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,81 +1,44 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import { useAsheeConfig as
|
|
5
|
-
import { resolveCascade as
|
|
6
|
-
import { FieldShell as
|
|
7
|
-
import { FALLBACK_RADIO_CONFIG as
|
|
8
|
-
import { RadioContext as
|
|
9
|
-
import {
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
required: R,
|
|
46
|
-
children: /* @__PURE__ */ e(
|
|
47
|
-
S.Provider,
|
|
48
|
-
{
|
|
49
|
-
value: {
|
|
50
|
-
name: I,
|
|
51
|
-
value: n,
|
|
52
|
-
onChange: m,
|
|
53
|
-
size: d,
|
|
54
|
-
color: c,
|
|
55
|
-
variant: p,
|
|
56
|
-
disabled: b,
|
|
57
|
-
status: l
|
|
58
|
-
},
|
|
59
|
-
children: /* @__PURE__ */ e(
|
|
60
|
-
"div",
|
|
61
|
-
{
|
|
62
|
-
ref: C,
|
|
63
|
-
role: "radiogroup",
|
|
64
|
-
className: _(
|
|
65
|
-
"flex",
|
|
66
|
-
f === "vertical" ? "flex-col gap-2" : "flex-row flex-wrap gap-4",
|
|
67
|
-
h
|
|
68
|
-
),
|
|
69
|
-
children: i
|
|
70
|
-
}
|
|
71
|
-
)
|
|
72
|
-
}
|
|
73
|
-
)
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
j.displayName = "RadioGroup";
|
|
79
|
-
export {
|
|
80
|
-
j as RadioGroup
|
|
81
|
-
};
|
|
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 } from "../../utils/resolve-token.js";
|
|
6
|
+
import { FieldShell as r } from "../field/FieldShell.js";
|
|
7
|
+
import { FALLBACK_RADIO_CONFIG as i } from "./radio-config.js";
|
|
8
|
+
import { RadioContext as a } from "./radio-context.js";
|
|
9
|
+
import { forwardRef as o, useId as s } from "react";
|
|
10
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
11
|
+
//#region src/components/radio/Radio.tsx
|
|
12
|
+
var l = o(({ children: o, name: l, value: u, onChange: d, size: f, color: p, variant: m, orientation: h = "vertical", status: g, label: _, labelAlign: v, description: y, message: b, required: x, disabled: S, className: C }, w) => {
|
|
13
|
+
let T = t().components?.radio, E = s(), D = l ?? E, O = g ?? i.status, k = n(v, T?.labelAlign, void 0, i.labelAlign);
|
|
14
|
+
return /* @__PURE__ */ c(r, {
|
|
15
|
+
id: E,
|
|
16
|
+
label: _,
|
|
17
|
+
labelAlign: k,
|
|
18
|
+
description: y,
|
|
19
|
+
message: b,
|
|
20
|
+
status: O,
|
|
21
|
+
required: x,
|
|
22
|
+
children: /* @__PURE__ */ c(a.Provider, {
|
|
23
|
+
value: {
|
|
24
|
+
name: D,
|
|
25
|
+
value: u,
|
|
26
|
+
onChange: d,
|
|
27
|
+
size: f,
|
|
28
|
+
color: p,
|
|
29
|
+
variant: m,
|
|
30
|
+
disabled: S,
|
|
31
|
+
status: O
|
|
32
|
+
},
|
|
33
|
+
children: /* @__PURE__ */ c("div", {
|
|
34
|
+
ref: w,
|
|
35
|
+
role: "radiogroup",
|
|
36
|
+
className: e("flex", h === "vertical" ? "flex-col gap-2" : "flex-row flex-wrap gap-4", C),
|
|
37
|
+
children: o
|
|
38
|
+
})
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
l.displayName = "RadioGroup";
|
|
43
|
+
//#endregion
|
|
44
|
+
export { l as RadioGroup };
|
|
@@ -1,156 +1,58 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import { useAsheeConfig as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
a.size
|
|
60
|
-
), Y = r(
|
|
61
|
-
c,
|
|
62
|
-
ms,
|
|
63
|
-
a.size
|
|
64
|
-
), g = r(
|
|
65
|
-
c,
|
|
66
|
-
fs,
|
|
67
|
-
a.size
|
|
68
|
-
), _ = r(
|
|
69
|
-
v,
|
|
70
|
-
h,
|
|
71
|
-
a.radius
|
|
72
|
-
), ss = r(
|
|
73
|
-
Q,
|
|
74
|
-
h,
|
|
75
|
-
"xl"
|
|
76
|
-
), m = N[J] ?? N.primary, p = O[M] ?? O.default, es = os(
|
|
77
|
-
(I) => {
|
|
78
|
-
var x;
|
|
79
|
-
l || (s ? (x = s.onChange) == null || x.call(s, t) : S === void 0 && q(!0), n == null || n(I.target.checked, t, I));
|
|
80
|
-
},
|
|
81
|
-
[S, s, l, n, t]
|
|
82
|
-
);
|
|
83
|
-
return /* @__PURE__ */ b(
|
|
84
|
-
"label",
|
|
85
|
-
{
|
|
86
|
-
className: i(
|
|
87
|
-
"relative inline-flex items-start select-none cursor-pointer transition-all duration-150 shrink-0",
|
|
88
|
-
g,
|
|
89
|
-
R ? i("p-3 border bg-background", ss) : "",
|
|
90
|
-
R && (d ? `${m.border} ${m.cardBg}` : p),
|
|
91
|
-
l && "opacity-50 pointer-events-none cursor-not-allowed",
|
|
92
|
-
B
|
|
93
|
-
),
|
|
94
|
-
style: T,
|
|
95
|
-
children: [
|
|
96
|
-
/* @__PURE__ */ o(
|
|
97
|
-
"input",
|
|
98
|
-
{
|
|
99
|
-
ref: G,
|
|
100
|
-
id: $,
|
|
101
|
-
type: "radio",
|
|
102
|
-
name: P,
|
|
103
|
-
value: t,
|
|
104
|
-
checked: d,
|
|
105
|
-
disabled: l,
|
|
106
|
-
onChange: es,
|
|
107
|
-
className: "sr-only peer",
|
|
108
|
-
...F
|
|
109
|
-
}
|
|
110
|
-
),
|
|
111
|
-
/* @__PURE__ */ o(
|
|
112
|
-
"div",
|
|
113
|
-
{
|
|
114
|
-
className: i(
|
|
115
|
-
"shrink-0 flex items-center justify-center border-2 transition-all duration-150 mt-0.5",
|
|
116
|
-
"peer-focus-visible:ring-2 peer-focus-visible:ring-primary peer-focus-visible:ring-offset-2",
|
|
117
|
-
W,
|
|
118
|
-
_,
|
|
119
|
-
d ? m.border : p
|
|
120
|
-
),
|
|
121
|
-
children: /* @__PURE__ */ o(
|
|
122
|
-
"span",
|
|
123
|
-
{
|
|
124
|
-
className: i(
|
|
125
|
-
X,
|
|
126
|
-
_,
|
|
127
|
-
m.bg,
|
|
128
|
-
"transition-all duration-200 ease-in-out transform-gpu",
|
|
129
|
-
d ? "scale-100 opacity-100" : "scale-0 opacity-0"
|
|
130
|
-
)
|
|
131
|
-
}
|
|
132
|
-
)
|
|
133
|
-
}
|
|
134
|
-
),
|
|
135
|
-
(f || u) && /* @__PURE__ */ b("div", { className: "flex flex-col min-w-0", children: [
|
|
136
|
-
f && /* @__PURE__ */ o(
|
|
137
|
-
"span",
|
|
138
|
-
{
|
|
139
|
-
className: i(
|
|
140
|
-
"font-medium text-foreground leading-snug",
|
|
141
|
-
Y
|
|
142
|
-
),
|
|
143
|
-
children: f
|
|
144
|
-
}
|
|
145
|
-
),
|
|
146
|
-
u && /* @__PURE__ */ o("span", { className: "text-xs sm:text-sm text-foreground/70 leading-snug mt-0.5", children: u })
|
|
147
|
-
] })
|
|
148
|
-
]
|
|
149
|
-
}
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
);
|
|
153
|
-
us.displayName = "Radio";
|
|
154
|
-
export {
|
|
155
|
-
us as Radio
|
|
156
|
-
};
|
|
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 { resolveCascade as r, resolveClassKey as i, resolveRadiusKey as a } from "../../utils/resolve-token.js";
|
|
7
|
+
import { FALLBACK_RADIO_CONFIG as o } from "./radio-config.js";
|
|
8
|
+
import { useRadioGroupContext as ee } from "./radio-context.js";
|
|
9
|
+
import { RADIO_COLOR_CLASS as s, RADIO_FONT_SIZE_CLASS as c, RADIO_GAP_CLASS as te, RADIO_INNER_SIZE_CLASS as l, RADIO_OUTER_SIZE_CLASS as ne, RADIO_STATUS_BORDER_CLASS as u } from "./radio-styles.js";
|
|
10
|
+
import { forwardRef as d, useCallback as f, useId as p, useState as m } from "react";
|
|
11
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
12
|
+
//#region src/components/radio/RadioGroup.tsx
|
|
13
|
+
var _ = d(({ value: d, size: _, color: v, radius: y, variant: b, status: x, label: S, description: C, id: re, name: w, className: T, style: E, disabled: D, checked: O, defaultChecked: k = !1, onChange: A, ...j }, M) => {
|
|
14
|
+
let N = t(), P = ee(), F = N.components?.radio, I = p(), L = re ?? I, R = w ?? P?.name, z = D ?? P?.disabled ?? !1, [B, V] = m(k), H = P ? P.value === d : O ?? B, U = r(_ ?? P?.size, F?.size, void 0, o.size), W = r(b ?? P?.variant, F?.variant, void 0, o.variant), G = r(v ?? P?.color, F?.color, N.defaultColor, o.color), K = x ?? P?.status ?? o.status, q = W === "card", J = a(y, F?.radius, void 0, o.radius), Y = q && J === "full" ? "xl" : J, X = i(U, ne, o.size), ie = i(U, l, o.size), ae = i(U, c, o.size), oe = i(U, te, o.size), Z = i(J, n, o.radius), se = i(Y, n, "xl"), Q = s[G] ?? s.primary, $ = u[K] ?? u.default, ce = f((e) => {
|
|
15
|
+
z || (P ? P.onChange?.(d) : O === void 0 && V(!0), A?.(e.target.checked, d, e));
|
|
16
|
+
}, [
|
|
17
|
+
O,
|
|
18
|
+
P,
|
|
19
|
+
z,
|
|
20
|
+
A,
|
|
21
|
+
d
|
|
22
|
+
]);
|
|
23
|
+
return /* @__PURE__ */ g("label", {
|
|
24
|
+
className: e("relative inline-flex items-start select-none cursor-pointer transition-all duration-150 shrink-0", oe, q ? e("p-3 border bg-background", se) : "", q && (H ? `${Q.border} ${Q.cardBg}` : $), z && "opacity-50 pointer-events-none cursor-not-allowed", T),
|
|
25
|
+
style: E,
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ h("input", {
|
|
28
|
+
ref: M,
|
|
29
|
+
id: L,
|
|
30
|
+
type: "radio",
|
|
31
|
+
name: R,
|
|
32
|
+
value: d,
|
|
33
|
+
checked: H,
|
|
34
|
+
disabled: z,
|
|
35
|
+
onChange: ce,
|
|
36
|
+
className: "sr-only peer",
|
|
37
|
+
...j
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ h("div", {
|
|
40
|
+
className: e("shrink-0 flex items-center justify-center border-2 transition-all duration-150 mt-0.5", "peer-focus-visible:ring-2 peer-focus-visible:ring-primary peer-focus-visible:ring-offset-2", X, Z, H ? Q.border : $),
|
|
41
|
+
children: /* @__PURE__ */ h("span", { className: e(ie, Z, Q.bg, "transition-all duration-200 ease-in-out transform-gpu", H ? "scale-100 opacity-100" : "scale-0 opacity-0") })
|
|
42
|
+
}),
|
|
43
|
+
(S || C) && /* @__PURE__ */ g("div", {
|
|
44
|
+
className: "flex flex-col min-w-0",
|
|
45
|
+
children: [S && /* @__PURE__ */ h("span", {
|
|
46
|
+
className: e("font-medium text-foreground leading-snug", ae),
|
|
47
|
+
children: S
|
|
48
|
+
}), C && /* @__PURE__ */ h("span", {
|
|
49
|
+
className: "text-xs sm:text-sm text-foreground/70 leading-snug mt-0.5",
|
|
50
|
+
children: C
|
|
51
|
+
})]
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
_.displayName = "Radio";
|
|
57
|
+
//#endregion
|
|
58
|
+
export { _ as Radio };
|
|
@@ -1,18 +1,17 @@
|
|
|
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
|
-
|
|
14
|
-
t("radio", a);
|
|
15
|
-
export {
|
|
16
|
-
u as FALLBACK_RADIO_CONFIG,
|
|
17
|
-
a as defaultRadioConfig
|
|
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/radio/radio-config.ts
|
|
6
|
+
var r = {
|
|
7
|
+
...n,
|
|
8
|
+
radius: "full",
|
|
9
|
+
variant: "default"
|
|
10
|
+
}, i = {
|
|
11
|
+
...t,
|
|
12
|
+
radius: "full",
|
|
13
|
+
variant: "default"
|
|
18
14
|
};
|
|
15
|
+
e("radio", r);
|
|
16
|
+
//#endregion
|
|
17
|
+
export { i as FALLBACK_RADIO_CONFIG, r as defaultRadioConfig };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
2
|
+
"use client";
|
|
3
|
+
import { createContext as e, useContext as t } from "react";
|
|
4
|
+
//#region src/components/radio/radio-context.ts
|
|
5
|
+
var n = e(null), r = () => t(n);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as RadioContext, r as useRadioGroupContext };
|
|
@@ -1,62 +1,57 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
export {
|
|
56
|
-
d as RADIO_COLOR_CLASS,
|
|
57
|
-
g as RADIO_FONT_SIZE_CLASS,
|
|
58
|
-
s as RADIO_GAP_CLASS,
|
|
59
|
-
e as RADIO_INNER_SIZE_CLASS,
|
|
60
|
-
r as RADIO_OUTER_SIZE_CLASS,
|
|
61
|
-
b as RADIO_STATUS_BORDER_CLASS
|
|
2
|
+
//#region src/components/radio/radio-styles.ts
|
|
3
|
+
var e = {
|
|
4
|
+
sm: "size-4",
|
|
5
|
+
md: "size-5",
|
|
6
|
+
lg: "size-6"
|
|
7
|
+
}, t = {
|
|
8
|
+
sm: "size-2",
|
|
9
|
+
md: "size-2.5",
|
|
10
|
+
lg: "size-3"
|
|
11
|
+
}, n = {
|
|
12
|
+
sm: "text-xs",
|
|
13
|
+
md: "text-sm",
|
|
14
|
+
lg: "text-base"
|
|
15
|
+
}, r = {
|
|
16
|
+
sm: "gap-2",
|
|
17
|
+
md: "gap-2.5",
|
|
18
|
+
lg: "gap-3"
|
|
19
|
+
}, i = {
|
|
20
|
+
none: {
|
|
21
|
+
border: "border-border",
|
|
22
|
+
bg: "bg-foreground",
|
|
23
|
+
cardBg: "bg-secondary/10"
|
|
24
|
+
},
|
|
25
|
+
primary: {
|
|
26
|
+
border: "border-primary",
|
|
27
|
+
bg: "bg-primary",
|
|
28
|
+
cardBg: "bg-primary/10"
|
|
29
|
+
},
|
|
30
|
+
secondary: {
|
|
31
|
+
border: "border-secondary",
|
|
32
|
+
bg: "bg-secondary",
|
|
33
|
+
cardBg: "bg-secondary/10"
|
|
34
|
+
},
|
|
35
|
+
danger: {
|
|
36
|
+
border: "border-danger",
|
|
37
|
+
bg: "bg-danger",
|
|
38
|
+
cardBg: "bg-danger/10"
|
|
39
|
+
},
|
|
40
|
+
warning: {
|
|
41
|
+
border: "border-warning",
|
|
42
|
+
bg: "bg-warning",
|
|
43
|
+
cardBg: "bg-warning/10"
|
|
44
|
+
},
|
|
45
|
+
success: {
|
|
46
|
+
border: "border-success",
|
|
47
|
+
bg: "bg-success",
|
|
48
|
+
cardBg: "bg-success/10"
|
|
49
|
+
}
|
|
50
|
+
}, a = {
|
|
51
|
+
default: "border-border",
|
|
52
|
+
error: "border-danger",
|
|
53
|
+
warning: "border-warning",
|
|
54
|
+
success: "border-success"
|
|
62
55
|
};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { i as RADIO_COLOR_CLASS, n as RADIO_FONT_SIZE_CLASS, r as RADIO_GAP_CLASS, t as RADIO_INNER_SIZE_CLASS, e as RADIO_OUTER_SIZE_CLASS, a as RADIO_STATUS_BORDER_CLASS };
|