@eightshift/ui-components 4.0.0 → 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-CvzGKGCo.js +0 -185
- package/dist/Collection-ddre1L5v.js +0 -2332
- package/dist/Color-MV5kBVXr.js +0 -2452
- package/dist/ColorSwatch-BqQfVu4L.js +0 -64
- package/dist/ComboBox-jQ-dk95U.js +0 -1906
- package/dist/Dialog-DX1aiYyE.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-BYNHbol3.js +0 -593
- package/dist/ListBox-mJ4nQaL7.js +0 -581
- package/dist/NumberFormatter-DA8u1Ot7.js +0 -140
- package/dist/OverlayArrow-BB0CWwdq.js +0 -629
- package/dist/RSPContexts-2lR5GG9p.js +0 -14
- package/dist/Select-aab027f3.esm--EmXjiL3.js +0 -2469
- package/dist/Separator-D9moUgP8.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-BPz6U6sJ.js +0 -3137
- package/dist/index-BKGQ6jGS.js +0 -44
- package/dist/index-BYHhzLf-.js +0 -444
- 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-BlZZoNXC.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-CwUoej5h.js +0 -107
- package/dist/react-select.esm-DcwYxadV.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-BpOKDWEN.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-UGlN5-7P.js +0 -161
- package/dist/useLocalizedStringFormatter-CFP1YZWQ.js +0 -121
- package/dist/useNumberField-CEAj7Mrj.js +0 -1204
- package/dist/useNumberFormatter-321rAb4J.js +0 -13
- package/dist/usePress-DNW8qpY6.js +0 -664
- package/dist/useSingleSelectListState-DC0wWTUM.js +0 -38
- package/dist/useToggle-BrpmSOB-.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
package/package.json
CHANGED
|
@@ -1,102 +1,102 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
2
|
+
"name": "@eightshift/ui-components",
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/infinum/eightshift-ui-components.git"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"sideEffects": [
|
|
15
|
+
"./dist/assets/*.css"
|
|
16
|
+
],
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"import": "./dist/index.js",
|
|
20
|
+
"require": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./icons": "./dist/icons/index.js",
|
|
23
|
+
"./utilities": "./dist/utilities/index.js",
|
|
24
|
+
"./dist/assets/style.css": "./dist/assets/style.css",
|
|
25
|
+
"./dist/assets/style-editor.css": "./dist/assets/style-editor.css",
|
|
26
|
+
"./dist/assets/style-admin.css": "./dist/assets/style-admin.css",
|
|
27
|
+
"./dist/assets/wp-font-enhancements.css": "./dist/assets/wp-font-enhancements.css",
|
|
28
|
+
"./dist/assets/wp-ui-enhancements.css": "./dist/assets/wp-ui-enhancements.css",
|
|
29
|
+
"./styles": "./dist/assets/style.css",
|
|
30
|
+
"./wp-font-enhancements": "./dist/assets/wp-font-enhancements.css",
|
|
31
|
+
"./wp-ui-enhancements": "./dist/assets/wp-ui-enhancements.css",
|
|
32
|
+
"./wp-overrides": "./dist/assets/wp.css"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"dev": "vite",
|
|
36
|
+
"start": "vite",
|
|
37
|
+
"build": "vite build",
|
|
38
|
+
"lint": "npx eslint",
|
|
39
|
+
"preview": "vite preview"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"react": "^18.3.1",
|
|
43
|
+
"react-dom": "^18.3.1"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@adobe/react-spectrum": "^3.41.0",
|
|
47
|
+
"@dnd-kit/abstract": "^0.1.10",
|
|
48
|
+
"@dnd-kit/core": "^6.3.1",
|
|
49
|
+
"@dnd-kit/dom": "^0.1.10",
|
|
50
|
+
"@dnd-kit/helpers": "^0.1.10",
|
|
51
|
+
"@dnd-kit/modifiers": "^9.0.0",
|
|
52
|
+
"@dnd-kit/react": "^0.1.10",
|
|
53
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
54
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
55
|
+
"@eslint/compat": "^1.2.9",
|
|
56
|
+
"@react-stately/collections": "^3.12.3",
|
|
57
|
+
"@stylistic/eslint-plugin-js": "^4.2.0",
|
|
58
|
+
"@tailwindcss/vite": "^4.1.5",
|
|
59
|
+
"@types/react": "^18.3.21",
|
|
60
|
+
"@types/react-dom": "^18.3.7",
|
|
61
|
+
"@vitejs/plugin-react-swc": "^3.9.0",
|
|
62
|
+
"@wordpress/i18n": "^5.22.0",
|
|
63
|
+
"autoprefixer": "^10.4.21",
|
|
64
|
+
"class-variance-authority": "^0.7.1",
|
|
65
|
+
"clsx": "^2.1.1",
|
|
66
|
+
"css-gradient-parser": "^0.0.16",
|
|
67
|
+
"eslint": "^9.26.0",
|
|
68
|
+
"eslint-config-prettier": "^10.1.2",
|
|
69
|
+
"eslint-plugin-jsdoc": "^50.6.11",
|
|
70
|
+
"eslint-plugin-prettier": "^5.4.0",
|
|
71
|
+
"glob": "^11.0.2",
|
|
72
|
+
"globals": "^16.0.0",
|
|
73
|
+
"just-camel-case": "^6.2.0",
|
|
74
|
+
"just-debounce-it": "^3.2.0",
|
|
75
|
+
"just-has": "^2.3.0",
|
|
76
|
+
"just-is-empty": "^3.4.1",
|
|
77
|
+
"just-kebab-case": "^4.2.0",
|
|
78
|
+
"just-throttle": "^4.2.0",
|
|
79
|
+
"lightningcss": "^1.29.3",
|
|
80
|
+
"postcss": "^8.5.3",
|
|
81
|
+
"prettier": "^3.5.3",
|
|
82
|
+
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
83
|
+
"react": "^18.3.1",
|
|
84
|
+
"react-aria": "^3.39.0",
|
|
85
|
+
"react-aria-components": "^1.8.0",
|
|
86
|
+
"react-dom": "^18.3.1",
|
|
87
|
+
"react-jsx-parser": "^2.4.0",
|
|
88
|
+
"react-movable": "^3.4.1",
|
|
89
|
+
"react-select": "^5.10.1",
|
|
90
|
+
"react-stately": "^3.37.0",
|
|
91
|
+
"svg-to-jsx-string": "^0.1.1",
|
|
92
|
+
"tailwindcss": "^4.1.5",
|
|
93
|
+
"tailwindcss-motion": "^1.1.0",
|
|
94
|
+
"tailwindcss-react-aria-components": "^2.0.0",
|
|
95
|
+
"vite": "^6.3.5",
|
|
96
|
+
"vite-plugin-lib-inject-css": "^2.2.2"
|
|
97
|
+
},
|
|
98
|
+
"dependencies": {
|
|
99
|
+
"@fontsource-variable/geist": "^5.2.6",
|
|
100
|
+
"@fontsource-variable/geist-mono": "^5.2.6"
|
|
101
|
+
}
|
|
102
|
+
}
|
package/dist/Button-CvzGKGCo.js
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3, e as $bdb11010cef70236$export$f680877a34711e37, d as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-DkCSC521.js";
|
|
2
|
-
import React__default, { createContext, useRef, useEffect } from "react";
|
|
3
|
-
import { $ as $f39a9eba43920ace$export$86427a43e3e48ebb } from "./Hidden-rE6uR-lr.js";
|
|
4
|
-
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-EDDcM64A.js";
|
|
5
|
-
import { $ as $701a24aa0da5b062$export$ea18c227d4417cc3 } from "./useButton-BpOKDWEN.js";
|
|
6
|
-
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "./useFocusRing-CV5l3lf6.js";
|
|
7
|
-
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "./useHover-DwDr6ozG.js";
|
|
8
|
-
const $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY = 7e3;
|
|
9
|
-
let $319e236875307eab$var$liveAnnouncer = null;
|
|
10
|
-
function $319e236875307eab$export$a9b970dcc4ae71a9(message, assertiveness = "assertive", timeout = $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY) {
|
|
11
|
-
if (!$319e236875307eab$var$liveAnnouncer) {
|
|
12
|
-
$319e236875307eab$var$liveAnnouncer = new $319e236875307eab$var$LiveAnnouncer();
|
|
13
|
-
if (!(typeof IS_REACT_ACT_ENVIRONMENT === "boolean" ? IS_REACT_ACT_ENVIRONMENT : typeof jest !== "undefined")) setTimeout(() => {
|
|
14
|
-
if ($319e236875307eab$var$liveAnnouncer === null || $319e236875307eab$var$liveAnnouncer === void 0 ? void 0 : $319e236875307eab$var$liveAnnouncer.isAttached()) $319e236875307eab$var$liveAnnouncer === null || $319e236875307eab$var$liveAnnouncer === void 0 ? void 0 : $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
15
|
-
}, 100);
|
|
16
|
-
else $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
17
|
-
} else $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
18
|
-
}
|
|
19
|
-
function $319e236875307eab$export$d10ae4f68404609a(assertiveness) {
|
|
20
|
-
if ($319e236875307eab$var$liveAnnouncer) $319e236875307eab$var$liveAnnouncer.clear(assertiveness);
|
|
21
|
-
}
|
|
22
|
-
class $319e236875307eab$var$LiveAnnouncer {
|
|
23
|
-
isAttached() {
|
|
24
|
-
var _this_node;
|
|
25
|
-
return (_this_node = this.node) === null || _this_node === void 0 ? void 0 : _this_node.isConnected;
|
|
26
|
-
}
|
|
27
|
-
createLog(ariaLive) {
|
|
28
|
-
let node = document.createElement("div");
|
|
29
|
-
node.setAttribute("role", "log");
|
|
30
|
-
node.setAttribute("aria-live", ariaLive);
|
|
31
|
-
node.setAttribute("aria-relevant", "additions");
|
|
32
|
-
return node;
|
|
33
|
-
}
|
|
34
|
-
destroy() {
|
|
35
|
-
if (!this.node) return;
|
|
36
|
-
document.body.removeChild(this.node);
|
|
37
|
-
this.node = null;
|
|
38
|
-
}
|
|
39
|
-
announce(message, assertiveness = "assertive", timeout = $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY) {
|
|
40
|
-
var _this_assertiveLog, _this_politeLog;
|
|
41
|
-
if (!this.node) return;
|
|
42
|
-
let node = document.createElement("div");
|
|
43
|
-
if (typeof message === "object") {
|
|
44
|
-
node.setAttribute("role", "img");
|
|
45
|
-
node.setAttribute("aria-labelledby", message["aria-labelledby"]);
|
|
46
|
-
} else node.textContent = message;
|
|
47
|
-
if (assertiveness === "assertive") (_this_assertiveLog = this.assertiveLog) === null || _this_assertiveLog === void 0 ? void 0 : _this_assertiveLog.appendChild(node);
|
|
48
|
-
else (_this_politeLog = this.politeLog) === null || _this_politeLog === void 0 ? void 0 : _this_politeLog.appendChild(node);
|
|
49
|
-
if (message !== "") setTimeout(() => {
|
|
50
|
-
node.remove();
|
|
51
|
-
}, timeout);
|
|
52
|
-
}
|
|
53
|
-
clear(assertiveness) {
|
|
54
|
-
if (!this.node) return;
|
|
55
|
-
if ((!assertiveness || assertiveness === "assertive") && this.assertiveLog) this.assertiveLog.innerHTML = "";
|
|
56
|
-
if ((!assertiveness || assertiveness === "polite") && this.politeLog) this.politeLog.innerHTML = "";
|
|
57
|
-
}
|
|
58
|
-
constructor() {
|
|
59
|
-
this.node = null;
|
|
60
|
-
this.assertiveLog = null;
|
|
61
|
-
this.politeLog = null;
|
|
62
|
-
if (typeof document !== "undefined") {
|
|
63
|
-
this.node = document.createElement("div");
|
|
64
|
-
this.node.dataset.liveAnnouncer = "true";
|
|
65
|
-
Object.assign(this.node.style, {
|
|
66
|
-
border: 0,
|
|
67
|
-
clip: "rect(0 0 0 0)",
|
|
68
|
-
clipPath: "inset(50%)",
|
|
69
|
-
height: "1px",
|
|
70
|
-
margin: "-1px",
|
|
71
|
-
overflow: "hidden",
|
|
72
|
-
padding: 0,
|
|
73
|
-
position: "absolute",
|
|
74
|
-
width: "1px",
|
|
75
|
-
whiteSpace: "nowrap"
|
|
76
|
-
});
|
|
77
|
-
this.assertiveLog = this.createLog("assertive");
|
|
78
|
-
this.node.appendChild(this.assertiveLog);
|
|
79
|
-
this.politeLog = this.createLog("polite");
|
|
80
|
-
this.node.appendChild(this.politeLog);
|
|
81
|
-
document.body.prepend(this.node);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
const $0393f8ab869a0f1a$export$e9f3bf65a26ce129 = /* @__PURE__ */ createContext(null);
|
|
86
|
-
const $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes = /* @__PURE__ */ new Set([
|
|
87
|
-
"form",
|
|
88
|
-
"formAction",
|
|
89
|
-
"formEncType",
|
|
90
|
-
"formMethod",
|
|
91
|
-
"formNoValidate",
|
|
92
|
-
"formTarget",
|
|
93
|
-
"name",
|
|
94
|
-
"value"
|
|
95
|
-
]);
|
|
96
|
-
const $d2b4bc8c273e7be6$export$24d547caef80ccd1 = /* @__PURE__ */ createContext({});
|
|
97
|
-
const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /* @__PURE__ */ $f39a9eba43920ace$export$86427a43e3e48ebb(function Button(props, ref) {
|
|
98
|
-
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $d2b4bc8c273e7be6$export$24d547caef80ccd1);
|
|
99
|
-
props = $d2b4bc8c273e7be6$var$disablePendingProps(props);
|
|
100
|
-
let ctx = props;
|
|
101
|
-
let { isPending } = ctx;
|
|
102
|
-
let { buttonProps, isPressed } = $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref);
|
|
103
|
-
let { focusProps, isFocused, isFocusVisible } = $f7dceffc5ad7768b$export$4e328f61c538687f(props);
|
|
104
|
-
let { hoverProps, isHovered } = $6179b936705e76d3$export$ae780daf29e6d456({
|
|
105
|
-
...props,
|
|
106
|
-
isDisabled: props.isDisabled || isPending
|
|
107
|
-
});
|
|
108
|
-
let renderValues = {
|
|
109
|
-
isHovered,
|
|
110
|
-
isPressed: (ctx.isPressed || isPressed) && !isPending,
|
|
111
|
-
isFocused,
|
|
112
|
-
isFocusVisible,
|
|
113
|
-
isDisabled: props.isDisabled || false,
|
|
114
|
-
isPending: isPending !== null && isPending !== void 0 ? isPending : false
|
|
115
|
-
};
|
|
116
|
-
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
117
|
-
...props,
|
|
118
|
-
values: renderValues,
|
|
119
|
-
defaultClassName: "react-aria-Button"
|
|
120
|
-
});
|
|
121
|
-
let buttonId = $bdb11010cef70236$export$f680877a34711e37(buttonProps.id);
|
|
122
|
-
let progressId = $bdb11010cef70236$export$f680877a34711e37();
|
|
123
|
-
let ariaLabelledby = buttonProps["aria-labelledby"];
|
|
124
|
-
if (isPending) {
|
|
125
|
-
if (ariaLabelledby) ariaLabelledby = `${ariaLabelledby} ${progressId}`;
|
|
126
|
-
else if (buttonProps["aria-label"]) ariaLabelledby = `${buttonId} ${progressId}`;
|
|
127
|
-
}
|
|
128
|
-
let wasPending = useRef(isPending);
|
|
129
|
-
useEffect(() => {
|
|
130
|
-
let message = {
|
|
131
|
-
"aria-labelledby": ariaLabelledby || buttonId
|
|
132
|
-
};
|
|
133
|
-
if (!wasPending.current && isFocused && isPending) $319e236875307eab$export$a9b970dcc4ae71a9(message, "assertive");
|
|
134
|
-
else if (wasPending.current && isFocused && !isPending) $319e236875307eab$export$a9b970dcc4ae71a9(message, "assertive");
|
|
135
|
-
wasPending.current = isPending;
|
|
136
|
-
}, [
|
|
137
|
-
isPending,
|
|
138
|
-
isFocused,
|
|
139
|
-
ariaLabelledby,
|
|
140
|
-
buttonId
|
|
141
|
-
]);
|
|
142
|
-
return /* @__PURE__ */ React__default.createElement("button", {
|
|
143
|
-
...$65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
144
|
-
propNames: $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes
|
|
145
|
-
}),
|
|
146
|
-
...$3ef42575df84b30b$export$9d1611c77c2fe928(buttonProps, focusProps, hoverProps),
|
|
147
|
-
...renderProps,
|
|
148
|
-
type: buttonProps.type === "submit" && isPending ? "button" : buttonProps.type,
|
|
149
|
-
id: buttonId,
|
|
150
|
-
ref,
|
|
151
|
-
"aria-labelledby": ariaLabelledby,
|
|
152
|
-
slot: props.slot || void 0,
|
|
153
|
-
"aria-disabled": isPending ? "true" : buttonProps["aria-disabled"],
|
|
154
|
-
"data-disabled": props.isDisabled || void 0,
|
|
155
|
-
"data-pressed": renderValues.isPressed || void 0,
|
|
156
|
-
"data-hovered": isHovered || void 0,
|
|
157
|
-
"data-focused": isFocused || void 0,
|
|
158
|
-
"data-pending": isPending || void 0,
|
|
159
|
-
"data-focus-visible": isFocusVisible || void 0
|
|
160
|
-
}, /* @__PURE__ */ React__default.createElement($0393f8ab869a0f1a$export$e9f3bf65a26ce129.Provider, {
|
|
161
|
-
value: {
|
|
162
|
-
id: progressId
|
|
163
|
-
}
|
|
164
|
-
}, renderProps.children));
|
|
165
|
-
});
|
|
166
|
-
function $d2b4bc8c273e7be6$var$disablePendingProps(props) {
|
|
167
|
-
if (props.isPending) {
|
|
168
|
-
props.onPress = void 0;
|
|
169
|
-
props.onPressStart = void 0;
|
|
170
|
-
props.onPressEnd = void 0;
|
|
171
|
-
props.onPressChange = void 0;
|
|
172
|
-
props.onPressUp = void 0;
|
|
173
|
-
props.onKeyDown = void 0;
|
|
174
|
-
props.onKeyUp = void 0;
|
|
175
|
-
props.onClick = void 0;
|
|
176
|
-
props.href = void 0;
|
|
177
|
-
}
|
|
178
|
-
return props;
|
|
179
|
-
}
|
|
180
|
-
export {
|
|
181
|
-
$d2b4bc8c273e7be6$export$353f5b6fc5456de1 as $,
|
|
182
|
-
$d2b4bc8c273e7be6$export$24d547caef80ccd1 as a,
|
|
183
|
-
$319e236875307eab$export$a9b970dcc4ae71a9 as b,
|
|
184
|
-
$319e236875307eab$export$d10ae4f68404609a as c
|
|
185
|
-
};
|