@wistia/ui 2.8.1 → 2.9.0-beta.1f60fa69.18dc8c1

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.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v2.8.1
3
+ * @license @wistia/ui v2.9.0-beta.1f60fa69.18dc8c1
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, throttle } from "throttle-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$9 = styled.div`
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$9, { children: [label != null && /* @__PURE__ */ jsx(LabelContainer$1, { children: /* @__PURE__ */ jsx(Label, { children: label }) }), /* @__PURE__ */ jsx(ItemsContainer$1, {
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$8 = styled(Radio$1.Root)`
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$8, {
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$7 = styled(ToggleGroup)`
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$7, {
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$6 = styled.div`
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$6, {
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$5 = styled(Toggle)`
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$5, {
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$4 = styled.div`
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$4, { children: /* @__PURE__ */ jsx(Stack, { children }) });
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$3 = styled.div`
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$3, { children: isContrastSufficient ? /* @__PURE__ */ jsx(Badge, {
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$2 = styled.div`
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$1 = styled(Slider$1.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$1}:focus-visible > & {
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$2, {
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$1, {
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$1 = styled.div`
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$1, {
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,179 @@ 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 Container = styled.div`
15869
- overflow: hidden;
15870
- position: relative;
15871
- flex: 1 1 auto;
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: ${({ $isVisible }) => $isVisible ? `0 0 ${SHADOW_SIZE_PX}px ${SHADOW_SIZE_PX}px var(--wui-color-drop-shadow)` : "none"};
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
- left: 0;
15889
- right: 0;
15890
- top: 0;
15883
+ inset-inline: 0;
15884
+ top: -${SHADOW_SIZE_PX}px;
15891
15885
  `;
15892
15886
  const ShadowAtBottom = styled(Shadow)`
15893
- transform: translateY(${SHADOW_SIZE_PX}px);
15894
- bottom: 0;
15887
+ bottom: -${SHADOW_SIZE_PX}px;
15895
15888
  height: 0;
15896
- left: 0;
15897
- right: 0;
15889
+ inset-inline: 0;
15898
15890
  `;
15899
- const ShadowAtLeft = styled(Shadow)`
15900
- transform: translateX(-${SHADOW_SIZE_PX}px);
15901
- bottom: 0;
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 ShadowAtRight = styled(Shadow)`
15907
- transform: translateX(${SHADOW_SIZE_PX}px);
15908
- bottom: 0;
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
+ height: 100%;
15930
+ width: 100%;
15931
+
15932
+ &:focus-visible {
15933
+ /* the root draws the focus ring, so the fade mask can't dim it */
15934
+ outline: none;
15935
+ }
15936
+
15937
+ ${({ $overflowIndicator }) => $overflowIndicator === "fade" && fadeMaskCss}
15938
+ `;
15939
+ const Root = styled(ScrollArea$1.Root)`
15940
+ overflow: hidden;
15941
+ flex: 1 1 auto;
15942
+
15943
+ &:has(> ${Viewport}:focus-visible) {
15944
+ outline: 2px solid var(--wui-color-focus-ring);
15945
+ outline-offset: -2px;
15946
+ }
15947
+
15948
+ &[data-overflow-y-start] > ${ShadowAtTop},
15949
+ &[data-overflow-y-end] > ${ShadowAtBottom},
15950
+ &[data-overflow-x-start] > ${ShadowAtInlineStart},
15951
+ &[data-overflow-x-end] > ${ShadowAtInlineEnd} {
15952
+ box-shadow: 0 0 ${SHADOW_SIZE_PX}px ${SHADOW_SIZE_PX}px var(--wui-color-drop-shadow);
15953
+ }
15954
+ `;
15955
+ const Thumb = styled(ScrollArea$1.Thumb)`
15956
+ background-color: var(--wui-gray-alpha-8);
15957
+ border-radius: var(--wui-border-radius-rounded);
15958
+ transition-duration: var(--wui-motion-duration-03);
15959
+ transition-property: background-color, height, width;
15960
+ transition-timing-function: var(--wui-motion-ease);
15961
+
15962
+ &[data-orientation='vertical'] {
15963
+ width: ${THUMB_SIZE_PX}px;
15964
+ }
15965
+
15966
+ &[data-orientation='horizontal'] {
15967
+ height: ${THUMB_SIZE_PX}px;
15968
+ }
15969
+ `;
15970
+ const Scrollbar = styled(ScrollArea$1.Scrollbar)`
15971
+ display: flex;
15972
+ opacity: 0;
15973
+ padding: ${SCROLLBAR_PADDING_PX}px;
15974
+ pointer-events: none;
15975
+ transition: opacity var(--wui-motion-duration-04) var(--wui-motion-ease)
15976
+ var(--wui-motion-duration-03);
15977
+ z-index: 2;
15978
+
15979
+ &[data-orientation='vertical'] {
15980
+ justify-content: flex-end;
15981
+ width: ${SCROLLBAR_SIZE_PX}px;
15982
+ }
15983
+
15984
+ &[data-orientation='horizontal'] {
15985
+ align-items: flex-end;
15986
+ height: ${SCROLLBAR_SIZE_PX}px;
15987
+ }
15988
+
15989
+ &[data-hovering],
15990
+ &[data-scrolling] {
15991
+ opacity: 1;
15992
+ pointer-events: auto;
15993
+ transition-delay: 0s;
15994
+ transition-duration: var(--wui-motion-duration-01);
15995
+ }
15996
+
15997
+ &:is(:hover, :active) > ${Thumb} {
15998
+ background-color: var(--wui-gray-alpha-9);
15999
+ }
16000
+
16001
+ &[data-orientation='vertical']:is(:hover, :active) > ${Thumb} {
16002
+ width: ${THUMB_SIZE_ACTIVE_PX}px;
16003
+ }
16004
+
16005
+ &[data-orientation='horizontal']:is(:hover, :active) > ${Thumb} {
16006
+ height: ${THUMB_SIZE_ACTIVE_PX}px;
16007
+ }
16008
+ `;
15913
16009
  /**
15914
- * ScrollArea is a simple scrollable container with shadow effects to indicate
15915
- * scrollability.
16010
+ * ScrollArea is a scrollable container with shadow or fade effects to indicate
16011
+ * scrollability. Its scrollbars overlay the content and only appear while the
16012
+ * pointer is over the area or the content is being scrolled.
15916
16013
  */
15917
- const ScrollArea = ({ children, onScroll, style, locked = false, ref: forwardedRef, ...props }) => {
15918
- const scrollContainerRefInternal = useRef(null);
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, {
16014
+ const ScrollArea = ({ children, style, locked = false, overflowIndicator = "shadow", ref, ...props }) => {
16015
+ return /* @__PURE__ */ jsxs(Root, {
15945
16016
  style,
15946
16017
  children: [
15947
- /* @__PURE__ */ jsx(ShadowAtTop, { $isVisible: shadowState.canScrollUp }),
15948
- /* @__PURE__ */ jsx(ShadowAtBottom, { $isVisible: shadowState.canScrollDown }),
15949
- /* @__PURE__ */ jsx(ShadowAtLeft, { $isVisible: shadowState.canScrollLeft }),
15950
- /* @__PURE__ */ jsx(ShadowAtRight, { $isVisible: shadowState.canScrollRight }),
15951
- /* @__PURE__ */ jsx(ScrollContainer, {
15952
- ref: scrollContainerRef,
15953
- $locked: locked,
15954
- onScroll: onScrollScrollContainer,
16018
+ overflowIndicator === "shadow" ? /* @__PURE__ */ jsxs(Fragment, { children: [
16019
+ /* @__PURE__ */ jsx(ShadowAtTop, {}),
16020
+ /* @__PURE__ */ jsx(ShadowAtBottom, {}),
16021
+ /* @__PURE__ */ jsx(ShadowAtInlineStart, {}),
16022
+ /* @__PURE__ */ jsx(ShadowAtInlineEnd, {})
16023
+ ] }) : null,
16024
+ /* @__PURE__ */ jsx(Viewport, {
16025
+ ref,
16026
+ $overflowIndicator: overflowIndicator,
16027
+ style: locked ? { overflow: "hidden" } : void 0,
15955
16028
  ...props,
15956
- children
15957
- })
16029
+ children: /* @__PURE__ */ jsx(ScrollArea$1.Content, { children })
16030
+ }),
16031
+ locked ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
16032
+ /* @__PURE__ */ jsx(Scrollbar, {
16033
+ orientation: "vertical",
16034
+ children: /* @__PURE__ */ jsx(Thumb, {})
16035
+ }),
16036
+ /* @__PURE__ */ jsx(Scrollbar, {
16037
+ orientation: "horizontal",
16038
+ children: /* @__PURE__ */ jsx(Thumb, {})
16039
+ }),
16040
+ /* @__PURE__ */ jsx(ScrollArea$1.Corner, {})
16041
+ ] })
15958
16042
  ]
15959
16043
  });
15960
16044
  };
@@ -16505,19 +16589,21 @@ SidebarTitle.displayName = "SidebarTitle_UI";
16505
16589
  //#endregion
16506
16590
  //#region src/components/Sidebar/SidebarContent.tsx
16507
16591
  const StyledSidebarContent = styled(ScrollArea)`
16508
- display: flex;
16509
- flex-direction: column;
16510
16592
  flex: 1 1 auto;
16511
16593
  min-height: 0;
16512
- gap: var(--wui-sidebar-group-gap);
16513
16594
  padding-top: var(--wui-sidebar-content-top-padding);
16514
16595
  padding-bottom: var(--wui-sidebar-content-bottom-padding);
16515
16596
  padding-inline: var(--wui-sidebar-padding-inline);
16516
16597
  `;
16598
+ const SidebarGroups = styled.div`
16599
+ display: flex;
16600
+ flex-direction: column;
16601
+ gap: var(--wui-sidebar-group-gap);
16602
+ `;
16517
16603
  const SidebarContent = ({ children }) => {
16518
16604
  return /* @__PURE__ */ jsx(StyledSidebarContent, {
16519
16605
  "data-wui-sidebar-content": true,
16520
- children
16606
+ children: /* @__PURE__ */ jsx(SidebarGroups, { children })
16521
16607
  });
16522
16608
  };
16523
16609
  SidebarContent.displayName = "SidebarContent_UI";