@eightshift/ui-components 5.6.0 → 6.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-BhEIfWLY.js → Button-BXjXzdW_.js} +13 -13
- package/dist/{Dialog-B8p4Ymh7.js → Dialog-D8bjn-nh.js} +404 -77
- package/dist/{FieldError-B8BgFmIQ.js → FieldError-DwBG6m1U.js} +2 -2
- package/dist/{FocusScope-B5vxRkHm.js → FocusScope-BMk5oZCk.js} +8 -8
- package/dist/{Heading-B5aEynOM.js → Heading-BmRX4BRL.js} +3 -3
- package/dist/{Hidden-rE6uR-lr.js → Hidden-Rfj-STx7.js} +4 -4
- package/dist/{Input-8yja_IHC.js → Input-CNNksOWg.js} +11 -11
- package/dist/{Label-DWVaNd2E.js → Label-D8a3eYb-.js} +4 -4
- package/dist/{List-Bll1lQEW.js → List-BGHOoFf0.js} +8 -8
- package/dist/{ListBox-CEpKw7yC.js → ListBox-Dd37zMvs.js} +40 -41
- package/dist/{OverlayArrow-DDfa8khI.js → OverlayArrow-DokC40S3.js} +6 -6
- package/dist/{PortalProvider---wyKpMr.js → PortalProvider-CHPnqDSH.js} +2 -2
- package/dist/RadioGroup-BVFvITWO.js +371 -0
- package/dist/{SearchField-D6mPli0i.js → SearchField-CHYnN-jt.js} +16 -16
- package/dist/{SelectionManager-D77bfEbg.js → SelectionManager-N8X7T_4D.js} +44 -46
- package/dist/{SharedElementTransition-BjRNHsjx.js → SharedElementTransition-BDT84GtD.js} +3 -3
- package/dist/{Slider-DfU6bRtH.js → Slider-CL5CM9S8.js} +23 -23
- package/dist/{Text-AxKZjtFm.js → Text-ztX6G1zR.js} +3 -3
- package/dist/{VisuallyHidden-CgnIuZJ2.js → VisuallyHidden-DTUuKFiI.js} +4 -4
- package/dist/assets/style-admin.css +12156 -2
- package/dist/assets/style-editor.css +12156 -2
- package/dist/assets/style.css +12162 -2
- package/dist/assets/wp-overrides/allow-full-width-blocks.css +6 -0
- package/dist/assets/wp-overrides/fix-label-text-case.css +29 -0
- package/dist/assets/wp-overrides/increase-sidebar-width.css +4 -0
- package/dist/assets/wp-overrides/make-block-messages-nicer.css +155 -0
- package/dist/assets/wp-overrides/replace-fonts.css +8 -0
- package/dist/assets/wp-overrides/restyle-tooltips.css +194 -0
- package/dist/assets/wp-overrides/round-corners.css +200 -0
- package/dist/assets/wp-overrides/unify-button-sizes.css +5 -0
- package/dist/clsx-DgYk2OaC.js +16 -0
- package/dist/{Color-WxFE7lQB.js → color-swatch-CFIuSPcO.js} +124 -6
- package/dist/components/animated-visibility/animated-visibility.js +25 -17
- package/dist/components/base-control/base-control.js +8 -5
- package/dist/components/base-control/container.js +204 -0
- package/dist/components/breakpoint-preview/breakpoint-preview.js +0 -1
- package/dist/components/button/button.js +249 -155
- package/dist/components/checkbox/checkbox.js +96 -37
- package/dist/components/color-pickers/color-picker.js +16 -7
- package/dist/components/color-pickers/color-swatch.js +5 -57
- package/dist/components/color-pickers/gradient-editor.js +161 -138
- package/dist/components/color-pickers/solid-color-picker.js +308 -206
- package/dist/components/component-toggle/component-toggle.js +12 -8
- package/dist/components/container-panel/container-panel.js +54 -31
- package/dist/components/draggable/draggable-handle.js +8 -7
- package/dist/components/draggable/draggable.js +2 -2
- package/dist/components/draggable-list/draggable-list-item.js +21 -12
- package/dist/components/draggable-list/draggable-list.js +19 -21
- package/dist/components/expandable/expandable.js +56 -28
- package/dist/components/index.js +7 -21
- package/dist/components/input-field/input-field.js +112 -35
- package/dist/components/item-collection/item-collection.js +1 -1
- package/dist/components/link-input/link-input.js +181 -121
- package/dist/components/matrix-align/matrix-align.js +54 -21
- package/dist/components/menu/menu.js +26 -34
- package/dist/components/modal/modal.js +31 -28
- package/dist/components/notice/notice.js +45 -28
- package/dist/components/number-picker/number-picker.js +151 -101
- package/dist/components/option-select/option-select.js +40 -4
- package/dist/components/options-panel/options-panel.js +52 -25
- package/dist/components/placeholders/file-picker-shell.js +10 -10
- package/dist/components/placeholders/file-placeholder.js +14 -6
- package/dist/components/placeholders/image-placeholder.js +14 -4
- package/dist/components/placeholders/media-placeholder.js +11 -4
- package/dist/components/popover/popover.js +14 -11
- package/dist/components/portal-provider/portal-provider.js +1 -1
- package/dist/components/radio/radio.js +118 -429
- package/dist/components/repeater/repeater-item.js +7 -10
- package/dist/components/repeater/repeater.js +9 -15
- package/dist/components/responsive/mini-responsive.js +53 -62
- package/dist/components/responsive/responsive-legacy.js +1 -2
- package/dist/components/responsive/responsive.js +27 -28
- package/dist/components/responsive-preview/responsive-preview.js +1 -2
- package/dist/components/rich-label/rich-label.js +5 -5
- package/dist/components/select/async-multi-select.js +467 -100
- package/dist/components/select/{v2/async-select.js → async-select.js} +182 -106
- package/dist/components/select/multi-select.js +437 -83
- package/dist/components/select/shared.js +14 -42
- package/dist/components/select/single-select.js +349 -54
- package/dist/components/slider/column-config-slider.js +138 -45
- package/dist/components/slider/slider.js +265 -205
- package/dist/components/slider/utils.js +32 -1
- package/dist/components/smart-image/smart-image.js +27 -6
- package/dist/components/smart-image/worker-inline.js +1 -1
- package/dist/components/spacer/spacer.js +2 -2
- package/dist/components/tabs/tabs.js +370 -101
- package/dist/components/toggle/switch.js +174 -39
- package/dist/components/toggle/toggle.js +6 -3
- package/dist/components/toggle-button/toggle-button.js +140 -56
- package/dist/components/tooltip/tooltip.js +27 -26
- package/dist/{context-DMOmz986.js → context-BQvmiUqb.js} +3 -3
- package/dist/{default-i18n-DBm-GqWM.js → default-i18n-CnQeC5Pl.js} +10 -10
- package/dist/{general-6STKQIrk.js → general-B6pOveVp.js} +13 -12
- package/dist/icons/icons.js +28 -9
- package/dist/icons/jsx-svg.js +1 -1
- package/dist/icons/spinner.js +3 -1
- package/dist/{index-Dq3gT5pW.js → index-BHpUy2Ix.js} +1 -1
- package/dist/{index-DjyEH0Gg.js → index-oFgxU4zs.js} +6 -4
- package/dist/index.js +6 -20
- package/dist/proxy-0B6wWuDe.js +7409 -0
- package/dist/{react-jsx-parser.min-VUl-CuCv.js → react-jsx-parser.min-B_hvYYa1.js} +5 -5
- package/dist/{Select-CHzjZxXy.js → shared-DwjRce5e.js} +170 -36
- package/dist/{textSelection-DbCKqaw8.js → textSelection-CwHUtNVX.js} +1 -1
- package/dist/{useButton-B2EaQJT_.js → useButton-DdZrS1Kz.js} +3 -3
- package/dist/{useEvent-BifIGnVS.js → useEvent-BD7Olibq.js} +1 -1
- package/dist/{useFilter-BPcJ-Jzv.js → useFilter-bhxeEDg8.js} +1 -1
- package/dist/{useFocusRing-Cgm0R4Cf.js → useFocusRing-D3b7Kh4P.js} +1 -1
- package/dist/{useFormReset-yV9VVy9R.js → useFormReset-WUv2PdFO.js} +1 -1
- package/dist/{useFormValidation-CeNsUGWK.js → useFormValidation-DQeXkyLm.js} +2 -2
- package/dist/{useHover-BRDW3y7-.js → useHover-Bycb7BsD.js} +7 -7
- package/dist/{useLabel-C8umX0gk.js → useLabel-Bnv4-T24.js} +2 -2
- package/dist/{useLabels-Cdxi6JSa.js → useLabels-B49ptFDX.js} +1 -1
- package/dist/{useListState-DZycqxCn.js → useListState-ZKhRO8ML.js} +1 -1
- package/dist/{useLocalizedStringFormatter-eaZiN2tE.js → useLocalizedStringFormatter-NETP-8H8.js} +1 -1
- package/dist/{useNumberField-CEA9Q4w_.js → useNumberField-D2fUHql3.js} +10 -10
- package/dist/{useNumberFormatter-BCmkV-7c.js → useNumberFormatter-DGvuRCn7.js} +1 -1
- package/dist/{usePress-BCEPS3hl.js → usePress-B8OteQMu.js} +6 -6
- package/dist/{useSingleSelectListState-BFZEfeqI.js → useSingleSelectListState-BBTu4shO.js} +2 -2
- package/dist/{useToggle-DNoP2bvV.js → useToggle-BZhaYwZl.js} +4 -4
- package/dist/{useToggleState-CzN79ary.js → useToggleState-VkXJjsru.js} +1 -1
- package/dist/utilities/general.js +2 -2
- package/dist/utilities/hash.js +30 -0
- package/dist/utilities/index.js +4 -6
- package/dist/{utils-cvK1vxO7.js → utils-DGpXyJOJ.js} +29 -42
- package/dist/workers/image-analysis.worker.js +3 -3
- package/package.json +26 -23
- package/dist/ColorSwatch-xVS3rMYS.js +0 -66
- package/dist/Select-ef7c0426.esm-BJmjGGzK.js +0 -2474
- package/dist/Separator-DcqCdD4k.js +0 -344
- package/dist/_commonjsHelpers-BhWcALO8.js +0 -38
- package/dist/assets/wp-font-enhancements.css +0 -2
- package/dist/assets/wp-ui-enhancements.css +0 -2
- package/dist/components/select/async-single-select.js +0 -138
- 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/react-select-component-wrappers.js +0 -90
- package/dist/components/select/styles.js +0 -49
- package/dist/components/select/v2/async-multi-select.js +0 -433
- package/dist/components/select/v2/multi-select.js +0 -404
- package/dist/components/select/v2/shared.js +0 -69
- package/dist/components/select/v2/single-select.js +0 -358
- package/dist/index-641ee5b8.esm-DiwvO-RP.js +0 -3139
- package/dist/modifiers.esm-BuJQPI1X.js +0 -31
- package/dist/multi-select-components-B3KuDyYd.js +0 -3744
- package/dist/react-select-async.esm-_4pk-41v.js +0 -107
- package/dist/react-select.esm-BeuAkAyY.js +0 -15
- package/dist/sha256-C56UDWfQ.js +0 -533
- package/dist/useDragAndDrop-DUXKDS0N.js +0 -3925
- package/dist/wp/wp-font-enhancements.js +0 -1
- package/dist/wp/wp-ui-enhancements.js +0 -1
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { b as $bdb11010cef70236$export$f680877a34711e37, $ as $64fa3d84918910a7$export$29f1550f4b0d4415, g as $64fa3d84918910a7$export$4d86445c2cf5e3, a as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-DGpXyJOJ.js";
|
|
3
|
+
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-D2C6R0DK.js";
|
|
4
|
+
import $dbSRa$react__default, { useMemo, forwardRef, createContext } from "react";
|
|
1
5
|
import { $ as $9446cca9a3875146$export$7d15b64cf5a3a4c4, b as $9446cca9a3875146$export$b6268554fba451f } from "./number-7sOvrqo0.js";
|
|
2
|
-
import { a as $5b160d28a433310d$export$c17fa47878dc55b6, b as $6db58dc88e78b024$export$2f817fcdc4b89ae0 } from "./useLocalizedStringFormatter-
|
|
6
|
+
import { a as $5b160d28a433310d$export$c17fa47878dc55b6, b as $6db58dc88e78b024$export$2f817fcdc4b89ae0, $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "./useLocalizedStringFormatter-NETP-8H8.js";
|
|
3
7
|
import { $ as $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5 } from "./NumberFormatter-DA8u1Ot7.js";
|
|
8
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-BQvmiUqb.js";
|
|
9
|
+
import { c as clsx } from "./lite-DVmmD_-j.js";
|
|
10
|
+
import { _ as __ } from "./default-i18n-CnQeC5Pl.js";
|
|
4
11
|
var $eccab2b0118aef08$exports = {};
|
|
5
12
|
$eccab2b0118aef08$exports = {
|
|
6
13
|
"colorInputLabel": (args) => `${args.label}, ${args.channelLabel}`,
|
|
@@ -1741,10 +1748,10 @@ $f98dad178a72c00d$exports = {
|
|
|
1741
1748
|
"zh-CN": $a9cedf75b94e4916$exports,
|
|
1742
1749
|
"zh-TW": $37cff576474bc8d4$exports
|
|
1743
1750
|
};
|
|
1744
|
-
function $parcel$interopDefault(a) {
|
|
1751
|
+
function $parcel$interopDefault$1(a) {
|
|
1745
1752
|
return a && a.__esModule ? a.default : a;
|
|
1746
1753
|
}
|
|
1747
|
-
let $799cddbef784668f$var$dictionary = new $5b160d28a433310d$export$c17fa47878dc55b6($parcel$interopDefault($f98dad178a72c00d$exports));
|
|
1754
|
+
let $799cddbef784668f$var$dictionary = new $5b160d28a433310d$export$c17fa47878dc55b6($parcel$interopDefault$1($f98dad178a72c00d$exports));
|
|
1748
1755
|
function $799cddbef784668f$export$6e865ea70d7724f(value) {
|
|
1749
1756
|
let res = $799cddbef784668f$var$RGBColor.parse(value) || $799cddbef784668f$var$HSBColor.parse(value) || $799cddbef784668f$var$HSLColor.parse(value);
|
|
1750
1757
|
if (res) return res;
|
|
@@ -2445,8 +2452,119 @@ function $799cddbef784668f$var$multiplyMatrix(m, x, y, z) {
|
|
|
2445
2452
|
c
|
|
2446
2453
|
];
|
|
2447
2454
|
}
|
|
2455
|
+
function $parcel$interopDefault(a) {
|
|
2456
|
+
return a && a.__esModule ? a.default : a;
|
|
2457
|
+
}
|
|
2458
|
+
function $2993fcad7650b98d$export$9060ae606178d849(props) {
|
|
2459
|
+
let { color: value, colorName } = props;
|
|
2460
|
+
let nonNullValue = value || "#fff0";
|
|
2461
|
+
let color = useMemo(() => typeof nonNullValue === "string" ? $799cddbef784668f$export$6e865ea70d7724f(nonNullValue) : nonNullValue, [
|
|
2462
|
+
nonNullValue
|
|
2463
|
+
]);
|
|
2464
|
+
let { locale } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
|
|
2465
|
+
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
2466
|
+
labelable: true
|
|
2467
|
+
});
|
|
2468
|
+
let stringFormatter = $fca6afa0e843324b$export$f12b703ca79dfbb1($parcel$interopDefault($3493a52097159720$exports), "@react-aria/color");
|
|
2469
|
+
let id = $bdb11010cef70236$export$f680877a34711e37(props.id);
|
|
2470
|
+
if (!colorName) colorName = color.getChannelValue("alpha") === 0 ? stringFormatter.format("transparent") : color.getColorName(locale);
|
|
2471
|
+
return {
|
|
2472
|
+
colorSwatchProps: {
|
|
2473
|
+
...DOMProps,
|
|
2474
|
+
role: "img",
|
|
2475
|
+
"aria-roledescription": stringFormatter.format("colorSwatch"),
|
|
2476
|
+
"aria-label": [
|
|
2477
|
+
colorName,
|
|
2478
|
+
props["aria-label"] || ""
|
|
2479
|
+
].filter(Boolean).join(", "),
|
|
2480
|
+
"aria-labelledby": props["aria-labelledby"] ? `${id} ${props["aria-labelledby"]}` : void 0,
|
|
2481
|
+
id,
|
|
2482
|
+
style: {
|
|
2483
|
+
backgroundColor: color.toString("css"),
|
|
2484
|
+
// @ts-ignore
|
|
2485
|
+
forcedColorAdjust: "none"
|
|
2486
|
+
}
|
|
2487
|
+
},
|
|
2488
|
+
color: color || null
|
|
2489
|
+
};
|
|
2490
|
+
}
|
|
2491
|
+
const $251c695a52d94a8d$export$83cc445538396800 = /* @__PURE__ */ createContext(null);
|
|
2492
|
+
const $251c695a52d94a8d$export$cae13e90592f246a = /* @__PURE__ */ forwardRef(function ColorSwatch(props, ref) {
|
|
2493
|
+
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $251c695a52d94a8d$export$83cc445538396800);
|
|
2494
|
+
let { colorSwatchProps, color } = $2993fcad7650b98d$export$9060ae606178d849(props);
|
|
2495
|
+
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
2496
|
+
...props,
|
|
2497
|
+
defaultClassName: "react-aria-ColorSwatch",
|
|
2498
|
+
defaultStyle: colorSwatchProps.style,
|
|
2499
|
+
values: {
|
|
2500
|
+
color
|
|
2501
|
+
}
|
|
2502
|
+
});
|
|
2503
|
+
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
2504
|
+
global: true
|
|
2505
|
+
});
|
|
2506
|
+
return /* @__PURE__ */ $dbSRa$react__default.createElement("div", {
|
|
2507
|
+
...$3ef42575df84b30b$export$9d1611c77c2fe928(DOMProps, colorSwatchProps, renderProps),
|
|
2508
|
+
slot: props.slot || void 0,
|
|
2509
|
+
ref
|
|
2510
|
+
});
|
|
2511
|
+
});
|
|
2512
|
+
/**
|
|
2513
|
+
* A simple color/gradient swatch.
|
|
2514
|
+
*
|
|
2515
|
+
* @component
|
|
2516
|
+
* @param {Object} props - Component props.
|
|
2517
|
+
* @param {string} [props.color] - The color to display.
|
|
2518
|
+
* @param {string} [props.gradient] - The gradient to display.
|
|
2519
|
+
* @param {string} [props.className] - Additional clsx to apply.
|
|
2520
|
+
* @param {string} [props.colorName] - The name of the color. Should be auto-generated for colors.
|
|
2521
|
+
* @param {boolean} [props.flat] - If `true`, component will look more flat. Useful for nested layer of controls.
|
|
2522
|
+
* @param {boolean} [props.customGradient=false] - Set to `true` if using a custom gradient.
|
|
2523
|
+
*
|
|
2524
|
+
* @returns {JSX.Element} The ColorSwatch component.
|
|
2525
|
+
*
|
|
2526
|
+
* @example
|
|
2527
|
+
* <ColorSwatch color="#FF0000" />
|
|
2528
|
+
*
|
|
2529
|
+
* @example
|
|
2530
|
+
* <ColorSwatch gradient="linear-gradient(45deg, #FF0000, #00FF00)" />
|
|
2531
|
+
*
|
|
2532
|
+
* @preserve
|
|
2533
|
+
*/
|
|
2534
|
+
const ColorSwatch2 = (props) => {
|
|
2535
|
+
const { color: rawColor, gradient, className, colorName, flat, customGradient = false } = props;
|
|
2536
|
+
const checkerPattern = "repeating-conic-gradient(#CCC 0% 25%, white 0% 50%) 50% / 0.75rem 0.75rem";
|
|
2537
|
+
let color;
|
|
2538
|
+
if (rawColor && !gradient && !customGradient) {
|
|
2539
|
+
try {
|
|
2540
|
+
if (rawColor === "transparent") {
|
|
2541
|
+
color = "rgba(0, 0, 0, 0)";
|
|
2542
|
+
} else {
|
|
2543
|
+
color = $799cddbef784668f$export$6e865ea70d7724f(rawColor);
|
|
2544
|
+
}
|
|
2545
|
+
} catch (error) {
|
|
2546
|
+
color = null;
|
|
2547
|
+
}
|
|
2548
|
+
}
|
|
2549
|
+
const backgroundGradient = gradient ? `${gradient}, ${checkerPattern}` : `linear-gradient(${color}, ${color}), ${checkerPattern}`;
|
|
2550
|
+
return /* @__PURE__ */ jsx(
|
|
2551
|
+
$251c695a52d94a8d$export$cae13e90592f246a,
|
|
2552
|
+
{
|
|
2553
|
+
...props,
|
|
2554
|
+
style: {
|
|
2555
|
+
background: (color || gradient) && backgroundGradient
|
|
2556
|
+
},
|
|
2557
|
+
className: () => clsx("es:size-6 es:rounded-md es:border es:border-secondary-300", !color && !gradient && !customGradient && "es:bg-white", !flat && "es:shadow-sm", className),
|
|
2558
|
+
colorName: !color && !gradient && !customGradient ? __("No color", "eightshift-ui-components") : colorName,
|
|
2559
|
+
color,
|
|
2560
|
+
children: !color && !gradient && !customGradient && /* @__PURE__ */ jsx("div", { className: "es:m-auto es:h-full es:w-px es:rotate-45 es:rounded-md es:bg-red-500" })
|
|
2561
|
+
}
|
|
2562
|
+
);
|
|
2563
|
+
};
|
|
2448
2564
|
export {
|
|
2449
|
-
$
|
|
2450
|
-
|
|
2451
|
-
$799cddbef784668f$export$
|
|
2565
|
+
$251c695a52d94a8d$export$cae13e90592f246a as $,
|
|
2566
|
+
ColorSwatch2 as C,
|
|
2567
|
+
$799cddbef784668f$export$6e865ea70d7724f as a,
|
|
2568
|
+
$799cddbef784668f$export$4cde5df63f53f473 as b,
|
|
2569
|
+
$3493a52097159720$exports as c
|
|
2452
2570
|
};
|
|
@@ -11,11 +11,12 @@ import { useState, useEffect } from "react";
|
|
|
11
11
|
* @param {boolean} [props.noInitial=false] - If `true`, the animation when the component is first mounted is disabled.
|
|
12
12
|
* @param {boolean} [props.noExitAnimation=false] - If `true`, the exit animation is not played.
|
|
13
13
|
* @param {boolean} [props.noEnterAnimation=false] - If `true`, the entrance animation is not played.
|
|
14
|
+
* @param {boolean} [props.decreaseBounce=false] - If `true`, the animations will be more snappy.
|
|
14
15
|
* @param {ElementTransition} [props.transition='slideFade'] - The transition to use when showing/hiding the content.
|
|
15
16
|
*
|
|
16
17
|
* @returns {JSX.Element} The AnimatedVisibility component.
|
|
17
18
|
*
|
|
18
|
-
* @typedef {'fade' | 'slideFade' |'scaleFade' | 'scaleRotateFade' | 'slideFadeUpSlight' | 'slideFadeDownSlight' | 'slideInFadeOut' | 'scaleSlideFade'} ElementTransition
|
|
19
|
+
* @typedef {'fade' | 'slideFade' |'scaleFade' | 'scaleRotateFade' | 'slideFadeUpSlight' | 'slideFadeDownSlight' | 'slideInFadeOut' | 'scaleSlideFade' | 'scaleSlideFadeSlight'} ElementTransition
|
|
19
20
|
*
|
|
20
21
|
* @example
|
|
21
22
|
* const [visible, setVisible] = useState(false);
|
|
@@ -27,7 +28,7 @@ import { useState, useEffect } from "react";
|
|
|
27
28
|
* @preserve
|
|
28
29
|
*/
|
|
29
30
|
const AnimatedVisibility = (props) => {
|
|
30
|
-
const { visible, className, children, noInitial = false, transition = "slideFade", noExitAnimation, noEnterAnimation, ...other } = props;
|
|
31
|
+
const { visible, className, children, noInitial = false, transition = "slideFade", noExitAnimation, noEnterAnimation, decreaseBounce, ...other } = props;
|
|
31
32
|
const [isVisibleInner, setIsVisibleInner] = useState(false);
|
|
32
33
|
const [canAnimate, setCanAnimate] = useState(true);
|
|
33
34
|
useEffect(() => {
|
|
@@ -45,36 +46,40 @@ const AnimatedVisibility = (props) => {
|
|
|
45
46
|
}, []);
|
|
46
47
|
const transitions = {
|
|
47
48
|
fade: {
|
|
48
|
-
inClassName: "es:motion-opacity-in
|
|
49
|
-
outClassName: "es:motion-opacity-out
|
|
49
|
+
inClassName: "es:motion-opacity-in",
|
|
50
|
+
outClassName: "es:motion-opacity-out"
|
|
50
51
|
},
|
|
51
52
|
slideFade: {
|
|
52
|
-
inClassName: "es:motion-
|
|
53
|
-
outClassName: "es:motion-
|
|
53
|
+
inClassName: "es:motion-translate-y-in-[-5%] es:motion-opacity-in",
|
|
54
|
+
outClassName: "es:motion-translate-y-out-[-5%] es:motion-opacity-out es:motion-duration-300"
|
|
54
55
|
},
|
|
55
56
|
slideInFadeOut: {
|
|
56
|
-
inClassName: "es:motion-
|
|
57
|
+
inClassName: "es:motion-translate-y-in-[-5%] es:motion-opacity-in",
|
|
57
58
|
outClassName: "es:motion-opacity-out es:motion-duration-300"
|
|
58
59
|
},
|
|
59
60
|
slideFadeUpSlight: {
|
|
60
|
-
inClassName: "es:motion-
|
|
61
|
-
outClassName: "es:motion-
|
|
61
|
+
inClassName: "es:motion-translate-y-in-[0.25rem] es:motion-opacity-in",
|
|
62
|
+
outClassName: "es:motion-translate-y-out-[0.25rem] es:motion-opacity-out"
|
|
62
63
|
},
|
|
63
64
|
slideFadeDownSlight: {
|
|
64
|
-
inClassName: "es:motion-
|
|
65
|
-
outClassName: "es:motion-
|
|
65
|
+
inClassName: "es:motion-translate-y-in-[-0.25rem] es:motion-opacity-in",
|
|
66
|
+
outClassName: "es:motion-translate-y-out-[-0.25rem] es:motion-opacity-out"
|
|
66
67
|
},
|
|
67
68
|
scaleFade: {
|
|
68
|
-
inClassName: "es:motion-
|
|
69
|
-
outClassName: "es:motion-
|
|
69
|
+
inClassName: "es:motion-scale-in-95 es:motion-opacity-in",
|
|
70
|
+
outClassName: "es:motion-scale-out-90 es:motion-opacity-out"
|
|
70
71
|
},
|
|
71
72
|
scaleSlideFade: {
|
|
72
|
-
inClassName: "es:motion-
|
|
73
|
-
outClassName: "es:motion-
|
|
73
|
+
inClassName: "es:motion-translate-y-in-[-5%] es:motion-scale-in-95 es:motion-opacity-in",
|
|
74
|
+
outClassName: "es:motion-translate-y-out-[-5%] es:motion-scale-out-90 es:motion-opacity-out"
|
|
75
|
+
},
|
|
76
|
+
scaleSlideFadeSlight: {
|
|
77
|
+
inClassName: "es:motion-translate-y-in-[-0.25rem] es:motion-scale-in-95 es:motion-opacity-in",
|
|
78
|
+
outClassName: "es:motion-translate-y-out-[-0.25rem] es:motion-scale-out-90 es:motion-opacity-out"
|
|
74
79
|
},
|
|
75
80
|
scaleRotateFade: {
|
|
76
|
-
inClassName: "es:motion-rotate-in es:motion-
|
|
77
|
-
outClassName: "es:motion-rotate-out es:motion-
|
|
81
|
+
inClassName: "es:motion-rotate-in es:motion-scale-in-95 es:motion-opacity-in es:motion-blur-in-[1px]",
|
|
82
|
+
outClassName: "es:motion-rotate-out es:motion-scale-out-90 es:motion-opacity-out es:motion-blur-out-[1px]"
|
|
78
83
|
}
|
|
79
84
|
};
|
|
80
85
|
return /* @__PURE__ */ jsx(Fragment, { children: isVisibleInner && /* @__PURE__ */ jsx(
|
|
@@ -84,6 +89,9 @@ const AnimatedVisibility = (props) => {
|
|
|
84
89
|
!noEnterAnimation && visible && noInitial && visible && canAnimate && transitions[transition].inClassName,
|
|
85
90
|
!noEnterAnimation && visible && !noInitial && transitions[transition].inClassName,
|
|
86
91
|
!noExitAnimation && !visible && transitions[transition].outClassName,
|
|
92
|
+
"es:motion-duration-300",
|
|
93
|
+
decreaseBounce && "es:motion-ease-spring-snappy es:motion-ease-linear/opacity",
|
|
94
|
+
!decreaseBounce && "es:motion-ease-spring-bouncy es:motion-ease-linear/opacity",
|
|
87
95
|
"es:fill-mode-forwards",
|
|
88
96
|
className
|
|
89
97
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { $ as $514c0188e459b4c0$export$5f1af8db9871e1d6 } from "../../Text-
|
|
2
|
+
import { $ as $514c0188e459b4c0$export$5f1af8db9871e1d6 } from "../../Text-ztX6G1zR.js";
|
|
3
3
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
4
4
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
5
5
|
/**
|
|
@@ -18,6 +18,7 @@ import { RichLabel } from "../rich-label/rich-label.js";
|
|
|
18
18
|
* @param {string} [props.labelContainerClassName] - Classes to pass to the label container.
|
|
19
19
|
* @param {string} [props.labelClassName] - Classes to pass to the label.
|
|
20
20
|
* @param {boolean} [props.fullWidthLabel] - If `true`, the label expands to fill up the whole width, instead of taking up only the space it needs.
|
|
21
|
+
* @param {boolean} [props.noHelpInset] - If `true`, the help text is not inset.
|
|
21
22
|
* @param {JSX.Element} [props.labelAs] - If provided, the label (includes icon and subtitle) will be rendered as this element.
|
|
22
23
|
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
23
24
|
*
|
|
@@ -43,6 +44,7 @@ const BaseControl = (props) => {
|
|
|
43
44
|
controlContainerClassName,
|
|
44
45
|
labelContainerClassName,
|
|
45
46
|
labelClassName,
|
|
47
|
+
noHelpInset,
|
|
46
48
|
fullWidthLabel,
|
|
47
49
|
labelAs,
|
|
48
50
|
hidden
|
|
@@ -53,8 +55,8 @@ const BaseControl = (props) => {
|
|
|
53
55
|
if (!(label || icon || subtitle)) {
|
|
54
56
|
return children;
|
|
55
57
|
}
|
|
56
|
-
return /* @__PURE__ */ jsxs("div", { className
|
|
57
|
-
/* @__PURE__ */ jsxs("div", { className: clsx("es:flex es:items-center es:gap-1", !inline &&
|
|
58
|
+
return /* @__PURE__ */ jsxs("div", { className, children: [
|
|
59
|
+
/* @__PURE__ */ jsxs("div", { className: clsx("es:flex es:items-center es:gap-1", !inline && "es:mb-1.5", labelContainerClassName), children: [
|
|
58
60
|
(label || icon || subtitle) && /* @__PURE__ */ jsx(
|
|
59
61
|
RichLabel,
|
|
60
62
|
{
|
|
@@ -63,7 +65,8 @@ const BaseControl = (props) => {
|
|
|
63
65
|
subtitle,
|
|
64
66
|
fullWidth: fullWidthLabel,
|
|
65
67
|
as: labelAs,
|
|
66
|
-
className: labelClassName
|
|
68
|
+
className: labelClassName,
|
|
69
|
+
noColor: true
|
|
67
70
|
}
|
|
68
71
|
),
|
|
69
72
|
inline && /* @__PURE__ */ jsx("div", { className: clsx("es:ml-auto es:flex es:items-center es:gap-1", controlContainerClassName), children }),
|
|
@@ -74,7 +77,7 @@ const BaseControl = (props) => {
|
|
|
74
77
|
help && /* @__PURE__ */ jsx(
|
|
75
78
|
$514c0188e459b4c0$export$5f1af8db9871e1d6,
|
|
76
79
|
{
|
|
77
|
-
className:
|
|
80
|
+
className: clsx('es:inline-block es:text-sm es:text-secondary-400 es:mt-1.5 es:font-variation-["wdth"_76,"wght"_350]', !noHelpInset && "es:pl-1"),
|
|
78
81
|
slot: "description",
|
|
79
82
|
children: help
|
|
80
83
|
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c as cva } from "../../index-BHpUy2Ix.js";
|
|
3
|
+
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
4
|
+
import { forwardRef, cloneElement } from "react";
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {Object} ContainerProps
|
|
7
|
+
* @property {string} [props.className] - Classes to pass to the container.
|
|
8
|
+
* @property {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
9
|
+
* @property {boolean} [props.accent] - If `true`, applies accent styling to the container.
|
|
10
|
+
* @property {boolean} [props.elevated] - If `true`, applies elevated styling (shadow) to the container.
|
|
11
|
+
* @property {boolean} [props.primary] - If `true`, applies primary styling (rounded full) to the container.
|
|
12
|
+
* @property {boolean} [props.isChild] - If `true`, applies child-specific styling for nested containers.
|
|
13
|
+
* @property {boolean} [props.compact] - If `true`, the vertical padding is reduced for a more compact appearance.
|
|
14
|
+
* @property {boolean} [props.standalone] - If `true`, the border radius is not adjusted automatically, based on neightboring containers.
|
|
15
|
+
* @property {string|JSX.Element} [props.as] - The HTML element or React component to render as the container.
|
|
16
|
+
*
|
|
17
|
+
* @preserve
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* A container component to wrap other components, providing consistent styling and spacing.
|
|
21
|
+
*
|
|
22
|
+
* @component
|
|
23
|
+
* @param {ContainerProps} props
|
|
24
|
+
* @param {React.Ref<HTMLDivElement>} ref
|
|
25
|
+
*
|
|
26
|
+
* @type React.ForwardRefRenderFunction<HTMLDivElement, ContainerProps>
|
|
27
|
+
*
|
|
28
|
+
* @returns {JSX.Element} The Container component.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* <Container accent elevated>
|
|
32
|
+
* <p>This is a container with accent and elevated styles.</p>
|
|
33
|
+
* </Container>
|
|
34
|
+
*
|
|
35
|
+
* @preserve
|
|
36
|
+
*/
|
|
37
|
+
const Container = forwardRef((props, ref) => {
|
|
38
|
+
const { className, children, as, hidden, accent, elevated, primary, isChild, compact, standalone, horizontal, ...rest } = props;
|
|
39
|
+
const ComponentToRender = as || "div";
|
|
40
|
+
if (hidden) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
const containerClasses = cva([" es:inset-ring es:px-2.5", className], {
|
|
44
|
+
variants: {
|
|
45
|
+
elevated: {
|
|
46
|
+
true: "es:inset-shadow-sm es:shadow-sm es:shadow-black/5"
|
|
47
|
+
},
|
|
48
|
+
primary: {
|
|
49
|
+
true: "es:rounded-full"
|
|
50
|
+
},
|
|
51
|
+
compact: {
|
|
52
|
+
false: "es:py-2 es:min-h-13",
|
|
53
|
+
true: "es:py-1 es:min-h-9"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
compoundVariants: [
|
|
57
|
+
{
|
|
58
|
+
primary: false,
|
|
59
|
+
standalone: false,
|
|
60
|
+
class: "es:rounded-md"
|
|
61
|
+
},
|
|
62
|
+
//
|
|
63
|
+
{
|
|
64
|
+
isChild: false,
|
|
65
|
+
primary: false,
|
|
66
|
+
standalone: false,
|
|
67
|
+
horizontal: false,
|
|
68
|
+
class: "es:first:rounded-t-2xl es:last:rounded-b-2xl"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
isChild: true,
|
|
72
|
+
primary: false,
|
|
73
|
+
standalone: false,
|
|
74
|
+
horizontal: false,
|
|
75
|
+
class: "es:[:first-child_>_&]:rounded-t-2xl es:[:last-child_>_&]:rounded-b-2xl"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
isChild: false,
|
|
79
|
+
primary: false,
|
|
80
|
+
standalone: false,
|
|
81
|
+
horizontal: true,
|
|
82
|
+
class: "es:first:rounded-l-2xl es:last:rounded-r-2xl"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
isChild: true,
|
|
86
|
+
primary: false,
|
|
87
|
+
standalone: false,
|
|
88
|
+
horizontal: true,
|
|
89
|
+
class: "es:[:first-child_>_&]:rounded-l-2xl es:[:last-child_>_&]:rounded-r-2xl"
|
|
90
|
+
},
|
|
91
|
+
//
|
|
92
|
+
{
|
|
93
|
+
isChild: false,
|
|
94
|
+
primary: false,
|
|
95
|
+
standalone: true,
|
|
96
|
+
class: "es:rounded-2xl"
|
|
97
|
+
},
|
|
98
|
+
//
|
|
99
|
+
{
|
|
100
|
+
accent: false,
|
|
101
|
+
elevated: false,
|
|
102
|
+
class: [
|
|
103
|
+
"es:bg-white es:bg-linear-to-b es:from-secondary-50/75 es:to-secondary-100/50 es:from-25% es:inset-ring-secondary-200/50",
|
|
104
|
+
"es:inset-shadow-sm es:inset-shadow-white/30"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
accent: true,
|
|
109
|
+
elevated: false,
|
|
110
|
+
class: "es:bg-surface-50 es:inset-ring-surface-100"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
accent: false,
|
|
114
|
+
elevated: true,
|
|
115
|
+
class: "es:bg-secondary-100 es:inset-ring-secondary-200 es:inset-shadow-white/50"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
accent: true,
|
|
119
|
+
elevated: true,
|
|
120
|
+
class: ["es:bg-surface-100 es:bg-linear-to-r es:from-accent-400/10 es:to-accent-400/12", " es:inset-ring-accent-600/10 es:inset-shadow-white/50 es:text-accent-900"]
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
defaultVariants: {
|
|
124
|
+
accent: false,
|
|
125
|
+
elevated: false,
|
|
126
|
+
primary: false,
|
|
127
|
+
isChild: false,
|
|
128
|
+
compact: false,
|
|
129
|
+
standalone: false,
|
|
130
|
+
horizontal: false
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
return /* @__PURE__ */ jsx(
|
|
134
|
+
ComponentToRender,
|
|
135
|
+
{
|
|
136
|
+
...rest,
|
|
137
|
+
ref,
|
|
138
|
+
className: containerClasses({ accent, elevated, primary, isChild, compact, horizontal, standalone }),
|
|
139
|
+
children
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
});
|
|
143
|
+
Container.displayName = "Container";
|
|
144
|
+
/**
|
|
145
|
+
* @typedef {Object} ContainerGroupProps
|
|
146
|
+
* @property {string} [className] - Classes to pass to the container group.
|
|
147
|
+
* @property {boolean} [hidden] - If `true`, the component is not rendered.
|
|
148
|
+
* @property {boolean} [horizontal] - If `true`, the component uses a horizontal orientation.
|
|
149
|
+
* @property {string|JSX.Element} [as] - The HTML element or React component to render as the container group.
|
|
150
|
+
*
|
|
151
|
+
* @preserve
|
|
152
|
+
*/
|
|
153
|
+
/**
|
|
154
|
+
* A container group component to wrap multiple Container components, providing consistent spacing between them.
|
|
155
|
+
*
|
|
156
|
+
* @component
|
|
157
|
+
* @param {ContainerGroupProps} props
|
|
158
|
+
* @param {React.Ref<HTMLDivElement>} ref
|
|
159
|
+
*
|
|
160
|
+
* @type React.ForwardRefRenderFunction<HTMLDivElement, ContainerGroupProps>
|
|
161
|
+
*
|
|
162
|
+
* @returns {JSX.Element} The ContainerGroup component.
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* <ContainerGroup>
|
|
166
|
+
* <Container>First container</Container>
|
|
167
|
+
* <Container>Second container</Container>
|
|
168
|
+
* </ContainerGroup>
|
|
169
|
+
*
|
|
170
|
+
* @preserve
|
|
171
|
+
*/
|
|
172
|
+
const ContainerGroup = forwardRef((props, ref) => {
|
|
173
|
+
const { className, children, as, hidden, horizontal, ...rest } = props;
|
|
174
|
+
const ComponentToRender = as || "div";
|
|
175
|
+
if (hidden) {
|
|
176
|
+
return null;
|
|
177
|
+
}
|
|
178
|
+
const processedChildren = Array.isArray(children) ? children.reduce((acc, child, index) => {
|
|
179
|
+
if (child.type.displayName === "Container") {
|
|
180
|
+
return [
|
|
181
|
+
...acc,
|
|
182
|
+
cloneElement(child, {
|
|
183
|
+
horizontal,
|
|
184
|
+
key: index
|
|
185
|
+
})
|
|
186
|
+
];
|
|
187
|
+
}
|
|
188
|
+
return acc;
|
|
189
|
+
}, []) : children;
|
|
190
|
+
return /* @__PURE__ */ jsx(
|
|
191
|
+
ComponentToRender,
|
|
192
|
+
{
|
|
193
|
+
...rest,
|
|
194
|
+
ref,
|
|
195
|
+
className: clsx("es:flex es:gap-0.5", !horizontal && "es:flex-col", className),
|
|
196
|
+
children: processedChildren
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
});
|
|
200
|
+
ContainerGroup.displayName = "ContainerGroup";
|
|
201
|
+
export {
|
|
202
|
+
Container,
|
|
203
|
+
ContainerGroup
|
|
204
|
+
};
|
|
@@ -2,7 +2,6 @@ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Fragment as Fragment$1 } from "react";
|
|
3
3
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
4
4
|
import { upperFirst } from "../../utilities/es-dash.js";
|
|
5
|
-
import "../../sha256-C56UDWfQ.js";
|
|
6
5
|
/**
|
|
7
6
|
* Component that renders a preview of the breakpoints to help users visualize the options they set.
|
|
8
7
|
*
|