@eightshift/ui-components 1.4.4 → 1.4.6
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/assets/style.css +1 -1
- package/dist/assets/wp-ui-enhancements.css +1 -1
- package/dist/components/animated-visibility/animated-visibility.js +132 -162
- package/dist/components/button/button.js +6 -2
- package/dist/components/input-field/input-field.js +3 -1
- package/dist/components/link-input/link-input.js +2 -2
- package/dist/components/menu/menu.js +1 -2
- package/dist/components/option-select/option-select.js +12 -6
- package/dist/components/popover/popover.js +8 -2
- package/dist/components/repeater/repeater.js +4 -8
- package/dist/components/select/async-multi-select.js +6 -3
- package/dist/components/select/async-single-select.js +4 -1
- package/dist/components/select/multi-select.js +11 -4
- package/dist/components/select/shared.js +7 -56
- package/dist/components/select/single-select.js +9 -2
- package/package.json +9 -9
- package/dist/hooks/use-cell-edit-mode.js +0 -35
|
@@ -1 +1 @@
|
|
|
1
|
-
.edit-post-header__toolbar .components-button,.edit-post-header__settings .components-button,.edit-post-sidebar .components-button:not(:-webkit-any(.components-panel__body-toggle,.editor-post-last-revision__title)),.components-snackbar,.components-toggle-group-control,.editor-post-publish-panel .components-button,.edit-post-text-editor__toolbar .components-button,.edit-post-text-editor__body .components-textarea-control__input{border-radius:.375rem!important}.edit-post-header__toolbar .components-button,.edit-post-header__settings .components-button,.edit-post-sidebar .components-button:not(:-moz-any(.components-panel__body-toggle,.editor-post-last-revision__title)),.components-snackbar,.components-toggle-group-control,.editor-post-publish-panel .components-button,.edit-post-text-editor__toolbar .components-button,.edit-post-text-editor__body .components-textarea-control__input{border-radius:.375rem!important}.edit-post-header__toolbar .components-button,.edit-post-header__settings .components-button,.edit-post-sidebar .components-button:not(:is(.components-panel__body-toggle,.editor-post-last-revision__title)),.components-snackbar,.components-toggle-group-control,.editor-post-publish-panel .components-button,.edit-post-text-editor__toolbar .components-button,.edit-post-text-editor__body .components-textarea-control__input{border-radius:.375rem!important}.components-input-control__container,.components-combobox-control__suggestions-container,.components-checkbox-control__input,button.components-toggle-group-control-option-base,.editor-post-visibility__password-input{border-radius:.25rem!important}.components-button-group .components-button:first-child{border-top-left-radius:.375rem!important;border-bottom-left-radius:.375rem!important}.components-button-group .components-button:last-child{border-top-right-radius:.375rem!important;border-bottom-right-radius:.375rem!important}.components-popover__content{border-radius:.5rem!important}.block-editor-inserter__search{border-top-left-radius:.5rem!important;border-top-right-radius:.5rem!important}.components-base-control__label,.components-input-control__label,.components-custom-select-control__label{text-transform:none!important;letter-spacing:0!important;font-size:13px!important;font-weight:400!important}.edit-post-sidebar{width:20rem!important}.block-list-appender.wp-block{padding:.25rem!important;position:static!important}.components-dropdown.block-editor-inserter{width:-moz-fit-content!important;width:fit-content!important;margin-left:auto!important;margin-right:auto!important}.block-editor-block-list__block-crash-warning{--tw-shadow:var(--tw-shadow-colored)!important;--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)!important;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)!important;--tw-shadow-color:#b91c1c1a!important;border-color:#b91c1c26!important;border-radius:.5rem!important}.block-editor-block-list__block-crash-warning .block-editor-warning__message{--tw-text-opacity:1!important;color:rgb(69 10 10/var(--tw-text-opacity))!important}.block-editor-block-contextual-toolbar,.block-editor-block-parent-selector__button{--tw-shadow:0 1px 2px 0 #0000000d;--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);border-radius:.5rem!important}.block-editor-block-types-list .block-editor-block-types-list__item{border-radius:.5rem!important}.block-editor-block-types-list .block-editor-block-types-list__item:after{content:var(--tw-content)!important;border-radius:.5rem!important}.block-editor-block-types-list .block-editor-block-types-list__item svg{--tw-scale-x:1.25;--tw-scale-y:1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.block-editor-list-view-tree .block-editor-block-icon{border-radius:.25rem!important}.block-editor-list-view-tree .block-editor-list-view-leaf>:first-child{border-top-left-radius:.5rem!important;border-bottom-left-radius:.5rem!important}.block-editor-list-view-tree .block-editor-list-view-leaf>:last-child{border-top-right-radius:.5rem!important;border-bottom-right-radius:.5rem!important}.block-editor-block-inspector .block-editor-block-card .block-editor-block-icon{border-radius:.25rem!important}.block-list-appender.wp-block>.block-editor-default-block-appender{width:-moz-fit-content;width:fit-content}.block-list-appender.wp-block>.block-editor-default-block-appender .block-editor-inserter__toggle{width:2.25rem!important;height:2.25rem!important}.block-list-appender.wp-block>.block-editor-default-block-appender .block-editor-inserter__toggle{border-radius:.375rem!important}.edit-post-header__toolbar .components-button{min-height:2.25rem!important}.edit-post-header__toolbar .components-button{min-width:2.25rem!important}.editor-styles-wrapper .wp-block:not(:-webkit-any(.editor-post-title,.block-list-appender)){max-width:100%!important}.editor-styles-wrapper .wp-block:not(:-moz-any(.editor-post-title,.block-list-appender)){max-width:100%!important}.editor-styles-wrapper .wp-block:not(:is(.editor-post-title,.block-list-appender)){max-width:100%!important}.components-tooltip{--tw-border-opacity:1;border-width:1px;border-color:rgb(31 41 55/var(--tw-border-opacity));--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity));--tw-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);--tw-backdrop-blur:blur(24px);--tw-backdrop-brightness:brightness(1.05);--tw-backdrop-saturate:saturate(1.5);-webkit-backdrop-filter:var(--tw-backdrop-blur)var(--tw-backdrop-brightness)var(--tw-backdrop-contrast)var(--tw-backdrop-grayscale)var(--tw-backdrop-hue-rotate)var(--tw-backdrop-invert)var(--tw-backdrop-opacity)var(--tw-backdrop-saturate)var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur)var(--tw-backdrop-brightness)var(--tw-backdrop-contrast)var(--tw-backdrop-grayscale)var(--tw-backdrop-hue-rotate)var(--tw-backdrop-invert)var(--tw-backdrop-opacity)var(--tw-backdrop-saturate)var(--tw-backdrop-sepia);background-color:#030712b3;padding:.125rem .25rem;border-radius:.375rem!important}.components-tooltip:has(>:first-child){--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity));--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity));background-color:#fffc}
|
|
1
|
+
.edit-post-header__toolbar .components-button,.edit-post-header__settings .components-button,.editor-document-tools__left .components-button,.editor-header__center .components-button,.editor-header__settings .components-button,.edit-post-sidebar .components-button:not(:-webkit-any(.components-panel__body-toggle,.editor-post-last-revision__title)),.components-snackbar,.components-toggle-group-control,.editor-post-publish-panel .components-button,.edit-post-text-editor__toolbar .components-button,.edit-post-text-editor__body .components-textarea-control__input,.media-modal-content,.media-modal-content .components-button,.components-guide__container .components-button,.components-notice__content .components-button,.editor-post-featured-image__toggle.components-button{border-radius:.375rem!important}.edit-post-header__toolbar .components-button,.edit-post-header__settings .components-button,.editor-document-tools__left .components-button,.editor-header__center .components-button,.editor-header__settings .components-button,.edit-post-sidebar .components-button:not(:-moz-any(.components-panel__body-toggle,.editor-post-last-revision__title)),.components-snackbar,.components-toggle-group-control,.editor-post-publish-panel .components-button,.edit-post-text-editor__toolbar .components-button,.edit-post-text-editor__body .components-textarea-control__input,.media-modal-content,.media-modal-content .components-button,.components-guide__container .components-button,.components-notice__content .components-button,.editor-post-featured-image__toggle.components-button{border-radius:.375rem!important}.edit-post-header__toolbar .components-button,.edit-post-header__settings .components-button,.editor-document-tools__left .components-button,.editor-header__center .components-button,.editor-header__settings .components-button,.edit-post-sidebar .components-button:not(:is(.components-panel__body-toggle,.editor-post-last-revision__title)),.components-snackbar,.components-toggle-group-control,.editor-post-publish-panel .components-button,.edit-post-text-editor__toolbar .components-button,.edit-post-text-editor__body .components-textarea-control__input,.media-modal-content,.media-modal-content .components-button,.components-guide__container .components-button,.components-notice__content .components-button,.editor-post-featured-image__toggle.components-button{border-radius:.375rem!important}.components-input-control__container,.components-combobox-control__suggestions-container,.components-checkbox-control__input,button.components-toggle-group-control-option-base,.editor-post-visibility__password-input{border-radius:.25rem!important}.components-button-group .components-button:first-child{border-top-left-radius:.375rem!important;border-bottom-left-radius:.375rem!important}.components-button-group .components-button:last-child{border-top-right-radius:.375rem!important;border-bottom-right-radius:.375rem!important}.components-popover__content,.components-guide{border-radius:.5rem!important}.block-editor-inserter__search{border-top-left-radius:.5rem!important;border-top-right-radius:.5rem!important}.media-menu-item.active{border-top-left-radius:.375rem!important;border-top-right-radius:.375rem!important}.components-base-control__label,.components-input-control__label,.components-custom-select-control__label{text-transform:none!important;letter-spacing:0!important;font-size:13px!important;font-weight:400!important}.edit-post-sidebar,.interface-interface-skeleton__sidebar:not(:empty)>.interface-complementary-area__fill[style="width: 280px;"],.interface-complementary-area.editor-sidebar{width:20rem!important}.block-list-appender.wp-block{padding:.25rem!important;position:static!important}.components-dropdown.block-editor-inserter{width:-moz-fit-content!important;width:fit-content!important;margin-left:auto!important;margin-right:auto!important}.block-editor-block-list__block-crash-warning{--tw-shadow:var(--tw-shadow-colored)!important;--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)!important;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)!important;--tw-shadow-color:#b91c1c1a!important;border-color:#b91c1c26!important;border-radius:.5rem!important}.block-editor-block-list__block-crash-warning .block-editor-warning__message{--tw-text-opacity:1!important;color:rgb(69 10 10/var(--tw-text-opacity))!important}.block-editor-block-contextual-toolbar,.block-editor-block-parent-selector__button{--tw-shadow:0 1px 2px 0 #0000000d;--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);border-radius:.5rem!important}.block-editor-block-types-list .block-editor-block-types-list__item{border-radius:.5rem!important}.block-editor-block-types-list .block-editor-block-types-list__item:after{content:var(--tw-content)!important;border-radius:.5rem!important}.block-editor-block-types-list .block-editor-block-types-list__item svg{--tw-scale-x:1.25;--tw-scale-y:1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.block-editor-list-view-tree .block-editor-block-icon{border-radius:.25rem!important}.block-editor-list-view-tree .block-editor-list-view-leaf>:first-child{border-top-left-radius:.5rem!important;border-bottom-left-radius:.5rem!important}.block-editor-list-view-tree .block-editor-list-view-leaf>:last-child{border-top-right-radius:.5rem!important;border-bottom-right-radius:.5rem!important}.block-editor-block-inspector .block-editor-block-card .block-editor-block-icon{border-radius:.25rem!important}.block-list-appender.wp-block>.block-editor-default-block-appender{width:-moz-fit-content;width:fit-content}.block-list-appender.wp-block>.block-editor-default-block-appender .block-editor-inserter__toggle{width:2.25rem!important;height:2.25rem!important}.block-list-appender.wp-block>.block-editor-default-block-appender .block-editor-inserter__toggle{border-radius:.375rem!important}:is(.edit-post-header__toolbar,.edit-post-header__settings,.editor-document-tools__left,.editor-header__center,.editor-header__settings) .components-button{min-height:2.25rem!important}:is(.edit-post-header__toolbar,.edit-post-header__settings,.editor-document-tools__left,.editor-header__center,.editor-header__settings) .components-button{min-width:2.25rem!important}.editor-styles-wrapper .wp-block:not(:-webkit-any(.editor-post-title,.block-list-appender)){max-width:100%!important}.editor-styles-wrapper .wp-block:not(:-moz-any(.editor-post-title,.block-list-appender)){max-width:100%!important}.editor-styles-wrapper .wp-block:not(:is(.editor-post-title,.block-list-appender)){max-width:100%!important}.components-tooltip{--tw-border-opacity:1;border-width:1px;border-color:rgb(31 41 55/var(--tw-border-opacity));--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity));--tw-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);--tw-backdrop-blur:blur(24px);--tw-backdrop-brightness:brightness(1.05);--tw-backdrop-saturate:saturate(1.5);-webkit-backdrop-filter:var(--tw-backdrop-blur)var(--tw-backdrop-brightness)var(--tw-backdrop-contrast)var(--tw-backdrop-grayscale)var(--tw-backdrop-hue-rotate)var(--tw-backdrop-invert)var(--tw-backdrop-opacity)var(--tw-backdrop-saturate)var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur)var(--tw-backdrop-brightness)var(--tw-backdrop-contrast)var(--tw-backdrop-grayscale)var(--tw-backdrop-hue-rotate)var(--tw-backdrop-invert)var(--tw-backdrop-opacity)var(--tw-backdrop-saturate)var(--tw-backdrop-sepia);background-color:#030712b3;padding:.125rem .25rem;border-radius:.375rem!important}.components-tooltip:has(>:first-child){--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity));--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity));background-color:#fffc}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { createContext, useLayoutEffect, useEffect, useContext, useRef, useInsertionEffect, useCallback, useMemo, forwardRef, Fragment, createElement, useId, Component,
|
|
3
|
+
import { createContext, useLayoutEffect, useEffect, useContext, useRef, useInsertionEffect, useCallback, useMemo, forwardRef, Fragment, createElement, useId, Component, Children, isValidElement, useState } from "react";
|
|
4
4
|
const MotionConfigContext = createContext({
|
|
5
5
|
transformPagePoint: (p) => p,
|
|
6
6
|
isStatic: false,
|
|
@@ -498,40 +498,6 @@ function isForcedMotionValue(key, { layout: layout2, layoutId }) {
|
|
|
498
498
|
return transformProps.has(key) || key.startsWith("origin") || (layout2 || layoutId !== void 0) && (!!scaleCorrectors[key] || key === "opacity");
|
|
499
499
|
}
|
|
500
500
|
const isMotionValue = (value) => Boolean(value && value.getVelocity);
|
|
501
|
-
const translateAlias = {
|
|
502
|
-
x: "translateX",
|
|
503
|
-
y: "translateY",
|
|
504
|
-
z: "translateZ",
|
|
505
|
-
transformPerspective: "perspective"
|
|
506
|
-
};
|
|
507
|
-
const numTransforms = transformPropOrder.length;
|
|
508
|
-
function buildTransform(transform, transformIsDefault, transformTemplate) {
|
|
509
|
-
let transformString = "";
|
|
510
|
-
for (let i = 0; i < numTransforms; i++) {
|
|
511
|
-
const key = transformPropOrder[i];
|
|
512
|
-
if (transform[key] !== void 0) {
|
|
513
|
-
const transformName = translateAlias[key] || key;
|
|
514
|
-
transformString += `${transformName}(${transform[key]}) `;
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
transformString = transformString.trim();
|
|
518
|
-
if (transformTemplate) {
|
|
519
|
-
transformString = transformTemplate(transform, transformIsDefault ? "" : transformString);
|
|
520
|
-
} else if (transformIsDefault) {
|
|
521
|
-
transformString = "none";
|
|
522
|
-
}
|
|
523
|
-
return transformString;
|
|
524
|
-
}
|
|
525
|
-
const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token);
|
|
526
|
-
const isCSSVariableName = checkStringStartsWith("--");
|
|
527
|
-
const startsAsVariableToken = checkStringStartsWith("var(--");
|
|
528
|
-
const isCSSVariableToken = (value) => {
|
|
529
|
-
const startsWithToken = startsAsVariableToken(value);
|
|
530
|
-
if (!startsWithToken)
|
|
531
|
-
return false;
|
|
532
|
-
return singleCssVariableRegex.test(value.split("/*")[0].trim());
|
|
533
|
-
};
|
|
534
|
-
const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;
|
|
535
501
|
const getValueAsType = (value, type) => {
|
|
536
502
|
return type && typeof value === "number" ? type.transform(value) : value;
|
|
537
503
|
};
|
|
@@ -652,36 +618,82 @@ const numberValueTypes = {
|
|
|
652
618
|
strokeOpacity: alpha,
|
|
653
619
|
numOctaves: int
|
|
654
620
|
};
|
|
621
|
+
const translateAlias = {
|
|
622
|
+
x: "translateX",
|
|
623
|
+
y: "translateY",
|
|
624
|
+
z: "translateZ",
|
|
625
|
+
transformPerspective: "perspective"
|
|
626
|
+
};
|
|
627
|
+
const numTransforms = transformPropOrder.length;
|
|
628
|
+
function buildTransform(latestValues, transform, transformTemplate) {
|
|
629
|
+
let transformString = "";
|
|
630
|
+
let transformIsDefault = true;
|
|
631
|
+
for (let i = 0; i < numTransforms; i++) {
|
|
632
|
+
const key = transformPropOrder[i];
|
|
633
|
+
const value = latestValues[key];
|
|
634
|
+
if (value === void 0)
|
|
635
|
+
continue;
|
|
636
|
+
let valueIsDefault = true;
|
|
637
|
+
if (typeof value === "number") {
|
|
638
|
+
valueIsDefault = value === (key.startsWith("scale") ? 1 : 0);
|
|
639
|
+
} else {
|
|
640
|
+
valueIsDefault = parseFloat(value) === 0;
|
|
641
|
+
}
|
|
642
|
+
if (!valueIsDefault || transformTemplate) {
|
|
643
|
+
const valueAsType = getValueAsType(value, numberValueTypes[key]);
|
|
644
|
+
if (!valueIsDefault) {
|
|
645
|
+
transformIsDefault = false;
|
|
646
|
+
const transformName = translateAlias[key] || key;
|
|
647
|
+
transformString += `${transformName}(${valueAsType}) `;
|
|
648
|
+
}
|
|
649
|
+
if (transformTemplate) {
|
|
650
|
+
transform[key] = valueAsType;
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
transformString = transformString.trim();
|
|
655
|
+
if (transformTemplate) {
|
|
656
|
+
transformString = transformTemplate(transform, transformIsDefault ? "" : transformString);
|
|
657
|
+
} else if (transformIsDefault) {
|
|
658
|
+
transformString = "none";
|
|
659
|
+
}
|
|
660
|
+
return transformString;
|
|
661
|
+
}
|
|
662
|
+
const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token);
|
|
663
|
+
const isCSSVariableName = checkStringStartsWith("--");
|
|
664
|
+
const startsAsVariableToken = checkStringStartsWith("var(--");
|
|
665
|
+
const isCSSVariableToken = (value) => {
|
|
666
|
+
const startsWithToken = startsAsVariableToken(value);
|
|
667
|
+
if (!startsWithToken)
|
|
668
|
+
return false;
|
|
669
|
+
return singleCssVariableRegex.test(value.split("/*")[0].trim());
|
|
670
|
+
};
|
|
671
|
+
const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;
|
|
655
672
|
function buildHTMLStyles(state, latestValues, transformTemplate) {
|
|
656
|
-
const { style, vars,
|
|
673
|
+
const { style, vars, transformOrigin } = state;
|
|
657
674
|
let hasTransform2 = false;
|
|
658
675
|
let hasTransformOrigin = false;
|
|
659
|
-
let transformIsNone = true;
|
|
660
676
|
for (const key in latestValues) {
|
|
661
677
|
const value = latestValues[key];
|
|
662
|
-
if (isCSSVariableName(key)) {
|
|
663
|
-
vars[key] = value;
|
|
664
|
-
continue;
|
|
665
|
-
}
|
|
666
|
-
const valueType = numberValueTypes[key];
|
|
667
|
-
const valueAsType = getValueAsType(value, valueType);
|
|
668
678
|
if (transformProps.has(key)) {
|
|
669
679
|
hasTransform2 = true;
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
transformIsNone = false;
|
|
675
|
-
} else if (key.startsWith("origin")) {
|
|
676
|
-
hasTransformOrigin = true;
|
|
677
|
-
transformOrigin[key] = valueAsType;
|
|
680
|
+
continue;
|
|
681
|
+
} else if (isCSSVariableName(key)) {
|
|
682
|
+
vars[key] = value;
|
|
683
|
+
continue;
|
|
678
684
|
} else {
|
|
679
|
-
|
|
685
|
+
const valueAsType = getValueAsType(value, numberValueTypes[key]);
|
|
686
|
+
if (key.startsWith("origin")) {
|
|
687
|
+
hasTransformOrigin = true;
|
|
688
|
+
transformOrigin[key] = valueAsType;
|
|
689
|
+
} else {
|
|
690
|
+
style[key] = valueAsType;
|
|
691
|
+
}
|
|
680
692
|
}
|
|
681
693
|
}
|
|
682
694
|
if (!latestValues.transform) {
|
|
683
695
|
if (hasTransform2 || transformTemplate) {
|
|
684
|
-
style.transform = buildTransform(state.transform,
|
|
696
|
+
style.transform = buildTransform(latestValues, state.transform, transformTemplate);
|
|
685
697
|
} else if (style.transform) {
|
|
686
698
|
style.transform = "none";
|
|
687
699
|
}
|
|
@@ -2358,13 +2370,9 @@ function spring({ keyframes: keyframes2, restDelta, restSpeed, ...options }) {
|
|
|
2358
2370
|
next: (t) => {
|
|
2359
2371
|
const current = resolveSpring(t);
|
|
2360
2372
|
if (!isResolvedFromDuration) {
|
|
2361
|
-
let currentVelocity =
|
|
2362
|
-
if (
|
|
2363
|
-
|
|
2364
|
-
currentVelocity = calcGeneratorVelocity(resolveSpring, t, current);
|
|
2365
|
-
} else {
|
|
2366
|
-
currentVelocity = 0;
|
|
2367
|
-
}
|
|
2373
|
+
let currentVelocity = 0;
|
|
2374
|
+
if (dampingRatio < 1) {
|
|
2375
|
+
currentVelocity = t === 0 ? secondsToMilliseconds(initialVelocity) : calcGeneratorVelocity(resolveSpring, t, current);
|
|
2368
2376
|
}
|
|
2369
2377
|
const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;
|
|
2370
2378
|
const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;
|
|
@@ -3231,6 +3239,8 @@ class AcceleratedAnimation extends BaseAnimation {
|
|
|
3231
3239
|
this.isStopped = true;
|
|
3232
3240
|
if (this.state === "idle")
|
|
3233
3241
|
return;
|
|
3242
|
+
this.resolveFinishedPromise();
|
|
3243
|
+
this.updateFinishedPromise();
|
|
3234
3244
|
const { resolved } = this;
|
|
3235
3245
|
if (!resolved)
|
|
3236
3246
|
return;
|
|
@@ -3477,7 +3487,7 @@ class MotionValue {
|
|
|
3477
3487
|
* @internal
|
|
3478
3488
|
*/
|
|
3479
3489
|
constructor(init, options = {}) {
|
|
3480
|
-
this.version = "11.3.
|
|
3490
|
+
this.version = "11.3.22";
|
|
3481
3491
|
this.canTrackVelocity = null;
|
|
3482
3492
|
this.events = {};
|
|
3483
3493
|
this.updateAndNotify = (v, render = true) => {
|
|
@@ -3895,9 +3905,7 @@ function animateVisualElement(visualElement, definition, options = {}) {
|
|
|
3895
3905
|
animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options));
|
|
3896
3906
|
}
|
|
3897
3907
|
return animation.then(() => {
|
|
3898
|
-
|
|
3899
|
-
visualElement.notify("AnimationComplete", definition);
|
|
3900
|
-
});
|
|
3908
|
+
visualElement.notify("AnimationComplete", definition);
|
|
3901
3909
|
});
|
|
3902
3910
|
}
|
|
3903
3911
|
const reversePriorityOrder = [...variantPriorityOrder].reverse();
|
|
@@ -6511,7 +6519,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
6511
6519
|
if (isMotionValue(nextValue)) {
|
|
6512
6520
|
element.addValue(key, nextValue);
|
|
6513
6521
|
if (process.env.NODE_ENV === "development") {
|
|
6514
|
-
warnOnce(nextValue.version === "11.3.
|
|
6522
|
+
warnOnce(nextValue.version === "11.3.22", `Attempting to mix Framer Motion versions ${nextValue.version} with 11.3.22 may not work as expected.`);
|
|
6515
6523
|
}
|
|
6516
6524
|
} else if (isMotionValue(prevValue)) {
|
|
6517
6525
|
element.addValue(key, motionValue(nextValue, { owner: element }));
|
|
@@ -7011,25 +7019,6 @@ const preloadedFeatures = {
|
|
|
7011
7019
|
...layout
|
|
7012
7020
|
};
|
|
7013
7021
|
const motion = /* @__PURE__ */ createMotionProxy((Component2, config) => createDomMotionConfig(Component2, config, preloadedFeatures, createDomVisualElement));
|
|
7014
|
-
function useIsMounted() {
|
|
7015
|
-
const isMounted = useRef(false);
|
|
7016
|
-
useIsomorphicLayoutEffect(() => {
|
|
7017
|
-
isMounted.current = true;
|
|
7018
|
-
return () => {
|
|
7019
|
-
isMounted.current = false;
|
|
7020
|
-
};
|
|
7021
|
-
}, []);
|
|
7022
|
-
return isMounted;
|
|
7023
|
-
}
|
|
7024
|
-
function useForceUpdate() {
|
|
7025
|
-
const isMounted = useIsMounted();
|
|
7026
|
-
const [forcedRenderCount, setForcedRenderCount] = useState(0);
|
|
7027
|
-
const forceRender = useCallback(() => {
|
|
7028
|
-
isMounted.current && setForcedRenderCount(forcedRenderCount + 1);
|
|
7029
|
-
}, [forcedRenderCount]);
|
|
7030
|
-
const deferredForceRender = useCallback(() => frame.postRender(forceRender), [forceRender]);
|
|
7031
|
-
return [deferredForceRender, forcedRenderCount];
|
|
7032
|
-
}
|
|
7033
7022
|
class PopChildMeasure extends React.Component {
|
|
7034
7023
|
getSnapshotBeforeUpdate(prevProps) {
|
|
7035
7024
|
const element = this.props.childRef.current;
|
|
@@ -7130,16 +7119,7 @@ const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, p
|
|
|
7130
7119
|
function newChildrenMap() {
|
|
7131
7120
|
return /* @__PURE__ */ new Map();
|
|
7132
7121
|
}
|
|
7133
|
-
function useUnmountEffect(callback) {
|
|
7134
|
-
return useEffect(() => () => callback(), []);
|
|
7135
|
-
}
|
|
7136
7122
|
const getChildKey = (child) => child.key || "";
|
|
7137
|
-
function updateChildLookup(children, allChildren) {
|
|
7138
|
-
children.forEach((child) => {
|
|
7139
|
-
const key = getChildKey(child);
|
|
7140
|
-
allChildren.set(key, child);
|
|
7141
|
-
});
|
|
7142
|
-
}
|
|
7143
7123
|
function onlyElements(children) {
|
|
7144
7124
|
const filtered = [];
|
|
7145
7125
|
Children.forEach(children, (child) => {
|
|
@@ -7148,83 +7128,73 @@ function onlyElements(children) {
|
|
|
7148
7128
|
});
|
|
7149
7129
|
return filtered;
|
|
7150
7130
|
}
|
|
7151
|
-
const AnimatePresence = ({ children, custom, initial = true, onExitComplete,
|
|
7131
|
+
const AnimatePresence = ({ children, exitBeforeEnter, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = "sync" }) => {
|
|
7152
7132
|
invariant(!exitBeforeEnter, "Replace exitBeforeEnter with mode='wait'");
|
|
7153
|
-
const
|
|
7154
|
-
const
|
|
7155
|
-
const filteredChildren = onlyElements(children);
|
|
7156
|
-
let childrenToRender = filteredChildren;
|
|
7157
|
-
const exitingChildren = useRef(/* @__PURE__ */ new Map()).current;
|
|
7158
|
-
const presentChildren = useRef(childrenToRender);
|
|
7159
|
-
const allChildren = useRef(/* @__PURE__ */ new Map()).current;
|
|
7133
|
+
const presentChildren = useMemo(() => onlyElements(children), [children]);
|
|
7134
|
+
const presentKeys = presentChildren.map(getChildKey);
|
|
7160
7135
|
const isInitialRender = useRef(true);
|
|
7136
|
+
const pendingPresentChildren = useRef(presentChildren);
|
|
7137
|
+
const exitComplete = useConstant(() => /* @__PURE__ */ new Map());
|
|
7138
|
+
const [diffedChildren, setDiffedChildren] = useState(presentChildren);
|
|
7139
|
+
const [renderedChildren, setRenderedChildren] = useState(presentChildren);
|
|
7161
7140
|
useIsomorphicLayoutEffect(() => {
|
|
7162
7141
|
isInitialRender.current = false;
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
exitingChildren.clear();
|
|
7170
|
-
});
|
|
7171
|
-
if (isInitialRender.current) {
|
|
7172
|
-
return jsx(Fragment$1, { children: childrenToRender.map((child) => jsx(PresenceChild, { isPresent: true, initial: initial ? void 0 : false, presenceAffectsLayout, mode, children: child }, getChildKey(child))) });
|
|
7173
|
-
}
|
|
7174
|
-
childrenToRender = [...childrenToRender];
|
|
7175
|
-
const presentKeys = presentChildren.current.map(getChildKey);
|
|
7176
|
-
const targetKeys = filteredChildren.map(getChildKey);
|
|
7177
|
-
const numPresent = presentKeys.length;
|
|
7178
|
-
for (let i = 0; i < numPresent; i++) {
|
|
7179
|
-
const key = presentKeys[i];
|
|
7180
|
-
if (targetKeys.indexOf(key) === -1 && !exitingChildren.has(key)) {
|
|
7181
|
-
exitingChildren.set(key, void 0);
|
|
7182
|
-
}
|
|
7183
|
-
}
|
|
7184
|
-
if (mode === "wait" && exitingChildren.size) {
|
|
7185
|
-
childrenToRender = [];
|
|
7186
|
-
}
|
|
7187
|
-
exitingChildren.forEach((component, key) => {
|
|
7188
|
-
if (targetKeys.indexOf(key) !== -1)
|
|
7189
|
-
return;
|
|
7190
|
-
const child = allChildren.get(key);
|
|
7191
|
-
if (!child)
|
|
7192
|
-
return;
|
|
7193
|
-
const insertionIndex = presentKeys.indexOf(key);
|
|
7194
|
-
let exitingComponent = component;
|
|
7195
|
-
if (!exitingComponent) {
|
|
7196
|
-
const onExit = () => {
|
|
7197
|
-
exitingChildren.delete(key);
|
|
7198
|
-
const leftOverKeys = Array.from(allChildren.keys()).filter((childKey) => !targetKeys.includes(childKey));
|
|
7199
|
-
leftOverKeys.forEach((leftOverKey) => allChildren.delete(leftOverKey));
|
|
7200
|
-
presentChildren.current = filteredChildren.filter((presentChild) => {
|
|
7201
|
-
const presentChildKey = getChildKey(presentChild);
|
|
7202
|
-
return (
|
|
7203
|
-
// filter out the node exiting
|
|
7204
|
-
presentChildKey === key || // filter out the leftover children
|
|
7205
|
-
leftOverKeys.includes(presentChildKey)
|
|
7206
|
-
);
|
|
7207
|
-
});
|
|
7208
|
-
if (!exitingChildren.size) {
|
|
7209
|
-
if (isMounted.current === false)
|
|
7210
|
-
return;
|
|
7211
|
-
forceRender();
|
|
7212
|
-
onExitComplete && onExitComplete();
|
|
7142
|
+
pendingPresentChildren.current = presentChildren;
|
|
7143
|
+
for (let i = 0; i < renderedChildren.length; i++) {
|
|
7144
|
+
const key = getChildKey(renderedChildren[i]);
|
|
7145
|
+
if (!presentKeys.includes(key)) {
|
|
7146
|
+
if (exitComplete.get(key) !== true) {
|
|
7147
|
+
exitComplete.set(key, false);
|
|
7213
7148
|
}
|
|
7214
|
-
}
|
|
7215
|
-
|
|
7216
|
-
|
|
7149
|
+
} else {
|
|
7150
|
+
exitComplete.delete(key);
|
|
7151
|
+
}
|
|
7217
7152
|
}
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7153
|
+
}, [renderedChildren, presentKeys.length, presentKeys.join("-")]);
|
|
7154
|
+
const exitingChildren = [];
|
|
7155
|
+
if (presentChildren !== diffedChildren) {
|
|
7156
|
+
let nextChildren = [...presentChildren];
|
|
7157
|
+
for (let i = 0; i < renderedChildren.length; i++) {
|
|
7158
|
+
const child = renderedChildren[i];
|
|
7159
|
+
const key = getChildKey(child);
|
|
7160
|
+
if (!presentKeys.includes(key)) {
|
|
7161
|
+
nextChildren.splice(i, 0, child);
|
|
7162
|
+
exitingChildren.push(child);
|
|
7163
|
+
}
|
|
7164
|
+
}
|
|
7165
|
+
if (mode === "wait" && exitingChildren.length) {
|
|
7166
|
+
nextChildren = exitingChildren;
|
|
7167
|
+
}
|
|
7168
|
+
setRenderedChildren(onlyElements(nextChildren));
|
|
7169
|
+
setDiffedChildren(presentChildren);
|
|
7170
|
+
return;
|
|
7171
|
+
}
|
|
7172
|
+
if (process.env.NODE_ENV !== "production" && mode === "wait" && renderedChildren.length > 1) {
|
|
7225
7173
|
console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
|
|
7226
7174
|
}
|
|
7227
|
-
|
|
7175
|
+
const { forceRender } = useContext(LayoutGroupContext);
|
|
7176
|
+
return jsx(Fragment$1, { children: renderedChildren.map((child) => {
|
|
7177
|
+
const key = getChildKey(child);
|
|
7178
|
+
const isPresent = presentChildren === renderedChildren || presentKeys.includes(key);
|
|
7179
|
+
const onExit = () => {
|
|
7180
|
+
if (exitComplete.has(key)) {
|
|
7181
|
+
exitComplete.set(key, true);
|
|
7182
|
+
} else {
|
|
7183
|
+
return;
|
|
7184
|
+
}
|
|
7185
|
+
let isEveryExitComplete = true;
|
|
7186
|
+
exitComplete.forEach((isExitComplete) => {
|
|
7187
|
+
if (!isExitComplete)
|
|
7188
|
+
isEveryExitComplete = false;
|
|
7189
|
+
});
|
|
7190
|
+
if (isEveryExitComplete) {
|
|
7191
|
+
forceRender === null || forceRender === void 0 ? void 0 : forceRender();
|
|
7192
|
+
setRenderedChildren(pendingPresentChildren.current);
|
|
7193
|
+
onExitComplete && onExitComplete();
|
|
7194
|
+
}
|
|
7195
|
+
};
|
|
7196
|
+
return jsx(PresenceChild, { isPresent, initial: !isInitialRender.current || initial ? void 0 : false, custom: isPresent ? void 0 : custom, presenceAffectsLayout, mode, onExitComplete: isPresent ? void 0 : onExit, children: child }, key);
|
|
7197
|
+
}) });
|
|
7228
7198
|
};
|
|
7229
7199
|
/**
|
|
7230
7200
|
* Component that allows animating the visibility of its children.
|
|
@@ -93,7 +93,7 @@ const $13c3c67164f4d5be$export$4c260019440d418f = /* @__PURE__ */ forwardRef($13
|
|
|
93
93
|
* @param {ButtonType} [props.type='default'] - The type of the button.
|
|
94
94
|
* @param {boolean} [props.disabled] - If `true`, the button is disabled.
|
|
95
95
|
* @param {string} [props.className] - Classes to pass to the button.
|
|
96
|
-
* @param {string} [props.tooltip] - Tooltip text to display on hover.
|
|
96
|
+
* @param {string|boolean} [props.tooltip] - Tooltip text to display on hover. If set to `true` and an `aria-label` is not provided, the tooltip text will be used as the `aria-label`.
|
|
97
97
|
* @param {Function} [props.onPress] - Function to run when the button is pressed.
|
|
98
98
|
* @param {React.Ref} [props.forwardedRef] - Ref to forward to the button. Use the same as the `ref` prop.
|
|
99
99
|
* @param {string} [props.wrapperClassName] - Classes to pass to the tooltip wrapper.
|
|
@@ -121,7 +121,7 @@ const Button = (props) => {
|
|
|
121
121
|
type = "default",
|
|
122
122
|
disabled,
|
|
123
123
|
className,
|
|
124
|
-
tooltip,
|
|
124
|
+
tooltip: rawTooltip,
|
|
125
125
|
onPress,
|
|
126
126
|
forwardedRef,
|
|
127
127
|
wrapperClassName,
|
|
@@ -130,6 +130,10 @@ const Button = (props) => {
|
|
|
130
130
|
hidden,
|
|
131
131
|
...other
|
|
132
132
|
} = props;
|
|
133
|
+
let tooltip = rawTooltip;
|
|
134
|
+
if (rawTooltip === true && (ariaLabel == null ? void 0 : ariaLabel.length) > 0) {
|
|
135
|
+
tooltip = ariaLabel;
|
|
136
|
+
}
|
|
133
137
|
const objRef = $df56164dff5785e2$export$4338b53315abf666(forwardedRef);
|
|
134
138
|
if (hidden) {
|
|
135
139
|
return null;
|
|
@@ -143,6 +143,7 @@ const $bcdf0525bf22703d$export$2c73285ae9390cec = /* @__PURE__ */ forwardRef($bc
|
|
|
143
143
|
* @param {boolean} [props.disabled] - If `true`, the input is disabled.
|
|
144
144
|
* @param {boolean} [props.readOnly] - If `true`, the input is read-only.
|
|
145
145
|
* @param {string} [props.className] - Classes to pass to the input field.
|
|
146
|
+
* @param {string} [props.wrapperClassName] - Classes to pass to the input field wrapping element.
|
|
146
147
|
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
147
148
|
*
|
|
148
149
|
* @returns {JSX.Element} The InputField component.
|
|
@@ -159,7 +160,7 @@ const $bcdf0525bf22703d$export$2c73285ae9390cec = /* @__PURE__ */ forwardRef($bc
|
|
|
159
160
|
* @preserve
|
|
160
161
|
*/
|
|
161
162
|
const InputField = (props) => {
|
|
162
|
-
const { icon, label, subtitle, help, actions, value, onChange, type = "text", disabled, readOnly, className, hidden, ...other } = props;
|
|
163
|
+
const { icon, label, subtitle, help, actions, value, onChange, type = "text", disabled, readOnly, className, wrapperClassName, hidden, ...other } = props;
|
|
163
164
|
if (hidden) {
|
|
164
165
|
return null;
|
|
165
166
|
}
|
|
@@ -170,6 +171,7 @@ const InputField = (props) => {
|
|
|
170
171
|
onChange,
|
|
171
172
|
isDisabled: disabled,
|
|
172
173
|
isReadOnly: readOnly,
|
|
174
|
+
className: wrapperClassName,
|
|
173
175
|
...other,
|
|
174
176
|
children: /* @__PURE__ */ jsxs(
|
|
175
177
|
BaseControl,
|
|
@@ -1854,8 +1854,8 @@ const LinkInput = (props) => {
|
|
|
1854
1854
|
"aria-label": __("URL suggestions", "eightshift-ui-components"),
|
|
1855
1855
|
className: ({ isEntering, isExiting }) => clsx(
|
|
1856
1856
|
"es-uic-rounded-md es-uic-border es-uic-border-gray-200 es-uic-bg-white es-uic-shadow-lg es-uic-outline-none",
|
|
1857
|
-
isEntering && "es-uic-
|
|
1858
|
-
isExiting && "es-uic-
|
|
1857
|
+
isEntering && "es-uic-animate-in es-uic-fade-in-0 es-uic-slide-in-from-top-3 es-uic-fill-mode-forwards",
|
|
1858
|
+
isExiting && "es-uic-animate-out es-uic-fade-out-0 es-uic-slide-out-to-top-2 es-uic-fill-mode-forwards",
|
|
1859
1859
|
!shouldShowSuggestions && suggestionList.items.length < 1 && "es-uic-invisible"
|
|
1860
1860
|
),
|
|
1861
1861
|
style: {
|
|
@@ -1086,8 +1086,7 @@ const Menu = (props) => {
|
|
|
1086
1086
|
children: /* @__PURE__ */ jsx(
|
|
1087
1087
|
$3674c52c6b3c5bce$export$d9b273488cd8ce6f,
|
|
1088
1088
|
{
|
|
1089
|
-
"
|
|
1090
|
-
className: "focus:es-uic-outline-none",
|
|
1089
|
+
className: "es-uic-outline-none",
|
|
1091
1090
|
...props,
|
|
1092
1091
|
...additionalProps,
|
|
1093
1092
|
children
|
|
@@ -31,7 +31,7 @@ import { _ as __ } from "../../default-i18n-BqWys-1G.js";
|
|
|
31
31
|
* @param {Object} [props.itemProps] - Props to pass to each item.
|
|
32
32
|
* @param {boolean} [props.noTriggerLabel] - Whether the trigger label should be hidden. Applies only to the `menu` type.
|
|
33
33
|
* @param {boolean} [props.noTriggerIcon] - Whether the trigger icon should be hidden. Applies only to the `menu` type.
|
|
34
|
-
* @param {string} [props.tooltip] - If provided, overrides the default tooltip text. If there is no label, the value will still be shown within the tooltip. Applies only to the `menu` type.
|
|
34
|
+
* @param {string|boolean} [props.tooltip] - If provided, overrides the default tooltip text. If there is no label, the value will still be shown within the tooltip. Applies only to the `menu` type. If `true` is set and an `aria-label` is provided, the tooltip will show the same text as the `aria-label`.
|
|
35
35
|
* @param {boolean} [props.noItemLabel] - Whether the option label should be hidden.
|
|
36
36
|
* @param {boolean} [props.noItemIcon] - Whether the option icon should be hidden.
|
|
37
37
|
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
@@ -75,16 +75,21 @@ const OptionSelect = (props) => {
|
|
|
75
75
|
itemProps,
|
|
76
76
|
noTriggerLabel,
|
|
77
77
|
noTriggerIcon,
|
|
78
|
-
tooltip,
|
|
78
|
+
tooltip: rawTooltip,
|
|
79
79
|
noItemLabel,
|
|
80
80
|
noItemIcon,
|
|
81
81
|
children,
|
|
82
82
|
hidden,
|
|
83
|
+
"aria-label": ariaLabel,
|
|
83
84
|
...rest
|
|
84
85
|
} = props;
|
|
85
86
|
if (hidden) {
|
|
86
87
|
return null;
|
|
87
88
|
}
|
|
89
|
+
let tooltip = rawTooltip;
|
|
90
|
+
if (rawTooltip === true && (ariaLabel == null ? void 0 : ariaLabel.length) > 0) {
|
|
91
|
+
tooltip = ariaLabel;
|
|
92
|
+
}
|
|
88
93
|
const currentItem = options == null ? void 0 : options.find(({ value: optionValue }) => optionValue === value);
|
|
89
94
|
const notSetLabel = /* @__PURE__ */ jsx("span", { className: "es-uic-leading-3 es-uic-opacity-50", children: __("Not set", "eightshift-ui-components") });
|
|
90
95
|
return /* @__PURE__ */ jsxs(
|
|
@@ -103,7 +108,7 @@ const OptionSelect = (props) => {
|
|
|
103
108
|
ButtonGroup,
|
|
104
109
|
{
|
|
105
110
|
vertical,
|
|
106
|
-
"aria-label": typeof label !== "undefined" ? null :
|
|
111
|
+
"aria-label": typeof label !== "undefined" ? null : ariaLabel,
|
|
107
112
|
...wrapperProps,
|
|
108
113
|
children: options.map(
|
|
109
114
|
({
|
|
@@ -151,7 +156,7 @@ const OptionSelect = (props) => {
|
|
|
151
156
|
orientation: vertical ? "vertical" : "horizontal",
|
|
152
157
|
onChange: (v) => onChange(v),
|
|
153
158
|
design: type === "radios" ? "default" : "segmented",
|
|
154
|
-
"aria-label": typeof label !== "undefined" ? null :
|
|
159
|
+
"aria-label": typeof label !== "undefined" ? null : ariaLabel,
|
|
155
160
|
value,
|
|
156
161
|
...wrapperProps,
|
|
157
162
|
children: options.map(({ label: optionLabel, value: optionValue, icon: optionIcon, ariaLabel: optionAriaLabel, subtitle: optionSubtitle, disabled: optionDisabled }) => {
|
|
@@ -176,7 +181,7 @@ const OptionSelect = (props) => {
|
|
|
176
181
|
type === "menu" && /* @__PURE__ */ jsxs(
|
|
177
182
|
Menu,
|
|
178
183
|
{
|
|
179
|
-
triggerLabel:
|
|
184
|
+
triggerLabel: noTriggerLabel ? null : (currentItem == null ? void 0 : currentItem.label) ?? notSetLabel,
|
|
180
185
|
triggerIcon: !noTriggerIcon && // eslint-disable-next-line no-nested-ternary
|
|
181
186
|
(currentItem ? typeof (currentItem == null ? void 0 : currentItem.icon) === "string" ? (_a = icons) == null ? void 0 : _a[currentItem == null ? void 0 : currentItem.icon] : currentItem == null ? void 0 : currentItem.icon : (noTriggerLabel || noTriggerIcon) && notSetLabel),
|
|
182
187
|
tooltip: noTriggerLabel ? /* @__PURE__ */ jsx(
|
|
@@ -189,9 +194,10 @@ const OptionSelect = (props) => {
|
|
|
189
194
|
) : tooltip,
|
|
190
195
|
triggerProps: {
|
|
191
196
|
...wrapperProps == null ? void 0 : wrapperProps.triggerProps,
|
|
192
|
-
"aria-label": typeof label !== "undefined" ? null :
|
|
197
|
+
"aria-label": typeof label !== "undefined" ? null : ariaLabel ?? label ?? tooltip
|
|
193
198
|
},
|
|
194
199
|
keepOpen: true,
|
|
200
|
+
"aria-label": ariaLabel ?? label ?? tooltip ?? __("Menu", "eightshift-ui-components"),
|
|
195
201
|
...wrapperProps,
|
|
196
202
|
children: [
|
|
197
203
|
options.map(
|
|
@@ -77,9 +77,14 @@ const Popover = (props) => {
|
|
|
77
77
|
containerPadding,
|
|
78
78
|
shouldFlip,
|
|
79
79
|
shouldCloseOnInteractOutside = () => true,
|
|
80
|
+
"aria-label": rawAriaLabel,
|
|
80
81
|
hidden,
|
|
81
82
|
...other
|
|
82
83
|
} = props;
|
|
84
|
+
let ariaLabel = rawAriaLabel;
|
|
85
|
+
if (ariaLabel === false) {
|
|
86
|
+
ariaLabel = void 0;
|
|
87
|
+
}
|
|
83
88
|
if (hidden) {
|
|
84
89
|
return null;
|
|
85
90
|
}
|
|
@@ -98,8 +103,8 @@ const Popover = (props) => {
|
|
|
98
103
|
containerPadding,
|
|
99
104
|
className: ({ isEntering, isExiting }) => clsx(
|
|
100
105
|
"es-uic-rounded-md es-uic-border es-uic-border-gray-200 es-uic-bg-white es-uic-shadow-lg es-uic-outline-none",
|
|
101
|
-
isEntering && "es-uic-
|
|
102
|
-
isExiting && "es-uic-
|
|
106
|
+
isEntering && "es-uic-animate-in es-uic-fade-in-0 es-uic-slide-in-from-top-3 es-uic-fill-mode-forwards",
|
|
107
|
+
isExiting && "es-uic-animate-out es-uic-fade-out-0 es-uic-slide-out-to-top-2 es-uic-fill-mode-forwards",
|
|
103
108
|
wrapperClassName
|
|
104
109
|
),
|
|
105
110
|
style,
|
|
@@ -107,6 +112,7 @@ const Popover = (props) => {
|
|
|
107
112
|
$de32f1b87079253c$export$3ddf2d174ce01153,
|
|
108
113
|
{
|
|
109
114
|
className: clsx("es-uic-p-1 es-uic-text-sm es-uic-outline-none", className),
|
|
115
|
+
"aria-label": ariaLabel,
|
|
110
116
|
...other,
|
|
111
117
|
children
|
|
112
118
|
}
|
|
@@ -5117,8 +5117,7 @@ const Repeater = (props) => {
|
|
|
5117
5117
|
{
|
|
5118
5118
|
onPress: () => {
|
|
5119
5119
|
const newItem = { id: `${itemIdBase}${items.length + 1}`, ...addDefaultItem };
|
|
5120
|
-
|
|
5121
|
-
onChange(items);
|
|
5120
|
+
onChange([...items, newItem]);
|
|
5122
5121
|
if (onAfterItemAdd) {
|
|
5123
5122
|
onAfterItemAdd(newItem);
|
|
5124
5123
|
}
|
|
@@ -5133,8 +5132,7 @@ const Repeater = (props) => {
|
|
|
5133
5132
|
addButton && /* @__PURE__ */ jsx("div", { className: clsx(!hideEmptyState && items.length < 1 && "es-uic-invisible"), children: addButton({
|
|
5134
5133
|
addItem: (additional = {}) => {
|
|
5135
5134
|
const newItem = { id: `${itemIdBase}${items.length + 1}`, ...addDefaultItem, ...additional };
|
|
5136
|
-
|
|
5137
|
-
onChange(items);
|
|
5135
|
+
onChange([...items, newItem]);
|
|
5138
5136
|
if (onAfterItemAdd) {
|
|
5139
5137
|
onAfterItemAdd(newItem);
|
|
5140
5138
|
}
|
|
@@ -5251,8 +5249,7 @@ const Repeater = (props) => {
|
|
|
5251
5249
|
{
|
|
5252
5250
|
onPress: () => {
|
|
5253
5251
|
const newItem = { id: `${itemIdBase}${items.length + 1}`, ...addDefaultItem };
|
|
5254
|
-
|
|
5255
|
-
onChange(items);
|
|
5252
|
+
onChange([...items, newItem]);
|
|
5256
5253
|
if (onAfterItemAdd) {
|
|
5257
5254
|
onAfterItemAdd(newItem);
|
|
5258
5255
|
}
|
|
@@ -5267,8 +5264,7 @@ const Repeater = (props) => {
|
|
|
5267
5264
|
addButton && !hideEmptyState && addButton({
|
|
5268
5265
|
addItem: (additional = {}) => {
|
|
5269
5266
|
const newItem = { id: `${itemIdBase}${items.length + 1}`, ...addDefaultItem, ...additional };
|
|
5270
|
-
|
|
5271
|
-
onChange(items);
|
|
5267
|
+
onChange([...items, newItem]);
|
|
5272
5268
|
if (onAfterItemAdd) {
|
|
5273
5269
|
onAfterItemAdd(newItem);
|
|
5274
5270
|
}
|