@eightshift/ui-components 1.9.1 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -7
- package/dist/{Button-BEIi9mB_.js → Button-OQ5EIPvt.js} +8 -8
- package/dist/{SelectionManager-DGbP8Ntl.js → Collection-CJM_asJz.js} +345 -197
- package/dist/{Color-CZxTZUqH.js → Color-B0HgM8f4.js} +1 -1
- package/dist/{ColorSwatch-Iijp9hzP.js → ColorSwatch-Dv3Wxdl_.js} +6 -7
- package/dist/{ComboBox-DVPU5XzU.js → ComboBox-BnlZjJ3T.js} +21 -22
- package/dist/{Dialog-17uxPRe5.js → Dialog-CIh-hX93.js} +77 -65
- package/dist/{FieldError-huHsqqMP.js → FieldError-D7A6s7O5.js} +2 -2
- package/dist/{FocusScope-7r2_SUa9.js → FocusScope-Cs5_OoeA.js} +6 -4
- package/dist/{Group-k_oyd3Te.js → Group-D6tr3U_n.js} +5 -6
- package/dist/{Heading-DRBzKYHb.js → Heading-DiYTXoIW.js} +3 -4
- package/dist/{Hidden-5cXbU70C.js → Hidden-DnOd_jPX.js} +2 -2
- package/dist/{Input-DCmTv_Qw.js → Input-Se0m3ubj.js} +13 -11
- package/dist/{Label-D8G0GMsc.js → Label-Ca9uelsn.js} +4 -5
- package/dist/{List-C7L49CxW.js → List-Br274SP1.js} +16 -8
- package/dist/{ListBox-BxZwDp9o.js → ListBox-D9dFEh5A.js} +36 -23
- package/dist/{OverlayArrow-Dca2JXYU.js → OverlayArrow-1jx-ZyCR.js} +75 -13
- package/dist/{Select-aab027f3.esm-OvJ8lZs8.js → Select-aab027f3.esm-HFNIFFya.js} +4 -4
- package/dist/{Separator-B_VdRHCf.js → Separator-BhZycTUp.js} +9 -7
- package/dist/{Slider-CgEZmlNY.js → Slider-BZNaJylD.js} +20 -24
- package/dist/{Text-Cld9rkzJ.js → Text-aOUPPvTO.js} +3 -4
- package/dist/{VisuallyHidden-D0lsNfi4.js → VisuallyHidden-ClTQo25k.js} +2 -2
- package/dist/assets/index.css +37 -0
- package/dist/assets/style-admin.css +5287 -0
- package/dist/assets/style-editor.css +5287 -0
- package/dist/assets/style.css +5293 -1
- package/dist/assets/wp-font-enhancements.css +8 -1
- package/dist/assets/wp-ui-enhancements.css +299 -1
- package/dist/components/animated-visibility/animated-visibility.js +17 -21
- package/dist/components/base-control/base-control.js +7 -7
- package/dist/components/breakpoint-preview/breakpoint-preview.js +50 -50
- package/dist/components/button/button.js +190 -86
- package/dist/components/checkbox/checkbox.js +44 -27
- package/dist/components/color-pickers/color-picker.js +13 -9
- package/dist/components/color-pickers/color-swatch.js +4 -4
- package/dist/components/color-pickers/gradient-editor.js +25 -24
- package/dist/components/color-pickers/solid-color-picker.js +197 -229
- package/dist/components/component-toggle/component-toggle.js +3 -3
- package/dist/components/container-panel/container-panel.js +17 -17
- package/dist/components/draggable/draggable-handle.js +6 -6
- package/dist/components/draggable/draggable.js +1414 -699
- package/dist/components/draggable-list/draggable-list-item.js +3 -3
- package/dist/components/draggable-list/draggable-list.js +12 -12
- package/dist/components/expandable/expandable.js +66 -78
- package/dist/components/index.js +2 -3
- package/dist/components/input-field/input-field.js +35 -22
- package/dist/components/layout/hstack.js +1 -1
- package/dist/components/layout/vstack.js +1 -1
- package/dist/components/link-input/link-input.js +69 -57
- package/dist/components/matrix-align/matrix-align.js +34 -86
- package/dist/components/menu/menu.js +22 -23
- package/dist/components/modal/modal.js +24 -25
- package/dist/components/notice/notice.js +32 -32
- package/dist/components/number-picker/number-picker.js +41 -40
- package/dist/components/option-select/option-select.js +9 -4
- package/dist/components/options-panel/options-panel.js +63 -28
- package/dist/components/placeholders/file-placeholder.js +6 -17
- package/dist/components/placeholders/image-placeholder.js +17 -17
- package/dist/components/placeholders/media-placeholder.js +12 -12
- package/dist/components/popover/popover.js +6 -5
- package/dist/components/radio/radio.js +60 -43
- package/dist/components/repeater/repeater-item.js +10 -10
- package/dist/components/repeater/repeater.js +8 -8
- package/dist/components/responsive/mini-responsive.js +41 -41
- package/dist/components/responsive/responsive-legacy.js +33 -33
- package/dist/components/responsive/responsive.js +48 -48
- package/dist/components/responsive-preview/responsive-preview.js +4 -4
- package/dist/components/rich-label/rich-label.js +13 -11
- package/dist/components/select/async-multi-select.js +3 -3
- package/dist/components/select/async-single-select.js +2 -2
- package/dist/components/select/custom-select-default-components.js +3 -3
- package/dist/components/select/multi-select-components.js +1 -1
- package/dist/components/select/multi-select.js +3 -3
- package/dist/components/select/react-select-component-wrappers.js +1 -1
- package/dist/components/select/single-select.js +2 -2
- package/dist/components/select/styles.js +21 -21
- package/dist/components/select/v2/async-select.js +37 -47
- package/dist/components/select/v2/shared.js +8 -8
- package/dist/components/select/v2/single-select.js +44 -48
- package/dist/components/slider/column-config-slider.js +25 -25
- package/dist/components/slider/slider.js +173 -182
- package/dist/components/spacer/spacer.js +21 -21
- package/dist/components/tabs/tabs.js +111 -63
- package/dist/components/toggle/switch.js +27 -21
- package/dist/components/toggle/toggle.js +1 -1
- package/dist/components/toggle-button/toggle-button.js +160 -83
- package/dist/components/tooltip/tooltip.js +25 -28
- package/dist/{context-DtrQ3I5U.js → context-CDOs-GuR.js} +1 -1
- package/dist/{focusSafely-ChK5oW-0.js → focusSafely-CiqTTjWy.js} +18 -17
- package/dist/icons/icons.js +52 -0
- package/dist/{index-641ee5b8.esm-DRaWil7u.js → index-641ee5b8.esm-DbdaYaxR.js} +45 -45
- package/dist/{index-D0mHceYg.js → index-BRp93Yfa.js} +24 -31
- package/dist/index-CcCn9HWX.js +44 -0
- package/dist/index.js +2 -3
- package/dist/{multi-select-components-2Ax71j9a.js → multi-select-components-CkF3LyTF.js} +4 -4
- package/dist/{react-select-async.esm-BZwl7Ddb.js → react-select-async.esm-DcVLw9X5.js} +3 -3
- package/dist/{react-select.esm-DI0eSkd8.js → react-select.esm-OZ0cmTjg.js} +3 -3
- package/dist/style-admin.js +1 -0
- package/dist/style-editor.js +1 -0
- package/dist/style.js +1 -1
- package/dist/{textSelection-CdZPiDxh.js → textSelection-BlTDSskG.js} +2 -2
- package/dist/{useButton-C5e_EJlC.js → useButton-CmLbE5vg.js} +3 -3
- package/dist/{useEvent-BW_vevRp.js → useEvent-cLDJlznQ.js} +1 -1
- package/dist/{useFocusRing-Dbj6MsFR.js → useFocusRing-CGp3guTX.js} +1 -1
- package/dist/{useFocusable-C2xrPFl6.js → useFocusable-087cO5Ct.js} +9 -6
- package/dist/{useFormReset-DDCE2RPv.js → useFormReset-NpLM2e3G.js} +1 -1
- package/dist/{useFormValidation-BxnASugK.js → useFormValidation-BWwmZQE2.js} +3 -3
- package/dist/{useLabel-C3sAYsiC.js → useLabel-C85N3Hzw.js} +2 -2
- package/dist/{useLabels-WnPbJUyQ.js → useLabels-C_2wWraB.js} +1 -1
- package/dist/{useListState-BmTFGt2_.js → useListState-Z7FB_NzO.js} +1 -1
- package/dist/{useLocalizedStringFormatter-BurzRhbk.js → useLocalizedStringFormatter-BQ4TF72x.js} +1 -1
- package/dist/{useNumberField-D_Azw6A1.js → useNumberField-Bm6_BVl9.js} +10 -10
- package/dist/{useNumberFormatter-B58dTQ-c.js → useNumberFormatter-DlUVKkO7.js} +1 -1
- package/dist/{usePress-DZ9pn6Jl.js → usePress-rg_OQIGW.js} +15 -14
- package/dist/{useSingleSelectListState-Dr843geC.js → useSingleSelectListState-Cu3xtEJS.js} +2 -2
- package/dist/{useToggle-Dq9VpeCd.js → useToggle-DzlgBLAJ.js} +4 -4
- package/dist/{useToggleState-DA_b3LG_.js → useToggleState-DhSBQxkp.js} +1 -1
- package/dist/{utils-BmaSD6gC.js → utils-39D0mStj.js} +41 -93
- package/package.json +41 -38
- package/dist/GeistMonoVF.woff2 +0 -0
- package/dist/GeistVF.woff2 +0 -0
- package/dist/assets/fonts.css +0 -1
- package/dist/components/list-box/list-box.js +0 -157
- package/dist/fonts.js +0 -1
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { l as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, d as $3ef42575df84b30b$export$9d1611c77c2fe928, f as $bdb11010cef70236$export$f680877a34711e37,
|
|
4
|
-
import { $ as $f39a9eba43920ace$export$86427a43e3e48ebb } from "../../Hidden-
|
|
2
|
+
import { c as $880e95eb8b93ba9a$export$ecf600387e221c37, i as $ae20dd8cbca75726$export$d6daf82dcd84e87c, d as $e1995378a142960e$export$bf788dd355e3a401, e as $e1995378a142960e$export$fb8073518f34e6ec, f as $7135fc7d473fd974$export$4feb769f8ddf26c5, j as $7135fc7d473fd974$export$90e00781bc59d8f9, h as $e1995378a142960e$export$18af5c7a9e9b3664, k as $7135fc7d473fd974$export$a164736487e3f0ae } from "../../Collection-CJM_asJz.js";
|
|
3
|
+
import { l as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, d as $3ef42575df84b30b$export$9d1611c77c2fe928, f as $bdb11010cef70236$export$f680877a34711e37, a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3, j as $64fa3d84918910a7$export$2881499e37b75b9a, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, m as $df56164dff5785e2$export$4338b53315abf666 } from "../../utils-39D0mStj.js";
|
|
4
|
+
import { $ as $f39a9eba43920ace$export$86427a43e3e48ebb } from "../../Hidden-DnOd_jPX.js";
|
|
5
5
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
|
|
6
|
-
import React__default, { useState, useMemo, useRef, useEffect, forwardRef, useContext, createContext, useId, cloneElement } from "react";
|
|
7
|
-
import {
|
|
8
|
-
import { $ as $
|
|
9
|
-
import {
|
|
10
|
-
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { $ as $
|
|
6
|
+
import React__default, { useState, useMemo, useRef, useEffect, forwardRef, useContext, createContext, useId, cloneElement, isValidElement } from "react";
|
|
7
|
+
import { $ as $a0d645289fe9b86b$export$e7f05e985daf4b5f } from "../../useSingleSelectListState-Cu3xtEJS.js";
|
|
8
|
+
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-CGp3guTX.js";
|
|
9
|
+
import { $ as $313b98861ee5dd6c$export$d6875122194c7b44 } from "../../useLabels-C_2wWraB.js";
|
|
10
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-CDOs-GuR.js";
|
|
11
|
+
import { a as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 } from "../../usePress-rg_OQIGW.js";
|
|
12
|
+
import { a as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "../../FocusScope-Cs5_OoeA.js";
|
|
13
|
+
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-CiqTTjWy.js";
|
|
14
14
|
import { _ as __, s as sprintf } from "../../default-i18n-CM1-Xvzf.js";
|
|
15
15
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
16
|
+
import { c as cva } from "../../index-CcCn9HWX.js";
|
|
16
17
|
import { Notice } from "../notice/notice.js";
|
|
17
18
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
18
19
|
function $83013635b024ae3d$export$eac1895992b9f3d6(ref, options) {
|
|
@@ -232,7 +233,7 @@ function $76f919a04c5a7d14$var$findDefaultSelectedKey(collection, disabledKeys)
|
|
|
232
233
|
}
|
|
233
234
|
const $5e8ad37a45e1c704$export$cfa7aa87c26e7d1f = /* @__PURE__ */ createContext(null);
|
|
234
235
|
const $5e8ad37a45e1c704$export$364712098d2aa57c = /* @__PURE__ */ createContext(null);
|
|
235
|
-
|
|
236
|
+
const $5e8ad37a45e1c704$export$b2539bed5023c21c = /* @__PURE__ */ forwardRef(function Tabs(props, ref) {
|
|
236
237
|
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $5e8ad37a45e1c704$export$cfa7aa87c26e7d1f);
|
|
237
238
|
let { children, orientation = "horizontal" } = props;
|
|
238
239
|
children = useMemo(() => typeof children === "function" ? children({
|
|
@@ -249,7 +250,7 @@ function $5e8ad37a45e1c704$var$Tabs(props, ref) {
|
|
|
249
250
|
collection,
|
|
250
251
|
tabsRef: ref
|
|
251
252
|
}));
|
|
252
|
-
}
|
|
253
|
+
});
|
|
253
254
|
function $5e8ad37a45e1c704$var$TabsInner({ props, tabsRef: ref, collection }) {
|
|
254
255
|
let { orientation = "horizontal" } = props;
|
|
255
256
|
let state = $76f919a04c5a7d14$export$4ba071daf4e486({
|
|
@@ -297,14 +298,13 @@ function $5e8ad37a45e1c704$var$TabsInner({ props, tabsRef: ref, collection }) {
|
|
|
297
298
|
]
|
|
298
299
|
}, renderProps.children));
|
|
299
300
|
}
|
|
300
|
-
const $5e8ad37a45e1c704$export$
|
|
301
|
-
function $5e8ad37a45e1c704$var$TabList(props, ref) {
|
|
301
|
+
const $5e8ad37a45e1c704$export$e51a686c67fdaa2d = /* @__PURE__ */ forwardRef(function TabList(props, ref) {
|
|
302
302
|
let state = useContext($5e8ad37a45e1c704$export$364712098d2aa57c);
|
|
303
303
|
return state ? /* @__PURE__ */ React__default.createElement($5e8ad37a45e1c704$var$TabListInner, {
|
|
304
304
|
props,
|
|
305
305
|
forwardedRef: ref
|
|
306
306
|
}) : /* @__PURE__ */ React__default.createElement($e1995378a142960e$export$fb8073518f34e6ec, props);
|
|
307
|
-
}
|
|
307
|
+
});
|
|
308
308
|
function $5e8ad37a45e1c704$var$TabListInner({ props, forwardedRef: ref }) {
|
|
309
309
|
let state = useContext($5e8ad37a45e1c704$export$364712098d2aa57c);
|
|
310
310
|
let { CollectionRoot } = useContext($7135fc7d473fd974$export$4feb769f8ddf26c5);
|
|
@@ -337,7 +337,6 @@ function $5e8ad37a45e1c704$var$TabListInner({ props, forwardedRef: ref }) {
|
|
|
337
337
|
persistedKeys: $7135fc7d473fd974$export$90e00781bc59d8f9(state.selectionManager.focusedKey)
|
|
338
338
|
}));
|
|
339
339
|
}
|
|
340
|
-
const $5e8ad37a45e1c704$export$e51a686c67fdaa2d = /* @__PURE__ */ forwardRef($5e8ad37a45e1c704$var$TabList);
|
|
341
340
|
const $5e8ad37a45e1c704$export$3e41faf802a29e71 = /* @__PURE__ */ $e1995378a142960e$export$18af5c7a9e9b3664("item", (props, forwardedRef, item) => {
|
|
342
341
|
let state = useContext($5e8ad37a45e1c704$export$364712098d2aa57c);
|
|
343
342
|
let ref = $df56164dff5785e2$export$4338b53315abf666(forwardedRef);
|
|
@@ -377,7 +376,7 @@ const $5e8ad37a45e1c704$export$3e41faf802a29e71 = /* @__PURE__ */ $e1995378a1429
|
|
|
377
376
|
"data-hovered": isHovered || void 0
|
|
378
377
|
});
|
|
379
378
|
});
|
|
380
|
-
|
|
379
|
+
const $5e8ad37a45e1c704$export$3d96ec278d3efce4 = /* @__PURE__ */ $f39a9eba43920ace$export$86427a43e3e48ebb(function TabPanel(props, forwardedRef) {
|
|
381
380
|
const state = useContext($5e8ad37a45e1c704$export$364712098d2aa57c);
|
|
382
381
|
let ref = $df56164dff5785e2$export$4338b53315abf666(forwardedRef);
|
|
383
382
|
let { tabPanelProps } = $34bce698202e07cb$export$fae0121b5afe572d(props, state, ref);
|
|
@@ -416,9 +415,10 @@ function $5e8ad37a45e1c704$var$TabPanel(props, forwardedRef) {
|
|
|
416
415
|
null
|
|
417
416
|
]
|
|
418
417
|
]
|
|
419
|
-
},
|
|
420
|
-
|
|
421
|
-
|
|
418
|
+
}, /* @__PURE__ */ React__default.createElement($7135fc7d473fd974$export$4feb769f8ddf26c5.Provider, {
|
|
419
|
+
value: $7135fc7d473fd974$export$a164736487e3f0ae
|
|
420
|
+
}, renderProps.children)));
|
|
421
|
+
});
|
|
422
422
|
/**
|
|
423
423
|
* Main tab container.
|
|
424
424
|
*
|
|
@@ -426,10 +426,13 @@ const $5e8ad37a45e1c704$export$3d96ec278d3efce4 = /* @__PURE__ */ $f39a9eba43920
|
|
|
426
426
|
* @param {Object} props - Component props.
|
|
427
427
|
* @param {boolean} [props.vertical=false] - Whether the tabs are vertical.
|
|
428
428
|
* @param {string} [props.className] - Classes to pass to the tabs container.
|
|
429
|
+
* @param {TabsType} [props.type='underline'] - Design of the tabs.
|
|
429
430
|
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
430
431
|
*
|
|
431
432
|
* @returns {JSX.Element} The Tabs component.
|
|
432
433
|
*
|
|
434
|
+
* @typedef {'underline' | 'pill' | 'pillInverse'} TabsType
|
|
435
|
+
*
|
|
433
436
|
* @example
|
|
434
437
|
* <Tabs>
|
|
435
438
|
* <TabList>
|
|
@@ -442,8 +445,8 @@ const $5e8ad37a45e1c704$export$3d96ec278d3efce4 = /* @__PURE__ */ $f39a9eba43920
|
|
|
442
445
|
*
|
|
443
446
|
* @preserve
|
|
444
447
|
*/
|
|
445
|
-
const
|
|
446
|
-
const { children, vertical, className, hidden, ...rest } = props;
|
|
448
|
+
const Tabs2 = (props) => {
|
|
449
|
+
const { children, vertical, className, hidden, type = "underline", ...rest } = props;
|
|
447
450
|
const baseId = useId();
|
|
448
451
|
if (hidden) {
|
|
449
452
|
return null;
|
|
@@ -464,13 +467,15 @@ const Tabs = (props) => {
|
|
|
464
467
|
cloneElement(
|
|
465
468
|
child,
|
|
466
469
|
{
|
|
467
|
-
key: index
|
|
470
|
+
key: index,
|
|
471
|
+
type
|
|
468
472
|
},
|
|
469
473
|
childItems == null ? void 0 : childItems.map(
|
|
470
474
|
(innerChild, i) => cloneElement(innerChild, {
|
|
471
475
|
id: `tab-${baseId}-${i + 1}`,
|
|
472
476
|
key: i,
|
|
473
|
-
isParentVertical: vertical
|
|
477
|
+
isParentVertical: vertical,
|
|
478
|
+
type
|
|
474
479
|
})
|
|
475
480
|
)
|
|
476
481
|
)
|
|
@@ -482,7 +487,7 @@ const Tabs = (props) => {
|
|
|
482
487
|
cloneElement(child, {
|
|
483
488
|
id: `tab-${baseId}-${tabPanelCounter++}`,
|
|
484
489
|
key: index,
|
|
485
|
-
className: clsx(child.props.className, vertical && "es
|
|
490
|
+
className: clsx(child.props.className, vertical && "es:pl-3")
|
|
486
491
|
})
|
|
487
492
|
];
|
|
488
493
|
}
|
|
@@ -508,12 +513,12 @@ const Tabs = (props) => {
|
|
|
508
513
|
{
|
|
509
514
|
...rest,
|
|
510
515
|
orientation: vertical ? "vertical" : "horizontal",
|
|
511
|
-
className: clsx(vertical ? "es
|
|
516
|
+
className: clsx(vertical ? "es:grid es:size-full es:min-h-40 es:grid-cols-[minmax(0,15rem)_2fr] es:gap-4" : "es:flex-col", className),
|
|
512
517
|
children: childrenWithIds
|
|
513
518
|
}
|
|
514
519
|
);
|
|
515
520
|
};
|
|
516
|
-
|
|
521
|
+
Tabs2.displayName = "Tabs";
|
|
517
522
|
/**
|
|
518
523
|
* Container for tabs within the Tabs component.
|
|
519
524
|
*
|
|
@@ -527,24 +532,29 @@ Tabs.displayName = "Tabs";
|
|
|
527
532
|
*
|
|
528
533
|
* @preserve
|
|
529
534
|
*/
|
|
530
|
-
const
|
|
531
|
-
const { children, "aria-label": ariaLabel, className, ...other } = props;
|
|
535
|
+
const TabList2 = (props) => {
|
|
536
|
+
const { children, "aria-label": ariaLabel, className, type, ...other } = props;
|
|
532
537
|
return /* @__PURE__ */ jsx(
|
|
533
538
|
$5e8ad37a45e1c704$export$e51a686c67fdaa2d,
|
|
534
539
|
{
|
|
535
540
|
"aria-label": ariaLabel ?? __("tabs", "eightshift-ui-components"),
|
|
536
|
-
className: ({ orientation }) =>
|
|
537
|
-
"
|
|
538
|
-
orientation === "vertical"
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
541
|
+
className: ({ orientation }) => {
|
|
542
|
+
const horizontal = orientation === "horizontal";
|
|
543
|
+
const vertical = orientation === "vertical";
|
|
544
|
+
return clsx(
|
|
545
|
+
"es:flex es:p-0.5 es:-m-0.5",
|
|
546
|
+
vertical && "es:h-full es:flex-col es:gap-1.5 es:pr-1.5 es:overflow-y-auto es:overflow-x-visible",
|
|
547
|
+
horizontal && "es:w-full es:items-stretch es:gap-1.5 es:overflow-x-auto es:overflow-y-visible es:mb-3",
|
|
548
|
+
horizontal && type === "underline" && 'es:relative es:isolate es:after:content-[""] es:after:-z-10 es:after:absolute es:after:bottom-0.5 es:after:left-0 es:after:w-full es:after:h-px es:after:bg-secondary-300',
|
|
549
|
+
className
|
|
550
|
+
);
|
|
551
|
+
},
|
|
542
552
|
...other,
|
|
543
553
|
children
|
|
544
554
|
}
|
|
545
555
|
);
|
|
546
556
|
};
|
|
547
|
-
|
|
557
|
+
TabList2.displayName = "TabList";
|
|
548
558
|
/**
|
|
549
559
|
* A tab within the TabList component, in the Tabs component.
|
|
550
560
|
*
|
|
@@ -553,6 +563,7 @@ TabList.displayName = "TabList";
|
|
|
553
563
|
* @param {boolean} [props.disabled] - Whether the tab is disabled.
|
|
554
564
|
* @param {string} [props.className] - Classes to pass to the tab.
|
|
555
565
|
* @param {JSX.Element} [props.icon] - Icon to show on the tab.
|
|
566
|
+
* @param {string|JSX.Element} [props.badge] - Badge to render besides the label.
|
|
556
567
|
* @param {string} [props.label] - Tab label. **Note**: overrides inner items!
|
|
557
568
|
* @param {string} [props.subtitle] - Tab subtitle. **Note**: overrides inner items!
|
|
558
569
|
*
|
|
@@ -563,39 +574,76 @@ TabList.displayName = "TabList";
|
|
|
563
574
|
* @preserve
|
|
564
575
|
*/
|
|
565
576
|
const Tab = (props) => {
|
|
566
|
-
const { children, disabled, isParentVertical, className, icon, label, subtitle, ...other } = props;
|
|
577
|
+
const { children, disabled, isParentVertical, className, icon, label, subtitle, type, badge, ...other } = props;
|
|
578
|
+
const componentClasses = cva(
|
|
579
|
+
[
|
|
580
|
+
"es:group es:flex es:items-center es:gap-1.5 es:relative es:shrink-0 es:min-h-9.5",
|
|
581
|
+
"es:select-none es:text-sm es:transition es:not-disabled:cursor-pointer",
|
|
582
|
+
"es:any-focus:outline-hidden es:focus-visible:ring-2 es:focus-visible:ring-accent-500/50",
|
|
583
|
+
className
|
|
584
|
+
],
|
|
585
|
+
{
|
|
586
|
+
variants: {
|
|
587
|
+
type: {
|
|
588
|
+
underline: "es:disabled:text-secondary-400 es:selected:text-accent-950",
|
|
589
|
+
pill: "es:font-[450] es:border es:border-transparent es:px-3 es:py-2 es:rounded-lg es:not-disabled:not-selected:hover:text-secondary-900 es:not-disabled:not-selected:hover:bg-secondary-100 es:text-secondary-500 es:selected:text-accent-900 es:selected:bg-accent-400/15 es:has-icon:pl-2.5 es:focus-visible:border-accent-500 es:disabled:text-secondary-400/75",
|
|
590
|
+
pillInverse: "es:font-[450] es:border es:border-transparent es:px-3 es:py-2 es:rounded-lg es:not-disabled:not-selected:hover:text-secondary-900 es:not-disabled:not-selected:hover:bg-secondary-100 es:text-secondary-500 es:selected:text-white es:selected:bg-accent-600 es:has-icon:pl-2.5 es:focus-visible:border-accent-500 es:disabled:text-secondary-400/75"
|
|
591
|
+
}
|
|
592
|
+
},
|
|
593
|
+
compoundVariants: [
|
|
594
|
+
{
|
|
595
|
+
vertical: false,
|
|
596
|
+
type: "underline",
|
|
597
|
+
class: [
|
|
598
|
+
"es:px-2 es:py-2.5 es:rounded-lg",
|
|
599
|
+
'es:after:content-[""] es:after:absolute es:after:bottom-px es:after:left-0 es:after:right-0 es:after:w-5/6 es:after:mx-auto es:after:h-0.75',
|
|
600
|
+
"es:after:bg-linear-to-b es:hover:not-selected:not-disabled:after:from-secondary-200 es:hover:not-selected:not-disabled:after:to-secondary-300 es:selected:after:from-accent-500 es:selected:after:to-accent-600",
|
|
601
|
+
"es:after:rounded-t-full es:selected:after:shadow-xs es:selected:after:shadow-accent-700/30 es:after:transition"
|
|
602
|
+
]
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
vertical: true,
|
|
606
|
+
type: "underline",
|
|
607
|
+
class: [
|
|
608
|
+
"es:pl-3 es:pr-2 es:py-2.5 es:rounded-lg es:selected:bg-accent-50/50 es:selected:text-accent-950 es:transition",
|
|
609
|
+
'es:after:content-[""] es:after:absolute es:after:-left-0 es:after:top-0 es:after:bottom-0 es:after:h-5/6 es:after:my-auto es:after:w-1',
|
|
610
|
+
"es:after:bg-linear-to-r es:hover:not-selected:not-disabled:after:from-secondary-200 es:hover:not-selected:not-disabled:after:to-secondary-300 es:selected:after:from-accent-500 es:selected:after:to-accent-600",
|
|
611
|
+
"es:after:rounded-full es:selected:after:shadow-xs es:selected:after:shadow-accent-700/30 es:after:transition"
|
|
612
|
+
]
|
|
613
|
+
}
|
|
614
|
+
]
|
|
615
|
+
}
|
|
616
|
+
);
|
|
567
617
|
return /* @__PURE__ */ jsxs(
|
|
568
618
|
$5e8ad37a45e1c704$export$3e41faf802a29e71,
|
|
569
619
|
{
|
|
570
620
|
...other,
|
|
571
621
|
isDisabled: disabled,
|
|
572
|
-
className: ({
|
|
573
|
-
return clsx(
|
|
574
|
-
"es-uic-relative es-uic-flex es-uic-select-none es-uic-items-center es-uic-rounded es-uic-p-1.5 es-uic-text-sm es-uic-transition",
|
|
575
|
-
"focus:es-uic-outline-none focus-visible:es-uic-outline-none focus-visible:es-uic-ring focus-visible:es-uic-ring-teal-500 focus-visible:es-uic-ring-opacity-50",
|
|
576
|
-
'after:es-uic-absolute after:es-uic-rounded-full after:es-uic-bg-teal-600 after:es-uic-shadow-sm after:es-uic-shadow-teal-500/25 after:es-uic-transition after:es-uic-duration-300 after:es-uic-content-[""]',
|
|
577
|
-
!isParentVertical && "after:es-uic-inset-x-0 after:-es-uic-bottom-px after:es-uic-h-0.5",
|
|
578
|
-
isSelected && "es-uic-border-b-teal-600 es-uic-text-teal-900 after:es-uic-opacity-100",
|
|
579
|
-
isSelected && isParentVertical && "after:es-uic-scale-y-100",
|
|
580
|
-
isSelected && !isParentVertical && "after:es-uic-scale-x-100",
|
|
581
|
-
!isSelected && !isDisabled && "es-uic-text-gray-800 after:es-uic-opacity-0 hover:es-uic-bg-gray-100",
|
|
582
|
-
!isSelected && !isDisabled && isParentVertical && "after:es-uic-scale-y-75",
|
|
583
|
-
!isSelected && !isDisabled && !isParentVertical && "after:es-uic-scale-x-75",
|
|
584
|
-
isDisabled && "es-uic-text-gray-300 after:es-uic-hidden",
|
|
585
|
-
isParentVertical && "es-uic-min-h-9 es-uic-pl-3 after:es-uic-inset-y-0 after:es-uic-left-px after:es-uic-right-auto after:es-uic-my-auto after:es-uic-h-7 after:es-uic-w-[0.1875rem]",
|
|
586
|
-
className
|
|
587
|
-
);
|
|
588
|
-
},
|
|
622
|
+
className: componentClasses({ vertical: Boolean(isParentVertical), type }),
|
|
589
623
|
children: [
|
|
590
624
|
(icon || subtitle) && /* @__PURE__ */ jsx(
|
|
591
625
|
RichLabel,
|
|
592
626
|
{
|
|
593
627
|
icon,
|
|
594
628
|
label: label ?? children,
|
|
595
|
-
subtitle
|
|
629
|
+
subtitle,
|
|
630
|
+
noColor: true
|
|
631
|
+
}
|
|
632
|
+
),
|
|
633
|
+
!(icon || subtitle) && (label ?? children),
|
|
634
|
+
badge && !isValidElement(badge) && /* @__PURE__ */ jsx(
|
|
635
|
+
"span",
|
|
636
|
+
{
|
|
637
|
+
className: clsx(
|
|
638
|
+
"es:transition-colors es:px-1.5 es:py-1 es:leading-none es:rounded-md es:text-xs es:font-medium",
|
|
639
|
+
type === "underline" && "es:inset-ring es:inset-ring-secondary-200/20 es:bg-secondary-100 es:group-selected:bg-accent-500/10 es:group-selected:text-accent-900 es:group-selected:inset-ring-accent-500/10",
|
|
640
|
+
type === "pill" && "es:bg-secondary-100 es:group-selected:bg-accent-600 es:group-selected:text-white",
|
|
641
|
+
type === "pillInverse" && "es:bg-secondary-100 es:group-selected:bg-accent-50 es:group-selected:text-accent-900"
|
|
642
|
+
),
|
|
643
|
+
children: badge
|
|
596
644
|
}
|
|
597
645
|
),
|
|
598
|
-
|
|
646
|
+
badge && isValidElement(badge) && /* @__PURE__ */ jsx("div", { children: badge })
|
|
599
647
|
]
|
|
600
648
|
}
|
|
601
649
|
);
|
|
@@ -614,21 +662,21 @@ Tab.displayName = "Tab";
|
|
|
614
662
|
*
|
|
615
663
|
* @preserve
|
|
616
664
|
*/
|
|
617
|
-
const
|
|
665
|
+
const TabPanel2 = (props) => {
|
|
618
666
|
const { children, className, ...other } = props;
|
|
619
667
|
return /* @__PURE__ */ jsx(
|
|
620
668
|
$5e8ad37a45e1c704$export$3d96ec278d3efce4,
|
|
621
669
|
{
|
|
622
670
|
...other,
|
|
623
|
-
className: clsx("es
|
|
671
|
+
className: clsx("es:mt-1.5 es:space-y-2.5 es:text-sm es:focus:outline-hidden", className),
|
|
624
672
|
children
|
|
625
673
|
}
|
|
626
674
|
);
|
|
627
675
|
};
|
|
628
|
-
|
|
676
|
+
TabPanel2.displayName = "TabPanel";
|
|
629
677
|
export {
|
|
630
678
|
Tab,
|
|
631
|
-
TabList,
|
|
632
|
-
TabPanel,
|
|
633
|
-
Tabs
|
|
679
|
+
TabList2 as TabList,
|
|
680
|
+
TabPanel2 as TabPanel,
|
|
681
|
+
Tabs2 as Tabs
|
|
634
682
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, m as $df56164dff5785e2$export$4338b53315abf666, n as $5dc95899b306f630$export$c9058316764c140e, i as $64fa3d84918910a7$export$ef03459518577ad4, b as $64fa3d84918910a7$export$4d86445c2cf5e3, d as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "../../utils-
|
|
2
|
+
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, m as $df56164dff5785e2$export$4338b53315abf666, n as $5dc95899b306f630$export$c9058316764c140e, i as $64fa3d84918910a7$export$ef03459518577ad4, b as $64fa3d84918910a7$export$4d86445c2cf5e3, d as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "../../utils-39D0mStj.js";
|
|
3
3
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
|
|
4
4
|
import React__default, { forwardRef, createContext } from "react";
|
|
5
|
-
import { $ as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../../useToggleState-
|
|
6
|
-
import { $ as $d2c8e2b0480f3f34$export$cbe85ee05b554577 } from "../../useToggle-
|
|
7
|
-
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-
|
|
8
|
-
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-
|
|
9
|
-
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "../../VisuallyHidden-
|
|
5
|
+
import { $ as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../../useToggleState-DhSBQxkp.js";
|
|
6
|
+
import { $ as $d2c8e2b0480f3f34$export$cbe85ee05b554577 } from "../../useToggle-DzlgBLAJ.js";
|
|
7
|
+
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-CGp3guTX.js";
|
|
8
|
+
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-CiqTTjWy.js";
|
|
9
|
+
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "../../VisuallyHidden-ClTQo25k.js";
|
|
10
10
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
11
11
|
function $b418ec0c85c52f27$export$d853f7095ae95f88(props, state, ref) {
|
|
12
12
|
let { labelProps, inputProps, isSelected, isPressed, isDisabled, isReadOnly } = $d2c8e2b0480f3f34$export$cbe85ee05b554577(props, state, ref);
|
|
@@ -24,7 +24,7 @@ function $b418ec0c85c52f27$export$d853f7095ae95f88(props, state, ref) {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
const $8e59e948500a8fe1$export$8699e3b644d5a28a = /* @__PURE__ */ createContext(null);
|
|
27
|
-
|
|
27
|
+
const $8e59e948500a8fe1$export$b5d5cf8927ab7262 = /* @__PURE__ */ forwardRef(function Switch(props, ref) {
|
|
28
28
|
let { inputRef: userProvidedInputRef = null, ...otherProps } = props;
|
|
29
29
|
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(otherProps, ref, $8e59e948500a8fe1$export$8699e3b644d5a28a);
|
|
30
30
|
let inputRef = $df56164dff5785e2$export$4338b53315abf666($5dc95899b306f630$export$c9058316764c140e(userProvidedInputRef, props.inputRef !== void 0 ? props.inputRef : null));
|
|
@@ -73,8 +73,7 @@ function $8e59e948500a8fe1$var$Switch(props, ref) {
|
|
|
73
73
|
...$3ef42575df84b30b$export$9d1611c77c2fe928(inputProps, focusProps),
|
|
74
74
|
ref: inputRef
|
|
75
75
|
})), renderProps.children);
|
|
76
|
-
}
|
|
77
|
-
const $8e59e948500a8fe1$export$b5d5cf8927ab7262 = /* @__PURE__ */ forwardRef($8e59e948500a8fe1$var$Switch);
|
|
76
|
+
});
|
|
78
77
|
/**
|
|
79
78
|
* A toggle switch.
|
|
80
79
|
*
|
|
@@ -100,7 +99,7 @@ const $8e59e948500a8fe1$export$b5d5cf8927ab7262 = /* @__PURE__ */ forwardRef($8e
|
|
|
100
99
|
*
|
|
101
100
|
* @preserve
|
|
102
101
|
*/
|
|
103
|
-
const
|
|
102
|
+
const Switch2 = (props) => {
|
|
104
103
|
const { checked, onChange, disabled, id, children, className, isIndeterminate, hidden } = props;
|
|
105
104
|
if (hidden) {
|
|
106
105
|
return null;
|
|
@@ -112,26 +111,33 @@ const Switch = (props) => {
|
|
|
112
111
|
isDisabled: disabled,
|
|
113
112
|
isSelected: checked ?? false,
|
|
114
113
|
onChange,
|
|
115
|
-
className: "es
|
|
114
|
+
className: "es:group es:flex es:items-center es:justify-between es:gap-2",
|
|
116
115
|
children: [
|
|
117
116
|
children,
|
|
118
|
-
/* @__PURE__ */ jsx("div", { className: clsx("es
|
|
117
|
+
/* @__PURE__ */ jsx("div", { className: clsx("es:flex es:shrink-0 es:items-center es:justify-center", className), children: /* @__PURE__ */ jsx(
|
|
119
118
|
"div",
|
|
120
119
|
{
|
|
121
120
|
className: clsx(
|
|
122
|
-
"es
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"
|
|
121
|
+
"es:shrink-0 es:cursor-pointer es:no-webkit-highlight",
|
|
122
|
+
"es:h-5 es:w-9 es:p-[0.1875rem] es:rounded-full",
|
|
123
|
+
"es:outline-hidden es:bg-radial-[circle_at_75%_50%]",
|
|
124
|
+
"es:border es:inset-ring es:inset-shadow-xs",
|
|
125
|
+
"es:transition",
|
|
126
|
+
"es:group-focus-visible:ring-2 es:group-focus-visible:ring-accent-500/50 es:focus-visible:ring-3 es:shadow-xs",
|
|
127
|
+
!checked && "es:border-secondary-400 es:inset-ring-secondary-100 es:from-white es:to-secondary-100",
|
|
128
|
+
checked && "es:border-accent-700/75 es:inset-ring-accent-500 es:to-accent-500 es:from-accent-600 es:shadow-accent-600/30",
|
|
129
|
+
disabled && "es:cursor-default es:border-secondary-300 es:bg-white"
|
|
126
130
|
),
|
|
127
131
|
children: /* @__PURE__ */ jsx(
|
|
128
132
|
"span",
|
|
129
133
|
{
|
|
130
134
|
className: clsx(
|
|
131
|
-
"es
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
|
|
135
|
+
"es:block es:size-3 es:rounded-full es:border es:will-change-transform es:bg-radial",
|
|
136
|
+
"es:transition es:motion-ease-spring-snappy es:ease-[var(--motion-spring-snappy)]",
|
|
137
|
+
!checked && "es:border-secondary-500 es:from-secondary-500 es:to-secondary-600 es:scale-95",
|
|
138
|
+
checked && "es:translate-x-4 es:border-accent-600/20 es:from-white es:to-accent-500/30 es:from-40% es:bg-white es:shadow-xs es:shadow-accent-900/60",
|
|
139
|
+
disabled && "es:border-secondary-300 es:bg-white",
|
|
140
|
+
isIndeterminate && "es:translate-x-2 es:scale-100"
|
|
135
141
|
)
|
|
136
142
|
}
|
|
137
143
|
)
|
|
@@ -142,5 +148,5 @@ const Switch = (props) => {
|
|
|
142
148
|
);
|
|
143
149
|
};
|
|
144
150
|
export {
|
|
145
|
-
Switch
|
|
151
|
+
Switch2 as Switch
|
|
146
152
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-
|
|
2
|
+
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-Ca9uelsn.js";
|
|
3
3
|
import { Switch } from "./switch.js";
|
|
4
4
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
5
5
|
/**
|