@eightshift/ui-components 1.3.2 → 1.4.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 (110) hide show
  1. package/dist/{Button-DTARR6Ff.js → Button-uYE9D_E3.js} +6 -5
  2. package/dist/{ColorSwatch-5bZ_yIMB.js → ColorSwatch-Bev-9Vbr.js} +4 -4
  3. package/dist/{Dialog-DJgS0mAg.js → Dialog-CGE2ficT.js} +17 -15
  4. package/dist/{FieldError-CviphIN5.js → FieldError-CBPJ4Xx8.js} +2 -2
  5. package/dist/{FocusScope-BjM5iOQC.js → FocusScope-CVd6C65L.js} +24 -8
  6. package/dist/{GridList-DjRnMEae.js → GridList-PBJsm70G.js} +156 -116
  7. package/dist/{Group-BQu67pVS.js → Group-WZgNv9RE.js} +3 -3
  8. package/dist/Hidden-YSmyVF_5.js +45 -0
  9. package/dist/{Input-DWRQF0ro.js → Input-CaS4qmLb.js} +10 -9
  10. package/dist/{Label-BXvY41yE.js → Label-yZgqvhXc.js} +3 -2
  11. package/dist/ListBox-MZyPpwvj.js +567 -0
  12. package/dist/{Select-49a62830.esm-BnlXlUnT.js → Select-49a62830.esm-CqLHaIei.js} +1 -1
  13. package/dist/{SelectionManager-JxXmb3-k.js → SelectionManager-CvRaua4m.js} +1580 -1484
  14. package/dist/{Separator-CX64zwq8.js → Separator-C7Few7L6.js} +80 -62
  15. package/dist/{Slider-Clme2C36.js → Slider-D8a63VhT.js} +14 -12
  16. package/dist/{Text-qjognpzK.js → Text-D8qh3_U7.js} +1 -1
  17. package/dist/{VisuallyHidden-BZPezMV5.js → VisuallyHidden-DD480kAb.js} +2 -2
  18. package/dist/_commonjsHelpers-CUmg6egw.js +6 -0
  19. package/dist/{ariaHideOutside-BZ5z6iCD.js → ariaHideOutside-BzxkODNq.js} +1 -9
  20. package/dist/assets/style.css +1 -1
  21. package/dist/assets/wp-ui-enhancements.css +1 -1
  22. package/dist/components/animated-visibility/animated-visibility.js +311 -198
  23. package/dist/components/base-control/base-control.js +1 -1
  24. package/dist/components/button/button.js +274 -9
  25. package/dist/components/checkbox/checkbox.js +171 -1
  26. package/dist/components/color-pickers/color-picker.js +1 -1
  27. package/dist/components/color-pickers/color-swatch.js +3 -3
  28. package/dist/components/color-pickers/gradient-editor.js +3 -3
  29. package/dist/components/color-pickers/solid-color-picker.js +46 -32
  30. package/dist/components/component-toggle/component-toggle.js +2 -2
  31. package/dist/components/container-panel/container-panel.js +2 -2
  32. package/dist/components/draggable-list/draggable-list-item.js +3 -3
  33. package/dist/components/draggable-list/draggable-list.js +3671 -6
  34. package/dist/components/expandable/expandable.js +7 -4
  35. package/dist/components/index.js +4 -4
  36. package/dist/components/input-field/input-field.js +7 -7
  37. package/dist/components/link-input/link-input.js +1519 -489
  38. package/dist/components/list-box/list-box.js +2 -2
  39. package/dist/components/matrix-align/matrix-align.js +3 -3
  40. package/dist/components/menu/menu.js +164 -466
  41. package/dist/components/modal/modal.js +7 -7
  42. package/dist/components/number-picker/number-picker.js +22 -17
  43. package/dist/components/option-select/option-select.js +2 -2
  44. package/dist/components/placeholders/file-placeholder.js +1 -1
  45. package/dist/components/popover/popover.js +3 -3
  46. package/dist/components/radio/radio.js +13 -13
  47. package/dist/components/repeater/repeater-context.js +5 -0
  48. package/dist/components/repeater/repeater-item.js +46 -91
  49. package/dist/components/repeater/repeater.js +5130 -175
  50. package/dist/components/responsive/responsive-legacy.js +3 -3
  51. package/dist/components/responsive/responsive.js +3 -3
  52. package/dist/components/responsive-preview/responsive-preview.js +1 -1
  53. package/dist/components/select/async-multi-select.js +3 -3
  54. package/dist/components/select/async-single-select.js +2 -2
  55. package/dist/components/select/custom-select-default-components.js +1 -1
  56. package/dist/components/select/multi-select-components.js +1 -1
  57. package/dist/components/select/multi-select.js +5 -5
  58. package/dist/components/select/react-select-component-wrappers.js +1 -1
  59. package/dist/components/select/single-select.js +2 -2
  60. package/dist/components/select/styles.js +1 -1
  61. package/dist/components/slider/column-config-slider.js +3 -3
  62. package/dist/components/slider/slider.js +3 -3
  63. package/dist/components/slider/utils.js +1 -1
  64. package/dist/components/tabs/tabs.js +46 -71
  65. package/dist/components/toggle/switch.js +6 -6
  66. package/dist/components/toggle/toggle.js +1 -1
  67. package/dist/components/toggle-button/toggle-button.js +7 -7
  68. package/dist/components/tooltip/tooltip.js +3 -3
  69. package/dist/{context-BG_1RnbC.js → context-Bon2Gyx5.js} +1 -1
  70. package/dist/{default-i18n-BqwLkgZv.js → default-i18n-BqWys-1G.js} +1 -1
  71. package/dist/{focusSafely-DGZ4R5fj.js → focusSafely-PMGZgZ9-.js} +33 -26
  72. package/dist/getScrollParent-B3XgpXBL.js +10 -0
  73. package/dist/icons/icons.js +205 -0
  74. package/dist/icons/jsx-svg.js +2 -2
  75. package/dist/{index-CAPcSs9K.js → index-BTCzc3zb.js} +1 -1
  76. package/dist/{index-a301f526.esm-ByOfDxiG.js → index-a301f526.esm-B9tWL9yi.js} +80 -603
  77. package/dist/index.js +4 -4
  78. package/dist/{intlStrings-CkuKCPkT.js → intlStrings-KQxgp5tS.js} +14 -9
  79. package/dist/{multi-select-components-7vKCF8dG.js → multi-select-components-DTvEidE3.js} +1 -1
  80. package/dist/react-jsx-parser.min-CAGfntg1.js +13425 -0
  81. package/dist/{react-select-async.esm-5zW9Dv9E.js → react-select-async.esm-8Rba_3KV.js} +3 -3
  82. package/dist/{react-select.esm-Bi6uzjbT.js → react-select.esm-DkSeQzOP.js} +3 -3
  83. package/dist/{textSelection-BLyBtNe2.js → textSelection-DS7-670U.js} +1 -1
  84. package/dist/{tooltip-DSk8I1SO.js → tooltip-C9mg1CP5.js} +54 -18
  85. package/dist/{useButton-EJ9c8fmq.js → useButton-BPY4yXUo.js} +3 -3
  86. package/dist/{useEvent-Cxq_BzP_.js → useEvent-DDLT851Z.js} +1 -1
  87. package/dist/{useFocusRing-Dg5Y_10S.js → useFocusRing-DsxEaA2J.js} +1 -1
  88. package/dist/{useFocusable-CQZyQp4q.js → useFocusable-BFKHuYS9.js} +2 -2
  89. package/dist/{useFormReset-DJMtIgSL.js → useFormReset-BCPbwfnH.js} +1 -1
  90. package/dist/{useFormValidationState-DDC_nImg.js → useFormValidationState-DC5jbhBW.js} +2 -2
  91. package/dist/{useHasTabbableChild-M3O3VIil.js → useHasTabbableChild-Byd7ylXD.js} +2 -2
  92. package/dist/{useLabel-6NqYraET.js → useLabel-DuJhImKc.js} +2 -2
  93. package/dist/{useLabels-D2RG7TdI.js → useLabels-JaBafrnV.js} +1 -1
  94. package/dist/{useListData-BpYQj7kK.js → useListData-B5Pk32vd.js} +6 -3
  95. package/dist/{useListState-IllYYnXV.js → useListState-Csx05BmT.js} +6 -3
  96. package/dist/{useLocalizedStringFormatter-Cwm_siat.js → useLocalizedStringFormatter-CVIIVTgz.js} +1 -1
  97. package/dist/useMenuTrigger-CMgzyMKW.js +246 -0
  98. package/dist/{useNumberFieldState-CVJOJnF1.js → useNumberFieldState-BVFqhboT.js} +12 -11
  99. package/dist/{useNumberFormatter-DVZRQXk3.js → useNumberFormatter-BEeBSV-N.js} +1 -1
  100. package/dist/{usePress-CiXj8dLE.js → usePress-CY8MpqYD.js} +58 -16
  101. package/dist/useSingleSelectListState-CzZUgAt0.js +37 -0
  102. package/dist/{useToggle-CV-IX6nL.js → useToggle-CJp2Fh_L.js} +4 -4
  103. package/dist/{useToggleState-DHIdITtQ.js → useToggleState-B4--Ski0.js} +1 -1
  104. package/dist/{utils-DC-UMp1n.js → utils-B4IdLYb8.js} +48 -85
  105. package/package.json +24 -21
  106. package/dist/Checkbox-CiJIVbAP.js +0 -174
  107. package/dist/ListBox-DTKMdjQC.js +0 -4216
  108. package/dist/_commonjsHelpers-DWwsNxpa.js +0 -8
  109. package/dist/button-IxfzzzbP.js +0 -277
  110. package/dist/react-jsx-parser.min-DhrYeqLL.js +0 -4563
@@ -0,0 +1,567 @@
1
+ import { c as $880e95eb8b93ba9a$export$ecf600387e221c37, d as $e1995378a142960e$export$18af5c7a9e9b3664, e as $e1995378a142960e$export$bf788dd355e3a401, f as $e1995378a142960e$export$fb8073518f34e6ec, g as $7135fc7d473fd974$export$4feb769f8ddf26c5, h as $7135fc7d473fd974$export$d40e14dec8b060a8 } from "./SelectionManager-CvRaua4m.js";
2
+ import { e as $bdb11010cef70236$export$f680877a34711e37, c as $3ef42575df84b30b$export$9d1611c77c2fe928, k as $bdb11010cef70236$export$b4cc09c592e8fdb8, n as $ff5963eb1fccf552$export$e08e3b67e392101e, l as $df56164dff5785e2$export$4338b53315abf666, b as $64fa3d84918910a7$export$4d86445c2cf5e3, j as $64fa3d84918910a7$export$2881499e37b75b9a, a as $64fa3d84918910a7$export$29f1550f4b0d4415, h as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8 } from "./utils-B4IdLYb8.js";
3
+ import React__default, { createContext, forwardRef, useContext, useCallback, useMemo, useEffect, useRef } from "react";
4
+ import { $ as $982254629710d113$export$b95089534ab7c1fd, a as $453cc9f0df89c0a5$export$77d5aafae4e095b2, b as $325a3faab7a68acd$export$a16aca283550c30d, c as $2a25aae57d74318e$export$a05409b8bb224a5a, d as $431f98aba6844401$export$6615d83f6de245ce, e as $72a5793c14baf454$export$e0e4026c12a8bdbb } from "./Separator-C7Few7L6.js";
5
+ import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "./Text-D8qh3_U7.js";
6
+ import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-EDDcM64A.js";
7
+ import { a as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 } from "./usePress-CY8MpqYD.js";
8
+ import { d as $9ab94262bd0047c7$export$420e68273165f4ec, n as $c87311424ea30a05$export$9ac100e40613ea10, o as $c87311424ea30a05$export$78551043582a6a98, $ as $6179b936705e76d3$export$ae780daf29e6d456, a as $507fabe10e71c6fb$export$b9b3dfddab17db27 } from "./focusSafely-PMGZgZ9-.js";
9
+ import { $ as $d191a55c9702f145$export$8467354a121f1b9f } from "./useLabel-DuJhImKc.js";
10
+ import { $ as $e72dd72e1c76a225$export$2f645645f7bca764 } from "./useListState-Csx05BmT.js";
11
+ import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-Bon2Gyx5.js";
12
+ import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "./useFocusRing-DsxEaA2J.js";
13
+ import { $ as $9bf71ea28793e738$export$20e40289641fbbb6 } from "./FocusScope-CVd6C65L.js";
14
+ const $b1f0cad8af73213b$export$3585ede4d035bf14 = /* @__PURE__ */ new WeakMap();
15
+ function $b1f0cad8af73213b$var$normalizeKey(key) {
16
+ if (typeof key === "string") return key.replace(/\s*/g, "");
17
+ return "" + key;
18
+ }
19
+ function $b1f0cad8af73213b$export$9145995848b05025(state, itemKey) {
20
+ let data = $b1f0cad8af73213b$export$3585ede4d035bf14.get(state);
21
+ if (!data) throw new Error("Unknown list");
22
+ return `${data.id}-option-${$b1f0cad8af73213b$var$normalizeKey(itemKey)}`;
23
+ }
24
+ function $c132121280ec012d$export$50eacbbf140a3141(props, state, ref) {
25
+ let domProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
26
+ labelable: true
27
+ });
28
+ let selectionBehavior = props.selectionBehavior || "toggle";
29
+ let linkBehavior = props.linkBehavior || (selectionBehavior === "replace" ? "action" : "override");
30
+ if (selectionBehavior === "toggle" && linkBehavior === "action")
31
+ linkBehavior = "override";
32
+ let { listProps } = $982254629710d113$export$b95089534ab7c1fd({
33
+ ...props,
34
+ ref,
35
+ selectionManager: state.selectionManager,
36
+ collection: state.collection,
37
+ disabledKeys: state.disabledKeys,
38
+ linkBehavior
39
+ });
40
+ let { focusWithinProps } = $9ab94262bd0047c7$export$420e68273165f4ec({
41
+ onFocusWithin: props.onFocus,
42
+ onBlurWithin: props.onBlur,
43
+ onFocusWithinChange: props.onFocusChange
44
+ });
45
+ let id = $bdb11010cef70236$export$f680877a34711e37(props.id);
46
+ $b1f0cad8af73213b$export$3585ede4d035bf14.set(state, {
47
+ id,
48
+ shouldUseVirtualFocus: props.shouldUseVirtualFocus,
49
+ shouldSelectOnPressUp: props.shouldSelectOnPressUp,
50
+ shouldFocusOnHover: props.shouldFocusOnHover,
51
+ isVirtualized: props.isVirtualized,
52
+ onAction: props.onAction,
53
+ linkBehavior
54
+ });
55
+ let { labelProps, fieldProps } = $d191a55c9702f145$export$8467354a121f1b9f({
56
+ ...props,
57
+ id,
58
+ // listbox is not an HTML input element so it
59
+ // shouldn't be labeled by a <label> element.
60
+ labelElementType: "span"
61
+ });
62
+ return {
63
+ labelProps,
64
+ listBoxProps: $3ef42575df84b30b$export$9d1611c77c2fe928(domProps, focusWithinProps, state.selectionManager.selectionMode === "multiple" ? {
65
+ "aria-multiselectable": "true"
66
+ } : {}, {
67
+ role: "listbox",
68
+ ...$3ef42575df84b30b$export$9d1611c77c2fe928(fieldProps, listProps)
69
+ })
70
+ };
71
+ }
72
+ function $293f70390ea03370$export$497855f14858aa34(props, state, ref) {
73
+ var _item_props, _item_props1;
74
+ let { key } = props;
75
+ let data = $b1f0cad8af73213b$export$3585ede4d035bf14.get(state);
76
+ var _props_isDisabled;
77
+ let isDisabled = (_props_isDisabled = props.isDisabled) !== null && _props_isDisabled !== void 0 ? _props_isDisabled : state.selectionManager.isDisabled(key);
78
+ var _props_isSelected;
79
+ let isSelected = (_props_isSelected = props.isSelected) !== null && _props_isSelected !== void 0 ? _props_isSelected : state.selectionManager.isSelected(key);
80
+ var _props_shouldSelectOnPressUp;
81
+ let shouldSelectOnPressUp = (_props_shouldSelectOnPressUp = props.shouldSelectOnPressUp) !== null && _props_shouldSelectOnPressUp !== void 0 ? _props_shouldSelectOnPressUp : data === null || data === void 0 ? void 0 : data.shouldSelectOnPressUp;
82
+ var _props_shouldFocusOnHover;
83
+ let shouldFocusOnHover = (_props_shouldFocusOnHover = props.shouldFocusOnHover) !== null && _props_shouldFocusOnHover !== void 0 ? _props_shouldFocusOnHover : data === null || data === void 0 ? void 0 : data.shouldFocusOnHover;
84
+ var _props_shouldUseVirtualFocus;
85
+ let shouldUseVirtualFocus = (_props_shouldUseVirtualFocus = props.shouldUseVirtualFocus) !== null && _props_shouldUseVirtualFocus !== void 0 ? _props_shouldUseVirtualFocus : data === null || data === void 0 ? void 0 : data.shouldUseVirtualFocus;
86
+ var _props_isVirtualized;
87
+ let isVirtualized = (_props_isVirtualized = props.isVirtualized) !== null && _props_isVirtualized !== void 0 ? _props_isVirtualized : data === null || data === void 0 ? void 0 : data.isVirtualized;
88
+ let labelId = $bdb11010cef70236$export$b4cc09c592e8fdb8();
89
+ let descriptionId = $bdb11010cef70236$export$b4cc09c592e8fdb8();
90
+ let optionProps = {
91
+ role: "option",
92
+ "aria-disabled": isDisabled || void 0,
93
+ "aria-selected": state.selectionManager.selectionMode !== "none" ? isSelected : void 0
94
+ };
95
+ if (!($c87311424ea30a05$export$9ac100e40613ea10() && $c87311424ea30a05$export$78551043582a6a98())) {
96
+ optionProps["aria-label"] = props["aria-label"];
97
+ optionProps["aria-labelledby"] = labelId;
98
+ optionProps["aria-describedby"] = descriptionId;
99
+ }
100
+ let item = state.collection.getItem(key);
101
+ if (isVirtualized) {
102
+ let index = Number(item === null || item === void 0 ? void 0 : item.index);
103
+ optionProps["aria-posinset"] = Number.isNaN(index) ? void 0 : index + 1;
104
+ optionProps["aria-setsize"] = $453cc9f0df89c0a5$export$77d5aafae4e095b2(state.collection);
105
+ }
106
+ let onAction = (data === null || data === void 0 ? void 0 : data.onAction) ? () => {
107
+ var _data_onAction;
108
+ return data === null || data === void 0 ? void 0 : (_data_onAction = data.onAction) === null || _data_onAction === void 0 ? void 0 : _data_onAction.call(data, key);
109
+ } : void 0;
110
+ let { itemProps, isPressed, isFocused, hasAction, allowsSelection } = $880e95eb8b93ba9a$export$ecf600387e221c37({
111
+ selectionManager: state.selectionManager,
112
+ key,
113
+ ref,
114
+ shouldSelectOnPressUp,
115
+ allowsDifferentPressOrigin: shouldSelectOnPressUp && shouldFocusOnHover,
116
+ isVirtualized,
117
+ shouldUseVirtualFocus,
118
+ isDisabled,
119
+ onAction: onAction || (item === null || item === void 0 ? void 0 : (_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.onAction) ? $ff5963eb1fccf552$export$e08e3b67e392101e(item === null || item === void 0 ? void 0 : (_item_props1 = item.props) === null || _item_props1 === void 0 ? void 0 : _item_props1.onAction, onAction) : void 0,
120
+ linkBehavior: data === null || data === void 0 ? void 0 : data.linkBehavior
121
+ });
122
+ let { hoverProps } = $6179b936705e76d3$export$ae780daf29e6d456({
123
+ isDisabled: isDisabled || !shouldFocusOnHover,
124
+ onHoverStart() {
125
+ if (!$507fabe10e71c6fb$export$b9b3dfddab17db27()) {
126
+ state.selectionManager.setFocused(true);
127
+ state.selectionManager.setFocusedKey(key);
128
+ }
129
+ }
130
+ });
131
+ let domProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(item === null || item === void 0 ? void 0 : item.props);
132
+ delete domProps.id;
133
+ let linkProps = $ea8dcbcb9ea1b556$export$7e924b3091a3bd18(item === null || item === void 0 ? void 0 : item.props);
134
+ return {
135
+ optionProps: {
136
+ ...optionProps,
137
+ ...$3ef42575df84b30b$export$9d1611c77c2fe928(domProps, itemProps, hoverProps, linkProps),
138
+ id: $b1f0cad8af73213b$export$9145995848b05025(state, key)
139
+ },
140
+ labelProps: {
141
+ id: labelId
142
+ },
143
+ descriptionProps: {
144
+ id: descriptionId
145
+ },
146
+ isFocused,
147
+ isFocusVisible: isFocused && $507fabe10e71c6fb$export$b9b3dfddab17db27(),
148
+ isSelected,
149
+ isDisabled,
150
+ isPressed,
151
+ allowsSelection,
152
+ hasAction
153
+ };
154
+ }
155
+ function $af383d3bef1cfdc9$export$c3f9f39876e4bc7(props) {
156
+ let { heading, "aria-label": ariaLabel } = props;
157
+ let headingId = $bdb11010cef70236$export$f680877a34711e37();
158
+ return {
159
+ itemProps: {
160
+ role: "presentation"
161
+ },
162
+ headingProps: heading ? {
163
+ // Techincally, listbox cannot contain headings according to ARIA.
164
+ // We hide the heading from assistive technology, using role="presentation",
165
+ // and only use it as a visual label for the nested group.
166
+ id: headingId,
167
+ role: "presentation"
168
+ } : {},
169
+ groupProps: {
170
+ role: "group",
171
+ "aria-label": ariaLabel,
172
+ "aria-labelledby": heading ? headingId : void 0
173
+ }
174
+ };
175
+ }
176
+ const $612b8eb6cb90e02d$export$d188a835a7bc5783 = /* @__PURE__ */ createContext({});
177
+ const $612b8eb6cb90e02d$export$f55761759794cf55 = /* @__PURE__ */ createContext(null);
178
+ function $612b8eb6cb90e02d$var$DropIndicator(props, ref) {
179
+ let { render } = useContext($612b8eb6cb90e02d$export$f55761759794cf55);
180
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, render(props, ref));
181
+ }
182
+ const $612b8eb6cb90e02d$export$62ed72bc21f6b8a6 = /* @__PURE__ */ forwardRef($612b8eb6cb90e02d$var$DropIndicator);
183
+ function $612b8eb6cb90e02d$export$971707d8a129a1f7(dragAndDropHooks, dropState) {
184
+ var _dragAndDropHooks_isVirtualDragging;
185
+ let renderDropIndicator = dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.renderDropIndicator;
186
+ let isVirtualDragging = dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : (_dragAndDropHooks_isVirtualDragging = dragAndDropHooks.isVirtualDragging) === null || _dragAndDropHooks_isVirtualDragging === void 0 ? void 0 : _dragAndDropHooks_isVirtualDragging.call(dragAndDropHooks);
187
+ let fn = useCallback((target) => {
188
+ if (isVirtualDragging || (dropState === null || dropState === void 0 ? void 0 : dropState.isDropTarget(target))) return renderDropIndicator ? renderDropIndicator(target) : /* @__PURE__ */ React__default.createElement($612b8eb6cb90e02d$export$62ed72bc21f6b8a6, {
189
+ target
190
+ });
191
+ }, [
192
+ dropState === null || dropState === void 0 ? void 0 : dropState.target,
193
+ isVirtualDragging,
194
+ renderDropIndicator
195
+ ]);
196
+ return (dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDropIndicator) ? fn : void 0;
197
+ }
198
+ function $612b8eb6cb90e02d$export$d1e8e3fbb7461f6(selectionManager, dragAndDropHooks, dropState) {
199
+ var _dragAndDropHooks_isVirtualDragging, _dropState_target;
200
+ let focusedKey = selectionManager.focusedKey;
201
+ let dropTargetKey = null;
202
+ if ((dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : (_dragAndDropHooks_isVirtualDragging = dragAndDropHooks.isVirtualDragging) === null || _dragAndDropHooks_isVirtualDragging === void 0 ? void 0 : _dragAndDropHooks_isVirtualDragging.call(dragAndDropHooks)) && (dropState === null || dropState === void 0 ? void 0 : (_dropState_target = dropState.target) === null || _dropState_target === void 0 ? void 0 : _dropState_target.type) === "item") {
203
+ dropTargetKey = dropState.target.key;
204
+ var _dropState_collection_getKeyAfter;
205
+ if (dropState.target.dropPosition === "after")
206
+ dropTargetKey = (_dropState_collection_getKeyAfter = dropState.collection.getKeyAfter(dropTargetKey)) !== null && _dropState_collection_getKeyAfter !== void 0 ? _dropState_collection_getKeyAfter : dropTargetKey;
207
+ }
208
+ return useMemo(() => {
209
+ return new Set([
210
+ focusedKey,
211
+ dropTargetKey
212
+ ].filter((k) => k !== null));
213
+ }, [
214
+ focusedKey,
215
+ dropTargetKey
216
+ ]);
217
+ }
218
+ const $eed445e0843c11d0$export$7ff8f37d2d81a48d = /* @__PURE__ */ createContext(null);
219
+ const $eed445e0843c11d0$export$7c5906fe4f1f2af2 = /* @__PURE__ */ createContext(null);
220
+ function $eed445e0843c11d0$var$ListBox(props, ref) {
221
+ [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $eed445e0843c11d0$export$7ff8f37d2d81a48d);
222
+ let state = useContext($eed445e0843c11d0$export$7c5906fe4f1f2af2);
223
+ if (state) return /* @__PURE__ */ React__default.createElement($eed445e0843c11d0$var$ListBoxInner, {
224
+ state,
225
+ props,
226
+ listBoxRef: ref
227
+ });
228
+ return /* @__PURE__ */ React__default.createElement($e1995378a142960e$export$bf788dd355e3a401, {
229
+ content: /* @__PURE__ */ React__default.createElement($e1995378a142960e$export$fb8073518f34e6ec, props)
230
+ }, (collection) => /* @__PURE__ */ React__default.createElement($eed445e0843c11d0$var$StandaloneListBox, {
231
+ props,
232
+ listBoxRef: ref,
233
+ collection
234
+ }));
235
+ }
236
+ function $eed445e0843c11d0$var$StandaloneListBox({ props, listBoxRef, collection }) {
237
+ props = {
238
+ ...props,
239
+ collection,
240
+ children: null,
241
+ items: null
242
+ };
243
+ let state = $e72dd72e1c76a225$export$2f645645f7bca764(props);
244
+ return /* @__PURE__ */ React__default.createElement($eed445e0843c11d0$var$ListBoxInner, {
245
+ state,
246
+ props,
247
+ listBoxRef
248
+ });
249
+ }
250
+ const $eed445e0843c11d0$export$41f133550aa26f48 = /* @__PURE__ */ forwardRef($eed445e0843c11d0$var$ListBox);
251
+ function $eed445e0843c11d0$var$ListBoxInner({ state, props, listBoxRef }) {
252
+ let { dragAndDropHooks, layout = "stack", orientation = "vertical" } = props;
253
+ let { collection, selectionManager } = state;
254
+ let isListDraggable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDraggableCollectionState);
255
+ let isListDroppable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDroppableCollectionState);
256
+ let { direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
257
+ let { disabledBehavior, disabledKeys } = selectionManager;
258
+ let collator = $325a3faab7a68acd$export$a16aca283550c30d({
259
+ usage: "search",
260
+ sensitivity: "base"
261
+ });
262
+ let { isVirtualized, layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate, CollectionRoot } = useContext($7135fc7d473fd974$export$4feb769f8ddf26c5);
263
+ let keyboardDelegate = useMemo(() => props.keyboardDelegate || new $2a25aae57d74318e$export$a05409b8bb224a5a({
264
+ collection,
265
+ collator,
266
+ ref: listBoxRef,
267
+ disabledKeys,
268
+ disabledBehavior,
269
+ layout,
270
+ orientation,
271
+ direction,
272
+ layoutDelegate
273
+ }), [
274
+ collection,
275
+ collator,
276
+ listBoxRef,
277
+ disabledBehavior,
278
+ disabledKeys,
279
+ orientation,
280
+ direction,
281
+ props.keyboardDelegate,
282
+ layout,
283
+ layoutDelegate
284
+ ]);
285
+ let { listBoxProps } = $c132121280ec012d$export$50eacbbf140a3141({
286
+ ...props,
287
+ shouldSelectOnPressUp: isListDraggable || props.shouldSelectOnPressUp,
288
+ keyboardDelegate,
289
+ isVirtualized
290
+ }, state, listBoxRef);
291
+ let dragHooksProvided = useRef(isListDraggable);
292
+ let dropHooksProvided = useRef(isListDroppable);
293
+ useEffect(() => {
294
+ if (dragHooksProvided.current !== isListDraggable) console.warn("Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.");
295
+ if (dropHooksProvided.current !== isListDroppable) console.warn("Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.");
296
+ }, [
297
+ isListDraggable,
298
+ isListDroppable
299
+ ]);
300
+ let dragState = void 0;
301
+ let dropState = void 0;
302
+ let droppableCollection = void 0;
303
+ let isRootDropTarget = false;
304
+ let dragPreview = null;
305
+ let preview = useRef(null);
306
+ if (isListDraggable && dragAndDropHooks) {
307
+ dragState = dragAndDropHooks.useDraggableCollectionState({
308
+ collection,
309
+ selectionManager,
310
+ preview: dragAndDropHooks.renderDragPreview ? preview : void 0
311
+ });
312
+ dragAndDropHooks.useDraggableCollection({}, dragState, listBoxRef);
313
+ let DragPreview = dragAndDropHooks.DragPreview;
314
+ dragPreview = dragAndDropHooks.renderDragPreview ? /* @__PURE__ */ React__default.createElement(DragPreview, {
315
+ ref: preview
316
+ }, dragAndDropHooks.renderDragPreview) : null;
317
+ }
318
+ if (isListDroppable && dragAndDropHooks) {
319
+ dropState = dragAndDropHooks.useDroppableCollectionState({
320
+ collection,
321
+ selectionManager
322
+ });
323
+ let dropTargetDelegate = dragAndDropHooks.dropTargetDelegate || ctxDropTargetDelegate || new dragAndDropHooks.ListDropTargetDelegate(collection, listBoxRef, {
324
+ orientation,
325
+ layout,
326
+ direction
327
+ });
328
+ droppableCollection = dragAndDropHooks.useDroppableCollection({
329
+ keyboardDelegate,
330
+ dropTargetDelegate
331
+ }, dropState, listBoxRef);
332
+ isRootDropTarget = dropState.isDropTarget({
333
+ type: "root"
334
+ });
335
+ }
336
+ let { focusProps, isFocused, isFocusVisible } = $f7dceffc5ad7768b$export$4e328f61c538687f();
337
+ let renderValues = {
338
+ isDropTarget: isRootDropTarget,
339
+ isEmpty: state.collection.size === 0,
340
+ isFocused,
341
+ isFocusVisible,
342
+ layout: props.layout || "stack",
343
+ state
344
+ };
345
+ let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
346
+ className: props.className,
347
+ style: props.style,
348
+ defaultClassName: "react-aria-ListBox",
349
+ values: renderValues
350
+ });
351
+ let emptyState = null;
352
+ if (state.collection.size === 0 && props.renderEmptyState) emptyState = /* @__PURE__ */ React__default.createElement("div", {
353
+ // eslint-disable-next-line
354
+ role: "option",
355
+ style: {
356
+ display: "contents"
357
+ }
358
+ }, props.renderEmptyState(renderValues));
359
+ return /* @__PURE__ */ React__default.createElement($9bf71ea28793e738$export$20e40289641fbbb6, null, /* @__PURE__ */ React__default.createElement("div", {
360
+ ...$65484d02dcb7eb3e$export$457c3d6518dd4c6f(props),
361
+ ...$3ef42575df84b30b$export$9d1611c77c2fe928(listBoxProps, focusProps, droppableCollection === null || droppableCollection === void 0 ? void 0 : droppableCollection.collectionProps),
362
+ ...renderProps,
363
+ ref: listBoxRef,
364
+ slot: props.slot || void 0,
365
+ onScroll: props.onScroll,
366
+ "data-drop-target": isRootDropTarget || void 0,
367
+ "data-empty": state.collection.size === 0 || void 0,
368
+ "data-focused": isFocused || void 0,
369
+ "data-focus-visible": isFocusVisible || void 0,
370
+ "data-layout": props.layout || "stack",
371
+ "data-orientation": props.orientation || "vertical"
372
+ }, /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
373
+ values: [
374
+ [
375
+ $eed445e0843c11d0$export$7ff8f37d2d81a48d,
376
+ props
377
+ ],
378
+ [
379
+ $eed445e0843c11d0$export$7c5906fe4f1f2af2,
380
+ state
381
+ ],
382
+ [
383
+ $612b8eb6cb90e02d$export$d188a835a7bc5783,
384
+ {
385
+ dragAndDropHooks,
386
+ dragState,
387
+ dropState
388
+ }
389
+ ],
390
+ [
391
+ $431f98aba6844401$export$6615d83f6de245ce,
392
+ {
393
+ elementType: "div"
394
+ }
395
+ ],
396
+ [
397
+ $612b8eb6cb90e02d$export$f55761759794cf55,
398
+ {
399
+ render: $eed445e0843c11d0$var$ListBoxDropIndicatorWrapper
400
+ }
401
+ ],
402
+ [
403
+ $7135fc7d473fd974$export$d40e14dec8b060a8,
404
+ {
405
+ render: $eed445e0843c11d0$var$ListBoxSection
406
+ }
407
+ ]
408
+ ]
409
+ }, /* @__PURE__ */ React__default.createElement(CollectionRoot, {
410
+ collection,
411
+ scrollRef: listBoxRef,
412
+ persistedKeys: $612b8eb6cb90e02d$export$d1e8e3fbb7461f6(selectionManager, dragAndDropHooks, dropState),
413
+ renderDropIndicator: $612b8eb6cb90e02d$export$971707d8a129a1f7(dragAndDropHooks, dropState)
414
+ })), emptyState, dragPreview));
415
+ }
416
+ function $eed445e0843c11d0$var$ListBoxSection(props, ref, section) {
417
+ let state = useContext($eed445e0843c11d0$export$7c5906fe4f1f2af2);
418
+ let { dragAndDropHooks, dropState } = useContext($612b8eb6cb90e02d$export$d188a835a7bc5783);
419
+ let { CollectionBranch } = useContext($7135fc7d473fd974$export$4feb769f8ddf26c5);
420
+ let [headingRef, heading] = $64fa3d84918910a7$export$9d4c57ee4c6ffdd8();
421
+ var _props_arialabel;
422
+ let { headingProps, groupProps } = $af383d3bef1cfdc9$export$c3f9f39876e4bc7({
423
+ heading,
424
+ "aria-label": (_props_arialabel = props["aria-label"]) !== null && _props_arialabel !== void 0 ? _props_arialabel : void 0
425
+ });
426
+ let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
427
+ defaultClassName: "react-aria-Section",
428
+ className: props.className,
429
+ style: props.style,
430
+ values: {}
431
+ });
432
+ return /* @__PURE__ */ React__default.createElement("section", {
433
+ ...$65484d02dcb7eb3e$export$457c3d6518dd4c6f(props),
434
+ ...groupProps,
435
+ ...renderProps,
436
+ ref
437
+ }, /* @__PURE__ */ React__default.createElement($72a5793c14baf454$export$e0e4026c12a8bdbb.Provider, {
438
+ value: {
439
+ ...headingProps,
440
+ ref: headingRef
441
+ }
442
+ }, /* @__PURE__ */ React__default.createElement(CollectionBranch, {
443
+ collection: state.collection,
444
+ parent: section,
445
+ renderDropIndicator: $612b8eb6cb90e02d$export$971707d8a129a1f7(dragAndDropHooks, dropState)
446
+ })));
447
+ }
448
+ const $eed445e0843c11d0$export$a11e76429ed99b4 = /* @__PURE__ */ $e1995378a142960e$export$18af5c7a9e9b3664("item", function ListBoxItem(props, forwardedRef, item) {
449
+ let ref = $df56164dff5785e2$export$4338b53315abf666(forwardedRef);
450
+ let state = useContext($eed445e0843c11d0$export$7c5906fe4f1f2af2);
451
+ let { dragAndDropHooks, dragState, dropState } = useContext($612b8eb6cb90e02d$export$d188a835a7bc5783);
452
+ let { optionProps, labelProps, descriptionProps, ...states } = $293f70390ea03370$export$497855f14858aa34({
453
+ key: item.key,
454
+ "aria-label": props === null || props === void 0 ? void 0 : props["aria-label"]
455
+ }, state, ref);
456
+ let { hoverProps, isHovered } = $6179b936705e76d3$export$ae780daf29e6d456({
457
+ isDisabled: !states.allowsSelection && !states.hasAction,
458
+ onHoverStart: item.props.onHoverStart,
459
+ onHoverChange: item.props.onHoverChange,
460
+ onHoverEnd: item.props.onHoverEnd
461
+ });
462
+ let draggableItem = null;
463
+ if (dragState && dragAndDropHooks) draggableItem = dragAndDropHooks.useDraggableItem({
464
+ key: item.key
465
+ }, dragState);
466
+ let droppableItem = null;
467
+ if (dropState && dragAndDropHooks) droppableItem = dragAndDropHooks.useDroppableItem({
468
+ target: {
469
+ type: "item",
470
+ key: item.key,
471
+ dropPosition: "on"
472
+ }
473
+ }, dropState, ref);
474
+ let isDragging = dragState && dragState.isDragging(item.key);
475
+ let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
476
+ ...props,
477
+ id: void 0,
478
+ children: props.children,
479
+ defaultClassName: "react-aria-ListBoxItem",
480
+ values: {
481
+ ...states,
482
+ isHovered,
483
+ selectionMode: state.selectionManager.selectionMode,
484
+ selectionBehavior: state.selectionManager.selectionBehavior,
485
+ allowsDragging: !!dragState,
486
+ isDragging,
487
+ isDropTarget: droppableItem === null || droppableItem === void 0 ? void 0 : droppableItem.isDropTarget
488
+ }
489
+ });
490
+ useEffect(() => {
491
+ if (!item.textValue) console.warn("A `textValue` prop is required for <ListBoxItem> elements with non-plain text children in order to support accessibility features such as type to select.");
492
+ }, [
493
+ item.textValue
494
+ ]);
495
+ let ElementType = props.href ? "a" : "div";
496
+ return /* @__PURE__ */ React__default.createElement(ElementType, {
497
+ ...$3ef42575df84b30b$export$9d1611c77c2fe928(optionProps, hoverProps, draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragProps, droppableItem === null || droppableItem === void 0 ? void 0 : droppableItem.dropProps),
498
+ ...renderProps,
499
+ ref,
500
+ "data-allows-dragging": !!dragState || void 0,
501
+ "data-selected": states.isSelected || void 0,
502
+ "data-disabled": states.isDisabled || void 0,
503
+ "data-hovered": isHovered || void 0,
504
+ "data-focused": states.isFocused || void 0,
505
+ "data-focus-visible": states.isFocusVisible || void 0,
506
+ "data-pressed": states.isPressed || void 0,
507
+ "data-dragging": isDragging || void 0,
508
+ "data-drop-target": (droppableItem === null || droppableItem === void 0 ? void 0 : droppableItem.isDropTarget) || void 0,
509
+ "data-selection-mode": state.selectionManager.selectionMode === "none" ? void 0 : state.selectionManager.selectionMode
510
+ }, /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
511
+ values: [
512
+ [
513
+ $514c0188e459b4c0$export$9afb8bc826b033ea,
514
+ {
515
+ slots: {
516
+ label: labelProps,
517
+ description: descriptionProps
518
+ }
519
+ }
520
+ ]
521
+ ]
522
+ }, renderProps.children));
523
+ });
524
+ function $eed445e0843c11d0$var$ListBoxDropIndicatorWrapper(props, ref) {
525
+ ref = $df56164dff5785e2$export$4338b53315abf666(ref);
526
+ let { dragAndDropHooks, dropState } = useContext($612b8eb6cb90e02d$export$d188a835a7bc5783);
527
+ let { dropIndicatorProps, isHidden, isDropTarget } = dragAndDropHooks.useDropIndicator(props, dropState, ref);
528
+ if (isHidden) return null;
529
+ return /* @__PURE__ */ React__default.createElement($eed445e0843c11d0$var$ListBoxDropIndicatorForwardRef, {
530
+ ...props,
531
+ dropIndicatorProps,
532
+ isDropTarget,
533
+ ref
534
+ });
535
+ }
536
+ function $eed445e0843c11d0$var$ListBoxDropIndicator(props, ref) {
537
+ let { dropIndicatorProps, isDropTarget, ...otherProps } = props;
538
+ let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
539
+ ...otherProps,
540
+ defaultClassName: "react-aria-DropIndicator",
541
+ values: {
542
+ isDropTarget
543
+ }
544
+ });
545
+ return /* @__PURE__ */ React__default.createElement("div", {
546
+ ...dropIndicatorProps,
547
+ ...renderProps,
548
+ // eslint-disable-next-line
549
+ role: "option",
550
+ ref,
551
+ "data-drop-target": isDropTarget || void 0
552
+ });
553
+ }
554
+ const $eed445e0843c11d0$var$ListBoxDropIndicatorForwardRef = /* @__PURE__ */ forwardRef($eed445e0843c11d0$var$ListBoxDropIndicator);
555
+ export {
556
+ $eed445e0843c11d0$export$41f133550aa26f48 as $,
557
+ $eed445e0843c11d0$export$a11e76429ed99b4 as a,
558
+ $b1f0cad8af73213b$export$3585ede4d035bf14 as b,
559
+ $b1f0cad8af73213b$export$9145995848b05025 as c,
560
+ $eed445e0843c11d0$export$7ff8f37d2d81a48d as d,
561
+ $eed445e0843c11d0$export$7c5906fe4f1f2af2 as e,
562
+ $612b8eb6cb90e02d$export$d188a835a7bc5783 as f,
563
+ $612b8eb6cb90e02d$export$f55761759794cf55 as g,
564
+ $612b8eb6cb90e02d$export$d1e8e3fbb7461f6 as h,
565
+ $612b8eb6cb90e02d$export$971707d8a129a1f7 as i,
566
+ $612b8eb6cb90e02d$export$62ed72bc21f6b8a6 as j
567
+ };
@@ -1,4 +1,4 @@
1
- import { a as _objectWithoutProperties, b as _slicedToArray, d as _objectSpread2, t as toPropertyKey, f as _typeof, g as _arrayLikeToArray, i as _unsupportedIterableToArray, j as isTouchCapable, k as isMobileDevice, m as multiValueAsValue, s as singleValueAsValue, v as valueTernary, l as classNames, n as defaultComponents, o as isDocumentElement, p as cleanValue, q as scrollIntoView, _ as _extends, r as noop, M as MenuPlacer, u as removeProps, w as jsx, x as css, y as clearIndicatorCSS, z as containerCSS, A as css$1, B as dropdownIndicatorCSS, C as groupCSS, D as groupHeadingCSS, E as indicatorsContainerCSS, F as indicatorSeparatorCSS, G as inputCSS, H as loadingIndicatorCSS, I as loadingMessageCSS, J as menuCSS, K as menuListCSS, L as menuPortalCSS, N as multiValueCSS, O as multiValueLabelCSS, P as multiValueRemoveCSS, Q as noOptionsMessageCSS, R as optionCSS, S as placeholderCSS, T as css$2, U as valueContainerCSS, V as notNullish, W as supportsPassiveEvents } from "./index-a301f526.esm-ByOfDxiG.js";
1
+ import { a as _objectWithoutProperties, b as _slicedToArray, d as _objectSpread2, t as toPropertyKey, f as _typeof, g as _arrayLikeToArray, i as _unsupportedIterableToArray, j as isTouchCapable, k as isMobileDevice, m as multiValueAsValue, s as singleValueAsValue, v as valueTernary, l as classNames, n as defaultComponents, o as isDocumentElement, p as cleanValue, q as scrollIntoView, _ as _extends, r as noop, M as MenuPlacer, u as removeProps, w as jsx, x as css, y as clearIndicatorCSS, z as containerCSS, A as css$1, B as dropdownIndicatorCSS, C as groupCSS, D as groupHeadingCSS, E as indicatorsContainerCSS, F as indicatorSeparatorCSS, G as inputCSS, H as loadingIndicatorCSS, I as loadingMessageCSS, J as menuCSS, K as menuListCSS, L as menuPortalCSS, N as multiValueCSS, O as multiValueLabelCSS, P as multiValueRemoveCSS, Q as noOptionsMessageCSS, R as optionCSS, S as placeholderCSS, T as css$2, U as valueContainerCSS, V as notNullish, W as supportsPassiveEvents } from "./index-a301f526.esm-B9tWL9yi.js";
2
2
  import * as React from "react";
3
3
  import { useState, useCallback, Component, Fragment, useMemo, useRef, useEffect } from "react";
4
4
  var _excluded$1 = ["defaultInputValue", "defaultMenuIsOpen", "defaultValue", "inputValue", "menuIsOpen", "onChange", "onInputChange", "onMenuClose", "onMenuOpen", "value"];