daleui 0.0.2 → 0.0.5

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.
Files changed (176) hide show
  1. package/README.md +43 -0
  2. package/dist/check-DEVerfH5.js +72 -0
  3. package/dist/components/Box/Box.d.ts +34 -0
  4. package/dist/components/Box/Box.js +34 -0
  5. package/dist/components/Button/Button.d.ts +37 -0
  6. package/dist/components/Button/Button.js +367 -0
  7. package/dist/components/Card/Card.d.ts +68 -0
  8. package/dist/components/Card/Card.js +132 -0
  9. package/dist/components/Checkbox/Checkbox.d.ts +34 -0
  10. package/dist/components/Checkbox/Checkbox.js +657 -0
  11. package/dist/components/Flex/Flex.d.ts +361 -0
  12. package/dist/components/Flex/Flex.js +65 -0
  13. package/dist/components/HStack/HStack.d.ts +23 -0
  14. package/dist/components/HStack/HStack.js +35 -0
  15. package/dist/components/Heading/Heading.d.ts +33 -0
  16. package/dist/components/Heading/Heading.js +67 -0
  17. package/dist/components/Icon/Icon.d.ts +20 -0
  18. package/dist/components/Icon/Icon.js +325 -0
  19. package/dist/components/Label/Label.d.ts +35 -0
  20. package/dist/components/Label/Label.js +74 -0
  21. package/dist/components/Link/Link.d.ts +33 -0
  22. package/dist/components/Link/Link.js +176 -0
  23. package/dist/components/PasswordInput/PasswordInput.d.ts +17 -0
  24. package/dist/components/PasswordInput/PasswordInput.js +151 -0
  25. package/dist/components/RadioGroup/RadioGroup.d.ts +82 -0
  26. package/dist/components/RadioGroup/RadioGroup.js +713 -0
  27. package/dist/components/Select/Select.d.ts +39 -0
  28. package/dist/components/Select/Select.js +222 -0
  29. package/dist/components/Tag/Tag.d.ts +26 -0
  30. package/dist/components/Tag/Tag.js +189 -0
  31. package/dist/components/Text/Text.d.ts +22 -0
  32. package/dist/components/Text/Text.js +115 -0
  33. package/dist/components/TextInput/TextInput.d.ts +21 -0
  34. package/dist/components/TextInput/TextInput.js +106 -0
  35. package/dist/components/VStack/VStack.d.ts +23 -0
  36. package/dist/components/VStack/VStack.js +35 -0
  37. package/dist/css-QiVVeZaw.js +212 -0
  38. package/dist/cva-BrKodHDH.js +57 -0
  39. package/dist/cx-DN21T1EH.js +9 -0
  40. package/dist/hstack-cCrHxysi.js +43 -0
  41. package/dist/index.css +1 -0
  42. package/dist/index.d.ts +18 -0
  43. package/dist/index.js +37 -0
  44. package/dist/tokens/colors.d.ts +4 -0
  45. package/dist/tokens/iconography.d.ts +45 -0
  46. package/dist/tokens/spacing.d.ts +42 -0
  47. package/dist/tokens/typography.d.ts +312 -0
  48. package/dist/use-locale-context-DYXE7B4r.js +775 -0
  49. package/package.json +62 -39
  50. package/styled-system/css/conditions.mjs +36 -0
  51. package/styled-system/css/css.d.ts +22 -0
  52. package/styled-system/css/css.mjs +45 -0
  53. package/styled-system/css/cva.d.ts +6 -0
  54. package/styled-system/css/cva.mjs +87 -0
  55. package/styled-system/css/cx.d.ts +5 -0
  56. package/styled-system/css/cx.mjs +15 -0
  57. package/styled-system/css/index.d.ts +5 -0
  58. package/styled-system/css/index.mjs +4 -0
  59. package/styled-system/css/sva.d.ts +4 -0
  60. package/styled-system/css/sva.mjs +46 -0
  61. package/styled-system/helpers.mjs +316 -0
  62. package/styled-system/patterns/aspect-ratio.d.ts +20 -0
  63. package/styled-system/patterns/aspect-ratio.mjs +38 -0
  64. package/styled-system/patterns/bleed.d.ts +21 -0
  65. package/styled-system/patterns/bleed.mjs +24 -0
  66. package/styled-system/patterns/box.d.ts +20 -0
  67. package/styled-system/patterns/box.mjs +15 -0
  68. package/styled-system/patterns/center.d.ts +20 -0
  69. package/styled-system/patterns/center.mjs +21 -0
  70. package/styled-system/patterns/circle.d.ts +20 -0
  71. package/styled-system/patterns/circle.mjs +25 -0
  72. package/styled-system/patterns/container.d.ts +20 -0
  73. package/styled-system/patterns/container.mjs +21 -0
  74. package/styled-system/patterns/cq.d.ts +21 -0
  75. package/styled-system/patterns/cq.mjs +21 -0
  76. package/styled-system/patterns/divider.d.ts +22 -0
  77. package/styled-system/patterns/divider.mjs +25 -0
  78. package/styled-system/patterns/flex.d.ts +26 -0
  79. package/styled-system/patterns/flex.mjs +26 -0
  80. package/styled-system/patterns/float.d.ts +23 -0
  81. package/styled-system/patterns/float.mjs +52 -0
  82. package/styled-system/patterns/grid-item.d.ts +25 -0
  83. package/styled-system/patterns/grid-item.mjs +25 -0
  84. package/styled-system/patterns/grid.d.ts +24 -0
  85. package/styled-system/patterns/grid.mjs +27 -0
  86. package/styled-system/patterns/hstack.d.ts +21 -0
  87. package/styled-system/patterns/hstack.mjs +24 -0
  88. package/styled-system/patterns/index.d.ts +21 -0
  89. package/styled-system/patterns/index.mjs +20 -0
  90. package/styled-system/patterns/link-overlay.d.ts +20 -0
  91. package/styled-system/patterns/link-overlay.mjs +24 -0
  92. package/styled-system/patterns/spacer.d.ts +20 -0
  93. package/styled-system/patterns/spacer.mjs +21 -0
  94. package/styled-system/patterns/square.d.ts +20 -0
  95. package/styled-system/patterns/square.mjs +24 -0
  96. package/styled-system/patterns/stack.d.ts +23 -0
  97. package/styled-system/patterns/stack.mjs +24 -0
  98. package/styled-system/patterns/visually-hidden.d.ts +20 -0
  99. package/styled-system/patterns/visually-hidden.mjs +18 -0
  100. package/styled-system/patterns/vstack.d.ts +21 -0
  101. package/styled-system/patterns/vstack.mjs +24 -0
  102. package/styled-system/patterns/wrap.d.ts +24 -0
  103. package/styled-system/patterns/wrap.mjs +25 -0
  104. package/styled-system/tokens/index.d.ts +9 -0
  105. package/styled-system/tokens/index.mjs +3176 -0
  106. package/styled-system/tokens/tokens.d.ts +63 -0
  107. package/styled-system/types/composition.d.ts +224 -0
  108. package/styled-system/types/conditions.d.ts +310 -0
  109. package/styled-system/types/csstype.d.ts +21298 -0
  110. package/styled-system/types/global.d.ts +20 -0
  111. package/styled-system/types/index.d.ts +7 -0
  112. package/styled-system/types/parts.d.ts +8 -0
  113. package/styled-system/types/pattern.d.ts +78 -0
  114. package/styled-system/types/prop-type.d.ts +265 -0
  115. package/styled-system/types/recipe.d.ts +181 -0
  116. package/styled-system/types/selectors.d.ts +59 -0
  117. package/styled-system/types/static-css.d.ts +56 -0
  118. package/styled-system/types/style-props.d.ts +7504 -0
  119. package/styled-system/types/system-types.d.ts +269 -0
  120. package/.github/CODEOWNERS +0 -1
  121. package/.github/FUNDING.yml +0 -1
  122. package/.github/workflows/automation.yml +0 -13
  123. package/.github/workflows/chromatic.yml +0 -19
  124. package/.github/workflows/deployment.yml +0 -32
  125. package/.github/workflows/integration.yml +0 -15
  126. package/.github/workflows/storybook-tests.yml +0 -17
  127. package/.storybook/main.ts +0 -18
  128. package/.storybook/preview.ts +0 -29
  129. package/.storybook/test-runner.ts +0 -33
  130. package/bun.lock +0 -2099
  131. package/chromatic.config.json +0 -5
  132. package/eslint.config.js +0 -28
  133. package/index.html +0 -13
  134. package/panda.config.ts +0 -61
  135. package/postcss.config.cjs +0 -5
  136. package/public/logo.svg +0 -9
  137. package/src/App.tsx +0 -67
  138. package/src/assets/Discord.svg +0 -1
  139. package/src/assets/GitHub.svg +0 -1
  140. package/src/assets/LinkedIn.svg +0 -1
  141. package/src/assets/Medium.svg +0 -1
  142. package/src/assets/YouTube.svg +0 -1
  143. package/src/components/Button/Button.stories.tsx +0 -115
  144. package/src/components/Button/Button.test.tsx +0 -108
  145. package/src/components/Button/Button.tsx +0 -245
  146. package/src/components/Button/index.tsx +0 -1
  147. package/src/components/Checkbox/Checkbox.stories.tsx +0 -129
  148. package/src/components/Checkbox/Checkbox.test.tsx +0 -169
  149. package/src/components/Checkbox/Checkbox.tsx +0 -190
  150. package/src/components/Heading/Heading.stories.tsx +0 -72
  151. package/src/components/Heading/Heading.test.tsx +0 -55
  152. package/src/components/Heading/Heading.tsx +0 -73
  153. package/src/components/Heading/index.tsx +0 -1
  154. package/src/components/Icon/Icon.stories.tsx +0 -106
  155. package/src/components/Icon/Icon.test.tsx +0 -44
  156. package/src/components/Icon/Icon.tsx +0 -116
  157. package/src/components/Icon/index.tsx +0 -1
  158. package/src/components/Text/Text.stories.tsx +0 -65
  159. package/src/components/Text/Text.test.tsx +0 -54
  160. package/src/components/Text/Text.tsx +0 -93
  161. package/src/components/Text/index.tsx +0 -1
  162. package/src/index.css +0 -2
  163. package/src/main.tsx +0 -10
  164. package/src/setupTests.tsx +0 -5
  165. package/src/styles/globalCss.ts +0 -43
  166. package/src/tokens/colors.mdx +0 -100
  167. package/src/tokens/colors.ts +0 -288
  168. package/src/tokens/iconography.mdx +0 -15
  169. package/src/tokens/iconography.tsx +0 -54
  170. package/src/tokens/typography.mdx +0 -38
  171. package/src/tokens/typography.ts +0 -132
  172. package/src/vite-env.d.ts +0 -2
  173. package/tsconfig.app.json +0 -25
  174. package/tsconfig.json +0 -7
  175. package/tsconfig.node.json +0 -22
  176. package/vite.config.ts +0 -16
@@ -0,0 +1,713 @@
1
+ import { jsx as l, jsxs as k } from "react/jsx-runtime";
2
+ import { forwardRef as f, useId as M, createContext as K, useContext as z } from "react";
3
+ import { c as T } from "../../css-QiVVeZaw.js";
4
+ import { c as I } from "../../cva-BrKodHDH.js";
5
+ import { f as J } from "../../hstack-cCrHxysi.js";
6
+ import { c as P, m, a as g, q as D, r as R, d as c, b as Q, v as X, i as Y, w as Z, x as ee, e as O, f as te, h as ae, j as oe, y as ie, k as re, t as de, z as ne, u as se, n as le, o as ue, p as ce } from "../../use-locale-context-DYXE7B4r.js";
7
+ const [Be, ve] = P({
8
+ name: "FieldsetContext",
9
+ hookName: "useFieldsetContext",
10
+ providerName: "<FieldsetProvider />",
11
+ strict: !1
12
+ }), [pe, h] = P({
13
+ name: "RadioGroupContext",
14
+ hookName: "useRadioGroupContext",
15
+ providerName: "<RadioGroupProvider />"
16
+ }), A = f((e, t) => {
17
+ const a = h(), i = m(a.getIndicatorProps(), e);
18
+ return /* @__PURE__ */ l(g.div, { ...i, ref: t });
19
+ });
20
+ A.displayName = "RadioGroupIndicator";
21
+ const [fe] = P({
22
+ name: "RadioGroupItemContext",
23
+ hookName: "useRadioGroupItemContext",
24
+ providerName: "<RadioGroupItemProvider />"
25
+ }), [me, x] = P({
26
+ name: "RadioGroupItemPropsContext",
27
+ hookName: "useRadioGroupItemPropsContext",
28
+ providerName: "<RadioGroupItemPropsProvider />"
29
+ }), ge = D(), H = f((e, t) => {
30
+ const [a, i] = ge(e, ["value", "disabled", "invalid"]), d = h(), r = m(d.getItemProps(a), i), n = d.getItemState(a);
31
+ return /* @__PURE__ */ l(fe, { value: n, children: /* @__PURE__ */ l(me, { value: a, children: /* @__PURE__ */ l(g.label, { ...r, ref: t }) }) });
32
+ });
33
+ H.displayName = "RadioGroupItem";
34
+ const L = f((e, t) => {
35
+ const a = h(), i = x(), d = m(a.getItemControlProps(i), e);
36
+ return /* @__PURE__ */ l(g.div, { ...d, ref: t });
37
+ });
38
+ L.displayName = "RadioGroupItemControl";
39
+ const _ = f((e, t) => {
40
+ const a = h(), i = x(), d = m(a.getItemHiddenInputProps(i), e);
41
+ return /* @__PURE__ */ l(g.input, { ...d, ref: t });
42
+ });
43
+ _.displayName = "RadioGroupItemHiddenInput";
44
+ const q = f((e, t) => {
45
+ const a = h(), i = x(), d = m(a.getItemTextProps(i), e);
46
+ return /* @__PURE__ */ l(g.span, { ...d, ref: t });
47
+ });
48
+ q.displayName = "RadioGroupItemText";
49
+ const $ = f((e, t) => {
50
+ const a = h(), i = m(a.getLabelProps(), e);
51
+ return /* @__PURE__ */ l(g.label, { ...i, ref: t });
52
+ });
53
+ $.displayName = "RadioGroupLabel";
54
+ var be = Q("radio-group").parts(
55
+ "root",
56
+ "label",
57
+ "item",
58
+ "itemText",
59
+ "itemControl",
60
+ "indicator"
61
+ ), b = be.build(), V = (e) => e.ids?.root ?? `radio-group:${e.id}`, N = (e) => e.ids?.label ?? `radio-group:${e.id}:label`, U = (e, t) => e.ids?.item?.(t) ?? `radio-group:${e.id}:radio:${t}`, G = (e, t) => e.ids?.itemHiddenInput?.(t) ?? `radio-group:${e.id}:radio:input:${t}`, he = (e, t) => e.ids?.itemControl?.(t) ?? `radio-group:${e.id}:radio:control:${t}`, ye = (e, t) => e.ids?.itemLabel?.(t) ?? `radio-group:${e.id}:radio:label:${t}`, W = (e) => e.ids?.indicator ?? `radio-group:${e.id}:indicator`, E = (e) => e.getById(V(e)), Ce = (e, t) => e.getById(G(e, t)), Ie = (e) => e.getById(W(e)), Re = (e) => E(e)?.querySelector("input:not(:disabled)"), Ve = (e) => E(e)?.querySelector("input:not(:disabled):checked"), F = (e) => {
62
+ const a = `input[type=radio][data-ownedby='${CSS.escape(V(e))}']:not([disabled])`;
63
+ return ne(E(e), a);
64
+ }, Pe = (e, t) => {
65
+ if (t)
66
+ return e.getById(U(e, t));
67
+ }, Ee = (e) => ({
68
+ x: e?.offsetLeft ?? 0,
69
+ y: e?.offsetTop ?? 0,
70
+ width: e?.offsetWidth ?? 0,
71
+ height: e?.offsetHeight ?? 0
72
+ });
73
+ function Se(e, t) {
74
+ const { context: a, send: i, computed: d, prop: r, scope: n } = e, u = d("isDisabled"), y = r("invalid"), p = r("readOnly");
75
+ function C(o) {
76
+ return {
77
+ value: o.value,
78
+ invalid: !!o.invalid || !!y,
79
+ disabled: !!o.disabled || u,
80
+ checked: a.get("value") === o.value,
81
+ focused: a.get("focusedValue") === o.value,
82
+ focusVisible: a.get("focusVisibleValue") === o.value,
83
+ hovered: a.get("hoveredValue") === o.value,
84
+ active: a.get("activeValue") === o.value
85
+ };
86
+ }
87
+ function S(o) {
88
+ const s = C(o);
89
+ return {
90
+ "data-focus": c(s.focused),
91
+ "data-focus-visible": c(s.focusVisible),
92
+ "data-disabled": c(s.disabled),
93
+ "data-readonly": c(p),
94
+ "data-state": s.checked ? "checked" : "unchecked",
95
+ "data-hover": c(s.hovered),
96
+ "data-invalid": c(s.invalid),
97
+ "data-orientation": r("orientation"),
98
+ "data-ssr": c(a.get("ssr"))
99
+ };
100
+ }
101
+ const w = () => {
102
+ (Ve(n) ?? Re(n))?.focus();
103
+ };
104
+ return {
105
+ focus: w,
106
+ value: a.get("value"),
107
+ setValue(o) {
108
+ i({ type: "SET_VALUE", value: o, isTrusted: !1 });
109
+ },
110
+ clearValue() {
111
+ i({ type: "SET_VALUE", value: null, isTrusted: !1 });
112
+ },
113
+ getRootProps() {
114
+ return t.element({
115
+ ...b.root.attrs,
116
+ role: "radiogroup",
117
+ id: V(n),
118
+ "aria-labelledby": N(n),
119
+ "aria-required": r("required") || void 0,
120
+ "aria-disabled": u || void 0,
121
+ "aria-readonly": p || void 0,
122
+ "data-orientation": r("orientation"),
123
+ "data-disabled": c(u),
124
+ "data-invalid": c(y),
125
+ "data-required": c(r("required")),
126
+ "aria-orientation": r("orientation"),
127
+ dir: r("dir"),
128
+ style: {
129
+ position: "relative"
130
+ }
131
+ });
132
+ },
133
+ getLabelProps() {
134
+ return t.element({
135
+ ...b.label.attrs,
136
+ dir: r("dir"),
137
+ "data-orientation": r("orientation"),
138
+ "data-disabled": c(u),
139
+ "data-invalid": c(y),
140
+ "data-required": c(r("required")),
141
+ id: N(n),
142
+ onClick: w
143
+ });
144
+ },
145
+ getItemState: C,
146
+ getItemProps(o) {
147
+ const s = C(o);
148
+ return t.label({
149
+ ...b.item.attrs,
150
+ dir: r("dir"),
151
+ id: U(n, o.value),
152
+ htmlFor: G(n, o.value),
153
+ ...S(o),
154
+ onPointerMove() {
155
+ s.disabled || s.hovered || i({ type: "SET_HOVERED", value: o.value, hovered: !0 });
156
+ },
157
+ onPointerLeave() {
158
+ s.disabled || i({ type: "SET_HOVERED", value: null });
159
+ },
160
+ onPointerDown(v) {
161
+ s.disabled || ee(v) && (s.focused && v.pointerType === "mouse" && v.preventDefault(), i({ type: "SET_ACTIVE", value: o.value, active: !0 }));
162
+ },
163
+ onPointerUp() {
164
+ s.disabled || i({ type: "SET_ACTIVE", value: null });
165
+ },
166
+ onClick() {
167
+ !s.disabled && Z() && Ce(n, o.value)?.focus();
168
+ }
169
+ });
170
+ },
171
+ getItemTextProps(o) {
172
+ return t.element({
173
+ ...b.itemText.attrs,
174
+ dir: r("dir"),
175
+ id: ye(n, o.value),
176
+ ...S(o)
177
+ });
178
+ },
179
+ getItemControlProps(o) {
180
+ const s = C(o);
181
+ return t.element({
182
+ ...b.itemControl.attrs,
183
+ dir: r("dir"),
184
+ id: he(n, o.value),
185
+ "data-active": c(s.active),
186
+ "aria-hidden": !0,
187
+ ...S(o)
188
+ });
189
+ },
190
+ getItemHiddenInputProps(o) {
191
+ const s = C(o);
192
+ return t.input({
193
+ "data-ownedby": V(n),
194
+ id: G(n, o.value),
195
+ type: "radio",
196
+ name: r("name") || r("id"),
197
+ form: r("form"),
198
+ value: o.value,
199
+ required: r("required"),
200
+ "aria-invalid": s.invalid || void 0,
201
+ onClick(v) {
202
+ if (p) {
203
+ v.preventDefault();
204
+ return;
205
+ }
206
+ v.currentTarget.checked && i({ type: "SET_VALUE", value: o.value, isTrusted: !0 });
207
+ },
208
+ onBlur() {
209
+ i({ type: "SET_FOCUSED", value: null, focused: !1, focusVisible: !1 });
210
+ },
211
+ onFocus() {
212
+ const v = Y();
213
+ i({ type: "SET_FOCUSED", value: o.value, focused: !0, focusVisible: v });
214
+ },
215
+ onKeyDown(v) {
216
+ v.defaultPrevented || v.key === " " && i({ type: "SET_ACTIVE", value: o.value, active: !0 });
217
+ },
218
+ onKeyUp(v) {
219
+ v.defaultPrevented || v.key === " " && i({ type: "SET_ACTIVE", value: null });
220
+ },
221
+ disabled: s.disabled || p,
222
+ defaultChecked: s.checked,
223
+ style: X
224
+ });
225
+ },
226
+ getIndicatorProps() {
227
+ const o = a.get("indicatorRect"), s = o == null || o.width === 0 && o.height === 0 && o.x === 0 && o.y === 0;
228
+ return t.element({
229
+ id: W(n),
230
+ ...b.indicator.attrs,
231
+ dir: r("dir"),
232
+ hidden: a.get("value") == null || s,
233
+ "data-disabled": c(u),
234
+ "data-orientation": r("orientation"),
235
+ style: {
236
+ "--transition-property": "left, top, width, height",
237
+ "--left": R(o?.x),
238
+ "--top": R(o?.y),
239
+ "--width": R(o?.width),
240
+ "--height": R(o?.height),
241
+ position: "absolute",
242
+ willChange: "var(--transition-property)",
243
+ transitionProperty: "var(--transition-property)",
244
+ transitionDuration: "var(--transition-duration, 150ms)",
245
+ transitionTimingFunction: "var(--transition-timing-function)",
246
+ [r("orientation") === "horizontal" ? "left" : "top"]: r("orientation") === "horizontal" ? "var(--left)" : "var(--top)"
247
+ }
248
+ });
249
+ }
250
+ };
251
+ }
252
+ var { not: ke } = ae(), Ge = te({
253
+ props({ props: e }) {
254
+ return {
255
+ orientation: "vertical",
256
+ ...e
257
+ };
258
+ },
259
+ initialState() {
260
+ return "idle";
261
+ },
262
+ context({ prop: e, bindable: t }) {
263
+ return {
264
+ value: t(() => ({
265
+ defaultValue: e("defaultValue"),
266
+ value: e("value"),
267
+ onChange(a) {
268
+ e("onValueChange")?.({ value: a });
269
+ }
270
+ })),
271
+ activeValue: t(() => ({
272
+ defaultValue: null
273
+ })),
274
+ focusedValue: t(() => ({
275
+ defaultValue: null
276
+ })),
277
+ focusVisibleValue: t(() => ({
278
+ defaultValue: null
279
+ })),
280
+ hoveredValue: t(() => ({
281
+ defaultValue: null
282
+ })),
283
+ indicatorRect: t(() => ({
284
+ defaultValue: null
285
+ })),
286
+ fieldsetDisabled: t(() => ({
287
+ defaultValue: !1
288
+ })),
289
+ ssr: t(() => ({
290
+ defaultValue: !0
291
+ }))
292
+ };
293
+ },
294
+ refs() {
295
+ return {
296
+ indicatorCleanup: null,
297
+ focusVisibleValue: null
298
+ };
299
+ },
300
+ computed: {
301
+ isDisabled: ({ prop: e, context: t }) => !!e("disabled") || t.get("fieldsetDisabled")
302
+ },
303
+ entry: ["syncIndicatorRect", "syncSsr"],
304
+ exit: ["cleanupObserver"],
305
+ effects: ["trackFormControlState", "trackFocusVisible"],
306
+ watch({ track: e, action: t, context: a }) {
307
+ e([() => a.get("value")], () => {
308
+ t(["syncIndicatorRect", "syncInputElements"]);
309
+ });
310
+ },
311
+ on: {
312
+ SET_VALUE: [
313
+ {
314
+ guard: ke("isTrusted"),
315
+ actions: ["setValue", "dispatchChangeEvent"]
316
+ },
317
+ {
318
+ actions: ["setValue"]
319
+ }
320
+ ],
321
+ SET_HOVERED: {
322
+ actions: ["setHovered"]
323
+ },
324
+ SET_ACTIVE: {
325
+ actions: ["setActive"]
326
+ },
327
+ SET_FOCUSED: {
328
+ actions: ["setFocused"]
329
+ }
330
+ },
331
+ states: {
332
+ idle: {}
333
+ },
334
+ implementations: {
335
+ guards: {
336
+ isTrusted: ({ event: e }) => !!e.isTrusted
337
+ },
338
+ effects: {
339
+ trackFormControlState({ context: e, scope: t }) {
340
+ return de(E(t), {
341
+ onFieldsetDisabledChange(a) {
342
+ e.set("fieldsetDisabled", a);
343
+ },
344
+ onFormReset() {
345
+ e.set("value", e.initial("value"));
346
+ }
347
+ });
348
+ },
349
+ trackFocusVisible({ scope: e }) {
350
+ return re({ root: e.getRootNode?.() });
351
+ }
352
+ },
353
+ actions: {
354
+ setValue({ context: e, event: t }) {
355
+ e.set("value", t.value);
356
+ },
357
+ setHovered({ context: e, event: t }) {
358
+ e.set("hoveredValue", t.value);
359
+ },
360
+ setActive({ context: e, event: t }) {
361
+ e.set("activeValue", t.value);
362
+ },
363
+ setFocused({ context: e, event: t }) {
364
+ e.set("focusedValue", t.value);
365
+ const a = t.value != null && t.focusVisible ? t.value : null;
366
+ e.set("focusVisibleValue", a);
367
+ },
368
+ syncInputElements({ context: e, scope: t }) {
369
+ F(t).forEach((i) => {
370
+ i.checked = i.value === e.get("value");
371
+ });
372
+ },
373
+ cleanupObserver({ refs: e }) {
374
+ e.get("indicatorCleanup")?.();
375
+ },
376
+ syncSsr({ context: e }) {
377
+ e.set("ssr", !1);
378
+ },
379
+ syncIndicatorRect({ context: e, scope: t, refs: a }) {
380
+ if (a.get("indicatorCleanup")?.(), !Ie(t)) return;
381
+ const i = e.get("value"), d = Pe(t, i);
382
+ if (i == null || !d) {
383
+ e.set("indicatorRect", null);
384
+ return;
385
+ }
386
+ const r = () => {
387
+ e.set("indicatorRect", Ee(d));
388
+ };
389
+ r();
390
+ const n = ie.observe(d, r);
391
+ a.set("indicatorCleanup", n);
392
+ },
393
+ dispatchChangeEvent({ context: e, scope: t }) {
394
+ F(t).forEach((i) => {
395
+ const d = i.value === e.get("value");
396
+ d !== i.checked && oe(i, { checked: d });
397
+ });
398
+ }
399
+ }
400
+ }
401
+ });
402
+ O()([
403
+ "dir",
404
+ "disabled",
405
+ "form",
406
+ "getRootNode",
407
+ "id",
408
+ "ids",
409
+ "invalid",
410
+ "name",
411
+ "onValueChange",
412
+ "orientation",
413
+ "readOnly",
414
+ "required",
415
+ "value",
416
+ "defaultValue"
417
+ ]);
418
+ O()(["value", "disabled", "invalid"]);
419
+ const Te = (e) => {
420
+ const t = ve(), a = M(), { getRootNode: i } = se(), { dir: d } = le(), r = {
421
+ id: a,
422
+ ids: {
423
+ label: t?.ids?.legend
424
+ },
425
+ dir: d,
426
+ disabled: t?.disabled,
427
+ invalid: t?.invalid,
428
+ getRootNode: i,
429
+ ...e
430
+ }, n = ue(Ge, r);
431
+ return Se(n, ce);
432
+ }, xe = D(), B = f((e, t) => {
433
+ const [a, i] = xe(e, [
434
+ "defaultValue",
435
+ "disabled",
436
+ "form",
437
+ "id",
438
+ "ids",
439
+ "invalid",
440
+ "name",
441
+ "onValueChange",
442
+ "orientation",
443
+ "readOnly",
444
+ "required",
445
+ "value"
446
+ ]), d = Te(a), r = m(d.getRootProps(), i);
447
+ return /* @__PURE__ */ l(pe, { value: d, children: /* @__PURE__ */ l(g.div, { ...r, ref: t }) });
448
+ });
449
+ B.displayName = "RadioGroupRoot";
450
+ const j = K(null);
451
+ function je({
452
+ children: e,
453
+ name: t,
454
+ label: a,
455
+ defaultValue: i,
456
+ value: d,
457
+ onChange: r,
458
+ disabled: n,
459
+ orientation: u,
460
+ tone: y = "neutral"
461
+ }) {
462
+ return /* @__PURE__ */ l(j.Provider, { value: { tone: y, disabled: n }, children: /* @__PURE__ */ k(
463
+ B,
464
+ {
465
+ name: t,
466
+ defaultValue: i,
467
+ value: d,
468
+ onValueChange: (p) => {
469
+ p.value && r?.(p.value);
470
+ },
471
+ disabled: n,
472
+ orientation: u,
473
+ className: we,
474
+ children: [
475
+ /* @__PURE__ */ l(
476
+ $,
477
+ {
478
+ className: T({
479
+ textStyle: "body.lg",
480
+ marginBottom: "8"
481
+ }),
482
+ children: a
483
+ }
484
+ ),
485
+ /* @__PURE__ */ l("div", { className: Ne({ orientation: u }), children: e })
486
+ ]
487
+ }
488
+ ) });
489
+ }
490
+ const we = T({
491
+ display: "flex",
492
+ flexDirection: "column"
493
+ }), Ne = I({
494
+ base: {
495
+ display: "flex",
496
+ gap: "8"
497
+ },
498
+ variants: {
499
+ orientation: {
500
+ horizontal: {
501
+ flexDirection: "row"
502
+ },
503
+ vertical: {
504
+ flexDirection: "column"
505
+ }
506
+ }
507
+ },
508
+ defaultVariants: {
509
+ orientation: "vertical"
510
+ }
511
+ });
512
+ function Me({ value: e, children: t, disabled: a, ref: i }) {
513
+ const d = z(j);
514
+ if (!d)
515
+ throw new Error("Radio 컴포넌트는 RadioGroup 내부에서만 사용해야 합니다.");
516
+ const { tone: r, disabled: n } = d, u = a || n;
517
+ return /* @__PURE__ */ k(
518
+ H,
519
+ {
520
+ value: e,
521
+ disabled: u,
522
+ className: J({
523
+ alignItems: "center",
524
+ gap: "8",
525
+ cursor: u ? "not-allowed" : "pointer"
526
+ }),
527
+ children: [
528
+ /* @__PURE__ */ k(L, { className: Fe, children: [
529
+ /* @__PURE__ */ l(
530
+ "div",
531
+ {
532
+ className: De({ tone: r, disabled: u }),
533
+ role: "presentation"
534
+ }
535
+ ),
536
+ /* @__PURE__ */ l(
537
+ A,
538
+ {
539
+ className: He({ tone: r, disabled: u })
540
+ }
541
+ ),
542
+ /* @__PURE__ */ l("div", { className: Oe({ tone: r, disabled: u }) }),
543
+ /* @__PURE__ */ l(_, { ref: i })
544
+ ] }),
545
+ t && /* @__PURE__ */ l(
546
+ q,
547
+ {
548
+ className: Ae({ disabled: u }),
549
+ children: t
550
+ }
551
+ )
552
+ ]
553
+ }
554
+ );
555
+ }
556
+ const Fe = T({
557
+ position: "relative",
558
+ width: "4",
559
+ height: "4",
560
+ display: "flex",
561
+ alignItems: "center",
562
+ justifyContent: "center"
563
+ }), De = I({
564
+ base: {
565
+ backgroundColor: "bg.neutral",
566
+ width: "4",
567
+ height: "4",
568
+ border: "neutral",
569
+ borderWidth: "md",
570
+ borderRadius: "full",
571
+ position: "absolute",
572
+ pointerEvents: "none",
573
+ borderColor: "slate.9",
574
+ "[data-state='checked'] &": {
575
+ borderColor: "slate.9"
576
+ }
577
+ },
578
+ variants: {
579
+ tone: {
580
+ neutral: {
581
+ "[data-focus-visible] &, [data-active] &": {
582
+ outline: "solid",
583
+ outlineWidth: "md",
584
+ outlineColor: "slate.9",
585
+ outlineOffset: "2"
586
+ }
587
+ },
588
+ brand: {
589
+ "[data-focus-visible] &, [data-active] &": {
590
+ outline: "solid",
591
+ outlineWidth: "md",
592
+ outlineColor: "border.brand.focus",
593
+ outlineOffset: "2"
594
+ }
595
+ },
596
+ danger: {
597
+ "[data-focus-visible] &, [data-active] &": {
598
+ outline: "solid",
599
+ outlineWidth: "md",
600
+ outlineColor: "border.danger",
601
+ outlineOffset: "2"
602
+ }
603
+ },
604
+ warning: {
605
+ "[data-focus-visible] &, [data-active] &": {
606
+ outline: "solid",
607
+ outlineWidth: "md",
608
+ outlineColor: "border.warning",
609
+ outlineOffset: "2"
610
+ }
611
+ },
612
+ success: {
613
+ "[data-focus-visible] &, [data-active] &": {
614
+ outline: "solid",
615
+ outlineWidth: "md",
616
+ outlineColor: "border.success",
617
+ outlineOffset: "2"
618
+ }
619
+ },
620
+ info: {
621
+ "[data-focus-visible] &, [data-active] &": {
622
+ outline: "solid",
623
+ outlineWidth: "md",
624
+ outlineColor: "border.info",
625
+ outlineOffset: "2"
626
+ }
627
+ }
628
+ },
629
+ disabled: {
630
+ true: {
631
+ borderColor: "fg.neutral.disabled!",
632
+ backgroundColor: "bg.neutral.disabled!",
633
+ "[data-state='checked'] &": {
634
+ borderColor: "fg.neutral.disabled!",
635
+ backgroundColor: "bg.neutral.disabled!"
636
+ }
637
+ }
638
+ }
639
+ }
640
+ }), Oe = I({
641
+ base: {
642
+ position: "absolute",
643
+ width: "6",
644
+ height: "6",
645
+ borderRadius: "full",
646
+ pointerEvents: "none",
647
+ opacity: 0,
648
+ "[data-hover] &": {
649
+ opacity: 0.1
650
+ }
651
+ },
652
+ variants: {
653
+ tone: {
654
+ neutral: { backgroundColor: "fg.neutral" },
655
+ brand: { backgroundColor: "fg.brand" },
656
+ danger: { backgroundColor: "fg.danger" },
657
+ warning: { backgroundColor: "fg.warning" },
658
+ success: { backgroundColor: "fg.success" },
659
+ info: { backgroundColor: "fg.info" }
660
+ },
661
+ disabled: {
662
+ true: {
663
+ display: "none"
664
+ }
665
+ }
666
+ }
667
+ }), Ae = I({
668
+ base: {
669
+ textStyle: "label.md"
670
+ },
671
+ variants: {
672
+ disabled: {
673
+ true: {
674
+ color: "fg.neutral.disabled"
675
+ }
676
+ }
677
+ }
678
+ }), He = I({
679
+ base: {
680
+ position: "absolute",
681
+ top: "50%!",
682
+ left: "50%!",
683
+ transform: "translate(-50%, -50%)!",
684
+ width: "2",
685
+ height: "2",
686
+ borderRadius: "full",
687
+ pointerEvents: "none",
688
+ opacity: 0,
689
+ backgroundColor: "slate.9",
690
+ "[data-scope='radio-group'][data-part='item'][data-state='checked'] &": {
691
+ opacity: 1
692
+ }
693
+ },
694
+ variants: {
695
+ tone: {
696
+ neutral: {},
697
+ brand: {},
698
+ danger: {},
699
+ warning: {},
700
+ success: {},
701
+ info: {}
702
+ },
703
+ disabled: {
704
+ true: {
705
+ backgroundColor: "fg.neutral.disabled!"
706
+ }
707
+ }
708
+ }
709
+ });
710
+ export {
711
+ Me as Radio,
712
+ je as RadioGroup
713
+ };