asheeui 0.6.15 → 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.
Files changed (183) hide show
  1. package/dist/AsheeUIProvider.js +22 -24
  2. package/dist/components/accordion/Accordion.js +79 -173
  3. package/dist/components/accordion/accordion-config.js +12 -13
  4. package/dist/components/accordion/accordion-styles.js +21 -24
  5. package/dist/components/autocomplete/Autocomplete.js +78 -136
  6. package/dist/components/autocomplete/autocomplete-config.js +7 -12
  7. package/dist/components/button/Button.d.ts +29 -1
  8. package/dist/components/button/Button.d.ts.map +1 -1
  9. package/dist/components/button/Button.js +47 -108
  10. package/dist/components/button/button-config.js +16 -17
  11. package/dist/components/button/button-styles.js +10 -11
  12. package/dist/components/card/Card.d.ts +36 -16
  13. package/dist/components/card/Card.d.ts.map +1 -1
  14. package/dist/components/card/Card.js +115 -205
  15. package/dist/components/card/card-config.js +24 -21
  16. package/dist/components/card/card-styles.js +19 -22
  17. package/dist/components/carousel/Carousel.js +123 -248
  18. package/dist/components/carousel/carousel-config.js +24 -25
  19. package/dist/components/carousel/carousel-styles.js +14 -16
  20. package/dist/components/chip/Chip.js +84 -191
  21. package/dist/components/chip/chip-config.js +13 -14
  22. package/dist/components/chip/chip-styles.js +22 -26
  23. package/dist/components/date-picker/Calendar.d.ts +3 -3
  24. package/dist/components/date-picker/Calendar.d.ts.map +1 -1
  25. package/dist/components/date-picker/Calendar.js +141 -222
  26. package/dist/components/date-picker/DatePicker.d.ts +5 -5
  27. package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
  28. package/dist/components/date-picker/DatePicker.js +122 -220
  29. package/dist/components/date-picker/TimeSpinner.js +58 -82
  30. package/dist/components/date-picker/date-picker-config.d.ts +4 -4
  31. package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
  32. package/dist/components/date-picker/date-picker-config.js +10 -11
  33. package/dist/components/date-picker/date-picker-styles.js +44 -45
  34. package/dist/components/date-picker/date-picker.helpers.d.ts +4 -4
  35. package/dist/components/date-picker/date-picker.helpers.d.ts.map +1 -1
  36. package/dist/components/date-picker/date-picker.helpers.js +74 -102
  37. package/dist/components/drawer/Drawer.d.ts +26 -8
  38. package/dist/components/drawer/Drawer.d.ts.map +1 -1
  39. package/dist/components/drawer/Drawer.js +54 -131
  40. package/dist/components/drawer/drawer-config.js +14 -15
  41. package/dist/components/drawer/drawer-styles.js +38 -42
  42. package/dist/components/field/FieldShell.js +49 -56
  43. package/dist/components/field/field-config.js +17 -18
  44. package/dist/components/field/field-styles.js +8 -8
  45. package/dist/components/image/Image.d.ts +7 -7
  46. package/dist/components/image/Image.d.ts.map +1 -1
  47. package/dist/components/image/Image.js +65 -132
  48. package/dist/components/image/image-config.js +17 -18
  49. package/dist/components/image/image-styles.js +14 -15
  50. package/dist/components/input/Input.js +65 -150
  51. package/dist/components/input/PasswordInput.js +30 -49
  52. package/dist/components/input/input-config.js +7 -7
  53. package/dist/components/input/input-styles.js +9 -10
  54. package/dist/components/keyboard/KeyboardContext.js +10 -11
  55. package/dist/components/keyboard/KeyboardProvider.js +100 -181
  56. package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
  57. package/dist/components/keyboard/OnScreenKeyboard.js +159 -166
  58. package/dist/components/keyboard/keyboard-config.js +59 -57
  59. package/dist/components/keyboard/keyboard-styles.js +10 -11
  60. package/dist/components/keyboard/use-keyboard-field.js +29 -21
  61. package/dist/components/link/Link.js +47 -137
  62. package/dist/components/link/link-config.js +14 -15
  63. package/dist/components/link/link-styles.js +25 -29
  64. package/dist/components/marquee/Marquee.js +55 -144
  65. package/dist/components/marquee/marquee-config.js +18 -19
  66. package/dist/components/marquee/marquee-styles.js +13 -15
  67. package/dist/components/modal/Modal.d.ts +26 -10
  68. package/dist/components/modal/Modal.d.ts.map +1 -1
  69. package/dist/components/modal/Modal.js +56 -136
  70. package/dist/components/modal/modal-config.js +15 -16
  71. package/dist/components/modal/modal-styles.js +13 -14
  72. package/dist/components/multi-select/MultiSelect.d.ts +18 -2
  73. package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
  74. package/dist/components/multi-select/MultiSelect.js +149 -283
  75. package/dist/components/multi-select/multi-select-config.d.ts +23 -18
  76. package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
  77. package/dist/components/multi-select/multi-select-config.js +18 -21
  78. package/dist/components/multi-select/multi-select-styles.js +17 -20
  79. package/dist/components/radio/Radio.js +43 -80
  80. package/dist/components/radio/RadioGroup.js +57 -155
  81. package/dist/components/radio/radio-config.js +15 -16
  82. package/dist/components/radio/radio-context.js +6 -6
  83. package/dist/components/radio/radio-styles.js +55 -60
  84. package/dist/components/resizable-screen/ResizableScreen.js +87 -177
  85. package/dist/components/resizable-screen/resizable-screen-config.js +16 -17
  86. package/dist/components/select/Select.d.ts +3 -2
  87. package/dist/components/select/Select.d.ts.map +1 -1
  88. package/dist/components/select/Select.js +97 -195
  89. package/dist/components/select/select-config.js +8 -9
  90. package/dist/components/select/select-styles.js +5 -5
  91. package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
  92. package/dist/components/select-menu/SelectMenu.js +102 -196
  93. package/dist/components/select-menu/select-menu-config.js +12 -12
  94. package/dist/components/select-menu/use-select-floating.d.ts +11 -1
  95. package/dist/components/select-menu/use-select-floating.d.ts.map +1 -1
  96. package/dist/components/select-menu/use-select-floating.js +41 -48
  97. package/dist/components/sidebar/Sidebar.d.ts +43 -22
  98. package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
  99. package/dist/components/sidebar/Sidebar.js +146 -331
  100. package/dist/components/sidebar/sidebar-config.d.ts +98 -31
  101. package/dist/components/sidebar/sidebar-config.d.ts.map +1 -1
  102. package/dist/components/sidebar/sidebar-config.js +47 -33
  103. package/dist/components/sidebar/sidebar-styles.js +27 -32
  104. package/dist/components/spinner/spinner-config.js +12 -13
  105. package/dist/components/spinner/spinner-styles.js +13 -14
  106. package/dist/components/spinner/spinner.js +39 -82
  107. package/dist/components/switch/Switch.js +62 -154
  108. package/dist/components/switch/switch-config.js +11 -12
  109. package/dist/components/switch/switch-styles.js +14 -16
  110. package/dist/components/table/Table.js +64 -186
  111. package/dist/components/table/table-config.js +17 -18
  112. package/dist/components/table/table-styles.js +48 -52
  113. package/dist/components/tabs/Tabs.d.ts +16 -8
  114. package/dist/components/tabs/Tabs.d.ts.map +1 -1
  115. package/dist/components/tabs/Tabs.js +93 -208
  116. package/dist/components/tabs/tabs-config.d.ts +42 -20
  117. package/dist/components/tabs/tabs-config.d.ts.map +1 -1
  118. package/dist/components/tabs/tabs-config.js +26 -18
  119. package/dist/components/tabs/tabs-styles.js +15 -17
  120. package/dist/components/textarea/Textarea.js +52 -138
  121. package/dist/components/textarea/textarea-config.js +10 -11
  122. package/dist/components/textarea/textarea-styles.js +9 -10
  123. package/dist/components/toast/ToastContext.js +22 -26
  124. package/dist/components/toast/ToastItem.js +82 -144
  125. package/dist/components/toast/ToastProvider.d.ts.map +1 -1
  126. package/dist/components/toast/ToastProvider.js +128 -190
  127. package/dist/components/toast/toast-config.js +23 -24
  128. package/dist/components/toast/toast-styles.js +50 -55
  129. package/dist/components/toast/use-pausable-timeout.js +17 -13
  130. package/dist/components/tooltip/Tooltip.d.ts +5 -0
  131. package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
  132. package/dist/components/tooltip/Tooltip.js +68 -158
  133. package/dist/components/tooltip/tooltip-config.d.ts +25 -0
  134. package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
  135. package/dist/components/tooltip/tooltip-config.js +26 -22
  136. package/dist/components/tooltip/tooltip-styles.js +15 -17
  137. package/dist/config/default-config.js +11 -34
  138. package/dist/config/resolve-color.js +23 -23
  139. package/dist/config/resolve-config.d.ts.map +1 -1
  140. package/dist/config/resolve-config.js +14 -12
  141. package/dist/icons/ArrowLeftIcon.js +16 -19
  142. package/dist/icons/CalendarIcon.js +43 -24
  143. package/dist/icons/CheckIcon.js +16 -19
  144. package/dist/icons/ChevronDownIcon.js +15 -21
  145. package/dist/icons/ChevronLeftIcon.js +16 -19
  146. package/dist/icons/ChevronRightIcon.js +16 -19
  147. package/dist/icons/ChevronUpIcon.js +16 -19
  148. package/dist/icons/ClearIcon.js +26 -22
  149. package/dist/icons/ClockIcon.js +20 -22
  150. package/dist/icons/CloseIcon.js +26 -22
  151. package/dist/icons/ErrorIcon.js +16 -19
  152. package/dist/icons/ExternalLinkIcon.js +25 -23
  153. package/dist/icons/EyeIcon.js +20 -22
  154. package/dist/icons/EyeOffIcon.js +21 -22
  155. package/dist/icons/InfoIcon.js +16 -19
  156. package/dist/icons/SearchIcon.js +25 -22
  157. package/dist/icons/WarningIcon.js +16 -19
  158. package/dist/index.js +65 -163
  159. package/dist/libs/context.js +10 -13
  160. package/dist/libs/index.js +1 -0
  161. package/dist/libs/registry.js +10 -12
  162. package/dist/libs/use-floating-z-index.d.ts +32 -0
  163. package/dist/libs/use-floating-z-index.d.ts.map +1 -0
  164. package/dist/libs/use-floating-z-index.js +16 -0
  165. package/dist/libs/use-isomorphic-layout-effect.js +5 -5
  166. package/dist/scripts/AsheeThemeScript.js +35 -44
  167. package/dist/shared/radius.d.ts.map +1 -1
  168. package/dist/shared/radius.js +12 -13
  169. package/dist/shared/variant.js +46 -134
  170. package/dist/theme/color.js +28 -28
  171. package/dist/theme/controller.d.ts.map +1 -1
  172. package/dist/theme/controller.js +65 -178
  173. package/dist/theme/useTheme.js +13 -44
  174. package/dist/utils/cn.js +7 -7
  175. package/dist/utils/index.d.ts +1 -0
  176. package/dist/utils/index.d.ts.map +1 -1
  177. package/dist/utils/index.js +1 -0
  178. package/dist/utils/merge-object.js +13 -14
  179. package/dist/utils/resolve-token.js +11 -14
  180. package/dist/utils/stacking.d.ts +76 -0
  181. package/dist/utils/stacking.d.ts.map +1 -0
  182. package/dist/utils/stacking.js +34 -0
  183. package/package.json +12 -11
@@ -1,26 +1,24 @@
1
1
  "use client";
2
- import { jsxs as t, jsx as m } from "react/jsx-runtime";
3
- import { useMemo as i } from "react";
4
- import { resolveConfig as s } from "./config/resolve-config.js";
5
- import { AsheeConfigContext as f } from "./libs/context.js";
6
- import { useIsomorphicLayoutEffect as n } from "./libs/use-isomorphic-layout-effect.js";
7
- import { AsheeThemeScript as c } from "./scripts/AsheeThemeScript.js";
8
- import { themeController as h } from "./theme/controller.js";
9
- function g({
10
- config: o = {},
11
- children: r
12
- }) {
13
- const e = i(() => s(o), [o]);
14
- return n(() => {
15
- h.configure({
16
- defaultTheme: e.defaultTheme ?? "system",
17
- themes: Object.keys(e.color)
18
- });
19
- }, [e]), /* @__PURE__ */ t(f.Provider, { value: e, children: [
20
- /* @__PURE__ */ m(c, { config: e }),
21
- r
22
- ] });
2
+ "use client";
3
+ import { themeController as e } from "./theme/controller.js";
4
+ import { resolveConfig as t } from "./config/resolve-config.js";
5
+ import { AsheeConfigContext as n } from "./libs/context.js";
6
+ import { useIsomorphicLayoutEffect as r } from "./libs/use-isomorphic-layout-effect.js";
7
+ import { AsheeThemeScript as i } from "./scripts/AsheeThemeScript.js";
8
+ import { useMemo as a } from "react";
9
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
10
+ //#region src/AsheeUIProvider.tsx
11
+ function c({ config: c = {}, children: l }) {
12
+ let u = a(() => t(c), [c]);
13
+ return r(() => {
14
+ e.configure({
15
+ defaultTheme: u.defaultTheme ?? "system",
16
+ themes: Object.keys(u.color)
17
+ });
18
+ }, [u]), /* @__PURE__ */ s(n.Provider, {
19
+ value: u,
20
+ children: [/* @__PURE__ */ o(i, { config: u }), l]
21
+ });
23
22
  }
24
- export {
25
- g as AsheeUIProvider
26
- };
23
+ //#endregion
24
+ export { c as AsheeUIProvider };
@@ -1,174 +1,80 @@
1
1
  "use client";
2
- import { jsx as t, jsxs as u } from "react/jsx-runtime";
3
- import { forwardRef as Y, useId as ee, useCallback as O, useState as se } from "react";
4
- import { ChevronDownIcon as re } from "../../icons/ChevronDownIcon.js";
5
- import { useAsheeConfig as te } from "../../libs/context.js";
6
- import { resolveCascade as v, resolveRadiusKey as oe, resolveClassKey as A } from "../../utils/resolve-token.js";
7
- import { FALLBACK_ACCORDION_CONFIG as o } from "./accordion-config.js";
8
- import { ACCORDION_HEADER_SIZE_CLASS as ie, ACCORDION_CONTENT_SIZE_CLASS as ne, ACCORDION_VARIANT_ITEM_CLASS as _, ACCORDION_VARIANT_CONTAINER_CLASS as R } from "./accordion-styles.js";
9
- import { RADIUS_CLASS as ae } from "../../shared/radius.js";
10
- import { cn as n } from "../../utils/cn.js";
11
- const le = Y(
12
- ({
13
- items: g = [],
14
- variant: z,
15
- size: K,
16
- radius: D,
17
- allowMultiple: E,
18
- defaultValue: L,
19
- value: b,
20
- onValueChange: d,
21
- expandIcon: T,
22
- disableAnimation: h = !1,
23
- itemClassName: $,
24
- headerClassName: M,
25
- contentClassName: j,
26
- className: V,
27
- style: F,
28
- id: Z,
29
- ...k
30
- }, B) => {
31
- var S;
32
- const f = te(), s = (S = f.components) == null ? void 0 : S.accordion, G = ee(), m = Z ?? G, x = v(
33
- K,
34
- s == null ? void 0 : s.size,
35
- void 0,
36
- o.size
37
- ), i = v(
38
- z,
39
- s == null ? void 0 : s.variant,
40
- f.defaultVariant,
41
- o.variant
42
- ), w = v(
43
- E,
44
- s == null ? void 0 : s.allowMultiple,
45
- void 0,
46
- o.allowMultiple
47
- ), H = oe(
48
- D,
49
- s == null ? void 0 : s.radius,
50
- f.defaultRadius,
51
- o.radius
52
- ), U = R[i] ?? R.separated, q = _[i] ?? _.separated, J = A(
53
- x,
54
- ie,
55
- o.size
56
- ), P = A(
57
- x,
58
- ne,
59
- o.size
60
- ), I = A(
61
- H,
62
- ae,
63
- o.radius
64
- ), p = b !== void 0, C = O(
65
- (e) => e === void 0 ? [] : Array.isArray(e) ? e : [e],
66
- []
67
- ), [Q, W] = se(
68
- () => C(L)
69
- ), a = p ? C(b) : Q, X = O(
70
- (e, N) => {
71
- if (N) return;
72
- let r;
73
- a.includes(e) ? r = a.filter((c) => c !== e) : r = w ? [...a, e] : [e], p || W(r), d == null || d(r);
74
- },
75
- [a, p, d, w]
76
- );
77
- return /* @__PURE__ */ t(
78
- "div",
79
- {
80
- ref: B,
81
- id: m,
82
- className: n(
83
- "w-full",
84
- U,
85
- i !== "ghost" && i !== "flush" && I,
86
- V
87
- ),
88
- style: F,
89
- ...k,
90
- children: g.map((e, N) => {
91
- const r = e.id || `item-${N}`, l = a.includes(r), c = `${m}-header-${r}`, y = `${m}-content-${r}`;
92
- return /* @__PURE__ */ u(
93
- "div",
94
- {
95
- className: n(
96
- "w-full transition-colors box-border",
97
- q,
98
- (i === "separated" || i === "ghost") && I,
99
- $
100
- ),
101
- children: [
102
- /* @__PURE__ */ u(
103
- "button",
104
- {
105
- id: c,
106
- type: "button",
107
- "aria-expanded": l,
108
- "aria-controls": y,
109
- disabled: e.disabled,
110
- onClick: () => X(r, e.disabled),
111
- className: n(
112
- "w-full min-w-full text-left flex items-center justify-between gap-3 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-inset text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed select-none box-border",
113
- J,
114
- M
115
- ),
116
- children: [
117
- /* @__PURE__ */ u("div", { className: "flex items-center gap-3 min-w-0 flex-1", children: [
118
- e.icon && /* @__PURE__ */ t("span", { className: "shrink-0 text-foreground/70", children: e.icon }),
119
- /* @__PURE__ */ u("div", { className: "flex flex-col min-w-0", children: [
120
- /* @__PURE__ */ t("span", { className: "font-semibold truncate", children: e.title }),
121
- e.subtitle && /* @__PURE__ */ t("span", { className: "text-xs text-foreground/70 truncate", children: e.subtitle })
122
- ] })
123
- ] }),
124
- /* @__PURE__ */ t(
125
- "div",
126
- {
127
- className: n(
128
- "text-foreground/70 shrink-0 ml-2 transition-transform duration-200 ease-in-out",
129
- h ? "transition-none" : "",
130
- l && "rotate-180"
131
- ),
132
- children: T || /* @__PURE__ */ t(re, { className: "w-4 h-4" })
133
- }
134
- )
135
- ]
136
- }
137
- ),
138
- /* @__PURE__ */ t(
139
- "section",
140
- {
141
- id: y,
142
- "aria-labelledby": c,
143
- "data-state": l ? "open" : "closed",
144
- className: n(
145
- "w-full grid transition-[grid-template-rows,opacity] duration-250 ease-[cubic-bezier(0.16,1,0.3,1)]",
146
- h ? "transition-none" : "",
147
- l ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0 pointer-events-none"
148
- ),
149
- children: /* @__PURE__ */ t("div", { className: "scrollbar-hide overflow-hidden w-full", children: /* @__PURE__ */ t(
150
- "div",
151
- {
152
- className: n(
153
- "text-foreground/70 leading-relaxed pt-0",
154
- P,
155
- j
156
- ),
157
- children: e.content
158
- }
159
- ) })
160
- }
161
- )
162
- ]
163
- },
164
- r
165
- );
166
- })
167
- }
168
- );
169
- }
170
- );
171
- le.displayName = "Accordion";
172
- export {
173
- le as Accordion
174
- };
2
+ "use client";
3
+ import { cn as e } from "../../utils/cn.js";
4
+ import { useAsheeConfig as t } from "../../libs/context.js";
5
+ import { ChevronDownIcon as n } from "../../icons/ChevronDownIcon.js";
6
+ import { RADIUS_CLASS as r } from "../../shared/radius.js";
7
+ import { resolveCascade as i, resolveClassKey as a, resolveRadiusKey as o } from "../../utils/resolve-token.js";
8
+ import { FALLBACK_ACCORDION_CONFIG as s } from "./accordion-config.js";
9
+ import { ACCORDION_CONTENT_SIZE_CLASS as c, ACCORDION_HEADER_SIZE_CLASS as l, ACCORDION_VARIANT_CONTAINER_CLASS as u, ACCORDION_VARIANT_ITEM_CLASS as d } from "./accordion-styles.js";
10
+ import { forwardRef as f, useCallback as p, useId as m, useState as h } from "react";
11
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
12
+ //#region src/components/accordion/Accordion.tsx
13
+ var v = f(({ items: f = [], variant: v, size: y, radius: b, allowMultiple: x, defaultValue: S, value: C, onValueChange: w, expandIcon: T, disableAnimation: E = !1, itemClassName: D, headerClassName: O, contentClassName: k, className: A, style: j, id: M, ...N }, P) => {
14
+ let F = t(), I = F.components?.accordion, L = m(), R = M ?? L, z = i(y, I?.size, void 0, s.size), B = i(v, I?.variant, F.defaultVariant, s.variant), V = i(x, I?.allowMultiple, void 0, s.allowMultiple), H = o(b, I?.radius, F.defaultRadius, s.radius), U = u[B] ?? u.separated, W = d[B] ?? d.separated, G = a(z, l, s.size), K = a(z, c, s.size), q = a(H, r, s.radius), J = C !== void 0, Y = p((e) => e === void 0 ? [] : Array.isArray(e) ? e : [e], []), [X, Z] = h(() => Y(S)), Q = J ? Y(C) : X, $ = p((e, t) => {
15
+ if (t) return;
16
+ let n;
17
+ n = Q.includes(e) ? Q.filter((t) => t !== e) : V ? [...Q, e] : [e], J || Z(n), w?.(n);
18
+ }, [
19
+ Q,
20
+ J,
21
+ w,
22
+ V
23
+ ]);
24
+ return /* @__PURE__ */ g("div", {
25
+ ref: P,
26
+ id: R,
27
+ className: e("w-full", U, B !== "ghost" && B !== "flush" && q, A),
28
+ style: j,
29
+ ...N,
30
+ children: f.map((t, r) => {
31
+ let i = t.id || `item-${r}`, a = Q.includes(i), o = `${R}-header-${i}`, s = `${R}-content-${i}`;
32
+ return /* @__PURE__ */ _("div", {
33
+ className: e("w-full transition-colors box-border", W, (B === "separated" || B === "ghost") && q, D),
34
+ children: [/* @__PURE__ */ _("button", {
35
+ id: o,
36
+ type: "button",
37
+ "aria-expanded": a,
38
+ "aria-controls": s,
39
+ disabled: t.disabled,
40
+ onClick: () => $(i, t.disabled),
41
+ className: e("w-full min-w-full text-left flex items-center justify-between gap-3 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-inset text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed select-none box-border", G, O),
42
+ children: [/* @__PURE__ */ _("div", {
43
+ className: "flex items-center gap-3 min-w-0 flex-1",
44
+ children: [t.icon && /* @__PURE__ */ g("span", {
45
+ className: "shrink-0 text-foreground/70",
46
+ children: t.icon
47
+ }), /* @__PURE__ */ _("div", {
48
+ className: "flex flex-col min-w-0",
49
+ children: [/* @__PURE__ */ g("span", {
50
+ className: "font-semibold truncate",
51
+ children: t.title
52
+ }), t.subtitle && /* @__PURE__ */ g("span", {
53
+ className: "text-xs text-foreground/70 truncate",
54
+ children: t.subtitle
55
+ })]
56
+ })]
57
+ }), /* @__PURE__ */ g("div", {
58
+ className: e("text-foreground/70 shrink-0 ml-2 transition-transform duration-200 ease-in-out", E ? "transition-none" : "", a && "rotate-180"),
59
+ children: T || /* @__PURE__ */ g(n, { className: "w-4 h-4" })
60
+ })]
61
+ }), /* @__PURE__ */ g("section", {
62
+ id: s,
63
+ "aria-labelledby": o,
64
+ "data-state": a ? "open" : "closed",
65
+ className: e("w-full grid transition-[grid-template-rows,opacity] duration-250 ease-[cubic-bezier(0.16,1,0.3,1)]", E ? "transition-none" : "", a ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0 pointer-events-none"),
66
+ children: /* @__PURE__ */ g("div", {
67
+ className: "scrollbar-hide overflow-hidden w-full",
68
+ children: /* @__PURE__ */ g("div", {
69
+ className: e("text-foreground/70 leading-relaxed pt-0", K, k),
70
+ children: t.content
71
+ })
72
+ })
73
+ })]
74
+ }, i);
75
+ })
76
+ });
77
+ });
78
+ v.displayName = "Accordion";
79
+ //#endregion
80
+ export { v as Accordion };
@@ -1,17 +1,16 @@
1
1
  "use client";
2
2
  import { registerComponentDefaults as e } from "../../libs/registry.js";
3
- const o = {
4
- size: "md",
5
- allowMultiple: !1
3
+ //#region src/components/accordion/accordion-config.ts
4
+ var t = {
5
+ size: "md",
6
+ allowMultiple: !1
6
7
  };
7
- e("accordion", o);
8
- const t = {
9
- size: "md",
10
- variant: "separated",
11
- radius: "md",
12
- allowMultiple: !1
13
- };
14
- export {
15
- t as FALLBACK_ACCORDION_CONFIG,
16
- o as defaultAccordionConfig
8
+ e("accordion", t);
9
+ var n = {
10
+ size: "md",
11
+ variant: "separated",
12
+ radius: "md",
13
+ allowMultiple: !1
17
14
  };
15
+ //#endregion
16
+ export { n as FALLBACK_ACCORDION_CONFIG, t as defaultAccordionConfig };
@@ -1,26 +1,23 @@
1
1
  "use client";
2
- const r = {
3
- sm: "px-3.5 py-2 text-xs",
4
- md: "px-5 py-3.5 text-sm",
5
- lg: "px-6 py-4 text-base"
6
- }, e = {
7
- sm: "px-3.5 pb-2 text-xs",
8
- md: "px-5 pb-3.5 text-sm",
9
- lg: "px-6 pb-4 text-base"
10
- }, o = {
11
- bordered: "border border-border divide-y divide-border",
12
- separated: "space-y-3",
13
- ghost: "divide-y divide-border border-y border-border",
14
- flush: "space-y-1"
15
- }, s = {
16
- bordered: "bg-secondary transition-colors hover:bg-foreground/10",
17
- separated: "border border-border bg-secondary transition-colors hover:bg-secondary/30 shadow-xs",
18
- ghost: "bg-transparent transition-colors hover:bg-secondary/20",
19
- flush: "bg-transparent hover:bg-secondary/50 transition-colors"
20
- };
21
- export {
22
- e as ACCORDION_CONTENT_SIZE_CLASS,
23
- r as ACCORDION_HEADER_SIZE_CLASS,
24
- o as ACCORDION_VARIANT_CONTAINER_CLASS,
25
- s as ACCORDION_VARIANT_ITEM_CLASS
2
+ //#region src/components/accordion/accordion-styles.ts
3
+ var e = {
4
+ sm: "px-3.5 py-2 text-xs",
5
+ md: "px-5 py-3.5 text-sm",
6
+ lg: "px-6 py-4 text-base"
7
+ }, t = {
8
+ sm: "px-3.5 pb-2 text-xs",
9
+ md: "px-5 pb-3.5 text-sm",
10
+ lg: "px-6 pb-4 text-base"
11
+ }, n = {
12
+ bordered: "border border-border divide-y divide-border",
13
+ separated: "space-y-3",
14
+ ghost: "divide-y divide-border border-y border-border",
15
+ flush: "space-y-1"
16
+ }, r = {
17
+ bordered: "bg-secondary transition-colors hover:bg-foreground/10",
18
+ separated: "border border-border bg-secondary transition-colors hover:bg-secondary/30 shadow-xs",
19
+ ghost: "bg-transparent transition-colors hover:bg-secondary/20",
20
+ flush: "bg-transparent hover:bg-secondary/50 transition-colors"
26
21
  };
22
+ //#endregion
23
+ export { t as ACCORDION_CONTENT_SIZE_CLASS, e as ACCORDION_HEADER_SIZE_CLASS, n as ACCORDION_VARIANT_CONTAINER_CLASS, r as ACCORDION_VARIANT_ITEM_CLASS };
@@ -1,137 +1,79 @@
1
1
  "use client";
2
- import { jsxs as V, jsx as A } from "react/jsx-runtime";
3
- import { useFocus as g, useDismiss as C, useRole as ee, useInteractions as te } from "@floating-ui/react";
4
- import { forwardRef as se, useMemo as F, useState as K, useEffect as re, useCallback as L } from "react";
5
- import { useAsheeConfig as oe } from "../../libs/context.js";
6
- import { resolveCascade as v, resolveRadiusKey as ie } from "../../utils/resolve-token.js";
7
- import { Input as le } from "../input/Input.js";
8
- import { SelectMenu as ce } from "../select-menu/SelectMenu.js";
9
- import { FALLBACK_AUTOCOMPLETE_CONFIG as p } from "./autocomplete-config.js";
10
- import { useSelectFloating as fe } from "../select-menu/use-select-floating.js";
11
- const me = se(
12
- ({
13
- options: o = [],
14
- value: s,
15
- onValueChange: r,
16
- onInputChange: l,
17
- allowCustomValue: R = !1,
18
- belowList: M,
19
- menu: P,
20
- variant: z,
21
- color: w,
22
- radius: E,
23
- size: N,
24
- endContent: T,
25
- onClick: n,
26
- disabled: O,
27
- placeholder: j = "Type to search...",
28
- className: _,
29
- ...B
30
- }, c) => {
31
- var b;
32
- const f = oe(), e = (b = f.components) == null ? void 0 : b.autocomplete, D = v(
33
- z,
34
- e == null ? void 0 : e.variant,
35
- f.defaultVariant,
36
- p.variant
37
- ), G = v(
38
- w,
39
- e == null ? void 0 : e.color,
40
- f.defaultColor,
41
- p.color
42
- ), I = ie(
43
- E,
44
- e == null ? void 0 : e.radius,
45
- f.defaultRadius,
46
- p.radius
47
- ), U = v(
48
- N,
49
- e == null ? void 0 : e.size,
50
- void 0,
51
- p.size
52
- ), i = F(
53
- () => o.find((t) => t.value === s),
54
- [o, s]
55
- ), [S, m] = K(!1), [a, u] = K(
56
- () => i ? i.label : String(s ?? "")
57
- );
58
- re(() => {
59
- i ? u(i.label) : s != null && u(String(s));
60
- }, [i, s]);
61
- const { refs: x, context: d, isPositioned: q, floatingStyles: H } = fe({
62
- isOpen: S,
63
- onOpenChange: m,
64
- disabled: O
65
- }), J = g(d), Q = C(d), W = ee(d, { role: "combobox" }), { getReferenceProps: X, getFloatingProps: Y } = te([
66
- J,
67
- Q,
68
- W
69
- ]), Z = F(() => a.trim() ? o.filter(
70
- (t) => t.label.toLowerCase().includes(a.toLowerCase())
71
- ) : o, [o, a]), $ = L(
72
- (t) => {
73
- const y = t.target.value;
74
- u(y), l == null || l(y), m(!0), R && (r == null || r(y));
75
- },
76
- [R, l, r]
77
- ), k = L(
78
- (t) => {
79
- u(t.label), r == null || r(t.value, t), m(!1);
80
- },
81
- [r]
82
- ), h = F(
83
- () => s != null ? [s] : [],
84
- [s]
85
- );
86
- return /* @__PURE__ */ V("div", { className: "w-full relative inline-block", children: [
87
- /* @__PURE__ */ A(
88
- le,
89
- {
90
- ref: (t) => {
91
- x.setReference(t), typeof c == "function" ? c(t) : c && (c.current = t);
92
- },
93
- variant: D,
94
- radius: I,
95
- color: G,
96
- size: U,
97
- disabled: O,
98
- placeholder: j,
99
- value: a,
100
- onChange: $,
101
- onClick: (t) => {
102
- O || m(!0), n == null || n(t);
103
- },
104
- "aria-expanded": S,
105
- "aria-autocomplete": "none",
106
- endContent: T,
107
- className: _,
108
- ...X(B)
109
- }
110
- ),
111
- /* @__PURE__ */ A(
112
- ce,
113
- {
114
- isOpen: S,
115
- floatingStyles: H,
116
- context: d,
117
- getFloatingProps: Y,
118
- setFloatingRef: x.setFloating,
119
- isPositioned: q,
120
- options: Z,
121
- selectedValues: h,
122
- onSelectMenuOption: k,
123
- isSearch: !1,
124
- belowList: M,
125
- menuProps: P,
126
- menuConfig: e == null ? void 0 : e.menu,
127
- initialFocus: -1,
128
- returnFocus: !1
129
- }
130
- )
131
- ] });
132
- }
133
- );
134
- me.displayName = "Autocomplete";
135
- export {
136
- me as Autocomplete
137
- };
2
+ "use client";
3
+ import { useAsheeConfig as e } from "../../libs/context.js";
4
+ import { resolveCascade as t, resolveRadiusKey as n } from "../../utils/resolve-token.js";
5
+ import { Input as r } from "../input/Input.js";
6
+ import { SelectMenu as i } from "../select-menu/SelectMenu.js";
7
+ import { useSelectFloating as a } from "../select-menu/use-select-floating.js";
8
+ import { FALLBACK_AUTOCOMPLETE_CONFIG as o } from "./autocomplete-config.js";
9
+ import { forwardRef as s, useCallback as c, useEffect as l, useMemo as u, useState as d } from "react";
10
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
11
+ import { useDismiss as m, useFocus as h, useInteractions as g, useRole as _ } from "@floating-ui/react";
12
+ //#region src/components/autocomplete/Autocomplete.tsx
13
+ var v = s(({ options: s = [], value: v, onValueChange: y, onInputChange: b, allowCustomValue: x = !1, belowList: S, menu: C, variant: w, color: T, radius: E, size: D, endContent: O, onClick: k, disabled: A, placeholder: j = "Type to search...", className: M, ...N }, P) => {
14
+ let F = e(), I = F.components?.autocomplete, L = t(w, I?.variant, F.defaultVariant, o.variant), R = t(T, I?.color, F.defaultColor, o.color), z = n(E, I?.radius, F.defaultRadius, o.radius), ee = t(D, I?.size, void 0, o.size), B = u(() => s.find((e) => e.value === v), [s, v]), [V, H] = d(!1), [U, W] = d(() => B ? B.label : String(v ?? ""));
15
+ l(() => {
16
+ B ? W(B.label) : v != null && W(String(v));
17
+ }, [B, v]);
18
+ let { refs: G, context: K, isPositioned: q, floatingStyles: J } = a({
19
+ isOpen: V,
20
+ onOpenChange: H,
21
+ disabled: A
22
+ }), Y = h(K), X = m(K), Z = _(K, { role: "combobox" }), { getReferenceProps: Q, getFloatingProps: $ } = g([
23
+ Y,
24
+ X,
25
+ Z
26
+ ]), te = u(() => U.trim() ? s.filter((e) => e.label.toLowerCase().includes(U.toLowerCase())) : s, [s, U]), ne = c((e) => {
27
+ let t = e.target.value;
28
+ W(t), b?.(t), H(!0), x && y?.(t);
29
+ }, [
30
+ x,
31
+ b,
32
+ y
33
+ ]), re = c((e) => {
34
+ W(e.label), y?.(e.value, e), H(!1);
35
+ }, [y]), ie = u(() => v == null ? [] : [v], [v]);
36
+ return /* @__PURE__ */ p("div", {
37
+ className: "w-full relative inline-block",
38
+ children: [/* @__PURE__ */ f(r, {
39
+ ref: (e) => {
40
+ G.setReference(e), typeof P == "function" ? P(e) : P && (P.current = e);
41
+ },
42
+ variant: L,
43
+ radius: z,
44
+ color: R,
45
+ size: ee,
46
+ disabled: A,
47
+ placeholder: j,
48
+ value: U,
49
+ onChange: ne,
50
+ onClick: (e) => {
51
+ A || H(!0), k?.(e);
52
+ },
53
+ "aria-expanded": V,
54
+ "aria-autocomplete": "none",
55
+ endContent: O,
56
+ className: M,
57
+ ...Q(N)
58
+ }), /* @__PURE__ */ f(i, {
59
+ isOpen: V,
60
+ floatingStyles: J,
61
+ context: K,
62
+ getFloatingProps: $,
63
+ setFloatingRef: G.setFloating,
64
+ isPositioned: q,
65
+ options: te,
66
+ selectedValues: ie,
67
+ onSelectMenuOption: re,
68
+ isSearch: !1,
69
+ belowList: S,
70
+ menuProps: C,
71
+ menuConfig: I?.menu,
72
+ initialFocus: -1,
73
+ returnFocus: !1
74
+ })]
75
+ });
76
+ });
77
+ v.displayName = "Autocomplete";
78
+ //#endregion
79
+ export { v as Autocomplete };
@@ -1,14 +1,9 @@
1
1
  "use client";
2
- import { registerComponentDefaults as o } from "../../libs/registry.js";
2
+ import { registerComponentDefaults as e } from "../../libs/registry.js";
3
3
  import { FALLBACK_FIELD_CONFIG as t } from "../field/field-config.js";
4
- import { defaultInputConfig as e } from "../input/input-config.js";
5
- const m = {
6
- ...e
7
- }, p = {
8
- ...t
9
- };
10
- o("autocomplete", m);
11
- export {
12
- p as FALLBACK_AUTOCOMPLETE_CONFIG,
13
- m as defaultAutocompleteConfig
14
- };
4
+ import { defaultInputConfig as n } from "../input/input-config.js";
5
+ //#region src/components/autocomplete/autocomplete-config.ts
6
+ var r = { ...n }, i = { ...t };
7
+ e("autocomplete", r);
8
+ //#endregion
9
+ export { i as FALLBACK_AUTOCOMPLETE_CONFIG, r as defaultAutocompleteConfig };