@wistia/ui 0.22.3 → 0.22.4-beta.751eafb4.c632f00
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/index.d.ts +118 -54
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +403 -314
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.22.
|
|
3
|
+
* @license @wistia/ui v0.22.4-beta.751eafb4.c632f00
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
7
7
|
* This source code is unlicensed, all rights reserved.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
|
|
11
11
|
import { Children, cloneElement, createContext, forwardRef, isValidElement, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useTransition } from "react";
|
|
12
12
|
import { createGlobalStyle, css, keyframes, styled } from "styled-components";
|
|
13
13
|
import { isArray, isBoolean, isEmptyString, isFunction, isNil, isNonEmptyArray, isNonEmptyString, isNotNil, isNotUndefined, isNumber, isRecord, isString, isUndefined } from "@wistia/type-guards";
|
|
@@ -18,23 +18,25 @@ import { useFilePicker as useFilePicker$1, useImperativeFilePicker as useImperat
|
|
|
18
18
|
import { FileAmountLimitValidator, FileSizeValidator, FileTypeValidator, ImageDimensionsValidator, PersistentFileAmountLimitValidator } from "use-file-picker/validators";
|
|
19
19
|
import { debounce, throttle } from "throttle-debounce";
|
|
20
20
|
import { Link as Link$1, useInRouterContext } from "react-router";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
21
|
+
import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
|
|
22
|
+
import { RadioGroup as RadioGroup$1 } from "@base-ui/react/radio-group";
|
|
23
23
|
import { differenceEuclidean, easingSmootherstep, formatHex, interpolate, modeHsv, modeLrgb, modeRgb, parseHex, useMode, wcagContrast } from "culori/fn";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
24
|
+
import { Radio as Radio$1 } from "@base-ui/react/radio";
|
|
25
|
+
import { ToggleGroup } from "@base-ui/react/toggle-group";
|
|
26
|
+
import { Toggle } from "@base-ui/react/toggle";
|
|
27
|
+
import { Popover as Popover$1 } from "@base-ui/react/popover";
|
|
28
|
+
import { Slider as Slider$1 } from "@base-ui/react/slider";
|
|
27
29
|
import * as Ariakit from "@ariakit/react";
|
|
28
30
|
import { matchSorter } from "match-sorter";
|
|
29
31
|
import { createPortal } from "react-dom";
|
|
30
|
-
import {
|
|
32
|
+
import { Menu as Menu$1 } from "@base-ui/react/menu";
|
|
31
33
|
import { ValidationError } from "yup";
|
|
32
|
-
import {
|
|
34
|
+
import { PreviewCard as PreviewCard$1 } from "@base-ui/react/preview-card";
|
|
33
35
|
import ReactMarkdown from "react-markdown";
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
36
|
+
import { Dialog } from "@base-ui/react/dialog";
|
|
37
|
+
import { Progress } from "@base-ui/react/progress";
|
|
38
|
+
import { Select as Select$1 } from "@base-ui/react/select";
|
|
39
|
+
import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
|
|
38
40
|
//#region src/css/globalStyleAdjustmentsCss.tsx
|
|
39
41
|
const globalStyleAdjustmentsCss = css`
|
|
40
42
|
/**
|
|
@@ -444,7 +446,7 @@ const UIProvider = ({ children }) => {
|
|
|
444
446
|
if (useContext(UIProviderNestingContext)) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
445
447
|
return /* @__PURE__ */ jsx(UIProviderNestingContext.Provider, {
|
|
446
448
|
value: true,
|
|
447
|
-
children: /* @__PURE__ */ jsx(AriaLiveProvider, { children: /* @__PURE__ */ jsxs(Provider, { children: [
|
|
449
|
+
children: /* @__PURE__ */ jsx(AriaLiveProvider, { children: /* @__PURE__ */ jsxs(Tooltip$1.Provider, { children: [
|
|
448
450
|
/* @__PURE__ */ jsx(GlobalStyle, {}),
|
|
449
451
|
children,
|
|
450
452
|
/* @__PURE__ */ jsx(ToastProvider, {})
|
|
@@ -6897,30 +6899,39 @@ const ClickRegion = ({ children, targetRef }) => {
|
|
|
6897
6899
|
ClickRegion.displayName = "ClickRegion_UI";
|
|
6898
6900
|
//#endregion
|
|
6899
6901
|
//#region src/components/Collapsible/Collapsible.tsx
|
|
6900
|
-
const StyledRoot = styled(
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6902
|
+
const StyledRoot = styled(Collapsible$1.Root)`
|
|
6903
|
+
${({ $isOpen }) => !$isOpen && css`
|
|
6904
|
+
[data-wui-collapsible-content] {
|
|
6905
|
+
display: -webkit-box;
|
|
6906
|
+
-webkit-box-orient: vertical;
|
|
6907
|
+
-webkit-line-clamp: var(--wui-collapsible-content-clamp-lines);
|
|
6908
|
+
overflow: hidden;
|
|
6909
|
+
}
|
|
6910
|
+
`}
|
|
6907
6911
|
`;
|
|
6908
6912
|
/**
|
|
6909
6913
|
* Toggle the visibility of content with a trigger.
|
|
6910
6914
|
*/
|
|
6911
6915
|
const Collapsible = ({ children, isOpen = false, onOpenChange }) => {
|
|
6916
|
+
const isControlled = isNotNil(onOpenChange);
|
|
6917
|
+
const [internalOpen, setInternalOpen] = useState(false);
|
|
6918
|
+
const handleOpenChange = (open) => {
|
|
6919
|
+
if (!isControlled) setInternalOpen(open);
|
|
6920
|
+
onOpenChange?.(open);
|
|
6921
|
+
};
|
|
6912
6922
|
return /* @__PURE__ */ jsx(StyledRoot, {
|
|
6913
|
-
|
|
6923
|
+
$isOpen: isControlled ? isOpen : internalOpen,
|
|
6924
|
+
...isControlled ? {
|
|
6914
6925
|
open: isOpen,
|
|
6915
|
-
onOpenChange
|
|
6916
|
-
} : {},
|
|
6926
|
+
onOpenChange: handleOpenChange
|
|
6927
|
+
} : { onOpenChange: handleOpenChange },
|
|
6917
6928
|
children
|
|
6918
6929
|
});
|
|
6919
6930
|
};
|
|
6920
6931
|
Collapsible.displayName = "Collapsible_UI";
|
|
6921
6932
|
//#endregion
|
|
6922
6933
|
//#region src/components/Collapsible/CollapsibleTrigger.tsx
|
|
6923
|
-
const StyledTrigger$1 = styled(
|
|
6934
|
+
const StyledTrigger$1 = styled(Collapsible$1.Trigger)`
|
|
6924
6935
|
[data-wui-collapsible-icon] {
|
|
6925
6936
|
transition: transform var(--wui-motion-duration-03) ease-in-out;
|
|
6926
6937
|
}
|
|
@@ -6943,10 +6954,7 @@ const StyledTrigger$1 = styled(Trigger$1)`
|
|
|
6943
6954
|
`;
|
|
6944
6955
|
const CollapsibleTrigger = ({ children }) => {
|
|
6945
6956
|
Children.only(children);
|
|
6946
|
-
return /* @__PURE__ */ jsx(StyledTrigger$1, {
|
|
6947
|
-
asChild: true,
|
|
6948
|
-
children
|
|
6949
|
-
});
|
|
6957
|
+
return /* @__PURE__ */ jsx(StyledTrigger$1, { render: children });
|
|
6950
6958
|
};
|
|
6951
6959
|
//#endregion
|
|
6952
6960
|
//#region src/components/Collapsible/CollapsibleTriggerIcon.tsx
|
|
@@ -6977,7 +6985,7 @@ const CollapsibleContent = ({ clamp, children }) => {
|
|
|
6977
6985
|
"data-wui-collapsible-content": "true",
|
|
6978
6986
|
children
|
|
6979
6987
|
});
|
|
6980
|
-
return /* @__PURE__ */ jsx(
|
|
6988
|
+
return /* @__PURE__ */ jsx(Collapsible$1.Panel, { children: /* @__PURE__ */ jsxs(Fragment, { children: [children, " "] }) });
|
|
6981
6989
|
};
|
|
6982
6990
|
//#endregion
|
|
6983
6991
|
//#region src/components/ColorPicker/color-conversion-utils.ts
|
|
@@ -7452,7 +7460,7 @@ const Container$9 = styled.div`
|
|
|
7452
7460
|
const LabelContainer$1 = styled.div`
|
|
7453
7461
|
padding-top: var(--wui-space-01);
|
|
7454
7462
|
`;
|
|
7455
|
-
const ItemsContainer$1 = styled(
|
|
7463
|
+
const ItemsContainer$1 = styled(RadioGroup$1)`
|
|
7456
7464
|
display: flex;
|
|
7457
7465
|
flex-wrap: wrap;
|
|
7458
7466
|
align-items: center;
|
|
@@ -7467,7 +7475,7 @@ const ItemsContainer$1 = styled(Root$2)`
|
|
|
7467
7475
|
const ColorGrid = ({ children, label }) => {
|
|
7468
7476
|
const { valueAsHex, onChangeNonDerivedValueAsHsv } = useColorPickerState();
|
|
7469
7477
|
const onValueChange = useCallback((value) => {
|
|
7470
|
-
onChangeNonDerivedValueAsHsv(convertToHsv(value));
|
|
7478
|
+
if (typeof value === "string") onChangeNonDerivedValueAsHsv(convertToHsv(value));
|
|
7471
7479
|
}, [onChangeNonDerivedValueAsHsv]);
|
|
7472
7480
|
return /* @__PURE__ */ jsxs(Container$9, { children: [label != null && /* @__PURE__ */ jsx(LabelContainer$1, { children: /* @__PURE__ */ jsx(Label, { children: label }) }), /* @__PURE__ */ jsx(ItemsContainer$1, {
|
|
7473
7481
|
onValueChange,
|
|
@@ -7565,7 +7573,7 @@ const slideRightAndFade = keyframes`
|
|
|
7565
7573
|
transform: translateX(0);
|
|
7566
7574
|
}
|
|
7567
7575
|
`;
|
|
7568
|
-
const
|
|
7576
|
+
const StyledPopup$4 = styled(Tooltip$1.Popup)`
|
|
7569
7577
|
--tooltip-font-family: var(--wui-typography-family-default);
|
|
7570
7578
|
--tooltip-border-radius: var(--wui-border-radius-05);
|
|
7571
7579
|
--tooltip-bg: var(--wui-color-bg-tooltip);
|
|
@@ -7591,27 +7599,54 @@ const StyledContent$3 = styled(Content)`
|
|
|
7591
7599
|
max-width: 30em;
|
|
7592
7600
|
z-index: var(--wui-zindex-tooltip);
|
|
7593
7601
|
|
|
7594
|
-
&[data-
|
|
7602
|
+
&[data-closed] {
|
|
7595
7603
|
animation-name: ${hide};
|
|
7596
7604
|
}
|
|
7597
7605
|
|
|
7598
|
-
&[data-
|
|
7606
|
+
&[data-open][data-side='top'] {
|
|
7599
7607
|
animation-name: ${slideUpAndFade};
|
|
7600
7608
|
}
|
|
7601
7609
|
|
|
7602
|
-
&[data-
|
|
7610
|
+
&[data-open][data-side='right'] {
|
|
7603
7611
|
animation-name: ${slideRightAndFade};
|
|
7604
7612
|
}
|
|
7605
7613
|
|
|
7606
|
-
&[data-
|
|
7614
|
+
&[data-open][data-side='bottom'] {
|
|
7607
7615
|
animation-name: ${slideDownAndFade};
|
|
7608
7616
|
}
|
|
7609
7617
|
|
|
7610
|
-
&[data-
|
|
7618
|
+
&[data-open][data-side='left'] {
|
|
7611
7619
|
animation-name: ${slideLeftAndFade};
|
|
7612
7620
|
}
|
|
7621
|
+
|
|
7622
|
+
overflow: visible;
|
|
7623
|
+
`;
|
|
7624
|
+
const arrowEdgeCss = css`
|
|
7625
|
+
&[data-side='top'] {
|
|
7626
|
+
bottom: 0;
|
|
7627
|
+
transform: translateY(calc(100% - 2px));
|
|
7628
|
+
}
|
|
7629
|
+
|
|
7630
|
+
&[data-side='bottom'] {
|
|
7631
|
+
top: 0;
|
|
7632
|
+
transform: translateY(calc(-100% + 2px)) rotate(180deg);
|
|
7633
|
+
}
|
|
7634
|
+
|
|
7635
|
+
&[data-side='left'] {
|
|
7636
|
+
right: 0;
|
|
7637
|
+
transform: translateX(calc(100% - 4px)) rotate(-90deg);
|
|
7638
|
+
}
|
|
7639
|
+
|
|
7640
|
+
&[data-side='right'] {
|
|
7641
|
+
left: 0;
|
|
7642
|
+
transform: translateX(calc(-100% + 4px)) rotate(90deg);
|
|
7643
|
+
}
|
|
7644
|
+
`;
|
|
7645
|
+
const StyledTooltipArrow = styled.svg`
|
|
7646
|
+
${arrowEdgeCss}
|
|
7613
7647
|
`;
|
|
7614
7648
|
const VISUAL_OFFSET = 6;
|
|
7649
|
+
const ARROW_EXTENSION = 6;
|
|
7615
7650
|
/**
|
|
7616
7651
|
* Tooltips are a way to provide additional information or context to a user when they hover or focus an element.
|
|
7617
7652
|
* For elements that are not interactive, consider using a [Popover]() instead.
|
|
@@ -7621,29 +7656,27 @@ const Tooltip = ({ delay = 500, direction = "top", content, children, forceOpen,
|
|
|
7621
7656
|
const rootProps = {};
|
|
7622
7657
|
if (content === "" || content === null) rootProps.open = false;
|
|
7623
7658
|
if (forceOpen === true) rootProps.open = true;
|
|
7624
|
-
return /* @__PURE__ */ jsxs(Root, {
|
|
7625
|
-
delayDuration: delay,
|
|
7659
|
+
return /* @__PURE__ */ jsxs(Tooltip$1.Root, {
|
|
7626
7660
|
...rootProps,
|
|
7627
|
-
children: [/* @__PURE__ */ jsx(Trigger, {
|
|
7628
|
-
|
|
7629
|
-
children
|
|
7630
|
-
}), /* @__PURE__ */ jsx(Portal, {
|
|
7631
|
-
container,
|
|
7632
|
-
children: /* @__PURE__ */
|
|
7661
|
+
children: [/* @__PURE__ */ jsx(Tooltip$1.Trigger, {
|
|
7662
|
+
delay,
|
|
7663
|
+
render: isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children })
|
|
7664
|
+
}), /* @__PURE__ */ jsx(Tooltip$1.Portal, {
|
|
7665
|
+
...container != null ? { container } : {},
|
|
7666
|
+
children: /* @__PURE__ */ jsx(Tooltip$1.Positioner, {
|
|
7633
7667
|
side: direction,
|
|
7634
|
-
sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET
|
|
7635
|
-
children:
|
|
7636
|
-
|
|
7637
|
-
children: /* @__PURE__ */ jsx(
|
|
7668
|
+
sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET + ARROW_EXTENSION,
|
|
7669
|
+
children: /* @__PURE__ */ jsxs(StyledPopup$4, {
|
|
7670
|
+
role: "tooltip",
|
|
7671
|
+
children: [content, !hideArrow ? /* @__PURE__ */ jsx(Tooltip$1.Arrow, { render: /* @__PURE__ */ jsx(StyledTooltipArrow, {
|
|
7638
7672
|
fill: "var(--tooltip-bg)",
|
|
7639
7673
|
height: "8",
|
|
7640
|
-
style: { transform: "translateY(-2px)" },
|
|
7641
7674
|
viewBox: "0 0 12 8",
|
|
7642
7675
|
width: "12",
|
|
7643
7676
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7644
7677
|
children: /* @__PURE__ */ jsx("path", { d: "M6.8 6.93333C6.4 7.46667 5.6 7.46667 5.2 6.93333L-2.54292e-07 -1.04907e-06L12 0L6.8 6.93333Z" })
|
|
7645
|
-
})
|
|
7646
|
-
})
|
|
7678
|
+
}) }) : null]
|
|
7679
|
+
})
|
|
7647
7680
|
})
|
|
7648
7681
|
})]
|
|
7649
7682
|
});
|
|
@@ -7651,7 +7684,7 @@ const Tooltip = ({ delay = 500, direction = "top", content, children, forceOpen,
|
|
|
7651
7684
|
Tooltip.displayName = "Tooltip_UI";
|
|
7652
7685
|
//#endregion
|
|
7653
7686
|
//#region src/components/ColorPicker/ColorGridOption.tsx
|
|
7654
|
-
const Container$8 = styled(
|
|
7687
|
+
const Container$8 = styled(Radio$1.Root)`
|
|
7655
7688
|
border: none;
|
|
7656
7689
|
appearance: none;
|
|
7657
7690
|
outline: none;
|
|
@@ -7693,7 +7726,7 @@ const ColorGridOption = ({ value: rawValue, name }) => {
|
|
|
7693
7726
|
ColorGridOption.displayName = "ColorGridOption_UI";
|
|
7694
7727
|
//#endregion
|
|
7695
7728
|
//#region src/components/ColorPicker/ColorList.tsx
|
|
7696
|
-
const Container$7 = styled(
|
|
7729
|
+
const Container$7 = styled(ToggleGroup)`
|
|
7697
7730
|
display: grid;
|
|
7698
7731
|
grid-template-columns: minmax(0, 1fr);
|
|
7699
7732
|
`;
|
|
@@ -7705,12 +7738,12 @@ const Container$7 = styled(Root$3)`
|
|
|
7705
7738
|
const ColorList = ({ children }) => {
|
|
7706
7739
|
const { valueAsHex, onChangeNonDerivedValueAsHsv } = useColorPickerState();
|
|
7707
7740
|
return /* @__PURE__ */ jsx(Container$7, {
|
|
7708
|
-
onValueChange: useCallback((
|
|
7709
|
-
|
|
7741
|
+
onValueChange: useCallback((newValue) => {
|
|
7742
|
+
const value = newValue[0];
|
|
7743
|
+
if (value === void 0 || value === "") return;
|
|
7710
7744
|
onChangeNonDerivedValueAsHsv(convertToHsv(value));
|
|
7711
7745
|
}, [onChangeNonDerivedValueAsHsv]),
|
|
7712
|
-
|
|
7713
|
-
value: valueAsHex,
|
|
7746
|
+
value: [valueAsHex],
|
|
7714
7747
|
children
|
|
7715
7748
|
});
|
|
7716
7749
|
};
|
|
@@ -7762,7 +7795,7 @@ const ColorNameOrHexCode = ({ name, hexCode }) => {
|
|
|
7762
7795
|
};
|
|
7763
7796
|
//#endregion
|
|
7764
7797
|
//#region src/components/ColorPicker/ColorListOption.tsx
|
|
7765
|
-
const Container$5 = styled(
|
|
7798
|
+
const Container$5 = styled(Toggle)`
|
|
7766
7799
|
border: none;
|
|
7767
7800
|
appearance: none;
|
|
7768
7801
|
outline: none;
|
|
@@ -7823,14 +7856,15 @@ ColorListOption.displayName = "ColorListOption_UI";
|
|
|
7823
7856
|
* sensible defaults (brand colors, contrast controls, popover/inline modes).
|
|
7824
7857
|
*/
|
|
7825
7858
|
const ColorPicker = ({ children, colorForComparison = DEFAULT_COLOR_FOR_COMPARISON, minimumContrastRatio = DEFAULT_MIN_CONTRAST, opacityForContrastCalculation = 1, onValueChange, value }) => {
|
|
7826
|
-
|
|
7859
|
+
const normalizedValue = value.startsWith("#") ? value.toLocaleLowerCase() : `#${value.toLocaleLowerCase()}`;
|
|
7860
|
+
return /* @__PURE__ */ jsx(Popover$1.Root, {
|
|
7827
7861
|
modal: false,
|
|
7828
7862
|
children: /* @__PURE__ */ jsx(ColorPickerProvider, {
|
|
7829
7863
|
colorForComparison,
|
|
7830
7864
|
minimumContrastRatio,
|
|
7831
7865
|
onValueChange,
|
|
7832
7866
|
opacityForContrastCalculation,
|
|
7833
|
-
value:
|
|
7867
|
+
value: normalizedValue,
|
|
7834
7868
|
children
|
|
7835
7869
|
})
|
|
7836
7870
|
});
|
|
@@ -7838,7 +7872,7 @@ const ColorPicker = ({ children, colorForComparison = DEFAULT_COLOR_FOR_COMPARIS
|
|
|
7838
7872
|
ColorPicker.displayName = "ColorPicker_UI";
|
|
7839
7873
|
//#endregion
|
|
7840
7874
|
//#region src/components/ColorPicker/ColorPickerPopoverContent.tsx
|
|
7841
|
-
const
|
|
7875
|
+
const StyledPopup$3 = styled(Popover$1.Popup)`
|
|
7842
7876
|
background-color: var(--wui-color-bg-surface);
|
|
7843
7877
|
border-radius: var(--wui-border-radius-02);
|
|
7844
7878
|
border: 1px solid var(--wui-color-border);
|
|
@@ -7855,10 +7889,10 @@ const StyledPopoverContent = styled(Content$2)`
|
|
|
7855
7889
|
* Use `ColorPickerSection` to organize content within it.
|
|
7856
7890
|
*/
|
|
7857
7891
|
const ColorPickerPopoverContent = ({ children }) => {
|
|
7858
|
-
return /* @__PURE__ */ jsx(
|
|
7892
|
+
return /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(Popover$1.Positioner, {
|
|
7859
7893
|
align: "start",
|
|
7860
7894
|
sideOffset: 4,
|
|
7861
|
-
children
|
|
7895
|
+
children: /* @__PURE__ */ jsx(StyledPopup$3, { children })
|
|
7862
7896
|
}) });
|
|
7863
7897
|
};
|
|
7864
7898
|
ColorPickerPopoverContent.displayName = "ColorPickerPopoverContent_UI";
|
|
@@ -7905,16 +7939,33 @@ const ValueNameOrHexCode = (props) => {
|
|
|
7905
7939
|
ValueNameOrHexCode.displayName = "ValueNameOrHexCode_UI";
|
|
7906
7940
|
//#endregion
|
|
7907
7941
|
//#region src/components/ColorPicker/ColorPickerTrigger.tsx
|
|
7908
|
-
const StyledPopoverTrigger = styled(Trigger
|
|
7942
|
+
const StyledPopoverTrigger = styled(Popover$1.Trigger)`
|
|
7909
7943
|
background-color: var(--wui-color-bg-surface);
|
|
7910
7944
|
border-radius: var(--wui-border-radius-rounded);
|
|
7911
|
-
border:
|
|
7945
|
+
border: none;
|
|
7946
|
+
outline: 1px solid var(--wui-color-border);
|
|
7947
|
+
outline-offset: -1px;
|
|
7912
7948
|
padding: var(--wui-space-01);
|
|
7913
7949
|
transition: background-color var(--wui-motion-duration-03) var(--wui-motion-ease);
|
|
7914
7950
|
|
|
7915
7951
|
&:hover {
|
|
7916
7952
|
background-color: var(--wui-color-bg-surface-hover);
|
|
7917
7953
|
}
|
|
7954
|
+
|
|
7955
|
+
&:focus {
|
|
7956
|
+
outline-width: 2px;
|
|
7957
|
+
outline-color: var(--wui-color-focus-ring);
|
|
7958
|
+
outline-offset: -2px;
|
|
7959
|
+
}
|
|
7960
|
+
|
|
7961
|
+
&[aria-invalid='true'] {
|
|
7962
|
+
outline-color: var(--wui-color-invalid-indicator);
|
|
7963
|
+
}
|
|
7964
|
+
|
|
7965
|
+
&:disabled {
|
|
7966
|
+
outline-color: var(--wui-color-border-disabled);
|
|
7967
|
+
background-color: var(--wui-color-bg-surface-disabled);
|
|
7968
|
+
}
|
|
7918
7969
|
`;
|
|
7919
7970
|
const DefaultTriggerContentContainer = styled.div`
|
|
7920
7971
|
align-items: center;
|
|
@@ -8534,7 +8585,7 @@ const Container$2 = styled.div`
|
|
|
8534
8585
|
padding: 0 var(--wui-space-03);
|
|
8535
8586
|
position: relative;
|
|
8536
8587
|
`;
|
|
8537
|
-
const Root
|
|
8588
|
+
const Root = styled(Slider$1.Root)`
|
|
8538
8589
|
align-items: center;
|
|
8539
8590
|
display: flex;
|
|
8540
8591
|
position: absolute;
|
|
@@ -8543,10 +8594,10 @@ const Root$11 = styled(Root$5)`
|
|
|
8543
8594
|
width: calc(100% - var(--wui-space-05));
|
|
8544
8595
|
height: 16px;
|
|
8545
8596
|
`;
|
|
8546
|
-
const Track
|
|
8597
|
+
const Track = styled(Slider$1.Track)`
|
|
8547
8598
|
width: 100%;
|
|
8548
8599
|
`;
|
|
8549
|
-
const Thumb$
|
|
8600
|
+
const Thumb$1 = styled(Slider$1.Thumb)`
|
|
8550
8601
|
position: relative;
|
|
8551
8602
|
`;
|
|
8552
8603
|
const ThumbInner = styled.div`
|
|
@@ -8561,7 +8612,7 @@ const ThumbInner = styled.div`
|
|
|
8561
8612
|
transform: translate(-50%, -50%);
|
|
8562
8613
|
width: 16px;
|
|
8563
8614
|
|
|
8564
|
-
${Thumb$
|
|
8615
|
+
${Thumb$1}:focus-visible > & {
|
|
8565
8616
|
box-shadow:
|
|
8566
8617
|
inset 0 0 0 2px var(--wui-color-border),
|
|
8567
8618
|
inset 0 0 0 3px black;
|
|
@@ -8586,7 +8637,7 @@ const HueSlider = (props) => {
|
|
|
8586
8637
|
return { backgroundColor: formatHex(valueAsHsv) };
|
|
8587
8638
|
}, [valueAsHsv]);
|
|
8588
8639
|
const onHueChange = useCallback((values) => {
|
|
8589
|
-
const newHue = values[0] ?? 0;
|
|
8640
|
+
const newHue = typeof values === "number" ? values : values[0] ?? 0;
|
|
8590
8641
|
onChangeNonDerivedValueAsHsv({
|
|
8591
8642
|
...nonDerivedValueAsHsv,
|
|
8592
8643
|
h: newHue
|
|
@@ -8595,17 +8646,17 @@ const HueSlider = (props) => {
|
|
|
8595
8646
|
return /* @__PURE__ */ jsxs(Container$2, {
|
|
8596
8647
|
...props,
|
|
8597
8648
|
style: containerStyle,
|
|
8598
|
-
children: [/* @__PURE__ */
|
|
8649
|
+
children: [/* @__PURE__ */ jsx(Root, {
|
|
8599
8650
|
max: 360,
|
|
8600
8651
|
min: 0,
|
|
8601
8652
|
onValueChange: onHueChange,
|
|
8602
8653
|
orientation: "horizontal",
|
|
8603
8654
|
step: 1,
|
|
8604
8655
|
value: [nonDerivedValueAsHsv.h ?? 0],
|
|
8605
|
-
children: [/* @__PURE__ */ jsx(Track
|
|
8656
|
+
children: /* @__PURE__ */ jsxs(Slider$1.Control, { children: [/* @__PURE__ */ jsx(Track, {}), /* @__PURE__ */ jsx(Thumb$1, {
|
|
8606
8657
|
"aria-label": "Hue slider",
|
|
8607
8658
|
children: /* @__PURE__ */ jsx(ThumbInner, { style: thumbInnerStyle })
|
|
8608
|
-
})]
|
|
8659
|
+
})] })
|
|
8609
8660
|
}), /* @__PURE__ */ jsx(HSVHueCanvas, { hsv: valueAsHsv })]
|
|
8610
8661
|
});
|
|
8611
8662
|
};
|
|
@@ -8735,7 +8786,7 @@ const Container$1 = styled.div`
|
|
|
8735
8786
|
overflow: hidden;
|
|
8736
8787
|
position: relative;
|
|
8737
8788
|
`;
|
|
8738
|
-
const Thumb
|
|
8789
|
+
const Thumb = styled.button.attrs({ type: "button" })`
|
|
8739
8790
|
appearance: none;
|
|
8740
8791
|
border-radius: var(--wui-border-radius-rounded);
|
|
8741
8792
|
border: none;
|
|
@@ -8870,7 +8921,7 @@ const SaturationAndValuePicker = ({ dataTestId }) => {
|
|
|
8870
8921
|
"data-testid": dataTestId,
|
|
8871
8922
|
onMouseDown: onContainerMouseDown,
|
|
8872
8923
|
children: [
|
|
8873
|
-
/* @__PURE__ */ jsx(Thumb
|
|
8924
|
+
/* @__PURE__ */ jsx(Thumb, {
|
|
8874
8925
|
ref: thumbRef,
|
|
8875
8926
|
"aria-describedby": instructionsId,
|
|
8876
8927
|
"aria-label": "Saturation and value thumb",
|
|
@@ -9335,18 +9386,18 @@ const menuContentCss = css`
|
|
|
9335
9386
|
font-family: var(--menu-font-family);
|
|
9336
9387
|
background: var(--menu-bg);
|
|
9337
9388
|
border-radius: var(--menu-border-radius);
|
|
9338
|
-
box-shadow: var(--menu-shadow);
|
|
9339
|
-
max-height: var(--
|
|
9389
|
+
box-shadow: var(--menu-shadow);
|
|
9390
|
+
max-height: var(--available-height);
|
|
9340
9391
|
min-width: var(--menu-min-width);
|
|
9341
9392
|
max-width: var(--menu-max-width);
|
|
9342
9393
|
overflow: auto;
|
|
9343
9394
|
padding: var(--menu-padding);
|
|
9344
|
-
transform-origin: var(--
|
|
9395
|
+
transform-origin: var(--transform-origin);
|
|
9345
9396
|
z-index: var(--wui-zindex-menu);
|
|
9346
9397
|
border: 1px solid var(--wui-color-border);
|
|
9347
9398
|
|
|
9348
|
-
&[data-
|
|
9349
|
-
animation: var(--menu-animation-duration) var(--wui-motion-ease-in) ${close};
|
|
9399
|
+
&[data-closed] {
|
|
9400
|
+
animation: var(--menu-animation-duration) var(--wui-motion-ease-in) ${close};
|
|
9350
9401
|
}
|
|
9351
9402
|
|
|
9352
9403
|
${mq.smAndUp} {
|
|
@@ -9361,18 +9412,21 @@ const menuContentCss = css`
|
|
|
9361
9412
|
margin: var(--menu-divider-margin) 0;
|
|
9362
9413
|
}
|
|
9363
9414
|
`;
|
|
9364
|
-
const
|
|
9415
|
+
const MenuPopup = styled(Menu$1.Popup)`
|
|
9365
9416
|
${menuContentCss}
|
|
9366
|
-
min-width: var(--
|
|
9417
|
+
min-width: var(--anchor-width);
|
|
9367
9418
|
`;
|
|
9368
9419
|
/**
|
|
9369
9420
|
* Displays a menu to the users with a set of actions.
|
|
9370
9421
|
*/
|
|
9371
9422
|
const Menu = forwardRef(({ align = "start", children, disabled = false, compact = false, trigger, label, isOpen, side = "bottom", triggerProps = {}, onOpenChange, ...props }, ref) => {
|
|
9372
9423
|
const contextValue = useMemo(() => ({ compact }), [compact]);
|
|
9424
|
+
const handleOpenChange = useCallback((nextOpen) => {
|
|
9425
|
+
if (nextOpen !== isOpen) onOpenChange?.(nextOpen);
|
|
9426
|
+
}, [isOpen, onOpenChange]);
|
|
9373
9427
|
let controlProps = { ...isNotNil(onOpenChange) && isNotNil(isOpen) ? {
|
|
9374
9428
|
open: isOpen,
|
|
9375
|
-
onOpenChange
|
|
9429
|
+
onOpenChange: handleOpenChange
|
|
9376
9430
|
} : {} };
|
|
9377
9431
|
if (disabled) controlProps = {
|
|
9378
9432
|
open: false,
|
|
@@ -9380,50 +9434,43 @@ const Menu = forwardRef(({ align = "start", children, disabled = false, compact
|
|
|
9380
9434
|
};
|
|
9381
9435
|
return /* @__PURE__ */ jsx(MenuContext.Provider, {
|
|
9382
9436
|
value: contextValue,
|
|
9383
|
-
children: /* @__PURE__ */ jsxs(
|
|
9437
|
+
children: /* @__PURE__ */ jsxs(Menu$1.Root, {
|
|
9384
9438
|
modal: false,
|
|
9385
9439
|
...controlProps,
|
|
9386
|
-
children: [/* @__PURE__ */ jsx(
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
...triggerProps,
|
|
9395
|
-
children: label
|
|
9396
|
-
})
|
|
9397
|
-
}), /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(MenuContent, {
|
|
9398
|
-
...props,
|
|
9399
|
-
$compact: compact,
|
|
9440
|
+
children: [/* @__PURE__ */ jsx(Menu$1.Trigger, { render: isNotUndefined(trigger) ? trigger : /* @__PURE__ */ jsx(Button, {
|
|
9441
|
+
ref,
|
|
9442
|
+
disabled,
|
|
9443
|
+
forceState: isOpen ? "active" : void 0,
|
|
9444
|
+
rightIcon: /* @__PURE__ */ jsx(Icon, { type: "caret-down" }),
|
|
9445
|
+
...triggerProps,
|
|
9446
|
+
children: label
|
|
9447
|
+
}) }), /* @__PURE__ */ jsx(Menu$1.Portal, { children: /* @__PURE__ */ jsx(Menu$1.Positioner, {
|
|
9400
9448
|
align,
|
|
9401
9449
|
collisionPadding: 8,
|
|
9402
|
-
onFocusOutside: (event) => {
|
|
9403
|
-
event.preventDefault();
|
|
9404
|
-
},
|
|
9405
9450
|
side,
|
|
9406
9451
|
sideOffset: 6,
|
|
9407
|
-
children
|
|
9452
|
+
children: /* @__PURE__ */ jsx(MenuPopup, {
|
|
9453
|
+
...props,
|
|
9454
|
+
$compact: compact,
|
|
9455
|
+
children
|
|
9456
|
+
})
|
|
9408
9457
|
}) })]
|
|
9409
9458
|
})
|
|
9410
9459
|
});
|
|
9411
9460
|
});
|
|
9412
9461
|
Menu.displayName = "Menu_UI";
|
|
9413
|
-
Menu.displayName = "Menu_UI";
|
|
9414
9462
|
//#endregion
|
|
9415
9463
|
//#region src/components/Menu/MenuLabel.tsx
|
|
9416
|
-
const StyledMenuLabel = styled
|
|
9464
|
+
const StyledMenuLabel = styled.div`
|
|
9417
9465
|
padding: var(--wui-space-02);
|
|
9418
9466
|
`;
|
|
9419
9467
|
const MenuLabel = ({ children, ...props }) => {
|
|
9420
9468
|
return /* @__PURE__ */ jsx(StyledMenuLabel, {
|
|
9421
|
-
|
|
9469
|
+
role: "group",
|
|
9422
9470
|
...props,
|
|
9423
9471
|
children: /* @__PURE__ */ jsx(Heading, {
|
|
9424
9472
|
renderAs: "span",
|
|
9425
9473
|
variant: "heading6",
|
|
9426
|
-
...props,
|
|
9427
9474
|
children
|
|
9428
9475
|
})
|
|
9429
9476
|
});
|
|
@@ -9554,7 +9601,7 @@ const MenuItemDescription = ({ children }) => {
|
|
|
9554
9601
|
};
|
|
9555
9602
|
//#endregion
|
|
9556
9603
|
//#region src/components/Menu/SubMenu.tsx
|
|
9557
|
-
const
|
|
9604
|
+
const SubMenuPopup = styled(Menu$1.Popup)`
|
|
9558
9605
|
${menuContentCss}
|
|
9559
9606
|
|
|
9560
9607
|
${mq.smAndDown} {
|
|
@@ -9564,19 +9611,19 @@ const SubMenuContent = styled(DropdownMenuSubContent)`
|
|
|
9564
9611
|
const StyledMobileSubMenuItems = styled.div`
|
|
9565
9612
|
margin-left: var(--wui-space-04);
|
|
9566
9613
|
`;
|
|
9567
|
-
const StyledSubTrigger = styled(
|
|
9614
|
+
const StyledSubTrigger = styled(Menu$1.SubmenuTrigger)`
|
|
9568
9615
|
outline: none;
|
|
9569
9616
|
|
|
9570
|
-
&[data-
|
|
9617
|
+
&[data-popup-open],
|
|
9571
9618
|
&[data-highlighted] {
|
|
9572
9619
|
background-color: var(--wui-color-bg-surface-hover);
|
|
9573
9620
|
}
|
|
9574
9621
|
`;
|
|
9575
9622
|
const SubMenuTrigger = ({ icon, ...props }) => {
|
|
9576
9623
|
const { isSmAndUp } = useMq();
|
|
9577
|
-
return /* @__PURE__ */ jsx(isSmAndUp ? StyledSubTrigger :
|
|
9578
|
-
|
|
9579
|
-
|
|
9624
|
+
return /* @__PURE__ */ jsx(isSmAndUp ? StyledSubTrigger : Menu$1.Item, {
|
|
9625
|
+
nativeButton: true,
|
|
9626
|
+
render: /* @__PURE__ */ jsx(MenuItemButton, {
|
|
9580
9627
|
...props,
|
|
9581
9628
|
leftIcon: icon,
|
|
9582
9629
|
rightIcon: /* @__PURE__ */ jsx(Icon, { type: "caret-right" })
|
|
@@ -9587,16 +9634,16 @@ const SubMenu = ({ label, description, children, onOpenChange = () => null, ...p
|
|
|
9587
9634
|
const { isSmAndUp } = useMq();
|
|
9588
9635
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
9589
9636
|
const { compact } = useMenuContext();
|
|
9590
|
-
return isSmAndUp ? /* @__PURE__ */ jsxs(
|
|
9637
|
+
return isSmAndUp ? /* @__PURE__ */ jsxs(Menu$1.SubmenuRoot, {
|
|
9591
9638
|
onOpenChange,
|
|
9592
9639
|
children: [/* @__PURE__ */ jsxs(SubMenuTrigger, {
|
|
9593
9640
|
...props,
|
|
9594
9641
|
children: [/* @__PURE__ */ jsx(MenuItemLabel, { children: label }), isNotNil(description) ? /* @__PURE__ */ jsx(MenuItemDescription, { children: description }) : null]
|
|
9595
|
-
}), /* @__PURE__ */ jsx(
|
|
9642
|
+
}), /* @__PURE__ */ jsx(Menu$1.Portal, { children: /* @__PURE__ */ jsx(Menu$1.Positioner, { children: /* @__PURE__ */ jsx(SubMenuPopup, {
|
|
9596
9643
|
$compact: compact,
|
|
9597
9644
|
children
|
|
9598
|
-
}) })]
|
|
9599
|
-
}) : /* @__PURE__ */ jsxs(
|
|
9645
|
+
}) }) })]
|
|
9646
|
+
}) : /* @__PURE__ */ jsxs(Menu$1.Group, { children: [/* @__PURE__ */ jsxs(SubMenuTrigger, {
|
|
9600
9647
|
...props,
|
|
9601
9648
|
onClick: (event) => {
|
|
9602
9649
|
event.preventDefault();
|
|
@@ -9608,11 +9655,12 @@ const SubMenu = ({ label, description, children, onOpenChange = () => null, ...p
|
|
|
9608
9655
|
SubMenu.displayName = "SubMenu_UI";
|
|
9609
9656
|
//#endregion
|
|
9610
9657
|
//#region src/components/Menu/MenuItem.tsx
|
|
9611
|
-
const MenuItem = forwardRef(({ onSelect = () => null, ...props }, ref) => {
|
|
9612
|
-
return /* @__PURE__ */ jsx(
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
|
|
9658
|
+
const MenuItem = forwardRef(({ onSelect = () => null, closeOnClick = true, ...props }, ref) => {
|
|
9659
|
+
return /* @__PURE__ */ jsx(Menu$1.Item, {
|
|
9660
|
+
closeOnClick,
|
|
9661
|
+
nativeButton: isNil(props.href),
|
|
9662
|
+
onClick: onSelect,
|
|
9663
|
+
render: /* @__PURE__ */ jsx(MenuItemButton, {
|
|
9616
9664
|
...props,
|
|
9617
9665
|
ref,
|
|
9618
9666
|
leftIcon: props.icon
|
|
@@ -9623,7 +9671,7 @@ MenuItem.displayName = "MenuItem_UI";
|
|
|
9623
9671
|
//#endregion
|
|
9624
9672
|
//#region src/components/Menu/MenuRadioGroup.tsx
|
|
9625
9673
|
const MenuRadioGroup = ({ children, ...props }) => {
|
|
9626
|
-
return /* @__PURE__ */ jsx(
|
|
9674
|
+
return /* @__PURE__ */ jsx(Menu$1.RadioGroup, {
|
|
9627
9675
|
...props,
|
|
9628
9676
|
children
|
|
9629
9677
|
});
|
|
@@ -9635,14 +9683,16 @@ const RadioMenuItem = ({ onSelect, value, indicator = /* @__PURE__ */ jsx(Icon,
|
|
|
9635
9683
|
size: "sm",
|
|
9636
9684
|
type: "checkmark"
|
|
9637
9685
|
}), ...props }) => {
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
|
|
9686
|
+
const extraProps = onSelect ? { onClick: onSelect } : {};
|
|
9687
|
+
return /* @__PURE__ */ jsx(Menu$1.RadioItem, {
|
|
9688
|
+
closeOnClick: false,
|
|
9689
|
+
nativeButton: true,
|
|
9690
|
+
...extraProps,
|
|
9691
|
+
render: /* @__PURE__ */ jsx(MenuItemButton, {
|
|
9643
9692
|
...props,
|
|
9644
|
-
rightIcon: /* @__PURE__ */ jsx(
|
|
9645
|
-
})
|
|
9693
|
+
rightIcon: /* @__PURE__ */ jsx(Menu$1.RadioItemIndicator, { children: indicator })
|
|
9694
|
+
}),
|
|
9695
|
+
value
|
|
9646
9696
|
});
|
|
9647
9697
|
};
|
|
9648
9698
|
RadioMenuItem.displayName = "RadioMenuItem_UI";
|
|
@@ -9680,15 +9730,16 @@ const CheckboxIndicator = ({ checked, ...props }) => {
|
|
|
9680
9730
|
});
|
|
9681
9731
|
};
|
|
9682
9732
|
const CheckboxMenuItem = ({ onSelect = () => null, checked, onCheckedChange, ...props }) => {
|
|
9683
|
-
return /* @__PURE__ */ jsx(
|
|
9684
|
-
asChild: true,
|
|
9733
|
+
return /* @__PURE__ */ jsx(Menu$1.CheckboxItem, {
|
|
9685
9734
|
checked,
|
|
9735
|
+
closeOnClick: false,
|
|
9736
|
+
nativeButton: true,
|
|
9686
9737
|
onCheckedChange,
|
|
9687
|
-
onSelect,
|
|
9688
|
-
|
|
9738
|
+
onClick: onSelect,
|
|
9739
|
+
render: /* @__PURE__ */ jsx(MenuItemButton, {
|
|
9689
9740
|
...props,
|
|
9690
9741
|
leftIcon: isNotNil(props.icon) ? props.icon : /* @__PURE__ */ jsx(CheckboxIndicator, { checked }),
|
|
9691
|
-
rightIcon: isNotNil(props.icon) ? /* @__PURE__ */ jsx(
|
|
9742
|
+
rightIcon: isNotNil(props.icon) ? /* @__PURE__ */ jsx(Menu$1.CheckboxItemIndicator, { children: /* @__PURE__ */ jsx(Icon, { type: "checkmark" }) }) : void 0
|
|
9692
9743
|
})
|
|
9693
9744
|
});
|
|
9694
9745
|
};
|
|
@@ -9742,7 +9793,7 @@ const FilterMenu = forwardRef(({ value, onChange, searchValue, onSearchValueChan
|
|
|
9742
9793
|
disabled: true,
|
|
9743
9794
|
children: "No results found"
|
|
9744
9795
|
}),
|
|
9745
|
-
value.length > 0 && /* @__PURE__ */ jsx(
|
|
9796
|
+
value.length > 0 && /* @__PURE__ */ jsx(Menu$1.Item, {
|
|
9746
9797
|
disabled: true,
|
|
9747
9798
|
style: { marginTop: "24px" },
|
|
9748
9799
|
children: /* @__PURE__ */ jsx(Card, {
|
|
@@ -11263,21 +11314,21 @@ const previewCardClose = keyframes`
|
|
|
11263
11314
|
transform: scale(0.96);
|
|
11264
11315
|
}
|
|
11265
11316
|
`;
|
|
11266
|
-
const
|
|
11317
|
+
const StyledPopup$2 = styled(PreviewCard$1.Popup)`
|
|
11267
11318
|
--preview-card-animation-duration: var(--wui-motion-duration-03);
|
|
11268
11319
|
--preview-card-animation-ease: var(--wui-motion-ease-out);
|
|
11269
11320
|
|
|
11270
11321
|
z-index: var(--wui-zindex-popover);
|
|
11271
|
-
transform-origin: var(--
|
|
11322
|
+
transform-origin: var(--transform-origin);
|
|
11272
11323
|
animation-duration: var(--preview-card-animation-duration);
|
|
11273
11324
|
animation-timing-function: var(--preview-card-animation-ease);
|
|
11274
11325
|
will-change: transform, opacity;
|
|
11275
11326
|
|
|
11276
|
-
&[data-
|
|
11327
|
+
&[data-open] {
|
|
11277
11328
|
animation-name: ${previewCardOpen};
|
|
11278
11329
|
}
|
|
11279
11330
|
|
|
11280
|
-
&[data-
|
|
11331
|
+
&[data-closed] {
|
|
11281
11332
|
animation-name: ${previewCardClose};
|
|
11282
11333
|
}
|
|
11283
11334
|
|
|
@@ -11296,28 +11347,31 @@ const StyledContent$2 = styled(Content$3)`
|
|
|
11296
11347
|
/**
|
|
11297
11348
|
* Preview cards reveal content on hover. **Everything in the card must also exist at the destination**—never put information only in the preview. This pattern is for sighted-only, so treat the card as a preview, not a source of truth.
|
|
11298
11349
|
*/
|
|
11299
|
-
const PreviewCard = ({ children, trigger, maxWidth = "320px", maxHeight = "auto", unstyled = false, paddingSize = "space-04", openDelay = 700, closeDelay = 300, colorScheme = "inherit", forceOpen, ...props }) => {
|
|
11350
|
+
const PreviewCard = ({ children, trigger, maxWidth = "320px", maxHeight = "auto", unstyled = false, paddingSize = "space-04", openDelay = 700, closeDelay = 300, colorScheme = "inherit", forceOpen, side, align, ...props }) => {
|
|
11300
11351
|
const style = {
|
|
11301
11352
|
"--wui-preview-card-max-width": maxWidth,
|
|
11302
11353
|
"--wui-preview-card-max-height": maxHeight
|
|
11303
11354
|
};
|
|
11304
11355
|
const rootProps = {};
|
|
11305
11356
|
if (forceOpen === true) rootProps.open = true;
|
|
11306
|
-
return /* @__PURE__ */ jsxs(Root
|
|
11307
|
-
closeDelay,
|
|
11308
|
-
openDelay,
|
|
11357
|
+
return /* @__PURE__ */ jsxs(PreviewCard$1.Root, {
|
|
11309
11358
|
...rootProps,
|
|
11310
|
-
children: [/* @__PURE__ */ jsx(Trigger
|
|
11311
|
-
|
|
11312
|
-
|
|
11313
|
-
|
|
11314
|
-
|
|
11315
|
-
|
|
11359
|
+
children: [/* @__PURE__ */ jsx(PreviewCard$1.Trigger, {
|
|
11360
|
+
closeDelay,
|
|
11361
|
+
delay: openDelay,
|
|
11362
|
+
render: trigger
|
|
11363
|
+
}), /* @__PURE__ */ jsx(PreviewCard$1.Portal, { children: /* @__PURE__ */ jsx(PreviewCard$1.Positioner, {
|
|
11364
|
+
align,
|
|
11365
|
+
side,
|
|
11316
11366
|
sideOffset: 8,
|
|
11317
|
-
|
|
11318
|
-
|
|
11319
|
-
|
|
11320
|
-
|
|
11367
|
+
children: /* @__PURE__ */ jsx(StyledPopup$2, {
|
|
11368
|
+
$colorScheme: colorScheme,
|
|
11369
|
+
$paddingSize: paddingSize,
|
|
11370
|
+
...props,
|
|
11371
|
+
$unstyled: unstyled,
|
|
11372
|
+
style,
|
|
11373
|
+
children: /* @__PURE__ */ jsx("div", { children })
|
|
11374
|
+
})
|
|
11321
11375
|
}) })]
|
|
11322
11376
|
});
|
|
11323
11377
|
};
|
|
@@ -11510,7 +11564,7 @@ const StyledKey = styled.kbd`
|
|
|
11510
11564
|
min-width: 20px;
|
|
11511
11565
|
padding: 0 var(--wui-space-01);
|
|
11512
11566
|
`;
|
|
11513
|
-
const Label$
|
|
11567
|
+
const Label$1 = styled.span`
|
|
11514
11568
|
color: var(--wui-color-text);
|
|
11515
11569
|
font-size: 12px;
|
|
11516
11570
|
`;
|
|
@@ -11544,7 +11598,7 @@ const keyToString = (key) => {
|
|
|
11544
11598
|
const KeyboardShortcut = ({ label, keyboardKeys, fullWidth = false, ...otherProps }) => /* @__PURE__ */ jsxs(StyledKeyboardShortcut, {
|
|
11545
11599
|
$fullWidth: fullWidth,
|
|
11546
11600
|
...otherProps,
|
|
11547
|
-
children: [isNotNil(label) && /* @__PURE__ */ jsx(Label$
|
|
11601
|
+
children: [isNotNil(label) && /* @__PURE__ */ jsx(Label$1, { children: label }), /* @__PURE__ */ jsx(KeysContainer, { children: (Array.isArray(keyboardKeys) ? keyboardKeys : [keyboardKeys]).map((keyboardKey, index) => /* @__PURE__ */ jsx(StyledKey, { children: keyToString(keyboardKey) }, index)) })]
|
|
11548
11602
|
});
|
|
11549
11603
|
KeyboardShortcut.displayName = "KeyboardShortcut_UI";
|
|
11550
11604
|
//#endregion
|
|
@@ -11992,19 +12046,14 @@ const Meter = ({ segments, label, labelMeta, description, hideKey = false, max =
|
|
|
11992
12046
|
Meter.displayName = "Meter_UI";
|
|
11993
12047
|
//#endregion
|
|
11994
12048
|
//#region src/components/Modal/ModalCloseButton.tsx
|
|
11995
|
-
const CloseButton = styled(Close$1)`
|
|
11996
|
-
align-self: start;
|
|
11997
|
-
`;
|
|
11998
12049
|
const ModalCloseButton = () => {
|
|
11999
|
-
return /* @__PURE__ */ jsx(
|
|
12000
|
-
|
|
12001
|
-
|
|
12002
|
-
|
|
12003
|
-
|
|
12004
|
-
|
|
12005
|
-
|
|
12006
|
-
})
|
|
12007
|
-
});
|
|
12050
|
+
return /* @__PURE__ */ jsx(Dialog.Close, { render: /* @__PURE__ */ jsx(IconButton, {
|
|
12051
|
+
label: "Dismiss modal",
|
|
12052
|
+
size: "sm",
|
|
12053
|
+
style: { alignSelf: "start" },
|
|
12054
|
+
variant: "ghost",
|
|
12055
|
+
children: /* @__PURE__ */ jsx(Icon, { type: "close" })
|
|
12056
|
+
}) });
|
|
12008
12057
|
};
|
|
12009
12058
|
//#endregion
|
|
12010
12059
|
//#region src/components/Modal/ModalHeader.tsx
|
|
@@ -12016,7 +12065,7 @@ const Header = styled.header`
|
|
|
12016
12065
|
gap: var(--wui-space-01);
|
|
12017
12066
|
justify-content: ${({ $hideTitle }) => $hideTitle ? "flex-end" : "space-between"}; /* ensure ModalCloseButton is right-aligned */
|
|
12018
12067
|
|
|
12019
|
-
/*
|
|
12068
|
+
/* Dialog.Title creates an h2 element which inherits some margin */
|
|
12020
12069
|
h2 {
|
|
12021
12070
|
margin: 0;
|
|
12022
12071
|
padding-right: ${({ $hideCloseButon }) => $hideCloseButon ? "0" : "var(--wui-space-03)"};
|
|
@@ -12028,7 +12077,7 @@ const Header = styled.header`
|
|
|
12028
12077
|
top: var(--wui-space-03);
|
|
12029
12078
|
}
|
|
12030
12079
|
`;
|
|
12031
|
-
const Title
|
|
12080
|
+
const Title = styled(Dialog.Title)`
|
|
12032
12081
|
font-family: var(--wui-typography-heading-2-family);
|
|
12033
12082
|
line-height: var(--wui-typography-heading-2-line-height);
|
|
12034
12083
|
font-size: var(--wui-typography-heading-2-size);
|
|
@@ -12039,7 +12088,7 @@ const ModalHeader = ({ title, hideTitle, hideCloseButton }) => {
|
|
|
12039
12088
|
return /* @__PURE__ */ jsxs(Header, {
|
|
12040
12089
|
$hideCloseButon: hideCloseButton,
|
|
12041
12090
|
$hideTitle: hideTitle,
|
|
12042
|
-
children: [hideTitle ? /* @__PURE__ */ jsx(ScreenReaderOnly, { children: /* @__PURE__ */ jsx(Title
|
|
12091
|
+
children: [hideTitle ? /* @__PURE__ */ jsx(ScreenReaderOnly, { children: /* @__PURE__ */ jsx(Title, { children: title }) }) : /* @__PURE__ */ jsx(Title, { children: title }), hideCloseButton ? null : /* @__PURE__ */ jsx(ModalCloseButton, {})]
|
|
12043
12092
|
});
|
|
12044
12093
|
};
|
|
12045
12094
|
//#endregion
|
|
@@ -12098,7 +12147,7 @@ const centeredModalStyles = css`
|
|
|
12098
12147
|
transform-origin: left center;
|
|
12099
12148
|
animation: ${modalEnter} var(--wui-motion-duration-04) var(--wui-motion-ease-out);
|
|
12100
12149
|
|
|
12101
|
-
&[data-
|
|
12150
|
+
&[data-closed] {
|
|
12102
12151
|
animation: ${modalExit} var(--wui-motion-duration-03) var(--wui-motion-ease-out);
|
|
12103
12152
|
}
|
|
12104
12153
|
`;
|
|
@@ -12117,7 +12166,7 @@ const fixedTopModalStyles = css`
|
|
|
12117
12166
|
transform-origin: left center;
|
|
12118
12167
|
animation: ${modalEnter} var(--wui-motion-duration-04) var(--wui-motion-ease-out);
|
|
12119
12168
|
|
|
12120
|
-
&[data-
|
|
12169
|
+
&[data-closed] {
|
|
12121
12170
|
animation: ${modalExit} var(--wui-motion-duration-03) var(--wui-motion-ease-out);
|
|
12122
12171
|
}
|
|
12123
12172
|
`;
|
|
@@ -12140,7 +12189,7 @@ const rightSidePanelModalStyles = css`
|
|
|
12140
12189
|
`} var(--wui-motion-duration-05) var(--wui-motion-ease-out);
|
|
12141
12190
|
transform-origin: right center;
|
|
12142
12191
|
|
|
12143
|
-
&[data-
|
|
12192
|
+
&[data-closed] {
|
|
12144
12193
|
animation: ${keyframes`
|
|
12145
12194
|
from {
|
|
12146
12195
|
opacity: 1;
|
|
@@ -12159,7 +12208,7 @@ const positionStyleMap = {
|
|
|
12159
12208
|
"fixed-top": fixedTopModalStyles,
|
|
12160
12209
|
"right-side-panel": rightSidePanelModalStyles
|
|
12161
12210
|
};
|
|
12162
|
-
const StyledModalContent = styled(
|
|
12211
|
+
const StyledModalContent = styled(Dialog.Popup)`
|
|
12163
12212
|
position: fixed;
|
|
12164
12213
|
display: flex;
|
|
12165
12214
|
flex-direction: column;
|
|
@@ -12186,12 +12235,13 @@ const StyledModalContent = styled(Content$4)`
|
|
|
12186
12235
|
${({ $positionVariant }) => positionStyleMap[$positionVariant]}
|
|
12187
12236
|
}
|
|
12188
12237
|
`;
|
|
12189
|
-
const ModalContent = forwardRef(({ width, positionVariant = "fixed-top", children, ...props }, ref) => {
|
|
12238
|
+
const ModalContent = forwardRef(({ width, positionVariant = "fixed-top", initialFocusRef, children, ...props }, ref) => {
|
|
12190
12239
|
useFocusRestore();
|
|
12191
12240
|
return /* @__PURE__ */ jsx(StyledModalContent, {
|
|
12192
12241
|
ref,
|
|
12193
12242
|
$positionVariant: positionVariant,
|
|
12194
12243
|
$width: width,
|
|
12244
|
+
...isNotNil(initialFocusRef) ? { initialFocus: initialFocusRef } : {},
|
|
12195
12245
|
...props,
|
|
12196
12246
|
children
|
|
12197
12247
|
});
|
|
@@ -12217,20 +12267,20 @@ const backdropHide = keyframes`
|
|
|
12217
12267
|
opacity: 0;
|
|
12218
12268
|
}
|
|
12219
12269
|
`;
|
|
12220
|
-
const ModalOverlay = styled(
|
|
12270
|
+
const ModalOverlay = styled(Dialog.Backdrop)`
|
|
12221
12271
|
animation: ${backdropShow} var(--wui-motion-duration-02);
|
|
12222
12272
|
background: var(--wui-color-backdrop);
|
|
12223
12273
|
inset: 0;
|
|
12224
12274
|
position: fixed;
|
|
12225
12275
|
z-index: var(--wui-zindex-backdrop);
|
|
12226
12276
|
|
|
12227
|
-
&[data-
|
|
12277
|
+
&[data-closed] {
|
|
12228
12278
|
animation: ${backdropHide} var(--wui-motion-duration-02);
|
|
12229
12279
|
}
|
|
12230
12280
|
`;
|
|
12231
12281
|
//#endregion
|
|
12232
12282
|
//#region src/components/Modal/Modal.tsx
|
|
12233
|
-
const ModalHiddenDescription = styled(Description)({ ...visuallyHiddenStyle });
|
|
12283
|
+
const ModalHiddenDescription = styled(Dialog.Description)({ ...visuallyHiddenStyle });
|
|
12234
12284
|
const ModalBody = styled.div`
|
|
12235
12285
|
flex-direction: column;
|
|
12236
12286
|
display: flex;
|
|
@@ -12252,21 +12302,14 @@ const ModalFooter = styled.footer`
|
|
|
12252
12302
|
* user interaction or dismissal before returning to the underlying content.
|
|
12253
12303
|
*/
|
|
12254
12304
|
const Modal = forwardRef(({ children, footer, hideCloseButton = false, hideTitle = false, initialFocusRef, isOpen, onRequestClose, positionVariant = "centered", title, width = DEFAULT_MODAL_WIDTH, ...props }, ref) => {
|
|
12255
|
-
return /* @__PURE__ */ jsx(Root
|
|
12305
|
+
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
12256
12306
|
onOpenChange: (open) => {
|
|
12257
12307
|
if (!open && isNotNil(onRequestClose)) onRequestClose();
|
|
12258
12308
|
},
|
|
12259
12309
|
open: isOpen,
|
|
12260
|
-
children: /* @__PURE__ */ jsxs(Portal
|
|
12310
|
+
children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(ModalOverlay, {}), /* @__PURE__ */ jsxs(ModalContent, {
|
|
12261
12311
|
ref,
|
|
12262
|
-
|
|
12263
|
-
if (isNotNil(initialFocusRef) && initialFocusRef.current) {
|
|
12264
|
-
event.preventDefault();
|
|
12265
|
-
requestAnimationFrame(() => {
|
|
12266
|
-
initialFocusRef.current?.focus();
|
|
12267
|
-
});
|
|
12268
|
-
}
|
|
12269
|
-
},
|
|
12312
|
+
initialFocusRef,
|
|
12270
12313
|
positionVariant,
|
|
12271
12314
|
width,
|
|
12272
12315
|
...props,
|
|
@@ -12318,6 +12361,14 @@ const getControlProps = (isOpen, onOpenChange) => {
|
|
|
12318
12361
|
};
|
|
12319
12362
|
//#endregion
|
|
12320
12363
|
//#region src/components/Popover/PopoverArrow.tsx
|
|
12364
|
+
const StyledArrowSvg = styled.svg`
|
|
12365
|
+
/* Override Base UI's inline top positioning and rotate the arrow to match Radix behavior.
|
|
12366
|
+
Radix applied rotate(180deg) so the circle sits near the trigger and the stalk extends
|
|
12367
|
+
down toward the popup. Base UI does not rotate the arrow automatically. */
|
|
12368
|
+
top: 0 !important;
|
|
12369
|
+
transform: rotate(180deg);
|
|
12370
|
+
transform-origin: center 0;
|
|
12371
|
+
`;
|
|
12321
12372
|
const StyledPath = styled.path`
|
|
12322
12373
|
fill: var(--wui-color-border-secondary);
|
|
12323
12374
|
`;
|
|
@@ -12355,41 +12406,38 @@ const StyledCircle = styled.circle`
|
|
|
12355
12406
|
`}
|
|
12356
12407
|
}
|
|
12357
12408
|
`;
|
|
12358
|
-
const PopoverArrow
|
|
12359
|
-
return /* @__PURE__ */ jsx(
|
|
12360
|
-
|
|
12361
|
-
|
|
12362
|
-
|
|
12363
|
-
|
|
12364
|
-
|
|
12365
|
-
|
|
12366
|
-
|
|
12367
|
-
|
|
12368
|
-
|
|
12369
|
-
|
|
12370
|
-
|
|
12371
|
-
|
|
12372
|
-
|
|
12373
|
-
|
|
12374
|
-
|
|
12375
|
-
|
|
12376
|
-
|
|
12377
|
-
|
|
12378
|
-
|
|
12379
|
-
|
|
12380
|
-
|
|
12381
|
-
|
|
12382
|
-
|
|
12383
|
-
|
|
12384
|
-
|
|
12385
|
-
]
|
|
12386
|
-
})
|
|
12387
|
-
});
|
|
12409
|
+
const PopoverArrow = ({ isAnimated }) => {
|
|
12410
|
+
return /* @__PURE__ */ jsx(Popover$1.Arrow, { render: /* @__PURE__ */ jsxs(StyledArrowSvg, {
|
|
12411
|
+
fill: "none",
|
|
12412
|
+
height: "56",
|
|
12413
|
+
viewBox: "0 0 48 56",
|
|
12414
|
+
width: "48",
|
|
12415
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12416
|
+
children: [
|
|
12417
|
+
/* @__PURE__ */ jsx(StyledPath, { d: "M24 26.6667C21.0545 26.6667 18.6667 29.0545 18.6667 32C18.6667 34.9455 21.0545 37.3333 24 37.3333C26.9455 37.3333 29.3333 34.9455 29.3333 32C29.3333 29.0545 26.9455 26.6667 24 26.6667ZM23 0V32H25V0H23Z" }),
|
|
12418
|
+
/* @__PURE__ */ jsx(StyledCircle, {
|
|
12419
|
+
$isAnimated: isAnimated,
|
|
12420
|
+
cx: "24",
|
|
12421
|
+
cy: "32",
|
|
12422
|
+
"data-wui-popover-arrow-inner-circle": true,
|
|
12423
|
+
r: "10",
|
|
12424
|
+
strokeWidth: "4"
|
|
12425
|
+
}),
|
|
12426
|
+
/* @__PURE__ */ jsx(StyledCircle, {
|
|
12427
|
+
$isAnimated: isAnimated,
|
|
12428
|
+
cx: "24",
|
|
12429
|
+
cy: "32",
|
|
12430
|
+
"data-wui-popover-arrow-outer-circle": true,
|
|
12431
|
+
r: "20",
|
|
12432
|
+
strokeWidth: "8"
|
|
12433
|
+
})
|
|
12434
|
+
]
|
|
12435
|
+
}) });
|
|
12388
12436
|
};
|
|
12389
|
-
PopoverArrow
|
|
12437
|
+
PopoverArrow.displayName = "PopoverArrow_UI";
|
|
12390
12438
|
//#endregion
|
|
12391
12439
|
//#region src/components/Popover/Popover.tsx
|
|
12392
|
-
const
|
|
12440
|
+
const StyledPopup$1 = styled(Popover$1.Popup)`
|
|
12393
12441
|
z-index: var(--wui-zindex-popover);
|
|
12394
12442
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
12395
12443
|
${({ $unstyled }) => !$unstyled && css`
|
|
@@ -12403,6 +12451,10 @@ const StyledContent$1 = styled(Content$2)`
|
|
|
12403
12451
|
overflow: auto;
|
|
12404
12452
|
`}
|
|
12405
12453
|
|
|
12454
|
+
${({ $withArrow }) => $withArrow && css`
|
|
12455
|
+
overflow: visible;
|
|
12456
|
+
`}
|
|
12457
|
+
|
|
12406
12458
|
[data-wui-popover-close] {
|
|
12407
12459
|
position: absolute;
|
|
12408
12460
|
top: var(--wui-space-02);
|
|
@@ -12412,37 +12464,40 @@ const StyledContent$1 = styled(Content$2)`
|
|
|
12412
12464
|
/**
|
|
12413
12465
|
* Displays rich content in a portal, triggered by a button.
|
|
12414
12466
|
*/
|
|
12415
|
-
const Popover = ({ children, trigger, isOpen = false, hideCloseButton = false, maxWidth = "320px", maxHeight = "auto", onOpenChange, unstyled = false, withArrow = false, isAnimated = false, colorScheme = "inherit", style, ...props }) => {
|
|
12416
|
-
const sideOffset = withArrow ?
|
|
12467
|
+
const Popover = ({ children, trigger, isOpen = false, hideCloseButton = false, maxWidth = "320px", maxHeight = "auto", onOpenChange, unstyled = false, withArrow = false, isAnimated = false, colorScheme = "inherit", style, side, align, nativeButton = true, ...props }) => {
|
|
12468
|
+
const sideOffset = withArrow ? 32 : 8;
|
|
12417
12469
|
const mergedStyle = {
|
|
12418
12470
|
"--wui-popover-max-width": maxWidth,
|
|
12419
12471
|
"--wui-popover-max-height": maxHeight,
|
|
12420
12472
|
...style
|
|
12421
12473
|
};
|
|
12422
|
-
return /* @__PURE__ */ jsxs(Root
|
|
12474
|
+
return /* @__PURE__ */ jsxs(Popover$1.Root, {
|
|
12423
12475
|
...getControlProps(isOpen, onOpenChange),
|
|
12424
|
-
children: [/* @__PURE__ */ jsx(Trigger
|
|
12425
|
-
|
|
12426
|
-
|
|
12427
|
-
}), /* @__PURE__ */ jsx(
|
|
12428
|
-
|
|
12476
|
+
children: [/* @__PURE__ */ jsx(Popover$1.Trigger, {
|
|
12477
|
+
nativeButton,
|
|
12478
|
+
render: trigger
|
|
12479
|
+
}), /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(Popover$1.Positioner, {
|
|
12480
|
+
align,
|
|
12481
|
+
side,
|
|
12429
12482
|
sideOffset,
|
|
12430
|
-
|
|
12431
|
-
|
|
12432
|
-
|
|
12433
|
-
|
|
12434
|
-
|
|
12435
|
-
|
|
12436
|
-
|
|
12483
|
+
children: /* @__PURE__ */ jsxs(StyledPopup$1, {
|
|
12484
|
+
$colorScheme: colorScheme,
|
|
12485
|
+
...props,
|
|
12486
|
+
$unstyled: unstyled,
|
|
12487
|
+
$withArrow: withArrow,
|
|
12488
|
+
role: "dialog",
|
|
12489
|
+
style: mergedStyle,
|
|
12490
|
+
children: [
|
|
12491
|
+
!hideCloseButton && /* @__PURE__ */ jsx(Popover$1.Close, { render: /* @__PURE__ */ jsx(IconButton, {
|
|
12437
12492
|
"data-wui-popover-close": true,
|
|
12438
12493
|
label: "Close",
|
|
12439
12494
|
variant: "ghost",
|
|
12440
12495
|
children: /* @__PURE__ */ jsx(Icon, { type: "close" })
|
|
12441
|
-
})
|
|
12442
|
-
|
|
12443
|
-
|
|
12444
|
-
|
|
12445
|
-
|
|
12496
|
+
}) }),
|
|
12497
|
+
withArrow ? /* @__PURE__ */ jsx(PopoverArrow, { isAnimated }) : null,
|
|
12498
|
+
/* @__PURE__ */ jsx("div", { children })
|
|
12499
|
+
]
|
|
12500
|
+
})
|
|
12446
12501
|
}) })]
|
|
12447
12502
|
});
|
|
12448
12503
|
};
|
|
@@ -12456,10 +12511,10 @@ const ProgressBarWrapper = styled.div`
|
|
|
12456
12511
|
align-items: center;
|
|
12457
12512
|
gap: var(--wui-space-02);
|
|
12458
12513
|
`;
|
|
12459
|
-
const
|
|
12460
|
-
|
|
12461
|
-
|
|
12462
|
-
|
|
12514
|
+
const StyledTrack = styled(Progress.Track)`
|
|
12515
|
+
height: 100%;
|
|
12516
|
+
overflow: hidden;
|
|
12517
|
+
`;
|
|
12463
12518
|
const ProgressBarLabel = styled.div`
|
|
12464
12519
|
display: flex;
|
|
12465
12520
|
line-height: var(--wui-typography-label-3-line-height);
|
|
@@ -12468,17 +12523,15 @@ const ProgressBarLabel = styled.div`
|
|
|
12468
12523
|
color: var(--wui-color-text-secondary);
|
|
12469
12524
|
flex-shrink: 0;
|
|
12470
12525
|
`;
|
|
12471
|
-
const StyledProgressIndicator = styled(Indicator)`
|
|
12526
|
+
const StyledProgressIndicator = styled(Progress.Indicator)`
|
|
12472
12527
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
12473
12528
|
background-color: var(--wui-color-bg-fill);
|
|
12474
|
-
|
|
12475
|
-
height: 100%;
|
|
12529
|
+
display: block;
|
|
12476
12530
|
border-top-right-radius: var(--wui-border-radius-rounded);
|
|
12477
12531
|
border-bottom-right-radius: var(--wui-border-radius-rounded);
|
|
12478
|
-
transition:
|
|
12479
|
-
transform: ${({ $progress, $max }) => getTranslateValue($progress, $max)};
|
|
12532
|
+
transition: width 660ms cubic-bezier(0.65, 0, 0.35, 1);
|
|
12480
12533
|
`;
|
|
12481
|
-
const StyledProgressBar = styled(Root
|
|
12534
|
+
const StyledProgressBar = styled(Progress.Root)`
|
|
12482
12535
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
12483
12536
|
position: relative;
|
|
12484
12537
|
overflow: hidden;
|
|
@@ -12498,14 +12551,11 @@ const ProgressBar = ({ progress, max = 100, children, labelLeft, labelRight, col
|
|
|
12498
12551
|
isNotNil(labelLeft) ? /* @__PURE__ */ jsx(ProgressBarLabel, { children: labelLeft }) : null,
|
|
12499
12552
|
/* @__PURE__ */ jsx(StyledProgressBar, {
|
|
12500
12553
|
$colorScheme: colorScheme,
|
|
12554
|
+
getAriaValueText: (_formattedValue, value) => value != null ? `${Math.round(value / max * 100)}%` : "indeterminate progress",
|
|
12501
12555
|
max,
|
|
12502
12556
|
value: progress,
|
|
12503
12557
|
...props,
|
|
12504
|
-
children: /* @__PURE__ */ jsx(StyledProgressIndicator, {
|
|
12505
|
-
$colorScheme: colorScheme,
|
|
12506
|
-
$max: max,
|
|
12507
|
-
$progress: progress
|
|
12508
|
-
})
|
|
12558
|
+
children: /* @__PURE__ */ jsx(StyledTrack, { children: /* @__PURE__ */ jsx(StyledProgressIndicator, { $colorScheme: colorScheme }) })
|
|
12509
12559
|
}),
|
|
12510
12560
|
isNotNil(labelRight) ? /* @__PURE__ */ jsx(ProgressBarLabel, { children: labelRight }) : null
|
|
12511
12561
|
] });
|
|
@@ -13087,7 +13137,7 @@ const segmentedControlStyles = css`
|
|
|
13087
13137
|
position: relative;
|
|
13088
13138
|
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
13089
13139
|
`;
|
|
13090
|
-
const StyledSegmentedControl = styled(
|
|
13140
|
+
const StyledSegmentedControl = styled(ToggleGroup)`
|
|
13091
13141
|
${segmentedControlStyles}
|
|
13092
13142
|
`;
|
|
13093
13143
|
/**
|
|
@@ -13100,11 +13150,11 @@ const SegmentedControl = forwardRef(({ children, colorScheme = "inherit", disabl
|
|
|
13100
13150
|
$colorScheme: colorScheme,
|
|
13101
13151
|
$fullWidth: fullWidth,
|
|
13102
13152
|
disabled,
|
|
13103
|
-
|
|
13104
|
-
onValueChange:
|
|
13105
|
-
|
|
13106
|
-
|
|
13107
|
-
value: selectedValue,
|
|
13153
|
+
loopFocus: true,
|
|
13154
|
+
onValueChange: (newValue) => {
|
|
13155
|
+
if (newValue.length > 0 && newValue[0] !== void 0) onSelectedValueChange(newValue[0]);
|
|
13156
|
+
},
|
|
13157
|
+
value: [selectedValue],
|
|
13108
13158
|
...props,
|
|
13109
13159
|
children: /* @__PURE__ */ jsx(SegmentedControlValueProvider, {
|
|
13110
13160
|
value: selectedValue,
|
|
@@ -13116,7 +13166,7 @@ SegmentedControl.displayName = "SegmentedControl_UI";
|
|
|
13116
13166
|
//#endregion
|
|
13117
13167
|
//#region src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
13118
13168
|
const segmentedControlItemStyles = css`
|
|
13119
|
-
all: unset;
|
|
13169
|
+
all: unset;
|
|
13120
13170
|
align-items: center;
|
|
13121
13171
|
border-radius: var(--wui-border-radius-rounded);
|
|
13122
13172
|
color: var(--wui-color-text-secondary);
|
|
@@ -13150,10 +13200,11 @@ const segmentedControlItemStyles = css`
|
|
|
13150
13200
|
/* note: react-toggle-group uses 'aria-selected' and react-tabs uses "active" */
|
|
13151
13201
|
|
|
13152
13202
|
/* we can't style off of 'data-state' since that gets overridden when wrapped in a Tooltip */
|
|
13153
|
-
&:hover:not([aria-checked='true'], [aria-selected='true']) {
|
|
13203
|
+
&:hover:not([aria-pressed='true'], [aria-checked='true'], [aria-selected='true']) {
|
|
13154
13204
|
background-color: var(--wui-color-bg-surface-secondary-hover);
|
|
13155
13205
|
}
|
|
13156
13206
|
|
|
13207
|
+
&[aria-pressed='true'],
|
|
13157
13208
|
&[aria-checked='true'],
|
|
13158
13209
|
&[aria-selected='true'] {
|
|
13159
13210
|
color: var(--wui-color-segmented-color-text-override, var(--wui-color-text-selected));
|
|
@@ -13183,7 +13234,7 @@ const segmentedControlItemStyles = css`
|
|
|
13183
13234
|
}
|
|
13184
13235
|
}
|
|
13185
13236
|
`;
|
|
13186
|
-
const StyledSegmentedControlItem = styled(
|
|
13237
|
+
const StyledSegmentedControlItem = styled(Toggle)`
|
|
13187
13238
|
${segmentedControlItemStyles}
|
|
13188
13239
|
`;
|
|
13189
13240
|
const SegmentedControlItem = forwardRef(({ disabled, icon, label, "aria-label": ariaLabel, value, ...otherProps }, forwardedRef) => {
|
|
@@ -13192,8 +13243,7 @@ const SegmentedControlItem = forwardRef(({ disabled, icon, label, "aria-label":
|
|
|
13192
13243
|
const buttonRef = useRef(null);
|
|
13193
13244
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
13194
13245
|
const handleClick = (event) => {
|
|
13195
|
-
|
|
13196
|
-
if (state === "on") event.preventDefault();
|
|
13246
|
+
if (event.currentTarget.getAttribute("aria-pressed") === "true") event.preventDefault();
|
|
13197
13247
|
};
|
|
13198
13248
|
useEffect(() => {
|
|
13199
13249
|
const buttonElem = buttonRef.current;
|
|
@@ -13234,7 +13284,7 @@ const SegmentedControlItem = forwardRef(({ disabled, icon, label, "aria-label":
|
|
|
13234
13284
|
SegmentedControlItem.displayName = "SegmentedControlItem_UI";
|
|
13235
13285
|
//#endregion
|
|
13236
13286
|
//#region src/components/Select/Select.tsx
|
|
13237
|
-
const StyledTrigger = styled(Trigger
|
|
13287
|
+
const StyledTrigger = styled(Select$1.Trigger)`
|
|
13238
13288
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
13239
13289
|
${inputCss};
|
|
13240
13290
|
padding: var(--wui-input-vertical-padding) var(--wui-input-horizontal-padding);
|
|
@@ -13280,7 +13330,7 @@ const StyledTrigger = styled(Trigger$4)`
|
|
|
13280
13330
|
color: var(--wui-input-placeholder);
|
|
13281
13331
|
}
|
|
13282
13332
|
`;
|
|
13283
|
-
const
|
|
13333
|
+
const StyledPopup = styled(Select$1.Popup)`
|
|
13284
13334
|
--wui-select-content-border: var(--wui-color-border);
|
|
13285
13335
|
--wui-select-content-bg: var(--wui-color-bg-surface);
|
|
13286
13336
|
--wui-select-content-border-radius: var(--wui-border-radius-02);
|
|
@@ -13294,8 +13344,8 @@ const StyledContent = styled(Content$5)`
|
|
|
13294
13344
|
border-radius: var(--wui-select-content-border-radius);
|
|
13295
13345
|
box-shadow: var(--wui-elevation-01);
|
|
13296
13346
|
padding: var(--wui-select-option-padding);
|
|
13297
|
-
min-width: var(--
|
|
13298
|
-
max-height: var(--
|
|
13347
|
+
min-width: var(--anchor-width);
|
|
13348
|
+
max-height: var(--available-height);
|
|
13299
13349
|
z-index: var(--wui-zindex-select);
|
|
13300
13350
|
|
|
13301
13351
|
[role='separator'] {
|
|
@@ -13307,55 +13357,87 @@ const scrollButtonStyles = css`
|
|
|
13307
13357
|
display: flex;
|
|
13308
13358
|
justify-content: center;
|
|
13309
13359
|
`;
|
|
13310
|
-
const
|
|
13360
|
+
const StyledScrollDownArrow = styled(Select$1.ScrollDownArrow)`
|
|
13311
13361
|
${scrollButtonStyles}
|
|
13312
13362
|
`;
|
|
13313
|
-
const
|
|
13363
|
+
const StyledScrollUpArrow = styled(Select$1.ScrollUpArrow)`
|
|
13314
13364
|
${scrollButtonStyles}
|
|
13315
13365
|
`;
|
|
13316
13366
|
/**
|
|
13367
|
+
* Walks the React children tree to build a value→label mapping for Base UI's `items` prop.
|
|
13368
|
+
* This ensures `Select.Value` displays the label text instead of the raw value.
|
|
13369
|
+
*/
|
|
13370
|
+
const collectItemLabels = (children) => {
|
|
13371
|
+
const items = [];
|
|
13372
|
+
Children.forEach(children, (child) => {
|
|
13373
|
+
if (!isValidElement(child)) return;
|
|
13374
|
+
const { value, selectedDisplayValue, children: childChildren, textValue } = child.props;
|
|
13375
|
+
if (typeof value === "string") {
|
|
13376
|
+
if (selectedDisplayValue !== void 0 && selectedDisplayValue !== null) items.push({
|
|
13377
|
+
value,
|
|
13378
|
+
label: selectedDisplayValue
|
|
13379
|
+
});
|
|
13380
|
+
else if (typeof childChildren === "string") items.push({
|
|
13381
|
+
value,
|
|
13382
|
+
label: childChildren
|
|
13383
|
+
});
|
|
13384
|
+
else if (typeof textValue === "string") items.push({
|
|
13385
|
+
value,
|
|
13386
|
+
label: textValue
|
|
13387
|
+
});
|
|
13388
|
+
return;
|
|
13389
|
+
}
|
|
13390
|
+
if (childChildren !== void 0 && childChildren !== null) items.push(...collectItemLabels(childChildren));
|
|
13391
|
+
});
|
|
13392
|
+
return items;
|
|
13393
|
+
};
|
|
13394
|
+
/**
|
|
13317
13395
|
* Display a list of options and choose one of them. Replacement for the native Select HTML element.
|
|
13318
13396
|
*/
|
|
13319
|
-
const Select = forwardRef(({ colorScheme = "inherit", children, onOpenChange = () => null, onChange = () => null, placeholder = "Select...", fullWidth = false, forceOpen = false, ...props }, forwardedRef) => {
|
|
13397
|
+
const Select = forwardRef(({ colorScheme = "inherit", children, onOpenChange = () => null, onChange = () => null, placeholder = "Select...", fullWidth = false, forceOpen = false, disabled, value, "aria-invalid": ariaInvalid, ...props }, forwardedRef) => {
|
|
13320
13398
|
const responsiveFullWidth = useResponsiveProp(fullWidth);
|
|
13321
13399
|
const rootProps = {
|
|
13322
|
-
|
|
13400
|
+
disabled,
|
|
13401
|
+
items: useMemo(() => collectItemLabels(children), [children]),
|
|
13323
13402
|
onOpenChange,
|
|
13324
|
-
onValueChange: onChange
|
|
13403
|
+
onValueChange: onChange,
|
|
13404
|
+
value
|
|
13325
13405
|
};
|
|
13326
13406
|
if (forceOpen) rootProps["open"] = true;
|
|
13327
|
-
return /* @__PURE__ */ jsxs(Root
|
|
13407
|
+
return /* @__PURE__ */ jsxs(Select$1.Root, {
|
|
13328
13408
|
...rootProps,
|
|
13329
13409
|
children: [/* @__PURE__ */ jsxs(StyledTrigger, {
|
|
13330
13410
|
ref: forwardedRef,
|
|
13331
13411
|
$colorScheme: colorScheme,
|
|
13332
13412
|
$fullWidth: responsiveFullWidth,
|
|
13413
|
+
"aria-invalid": ariaInvalid,
|
|
13333
13414
|
...props,
|
|
13334
|
-
children: [/* @__PURE__ */ jsx(Value, { placeholder }), /* @__PURE__ */ jsx(Icon, {
|
|
13415
|
+
children: [/* @__PURE__ */ jsx(Select$1.Value, { placeholder }), /* @__PURE__ */ jsx(Icon, {
|
|
13335
13416
|
size: "md",
|
|
13336
13417
|
type: "caret-down"
|
|
13337
13418
|
})]
|
|
13338
|
-
}), /* @__PURE__ */ jsx(Portal
|
|
13339
|
-
|
|
13419
|
+
}), /* @__PURE__ */ jsx(Select$1.Portal, { children: /* @__PURE__ */ jsx(Select$1.Positioner, {
|
|
13420
|
+
align: "start",
|
|
13421
|
+
alignItemWithTrigger: false,
|
|
13340
13422
|
sideOffset: 8,
|
|
13341
|
-
children: [
|
|
13342
|
-
/* @__PURE__ */ jsx(
|
|
13423
|
+
children: /* @__PURE__ */ jsxs(StyledPopup, { children: [
|
|
13424
|
+
/* @__PURE__ */ jsx(StyledScrollUpArrow, { children: /* @__PURE__ */ jsx(Icon, {
|
|
13343
13425
|
size: "sm",
|
|
13344
13426
|
type: "caret-up"
|
|
13345
13427
|
}) }),
|
|
13346
|
-
|
|
13347
|
-
/* @__PURE__ */ jsx(
|
|
13428
|
+
children,
|
|
13429
|
+
/* @__PURE__ */ jsx(StyledScrollDownArrow, { children: /* @__PURE__ */ jsx(Icon, {
|
|
13348
13430
|
size: "sm",
|
|
13349
13431
|
type: "caret-down"
|
|
13350
13432
|
}) })
|
|
13351
|
-
]
|
|
13433
|
+
] })
|
|
13352
13434
|
}) })]
|
|
13353
13435
|
});
|
|
13354
13436
|
});
|
|
13355
13437
|
Select.displayName = "Select_UI";
|
|
13356
13438
|
//#endregion
|
|
13357
13439
|
//#region src/components/Select/SelectOption.tsx
|
|
13358
|
-
const StyledItem = styled(Item
|
|
13440
|
+
const StyledItem = styled(Select$1.Item)`
|
|
13359
13441
|
${getTypographicStyles("label3")}
|
|
13360
13442
|
align-items: ${({ $checkmarkVerticalAlign }) => $checkmarkVerticalAlign === "center" ? "center" : "flex-start"};
|
|
13361
13443
|
background-color: transparent;
|
|
@@ -13381,15 +13463,17 @@ const StyledItem = styled(Item$2)`
|
|
|
13381
13463
|
background-color: transparent;
|
|
13382
13464
|
}
|
|
13383
13465
|
`;
|
|
13384
|
-
const SelectOption = forwardRef(({ children, selectedDisplayValue, checkmarkVerticalAlign = "center", ...props }, forwardedRef) => {
|
|
13466
|
+
const SelectOption = forwardRef(({ children, selectedDisplayValue, checkmarkVerticalAlign = "center", textValue, ...props }, forwardedRef) => {
|
|
13467
|
+
const label = typeof children === "string" ? children : textValue;
|
|
13385
13468
|
return /* @__PURE__ */ jsxs(StyledItem, {
|
|
13386
13469
|
...props,
|
|
13387
13470
|
ref: forwardedRef,
|
|
13388
13471
|
$checkmarkVerticalAlign: checkmarkVerticalAlign,
|
|
13472
|
+
...label != null ? { label } : {},
|
|
13389
13473
|
children: [isNotNil(selectedDisplayValue) ? /* @__PURE__ */ jsxs("div", { children: [children, /* @__PURE__ */ jsx("div", {
|
|
13390
13474
|
style: { display: "none" },
|
|
13391
|
-
children: /* @__PURE__ */ jsx(ItemText, { children: selectedDisplayValue })
|
|
13392
|
-
})] }) : /* @__PURE__ */ jsx(ItemText, { children }), /* @__PURE__ */ jsx(ItemIndicator, { children: /* @__PURE__ */ jsx(Icon, {
|
|
13475
|
+
children: /* @__PURE__ */ jsx(Select$1.ItemText, { children: selectedDisplayValue })
|
|
13476
|
+
})] }) : /* @__PURE__ */ jsx(Select$1.ItemText, { children }), /* @__PURE__ */ jsx(Select$1.ItemIndicator, { children: /* @__PURE__ */ jsx(Icon, {
|
|
13393
13477
|
size: "md",
|
|
13394
13478
|
type: "checkmark"
|
|
13395
13479
|
}) })]
|
|
@@ -13398,11 +13482,11 @@ const SelectOption = forwardRef(({ children, selectedDisplayValue, checkmarkVert
|
|
|
13398
13482
|
SelectOption.displayName = "SelectOption_UI";
|
|
13399
13483
|
//#endregion
|
|
13400
13484
|
//#region src/components/Select/SelectOptionGroup.tsx
|
|
13401
|
-
const StyledLabel = styled(
|
|
13485
|
+
const StyledLabel = styled(Select$1.GroupLabel)`
|
|
13402
13486
|
padding: var(--wui-select-option-padding);
|
|
13403
13487
|
`;
|
|
13404
13488
|
const SelectOptionGroup = ({ children, label, ...props }) => {
|
|
13405
|
-
return /* @__PURE__ */ jsxs(Group, {
|
|
13489
|
+
return /* @__PURE__ */ jsxs(Select$1.Group, {
|
|
13406
13490
|
...props,
|
|
13407
13491
|
children: [/* @__PURE__ */ jsx(StyledLabel, { children: /* @__PURE__ */ jsx(Heading, {
|
|
13408
13492
|
renderAs: "span",
|
|
@@ -13429,28 +13513,28 @@ const SliderContainer = styled.div`
|
|
|
13429
13513
|
pointer-events: none;
|
|
13430
13514
|
}
|
|
13431
13515
|
`;
|
|
13432
|
-
const StyledSliderRoot = styled(Root
|
|
13433
|
-
|
|
13516
|
+
const StyledSliderRoot = styled(Slider$1.Root)`
|
|
13517
|
+
width: 100%;
|
|
13518
|
+
`;
|
|
13519
|
+
const StyledSliderControl = styled(Slider$1.Control)`
|
|
13434
13520
|
display: flex;
|
|
13435
13521
|
align-items: center;
|
|
13436
13522
|
user-select: none;
|
|
13437
13523
|
touch-action: none;
|
|
13438
13524
|
width: 100%;
|
|
13439
13525
|
`;
|
|
13440
|
-
const StyledSliderTrack = styled(Track)`
|
|
13526
|
+
const StyledSliderTrack = styled(Slider$1.Track)`
|
|
13441
13527
|
background-color: var(--wui-slider-track-color);
|
|
13442
13528
|
border-radius: var(--wui-slider-track-border-radius);
|
|
13443
|
-
|
|
13529
|
+
width: 100%;
|
|
13444
13530
|
height: 6px;
|
|
13445
13531
|
position: relative;
|
|
13446
13532
|
`;
|
|
13447
|
-
const
|
|
13533
|
+
const StyledSliderIndicator = styled(Slider$1.Indicator)`
|
|
13448
13534
|
background-color: var(--wui-slider-range-color);
|
|
13449
13535
|
border-radius: var(--wui-slider-track-border-radius);
|
|
13450
|
-
height: 100%;
|
|
13451
|
-
position: absolute;
|
|
13452
13536
|
`;
|
|
13453
|
-
const StyledSliderThumb = styled(Thumb)`
|
|
13537
|
+
const StyledSliderThumb = styled(Slider$1.Thumb)`
|
|
13454
13538
|
background-color: var(--wui-slider-thumb-color);
|
|
13455
13539
|
border-radius: var(--wui-border-radius-rounded);
|
|
13456
13540
|
cursor: grab;
|
|
@@ -13477,16 +13561,19 @@ const StyledSliderThumb = styled(Thumb)`
|
|
|
13477
13561
|
outline-width: 2px;
|
|
13478
13562
|
}
|
|
13479
13563
|
`;
|
|
13480
|
-
const Slider = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, disabled = false, initialValue = [0], max = 100, min = 0, onChange,
|
|
13564
|
+
const Slider = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, disabled = false, initialValue = [0], max = 100, min = 0, onChange, onValueCommitted, step = 1, value, "data-testid": dataTestId = "ui-slider", ...otherProps }) => {
|
|
13481
13565
|
if (!(isNonEmptyString(ariaLabel) || isNonEmptyString(ariaLabelledby))) throw new Error("UI Slider: Sliders should have an accessible name. Add a label using the aria-label or aria-labelledby prop.");
|
|
13482
13566
|
const values = value ?? initialValue;
|
|
13483
13567
|
const handleValueChange = (newValue) => {
|
|
13484
|
-
if (onChange) onChange(newValue);
|
|
13568
|
+
if (onChange) onChange(typeof newValue === "number" ? [newValue] : [...newValue]);
|
|
13569
|
+
};
|
|
13570
|
+
const handleValueCommitted = (newValue) => {
|
|
13571
|
+
if (onValueCommitted) onValueCommitted(typeof newValue === "number" ? [newValue] : [...newValue]);
|
|
13485
13572
|
};
|
|
13486
13573
|
return /* @__PURE__ */ jsx(SliderContainer, {
|
|
13487
13574
|
...otherProps,
|
|
13488
13575
|
"data-testid": dataTestId,
|
|
13489
|
-
children: /* @__PURE__ */
|
|
13576
|
+
children: /* @__PURE__ */ jsx(StyledSliderRoot, {
|
|
13490
13577
|
"aria-label": ariaLabel,
|
|
13491
13578
|
"aria-labelledby": ariaLabelledby,
|
|
13492
13579
|
defaultValue: initialValue,
|
|
@@ -13494,13 +13581,13 @@ const Slider = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, di
|
|
|
13494
13581
|
max,
|
|
13495
13582
|
min,
|
|
13496
13583
|
onValueChange: handleValueChange,
|
|
13584
|
+
onValueCommitted: handleValueCommitted,
|
|
13497
13585
|
step,
|
|
13498
|
-
...onValueCommit ? { onValueCommit } : {},
|
|
13499
13586
|
...value ? { value } : {},
|
|
13500
|
-
children:
|
|
13587
|
+
children: /* @__PURE__ */ jsx(StyledSliderControl, { children: /* @__PURE__ */ jsxs(StyledSliderTrack, {
|
|
13501
13588
|
"data-testid": `${dataTestId}-track`,
|
|
13502
|
-
children: /* @__PURE__ */ jsx(
|
|
13503
|
-
})
|
|
13589
|
+
children: [/* @__PURE__ */ jsx(StyledSliderIndicator, { "data-testid": `${dataTestId}-range` }), values.map((_, index) => /* @__PURE__ */ jsx(StyledSliderThumb, { "data-testid": `${dataTestId}-thumb-${index}` }, `thumb-${index}`))]
|
|
13590
|
+
}) })
|
|
13504
13591
|
})
|
|
13505
13592
|
});
|
|
13506
13593
|
};
|
|
@@ -13518,7 +13605,7 @@ const StyledSplitButton = styled.span`
|
|
|
13518
13605
|
padding-right: 0;
|
|
13519
13606
|
}
|
|
13520
13607
|
|
|
13521
|
-
> [data-wui-button='true']:
|
|
13608
|
+
> [data-wui-button='true']:not(:first-child) {
|
|
13522
13609
|
border-top-left-radius: 0;
|
|
13523
13610
|
border-bottom-left-radius: 0;
|
|
13524
13611
|
display: inline-flex;
|
|
@@ -13702,8 +13789,10 @@ const useTabsValue = () => {
|
|
|
13702
13789
|
const Tabs = ({ children, value: valueProp, onValueChange: onValueChangeProp, defaultValue, ...props }) => {
|
|
13703
13790
|
const [value, setValue] = useState(valueProp ?? defaultValue);
|
|
13704
13791
|
const onValueChange = useCallback((newValue) => {
|
|
13705
|
-
|
|
13706
|
-
|
|
13792
|
+
if (newValue !== null) {
|
|
13793
|
+
setValue(newValue);
|
|
13794
|
+
if (onValueChangeProp) onValueChangeProp(newValue);
|
|
13795
|
+
}
|
|
13707
13796
|
}, [onValueChangeProp]);
|
|
13708
13797
|
const rootProps = {
|
|
13709
13798
|
...props,
|
|
@@ -13711,7 +13800,7 @@ const Tabs = ({ children, value: valueProp, onValueChange: onValueChangeProp, de
|
|
|
13711
13800
|
};
|
|
13712
13801
|
if (isNotNil(value)) rootProps.value = value;
|
|
13713
13802
|
if (isNotNil(defaultValue)) rootProps.defaultValue = defaultValue;
|
|
13714
|
-
return /* @__PURE__ */ jsx(Root
|
|
13803
|
+
return /* @__PURE__ */ jsx(Tabs$1.Root, {
|
|
13715
13804
|
...rootProps,
|
|
13716
13805
|
children: /* @__PURE__ */ jsx(TabsValueProvider, {
|
|
13717
13806
|
value: value ?? defaultValue,
|
|
@@ -13723,7 +13812,7 @@ Tabs.displayName = "Tabs_UI";
|
|
|
13723
13812
|
//#endregion
|
|
13724
13813
|
//#region src/components/Tabs/TabsContent.tsx
|
|
13725
13814
|
const TabsContent = ({ children, value }) => {
|
|
13726
|
-
return /* @__PURE__ */ jsx(
|
|
13815
|
+
return /* @__PURE__ */ jsx(Tabs$1.Panel, {
|
|
13727
13816
|
value,
|
|
13728
13817
|
children
|
|
13729
13818
|
});
|
|
@@ -13748,7 +13837,7 @@ const SelectedTabIndicator = () => {
|
|
|
13748
13837
|
};
|
|
13749
13838
|
//#endregion
|
|
13750
13839
|
//#region src/components/Tabs/TabsList.tsx
|
|
13751
|
-
const StyledTabsList = styled(
|
|
13840
|
+
const StyledTabsList = styled(Tabs$1.List)`
|
|
13752
13841
|
${segmentedControlStyles}
|
|
13753
13842
|
`;
|
|
13754
13843
|
const TabsList = ({ children, fullWidth = true, ...props }) => {
|
|
@@ -13761,7 +13850,7 @@ const TabsList = ({ children, fullWidth = true, ...props }) => {
|
|
|
13761
13850
|
TabsList.displayName = "TabsList_UI";
|
|
13762
13851
|
//#endregion
|
|
13763
13852
|
//#region src/components/Tabs/StyledTabsTrigger.tsx
|
|
13764
|
-
const StyledTabsTrigger = styled(
|
|
13853
|
+
const StyledTabsTrigger = styled(Tabs$1.Tab)`
|
|
13765
13854
|
${segmentedControlItemStyles}
|
|
13766
13855
|
|
|
13767
13856
|
&:focus-visible {
|