diff --git a/src/routes/radio-group/radio-group.svelte b/src/routes/radio-group/radio-group.svelte new file mode 100644 index 0000000..400c292 --- /dev/null +++ b/src/routes/radio-group/radio-group.svelte @@ -0,0 +1,100 @@ + + +
+ Link before + (active = event.detail)} + > +
+ +

Privacy setting

+
+ +
+ {#each access as { id, name, description }, i (id)} + + classNames( + // Rounded corners + i === 0 && "rounded-tl-md rounded-tr-md", + access.length - 1 === i && "rounded-bl-md rounded-br-md", + + // Shared + "relative border p-4 flex focus:outline-none", + active + ? "bg-indigo-50 border-indigo-200 z-10" + : "border-gray-200" + )} + let:active + let:checked + > +
+
+ + {name} + + + {description} + +
+
+ {#if checked} + + + + {/if} +
+
+
+ {/each} +
+
+
+ Link after +
diff --git a/src/routes/switch/switch-with-pure-tailwind.svelte b/src/routes/switch/switch-with-pure-tailwind.svelte new file mode 100644 index 0000000..6f85671 --- /dev/null +++ b/src/routes/switch/switch-with-pure-tailwind.svelte @@ -0,0 +1,34 @@ + + +
+ + Enable notifications + + (state = event.detail)} + class={({ checked }) => + classNames( + "relative inline-flex flex-shrink-0 h-6 border-2 border-transparent rounded-full cursor-pointer w-11 focus:outline-none focus:shadow-outline transition-colors ease-in-out duration-200", + checked ? "bg-indigo-600" : "bg-gray-200" + )} + let:checked + > + + + +
diff --git a/src/routes/tabs/tabs-with-pure-tailwind.svelte b/src/routes/tabs/tabs-with-pure-tailwind.svelte new file mode 100644 index 0000000..a21e063 --- /dev/null +++ b/src/routes/tabs/tabs-with-pure-tailwind.svelte @@ -0,0 +1,94 @@ + + +
+ + Manual keyboard activation + + (manual = event.detail)} + class={({ checked }) => + classNames( + "relative inline-flex flex-shrink-0 h-6 border-2 border-transparent rounded-full cursor-pointer w-11 focus:outline-none focus:shadow-outline transition-colors ease-in-out duration-200", + checked ? "bg-indigo-600" : "bg-gray-200" + )} + let:checked + > + + + + + + + {#each tabs as tab, tabIdx (tab.name)} + + classNames( + selected ? "text-gray-900" : "text-gray-500 hover:text-gray-700", + tabIdx === 0 ? "rounded-l-lg" : "", + tabIdx === tabs.length - 1 ? "rounded-r-lg" : "", + tab.disabled && "opacity-50", + "group relative min-w-0 flex-1 overflow-hidden bg-white py-4 px-4 text-sm font-medium text-center hover:bg-gray-50 focus:z-10" + )} + let:selected + > + {tab.name} + {#if tab.disabled} + (disabled) + + {/each} + + + + {#each tabs as tab (tab.name)} + + {tab.content} + + {/each} + + +
diff --git a/src/routes/transitions/component-examples/dropdown.svelte b/src/routes/transitions/component-examples/dropdown.svelte new file mode 100644 index 0000000..d8102b6 --- /dev/null +++ b/src/routes/transitions/component-examples/dropdown.svelte @@ -0,0 +1,90 @@ + + + + Transition Component - Playground + + +
+
+
+ + + +
+ + + + +
+
diff --git a/src/routes/transitions/component-examples/modal.svelte b/src/routes/transitions/component-examples/modal.svelte new file mode 100644 index 0000000..7651b93 --- /dev/null +++ b/src/routes/transitions/component-examples/modal.svelte @@ -0,0 +1,173 @@ + + +
+
+
+ + + +
+ + +
+ + { + addEvent("Before enter"); + }} + on:afterEnter={() => { + inputRef?.focus(); + addEvent("After enter"); + }} + on:beforeLeave={() => { + addEvent("Before leave (before confirm)"); + window.confirm("Are you sure?"); + addEvent("Before leave (after confirm)"); + }} + on:afterLeave={(event) => { + addEvent(`After leave (before alert)`); + window.alert("Consider it done!"); + addEvent(`After leave (after alert)`); + email = ""; + }} + > +
+ +
+
+
+ + +
+ +