@wistia/ui 2.8.1 → 2.9.0-beta.81dd8723.200107c
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 +13 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +195 -100
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/CHANGELOG.md +0 -2451
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v2.
|
|
3
|
+
* @license @wistia/ui v2.9.0-beta.81dd8723.200107c
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -16,7 +16,7 @@ import { Toaster, toast } from "sonner";
|
|
|
16
16
|
import { getValueAndUnit } from "polished";
|
|
17
17
|
import { useFilePicker as useFilePicker$1, useImperativeFilePicker as useImperativeFilePicker$1 } from "use-file-picker";
|
|
18
18
|
import { FileAmountLimitValidator, FileSizeValidator, FileTypeValidator, ImageDimensionsValidator, PersistentFileAmountLimitValidator } from "use-file-picker/validators";
|
|
19
|
-
import { debounce
|
|
19
|
+
import { debounce } from "throttle-debounce";
|
|
20
20
|
import { Link as Link$1, useInRouterContext } from "react-router";
|
|
21
21
|
import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
|
|
22
22
|
import { RadioGroup as RadioGroup$1 } from "@base-ui/react/radio-group";
|
|
@@ -37,6 +37,7 @@ import { PreviewCard as PreviewCard$1 } from "@base-ui/react/preview-card";
|
|
|
37
37
|
import ReactMarkdown from "react-markdown";
|
|
38
38
|
import { Dialog } from "@base-ui/react/dialog";
|
|
39
39
|
import { Progress } from "@base-ui/react/progress";
|
|
40
|
+
import { ScrollArea as ScrollArea$1 } from "@base-ui/react/scroll-area";
|
|
40
41
|
import { Select as Select$1 } from "@base-ui/react/select";
|
|
41
42
|
import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
|
|
42
43
|
//#region src/components/ClickRegion/globalStyles.tsx
|
|
@@ -8731,7 +8732,7 @@ const useColorPickerState = () => {
|
|
|
8731
8732
|
};
|
|
8732
8733
|
//#endregion
|
|
8733
8734
|
//#region src/components/ColorPicker/ColorGrid.tsx
|
|
8734
|
-
const Container$
|
|
8735
|
+
const Container$8 = styled.div`
|
|
8735
8736
|
display: grid;
|
|
8736
8737
|
gap: var(--wui-space-01);
|
|
8737
8738
|
grid-template-columns: minmax(0, 1fr);
|
|
@@ -8760,7 +8761,7 @@ const ColorGrid = ({ children, label }) => {
|
|
|
8760
8761
|
commitValue(value);
|
|
8761
8762
|
}
|
|
8762
8763
|
}, [commitValue, onChangeNonDerivedValueAsHsv]);
|
|
8763
|
-
return /* @__PURE__ */ jsxs(Container$
|
|
8764
|
+
return /* @__PURE__ */ jsxs(Container$8, { children: [label != null && /* @__PURE__ */ jsx(LabelContainer$1, { children: /* @__PURE__ */ jsx(Label, { children: label }) }), /* @__PURE__ */ jsx(ItemsContainer$1, {
|
|
8764
8765
|
onValueChange,
|
|
8765
8766
|
value: valueAsHex,
|
|
8766
8767
|
children
|
|
@@ -8966,7 +8967,7 @@ const ColorSwatch = ({ children, diameterPx = 24, isSelected = false, derivative
|
|
|
8966
8967
|
};
|
|
8967
8968
|
//#endregion
|
|
8968
8969
|
//#region src/components/ColorPicker/ColorGridOption.tsx
|
|
8969
|
-
const Container$
|
|
8970
|
+
const Container$7 = styled(Radio$1.Root)`
|
|
8970
8971
|
border: none;
|
|
8971
8972
|
appearance: none;
|
|
8972
8973
|
outline: none;
|
|
@@ -8990,7 +8991,7 @@ const ColorGridOption = ({ value: rawValue, name }) => {
|
|
|
8990
8991
|
style: { fontFamily: "var(--wui-typography-family-mono)" },
|
|
8991
8992
|
children: value
|
|
8992
8993
|
}),
|
|
8993
|
-
children: /* @__PURE__ */ jsx(Container$
|
|
8994
|
+
children: /* @__PURE__ */ jsx(Container$7, {
|
|
8994
8995
|
"aria-label": value,
|
|
8995
8996
|
"aria-selected": valueAsHex === value,
|
|
8996
8997
|
role: "option",
|
|
@@ -9007,7 +9008,7 @@ const ColorGridOption = ({ value: rawValue, name }) => {
|
|
|
9007
9008
|
ColorGridOption.displayName = "ColorGridOption_UI";
|
|
9008
9009
|
//#endregion
|
|
9009
9010
|
//#region src/components/ColorPicker/ColorList.tsx
|
|
9010
|
-
const Container$
|
|
9011
|
+
const Container$6 = styled(ToggleGroup)`
|
|
9011
9012
|
display: grid;
|
|
9012
9013
|
grid-template-columns: minmax(0, 1fr);
|
|
9013
9014
|
`;
|
|
@@ -9025,7 +9026,7 @@ const ColorList = ({ children }) => {
|
|
|
9025
9026
|
onChangeNonDerivedValueAsHsv(hsv);
|
|
9026
9027
|
commitValue(value);
|
|
9027
9028
|
}, [commitValue, onChangeNonDerivedValueAsHsv]);
|
|
9028
|
-
return /* @__PURE__ */ jsx(Container$
|
|
9029
|
+
return /* @__PURE__ */ jsx(Container$6, {
|
|
9029
9030
|
onValueChange,
|
|
9030
9031
|
value: [valueAsHex],
|
|
9031
9032
|
children
|
|
@@ -9034,7 +9035,7 @@ const ColorList = ({ children }) => {
|
|
|
9034
9035
|
ColorList.displayName = "ColorList_UI";
|
|
9035
9036
|
//#endregion
|
|
9036
9037
|
//#region src/components/ColorPicker/ColorListGroup.tsx
|
|
9037
|
-
const Container$
|
|
9038
|
+
const Container$5 = styled.div`
|
|
9038
9039
|
display: grid;
|
|
9039
9040
|
gap: var(--wui-space-01);
|
|
9040
9041
|
grid-template-columns: minmax(0, 1fr);
|
|
@@ -9050,7 +9051,7 @@ const LabelContainer = styled.div`
|
|
|
9050
9051
|
* Groups `ColorListOption` items under a labeled heading within a `ColorList`.
|
|
9051
9052
|
*/
|
|
9052
9053
|
const ColorListGroup = ({ label, children }) => {
|
|
9053
|
-
return /* @__PURE__ */ jsxs(Container$
|
|
9054
|
+
return /* @__PURE__ */ jsxs(Container$5, {
|
|
9054
9055
|
"aria-label": label,
|
|
9055
9056
|
role: "group",
|
|
9056
9057
|
children: [/* @__PURE__ */ jsx(LabelContainer, { children: /* @__PURE__ */ jsx(Label, { children: label }) }), /* @__PURE__ */ jsx(ItemsContainer, { children })]
|
|
@@ -9079,7 +9080,7 @@ const ColorNameOrHexCode = ({ name, hexCode }) => {
|
|
|
9079
9080
|
};
|
|
9080
9081
|
//#endregion
|
|
9081
9082
|
//#region src/components/ColorPicker/ColorListOption.tsx
|
|
9082
|
-
const Container$
|
|
9083
|
+
const Container$4 = styled(Toggle)`
|
|
9083
9084
|
border: none;
|
|
9084
9085
|
appearance: none;
|
|
9085
9086
|
outline: none;
|
|
@@ -9110,7 +9111,7 @@ const ColorListOption = ({ value: rawValue, name }) => {
|
|
|
9110
9111
|
const { valueAsHsv, nonDerivedValueAsHex } = useColorPickerState();
|
|
9111
9112
|
const valueAsHex = formatHex(valueAsHsv);
|
|
9112
9113
|
const isSelected = valueAsHex === value;
|
|
9113
|
-
return /* @__PURE__ */ jsxs(Container$
|
|
9114
|
+
return /* @__PURE__ */ jsxs(Container$4, {
|
|
9114
9115
|
"aria-label": value,
|
|
9115
9116
|
"aria-selected": valueAsHex === value,
|
|
9116
9117
|
role: "option",
|
|
@@ -9199,7 +9200,7 @@ const ColorPickerPopoverContent = ({ children }) => {
|
|
|
9199
9200
|
ColorPickerPopoverContent.displayName = "ColorPickerPopoverContent_UI";
|
|
9200
9201
|
//#endregion
|
|
9201
9202
|
//#region src/components/ColorPicker/ColorPickerSection.tsx
|
|
9202
|
-
const Container$
|
|
9203
|
+
const Container$3 = styled.div`
|
|
9203
9204
|
padding: var(--wui-space-02);
|
|
9204
9205
|
`;
|
|
9205
9206
|
/**
|
|
@@ -9207,7 +9208,7 @@ const Container$4 = styled.div`
|
|
|
9207
9208
|
* `ColorPickerPopoverContent`. Provides consistent spacing between sections.
|
|
9208
9209
|
*/
|
|
9209
9210
|
const ColorPickerSection = ({ children }) => {
|
|
9210
|
-
return /* @__PURE__ */ jsx(Container$
|
|
9211
|
+
return /* @__PURE__ */ jsx(Container$3, { children: /* @__PURE__ */ jsx(Stack, { children }) });
|
|
9211
9212
|
};
|
|
9212
9213
|
ColorPickerSection.displayName = "ColorPickerSection_UI";
|
|
9213
9214
|
//#endregion
|
|
@@ -9428,7 +9429,7 @@ const ContrastEnforcerSwitch = () => {
|
|
|
9428
9429
|
};
|
|
9429
9430
|
//#endregion
|
|
9430
9431
|
//#region src/components/ColorPicker/ContrastIndicator.tsx
|
|
9431
|
-
const Container$
|
|
9432
|
+
const Container$2 = styled.div`
|
|
9432
9433
|
display: flex;
|
|
9433
9434
|
flex-direction: row;
|
|
9434
9435
|
justify-content: end;
|
|
@@ -9453,7 +9454,7 @@ const ContrastIndicator = () => {
|
|
|
9453
9454
|
children: [floorToTenth(currentContrastRatio).toFixed(1), ":1"]
|
|
9454
9455
|
})
|
|
9455
9456
|
] });
|
|
9456
|
-
return /* @__PURE__ */ jsx(Container$
|
|
9457
|
+
return /* @__PURE__ */ jsx(Container$2, { children: isContrastSufficient ? /* @__PURE__ */ jsx(Badge, {
|
|
9457
9458
|
colorScheme: "success",
|
|
9458
9459
|
icon: /* @__PURE__ */ jsx(Icon, { type: "checkmark" }),
|
|
9459
9460
|
label,
|
|
@@ -9920,7 +9921,7 @@ const HSVHueCanvas = ({ hsv }) => {
|
|
|
9920
9921
|
};
|
|
9921
9922
|
//#endregion
|
|
9922
9923
|
//#region src/components/ColorPicker/HueSlider.tsx
|
|
9923
|
-
const Container$
|
|
9924
|
+
const Container$1 = styled.div`
|
|
9924
9925
|
border-radius: var(--wui-border-radius-rounded);
|
|
9925
9926
|
border: 1px solid var(--wui-color-border);
|
|
9926
9927
|
height: ${24}px;
|
|
@@ -9928,7 +9929,7 @@ const Container$2 = styled.div`
|
|
|
9928
9929
|
padding: 0 var(--wui-space-03);
|
|
9929
9930
|
position: relative;
|
|
9930
9931
|
`;
|
|
9931
|
-
const Root = styled(Slider$1.Root)`
|
|
9932
|
+
const Root$1 = styled(Slider$1.Root)`
|
|
9932
9933
|
align-items: center;
|
|
9933
9934
|
display: flex;
|
|
9934
9935
|
position: absolute;
|
|
@@ -9945,7 +9946,7 @@ const Control = styled(Slider$1.Control)`
|
|
|
9945
9946
|
const Track = styled(Slider$1.Track)`
|
|
9946
9947
|
width: 100%;
|
|
9947
9948
|
`;
|
|
9948
|
-
const Thumb$
|
|
9949
|
+
const Thumb$2 = styled(Slider$1.Thumb)`
|
|
9949
9950
|
position: relative;
|
|
9950
9951
|
`;
|
|
9951
9952
|
const ThumbInner = styled.div`
|
|
@@ -9960,7 +9961,7 @@ const ThumbInner = styled.div`
|
|
|
9960
9961
|
transform: translate(-50%, -50%);
|
|
9961
9962
|
width: 16px;
|
|
9962
9963
|
|
|
9963
|
-
${Thumb$
|
|
9964
|
+
${Thumb$2}:focus-visible > & {
|
|
9964
9965
|
box-shadow:
|
|
9965
9966
|
inset 0 0 0 2px var(--wui-color-border),
|
|
9966
9967
|
inset 0 0 0 3px black;
|
|
@@ -9998,10 +9999,10 @@ const HueSlider = (props) => {
|
|
|
9998
9999
|
h: newHue
|
|
9999
10000
|
});
|
|
10000
10001
|
}, [nonDerivedValueAsHsv, onChangeNonDerivedValueAsHsv]);
|
|
10001
|
-
return /* @__PURE__ */ jsxs(Container$
|
|
10002
|
+
return /* @__PURE__ */ jsxs(Container$1, {
|
|
10002
10003
|
...props,
|
|
10003
10004
|
style: containerStyle,
|
|
10004
|
-
children: [/* @__PURE__ */ jsx(Root, {
|
|
10005
|
+
children: [/* @__PURE__ */ jsx(Root$1, {
|
|
10005
10006
|
max: 360,
|
|
10006
10007
|
min: 0,
|
|
10007
10008
|
onValueChange: onHueChange,
|
|
@@ -10009,7 +10010,7 @@ const HueSlider = (props) => {
|
|
|
10009
10010
|
orientation: "horizontal",
|
|
10010
10011
|
step: 1,
|
|
10011
10012
|
value: [nonDerivedValueAsHsv.h ?? 0],
|
|
10012
|
-
children: /* @__PURE__ */ jsxs(Control, { children: [/* @__PURE__ */ jsx(Track, {}), /* @__PURE__ */ jsx(Thumb$
|
|
10013
|
+
children: /* @__PURE__ */ jsxs(Control, { children: [/* @__PURE__ */ jsx(Track, {}), /* @__PURE__ */ jsx(Thumb$2, {
|
|
10013
10014
|
"aria-label": "Hue slider",
|
|
10014
10015
|
children: /* @__PURE__ */ jsx(ThumbInner, { style: thumbInnerStyle })
|
|
10015
10016
|
})] })
|
|
@@ -10137,13 +10138,13 @@ const HSVSaturationValueCanvas = ({ hue, shouldShowContrastCurve, minimumContras
|
|
|
10137
10138
|
//#region src/components/ColorPicker/SaturationAndValuePicker.tsx
|
|
10138
10139
|
const SATURATION_NUDGE = .02;
|
|
10139
10140
|
const VALUE_NUDGE = .02;
|
|
10140
|
-
const Container
|
|
10141
|
+
const Container = styled.div`
|
|
10141
10142
|
border-radius: var(--wui-border-radius-02);
|
|
10142
10143
|
box-shadow: 0 0 0 1px var(--wui-color-border);
|
|
10143
10144
|
overflow: hidden;
|
|
10144
10145
|
position: relative;
|
|
10145
10146
|
`;
|
|
10146
|
-
const Thumb = styled.button.attrs({ type: "button" })`
|
|
10147
|
+
const Thumb$1 = styled.button.attrs({ type: "button" })`
|
|
10147
10148
|
appearance: none;
|
|
10148
10149
|
border-radius: var(--wui-border-radius-rounded);
|
|
10149
10150
|
border: none;
|
|
@@ -10281,12 +10282,12 @@ const SaturationAndValuePicker = ({ dataTestId }) => {
|
|
|
10281
10282
|
window.removeEventListener("mouseup", onWindowMouseUp);
|
|
10282
10283
|
};
|
|
10283
10284
|
}, [onWindowMouseMove, onWindowMouseUp]);
|
|
10284
|
-
return /* @__PURE__ */ jsxs(Container
|
|
10285
|
+
return /* @__PURE__ */ jsxs(Container, {
|
|
10285
10286
|
ref: containerRef,
|
|
10286
10287
|
"data-testid": dataTestId,
|
|
10287
10288
|
onMouseDown: onContainerMouseDown,
|
|
10288
10289
|
children: [
|
|
10289
|
-
/* @__PURE__ */ jsx(Thumb, {
|
|
10290
|
+
/* @__PURE__ */ jsx(Thumb$1, {
|
|
10290
10291
|
ref: thumbRef,
|
|
10291
10292
|
"aria-describedby": instructionsId,
|
|
10292
10293
|
"aria-label": "Saturation and value thumb",
|
|
@@ -15865,96 +15866,188 @@ const RadioCardImage = ({ label, imageSrc, aspectRatio, padding = "space-04", re
|
|
|
15865
15866
|
//#endregion
|
|
15866
15867
|
//#region src/components/ScrollArea/ScrollArea.tsx
|
|
15867
15868
|
const SHADOW_SIZE_PX = 8;
|
|
15868
|
-
const
|
|
15869
|
-
|
|
15870
|
-
|
|
15871
|
-
|
|
15872
|
-
|
|
15873
|
-
const ScrollContainer = styled.div`
|
|
15874
|
-
overflow: ${({ $locked }) => $locked ? "hidden" : "auto"};
|
|
15875
|
-
height: 100%;
|
|
15876
|
-
width: 100%;
|
|
15877
|
-
`;
|
|
15869
|
+
const FADE_SIZE_PX = 32;
|
|
15870
|
+
const SCROLLBAR_SIZE_PX = 12;
|
|
15871
|
+
const SCROLLBAR_PADDING_PX = 2;
|
|
15872
|
+
const THUMB_SIZE_PX = 6;
|
|
15873
|
+
const THUMB_SIZE_ACTIVE_PX = 8;
|
|
15878
15874
|
const Shadow = styled.div`
|
|
15879
15875
|
pointer-events: none;
|
|
15880
15876
|
position: absolute;
|
|
15881
15877
|
transition: box-shadow var(--wui-motion-duration-04) var(--wui-motion-ease);
|
|
15882
|
-
box-shadow:
|
|
15878
|
+
box-shadow: none;
|
|
15883
15879
|
z-index: 1;
|
|
15884
15880
|
`;
|
|
15885
15881
|
const ShadowAtTop = styled(Shadow)`
|
|
15886
|
-
transform: translateY(-${SHADOW_SIZE_PX}px);
|
|
15887
15882
|
height: 0;
|
|
15888
|
-
|
|
15889
|
-
|
|
15890
|
-
top: 0;
|
|
15883
|
+
inset-inline: 0;
|
|
15884
|
+
top: -${SHADOW_SIZE_PX}px;
|
|
15891
15885
|
`;
|
|
15892
15886
|
const ShadowAtBottom = styled(Shadow)`
|
|
15893
|
-
|
|
15894
|
-
bottom: 0;
|
|
15887
|
+
bottom: -${SHADOW_SIZE_PX}px;
|
|
15895
15888
|
height: 0;
|
|
15896
|
-
|
|
15897
|
-
right: 0;
|
|
15889
|
+
inset-inline: 0;
|
|
15898
15890
|
`;
|
|
15899
|
-
const
|
|
15900
|
-
|
|
15901
|
-
|
|
15902
|
-
left: 0;
|
|
15903
|
-
top: 0;
|
|
15891
|
+
const ShadowAtInlineStart = styled(Shadow)`
|
|
15892
|
+
inset-block: 0;
|
|
15893
|
+
inset-inline-start: -${SHADOW_SIZE_PX}px;
|
|
15904
15894
|
width: 0;
|
|
15905
15895
|
`;
|
|
15906
|
-
const
|
|
15907
|
-
|
|
15908
|
-
|
|
15909
|
-
right: 0;
|
|
15910
|
-
top: 0;
|
|
15896
|
+
const ShadowAtInlineEnd = styled(Shadow)`
|
|
15897
|
+
inset-block: 0;
|
|
15898
|
+
inset-inline-end: -${SHADOW_SIZE_PX}px;
|
|
15911
15899
|
width: 0;
|
|
15912
15900
|
`;
|
|
15901
|
+
const fadeMaskCss = css`
|
|
15902
|
+
--wui-scroll-area-fade-size: ${FADE_SIZE_PX}px;
|
|
15903
|
+
--wui-scroll-area-fade-inline-direction: to right;
|
|
15904
|
+
|
|
15905
|
+
mask-composite: intersect;
|
|
15906
|
+
mask-image:
|
|
15907
|
+
linear-gradient(
|
|
15908
|
+
to bottom,
|
|
15909
|
+
transparent,
|
|
15910
|
+
#000000 min(var(--wui-scroll-area-fade-size), var(--scroll-area-overflow-y-start, 0px)),
|
|
15911
|
+
#000000
|
|
15912
|
+
calc(100% - min(var(--wui-scroll-area-fade-size), var(--scroll-area-overflow-y-end, 0px))),
|
|
15913
|
+
transparent
|
|
15914
|
+
),
|
|
15915
|
+
linear-gradient(
|
|
15916
|
+
var(--wui-scroll-area-fade-inline-direction),
|
|
15917
|
+
transparent,
|
|
15918
|
+
#000000 min(var(--wui-scroll-area-fade-size), var(--scroll-area-overflow-x-start, 0px)),
|
|
15919
|
+
#000000
|
|
15920
|
+
calc(100% - min(var(--wui-scroll-area-fade-size), var(--scroll-area-overflow-x-end, 0px))),
|
|
15921
|
+
transparent
|
|
15922
|
+
);
|
|
15923
|
+
|
|
15924
|
+
&:dir(rtl) {
|
|
15925
|
+
--wui-scroll-area-fade-inline-direction: to left;
|
|
15926
|
+
}
|
|
15927
|
+
`;
|
|
15928
|
+
const Viewport = styled(ScrollArea$1.Viewport)`
|
|
15929
|
+
/* a flex item, not height: 100%, so it still shrinks to fit when the root's
|
|
15930
|
+
height is only capped (max-height) or comes from a flex parent */
|
|
15931
|
+
flex: 1 1 auto;
|
|
15932
|
+
min-height: 0;
|
|
15933
|
+
width: 100%;
|
|
15934
|
+
|
|
15935
|
+
&:focus-visible {
|
|
15936
|
+
/* the root draws the focus ring, so the fade mask can't dim it */
|
|
15937
|
+
outline: none;
|
|
15938
|
+
}
|
|
15939
|
+
|
|
15940
|
+
${({ $overflowIndicator }) => $overflowIndicator === "fade" && fadeMaskCss}
|
|
15941
|
+
`;
|
|
15942
|
+
const Root = styled(ScrollArea$1.Root)`
|
|
15943
|
+
display: flex;
|
|
15944
|
+
flex-direction: column;
|
|
15945
|
+
overflow: hidden;
|
|
15946
|
+
flex: 1 1 auto;
|
|
15947
|
+
|
|
15948
|
+
&:has(> ${Viewport}:focus-visible) {
|
|
15949
|
+
outline: 2px solid var(--wui-color-focus-ring);
|
|
15950
|
+
outline-offset: -2px;
|
|
15951
|
+
}
|
|
15952
|
+
|
|
15953
|
+
&[data-overflow-y-start] > ${ShadowAtTop},
|
|
15954
|
+
&[data-overflow-y-end] > ${ShadowAtBottom},
|
|
15955
|
+
&[data-overflow-x-start] > ${ShadowAtInlineStart},
|
|
15956
|
+
&[data-overflow-x-end] > ${ShadowAtInlineEnd} {
|
|
15957
|
+
box-shadow: 0 0 ${SHADOW_SIZE_PX}px ${SHADOW_SIZE_PX}px var(--wui-color-drop-shadow);
|
|
15958
|
+
}
|
|
15959
|
+
`;
|
|
15960
|
+
const Thumb = styled(ScrollArea$1.Thumb)`
|
|
15961
|
+
background-color: var(--wui-gray-alpha-8);
|
|
15962
|
+
border-radius: var(--wui-border-radius-rounded);
|
|
15963
|
+
transition-duration: var(--wui-motion-duration-03);
|
|
15964
|
+
transition-property: background-color, height, width;
|
|
15965
|
+
transition-timing-function: var(--wui-motion-ease);
|
|
15966
|
+
|
|
15967
|
+
&[data-orientation='vertical'] {
|
|
15968
|
+
width: ${THUMB_SIZE_PX}px;
|
|
15969
|
+
}
|
|
15970
|
+
|
|
15971
|
+
&[data-orientation='horizontal'] {
|
|
15972
|
+
height: ${THUMB_SIZE_PX}px;
|
|
15973
|
+
}
|
|
15974
|
+
`;
|
|
15975
|
+
const Scrollbar = styled(ScrollArea$1.Scrollbar)`
|
|
15976
|
+
display: flex;
|
|
15977
|
+
opacity: 0;
|
|
15978
|
+
padding: ${SCROLLBAR_PADDING_PX}px;
|
|
15979
|
+
pointer-events: none;
|
|
15980
|
+
transition: opacity var(--wui-motion-duration-04) var(--wui-motion-ease)
|
|
15981
|
+
var(--wui-motion-duration-03);
|
|
15982
|
+
z-index: 2;
|
|
15983
|
+
|
|
15984
|
+
&[data-orientation='vertical'] {
|
|
15985
|
+
justify-content: flex-end;
|
|
15986
|
+
width: ${SCROLLBAR_SIZE_PX}px;
|
|
15987
|
+
}
|
|
15988
|
+
|
|
15989
|
+
&[data-orientation='horizontal'] {
|
|
15990
|
+
align-items: flex-end;
|
|
15991
|
+
height: ${SCROLLBAR_SIZE_PX}px;
|
|
15992
|
+
}
|
|
15993
|
+
|
|
15994
|
+
&[data-hovering],
|
|
15995
|
+
&[data-scrolling] {
|
|
15996
|
+
opacity: 1;
|
|
15997
|
+
pointer-events: auto;
|
|
15998
|
+
transition-delay: 0s;
|
|
15999
|
+
transition-duration: var(--wui-motion-duration-01);
|
|
16000
|
+
}
|
|
16001
|
+
|
|
16002
|
+
&:is(:hover, :active) > ${Thumb} {
|
|
16003
|
+
background-color: var(--wui-gray-alpha-9);
|
|
16004
|
+
}
|
|
16005
|
+
|
|
16006
|
+
&[data-orientation='vertical']:is(:hover, :active) > ${Thumb} {
|
|
16007
|
+
width: ${THUMB_SIZE_ACTIVE_PX}px;
|
|
16008
|
+
}
|
|
16009
|
+
|
|
16010
|
+
&[data-orientation='horizontal']:is(:hover, :active) > ${Thumb} {
|
|
16011
|
+
height: ${THUMB_SIZE_ACTIVE_PX}px;
|
|
16012
|
+
}
|
|
16013
|
+
`;
|
|
16014
|
+
const CONTENT_STYLE = { minWidth: 0 };
|
|
15913
16015
|
/**
|
|
15914
|
-
* ScrollArea is a
|
|
15915
|
-
* scrollability.
|
|
16016
|
+
* ScrollArea is a scrollable container with shadow or fade effects to indicate
|
|
16017
|
+
* scrollability. Its scrollbars overlay the content and only appear while the
|
|
16018
|
+
* pointer is over the area or the content is being scrolled.
|
|
15916
16019
|
*/
|
|
15917
|
-
const ScrollArea = ({ children,
|
|
15918
|
-
|
|
15919
|
-
const [shadowState, setShadowState] = useState({
|
|
15920
|
-
canScrollUp: false,
|
|
15921
|
-
canScrollLeft: false,
|
|
15922
|
-
canScrollDown: false,
|
|
15923
|
-
canScrollRight: false
|
|
15924
|
-
});
|
|
15925
|
-
const scrollContainerRef = mergeRefs([scrollContainerRefInternal, forwardedRef]);
|
|
15926
|
-
const updateShadows = useCallback(() => {
|
|
15927
|
-
const scrollContainer = scrollContainerRefInternal.current;
|
|
15928
|
-
if (!scrollContainer) return;
|
|
15929
|
-
setShadowState({
|
|
15930
|
-
canScrollUp: scrollContainer.scrollTop > 0,
|
|
15931
|
-
canScrollLeft: scrollContainer.scrollLeft > 0,
|
|
15932
|
-
canScrollDown: scrollContainer.scrollTop + scrollContainer.clientHeight < scrollContainer.scrollHeight,
|
|
15933
|
-
canScrollRight: scrollContainer.scrollLeft + scrollContainer.clientWidth < scrollContainer.scrollWidth
|
|
15934
|
-
});
|
|
15935
|
-
}, []);
|
|
15936
|
-
const throttledUpdateShadows = useMemo(() => throttle(100, updateShadows), [updateShadows]);
|
|
15937
|
-
const onScrollScrollContainer = useCallback((event) => {
|
|
15938
|
-
onScroll?.(event);
|
|
15939
|
-
throttledUpdateShadows();
|
|
15940
|
-
}, [onScroll, throttledUpdateShadows]);
|
|
15941
|
-
useEffect(() => {
|
|
15942
|
-
updateShadows();
|
|
15943
|
-
}, [updateShadows]);
|
|
15944
|
-
return /* @__PURE__ */ jsxs(Container, {
|
|
16020
|
+
const ScrollArea = ({ children, style, locked = false, overflowIndicator = "shadow", ref, ...props }) => {
|
|
16021
|
+
return /* @__PURE__ */ jsxs(Root, {
|
|
15945
16022
|
style,
|
|
15946
16023
|
children: [
|
|
15947
|
-
/* @__PURE__ */
|
|
15948
|
-
|
|
15949
|
-
|
|
15950
|
-
|
|
15951
|
-
|
|
15952
|
-
|
|
15953
|
-
|
|
15954
|
-
|
|
16024
|
+
overflowIndicator === "shadow" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16025
|
+
/* @__PURE__ */ jsx(ShadowAtTop, {}),
|
|
16026
|
+
/* @__PURE__ */ jsx(ShadowAtBottom, {}),
|
|
16027
|
+
/* @__PURE__ */ jsx(ShadowAtInlineStart, {}),
|
|
16028
|
+
/* @__PURE__ */ jsx(ShadowAtInlineEnd, {})
|
|
16029
|
+
] }) : null,
|
|
16030
|
+
/* @__PURE__ */ jsx(Viewport, {
|
|
16031
|
+
ref,
|
|
16032
|
+
$overflowIndicator: overflowIndicator,
|
|
16033
|
+
style: locked ? { overflow: "hidden" } : void 0,
|
|
15955
16034
|
...props,
|
|
15956
|
-
children
|
|
15957
|
-
|
|
16035
|
+
children: /* @__PURE__ */ jsx(ScrollArea$1.Content, {
|
|
16036
|
+
style: CONTENT_STYLE,
|
|
16037
|
+
children
|
|
16038
|
+
})
|
|
16039
|
+
}),
|
|
16040
|
+
locked ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16041
|
+
/* @__PURE__ */ jsx(Scrollbar, {
|
|
16042
|
+
orientation: "vertical",
|
|
16043
|
+
children: /* @__PURE__ */ jsx(Thumb, {})
|
|
16044
|
+
}),
|
|
16045
|
+
/* @__PURE__ */ jsx(Scrollbar, {
|
|
16046
|
+
orientation: "horizontal",
|
|
16047
|
+
children: /* @__PURE__ */ jsx(Thumb, {})
|
|
16048
|
+
}),
|
|
16049
|
+
/* @__PURE__ */ jsx(ScrollArea$1.Corner, {})
|
|
16050
|
+
] })
|
|
15958
16051
|
]
|
|
15959
16052
|
});
|
|
15960
16053
|
};
|
|
@@ -16505,19 +16598,21 @@ SidebarTitle.displayName = "SidebarTitle_UI";
|
|
|
16505
16598
|
//#endregion
|
|
16506
16599
|
//#region src/components/Sidebar/SidebarContent.tsx
|
|
16507
16600
|
const StyledSidebarContent = styled(ScrollArea)`
|
|
16508
|
-
display: flex;
|
|
16509
|
-
flex-direction: column;
|
|
16510
16601
|
flex: 1 1 auto;
|
|
16511
16602
|
min-height: 0;
|
|
16512
|
-
gap: var(--wui-sidebar-group-gap);
|
|
16513
16603
|
padding-top: var(--wui-sidebar-content-top-padding);
|
|
16514
16604
|
padding-bottom: var(--wui-sidebar-content-bottom-padding);
|
|
16515
16605
|
padding-inline: var(--wui-sidebar-padding-inline);
|
|
16516
16606
|
`;
|
|
16607
|
+
const SidebarGroups = styled.div`
|
|
16608
|
+
display: flex;
|
|
16609
|
+
flex-direction: column;
|
|
16610
|
+
gap: var(--wui-sidebar-group-gap);
|
|
16611
|
+
`;
|
|
16517
16612
|
const SidebarContent = ({ children }) => {
|
|
16518
16613
|
return /* @__PURE__ */ jsx(StyledSidebarContent, {
|
|
16519
16614
|
"data-wui-sidebar-content": true,
|
|
16520
|
-
children
|
|
16615
|
+
children: /* @__PURE__ */ jsx(SidebarGroups, { children })
|
|
16521
16616
|
});
|
|
16522
16617
|
};
|
|
16523
16618
|
SidebarContent.displayName = "SidebarContent_UI";
|