asheeui 0.6.14 → 0.7.0
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/README.md +1 -14
- package/dist/AsheeUIProvider.js +22 -24
- package/dist/components/accordion/Accordion.js +79 -173
- package/dist/components/accordion/accordion-config.js +12 -13
- package/dist/components/accordion/accordion-styles.js +21 -24
- package/dist/components/autocomplete/Autocomplete.js +78 -136
- package/dist/components/autocomplete/autocomplete-config.js +7 -12
- package/dist/components/button/Button.d.ts +29 -1
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +47 -108
- package/dist/components/button/button-config.js +16 -17
- package/dist/components/button/button-styles.js +10 -11
- package/dist/components/card/Card.d.ts +36 -16
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +115 -205
- package/dist/components/card/card-config.js +24 -21
- package/dist/components/card/card-styles.js +19 -22
- package/dist/components/carousel/Carousel.js +123 -248
- package/dist/components/carousel/carousel-config.js +24 -25
- package/dist/components/carousel/carousel-styles.js +14 -16
- package/dist/components/chip/Chip.js +84 -191
- package/dist/components/chip/chip-config.js +13 -14
- package/dist/components/chip/chip-styles.js +22 -26
- package/dist/components/date-picker/Calendar.d.ts +3 -3
- package/dist/components/date-picker/Calendar.d.ts.map +1 -1
- package/dist/components/date-picker/Calendar.js +141 -222
- package/dist/components/date-picker/DatePicker.d.ts +5 -5
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +122 -220
- package/dist/components/date-picker/TimeSpinner.js +58 -82
- package/dist/components/date-picker/date-picker-config.d.ts +4 -4
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-config.js +10 -11
- package/dist/components/date-picker/date-picker-styles.js +44 -45
- package/dist/components/date-picker/date-picker.helpers.d.ts +4 -4
- package/dist/components/date-picker/date-picker.helpers.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.helpers.js +74 -102
- package/dist/components/drawer/Drawer.d.ts +26 -8
- package/dist/components/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.js +54 -131
- package/dist/components/drawer/drawer-config.js +14 -15
- package/dist/components/drawer/drawer-styles.js +38 -42
- package/dist/components/field/FieldShell.js +49 -56
- package/dist/components/field/field-config.js +17 -18
- package/dist/components/field/field-styles.js +8 -8
- package/dist/components/image/Image.d.ts +7 -7
- package/dist/components/image/Image.d.ts.map +1 -1
- package/dist/components/image/Image.js +65 -132
- package/dist/components/image/image-config.js +17 -18
- package/dist/components/image/image-styles.js +14 -15
- package/dist/components/input/Input.js +65 -150
- package/dist/components/input/PasswordInput.js +30 -49
- package/dist/components/input/input-config.js +7 -7
- package/dist/components/input/input-styles.js +9 -10
- package/dist/components/keyboard/KeyboardContext.js +10 -11
- package/dist/components/keyboard/KeyboardProvider.js +100 -181
- package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
- package/dist/components/keyboard/OnScreenKeyboard.js +159 -166
- package/dist/components/keyboard/keyboard-config.js +59 -57
- package/dist/components/keyboard/keyboard-styles.js +10 -11
- package/dist/components/keyboard/use-keyboard-field.js +29 -21
- package/dist/components/link/Link.js +47 -137
- package/dist/components/link/link-config.js +14 -15
- package/dist/components/link/link-styles.js +25 -29
- package/dist/components/marquee/Marquee.js +55 -144
- package/dist/components/marquee/marquee-config.js +18 -19
- package/dist/components/marquee/marquee-styles.js +13 -15
- package/dist/components/modal/Modal.d.ts +26 -10
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +56 -136
- package/dist/components/modal/modal-config.js +15 -16
- package/dist/components/modal/modal-styles.js +13 -14
- package/dist/components/multi-select/MultiSelect.d.ts +18 -2
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +149 -283
- package/dist/components/multi-select/multi-select-config.d.ts +23 -18
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +18 -21
- package/dist/components/multi-select/multi-select-styles.js +17 -20
- package/dist/components/radio/Radio.js +43 -80
- package/dist/components/radio/RadioGroup.js +57 -155
- package/dist/components/radio/radio-config.js +15 -16
- package/dist/components/radio/radio-context.js +6 -6
- package/dist/components/radio/radio-styles.js +55 -60
- package/dist/components/resizable-screen/ResizableScreen.js +87 -177
- package/dist/components/resizable-screen/resizable-screen-config.js +16 -17
- package/dist/components/select/Select.d.ts +3 -2
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +97 -195
- package/dist/components/select/select-config.js +8 -9
- package/dist/components/select/select-styles.js +5 -5
- package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/components/select-menu/SelectMenu.js +102 -196
- package/dist/components/select-menu/select-menu-config.js +12 -12
- package/dist/components/select-menu/use-select-floating.d.ts +11 -1
- package/dist/components/select-menu/use-select-floating.d.ts.map +1 -1
- package/dist/components/select-menu/use-select-floating.js +41 -48
- package/dist/components/sidebar/Sidebar.d.ts +43 -22
- package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/sidebar/Sidebar.js +146 -331
- package/dist/components/sidebar/sidebar-config.d.ts +98 -31
- package/dist/components/sidebar/sidebar-config.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-config.js +47 -33
- package/dist/components/sidebar/sidebar-styles.js +27 -32
- package/dist/components/spinner/spinner-config.js +12 -13
- package/dist/components/spinner/spinner-styles.js +13 -14
- package/dist/components/spinner/spinner.js +39 -82
- package/dist/components/switch/Switch.js +62 -154
- package/dist/components/switch/switch-config.js +11 -12
- package/dist/components/switch/switch-styles.js +14 -16
- package/dist/components/table/Table.js +64 -186
- package/dist/components/table/table-config.js +17 -18
- package/dist/components/table/table-styles.js +48 -52
- package/dist/components/tabs/Tabs.d.ts +16 -8
- package/dist/components/tabs/Tabs.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.js +93 -208
- package/dist/components/tabs/tabs-config.d.ts +42 -20
- package/dist/components/tabs/tabs-config.d.ts.map +1 -1
- package/dist/components/tabs/tabs-config.js +26 -18
- package/dist/components/tabs/tabs-styles.js +15 -17
- package/dist/components/textarea/Textarea.js +52 -138
- package/dist/components/textarea/textarea-config.js +10 -11
- package/dist/components/textarea/textarea-styles.js +9 -10
- package/dist/components/toast/ToastContext.js +22 -26
- package/dist/components/toast/ToastItem.js +82 -144
- package/dist/components/toast/ToastProvider.d.ts.map +1 -1
- package/dist/components/toast/ToastProvider.js +128 -190
- package/dist/components/toast/toast-config.js +23 -24
- package/dist/components/toast/toast-styles.js +50 -55
- package/dist/components/toast/use-pausable-timeout.js +17 -13
- package/dist/components/tooltip/Tooltip.d.ts +5 -0
- package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.js +68 -158
- package/dist/components/tooltip/tooltip-config.d.ts +25 -0
- package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip-config.js +26 -22
- package/dist/components/tooltip/tooltip-styles.js +15 -17
- package/dist/config/default-config.js +11 -34
- package/dist/config/resolve-color.js +23 -23
- package/dist/config/resolve-config.d.ts.map +1 -1
- package/dist/config/resolve-config.js +14 -12
- package/dist/icons/ArrowLeftIcon.js +16 -19
- package/dist/icons/CalendarIcon.js +43 -24
- package/dist/icons/CheckIcon.js +16 -19
- package/dist/icons/ChevronDownIcon.js +15 -21
- package/dist/icons/ChevronLeftIcon.js +16 -19
- package/dist/icons/ChevronRightIcon.js +16 -19
- package/dist/icons/ChevronUpIcon.js +16 -19
- package/dist/icons/ClearIcon.js +26 -22
- package/dist/icons/ClockIcon.js +20 -22
- package/dist/icons/CloseIcon.js +26 -22
- package/dist/icons/ErrorIcon.js +16 -19
- package/dist/icons/ExternalLinkIcon.js +25 -23
- package/dist/icons/EyeIcon.js +20 -22
- package/dist/icons/EyeOffIcon.js +21 -22
- package/dist/icons/InfoIcon.js +16 -19
- package/dist/icons/SearchIcon.js +25 -22
- package/dist/icons/WarningIcon.js +16 -19
- package/dist/index.js +65 -163
- package/dist/libs/context.js +10 -13
- package/dist/libs/index.js +1 -0
- package/dist/libs/registry.js +10 -12
- package/dist/libs/use-floating-z-index.d.ts +32 -0
- package/dist/libs/use-floating-z-index.d.ts.map +1 -0
- package/dist/libs/use-floating-z-index.js +16 -0
- package/dist/libs/use-isomorphic-layout-effect.js +5 -5
- package/dist/scripts/AsheeThemeScript.js +35 -44
- package/dist/shared/radius.d.ts.map +1 -1
- package/dist/shared/radius.js +12 -13
- package/dist/shared/variant.js +46 -134
- package/dist/theme/color.js +28 -28
- package/dist/theme/controller.d.ts.map +1 -1
- package/dist/theme/controller.js +65 -178
- package/dist/theme/useTheme.js +13 -44
- package/dist/utils/cn.js +7 -7
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/merge-object.js +13 -14
- package/dist/utils/resolve-token.js +11 -14
- package/dist/utils/stacking.d.ts +76 -0
- package/dist/utils/stacking.d.ts.map +1 -0
- package/dist/utils/stacking.js +34 -0
- package/package.json +12 -11
|
@@ -1,35 +1,49 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { registerComponentDefaults as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
//#region src/components/sidebar/sidebar-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
size: "md",
|
|
6
|
+
animated: !0,
|
|
7
|
+
defaultCollapsed: !1,
|
|
8
|
+
collapsible: !0,
|
|
9
|
+
showCollapseButton: !0,
|
|
10
|
+
options: {
|
|
11
|
+
inactive: { variant: "ghost" },
|
|
12
|
+
active: {
|
|
13
|
+
variant: "solid",
|
|
14
|
+
color: "primary"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
tooltip: {
|
|
18
|
+
show: !0,
|
|
19
|
+
placement: "right"
|
|
20
|
+
}
|
|
21
|
+
}, n = {
|
|
22
|
+
size: "md",
|
|
23
|
+
variant: "default",
|
|
24
|
+
radius: "none",
|
|
25
|
+
options: {
|
|
26
|
+
radius: "md",
|
|
27
|
+
active: {
|
|
28
|
+
variant: "solid",
|
|
29
|
+
color: "primary"
|
|
30
|
+
},
|
|
31
|
+
inactive: {
|
|
32
|
+
variant: "ghost",
|
|
33
|
+
color: "none"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
tooltip: {
|
|
37
|
+
show: !0,
|
|
38
|
+
placement: "right",
|
|
39
|
+
variant: "solid",
|
|
40
|
+
color: "secondary"
|
|
41
|
+
},
|
|
42
|
+
animated: !0,
|
|
43
|
+
defaultCollapsed: !1,
|
|
44
|
+
collapsible: !0,
|
|
45
|
+
showCollapseButton: !0
|
|
35
46
|
};
|
|
47
|
+
e("sidebar", t);
|
|
48
|
+
//#endregion
|
|
49
|
+
export { n as FALLBACK_SIDEBAR_CONFIG, t as defaultSidebarConfig };
|
|
@@ -1,35 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
sm: "w-16",
|
|
8
|
-
md: "w-18",
|
|
9
|
-
lg: "w-20"
|
|
10
|
-
}, d = {
|
|
11
|
-
sm: "h-12 text-xs px-2.5",
|
|
12
|
-
md: "h-14 text-sm px-3",
|
|
13
|
-
lg: "h-16 text-base px-4"
|
|
14
|
-
}, b = {
|
|
15
|
-
sm: "text-[10px] px-2 py-1.5",
|
|
16
|
-
md: "text-xs px-3 py-2",
|
|
17
|
-
lg: "text-sm px-4 py-2.5"
|
|
18
|
-
}, e = {
|
|
19
|
-
sm: "h-9 text-xs px-2",
|
|
20
|
-
md: "h-11 text-sm px-3",
|
|
21
|
-
lg: "h-13 text-base px-4"
|
|
2
|
+
//#region src/components/sidebar/sidebar-styles.ts
|
|
3
|
+
var e = {
|
|
4
|
+
sm: "w-56",
|
|
5
|
+
md: "w-64",
|
|
6
|
+
lg: "w-72"
|
|
22
7
|
}, t = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
8
|
+
sm: "w-16",
|
|
9
|
+
md: "w-18",
|
|
10
|
+
lg: "w-20"
|
|
11
|
+
}, n = {
|
|
12
|
+
sm: "h-12 text-xs px-2.5",
|
|
13
|
+
md: "h-14 text-sm px-3",
|
|
14
|
+
lg: "h-16 text-base px-4"
|
|
15
|
+
}, r = {
|
|
16
|
+
sm: "text-[10px] px-2 py-1.5",
|
|
17
|
+
md: "text-xs px-3 py-2",
|
|
18
|
+
lg: "text-sm px-4 py-2.5"
|
|
19
|
+
}, i = {
|
|
20
|
+
sm: "h-9 text-xs px-2",
|
|
21
|
+
md: "h-11 text-sm px-3",
|
|
22
|
+
lg: "h-13 text-base px-4"
|
|
23
|
+
}, a = {
|
|
24
|
+
default: "border-r border-border bg-background/80 backdrop-blur-xs",
|
|
25
|
+
bordered: "border-r-2 border-border bg-background/80 backdrop-blur-xs",
|
|
26
|
+
floating: "m-2 rounded-xl border border-border shadow-md bg-background/80 backdrop-blur-xs",
|
|
27
|
+
ghost: "border-none bg-background/80 backdrop-blur-xs"
|
|
35
28
|
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { t as SIDEBAR_COLLAPSED_WIDTH_CLASS, e as SIDEBAR_EXPANDED_WIDTH_CLASS, n as SIDEBAR_HEADER_CLASS, i as SIDEBAR_ITEM_CLASS, r as SIDEBAR_SECTION_LABEL_CLASS, a as SIDEBAR_VARIANT_CLASS };
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
e("spinner", s);
|
|
13
|
-
export {
|
|
14
|
-
o as FALLBACK_SPINNER_CONFIG,
|
|
15
|
-
s as defaultSpinnerConfig
|
|
3
|
+
//#region src/components/spinner/spinner-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
size: "md",
|
|
6
|
+
speed: "0.75s"
|
|
7
|
+
}, n = {
|
|
8
|
+
size: "md",
|
|
9
|
+
color: "primary",
|
|
10
|
+
speed: "0.75s",
|
|
11
|
+
className: ""
|
|
16
12
|
};
|
|
13
|
+
e("spinner", t);
|
|
14
|
+
//#endregion
|
|
15
|
+
export { n as FALLBACK_SPINNER_CONFIG, t as defaultSpinnerConfig };
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
//#region src/components/spinner/spinner-styles.ts
|
|
3
|
+
var e = {
|
|
4
|
+
sm: "w-3.5 h-3.5",
|
|
5
|
+
md: "w-4 h-4",
|
|
6
|
+
lg: "w-5 h-5"
|
|
6
7
|
}, t = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
t as SPINNER_COLOR_CLASS,
|
|
16
|
-
e as SPINNER_SIZE_CLASS
|
|
8
|
+
none: "text-background",
|
|
9
|
+
primary: "text-primary",
|
|
10
|
+
secondary: "text-secondary",
|
|
11
|
+
danger: "text-danger",
|
|
12
|
+
warning: "text-warning",
|
|
13
|
+
success: "text-success"
|
|
17
14
|
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { t as SPINNER_COLOR_CLASS, e as SPINNER_SIZE_CLASS };
|
|
@@ -1,83 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import { useAsheeConfig as
|
|
5
|
-
import { resolveCascade as
|
|
6
|
-
import { FALLBACK_SPINNER_CONFIG as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
className: A(
|
|
42
|
-
"animate-spin shrink-0",
|
|
43
|
-
y,
|
|
44
|
-
C,
|
|
45
|
-
e == null ? void 0 : e.className,
|
|
46
|
-
p
|
|
47
|
-
),
|
|
48
|
-
style: {
|
|
49
|
-
animationDuration: u,
|
|
50
|
-
...n
|
|
51
|
-
},
|
|
52
|
-
viewBox: "0 0 24 24",
|
|
53
|
-
fill: "none",
|
|
54
|
-
...d,
|
|
55
|
-
children: [
|
|
56
|
-
/* @__PURE__ */ a(
|
|
57
|
-
"circle",
|
|
58
|
-
{
|
|
59
|
-
className: "opacity-25",
|
|
60
|
-
cx: "12",
|
|
61
|
-
cy: "12",
|
|
62
|
-
r: "10",
|
|
63
|
-
stroke: "currentColor",
|
|
64
|
-
strokeWidth: "4"
|
|
65
|
-
}
|
|
66
|
-
),
|
|
67
|
-
/* @__PURE__ */ a(
|
|
68
|
-
"path",
|
|
69
|
-
{
|
|
70
|
-
className: "opacity-75",
|
|
71
|
-
fill: "currentColor",
|
|
72
|
-
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
|
|
73
|
-
}
|
|
74
|
-
)
|
|
75
|
-
]
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
);
|
|
80
|
-
I.displayName = "Spinner";
|
|
81
|
-
export {
|
|
82
|
-
I as Spinner
|
|
83
|
-
};
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { useAsheeConfig as t } from "../../libs/context.js";
|
|
5
|
+
import { resolveCascade as n, resolveClassKey as r } from "../../utils/resolve-token.js";
|
|
6
|
+
import { FALLBACK_SPINNER_CONFIG as i } from "./spinner-config.js";
|
|
7
|
+
import { SPINNER_COLOR_CLASS as a, SPINNER_SIZE_CLASS as o } from "./spinner-styles.js";
|
|
8
|
+
import { forwardRef as s } from "react";
|
|
9
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/spinner/spinner.tsx
|
|
11
|
+
var u = s(({ size: s, color: u, speed: d, className: f, style: p, ...m }, h) => {
|
|
12
|
+
let g = t(), _ = g.components?.spinner, v = n(s, _?.size, void 0, i.size), y = n(u, _?.color, g.defaultColor, i.color), b = n(d, _?.speed, void 0, i.speed), x = r(v, o, i.size), S = r(y, a, i.color);
|
|
13
|
+
return /* @__PURE__ */ l("svg", {
|
|
14
|
+
ref: h,
|
|
15
|
+
"aria-hidden": "true",
|
|
16
|
+
className: e("animate-spin shrink-0", x, S, _?.className, f),
|
|
17
|
+
style: {
|
|
18
|
+
animationDuration: b,
|
|
19
|
+
...p
|
|
20
|
+
},
|
|
21
|
+
viewBox: "0 0 24 24",
|
|
22
|
+
fill: "none",
|
|
23
|
+
...m,
|
|
24
|
+
children: [/* @__PURE__ */ c("circle", {
|
|
25
|
+
className: "opacity-25",
|
|
26
|
+
cx: "12",
|
|
27
|
+
cy: "12",
|
|
28
|
+
r: "10",
|
|
29
|
+
stroke: "currentColor",
|
|
30
|
+
strokeWidth: "4"
|
|
31
|
+
}), /* @__PURE__ */ c("path", {
|
|
32
|
+
className: "opacity-75",
|
|
33
|
+
fill: "currentColor",
|
|
34
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
u.displayName = "Spinner";
|
|
39
|
+
//#endregion
|
|
40
|
+
export { u as Spinner };
|
|
@@ -1,155 +1,63 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import { useAsheeConfig as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
), h = l(
|
|
65
|
-
U,
|
|
66
|
-
ee,
|
|
67
|
-
s.radius
|
|
68
|
-
), D = se("solid", F), i = N || n, M = J(
|
|
69
|
-
(f) => {
|
|
70
|
-
if (i) return;
|
|
71
|
-
const v = f.target.checked;
|
|
72
|
-
c === void 0 && g(v), o == null || o(v, f);
|
|
73
|
-
},
|
|
74
|
-
[c, i, o]
|
|
75
|
-
);
|
|
76
|
-
return /* @__PURE__ */ r(
|
|
77
|
-
X,
|
|
78
|
-
{
|
|
79
|
-
id: d,
|
|
80
|
-
label: y,
|
|
81
|
-
labelAlign: W,
|
|
82
|
-
description: _,
|
|
83
|
-
required: p,
|
|
84
|
-
isLoading: n,
|
|
85
|
-
children: /* @__PURE__ */ r(
|
|
86
|
-
"label",
|
|
87
|
-
{
|
|
88
|
-
htmlFor: d,
|
|
89
|
-
className: a(
|
|
90
|
-
"inline-flex items-center gap-3 select-none cursor-pointer shrink-0",
|
|
91
|
-
i && "opacity-50 pointer-events-none cursor-not-allowed"
|
|
92
|
-
),
|
|
93
|
-
children: /* @__PURE__ */ Z(
|
|
94
|
-
"div",
|
|
95
|
-
{
|
|
96
|
-
className: a(
|
|
97
|
-
"relative shrink-0 inline-flex items-center",
|
|
98
|
-
B
|
|
99
|
-
),
|
|
100
|
-
children: [
|
|
101
|
-
/* @__PURE__ */ r(
|
|
102
|
-
"input",
|
|
103
|
-
{
|
|
104
|
-
ref: H,
|
|
105
|
-
id: d,
|
|
106
|
-
type: "checkbox",
|
|
107
|
-
role: "switch",
|
|
108
|
-
checked: t,
|
|
109
|
-
disabled: i,
|
|
110
|
-
required: p,
|
|
111
|
-
"aria-checked": t,
|
|
112
|
-
"aria-busy": n,
|
|
113
|
-
onChange: M,
|
|
114
|
-
className: "sr-only peer",
|
|
115
|
-
...K
|
|
116
|
-
}
|
|
117
|
-
),
|
|
118
|
-
/* @__PURE__ */ r(
|
|
119
|
-
"div",
|
|
120
|
-
{
|
|
121
|
-
className: a(
|
|
122
|
-
"absolute inset-0 border border-border/60 transition-colors duration-200 shrink-0",
|
|
123
|
-
"peer-focus-visible:ring-2 peer-focus-visible:ring-primary peer-focus-visible:ring-offset-2",
|
|
124
|
-
h,
|
|
125
|
-
t ? D : "bg-secondary",
|
|
126
|
-
T
|
|
127
|
-
),
|
|
128
|
-
style: x
|
|
129
|
-
}
|
|
130
|
-
),
|
|
131
|
-
/* @__PURE__ */ r(
|
|
132
|
-
"span",
|
|
133
|
-
{
|
|
134
|
-
className: a(
|
|
135
|
-
"relative z-10 bg-background shadow-sm pointer-events-none shrink-0",
|
|
136
|
-
"transition-transform duration-200 ease-in-out transform-gpu",
|
|
137
|
-
h,
|
|
138
|
-
E,
|
|
139
|
-
t ? j : "translate-x-0"
|
|
140
|
-
)
|
|
141
|
-
}
|
|
142
|
-
)
|
|
143
|
-
]
|
|
144
|
-
}
|
|
145
|
-
)
|
|
146
|
-
}
|
|
147
|
-
)
|
|
148
|
-
}
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
);
|
|
152
|
-
re.displayName = "Switch";
|
|
153
|
-
export {
|
|
154
|
-
re as Switch
|
|
155
|
-
};
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { useAsheeConfig as t } from "../../libs/context.js";
|
|
5
|
+
import { RADIUS_CLASS as n } from "../../shared/radius.js";
|
|
6
|
+
import { resolveVariantClass as r } from "../../shared/variant.js";
|
|
7
|
+
import { resolveCascade as i, resolveClassKey as a, resolveRadiusKey as o } from "../../utils/resolve-token.js";
|
|
8
|
+
import { FieldShell as s } from "../field/FieldShell.js";
|
|
9
|
+
import { FALLBACK_SWITCH_CONFIG as c } from "./switch-config.js";
|
|
10
|
+
import { SWITCH_THUMB_SIZE_CLASS as l, SWITCH_THUMB_TRANSLATE_CLASS as u, SWITCH_TRACK_SIZE_CLASS as d } from "./switch-styles.js";
|
|
11
|
+
import { forwardRef as f, useCallback as p, useId as m, useState as h } from "react";
|
|
12
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
13
|
+
//#region src/components/switch/Switch.tsx
|
|
14
|
+
var v = f(({ size: f, color: v, radius: y, label: b, labelAlign: x, description: S, required: C, isLoading: w, id: T, className: E, style: D, disabled: O, checked: k, defaultChecked: A = !1, onChange: j, ...M }, N) => {
|
|
15
|
+
let P = t(), F = P.components?.switch, I = m(), L = T ?? I, [R, z] = h(A), B = k ?? R, V = i(f, F?.size, void 0, c.size), H = i(v, F?.color, P.defaultColor, c.color), U = o(y, F?.radius, void 0, c.radius), W = i(x, F?.labelAlign, void 0, c.labelAlign), G = a(V, d, c.size), K = a(V, l, c.size), q = a(V, u, c.size), J = a(U, n, c.radius), Y = r("solid", H), X = O || w, Z = p((e) => {
|
|
16
|
+
if (X) return;
|
|
17
|
+
let t = e.target.checked;
|
|
18
|
+
k === void 0 && z(t), j?.(t, e);
|
|
19
|
+
}, [
|
|
20
|
+
k,
|
|
21
|
+
X,
|
|
22
|
+
j
|
|
23
|
+
]);
|
|
24
|
+
return /* @__PURE__ */ g(s, {
|
|
25
|
+
id: L,
|
|
26
|
+
label: b,
|
|
27
|
+
labelAlign: W,
|
|
28
|
+
description: S,
|
|
29
|
+
required: C,
|
|
30
|
+
isLoading: w,
|
|
31
|
+
children: /* @__PURE__ */ g("label", {
|
|
32
|
+
htmlFor: L,
|
|
33
|
+
className: e("inline-flex items-center gap-3 select-none cursor-pointer shrink-0", X && "opacity-50 pointer-events-none cursor-not-allowed"),
|
|
34
|
+
children: /* @__PURE__ */ _("div", {
|
|
35
|
+
className: e("relative shrink-0 inline-flex items-center", G),
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ g("input", {
|
|
38
|
+
ref: N,
|
|
39
|
+
id: L,
|
|
40
|
+
type: "checkbox",
|
|
41
|
+
role: "switch",
|
|
42
|
+
checked: B,
|
|
43
|
+
disabled: X,
|
|
44
|
+
required: C,
|
|
45
|
+
"aria-checked": B,
|
|
46
|
+
"aria-busy": w,
|
|
47
|
+
onChange: Z,
|
|
48
|
+
className: "sr-only peer",
|
|
49
|
+
...M
|
|
50
|
+
}),
|
|
51
|
+
/* @__PURE__ */ g("div", {
|
|
52
|
+
className: e("absolute inset-0 border border-border/60 transition-colors duration-200 shrink-0", "peer-focus-visible:ring-2 peer-focus-visible:ring-primary peer-focus-visible:ring-offset-2", J, B ? Y : "bg-secondary", E),
|
|
53
|
+
style: D
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ g("span", { className: e("relative z-10 bg-background shadow-sm pointer-events-none shrink-0", "transition-transform duration-200 ease-in-out transform-gpu", J, K, B ? q : "translate-x-0") })
|
|
56
|
+
]
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
v.displayName = "Switch";
|
|
62
|
+
//#endregion
|
|
63
|
+
export { v as Switch };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { registerComponentDefaults as
|
|
3
|
-
import { FALLBACK_FIELD_CONFIG as
|
|
4
|
-
import { defaultInputConfig as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
import { FALLBACK_FIELD_CONFIG as t } from "../field/field-config.js";
|
|
4
|
+
import { defaultInputConfig as n } from "../input/input-config.js";
|
|
5
|
+
//#region src/components/switch/switch-config.ts
|
|
6
|
+
var r = {
|
|
7
|
+
...n,
|
|
8
|
+
radius: "full"
|
|
9
|
+
}, i = t;
|
|
10
|
+
e("switch", r);
|
|
11
|
+
//#endregion
|
|
12
|
+
export { i as FALLBACK_SWITCH_CONFIG, r as defaultSwitchConfig };
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
sm: "size-3.5",
|
|
8
|
-
md: "size-5",
|
|
9
|
-
lg: "size-5.5"
|
|
2
|
+
//#region src/components/switch/switch-styles.ts
|
|
3
|
+
var e = {
|
|
4
|
+
sm: "w-8 h-4.5 p-0.5",
|
|
5
|
+
md: "w-11 h-6 p-0.5",
|
|
6
|
+
lg: "w-14 h-7.5 p-1"
|
|
10
7
|
}, t = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
s as SWITCH_TRACK_SIZE_CLASS
|
|
8
|
+
sm: "size-3.5",
|
|
9
|
+
md: "size-5",
|
|
10
|
+
lg: "size-5.5"
|
|
11
|
+
}, n = {
|
|
12
|
+
sm: "translate-x-3.5",
|
|
13
|
+
md: "translate-x-5",
|
|
14
|
+
lg: "translate-x-6"
|
|
19
15
|
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { t as SWITCH_THUMB_SIZE_CLASS, n as SWITCH_THUMB_TRANSLATE_CLASS, e as SWITCH_TRACK_SIZE_CLASS };
|