@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/index153.js CHANGED
@@ -1,87 +1,323 @@
1
- // src/MultiSelect/utils.ts
2
- var e = (e) => Array.isArray(e) && e.length > 0 && "heading" in e[0], t = (e, t) => {
3
- if (e.length !== t.length) return !1;
4
- let n = [...e].sort(), r = [...t].sort();
5
- return n.every((e, t) => e === r[t]);
6
- }, n = (t, n) => {
7
- if (t.length === 0) return {
8
- options: [],
9
- duplicates: []
10
- };
11
- let r = e(t) ? t.flatMap((e) => e.options) : t, i = /* @__PURE__ */ new Set(), a = [], o = [];
12
- return r.forEach((e) => {
13
- i.has(e.value) ? (a.push(e.value), n || o.push(e)) : (i.add(e.value), o.push(e));
14
- }), {
15
- options: n ? o : r,
16
- duplicates: a
17
- };
18
- }, r = (e, t, n) => {
19
- if (!e) return {
20
- maxCount: t,
21
- hideIcons: !1,
22
- compactMode: !1
23
- };
24
- if (e === !0) {
25
- let e = {
26
- mobile: {
27
- maxCount: 2,
28
- hideIcons: !1,
29
- compactMode: !0
30
- },
31
- tablet: {
32
- maxCount: 4,
33
- hideIcons: !1,
34
- compactMode: !1
35
- },
36
- desktop: {
37
- maxCount: 6,
38
- hideIcons: !1,
39
- compactMode: !1
40
- }
41
- }[n];
42
- return {
43
- maxCount: e?.maxCount ?? t,
44
- hideIcons: e?.hideIcons ?? !1,
45
- compactMode: e?.compactMode ?? !1
46
- };
47
- }
48
- let r = e[n];
49
- return {
50
- maxCount: r?.maxCount ?? t,
51
- hideIcons: r?.hideIcons ?? !1,
52
- compactMode: r?.compactMode ?? !1
53
- };
54
- }, i = (e, t) => {
55
- if (t?.badgeAnimation) switch (t.badgeAnimation) {
56
- case "bounce": return e ? "animate-bounce" : "hover:-translate-y-1 hover:scale-110";
57
- case "pulse": return "hover:animate-pulse";
58
- case "wiggle": return "hover:animate-wiggle";
59
- case "fade": return "hover:opacity-80";
60
- case "slide": return "hover:translate-x-1";
61
- case "none": return "";
62
- default: return "";
1
+ import { Badge as e } from "./index34.js";
2
+ import { cn as t } from "./index36.js";
3
+ import { Command as n, CommandEmpty as r, CommandGroup as i, CommandInput as a, CommandItem as o, CommandList as s, CommandSeparator as c } from "./index51.js";
4
+ import { Separator as l } from "./index96.js";
5
+ import { isGroupedOptions as u } from "./index152.js";
6
+ import "react";
7
+ import "@stylexjs/stylex";
8
+ import { CheckIcon as d, ChevronDown as f, XCircle as p, XIcon as m } from "lucide-react";
9
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
10
+ import { c as v } from "react/compiler-runtime";
11
+ // src/MultiSelect/renderers.tsx
12
+ var y = {
13
+ extraBadge: {
14
+ kWkggS: "xjbqb8w",
15
+ kMwMTN: "x84br7x",
16
+ kVAM5u: "xb30jbz",
17
+ kGzVvX: "x1n5bzlp",
18
+ $$css: !0
19
+ },
20
+ separator: {
21
+ k1xSpc: "x78zum5",
22
+ kAzted: "x1rqwxy8",
23
+ kZKoxP: "x5yr21d",
24
+ $$css: !0
25
+ },
26
+ footerActionItem: {
27
+ kUk6DE: "x98rzlu",
28
+ kjj79g: "xl56j7k",
29
+ kkrTdU: "x1ypdohk",
30
+ $$css: !0
63
31
  }
64
- return e ? "animate-bounce" : "";
65
- }, a = (e) => {
66
- if (e?.popoverAnimation) switch (e.popoverAnimation) {
67
- case "scale": return "animate-scaleIn";
68
- case "slide": return "animate-slideInDown";
69
- case "fade": return "animate-fadeIn";
70
- case "flip": return "animate-flipIn";
71
- case "none": return "";
72
- default: return "";
73
- }
74
- return "";
75
- }, o = (t, n, r) => !r || !n ? t : t.length === 0 ? [] : e(t) ? t.map((e) => ({
76
- ...e,
77
- options: e.options.filter((e) => e.label.toLowerCase().includes(n.toLowerCase()) || e.value.toLowerCase().includes(n.toLowerCase()))
78
- })).filter((e) => e.options.length > 0) : t.filter((e) => e.label.toLowerCase().includes(n.toLowerCase()) || e.value.toLowerCase().includes(n.toLowerCase())), s = (e, t, n, r) => ({
79
- minWidth: n || (e === "mobile" ? "0px" : "200px"),
80
- maxWidth: r || "100%",
81
- width: t ? "auto" : "100%"
82
- }), c = (e, t) => {
83
- if (!t) return e.length;
84
- let n = t.toLowerCase();
85
- return e.filter((e) => e.label.toLowerCase().includes(n) || e.value.toLowerCase().includes(n)).length;
32
+ }, b = (e) => {
33
+ let t = v(7), { politeMessage: n, assertiveMessage: r } = e, i;
34
+ t[0] === n ? i = t[1] : (i = /* @__PURE__ */ g("div", {
35
+ "aria-live": "polite",
36
+ "aria-atomic": "true",
37
+ role: "status",
38
+ children: n
39
+ }), t[0] = n, t[1] = i);
40
+ let a;
41
+ t[2] === r ? a = t[3] : (a = /* @__PURE__ */ g("div", {
42
+ "aria-live": "assertive",
43
+ "aria-atomic": "true",
44
+ role: "alert",
45
+ children: r
46
+ }), t[2] = r, t[3] = a);
47
+ let o;
48
+ return t[4] !== i || t[5] !== a ? (o = /* @__PURE__ */ _("div", {
49
+ className: "x10l6tqk x1i1rx1s xjm9jq1 x1717udv xkdpibf xb3r6kr xzpqnlu xuxw1ft xc342km",
50
+ children: [i, a]
51
+ }), t[4] = i, t[5] = a, t[6] = o) : o = t[6], o;
52
+ }, x = (n) => {
53
+ let r = v(51), { selectedValues: i, responsiveSettings: a, singleLine: o, animation: s, animationConfig: c, badgeAnimationClass: u, variant: d, getOptionByValue: h, toggleOption: b, clearExtraOptions: x, handleClear: S } = n, C;
54
+ r[0] === Symbol.for("react.memo_cache_sentinel") ? (C = {
55
+ 0: { className: "x78zum5 x6s0dn4 xvh977a x1a02dak" },
56
+ 2: { className: "x78zum5 x6s0dn4 xvh977a xw2csxc xes99ow" },
57
+ 1: { className: "x78zum5 x6s0dn4 x1a02dak x1enigpx" },
58
+ 3: { className: "x78zum5 x6s0dn4 xw2csxc xes99ow x1enigpx" }
59
+ }, r[0] = C) : C = r[0];
60
+ let w = C[!!o << 1 | !!a.compactMode], T;
61
+ if (r[1] !== s || r[2] !== c?.delay || r[3] !== c?.duration || r[4] !== u || r[5] !== h || r[6] !== a.compactMode || r[7] !== a.hideIcons || r[8] !== a.maxCount || r[9] !== i || r[10] !== b || r[11] !== d) {
62
+ let n;
63
+ r[13] !== s || r[14] !== c?.delay || r[15] !== c?.duration || r[16] !== u || r[17] !== h || r[18] !== a.compactMode || r[19] !== a.hideIcons || r[20] !== b || r[21] !== d ? (n = (n) => {
64
+ let r = h(n), i = r?.icon, o = r?.style;
65
+ if (!r) return null;
66
+ let l = {
67
+ animationDuration: `${s}s`,
68
+ ...o?.badgeColor && { backgroundColor: o.badgeColor },
69
+ ...o?.gradient && {
70
+ background: o.gradient,
71
+ color: "white"
72
+ }
73
+ };
74
+ return /* @__PURE__ */ _(e, {
75
+ variant: d || "secondary",
76
+ className: t(u),
77
+ style: {
78
+ ...l,
79
+ animationDuration: `${c?.duration || s}s`,
80
+ animationDelay: `${c?.delay || 0}s`
81
+ },
82
+ children: [
83
+ i && !a.hideIcons && /* @__PURE__ */ g(i, {
84
+ ...{
85
+ 0: { className: "x1l36t39 xcdlrvm xpoiemb" },
86
+ 1: { className: "xvle69y x1jw3ynk xj17ml3" }
87
+ }[!!a.compactMode | 0],
88
+ ...o?.iconColor && { style: { color: o.iconColor } }
89
+ }),
90
+ /* @__PURE__ */ g("span", { children: r.label }),
91
+ /* @__PURE__ */ g("div", {
92
+ role: "button",
93
+ tabIndex: 0,
94
+ onClick: (e) => {
95
+ e.stopPropagation(), b(n);
96
+ },
97
+ onKeyDown: (e) => {
98
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), b(n));
99
+ },
100
+ "aria-label": `Remove ${r.label} from selection`,
101
+ className: "x13zjp5t x1l36t39 xcdlrvm x1ypdohk x1q0v2j7 x1ngqb6p x1a2a7pz x17iuh41",
102
+ children: /* @__PURE__ */ g(p, { ...{
103
+ 0: { className: "xvle69y x1jw3ynk" },
104
+ 1: { className: "x1qa65zt x1e7hgle" }
105
+ }[!!a.compactMode | 0] })
106
+ })
107
+ ]
108
+ }, n);
109
+ }, r[13] = s, r[14] = c?.delay, r[15] = c?.duration, r[16] = u, r[17] = h, r[18] = a.compactMode, r[19] = a.hideIcons, r[20] = b, r[21] = d, r[22] = n) : n = r[22], T = i.slice(0, a.maxCount).map(n).filter(Boolean), r[1] = s, r[2] = c?.delay, r[3] = c?.duration, r[4] = u, r[5] = h, r[6] = a.compactMode, r[7] = a.hideIcons, r[8] = a.maxCount, r[9] = i, r[10] = b, r[11] = d, r[12] = T;
110
+ } else T = r[12];
111
+ let E;
112
+ r[23] !== s || r[24] !== c?.delay || r[25] !== c?.duration || r[26] !== u || r[27] !== x || r[28] !== a.compactMode || r[29] !== a.maxCount || r[30] !== i.length ? (E = i.length > a.maxCount && /* @__PURE__ */ _(e, {
113
+ sx: y.extraBadge,
114
+ className: t(u),
115
+ style: {
116
+ animationDuration: `${c?.duration || s}s`,
117
+ animationDelay: `${c?.delay || 0}s`
118
+ },
119
+ children: [`+ ${i.length - a.maxCount} more`, /* @__PURE__ */ g(p, {
120
+ ...{
121
+ 0: { className: "x13zjp5t x1l36t39 xcdlrvm x1ypdohk" },
122
+ 1: { className: "x4aigyd xvle69y x1jw3ynk" }
123
+ }[!!a.compactMode | 0],
124
+ onClick: (e) => {
125
+ e.stopPropagation(), x();
126
+ }
127
+ })]
128
+ }), r[23] = s, r[24] = c?.delay, r[25] = c?.duration, r[26] = u, r[27] = x, r[28] = a.compactMode, r[29] = a.maxCount, r[30] = i.length, r[31] = E) : E = r[31];
129
+ let D;
130
+ r[32] !== w || r[33] !== T || r[34] !== E ? (D = /* @__PURE__ */ _("div", {
131
+ ...w,
132
+ children: [T, E]
133
+ }), r[32] = w, r[33] = T, r[34] = E, r[35] = D) : D = r[35];
134
+ let O, k;
135
+ r[36] === S ? (O = r[37], k = r[38]) : (O = (e) => {
136
+ e.stopPropagation(), S();
137
+ }, k = (e) => {
138
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), S());
139
+ }, r[36] = S, r[37] = O, r[38] = k);
140
+ let A = `Clear all ${i.length} selected options`, j;
141
+ r[39] === Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ g(m, { className: "x1l36t39 xcdlrvm" }), r[39] = j) : j = r[39];
142
+ let M;
143
+ r[40] !== O || r[41] !== k || r[42] !== A ? (M = /* @__PURE__ */ g("div", {
144
+ role: "button",
145
+ tabIndex: 0,
146
+ onClick: O,
147
+ onKeyDown: k,
148
+ "aria-label": A,
149
+ className: "x78zum5 x6s0dn4 xl56j7k x1l36t39 xcdlrvm x1wboj75 x1ypdohk xw3nh4a x1q0v2j7 x1a2a7pz x8aud5w",
150
+ children: j
151
+ }), r[40] = O, r[41] = k, r[42] = A, r[43] = M) : M = r[43];
152
+ let N, P;
153
+ r[44] === Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ g(l, {
154
+ orientation: "vertical",
155
+ sx: y.separator
156
+ }), P = /* @__PURE__ */ g(f, {
157
+ className: "x1l36t39 xcdlrvm x1wboj75 x1ypdohk xw3nh4a",
158
+ "aria-hidden": "true"
159
+ }), r[44] = N, r[45] = P) : (N = r[44], P = r[45]);
160
+ let F;
161
+ r[46] === M ? F = r[47] : (F = /* @__PURE__ */ _("div", {
162
+ className: "x78zum5 x6s0dn4 x1qughib",
163
+ children: [
164
+ M,
165
+ N,
166
+ P
167
+ ]
168
+ }), r[46] = M, r[47] = F);
169
+ let I;
170
+ return r[48] !== F || r[49] !== D ? (I = /* @__PURE__ */ _("div", {
171
+ className: "x78zum5 x1qughib x6s0dn4 xh8yej3",
172
+ children: [D, F]
173
+ }), r[48] = F, r[49] = D, r[50] = I) : I = r[50], I;
174
+ }, S = (e) => {
175
+ let t = v(5), { placeholder: n } = e, r;
176
+ t[0] === n ? r = t[1] : (r = /* @__PURE__ */ g("span", {
177
+ className: "xkpwil5 xw3nh4a x1acpp9h",
178
+ children: n
179
+ }), t[0] = n, t[1] = r);
180
+ let i;
181
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ g(f, { className: "x1l36t39 xcdlrvm x1ypdohk xw3nh4a x1wboj75" }), t[2] = i) : i = t[2];
182
+ let a;
183
+ return t[3] === r ? a = t[4] : (a = /* @__PURE__ */ _("div", {
184
+ className: "x78zum5 x6s0dn4 x1qughib xh8yej3 xvueqy4",
185
+ children: [r, i]
186
+ }), t[3] = r, t[4] = a), a;
187
+ }, C = (e) => {
188
+ let t = v(39), { filteredOptions: f, hideSelectAll: p, searchValue: m, searchable: b, selectedValues: x, getAllOptions: S, toggleAll: C, toggleOption: E, handleClear: D, setIsPopoverOpen: O, handleInputKeyDown: k, setSearchValue: A, multiSelectId: j, emptyIndicator: M } = e, N;
189
+ t[0] !== k || t[1] !== j || t[2] !== m || t[3] !== b || t[4] !== A ? (N = b && /* @__PURE__ */ g(a, {
190
+ placeholder: "Search options...",
191
+ onKeyDown: k,
192
+ value: m,
193
+ onValueChange: A,
194
+ "aria-label": "Search through available options",
195
+ "aria-describedby": `${j}-search-help`
196
+ }), t[0] = k, t[1] = j, t[2] = m, t[3] = b, t[4] = A, t[5] = N) : N = t[5];
197
+ let P;
198
+ t[6] !== j || t[7] !== b ? (P = b && /* @__PURE__ */ g("div", {
199
+ id: `${j}-search-help`,
200
+ className: "x10l6tqk x1i1rx1s xjm9jq1 x1717udv xkdpibf xb3r6kr xzpqnlu xuxw1ft xc342km",
201
+ children: "Type to filter options. Use arrow keys to navigate results."
202
+ }), t[6] = j, t[7] = b, t[8] = P) : P = t[8];
203
+ let F = M || "No results found.", I;
204
+ t[9] === F ? I = t[10] : (I = /* @__PURE__ */ g(r, { children: F }), t[9] = F, t[10] = I);
205
+ let L;
206
+ t[11] !== S || t[12] !== p || t[13] !== m || t[14] !== x.length || t[15] !== C ? (L = !p && !m && /* @__PURE__ */ g(i, { children: /* @__PURE__ */ _(o, {
207
+ onSelect: C,
208
+ role: "option",
209
+ "aria-selected": x.length === S().filter(w).length,
210
+ "aria-label": `Select all ${S().length} options`,
211
+ children: [/* @__PURE__ */ g("div", {
212
+ ...{
213
+ 0: { className: "xpoiemb x78zum5 x1l36t39 xcdlrvm x6s0dn4 xl56j7k x1q0v2j7 xmkeg23 x1y0btm7 x1khvrlk xbyyjgo" },
214
+ 1: { className: "xpoiemb x78zum5 x1l36t39 xcdlrvm x6s0dn4 xl56j7k x1q0v2j7 xmkeg23 x1y0btm7 x1khvrlk x1j7ufkg xstwp1q" }
215
+ }[x.length === S().filter(T).length | 0],
216
+ "aria-hidden": "true",
217
+ children: /* @__PURE__ */ g(d, { className: "x1l36t39 xcdlrvm" })
218
+ }), /* @__PURE__ */ _("span", { children: [
219
+ "(Select All",
220
+ S().length > 20 ? ` - ${S().length} options` : "",
221
+ ")"
222
+ ] })]
223
+ }, "all") }), t[11] = S, t[12] = p, t[13] = m, t[14] = x.length, t[15] = C, t[16] = L) : L = t[16];
224
+ let R;
225
+ t[17] !== f || t[18] !== x || t[19] !== E ? (R = u(f) ? f.map((e) => /* @__PURE__ */ g(i, {
226
+ heading: e.heading,
227
+ children: e.options.map((e) => {
228
+ let t = x.includes(e.value);
229
+ return /* @__PURE__ */ _(o, {
230
+ onSelect: () => E(e.value),
231
+ role: "option",
232
+ "aria-selected": t,
233
+ "aria-disabled": e.disabled,
234
+ "aria-label": `${e.label}${t ? ", selected" : ", not selected"}${e.disabled ? ", disabled" : ""}`,
235
+ disabled: e.disabled,
236
+ children: [
237
+ /* @__PURE__ */ g("div", {
238
+ ...{
239
+ 0: { className: "xpoiemb x78zum5 x1l36t39 xcdlrvm x6s0dn4 xl56j7k x1q0v2j7 xmkeg23 x1y0btm7 x1khvrlk xbyyjgo" },
240
+ 1: { className: "xpoiemb x78zum5 x1l36t39 xcdlrvm x6s0dn4 xl56j7k x1q0v2j7 xmkeg23 x1y0btm7 x1khvrlk x1j7ufkg xstwp1q" }
241
+ }[!!t | 0],
242
+ "aria-hidden": "true",
243
+ children: /* @__PURE__ */ g(d, { className: "x1l36t39 xcdlrvm" })
244
+ }),
245
+ e.icon && /* @__PURE__ */ g(e.icon, {
246
+ className: "xpoiemb x1l36t39 xcdlrvm xw3nh4a",
247
+ "aria-hidden": "true"
248
+ }),
249
+ /* @__PURE__ */ g("span", { children: e.label })
250
+ ]
251
+ }, e.value);
252
+ })
253
+ }, e.heading)) : /* @__PURE__ */ g(i, { children: f.map((e) => {
254
+ let t = x.includes(e.value);
255
+ return /* @__PURE__ */ _(o, {
256
+ onSelect: () => E(e.value),
257
+ role: "option",
258
+ "aria-selected": t,
259
+ "aria-disabled": e.disabled,
260
+ "aria-label": `${e.label}${t ? ", selected" : ", not selected"}${e.disabled ? ", disabled" : ""}`,
261
+ disabled: e.disabled,
262
+ children: [
263
+ /* @__PURE__ */ g("div", {
264
+ ...{
265
+ 0: { className: "xpoiemb x78zum5 x1l36t39 xcdlrvm x6s0dn4 xl56j7k x1q0v2j7 xmkeg23 x1y0btm7 x1khvrlk xbyyjgo" },
266
+ 1: { className: "xpoiemb x78zum5 x1l36t39 xcdlrvm x6s0dn4 xl56j7k x1q0v2j7 xmkeg23 x1y0btm7 x1khvrlk x1j7ufkg xstwp1q" }
267
+ }[!!t | 0],
268
+ "aria-hidden": "true",
269
+ children: /* @__PURE__ */ g(d, { className: "x1l36t39 xcdlrvm" })
270
+ }),
271
+ e.icon && /* @__PURE__ */ g(e.icon, {
272
+ className: "xpoiemb x1l36t39 xcdlrvm xw3nh4a",
273
+ "aria-hidden": "true"
274
+ }),
275
+ /* @__PURE__ */ g("span", { children: e.label })
276
+ ]
277
+ }, e.value);
278
+ }) }), t[17] = f, t[18] = x, t[19] = E, t[20] = R) : R = t[20];
279
+ let z;
280
+ t[21] === Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ g(c, {}), t[21] = z) : z = t[21];
281
+ let B;
282
+ t[22] !== D || t[23] !== x.length ? (B = x.length > 0 && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(o, {
283
+ onSelect: D,
284
+ sx: y.footerActionItem,
285
+ children: "Clear"
286
+ }), /* @__PURE__ */ g(l, {
287
+ orientation: "vertical",
288
+ sx: y.separator
289
+ })] }), t[22] = D, t[23] = x.length, t[24] = B) : B = t[24];
290
+ let V;
291
+ t[25] === O ? V = t[26] : (V = /* @__PURE__ */ g(o, {
292
+ onSelect: () => O(!1),
293
+ sx: y.footerActionItem,
294
+ children: "Close"
295
+ }), t[25] = O, t[26] = V);
296
+ let H;
297
+ t[27] !== B || t[28] !== V ? (H = /* @__PURE__ */ g(i, { children: /* @__PURE__ */ _("div", {
298
+ className: "x78zum5 x6s0dn4 x1qughib",
299
+ children: [B, V]
300
+ }) }), t[27] = B, t[28] = V, t[29] = H) : H = t[29];
301
+ let U;
302
+ t[30] !== H || t[31] !== I || t[32] !== L || t[33] !== R ? (U = /* @__PURE__ */ _(s, { children: [
303
+ I,
304
+ " ",
305
+ L,
306
+ R,
307
+ z,
308
+ H
309
+ ] }), t[30] = H, t[31] = I, t[32] = L, t[33] = R, t[34] = U) : U = t[34];
310
+ let W;
311
+ return t[35] !== N || t[36] !== U || t[37] !== P ? (W = /* @__PURE__ */ _(n, { children: [
312
+ N,
313
+ P,
314
+ U
315
+ ] }), t[35] = N, t[36] = U, t[37] = P, t[38] = W) : W = t[38], W;
86
316
  };
87
- export { t as arraysEqual, n as buildAllOptions, i as buildBadgeAnimationClass, a as buildPopoverAnimationClass, s as buildWidthConstraints, r as computeResponsiveSettings, c as countMatchingOptions, o as filterOptions, e as isGroupedOptions };
317
+ function w(e) {
318
+ return !e.disabled;
319
+ }
320
+ function T(e) {
321
+ return !e.disabled;
322
+ }
323
+ export { b as LiveRegion, C as OptionsContent, S as PlaceholderContent, x as SelectedValuesContent };
package/dist/index154.cjs CHANGED
@@ -1 +1 @@
1
- const e=require("./index34.cjs"),t=require("./index36.cjs"),n=require("./index51.cjs"),r=require("./index96.cjs"),i=require("./index152.cjs"),a=require("./index153.cjs");require("react");let o=require("lucide-react"),s=require("react/jsx-runtime"),c=require("react/compiler-runtime");var l=e=>{let t=(0,c.c)(7),{politeMessage:n,assertiveMessage:r}=e,i;t[0]===n?i=t[1]:(i=(0,s.jsx)(`div`,{"aria-live":`polite`,"aria-atomic":`true`,role:`status`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,s.jsx)(`div`,{"aria-live":`assertive`,"aria-atomic":`true`,role:`alert`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,s.jsxs)(`div`,{className:`sr-only`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o},u=n=>{let a=(0,c.c)(59),{selectedValues:l,responsiveSettings:u,screenSize:d,singleLine:f,animation:p,animationConfig:m,badgeAnimationClass:h,variant:g,getOptionByValue:_,toggleOption:v,clearExtraOptions:y,handleClear:b}=n,x=f?`overflow-x-auto multiselect-singleline-scroll pb-1`:`flex-wrap`,S=u.compactMode&&`gap-0.5`,C;a[0]!==x||a[1]!==S?(C=t.cn(`flex items-center gap-1`,x,S),a[0]=x,a[1]=S,a[2]=C):C=a[2];let w;if(a[3]!==p||a[4]!==m?.delay||a[5]!==m?.duration||a[6]!==h||a[7]!==_||a[8]!==u.compactMode||a[9]!==u.hideIcons||a[10]!==u.maxCount||a[11]!==d||a[12]!==l||a[13]!==f||a[14]!==v||a[15]!==g){let n;a[17]!==p||a[18]!==m?.delay||a[19]!==m?.duration||a[20]!==h||a[21]!==_||a[22]!==u.compactMode||a[23]!==u.hideIcons||a[24]!==d||a[25]!==f||a[26]!==v||a[27]!==g?(n=n=>{let r=_(n),a=r?.icon,c=r?.style;if(!r)return null;let l={animationDuration:`${p}s`,...c?.badgeColor&&{backgroundColor:c.badgeColor},...c?.gradient&&{background:c.gradient,color:`white`}};return(0,s.jsxs)(e.Badge,{variant:g||`secondary`,className:t.cn(h,i.multiSelectVariants({variant:g}),c?.gradient&&`text-white border-transparent`,u.compactMode&&`text-xs px-1.5 py-0.5`,d===`mobile`&&`max-w-30 truncate`,f&&`shrink-0 whitespace-nowrap`,`[&>svg]:pointer-events-auto`),style:{...l,animationDuration:`${m?.duration||p}s`,animationDelay:`${m?.delay||0}s`},children:[a&&!u.hideIcons&&(0,s.jsx)(a,{className:t.cn(`h-4 w-4 mr-2`,u.compactMode&&`h-3 w-3 mr-1`,c?.iconColor&&`text-current`),...c?.iconColor&&{style:{color:c.iconColor}}}),(0,s.jsx)(`span`,{className:t.cn(d===`mobile`&&`truncate`),children:r.label}),(0,s.jsx)(`div`,{role:`button`,tabIndex:0,onClick:e=>{e.stopPropagation(),v(n)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),v(n))},"aria-label":`Remove ${r.label} from selection`,className:`ml-2 h-4 w-4 cursor-pointer hover:bg-white/20 rounded-sm p-0.5 -m-0.5 focus:outline-none focus:ring-1 focus:ring-white/50`,children:(0,s.jsx)(o.XCircle,{className:t.cn(`h-3 w-3`,u.compactMode&&`h-2.5 w-2.5`)})})]},n)},a[17]=p,a[18]=m?.delay,a[19]=m?.duration,a[20]=h,a[21]=_,a[22]=u.compactMode,a[23]=u.hideIcons,a[24]=d,a[25]=f,a[26]=v,a[27]=g,a[28]=n):n=a[28],w=l.slice(0,u.maxCount).map(n).filter(Boolean),a[3]=p,a[4]=m?.delay,a[5]=m?.duration,a[6]=h,a[7]=_,a[8]=u.compactMode,a[9]=u.hideIcons,a[10]=u.maxCount,a[11]=d,a[12]=l,a[13]=f,a[14]=v,a[15]=g,a[16]=w}else w=a[16];let T;a[29]!==p||a[30]!==m?.delay||a[31]!==m?.duration||a[32]!==h||a[33]!==y||a[34]!==u.compactMode||a[35]!==u.maxCount||a[36]!==l.length||a[37]!==f||a[38]!==g?(T=l.length>u.maxCount&&(0,s.jsxs)(e.Badge,{className:t.cn(`bg-transparent text-foreground border-foreground/1 hover:bg-transparent`,h,i.multiSelectVariants({variant:g}),u.compactMode&&`text-xs px-1.5 py-0.5`,f&&`shrink-0 whitespace-nowrap`,`[&>svg]:pointer-events-auto`),style:{animationDuration:`${m?.duration||p}s`,animationDelay:`${m?.delay||0}s`},children:[`+ ${l.length-u.maxCount} more`,(0,s.jsx)(o.XCircle,{className:t.cn(`ml-2 h-4 w-4 cursor-pointer`,u.compactMode&&`ml-1 h-3 w-3`),onClick:e=>{e.stopPropagation(),y()}})]}),a[29]=p,a[30]=m?.delay,a[31]=m?.duration,a[32]=h,a[33]=y,a[34]=u.compactMode,a[35]=u.maxCount,a[36]=l.length,a[37]=f,a[38]=g,a[39]=T):T=a[39];let E;a[40]!==C||a[41]!==w||a[42]!==T?(E=(0,s.jsxs)(`div`,{className:C,children:[w,T]}),a[40]=C,a[41]=w,a[42]=T,a[43]=E):E=a[43];let D,O;a[44]===b?(D=a[45],O=a[46]):(D=e=>{e.stopPropagation(),b()},O=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),b())},a[44]=b,a[45]=D,a[46]=O);let k=`Clear all ${l.length} selected options`,A;a[47]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,s.jsx)(o.XIcon,{className:`h-4 w-4`}),a[47]=A):A=a[47];let j;a[48]!==D||a[49]!==O||a[50]!==k?(j=(0,s.jsx)(`div`,{role:`button`,tabIndex:0,onClick:D,onKeyDown:O,"aria-label":k,className:`flex items-center justify-center h-4 w-4 mx-2 cursor-pointer text-muted-foreground hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1 rounded-sm`,children:A}),a[48]=D,a[49]=O,a[50]=k,a[51]=j):j=a[51];let M,N;a[52]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,s.jsx)(r.Separator,{orientation:`vertical`,className:`flex min-h-6 h-full`}),N=(0,s.jsx)(o.ChevronDown,{className:`h-4 mx-2 cursor-pointer text-muted-foreground`,"aria-hidden":`true`}),a[52]=M,a[53]=N):(M=a[52],N=a[53]);let P;a[54]===j?P=a[55]:(P=(0,s.jsxs)(`div`,{className:`flex items-center justify-between`,children:[j,M,N]}),a[54]=j,a[55]=P);let F;return a[56]!==P||a[57]!==E?(F=(0,s.jsxs)(`div`,{className:`flex justify-between items-center w-full`,children:[E,P]}),a[56]=P,a[57]=E,a[58]=F):F=a[58],F},d=e=>{let t=(0,c.c)(5),{placeholder:n}=e,r;t[0]===n?r=t[1]:(r=(0,s.jsx)(`span`,{className:`text-sm text-muted-foreground mx-3`,children:n}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,s.jsx)(o.ChevronDown,{className:`h-4 cursor-pointer text-muted-foreground mx-2`}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,s.jsxs)(`div`,{className:`flex items-center justify-between w-full mx-auto`,children:[r,i]}),t[3]=r,t[4]=a),a},f=e=>{let i=(0,c.c)(42),{filteredOptions:l,hideSelectAll:u,searchValue:d,searchable:f,selectedValues:h,getAllOptions:g,toggleAll:_,toggleOption:v,handleClear:y,setIsPopoverOpen:b,handleInputKeyDown:x,setSearchValue:S,multiSelectId:C,emptyIndicator:w,screenSize:T}=e,E;i[0]!==x||i[1]!==C||i[2]!==d||i[3]!==f||i[4]!==S?(E=f&&(0,s.jsx)(n.CommandInput,{placeholder:`Search options...`,onKeyDown:x,value:d,onValueChange:S,"aria-label":`Search through available options`,"aria-describedby":`${C}-search-help`}),i[0]=x,i[1]=C,i[2]=d,i[3]=f,i[4]=S,i[5]=E):E=i[5];let D;i[6]!==C||i[7]!==f?(D=f&&(0,s.jsx)(`div`,{id:`${C}-search-help`,className:`sr-only`,children:`Type to filter options. Use arrow keys to navigate results.`}),i[6]=C,i[7]=f,i[8]=D):D=i[8];let O=T===`mobile`&&`max-h-[50vh]`,k;i[9]===O?k=i[10]:(k=t.cn(`max-h-[40vh] overflow-y-auto multiselect-scrollbar`,O,`overscroll-behavior-y-contain`),i[9]=O,i[10]=k);let A=w||`No results found.`,j;i[11]===A?j=i[12]:(j=(0,s.jsx)(n.CommandEmpty,{children:A}),i[11]=A,i[12]=j);let M;i[13]!==g||i[14]!==u||i[15]!==d||i[16]!==h.length||i[17]!==_?(M=!u&&!d&&(0,s.jsx)(n.CommandGroup,{children:(0,s.jsxs)(n.CommandItem,{onSelect:_,role:`option`,"aria-selected":h.length===g().filter(p).length,"aria-label":`Select all ${g().length} options`,className:`cursor-pointer`,children:[(0,s.jsx)(`div`,{className:t.cn(`mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary`,h.length===g().filter(m).length?`bg-primary text-primary-foreground`:`opacity-50 [&_svg]:invisible`),"aria-hidden":`true`,children:(0,s.jsx)(o.CheckIcon,{className:`h-4 w-4`})}),(0,s.jsxs)(`span`,{children:[`(Select All`,g().length>20?` - ${g().length} options`:``,`)`]})]},`all`)}),i[13]=g,i[14]=u,i[15]=d,i[16]=h.length,i[17]=_,i[18]=M):M=i[18];let N;i[19]!==l||i[20]!==h||i[21]!==v?(N=a.isGroupedOptions(l)?l.map(e=>(0,s.jsx)(n.CommandGroup,{heading:e.heading,children:e.options.map(e=>{let r=h.includes(e.value);return(0,s.jsxs)(n.CommandItem,{onSelect:()=>v(e.value),role:`option`,"aria-selected":r,"aria-disabled":e.disabled,"aria-label":`${e.label}${r?`, selected`:`, not selected`}${e.disabled?`, disabled`:``}`,className:t.cn(`cursor-pointer`,e.disabled&&`opacity-50 cursor-not-allowed`),disabled:e.disabled,children:[(0,s.jsx)(`div`,{className:t.cn(`mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary`,r?`bg-primary text-primary-foreground`:`opacity-50 [&_svg]:invisible`),"aria-hidden":`true`,children:(0,s.jsx)(o.CheckIcon,{className:`h-4 w-4`})}),e.icon&&(0,s.jsx)(e.icon,{className:`mr-2 h-4 w-4 text-muted-foreground`,"aria-hidden":`true`}),(0,s.jsx)(`span`,{children:e.label})]},e.value)})},e.heading)):(0,s.jsx)(n.CommandGroup,{children:l.map(e=>{let r=h.includes(e.value);return(0,s.jsxs)(n.CommandItem,{onSelect:()=>v(e.value),role:`option`,"aria-selected":r,"aria-disabled":e.disabled,"aria-label":`${e.label}${r?`, selected`:`, not selected`}${e.disabled?`, disabled`:``}`,className:t.cn(`cursor-pointer`,e.disabled&&`opacity-50 cursor-not-allowed`),disabled:e.disabled,children:[(0,s.jsx)(`div`,{className:t.cn(`mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary`,r?`bg-primary text-primary-foreground`:`opacity-50 [&_svg]:invisible`),"aria-hidden":`true`,children:(0,s.jsx)(o.CheckIcon,{className:`h-4 w-4`})}),e.icon&&(0,s.jsx)(e.icon,{className:`mr-2 h-4 w-4 text-muted-foreground`,"aria-hidden":`true`}),(0,s.jsx)(`span`,{children:e.label})]},e.value)})}),i[19]=l,i[20]=h,i[21]=v,i[22]=N):N=i[22];let P;i[23]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,s.jsx)(n.CommandSeparator,{}),i[23]=P):P=i[23];let F;i[24]!==y||i[25]!==h.length?(F=h.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.CommandItem,{onSelect:y,className:`flex-1 justify-center cursor-pointer`,children:`Clear`}),(0,s.jsx)(r.Separator,{orientation:`vertical`,className:`flex min-h-6 h-full`})]}),i[24]=y,i[25]=h.length,i[26]=F):F=i[26];let I;i[27]===b?I=i[28]:(I=(0,s.jsx)(n.CommandItem,{onSelect:()=>b(!1),className:`flex-1 justify-center cursor-pointer max-w-full`,children:`Close`}),i[27]=b,i[28]=I);let L;i[29]!==F||i[30]!==I?(L=(0,s.jsx)(n.CommandGroup,{children:(0,s.jsxs)(`div`,{className:`flex items-center justify-between`,children:[F,I]})}),i[29]=F,i[30]=I,i[31]=L):L=i[31];let R;i[32]!==L||i[33]!==k||i[34]!==j||i[35]!==M||i[36]!==N?(R=(0,s.jsxs)(n.CommandList,{className:k,children:[j,` `,M,N,P,L]}),i[32]=L,i[33]=k,i[34]=j,i[35]=M,i[36]=N,i[37]=R):R=i[37];let z;return i[38]!==E||i[39]!==R||i[40]!==D?(z=(0,s.jsxs)(n.Command,{children:[E,D,R]}),i[38]=E,i[39]=R,i[40]=D,i[41]=z):z=i[41],z};function p(e){return!e.disabled}function m(e){return!e.disabled}exports.LiveRegion=l,exports.OptionsContent=f,exports.PlaceholderContent=d,exports.SelectedValuesContent=u;
1
+ const e=require("./index152.cjs");let t=require("react");var n=({forwardedRef:n,...r})=>{let{options:i,onValueChange:a,defaultValue:o=[],animationConfig:s,maxCount:c=3,responsive:l,minWidth:u,maxWidth:d,deduplicateOptions:f=!1,resetOnDefaultValueChange:p=!0,closeOnSelect:m=!1,searchable:h=!0,autoSize:g=!1,disabled:_=!1}=r,[v,y]=(0,t.useState)(o),[b,x]=(0,t.useState)(!1),[S,C]=(0,t.useState)(!1),[w,T]=(0,t.useState)(``),[E,D]=(0,t.useState)(`desktop`),[O,k]=(0,t.useState)(``),[A,j]=(0,t.useState)(``),M=(0,t.useRef)(v.length),N=(0,t.useRef)(b),P=(0,t.useRef)(w),F=(0,t.useId)(),I=`${F}-listbox`,L=`${F}-description`,R=`${F}-count`,z=(0,t.useRef)(o),B=(0,t.useRef)(null),V=(0,t.useCallback)((e,t=`polite`)=>{t===`assertive`?(j(e),setTimeout(()=>j(``),100)):(k(e),setTimeout(()=>k(``),100))},[]),H=(0,t.useCallback)(()=>{let{options:t,duplicates:n}=e.buildAllOptions(i,f);return t},[f,i]),U=(0,t.useCallback)(e=>H().find(t=>t.value===e),[H]),W=(0,t.useMemo)(()=>e.filterOptions(i,w,h),[i,w,h]),G=e=>{if(!_){if(e.key===`Enter`)x(!0);else if(e.key===`Backspace`&&!e.currentTarget.value){let e=[...v];e.pop(),y(e),a(e)}}},K=e=>{if(_||U(e)?.disabled)return;let t=v.includes(e)?v.filter(t=>t!==e):[...v,e];y(t),a(t),m&&x(!1)},q=()=>{_||(y([]),a([]))},J=()=>{_||x(e=>!e)},Y=(0,t.useMemo)(()=>e.computeResponsiveSettings(l,c,E),[l,c,E]),X=()=>{if(_)return;let e=v.slice(0,Y.maxCount);y(e),a(e)},Z=()=>{if(_)return;let e=H().filter(e=>!e.disabled);if(v.length===e.length)q();else{let t=e.map(e=>e.value);y(t),a(t)}m&&x(!1)},Q=(0,t.useMemo)(()=>e.buildWidthConstraints(E,g,u,d),[g,d,u,E]);(0,t.useEffect)(()=>{if(!p)return;let t=z.current;e.arraysEqual(t,o)||(e.arraysEqual(v,o)||y(o),z.current=[...o])},[o,p,v]),(0,t.useEffect)(()=>{b||T(``)},[b]),(0,t.useEffect)(()=>{let t=v.length,n=H(),r=n.filter(e=>!e.disabled).length;if(t!==M.current){let e=t-M.current;if(e>0){let i=v.slice(-e).map(e=>n.find(t=>t.value===e)?.label).filter(Boolean);i.length===1?V(`${i[0]} selected. ${t} of ${r} options selected.`):V(`${i.length} options selected. ${t} of ${r} total selected.`)}else e<0&&V(`Option removed. ${t} of ${r} options selected.`);M.current=t}if(b!==N.current&&(V(b?`Dropdown opened. ${r} options available. Use arrow keys to navigate.`:`Dropdown closed.`),N.current=b),w!==P.current&&w!==void 0){if(w&&b){let t=e.countMatchingOptions(n,w);V(`${t} option${t===1?``:`s`} found for "${w}"`)}P.current=w}},[V,H,b,w,v]),(0,t.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>{let e=window.innerWidth;D(e<640?`mobile`:e<1024?`tablet`:`desktop`)};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let $=(0,t.useMemo)(()=>e.buildBadgeAnimationClass(S,s),[s,S]),ee=(0,t.useMemo)(()=>e.buildPopoverAnimationClass(s),[s]);return(0,t.useImperativeHandle)(n,()=>({reset:()=>{y(o),x(!1),T(``),a(o)},getSelectedValues:()=>v,setSelectedValues:e=>{y(e),a(e)},clear:()=>{y([]),a([])},focus:()=>{if(B.current){B.current.focus();let e=B.current.style.outline,t=B.current.style.outlineOffset;B.current.style.outline=`2px solid hsl(var(--ring))`,B.current.style.outlineOffset=`2px`,setTimeout(()=>{B.current&&(B.current.style.outline=e,B.current.style.outlineOffset=t)},1e3)}}}),[o,n,a,v]),{ids:{multiSelectId:F,listboxId:I,triggerDescriptionId:L,selectedCountId:R},state:{selectedValues:v,isPopoverOpen:b,isAnimating:S,searchValue:w,screenSize:E},derived:{filteredOptions:W,responsiveSettings:Y,widthConstraints:Q,badgeAnimationClass:$,popoverAnimationClass:ee},refs:{buttonRef:B},helpers:{getAllOptions:H,getOptionByValue:U},a11yMessages:{politeMessage:O,assertiveMessage:A},handlers:{setIsPopoverOpen:x,handleTogglePopover:J,handleInputKeyDown:G,toggleOption:K,handleClear:q,clearExtraOptions:X,toggleAll:Z,setSearchValue:T,setIsAnimating:C}}};exports.useMultiSelect=n;