@vlrc-fe/components 2.2.0 → 2.3.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 (215) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/DataTable/DataTable.d.ts.map +1 -1
  3. package/dist/DataTable/components/DataTableTable.d.ts.map +1 -1
  4. package/dist/Form/Form.d.ts.map +1 -1
  5. package/dist/Form/FormDatePicker/FormDatePicker.d.ts.map +1 -1
  6. package/dist/Form/FormDatePicker/RangeDatePicker.d.ts.map +1 -1
  7. package/dist/Form/FormDatePicker/SingleDatePicker.d.ts +4 -3
  8. package/dist/Form/FormDatePicker/SingleDatePicker.d.ts.map +1 -1
  9. package/dist/Form/FormDatePicker/TimeInput.d.ts +3 -4
  10. package/dist/Form/FormDatePicker/TimeInput.d.ts.map +1 -1
  11. package/dist/Form/FormDatePicker/TimePicker.d.ts +3 -3
  12. package/dist/Form/FormDatePicker/TimePicker.d.ts.map +1 -1
  13. package/dist/Form/FormDatePicker/types.d.ts +1 -0
  14. package/dist/Form/FormDatePicker/types.d.ts.map +1 -1
  15. package/dist/Form/FormDatePicker/useFormDatePicker.d.ts +2 -2
  16. package/dist/Form/FormDatePicker/useFormDatePicker.d.ts.map +1 -1
  17. package/dist/Form/FormNumberInput/FormNumberInput.d.ts.map +1 -1
  18. package/dist/Form/FormNumberInput/StepperControls.d.ts.map +1 -1
  19. package/dist/Form/FormNumberInput/useFormNumberInput.d.ts.map +1 -1
  20. package/dist/MultiSelect/MultiSelect.d.ts.map +1 -1
  21. package/dist/MultiSelect/renderers.d.ts +2 -2
  22. package/dist/MultiSelect/renderers.d.ts.map +1 -1
  23. package/dist/assets/stylex.css +450 -0
  24. package/dist/index.cjs +1 -1
  25. package/dist/index.js +25 -25
  26. package/dist/index101.cjs +1 -1
  27. package/dist/index101.js +120 -91
  28. package/dist/index103.cjs +1 -1
  29. package/dist/index103.js +32 -15
  30. package/dist/index107.cjs +1 -1
  31. package/dist/index107.js +245 -132
  32. package/dist/index109.cjs +1 -1
  33. package/dist/index109.js +319 -138
  34. package/dist/index113.cjs +1 -1
  35. package/dist/index113.js +230 -95
  36. package/dist/index119.cjs +1 -1
  37. package/dist/index119.js +62 -35
  38. package/dist/index120.cjs +1 -1
  39. package/dist/index120.js +71 -32
  40. package/dist/index121.cjs +1 -1
  41. package/dist/index121.js +201 -79
  42. package/dist/index125.cjs +1 -1
  43. package/dist/index125.js +661 -288
  44. package/dist/index129.cjs +1 -1
  45. package/dist/index129.js +6 -5
  46. package/dist/index144.cjs +1 -1
  47. package/dist/index144.js +33 -22
  48. package/dist/index148.cjs +1 -1
  49. package/dist/index148.js +95 -92
  50. package/dist/index151.cjs +1 -1
  51. package/dist/index151.js +56 -56
  52. package/dist/index152.cjs +1 -1
  53. package/dist/index152.js +87 -3
  54. package/dist/index153.cjs +1 -1
  55. package/dist/index153.js +321 -85
  56. package/dist/index154.cjs +1 -1
  57. package/dist/index154.js +160 -287
  58. package/dist/index155.cjs +1 -1
  59. package/dist/index155.js +198 -162
  60. package/dist/index156.cjs +1 -1
  61. package/dist/index156.js +24 -125
  62. package/dist/index157.cjs +1 -1
  63. package/dist/index157.js +8 -25
  64. package/dist/index158.cjs +1 -1
  65. package/dist/index158.js +13 -5
  66. package/dist/index159.cjs +1 -1
  67. package/dist/index159.js +18 -13
  68. package/dist/index160.cjs +1 -1
  69. package/dist/index160.js +12 -16
  70. package/dist/index161.cjs +1 -1
  71. package/dist/index161.js +5 -17
  72. package/dist/index162.cjs +1 -1
  73. package/dist/index162.js +6 -5
  74. package/dist/index163.cjs +1 -1
  75. package/dist/index163.js +6 -5
  76. package/dist/index164.cjs +1 -1
  77. package/dist/index164.js +5 -6
  78. package/dist/index165.cjs +1 -1
  79. package/dist/index165.js +5 -5
  80. package/dist/index166.cjs +1 -1
  81. package/dist/index166.js +7 -5
  82. package/dist/index167.cjs +1 -1
  83. package/dist/index167.js +68 -8
  84. package/dist/index168.cjs +1 -1
  85. package/dist/index168.js +9 -67
  86. package/dist/index169.cjs +1 -1
  87. package/dist/index169.js +201 -10
  88. package/dist/index170.cjs +1 -1
  89. package/dist/index170.js +101 -179
  90. package/dist/index171.cjs +1 -1
  91. package/dist/index171.js +24 -116
  92. package/dist/index172.cjs +1 -1
  93. package/dist/index172.js +18 -30
  94. package/dist/index173.cjs +1 -1
  95. package/dist/index173.js +66 -17
  96. package/dist/index174.cjs +1 -1
  97. package/dist/index174.js +30 -67
  98. package/dist/index175.cjs +1 -1
  99. package/dist/index175.js +10 -31
  100. package/dist/index176.cjs +1 -1
  101. package/dist/index176.js +279 -10
  102. package/dist/index177.cjs +1 -1
  103. package/dist/index177.js +125 -248
  104. package/dist/index178.cjs +1 -1
  105. package/dist/index178.js +18 -155
  106. package/dist/index179.cjs +1 -1
  107. package/dist/index179.js +9 -19
  108. package/dist/index180.cjs +1 -1
  109. package/dist/index180.js +12 -8
  110. package/dist/index181.cjs +1 -1
  111. package/dist/index181.js +6 -12
  112. package/dist/index182.cjs +1 -1
  113. package/dist/index182.js +6 -6
  114. package/dist/index183.cjs +1 -1
  115. package/dist/index183.js +9 -6
  116. package/dist/index184.cjs +1 -1
  117. package/dist/index184.js +8 -9
  118. package/dist/index185.cjs +1 -1
  119. package/dist/index185.js +4 -8
  120. package/dist/index186.cjs +1 -1
  121. package/dist/index186.js +6 -4
  122. package/dist/index187.cjs +1 -1
  123. package/dist/index187.js +6 -6
  124. package/dist/index188.cjs +1 -1
  125. package/dist/index188.js +8 -6
  126. package/dist/index189.cjs +1 -1
  127. package/dist/index189.js +9 -8
  128. package/dist/index190.cjs +1 -1
  129. package/dist/index190.js +12 -8
  130. package/dist/index191.cjs +1 -1
  131. package/dist/index191.js +7 -11
  132. package/dist/index192.cjs +1 -1
  133. package/dist/index192.js +7 -7
  134. package/dist/index193.cjs +1 -1
  135. package/dist/index193.js +4 -9
  136. package/dist/index194.cjs +1 -1
  137. package/dist/index194.js +42 -5
  138. package/dist/index195.cjs +1 -1
  139. package/dist/index195.js +375 -29
  140. package/dist/index196.cjs +1 -1
  141. package/dist/index196.js +35 -386
  142. package/dist/index197.cjs +1 -1
  143. package/dist/index197.js +22 -37
  144. package/dist/index198.cjs +1 -1
  145. package/dist/index198.js +56 -20
  146. package/dist/index199.cjs +1 -1
  147. package/dist/index199.js +36 -54
  148. package/dist/index200.cjs +1 -1
  149. package/dist/index200.js +102 -54
  150. package/dist/index201.cjs +1 -1
  151. package/dist/index201.js +76 -54
  152. package/dist/index202.cjs +1 -1
  153. package/dist/index202.js +68 -66
  154. package/dist/index203.cjs +1 -1
  155. package/dist/index203.js +147 -63
  156. package/dist/index204.cjs +1 -1
  157. package/dist/index204.js +69 -91
  158. package/dist/index205.cjs +9 -1
  159. package/dist/index205.js +585 -62
  160. package/dist/index206.cjs +1 -9
  161. package/dist/index206.js +65 -586
  162. package/dist/index207.cjs +1 -1
  163. package/dist/index207.js +42 -41
  164. package/dist/index208.cjs +1 -1
  165. package/dist/index208.js +64 -46
  166. package/dist/index209.cjs +1 -1
  167. package/dist/index209.js +48 -64
  168. package/dist/index210.cjs +1 -1
  169. package/dist/index210.js +75 -47
  170. package/dist/index211.cjs +1 -1
  171. package/dist/index211.js +173 -69
  172. package/dist/index212.cjs +1 -1
  173. package/dist/index212.js +24 -180
  174. package/dist/index213.cjs +1 -1
  175. package/dist/index213.js +25 -24
  176. package/dist/index214.cjs +1 -1
  177. package/dist/index214.js +61 -24
  178. package/dist/index215.cjs +1 -1
  179. package/dist/index215.js +408 -49
  180. package/dist/index216.cjs +1 -1
  181. package/dist/index216.js +25 -422
  182. package/dist/index37.cjs +1 -1
  183. package/dist/index37.js +123 -65
  184. package/dist/index42.cjs +1 -1
  185. package/dist/index42.js +175 -88
  186. package/dist/index91.cjs +1 -1
  187. package/dist/index91.js +252 -124
  188. package/dist/ui/calendar.d.ts +5 -2
  189. package/dist/ui/calendar.d.ts.map +1 -1
  190. package/dist/ui/carousel.d.ts +19 -5
  191. package/dist/ui/carousel.d.ts.map +1 -1
  192. package/dist/ui/context-menu.d.ts +37 -12
  193. package/dist/ui/context-menu.d.ts.map +1 -1
  194. package/dist/ui/form.d.ts +15 -4
  195. package/dist/ui/form.d.ts.map +1 -1
  196. package/dist/ui/hover-card.d.ts +5 -1
  197. package/dist/ui/hover-card.d.ts.map +1 -1
  198. package/dist/ui/item.d.ts +43 -18
  199. package/dist/ui/item.d.ts.map +1 -1
  200. package/dist/ui/menubar.d.ts +45 -14
  201. package/dist/ui/menubar.d.ts.map +1 -1
  202. package/dist/ui/navigation-menu.d.ts +34 -10
  203. package/dist/ui/navigation-menu.d.ts.map +1 -1
  204. package/dist/ui/resizable.d.ts +9 -3
  205. package/dist/ui/resizable.d.ts.map +1 -1
  206. package/dist/ui/scroll-area.d.ts +9 -2
  207. package/dist/ui/scroll-area.d.ts.map +1 -1
  208. package/dist/ui/select.d.ts +19 -5
  209. package/dist/ui/select.d.ts.map +1 -1
  210. package/dist/ui/sidebar.d.ts +99 -37
  211. package/dist/ui/sidebar.d.ts.map +1 -1
  212. package/dist/ui/sonner.d.ts.map +1 -1
  213. package/package.json +1 -1
  214. package/dist/index217.cjs +0 -1
  215. package/dist/index217.js +0 -25
package/dist/index155.js CHANGED
@@ -1,163 +1,199 @@
1
- import { arraysEqual as e, buildAllOptions as t, buildBadgeAnimationClass as n, buildPopoverAnimationClass as r, buildWidthConstraints as i, computeResponsiveSettings as a, countMatchingOptions as ee, filterOptions as te } from "./index153.js";
2
- import { useCallback as o, useEffect as s, useId as ne, useImperativeHandle as re, useMemo as c, useRef as l, useState as u } from "react";
3
- // src/MultiSelect/useMultiSelect.ts
4
- var d = ({ forwardedRef: d, ...f }) => {
5
- let { options: p, onValueChange: m, defaultValue: h = [], animationConfig: g, maxCount: _ = 3, responsive: v, minWidth: y, maxWidth: b, deduplicateOptions: x = !1, resetOnDefaultValueChange: S = !0, closeOnSelect: C = !1, searchable: w = !0, autoSize: T = !1, disabled: E = !1 } = f, [D, O] = u(h), [k, A] = u(!1), [j, ie] = u(!1), [M, N] = u(""), [P, F] = u("desktop"), [I, L] = u(""), [ae, R] = u(""), z = l(D.length), B = l(k), V = l(M), H = ne(), U = `${H}-listbox`, W = `${H}-description`, G = `${H}-count`, K = l(h), q = l(null), J = o((e, t = "polite") => {
6
- t === "assertive" ? (R(e), setTimeout(() => R(""), 100)) : (L(e), setTimeout(() => L(""), 100));
7
- }, []), Y = o(() => {
8
- let { options: e, duplicates: n } = t(p, x);
9
- return e;
10
- }, [x, p]), X = o((e) => Y().find((t) => t.value === e), [Y]), oe = c(() => te(p, M, w), [
11
- p,
12
- M,
13
- w
14
- ]), se = (e) => {
15
- if (!E) {
16
- if (e.key === "Enter") A(!0);
17
- else if (e.key === "Backspace" && !e.currentTarget.value) {
18
- let e = [...D];
19
- e.pop(), O(e), m(e);
20
- }
21
- }
22
- }, ce = (e) => {
23
- if (E || X(e)?.disabled) return;
24
- let t = D.includes(e) ? D.filter((t) => t !== e) : [...D, e];
25
- O(t), m(t), C && A(!1);
26
- }, Z = () => {
27
- E || (O([]), m([]));
28
- }, Q = () => {
29
- E || A((e) => !e);
30
- }, $ = c(() => a(v, _, P), [
31
- v,
32
- _,
33
- P
34
- ]), le = () => {
35
- if (E) return;
36
- let e = D.slice(0, $.maxCount);
37
- O(e), m(e);
38
- }, ue = () => {
39
- if (E) return;
40
- let e = Y().filter((e) => !e.disabled);
41
- if (D.length === e.length) Z();
42
- else {
43
- let t = e.map((e) => e.value);
44
- O(t), m(t);
45
- }
46
- C && A(!1);
47
- }, de = c(() => i(P, T, y, b), [
48
- T,
49
- b,
50
- y,
51
- P
52
- ]);
53
- s(() => {
54
- if (!S) return;
55
- let t = K.current;
56
- e(t, h) || (e(D, h) || O(h), K.current = [...h]);
57
- }, [
58
- h,
59
- S,
60
- D
61
- ]), s(() => {
62
- k || N("");
63
- }, [k]), s(() => {
64
- let e = D.length, t = Y(), n = t.filter((e) => !e.disabled).length;
65
- if (e !== z.current) {
66
- let r = e - z.current;
67
- if (r > 0) {
68
- let i = D.slice(-r).map((e) => t.find((t) => t.value === e)?.label).filter(Boolean);
69
- i.length === 1 ? J(`${i[0]} selected. ${e} of ${n} options selected.`) : J(`${i.length} options selected. ${e} of ${n} total selected.`);
70
- } else r < 0 && J(`Option removed. ${e} of ${n} options selected.`);
71
- z.current = e;
72
- }
73
- if (k !== B.current && (J(k ? `Dropdown opened. ${n} options available. Use arrow keys to navigate.` : "Dropdown closed."), B.current = k), M !== V.current && M !== void 0) {
74
- if (M && k) {
75
- let e = ee(t, M);
76
- J(`${e} option${e === 1 ? "" : "s"} found for "${M}"`);
77
- }
78
- V.current = M;
79
- }
80
- }, [
81
- J,
82
- Y,
83
- k,
84
- M,
85
- D
86
- ]), s(() => {
87
- if (typeof window > "u") return;
88
- let e = () => {
89
- let e = window.innerWidth;
90
- F(e < 640 ? "mobile" : e < 1024 ? "tablet" : "desktop");
91
- };
92
- return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
93
- }, []);
94
- let fe = c(() => n(j, g), [g, j]), pe = c(() => r(g), [g]);
95
- return re(d, () => ({
96
- reset: () => {
97
- O(h), A(!1), N(""), m(h);
98
- },
99
- getSelectedValues: () => D,
100
- setSelectedValues: (e) => {
101
- O(e), m(e);
102
- },
103
- clear: () => {
104
- O([]), m([]);
105
- },
106
- focus: () => {
107
- if (q.current) {
108
- q.current.focus();
109
- let e = q.current.style.outline, t = q.current.style.outlineOffset;
110
- q.current.style.outline = "2px solid hsl(var(--ring))", q.current.style.outlineOffset = "2px", setTimeout(() => {
111
- q.current && (q.current.style.outline = e, q.current.style.outlineOffset = t);
112
- }, 1e3);
113
- }
114
- }
115
- }), [
116
- h,
117
- d,
118
- m,
119
- D
120
- ]), {
121
- ids: {
122
- multiSelectId: H,
123
- listboxId: U,
124
- triggerDescriptionId: W,
125
- selectedCountId: G
126
- },
127
- state: {
128
- selectedValues: D,
129
- isPopoverOpen: k,
130
- isAnimating: j,
131
- searchValue: M,
132
- screenSize: P
133
- },
134
- derived: {
135
- filteredOptions: oe,
136
- responsiveSettings: $,
137
- widthConstraints: de,
138
- badgeAnimationClass: fe,
139
- popoverAnimationClass: pe
140
- },
141
- refs: { buttonRef: q },
142
- helpers: {
143
- getAllOptions: Y,
144
- getOptionByValue: X
145
- },
146
- a11yMessages: {
147
- politeMessage: I,
148
- assertiveMessage: ae
149
- },
150
- handlers: {
151
- setIsPopoverOpen: A,
152
- handleTogglePopover: Q,
153
- handleInputKeyDown: se,
154
- toggleOption: ce,
155
- handleClear: Z,
156
- clearExtraOptions: le,
157
- toggleAll: ue,
158
- setSearchValue: N,
159
- setIsAnimating: ie
160
- }
161
- };
1
+ import { Icons as e } from "./index4.js";
2
+ import { Button as t } from "./index25.js";
3
+ import { cn as n } from "./index36.js";
4
+ import { Popover as r, PopoverContent as i, PopoverTrigger as a } from "./index115.js";
5
+ import { LiveRegion as ee, OptionsContent as te, PlaceholderContent as ne, SelectedValuesContent as re } from "./index153.js";
6
+ import { useMultiSelect as ie } from "./index154.js";
7
+ import "react";
8
+ import "@stylexjs/stylex";
9
+ import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
10
+ // src/MultiSelect/MultiSelect.tsx
11
+ var l = {
12
+ triggerButton: {
13
+ k1xSpc: "x78zum5",
14
+ kmVPX3: "x78pyy4",
15
+ kaIpWk: "xsda711",
16
+ kMzoRj: "xmkeg23",
17
+ ksu8eU: "x1y0btm7",
18
+ kVAM5u: "xb30jbz",
19
+ kAzted: "xsejkeq",
20
+ kZKoxP: "xt7dq6l",
21
+ kGNEyG: "x6s0dn4",
22
+ kjj79g: "x1qughib",
23
+ kWkggS: "xgcd1z6",
24
+ kGzVvX: "xadmf9m",
25
+ $$css: !0
26
+ },
27
+ triggerAutoSize: {
28
+ kzqmXN: "x14atkfc",
29
+ $$css: !0
30
+ },
31
+ triggerFullWidth: {
32
+ kzqmXN: "xh8yej3",
33
+ $$css: !0
34
+ },
35
+ triggerCompact: {
36
+ kAzted: "x1in32aq",
37
+ kGuDYH: "xkpwil5",
38
+ $$css: !0
39
+ },
40
+ triggerMobile: {
41
+ kAzted: "xe8gcm",
42
+ kGuDYH: "x1jchvi3",
43
+ $$css: !0
44
+ },
45
+ triggerDisabled: {
46
+ kSiTet: "xbyyjgo",
47
+ kkrTdU: "x1h6gzvc",
48
+ $$css: !0
49
+ },
50
+ popoverContent: {
51
+ kzqmXN: "x14atkfc",
52
+ kmVPX3: "x1717udv",
53
+ kFalU9: "xggy1nq",
54
+ $$css: !0
55
+ },
56
+ popoverMobile: {
57
+ kzqmXN: "xag7ckl",
58
+ ks0D6T: "xmjjyld",
59
+ $$css: !0
60
+ },
61
+ popoverTablet: {
62
+ kzqmXN: "xfmqdhw",
63
+ ks0D6T: "x1983rqf",
64
+ $$css: !0
65
+ },
66
+ popoverDesktop: {
67
+ k7Eaqz: "xk9iosm",
68
+ $$css: !0
69
+ }
70
+ }, u = ({ options: u, onValueChange: d, variant: ae, defaultValue: f = [], value: p, placeholder: m = "Select options", animation: h = 0, animationConfig: g, maxCount: oe = 3, modalPopover: _ = !1, className: se, hideSelectAll: v = !1, searchable: y = !0, emptyIndicator: b, autoSize: x = !1, singleLine: S = !1, popoverClassName: C, disabled: w = !1, responsive: T, width: E, minWidth: D, maxWidth: O, deduplicateOptions: k = !1, resetOnDefaultValueChange: A = !0, closeOnSelect: j = !1, ref: M, ...N }) => {
71
+ let { ids: P, state: F, derived: I, refs: L, helpers: R, a11yMessages: z, handlers: B } = ie({
72
+ options: u,
73
+ onValueChange: d,
74
+ defaultValue: p || f,
75
+ animation: h,
76
+ animationConfig: g,
77
+ maxCount: oe,
78
+ modalPopover: _,
79
+ hideSelectAll: v,
80
+ searchable: y,
81
+ autoSize: x,
82
+ disabled: w,
83
+ responsive: T,
84
+ minWidth: D,
85
+ maxWidth: O,
86
+ deduplicateOptions: k,
87
+ resetOnDefaultValueChange: A,
88
+ closeOnSelect: j,
89
+ forwardedRef: M
90
+ }), { selectedValues: V, isPopoverOpen: H, isAnimating: U, searchValue: W, screenSize: G } = F, { filteredOptions: K, responsiveSettings: q, widthConstraints: J, badgeAnimationClass: ce, popoverAnimationClass: le } = I, { buttonRef: ue } = L, { getAllOptions: Y, getOptionByValue: X } = R, { politeMessage: de, assertiveMessage: fe } = z, { setIsPopoverOpen: Z, handleTogglePopover: pe, handleInputKeyDown: me, toggleOption: Q, handleClear: $, clearExtraOptions: he, toggleAll: ge, setSearchValue: _e, setIsAnimating: ve } = B, ye = (e) => {
91
+ w || Z(e);
92
+ }, be = `Multi-select: ${V.length} of ${Y().length} options selected. ${m}`;
93
+ return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(ee, {
94
+ politeMessage: de,
95
+ assertiveMessage: fe
96
+ }), /* @__PURE__ */ c(r, {
97
+ open: H,
98
+ onOpenChange: ye,
99
+ modal: _,
100
+ children: [
101
+ /* @__PURE__ */ s("div", {
102
+ id: P.triggerDescriptionId,
103
+ className: "x10l6tqk x1i1rx1s xjm9jq1 x1717udv xkdpibf xb3r6kr xzpqnlu xuxw1ft xc342km",
104
+ children: "Multi-select dropdown. Use arrow keys to navigate, Enter to select, and Escape to close."
105
+ }),
106
+ /* @__PURE__ */ s("div", {
107
+ id: P.selectedCountId,
108
+ className: "x10l6tqk x1i1rx1s xjm9jq1 x1717udv xkdpibf xb3r6kr xzpqnlu xuxw1ft xc342km",
109
+ "aria-live": "polite",
110
+ children: V.length === 0 ? "No options selected" : `${V.length} option${V.length === 1 ? "" : "s"} selected: ${V.map((e) => X(e)?.label).filter(Boolean).join(", ")}`
111
+ }),
112
+ /* @__PURE__ */ s(a, {
113
+ asChild: !0,
114
+ children: /* @__PURE__ */ s(t, {
115
+ ref: ue,
116
+ variant: "outline",
117
+ width: E,
118
+ ...N,
119
+ onClick: pe,
120
+ disabled: w,
121
+ role: "combobox",
122
+ "aria-expanded": H,
123
+ "aria-haspopup": "listbox",
124
+ "aria-controls": H ? P.listboxId : void 0,
125
+ "aria-describedby": `${P.triggerDescriptionId} ${P.selectedCountId}`,
126
+ "aria-label": be,
127
+ sx: [
128
+ l.triggerButton,
129
+ x ? l.triggerAutoSize : l.triggerFullWidth,
130
+ q.compactMode ? l.triggerCompact : void 0,
131
+ G === "mobile" ? l.triggerMobile : void 0,
132
+ w ? l.triggerDisabled : void 0
133
+ ],
134
+ className: se,
135
+ style: {
136
+ ...J,
137
+ maxWidth: `min(${J.maxWidth}, 100%)`
138
+ },
139
+ children: V.length > 0 ? /* @__PURE__ */ s(re, {
140
+ selectedValues: V,
141
+ responsiveSettings: q,
142
+ screenSize: G,
143
+ singleLine: S,
144
+ animation: h,
145
+ animationConfig: g,
146
+ badgeAnimationClass: ce,
147
+ variant: ae,
148
+ getOptionByValue: X,
149
+ toggleOption: Q,
150
+ clearExtraOptions: he,
151
+ handleClear: $
152
+ }) : /* @__PURE__ */ s(ne, { placeholder: m })
153
+ })
154
+ }),
155
+ /* @__PURE__ */ s(i, {
156
+ id: P.listboxId,
157
+ role: "listbox",
158
+ "aria-multiselectable": "true",
159
+ "aria-label": "Available options",
160
+ sx: [l.popoverContent, G === "mobile" ? l.popoverMobile : G === "tablet" ? l.popoverTablet : l.popoverDesktop],
161
+ className: n(le, C),
162
+ style: {
163
+ animationDuration: `${g?.duration || h}s`,
164
+ animationDelay: `${g?.delay || 0}s`,
165
+ maxWidth: `min(${J.maxWidth}, 85vw)`,
166
+ maxHeight: G === "mobile" ? "70vh" : "60vh"
167
+ },
168
+ align: "start",
169
+ onEscapeKeyDown: () => Z(!1),
170
+ children: /* @__PURE__ */ s(te, {
171
+ filteredOptions: K,
172
+ hideSelectAll: v,
173
+ searchValue: W,
174
+ searchable: y,
175
+ selectedValues: V,
176
+ getAllOptions: Y,
177
+ toggleAll: ge,
178
+ toggleOption: Q,
179
+ handleClear: $,
180
+ setIsPopoverOpen: Z,
181
+ handleInputKeyDown: me,
182
+ setSearchValue: _e,
183
+ multiSelectId: P.multiSelectId,
184
+ emptyIndicator: b,
185
+ screenSize: G
186
+ })
187
+ }),
188
+ h > 0 && V.length > 0 && /* @__PURE__ */ s(e.WandSparkles, {
189
+ ...{
190
+ 0: { className: "x1ypdohk xahocic x84br7x x1mlyrtw x1jw3ynk xvle69y" },
191
+ 1: { className: "x1ypdohk xahocic x1mlyrtw x1jw3ynk xvle69y xw3nh4a" }
192
+ }[!U | 0],
193
+ onClick: () => ve(!U)
194
+ })
195
+ ]
196
+ })] });
162
197
  };
163
- export { d as useMultiSelect };
198
+ u.displayName = "MultiSelect";
199
+ export { u as default };
package/dist/index156.cjs CHANGED
@@ -1 +1 @@
1
- const e=require("./index4.cjs"),t=require("./index25.cjs"),n=require("./index36.cjs"),r=require("./index115.cjs"),i=require("./index154.cjs"),ee=require("./index155.cjs");require("react");let a=require("react/jsx-runtime");var o=({options:o,onValueChange:s,variant:c,defaultValue:l=[],value:u,placeholder:d=`Select options`,animation:f=0,animationConfig:p,maxCount:te=3,modalPopover:ne=!1,className:m,hideSelectAll:h=!1,searchable:g=!0,emptyIndicator:_,autoSize:v=!1,singleLine:y=!1,popoverClassName:b,disabled:x=!1,responsive:re,width:S,minWidth:C,maxWidth:w,deduplicateOptions:T=!1,resetOnDefaultValueChange:E=!0,closeOnSelect:D=!1,ref:O,...k})=>{let{ids:A,state:j,derived:M,refs:N,helpers:P,a11yMessages:F,handlers:I}=ee.useMultiSelect({options:o,onValueChange:s,defaultValue:u||l,animation:f,animationConfig:p,maxCount:te,responsive:re,minWidth:C,maxWidth:w,deduplicateOptions:T,resetOnDefaultValueChange:E,closeOnSelect:D,searchable:g,autoSize:v,disabled:x,forwardedRef:O}),{selectedValues:L,isPopoverOpen:R,isAnimating:z,searchValue:B,screenSize:V}=j,{filteredOptions:H,responsiveSettings:U,widthConstraints:W,badgeAnimationClass:G,popoverAnimationClass:K}=M,{buttonRef:q}=N,{getAllOptions:J,getOptionByValue:Y}=P,{politeMessage:X,assertiveMessage:ie}=F,{setIsPopoverOpen:Z,handleTogglePopover:ae,handleInputKeyDown:oe,toggleOption:Q,handleClear:$,clearExtraOptions:se,toggleAll:ce,setSearchValue:le,setIsAnimating:ue}=I,de=e=>{x||Z(e)},fe=`Multi-select: ${L.length} of ${J().length} options selected. ${d}`;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.LiveRegion,{politeMessage:X,assertiveMessage:ie}),(0,a.jsxs)(r.Popover,{open:R,onOpenChange:de,modal:ne,children:[(0,a.jsx)(`div`,{id:A.triggerDescriptionId,className:`sr-only`,children:`Multi-select dropdown. Use arrow keys to navigate, Enter to select, and Escape to close.`}),(0,a.jsx)(`div`,{id:A.selectedCountId,className:`sr-only`,"aria-live":`polite`,children:L.length===0?`No options selected`:`${L.length} option${L.length===1?``:`s`} selected: ${L.map(e=>Y(e)?.label).filter(Boolean).join(`, `)}`}),(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsx)(t.Button,{ref:q,variant:`outline`,width:S,...k,onClick:ae,disabled:x,role:`combobox`,"aria-expanded":R,"aria-haspopup":`listbox`,"aria-controls":R?A.listboxId:void 0,"aria-describedby":`${A.triggerDescriptionId} ${A.selectedCountId}`,"aria-label":fe,className:n.cn(`flex p-1 rounded-md border min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit [&_svg]:pointer-events-auto`,v?`w-auto`:`w-full`,U.compactMode&&`min-h-8 text-sm`,V===`mobile`&&`min-h-12 text-base`,x&&`opacity-50 cursor-not-allowed`,m),style:{...W,maxWidth:`min(${W.maxWidth}, 100%)`},children:L.length>0?(0,a.jsx)(i.SelectedValuesContent,{selectedValues:L,responsiveSettings:U,screenSize:V,singleLine:y,animation:f,animationConfig:p,badgeAnimationClass:G,variant:c,getOptionByValue:Y,toggleOption:Q,clearExtraOptions:se,handleClear:$}):(0,a.jsx)(i.PlaceholderContent,{placeholder:d})})}),(0,a.jsx)(r.PopoverContent,{id:A.listboxId,role:`listbox`,"aria-multiselectable":`true`,"aria-label":`Available options`,className:n.cn(`w-auto p-0 touch-manipulation`,K,V===`mobile`&&`w-[85vw] max-w-70`,V===`tablet`&&`w-[70vw] max-w-md`,V===`desktop`&&`min-w-75`,b),style:{animationDuration:`${p?.duration||f}s`,animationDelay:`${p?.delay||0}s`,maxWidth:`min(${W.maxWidth}, 85vw)`,maxHeight:V===`mobile`?`70vh`:`60vh`},align:`start`,onEscapeKeyDown:()=>Z(!1),children:(0,a.jsx)(i.OptionsContent,{filteredOptions:H,hideSelectAll:h,searchValue:B,searchable:g,selectedValues:L,getAllOptions:J,toggleAll:ce,toggleOption:Q,handleClear:$,setIsPopoverOpen:Z,handleInputKeyDown:oe,setSearchValue:le,multiSelectId:A.multiSelectId,emptyIndicator:_,screenSize:V})}),f>0&&L.length>0&&(0,a.jsx)(e.Icons.WandSparkles,{className:n.cn(`cursor-pointer my-2 text-foreground bg-background w-3 h-3`,z?``:`text-muted-foreground`),onClick:()=>ue(!z)})]})]})};o.displayName=`MultiSelect`,exports.default=o;
1
+ const e=require("./index151.cjs"),t=require("./index155.cjs");let n=require("react/jsx-runtime"),r=require("react/compiler-runtime");var i=i=>{let a=(0,r.c)(8),o,s;a[0]===i?(o=a[1],s=a[2]):({options:o,...s}=i,a[0]=i,a[1]=o,a[2]=s);let c;a[3]===o?c=a[4]:(c=e=>{let{onChange:r,value:i,...a}=e;return(0,n.jsx)(t.default,{...a,options:o,onValueChange:r,value:i})},a[3]=o,a[4]=c);let l;return a[5]!==s||a[6]!==c?(l=(0,n.jsx)(e.FormBase,{...s,children:c}),a[5]=s,a[6]=c,a[7]=l):l=a[7],l};exports.FormMultiSelect=i,exports.default=i;
package/dist/index156.js CHANGED
@@ -1,126 +1,25 @@
1
- import { Icons as e } from "./index4.js";
2
- import { Button as t } from "./index25.js";
3
- import { cn as n } from "./index36.js";
4
- import { Popover as r, PopoverContent as i, PopoverTrigger as ee } from "./index115.js";
5
- import { LiveRegion as te, OptionsContent as ne, PlaceholderContent as re, SelectedValuesContent as a } from "./index154.js";
6
- import { useMultiSelect as o } from "./index155.js";
7
- import "react";
8
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
9
- // src/MultiSelect/MultiSelect.tsx
10
- var u = ({ options: u, onValueChange: d, variant: f, defaultValue: p = [], value: m, placeholder: h = "Select options", animation: g = 0, animationConfig: _, maxCount: ie = 3, modalPopover: ae = !1, className: oe, hideSelectAll: v = !1, searchable: y = !0, emptyIndicator: b, autoSize: x = !1, singleLine: S = !1, popoverClassName: C, disabled: w = !1, responsive: T, width: E, minWidth: D, maxWidth: O, deduplicateOptions: k = !1, resetOnDefaultValueChange: A = !0, closeOnSelect: j = !1, ref: M, ...N }) => {
11
- let { ids: P, state: F, derived: I, refs: L, helpers: R, a11yMessages: z, handlers: B } = o({
12
- options: u,
13
- onValueChange: d,
14
- defaultValue: m || p,
15
- animation: g,
16
- animationConfig: _,
17
- maxCount: ie,
18
- responsive: T,
19
- minWidth: D,
20
- maxWidth: O,
21
- deduplicateOptions: k,
22
- resetOnDefaultValueChange: A,
23
- closeOnSelect: j,
24
- searchable: y,
25
- autoSize: x,
26
- disabled: w,
27
- forwardedRef: M
28
- }), { selectedValues: V, isPopoverOpen: H, isAnimating: U, searchValue: W, screenSize: G } = F, { filteredOptions: K, responsiveSettings: q, widthConstraints: J, badgeAnimationClass: se, popoverAnimationClass: ce } = I, { buttonRef: le } = L, { getAllOptions: Y, getOptionByValue: X } = R, { politeMessage: ue, assertiveMessage: de } = z, { setIsPopoverOpen: Z, handleTogglePopover: fe, handleInputKeyDown: pe, toggleOption: Q, handleClear: $, clearExtraOptions: me, toggleAll: he, setSearchValue: ge, setIsAnimating: _e } = B, ve = (e) => {
29
- w || Z(e);
30
- }, ye = `Multi-select: ${V.length} of ${Y().length} options selected. ${h}`;
31
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(te, {
32
- politeMessage: ue,
33
- assertiveMessage: de
34
- }), /* @__PURE__ */ l(r, {
35
- open: H,
36
- onOpenChange: ve,
37
- modal: ae,
38
- children: [
39
- /* @__PURE__ */ c("div", {
40
- id: P.triggerDescriptionId,
41
- className: "sr-only",
42
- children: "Multi-select dropdown. Use arrow keys to navigate, Enter to select, and Escape to close."
43
- }),
44
- /* @__PURE__ */ c("div", {
45
- id: P.selectedCountId,
46
- className: "sr-only",
47
- "aria-live": "polite",
48
- children: V.length === 0 ? "No options selected" : `${V.length} option${V.length === 1 ? "" : "s"} selected: ${V.map((e) => X(e)?.label).filter(Boolean).join(", ")}`
49
- }),
50
- /* @__PURE__ */ c(ee, {
51
- asChild: !0,
52
- children: /* @__PURE__ */ c(t, {
53
- ref: le,
54
- variant: "outline",
55
- width: E,
56
- ...N,
57
- onClick: fe,
58
- disabled: w,
59
- role: "combobox",
60
- "aria-expanded": H,
61
- "aria-haspopup": "listbox",
62
- "aria-controls": H ? P.listboxId : void 0,
63
- "aria-describedby": `${P.triggerDescriptionId} ${P.selectedCountId}`,
64
- "aria-label": ye,
65
- className: n("flex p-1 rounded-md border min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit [&_svg]:pointer-events-auto", x ? "w-auto" : "w-full", q.compactMode && "min-h-8 text-sm", G === "mobile" && "min-h-12 text-base", w && "opacity-50 cursor-not-allowed", oe),
66
- style: {
67
- ...J,
68
- maxWidth: `min(${J.maxWidth}, 100%)`
69
- },
70
- children: V.length > 0 ? /* @__PURE__ */ c(a, {
71
- selectedValues: V,
72
- responsiveSettings: q,
73
- screenSize: G,
74
- singleLine: S,
75
- animation: g,
76
- animationConfig: _,
77
- badgeAnimationClass: se,
78
- variant: f,
79
- getOptionByValue: X,
80
- toggleOption: Q,
81
- clearExtraOptions: me,
82
- handleClear: $
83
- }) : /* @__PURE__ */ c(re, { placeholder: h })
84
- })
85
- }),
86
- /* @__PURE__ */ c(i, {
87
- id: P.listboxId,
88
- role: "listbox",
89
- "aria-multiselectable": "true",
90
- "aria-label": "Available options",
91
- className: n("w-auto p-0 touch-manipulation", ce, G === "mobile" && "w-[85vw] max-w-70", G === "tablet" && "w-[70vw] max-w-md", G === "desktop" && "min-w-75", C),
92
- style: {
93
- animationDuration: `${_?.duration || g}s`,
94
- animationDelay: `${_?.delay || 0}s`,
95
- maxWidth: `min(${J.maxWidth}, 85vw)`,
96
- maxHeight: G === "mobile" ? "70vh" : "60vh"
97
- },
98
- align: "start",
99
- onEscapeKeyDown: () => Z(!1),
100
- children: /* @__PURE__ */ c(ne, {
101
- filteredOptions: K,
102
- hideSelectAll: v,
103
- searchValue: W,
104
- searchable: y,
105
- selectedValues: V,
106
- getAllOptions: Y,
107
- toggleAll: he,
108
- toggleOption: Q,
109
- handleClear: $,
110
- setIsPopoverOpen: Z,
111
- handleInputKeyDown: pe,
112
- setSearchValue: ge,
113
- multiSelectId: P.multiSelectId,
114
- emptyIndicator: b,
115
- screenSize: G
116
- })
117
- }),
118
- g > 0 && V.length > 0 && /* @__PURE__ */ c(e.WandSparkles, {
119
- className: n("cursor-pointer my-2 text-foreground bg-background w-3 h-3", U ? "" : "text-muted-foreground"),
120
- onClick: () => _e(!U)
121
- })
122
- ]
123
- })] });
1
+ import { FormBase as e } from "./index151.js";
2
+ import t from "./index155.js";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ import { c as r } from "react/compiler-runtime";
5
+ // src/Form/FormMultiSelect/FormMultiSelect.tsx
6
+ var i = (i) => {
7
+ let a = r(8), o, s;
8
+ a[0] === i ? (o = a[1], s = a[2]) : ({options: o, ...s} = i, a[0] = i, a[1] = o, a[2] = s);
9
+ let c;
10
+ a[3] === o ? c = a[4] : (c = (e) => {
11
+ let { onChange: r, value: i, ...a } = e;
12
+ return /* @__PURE__ */ n(t, {
13
+ ...a,
14
+ options: o,
15
+ onValueChange: r,
16
+ value: i
17
+ });
18
+ }, a[3] = o, a[4] = c);
19
+ let l;
20
+ return a[5] !== s || a[6] !== c ? (l = /* @__PURE__ */ n(e, {
21
+ ...s,
22
+ children: c
23
+ }), a[5] = s, a[6] = c, a[7] = l) : l = a[7], l;
124
24
  };
125
- u.displayName = "MultiSelect";
126
- export { u as default };
25
+ export { i as FormMultiSelect, i as default };
package/dist/index157.cjs CHANGED
@@ -1 +1 @@
1
- const e=require("./index151.cjs"),t=require("./index156.cjs");let n=require("react/jsx-runtime"),r=require("react/compiler-runtime");var i=i=>{let a=(0,r.c)(8),o,s;a[0]===i?(o=a[1],s=a[2]):({options:o,...s}=i,a[0]=i,a[1]=o,a[2]=s);let c;a[3]===o?c=a[4]:(c=e=>{let{onChange:r,value:i,...a}=e;return(0,n.jsx)(t.default,{...a,options:o,onValueChange:r,value:i})},a[3]=o,a[4]=c);let l;return a[5]!==s||a[6]!==c?(l=(0,n.jsx)(e.FormBase,{...s,children:c}),a[5]=s,a[6]=c,a[7]=l):l=a[7],l};exports.FormMultiSelect=i,exports.default=i;
1
+ function e(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}exports.buildFormatLongFn=e;
package/dist/index157.js CHANGED
@@ -1,25 +1,8 @@
1
- import { FormBase as e } from "./index151.js";
2
- import t from "./index156.js";
3
- import { jsx as n } from "react/jsx-runtime";
4
- import { c as r } from "react/compiler-runtime";
5
- // src/Form/FormMultiSelect/FormMultiSelect.tsx
6
- var i = (i) => {
7
- let a = r(8), o, s;
8
- a[0] === i ? (o = a[1], s = a[2]) : ({options: o, ...s} = i, a[0] = i, a[1] = o, a[2] = s);
9
- let c;
10
- a[3] === o ? c = a[4] : (c = (e) => {
11
- let { onChange: r, value: i, ...a } = e;
12
- return /* @__PURE__ */ n(t, {
13
- ...a,
14
- options: o,
15
- onValueChange: r,
16
- value: i
17
- });
18
- }, a[3] = o, a[4] = c);
19
- let l;
20
- return a[5] !== s || a[6] !== c ? (l = /* @__PURE__ */ n(e, {
21
- ...s,
22
- children: c
23
- }), a[5] = s, a[6] = c, a[7] = l) : l = a[7], l;
24
- };
25
- export { i as FormMultiSelect, i as default };
1
+ // ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js
2
+ function e(e) {
3
+ return (t = {}) => {
4
+ let n = t.width ? String(t.width) : e.defaultWidth;
5
+ return e.formats[n] || e.formats[e.defaultWidth];
6
+ };
7
+ }
8
+ export { e as buildFormatLongFn };
package/dist/index158.cjs CHANGED
@@ -1 +1 @@
1
- function e(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}exports.buildFormatLongFn=e;
1
+ function e(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}exports.buildLocalizeFn=e;
package/dist/index158.js CHANGED
@@ -1,8 +1,16 @@
1
- // ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js
1
+ // ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js
2
2
  function e(e) {
3
- return (t = {}) => {
4
- let n = t.width ? String(t.width) : e.defaultWidth;
5
- return e.formats[n] || e.formats[e.defaultWidth];
3
+ return (t, n) => {
4
+ let r = n?.context ? String(n.context) : "standalone", i;
5
+ if (r === "formatting" && e.formattingValues) {
6
+ let t = e.defaultFormattingWidth || e.defaultWidth, r = n?.width ? String(n.width) : t;
7
+ i = e.formattingValues[r] || e.formattingValues[t];
8
+ } else {
9
+ let t = e.defaultWidth, r = n?.width ? String(n.width) : e.defaultWidth;
10
+ i = e.values[r] || e.values[t];
11
+ }
12
+ let a = e.argumentCallback ? e.argumentCallback(t) : t;
13
+ return i[a];
6
14
  };
7
15
  }
8
- export { e as buildFormatLongFn };
16
+ export { e as buildLocalizeFn };
package/dist/index159.cjs CHANGED
@@ -1 +1 @@
1
- function e(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}exports.buildLocalizeFn=e;
1
+ function e(e){return(r,i={})=>{let a=i.width,o=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],s=r.match(o);if(!s)return null;let c=s[0],l=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?n(l,e=>e.test(c)):t(l,e=>e.test(c)),d;d=e.valueCallback?e.valueCallback(u):u,d=i.valueCallback?i.valueCallback(d):d;let f=r.slice(c.length);return{value:d,rest:f}}}function t(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function n(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}exports.buildMatchFn=e;