@eightshift/ui-components 3.0.1 → 5.0.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.
- package/package.json +101 -101
- package/dist/Button-BPLceDeW.js +0 -185
- package/dist/Collection-CZxddMZS.js +0 -2332
- package/dist/Color-MV5kBVXr.js +0 -2452
- package/dist/ColorSwatch-BqQfVu4L.js +0 -64
- package/dist/ComboBox-_RfyhwZw.js +0 -1906
- package/dist/Dialog-8tYeQ9n4.js +0 -2300
- package/dist/FieldError-52GVSGgC.js +0 -42
- package/dist/FocusScope-Cri5BFRz.js +0 -831
- package/dist/Form-Cq3fu75_.js +0 -5
- package/dist/Group-_emcIVxI.js +0 -48
- package/dist/Heading-B2153VXe.js +0 -16
- package/dist/Hidden-rE6uR-lr.js +0 -41
- package/dist/Input-BxpFEIXV.js +0 -133
- package/dist/Label-icmbmNdI.js +0 -17
- package/dist/List-CZMUbkFU.js +0 -593
- package/dist/ListBox-Ca6hiCqz.js +0 -581
- package/dist/NumberFormatter-DA8u1Ot7.js +0 -140
- package/dist/OverlayArrow-CYXQSlEU.js +0 -629
- package/dist/RSPContexts-2lR5GG9p.js +0 -14
- package/dist/Select-aab027f3.esm-PDJCDE95.js +0 -2469
- package/dist/Separator-4IIDRlV_.js +0 -322
- package/dist/Slider-rz2XRMGm.js +0 -853
- package/dist/Text-DVSAPY-K.js +0 -16
- package/dist/VisuallyHidden-f9zX67a_.js +0 -48
- package/dist/_commonjsHelpers-CUmg6egw.js +0 -6
- package/dist/assets/index.css +0 -37
- package/dist/assets/style-admin.css +0 -5255
- package/dist/assets/style-editor.css +0 -5255
- package/dist/assets/style.css +0 -5261
- package/dist/assets/wp-font-enhancements.css +0 -8
- package/dist/assets/wp-ui-enhancements.css +0 -299
- package/dist/components/animated-visibility/animated-visibility.js +0 -105
- package/dist/components/base-control/base-control.js +0 -86
- package/dist/components/breakpoint-preview/breakpoint-preview.js +0 -161
- package/dist/components/button/button.js +0 -387
- package/dist/components/checkbox/checkbox.js +0 -320
- package/dist/components/color-pickers/color-picker.js +0 -272
- package/dist/components/color-pickers/color-swatch.js +0 -58
- package/dist/components/color-pickers/gradient-editor.js +0 -534
- package/dist/components/color-pickers/solid-color-picker.js +0 -1567
- package/dist/components/component-toggle/component-toggle.js +0 -158
- package/dist/components/container-panel/container-panel.js +0 -131
- package/dist/components/draggable/draggable-context.js +0 -5
- package/dist/components/draggable/draggable-handle.js +0 -46
- package/dist/components/draggable/draggable.js +0 -6207
- package/dist/components/draggable-list/draggable-list-context.js +0 -5
- package/dist/components/draggable-list/draggable-list-item.js +0 -77
- package/dist/components/draggable-list/draggable-list.js +0 -151
- package/dist/components/expandable/expandable.js +0 -342
- package/dist/components/index.js +0 -137
- package/dist/components/input-field/input-field.js +0 -231
- package/dist/components/item-collection/item-collection.js +0 -59
- package/dist/components/layout/hstack.js +0 -30
- package/dist/components/layout/vstack.js +0 -30
- package/dist/components/link-input/link-input.js +0 -293
- package/dist/components/matrix-align/matrix-align.js +0 -134
- package/dist/components/menu/menu.js +0 -285
- package/dist/components/modal/modal.js +0 -305
- package/dist/components/notice/notice.js +0 -123
- package/dist/components/number-picker/number-picker.js +0 -292
- package/dist/components/option-select/option-select.js +0 -264
- package/dist/components/options-panel/options-panel.js +0 -158
- package/dist/components/placeholders/file-placeholder.js +0 -42
- package/dist/components/placeholders/image-placeholder.js +0 -88
- package/dist/components/placeholders/media-placeholder.js +0 -63
- package/dist/components/popover/popover.js +0 -207
- package/dist/components/radio/radio.js +0 -579
- package/dist/components/repeater/repeater-context.js +0 -5
- package/dist/components/repeater/repeater-item.js +0 -119
- package/dist/components/repeater/repeater.js +0 -280
- package/dist/components/responsive/mini-responsive.js +0 -498
- package/dist/components/responsive/responsive-legacy.js +0 -343
- package/dist/components/responsive/responsive.js +0 -580
- package/dist/components/responsive-preview/responsive-preview.js +0 -123
- package/dist/components/rich-label/rich-label.js +0 -66
- package/dist/components/select/async-multi-select.js +0 -157
- package/dist/components/select/async-single-select.js +0 -137
- package/dist/components/select/custom-select-default-components.js +0 -38
- package/dist/components/select/multi-select-components.js +0 -8
- package/dist/components/select/multi-select.js +0 -151
- package/dist/components/select/react-select-component-wrappers.js +0 -90
- package/dist/components/select/shared.js +0 -26
- package/dist/components/select/single-select.js +0 -131
- package/dist/components/select/styles.js +0 -49
- package/dist/components/select/v2/async-select.js +0 -297
- package/dist/components/select/v2/shared.js +0 -24
- package/dist/components/select/v2/single-select.js +0 -990
- package/dist/components/slider/column-config-slider.js +0 -210
- package/dist/components/slider/slider.js +0 -343
- package/dist/components/slider/utils.js +0 -84
- package/dist/components/spacer/spacer.js +0 -97
- package/dist/components/tabs/tabs.js +0 -702
- package/dist/components/toggle/switch.js +0 -155
- package/dist/components/toggle/toggle.js +0 -64
- package/dist/components/toggle-button/toggle-button.js +0 -324
- package/dist/components/tooltip/tooltip.js +0 -525
- package/dist/context-D2KUdwNL.js +0 -92
- package/dist/default-i18n-CT_oS1Fy.js +0 -922
- package/dist/filterDOMProps-EDDcM64A.js +0 -28
- package/dist/icons/block-icon.js +0 -42
- package/dist/icons/generic-color-swatch.js +0 -113
- package/dist/icons/icons.js +0 -30371
- package/dist/icons/index.js +0 -11
- package/dist/icons/jsx-svg.js +0 -50
- package/dist/index-641ee5b8.esm-DIuJijyT.js +0 -3137
- package/dist/index-BKGQ6jGS.js +0 -44
- package/dist/index-CFozsmNS.js +0 -28321
- package/dist/index.js +0 -139
- package/dist/lite-DVmmD_-j.js +0 -7
- package/dist/modifiers.esm-BuJQPI1X.js +0 -31
- package/dist/multi-select-components-Sp-JEFEX.js +0 -3744
- package/dist/number-GajL10e1.js +0 -36
- package/dist/react-jsx-parser.min-DZCiis5V.js +0 -11753
- package/dist/react-select-async.esm-Bql4G5iV.js +0 -107
- package/dist/react-select.esm-B_TudhTU.js +0 -15
- package/dist/style-admin.js +0 -1
- package/dist/style-editor.js +0 -1
- package/dist/style.js +0 -1
- package/dist/textSelection-0UUS8Yfg.js +0 -46
- package/dist/useButton-Cg474OYB.js +0 -71
- package/dist/useEvent-B0b-6KBr.js +0 -23
- package/dist/useFocusRing-CV5l3lf6.js +0 -107
- package/dist/useFormReset-C5OggHsw.js +0 -22
- package/dist/useFormValidation-DhDNSjws.js +0 -224
- package/dist/useHover-DwDr6ozG.js +0 -900
- package/dist/useLabel-D7HkNEHT.js +0 -27
- package/dist/useLabels-D8cxd1Z8.js +0 -23
- package/dist/useListState-DVr6aYd_.js +0 -161
- package/dist/useLocalizedStringFormatter-CFP1YZWQ.js +0 -121
- package/dist/useNumberField-TwM0Z9D1.js +0 -1204
- package/dist/useNumberFormatter-321rAb4J.js +0 -13
- package/dist/usePress-Cucx-xSA.js +0 -664
- package/dist/useSingleSelectListState-CMGsRHHh.js +0 -38
- package/dist/useToggle-C0I3vs0g.js +0 -59
- package/dist/useToggleState-CmQX3SoX.js +0 -19
- package/dist/utilities/array-helpers.js +0 -56
- package/dist/utilities/debounce-throttle.js +0 -123
- package/dist/utilities/es-dash.js +0 -376
- package/dist/utilities/index.js +0 -27
- package/dist/utilities/text-helpers.js +0 -136
- package/dist/utils-DkCSC521.js +0 -370
- package/dist/wp/wp-font-enhancements.js +0 -1
- package/dist/wp/wp-ui-enhancements.js +0 -1
|
@@ -1,140 +0,0 @@
|
|
|
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
|
-
};
|