File tree Expand file tree Collapse file tree 4 files changed +57
-35
lines changed
workbench/resources/views Expand file tree Collapse file tree 4 files changed +57
-35
lines changed Original file line number Diff line number Diff line change 11@layer components {
22 .el-switch {
3- @apply appearance-none w-10 cursor-pointer inline-block border-0 h-3
4- before:absolute before:top-0 before:inline-block before:rounded-xl before: outline-offset-2 before:w-10 before:h-full before:shadow-[inset_0_0_#000]
3+ @apply appearance-none cursor-pointer inline-block border-0 w-10 h-lh relative rounded-xl align-text-bottom
4+ before:absolute before:top-0 before:inline-block before:outline-offset-2 before:w-full before:h-full before:shadow-[inset_0_0_#000]
55 dark:before:bg-gray-600
6- after:absolute after:top-0 after:block after:rounded-xl after:w-5 after:h-[ calc ( 100 % -4 px )] after:mt-0.5 after:ml -0.5 after:shadow-md after:duration-100 after:bg-white
6+ after:absolute after:top-0 after:block after:w-1/2 after:m -0.5 after:shadow-md after:duration-100 after:bg-white
77 dark:after:bg-gray-50
8- checked:after:duration-300 checked:after:translate-x-4
8+ checked:after:duration-300
99 disabled:cursor-not-allowed disabled:opacity-50
1010 focus:ring-offset-transparent focus:ring-transparent focus-within:ring-0 focus:shadow-none focus:before:outline-2
1111 dark:border-0 dark:focus:ring-offset-transparent dark:focus:ring-transparent dark:focus-within:ring-0 dark:focus:shadow-none;
1212
13+ & ::before {
14+ border-radius : inherit;
15+ }
16+
17+ & ::after {
18+ border-radius : inherit;
19+ height : calc (100% - calc (var (--spacing )));
20+ }
21+
22+ & : checked ::after {
23+ transform : translateX (calc (100% - calc (var (--spacing ))));
24+ }
25+
26+ & .rounded ::after {
27+ @apply rounded-xs;
28+ }
29+
30+ & .rounded-md ::after {
31+ @apply rounded;
32+ }
33+
34+ & .rounded-lg ::after {
35+ @apply rounded-md;
36+ }
37+
1338 & [data-color = "white" ] {
1439 @apply before:bg-gray-300 checked:before:bg-white dark:before:bg-gray-600 dark:checked:before:bg-black;
1540 }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11@props ([
2- ' class' => null ,
3- ' style' => null ,
4- ' id' => null ,
2+ ' disabled' => false ,
3+ ' checked' => false ,
4+ ' required' => false ,
5+ ' color' => ' emerald' ,
56] )
67
7- <label @class ([' flex items-start gap-2 cursor-pointer' , $class ] ) @style ($style )
8- @if ($id ) for =" {{ $id } }" @endif >
9- <span class =" relative" >
10- <x-kit::switch .base :attributes =" $attributes" :id =" $id" />
11- </span >
12- {{ $slot } }
13- </label >
8+ <input {!! $attributes -> class ([' el-switch' ]) ! !} data-color =" {{ $color } }" type =" checkbox" @disabled ($disabled )
9+ @checked ($checked ) @required ($required )>
Original file line number Diff line number Diff line change @@ -355,16 +355,25 @@ class="rounded ring-1 ring-inset">
355355 <div class =" p-3" >
356356 <h1 class =" font-semibold" >Switch</h1 >
357357 </div >
358- <div class =" flex grow items-center justify-center border-b border-gray-200" >
359- <x-kit::switch >
360- Switch
361- </x-kit::switch >
362- <x-kit::switch class =" text-sm" >
363- Switch
364- </x-kit::switch >
365- <x-kit::switch >
366- Switch
367- </x-kit::switch >
358+ <div class =" flex grow flex-col items-center justify-center gap-3 border-b border-gray-200" >
359+ <div >
360+ <x-kit::switch class =" " checked />
361+ <x-kit::switch class =" " checked disabled />
362+ <x-kit::switch class =" " disabled />
363+ </div >
364+ <div >
365+ <x-kit::switch class =" rounded" />
366+ <x-kit::switch class =" rounded-md" />
367+ <x-kit::switch class =" rounded-lg" />
368+ <x-kit::switch class =" " />
369+
370+ </div >
371+ <div >
372+ <x-kit::switch class =" text-xs" />
373+ <x-kit::switch class =" text-sm" />
374+ <x-kit::switch class =" text-base" />
375+ <x-kit::switch class =" text-lg" />
376+ </div >
368377 </div >
369378 </div >
370379
@@ -373,9 +382,10 @@ class="rounded ring-1 ring-inset">
373382 <h1 class =" font-semibold" >Disabled Switch</h1 >
374383 </div >
375384 <div class =" flex grow items-center justify-center border-b border-gray-200" >
376- <x-kit::switch disabled checked >
385+ <label class =" " >
386+ <x-kit::switch checked class =" text-sm" />
377387 Switch
378- </x-kit::switch >
388+ </label >
379389 </div >
380390 </div >
381391
You can’t perform that action at this time.
0 commit comments