@eightshift/ui-components 2.0.1 → 3.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/dist/{Button-OQ5EIPvt.js → Button-D7c-vzAt.js} +5 -5
- package/dist/{Collection-CJM_asJz.js → Collection-CDEKDgvV.js} +234 -128
- package/dist/{Color-B0HgM8f4.js → Color-MV5kBVXr.js} +1 -1
- package/dist/{ColorSwatch-Dv3Wxdl_.js → ColorSwatch-BqQfVu4L.js} +5 -5
- package/dist/{ComboBox-BnlZjJ3T.js → ComboBox-BL1hyP4p.js} +42 -21
- package/dist/{Dialog-CIh-hX93.js → Dialog-s3fX5lSh.js} +199 -88
- package/dist/{FieldError-D7A6s7O5.js → FieldError-52GVSGgC.js} +2 -2
- package/dist/{FocusScope-Cs5_OoeA.js → FocusScope-DbqfVa2Z.js} +206 -43
- package/dist/{Group-D6tr3U_n.js → Group-DMRt6g_N.js} +3 -3
- package/dist/{Heading-DiYTXoIW.js → Heading-B2153VXe.js} +1 -1
- package/dist/{Hidden-DnOd_jPX.js → Hidden-rE6uR-lr.js} +2 -6
- package/dist/{Input-Se0m3ubj.js → Input-CTTTeCpo.js} +10 -10
- package/dist/{Label-Ca9uelsn.js → Label-icmbmNdI.js} +2 -2
- package/dist/{List-Br274SP1.js → List-UdOhiW-i.js} +2 -0
- package/dist/{ListBox-D9dFEh5A.js → ListBox-CfdzmefC.js} +28 -27
- package/dist/{OverlayArrow-1jx-ZyCR.js → OverlayArrow-CMh-7gEM.js} +3 -3
- package/dist/{Separator-BhZycTUp.js → Separator-BxbOoGIK.js} +4 -4
- package/dist/{Slider-BZNaJylD.js → Slider-BZO0Tvut.js} +13 -14
- package/dist/{Text-aOUPPvTO.js → Text-DVSAPY-K.js} +1 -1
- package/dist/{VisuallyHidden-ClTQo25k.js → VisuallyHidden-ooItkWYR.js} +2 -2
- package/dist/assets/style-admin.css +1320 -1348
- package/dist/assets/style-editor.css +475 -503
- package/dist/assets/style.css +475 -503
- package/dist/assets/wp-font-enhancements.css +3 -3
- package/dist/assets/wp-ui-enhancements.css +45 -45
- package/dist/components/base-control/base-control.js +1 -1
- package/dist/components/button/button.js +5 -5
- package/dist/components/checkbox/checkbox.js +8 -8
- package/dist/components/color-pickers/color-swatch.js +2 -2
- package/dist/components/color-pickers/gradient-editor.js +2 -2
- package/dist/components/color-pickers/solid-color-picker.js +23 -25
- package/dist/components/container-panel/container-panel.js +9 -3
- package/dist/components/draggable/draggable-handle.js +4 -3
- package/dist/components/draggable/draggable.js +1166 -877
- package/dist/components/draggable-list/draggable-list-item.js +1 -1
- package/dist/components/draggable-list/draggable-list.js +3 -2
- package/dist/components/expandable/expandable.js +7 -13
- package/dist/components/input-field/input-field.js +10 -9
- package/dist/components/link-input/link-input.js +9 -10
- package/dist/components/menu/menu.js +5 -5
- package/dist/components/modal/modal.js +5 -5
- package/dist/components/notice/notice.js +1 -1
- package/dist/components/number-picker/number-picker.js +14 -12
- package/dist/components/options-panel/options-panel.js +1 -1
- package/dist/components/placeholders/image-placeholder.js +1 -1
- package/dist/components/popover/popover.js +1 -1
- package/dist/components/radio/radio.js +16 -15
- package/dist/components/repeater/repeater-item.js +11 -4
- package/dist/components/repeater/repeater.js +33 -4
- package/dist/components/responsive/mini-responsive.js +7 -4
- package/dist/components/responsive/responsive.js +7 -4
- package/dist/components/rich-label/rich-label.js +4 -3
- package/dist/components/select/async-multi-select.js +1 -1
- package/dist/components/select/multi-select-components.js +1 -1
- package/dist/components/select/multi-select.js +1 -1
- package/dist/components/select/styles.js +1 -1
- package/dist/components/select/v2/async-select.js +13 -13
- package/dist/components/select/v2/shared.js +3 -3
- package/dist/components/select/v2/single-select.js +22 -21
- package/dist/components/slider/column-config-slider.js +3 -3
- package/dist/components/slider/slider.js +4 -4
- package/dist/components/tabs/tabs.js +44 -24
- package/dist/components/toggle/switch.js +20 -17
- package/dist/components/toggle/toggle.js +1 -1
- package/dist/components/toggle-button/toggle-button.js +6 -6
- package/dist/components/tooltip/tooltip.js +17 -23
- package/dist/{context-CDOs-GuR.js → context-D2KUdwNL.js} +1 -1
- package/dist/icons/icons.js +229 -1629
- package/dist/icons/index.js +2 -3
- package/dist/icons/jsx-svg.js +1 -1
- package/dist/{index-CcCn9HWX.js → index-BKGQ6jGS.js} +1 -1
- package/dist/{multi-select-components-CkF3LyTF.js → multi-select-components-DJfz929p.js} +1 -1
- package/dist/{react-jsx-parser.min-CVit0rZn.js → react-jsx-parser.min-DZCiis5V.js} +48 -20
- package/dist/{textSelection-BlTDSskG.js → textSelection-CrrUNX-B.js} +8 -47
- package/dist/{useButton-CmLbE5vg.js → useButton-Dl1C1478.js} +5 -5
- package/dist/{useEvent-cLDJlznQ.js → useEvent-B0b-6KBr.js} +1 -1
- package/dist/useFocusRing-CxlVCVpL.js +107 -0
- package/dist/{useFormReset-NpLM2e3G.js → useFormReset-C5OggHsw.js} +1 -1
- package/dist/{useFormValidation-BWwmZQE2.js → useFormValidation-BgSHI8kQ.js} +2 -2
- package/dist/{focusSafely-CiqTTjWy.js → useHover-B-8Wji4B.js} +305 -98
- package/dist/{useLabel-C85N3Hzw.js → useLabel-D7HkNEHT.js} +2 -2
- package/dist/{useLabels-C_2wWraB.js → useLabels-D8cxd1Z8.js} +1 -1
- package/dist/{useListState-Z7FB_NzO.js → useListState-BXnC0mNr.js} +28 -13
- package/dist/{useLocalizedStringFormatter-BQ4TF72x.js → useLocalizedStringFormatter-CFP1YZWQ.js} +1 -1
- package/dist/{useNumberField-Bm6_BVl9.js → useNumberField-ecr8uK6_.js} +10 -10
- package/dist/{useNumberFormatter-DlUVKkO7.js → useNumberFormatter-321rAb4J.js} +1 -1
- package/dist/{usePress-rg_OQIGW.js → usePress-C3dxzVyi.js} +69 -63
- package/dist/{useSingleSelectListState-Cu3xtEJS.js → useSingleSelectListState-Dgbuzw5o.js} +2 -2
- package/dist/{useToggle-DzlgBLAJ.js → useToggle-DyZydSPy.js} +9 -7
- package/dist/{useToggleState-DhSBQxkp.js → useToggleState-BZoo5qt_.js} +1 -1
- package/dist/{utils-39D0mStj.js → utils-DkCSC521.js} +38 -35
- package/package.json +32 -32
- package/dist/useFocusRing-CGp3guTX.js +0 -41
- package/dist/useFocusable-087cO5Ct.js +0 -81
package/dist/icons/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { blockIcons, icons
|
|
1
|
+
import { blockIcons, icons } from "./icons.js";
|
|
2
2
|
import { BlockIcon } from "./block-icon.js";
|
|
3
3
|
import { GenericColorSwatch } from "./generic-color-swatch.js";
|
|
4
4
|
import { JsxSvg } from "./jsx-svg.js";
|
|
@@ -7,6 +7,5 @@ export {
|
|
|
7
7
|
GenericColorSwatch,
|
|
8
8
|
JsxSvg,
|
|
9
9
|
blockIcons,
|
|
10
|
-
icons
|
|
11
|
-
illustrations
|
|
10
|
+
icons
|
|
12
11
|
};
|
package/dist/icons/jsx-svg.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { s as svgToJsxString, a as source_default } from "../react-jsx-parser.min-
|
|
2
|
+
import { s as svgToJsxString, a as source_default } from "../react-jsx-parser.min-DZCiis5V.js";
|
|
3
3
|
/**
|
|
4
4
|
* Renders SVG string as JSX SVGs.
|
|
5
5
|
*
|
|
@@ -3704,7 +3704,7 @@ const getMultiValue = (ComponentToRender) => {
|
|
|
3704
3704
|
style,
|
|
3705
3705
|
ref: setNodeRef,
|
|
3706
3706
|
className: clsx(
|
|
3707
|
-
"es:focus:outline-hidden",
|
|
3707
|
+
"es:any-focus:outline-hidden",
|
|
3708
3708
|
// Make non-dragged tiles have no pointer events, so you don't see hover styles on things like the remove button.
|
|
3709
3709
|
CSS.Translate.toString(transform) && "es:[&_>_div]:pointer-events-none",
|
|
3710
3710
|
// Make the currently grabbed item into a fancy holo-like thing.
|
|
@@ -942,7 +942,8 @@ var require_acorn = __commonJS((exports, module) => {
|
|
|
942
942
|
} else if (options.ecmaVersion == null) {
|
|
943
943
|
if (!warnedAboutEcmaVersion2 && typeof console === "object" && console.warn) {
|
|
944
944
|
warnedAboutEcmaVersion2 = true;
|
|
945
|
-
console.warn(
|
|
945
|
+
console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
946
|
+
Defaulting to 2020, but this will stop working in the future.`);
|
|
946
947
|
}
|
|
947
948
|
options.ecmaVersion = 11;
|
|
948
949
|
} else if (options.ecmaVersion >= 2015) {
|
|
@@ -1006,7 +1007,8 @@ var require_acorn = __commonJS((exports, module) => {
|
|
|
1006
1007
|
this.containsEsc = false;
|
|
1007
1008
|
if (startPos) {
|
|
1008
1009
|
this.pos = startPos;
|
|
1009
|
-
this.lineStart = this.input.lastIndexOf(
|
|
1010
|
+
this.lineStart = this.input.lastIndexOf(`
|
|
1011
|
+
`, startPos - 1) + 1;
|
|
1010
1012
|
this.curLine = this.input.slice(0, this.lineStart).split(lineBreak2).length;
|
|
1011
1013
|
} else {
|
|
1012
1014
|
this.pos = this.lineStart = 0;
|
|
@@ -3252,12 +3254,14 @@ var require_acorn = __commonJS((exports, module) => {
|
|
|
3252
3254
|
this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
|
|
3253
3255
|
}
|
|
3254
3256
|
elem.value = {
|
|
3255
|
-
raw: this.value.replace(/\r\n?/g,
|
|
3257
|
+
raw: this.value.replace(/\r\n?/g, `
|
|
3258
|
+
`),
|
|
3256
3259
|
cooked: null
|
|
3257
3260
|
};
|
|
3258
3261
|
} else {
|
|
3259
3262
|
elem.value = {
|
|
3260
|
-
raw: this.input.slice(this.start, this.end).replace(/\r\n?/g,
|
|
3263
|
+
raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, `
|
|
3264
|
+
`),
|
|
3261
3265
|
cooked: this.value
|
|
3262
3266
|
};
|
|
3263
3267
|
}
|
|
@@ -5552,7 +5556,8 @@ var require_acorn = __commonJS((exports, module) => {
|
|
|
5552
5556
|
++this.pos;
|
|
5553
5557
|
}
|
|
5554
5558
|
case 10:
|
|
5555
|
-
out +=
|
|
5559
|
+
out += `
|
|
5560
|
+
`;
|
|
5556
5561
|
break;
|
|
5557
5562
|
default:
|
|
5558
5563
|
out += String.fromCharCode(ch);
|
|
@@ -5581,10 +5586,12 @@ var require_acorn = __commonJS((exports, module) => {
|
|
|
5581
5586
|
case "`":
|
|
5582
5587
|
return this.finishToken(types$12.invalidTemplate, this.input.slice(this.start, this.pos));
|
|
5583
5588
|
case "\r":
|
|
5584
|
-
if (this.input[this.pos + 1] ===
|
|
5589
|
+
if (this.input[this.pos + 1] === `
|
|
5590
|
+
`) {
|
|
5585
5591
|
++this.pos;
|
|
5586
5592
|
}
|
|
5587
|
-
case
|
|
5593
|
+
case `
|
|
5594
|
+
`:
|
|
5588
5595
|
case "\u2028":
|
|
5589
5596
|
case "\u2029":
|
|
5590
5597
|
++this.curLine;
|
|
@@ -5599,7 +5606,8 @@ var require_acorn = __commonJS((exports, module) => {
|
|
|
5599
5606
|
++this.pos;
|
|
5600
5607
|
switch (ch) {
|
|
5601
5608
|
case 110:
|
|
5602
|
-
return
|
|
5609
|
+
return `
|
|
5610
|
+
`;
|
|
5603
5611
|
case 114:
|
|
5604
5612
|
return "\r";
|
|
5605
5613
|
case 120:
|
|
@@ -5889,7 +5897,9 @@ var require_acorn_jsx = __commonJS((exports, module) => {
|
|
|
5889
5897
|
++this.pos;
|
|
5890
5898
|
if (ch === 13 && this.input.charCodeAt(this.pos) === 10) {
|
|
5891
5899
|
++this.pos;
|
|
5892
|
-
out = normalizeCRLF ?
|
|
5900
|
+
out = normalizeCRLF ? `
|
|
5901
|
+
` : `\r
|
|
5902
|
+
`;
|
|
5893
5903
|
} else {
|
|
5894
5904
|
out = String.fromCharCode(ch);
|
|
5895
5905
|
}
|
|
@@ -6459,7 +6469,8 @@ function getOptions(opts) {
|
|
|
6459
6469
|
} else if (options.ecmaVersion == null) {
|
|
6460
6470
|
if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) {
|
|
6461
6471
|
warnedAboutEcmaVersion = true;
|
|
6462
|
-
console.warn(
|
|
6472
|
+
console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
6473
|
+
Defaulting to 2020, but this will stop working in the future.`);
|
|
6463
6474
|
}
|
|
6464
6475
|
options.ecmaVersion = 11;
|
|
6465
6476
|
} else if (options.ecmaVersion >= 2015) {
|
|
@@ -6537,7 +6548,8 @@ var Parser = function Parser2(options, input, startPos) {
|
|
|
6537
6548
|
this.containsEsc = false;
|
|
6538
6549
|
if (startPos) {
|
|
6539
6550
|
this.pos = startPos;
|
|
6540
|
-
this.lineStart = this.input.lastIndexOf(
|
|
6551
|
+
this.lineStart = this.input.lastIndexOf(`
|
|
6552
|
+
`, startPos - 1) + 1;
|
|
6541
6553
|
this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
|
|
6542
6554
|
} else {
|
|
6543
6555
|
this.pos = this.lineStart = 0;
|
|
@@ -8786,12 +8798,14 @@ pp$5.parseTemplateElement = function(ref2) {
|
|
|
8786
8798
|
this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
|
|
8787
8799
|
}
|
|
8788
8800
|
elem.value = {
|
|
8789
|
-
raw: this.value.replace(/\r\n?/g,
|
|
8801
|
+
raw: this.value.replace(/\r\n?/g, `
|
|
8802
|
+
`),
|
|
8790
8803
|
cooked: null
|
|
8791
8804
|
};
|
|
8792
8805
|
} else {
|
|
8793
8806
|
elem.value = {
|
|
8794
|
-
raw: this.input.slice(this.start, this.end).replace(/\r\n?/g,
|
|
8807
|
+
raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, `
|
|
8808
|
+
`),
|
|
8795
8809
|
cooked: this.value
|
|
8796
8810
|
};
|
|
8797
8811
|
}
|
|
@@ -11089,7 +11103,8 @@ pp.readTmplToken = function() {
|
|
|
11089
11103
|
++this.pos;
|
|
11090
11104
|
}
|
|
11091
11105
|
case 10:
|
|
11092
|
-
out +=
|
|
11106
|
+
out += `
|
|
11107
|
+
`;
|
|
11093
11108
|
break;
|
|
11094
11109
|
default:
|
|
11095
11110
|
out += String.fromCharCode(ch);
|
|
@@ -11118,10 +11133,12 @@ pp.readInvalidTemplateToken = function() {
|
|
|
11118
11133
|
case "`":
|
|
11119
11134
|
return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos));
|
|
11120
11135
|
case "\r":
|
|
11121
|
-
if (this.input[this.pos + 1] ===
|
|
11136
|
+
if (this.input[this.pos + 1] === `
|
|
11137
|
+
`) {
|
|
11122
11138
|
++this.pos;
|
|
11123
11139
|
}
|
|
11124
|
-
case
|
|
11140
|
+
case `
|
|
11141
|
+
`:
|
|
11125
11142
|
case "\u2028":
|
|
11126
11143
|
case "\u2029":
|
|
11127
11144
|
++this.curLine;
|
|
@@ -11136,7 +11153,8 @@ pp.readEscapedChar = function(inTemplate) {
|
|
|
11136
11153
|
++this.pos;
|
|
11137
11154
|
switch (ch) {
|
|
11138
11155
|
case 110:
|
|
11139
|
-
return
|
|
11156
|
+
return `
|
|
11157
|
+
`;
|
|
11140
11158
|
case 114:
|
|
11141
11159
|
return "\r";
|
|
11142
11160
|
case 120:
|
|
@@ -11495,7 +11513,7 @@ class JsxParser extends React__default.Component {
|
|
|
11495
11513
|
this.props.onError(new Error(`The expression '${expression.callee}' could not be resolved, resulting in an undefined return value.`));
|
|
11496
11514
|
return;
|
|
11497
11515
|
}
|
|
11498
|
-
return parsedCallee(...expression.arguments.map((arg) => __privateGet(this, _parseExpression).call(this, arg,
|
|
11516
|
+
return parsedCallee(...expression.arguments.map((arg) => __privateGet(this, _parseExpression).call(this, arg, scope)));
|
|
11499
11517
|
case "ConditionalExpression":
|
|
11500
11518
|
return __privateGet(this, _parseExpression).call(this, expression.test, scope) ? __privateGet(this, _parseExpression).call(this, expression.consequent, scope) : __privateGet(this, _parseExpression).call(this, expression.alternate, scope);
|
|
11501
11519
|
case "ExpressionStatement":
|
|
@@ -11555,7 +11573,7 @@ class JsxParser extends React__default.Component {
|
|
|
11555
11573
|
(_b = (_a = this.props).onError) == null ? void 0 : _b.call(_a, new Error("Async and generator arrow functions are not supported."));
|
|
11556
11574
|
}
|
|
11557
11575
|
return (...args) => {
|
|
11558
|
-
const functionScope = {};
|
|
11576
|
+
const functionScope = { ...scope };
|
|
11559
11577
|
expression.params.forEach((param, idx) => {
|
|
11560
11578
|
functionScope[param.name] = args[idx];
|
|
11561
11579
|
});
|
|
@@ -11634,14 +11652,24 @@ class JsxParser extends React__default.Component {
|
|
|
11634
11652
|
}
|
|
11635
11653
|
}
|
|
11636
11654
|
let children;
|
|
11637
|
-
|
|
11655
|
+
let component = element.type === "JSXElement" ? resolvePath(components, name) : Fragment;
|
|
11638
11656
|
if (component || canHaveChildren(name)) {
|
|
11639
11657
|
children = childNodes.map((node) => __privateGet(this, _parseExpression).call(this, node, scope));
|
|
11658
|
+
if (name.includes(".")) {
|
|
11659
|
+
const nameParts = name.split(".");
|
|
11660
|
+
const componentPath = nameParts.reduce((acc, part) => acc ? acc[part] : components == null ? void 0 : components[part], null);
|
|
11661
|
+
if (componentPath) {
|
|
11662
|
+
component = componentPath;
|
|
11663
|
+
}
|
|
11664
|
+
}
|
|
11640
11665
|
if (!component && !canHaveWhitespace(name)) {
|
|
11641
11666
|
children = children.filter((child) => typeof child !== "string" || !/^\s*$/.test(child));
|
|
11642
11667
|
}
|
|
11668
|
+
const childFn = children.find((child) => typeof child === "function");
|
|
11643
11669
|
if (children.length === 0) {
|
|
11644
11670
|
children = void 0;
|
|
11671
|
+
} else if (childFn) {
|
|
11672
|
+
children = childFn;
|
|
11645
11673
|
} else if (children.length === 1) {
|
|
11646
11674
|
[children] = children;
|
|
11647
11675
|
} else if (children.length > 1 && !this.props.disableKeyGeneration) {
|
|
@@ -1,44 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { m as $c87311424ea30a05$export$fedb369cb70207f1, g as $431fbd86ca7dc216$export$b204af158042fbac, n as $bbed8b41f857bcc0$export$24490316f764c430 } from "./focusSafely-CiqTTjWy.js";
|
|
3
|
-
function $03deb23ff14920c4$export$4eaf04e54aa8eed6() {
|
|
4
|
-
let globalListeners = useRef(/* @__PURE__ */ new Map());
|
|
5
|
-
let addGlobalListener = useCallback((eventTarget, type, listener, options) => {
|
|
6
|
-
let fn = (options === null || options === void 0 ? void 0 : options.once) ? (...args) => {
|
|
7
|
-
globalListeners.current.delete(listener);
|
|
8
|
-
listener(...args);
|
|
9
|
-
} : listener;
|
|
10
|
-
globalListeners.current.set(listener, {
|
|
11
|
-
type,
|
|
12
|
-
eventTarget,
|
|
13
|
-
fn,
|
|
14
|
-
options
|
|
15
|
-
});
|
|
16
|
-
eventTarget.addEventListener(type, fn, options);
|
|
17
|
-
}, []);
|
|
18
|
-
let removeGlobalListener = useCallback((eventTarget, type, listener, options) => {
|
|
19
|
-
var _globalListeners_current_get;
|
|
20
|
-
let fn = ((_globalListeners_current_get = globalListeners.current.get(listener)) === null || _globalListeners_current_get === void 0 ? void 0 : _globalListeners_current_get.fn) || listener;
|
|
21
|
-
eventTarget.removeEventListener(type, fn, options);
|
|
22
|
-
globalListeners.current.delete(listener);
|
|
23
|
-
}, []);
|
|
24
|
-
let removeAllGlobalListeners = useCallback(() => {
|
|
25
|
-
globalListeners.current.forEach((value, key) => {
|
|
26
|
-
removeGlobalListener(value.eventTarget, value.type, key, value.options);
|
|
27
|
-
});
|
|
28
|
-
}, [
|
|
29
|
-
removeGlobalListener
|
|
30
|
-
]);
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
return removeAllGlobalListeners;
|
|
33
|
-
}, [
|
|
34
|
-
removeAllGlobalListeners
|
|
35
|
-
]);
|
|
36
|
-
return {
|
|
37
|
-
addGlobalListener,
|
|
38
|
-
removeGlobalListener,
|
|
39
|
-
removeAllGlobalListeners
|
|
40
|
-
};
|
|
41
|
-
}
|
|
1
|
+
import { c as $c87311424ea30a05$export$fedb369cb70207f1, d as $431fbd86ca7dc216$export$b204af158042fbac, e as $bbed8b41f857bcc0$export$24490316f764c430 } from "./useHover-B-8Wji4B.js";
|
|
42
2
|
let $14c0b72509d70225$var$state = "default";
|
|
43
3
|
let $14c0b72509d70225$var$savedUserSelect = "";
|
|
44
4
|
let $14c0b72509d70225$var$modifiedElementMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -51,8 +11,9 @@ function $14c0b72509d70225$export$16a4697467175487(target) {
|
|
|
51
11
|
}
|
|
52
12
|
$14c0b72509d70225$var$state = "disabled";
|
|
53
13
|
} else if (target instanceof HTMLElement || target instanceof SVGElement) {
|
|
54
|
-
|
|
55
|
-
target.style
|
|
14
|
+
let property = "userSelect" in target.style ? "userSelect" : "webkitUserSelect";
|
|
15
|
+
$14c0b72509d70225$var$modifiedElementMap.set(target, target.style[property]);
|
|
16
|
+
target.style[property] = "none";
|
|
56
17
|
}
|
|
57
18
|
}
|
|
58
19
|
function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) {
|
|
@@ -72,14 +33,14 @@ function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) {
|
|
|
72
33
|
} else if (target instanceof HTMLElement || target instanceof SVGElement) {
|
|
73
34
|
if (target && $14c0b72509d70225$var$modifiedElementMap.has(target)) {
|
|
74
35
|
let targetOldUserSelect = $14c0b72509d70225$var$modifiedElementMap.get(target);
|
|
75
|
-
|
|
36
|
+
let property = "userSelect" in target.style ? "userSelect" : "webkitUserSelect";
|
|
37
|
+
if (target.style[property] === "none") target.style[property] = targetOldUserSelect;
|
|
76
38
|
if (target.getAttribute("style") === "") target.removeAttribute("style");
|
|
77
39
|
$14c0b72509d70225$var$modifiedElementMap.delete(target);
|
|
78
40
|
}
|
|
79
41
|
}
|
|
80
42
|
}
|
|
81
43
|
export {
|
|
82
|
-
$
|
|
83
|
-
$14c0b72509d70225$export$
|
|
84
|
-
$14c0b72509d70225$export$16a4697467175487 as b
|
|
44
|
+
$14c0b72509d70225$export$b0d6fa1ab32e3295 as $,
|
|
45
|
+
$14c0b72509d70225$export$16a4697467175487 as a
|
|
85
46
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { d as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-
|
|
1
|
+
import { d as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-DkCSC521.js";
|
|
2
2
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-EDDcM64A.js";
|
|
3
|
-
import { $ as $
|
|
4
|
-
import {
|
|
3
|
+
import { $ as $f6c31cce2adf654f$export$45712eceda6fad21 } from "./usePress-C3dxzVyi.js";
|
|
4
|
+
import { a as $f645667febf57a63$export$4c014de7c8940b4c } from "./useHover-B-8Wji4B.js";
|
|
5
5
|
function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
|
|
6
6
|
let {
|
|
7
7
|
elementType = "button",
|
|
@@ -27,7 +27,6 @@ function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
|
|
|
27
27
|
};
|
|
28
28
|
else additionalProps = {
|
|
29
29
|
role: "button",
|
|
30
|
-
tabIndex: isDisabled ? void 0 : 0,
|
|
31
30
|
href: elementType === "a" && !isDisabled ? href : void 0,
|
|
32
31
|
target: elementType === "a" ? target : void 0,
|
|
33
32
|
type: elementType === "input" ? type : void 0,
|
|
@@ -45,7 +44,7 @@ function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
|
|
|
45
44
|
preventFocusOnPress,
|
|
46
45
|
ref
|
|
47
46
|
});
|
|
48
|
-
let { focusableProps } = $
|
|
47
|
+
let { focusableProps } = $f645667febf57a63$export$4c014de7c8940b4c(props, ref);
|
|
49
48
|
if (allowFocusWhenDisabled) focusableProps.tabIndex = isDisabled ? -1 : focusableProps.tabIndex;
|
|
50
49
|
let buttonProps = $3ef42575df84b30b$export$9d1611c77c2fe928(focusableProps, pressProps, $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
51
50
|
labelable: true
|
|
@@ -57,6 +56,7 @@ function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
|
|
|
57
56
|
"aria-expanded": props["aria-expanded"],
|
|
58
57
|
"aria-controls": props["aria-controls"],
|
|
59
58
|
"aria-pressed": props["aria-pressed"],
|
|
59
|
+
"aria-current": props["aria-current"],
|
|
60
60
|
onClick: (e) => {
|
|
61
61
|
if (deprecatedOnClick) {
|
|
62
62
|
deprecatedOnClick(e);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as $8ae05eaa5c114e9c$export$7f54fc3180508a52 } from "./utils-DkCSC521.js";
|
|
2
2
|
import { useEffect } from "react";
|
|
3
3
|
function $e9faafb641e167db$export$90fc3a17d93f704c(ref, event, handler, options) {
|
|
4
4
|
let handleEvent = $8ae05eaa5c114e9c$export$7f54fc3180508a52(handler);
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { g as $03deb23ff14920c4$export$4eaf04e54aa8eed6, h as $8a9cb279dc87e130$export$715c682d09d639cc, d as $431fbd86ca7dc216$export$b204af158042fbac, i as $d4ee10de306f2510$export$cd4e5573fbe2b576, j as $d4ee10de306f2510$export$e58f029f0fbfdb29, k as $d4ee10de306f2510$export$4282f70798064fe0, l as $8a9cb279dc87e130$export$905e7fc544a71f36, m as $507fabe10e71c6fb$export$b9b3dfddab17db27, n as $507fabe10e71c6fb$export$ec71b4b83ac08ec3, o as $a1ea59d68270f0dd$export$f8168d8dd8fd66e6 } from "./useHover-B-8Wji4B.js";
|
|
2
|
+
import { useRef, useCallback, useState } from "react";
|
|
3
|
+
function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
|
|
4
|
+
let { isDisabled, onBlurWithin, onFocusWithin, onFocusWithinChange } = props;
|
|
5
|
+
let state = useRef({
|
|
6
|
+
isFocusWithin: false
|
|
7
|
+
});
|
|
8
|
+
let { addGlobalListener, removeAllGlobalListeners } = $03deb23ff14920c4$export$4eaf04e54aa8eed6();
|
|
9
|
+
let onBlur = useCallback((e) => {
|
|
10
|
+
if (!e.currentTarget.contains(e.target)) return;
|
|
11
|
+
if (state.current.isFocusWithin && !e.currentTarget.contains(e.relatedTarget)) {
|
|
12
|
+
state.current.isFocusWithin = false;
|
|
13
|
+
removeAllGlobalListeners();
|
|
14
|
+
if (onBlurWithin) onBlurWithin(e);
|
|
15
|
+
if (onFocusWithinChange) onFocusWithinChange(false);
|
|
16
|
+
}
|
|
17
|
+
}, [
|
|
18
|
+
onBlurWithin,
|
|
19
|
+
onFocusWithinChange,
|
|
20
|
+
state,
|
|
21
|
+
removeAllGlobalListeners
|
|
22
|
+
]);
|
|
23
|
+
let onSyntheticFocus = $8a9cb279dc87e130$export$715c682d09d639cc(onBlur);
|
|
24
|
+
let onFocus = useCallback((e) => {
|
|
25
|
+
if (!e.currentTarget.contains(e.target)) return;
|
|
26
|
+
const ownerDocument = $431fbd86ca7dc216$export$b204af158042fbac(e.target);
|
|
27
|
+
const activeElement = $d4ee10de306f2510$export$cd4e5573fbe2b576(ownerDocument);
|
|
28
|
+
if (!state.current.isFocusWithin && activeElement === $d4ee10de306f2510$export$e58f029f0fbfdb29(e.nativeEvent)) {
|
|
29
|
+
if (onFocusWithin) onFocusWithin(e);
|
|
30
|
+
if (onFocusWithinChange) onFocusWithinChange(true);
|
|
31
|
+
state.current.isFocusWithin = true;
|
|
32
|
+
onSyntheticFocus(e);
|
|
33
|
+
let currentTarget = e.currentTarget;
|
|
34
|
+
addGlobalListener(ownerDocument, "focus", (e2) => {
|
|
35
|
+
if (state.current.isFocusWithin && !$d4ee10de306f2510$export$4282f70798064fe0(currentTarget, e2.target)) {
|
|
36
|
+
let event = new $8a9cb279dc87e130$export$905e7fc544a71f36("blur", new ownerDocument.defaultView.FocusEvent("blur", {
|
|
37
|
+
relatedTarget: e2.target
|
|
38
|
+
}));
|
|
39
|
+
event.target = currentTarget;
|
|
40
|
+
event.currentTarget = currentTarget;
|
|
41
|
+
onBlur(event);
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
capture: true
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}, [
|
|
48
|
+
onFocusWithin,
|
|
49
|
+
onFocusWithinChange,
|
|
50
|
+
onSyntheticFocus,
|
|
51
|
+
addGlobalListener,
|
|
52
|
+
onBlur
|
|
53
|
+
]);
|
|
54
|
+
if (isDisabled) return {
|
|
55
|
+
focusWithinProps: {
|
|
56
|
+
// These cannot be null, that would conflict in mergeProps
|
|
57
|
+
onFocus: void 0,
|
|
58
|
+
onBlur: void 0
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
return {
|
|
62
|
+
focusWithinProps: {
|
|
63
|
+
onFocus,
|
|
64
|
+
onBlur
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function $f7dceffc5ad7768b$export$4e328f61c538687f(props = {}) {
|
|
69
|
+
let { autoFocus = false, isTextInput, within } = props;
|
|
70
|
+
let state = useRef({
|
|
71
|
+
isFocused: false,
|
|
72
|
+
isFocusVisible: autoFocus || $507fabe10e71c6fb$export$b9b3dfddab17db27()
|
|
73
|
+
});
|
|
74
|
+
let [isFocused, setFocused] = useState(false);
|
|
75
|
+
let [isFocusVisibleState, setFocusVisible] = useState(() => state.current.isFocused && state.current.isFocusVisible);
|
|
76
|
+
let updateState = useCallback(() => setFocusVisible(state.current.isFocused && state.current.isFocusVisible), []);
|
|
77
|
+
let onFocusChange = useCallback((isFocused2) => {
|
|
78
|
+
state.current.isFocused = isFocused2;
|
|
79
|
+
setFocused(isFocused2);
|
|
80
|
+
updateState();
|
|
81
|
+
}, [
|
|
82
|
+
updateState
|
|
83
|
+
]);
|
|
84
|
+
$507fabe10e71c6fb$export$ec71b4b83ac08ec3((isFocusVisible) => {
|
|
85
|
+
state.current.isFocusVisible = isFocusVisible;
|
|
86
|
+
updateState();
|
|
87
|
+
}, [], {
|
|
88
|
+
isTextInput
|
|
89
|
+
});
|
|
90
|
+
let { focusProps } = $a1ea59d68270f0dd$export$f8168d8dd8fd66e6({
|
|
91
|
+
isDisabled: within,
|
|
92
|
+
onFocusChange
|
|
93
|
+
});
|
|
94
|
+
let { focusWithinProps } = $9ab94262bd0047c7$export$420e68273165f4ec({
|
|
95
|
+
isDisabled: !within,
|
|
96
|
+
onFocusWithinChange: onFocusChange
|
|
97
|
+
});
|
|
98
|
+
return {
|
|
99
|
+
isFocused,
|
|
100
|
+
isFocusVisible: isFocusVisibleState,
|
|
101
|
+
focusProps: within ? focusWithinProps : focusProps
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
export {
|
|
105
|
+
$f7dceffc5ad7768b$export$4e328f61c538687f as $,
|
|
106
|
+
$9ab94262bd0047c7$export$420e68273165f4ec as a
|
|
107
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as $8ae05eaa5c114e9c$export$7f54fc3180508a52 } from "./utils-DkCSC521.js";
|
|
2
2
|
import { useRef, useEffect } from "react";
|
|
3
3
|
function $99facab73266f662$export$5add1d006293d136(ref, initialValue, onReset) {
|
|
4
4
|
let resetValue = useRef(initialValue);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext, useMemo, useContext, useState, useRef, useEffect } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { p as $507fabe10e71c6fb$export$8397ddfc504fdb9a } from "./useHover-B-8Wji4B.js";
|
|
3
|
+
import { k as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, f as $8ae05eaa5c114e9c$export$7f54fc3180508a52 } from "./utils-DkCSC521.js";
|
|
4
4
|
const $e5be200c675c3b3a$export$aca958c65c314e6c = {
|
|
5
5
|
badInput: false,
|
|
6
6
|
customError: false,
|