@eightshift/ui-components 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +27 -0
  2. package/dist/Checkbox-BLcVbhiO.js +178 -0
  3. package/dist/ColorSwatch-Cmlex_kT.js +66 -0
  4. package/dist/FieldError-wtMA4667.js +42 -0
  5. package/dist/FocusScope-1u9yyfIN.js +725 -0
  6. package/dist/Form-Cq3fu75_.js +5 -0
  7. package/dist/GridList-BZPXp3_O.js +1256 -0
  8. package/dist/Group-DyqpTRPe.js +49 -0
  9. package/dist/Input-jsbb4ugq.js +130 -0
  10. package/dist/Label-BPzS-sR7.js +17 -0
  11. package/dist/ListBox-w9gDaJkV.js +4423 -0
  12. package/dist/LiveAnnouncer-IsokfWQ5.js +73 -0
  13. package/dist/NumberFormatter-LzoKy975.js +160 -0
  14. package/dist/RSPContexts-CrNYmadY.js +14 -0
  15. package/dist/Select-49a62830.esm-C-RFtLiD.js +2541 -0
  16. package/dist/SelectionManager-mefd0ThJ.js +2155 -0
  17. package/dist/Separator-DHn0CwdK.js +325 -0
  18. package/dist/Slider-Pyh2V4bY.js +885 -0
  19. package/dist/Text-BM136LvS.js +17 -0
  20. package/dist/VisuallyHidden-BYRI1Lfo.js +51 -0
  21. package/dist/_commonjsHelpers-CUmg6egw.js +6 -0
  22. package/dist/ariaHideOutside-ByKBPHmX.js +113 -0
  23. package/dist/assets/style.css +1 -0
  24. package/dist/button-BkkdyHfJ.js +307 -0
  25. package/dist/components/animated-visibility/animated-visibility.js +7165 -0
  26. package/dist/components/base-control/base-control.js +97 -0
  27. package/dist/components/breakpoint-preview/breakpoint-preview.js +218 -0
  28. package/dist/components/button/button.js +10 -0
  29. package/dist/components/checkbox/checkbox.js +119 -0
  30. package/dist/components/color-pickers/color-picker.js +242 -0
  31. package/dist/components/color-pickers/color-swatch.js +62 -0
  32. package/dist/components/color-pickers/gradient-editor.js +516 -0
  33. package/dist/components/color-pickers/solid-color-picker.js +1633 -0
  34. package/dist/components/component-toggle/component-toggle.js +71 -0
  35. package/dist/components/container-panel/container-panel.js +39 -0
  36. package/dist/components/expandable/expandable.js +144 -0
  37. package/dist/components/input-field/input-field.js +224 -0
  38. package/dist/components/link-input/link-input.js +937 -0
  39. package/dist/components/list-box/list-box.js +152 -0
  40. package/dist/components/matrix-align/matrix-align.js +185 -0
  41. package/dist/components/menu/menu.js +1608 -0
  42. package/dist/components/notice/notice.js +119 -0
  43. package/dist/components/number-picker/number-picker.js +277 -0
  44. package/dist/components/popover/popover.js +9 -0
  45. package/dist/components/radio/radio.js +552 -0
  46. package/dist/components/repeater/repeater-item.js +127 -0
  47. package/dist/components/repeater/repeater.js +248 -0
  48. package/dist/components/responsive/responsive-legacy.js +326 -0
  49. package/dist/components/responsive/responsive.js +499 -0
  50. package/dist/components/responsive-preview/responsive-preview.js +119 -0
  51. package/dist/components/rich-label/rich-label.js +56 -0
  52. package/dist/components/select/async-multi-select.js +144 -0
  53. package/dist/components/select/async-single-select.js +126 -0
  54. package/dist/components/select/custom-select-default-components.js +38 -0
  55. package/dist/components/select/multi-select-components.js +8 -0
  56. package/dist/components/select/multi-select.js +134 -0
  57. package/dist/components/select/react-select-component-wrappers.js +90 -0
  58. package/dist/components/select/shared.js +45 -0
  59. package/dist/components/select/single-select.js +116 -0
  60. package/dist/components/select/styles.js +55 -0
  61. package/dist/components/slider/column-config-slider.js +225 -0
  62. package/dist/components/slider/slider.js +362 -0
  63. package/dist/components/slider/utils.js +45 -0
  64. package/dist/components/spacer/spacer.js +93 -0
  65. package/dist/components/tabs/tabs.js +626 -0
  66. package/dist/components/toggle/switch.js +140 -0
  67. package/dist/components/toggle/toggle.js +58 -0
  68. package/dist/components/toggle-button/toggle-button.js +206 -0
  69. package/dist/components/tooltip/tooltip.js +10 -0
  70. package/dist/context-jMy6xdVq.js +98 -0
  71. package/dist/default-i18n-BhE-OUmt.js +873 -0
  72. package/dist/filterDOMProps-DG2RfOUr.js +30 -0
  73. package/dist/focusSafely-C3K8zAKj.js +743 -0
  74. package/dist/hooks/use-cell-edit-mode.js +35 -0
  75. package/dist/icons/block-icon.js +42 -0
  76. package/dist/icons/generic-color-swatch.js +21 -0
  77. package/dist/icons/icons.js +3636 -0
  78. package/dist/index-Bfb9bWcb.js +28844 -0
  79. package/dist/index-a301f526.esm-Bioi4cGX.js +3576 -0
  80. package/dist/index.js +109 -0
  81. package/dist/intlStrings-CUhoK9EN.js +2484 -0
  82. package/dist/isScrollable-PcyglExV.js +10 -0
  83. package/dist/modifiers.esm-BuJQPI1X.js +31 -0
  84. package/dist/multi-select-components-CjVpCNko.js +3677 -0
  85. package/dist/number-rWqELA8W.js +39 -0
  86. package/dist/popover-Dx3vKXUX.js +1061 -0
  87. package/dist/react-select-async.esm-TFb_ZX6C.js +111 -0
  88. package/dist/react-select.esm-BjRWqf0E.js +15 -0
  89. package/dist/style.js +1 -0
  90. package/dist/textSelection-BosCCRVE.js +89 -0
  91. package/dist/tooltip-CkCndvTI.js +1094 -0
  92. package/dist/useButton-CuG5UzUw.js +74 -0
  93. package/dist/useEvent-DHv-yhOH.js +24 -0
  94. package/dist/useFocusRing-Cc-4eouh.js +41 -0
  95. package/dist/useFocusable-5q1Gek1J.js +81 -0
  96. package/dist/useFormReset-Buc9YJcv.js +23 -0
  97. package/dist/useFormValidationState-BAPPNXic.js +238 -0
  98. package/dist/useHasTabbableChild-D3uUNhJ0.js +37 -0
  99. package/dist/useLabel-CGlkoFG0.js +28 -0
  100. package/dist/useLabels-Dg62M_3P.js +25 -0
  101. package/dist/useListData-BelKu4kx.js +211 -0
  102. package/dist/useListState-Domq0blV.js +137 -0
  103. package/dist/useLocalizedStringFormatter-Prmz0h0A.js +130 -0
  104. package/dist/useNumberFieldState-BLU3uhSR.js +1253 -0
  105. package/dist/useNumberFormatter-BLc2xjZn.js +13 -0
  106. package/dist/usePress-BQgVor4T.js +698 -0
  107. package/dist/useToggle-C9ETOBaZ.js +58 -0
  108. package/dist/useToggleState-DJ_z5E2S.js +21 -0
  109. package/dist/utilities/classnames.js +16 -0
  110. package/dist/utilities/text-helpers.js +79 -0
  111. package/dist/utils-BsiH7-5Y.js +488 -0
  112. package/package.json +71 -0
@@ -0,0 +1,325 @@
1
+ import { c as $ae20dd8cbca75726$export$d6daf82dcd84e87c, d as $c5a24bc478652b5f$export$1005530eda016c13, e as $7135fc7d473fd974$export$aeba0b1fb3dcd8b8 } from "./SelectionManager-mefd0ThJ.js";
2
+ import { $ as $cc38e7bd3fc7b213$export$2bb74740c4e19def } from "./isScrollable-PcyglExV.js";
3
+ import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-jMy6xdVq.js";
4
+ import React__default, { useMemo, forwardRef, createContext } from "react";
5
+ import { a as $64fa3d84918910a7$export$29f1550f4b0d4415 } from "./utils-BsiH7-5Y.js";
6
+ import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-DG2RfOUr.js";
7
+ let $325a3faab7a68acd$var$cache = /* @__PURE__ */ new Map();
8
+ function $325a3faab7a68acd$export$a16aca283550c30d(options) {
9
+ let { locale } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
10
+ let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : "");
11
+ if ($325a3faab7a68acd$var$cache.has(cacheKey))
12
+ return $325a3faab7a68acd$var$cache.get(cacheKey);
13
+ let formatter = new Intl.Collator(locale, options);
14
+ $325a3faab7a68acd$var$cache.set(cacheKey, formatter);
15
+ return formatter;
16
+ }
17
+ class $2a25aae57d74318e$export$a05409b8bb224a5a {
18
+ isDisabled(item) {
19
+ var _item_props;
20
+ return this.disabledBehavior === "all" && (((_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.isDisabled) || this.disabledKeys.has(item.key));
21
+ }
22
+ getNextKey(key) {
23
+ key = this.collection.getKeyAfter(key);
24
+ while (key != null) {
25
+ let item = this.collection.getItem(key);
26
+ if (item.type === "item" && !this.isDisabled(item))
27
+ return key;
28
+ key = this.collection.getKeyAfter(key);
29
+ }
30
+ return null;
31
+ }
32
+ getPreviousKey(key) {
33
+ key = this.collection.getKeyBefore(key);
34
+ while (key != null) {
35
+ let item = this.collection.getItem(key);
36
+ if (item.type === "item" && !this.isDisabled(item))
37
+ return key;
38
+ key = this.collection.getKeyBefore(key);
39
+ }
40
+ return null;
41
+ }
42
+ findKey(key, nextKey, shouldSkip) {
43
+ let item = this.getItem(key);
44
+ if (!item)
45
+ return null;
46
+ let prevRect = item.getBoundingClientRect();
47
+ do {
48
+ key = nextKey(key);
49
+ item = this.getItem(key);
50
+ } while (item && shouldSkip(prevRect, item.getBoundingClientRect()));
51
+ return key;
52
+ }
53
+ isSameRow(prevRect, itemRect) {
54
+ return prevRect.top === itemRect.top || prevRect.left !== itemRect.left;
55
+ }
56
+ isSameColumn(prevRect, itemRect) {
57
+ return prevRect.left === itemRect.left || prevRect.top !== itemRect.top;
58
+ }
59
+ getKeyBelow(key) {
60
+ if (this.layout === "grid" && this.orientation === "vertical")
61
+ return this.findKey(key, (key2) => this.getNextKey(key2), this.isSameRow);
62
+ else
63
+ return this.getNextKey(key);
64
+ }
65
+ getKeyAbove(key) {
66
+ if (this.layout === "grid" && this.orientation === "vertical")
67
+ return this.findKey(key, (key2) => this.getPreviousKey(key2), this.isSameRow);
68
+ else
69
+ return this.getPreviousKey(key);
70
+ }
71
+ getNextColumn(key, right) {
72
+ return right ? this.getPreviousKey(key) : this.getNextKey(key);
73
+ }
74
+ getKeyRightOf(key) {
75
+ if (this.layout === "grid") {
76
+ if (this.orientation === "vertical")
77
+ return this.getNextColumn(key, this.direction === "rtl");
78
+ else
79
+ return this.findKey(key, (key2) => this.getNextColumn(key2, this.direction === "rtl"), this.isSameColumn);
80
+ } else if (this.orientation === "horizontal")
81
+ return this.getNextColumn(key, this.direction === "rtl");
82
+ return null;
83
+ }
84
+ getKeyLeftOf(key) {
85
+ if (this.layout === "grid") {
86
+ if (this.orientation === "vertical")
87
+ return this.getNextColumn(key, this.direction === "ltr");
88
+ else
89
+ return this.findKey(key, (key2) => this.getNextColumn(key2, this.direction === "ltr"), this.isSameColumn);
90
+ } else if (this.orientation === "horizontal")
91
+ return this.getNextColumn(key, this.direction === "ltr");
92
+ return null;
93
+ }
94
+ getFirstKey() {
95
+ let key = this.collection.getFirstKey();
96
+ while (key != null) {
97
+ let item = this.collection.getItem(key);
98
+ if ((item === null || item === void 0 ? void 0 : item.type) === "item" && !this.isDisabled(item))
99
+ return key;
100
+ key = this.collection.getKeyAfter(key);
101
+ }
102
+ return null;
103
+ }
104
+ getLastKey() {
105
+ let key = this.collection.getLastKey();
106
+ while (key != null) {
107
+ let item = this.collection.getItem(key);
108
+ if (item.type === "item" && !this.isDisabled(item))
109
+ return key;
110
+ key = this.collection.getKeyBefore(key);
111
+ }
112
+ return null;
113
+ }
114
+ getItem(key) {
115
+ return key !== null ? this.ref.current.querySelector(`[data-key="${CSS.escape(key.toString())}"]`) : null;
116
+ }
117
+ getKeyPageAbove(key) {
118
+ let menu = this.ref.current;
119
+ let item = this.getItem(key);
120
+ if (!item)
121
+ return null;
122
+ if (!$cc38e7bd3fc7b213$export$2bb74740c4e19def(menu))
123
+ return this.getFirstKey();
124
+ let containerRect = menu.getBoundingClientRect();
125
+ let itemRect = item.getBoundingClientRect();
126
+ if (this.orientation === "horizontal") {
127
+ let containerX = containerRect.x - menu.scrollLeft;
128
+ let pageX = Math.max(0, itemRect.x - containerX + itemRect.width - containerRect.width);
129
+ while (item && itemRect.x - containerX > pageX) {
130
+ key = this.getKeyAbove(key);
131
+ item = key == null ? null : this.getItem(key);
132
+ itemRect = item === null || item === void 0 ? void 0 : item.getBoundingClientRect();
133
+ }
134
+ } else {
135
+ let containerY = containerRect.y - menu.scrollTop;
136
+ let pageY = Math.max(0, itemRect.y - containerY + itemRect.height - containerRect.height);
137
+ while (item && itemRect.y - containerY > pageY) {
138
+ key = this.getKeyAbove(key);
139
+ item = key == null ? null : this.getItem(key);
140
+ itemRect = item === null || item === void 0 ? void 0 : item.getBoundingClientRect();
141
+ }
142
+ }
143
+ return key !== null && key !== void 0 ? key : this.getFirstKey();
144
+ }
145
+ getKeyPageBelow(key) {
146
+ let menu = this.ref.current;
147
+ let item = this.getItem(key);
148
+ if (!item)
149
+ return null;
150
+ if (!$cc38e7bd3fc7b213$export$2bb74740c4e19def(menu))
151
+ return this.getLastKey();
152
+ let containerRect = menu.getBoundingClientRect();
153
+ let itemRect = item.getBoundingClientRect();
154
+ if (this.orientation === "horizontal") {
155
+ let containerX = containerRect.x - menu.scrollLeft;
156
+ let pageX = Math.min(menu.scrollWidth, itemRect.x - containerX - itemRect.width + containerRect.width);
157
+ while (item && itemRect.x - containerX < pageX) {
158
+ key = this.getKeyBelow(key);
159
+ item = key == null ? null : this.getItem(key);
160
+ itemRect = item === null || item === void 0 ? void 0 : item.getBoundingClientRect();
161
+ }
162
+ } else {
163
+ let containerY = containerRect.y - menu.scrollTop;
164
+ let pageY = Math.min(menu.scrollHeight, itemRect.y - containerY - itemRect.height + containerRect.height);
165
+ while (item && itemRect.y - containerY < pageY) {
166
+ key = this.getKeyBelow(key);
167
+ item = key == null ? null : this.getItem(key);
168
+ itemRect = item === null || item === void 0 ? void 0 : item.getBoundingClientRect();
169
+ }
170
+ }
171
+ return key !== null && key !== void 0 ? key : this.getLastKey();
172
+ }
173
+ getKeyForSearch(search, fromKey) {
174
+ if (!this.collator)
175
+ return null;
176
+ let collection = this.collection;
177
+ let key = fromKey || this.getFirstKey();
178
+ while (key != null) {
179
+ let item = collection.getItem(key);
180
+ let substring = item.textValue.slice(0, search.length);
181
+ if (item.textValue && this.collator.compare(substring, search) === 0)
182
+ return key;
183
+ key = this.getKeyBelow(key);
184
+ }
185
+ return null;
186
+ }
187
+ constructor(...args) {
188
+ if (args.length === 1) {
189
+ let opts = args[0];
190
+ this.collection = opts.collection;
191
+ this.ref = opts.ref;
192
+ this.collator = opts.collator;
193
+ this.disabledKeys = opts.disabledKeys || /* @__PURE__ */ new Set();
194
+ this.disabledBehavior = opts.disabledBehavior || "all";
195
+ this.orientation = opts.orientation;
196
+ this.direction = opts.direction;
197
+ this.layout = opts.layout || "stack";
198
+ } else {
199
+ this.collection = args[0];
200
+ this.disabledKeys = args[1];
201
+ this.ref = args[2];
202
+ this.collator = args[3];
203
+ this.layout = "stack";
204
+ this.orientation = "vertical";
205
+ this.disabledBehavior = "all";
206
+ }
207
+ if (this.layout === "stack" && this.orientation === "vertical") {
208
+ this.getKeyLeftOf = void 0;
209
+ this.getKeyRightOf = void 0;
210
+ }
211
+ }
212
+ }
213
+ function $982254629710d113$export$b95089534ab7c1fd(props) {
214
+ let { selectionManager, collection, disabledKeys, ref, keyboardDelegate } = props;
215
+ let collator = $325a3faab7a68acd$export$a16aca283550c30d({
216
+ usage: "search",
217
+ sensitivity: "base"
218
+ });
219
+ let disabledBehavior = selectionManager.disabledBehavior;
220
+ let delegate = useMemo(() => keyboardDelegate || new $2a25aae57d74318e$export$a05409b8bb224a5a({
221
+ collection,
222
+ disabledKeys,
223
+ disabledBehavior,
224
+ ref,
225
+ collator
226
+ }), [
227
+ keyboardDelegate,
228
+ collection,
229
+ disabledKeys,
230
+ ref,
231
+ collator,
232
+ disabledBehavior
233
+ ]);
234
+ let { collectionProps } = $ae20dd8cbca75726$export$d6daf82dcd84e87c({
235
+ ...props,
236
+ ref,
237
+ selectionManager,
238
+ keyboardDelegate: delegate
239
+ });
240
+ return {
241
+ listProps: collectionProps
242
+ };
243
+ }
244
+ const $453cc9f0df89c0a5$var$cache = /* @__PURE__ */ new WeakMap();
245
+ function $453cc9f0df89c0a5$export$77d5aafae4e095b2(collection) {
246
+ let count = $453cc9f0df89c0a5$var$cache.get(collection);
247
+ if (count != null)
248
+ return count;
249
+ count = 0;
250
+ let countItems = (items) => {
251
+ for (let item of items)
252
+ if (item.type === "section")
253
+ countItems($c5a24bc478652b5f$export$1005530eda016c13(item, collection));
254
+ else
255
+ count++;
256
+ };
257
+ countItems(collection);
258
+ $453cc9f0df89c0a5$var$cache.set(collection, count);
259
+ return count;
260
+ }
261
+ function $f4b273590fab9f93$export$52210f68a14655d0(props) {
262
+ let domProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
263
+ labelable: true
264
+ });
265
+ let ariaOrientation;
266
+ if (props.orientation === "vertical")
267
+ ariaOrientation = "vertical";
268
+ if (props.elementType !== "hr")
269
+ return {
270
+ separatorProps: {
271
+ ...domProps,
272
+ role: "separator",
273
+ "aria-orientation": ariaOrientation
274
+ }
275
+ };
276
+ return {
277
+ separatorProps: domProps
278
+ };
279
+ }
280
+ const $72a5793c14baf454$export$e0e4026c12a8bdbb = /* @__PURE__ */ createContext({});
281
+ function $72a5793c14baf454$var$Header(originalProps, originalRef) {
282
+ let [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(originalProps, originalRef, $72a5793c14baf454$export$e0e4026c12a8bdbb);
283
+ let shallow = $7135fc7d473fd974$export$aeba0b1fb3dcd8b8("header", originalProps, originalRef);
284
+ if (shallow)
285
+ return shallow;
286
+ return /* @__PURE__ */ React__default.createElement("header", {
287
+ className: "react-aria-Header",
288
+ ...props,
289
+ ref
290
+ }, props.children);
291
+ }
292
+ const $72a5793c14baf454$export$8b251419efc915eb = /* @__PURE__ */ forwardRef($72a5793c14baf454$var$Header);
293
+ const $431f98aba6844401$export$6615d83f6de245ce = /* @__PURE__ */ createContext({});
294
+ function $431f98aba6844401$var$Separator(originalProps, originalRef) {
295
+ let [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(originalProps, originalRef, $431f98aba6844401$export$6615d83f6de245ce);
296
+ let { elementType, orientation, style, className } = props;
297
+ let Element = elementType || "hr";
298
+ if (Element === "hr" && orientation === "vertical")
299
+ Element = "div";
300
+ let { separatorProps } = $f4b273590fab9f93$export$52210f68a14655d0({
301
+ elementType,
302
+ orientation
303
+ });
304
+ let shallow = $7135fc7d473fd974$export$aeba0b1fb3dcd8b8("separator", originalProps, originalRef);
305
+ if (shallow)
306
+ return shallow;
307
+ return /* @__PURE__ */ React__default.createElement(Element, {
308
+ ...$65484d02dcb7eb3e$export$457c3d6518dd4c6f(props),
309
+ ...separatorProps,
310
+ style,
311
+ className: className !== null && className !== void 0 ? className : "react-aria-Separator",
312
+ ref,
313
+ slot: props.slot || void 0
314
+ });
315
+ }
316
+ const $431f98aba6844401$export$1ff3c3f08ae963c0 = /* @__PURE__ */ forwardRef($431f98aba6844401$var$Separator);
317
+ export {
318
+ $982254629710d113$export$b95089534ab7c1fd as $,
319
+ $2a25aae57d74318e$export$a05409b8bb224a5a as a,
320
+ $453cc9f0df89c0a5$export$77d5aafae4e095b2 as b,
321
+ $431f98aba6844401$export$1ff3c3f08ae963c0 as c,
322
+ $431f98aba6844401$export$6615d83f6de245ce as d,
323
+ $72a5793c14baf454$export$8b251419efc915eb as e,
324
+ $325a3faab7a68acd$export$a16aca283550c30d as f
325
+ };