@eightshift/ui-components 5.0.0 → 5.0.2

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 (144) hide show
  1. package/dist/Button-BpwTmkAe.js +185 -0
  2. package/dist/Collection-n5d0zIgb.js +2398 -0
  3. package/dist/Color-lVhk8V_G.js +2452 -0
  4. package/dist/ColorSwatch-DntWEAC3.js +64 -0
  5. package/dist/ComboBox-BJpTEATT.js +1915 -0
  6. package/dist/Dialog-O9uw63D7.js +2317 -0
  7. package/dist/FieldError-DHrSdE_Q.js +42 -0
  8. package/dist/FocusScope-BEPI2m7u.js +831 -0
  9. package/dist/Form-Cq3fu75_.js +5 -0
  10. package/dist/Group-DDPhPPTQ.js +48 -0
  11. package/dist/Heading-ba38ScjJ.js +16 -0
  12. package/dist/Hidden-rE6uR-lr.js +41 -0
  13. package/dist/Input-BmDS8Juy.js +133 -0
  14. package/dist/Label-JS_ob-kh.js +17 -0
  15. package/dist/List-CZMUbkFU.js +593 -0
  16. package/dist/ListBox-BTxlCGcc.js +664 -0
  17. package/dist/NumberFormatter-DA8u1Ot7.js +140 -0
  18. package/dist/OverlayArrow-5aDgmImj.js +637 -0
  19. package/dist/RSPContexts-2lR5GG9p.js +14 -0
  20. package/dist/Select-aab027f3.esm-BKIJGje-.js +2469 -0
  21. package/dist/Separator-CaTBkETC.js +332 -0
  22. package/dist/Slider-C-S1oEH9.js +853 -0
  23. package/dist/Text-BuJgePCv.js +16 -0
  24. package/dist/VisuallyHidden-BYi0pekx.js +48 -0
  25. package/dist/_commonjsHelpers-CUmg6egw.js +6 -0
  26. package/dist/assets/index.css +57 -0
  27. package/dist/assets/style-admin.css +5908 -0
  28. package/dist/assets/style-editor.css +5908 -0
  29. package/dist/assets/style.css +5914 -0
  30. package/dist/assets/wp-font-enhancements.css +8 -0
  31. package/dist/assets/wp-ui-enhancements.css +396 -0
  32. package/dist/components/animated-visibility/animated-visibility.js +105 -0
  33. package/dist/components/base-control/base-control.js +86 -0
  34. package/dist/components/breakpoint-preview/breakpoint-preview.js +161 -0
  35. package/dist/components/button/button.js +387 -0
  36. package/dist/components/checkbox/checkbox.js +323 -0
  37. package/dist/components/color-pickers/color-picker.js +272 -0
  38. package/dist/components/color-pickers/color-swatch.js +59 -0
  39. package/dist/components/color-pickers/gradient-editor.js +534 -0
  40. package/dist/components/color-pickers/solid-color-picker.js +1567 -0
  41. package/dist/components/component-toggle/component-toggle.js +161 -0
  42. package/dist/components/container-panel/container-panel.js +131 -0
  43. package/dist/components/draggable/draggable-context.js +5 -0
  44. package/dist/components/draggable/draggable-handle.js +46 -0
  45. package/dist/components/draggable/draggable.js +7320 -0
  46. package/dist/components/draggable-list/draggable-list-context.js +5 -0
  47. package/dist/components/draggable-list/draggable-list-item.js +77 -0
  48. package/dist/components/draggable-list/draggable-list.js +151 -0
  49. package/dist/components/expandable/expandable.js +342 -0
  50. package/dist/components/index.js +137 -0
  51. package/dist/components/input-field/input-field.js +231 -0
  52. package/dist/components/item-collection/item-collection.js +59 -0
  53. package/dist/components/layout/hstack.js +30 -0
  54. package/dist/components/layout/vstack.js +30 -0
  55. package/dist/components/link-input/link-input.js +284 -0
  56. package/dist/components/matrix-align/matrix-align.js +134 -0
  57. package/dist/components/menu/menu.js +285 -0
  58. package/dist/components/modal/modal.js +305 -0
  59. package/dist/components/notice/notice.js +123 -0
  60. package/dist/components/number-picker/number-picker.js +292 -0
  61. package/dist/components/option-select/option-select.js +264 -0
  62. package/dist/components/options-panel/options-panel.js +158 -0
  63. package/dist/components/placeholders/file-placeholder.js +42 -0
  64. package/dist/components/placeholders/image-placeholder.js +88 -0
  65. package/dist/components/placeholders/media-placeholder.js +63 -0
  66. package/dist/components/popover/popover.js +207 -0
  67. package/dist/components/radio/radio.js +582 -0
  68. package/dist/components/repeater/repeater-context.js +5 -0
  69. package/dist/components/repeater/repeater-item.js +119 -0
  70. package/dist/components/repeater/repeater.js +280 -0
  71. package/dist/components/responsive/mini-responsive.js +498 -0
  72. package/dist/components/responsive/responsive-legacy.js +343 -0
  73. package/dist/components/responsive/responsive.js +583 -0
  74. package/dist/components/responsive-preview/responsive-preview.js +123 -0
  75. package/dist/components/rich-label/rich-label.js +66 -0
  76. package/dist/components/select/async-multi-select.js +157 -0
  77. package/dist/components/select/async-single-select.js +137 -0
  78. package/dist/components/select/custom-select-default-components.js +38 -0
  79. package/dist/components/select/multi-select-components.js +8 -0
  80. package/dist/components/select/multi-select.js +151 -0
  81. package/dist/components/select/react-select-component-wrappers.js +90 -0
  82. package/dist/components/select/shared.js +26 -0
  83. package/dist/components/select/single-select.js +131 -0
  84. package/dist/components/select/styles.js +49 -0
  85. package/dist/components/select/v2/async-select.js +297 -0
  86. package/dist/components/select/v2/shared.js +24 -0
  87. package/dist/components/select/v2/single-select.js +1004 -0
  88. package/dist/components/slider/column-config-slider.js +210 -0
  89. package/dist/components/slider/slider.js +345 -0
  90. package/dist/components/slider/utils.js +94 -0
  91. package/dist/components/spacer/spacer.js +97 -0
  92. package/dist/components/tabs/tabs.js +703 -0
  93. package/dist/components/toggle/switch.js +156 -0
  94. package/dist/components/toggle/toggle.js +64 -0
  95. package/dist/components/toggle-button/toggle-button.js +343 -0
  96. package/dist/components/tooltip/tooltip.js +527 -0
  97. package/dist/context-BbYZoHvX.js +92 -0
  98. package/dist/default-i18n-CT_oS1Fy.js +922 -0
  99. package/dist/filterDOMProps-EDDcM64A.js +28 -0
  100. package/dist/icons/block-icon.js +42 -0
  101. package/dist/icons/generic-color-swatch.js +113 -0
  102. package/dist/icons/icons.js +30495 -0
  103. package/dist/icons/index.js +11 -0
  104. package/dist/icons/jsx-svg.js +50 -0
  105. package/dist/index-641ee5b8.esm-BPU8rMZr.js +3137 -0
  106. package/dist/index-BljRBEr_.js +44 -0
  107. package/dist/index-CFozsmNS.js +28321 -0
  108. package/dist/index.js +139 -0
  109. package/dist/lite-DVmmD_-j.js +7 -0
  110. package/dist/modifiers.esm-BuJQPI1X.js +31 -0
  111. package/dist/multi-select-components-Sp-JEFEX.js +3744 -0
  112. package/dist/number-GajL10e1.js +36 -0
  113. package/dist/react-jsx-parser.min-DZCiis5V.js +11753 -0
  114. package/dist/react-select-async.esm-D937XTWW.js +107 -0
  115. package/dist/react-select.esm-Ciai3aKf.js +15 -0
  116. package/dist/style-admin.js +1 -0
  117. package/dist/style-editor.js +1 -0
  118. package/dist/style.js +1 -0
  119. package/dist/textSelection-8DpK8fJl.js +46 -0
  120. package/dist/useButton-Bt3BffJm.js +50 -0
  121. package/dist/useEvent-ICdlokG-.js +23 -0
  122. package/dist/useFocusRing-Bv0UJQl8.js +107 -0
  123. package/dist/useFormReset-D2YaWRIA.js +22 -0
  124. package/dist/useFormValidation-Dy0PXJg5.js +224 -0
  125. package/dist/useHover-C2SkI1Fn.js +895 -0
  126. package/dist/useLabel-BPCd5c7-.js +27 -0
  127. package/dist/useLabels-B7-lUnAF.js +23 -0
  128. package/dist/useListState-DkyH7elT.js +168 -0
  129. package/dist/useLocalizedStringFormatter-C9GO0IDB.js +121 -0
  130. package/dist/useNumberField-CU1_u8ze.js +1215 -0
  131. package/dist/useNumberFormatter-CZ9QUnRt.js +13 -0
  132. package/dist/usePress-BrJylgPR.js +688 -0
  133. package/dist/useSingleSelectListState-C4sorv2p.js +38 -0
  134. package/dist/useToggle-CDa3YAZI.js +59 -0
  135. package/dist/useToggleState-ibcBUHnB.js +19 -0
  136. package/dist/utilities/array-helpers.js +56 -0
  137. package/dist/utilities/debounce-throttle.js +123 -0
  138. package/dist/utilities/es-dash.js +382 -0
  139. package/dist/utilities/index.js +27 -0
  140. package/dist/utilities/text-helpers.js +136 -0
  141. package/dist/utils-CZt7LCbO.js +403 -0
  142. package/dist/wp/wp-font-enhancements.js +1 -0
  143. package/dist/wp/wp-ui-enhancements.js +1 -0
  144. package/package.json +24 -24
@@ -0,0 +1,140 @@
1
+ let $488c6ddbf4ef74c2$var$formatterCache = /* @__PURE__ */ new Map();
2
+ let $488c6ddbf4ef74c2$var$supportsSignDisplay = false;
3
+ try {
4
+ $488c6ddbf4ef74c2$var$supportsSignDisplay = new Intl.NumberFormat("de-DE", {
5
+ signDisplay: "exceptZero"
6
+ }).resolvedOptions().signDisplay === "exceptZero";
7
+ } catch {
8
+ }
9
+ let $488c6ddbf4ef74c2$var$supportsUnit = false;
10
+ try {
11
+ $488c6ddbf4ef74c2$var$supportsUnit = new Intl.NumberFormat("de-DE", {
12
+ style: "unit",
13
+ unit: "degree"
14
+ }).resolvedOptions().style === "unit";
15
+ } catch {
16
+ }
17
+ const $488c6ddbf4ef74c2$var$UNITS = {
18
+ degree: {
19
+ narrow: {
20
+ default: "°",
21
+ "ja-JP": " 度",
22
+ "zh-TW": "度",
23
+ "sl-SI": " °"
24
+ }
25
+ }
26
+ };
27
+ class $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5 {
28
+ /** Formats a number value as a string, according to the locale and options provided to the constructor. */
29
+ format(value) {
30
+ let res = "";
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);
33
+ if (this.options.style === "unit" && !$488c6ddbf4ef74c2$var$supportsUnit) {
34
+ var _UNITS_unit;
35
+ let { unit, unitDisplay = "short", locale } = this.resolvedOptions();
36
+ if (!unit) return res;
37
+ let values = (_UNITS_unit = $488c6ddbf4ef74c2$var$UNITS[unit]) === null || _UNITS_unit === void 0 ? void 0 : _UNITS_unit[unitDisplay];
38
+ res += values[locale] || values.default;
39
+ }
40
+ return res;
41
+ }
42
+ /** Formats a number to an array of parts such as separators, digits, punctuation, and more. */
43
+ formatToParts(value) {
44
+ return this.numberFormatter.formatToParts(value);
45
+ }
46
+ /** Formats a number range as a string. */
47
+ formatRange(start, end) {
48
+ if (typeof this.numberFormatter.formatRange === "function") return this.numberFormatter.formatRange(start, end);
49
+ if (end < start) throw new RangeError("End date must be >= start date");
50
+ return `${this.format(start)} – ${this.format(end)}`;
51
+ }
52
+ /** Formats a number range as an array of parts. */
53
+ formatRangeToParts(start, end) {
54
+ if (typeof this.numberFormatter.formatRangeToParts === "function") return this.numberFormatter.formatRangeToParts(start, end);
55
+ if (end < start) throw new RangeError("End date must be >= start date");
56
+ let startParts = this.numberFormatter.formatToParts(start);
57
+ let endParts = this.numberFormatter.formatToParts(end);
58
+ return [
59
+ ...startParts.map((p) => ({
60
+ ...p,
61
+ source: "startRange"
62
+ })),
63
+ {
64
+ type: "literal",
65
+ value: " – ",
66
+ source: "shared"
67
+ },
68
+ ...endParts.map((p) => ({
69
+ ...p,
70
+ source: "endRange"
71
+ }))
72
+ ];
73
+ }
74
+ /** Returns the resolved formatting options based on the values passed to the constructor. */
75
+ resolvedOptions() {
76
+ let options = this.numberFormatter.resolvedOptions();
77
+ if (!$488c6ddbf4ef74c2$var$supportsSignDisplay && this.options.signDisplay != null) options = {
78
+ ...options,
79
+ signDisplay: this.options.signDisplay
80
+ };
81
+ if (!$488c6ddbf4ef74c2$var$supportsUnit && this.options.style === "unit") options = {
82
+ ...options,
83
+ style: "unit",
84
+ unit: this.options.unit,
85
+ unitDisplay: this.options.unitDisplay
86
+ };
87
+ return options;
88
+ }
89
+ constructor(locale, options = {}) {
90
+ this.numberFormatter = $488c6ddbf4ef74c2$var$getCachedNumberFormatter(locale, options);
91
+ this.options = options;
92
+ }
93
+ }
94
+ function $488c6ddbf4ef74c2$var$getCachedNumberFormatter(locale, options = {}) {
95
+ let { numberingSystem } = options;
96
+ if (numberingSystem && locale.includes("-nu-")) {
97
+ if (!locale.includes("-u-")) locale += "-u-";
98
+ locale += `-nu-${numberingSystem}`;
99
+ }
100
+ if (options.style === "unit" && !$488c6ddbf4ef74c2$var$supportsUnit) {
101
+ var _UNITS_unit;
102
+ let { unit, unitDisplay = "short" } = options;
103
+ if (!unit) throw new Error('unit option must be provided with style: "unit"');
104
+ 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}`);
105
+ options = {
106
+ ...options,
107
+ style: "decimal"
108
+ };
109
+ }
110
+ let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : "");
111
+ if ($488c6ddbf4ef74c2$var$formatterCache.has(cacheKey)) return $488c6ddbf4ef74c2$var$formatterCache.get(cacheKey);
112
+ let numberFormatter = new Intl.NumberFormat(locale, options);
113
+ $488c6ddbf4ef74c2$var$formatterCache.set(cacheKey, numberFormatter);
114
+ return numberFormatter;
115
+ }
116
+ function $488c6ddbf4ef74c2$export$711b50b3c525e0f2(numberFormat, signDisplay, num) {
117
+ if (signDisplay === "auto") return numberFormat.format(num);
118
+ else if (signDisplay === "never") return numberFormat.format(Math.abs(num));
119
+ else {
120
+ let needsPositiveSign = false;
121
+ if (signDisplay === "always") needsPositiveSign = num > 0 || Object.is(num, 0);
122
+ else if (signDisplay === "exceptZero") {
123
+ if (Object.is(num, -0) || Object.is(num, 0)) num = Math.abs(num);
124
+ else needsPositiveSign = num > 0;
125
+ }
126
+ if (needsPositiveSign) {
127
+ let negative = numberFormat.format(-num);
128
+ let noSign = numberFormat.format(num);
129
+ let minus = negative.replace(noSign, "").replace(/\u200e|\u061C/, "");
130
+ if ([
131
+ ...minus
132
+ ].length !== 1) console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case");
133
+ let positive = negative.replace(noSign, "!!!").replace(minus, "+").replace("!!!", noSign);
134
+ return positive;
135
+ } else return numberFormat.format(num);
136
+ }
137
+ }
138
+ export {
139
+ $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5 as $
140
+ };