Run Prettier
This commit is contained in:
@@ -5,7 +5,7 @@ import { Tasks } from './tasks';
|
||||
export const Application = () => {
|
||||
return (
|
||||
<TaskProvider>
|
||||
<main className="container max-w-xl my-10 space-y-8">
|
||||
<main className="container my-10 max-w-xl space-y-8">
|
||||
<CreateTask onSubmit={(title) => console.log(title)} />
|
||||
<Tasks />
|
||||
</main>
|
||||
|
||||
@@ -16,8 +16,8 @@ export const DateTime = ({
|
||||
}) => {
|
||||
if (typeof date === 'string') date = new Date(date);
|
||||
return (
|
||||
<div className={merge('overflow-x-hidden space-x-2 text-xs', className)}>
|
||||
<span className="font-semibold after:content-[':'] after:text-slate-700 text-primary-800 dark:text-primary-200 dark:after:text-slate-300">
|
||||
<div className={merge('space-x-2 overflow-x-hidden text-xs', className)}>
|
||||
<span className="text-primary-800 dark:text-primary-200 font-semibold after:text-slate-700 after:content-[':'] dark:after:text-slate-300">
|
||||
{title}
|
||||
</span>
|
||||
<span className="whitespace-pre">{formatDate.format(date)}</span>
|
||||
|
||||
@@ -11,7 +11,7 @@ export const Task = memo(({ task }: TaskProps) => {
|
||||
const { updateTask, removeTask } = useTaskActions();
|
||||
|
||||
return (
|
||||
<li className="block p-4 space-y-2 border-t first:rounded-t-md border-x last:border-b last:rounded-b-md dark:border-slate-700 border-slate-300">
|
||||
<li className="block space-y-2 border-x border-t border-slate-300 p-4 first:rounded-t-md last:rounded-b-md last:border-b dark:border-slate-700">
|
||||
<header className="flex flex-row items-center gap-4">
|
||||
<label htmlFor={`toggle-${task.id}`} className="sr-only">
|
||||
Mark Task as {task.completed ? 'Incomplete' : 'Complete'}
|
||||
@@ -19,7 +19,7 @@ export const Task = memo(({ task }: TaskProps) => {
|
||||
<input
|
||||
id={`toggle-${task.id}`}
|
||||
type="checkbox"
|
||||
className="block w-6 h-6"
|
||||
className="block h-6 w-6"
|
||||
checked={task.completed}
|
||||
onChange={() => updateTask(task.id, { completed: !task.completed })}
|
||||
/>
|
||||
@@ -31,11 +31,11 @@ export const Task = memo(({ task }: TaskProps) => {
|
||||
❌
|
||||
</button>
|
||||
</header>
|
||||
<label className="text-xs grid grid-cols-[1.25rem_1fr] gap-1 cursor-pointer rounded-md bg-primary-50 dark:bg-slate-800 border-2 border-primary-100 dark:border-slate-900 p-2">
|
||||
<input type="checkbox" className="sr-only peer" />
|
||||
<ChevronRightCircle className="block w-4 h-4 transition-transform peer-checked:rotate-90" />
|
||||
<label className="bg-primary-50 border-primary-100 grid cursor-pointer grid-cols-[1.25rem_1fr] gap-1 rounded-md border-2 p-2 text-xs dark:border-slate-900 dark:bg-slate-800">
|
||||
<input type="checkbox" className="peer sr-only" />
|
||||
<ChevronRightCircle className="block h-4 w-4 transition-transform peer-checked:rotate-90" />
|
||||
<h3 className="select-none">Metadata</h3>
|
||||
<div className="hidden col-span-2 gap-2 peer-checked:flex">
|
||||
<div className="col-span-2 hidden gap-2 peer-checked:flex">
|
||||
<DateTime date={task.createdAt} title="Created" />
|
||||
<DateTime date={task.lastModified} title="Modified" />
|
||||
</div>
|
||||
|
||||
@@ -14,21 +14,21 @@
|
||||
input[type='text'],
|
||||
input[type='email'],
|
||||
input[type='password'] {
|
||||
@apply text-sm sm:text-base block w-full rounded-md border-0 py-1.5 px-2.5 shadow-sm ring-1 ring-inset ring-primary-600 placeholder:text-primary-600 sm:text-sm sm:leading-6 dark:bg-slate-800 dark:text-slate-50 dark:placeholder:text-slate-400;
|
||||
@apply focus:ring-2 focus:outline-none;
|
||||
@apply ring-primary-600 placeholder:text-primary-600 block w-full rounded-md border-0 px-2.5 py-1.5 text-sm shadow-sm ring-1 ring-inset sm:text-base sm:text-sm sm:leading-6 dark:bg-slate-800 dark:text-slate-50 dark:placeholder:text-slate-400;
|
||||
@apply focus:outline-none focus:ring-2;
|
||||
&:has(+ button[type='submit']) {
|
||||
@apply block w-full rounded-r-none;
|
||||
}
|
||||
}
|
||||
|
||||
input[type='checkbox'] {
|
||||
@apply h-4 w-4 rounded border-primary-500 accent-primary-600 dark:bg-slate-800 dark:border-slate-700 dark:accent-primary-600;
|
||||
@apply border-primary-500 accent-primary-600 dark:accent-primary-600 h-4 w-4 rounded dark:border-slate-700 dark:bg-slate-800;
|
||||
}
|
||||
|
||||
button {
|
||||
@apply button;
|
||||
input + & {
|
||||
@apply rounded-l-none -ml-px;
|
||||
@apply -ml-px rounded-l-none;
|
||||
}
|
||||
&[type='submit'] {
|
||||
@apply button-primary;
|
||||
@@ -38,19 +38,19 @@
|
||||
|
||||
@layer components {
|
||||
.button {
|
||||
@apply relative inline-flex items-center justify-center gap-x-1.5 rounded-md px-3 py-2 text-sm font-semibold text-slate-900 ring-1 ring-inset ring-primary-300 hover:bg-slate-50 whitespace-pre disabled:cursor-not-allowed text-sm sm:text-base;
|
||||
@apply ring-primary-300 relative inline-flex items-center justify-center gap-x-1.5 whitespace-pre rounded-md px-3 py-2 text-sm font-semibold text-slate-900 ring-1 ring-inset hover:bg-slate-50 disabled:cursor-not-allowed sm:text-base;
|
||||
}
|
||||
|
||||
.button-primary {
|
||||
@apply bg-primary-600 text-white cursor-pointer ring-primary-600 transition duration-100 ease-in-out hover:bg-primary-700 active:bg-primary-800 disabled:bg-primary-600/50 disabled:hover:bg-primary-600/50 disabled:active:bg-primary-600/50 disabled:cursor-not-allowed;
|
||||
@apply bg-primary-600 ring-primary-600 hover:bg-primary-700 active:bg-primary-800 disabled:bg-primary-600/50 disabled:hover:bg-primary-600/50 disabled:active:bg-primary-600/50 cursor-pointer text-white transition duration-100 ease-in-out disabled:cursor-not-allowed;
|
||||
}
|
||||
|
||||
.button-small {
|
||||
@apply py-1 px-1.5 text-xs;
|
||||
@apply px-1.5 py-1 text-xs;
|
||||
}
|
||||
|
||||
.button-destructive {
|
||||
@apply bg-red-600 text-white cursor-pointer ring-0 transition duration-100 ease-in-out hover:bg-red-700 active:bg-red-800 disabled:bg-red-600/50 disabled:hover:bg-red-600/50 disabled:active:bg-red-600/50 disabled:cursor-not-allowed disabled:ring-red-700/20;
|
||||
@apply cursor-pointer bg-red-600 text-white ring-0 transition duration-100 ease-in-out hover:bg-red-700 active:bg-red-800 disabled:cursor-not-allowed disabled:bg-red-600/50 disabled:ring-red-700/20 disabled:hover:bg-red-600/50 disabled:active:bg-red-600/50;
|
||||
&.button-ghost {
|
||||
@apply bg-transparent text-red-600 ring-red-600 hover:bg-red-600/10 active:bg-red-600/20 dark:hover:bg-red-400/30 dark:active:bg-red-400/40;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user