kosui 0.0.25 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/switch/switch.svelte +27 -29
- package/package.json +1 -1
|
@@ -52,44 +52,42 @@
|
|
|
52
52
|
role="switch"
|
|
53
53
|
aria-checked={checked}
|
|
54
54
|
class={twMerge(
|
|
55
|
-
"group relative inline-flex cursor-pointer transition-all focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
55
|
+
"group relative inline-flex cursor-pointer bg-m3-surface-container-highest transition-all focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
56
56
|
|
|
57
|
-
color === "primary" &&
|
|
58
|
-
|
|
59
|
-
color === "
|
|
60
|
-
|
|
57
|
+
color === "primary" &&
|
|
58
|
+
"focus-visible:outline-m3-primary aria-checked:bg-m3-primary",
|
|
59
|
+
color === "secondary" &&
|
|
60
|
+
"focus-visible:outline-m3-secondary aria-checked:bg-m3-secondary",
|
|
61
|
+
color === "tertiary" &&
|
|
62
|
+
"focus-visible:outline-m3-tertiary aria-checked:bg-m3-tertiary",
|
|
63
|
+
color === "error" &&
|
|
64
|
+
"focus-visible:outline-m3-error aria-checked:bg-m3-error",
|
|
65
|
+
|
|
66
|
+
size === "xs" && "h-4 w-8",
|
|
67
|
+
size === "sm" && "h-5 w-10",
|
|
68
|
+
size === "md" && "h-6 w-12",
|
|
69
|
+
size === "lg" && "h-7 w-14",
|
|
70
|
+
size === "xl" && "h-8 w-16",
|
|
71
|
+
|
|
72
|
+
radius === "xs" && "rounded-xs",
|
|
73
|
+
radius === "sm" && "rounded-sm",
|
|
74
|
+
radius === "md" && "rounded-lg",
|
|
75
|
+
radius === "lg" && "rounded-2xl",
|
|
76
|
+
radius === "xl" && "rounded-4xl",
|
|
61
77
|
|
|
62
78
|
className,
|
|
63
79
|
)}
|
|
64
80
|
{...mergeProps(restProps, { onclick: () => (checked = !checked) })}
|
|
65
81
|
>
|
|
66
|
-
<!-- Track -->
|
|
67
|
-
<div
|
|
68
|
-
class={twMerge(
|
|
69
|
-
"bg-m3-surface-container-highest transition-colors",
|
|
70
|
-
|
|
71
|
-
color === "primary" && "group-aria-checked:bg-m3-primary",
|
|
72
|
-
color === "secondary" && "group-aria-checked:bg-m3-secondary",
|
|
73
|
-
color === "tertiary" && "group-aria-checked:bg-m3-tertiary",
|
|
74
|
-
color === "error" && "group-aria-checked:bg-m3-error",
|
|
75
|
-
|
|
76
|
-
size === "xs" && "h-4 w-8",
|
|
77
|
-
size === "sm" && "h-5 w-10",
|
|
78
|
-
size === "md" && "h-6 w-12",
|
|
79
|
-
size === "lg" && "h-7 w-14",
|
|
80
|
-
size === "xl" && "h-8 w-16",
|
|
81
|
-
|
|
82
|
-
radius === "xs" && "rounded-xs",
|
|
83
|
-
radius === "sm" && "rounded-sm",
|
|
84
|
-
radius === "md" && "rounded-lg",
|
|
85
|
-
radius === "lg" && "rounded-2xl",
|
|
86
|
-
radius === "xl" && "rounded-4xl",
|
|
87
|
-
)}
|
|
88
|
-
></div>
|
|
89
82
|
<!-- Thumb -->
|
|
90
83
|
<div
|
|
91
84
|
class={twMerge(
|
|
92
|
-
"absolute top-0.5 left-0.5
|
|
85
|
+
"absolute top-0.5 left-0.5 shadow-sm transition-all",
|
|
86
|
+
|
|
87
|
+
color === "primary" && "bg-m3-on-primary",
|
|
88
|
+
color === "secondary" && "bg-m3-on-secondary",
|
|
89
|
+
color === "tertiary" && "bg-m3-on-tertiary",
|
|
90
|
+
color === "error" && "bg-m3-on-error",
|
|
93
91
|
|
|
94
92
|
size === "xs" && "size-3 group-aria-checked:translate-x-4",
|
|
95
93
|
size === "sm" && "size-4 group-aria-checked:translate-x-5",
|