@eightshift/ui-components 1.0.5 → 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 +52 -70
  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 +27 -15
  59. package/dist/components/responsive/responsive.js +53 -52
  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,13 +1,11 @@
1
1
  const $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY = 7e3;
2
2
  let $319e236875307eab$var$liveAnnouncer = null;
3
3
  function $319e236875307eab$export$a9b970dcc4ae71a9(message, assertiveness = "assertive", timeout = $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY) {
4
- if (!$319e236875307eab$var$liveAnnouncer)
5
- $319e236875307eab$var$liveAnnouncer = new $319e236875307eab$var$LiveAnnouncer();
4
+ if (!$319e236875307eab$var$liveAnnouncer) $319e236875307eab$var$liveAnnouncer = new $319e236875307eab$var$LiveAnnouncer();
6
5
  $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
7
6
  }
8
7
  function $319e236875307eab$export$d10ae4f68404609a(assertiveness) {
9
- if ($319e236875307eab$var$liveAnnouncer)
10
- $319e236875307eab$var$liveAnnouncer.clear(assertiveness);
8
+ if ($319e236875307eab$var$liveAnnouncer) $319e236875307eab$var$liveAnnouncer.clear(assertiveness);
11
9
  }
12
10
  class $319e236875307eab$var$LiveAnnouncer {
13
11
  createLog(ariaLive) {
@@ -18,32 +16,24 @@ class $319e236875307eab$var$LiveAnnouncer {
18
16
  return node;
19
17
  }
20
18
  destroy() {
21
- if (!this.node)
22
- return;
19
+ if (!this.node) return;
23
20
  document.body.removeChild(this.node);
24
21
  this.node = null;
25
22
  }
26
23
  announce(message, assertiveness = "assertive", timeout = $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY) {
27
- if (!this.node)
28
- return;
24
+ if (!this.node) return;
29
25
  let node = document.createElement("div");
30
26
  node.textContent = message;
31
- if (assertiveness === "assertive")
32
- this.assertiveLog.appendChild(node);
33
- else
34
- this.politeLog.appendChild(node);
35
- if (message !== "")
36
- setTimeout(() => {
37
- node.remove();
38
- }, timeout);
27
+ if (assertiveness === "assertive") this.assertiveLog.appendChild(node);
28
+ else this.politeLog.appendChild(node);
29
+ if (message !== "") setTimeout(() => {
30
+ node.remove();
31
+ }, timeout);
39
32
  }
40
33
  clear(assertiveness) {
41
- if (!this.node)
42
- return;
43
- if (!assertiveness || assertiveness === "assertive")
44
- this.assertiveLog.innerHTML = "";
45
- if (!assertiveness || assertiveness === "polite")
46
- this.politeLog.innerHTML = "";
34
+ if (!this.node) return;
35
+ if (!assertiveness || assertiveness === "assertive") this.assertiveLog.innerHTML = "";
36
+ if (!assertiveness || assertiveness === "polite") this.politeLog.innerHTML = "";
47
37
  }
48
38
  constructor() {
49
39
  this.node = document.createElement("div");
@@ -28,15 +28,12 @@ class $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5 {
28
28
  /** Formats a number value as a string, according to the locale and options provided to the constructor. */
29
29
  format(value) {
30
30
  let res = "";
31
- if (!$488c6ddbf4ef74c2$var$supportsSignDisplay && this.options.signDisplay != null)
32
- res = $488c6ddbf4ef74c2$export$711b50b3c525e0f2(this.numberFormatter, this.options.signDisplay, value);
33
- else
34
- res = this.numberFormatter.format(value);
31
+ if (!$488c6ddbf4ef74c2$var$supportsSignDisplay && this.options.signDisplay != null) res = $488c6ddbf4ef74c2$export$711b50b3c525e0f2(this.numberFormatter, this.options.signDisplay, value);
32
+ else res = this.numberFormatter.format(value);
35
33
  if (this.options.style === "unit" && !$488c6ddbf4ef74c2$var$supportsUnit) {
36
34
  var _UNITS_unit;
37
35
  let { unit, unitDisplay = "short", locale } = this.resolvedOptions();
38
- if (!unit)
39
- return res;
36
+ if (!unit) return res;
40
37
  let values = (_UNITS_unit = $488c6ddbf4ef74c2$var$UNITS[unit]) === null || _UNITS_unit === void 0 ? void 0 : _UNITS_unit[unitDisplay];
41
38
  res += values[locale] || values.default;
42
39
  }
@@ -50,16 +47,14 @@ class $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5 {
50
47
  formatRange(start, end) {
51
48
  if (typeof this.numberFormatter.formatRange === "function")
52
49
  return this.numberFormatter.formatRange(start, end);
53
- if (end < start)
54
- throw new RangeError("End date must be >= start date");
50
+ if (end < start) throw new RangeError("End date must be >= start date");
55
51
  return `${this.format(start)} – ${this.format(end)}`;
56
52
  }
57
53
  /** Formats a number range as an array of parts. */
58
54
  formatRangeToParts(start, end) {
59
55
  if (typeof this.numberFormatter.formatRangeToParts === "function")
60
56
  return this.numberFormatter.formatRangeToParts(start, end);
61
- if (end < start)
62
- throw new RangeError("End date must be >= start date");
57
+ if (end < start) throw new RangeError("End date must be >= start date");
63
58
  let startParts = this.numberFormatter.formatToParts(start);
64
59
  let endParts = this.numberFormatter.formatToParts(end);
65
60
  return [
@@ -81,18 +76,16 @@ class $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5 {
81
76
  /** Returns the resolved formatting options based on the values passed to the constructor. */
82
77
  resolvedOptions() {
83
78
  let options = this.numberFormatter.resolvedOptions();
84
- if (!$488c6ddbf4ef74c2$var$supportsSignDisplay && this.options.signDisplay != null)
85
- options = {
86
- ...options,
87
- signDisplay: this.options.signDisplay
88
- };
89
- if (!$488c6ddbf4ef74c2$var$supportsUnit && this.options.style === "unit")
90
- options = {
91
- ...options,
92
- style: "unit",
93
- unit: this.options.unit,
94
- unitDisplay: this.options.unitDisplay
95
- };
79
+ if (!$488c6ddbf4ef74c2$var$supportsSignDisplay && this.options.signDisplay != null) options = {
80
+ ...options,
81
+ signDisplay: this.options.signDisplay
82
+ };
83
+ if (!$488c6ddbf4ef74c2$var$supportsUnit && this.options.style === "unit") options = {
84
+ ...options,
85
+ style: "unit",
86
+ unit: this.options.unit,
87
+ unitDisplay: this.options.unitDisplay
88
+ };
96
89
  return options;
97
90
  }
98
91
  constructor(locale, options = {}) {
@@ -103,43 +96,34 @@ class $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5 {
103
96
  function $488c6ddbf4ef74c2$var$getCachedNumberFormatter(locale, options = {}) {
104
97
  let { numberingSystem } = options;
105
98
  if (numberingSystem && locale.includes("-nu-")) {
106
- if (!locale.includes("-u-"))
107
- locale += "-u-";
99
+ if (!locale.includes("-u-")) locale += "-u-";
108
100
  locale += `-nu-${numberingSystem}`;
109
101
  }
110
102
  if (options.style === "unit" && !$488c6ddbf4ef74c2$var$supportsUnit) {
111
103
  var _UNITS_unit;
112
104
  let { unit, unitDisplay = "short" } = options;
113
- if (!unit)
114
- throw new Error('unit option must be provided with style: "unit"');
115
- if (!((_UNITS_unit = $488c6ddbf4ef74c2$var$UNITS[unit]) === null || _UNITS_unit === void 0 ? void 0 : _UNITS_unit[unitDisplay]))
116
- throw new Error(`Unsupported unit ${unit} with unitDisplay = ${unitDisplay}`);
105
+ if (!unit) throw new Error('unit option must be provided with style: "unit"');
106
+ if (!((_UNITS_unit = $488c6ddbf4ef74c2$var$UNITS[unit]) === null || _UNITS_unit === void 0 ? void 0 : _UNITS_unit[unitDisplay])) throw new Error(`Unsupported unit ${unit} with unitDisplay = ${unitDisplay}`);
117
107
  options = {
118
108
  ...options,
119
109
  style: "decimal"
120
110
  };
121
111
  }
122
112
  let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : "");
123
- if ($488c6ddbf4ef74c2$var$formatterCache.has(cacheKey))
124
- return $488c6ddbf4ef74c2$var$formatterCache.get(cacheKey);
113
+ if ($488c6ddbf4ef74c2$var$formatterCache.has(cacheKey)) return $488c6ddbf4ef74c2$var$formatterCache.get(cacheKey);
125
114
  let numberFormatter = new Intl.NumberFormat(locale, options);
126
115
  $488c6ddbf4ef74c2$var$formatterCache.set(cacheKey, numberFormatter);
127
116
  return numberFormatter;
128
117
  }
129
118
  function $488c6ddbf4ef74c2$export$711b50b3c525e0f2(numberFormat, signDisplay, num) {
130
- if (signDisplay === "auto")
131
- return numberFormat.format(num);
132
- else if (signDisplay === "never")
133
- return numberFormat.format(Math.abs(num));
119
+ if (signDisplay === "auto") return numberFormat.format(num);
120
+ else if (signDisplay === "never") return numberFormat.format(Math.abs(num));
134
121
  else {
135
122
  let needsPositiveSign = false;
136
- if (signDisplay === "always")
137
- needsPositiveSign = num > 0 || Object.is(num, 0);
123
+ if (signDisplay === "always") needsPositiveSign = num > 0 || Object.is(num, 0);
138
124
  else if (signDisplay === "exceptZero") {
139
- if (Object.is(num, -0) || Object.is(num, 0))
140
- num = Math.abs(num);
141
- else
142
- needsPositiveSign = num > 0;
125
+ if (Object.is(num, -0) || Object.is(num, 0)) num = Math.abs(num);
126
+ else needsPositiveSign = num > 0;
143
127
  }
144
128
  if (needsPositiveSign) {
145
129
  let negative = numberFormat.format(-num);
@@ -147,12 +131,10 @@ function $488c6ddbf4ef74c2$export$711b50b3c525e0f2(numberFormat, signDisplay, nu
147
131
  let minus = negative.replace(noSign, "").replace(/\u200e|\u061C/, "");
148
132
  if ([
149
133
  ...minus
150
- ].length !== 1)
151
- console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case");
134
+ ].length !== 1) console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case");
152
135
  let positive = negative.replace(noSign, "!!!").replace(minus, "+").replace("!!!", noSign);
153
136
  return positive;
154
- } else
155
- return numberFormat.format(num);
137
+ } else return numberFormat.format(num);
156
138
  }
157
139
  }
158
140
  export {