@viasat/beam-react 2.29.1 → 2.36.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 (170) hide show
  1. package/assets/ActionList.css +1 -1
  2. package/assets/Avatar.css +1 -1
  3. package/assets/Badge.css +1 -1
  4. package/assets/Button.css +1 -1
  5. package/assets/Checkbox.css +1 -1
  6. package/assets/Chip.css +1 -1
  7. package/assets/ChipGroup.css +1 -1
  8. package/assets/CloseButton.css +1 -1
  9. package/assets/DateField.css +1 -0
  10. package/assets/EmptyState.css +1 -1
  11. package/assets/{floatingui.css → FloatingUI.css} +1 -1
  12. package/assets/InputChoiceGroup.css +1 -1
  13. package/assets/Link.css +1 -1
  14. package/assets/NativeSelect.css +1 -1
  15. package/assets/Pagination.css +1 -1
  16. package/assets/ProgressBar.css +1 -1
  17. package/assets/RadioButton.css +1 -1
  18. package/assets/Search.css +1 -1
  19. package/assets/SpinnerWrap.css +1 -1
  20. package/assets/Switch.css +1 -1
  21. package/assets/TextArea.css +1 -1
  22. package/assets/TextField.css +1 -1
  23. package/assets/card.css +1 -1
  24. package/assets/combobox.css +1 -1
  25. package/assets/fileUpload.css +1 -1
  26. package/assets/header.css +1 -1
  27. package/assets/index.css +1 -1
  28. package/assets/panel.css +1 -1
  29. package/assets/segmentedControl.css +1 -1
  30. package/assets/slider.css +1 -1
  31. package/assets/stepper.css +1 -1
  32. package/chunks/DateField.Segment.7oCeBSNo.js +1 -0
  33. package/chunks/DateField.Segment.DbjGMAPP.js +99 -0
  34. package/chunks/FloatingUI.arrow.DFhYQv_F.js +1 -0
  35. package/chunks/FloatingUI.arrow.tN5_IctZ.js +27 -0
  36. package/chunks/panel.module.BVmRxZHo.js +1 -0
  37. package/chunks/{panel.module.BblnuBjO.js → panel.module.CnHWv4EZ.js} +1 -3
  38. package/index.cjs.js +1 -1
  39. package/index.es.js +35 -33
  40. package/lib/ActionList/ActionList.Group.d.ts +1 -1
  41. package/lib/Autocomplete/Autocomplete.cjs.js +1 -1
  42. package/lib/Autocomplete/Autocomplete.d.ts +5 -5
  43. package/lib/Autocomplete/Autocomplete.es.js +296 -268
  44. package/lib/Autocomplete/AutocompleteDropdown.cjs.js +1 -1
  45. package/lib/Autocomplete/AutocompleteDropdown.es.js +15 -12
  46. package/lib/FloatingUI/FloatingUI.arrow.cjs.js +1 -1
  47. package/lib/FloatingUI/FloatingUI.arrow.es.js +6 -17
  48. package/lib/FloatingUI/FloatingUI.content.cjs.js +1 -1
  49. package/lib/FloatingUI/FloatingUI.content.es.js +17 -18
  50. package/lib/Search/SearchDropdown.cjs.js +1 -1
  51. package/lib/Search/SearchDropdown.es.js +1 -1
  52. package/lib/Select/Select.cjs.js +1 -1
  53. package/lib/Select/Select.d.ts +3 -2
  54. package/lib/Select/Select.es.js +208 -195
  55. package/lib/Select/SelectDropdown.cjs.js +1 -1
  56. package/lib/Select/SelectDropdown.es.js +15 -12
  57. package/lib/_Options/Option.cjs.js +1 -1
  58. package/lib/_Options/Option.context.cjs.js +1 -1
  59. package/lib/_Options/Option.context.d.ts +31 -13
  60. package/lib/_Options/Option.context.es.js +133 -88
  61. package/lib/_Options/Option.es.js +23 -21
  62. package/lib/_Options/Option.types.d.ts +23 -0
  63. package/lib/_Options/OptionGroup.cjs.js +1 -0
  64. package/lib/_Options/OptionGroup.context.cjs.js +1 -0
  65. package/lib/_Options/OptionGroup.context.d.ts +6 -0
  66. package/lib/_Options/OptionGroup.context.es.js +6 -0
  67. package/lib/_Options/OptionGroup.d.ts +3 -0
  68. package/lib/_Options/OptionGroup.es.js +22 -0
  69. package/lib/_Options/getLastVisibleStructureIndex.cjs.js +1 -0
  70. package/lib/_Options/getLastVisibleStructureIndex.d.ts +15 -0
  71. package/lib/_Options/getLastVisibleStructureIndex.es.js +14 -0
  72. package/lib/_Options/index.cjs.js +1 -1
  73. package/lib/_Options/index.d.ts +4 -0
  74. package/lib/_Options/index.es.js +13 -4
  75. package/lib/_Options/useRenderOption.cjs.js +1 -0
  76. package/lib/_Options/useRenderOption.d.ts +30 -0
  77. package/lib/_Options/useRenderOption.es.js +43 -0
  78. package/lib/index.cjs.js +1 -1
  79. package/lib/index.d.ts +1 -0
  80. package/lib/index.es.js +27 -25
  81. package/lib/wip/DateField/DateField.Segment.cjs.js +1 -0
  82. package/lib/wip/DateField/DateField.Segment.d.ts +2 -0
  83. package/lib/wip/DateField/DateField.Segment.es.js +8 -0
  84. package/lib/wip/DateField/DateField.Segments.cjs.js +1 -0
  85. package/lib/wip/DateField/DateField.Segments.d.ts +17 -0
  86. package/lib/wip/DateField/DateField.Segments.es.js +61 -0
  87. package/lib/wip/DateField/DateField.cjs.js +1 -0
  88. package/lib/wip/DateField/DateField.d.ts +3 -0
  89. package/lib/wip/DateField/DateField.es.js +191 -0
  90. package/lib/wip/DateField/DateField.types.cjs.js +1 -0
  91. package/lib/wip/DateField/DateField.types.d.ts +118 -0
  92. package/lib/wip/DateField/DateField.types.es.js +1 -0
  93. package/lib/wip/DateField/DateField.utils.cjs.js +1 -0
  94. package/lib/wip/DateField/DateField.utils.d.ts +26 -0
  95. package/lib/wip/DateField/DateField.utils.es.js +45 -0
  96. package/lib/wip/DateField/DateField.validation.cjs.js +1 -0
  97. package/lib/wip/DateField/DateField.validation.d.ts +26 -0
  98. package/lib/wip/DateField/DateField.validation.es.js +24 -0
  99. package/lib/wip/DateField/index.cjs.js +1 -0
  100. package/lib/wip/DateField/index.d.ts +2 -0
  101. package/lib/wip/DateField/index.es.js +4 -0
  102. package/lib/wip/DateField/useDateFieldFocus.cjs.js +1 -0
  103. package/lib/wip/DateField/useDateFieldFocus.d.ts +23 -0
  104. package/lib/wip/DateField/useDateFieldFocus.es.js +65 -0
  105. package/lib/wip/DateField/useDateFieldForm.cjs.js +1 -0
  106. package/lib/wip/DateField/useDateFieldForm.d.ts +32 -0
  107. package/lib/wip/DateField/useDateFieldForm.es.js +51 -0
  108. package/lib/wip/DateField/useDateFieldSegments.cjs.js +1 -0
  109. package/lib/wip/DateField/useDateFieldSegments.d.ts +7 -0
  110. package/lib/wip/DateField/useDateFieldSegments.es.js +13 -0
  111. package/lib/wip/DateField/useDateFieldValidity.cjs.js +1 -0
  112. package/lib/wip/DateField/useDateFieldValidity.d.ts +23 -0
  113. package/lib/wip/DateField/useDateFieldValidity.es.js +19 -0
  114. package/lib/wip/DateField/useDateFieldValue.cjs.js +1 -0
  115. package/lib/wip/DateField/useDateFieldValue.d.ts +19 -0
  116. package/lib/wip/DateField/useDateFieldValue.es.js +62 -0
  117. package/lib/wip/DateField/useInvalidState.cjs.js +1 -0
  118. package/lib/wip/DateField/useInvalidState.d.ts +13 -0
  119. package/lib/wip/DateField/useInvalidState.es.js +8 -0
  120. package/lib/wip/Panel/Footer/Panel.Footer.Actions.cjs.js +1 -1
  121. package/lib/wip/Panel/Footer/Panel.Footer.Actions.es.js +1 -1
  122. package/lib/wip/Panel/Footer/Panel.Footer.cjs.js +1 -1
  123. package/lib/wip/Panel/Footer/Panel.Footer.es.js +1 -1
  124. package/lib/wip/Panel/Header/Panel.Header.ContentAfter.cjs.js +1 -1
  125. package/lib/wip/Panel/Header/Panel.Header.ContentAfter.es.js +1 -1
  126. package/lib/wip/Panel/Header/Panel.Header.ContentBefore.cjs.js +1 -1
  127. package/lib/wip/Panel/Header/Panel.Header.ContentBefore.es.js +1 -1
  128. package/lib/wip/Panel/Header/Panel.Header.Description.cjs.js +1 -1
  129. package/lib/wip/Panel/Header/Panel.Header.Description.es.js +1 -1
  130. package/lib/wip/Panel/Header/Panel.Header.Heading.cjs.js +1 -1
  131. package/lib/wip/Panel/Header/Panel.Header.Heading.es.js +1 -1
  132. package/lib/wip/Panel/Header/Panel.Header.Row.cjs.js +1 -1
  133. package/lib/wip/Panel/Header/Panel.Header.Row.es.js +1 -1
  134. package/lib/wip/Panel/Header/Panel.Header.Subheader.cjs.js +1 -1
  135. package/lib/wip/Panel/Header/Panel.Header.Subheader.es.js +1 -1
  136. package/lib/wip/Panel/Header/Panel.Header.cjs.js +1 -1
  137. package/lib/wip/Panel/Header/Panel.Header.es.js +1 -1
  138. package/lib/wip/Panel/Panel.Body.cjs.js +1 -1
  139. package/lib/wip/Panel/Panel.Body.es.js +1 -1
  140. package/lib/wip/Panel/Panel.Inline.cjs.js +1 -1
  141. package/lib/wip/Panel/Panel.Inline.d.ts +5 -1
  142. package/lib/wip/Panel/Panel.Inline.es.js +54 -47
  143. package/lib/wip/Panel/Panel.Overlay.cjs.js +1 -1
  144. package/lib/wip/Panel/Panel.Overlay.d.ts +20 -2
  145. package/lib/wip/Panel/Panel.Overlay.es.js +117 -80
  146. package/lib/wip/Panel/Panel.ResizeHandle.cjs.js +1 -1
  147. package/lib/wip/Panel/Panel.ResizeHandle.es.js +1 -1
  148. package/lib/wip/Panel/Panel.cjs.js +1 -1
  149. package/lib/wip/Panel/Panel.d.ts +1 -1
  150. package/lib/wip/Panel/Panel.es.js +139 -100
  151. package/lib/wip/Panel/Panel.helpers.cjs.js +1 -1
  152. package/lib/wip/Panel/Panel.helpers.d.ts +2 -1
  153. package/lib/wip/Panel/Panel.helpers.es.js +37 -35
  154. package/lib/wip/Panel/Panel.types.d.ts +64 -10
  155. package/lib/wip/Panel/Panel.useResize.cjs.js +1 -1
  156. package/lib/wip/Panel/Panel.useResize.d.ts +3 -1
  157. package/lib/wip/Panel/Panel.useResize.es.js +34 -30
  158. package/package.json +6 -6
  159. package/utils/hooks/index.cjs.js +1 -1
  160. package/utils/hooks/index.d.ts +1 -0
  161. package/utils/hooks/index.es.js +12 -10
  162. package/utils/hooks/useElementResize.cjs.js +1 -1
  163. package/utils/hooks/useElementResize.d.ts +1 -1
  164. package/utils/hooks/useElementResize.es.js +33 -33
  165. package/utils/hooks/usePrevious.cjs.js +1 -0
  166. package/utils/hooks/usePrevious.d.ts +5 -0
  167. package/utils/hooks/usePrevious.es.js +10 -0
  168. package/chunks/floatingui.module.BcBFebz0.js +0 -10
  169. package/chunks/floatingui.module.D3Aw_aYe.js +0 -1
  170. package/chunks/panel.module.CVyUzyCZ.js +0 -1
@@ -1,259 +1,272 @@
1
- import { jsxs as x, jsx as i } from "react/jsx-runtime";
2
- import ke, { useCallback as k, useMemo as C, createElement as Fe } from "react";
3
- import { g as Le } from "../../chunks/classNames.BTJmrO_L.js";
4
- import { t as Re } from "../../chunks/constants.CKKGf1-i.js";
5
- import { s as r } from "../../chunks/combobox.module.D_HXP875.js";
6
- import F from "clsx";
7
- import { b as qe, H as Ae } from "../../chunks/form.context.D7b4066_.js";
8
- import { LabelProvider as He } from "../Form/contexts/label.context.es.js";
9
- import { HelperTextProvider as je } from "../Form/contexts/helperText.context.es.js";
10
- import { ActionList as L } from "../ActionList/ActionList.es.js";
11
- import { useSelectDropdown as Ke } from "./useSelectDropdown.es.js";
12
- import { SelectDropdown as Te } from "./SelectDropdown.es.js";
13
- import { useSelectChips as Ge } from "./useSelectChips.es.js";
14
- import { useSelectKeyboardManager as We } from "./useSelectKeyboardManager.es.js";
15
- import ze from "./useClearSelection.es.js";
16
- import { OptionChips as Je } from "../_Options/OptionChips.es.js";
17
- import { SelectField as Qe } from "./SelectField.es.js";
18
- import Ue from "./useSelectA11y.es.js";
19
- import { useCreateOptionsContext as Xe, OptionsProvider as Ye } from "../_Options/Option.context.es.js";
20
- import { Option as Ze } from "../_Options/Option.es.js";
21
- import { useSelectValue as _e } from "../_Options/useSelectValue.es.js";
22
- import { createSelectionStrategy as et } from "../_Options/strategies/SelectionStrategy.es.js";
23
- const { baseClassNamePrefix: tt, subElementClassPrefix: O, classModifierPrefix: a } = Le("combobox"), lt = ke.forwardRef(
1
+ import { jsxs as v, jsx as o } from "react/jsx-runtime";
2
+ import { g as Ke } from "../../chunks/classNames.BTJmrO_L.js";
3
+ import { t as Te } from "../../chunks/constants.CKKGf1-i.js";
4
+ import { s as i } from "../../chunks/combobox.module.D_HXP875.js";
5
+ import We from "clsx";
6
+ import ze, { useCallback as H, useMemo as y } from "react";
7
+ import { b as Je, H as Qe } from "../../chunks/form.context.D7b4066_.js";
8
+ import { LabelProvider as Ue } from "../Form/contexts/label.context.es.js";
9
+ import { HelperTextProvider as Xe } from "../Form/contexts/helperText.context.es.js";
10
+ import { ActionList as j } from "../ActionList/ActionList.es.js";
11
+ import { useSelectDropdown as Ye } from "./useSelectDropdown.es.js";
12
+ import { SelectDropdown as Ze } from "./SelectDropdown.es.js";
13
+ import { useSelectChips as _e } from "./useSelectChips.es.js";
14
+ import { useSelectKeyboardManager as et } from "./useSelectKeyboardManager.es.js";
15
+ import tt from "./useClearSelection.es.js";
16
+ import { OptionChips as rt } from "../_Options/OptionChips.es.js";
17
+ import { SelectField as it } from "./SelectField.es.js";
18
+ import ot from "./useSelectA11y.es.js";
19
+ import { useCreateOptionsContext as st, OptionsProvider as lt } from "../_Options/Option.context.es.js";
20
+ import { Option as at } from "../_Options/Option.es.js";
21
+ import { OptionGroup as dt } from "../_Options/OptionGroup.es.js";
22
+ import "../_Options/OptionGroup.context.es.js";
23
+ import { getLastVisibleStructureIndex as nt } from "../_Options/getLastVisibleStructureIndex.es.js";
24
+ import { useRenderOption as ct } from "../_Options/useRenderOption.es.js";
25
+ import { useSelectValue as pt } from "../_Options/useSelectValue.es.js";
26
+ import { createSelectionStrategy as mt } from "../_Options/strategies/SelectionStrategy.es.js";
27
+ const { baseClassNamePrefix: ut, subElementClassPrefix: P, classModifierPrefix: a } = Ke("combobox"), ft = ze.forwardRef(
24
28
  ({
25
- theme: v,
26
- width: q,
29
+ theme: O,
30
+ width: k,
27
31
  error: d,
28
- children: A,
29
- label: P = null,
30
- contentBefore: H,
31
- contentAfter: j,
32
- fluid: K = !1,
33
- helperText: g = null,
34
- validationRules: T = [],
35
- className: G,
36
- hideRequiredMarker: W = !1,
37
- disabled: z = !1,
38
- readOnly: J = !1,
39
- required: Q = !1,
40
- placeholder: U = "",
32
+ children: K,
33
+ label: $ = null,
34
+ contentBefore: T,
35
+ contentAfter: W,
36
+ fluid: z = !1,
37
+ helperText: N = null,
38
+ validationRules: J = [],
39
+ className: Q,
40
+ hideRequiredMarker: U = !1,
41
+ disabled: X = !1,
42
+ readOnly: Y = !1,
43
+ required: Z = !1,
44
+ placeholder: _ = "",
41
45
  onChange: m,
42
46
  ...u
43
- }, X) => {
47
+ }, ee) => {
44
48
  const {
45
- id: I,
46
- name: Y,
47
- "aria-describedby": Z,
49
+ id: V,
50
+ name: te,
51
+ "aria-describedby": re,
48
52
  multiple: e = !1,
49
- clearable: _ = e,
50
- ...ee
51
- } = u, { showErrors: te, isInvalid: le, errorShown: re, disabled: l, readOnly: s, required: $ } = qe({
52
- name: Y,
53
- validationRules: T,
54
- disabledProp: z,
55
- readOnlyProp: J,
56
- requiredProp: Q
57
- }), { aria: f, ids: oe } = Ue({
58
- helperText: g,
59
- externalDescribedBy: Z,
53
+ clearable: ie = e,
54
+ ...oe
55
+ } = u, { showErrors: se, isInvalid: le, errorShown: ae, disabled: r, readOnly: s, required: w } = Je({
56
+ name: te,
57
+ validationRules: J,
58
+ disabledProp: X,
59
+ readOnlyProp: Y,
60
+ requiredProp: Z
61
+ }), { aria: f, ids: de } = ot({
62
+ helperText: N,
63
+ externalDescribedBy: re,
60
64
  error: d,
61
- errorShown: re,
65
+ errorShown: ae,
62
66
  invalid: !!d || le
63
- }), { helperTextId: se, errorId: ie, validationErrorsId: ae, labelId: N } = oe, de = !!(d != null && d.length), ne = k(
64
- (o) => {
65
- m == null || m(o);
67
+ }), { helperTextId: ne, errorId: ce, validationErrorsId: pe, labelId: D } = de, me = !!(d != null && d.length), ue = H(
68
+ (t) => {
69
+ m == null || m(t);
66
70
  },
67
71
  [m]
68
72
  ), {
69
73
  value: n,
70
- setValue: B,
71
- selectProps: ce,
72
- handleBlur: w,
74
+ setValue: L,
75
+ selectProps: fe,
76
+ handleBlur: M,
73
77
  singleValue: b
74
- } = _e({ onChange: ne, ...u }, X), y = !n || Array.isArray(n) && !n.length, {
75
- optionsContext: pe,
76
- optionIds: c,
77
- optionsProps: p,
78
- selectedOptionsProps: M,
79
- deselectOptionValue: D
80
- } = Xe(n, B, e), h = C(() => {
78
+ } = pt({ onChange: ue, ...u }, ee), g = !n || Array.isArray(n) && !n.length, {
79
+ optionsContext: be,
80
+ optionIds: h,
81
+ optionsProps: c,
82
+ selectedOptionsProps: R,
83
+ deselectOptionValue: E,
84
+ structureIds: S,
85
+ groupsProps: he,
86
+ optionIdsByGroup: C
87
+ } = st(n, L, e), x = y(() => {
81
88
  if (!b) return;
82
- const o = c.map((t) => p.get(t)).findIndex((t) => (t == null ? void 0 : t.value) === b);
83
- return o !== -1 ? o : void 0;
84
- }, [c, p, b]), me = C(() => {
85
- if (h === void 0) return;
86
- const o = p.get(c[h]);
87
- return o == null ? void 0 : o.label;
88
- }, [h, c, p]), { getFieldProps: ue, dropdownProps: fe, refs: be, open: E, setOpen: S, status: he } = Ke({
89
- disabled: l,
89
+ const t = h.map((l) => c.get(l)).findIndex((l) => (l == null ? void 0 : l.value) === b);
90
+ return t !== -1 ? t : void 0;
91
+ }, [h, c, b]), xe = y(() => {
92
+ if (x === void 0) return;
93
+ const t = c.get(h[x]);
94
+ return t == null ? void 0 : t.label;
95
+ }, [x, h, c]), { getFieldProps: ve, dropdownProps: ye, refs: Oe, open: F, setOpen: I, status: ge } = Ye({
96
+ disabled: r,
90
97
  readOnly: s,
91
- lastSelectedOptionIndex: h
92
- }), xe = F(
93
- r[tt],
94
- v && Re(v),
95
- K && r[`${a}fluid`],
96
- f.invalid && r[`${a}error`],
97
- l && r[`${a}disabled`],
98
- s && r[`${a}read-only`],
99
- y && r[`${a}empty`],
100
- e && r[`${a}multiple`],
101
- r[`${a}dropdown-${he}`],
102
- G
103
- ), { canClear: ve, handleClear: ye } = ze({
98
+ lastSelectedOptionIndex: x
99
+ }), Se = We(
100
+ i[ut],
101
+ O && Te(O),
102
+ z && i[`${a}fluid`],
103
+ f.invalid && i[`${a}error`],
104
+ r && i[`${a}disabled`],
105
+ s && i[`${a}read-only`],
106
+ g && i[`${a}empty`],
107
+ e && i[`${a}multiple`],
108
+ i[`${a}dropdown-${ge}`],
109
+ Q
110
+ ), { canClear: Ce, handleClear: Ie } = tt({
104
111
  multiple: e,
105
- clearable: _,
106
- isEmpty: y,
107
- disabled: l,
112
+ clearable: ie,
113
+ isEmpty: g,
114
+ disabled: r,
108
115
  readOnly: s,
109
- setValue: B,
110
- setOpen: S
116
+ setValue: L,
117
+ setOpen: I
111
118
  }), {
112
- chipGroupProps: Se,
113
- handleBlur: V,
114
- selectedChip: Ce,
115
- setSelectedChip: Oe,
116
- enabled: Pe,
117
- selectPreviousChip: ge,
118
- selectNextChip: Ie,
119
- options: $e,
120
- deselectOptionValue: Ne
121
- } = Ge({
119
+ chipGroupProps: Pe,
120
+ handleBlur: G,
121
+ selectedChip: Be,
122
+ setSelectedChip: $e,
123
+ enabled: Ne,
124
+ selectPreviousChip: Ve,
125
+ selectNextChip: we,
126
+ options: De,
127
+ deselectOptionValue: Le
128
+ } = _e({
122
129
  multiple: e,
123
- disabled: l,
130
+ disabled: r,
124
131
  readOnly: s,
125
- open: E,
126
- setOpen: S,
127
- options: M,
128
- deselectOptionValue: D,
129
- fieldRef: be.domReference
130
- }), { getKeyboardProps: Be } = We({
132
+ open: F,
133
+ setOpen: I,
134
+ options: R,
135
+ deselectOptionValue: E,
136
+ fieldRef: Oe.domReference
137
+ }), { getKeyboardProps: Me } = et({
131
138
  multiple: e,
132
- disabled: l,
139
+ disabled: r,
133
140
  readOnly: s,
134
- open: E,
135
- setOpen: S,
141
+ open: F,
142
+ setOpen: I,
136
143
  chips: {
137
- enabled: Pe,
138
- selectedChip: Ce,
139
- setSelectedChip: Oe,
140
- selectPreviousChip: ge,
141
- selectNextChip: Ie,
142
- options: $e,
143
- deselectOptionValue: Ne
144
+ enabled: Ne,
145
+ selectedChip: Be,
146
+ setSelectedChip: $e,
147
+ selectPreviousChip: Ve,
148
+ selectNextChip: we,
149
+ options: De,
150
+ deselectOptionValue: Le
144
151
  }
145
- }), we = C(
146
- () => et(e),
152
+ }), Re = y(
153
+ () => mt(e),
147
154
  [e]
148
- ), Me = k(() => {
149
- w(), V();
150
- }, [w, V]), { ref: De, ...Ee } = Be(ue());
151
- return /* @__PURE__ */ x(Ye, { value: pe, children: [
152
- /* @__PURE__ */ x("div", { className: xe, style: { maxWidth: q }, children: [
153
- /* @__PURE__ */ i(
154
- He,
155
+ ), Ee = H(() => {
156
+ M(), G();
157
+ }, [M, G]), q = ct({
158
+ optionsProps: c,
159
+ selectionStrategy: Re,
160
+ value: n,
161
+ multiple: e,
162
+ optionClassName: i[`${P}option`]
163
+ }), Fe = y(
164
+ () => nt(S, C),
165
+ [S, C]
166
+ ), { ref: Ge, ...qe } = Me(ve());
167
+ return /* @__PURE__ */ v(lt, { value: be, children: [
168
+ /* @__PURE__ */ v("div", { className: Se, style: { maxWidth: k }, children: [
169
+ /* @__PURE__ */ o(
170
+ Ue,
155
171
  {
156
- ctxHtmlFor: I,
157
- ctxDisabled: l,
158
- ctxRequired: $ && !W,
159
- ctxId: N,
160
- children: P
172
+ ctxHtmlFor: V,
173
+ ctxDisabled: r,
174
+ ctxRequired: w && !U,
175
+ ctxId: D,
176
+ children: $
161
177
  }
162
178
  ),
163
- /* @__PURE__ */ i(
164
- Qe,
179
+ /* @__PURE__ */ o(
180
+ it,
165
181
  {
166
- id: I,
167
- disabled: l,
182
+ id: V,
183
+ disabled: r,
168
184
  readOnly: s,
169
- required: $,
185
+ required: w,
170
186
  invalid: f.invalid,
171
187
  errorMessage: f.errorMessage,
172
- labelId: !u.ariaLabel && P ? N : void 0,
188
+ labelId: !u.ariaLabel && $ ? D : void 0,
173
189
  ariaLabel: u.ariaLabel,
174
190
  describedBy: f.describedBy,
175
- contentBefore: H,
176
- contentAfter: j,
177
- chips: /* @__PURE__ */ i(
178
- Je,
191
+ contentBefore: T,
192
+ contentAfter: W,
193
+ chips: /* @__PURE__ */ o(
194
+ rt,
179
195
  {
180
196
  multiple: e,
181
- disabled: l,
197
+ disabled: r,
182
198
  readOnly: s,
183
- selectedOptions: M,
184
- deselectOptionValue: D,
185
- chipGroupProps: Se,
186
- input: /* @__PURE__ */ i(
199
+ selectedOptions: R,
200
+ deselectOptionValue: E,
201
+ chipGroupProps: Pe,
202
+ input: /* @__PURE__ */ o(
187
203
  "input",
188
204
  {
189
- className: r[`${O}field__input`],
190
- placeholder: e && !y ? "" : U,
191
- disabled: l,
205
+ className: i[`${P}field__input`],
206
+ placeholder: e && !g ? "" : _,
207
+ disabled: r,
192
208
  readOnly: !0,
193
209
  autoComplete: "off",
194
210
  tabIndex: -1,
195
211
  autoFocus: !1,
196
- value: e ? "" : me ?? b
212
+ value: e ? "" : xe ?? b
197
213
  }
198
214
  )
199
215
  }
200
216
  ),
201
- hasClearButton: ve,
202
- onClear: ye,
203
- onBlur: Me,
204
- ...Ee,
205
- ref: De
217
+ hasClearButton: Ce,
218
+ onClear: Ie,
219
+ onBlur: Ee,
220
+ ...qe,
221
+ ref: Ge
206
222
  }
207
223
  ),
208
- /* @__PURE__ */ x(je, { ctxId: se, ctxDisabled: l, children: [
209
- g,
210
- de && /* @__PURE__ */ i(Ae, { id: ie, appearance: "negative", children: d })
224
+ /* @__PURE__ */ v(Xe, { ctxId: ne, ctxDisabled: r, children: [
225
+ N,
226
+ me && /* @__PURE__ */ o(Qe, { id: ce, appearance: "negative", children: d })
211
227
  ] }),
212
- te(ae)
228
+ se(pe)
213
229
  ] }),
214
- /* @__PURE__ */ x("select", { ...ee, ...ce, hidden: !0, multiple: e, children: [
215
- /* @__PURE__ */ i("option", { value: "", children: "empty" }),
216
- A
230
+ /* @__PURE__ */ v("select", { ...oe, ...fe, hidden: !0, multiple: e, children: [
231
+ /* @__PURE__ */ o("option", { value: "", children: "empty" }),
232
+ K
217
233
  ] }),
218
- /* @__PURE__ */ i(
219
- Te,
234
+ /* @__PURE__ */ o(
235
+ Ze,
220
236
  {
221
- ...fe,
222
- className: r[`${O}dropdown`],
223
- disabled: l,
237
+ ...ye,
238
+ className: i[`${P}dropdown`],
239
+ disabled: r,
224
240
  readOnly: s,
225
- theme: v,
241
+ theme: O,
226
242
  multiple: e,
227
- children: /* @__PURE__ */ i(L, { role: "listbox", children: c.map((o) => {
228
- const t = p.get(o);
229
- if (!t) return null;
230
- const Ve = we.isSelected(
231
- t.value,
232
- n
233
- );
234
- return /* @__PURE__ */ Fe(
235
- L.Item,
243
+ children: /* @__PURE__ */ o(j, { role: "listbox", children: S.map((t, l) => {
244
+ if (t.kind === "option")
245
+ return q(t.id);
246
+ const p = he.get(t.id);
247
+ if (!p) return null;
248
+ const A = C.get(t.id) ?? [], Ae = A.length > 0, He = l === Fe, je = !!p.divider && !He;
249
+ return /* @__PURE__ */ o(
250
+ j.Group,
236
251
  {
237
- ...t,
238
- className: F(
239
- r[`${O}option`],
240
- t.className
241
- ),
242
- defaultSelected: Ve,
243
- key: `opt-${t.value ?? t.label}`,
244
- kind: e ? "checkbox" : "singleCheckMark",
245
- role: "option"
246
- }
252
+ heading: p.heading,
253
+ divider: je,
254
+ disabled: p.disabled,
255
+ hidden: !Ae,
256
+ children: A.map((ke) => q(ke, p.disabled))
257
+ },
258
+ t.id
247
259
  );
248
260
  }) })
249
261
  }
250
262
  )
251
263
  ] });
252
264
  }
253
- ), R = lt;
254
- R.Option = Ze;
255
- R.displayName = "Select";
265
+ ), B = ft;
266
+ B.Option = at;
267
+ B.OptionGroup = dt;
268
+ B.displayName = "Select";
256
269
  export {
257
- R as Select,
258
- R as default
270
+ B as Select,
271
+ B as default
259
272
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@floating-ui/react"),B=require("../Box/Box.cjs.js"),C=require("clsx"),a=require("../../chunks/classNames.DAeKwerT.js"),P=require("../../chunks/constants.hwjHOsvT.js");require("../_Options/Option.context.cjs.js");const v=require("../_Options/Option.cjs.js"),y=require("react");require("../../chunks/form.context.hesWPMlU.js");require("../Form/contexts/label.context.cjs.js");require("../Form/contexts/helperText.context.cjs.js");const S=require("../ActionList/ActionList.context.cjs.js"),O=require("../../chunks/floatingui.module.D3Aw_aYe.js"),M=require("../../chunks/popover.module.DGUJIXrP.js"),{baseClassNamePrefix:w}=a.getBEMClassNames("floatingui"),{baseClassNamePrefix:A}=a.getBEMClassNames("popover"),L=[v.Option],T=({setOpen:t,isMounted:n,status:l,nodeId:c,context:u,getFloatingProps:d,floatingStyles:x,labelsRef:f,elementsRef:q,getItemProps:g,setFloating:p,disabled:m,readOnly:N,theme:o,className:b,children:F,multiple:i,activeIndex:_,onItemClick:s})=>{const j=y.useCallback(h=>{s==null||s(h),!i&&t(!1)},[i,s,t]);return n?e.jsx(r.FloatingTree,{children:e.jsx(r.FloatingNode,{id:c,children:e.jsx(r.FloatingPortal,{children:e.jsx(r.FloatingFocusManager,{context:u,modal:!1,initialFocus:0,disabled:m||N,closeOnFocusOut:!0,restoreFocus:!0,returnFocus:!0,guards:!0,order:["content","reference"],children:e.jsx(B.Box,{"data-status":l,className:C(o&&P.themeClassName(o),O.floatinguiStyles[w],M.popoverStyles[A],b),...d(),style:x,ref:p,children:e.jsx(S.ActionListContextProvider,{allowChildrenTypes:L,getItemProps:g,itemsFocusable:!1,onItemClick:j,labelsRef:f,elementsRef:q,activeIndex:_,children:F})})})})})}):null};exports.SelectDropdown=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("@floating-ui/react"),B=require("../Box/Box.cjs.js"),C=require("clsx"),a=require("../../chunks/classNames.DAeKwerT.js"),P=require("../../chunks/constants.hwjHOsvT.js");require("../_Options/Option.context.cjs.js");const v=require("../_Options/Option.cjs.js"),y=require("react");require("../_Options/OptionGroup.context.cjs.js");require("../../utils/hooks/useId.cjs.js");require("../ActionList/ActionList.cjs.js");require("../../chunks/form.context.hesWPMlU.js");require("../Form/contexts/label.context.cjs.js");require("../Form/contexts/helperText.context.cjs.js");const S=require("../ActionList/ActionList.context.cjs.js"),O=require("../../chunks/FloatingUI.arrow.DFhYQv_F.js"),w=require("../../chunks/popover.module.DGUJIXrP.js"),{baseClassNamePrefix:M}=a.getBEMClassNames("floatingui"),{baseClassNamePrefix:A}=a.getBEMClassNames("popover"),L=[v.Option],T=({setOpen:t,isMounted:n,status:l,nodeId:c,context:u,getFloatingProps:d,floatingStyles:q,labelsRef:x,elementsRef:g,getItemProps:f,setFloating:p,disabled:F,readOnly:_,theme:o,className:b,children:m,multiple:i,activeIndex:N,onItemClick:r})=>{const j=y.useCallback(h=>{r==null||r(h),!i&&t(!1)},[i,r,t]);return n?e.jsx(s.FloatingTree,{children:e.jsx(s.FloatingNode,{id:c,children:e.jsx(s.FloatingPortal,{children:e.jsx(s.FloatingFocusManager,{context:u,modal:!1,initialFocus:0,disabled:F||_,closeOnFocusOut:!0,restoreFocus:!0,returnFocus:!0,guards:!0,order:["content","reference"],children:e.jsx(B.Box,{"data-status":l,className:C(o&&P.themeClassName(o),O.floatinguiStyles[M],w.popoverStyles[A],b),...d(),style:q,ref:p,children:e.jsx(S.ActionListContextProvider,{allowChildrenTypes:L,getItemProps:f,itemsFocusable:!1,onItemClick:j,labelsRef:x,elementsRef:g,activeIndex:N,children:m})})})})})}):null};exports.SelectDropdown=T;
@@ -7,38 +7,41 @@ import { t as O } from "../../chunks/constants.CKKGf1-i.js";
7
7
  import "../_Options/Option.context.es.js";
8
8
  import { Option as T } from "../_Options/Option.es.js";
9
9
  import { useCallback as j } from "react";
10
+ import "../_Options/OptionGroup.context.es.js";
11
+ import "../../utils/hooks/useId.es.js";
12
+ import "../ActionList/ActionList.es.js";
10
13
  import "../../chunks/form.context.D7b4066_.js";
11
14
  import "../Form/contexts/label.context.es.js";
12
15
  import "../Form/contexts/helperText.context.es.js";
13
16
  import { ActionListContextProvider as A } from "../ActionList/ActionList.context.es.js";
14
- import { f as D } from "../../chunks/floatingui.module.BcBFebz0.js";
17
+ import { f as D } from "../../chunks/FloatingUI.arrow.tN5_IctZ.js";
15
18
  import { p as E } from "../../chunks/popover.module.3dnl8y6-.js";
16
- const { baseClassNamePrefix: L } = a("floatingui"), { baseClassNamePrefix: q } = a("popover"), z = [T], I = ({
19
+ const { baseClassNamePrefix: L } = a("floatingui"), { baseClassNamePrefix: q } = a("popover"), z = [T], er = ({
17
20
  setOpen: e,
18
21
  isMounted: i,
19
22
  status: l,
20
23
  nodeId: m,
21
24
  context: n,
22
- getFloatingProps: f,
23
- floatingStyles: p,
25
+ getFloatingProps: p,
26
+ floatingStyles: f,
24
27
  labelsRef: c,
25
28
  elementsRef: u,
26
29
  getItemProps: d,
27
30
  setFloating: g,
28
31
  disabled: F,
29
32
  readOnly: x,
30
- theme: s,
33
+ theme: t,
31
34
  className: N,
32
35
  children: h,
33
- multiple: t,
36
+ multiple: s,
34
37
  activeIndex: C,
35
38
  onItemClick: o
36
39
  }) => {
37
40
  const P = j(
38
41
  (b) => {
39
- o == null || o(b), !t && e(!1);
42
+ o == null || o(b), !s && e(!1);
40
43
  },
41
- [t, o, e]
44
+ [s, o, e]
42
45
  );
43
46
  return i ? /* @__PURE__ */ r(v, { children: /* @__PURE__ */ r(y, { id: m, children: /* @__PURE__ */ r(B, { children: /* @__PURE__ */ r(
44
47
  S,
@@ -57,13 +60,13 @@ const { baseClassNamePrefix: L } = a("floatingui"), { baseClassNamePrefix: q } =
57
60
  {
58
61
  "data-status": l,
59
62
  className: M(
60
- s && O(s),
63
+ t && O(t),
61
64
  D[L],
62
65
  E[q],
63
66
  N
64
67
  ),
65
- ...f(),
66
- style: p,
68
+ ...p(),
69
+ style: f,
67
70
  ref: g,
68
71
  children: /* @__PURE__ */ r(
69
72
  A,
@@ -84,5 +87,5 @@ const { baseClassNamePrefix: L } = a("floatingui"), { baseClassNamePrefix: q } =
84
87
  ) }) }) }) : null;
85
88
  };
86
89
  export {
87
- I as SelectDropdown
90
+ er as SelectDropdown
88
91
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("react/jsx-runtime"),t=require("react"),d=require("./Option.context.cjs.js"),x=require("../../utils/functions.cjs.js"),f=({className:g,label:i,value:m,children:o,...u})=>{const s=t.useMemo(()=>i??x.extractTextFromReactNode(o),[i,o]),n=m??s,{selectOption:c,deselectOption:r,registerOption:l,unregisterOption:a,setOptionProps:p}=d.useOptionsContext(),e=t.useMemo(()=>Symbol("OptionId"),[]),O=t.useCallback(_=>{_?c(e):r(e)},[r,e,c]);return t.useLayoutEffect(()=>(l(e),()=>a(e)),[e,l,a]),t.useEffect(()=>{p(e,{...u,label:s,value:n,children:o,onSelectionChange:O})},[o,e,s,O,u,p,n]),b.jsx("option",{value:n,children:s})};exports.Option=f;exports.default=f;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("react/jsx-runtime"),s=require("react"),g=require("./Option.context.cjs.js"),m=require("./OptionGroup.context.cjs.js"),q=require("../../utils/functions.cjs.js"),v=require("../../utils/hooks/useId.cjs.js"),d=({className:C,label:u,value:f,children:t,...i})=>{const o=s.useMemo(()=>u??q.extractTextFromReactNode(t),[u,t]),n=f??o,{selectOption:r,deselectOption:c,registerOption:l,unregisterOption:a,setOptionProps:p}=g.useOptionsContext(),{groupId:O}=m.useOptionGroupContext(),e=v.useId()??"",_=s.useCallback(x=>{x?r(e):c(e)},[c,e,r]);return s.useLayoutEffect(()=>(l(e,O),()=>a(e)),[e,O,l,a]),s.useEffect(()=>{p(e,{...i,label:o,value:n,children:t,onSelectionChange:_})},[t,e,o,_,i,p,n]),b.jsx("option",{value:n,children:o})};exports.Option=d;exports.default=d;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),h=r.createContext(null),P=h.Provider,S=()=>{const o=r.useContext(h);if(!o)throw new Error("useOptionsContext must be used within an OptionsProvider");return o},I=o=>Array.isArray(o)?o:o!==void 0?[o]:[],V=(o,c,u)=>{const p=r.useRef(void 0),[i,O]=r.useState(()=>new Map),[a,C]=r.useState(()=>[]),g=r.useRef(i);g.current=i;const l=r.useMemo(()=>I(o),[o]),d=r.useRef(l);d.current=l,r.useMemo(()=>{if(!l.length)p.current=void 0;else{const n=l[l.length-1],t=a.map(e=>i.get(e)).findIndex(e=>(e==null?void 0:e.value)===n);p.current=t}},[l,a,i]);const x=r.useCallback(n=>{const t=g.current.get(n),e=t==null?void 0:t.value,s=d.current;t&&e&&c(u?[...s.filter(f=>f!==e),e]:e)},[u,c]),b=r.useCallback(n=>{const t=g.current.get(n),e=t==null?void 0:t.value,s=d.current;if(t&&e)if(u){if(!s.includes(e))return;c(s.filter(f=>f!==e))}else return},[u,c]),m=r.useCallback(n=>{if(!u||n===void 0)return;const e=I(n)[0];if(!e)return;const s=d.current;s.includes(e)&&c(s.filter(f=>f!==e))},[u,c]),M=r.useCallback(n=>C(t=>[...t,n]),[C]),v=r.useCallback(n=>{C(t=>t.filter(e=>e!==n)),O(t=>{const e=new Map(t);return e.delete(n),e})},[O,C]),w=r.useCallback((n,t)=>O(e=>{const s=new Map(e);return s.set(n,t),s}),[O]),y=r.useMemo(()=>({setValue:c,registerOption:M,unregisterOption:v,setOptionProps:w,selectOption:x,deselectOption:b}),[c,M,v,w,x,b]),k=r.useMemo(()=>{if(!o||!i.size)return[];const n=Array.from(i.values()),t=new Map(n.map(e=>[e.value,e]));return d.current.length===0?[]:d.current.map(e=>t.get(e)).filter(Boolean)},[o,i]),R=r.useCallback(n=>g.current.get(n),[]),z=r.useCallback(n=>{const t=a[n];if(t)return R(t)},[R,a]);return r.useMemo(()=>({optionsContext:y,selectedOptionsProps:k,optionIds:a,optionsProps:i,deselectOptionValue:m,indexOfLastSelectedOptionRef:p,getOptionByIndex:z}),[y,m,a,i,k,p,z])};exports.OptionsProvider=P;exports.useCreateOptionsContext=V;exports.useOptionsContext=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),V=r.createContext(null),D=V.Provider,L=()=>{const o=r.useContext(V);if(!o)throw new Error("useOptionsContext must be used within an OptionsProvider");return o},z=o=>Array.isArray(o)?o:o!==void 0?[o]:[],F=(o,u,a)=>{const g=r.useRef(void 0),[c,M]=r.useState(()=>new Map),[i,k]=r.useState(()=>[]),[A,w]=r.useState(()=>new Map),[C,b]=r.useState(()=>new Map),[x,d]=r.useState(()=>[]),O=r.useRef(c);O.current=c;const l=r.useMemo(()=>z(o),[o]),p=r.useRef(l);p.current=l,r.useMemo(()=>{if(!l.length)g.current=void 0;else{const n=l[l.length-1],t=i.map(e=>c.get(e)).findIndex(e=>(e==null?void 0:e.value)===n);g.current=t}},[l,i,c]);const m=r.useCallback(n=>{const t=O.current.get(n),e=t==null?void 0:t.value,s=p.current;t&&e&&u(a?[...s.filter(f=>f!==e),e]:e)},[a,u]),y=r.useCallback(n=>{const t=O.current.get(n),e=t==null?void 0:t.value,s=p.current;if(t&&e)if(a){if(!s.includes(e))return;u(s.filter(f=>f!==e))}else return},[a,u]),B=r.useCallback(n=>{if(!a||n===void 0)return;const e=z(n)[0];if(!e)return;const s=p.current;s.includes(e)&&u(s.filter(f=>f!==e))},[a,u]),v=r.useCallback((n,t)=>{k(e=>[...e,n]),b(e=>{const s=new Map(e);return s.set(n,t),s}),t===null&&d(e=>[...e,{kind:"option",id:n}])},[]),S=r.useCallback(n=>{k(t=>t.filter(e=>e!==n)),M(t=>{const e=new Map(t);return e.delete(n),e}),b(t=>{const e=new Map(t);return e.delete(n),e}),d(t=>t.filter(e=>!(e.kind==="option"&&e.id===n)))},[]),h=r.useCallback((n,t)=>M(e=>{const s=new Map(e);return s.set(n,t),s}),[]),I=r.useCallback(n=>{d(t=>[...t,{kind:"group",id:n}])},[]),P=r.useCallback(n=>{w(t=>{const e=new Map(t);return e.delete(n),e}),d(t=>t.filter(e=>!(e.kind==="group"&&e.id===n)))},[]),G=r.useCallback((n,t)=>w(e=>{const s=new Map(e);return s.set(n,t),s}),[]),E=r.useMemo(()=>({setValue:u,registerOption:v,unregisterOption:S,setOptionProps:h,selectOption:m,deselectOption:y,registerGroup:I,unregisterGroup:P,setGroupProps:G}),[u,v,S,h,m,y,I,P,G]),T=r.useMemo(()=>{if(!o||!c.size)return[];const n=Array.from(c.values()),t=new Map(n.map(e=>[e.value,e]));return p.current.length===0?[]:p.current.map(e=>t.get(e)).filter(Boolean)},[o,c]),R=r.useCallback(n=>O.current.get(n),[]),j=r.useCallback(n=>{const t=i[n];if(t)return R(t)},[R,i]),q=r.useMemo(()=>{const n=new Map;return x.forEach(t=>{t.kind==="group"&&n.set(t.id,[])}),i.forEach(t=>{const e=C.get(t);if(e!=null){const s=n.get(e);s&&s.push(t)}}),n},[x,i,C]);return{optionsContext:E,selectedOptionsProps:T,optionIds:i,optionsProps:c,deselectOptionValue:B,indexOfLastSelectedOptionRef:g,getOptionByIndex:j,structureIds:x,groupsProps:A,optionGroupOf:C,optionIdsByGroup:q}};exports.OptionsProvider=D;exports.useCreateOptionsContext=F;exports.useOptionsContext=L;
@@ -1,11 +1,22 @@
1
1
  import { SelectHTMLAttributes } from 'react';
2
- import { OptionProps } from './Option.types';
2
+ import { OptionGroupProps, OptionProps } from './Option.types';
3
+ export type StructureNode = {
4
+ kind: 'option';
5
+ id: string;
6
+ } | {
7
+ kind: 'group';
8
+ id: string;
9
+ };
3
10
  interface OptionsContextValue {
4
- selectOption: (id: symbol) => void;
5
- deselectOption: (id: symbol) => void;
6
- registerOption: (id: symbol) => void;
7
- unregisterOption: (id: symbol) => void;
8
- setOptionProps: (id: symbol, optionProps: OptionProps) => void;
11
+ selectOption: (id: string) => void;
12
+ deselectOption: (id: string) => void;
13
+ /** Register an Option. Pass `null` for `groupId` when the Option is rendered at the root (not inside any OptionGroup). */
14
+ registerOption: (id: string, groupId: string | null) => void;
15
+ unregisterOption: (id: string) => void;
16
+ setOptionProps: (id: string, optionProps: OptionProps) => void;
17
+ registerGroup: (id: string) => void;
18
+ unregisterGroup: (id: string) => void;
19
+ setGroupProps: (id: string, groupProps: OptionGroupProps) => void;
9
20
  }
10
21
  export declare const OptionsProvider: import('react').Provider<OptionsContextValue | null>;
11
22
  export declare const useOptionsContext: () => OptionsContextValue;
@@ -13,17 +24,24 @@ type ValueType = SelectHTMLAttributes<HTMLSelectElement>['value'];
13
24
  export declare const useCreateOptionsContext: (value: ValueType, setValue: (value: ValueType) => void, multiple: boolean) => {
14
25
  optionsContext: {
15
26
  setValue: (value: ValueType) => void;
16
- registerOption: (id: symbol) => void;
17
- unregisterOption: (id: symbol) => void;
18
- setOptionProps: (id: symbol, optionProps: OptionProps) => void;
19
- selectOption: (id: symbol) => void;
20
- deselectOption: (id: symbol) => void;
27
+ registerOption: (id: string, groupId: string | null) => void;
28
+ unregisterOption: (id: string) => void;
29
+ setOptionProps: (id: string, optionProps: OptionProps) => void;
30
+ selectOption: (id: string) => void;
31
+ deselectOption: (id: string) => void;
32
+ registerGroup: (id: string) => void;
33
+ unregisterGroup: (id: string) => void;
34
+ setGroupProps: (id: string, groupProps: OptionGroupProps) => void;
21
35
  };
22
36
  selectedOptionsProps: OptionProps[];
23
- optionIds: symbol[];
24
- optionsProps: Map<symbol, OptionProps>;
37
+ optionIds: string[];
38
+ optionsProps: Map<string, OptionProps>;
25
39
  deselectOptionValue: (value: ValueType) => void;
26
40
  indexOfLastSelectedOptionRef: import('react').MutableRefObject<number | undefined>;
27
41
  getOptionByIndex: (index: number) => OptionProps | undefined;
42
+ structureIds: StructureNode[];
43
+ groupsProps: Map<string, OptionGroupProps>;
44
+ optionGroupOf: Map<string, string | null>;
45
+ optionIdsByGroup: Map<string, string[]>;
28
46
  };
29
47
  export {};