@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,73 @@
1
+ const $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY = 7e3;
2
+ let $319e236875307eab$var$liveAnnouncer = null;
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();
6
+ $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
7
+ }
8
+ function $319e236875307eab$export$d10ae4f68404609a(assertiveness) {
9
+ if ($319e236875307eab$var$liveAnnouncer)
10
+ $319e236875307eab$var$liveAnnouncer.clear(assertiveness);
11
+ }
12
+ class $319e236875307eab$var$LiveAnnouncer {
13
+ createLog(ariaLive) {
14
+ let node = document.createElement("div");
15
+ node.setAttribute("role", "log");
16
+ node.setAttribute("aria-live", ariaLive);
17
+ node.setAttribute("aria-relevant", "additions");
18
+ return node;
19
+ }
20
+ destroy() {
21
+ if (!this.node)
22
+ return;
23
+ document.body.removeChild(this.node);
24
+ this.node = null;
25
+ }
26
+ announce(message, assertiveness = "assertive", timeout = $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY) {
27
+ if (!this.node)
28
+ return;
29
+ let node = document.createElement("div");
30
+ 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);
39
+ }
40
+ 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 = "";
47
+ }
48
+ constructor() {
49
+ this.node = document.createElement("div");
50
+ this.node.dataset.liveAnnouncer = "true";
51
+ Object.assign(this.node.style, {
52
+ border: 0,
53
+ clip: "rect(0 0 0 0)",
54
+ clipPath: "inset(50%)",
55
+ height: "1px",
56
+ margin: "-1px",
57
+ overflow: "hidden",
58
+ padding: 0,
59
+ position: "absolute",
60
+ width: "1px",
61
+ whiteSpace: "nowrap"
62
+ });
63
+ this.assertiveLog = this.createLog("assertive");
64
+ this.node.appendChild(this.assertiveLog);
65
+ this.politeLog = this.createLog("polite");
66
+ this.node.appendChild(this.politeLog);
67
+ document.body.prepend(this.node);
68
+ }
69
+ }
70
+ export {
71
+ $319e236875307eab$export$a9b970dcc4ae71a9 as $,
72
+ $319e236875307eab$export$d10ae4f68404609a as a
73
+ };
@@ -0,0 +1,160 @@
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 (e) {
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 (e) {
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)
32
+ res = $488c6ddbf4ef74c2$export$711b50b3c525e0f2(this.numberFormatter, this.options.signDisplay, value);
33
+ else
34
+ res = this.numberFormatter.format(value);
35
+ if (this.options.style === "unit" && !$488c6ddbf4ef74c2$var$supportsUnit) {
36
+ var _UNITS_unit;
37
+ let { unit, unitDisplay = "short", locale } = this.resolvedOptions();
38
+ if (!unit)
39
+ return res;
40
+ let values = (_UNITS_unit = $488c6ddbf4ef74c2$var$UNITS[unit]) === null || _UNITS_unit === void 0 ? void 0 : _UNITS_unit[unitDisplay];
41
+ res += values[locale] || values.default;
42
+ }
43
+ return res;
44
+ }
45
+ /** Formats a number to an array of parts such as separators, digits, punctuation, and more. */
46
+ formatToParts(value) {
47
+ return this.numberFormatter.formatToParts(value);
48
+ }
49
+ /** Formats a number range as a string. */
50
+ formatRange(start, end) {
51
+ if (typeof this.numberFormatter.formatRange === "function")
52
+ return this.numberFormatter.formatRange(start, end);
53
+ if (end < start)
54
+ throw new RangeError("End date must be >= start date");
55
+ return `${this.format(start)} – ${this.format(end)}`;
56
+ }
57
+ /** Formats a number range as an array of parts. */
58
+ formatRangeToParts(start, end) {
59
+ if (typeof this.numberFormatter.formatRangeToParts === "function")
60
+ return this.numberFormatter.formatRangeToParts(start, end);
61
+ if (end < start)
62
+ throw new RangeError("End date must be >= start date");
63
+ let startParts = this.numberFormatter.formatToParts(start);
64
+ let endParts = this.numberFormatter.formatToParts(end);
65
+ return [
66
+ ...startParts.map((p) => ({
67
+ ...p,
68
+ source: "startRange"
69
+ })),
70
+ {
71
+ type: "literal",
72
+ value: " – ",
73
+ source: "shared"
74
+ },
75
+ ...endParts.map((p) => ({
76
+ ...p,
77
+ source: "endRange"
78
+ }))
79
+ ];
80
+ }
81
+ /** Returns the resolved formatting options based on the values passed to the constructor. */
82
+ resolvedOptions() {
83
+ 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
+ };
96
+ return options;
97
+ }
98
+ constructor(locale, options = {}) {
99
+ this.numberFormatter = $488c6ddbf4ef74c2$var$getCachedNumberFormatter(locale, options);
100
+ this.options = options;
101
+ }
102
+ }
103
+ function $488c6ddbf4ef74c2$var$getCachedNumberFormatter(locale, options = {}) {
104
+ let { numberingSystem } = options;
105
+ if (numberingSystem && locale.includes("-nu-")) {
106
+ if (!locale.includes("-u-"))
107
+ locale += "-u-";
108
+ locale += `-nu-${numberingSystem}`;
109
+ }
110
+ if (options.style === "unit" && !$488c6ddbf4ef74c2$var$supportsUnit) {
111
+ var _UNITS_unit;
112
+ 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}`);
117
+ options = {
118
+ ...options,
119
+ style: "decimal"
120
+ };
121
+ }
122
+ 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);
125
+ let numberFormatter = new Intl.NumberFormat(locale, options);
126
+ $488c6ddbf4ef74c2$var$formatterCache.set(cacheKey, numberFormatter);
127
+ return numberFormatter;
128
+ }
129
+ 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));
134
+ else {
135
+ let needsPositiveSign = false;
136
+ if (signDisplay === "always")
137
+ needsPositiveSign = num > 0 || Object.is(num, 0);
138
+ 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;
143
+ }
144
+ if (needsPositiveSign) {
145
+ let negative = numberFormat.format(-num);
146
+ let noSign = numberFormat.format(num);
147
+ let minus = negative.replace(noSign, "").replace(/\u200e|\u061C/, "");
148
+ if ([
149
+ ...minus
150
+ ].length !== 1)
151
+ console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case");
152
+ let positive = negative.replace(noSign, "!!!").replace(minus, "+").replace("!!!", noSign);
153
+ return positive;
154
+ } else
155
+ return numberFormat.format(num);
156
+ }
157
+ }
158
+ export {
159
+ $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5 as $
160
+ };
@@ -0,0 +1,14 @@
1
+ import { createContext } from "react";
2
+ const $4e85f108e88277b8$export$b085522c77523c51 = createContext(null);
3
+ const $4e85f108e88277b8$export$ebe63fadcdce34ed = createContext(null);
4
+ const $4e85f108e88277b8$export$44644b8a16031b5b = createContext(null);
5
+ const $4e85f108e88277b8$export$717b2c0a523a0b53 = createContext(null);
6
+ createContext(null);
7
+ const $4e85f108e88277b8$export$d688439359537581 = createContext({});
8
+ export {
9
+ $4e85f108e88277b8$export$b085522c77523c51 as $,
10
+ $4e85f108e88277b8$export$ebe63fadcdce34ed as a,
11
+ $4e85f108e88277b8$export$44644b8a16031b5b as b,
12
+ $4e85f108e88277b8$export$717b2c0a523a0b53 as c,
13
+ $4e85f108e88277b8$export$d688439359537581 as d
14
+ };