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.
Files changed (184) hide show
  1. package/README.md +1 -14
  2. package/dist/AsheeUIProvider.js +22 -24
  3. package/dist/components/accordion/Accordion.js +79 -173
  4. package/dist/components/accordion/accordion-config.js +12 -13
  5. package/dist/components/accordion/accordion-styles.js +21 -24
  6. package/dist/components/autocomplete/Autocomplete.js +78 -136
  7. package/dist/components/autocomplete/autocomplete-config.js +7 -12
  8. package/dist/components/button/Button.d.ts +29 -1
  9. package/dist/components/button/Button.d.ts.map +1 -1
  10. package/dist/components/button/Button.js +47 -108
  11. package/dist/components/button/button-config.js +16 -17
  12. package/dist/components/button/button-styles.js +10 -11
  13. package/dist/components/card/Card.d.ts +36 -16
  14. package/dist/components/card/Card.d.ts.map +1 -1
  15. package/dist/components/card/Card.js +115 -205
  16. package/dist/components/card/card-config.js +24 -21
  17. package/dist/components/card/card-styles.js +19 -22
  18. package/dist/components/carousel/Carousel.js +123 -248
  19. package/dist/components/carousel/carousel-config.js +24 -25
  20. package/dist/components/carousel/carousel-styles.js +14 -16
  21. package/dist/components/chip/Chip.js +84 -191
  22. package/dist/components/chip/chip-config.js +13 -14
  23. package/dist/components/chip/chip-styles.js +22 -26
  24. package/dist/components/date-picker/Calendar.d.ts +3 -3
  25. package/dist/components/date-picker/Calendar.d.ts.map +1 -1
  26. package/dist/components/date-picker/Calendar.js +141 -222
  27. package/dist/components/date-picker/DatePicker.d.ts +5 -5
  28. package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
  29. package/dist/components/date-picker/DatePicker.js +122 -220
  30. package/dist/components/date-picker/TimeSpinner.js +58 -82
  31. package/dist/components/date-picker/date-picker-config.d.ts +4 -4
  32. package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
  33. package/dist/components/date-picker/date-picker-config.js +10 -11
  34. package/dist/components/date-picker/date-picker-styles.js +44 -45
  35. package/dist/components/date-picker/date-picker.helpers.d.ts +4 -4
  36. package/dist/components/date-picker/date-picker.helpers.d.ts.map +1 -1
  37. package/dist/components/date-picker/date-picker.helpers.js +74 -102
  38. package/dist/components/drawer/Drawer.d.ts +26 -8
  39. package/dist/components/drawer/Drawer.d.ts.map +1 -1
  40. package/dist/components/drawer/Drawer.js +54 -131
  41. package/dist/components/drawer/drawer-config.js +14 -15
  42. package/dist/components/drawer/drawer-styles.js +38 -42
  43. package/dist/components/field/FieldShell.js +49 -56
  44. package/dist/components/field/field-config.js +17 -18
  45. package/dist/components/field/field-styles.js +8 -8
  46. package/dist/components/image/Image.d.ts +7 -7
  47. package/dist/components/image/Image.d.ts.map +1 -1
  48. package/dist/components/image/Image.js +65 -132
  49. package/dist/components/image/image-config.js +17 -18
  50. package/dist/components/image/image-styles.js +14 -15
  51. package/dist/components/input/Input.js +65 -150
  52. package/dist/components/input/PasswordInput.js +30 -49
  53. package/dist/components/input/input-config.js +7 -7
  54. package/dist/components/input/input-styles.js +9 -10
  55. package/dist/components/keyboard/KeyboardContext.js +10 -11
  56. package/dist/components/keyboard/KeyboardProvider.js +100 -181
  57. package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
  58. package/dist/components/keyboard/OnScreenKeyboard.js +159 -166
  59. package/dist/components/keyboard/keyboard-config.js +59 -57
  60. package/dist/components/keyboard/keyboard-styles.js +10 -11
  61. package/dist/components/keyboard/use-keyboard-field.js +29 -21
  62. package/dist/components/link/Link.js +47 -137
  63. package/dist/components/link/link-config.js +14 -15
  64. package/dist/components/link/link-styles.js +25 -29
  65. package/dist/components/marquee/Marquee.js +55 -144
  66. package/dist/components/marquee/marquee-config.js +18 -19
  67. package/dist/components/marquee/marquee-styles.js +13 -15
  68. package/dist/components/modal/Modal.d.ts +26 -10
  69. package/dist/components/modal/Modal.d.ts.map +1 -1
  70. package/dist/components/modal/Modal.js +56 -136
  71. package/dist/components/modal/modal-config.js +15 -16
  72. package/dist/components/modal/modal-styles.js +13 -14
  73. package/dist/components/multi-select/MultiSelect.d.ts +18 -2
  74. package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
  75. package/dist/components/multi-select/MultiSelect.js +149 -283
  76. package/dist/components/multi-select/multi-select-config.d.ts +23 -18
  77. package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
  78. package/dist/components/multi-select/multi-select-config.js +18 -21
  79. package/dist/components/multi-select/multi-select-styles.js +17 -20
  80. package/dist/components/radio/Radio.js +43 -80
  81. package/dist/components/radio/RadioGroup.js +57 -155
  82. package/dist/components/radio/radio-config.js +15 -16
  83. package/dist/components/radio/radio-context.js +6 -6
  84. package/dist/components/radio/radio-styles.js +55 -60
  85. package/dist/components/resizable-screen/ResizableScreen.js +87 -177
  86. package/dist/components/resizable-screen/resizable-screen-config.js +16 -17
  87. package/dist/components/select/Select.d.ts +3 -2
  88. package/dist/components/select/Select.d.ts.map +1 -1
  89. package/dist/components/select/Select.js +97 -195
  90. package/dist/components/select/select-config.js +8 -9
  91. package/dist/components/select/select-styles.js +5 -5
  92. package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
  93. package/dist/components/select-menu/SelectMenu.js +102 -196
  94. package/dist/components/select-menu/select-menu-config.js +12 -12
  95. package/dist/components/select-menu/use-select-floating.d.ts +11 -1
  96. package/dist/components/select-menu/use-select-floating.d.ts.map +1 -1
  97. package/dist/components/select-menu/use-select-floating.js +41 -48
  98. package/dist/components/sidebar/Sidebar.d.ts +43 -22
  99. package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
  100. package/dist/components/sidebar/Sidebar.js +146 -331
  101. package/dist/components/sidebar/sidebar-config.d.ts +98 -31
  102. package/dist/components/sidebar/sidebar-config.d.ts.map +1 -1
  103. package/dist/components/sidebar/sidebar-config.js +47 -33
  104. package/dist/components/sidebar/sidebar-styles.js +27 -32
  105. package/dist/components/spinner/spinner-config.js +12 -13
  106. package/dist/components/spinner/spinner-styles.js +13 -14
  107. package/dist/components/spinner/spinner.js +39 -82
  108. package/dist/components/switch/Switch.js +62 -154
  109. package/dist/components/switch/switch-config.js +11 -12
  110. package/dist/components/switch/switch-styles.js +14 -16
  111. package/dist/components/table/Table.js +64 -186
  112. package/dist/components/table/table-config.js +17 -18
  113. package/dist/components/table/table-styles.js +48 -52
  114. package/dist/components/tabs/Tabs.d.ts +16 -8
  115. package/dist/components/tabs/Tabs.d.ts.map +1 -1
  116. package/dist/components/tabs/Tabs.js +93 -208
  117. package/dist/components/tabs/tabs-config.d.ts +42 -20
  118. package/dist/components/tabs/tabs-config.d.ts.map +1 -1
  119. package/dist/components/tabs/tabs-config.js +26 -18
  120. package/dist/components/tabs/tabs-styles.js +15 -17
  121. package/dist/components/textarea/Textarea.js +52 -138
  122. package/dist/components/textarea/textarea-config.js +10 -11
  123. package/dist/components/textarea/textarea-styles.js +9 -10
  124. package/dist/components/toast/ToastContext.js +22 -26
  125. package/dist/components/toast/ToastItem.js +82 -144
  126. package/dist/components/toast/ToastProvider.d.ts.map +1 -1
  127. package/dist/components/toast/ToastProvider.js +128 -190
  128. package/dist/components/toast/toast-config.js +23 -24
  129. package/dist/components/toast/toast-styles.js +50 -55
  130. package/dist/components/toast/use-pausable-timeout.js +17 -13
  131. package/dist/components/tooltip/Tooltip.d.ts +5 -0
  132. package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
  133. package/dist/components/tooltip/Tooltip.js +68 -158
  134. package/dist/components/tooltip/tooltip-config.d.ts +25 -0
  135. package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
  136. package/dist/components/tooltip/tooltip-config.js +26 -22
  137. package/dist/components/tooltip/tooltip-styles.js +15 -17
  138. package/dist/config/default-config.js +11 -34
  139. package/dist/config/resolve-color.js +23 -23
  140. package/dist/config/resolve-config.d.ts.map +1 -1
  141. package/dist/config/resolve-config.js +14 -12
  142. package/dist/icons/ArrowLeftIcon.js +16 -19
  143. package/dist/icons/CalendarIcon.js +43 -24
  144. package/dist/icons/CheckIcon.js +16 -19
  145. package/dist/icons/ChevronDownIcon.js +15 -21
  146. package/dist/icons/ChevronLeftIcon.js +16 -19
  147. package/dist/icons/ChevronRightIcon.js +16 -19
  148. package/dist/icons/ChevronUpIcon.js +16 -19
  149. package/dist/icons/ClearIcon.js +26 -22
  150. package/dist/icons/ClockIcon.js +20 -22
  151. package/dist/icons/CloseIcon.js +26 -22
  152. package/dist/icons/ErrorIcon.js +16 -19
  153. package/dist/icons/ExternalLinkIcon.js +25 -23
  154. package/dist/icons/EyeIcon.js +20 -22
  155. package/dist/icons/EyeOffIcon.js +21 -22
  156. package/dist/icons/InfoIcon.js +16 -19
  157. package/dist/icons/SearchIcon.js +25 -22
  158. package/dist/icons/WarningIcon.js +16 -19
  159. package/dist/index.js +65 -163
  160. package/dist/libs/context.js +10 -13
  161. package/dist/libs/index.js +1 -0
  162. package/dist/libs/registry.js +10 -12
  163. package/dist/libs/use-floating-z-index.d.ts +32 -0
  164. package/dist/libs/use-floating-z-index.d.ts.map +1 -0
  165. package/dist/libs/use-floating-z-index.js +16 -0
  166. package/dist/libs/use-isomorphic-layout-effect.js +5 -5
  167. package/dist/scripts/AsheeThemeScript.js +35 -44
  168. package/dist/shared/radius.d.ts.map +1 -1
  169. package/dist/shared/radius.js +12 -13
  170. package/dist/shared/variant.js +46 -134
  171. package/dist/theme/color.js +28 -28
  172. package/dist/theme/controller.d.ts.map +1 -1
  173. package/dist/theme/controller.js +65 -178
  174. package/dist/theme/useTheme.js +13 -44
  175. package/dist/utils/cn.js +7 -7
  176. package/dist/utils/index.d.ts +1 -0
  177. package/dist/utils/index.d.ts.map +1 -1
  178. package/dist/utils/index.js +1 -0
  179. package/dist/utils/merge-object.js +13 -14
  180. package/dist/utils/resolve-token.js +11 -14
  181. package/dist/utils/stacking.d.ts +76 -0
  182. package/dist/utils/stacking.d.ts.map +1 -0
  183. package/dist/utils/stacking.js +34 -0
  184. package/package.json +12 -11
@@ -1,179 +1,89 @@
1
1
  "use client";
2
- import { jsxs as ee, jsx as v } from "react/jsx-runtime";
3
- import { forwardRef as te, useState as H, useRef as re, useCallback as k } from "react";
4
- import { useAsheeConfig as oe } from "../../libs/context.js";
2
+ "use client";
3
+ import { cn as e } from "../../utils/cn.js";
4
+ import { useAsheeConfig as t } from "../../libs/context.js";
5
5
  import { resolveCascade as n } from "../../utils/resolve-token.js";
6
- import { FALLBACK_RESIZABLE_SCREEN_CONFIG as l } from "./resizable-screen-config.js";
7
- import { cn as c } from "../../utils/cn.js";
8
- const ie = te(
9
- ({
10
- children: A,
11
- left: I,
12
- size: w,
13
- defaultSize: M,
14
- minSize: N,
15
- maxSize: E,
16
- step: K,
17
- orientation: L,
18
- hideHandle: $,
19
- onSizeChange: d,
20
- handleClassName: S,
21
- minContainerHeight: j = 200,
22
- minContainerWidth: B = 200,
23
- className: U,
24
- style: _,
25
- ...F
26
- }, u) => {
27
- var R;
28
- const t = (R = oe().components) == null ? void 0 : R.resizableScreen, h = n(
29
- N,
30
- t == null ? void 0 : t.minSize,
31
- void 0,
32
- l.minSize
33
- ), f = n(
34
- E,
35
- t == null ? void 0 : t.maxSize,
36
- void 0,
37
- l.maxSize
38
- ), D = n(
39
- K,
40
- t == null ? void 0 : t.step,
41
- void 0,
42
- l.step
43
- ), z = n(
44
- L,
45
- t == null ? void 0 : t.orientation,
46
- void 0,
47
- l.orientation
48
- ), G = n(
49
- $,
50
- t == null ? void 0 : t.hideHandle,
51
- void 0,
52
- l.hideHandle
53
- ), O = n(
54
- M,
55
- t == null ? void 0 : t.defaultSize,
56
- void 0,
57
- l.defaultSize
58
- ), T = w ?? I ?? O, [W, X] = H(T), [o, b] = H(!1), x = re(null), y = w !== void 0, a = y ? w : W, g = k(
59
- (e) => Math.min(Math.max(e, h), f),
60
- [h, f]
61
- ), s = k(
62
- (e) => {
63
- const r = g(e);
64
- y || X(r), d == null || d(r);
65
- },
66
- [g, y, d]
67
- ), Y = (e) => {
68
- e.preventDefault(), e.currentTarget.setPointerCapture(e.pointerId), b(!0);
69
- }, Z = (e) => {
70
- if (!o || !x.current) return;
71
- const r = x.current.getBoundingClientRect(), m = z === "horizontal", p = m ? r.width : r.height, V = m ? e.clientX - r.left : e.clientY - r.top;
72
- if (p > 0) {
73
- const C = V / p * 100;
74
- s(C);
75
- }
76
- }, P = (e) => {
77
- if (o) {
78
- try {
79
- e.currentTarget.releasePointerCapture(e.pointerId);
80
- } catch {
81
- }
82
- b(!1);
83
- }
84
- }, q = (e) => {
85
- const r = z === "horizontal", m = r ? "ArrowLeft" : "ArrowUp", p = r ? "ArrowRight" : "ArrowDown";
86
- e.key === m ? (e.preventDefault(), s(a - D)) : e.key === p ? (e.preventDefault(), s(a + D)) : e.key === "Home" ? (e.preventDefault(), s(h)) : e.key === "End" && (e.preventDefault(), s(f));
87
- }, [J, Q] = A, i = z === "horizontal";
88
- return /* @__PURE__ */ ee(
89
- "div",
90
- {
91
- ref: (e) => {
92
- x.current = e, typeof u == "function" ? u(e) : u && (u.current = e);
93
- },
94
- className: c(
95
- "flex relative",
96
- o && "select-none",
97
- i ? "flex-row" : "flex-col",
98
- U
99
- ),
100
- style: {
101
- cursor: o ? i ? "col-resize" : "row-resize" : "default",
102
- // Ensure sensible minimums so the component works even when no
103
- // ancestor provides a definite size. These are fallbacks only.
104
- minHeight: `${j}px`,
105
- minWidth: `${B}px`,
106
- ..._
107
- },
108
- ...F,
109
- children: [
110
- /* @__PURE__ */ v(
111
- "div",
112
- {
113
- className: c(
114
- "min-w-0 min-h-0 overflow-auto",
115
- o ? "transition-none" : "transition-[width,height] duration-150 ease-out"
116
- ),
117
- style: {
118
- [i ? "width" : "height"]: `${a}%`,
119
- flexShrink: 0,
120
- flexGrow: 0
121
- },
122
- children: J
123
- }
124
- ),
125
- !G && // biome-ignore lint/a11y/useSemanticElements: interactive resizable handle requires div styling
126
- /* @__PURE__ */ v(
127
- "div",
128
- {
129
- role: "separator",
130
- tabIndex: 0,
131
- "aria-valuenow": Math.round(a),
132
- "aria-valuemin": h,
133
- "aria-valuemax": f,
134
- "aria-orientation": i ? "horizontal" : "vertical",
135
- "aria-label": "Resize panel split",
136
- onPointerDown: Y,
137
- onPointerMove: Z,
138
- onPointerUp: P,
139
- onPointerCancel: P,
140
- onKeyDown: q,
141
- className: c(
142
- "relative z-20 shrink-0 flex items-center justify-center outline-none select-none group touch-none",
143
- i ? "w-4 self-stretch cursor-col-resize -mx-2" : "h-4 self-stretch w-full cursor-row-resize -my-2"
144
- ),
145
- children: /* @__PURE__ */ v(
146
- "div",
147
- {
148
- className: c(
149
- "transition-colors duration-150",
150
- i ? "w-1 self-stretch" : "h-1 self-stretch w-full",
151
- S || (o ? "bg-primary" : "bg-border group-hover:bg-primary/70 group-focus-visible:bg-primary")
152
- )
153
- }
154
- )
155
- }
156
- ),
157
- /* @__PURE__ */ v(
158
- "div",
159
- {
160
- className: c(
161
- "min-w-0 min-h-0 overflow-auto",
162
- o ? "transition-none" : "transition-[width,height] duration-150 ease-out"
163
- ),
164
- style: {
165
- [i ? "width" : "height"]: `${100 - a}%`,
166
- flex: 1
167
- },
168
- children: Q
169
- }
170
- )
171
- ]
172
- }
173
- );
174
- }
175
- );
176
- ie.displayName = "ResizableScreen";
177
- export {
178
- ie as ResizableScreen
179
- };
6
+ import { FALLBACK_RESIZABLE_SCREEN_CONFIG as r } from "./resizable-screen-config.js";
7
+ import { forwardRef as i, useCallback as a, useRef as o, useState as s } from "react";
8
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
9
+ //#region src/components/resizable-screen/ResizableScreen.tsx
10
+ var u = i(({ children: i, left: u, size: d, defaultSize: f, minSize: p, maxSize: m, step: h, orientation: g, hideHandle: _, onSizeChange: v, handleClassName: y, minContainerHeight: b = 200, minContainerWidth: x = 200, className: S, style: C, ...w }, T) => {
11
+ let E = t().components?.resizableScreen, D = n(p, E?.minSize, void 0, r.minSize), O = n(m, E?.maxSize, void 0, r.maxSize), k = n(h, E?.step, void 0, r.step), A = n(g, E?.orientation, void 0, r.orientation), j = n(_, E?.hideHandle, void 0, r.hideHandle), M = n(f, E?.defaultSize, void 0, r.defaultSize), [N, P] = s(d ?? u ?? M), [F, I] = s(!1), L = o(null), R = d !== void 0, z = R ? d : N, B = a((e) => Math.min(Math.max(e, D), O), [D, O]), V = a((e) => {
12
+ let t = B(e);
13
+ R || P(t), v?.(t);
14
+ }, [
15
+ B,
16
+ R,
17
+ v
18
+ ]), H = (e) => {
19
+ e.preventDefault(), e.currentTarget.setPointerCapture(e.pointerId), I(!0);
20
+ }, U = (e) => {
21
+ if (!F || !L.current) return;
22
+ let t = L.current.getBoundingClientRect(), n = A === "horizontal", r = n ? t.width : t.height, i = n ? e.clientX - t.left : e.clientY - t.top;
23
+ if (r > 0) {
24
+ let e = i / r * 100;
25
+ V(e);
26
+ }
27
+ }, W = (e) => {
28
+ if (F) {
29
+ try {
30
+ e.currentTarget.releasePointerCapture(e.pointerId);
31
+ } catch {}
32
+ I(!1);
33
+ }
34
+ }, G = (e) => {
35
+ let t = A === "horizontal", n = t ? "ArrowLeft" : "ArrowUp", r = t ? "ArrowRight" : "ArrowDown";
36
+ e.key === n ? (e.preventDefault(), V(z - k)) : e.key === r ? (e.preventDefault(), V(z + k)) : e.key === "Home" ? (e.preventDefault(), V(D)) : e.key === "End" && (e.preventDefault(), V(O));
37
+ }, [K, q] = i, J = A === "horizontal";
38
+ return /* @__PURE__ */ l("div", {
39
+ ref: (e) => {
40
+ L.current = e, typeof T == "function" ? T(e) : T && (T.current = e);
41
+ },
42
+ className: e("flex relative", F && "select-none", J ? "flex-row" : "flex-col", S),
43
+ style: {
44
+ cursor: F ? J ? "col-resize" : "row-resize" : "default",
45
+ minHeight: `${b}px`,
46
+ minWidth: `${x}px`,
47
+ ...C
48
+ },
49
+ ...w,
50
+ children: [
51
+ /* @__PURE__ */ c("div", {
52
+ className: e("min-w-0 min-h-0 overflow-auto", F ? "transition-none" : "transition-[width,height] duration-150 ease-out"),
53
+ style: {
54
+ [J ? "width" : "height"]: `${z}%`,
55
+ flexShrink: 0,
56
+ flexGrow: 0
57
+ },
58
+ children: K
59
+ }),
60
+ !j && /* @__PURE__ */ c("div", {
61
+ role: "separator",
62
+ tabIndex: 0,
63
+ "aria-valuenow": Math.round(z),
64
+ "aria-valuemin": D,
65
+ "aria-valuemax": O,
66
+ "aria-orientation": J ? "horizontal" : "vertical",
67
+ "aria-label": "Resize panel split",
68
+ onPointerDown: H,
69
+ onPointerMove: U,
70
+ onPointerUp: W,
71
+ onPointerCancel: W,
72
+ onKeyDown: G,
73
+ className: e("relative z-20 shrink-0 flex items-center justify-center outline-none select-none group touch-none", J ? "w-4 self-stretch cursor-col-resize -mx-2" : "h-4 self-stretch w-full cursor-row-resize -my-2"),
74
+ children: /* @__PURE__ */ c("div", { className: e("transition-colors duration-150", J ? "w-1 self-stretch" : "h-1 self-stretch w-full", y || (F ? "bg-primary" : "bg-border group-hover:bg-primary/70 group-focus-visible:bg-primary")) })
75
+ }),
76
+ /* @__PURE__ */ c("div", {
77
+ className: e("min-w-0 min-h-0 overflow-auto", F ? "transition-none" : "transition-[width,height] duration-150 ease-out"),
78
+ style: {
79
+ [J ? "width" : "height"]: `${100 - z}%`,
80
+ flex: 1
81
+ },
82
+ children: q
83
+ })
84
+ ]
85
+ });
86
+ });
87
+ u.displayName = "ResizableScreen";
88
+ //#endregion
89
+ export { u as ResizableScreen };
@@ -1,21 +1,20 @@
1
1
  "use client";
2
2
  import { registerComponentDefaults as e } from "../../libs/registry.js";
3
- const i = {
4
- defaultSize: 50,
5
- minSize: 20,
6
- maxSize: 80,
7
- step: 2,
8
- orientation: "horizontal"
3
+ //#region src/components/resizable-screen/resizable-screen-config.ts
4
+ var t = {
5
+ defaultSize: 50,
6
+ minSize: 20,
7
+ maxSize: 80,
8
+ step: 2,
9
+ orientation: "horizontal"
9
10
  }, n = {
10
- defaultSize: 50,
11
- minSize: 20,
12
- maxSize: 80,
13
- step: 2,
14
- orientation: "horizontal",
15
- hideHandle: !1
16
- };
17
- e("resizableScreen", i);
18
- export {
19
- n as FALLBACK_RESIZABLE_SCREEN_CONFIG,
20
- i as defaultResizableScreenConfig
11
+ defaultSize: 50,
12
+ minSize: 20,
13
+ maxSize: 80,
14
+ step: 2,
15
+ orientation: "horizontal",
16
+ hideHandle: !1
21
17
  };
18
+ e("resizableScreen", t);
19
+ //#endregion
20
+ export { n as FALLBACK_RESIZABLE_SCREEN_CONFIG, t as defaultResizableScreenConfig };
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { InputProps } from '../input/Input';
3
- import { MenuConfig, SelectMenuOption } from '../select-menu/select-menu-config';
3
+ import { MenuProps } from '../select-menu/SelectMenu';
4
+ import { SelectMenuOption } from '../select-menu/select-menu-config';
4
5
  import { SelectConfig } from './select-config';
5
6
  /**
6
7
  * Field-related props that Select inherits from Input.
@@ -89,7 +90,7 @@ export interface SelectProps extends SelectFieldProps, Omit<SelectConfig, "menu"
89
90
  * Menu configuration overrides including portal, portalTarget, className, and visual styles.
90
91
  * All menu-related props should be passed through this object.
91
92
  */
92
- menu?: MenuConfig;
93
+ menu?: MenuProps;
93
94
  }
94
95
  /**
95
96
  * A dropdown selector with search, label, validation, and configurable styles.
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/select/Select.tsx"],"names":[],"mappings":"AAWA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AASf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EACjB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAA0B,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAK5E;;;GAGG;AACH,KAAK,gBAAgB,GAAG,IAAI,CAC1B,UAAU,EACR,OAAO,GACP,aAAa,GACb,SAAS,GACT,UAAU,GACV,WAAW,GACX,QAAQ,GACR,YAAY,GACZ,WAAW,GACX,IAAI,GACJ,OAAO,CACV,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW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;IAEd;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoGG;AACH,eAAO,MAAM,MAAM,2GAsPlB,CAAC"}
@@ -1,196 +1,98 @@
1
1
  "use client";
2
- import { jsx as l, jsxs as O, Fragment as me } from "react/jsx-runtime";
3
- import { forwardRef as fe, useId as pe, useState as g, useMemo as b, useCallback as ve } from "react";
4
- import { ChevronDownIcon as Se } from "../../icons/ChevronDownIcon.js";
5
- import { useAsheeConfig as be } from "../../libs/context.js";
6
- import { resolveCascade as f, resolveRadiusKey as ye } from "../../utils/resolve-token.js";
7
- import { Button as he } from "../button/Button.js";
8
- import { FieldShell as xe } from "../field/FieldShell.js";
9
- import { SelectMenu as Ae } from "../select-menu/SelectMenu.js";
10
- import { FALLBACK_SELECT_CONFIG as o } from "./select-config.js";
11
- import { SELECT_STATUS_BORDER_CLASS as Re } from "./select-styles.js";
12
- import { useSelectFloating as Fe } from "../select-menu/use-select-floating.js";
13
- import { cn as y } from "../../utils/cn.js";
14
- const Ie = fe(
15
- ({
16
- options: p = [],
17
- value: r,
18
- onChange: v,
19
- onValueChange: a,
20
- size: E,
21
- radius: P,
22
- variant: _,
23
- color: j,
24
- status: w,
25
- label: z,
26
- labelAlign: B,
27
- description: S,
28
- message: h,
29
- required: M,
30
- isLoading: x,
31
- disabled: A,
32
- isSearch: T = !1,
33
- searchPlaceholder: k = "Search options...",
34
- searchInputName: D = "select-search",
35
- initialValue: n,
36
- belowList: $,
37
- placeholder: R = "Select...",
38
- className: Q,
39
- id: G,
40
- name: F,
41
- menu: U,
42
- style: W,
43
- startContent: q,
44
- endContent: H
45
- }, i) => {
46
- var N;
47
- const d = be(), e = (N = d.components) == null ? void 0 : N.select, J = pe(), c = G ?? J, [u, I] = g(!1), [X, K] = g(""), Y = f(
48
- E,
49
- e == null ? void 0 : e.size,
50
- void 0,
51
- o.size
52
- ), Z = f(
53
- _,
54
- e == null ? void 0 : e.variant,
55
- d.defaultVariant,
56
- o.variant
57
- ), C = f(
58
- j,
59
- e == null ? void 0 : e.color,
60
- d.defaultColor,
61
- o.color
62
- ), V = ye(
63
- P,
64
- e == null ? void 0 : e.radius,
65
- d.defaultRadius,
66
- o.radius
67
- ), m = w ?? o.status, ee = f(
68
- B,
69
- e == null ? void 0 : e.labelAlign,
70
- void 0,
71
- o.labelAlign
72
- ), te = m !== "default" ? Re[m] : "", s = b(
73
- () => p.find((t) => t.value === r),
74
- [p, r]
75
- ), {
76
- refs: L,
77
- context: re,
78
- floatingStyles: se,
79
- isPositioned: oe,
80
- getReferenceProps: le,
81
- getFloatingProps: ae
82
- } = Fe({
83
- isOpen: u,
84
- onOpenChange: I,
85
- disabled: A
86
- }), ne = ve(
87
- (t) => {
88
- if (a == null || a(t.value), v) {
89
- const ue = {
90
- target: { value: t.value, name: F ?? "" }
91
- };
92
- v(ue);
93
- }
94
- I(!1), K("");
95
- },
96
- [F, v, a]
97
- ), ie = b(() => s != null && s.label ? s.label : n !== void 0 ? String(n) : R, [s, n, R]), de = b(
98
- () => r != null ? [r] : [],
99
- [r]
100
- ), ce = le();
101
- return /* @__PURE__ */ l(
102
- xe,
103
- {
104
- id: c,
105
- label: z,
106
- labelAlign: ee,
107
- description: S,
108
- descriptionId: S ? `${c}-description` : void 0,
109
- message: h,
110
- messageId: h ? `${c}-message` : void 0,
111
- status: m,
112
- required: M,
113
- isLoading: x,
114
- children: /* @__PURE__ */ O("div", { className: "w-full relative inline-block", children: [
115
- /* @__PURE__ */ l(
116
- he,
117
- {
118
- ref: (t) => {
119
- L.setReference(t), typeof i == "function" ? i(t) : i && (i.current = t);
120
- },
121
- type: "button",
122
- variant: Z,
123
- color: C,
124
- animate: !1,
125
- size: Y,
126
- radius: V,
127
- isDisabled: A,
128
- isLoading: x,
129
- fullWidth: !0,
130
- "aria-expanded": u,
131
- "aria-haspopup": "listbox",
132
- "aria-invalid": m === "error",
133
- "aria-describedby": [S ? `${c}-description` : void 0].filter(Boolean).join(" ") || void 0,
134
- className: y(
135
- "font-normal text-left justify-between",
136
- te,
137
- Q
138
- ),
139
- style: W,
140
- startContent: q,
141
- endContent: /* @__PURE__ */ O(me, { children: [
142
- H,
143
- /* @__PURE__ */ l(
144
- Se,
145
- {
146
- className: y(
147
- "shrink-0 text-foreground/70 transition-transform duration-200",
148
- u && "rotate-180"
149
- )
150
- }
151
- )
152
- ] }),
153
- ...ce,
154
- children: /* @__PURE__ */ l(
155
- "span",
156
- {
157
- className: y(
158
- "truncate",
159
- s || n ? "text-foreground" : "text-foreground/70"
160
- ),
161
- children: ie
162
- }
163
- )
164
- }
165
- ),
166
- /* @__PURE__ */ l(
167
- Ae,
168
- {
169
- isOpen: u,
170
- context: re,
171
- floatingStyles: se,
172
- getFloatingProps: ae,
173
- setFloatingRef: L.setFloating,
174
- isPositioned: oe,
175
- options: p,
176
- selectedValues: de,
177
- onSelectMenuOption: ne,
178
- isSearch: T,
179
- searchPlaceholder: k,
180
- searchInputName: D,
181
- searchQuery: X,
182
- onSearchChange: K,
183
- belowList: $,
184
- menuProps: U,
185
- menuConfig: e == null ? void 0 : e.menu
186
- }
187
- )
188
- ] })
189
- }
190
- );
191
- }
192
- );
193
- Ie.displayName = "Select";
194
- export {
195
- Ie as Select
196
- };
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 { resolveCascade as r, resolveRadiusKey as i } from "../../utils/resolve-token.js";
7
+ import { FieldShell as a } from "../field/FieldShell.js";
8
+ import { Button as o } from "../button/Button.js";
9
+ import { SelectMenu as s } from "../select-menu/SelectMenu.js";
10
+ import { useSelectFloating as c } from "../select-menu/use-select-floating.js";
11
+ import { FALLBACK_SELECT_CONFIG as l } from "./select-config.js";
12
+ import { SELECT_STATUS_BORDER_CLASS as u } from "./select-styles.js";
13
+ import { forwardRef as d, useCallback as ee, useId as f, useMemo as p, useState as m } from "react";
14
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
15
+ //#region src/components/select/Select.tsx
16
+ var v = d(({ options: d = [], value: v, onChange: y, onValueChange: b, size: te, radius: x, variant: S, color: C, status: ne, label: re, labelAlign: ie, description: w, message: T, required: E, isLoading: D, disabled: O, isSearch: k = !1, searchPlaceholder: A = "Search options...", searchInputName: j = "select-search", initialValue: M, belowList: N, placeholder: P = "Select...", className: F, id: I, name: L, menu: R, style: z, startContent: B, endContent: V }, H) => {
17
+ let U = t(), W = U.components?.select, G = f(), K = I ?? G, [q, J] = m(!1), [Y, X] = m(""), ae = r(te, W?.size, void 0, l.size), oe = r(S, W?.variant, U.defaultVariant, l.variant), se = r(C, W?.color, U.defaultColor, l.color), ce = i(x, W?.radius, U.defaultRadius, l.radius), Z = ne ?? l.status, le = r(ie, W?.labelAlign, void 0, l.labelAlign), ue = Z === "default" ? "" : u[Z], Q = p(() => d.find((e) => e.value === v), [d, v]), { refs: $, context: de, floatingStyles: fe, isPositioned: pe, getReferenceProps: me, getFloatingProps: he } = c({
18
+ isOpen: q,
19
+ onOpenChange: J,
20
+ disabled: O
21
+ }), ge = ee((e) => {
22
+ b?.(e.value), y && y({ target: {
23
+ value: e.value,
24
+ name: L ?? ""
25
+ } }), J(!1), X("");
26
+ }, [
27
+ L,
28
+ y,
29
+ b
30
+ ]), _e = p(() => Q?.label ? Q.label : M === void 0 ? P : String(M), [
31
+ Q,
32
+ M,
33
+ P
34
+ ]), ve = p(() => v == null ? [] : [v], [v]), ye = me();
35
+ return /* @__PURE__ */ g(a, {
36
+ id: K,
37
+ label: re,
38
+ labelAlign: le,
39
+ description: w,
40
+ descriptionId: w ? `${K}-description` : void 0,
41
+ message: T,
42
+ messageId: T ? `${K}-message` : void 0,
43
+ status: Z,
44
+ required: E,
45
+ isLoading: D,
46
+ children: /* @__PURE__ */ _("div", {
47
+ className: "w-full relative inline-block",
48
+ children: [/* @__PURE__ */ g(o, {
49
+ ref: (e) => {
50
+ $.setReference(e), typeof H == "function" ? H(e) : H && (H.current = e);
51
+ },
52
+ type: "button",
53
+ variant: oe,
54
+ color: se,
55
+ animate: !1,
56
+ size: ae,
57
+ radius: ce,
58
+ isDisabled: O,
59
+ isLoading: D,
60
+ fullWidth: !0,
61
+ "aria-expanded": q,
62
+ "aria-haspopup": "listbox",
63
+ "aria-invalid": Z === "error",
64
+ "aria-describedby": [w ? `${K}-description` : void 0].filter(Boolean).join(" ") || void 0,
65
+ className: e("font-normal text-left justify-between", ue, F),
66
+ style: z,
67
+ startContent: B,
68
+ endContent: /* @__PURE__ */ _(h, { children: [V, /* @__PURE__ */ g(n, { className: e("shrink-0 text-foreground/70 transition-transform duration-200", q && "rotate-180") })] }),
69
+ ...ye,
70
+ children: /* @__PURE__ */ g("span", {
71
+ className: e("truncate", Q || M ? "text-foreground" : "text-foreground/70"),
72
+ children: _e
73
+ })
74
+ }), /* @__PURE__ */ g(s, {
75
+ isOpen: q,
76
+ context: de,
77
+ floatingStyles: fe,
78
+ getFloatingProps: he,
79
+ setFloatingRef: $.setFloating,
80
+ isPositioned: pe,
81
+ options: d,
82
+ selectedValues: ve,
83
+ onSelectMenuOption: ge,
84
+ isSearch: k,
85
+ searchPlaceholder: A,
86
+ searchInputName: j,
87
+ searchQuery: Y,
88
+ onSearchChange: X,
89
+ belowList: N,
90
+ menuProps: R,
91
+ menuConfig: W?.menu
92
+ })]
93
+ })
94
+ });
95
+ });
96
+ v.displayName = "Select";
97
+ //#endregion
98
+ export { v as Select };
@@ -1,10 +1,9 @@
1
1
  "use client";
2
- import { registerComponentDefaults as t } from "../../libs/registry.js";
3
- import { FALLBACK_FIELD_CONFIG as e } from "../field/field-config.js";
4
- import { defaultInputConfig as o } from "../input/input-config.js";
5
- const r = o, i = e;
6
- t("select", r);
7
- export {
8
- i as FALLBACK_SELECT_CONFIG,
9
- r as defaultSelectConfig
10
- };
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/select/select-config.ts
6
+ var r = n, i = t;
7
+ e("select", r);
8
+ //#endregion
9
+ export { i as FALLBACK_SELECT_CONFIG, r as defaultSelectConfig };