@pismo/marola 2.1.64 → 2.1.65

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 (112) hide show
  1. package/dist/Button-CJaBSdv1.js +135 -0
  2. package/dist/ClassNameConfigurator-CVRWfyIa.js +847 -0
  3. package/dist/{ClickAwayListener-Z08peX_P.js → ClickAwayListener-BnYMO5Ki.js} +26 -33
  4. package/dist/Popup-D267EI4e.js +1338 -0
  5. package/dist/{Portal-DJapUCn6.js → Portal-BrGvxB96.js} +32 -36
  6. package/dist/RadioOption-DyRY8xlF.js +1094 -0
  7. package/dist/{Toggle-DcZTfLrC.js → Toggle-nnDfpqI1.js} +31 -31
  8. package/dist/assets/Checkbox.css +1 -1
  9. package/dist/assets/DropdownMenu.css +1 -1
  10. package/dist/assets/ToastCard.css +1 -1
  11. package/dist/assets/Toggle2.css +1 -1
  12. package/dist/combineHooksSlotProps-j-8UVeYo.js +86 -0
  13. package/dist/components/Alert/Alert.stories.d.ts +6 -6
  14. package/dist/components/Autocomplete/Autocomplete.d.ts +1 -1
  15. package/dist/components/Autocomplete/Autocomplete.js +311 -320
  16. package/dist/components/Autocomplete/Autocomplete.stories.d.ts +1 -1
  17. package/dist/components/Avatar/Avatar.stories.d.ts +4 -4
  18. package/dist/components/BankingCard/BankingCard.d.ts +0 -1
  19. package/dist/components/Button/Button.js +1 -1
  20. package/dist/components/Checkbox/Checkbox.js +56 -56
  21. package/dist/components/Checkbox/Checkbox.stories.d.ts +8 -8
  22. package/dist/components/Chip/Chip.js +3 -3
  23. package/dist/components/DatePicker/DatePicker.js +742 -639
  24. package/dist/components/DatePicker/DatePicker.stories.d.ts +8 -8
  25. package/dist/components/DatePicker/dateUtils.d.ts +2 -2
  26. package/dist/components/DatePicker/dateUtils.js +1 -1
  27. package/dist/components/DatePicker/keyboardNavigation.d.ts +1 -1
  28. package/dist/components/DatePicker/renderCalendarDays.js +1 -1
  29. package/dist/components/DatePicker/renderPeriodSelection.js +1 -1
  30. package/dist/components/Dialog/CloseIconButton.js +1 -1
  31. package/dist/components/Dialog/Dialog.js +372 -352
  32. package/dist/components/Dialog/Dialog.stories.d.ts +96 -135
  33. package/dist/components/DoubleAutocomplete/DoubleAutocomplete.d.ts +1 -1
  34. package/dist/components/DoubleAutocomplete/DoubleAutocomplete.js +2 -2
  35. package/dist/components/DoubleAutocomplete/DoubleAutocomplete.stories.d.ts +1 -1
  36. package/dist/components/DoubleInput/DoubleInput.stories.d.ts +1 -1
  37. package/dist/components/Draggable/Draggable.d.ts +0 -1
  38. package/dist/components/Draggable/Draggable.js +1 -1
  39. package/dist/components/Draggable/Draggable.stories.d.ts +2 -3
  40. package/dist/components/Draggable/useDraggable.js +1 -1
  41. package/dist/components/DropdownMenu/DropdownMenu.d.ts +3 -1
  42. package/dist/components/DropdownMenu/DropdownMenu.js +39 -34
  43. package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts +6 -4
  44. package/dist/components/EllipsisTooltip/EllipsisTooltip.stories.d.ts +4 -4
  45. package/dist/components/IconButton/IconButton.js +1 -1
  46. package/dist/components/Input/Input.js +335 -320
  47. package/dist/components/InputSearch/InputSearch.d.ts +31 -31
  48. package/dist/components/InputSearch/InputSearch.stories.d.ts +31 -31
  49. package/dist/components/Popover/Popover.d.ts +3 -3
  50. package/dist/components/Popover/Popover.js +2 -2
  51. package/dist/components/Popover/Popover.stories.d.ts +3 -3
  52. package/dist/components/Popover/PopoverBody.d.ts +0 -1
  53. package/dist/components/Popover/PopoverFooter.d.ts +0 -1
  54. package/dist/components/Popover/PopoverHeader.d.ts +0 -1
  55. package/dist/components/RadioButton/RadioButton.d.ts +0 -1
  56. package/dist/components/RadioButton/RadioButton.js +684 -769
  57. package/dist/components/RadioButton/RadioOption.d.ts +0 -1
  58. package/dist/components/RadioButton/RadioOption.js +3 -3
  59. package/dist/components/ResultContainer/ResultContainer.d.ts +0 -1
  60. package/dist/components/ResultContainer/ResultContainer.stories.d.ts +9 -9
  61. package/dist/components/ResultWithChips/ResultWithChips.js +1 -1
  62. package/dist/components/ResultWithChips/ResultWithChips.stories.d.ts +9 -9
  63. package/dist/components/RowItem/RowItem.js +2 -2
  64. package/dist/components/Select/Select.js +625 -591
  65. package/dist/components/Skeleton/Skeleton.d.ts +0 -1
  66. package/dist/components/Snackbar/Snackbar.js +295 -239
  67. package/dist/components/Snackbar/Snackbar.stories.d.ts +113 -113
  68. package/dist/components/StepperNavigator/StepperNavigator.d.ts +0 -1
  69. package/dist/components/Table/Table.stories.d.ts +5 -5
  70. package/dist/components/Tabs/Tab.js +107 -98
  71. package/dist/components/Tabs/TabPanel.js +58 -55
  72. package/dist/components/Tabs/Tabs.js +246 -231
  73. package/dist/components/ToastCard/ToastCard.js +31 -31
  74. package/dist/components/Toggle/Toggle.js +147 -137
  75. package/dist/components/Toggle/Toggle.stories.d.ts +5 -5
  76. package/dist/components/ToggleGroup/Toggle.d.ts +0 -1
  77. package/dist/components/ToggleGroup/Toggle.js +2 -2
  78. package/dist/components/ToggleGroup/ToggleGroup.js +1 -1
  79. package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +1 -1
  80. package/dist/components/Tooltip/Tooltip.js +266 -325
  81. package/dist/components/Tooltip/Tooltip.stories.d.ts +4 -4
  82. package/dist/components/TransactionRow/TransactionRow.stories.d.ts +21 -21
  83. package/dist/contexts/DraggableProvider/DraggableProvider.d.ts +0 -1
  84. package/dist/contexts/DraggableProvider/DraggableProvider.js +1 -1
  85. package/dist/contexts/SnackbarProvider/SnackbarProvider.js +1 -1
  86. package/dist/{dayjs.min-ClQKmc--.js → dayjs.min-BtgZiFZY.js} +14 -14
  87. package/dist/getReactElementRef-iorwYm2A.js +19 -0
  88. package/dist/{index-1UpBa69h.js → index-ew-96uBP.js} +2129 -2128
  89. package/dist/isFocusVisible-CPZqtjv2.js +12 -0
  90. package/dist/main.js +2 -2
  91. package/dist/{ownerDocument-By592Iy6.js → ownerDocument-CU-LCrtd.js} +1 -1
  92. package/dist/react-BTbo_5A3.js +526 -0
  93. package/dist/setRef-Bo0HEdBB.js +6 -0
  94. package/dist/useButton-C2E_LFJp.js +90 -0
  95. package/dist/useControlled-BYdyS7Pn.js +31 -0
  96. package/dist/useId-CK6Kn3Tn.js +21 -0
  97. package/dist/useList-BLW78Lq7.js +446 -0
  98. package/dist/utils/draggable.d.ts +2 -2
  99. package/package.json +1 -1
  100. package/dist/Button-BrEDdtHO.js +0 -130
  101. package/dist/Popup-Dffqo7wT.js +0 -1246
  102. package/dist/RadioOption-DYovqiwF.js +0 -720
  103. package/dist/combineHooksSlotProps-BhQ14uyD.js +0 -79
  104. package/dist/exactProp-SYjL19cU.js +0 -13
  105. package/dist/react-BvI-Sw9b.js +0 -509
  106. package/dist/useButton-CezPDte8.js +0 -105
  107. package/dist/useControlled-CCMYYdCM.js +0 -31
  108. package/dist/useId-BW-oWmul.js +0 -19
  109. package/dist/useIsFocusVisible-BH4IAdcw.js +0 -69
  110. package/dist/useList-nqLfZem8.js +0 -435
  111. package/dist/useSlotProps-CYHDC4TN.js +0 -834
  112. package/dist/useTimeout-DxF9kiZL.js +0 -36
@@ -1,20 +1,20 @@
1
- import { jsx as m, jsxs as Y } from "react/jsx-runtime";
1
+ import { jsx as f, jsxs as J } from "react/jsx-runtime";
2
2
  import * as r from "react";
3
- import { createContext as We, useId as Je, useContext as Ge } from "react";
4
- import { c as K } from "../../clsx-OuTLNxxd.js";
5
- import { Checkbox as Qe } from "../Checkbox/Checkbox.js";
6
- import { Icon as Xe } from "../Icon/Icon.js";
7
- import { Typography as _e } from "../Typography/Typography.js";
8
- import { s as y, S as Ye } from "../../SelectButton-CmFJp2dA.js";
9
- import { g as we, a as Ie, u as ee, f as se, _ as g, b as Ne, c as re, d as ke, e as Me, P as l } from "../../useSlotProps-CYHDC4TN.js";
10
- import { P as Ze } from "../../Popup-Dffqo7wT.js";
11
- import { u as et, c as ae, a as Se, L as Z } from "../../combineHooksSlotProps-BhQ14uyD.js";
12
- import { u as tt, a as ot, C as nt } from "../../useCompoundItem-B7Eo_qZk.js";
13
- import { m as Re, h as lt, l as st, u as rt } from "../../useList-nqLfZem8.js";
14
- import { u as Te } from "../../useId-BW-oWmul.js";
15
- import { u as Le } from "../../useButton-CezPDte8.js";
16
- import { u as at } from "../../useEnhancedEffect-CJGo-L3B.js";
17
- const it = {
3
+ import { createContext as Ke, useId as We, useContext as Je } from "react";
4
+ import { c as $ } from "../../clsx-OuTLNxxd.js";
5
+ import { Checkbox as Ge } from "../Checkbox/Checkbox.js";
6
+ import { Icon as Qe } from "../Icon/Icon.js";
7
+ import { Typography as xe } from "../Typography/Typography.js";
8
+ import { s as R, S as Xe } from "../../SelectButton-CmFJp2dA.js";
9
+ import { g as ye, a as Re, u as Q, e as ne, b as se, c as Se, d as Ve, P as n } from "../../ClassNameConfigurator-CVRWfyIa.js";
10
+ import { P as Ye } from "../../Popup-D267EI4e.js";
11
+ import { u as Ze, c as le, a as Ce, L as G } from "../../combineHooksSlotProps-j-8UVeYo.js";
12
+ import { u as He, a as et, C as tt } from "../../useCompoundItem-B7Eo_qZk.js";
13
+ import { m as he, h as ot, l as nt, u as st } from "../../useList-BLW78Lq7.js";
14
+ import { u as we } from "../../useId-CK6Kn3Tn.js";
15
+ import { u as Oe } from "../../useButton-C2E_LFJp.js";
16
+ import { u as lt } from "../../useEnhancedEffect-CJGo-L3B.js";
17
+ const rt = {
18
18
  border: 0,
19
19
  clip: "rect(0 0 0 0)",
20
20
  height: "1px",
@@ -24,147 +24,191 @@ const it = {
24
24
  position: "absolute",
25
25
  whiteSpace: "nowrap",
26
26
  width: "1px"
27
- }, Ae = "Option";
28
- function ut(n) {
29
- return we(Ae, n);
27
+ }, _e = "Option";
28
+ function it(o) {
29
+ return ye(_e, o);
30
30
  }
31
- Ie(Ae, ["root", "disabled", "selected", "highlighted"]);
32
- function ct(n) {
31
+ Re(_e, ["root", "disabled", "selected", "highlighted"]);
32
+ function at(o) {
33
33
  const {
34
- value: o,
34
+ value: s,
35
35
  label: i,
36
- disabled: c,
37
- rootRef: s,
38
- id: u
39
- } = n, {
40
- getRootProps: p,
41
- highlighted: f,
42
- selected: d
43
- } = et({
44
- item: o
36
+ disabled: a,
37
+ rootRef: l,
38
+ id: c
39
+ } = o, {
40
+ getRootProps: m,
41
+ highlighted: b,
42
+ selected: p
43
+ } = Ze({
44
+ item: s
45
45
  }), {
46
- getRootProps: _,
46
+ getRootProps: V,
47
47
  rootRef: k
48
- } = Le({
49
- disabled: c,
48
+ } = Oe({
49
+ disabled: a,
50
50
  focusableWhenDisabled: !0
51
- }), h = Te(u), S = r.useRef(null), R = r.useMemo(() => ({
52
- disabled: c,
51
+ }), g = we(c), w = r.useRef(null), h = r.useMemo(() => ({
52
+ disabled: a,
53
53
  label: i,
54
- value: o,
55
- ref: S,
56
- id: h
57
- }), [c, i, o, h]), {
54
+ value: s,
55
+ ref: w,
56
+ id: g
57
+ }), [a, i, s, g]), {
58
58
  index: I
59
- } = tt(o, R), O = ee(s, S, k), x = (b) => (C) => {
60
- var P;
61
- (P = b.onKeyDown) == null || P.call(b, C), !C.defaultMuiPrevented && [" ", "Enter"].includes(C.key) && (C.defaultMuiPrevented = !0);
62
- }, A = (b = {}) => ({
63
- onKeyDown: x(b)
59
+ } = He(s, h), O = Q(l, w, k), x = (d) => (C) => {
60
+ var S;
61
+ (S = d.onKeyDown) == null || S.call(d, C), !C.defaultMuiPrevented && [" ", "Enter"].includes(C.key) && (C.defaultMuiPrevented = !0);
62
+ }, A = (d = {}) => ({
63
+ onKeyDown: x(d)
64
64
  });
65
65
  return {
66
- getRootProps: (b = {}) => {
67
- const C = se(b), P = ae(p, ae(_, A));
68
- return g({}, b, C, P(C), {
69
- id: h,
66
+ getRootProps: (d = {}) => {
67
+ const C = ne(d), S = le(m, le(V, A));
68
+ return {
69
+ ...d,
70
+ ...C,
71
+ ...S(C),
72
+ id: g,
70
73
  ref: O,
71
74
  role: "option",
72
- "aria-selected": d
73
- });
75
+ "aria-selected": p
76
+ };
74
77
  },
75
- highlighted: f,
78
+ highlighted: b,
76
79
  index: I,
77
- selected: d,
80
+ selected: p,
78
81
  rootRef: O
79
82
  };
80
83
  }
81
- function dt(n) {
82
- const o = r.useContext(Se);
83
- if (!o)
84
+ function ut(o) {
85
+ const s = r.useContext(Ce);
86
+ if (!s)
84
87
  throw new Error("Option: ListContext was not found.");
85
88
  const {
86
89
  getItemState: i,
87
- dispatch: c
88
- } = o, {
89
- highlighted: s,
90
- selected: u,
91
- focusable: p
92
- } = i(n), f = r.useCallback((_) => {
93
- if (_ !== n)
94
- throw new Error(["Base UI Option: Tried to access the state of another Option.", "This is unsupported when the Option uses the OptionContextStabilizer as a performance optimization."].join("/n"));
90
+ dispatch: a
91
+ } = s, {
92
+ highlighted: l,
93
+ selected: c,
94
+ focusable: m
95
+ } = i(o), b = r.useCallback((V) => {
96
+ if (V !== o)
97
+ throw new Error(["MUI Base Option: Tried to access the state of another Option.", "This is unsupported when the Option uses the OptionContextStabilizer as a performance optimization."].join("/n"));
95
98
  return {
96
- highlighted: s,
97
- selected: u,
98
- focusable: p
99
+ highlighted: l,
100
+ selected: c,
101
+ focusable: m
99
102
  };
100
- }, [s, u, p, n]);
103
+ }, [l, c, m, o]);
101
104
  return {
102
105
  contextValue: r.useMemo(() => ({
103
- dispatch: c,
104
- getItemState: f
105
- }), [c, f])
106
+ dispatch: a,
107
+ getItemState: b
108
+ }), [a, b])
106
109
  };
107
110
  }
108
- const pt = ["children", "disabled", "label", "slotProps", "slots", "value"];
109
- function ft(n) {
111
+ function ct(o) {
110
112
  const {
111
- disabled: o,
113
+ disabled: s,
112
114
  highlighted: i,
113
- selected: c
114
- } = n;
115
- return ke({
116
- root: ["root", o && "disabled", i && "highlighted", c && "selected"]
117
- }, Me(ut));
115
+ selected: a
116
+ } = o;
117
+ return Se({
118
+ root: ["root", s && "disabled", i && "highlighted", a && "selected"]
119
+ }, Ve(it));
118
120
  }
119
- const bt = /* @__PURE__ */ r.memo(/* @__PURE__ */ r.forwardRef(function(o, i) {
120
- var c, s;
121
+ const Ie = /* @__PURE__ */ r.forwardRef(function(s, i) {
122
+ var M, P;
121
123
  const {
122
- children: u,
123
- disabled: p = !1,
124
- label: f,
125
- slotProps: d = {},
126
- slots: _ = {},
127
- value: k
128
- } = o, h = Ne(o, pt), S = (c = _.root) != null ? c : "li", R = r.useRef(null), I = ee(R, i), O = f ?? (typeof u == "string" ? u : (s = R.current) == null || (s = s.textContent) == null ? void 0 : s.trim()), {
129
- getRootProps: x,
130
- selected: A,
131
- highlighted: b,
132
- index: C
133
- } = ct({
134
- disabled: p,
135
- label: O,
136
- rootRef: I,
137
- value: k
138
- }), P = g({}, o, {
139
- disabled: p,
140
- highlighted: b,
141
- index: C,
142
- selected: A
143
- }), B = ft(P), V = re({
144
- getSlotProps: x,
145
- elementType: S,
146
- externalSlotProps: d.root,
147
- externalForwardedProps: h,
148
- className: B.root,
149
- ownerState: P
124
+ children: a,
125
+ disabled: l = !1,
126
+ label: c,
127
+ slotProps: m = {},
128
+ slots: b = {},
129
+ value: p,
130
+ ...V
131
+ } = s, k = b.root ?? "li", g = r.useRef(null), w = Q(g, i), h = c ?? (typeof a == "string" ? a : (P = (M = g.current) == null ? void 0 : M.textContent) == null ? void 0 : P.trim()), {
132
+ getRootProps: I,
133
+ selected: O,
134
+ highlighted: x,
135
+ index: A
136
+ } = at({
137
+ disabled: l,
138
+ label: h,
139
+ rootRef: w,
140
+ value: p
141
+ }), d = {
142
+ ...s,
143
+ disabled: l,
144
+ highlighted: x,
145
+ index: A,
146
+ selected: O
147
+ }, C = ct(d), S = se({
148
+ getSlotProps: I,
149
+ elementType: k,
150
+ externalSlotProps: m.root,
151
+ externalForwardedProps: V,
152
+ className: C.root,
153
+ ownerState: d
154
+ });
155
+ return /* @__PURE__ */ f(k, {
156
+ ...S,
157
+ children: a
150
158
  });
151
- return /* @__PURE__ */ m(S, g({}, V, {
152
- children: u
153
- }));
154
- })), Ee = /* @__PURE__ */ r.forwardRef(function(o, i) {
159
+ });
160
+ process.env.NODE_ENV !== "production" && (Ie.propTypes = {
161
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
162
+ // These PropTypes are generated from the TypeScript type definitions.
163
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
164
+ // └─────────────────────────────────────────────────────────────────────┘
165
+ children: n.node,
166
+ className: n.string,
167
+ /**
168
+ * If `true`, the option will be disabled.
169
+ * @default false
170
+ */
171
+ disabled: n.bool,
172
+ /**
173
+ * A text representation of the option's content.
174
+ * Used for keyboard text navigation matching.
175
+ */
176
+ label: n.string,
177
+ /**
178
+ * The props used for each slot inside the Option.
179
+ * @default {}
180
+ */
181
+ slotProps: n.shape({
182
+ root: n.oneOfType([n.func, n.object])
183
+ }),
184
+ /**
185
+ * The components used for each slot inside the Option.
186
+ * Either a string to use a HTML element or a component.
187
+ * @default {}
188
+ */
189
+ slots: n.shape({
190
+ root: n.elementType
191
+ }),
192
+ /**
193
+ * The value of the option.
194
+ */
195
+ value: n.any.isRequired
196
+ });
197
+ const pt = /* @__PURE__ */ r.memo(Ie), Me = /* @__PURE__ */ r.forwardRef(function(s, i) {
155
198
  const {
156
- value: c
157
- } = o, {
158
- contextValue: s
159
- } = dt(c);
160
- return /* @__PURE__ */ m(Se.Provider, {
161
- value: s,
162
- children: /* @__PURE__ */ m(bt, g({}, o, {
199
+ value: a
200
+ } = s, {
201
+ contextValue: l
202
+ } = ut(a);
203
+ return /* @__PURE__ */ f(Ce.Provider, {
204
+ value: l,
205
+ children: /* @__PURE__ */ f(pt, {
206
+ ...s,
163
207
  ref: i
164
- }))
208
+ })
165
209
  });
166
210
  });
167
- process.env.NODE_ENV !== "production" && (Ee.propTypes = {
211
+ process.env.NODE_ENV !== "production" && (Me.propTypes = {
168
212
  // ┌────────────────────────────── Warning ──────────────────────────────┐
169
213
  // │ These PropTypes are generated from the TypeScript type definitions. │
170
214
  // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
@@ -172,523 +216,513 @@ process.env.NODE_ENV !== "production" && (Ee.propTypes = {
172
216
  /**
173
217
  * @ignore
174
218
  */
175
- children: l.node,
219
+ children: n.node,
176
220
  /**
177
221
  * @ignore
178
222
  */
179
- className: l.string,
223
+ className: n.string,
180
224
  /**
181
225
  * If `true`, the option will be disabled.
182
226
  * @default false
183
227
  */
184
- disabled: l.bool,
228
+ disabled: n.bool,
185
229
  /**
186
230
  * A text representation of the option's content.
187
231
  * Used for keyboard text navigation matching.
188
232
  */
189
- label: l.string,
233
+ label: n.string,
190
234
  /**
191
235
  * The props used for each slot inside the Option.
192
236
  * @default {}
193
237
  */
194
- slotProps: l.shape({
195
- root: l.oneOfType([l.func, l.object])
238
+ slotProps: n.shape({
239
+ root: n.oneOfType([n.func, n.object])
196
240
  }),
197
241
  /**
198
242
  * The components used for each slot inside the Option.
199
243
  * Either a string to use a HTML element or a component.
200
244
  * @default {}
201
245
  */
202
- slots: l.shape({
203
- root: l.elementType
246
+ slots: n.shape({
247
+ root: n.elementType
204
248
  }),
205
249
  /**
206
250
  * The value of the option.
207
251
  */
208
- value: l.any.isRequired
252
+ value: n.any.isRequired
209
253
  });
210
- const ie = {
254
+ const re = {
211
255
  buttonClick: "buttonClick",
212
256
  browserAutoFill: "browserAutoFill"
213
- }, Be = (n) => {
257
+ }, Ne = (o) => {
214
258
  const {
215
- label: o,
259
+ label: s,
216
260
  value: i
217
- } = n;
218
- return typeof o == "string" ? o : typeof i == "string" ? i : String(n);
261
+ } = o;
262
+ return typeof s == "string" ? s : typeof i == "string" ? i : String(o);
219
263
  };
220
- function mt(n, o) {
264
+ function dt(o, s) {
221
265
  const {
222
266
  open: i
223
- } = n, {
267
+ } = o, {
224
268
  context: {
225
- selectionMode: c
269
+ selectionMode: a
226
270
  }
227
- } = o;
228
- if (o.type === ie.buttonClick) {
229
- var s;
230
- const d = (s = n.selectedValues[0]) != null ? s : Re(null, "start", o.context);
231
- return g({}, n, {
271
+ } = s;
272
+ if (s.type === re.buttonClick) {
273
+ const c = o.selectedValues[0] ?? he(null, "start", s.context);
274
+ return {
275
+ ...o,
232
276
  open: !i,
233
- highlightedValue: i ? null : d
234
- });
277
+ highlightedValue: i ? null : c
278
+ };
235
279
  }
236
- if (o.type === ie.browserAutoFill)
237
- return lt(o.item, n, o.context);
238
- const u = st(n, o);
239
- switch (o.type) {
240
- case Z.keyDown:
241
- if (n.open) {
242
- if (o.event.key === "Escape")
243
- return g({}, u, {
280
+ if (s.type === re.browserAutoFill)
281
+ return ot(s.item, o, s.context);
282
+ const l = nt(o, s);
283
+ switch (s.type) {
284
+ case G.keyDown:
285
+ if (o.open) {
286
+ if (s.event.key === "Escape")
287
+ return {
288
+ ...l,
244
289
  open: !1
245
- });
290
+ };
246
291
  } else {
247
- if (o.event.key === "ArrowDown") {
248
- var p;
249
- return g({}, n, {
292
+ if (s.event.key === "ArrowDown")
293
+ return {
294
+ ...o,
250
295
  open: !0,
251
- highlightedValue: (p = n.selectedValues[0]) != null ? p : Re(null, "start", o.context)
252
- });
253
- }
254
- if (o.event.key === "ArrowUp") {
255
- var f;
256
- return g({}, n, {
296
+ highlightedValue: o.selectedValues[0] ?? he(null, "start", s.context)
297
+ };
298
+ if (s.event.key === "ArrowUp")
299
+ return {
300
+ ...o,
257
301
  open: !0,
258
- highlightedValue: (f = n.selectedValues[0]) != null ? f : Re(null, "end", o.context)
259
- });
260
- }
302
+ highlightedValue: o.selectedValues[0] ?? he(null, "end", s.context)
303
+ };
261
304
  }
262
305
  break;
263
- case Z.itemClick:
264
- if (c === "single")
265
- return g({}, u, {
306
+ case G.itemClick:
307
+ if (a === "single")
308
+ return {
309
+ ...l,
266
310
  open: !1
267
- });
311
+ };
268
312
  break;
269
- case Z.blur:
270
- return g({}, u, {
313
+ case G.blur:
314
+ return {
315
+ ...l,
271
316
  open: !1
272
- });
317
+ };
273
318
  default:
274
- return u;
319
+ return l;
275
320
  }
276
- return u;
321
+ return l;
277
322
  }
278
- function gt(n) {
279
- return Array.isArray(n) ? n.length === 0 ? "" : JSON.stringify(n.map((o) => o.value)) : (n == null ? void 0 : n.value) == null ? "" : typeof n.value == "string" || typeof n.value == "number" ? n.value : JSON.stringify(n.value);
323
+ function ft(o) {
324
+ return Array.isArray(o) ? o.length === 0 ? "" : JSON.stringify(o.map((s) => s.value)) : (o == null ? void 0 : o.value) == null ? "" : typeof o.value == "string" || typeof o.value == "number" ? o.value : JSON.stringify(o.value);
280
325
  }
281
- function ht(n) {
326
+ function mt(o) {
282
327
  const {
283
- areOptionsEqual: o,
328
+ areOptionsEqual: s,
284
329
  buttonRef: i,
285
- defaultOpen: c = !1,
286
- defaultValue: s,
287
- disabled: u = !1,
288
- listboxId: p,
289
- listboxRef: f,
290
- multiple: d = !1,
291
- name: _,
330
+ defaultOpen: a = !1,
331
+ defaultValue: l,
332
+ disabled: c = !1,
333
+ listboxId: m,
334
+ listboxRef: b,
335
+ multiple: p = !1,
336
+ name: V,
292
337
  required: k,
293
- onChange: h,
294
- onHighlightChange: S,
295
- onOpenChange: R,
338
+ onChange: g,
339
+ onHighlightChange: w,
340
+ onOpenChange: h,
296
341
  open: I,
297
342
  options: O,
298
- getOptionAsString: x = Be,
299
- getSerializedValue: A = gt,
300
- value: b,
343
+ getOptionAsString: x = Ne,
344
+ getSerializedValue: A = ft,
345
+ value: d,
301
346
  componentName: C = "useSelect"
302
- } = n, P = r.useRef(null), B = ee(i, P), V = r.useRef(null), D = Te(p);
303
- let w;
304
- b === void 0 && s === void 0 ? w = [] : s !== void 0 && (d ? w = s : w = s == null ? [] : [s]);
305
- const H = r.useMemo(() => {
306
- if (b !== void 0)
307
- return d ? b : b == null ? [] : [b];
308
- }, [b, d]), {
309
- subitems: M,
310
- contextValue: j
311
- } = ot(), T = r.useMemo(() => O != null ? new Map(O.map((e, t) => [e.value, {
347
+ } = o, S = r.useRef(null), M = Q(i, S), P = r.useRef(null), B = we(m);
348
+ let N;
349
+ d === void 0 && l === void 0 ? N = [] : l !== void 0 && (p ? N = l : N = l == null ? [] : [l]);
350
+ const L = r.useMemo(() => {
351
+ if (d !== void 0)
352
+ return p ? d : d == null ? [] : [d];
353
+ }, [d, p]), {
354
+ subitems: D,
355
+ contextValue: X
356
+ } = et(), _ = r.useMemo(() => O != null ? new Map(O.map((e, t) => [e.value, {
312
357
  value: e.value,
313
358
  label: e.label,
314
359
  disabled: e.disabled,
315
360
  ref: /* @__PURE__ */ r.createRef(),
316
- id: `${D}_${t}`
317
- }])) : M, [O, M, D]), ue = ee(f, V), {
318
- getRootProps: te,
319
- active: ce,
320
- focusVisible: de,
321
- rootRef: z
322
- } = Le({
323
- disabled: u,
324
- rootRef: B
325
- }), U = r.useMemo(() => Array.from(T.keys()), [T]), N = r.useCallback((e) => {
326
- if (o !== void 0) {
327
- const t = U.find((a) => o(a, e));
328
- return T.get(t);
361
+ id: `${B}_${t}`
362
+ }])) : D, [O, D, B]), ie = Q(b, P), {
363
+ getRootProps: Y,
364
+ active: Z,
365
+ focusVisible: H,
366
+ rootRef: ae
367
+ } = Oe({
368
+ disabled: c,
369
+ rootRef: M
370
+ }), U = r.useMemo(() => Array.from(_.keys()), [_]), v = r.useCallback((e) => {
371
+ if (s !== void 0) {
372
+ const t = U.find((u) => s(u, e));
373
+ return _.get(t);
329
374
  }
330
- return T.get(e);
331
- }, [T, o, U]), oe = r.useCallback((e) => {
332
- var t;
333
- const a = N(e);
334
- return (t = a == null ? void 0 : a.disabled) != null ? t : !1;
335
- }, [N]), ne = r.useCallback((e) => {
336
- const t = N(e);
375
+ return _.get(e);
376
+ }, [_, s, U]), ue = r.useCallback((e) => {
377
+ const t = v(e);
378
+ return (t == null ? void 0 : t.disabled) ?? !1;
379
+ }, [v]), ce = r.useCallback((e) => {
380
+ const t = v(e);
337
381
  return t ? x(t) : "";
338
- }, [N, x]), pe = r.useMemo(() => ({
339
- selectedValues: H,
382
+ }, [v, x]), pe = r.useMemo(() => ({
383
+ selectedValues: L,
340
384
  open: I
341
- }), [H, I]), fe = r.useCallback((e) => {
385
+ }), [L, I]), de = r.useCallback((e) => {
342
386
  var t;
343
- return (t = T.get(e)) == null ? void 0 : t.id;
344
- }, [T]), be = r.useCallback((e, t) => {
345
- if (d)
346
- h == null || h(e, t);
347
- else {
348
- var a;
349
- h == null || h(e, (a = t[0]) != null ? a : null);
350
- }
351
- }, [d, h]), me = r.useCallback((e, t) => {
352
- S == null || S(e, t ?? null);
353
- }, [S]), ge = r.useCallback((e, t, a) => {
354
- if (t === "open" && (R == null || R(a), a === !1 && (e == null ? void 0 : e.type) !== "blur")) {
355
- var v;
356
- (v = P.current) == null || v.focus();
357
- }
358
- }, [R]), he = r.useCallback((e) => {
359
- var t, a;
360
- return e == null ? null : (t = (a = M.get(e)) == null ? void 0 : a.ref.current) != null ? t : null;
361
- }, [M]), xe = {
362
- getInitialState: () => {
363
- var e;
364
- return {
365
- highlightedValue: null,
366
- selectedValues: (e = w) != null ? e : [],
367
- open: c
368
- };
369
- },
370
- getItemId: fe,
387
+ return (t = _.get(e)) == null ? void 0 : t.id;
388
+ }, [_]), fe = r.useCallback((e, t) => {
389
+ p ? g == null || g(e, t) : g == null || g(e, t[0] ?? null);
390
+ }, [p, g]), me = r.useCallback((e, t) => {
391
+ w == null || w(e, t ?? null);
392
+ }, [w]), ee = r.useCallback((e, t, u) => {
393
+ var y;
394
+ t === "open" && (h == null || h(u), u === !1 && (e == null ? void 0 : e.type) !== "blur" && ((y = S.current) == null || y.focus()));
395
+ }, [h]), z = r.useCallback((e) => {
396
+ var t;
397
+ return e == null ? null : ((t = D.get(e)) == null ? void 0 : t.ref.current) ?? null;
398
+ }, [D]), te = {
399
+ getInitialState: () => ({
400
+ highlightedValue: null,
401
+ selectedValues: N ?? [],
402
+ open: a
403
+ }),
404
+ getItemId: de,
371
405
  controlledProps: pe,
372
406
  focusManagement: "DOM",
373
- getItemDomElement: he,
374
- itemComparer: o,
375
- isItemDisabled: oe,
376
- rootRef: ue,
377
- onChange: be,
407
+ getItemDomElement: z,
408
+ itemComparer: s,
409
+ isItemDisabled: ue,
410
+ rootRef: ie,
411
+ onChange: fe,
378
412
  onHighlightChange: me,
379
- onStateChange: ge,
413
+ onStateChange: ee,
380
414
  reducerActionContext: r.useMemo(() => ({
381
- multiple: d
382
- }), [d]),
415
+ multiple: p
416
+ }), [p]),
383
417
  items: U,
384
- getItemAsString: ne,
385
- selectionMode: d ? "multiple" : "single",
386
- stateReducer: mt,
418
+ getItemAsString: ce,
419
+ selectionMode: p ? "multiple" : "single",
420
+ stateReducer: dt,
387
421
  componentName: C
388
422
  }, {
389
- dispatch: F,
390
- getRootProps: Ce,
391
- contextValue: W,
423
+ dispatch: T,
424
+ getRootProps: K,
425
+ contextValue: oe,
392
426
  state: {
393
- open: L,
394
- highlightedValue: $,
427
+ open: F,
428
+ highlightedValue: q,
395
429
  selectedValues: E
396
430
  },
397
- rootRef: J
398
- } = rt(xe), Pe = r.useRef(L);
399
- at(() => {
400
- if (L && $ !== null) {
401
- var e;
402
- const t = (e = N($)) == null ? void 0 : e.ref;
403
- if (!V.current || !(t != null && t.current))
431
+ rootRef: j
432
+ } = st(te), Ae = r.useRef(F);
433
+ lt(() => {
434
+ var e;
435
+ if (F && q !== null) {
436
+ const t = (e = v(q)) == null ? void 0 : e.ref;
437
+ if (!P.current || !(t != null && t.current))
404
438
  return;
405
- Pe.current || t.current.focus({
439
+ Ae.current || t.current.focus({
406
440
  preventScroll: !0
407
441
  });
408
- const a = V.current.getBoundingClientRect(), v = t.current.getBoundingClientRect();
409
- v.top < a.top ? V.current.scrollTop -= a.top - v.top : v.bottom > a.bottom && (V.current.scrollTop += v.bottom - a.bottom);
442
+ const u = P.current.getBoundingClientRect(), y = t.current.getBoundingClientRect();
443
+ y.top < u.top ? P.current.scrollTop -= u.top - y.top : y.bottom > u.bottom && (P.current.scrollTop += y.bottom - u.bottom);
410
444
  }
411
- }, [L, $, N]);
412
- const G = r.useCallback((e) => N(e), [N]), ve = (e) => (t) => {
413
- var a;
414
- if (e == null || (a = e.onClick) == null || a.call(e, t), !t.defaultMuiPrevented) {
415
- const v = {
416
- type: ie.buttonClick,
445
+ }, [F, q, v]);
446
+ const be = r.useCallback((e) => v(e), [v]), Be = (e) => (t) => {
447
+ var u;
448
+ if ((u = e == null ? void 0 : e.onClick) == null || u.call(e, t), !t.defaultMuiPrevented) {
449
+ const y = {
450
+ type: re.buttonClick,
417
451
  event: t
418
452
  };
419
- F(v);
453
+ T(y);
420
454
  }
421
- }, Q = (e) => (t) => {
422
- var a;
423
- (a = e.onKeyDown) == null || a.call(e, t), !t.defaultMuiPrevented && (t.key === "ArrowDown" || t.key === "ArrowUp") && (t.preventDefault(), F({
424
- type: Z.keyDown,
455
+ }, Le = (e) => (t) => {
456
+ var u;
457
+ (u = e.onKeyDown) == null || u.call(e, t), !t.defaultMuiPrevented && (t.key === "ArrowDown" || t.key === "ArrowUp") && (t.preventDefault(), T({
458
+ type: G.keyDown,
425
459
  key: t.key,
426
460
  event: t
427
461
  }));
428
- }, le = (e = {}) => ({
429
- onClick: ve(e),
430
- onKeyDown: Q(e)
431
- }), q = (e = {}) => g({}, e, le(e), {
462
+ }, De = (e = {}) => ({
463
+ onClick: Be(e),
464
+ onKeyDown: Le(e)
465
+ }), Fe = (e = {}) => ({
466
+ ...e,
467
+ ...De(e),
432
468
  role: "combobox",
433
- "aria-expanded": L,
434
- "aria-controls": D
435
- }), Fe = (e = {}) => {
436
- const t = se(e), a = ae(q, te);
437
- return g({}, e, a(t));
469
+ "aria-expanded": F,
470
+ "aria-controls": B
471
+ }), Ee = (e = {}) => {
472
+ const t = ne(e), u = le(Fe, Y);
473
+ return {
474
+ ...e,
475
+ ...u(t)
476
+ };
438
477
  }, qe = (e) => (t) => {
439
- var a, v;
440
- (a = e.onBlur) == null || a.call(e, t), !t.defaultMuiPrevented && ((v = V.current) != null && v.contains(t.relatedTarget) || t.relatedTarget === P.current) && (t.defaultMuiPrevented = !0);
478
+ var u, y;
479
+ (u = e.onBlur) == null || u.call(e, t), !t.defaultMuiPrevented && ((y = P.current) != null && y.contains(t.relatedTarget) || t.relatedTarget === S.current) && (t.defaultMuiPrevented = !0);
441
480
  }, je = (e = {}) => ({
442
481
  onBlur: qe(e)
443
482
  }), Ue = (e = {}) => {
444
- const t = se(e), a = ae(je, Ce);
445
- return g({
446
- id: D,
483
+ const t = ne(e), u = le(je, K);
484
+ return {
485
+ id: B,
447
486
  role: "listbox",
448
- "aria-multiselectable": d ? "true" : void 0
449
- }, e, a(t));
487
+ "aria-multiselectable": p ? "true" : void 0,
488
+ ...e,
489
+ ...u(t)
490
+ };
450
491
  };
451
492
  r.useDebugValue({
452
493
  selectedOptions: E,
453
- highlightedOption: $,
454
- open: L
494
+ highlightedOption: q,
495
+ open: F
455
496
  });
456
- const Ke = r.useMemo(() => g({}, W, j), [W, j]);
457
- let X;
458
- n.multiple ? X = E : X = E.length > 0 ? E[0] : null;
459
- let ye;
460
- if (d)
461
- ye = X.map((e) => G(e)).filter((e) => e !== void 0);
462
- else {
463
- var Oe;
464
- ye = (Oe = G(X)) != null ? Oe : null;
465
- }
497
+ const $e = r.useMemo(() => ({
498
+ ...oe,
499
+ ...X
500
+ }), [oe, X]);
501
+ let W;
502
+ o.multiple ? W = E : W = E.length > 0 ? E[0] : null;
503
+ let ge;
504
+ p ? ge = W.map((e) => be(e)).filter((e) => e !== void 0) : ge = be(W) ?? null;
466
505
  const ze = (e) => (t) => {
467
- var a;
468
- if (e == null || (a = e.onChange) == null || a.call(e, t), t.defaultMuiPrevented)
506
+ var y;
507
+ if ((y = e == null ? void 0 : e.onChange) == null || y.call(e, t), t.defaultMuiPrevented)
469
508
  return;
470
- const v = T.get(t.target.value);
471
- t.target.value === "" ? F({
472
- type: Z.clearSelection
473
- }) : v !== void 0 && F({
474
- type: ie.browserAutoFill,
475
- item: v.value,
509
+ const u = _.get(t.target.value);
510
+ t.target.value === "" ? T({
511
+ type: G.clearSelection
512
+ }) : u !== void 0 && T({
513
+ type: re.browserAutoFill,
514
+ item: u.value,
476
515
  event: t
477
516
  });
478
517
  };
479
518
  return {
480
- buttonActive: ce,
481
- buttonFocusVisible: de,
482
- buttonRef: z,
483
- contextValue: Ke,
484
- disabled: u,
485
- dispatch: F,
486
- getButtonProps: Fe,
519
+ buttonActive: Z,
520
+ buttonFocusVisible: H,
521
+ buttonRef: ae,
522
+ contextValue: $e,
523
+ disabled: c,
524
+ dispatch: T,
525
+ getButtonProps: Ee,
487
526
  getHiddenInputProps: (e = {}) => {
488
- const t = se(e);
489
- return g({
490
- name: _,
527
+ const t = ne(e);
528
+ return {
529
+ name: V,
491
530
  tabIndex: -1,
492
531
  "aria-hidden": !0,
493
532
  required: k ? !0 : void 0,
494
- value: A(ye),
495
- style: it
496
- }, e, {
533
+ value: A(ge),
534
+ style: rt,
535
+ ...e,
497
536
  onChange: ze(t)
498
- });
537
+ };
499
538
  },
500
539
  getListboxProps: Ue,
501
- getOptionMetadata: G,
502
- listboxRef: J,
503
- open: L,
540
+ getOptionMetadata: be,
541
+ listboxRef: j,
542
+ open: F,
504
543
  options: U,
505
- value: X,
506
- highlightedOption: $
544
+ value: W,
545
+ highlightedOption: q
507
546
  };
508
547
  }
509
- function xt(n) {
548
+ function bt(o) {
510
549
  const {
511
- value: o,
550
+ value: s,
512
551
  children: i
513
- } = n, {
514
- dispatch: c,
515
- getItemIndex: s,
516
- getItemState: u,
517
- registerItem: p,
518
- totalSubitemCount: f
519
- } = o, d = r.useMemo(() => ({
520
- dispatch: c,
521
- getItemState: u,
522
- getItemIndex: s
523
- }), [c, s, u]), _ = r.useMemo(() => ({
524
- getItemIndex: s,
525
- registerItem: p,
526
- totalSubitemCount: f
527
- }), [p, s, f]);
528
- return /* @__PURE__ */ m(nt.Provider, {
529
- value: _,
530
- children: /* @__PURE__ */ m(Se.Provider, {
531
- value: d,
552
+ } = o, {
553
+ dispatch: a,
554
+ getItemIndex: l,
555
+ getItemState: c,
556
+ registerItem: m,
557
+ totalSubitemCount: b
558
+ } = s, p = r.useMemo(() => ({
559
+ dispatch: a,
560
+ getItemState: c,
561
+ getItemIndex: l
562
+ }), [a, l, c]), V = r.useMemo(() => ({
563
+ getItemIndex: l,
564
+ registerItem: m,
565
+ totalSubitemCount: b
566
+ }), [m, l, b]);
567
+ return /* @__PURE__ */ f(tt.Provider, {
568
+ value: V,
569
+ children: /* @__PURE__ */ f(Ce.Provider, {
570
+ value: p,
532
571
  children: i
533
572
  })
534
573
  });
535
574
  }
536
- const De = "Select";
537
- function Ct(n) {
538
- return we(De, n);
575
+ const ke = "Select";
576
+ function gt(o) {
577
+ return ye(ke, o);
539
578
  }
540
- Ie(De, ["root", "button", "listbox", "popup", "active", "expanded", "disabled", "focusVisible"]);
541
- var Ve;
542
- const Pt = ["areOptionsEqual", "autoComplete", "autoFocus", "children", "defaultValue", "defaultListboxOpen", "disabled", "getSerializedValue", "listboxId", "listboxOpen", "multiple", "name", "required", "onChange", "onListboxOpenChange", "getOptionAsString", "renderValue", "placeholder", "slotProps", "slots", "value"];
543
- function vt(n) {
544
- var o;
545
- return Array.isArray(n) ? /* @__PURE__ */ m(r.Fragment, {
546
- children: n.map((i) => i.label).join(", ")
547
- }) : (o = n == null ? void 0 : n.label) != null ? o : null;
579
+ Re(ke, ["root", "button", "listbox", "popup", "active", "expanded", "disabled", "focusVisible"]);
580
+ var Pe;
581
+ function ht(o) {
582
+ return Array.isArray(o) ? /* @__PURE__ */ f(r.Fragment, {
583
+ children: o.map((s) => s.label).join(", ")
584
+ }) : (o == null ? void 0 : o.label) ?? null;
548
585
  }
549
- function yt(n) {
586
+ function xt(o) {
550
587
  const {
551
- active: o,
588
+ active: s,
552
589
  disabled: i,
553
- open: c,
554
- focusVisible: s
555
- } = n;
556
- return ke({
557
- root: ["root", i && "disabled", s && "focusVisible", o && "active", c && "expanded"],
590
+ open: a,
591
+ focusVisible: l
592
+ } = o;
593
+ return Se({
594
+ root: ["root", i && "disabled", l && "focusVisible", s && "active", a && "expanded"],
558
595
  listbox: ["listbox", i && "disabled"],
559
596
  popup: ["popup"]
560
- }, Me(Ct));
597
+ }, Ve(gt));
561
598
  }
562
- const $e = /* @__PURE__ */ r.forwardRef(function(o, i) {
563
- var c, s, u, p, f;
599
+ const ve = /* @__PURE__ */ r.forwardRef(function(s, i) {
564
600
  const {
565
- areOptionsEqual: d,
566
- autoComplete: _,
567
- autoFocus: k,
568
- children: h,
569
- defaultValue: S,
570
- defaultListboxOpen: R = !1,
571
- disabled: I,
572
- getSerializedValue: O,
573
- listboxId: x,
574
- listboxOpen: A,
575
- multiple: b = !1,
576
- name: C,
577
- required: P = !1,
578
- onChange: B,
579
- onListboxOpenChange: V,
580
- getOptionAsString: D = Be,
581
- renderValue: w,
582
- placeholder: H,
601
+ areOptionsEqual: a,
602
+ autoComplete: l,
603
+ autoFocus: c,
604
+ children: m,
605
+ defaultValue: b,
606
+ defaultListboxOpen: p = !1,
607
+ disabled: V,
608
+ getSerializedValue: k,
609
+ listboxId: g,
610
+ listboxOpen: w,
611
+ multiple: h = !1,
612
+ name: I,
613
+ required: O = !1,
614
+ onChange: x,
615
+ onListboxOpenChange: A,
616
+ getOptionAsString: d = Ne,
617
+ renderValue: C,
618
+ placeholder: S,
583
619
  slotProps: M = {},
584
- slots: j = {},
585
- value: T
586
- } = o, ue = Ne(o, Pt), te = w ?? vt, [ce, de] = r.useState(!1), z = r.useRef(null), U = r.useRef(null), N = (c = j.root) != null ? c : "button", oe = (s = j.listbox) != null ? s : "ul", ne = (u = j.popup) != null ? u : "div", pe = r.useCallback((q) => {
587
- de(q != null);
588
- }, []), fe = ee(i, z, pe);
620
+ slots: P = {},
621
+ value: B,
622
+ ...N
623
+ } = s, L = C ?? ht, [D, X] = r.useState(!1), _ = r.useRef(null), ie = r.useRef(null), Y = P.root ?? "button", Z = P.listbox ?? "ul", H = P.popup ?? "div", ae = r.useCallback((j) => {
624
+ X(j != null);
625
+ }, []), U = Q(i, _, ae);
589
626
  r.useEffect(() => {
590
- k && z.current.focus();
591
- }, [k]);
627
+ c && _.current.focus();
628
+ }, [c]);
592
629
  const {
593
- buttonActive: be,
594
- buttonFocusVisible: me,
595
- contextValue: ge,
596
- disabled: he,
597
- getButtonProps: xe,
598
- getListboxProps: F,
599
- getHiddenInputProps: Ce,
600
- getOptionMetadata: W,
601
- value: L,
602
- open: $
603
- } = ht({
604
- name: C,
605
- required: P,
606
- getSerializedValue: O,
607
- areOptionsEqual: d,
608
- buttonRef: fe,
609
- defaultOpen: R,
610
- defaultValue: S,
611
- disabled: I,
612
- listboxId: x,
613
- multiple: b,
614
- open: A,
615
- onChange: B,
616
- onOpenChange: V,
617
- getOptionAsString: D,
618
- value: T,
630
+ buttonActive: v,
631
+ buttonFocusVisible: ue,
632
+ contextValue: ce,
633
+ disabled: pe,
634
+ getButtonProps: de,
635
+ getListboxProps: fe,
636
+ getHiddenInputProps: me,
637
+ getOptionMetadata: ee,
638
+ value: z,
639
+ open: te
640
+ } = mt({
641
+ name: I,
642
+ required: O,
643
+ getSerializedValue: k,
644
+ areOptionsEqual: a,
645
+ buttonRef: U,
646
+ defaultOpen: p,
647
+ defaultValue: b,
648
+ disabled: V,
649
+ listboxId: g,
650
+ multiple: h,
651
+ open: w,
652
+ onChange: x,
653
+ onOpenChange: A,
654
+ getOptionAsString: d,
655
+ value: B,
619
656
  componentName: "Select"
620
- }), E = g({}, o, {
621
- active: be,
622
- defaultListboxOpen: R,
623
- disabled: he,
624
- focusVisible: me,
625
- open: $,
626
- multiple: b,
627
- renderValue: te,
628
- value: L
629
- }), J = yt(E), Pe = re({
630
- elementType: N,
631
- getSlotProps: xe,
657
+ }), T = {
658
+ ...s,
659
+ active: v,
660
+ defaultListboxOpen: p,
661
+ disabled: pe,
662
+ focusVisible: ue,
663
+ open: te,
664
+ multiple: h,
665
+ renderValue: L,
666
+ value: z
667
+ }, K = xt(T), oe = se({
668
+ elementType: Y,
669
+ getSlotProps: de,
632
670
  externalSlotProps: M.root,
633
- externalForwardedProps: ue,
634
- ownerState: E,
635
- className: J.root
636
- }), G = re({
637
- elementType: oe,
638
- getSlotProps: F,
671
+ externalForwardedProps: N,
672
+ ownerState: T,
673
+ className: K.root
674
+ }), F = se({
675
+ elementType: Z,
676
+ getSlotProps: fe,
639
677
  externalSlotProps: M.listbox,
640
678
  additionalProps: {
641
- ref: U
679
+ ref: ie
642
680
  },
643
- ownerState: E,
644
- className: J.listbox
645
- }), ve = re({
646
- elementType: ne,
681
+ ownerState: T,
682
+ className: K.listbox
683
+ }), q = se({
684
+ elementType: H,
647
685
  externalSlotProps: M.popup,
648
686
  additionalProps: {
649
- anchor: z.current,
687
+ anchor: _.current,
650
688
  keepMounted: !0,
651
- open: $,
689
+ open: te,
652
690
  placement: "bottom-start",
653
691
  role: void 0
654
692
  },
655
- ownerState: E,
656
- className: J.popup
693
+ ownerState: T,
694
+ className: K.popup
657
695
  });
658
- let Q;
659
- if (b)
660
- Q = L.map((q) => W(q)).filter((q) => q !== void 0);
661
- else {
662
- var le;
663
- Q = (le = W(L)) != null ? le : null;
664
- }
665
- return /* @__PURE__ */ Y(r.Fragment, {
666
- children: [/* @__PURE__ */ m(N, g({}, Pe, {
667
- children: (p = (f = te(Q)) != null ? f : H) != null ? p : (
668
- // fall back to a zero-width space to prevent layout shift
669
- // from https://github.com/mui/material-ui/pull/24563
670
- Ve || (Ve = /* @__PURE__ */ m("span", {
671
- className: "notranslate",
672
- children: "​"
673
- }))
674
- )
675
- })), ce && /* @__PURE__ */ m(Ze, g({
696
+ let E;
697
+ return h ? E = z.map((j) => ee(j)).filter((j) => j !== void 0) : E = ee(z) ?? null, /* @__PURE__ */ J(r.Fragment, {
698
+ children: [/* @__PURE__ */ f(Y, {
699
+ ...oe,
700
+ children: L(E) ?? S ?? // fall back to a zero-width space to prevent layout shift
701
+ // from https://github.com/mui/material-ui/pull/24563
702
+ (Pe || (Pe = /* @__PURE__ */ f("span", {
703
+ className: "notranslate",
704
+ "aria-hidden": !0,
705
+ children: "​"
706
+ })))
707
+ }), D && /* @__PURE__ */ f(Ye, {
676
708
  slots: {
677
- root: ne
678
- }
679
- }, ve, {
680
- children: /* @__PURE__ */ m(oe, g({}, G, {
681
- children: /* @__PURE__ */ m(xt, {
682
- value: ge,
683
- children: h
709
+ root: H
710
+ },
711
+ ...q,
712
+ children: /* @__PURE__ */ f(Z, {
713
+ ...F,
714
+ children: /* @__PURE__ */ f(bt, {
715
+ value: ce,
716
+ children: m
684
717
  })
685
- }))
686
- })), /* @__PURE__ */ m("input", g({}, Ce(), {
687
- autoComplete: _
688
- }))]
718
+ })
719
+ }), /* @__PURE__ */ f("input", {
720
+ ...me(),
721
+ autoComplete: l
722
+ })]
689
723
  });
690
724
  });
691
- process.env.NODE_ENV !== "production" && ($e.propTypes = {
725
+ process.env.NODE_ENV !== "production" && (ve.propTypes = {
692
726
  // ┌────────────────────────────── Warning ──────────────────────────────┐
693
727
  // │ These PropTypes are generated from the TypeScript type definitions. │
694
728
  // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
@@ -700,40 +734,40 @@ process.env.NODE_ENV !== "production" && ($e.propTypes = {
700
734
  * There is a performance impact when using the `areOptionsEqual` prop (proportional to the number of options).
701
735
  * Therefore, it's recommented to use the default reference equality comparison whenever possible.
702
736
  */
703
- areOptionsEqual: l.func,
737
+ areOptionsEqual: n.func,
704
738
  /**
705
739
  * This prop helps users to fill forms faster, especially on mobile devices.
706
740
  * The name can be confusing, as it's more like an autofill.
707
741
  * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
708
742
  */
709
- autoComplete: l.string,
743
+ autoComplete: n.string,
710
744
  /**
711
745
  * If `true`, the select element is focused during the first mount
712
746
  * @default false
713
747
  */
714
- autoFocus: l.bool,
748
+ autoFocus: n.bool,
715
749
  /**
716
750
  * @ignore
717
751
  */
718
- children: l.node,
752
+ children: n.node,
719
753
  /**
720
754
  * @ignore
721
755
  */
722
- className: l.string,
756
+ className: n.string,
723
757
  /**
724
758
  * If `true`, the select will be initially open.
725
759
  * @default false
726
760
  */
727
- defaultListboxOpen: l.bool,
761
+ defaultListboxOpen: n.bool,
728
762
  /**
729
763
  * The default selected value. Use when the component is not controlled.
730
764
  */
731
- defaultValue: l.any,
765
+ defaultValue: n.any,
732
766
  /**
733
767
  * If `true`, the select is disabled.
734
768
  * @default false
735
769
  */
736
- disabled: l.bool,
770
+ disabled: n.bool,
737
771
  /**
738
772
  * A function used to convert the option label to a string.
739
773
  * It's useful when labels are elements and need to be converted to plain text
@@ -741,182 +775,182 @@ process.env.NODE_ENV !== "production" && ($e.propTypes = {
741
775
  *
742
776
  * @default defaultOptionStringifier
743
777
  */
744
- getOptionAsString: l.func,
778
+ getOptionAsString: n.func,
745
779
  /**
746
780
  * A function to convert the currently selected value to a string.
747
781
  * Used to set a value of a hidden input associated with the select,
748
782
  * so that the selected value can be posted with a form.
749
783
  */
750
- getSerializedValue: l.func,
784
+ getSerializedValue: n.func,
751
785
  /**
752
786
  * `id` attribute of the listbox element.
753
787
  */
754
- listboxId: l.string,
788
+ listboxId: n.string,
755
789
  /**
756
790
  * Controls the open state of the select's listbox.
757
791
  * @default undefined
758
792
  */
759
- listboxOpen: l.bool,
793
+ listboxOpen: n.bool,
760
794
  /**
761
795
  * If `true`, selecting multiple values is allowed.
762
796
  * This affects the type of the `value`, `defaultValue`, and `onChange` props.
763
797
  *
764
798
  * @default false
765
799
  */
766
- multiple: l.bool,
800
+ multiple: n.bool,
767
801
  /**
768
802
  * Name of the element. For example used by the server to identify the fields in form submits.
769
803
  */
770
- name: l.string,
804
+ name: n.string,
771
805
  /**
772
806
  * Callback fired when an option is selected.
773
807
  */
774
- onChange: l.func,
808
+ onChange: n.func,
775
809
  /**
776
810
  * Callback fired when the component requests to be opened.
777
811
  * Use in controlled mode (see listboxOpen).
778
812
  */
779
- onListboxOpenChange: l.func,
813
+ onListboxOpenChange: n.func,
780
814
  /**
781
815
  * Text to show when there is no selected value.
782
816
  */
783
- placeholder: l.node,
817
+ placeholder: n.node,
784
818
  /**
785
819
  * Function that customizes the rendering of the selected value.
786
820
  */
787
- renderValue: l.func,
821
+ renderValue: n.func,
788
822
  /**
789
823
  * If `true`, the Select cannot be empty when submitting form.
790
824
  * @default false
791
825
  */
792
- required: l.bool,
826
+ required: n.bool,
793
827
  /**
794
828
  * The props used for each slot inside the Input.
795
829
  * @default {}
796
830
  */
797
- slotProps: l.shape({
798
- listbox: l.oneOfType([l.func, l.object]),
799
- popup: l.oneOfType([l.func, l.object]),
800
- root: l.oneOfType([l.func, l.object])
831
+ slotProps: n.shape({
832
+ listbox: n.oneOfType([n.func, n.object]),
833
+ popup: n.oneOfType([n.func, n.object]),
834
+ root: n.oneOfType([n.func, n.object])
801
835
  }),
802
836
  /**
803
837
  * The components used for each slot inside the Select.
804
838
  * Either a string to use a HTML element or a component.
805
839
  * @default {}
806
840
  */
807
- slots: l.shape({
808
- listbox: l.elementType,
809
- popup: l.elementType,
810
- root: l.elementType
841
+ slots: n.shape({
842
+ listbox: n.elementType,
843
+ popup: n.elementType,
844
+ root: n.elementType
811
845
  }),
812
846
  /**
813
847
  * The selected value.
814
848
  * Set to `null` to deselect all options.
815
849
  */
816
- value: l.any
850
+ value: n.any
817
851
  });
818
- const He = We({}), Rt = () => Ge(He), _t = (n) => {
819
- const { children: o, icon: i, className: c, ...s } = n, { multiple: u, selectedValue: p = [] } = Rt();
820
- return /* @__PURE__ */ Y(
821
- Ee,
852
+ const Te = Ke({}), Ct = () => Je(Te), Pt = (o) => {
853
+ const { children: s, icon: i, className: a, ...l } = o, { multiple: c, selectedValue: m = [] } = Ct();
854
+ return /* @__PURE__ */ J(
855
+ Me,
822
856
  {
823
- ...s,
857
+ ...l,
824
858
  slotProps: {
825
- root: (f) => ({
826
- className: K(y.select__listbox__option, c, {
827
- [y["select__listbox__option--disabled"]]: f.disabled,
828
- [y["select__listbox__option--selected"]]: f.selected && !u
859
+ root: (b) => ({
860
+ className: $(R.select__listbox__option, a, {
861
+ [R["select__listbox__option--disabled"]]: b.disabled,
862
+ [R["select__listbox__option--selected"]]: b.selected && !c
829
863
  })
830
864
  })
831
865
  },
832
866
  children: [
833
- u && /* @__PURE__ */ m(Qe, { checked: p == null ? void 0 : p.includes(s.value), onChange: () => {
867
+ c && /* @__PURE__ */ f(Ge, { checked: m == null ? void 0 : m.includes(l.value), onChange: () => {
834
868
  } }),
835
- i ? /* @__PURE__ */ m("span", { className: y.select__listbox__option__icon, children: i }) : "",
836
- /* @__PURE__ */ m(_e, { className: y.select__listbox__option__text, children: o })
869
+ i ? /* @__PURE__ */ f("span", { className: R.select__listbox__option__icon, children: i }) : "",
870
+ /* @__PURE__ */ f(xe, { className: R.select__listbox__option__text, children: s })
837
871
  ]
838
872
  }
839
873
  );
840
- }, St = (n) => {
874
+ }, yt = (o) => {
841
875
  const {
842
- children: o,
876
+ children: s,
843
877
  className: i,
844
- id: c,
845
- onChange: s,
846
- label: u,
847
- required: p,
848
- multiple: f,
849
- value: d,
850
- classNameWrapper: _,
878
+ id: a,
879
+ onChange: l,
880
+ label: c,
881
+ required: m,
882
+ multiple: b,
883
+ value: p,
884
+ classNameWrapper: V,
851
885
  classNameLabel: k,
852
- testIdLabel: h,
853
- testIdWrapper: S,
854
- fullWidth: R = !0,
886
+ testIdLabel: g,
887
+ testIdWrapper: w,
888
+ fullWidth: h = !0,
855
889
  infoMessage: I,
856
890
  error: O,
857
891
  errorMessage: x,
858
892
  classNameInfoMessage: A,
859
- classNameErrorMessage: b,
893
+ classNameErrorMessage: d,
860
894
  "data-testid-infoMessage": C,
861
- "data-testid-errorMessage": P,
862
- ...B
863
- } = n, V = (H, M) => {
864
- H && (s == null || s(M, H));
865
- }, D = Je(), w = c || `select_${D}`;
866
- return /* @__PURE__ */ Y(
895
+ "data-testid-errorMessage": S,
896
+ ...M
897
+ } = o, P = (L, D) => {
898
+ L && (l == null || l(D, L));
899
+ }, B = We(), N = a || `select_${B.replace(/:/g, "-")}`;
900
+ return /* @__PURE__ */ J(
867
901
  "div",
868
902
  {
869
- className: K(
870
- y.select__wrapper,
871
- !R && y["select__wrapper--fit-content-width"],
872
- _
903
+ className: $(
904
+ R.select__wrapper,
905
+ !h && R["select__wrapper--fit-content-width"],
906
+ V
873
907
  ),
874
- "data-testid": S,
875
- id: `${w}_wrapper`,
908
+ "data-testid": w,
909
+ id: `${N}_wrapper`,
876
910
  children: [
877
- u && /* @__PURE__ */ Y(
878
- _e,
911
+ c && /* @__PURE__ */ J(
912
+ xe,
879
913
  {
880
914
  element: "label",
881
915
  bold: !0,
882
- elementProps: { htmlFor: w, id: `${w}_label` },
883
- className: K(y.select__label, k),
884
- "data-testid": h,
916
+ elementProps: { htmlFor: N, id: `${N}_label` },
917
+ className: $(R.select__label, k),
918
+ "data-testid": g,
885
919
  children: [
886
- u,
887
- p && /* @__PURE__ */ m("span", { children: "*" })
920
+ c,
921
+ m && /* @__PURE__ */ f("span", { children: "*" })
888
922
  ]
889
923
  }
890
924
  ),
891
- /* @__PURE__ */ m(He.Provider, { value: { multiple: f, selectedValue: d, onChange: s }, children: /* @__PURE__ */ m(
892
- $e,
925
+ /* @__PURE__ */ f(Te.Provider, { value: { multiple: b, selectedValue: p, onChange: l }, children: /* @__PURE__ */ f(
926
+ ve,
893
927
  {
894
- ...B,
895
- value: d,
896
- id: w,
897
- onChange: V,
898
- className: K(y.select, i, (O || x) && y["select-button--error"]),
899
- slots: { root: Ye },
900
- multiple: f,
928
+ ...M,
929
+ value: p,
930
+ id: N,
931
+ onChange: P,
932
+ className: $(R.select, i, (O || x) && R["select-button--error"]),
933
+ slots: { root: Xe },
934
+ multiple: b,
901
935
  slotProps: {
902
- root: { fullWidth: R, placeholder: B.placeholder },
903
- listbox: { className: y.select__listbox },
936
+ root: { fullWidth: h, placeholder: M.placeholder },
937
+ listbox: { className: R.select__listbox },
904
938
  popup: {
905
- className: y.select__popup,
939
+ className: R.select__popup,
906
940
  disablePortal: !0,
907
941
  strategy: "absolute"
908
942
  }
909
943
  },
910
- children: o
944
+ children: s
911
945
  }
912
946
  ) }),
913
- /* @__PURE__ */ m("div", { className: y["messages-wrapper"], children: (x || I) && /* @__PURE__ */ Y(
914
- _e,
947
+ /* @__PURE__ */ f("div", { className: R["messages-wrapper"], children: (x || I) && /* @__PURE__ */ J(
948
+ xe,
915
949
  {
916
- className: x ? K(y["error-message"], b) : K(y["info-message"], A),
917
- "data-testid": x ? P : C,
950
+ className: x ? $(R["error-message"], d) : $(R["info-message"], A),
951
+ "data-testid": x ? S : C,
918
952
  children: [
919
- /* @__PURE__ */ m(Xe, { icon: x ? "circle-exclamation" : "circle-info" }),
953
+ /* @__PURE__ */ f(Qe, { icon: x ? "circle-exclamation" : "circle-info" }),
920
954
  x || I
921
955
  ]
922
956
  }
@@ -925,10 +959,10 @@ const He = We({}), Rt = () => Ge(He), _t = (n) => {
925
959
  }
926
960
  );
927
961
  };
928
- St.Option = _t;
962
+ yt.Option = Pt;
929
963
  export {
930
- St as Select,
931
- He as SelectContext,
932
- _t as SelectOption,
933
- Rt as useSelectContext
964
+ yt as Select,
965
+ Te as SelectContext,
966
+ Pt as SelectOption,
967
+ Ct as useSelectContext
934
968
  };