@eightshift/ui-components 1.0.6 → 1.1.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 (121) hide show
  1. package/README.md +9 -0
  2. package/dist/{Button-eebLs4cp.js → Button-CbFrFO04.js} +5 -5
  3. package/dist/{Checkbox-BN0TEda-.js → Checkbox-Cv3pZDHg.js} +12 -16
  4. package/dist/{ColorSwatch-BrowHhTG.js → ColorSwatch-CNQmCQV8.js} +6 -7
  5. package/dist/{FieldError-ILxgMZy5.js → FieldError-J1-YPbi6.js} +2 -2
  6. package/dist/{FocusScope-B9b0VMib.js → FocusScope-Bw-IatMO.js} +79 -153
  7. package/dist/{GridList-CzpWxJsS.js → GridList-CEzzyr-l.js} +62 -90
  8. package/dist/{Group-Dkdm2-E7.js → Group-D3Qa6PrV.js} +3 -3
  9. package/dist/{Input-BJA4rmIo.js → Input-CX_rocyZ.js} +8 -8
  10. package/dist/{Label-9x5iLJ-Y.js → Label-Bg5O81Wb.js} +1 -1
  11. package/dist/{ListBox-D3Vr4vvC.js → ListBox-CCWXTj0t.js} +391 -598
  12. package/dist/{LiveAnnouncer-IsokfWQ5.js → LiveAnnouncer-D8h-3GrG.js} +12 -22
  13. package/dist/{NumberFormatter-LzoKy975.js → NumberFormatter-U_Gx0UDq.js} +26 -44
  14. package/dist/{Select-49a62830.esm-CKPmlkza.js → Select-49a62830.esm-BnlXlUnT.js} +92 -166
  15. package/dist/{SelectionManager-sedvcM-1.js → SelectionManager-XOAt-Ekx.js} +219 -401
  16. package/dist/{Separator-B6rnDabE.js → Separator-DZeg0KOr.js} +41 -72
  17. package/dist/{Slider-C5U5N7uM.js → Slider-fULMI0gI.js} +51 -82
  18. package/dist/{Text-Cyxp9ewv.js → Text-WqetJduR.js} +1 -1
  19. package/dist/{VisuallyHidden-BPJVSUyp.js → VisuallyHidden-Di1zXprL.js} +8 -11
  20. package/dist/{ariaHideOutside-ByKBPHmX.js → ariaHideOutside-Zn64-frS.js} +20 -36
  21. package/dist/assets/style.css +1 -1
  22. package/dist/assets/wp-font-enhancements.css +1 -1
  23. package/dist/assets/wp-ui-enhancements.css +1 -1
  24. package/dist/{button-idVI4jmd.js → button-CD8Q1eok.js} +17 -29
  25. package/dist/components/animated-visibility/animated-visibility.js +125 -113
  26. package/dist/components/base-control/base-control.js +3 -9
  27. package/dist/components/breakpoint-preview/breakpoint-preview.js +51 -108
  28. package/dist/components/button/button.js +6 -6
  29. package/dist/components/checkbox/checkbox.js +2 -2
  30. package/dist/components/color-pickers/color-picker.js +2 -2
  31. package/dist/components/color-pickers/color-swatch.js +5 -9
  32. package/dist/components/color-pickers/gradient-editor.js +15 -29
  33. package/dist/components/color-pickers/solid-color-picker.js +81 -128
  34. package/dist/components/component-toggle/component-toggle.js +4 -4
  35. package/dist/components/container-panel/container-panel.js +4 -11
  36. package/dist/components/draggable-list/draggable-list-item.js +4 -4
  37. package/dist/components/draggable-list/draggable-list.js +5 -5
  38. package/dist/components/expandable/expandable.js +45 -57
  39. package/dist/components/index.js +3 -3
  40. package/dist/components/input-field/input-field.js +11 -26
  41. package/dist/components/layout/hstack.js +2 -12
  42. package/dist/components/layout/vstack.js +2 -12
  43. package/dist/components/link-input/link-input.js +36 -53
  44. package/dist/components/list-box/list-box.js +4 -4
  45. package/dist/components/matrix-align/matrix-align.js +6 -10
  46. package/dist/components/menu/menu.js +101 -170
  47. package/dist/components/notice/notice.js +1 -1
  48. package/dist/components/number-picker/number-picker.js +15 -15
  49. package/dist/components/option-select/option-select.js +48 -64
  50. package/dist/components/options-panel/options-panel.js +3 -3
  51. package/dist/components/placeholders/file-placeholder.js +2 -2
  52. package/dist/components/placeholders/image-placeholder.js +1 -1
  53. package/dist/components/placeholders/media-placeholder.js +1 -1
  54. package/dist/components/popover/popover.js +4 -4
  55. package/dist/components/radio/radio.js +25 -38
  56. package/dist/components/repeater/repeater-item.js +6 -17
  57. package/dist/components/repeater/repeater.js +6 -7
  58. package/dist/components/responsive/responsive-legacy.js +6 -12
  59. package/dist/components/responsive/responsive.js +21 -48
  60. package/dist/components/responsive-preview/responsive-preview.js +1 -1
  61. package/dist/components/rich-label/rich-label.js +2 -8
  62. package/dist/components/select/async-multi-select.js +3 -3
  63. package/dist/components/select/async-single-select.js +2 -2
  64. package/dist/components/select/custom-select-default-components.js +2 -2
  65. package/dist/components/select/multi-select-components.js +2 -2
  66. package/dist/components/select/multi-select.js +3 -3
  67. package/dist/components/select/react-select-component-wrappers.js +9 -9
  68. package/dist/components/select/single-select.js +2 -2
  69. package/dist/components/select/styles.js +3 -10
  70. package/dist/components/slider/column-config-slider.js +4 -4
  71. package/dist/components/slider/slider.js +5 -8
  72. package/dist/components/slider/utils.js +2 -6
  73. package/dist/components/spacer/spacer.js +2 -7
  74. package/dist/components/tabs/tabs.js +29 -50
  75. package/dist/components/toggle/switch.js +8 -8
  76. package/dist/components/toggle/toggle.js +1 -1
  77. package/dist/components/toggle-button/toggle-button.js +8 -22
  78. package/dist/components/tooltip/tooltip.js +4 -4
  79. package/dist/{context-BAcFg5GO.js → context-4oSz1ItD.js} +10 -16
  80. package/dist/{default-i18n-Bk1GxDHz.js → default-i18n-BqwLkgZv.js} +21 -22
  81. package/dist/{filterDOMProps-DG2RfOUr.js → filterDOMProps-EDDcM64A.js} +1 -3
  82. package/dist/{focusSafely-B0hyd-S4.js → focusSafely-BS4dllCW.js} +85 -143
  83. package/dist/icons/generic-color-swatch.js +105 -13
  84. package/dist/icons/icons.js +31010 -3447
  85. package/dist/icons/jsx-svg.js +591 -953
  86. package/dist/{index-BDk0TPWz.js → index-CAPcSs9K.js} +1504 -2087
  87. package/dist/{index-a301f526.esm-BzTuHLdr.js → index-a301f526.esm-ByOfDxiG.js} +111 -183
  88. package/dist/index.js +3 -3
  89. package/dist/{intlStrings-Ctkp0HDc.js → intlStrings-Dxaeitoh.js} +35 -60
  90. package/dist/{isScrollable-PcyglExV.js → isScrollable-Dh9D9IOd.js} +1 -2
  91. package/dist/lite-DVmmD_-j.js +7 -0
  92. package/dist/{multi-select-components-nORKdJ-2.js → multi-select-components-7vKCF8dG.js} +3 -3
  93. package/dist/{number-rWqELA8W.js → number-CHmNj-oR.js} +3 -6
  94. package/dist/{popover-o2Q28Ljn.js → popover-Dk2o4S7K.js} +70 -112
  95. package/dist/{react-select-async.esm-CLj9uZTq.js → react-select-async.esm-5zW9Dv9E.js} +7 -11
  96. package/dist/{react-select.esm-3tyTZmrx.js → react-select.esm-Bi6uzjbT.js} +3 -3
  97. package/dist/{textSelection-BRZdHY-4.js → textSelection-exP_9srp.js} +5 -9
  98. package/dist/{tooltip-T6H9uF-Z.js → tooltip-BRQ4tvZL.js} +64 -111
  99. package/dist/{useButton-D-xACzEY.js → useButton-DbjDV_33.js} +19 -22
  100. package/dist/{useEvent-XlYPKgwX.js → useEvent-zvxfEnmK.js} +2 -3
  101. package/dist/{useFocusRing-CRx_hYC4.js → useFocusRing-SPRI0-SN.js} +1 -1
  102. package/dist/{useFocusable-CHfpEdlE.js → useFocusable-CLmhO94g.js} +5 -8
  103. package/dist/{useFormReset-aHn6-wRk.js → useFormReset-BVWgcyGO.js} +2 -3
  104. package/dist/{useFormValidationState-CdYmOaXI.js → useFormValidationState-CthG9Fbc.js} +20 -38
  105. package/dist/{useHasTabbableChild-domoFB7A.js → useHasTabbableChild--gkWUICh.js} +2 -2
  106. package/dist/{useLabel-DVhXVhtH.js → useLabel-g836T8kL.js} +3 -4
  107. package/dist/{useLabels-C7E5SkOi.js → useLabels-CfOtyOe2.js} +3 -5
  108. package/dist/{useListData-BelKu4kx.js → useListData-BpYQj7kK.js} +18 -32
  109. package/dist/{useListState-BRsq7O1C.js → useListState-DnWZa__1.js} +6 -12
  110. package/dist/{useLocalizedStringFormatter-WsEL47qR.js → useLocalizedStringFormatter-BQCMno9k.js} +12 -21
  111. package/dist/{useNumberFieldState-ZH2Qyyxh.js → useNumberFieldState-BegO5X6F.js} +75 -132
  112. package/dist/{useNumberFormatter-mhdYLxWQ.js → useNumberFormatter-DhOGEsEK.js} +2 -2
  113. package/dist/{usePress-B42RawCH.js → usePress-CScNeV3V.js} +92 -175
  114. package/dist/{useToggle-CExfZM8x.js → useToggle-6LnpaJ7-.js} +6 -7
  115. package/dist/{useToggleState-DghG5ImG.js → useToggleState-Cymkpac8.js} +3 -5
  116. package/dist/utilities/array-helpers.js +1 -1
  117. package/dist/utilities/index.js +1 -1
  118. package/dist/utilities/text-helpers.js +20 -20
  119. package/dist/{utils-DIBzm1e4.js → utils-Dc35LwuT.js} +49 -90
  120. package/package.json +96 -90
  121. package/dist/lite-pbIeT7tm.js +0 -8
@@ -1,20 +1,18 @@
1
- import { g as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, f as $8ae05eaa5c114e9c$export$7f54fc3180508a52, o as $b5e257d569688ac6$export$535bd6ca7f90a273 } from "./utils-DIBzm1e4.js";
1
+ import { g as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, f as $8ae05eaa5c114e9c$export$7f54fc3180508a52, o as $b5e257d569688ac6$export$535bd6ca7f90a273 } from "./utils-Dc35LwuT.js";
2
2
  import { useState, useRef, useEffect, useCallback, useMemo } from "react";
3
3
  const $431fbd86ca7dc216$export$b204af158042fbac = (el) => {
4
4
  var _el_ownerDocument;
5
5
  return (_el_ownerDocument = el === null || el === void 0 ? void 0 : el.ownerDocument) !== null && _el_ownerDocument !== void 0 ? _el_ownerDocument : document;
6
6
  };
7
7
  const $431fbd86ca7dc216$export$f21a1ffae260145a = (el) => {
8
- if (el && "window" in el && el.window === el)
9
- return el;
8
+ if (el && "window" in el && el.window === el) return el;
10
9
  const doc = $431fbd86ca7dc216$export$b204af158042fbac(el);
11
10
  return doc.defaultView || window;
12
11
  };
13
12
  function $7215afc6de606d6b$export$de79e2c695e052f3(element) {
14
- if ($7215afc6de606d6b$var$supportsPreventScroll())
15
- element.focus({
16
- preventScroll: true
17
- });
13
+ if ($7215afc6de606d6b$var$supportsPreventScroll()) element.focus({
14
+ preventScroll: true
15
+ });
18
16
  else {
19
17
  let scrollableElements = $7215afc6de606d6b$var$getScrollableElements(element);
20
18
  element.focus();
@@ -43,20 +41,18 @@ function $7215afc6de606d6b$var$getScrollableElements(element) {
43
41
  let scrollableElements = [];
44
42
  let rootScrollingElement = document.scrollingElement || document.documentElement;
45
43
  while (parent instanceof HTMLElement && parent !== rootScrollingElement) {
46
- if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth)
47
- scrollableElements.push({
48
- element: parent,
49
- scrollTop: parent.scrollTop,
50
- scrollLeft: parent.scrollLeft
51
- });
44
+ if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({
45
+ element: parent,
46
+ scrollTop: parent.scrollTop,
47
+ scrollLeft: parent.scrollLeft
48
+ });
52
49
  parent = parent.parentNode;
53
50
  }
54
- if (rootScrollingElement instanceof HTMLElement)
55
- scrollableElements.push({
56
- element: rootScrollingElement,
57
- scrollTop: rootScrollingElement.scrollTop,
58
- scrollLeft: rootScrollingElement.scrollLeft
59
- });
51
+ if (rootScrollingElement instanceof HTMLElement) scrollableElements.push({
52
+ element: rootScrollingElement,
53
+ scrollTop: rootScrollingElement.scrollTop,
54
+ scrollLeft: rootScrollingElement.scrollLeft
55
+ });
60
56
  return scrollableElements;
61
57
  }
62
58
  function $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements) {
@@ -67,8 +63,7 @@ function $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements) {
67
63
  }
68
64
  function $c87311424ea30a05$var$testUserAgent(re) {
69
65
  var _window_navigator_userAgentData;
70
- if (typeof window === "undefined" || window.navigator == null)
71
- return false;
66
+ if (typeof window === "undefined" || window.navigator == null) return false;
72
67
  return ((_window_navigator_userAgentData = window.navigator["userAgentData"]) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands.some((brand) => re.test(brand.brand))) || re.test(window.navigator.userAgent);
73
68
  }
74
69
  function $c87311424ea30a05$var$testPlatform(re) {
@@ -106,14 +101,12 @@ function $c87311424ea30a05$export$b7d78993b74f766d() {
106
101
  let $bbed8b41f857bcc0$var$transitionsByElement = /* @__PURE__ */ new Map();
107
102
  let $bbed8b41f857bcc0$var$transitionCallbacks = /* @__PURE__ */ new Set();
108
103
  function $bbed8b41f857bcc0$var$setupGlobalEvents() {
109
- if (typeof window === "undefined")
110
- return;
104
+ if (typeof window === "undefined") return;
111
105
  function isTransitionEvent(event) {
112
106
  return "propertyName" in event;
113
107
  }
114
108
  let onTransitionStart = (e) => {
115
- if (!isTransitionEvent(e) || !e.target)
116
- return;
109
+ if (!isTransitionEvent(e) || !e.target) return;
117
110
  let transitions = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
118
111
  if (!transitions) {
119
112
  transitions = /* @__PURE__ */ new Set();
@@ -125,19 +118,16 @@ function $bbed8b41f857bcc0$var$setupGlobalEvents() {
125
118
  transitions.add(e.propertyName);
126
119
  };
127
120
  let onTransitionEnd = (e) => {
128
- if (!isTransitionEvent(e) || !e.target)
129
- return;
121
+ if (!isTransitionEvent(e) || !e.target) return;
130
122
  let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
131
- if (!properties)
132
- return;
123
+ if (!properties) return;
133
124
  properties.delete(e.propertyName);
134
125
  if (properties.size === 0) {
135
126
  e.target.removeEventListener("transitioncancel", onTransitionEnd);
136
127
  $bbed8b41f857bcc0$var$transitionsByElement.delete(e.target);
137
128
  }
138
129
  if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) {
139
- for (let cb of $bbed8b41f857bcc0$var$transitionCallbacks)
140
- cb();
130
+ for (let cb of $bbed8b41f857bcc0$var$transitionCallbacks) cb();
141
131
  $bbed8b41f857bcc0$var$transitionCallbacks.clear();
142
132
  }
143
133
  };
@@ -145,17 +135,13 @@ function $bbed8b41f857bcc0$var$setupGlobalEvents() {
145
135
  document.body.addEventListener("transitionend", onTransitionEnd);
146
136
  }
147
137
  if (typeof document !== "undefined") {
148
- if (document.readyState !== "loading")
149
- $bbed8b41f857bcc0$var$setupGlobalEvents();
150
- else
151
- document.addEventListener("DOMContentLoaded", $bbed8b41f857bcc0$var$setupGlobalEvents);
138
+ if (document.readyState !== "loading") $bbed8b41f857bcc0$var$setupGlobalEvents();
139
+ else document.addEventListener("DOMContentLoaded", $bbed8b41f857bcc0$var$setupGlobalEvents);
152
140
  }
153
141
  function $bbed8b41f857bcc0$export$24490316f764c430(fn) {
154
142
  requestAnimationFrame(() => {
155
- if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0)
156
- fn();
157
- else
158
- $bbed8b41f857bcc0$var$transitionCallbacks.add(fn);
143
+ if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) fn();
144
+ else $bbed8b41f857bcc0$var$transitionCallbacks.add(fn);
159
145
  });
160
146
  }
161
147
  function $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, ref) {
@@ -163,17 +149,14 @@ function $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, ref) {
163
149
  if (context && context.ref && ref) {
164
150
  context.ref.current = ref.current;
165
151
  return () => {
166
- if (context.ref)
167
- context.ref.current = null;
152
+ if (context.ref) context.ref.current = null;
168
153
  };
169
154
  }
170
155
  });
171
156
  }
172
157
  function $6a7db85432448f7f$export$60278871457622de(event) {
173
- if (event.mozInputSource === 0 && event.isTrusted)
174
- return true;
175
- if ($c87311424ea30a05$export$a11b0059900ceec8() && event.pointerType)
176
- return event.type === "click" && event.buttons === 1;
158
+ if (event.mozInputSource === 0 && event.isTrusted) return true;
159
+ if ($c87311424ea30a05$export$a11b0059900ceec8() && event.pointerType) return event.type === "click" && event.buttons === 1;
177
160
  return event.detail === 0 && !event.pointerType;
178
161
  }
179
162
  function $6a7db85432448f7f$export$29bf1b5f2c56cf63(event) {
@@ -185,8 +168,7 @@ function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange
185
168
  let isControlled = value !== void 0;
186
169
  useEffect(() => {
187
170
  let wasControlled = isControlledRef.current;
188
- if (wasControlled !== isControlled)
189
- console.warn(`WARN: A component changed from ${wasControlled ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}.`);
171
+ if (wasControlled !== isControlled) console.warn(`WARN: A component changed from ${wasControlled ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}.`);
190
172
  isControlledRef.current = isControlled;
191
173
  }, [
192
174
  isControlled
@@ -195,8 +177,7 @@ function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange
195
177
  let setValue = useCallback((value2, ...args) => {
196
178
  let onChangeCaller = (value3, ...onChangeArgs) => {
197
179
  if (onChange) {
198
- if (!Object.is(currentValue, value3))
199
- onChange(value3, ...onChangeArgs);
180
+ if (!Object.is(currentValue, value3)) onChange(value3, ...onChangeArgs);
200
181
  }
201
182
  if (!isControlled)
202
183
  currentValue = value3;
@@ -206,14 +187,12 @@ function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange
206
187
  let updateFunction = (oldValue, ...functionArgs) => {
207
188
  let interceptedValue = value2(isControlled ? currentValue : oldValue, ...functionArgs);
208
189
  onChangeCaller(interceptedValue, ...args);
209
- if (!isControlled)
210
- return interceptedValue;
190
+ if (!isControlled) return interceptedValue;
211
191
  return oldValue;
212
192
  };
213
193
  setStateValue(updateFunction);
214
194
  } else {
215
- if (!isControlled)
216
- setStateValue(value2);
195
+ if (!isControlled) setStateValue(value2);
217
196
  onChangeCaller(value2, ...args);
218
197
  }
219
198
  }, [
@@ -319,10 +298,8 @@ function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
319
298
  let { isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange } = props;
320
299
  const onBlur = useCallback((e) => {
321
300
  if (e.target === e.currentTarget) {
322
- if (onBlurProp)
323
- onBlurProp(e);
324
- if (onFocusChange)
325
- onFocusChange(false);
301
+ if (onBlurProp) onBlurProp(e);
302
+ if (onFocusChange) onFocusChange(false);
326
303
  return true;
327
304
  }
328
305
  }, [
@@ -333,10 +310,8 @@ function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
333
310
  const onFocus = useCallback((e) => {
334
311
  const ownerDocument = $431fbd86ca7dc216$export$b204af158042fbac(e.target);
335
312
  if (e.target === e.currentTarget && ownerDocument.activeElement === e.target) {
336
- if (onFocusProp)
337
- onFocusProp(e);
338
- if (onFocusChange)
339
- onFocusChange(true);
313
+ if (onFocusProp) onFocusProp(e);
314
+ if (onFocusChange) onFocusChange(true);
340
315
  onSyntheticFocus(e);
341
316
  }
342
317
  }, [
@@ -361,8 +336,7 @@ const $507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS = {
361
336
  Escape: true
362
337
  };
363
338
  function $507fabe10e71c6fb$var$triggerChangeHandlers(modality, e) {
364
- for (let handler of $507fabe10e71c6fb$var$changeHandlers)
365
- handler(modality, e);
339
+ for (let handler of $507fabe10e71c6fb$var$changeHandlers) handler(modality, e);
366
340
  }
367
341
  function $507fabe10e71c6fb$var$isValidKey(e) {
368
342
  return !(e.metaKey || !$c87311424ea30a05$export$9ac100e40613ea10() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
@@ -388,8 +362,7 @@ function $507fabe10e71c6fb$var$handleClickEvent(e) {
388
362
  }
389
363
  }
390
364
  function $507fabe10e71c6fb$var$handleFocusEvent(e) {
391
- if (e.target === window || e.target === document)
392
- return;
365
+ if (e.target === window || e.target === document) return;
393
366
  if (!$507fabe10e71c6fb$var$hasEventBeforeFocus && !$507fabe10e71c6fb$var$hasBlurredWindowRecently) {
394
367
  $507fabe10e71c6fb$var$currentModality = "virtual";
395
368
  $507fabe10e71c6fb$var$triggerChangeHandlers("virtual", e);
@@ -402,8 +375,7 @@ function $507fabe10e71c6fb$var$handleWindowBlur() {
402
375
  $507fabe10e71c6fb$var$hasBlurredWindowRecently = true;
403
376
  }
404
377
  function $507fabe10e71c6fb$var$setupGlobalFocusEvents(element) {
405
- if (typeof window === "undefined" || $507fabe10e71c6fb$export$d90243b58daecda7.get($431fbd86ca7dc216$export$f21a1ffae260145a(element)))
406
- return;
378
+ if (typeof window === "undefined" || $507fabe10e71c6fb$export$d90243b58daecda7.get($431fbd86ca7dc216$export$f21a1ffae260145a(element))) return;
407
379
  const windowObject = $431fbd86ca7dc216$export$f21a1ffae260145a(element);
408
380
  const documentObject = $431fbd86ca7dc216$export$b204af158042fbac(element);
409
381
  let focus = windowObject.HTMLElement.prototype.focus;
@@ -437,10 +409,8 @@ function $507fabe10e71c6fb$var$setupGlobalFocusEvents(element) {
437
409
  const $507fabe10e71c6fb$var$tearDownWindowFocusTracking = (element, loadListener) => {
438
410
  const windowObject = $431fbd86ca7dc216$export$f21a1ffae260145a(element);
439
411
  const documentObject = $431fbd86ca7dc216$export$b204af158042fbac(element);
440
- if (loadListener)
441
- documentObject.removeEventListener("DOMContentLoaded", loadListener);
442
- if (!$507fabe10e71c6fb$export$d90243b58daecda7.has(windowObject))
443
- return;
412
+ if (loadListener) documentObject.removeEventListener("DOMContentLoaded", loadListener);
413
+ if (!$507fabe10e71c6fb$export$d90243b58daecda7.has(windowObject)) return;
444
414
  windowObject.HTMLElement.prototype.focus = $507fabe10e71c6fb$export$d90243b58daecda7.get(windowObject).focus;
445
415
  documentObject.removeEventListener("keydown", $507fabe10e71c6fb$var$handleKeyboardEvent, true);
446
416
  documentObject.removeEventListener("keyup", $507fabe10e71c6fb$var$handleKeyboardEvent, true);
@@ -461,8 +431,7 @@ const $507fabe10e71c6fb$var$tearDownWindowFocusTracking = (element, loadListener
461
431
  function $507fabe10e71c6fb$export$2f1888112f558a7d(element) {
462
432
  const documentObject = $431fbd86ca7dc216$export$b204af158042fbac(element);
463
433
  let loadListener;
464
- if (documentObject.readyState !== "loading")
465
- $507fabe10e71c6fb$var$setupGlobalFocusEvents(element);
434
+ if (documentObject.readyState !== "loading") $507fabe10e71c6fb$var$setupGlobalFocusEvents(element);
466
435
  else {
467
436
  loadListener = () => {
468
437
  $507fabe10e71c6fb$var$setupGlobalFocusEvents(element);
@@ -471,8 +440,7 @@ function $507fabe10e71c6fb$export$2f1888112f558a7d(element) {
471
440
  }
472
441
  return () => $507fabe10e71c6fb$var$tearDownWindowFocusTracking(element, loadListener);
473
442
  }
474
- if (typeof document !== "undefined")
475
- $507fabe10e71c6fb$export$2f1888112f558a7d();
443
+ if (typeof document !== "undefined") $507fabe10e71c6fb$export$2f1888112f558a7d();
476
444
  function $507fabe10e71c6fb$export$b9b3dfddab17db27() {
477
445
  return $507fabe10e71c6fb$var$currentModality !== "pointer";
478
446
  }
@@ -521,8 +489,7 @@ function $507fabe10e71c6fb$export$ec71b4b83ac08ec3(fn, deps, opts) {
521
489
  $507fabe10e71c6fb$var$setupGlobalFocusEvents();
522
490
  useEffect(() => {
523
491
  let handler = (modality, e) => {
524
- if (!$507fabe10e71c6fb$var$isKeyboardFocusEvent(!!(opts === null || opts === void 0 ? void 0 : opts.isTextInput), modality, e))
525
- return;
492
+ if (!$507fabe10e71c6fb$var$isKeyboardFocusEvent(!!(opts === null || opts === void 0 ? void 0 : opts.isTextInput), modality, e)) return;
526
493
  fn($507fabe10e71c6fb$export$b9b3dfddab17db27());
527
494
  };
528
495
  $507fabe10e71c6fb$var$changeHandlers.add(handler);
@@ -539,10 +506,8 @@ function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
539
506
  let onBlur = useCallback((e) => {
540
507
  if (state.current.isFocusWithin && !e.currentTarget.contains(e.relatedTarget)) {
541
508
  state.current.isFocusWithin = false;
542
- if (onBlurWithin)
543
- onBlurWithin(e);
544
- if (onFocusWithinChange)
545
- onFocusWithinChange(false);
509
+ if (onBlurWithin) onBlurWithin(e);
510
+ if (onFocusWithinChange) onFocusWithinChange(false);
546
511
  }
547
512
  }, [
548
513
  onBlurWithin,
@@ -552,10 +517,8 @@ function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
552
517
  let onSyntheticFocus = $8a9cb279dc87e130$export$715c682d09d639cc(onBlur);
553
518
  let onFocus = useCallback((e) => {
554
519
  if (!state.current.isFocusWithin && document.activeElement === e.target) {
555
- if (onFocusWithin)
556
- onFocusWithin(e);
557
- if (onFocusWithinChange)
558
- onFocusWithinChange(true);
520
+ if (onFocusWithin) onFocusWithin(e);
521
+ if (onFocusWithinChange) onFocusWithinChange(true);
559
522
  state.current.isFocusWithin = true;
560
523
  onSyntheticFocus(e);
561
524
  }
@@ -564,14 +527,13 @@ function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
564
527
  onFocusWithinChange,
565
528
  onSyntheticFocus
566
529
  ]);
567
- if (isDisabled)
568
- return {
569
- focusWithinProps: {
570
- // These should not have been null, that would conflict in mergeProps
571
- onFocus: void 0,
572
- onBlur: void 0
573
- }
574
- };
530
+ if (isDisabled) return {
531
+ focusWithinProps: {
532
+ // These should not have been null, that would conflict in mergeProps
533
+ onFocus: void 0,
534
+ onBlur: void 0
535
+ }
536
+ };
575
537
  return {
576
538
  focusWithinProps: {
577
539
  onFocus,
@@ -588,25 +550,18 @@ function $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents() {
588
550
  }, 50);
589
551
  }
590
552
  function $6179b936705e76d3$var$handleGlobalPointerEvent(e) {
591
- if (e.pointerType === "touch")
592
- $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents();
553
+ if (e.pointerType === "touch") $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents();
593
554
  }
594
555
  function $6179b936705e76d3$var$setupGlobalTouchEvents() {
595
- if (typeof document === "undefined")
596
- return;
597
- if (typeof PointerEvent !== "undefined")
598
- document.addEventListener("pointerup", $6179b936705e76d3$var$handleGlobalPointerEvent);
599
- else
600
- document.addEventListener("touchend", $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
556
+ if (typeof document === "undefined") return;
557
+ if (typeof PointerEvent !== "undefined") document.addEventListener("pointerup", $6179b936705e76d3$var$handleGlobalPointerEvent);
558
+ else document.addEventListener("touchend", $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
601
559
  $6179b936705e76d3$var$hoverCount++;
602
560
  return () => {
603
561
  $6179b936705e76d3$var$hoverCount--;
604
- if ($6179b936705e76d3$var$hoverCount > 0)
605
- return;
606
- if (typeof PointerEvent !== "undefined")
607
- document.removeEventListener("pointerup", $6179b936705e76d3$var$handleGlobalPointerEvent);
608
- else
609
- document.removeEventListener("touchend", $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
562
+ if ($6179b936705e76d3$var$hoverCount > 0) return;
563
+ if (typeof PointerEvent !== "undefined") document.removeEventListener("pointerup", $6179b936705e76d3$var$handleGlobalPointerEvent);
564
+ else document.removeEventListener("touchend", $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
610
565
  };
611
566
  }
612
567
  function $6179b936705e76d3$export$ae780daf29e6d456(props) {
@@ -622,61 +577,51 @@ function $6179b936705e76d3$export$ae780daf29e6d456(props) {
622
577
  let { hoverProps, triggerHoverEnd } = useMemo(() => {
623
578
  let triggerHoverStart = (event, pointerType) => {
624
579
  state.pointerType = pointerType;
625
- if (isDisabled || pointerType === "touch" || state.isHovered || !event.currentTarget.contains(event.target))
626
- return;
580
+ if (isDisabled || pointerType === "touch" || state.isHovered || !event.currentTarget.contains(event.target)) return;
627
581
  state.isHovered = true;
628
582
  let target = event.currentTarget;
629
583
  state.target = target;
630
- if (onHoverStart)
631
- onHoverStart({
632
- type: "hoverstart",
633
- target,
634
- pointerType
635
- });
636
- if (onHoverChange)
637
- onHoverChange(true);
584
+ if (onHoverStart) onHoverStart({
585
+ type: "hoverstart",
586
+ target,
587
+ pointerType
588
+ });
589
+ if (onHoverChange) onHoverChange(true);
638
590
  setHovered(true);
639
591
  };
640
592
  let triggerHoverEnd2 = (event, pointerType) => {
641
593
  state.pointerType = "";
642
594
  state.target = null;
643
- if (pointerType === "touch" || !state.isHovered)
644
- return;
595
+ if (pointerType === "touch" || !state.isHovered) return;
645
596
  state.isHovered = false;
646
597
  let target = event.currentTarget;
647
- if (onHoverEnd)
648
- onHoverEnd({
649
- type: "hoverend",
650
- target,
651
- pointerType
652
- });
653
- if (onHoverChange)
654
- onHoverChange(false);
598
+ if (onHoverEnd) onHoverEnd({
599
+ type: "hoverend",
600
+ target,
601
+ pointerType
602
+ });
603
+ if (onHoverChange) onHoverChange(false);
655
604
  setHovered(false);
656
605
  };
657
606
  let hoverProps2 = {};
658
607
  if (typeof PointerEvent !== "undefined") {
659
608
  hoverProps2.onPointerEnter = (e) => {
660
- if ($6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents && e.pointerType === "mouse")
661
- return;
609
+ if ($6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents && e.pointerType === "mouse") return;
662
610
  triggerHoverStart(e, e.pointerType);
663
611
  };
664
612
  hoverProps2.onPointerLeave = (e) => {
665
- if (!isDisabled && e.currentTarget.contains(e.target))
666
- triggerHoverEnd2(e, e.pointerType);
613
+ if (!isDisabled && e.currentTarget.contains(e.target)) triggerHoverEnd2(e, e.pointerType);
667
614
  };
668
615
  } else {
669
616
  hoverProps2.onTouchStart = () => {
670
617
  state.ignoreEmulatedMouseEvents = true;
671
618
  };
672
619
  hoverProps2.onMouseEnter = (e) => {
673
- if (!state.ignoreEmulatedMouseEvents && !$6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents)
674
- triggerHoverStart(e, "mouse");
620
+ if (!state.ignoreEmulatedMouseEvents && !$6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents) triggerHoverStart(e, "mouse");
675
621
  state.ignoreEmulatedMouseEvents = false;
676
622
  };
677
623
  hoverProps2.onMouseLeave = (e) => {
678
- if (!isDisabled && e.currentTarget.contains(e.target))
679
- triggerHoverEnd2(e, "mouse");
624
+ if (!isDisabled && e.currentTarget.contains(e.target)) triggerHoverEnd2(e, "mouse");
680
625
  };
681
626
  }
682
627
  return {
@@ -691,10 +636,9 @@ function $6179b936705e76d3$export$ae780daf29e6d456(props) {
691
636
  state
692
637
  ]);
693
638
  useEffect(() => {
694
- if (isDisabled)
695
- triggerHoverEnd({
696
- currentTarget: state.target
697
- }, state.pointerType);
639
+ if (isDisabled) triggerHoverEnd({
640
+ currentTarget: state.target
641
+ }, state.pointerType);
698
642
  }, [
699
643
  isDisabled
700
644
  ]);
@@ -708,11 +652,9 @@ function $6a99195332edec8b$export$80f3e147d781571c(element) {
708
652
  if ($507fabe10e71c6fb$export$630ff653c5ada6a9() === "virtual") {
709
653
  let lastFocusedElement = ownerDocument.activeElement;
710
654
  $bbed8b41f857bcc0$export$24490316f764c430(() => {
711
- if (ownerDocument.activeElement === lastFocusedElement && element.isConnected)
712
- $7215afc6de606d6b$export$de79e2c695e052f3(element);
655
+ if (ownerDocument.activeElement === lastFocusedElement && element.isConnected) $7215afc6de606d6b$export$de79e2c695e052f3(element);
713
656
  });
714
- } else
715
- $7215afc6de606d6b$export$de79e2c695e052f3(element);
657
+ } else $7215afc6de606d6b$export$de79e2c695e052f3(element);
716
658
  }
717
659
  export {
718
660
  $6179b936705e76d3$export$ae780daf29e6d456 as $,
@@ -2,19 +2,111 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useId } from "react";
3
3
  const GenericColorSwatch = ({ style }) => {
4
4
  const clipId = useId();
5
- return /* @__PURE__ */ jsxs("svg", { style, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
6
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: `genericColorSwatchShape-${clipId}`, children: /* @__PURE__ */ jsx("rect", { className: "generic-swatch-icon-color-mask", x: "1", y: "1", width: "18", height: "18", rx: "2" }) }) }),
7
- /* @__PURE__ */ jsxs("g", { opacity: "var(--checkerboard-opacity, 0)", clipPath: `url(#genericColorSwatchShape-${clipId})`, className: "generic-swatch-icon-checkerboard-group", children: [
8
- /* @__PURE__ */ jsx("path", { fill: "#CCC", d: "M1 1h3v3H1V1zm0 6h3v3H1zm0 6h3v3H1zM7 1h3v3H7zm0 6h3v3H7zm0 6h3v3H7zm6-12h3v3h-3zm0 6h3v3h-3zm0 6h3v3h-3z" }),
9
- /* @__PURE__ */ jsx("path", { fill: "#fff", d: "M4 1h3v3H4zm0 6h3v3H4zm0 6h3v3H4zm6-12h3v3h-3zm0 6h3v3h-3zm0 6h3v3h-3zm6-12h3v3h-3V1zm0 6h3v3h-3zm0 6h3v3h-3z" }),
10
- /* @__PURE__ */ jsx("path", { fill: "#CCC", d: "M4 4h3v3H4zm0 6h3v3H4zm0 6h3v3H4zm6-12h3v3h-3zm0 6h3v3h-3zm0 6h3v3h-3zm6-12h3v3h-3zm0 6h3v3h-3zm0 6h3v3h-3v-3z" }),
11
- /* @__PURE__ */ jsx("path", { fill: "#fff", d: "M1 4h3v3H1zm0 6h3v3H1zm0 6h3v3H1v-3zM7 4h3v3H7zm0 6h3v3H7zm0 6h3v3H7zm6-12h3v3h-3zm0 6h3v3h-3zm0 6h3v3h-3z" })
12
- ] }),
13
- /* @__PURE__ */ jsx("rect", { className: "generic-swatch-icon-color", x: "1", y: "1", width: "18", height: "18", rx: "2", fill: "var(--selected-color, currentColor)", stroke: "gray" }),
14
- /* @__PURE__ */ jsx("path", { opacity: "var(--selected-opacity, 0)", d: "M4 16 16 4", stroke: "gray", strokeLinejoin: "round", fill: "none" }),
15
- /* @__PURE__ */ jsx("circle", { opacity: "var(--current-opacity, 0)", cx: "10", cy: "10", r: "4.5", fill: "#fff" }),
16
- /* @__PURE__ */ jsx("circle", { opacity: "var(--current-opacity, 0)", cx: "10", cy: "10", r: "2.5", fill: "#000" })
17
- ] });
5
+ return /* @__PURE__ */ jsxs(
6
+ "svg",
7
+ {
8
+ style,
9
+ width: "20",
10
+ height: "20",
11
+ viewBox: "0 0 20 20",
12
+ fill: "none",
13
+ xmlns: "http://www.w3.org/2000/svg",
14
+ children: [
15
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: `genericColorSwatchShape-${clipId}`, children: /* @__PURE__ */ jsx(
16
+ "rect",
17
+ {
18
+ className: "generic-swatch-icon-color-mask",
19
+ x: "1",
20
+ y: "1",
21
+ width: "18",
22
+ height: "18",
23
+ rx: "2"
24
+ }
25
+ ) }) }),
26
+ /* @__PURE__ */ jsxs(
27
+ "g",
28
+ {
29
+ opacity: "var(--checkerboard-opacity, 0)",
30
+ clipPath: `url(#genericColorSwatchShape-${clipId})`,
31
+ className: "generic-swatch-icon-checkerboard-group",
32
+ children: [
33
+ /* @__PURE__ */ jsx(
34
+ "path",
35
+ {
36
+ fill: "#CCC",
37
+ d: "M1 1h3v3H1V1zm0 6h3v3H1zm0 6h3v3H1zM7 1h3v3H7zm0 6h3v3H7zm0 6h3v3H7zm6-12h3v3h-3zm0 6h3v3h-3zm0 6h3v3h-3z"
38
+ }
39
+ ),
40
+ /* @__PURE__ */ jsx(
41
+ "path",
42
+ {
43
+ fill: "#fff",
44
+ d: "M4 1h3v3H4zm0 6h3v3H4zm0 6h3v3H4zm6-12h3v3h-3zm0 6h3v3h-3zm0 6h3v3h-3zm6-12h3v3h-3V1zm0 6h3v3h-3zm0 6h3v3h-3z"
45
+ }
46
+ ),
47
+ /* @__PURE__ */ jsx(
48
+ "path",
49
+ {
50
+ fill: "#CCC",
51
+ d: "M4 4h3v3H4zm0 6h3v3H4zm0 6h3v3H4zm6-12h3v3h-3zm0 6h3v3h-3zm0 6h3v3h-3zm6-12h3v3h-3zm0 6h3v3h-3zm0 6h3v3h-3v-3z"
52
+ }
53
+ ),
54
+ /* @__PURE__ */ jsx(
55
+ "path",
56
+ {
57
+ fill: "#fff",
58
+ d: "M1 4h3v3H1zm0 6h3v3H1zm0 6h3v3H1v-3zM7 4h3v3H7zm0 6h3v3H7zm0 6h3v3H7zm6-12h3v3h-3zm0 6h3v3h-3zm0 6h3v3h-3z"
59
+ }
60
+ )
61
+ ]
62
+ }
63
+ ),
64
+ /* @__PURE__ */ jsx(
65
+ "rect",
66
+ {
67
+ className: "generic-swatch-icon-color",
68
+ x: "1",
69
+ y: "1",
70
+ width: "18",
71
+ height: "18",
72
+ rx: "2",
73
+ fill: "var(--selected-color, currentColor)",
74
+ stroke: "gray"
75
+ }
76
+ ),
77
+ /* @__PURE__ */ jsx(
78
+ "path",
79
+ {
80
+ opacity: "var(--selected-opacity, 0)",
81
+ d: "M4 16 16 4",
82
+ stroke: "gray",
83
+ strokeLinejoin: "round",
84
+ fill: "none"
85
+ }
86
+ ),
87
+ /* @__PURE__ */ jsx(
88
+ "circle",
89
+ {
90
+ opacity: "var(--current-opacity, 0)",
91
+ cx: "10",
92
+ cy: "10",
93
+ r: "4.5",
94
+ fill: "#fff"
95
+ }
96
+ ),
97
+ /* @__PURE__ */ jsx(
98
+ "circle",
99
+ {
100
+ opacity: "var(--current-opacity, 0)",
101
+ cx: "10",
102
+ cy: "10",
103
+ r: "2.5",
104
+ fill: "#000"
105
+ }
106
+ )
107
+ ]
108
+ }
109
+ );
18
110
  };
19
111
  export {
20
112
  GenericColorSwatch