@eightshift/ui-components 7.2.0 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/dist/Autocomplete-pLMPWMFq.js +451 -0
  2. package/dist/Button-Biwg7zwt.js +223 -0
  3. package/dist/Dialog-C1sh8jbh.js +2474 -0
  4. package/dist/{Disclosure-NYWFw9RJ.js → Disclosure-B_SHgiUz.js} +50 -51
  5. package/dist/FocusScope-lGkM8AO8.js +734 -0
  6. package/dist/Form-BxIJCHYd.js +5 -0
  7. package/dist/Heading-B2EsUuu6.js +16 -0
  8. package/dist/{Hidden-8TB37dpK.js → Hidden-DYY00jLm.js} +10 -10
  9. package/dist/I18nProvider-Cm6dj5jY.js +93 -0
  10. package/dist/Label-B1TkoVOG.js +17 -0
  11. package/dist/ListBox-BquE0m8z.js +584 -0
  12. package/dist/{NumberFormatter-m5VW6MTK.js → NumberFormatter-JHF0Tadk.js} +24 -26
  13. package/dist/PortalProvider-BYcv24il.js +13 -0
  14. package/dist/RadioGroup-BxjLooWU.js +324 -0
  15. package/dist/SearchField-BkAU0HLm.js +322 -0
  16. package/dist/SelectionIndicator-Bx_EYBXD.js +13 -0
  17. package/dist/{Slider-DW1RuMVp.js → Slider-DSv6fyZ6.js} +321 -363
  18. package/dist/Text-C8pfwn0W.js +16 -0
  19. package/dist/{VisuallyHidden-CfsnJHZb.js → VisuallyHidden-KcXlGa5p.js} +12 -12
  20. package/dist/{animation-Bd2peown.js → animation-BJ-2VKdB.js} +12 -12
  21. package/dist/assets/fonts/google-sans-flex-latin-ext-full-normal.woff2 +0 -0
  22. package/dist/assets/fonts/google-sans-flex-latin-full-normal.woff2 +0 -0
  23. package/dist/assets/fonts/google-sans-flex-symbols-full-normal.woff2 +0 -0
  24. package/dist/assets/style-admin.css +1 -1
  25. package/dist/assets/style-editor.css +1 -1
  26. package/dist/assets/style.css +1 -1
  27. package/dist/{button-D9cbyHeZ.js → button-CawAzlko.js} +21 -73
  28. package/dist/{checkbox-BO5RZmO8.js → checkbox-t7VrqXv2.js} +59 -62
  29. package/dist/{color-swatch-D2ZBkuTt.js → color-swatch-gU09x9Ga.js} +417 -414
  30. package/dist/components/base-control/base-control.js +2 -2
  31. package/dist/components/base-control/container.js +1 -1
  32. package/dist/components/breakpoint-preview/breakpoint-preview.js +1 -1
  33. package/dist/components/button/button.js +1 -1
  34. package/dist/components/checkbox/checkbox.js +1 -1
  35. package/dist/components/color-pickers/color-picker.js +2 -2
  36. package/dist/components/color-pickers/color-swatch.js +1 -1
  37. package/dist/components/color-pickers/gradient-editor.js +1 -1
  38. package/dist/components/color-pickers/solid-color-picker.js +1 -1
  39. package/dist/components/component-toggle/component-toggle.js +4 -4
  40. package/dist/components/container-panel/container-panel.js +5 -5
  41. package/dist/components/draggable/draggable-handle.js +1 -1
  42. package/dist/components/draggable/draggable.js +1 -1
  43. package/dist/components/draggable-list/draggable-list-item.js +1 -1
  44. package/dist/components/draggable-list/draggable-list.js +2 -2
  45. package/dist/components/expandable/expandable.js +7 -7
  46. package/dist/components/index.js +15 -15
  47. package/dist/components/input-field/input-field.js +1 -1
  48. package/dist/components/item-collection/item-collection.js +1 -1
  49. package/dist/components/link-input/link-input.js +1 -1
  50. package/dist/components/matrix-align/matrix-align.js +5 -5
  51. package/dist/components/menu/menu.js +11 -11
  52. package/dist/components/modal/modal.js +1 -1
  53. package/dist/components/number-picker/number-picker.js +1 -1
  54. package/dist/components/option-select/option-select.js +3 -3
  55. package/dist/components/options-panel/options-panel.js +3 -3
  56. package/dist/components/placeholders/file-picker-shell.js +1 -1
  57. package/dist/components/placeholders/file-placeholder.js +1 -1
  58. package/dist/components/popover/popover.js +6 -6
  59. package/dist/components/portal-provider/portal-provider.js +2 -2
  60. package/dist/components/radio/radio.js +9 -9
  61. package/dist/components/repeater/repeater-item.js +2 -2
  62. package/dist/components/repeater/repeater.js +3 -3
  63. package/dist/components/responsive/mini-responsive.js +6 -6
  64. package/dist/components/responsive/responsive-legacy.js +5 -5
  65. package/dist/components/responsive/responsive.js +5 -5
  66. package/dist/components/responsive-preview/responsive-preview.js +2 -2
  67. package/dist/components/select/async-multi-select.js +27 -26
  68. package/dist/components/select/async-select.js +27 -26
  69. package/dist/components/select/multi-select.js +33 -32
  70. package/dist/components/select/shared.js +1 -1
  71. package/dist/components/select/single-select.js +33 -32
  72. package/dist/components/select/styles.js +1 -1
  73. package/dist/components/slider/column-config-slider.js +8 -8
  74. package/dist/components/slider/slider.js +8 -8
  75. package/dist/components/slider/utils.js +1 -1
  76. package/dist/components/smart-image/smart-image.js +1 -1
  77. package/dist/components/tabs/tabs.js +1 -1
  78. package/dist/components/toggle/switch.js +1 -1
  79. package/dist/components/toggle/toggle.js +3 -3
  80. package/dist/components/toggle-button/toggle-button.js +1 -1
  81. package/dist/components/tooltip/tooltip.js +1 -1
  82. package/dist/{draggable-CTDVJ4zd.js → draggable-Cxv-OueQ.js} +1 -1
  83. package/dist/filterDOMProps-BfW758QC.js +69 -0
  84. package/dist/{gradient-editor-xfxA_s9a.js → gradient-editor-CInqVF8v.js} +6 -11
  85. package/dist/icons/index.js +1 -1
  86. package/dist/icons/jsx-svg.js +1 -1
  87. package/dist/index.js +15 -15
  88. package/dist/{input-field-_OCWbftf.js → input-field-BdFrxQ-R.js} +46 -47
  89. package/dist/{jsx-svg-BRJ4n3pD.js → jsx-svg-DT1SBWuP.js} +6 -12
  90. package/dist/keyboard-CT41mQzR.js +55 -0
  91. package/dist/{link-input-Bh8G7Urm.js → link-input-BDFhSSvH.js} +324 -356
  92. package/dist/{modal-snrElwty.js → modal-CJDaBdPh.js} +100 -92
  93. package/dist/{number-ZZIxJukn.js → number-MWRvGfyE.js} +10 -10
  94. package/dist/{number-picker-Dhtx4409.js → number-picker-BrxrB-xq.js} +43 -42
  95. package/dist/{shared-BiWZjrGF.js → shared-CI4kcnm8.js} +482 -502
  96. package/dist/{smart-image-CBNbxJ57.js → smart-image-eGdMu9s9.js} +2 -2
  97. package/dist/{solid-color-picker-DukArNH-.js → solid-color-picker-DXgX-OAm.js} +926 -935
  98. package/dist/{switch-DmsvyQPa.js → switch-DNHFoCCx.js} +28 -28
  99. package/dist/{tabs-DaIUEc0g.js → tabs-C2tPOEYr.js} +150 -153
  100. package/dist/textSelection-BhX_2zV9.js +45 -0
  101. package/dist/{toggle-button-BlzUGfGy.js → toggle-button-DYDp11rq.js} +35 -35
  102. package/dist/{tooltip-BzJzYlcc.js → tooltip-C-hT6tN9.js} +162 -162
  103. package/dist/{useAsyncList-BNzwKoX4.js → useAsyncList-DsOh1xIx.js} +54 -74
  104. package/dist/{useButton-ra1ZSZ4z.js → useButton-BMZc4fTX.js} +11 -11
  105. package/dist/{SelectionManager-B8lLv6Ue.js → useCollection-CBVYSuGz.js} +1689 -1777
  106. package/dist/{useEvent-DkZVfgsS.js → useEvent-ypAU33vv.js} +5 -5
  107. package/dist/useField-BXf__jxy.js +32 -0
  108. package/dist/{useFilter-OiMnf6sb.js → useFilter-CfKEbIwL.js} +5 -5
  109. package/dist/{useFocusRing-DuYL4cdO.js → useFocusRing-BgYY-7ko.js} +23 -23
  110. package/dist/useFormReset-BuMc_O4y.js +17 -0
  111. package/dist/{FieldError-BWDbP5Db.js → useFormValidation-BcME9D0E.js} +63 -66
  112. package/dist/useHover-lyApu3ba.js +975 -0
  113. package/dist/{useLabel-2EohW5l6.js → useLabel-Rv8cIIKk.js} +8 -8
  114. package/dist/{useLabels-B2p7RXi5.js → useLabels-xOYtkA8o.js} +5 -5
  115. package/dist/useListState-u6DfeXHi.js +135 -0
  116. package/dist/{useLocalizedStringFormatter-Dv2diN3k.js → useLocalizedStringFormatter-CR-bmorj.js} +45 -45
  117. package/dist/{useNumberField-2xbi3jRV.js → useNumberFieldState-xL-ecwNz.js} +665 -619
  118. package/dist/useNumberFormatter-CR1PAFPG.js +10 -0
  119. package/dist/useOverlayTriggerState-AeCx45Gv.js +551 -0
  120. package/dist/usePress-Dnx5rBoD.js +593 -0
  121. package/dist/useTextField-BW3ZwGyz.js +159 -0
  122. package/dist/{useToggle-ecIirvIM.js → useToggle-BF5wptMP.js} +19 -20
  123. package/dist/useToggleState-D5P01lch.js +22 -0
  124. package/dist/useToolbar-BT25-MJg.js +55 -0
  125. package/dist/utilities/debounce-throttle.js +1 -1
  126. package/dist/utilities/es-dash.js +1 -1
  127. package/dist/utilities/index.js +3 -3
  128. package/dist/{utils-B_uiqNa4.js → utils-JFcCNFzy.js} +121 -122
  129. package/package.json +18 -18
  130. package/dist/Button-h6xF_WrP.js +0 -225
  131. package/dist/Dialog-i5VLQw1o.js +0 -2488
  132. package/dist/FocusScope-CgwbGOBB.js +0 -746
  133. package/dist/Form-DTMkbrQY.js +0 -5
  134. package/dist/Heading-Hol-wS_B.js +0 -16
  135. package/dist/Input-BURqyJXW.js +0 -161
  136. package/dist/Label-DFXXxMKY.js +0 -17
  137. package/dist/ListBox-B21SgugS.js +0 -601
  138. package/dist/OverlayArrow-BoloUPQM.js +0 -573
  139. package/dist/PortalProvider-DinZZCKX.js +0 -14
  140. package/dist/RSPContexts-C_z0bI8W.js +0 -12
  141. package/dist/RadioGroup-BwlGtCja.js +0 -329
  142. package/dist/SearchField-DR_I4_yn.js +0 -765
  143. package/dist/SelectionIndicator-31L6EI9F.js +0 -13
  144. package/dist/Text-O6VBBDlP.js +0 -16
  145. package/dist/context-C-XNeJ_l.js +0 -93
  146. package/dist/filterDOMProps-_2_3GD-K.js +0 -69
  147. package/dist/textSelection-Dv6WPj0Z.js +0 -45
  148. package/dist/useField-D0WrzR2F.js +0 -32
  149. package/dist/useFormReset-DdkykzAn.js +0 -18
  150. package/dist/useHover-qaMm3XFO.js +0 -982
  151. package/dist/useListState-CD_5vfyy.js +0 -147
  152. package/dist/useNumberFormatter-C2Cm2mNj.js +0 -10
  153. package/dist/usePress-ZP1TjkFf.js +0 -678
  154. package/dist/useToggleState-IIDbiKPl.js +0 -23
  155. /package/dist/{List-DWlgW2Ex.js → List---tsVJlI.js} +0 -0
  156. /package/dist/{build-module-Bsx62nlm.js → build-module-K6vi4xE0.js} +0 -0
  157. /package/dist/{debounce-throttle-DXxSAKpq.js → debounce-throttle-LSPAPFtq.js} +0 -0
  158. /package/dist/{dist-2gkv7_1U.js → dist-jw8wvxoG.js} +0 -0
  159. /package/dist/{es-dash-HqXWZZ3_.js → es-dash-BuShf_ht.js} +0 -0
  160. /package/dist/{utilities-lwX686oD.js → utilities-DV0KKJNR.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useMemo, useReducer, useRef, useState } from "react";
2
- //#region node_modules/@react-stately/data/dist/useListData.mjs
3
- function $0d86e9c8f07f9a7b$export$79c0c687a5963b0a(opts, dispatch) {
2
+ //#region node_modules/react-stately/dist/private/data/useListData.mjs
3
+ function $232f8dea1b0a4f2f$export$79c0c687a5963b0a(opts, dispatch) {
4
4
  let { cursor, getKey } = opts;
5
5
  return {
6
6
  setSelectedKeys(selectedKeys) {
@@ -43,29 +43,29 @@ function $0d86e9c8f07f9a7b$export$79c0c687a5963b0a(opts, dispatch) {
43
43
  }));
44
44
  },
45
45
  insert(index, ...values) {
46
- dispatch((state) => $0d86e9c8f07f9a7b$var$insert(state, index, ...values));
46
+ dispatch((state) => $232f8dea1b0a4f2f$var$insert(state, index, ...values));
47
47
  },
48
48
  insertBefore(key, ...values) {
49
49
  dispatch((state) => {
50
- let index = state.items.findIndex((item) => (getKey === null || getKey === void 0 ? void 0 : getKey(item)) === key);
50
+ let index = state.items.findIndex((item) => getKey?.(item) === key);
51
51
  if (index === -1) if (state.items.length === 0) index = 0;
52
52
  else return state;
53
- return $0d86e9c8f07f9a7b$var$insert(state, index, ...values);
53
+ return $232f8dea1b0a4f2f$var$insert(state, index, ...values);
54
54
  });
55
55
  },
56
56
  insertAfter(key, ...values) {
57
57
  dispatch((state) => {
58
- let index = state.items.findIndex((item) => (getKey === null || getKey === void 0 ? void 0 : getKey(item)) === key);
58
+ let index = state.items.findIndex((item) => getKey?.(item) === key);
59
59
  if (index === -1) if (state.items.length === 0) index = 0;
60
60
  else return state;
61
- return $0d86e9c8f07f9a7b$var$insert(state, index + 1, ...values);
61
+ return $232f8dea1b0a4f2f$var$insert(state, index + 1, ...values);
62
62
  });
63
63
  },
64
64
  prepend(...values) {
65
- dispatch((state) => $0d86e9c8f07f9a7b$var$insert(state, 0, ...values));
65
+ dispatch((state) => $232f8dea1b0a4f2f$var$insert(state, 0, ...values));
66
66
  },
67
67
  append(...values) {
68
- dispatch((state) => $0d86e9c8f07f9a7b$var$insert(state, state.items.length, ...values));
68
+ dispatch((state) => $232f8dea1b0a4f2f$var$insert(state, state.items.length, ...values));
69
69
  },
70
70
  remove(...keys) {
71
71
  dispatch((state) => {
@@ -117,14 +117,14 @@ function $0d86e9c8f07f9a7b$export$79c0c687a5963b0a(opts, dispatch) {
117
117
  dispatch((state) => {
118
118
  let toIndex = state.items.findIndex((item) => getKey(item) === key);
119
119
  if (toIndex === -1) return state;
120
- return $0d86e9c8f07f9a7b$var$move(state, (Array.isArray(keys) ? keys : [...keys]).map((key) => state.items.findIndex((item) => getKey(item) === key)).sort((a, b) => a - b), toIndex);
120
+ return $232f8dea1b0a4f2f$var$move(state, (Array.isArray(keys) ? keys : [...keys]).map((key) => state.items.findIndex((item) => getKey(item) === key)).sort((a, b) => a - b), toIndex);
121
121
  });
122
122
  },
123
123
  moveAfter(key, keys) {
124
124
  dispatch((state) => {
125
125
  let toIndex = state.items.findIndex((item) => getKey(item) === key);
126
126
  if (toIndex === -1) return state;
127
- return $0d86e9c8f07f9a7b$var$move(state, (Array.isArray(keys) ? keys : [...keys]).map((key) => state.items.findIndex((item) => getKey(item) === key)).sort((a, b) => a - b), toIndex + 1);
127
+ return $232f8dea1b0a4f2f$var$move(state, (Array.isArray(keys) ? keys : [...keys]).map((key) => state.items.findIndex((item) => getKey(item) === key)).sort((a, b) => a - b), toIndex + 1);
128
128
  });
129
129
  },
130
130
  update(key, newValue) {
@@ -146,7 +146,7 @@ function $0d86e9c8f07f9a7b$export$79c0c687a5963b0a(opts, dispatch) {
146
146
  }
147
147
  };
148
148
  }
149
- function $0d86e9c8f07f9a7b$var$insert(state, index, ...values) {
149
+ function $232f8dea1b0a4f2f$var$insert(state, index, ...values) {
150
150
  return {
151
151
  ...state,
152
152
  items: [
@@ -156,7 +156,7 @@ function $0d86e9c8f07f9a7b$var$insert(state, index, ...values) {
156
156
  ]
157
157
  };
158
158
  }
159
- function $0d86e9c8f07f9a7b$var$move(state, indices, toIndex) {
159
+ function $232f8dea1b0a4f2f$var$move(state, indices, toIndex) {
160
160
  toIndex -= indices.filter((index) => index < toIndex).length;
161
161
  let moves = indices.map((from) => ({
162
162
  from,
@@ -185,8 +185,8 @@ function $0d86e9c8f07f9a7b$var$move(state, indices, toIndex) {
185
185
  };
186
186
  }
187
187
  //#endregion
188
- //#region node_modules/@react-stately/data/dist/useAsyncList.mjs
189
- function $f86e6c1ec7da6ebb$var$reducer(data, action) {
188
+ //#region node_modules/react-stately/dist/private/data/useAsyncList.mjs
189
+ function $c73d3f3d5ec90946$var$reducer(data, action) {
190
190
  let selectedKeys;
191
191
  switch (data.state) {
192
192
  case "idle":
@@ -194,22 +194,18 @@ function $f86e6c1ec7da6ebb$var$reducer(data, action) {
194
194
  case "loading":
195
195
  case "loadingMore":
196
196
  case "sorting":
197
- case "filtering":
198
- var _action_filterText, _action_sortDescriptor;
199
- return {
200
- ...data,
201
- filterText: (_action_filterText = action.filterText) !== null && _action_filterText !== void 0 ? _action_filterText : data.filterText,
202
- state: action.type,
203
- items: action.type === "loading" ? [] : data.items,
204
- sortDescriptor: (_action_sortDescriptor = action.sortDescriptor) !== null && _action_sortDescriptor !== void 0 ? _action_sortDescriptor : data.sortDescriptor,
205
- abortController: action.abortController
206
- };
207
- case "update":
208
- var _action_updater;
209
- return {
210
- ...data,
211
- ...(_action_updater = action.updater) === null || _action_updater === void 0 ? void 0 : _action_updater.call(action, data)
212
- };
197
+ case "filtering": return {
198
+ ...data,
199
+ filterText: action.filterText ?? data.filterText,
200
+ state: action.type,
201
+ items: action.type === "loading" ? [] : data.items,
202
+ sortDescriptor: action.sortDescriptor ?? data.sortDescriptor,
203
+ abortController: action.abortController
204
+ };
205
+ case "update": return {
206
+ ...data,
207
+ ...action.updater?.(data)
208
+ };
213
209
  case "success":
214
210
  case "error": return data;
215
211
  default: throw new Error(`Invalid action "${action.type}" in state "${data.state}"`);
@@ -219,16 +215,14 @@ function $f86e6c1ec7da6ebb$var$reducer(data, action) {
219
215
  case "filtering": switch (action.type) {
220
216
  case "success":
221
217
  if (action.abortController !== data.abortController) return data;
222
- var _action_selectedKeys;
223
- selectedKeys = (_action_selectedKeys = action.selectedKeys) !== null && _action_selectedKeys !== void 0 ? _action_selectedKeys : data.selectedKeys;
224
- var _action_filterText1, _action_items, _action_sortDescriptor1;
218
+ selectedKeys = action.selectedKeys ?? data.selectedKeys;
225
219
  return {
226
220
  ...data,
227
- filterText: (_action_filterText1 = action.filterText) !== null && _action_filterText1 !== void 0 ? _action_filterText1 : data.filterText,
221
+ filterText: action.filterText ?? data.filterText,
228
222
  state: "idle",
229
- items: [...(_action_items = action.items) !== null && _action_items !== void 0 ? _action_items : []],
223
+ items: [...action.items ?? []],
230
224
  selectedKeys: selectedKeys === "all" ? "all" : new Set(selectedKeys),
231
- sortDescriptor: (_action_sortDescriptor1 = action.sortDescriptor) !== null && _action_sortDescriptor1 !== void 0 ? _action_sortDescriptor1 : data.sortDescriptor,
225
+ sortDescriptor: action.sortDescriptor ?? data.sortDescriptor,
232
226
  abortController: void 0,
233
227
  cursor: action.cursor
234
228
  };
@@ -244,35 +238,29 @@ function $f86e6c1ec7da6ebb$var$reducer(data, action) {
244
238
  case "loadingMore":
245
239
  case "sorting":
246
240
  case "filtering":
247
- var _data_abortController;
248
- (_data_abortController = data.abortController) === null || _data_abortController === void 0 || _data_abortController.abort("aborting current load and starting new one");
249
- var _action_filterText2;
241
+ data.abortController?.abort("aborting current load and starting new one");
250
242
  return {
251
243
  ...data,
252
- filterText: (_action_filterText2 = action.filterText) !== null && _action_filterText2 !== void 0 ? _action_filterText2 : data.filterText,
244
+ filterText: action.filterText ?? data.filterText,
253
245
  state: action.type,
254
246
  items: action.type === "loading" ? [] : data.items,
255
247
  abortController: action.abortController
256
248
  };
257
- case "update":
258
- var _action_updater1;
259
- return {
260
- ...data,
261
- ...(_action_updater1 = action.updater) === null || _action_updater1 === void 0 ? void 0 : _action_updater1.call(action, data)
262
- };
249
+ case "update": return {
250
+ ...data,
251
+ ...action.updater?.(data)
252
+ };
263
253
  default: throw new Error(`Invalid action "${action.type}" in state "${data.state}"`);
264
254
  }
265
255
  case "loadingMore": switch (action.type) {
266
256
  case "success":
267
- var _action_selectedKeys1;
268
- selectedKeys = data.selectedKeys === "all" || action.selectedKeys === "all" ? "all" : new Set([...data.selectedKeys, ...(_action_selectedKeys1 = action.selectedKeys) !== null && _action_selectedKeys1 !== void 0 ? _action_selectedKeys1 : []]);
269
- var _action_items1, _action_sortDescriptor2;
257
+ selectedKeys = data.selectedKeys === "all" || action.selectedKeys === "all" ? "all" : new Set([...data.selectedKeys, ...action.selectedKeys ?? []]);
270
258
  return {
271
259
  ...data,
272
260
  state: "idle",
273
- items: [...data.items, ...(_action_items1 = action.items) !== null && _action_items1 !== void 0 ? _action_items1 : []],
261
+ items: [...data.items, ...action.items ?? []],
274
262
  selectedKeys,
275
- sortDescriptor: (_action_sortDescriptor2 = action.sortDescriptor) !== null && _action_sortDescriptor2 !== void 0 ? _action_sortDescriptor2 : data.sortDescriptor,
263
+ sortDescriptor: action.sortDescriptor ?? data.sortDescriptor,
276
264
  abortController: void 0,
277
265
  cursor: action.cursor
278
266
  };
@@ -286,34 +274,29 @@ function $f86e6c1ec7da6ebb$var$reducer(data, action) {
286
274
  case "loading":
287
275
  case "sorting":
288
276
  case "filtering":
289
- var _data_abortController1;
290
- (_data_abortController1 = data.abortController) === null || _data_abortController1 === void 0 || _data_abortController1.abort();
291
- var _action_filterText3;
277
+ data.abortController?.abort();
292
278
  return {
293
279
  ...data,
294
- filterText: (_action_filterText3 = action.filterText) !== null && _action_filterText3 !== void 0 ? _action_filterText3 : data.filterText,
280
+ filterText: action.filterText ?? data.filterText,
295
281
  state: action.type,
296
282
  items: action.type === "loading" ? [] : data.items,
297
283
  abortController: action.abortController
298
284
  };
299
285
  case "loadingMore":
300
- var _action_abortController;
301
- (_action_abortController = action.abortController) === null || _action_abortController === void 0 || _action_abortController.abort();
286
+ action.abortController?.abort();
302
287
  return data;
303
- case "update":
304
- var _action_updater2;
305
- return {
306
- ...data,
307
- ...(_action_updater2 = action.updater) === null || _action_updater2 === void 0 ? void 0 : _action_updater2.call(action, data)
308
- };
288
+ case "update": return {
289
+ ...data,
290
+ ...action.updater?.(data)
291
+ };
309
292
  default: throw new Error(`Invalid action "${action.type}" in state "${data.state}"`);
310
293
  }
311
294
  default: throw new Error(`Invalid state "${data.state}"`);
312
295
  }
313
296
  }
314
- function $f86e6c1ec7da6ebb$export$bc3384a35de93d66(options) {
297
+ function $c73d3f3d5ec90946$export$bc3384a35de93d66(options) {
315
298
  const { load, sort, initialSelectedKeys, initialSortDescriptor, getKey = (item) => item.id || item.key, initialFilterText = "" } = options;
316
- let [data, dispatch] = useReducer($f86e6c1ec7da6ebb$var$reducer, {
299
+ let [data, dispatch] = useReducer($c73d3f3d5ec90946$var$reducer, {
317
300
  state: "idle",
318
301
  error: void 0,
319
302
  items: [],
@@ -328,20 +311,17 @@ function $f86e6c1ec7da6ebb$export$bc3384a35de93d66(options) {
328
311
  ...action,
329
312
  abortController
330
313
  });
331
- var _action_filterText;
332
- let previousFilterText = (_action_filterText = action.filterText) !== null && _action_filterText !== void 0 ? _action_filterText : data.filterText;
333
- var _action_sortDescriptor;
314
+ let previousFilterText = action.filterText ?? data.filterText;
334
315
  let response = await fn({
335
316
  items: data.items.slice(),
336
317
  selectedKeys: data.selectedKeys,
337
- sortDescriptor: (_action_sortDescriptor = action.sortDescriptor) !== null && _action_sortDescriptor !== void 0 ? _action_sortDescriptor : data.sortDescriptor,
318
+ sortDescriptor: action.sortDescriptor ?? data.sortDescriptor,
338
319
  signal: abortController.signal,
339
320
  cursor: action.type === "loadingMore" ? data.cursor : void 0,
340
321
  filterText: previousFilterText,
341
322
  loadingState: data.state
342
323
  });
343
- var _response_filterText;
344
- let filterText = (_response_filterText = response.filterText) !== null && _response_filterText !== void 0 ? _response_filterText : previousFilterText;
324
+ let filterText = response.filterText ?? previousFilterText;
345
325
  dispatch({
346
326
  type: "success",
347
327
  ...response,
@@ -390,7 +370,7 @@ function $f86e6c1ec7da6ebb$export$bc3384a35de93d66(options) {
390
370
  sortDescriptor
391
371
  }, sort || load);
392
372
  },
393
- ...$0d86e9c8f07f9a7b$export$79c0c687a5963b0a({
373
+ ...$232f8dea1b0a4f2f$export$79c0c687a5963b0a({
394
374
  ...options,
395
375
  getKey,
396
376
  cursor: data.cursor
@@ -409,4 +389,4 @@ function $f86e6c1ec7da6ebb$export$bc3384a35de93d66(options) {
409
389
  };
410
390
  }
411
391
  //#endregion
412
- export { $f86e6c1ec7da6ebb$export$bc3384a35de93d66 as t };
392
+ export { $c73d3f3d5ec90946$export$bc3384a35de93d66 as t };
@@ -1,9 +1,9 @@
1
- import { u as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-B_uiqNa4.js";
2
- import { r as $f645667febf57a63$export$4c014de7c8940b4c } from "./useHover-qaMm3XFO.js";
3
- import { t as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-_2_3GD-K.js";
4
- import { t as $f6c31cce2adf654f$export$45712eceda6fad21 } from "./usePress-ZP1TjkFf.js";
5
- //#region node_modules/@react-aria/button/dist/useButton.mjs
6
- function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
1
+ import { u as $bbaa08b3cd72f041$export$9d1611c77c2fe928 } from "./utils-JFcCNFzy.js";
2
+ import { i as $d1116acdf220c2da$export$4c014de7c8940b4c } from "./useHover-lyApu3ba.js";
3
+ import { t as $8e9d2fae0ecb9001$export$457c3d6518dd4c6f } from "./filterDOMProps-BfW758QC.js";
4
+ import { t as $d27d541f9569d26d$export$45712eceda6fad21 } from "./usePress-Dnx5rBoD.js";
5
+ //#region node_modules/react-aria/dist/private/button/useButton.mjs
6
+ function $ac4318a9c075bb9f$export$ea18c227d4417cc3(props, ref) {
7
7
  let { elementType = "button", isDisabled, onPress, onPressStart, onPressEnd, onPressUp, onPressChange, preventFocusOnPress, allowFocusWhenDisabled, onClick, href, target, rel, type = "button" } = props;
8
8
  let additionalProps;
9
9
  if (elementType === "button") additionalProps = {
@@ -27,7 +27,7 @@ function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
27
27
  "aria-disabled": !isDisabled || elementType === "input" ? void 0 : isDisabled,
28
28
  rel: elementType === "a" ? rel : void 0
29
29
  };
30
- let { pressProps, isPressed } = $f6c31cce2adf654f$export$45712eceda6fad21({
30
+ let { pressProps, isPressed } = $d27d541f9569d26d$export$45712eceda6fad21({
31
31
  onPressStart,
32
32
  onPressEnd,
33
33
  onPressChange,
@@ -38,12 +38,12 @@ function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
38
38
  preventFocusOnPress,
39
39
  ref
40
40
  });
41
- let { focusableProps } = $f645667febf57a63$export$4c014de7c8940b4c(props, ref);
41
+ let { focusableProps } = $d1116acdf220c2da$export$4c014de7c8940b4c(props, ref);
42
42
  if (allowFocusWhenDisabled) focusableProps.tabIndex = isDisabled ? -1 : focusableProps.tabIndex;
43
- let buttonProps = $3ef42575df84b30b$export$9d1611c77c2fe928(focusableProps, pressProps, $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, { labelable: true }));
43
+ let buttonProps = $bbaa08b3cd72f041$export$9d1611c77c2fe928(focusableProps, pressProps, $8e9d2fae0ecb9001$export$457c3d6518dd4c6f(props, { labelable: true }));
44
44
  return {
45
45
  isPressed,
46
- buttonProps: $3ef42575df84b30b$export$9d1611c77c2fe928(additionalProps, buttonProps, {
46
+ buttonProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928(additionalProps, buttonProps, {
47
47
  "aria-haspopup": props["aria-haspopup"],
48
48
  "aria-expanded": props["aria-expanded"],
49
49
  "aria-controls": props["aria-controls"],
@@ -54,4 +54,4 @@ function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
54
54
  };
55
55
  }
56
56
  //#endregion
57
- export { $701a24aa0da5b062$export$ea18c227d4417cc3 as t };
57
+ export { $ac4318a9c075bb9f$export$ea18c227d4417cc3 as t };