@wistia/ui 2.10.0-beta.468cd2d8.96512f1 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v2.10.0-beta.468cd2d8.96512f1
3
+ * @license @wistia/ui v2.10.0
4
4
  *
5
5
  * Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
6
6
  *
@@ -28,7 +28,6 @@ import { Popover as Popover$1 } from "@base-ui/react/popover";
28
28
  import { Slider as Slider$1 } from "@base-ui/react/slider";
29
29
  import * as Ariakit from "@ariakit/react";
30
30
  import { matchSorter } from "match-sorter";
31
- import { ScrollArea as ScrollArea$1 } from "@base-ui/react/scroll-area";
32
31
  import { ContextMenu as ContextMenu$1 } from "@base-ui/react/context-menu";
33
32
  import { Menu as Menu$1 } from "@base-ui/react/menu";
34
33
  import { createPortal } from "react-dom";
@@ -38,6 +37,7 @@ import { PreviewCard as PreviewCard$1 } from "@base-ui/react/preview-card";
38
37
  import ReactMarkdown from "react-markdown";
39
38
  import { Dialog } from "@base-ui/react/dialog";
40
39
  import { Progress } from "@base-ui/react/progress";
40
+ import { ScrollArea as ScrollArea$1 } from "@base-ui/react/scroll-area";
41
41
  import { Select as Select$1 } from "@base-ui/react/select";
42
42
  import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
43
43
  //#region src/components/ClickRegion/globalStyles.tsx
@@ -10350,206 +10350,6 @@ const getDefaultTypographicElement = (variant) => {
10350
10350
  return typographicVariantElementMap[variant] ?? "span";
10351
10351
  };
10352
10352
  //#endregion
10353
- //#region src/components/ScrollArea/ScrollArea.tsx
10354
- const SHADOW_SIZE_PX = 8;
10355
- const FADE_SIZE_PX = 32;
10356
- const SCROLLBAR_SIZE_PX = 12;
10357
- const SCROLLBAR_PADDING_PX = 2;
10358
- const THUMB_SIZE_PX = 6;
10359
- const THUMB_SIZE_ACTIVE_PX = 8;
10360
- const Shadow = styled.div`
10361
- pointer-events: none;
10362
- position: absolute;
10363
- transition: box-shadow var(--wui-motion-duration-04) var(--wui-motion-ease);
10364
- box-shadow: none;
10365
- z-index: 1;
10366
- `;
10367
- const ShadowAtTop = styled(Shadow)`
10368
- height: 0;
10369
- inset-inline: 0;
10370
- top: -${SHADOW_SIZE_PX}px;
10371
- `;
10372
- const ShadowAtBottom = styled(Shadow)`
10373
- bottom: -${SHADOW_SIZE_PX}px;
10374
- height: 0;
10375
- inset-inline: 0;
10376
- `;
10377
- const ShadowAtInlineStart = styled(Shadow)`
10378
- inset-block: 0;
10379
- inset-inline-start: -${SHADOW_SIZE_PX}px;
10380
- width: 0;
10381
- `;
10382
- const ShadowAtInlineEnd = styled(Shadow)`
10383
- inset-block: 0;
10384
- inset-inline-end: -${SHADOW_SIZE_PX}px;
10385
- width: 0;
10386
- `;
10387
- const fadeMaskCss = css`
10388
- --wui-scroll-area-fade-size: ${FADE_SIZE_PX}px;
10389
- --wui-scroll-area-fade-inline-direction: to right;
10390
-
10391
- mask-composite: intersect;
10392
- mask-image:
10393
- linear-gradient(
10394
- to bottom,
10395
- transparent,
10396
- #000000 min(var(--wui-scroll-area-fade-size), var(--scroll-area-overflow-y-start, 0px)),
10397
- #000000
10398
- calc(100% - min(var(--wui-scroll-area-fade-size), var(--scroll-area-overflow-y-end, 0px))),
10399
- transparent
10400
- ),
10401
- linear-gradient(
10402
- var(--wui-scroll-area-fade-inline-direction),
10403
- transparent,
10404
- #000000 min(var(--wui-scroll-area-fade-size), var(--scroll-area-overflow-x-start, 0px)),
10405
- #000000
10406
- calc(100% - min(var(--wui-scroll-area-fade-size), var(--scroll-area-overflow-x-end, 0px))),
10407
- transparent
10408
- );
10409
-
10410
- &:dir(rtl) {
10411
- --wui-scroll-area-fade-inline-direction: to left;
10412
- }
10413
- `;
10414
- const Viewport = styled(ScrollArea$1.Viewport)`
10415
- /* a flex item, not height: 100%, so it still shrinks to fit when the root's
10416
- height is only capped (max-height) or comes from a flex parent */
10417
- flex: 1 1 auto;
10418
- min-height: 0;
10419
- width: 100%;
10420
-
10421
- &:focus-visible {
10422
- /* the root draws the focus ring, so the fade mask can't dim it */
10423
- outline: none;
10424
- }
10425
-
10426
- ${({ $fillHeight }) => $fillHeight && css`
10427
- display: flex;
10428
- flex-direction: column;
10429
- `}
10430
-
10431
- ${({ $overflowIndicator }) => $overflowIndicator === "fade" && fadeMaskCss}
10432
- `;
10433
- const Root = styled(ScrollArea$1.Root)`
10434
- display: flex;
10435
- flex-direction: column;
10436
- overflow: hidden;
10437
- flex: 1 1 auto;
10438
-
10439
- &:has(> ${Viewport}:focus-visible) {
10440
- outline: 2px solid var(--wui-color-focus-ring);
10441
- outline-offset: -2px;
10442
- }
10443
-
10444
- &[data-overflow-y-start] > ${ShadowAtTop},
10445
- &[data-overflow-y-end] > ${ShadowAtBottom},
10446
- &[data-overflow-x-start] > ${ShadowAtInlineStart},
10447
- &[data-overflow-x-end] > ${ShadowAtInlineEnd} {
10448
- box-shadow: 0 0 ${SHADOW_SIZE_PX}px ${SHADOW_SIZE_PX}px var(--wui-color-drop-shadow);
10449
- }
10450
- `;
10451
- const Thumb = styled(ScrollArea$1.Thumb)`
10452
- background-color: var(--wui-gray-alpha-8);
10453
- border-radius: var(--wui-border-radius-rounded);
10454
- transition-duration: var(--wui-motion-duration-03);
10455
- transition-property: background-color, height, width;
10456
- transition-timing-function: var(--wui-motion-ease);
10457
-
10458
- &[data-orientation='vertical'] {
10459
- width: ${THUMB_SIZE_PX}px;
10460
- }
10461
-
10462
- &[data-orientation='horizontal'] {
10463
- height: ${THUMB_SIZE_PX}px;
10464
- }
10465
- `;
10466
- const Scrollbar = styled(ScrollArea$1.Scrollbar)`
10467
- display: flex;
10468
- opacity: 0;
10469
- padding: ${SCROLLBAR_PADDING_PX}px;
10470
- pointer-events: none;
10471
- transition: opacity var(--wui-motion-duration-04) var(--wui-motion-ease)
10472
- var(--wui-motion-duration-03);
10473
- z-index: 2;
10474
-
10475
- &[data-orientation='vertical'] {
10476
- justify-content: flex-end;
10477
- width: ${SCROLLBAR_SIZE_PX}px;
10478
- }
10479
-
10480
- &[data-orientation='horizontal'] {
10481
- align-items: flex-end;
10482
- height: ${SCROLLBAR_SIZE_PX}px;
10483
- }
10484
-
10485
- &[data-hovering],
10486
- &[data-scrolling] {
10487
- opacity: 1;
10488
- pointer-events: auto;
10489
- transition-delay: 0s;
10490
- transition-duration: var(--wui-motion-duration-01);
10491
- }
10492
-
10493
- &:is(:hover, :active) > ${Thumb} {
10494
- background-color: var(--wui-gray-alpha-9);
10495
- }
10496
-
10497
- &[data-orientation='vertical']:is(:hover, :active) > ${Thumb} {
10498
- width: ${THUMB_SIZE_ACTIVE_PX}px;
10499
- }
10500
-
10501
- &[data-orientation='horizontal']:is(:hover, :active) > ${Thumb} {
10502
- height: ${THUMB_SIZE_ACTIVE_PX}px;
10503
- }
10504
- `;
10505
- const CONTENT_STYLE = { minWidth: 0 };
10506
- const FILL_HEIGHT_CONTENT_STYLE = {
10507
- ...CONTENT_STYLE,
10508
- display: "flex",
10509
- flex: "1 0 auto",
10510
- flexDirection: "column"
10511
- };
10512
- /**
10513
- * ScrollArea is a scrollable container with shadow or fade effects to indicate
10514
- * scrollability. Its scrollbars overlay the content and only appear while the
10515
- * pointer is over the area or the content is being scrolled.
10516
- */
10517
- const ScrollArea = ({ children, style, locked = false, fillHeight = false, overflowIndicator = "shadow", ref, ...props }) => {
10518
- return /* @__PURE__ */ jsxs(Root, {
10519
- style,
10520
- children: [
10521
- overflowIndicator === "shadow" ? /* @__PURE__ */ jsxs(Fragment, { children: [
10522
- /* @__PURE__ */ jsx(ShadowAtTop, {}),
10523
- /* @__PURE__ */ jsx(ShadowAtBottom, {}),
10524
- /* @__PURE__ */ jsx(ShadowAtInlineStart, {}),
10525
- /* @__PURE__ */ jsx(ShadowAtInlineEnd, {})
10526
- ] }) : null,
10527
- /* @__PURE__ */ jsx(Viewport, {
10528
- ref,
10529
- $fillHeight: fillHeight,
10530
- $overflowIndicator: overflowIndicator,
10531
- style: locked ? { overflow: "hidden" } : void 0,
10532
- ...props,
10533
- children: /* @__PURE__ */ jsx(ScrollArea$1.Content, {
10534
- style: fillHeight ? FILL_HEIGHT_CONTENT_STYLE : CONTENT_STYLE,
10535
- children
10536
- })
10537
- }),
10538
- locked ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
10539
- /* @__PURE__ */ jsx(Scrollbar, {
10540
- orientation: "vertical",
10541
- children: /* @__PURE__ */ jsx(Thumb, {})
10542
- }),
10543
- /* @__PURE__ */ jsx(Scrollbar, {
10544
- orientation: "horizontal",
10545
- children: /* @__PURE__ */ jsx(Thumb, {})
10546
- }),
10547
- /* @__PURE__ */ jsx(ScrollArea$1.Corner, {})
10548
- ] })
10549
- ]
10550
- });
10551
- };
10552
- //#endregion
10553
10353
  //#region src/components/Tag/Tag.tsx
10554
10354
  const TagLabel = styled.a`
10555
10355
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
@@ -10748,6 +10548,7 @@ const ComboboxPopover = styled(Ariakit.ComboboxPopover)`
10748
10548
  --wui-combobox-option-bg-hover: var(--wui-color-bg-surface-hover);
10749
10549
 
10750
10550
  border-radius: var(--wui-border-radius-02);
10551
+ padding: var(--wui-space-02);
10751
10552
  max-height: var(--wui-popover-max-height, 300px);
10752
10553
  background-color: var(--wui-color-bg-surface);
10753
10554
  box-shadow: var(--wui-elevation-01);
@@ -10756,21 +10557,14 @@ const ComboboxPopover = styled(Ariakit.ComboboxPopover)`
10756
10557
  z-index: 50;
10757
10558
  display: flex;
10758
10559
  flex-direction: column;
10759
- overflow: hidden;
10560
+ overflow: auto;
10561
+ overscroll-behavior: contain;
10760
10562
  margin-top: var(--wui-space-02);
10761
10563
 
10762
10564
  &[aria-busy='true'] {
10763
10565
  --item-opacity: 0.5;
10764
10566
  }
10765
10567
  `;
10766
- const OptionsScrollArea = styled(ScrollArea)`
10767
- overscroll-behavior: contain;
10768
- `;
10769
- const OptionList = styled.div`
10770
- display: flex;
10771
- flex-direction: column;
10772
- padding: var(--wui-space-02);
10773
- `;
10774
10568
  const ComboboxItem = styled(Ariakit.ComboboxItem)`
10775
10569
  ${getTypographicStyles("body3")};
10776
10570
  display: flex;
@@ -10871,25 +10665,22 @@ const Combobox = ({ "aria-label": ariaLabel, placeholder, value, onChange, searc
10871
10665
  autoSelect: true,
10872
10666
  placeholder
10873
10667
  })]
10874
- }), /* @__PURE__ */ jsx(ComboboxPopover, {
10668
+ }), /* @__PURE__ */ jsxs(ComboboxPopover, {
10875
10669
  "aria-busy": isPending,
10876
10670
  flip: flipPopover,
10877
10671
  gutter: 8,
10878
10672
  onClose: () => onSearchValueChange(""),
10879
10673
  sameWidth: false,
10880
10674
  style: { width: wrapperWidth },
10881
- children: /* @__PURE__ */ jsx(OptionsScrollArea, {
10882
- tabIndex: -1,
10883
- children: /* @__PURE__ */ jsxs(OptionList, { children: [matches.map((match) => /* @__PURE__ */ jsxs(ComboboxItem, {
10884
- className: "combobox-item",
10885
- value: match,
10886
- children: [options[match], /* @__PURE__ */ jsx(Icon, {
10887
- size: "md",
10888
- style: { opacity: value.includes(match) ? 1 : 0 },
10889
- type: "checkmark"
10890
- })]
10891
- }, match)), !isNonEmptyArray(matches) && /* @__PURE__ */ jsx(NoResults, { children: "No results found" })] })
10892
- })
10675
+ children: [matches.map((match) => /* @__PURE__ */ jsxs(ComboboxItem, {
10676
+ className: "combobox-item",
10677
+ value: match,
10678
+ children: [options[match], /* @__PURE__ */ jsx(Icon, {
10679
+ size: "md",
10680
+ style: { opacity: value.includes(match) ? 1 : 0 },
10681
+ type: "checkmark"
10682
+ })]
10683
+ }, match)), !isNonEmptyArray(matches) && /* @__PURE__ */ jsx(NoResults, { children: "No results found" })]
10893
10684
  })]
10894
10685
  });
10895
10686
  };
@@ -16073,6 +15864,206 @@ const RadioCardImage = ({ label, imageSrc, aspectRatio, padding = "space-04", re
16073
15864
  });
16074
15865
  };
16075
15866
  //#endregion
15867
+ //#region src/components/ScrollArea/ScrollArea.tsx
15868
+ const SHADOW_SIZE_PX = 8;
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;
15874
+ const Shadow = styled.div`
15875
+ pointer-events: none;
15876
+ position: absolute;
15877
+ transition: box-shadow var(--wui-motion-duration-04) var(--wui-motion-ease);
15878
+ box-shadow: none;
15879
+ z-index: 1;
15880
+ `;
15881
+ const ShadowAtTop = styled(Shadow)`
15882
+ height: 0;
15883
+ inset-inline: 0;
15884
+ top: -${SHADOW_SIZE_PX}px;
15885
+ `;
15886
+ const ShadowAtBottom = styled(Shadow)`
15887
+ bottom: -${SHADOW_SIZE_PX}px;
15888
+ height: 0;
15889
+ inset-inline: 0;
15890
+ `;
15891
+ const ShadowAtInlineStart = styled(Shadow)`
15892
+ inset-block: 0;
15893
+ inset-inline-start: -${SHADOW_SIZE_PX}px;
15894
+ width: 0;
15895
+ `;
15896
+ const ShadowAtInlineEnd = styled(Shadow)`
15897
+ inset-block: 0;
15898
+ inset-inline-end: -${SHADOW_SIZE_PX}px;
15899
+ width: 0;
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
+ ${({ $fillHeight }) => $fillHeight && css`
15941
+ display: flex;
15942
+ flex-direction: column;
15943
+ `}
15944
+
15945
+ ${({ $overflowIndicator }) => $overflowIndicator === "fade" && fadeMaskCss}
15946
+ `;
15947
+ const Root = styled(ScrollArea$1.Root)`
15948
+ display: flex;
15949
+ flex-direction: column;
15950
+ overflow: hidden;
15951
+ flex: 1 1 auto;
15952
+
15953
+ &:has(> ${Viewport}:focus-visible) {
15954
+ outline: 2px solid var(--wui-color-focus-ring);
15955
+ outline-offset: -2px;
15956
+ }
15957
+
15958
+ &[data-overflow-y-start] > ${ShadowAtTop},
15959
+ &[data-overflow-y-end] > ${ShadowAtBottom},
15960
+ &[data-overflow-x-start] > ${ShadowAtInlineStart},
15961
+ &[data-overflow-x-end] > ${ShadowAtInlineEnd} {
15962
+ box-shadow: 0 0 ${SHADOW_SIZE_PX}px ${SHADOW_SIZE_PX}px var(--wui-color-drop-shadow);
15963
+ }
15964
+ `;
15965
+ const Thumb = styled(ScrollArea$1.Thumb)`
15966
+ background-color: var(--wui-gray-alpha-8);
15967
+ border-radius: var(--wui-border-radius-rounded);
15968
+ transition-duration: var(--wui-motion-duration-03);
15969
+ transition-property: background-color, height, width;
15970
+ transition-timing-function: var(--wui-motion-ease);
15971
+
15972
+ &[data-orientation='vertical'] {
15973
+ width: ${THUMB_SIZE_PX}px;
15974
+ }
15975
+
15976
+ &[data-orientation='horizontal'] {
15977
+ height: ${THUMB_SIZE_PX}px;
15978
+ }
15979
+ `;
15980
+ const Scrollbar = styled(ScrollArea$1.Scrollbar)`
15981
+ display: flex;
15982
+ opacity: 0;
15983
+ padding: ${SCROLLBAR_PADDING_PX}px;
15984
+ pointer-events: none;
15985
+ transition: opacity var(--wui-motion-duration-04) var(--wui-motion-ease)
15986
+ var(--wui-motion-duration-03);
15987
+ z-index: 2;
15988
+
15989
+ &[data-orientation='vertical'] {
15990
+ justify-content: flex-end;
15991
+ width: ${SCROLLBAR_SIZE_PX}px;
15992
+ }
15993
+
15994
+ &[data-orientation='horizontal'] {
15995
+ align-items: flex-end;
15996
+ height: ${SCROLLBAR_SIZE_PX}px;
15997
+ }
15998
+
15999
+ &[data-hovering],
16000
+ &[data-scrolling] {
16001
+ opacity: 1;
16002
+ pointer-events: auto;
16003
+ transition-delay: 0s;
16004
+ transition-duration: var(--wui-motion-duration-01);
16005
+ }
16006
+
16007
+ &:is(:hover, :active) > ${Thumb} {
16008
+ background-color: var(--wui-gray-alpha-9);
16009
+ }
16010
+
16011
+ &[data-orientation='vertical']:is(:hover, :active) > ${Thumb} {
16012
+ width: ${THUMB_SIZE_ACTIVE_PX}px;
16013
+ }
16014
+
16015
+ &[data-orientation='horizontal']:is(:hover, :active) > ${Thumb} {
16016
+ height: ${THUMB_SIZE_ACTIVE_PX}px;
16017
+ }
16018
+ `;
16019
+ const CONTENT_STYLE = { minWidth: 0 };
16020
+ const FILL_HEIGHT_CONTENT_STYLE = {
16021
+ ...CONTENT_STYLE,
16022
+ display: "flex",
16023
+ flex: "1 0 auto",
16024
+ flexDirection: "column"
16025
+ };
16026
+ /**
16027
+ * ScrollArea is a scrollable container with shadow or fade effects to indicate
16028
+ * scrollability. Its scrollbars overlay the content and only appear while the
16029
+ * pointer is over the area or the content is being scrolled.
16030
+ */
16031
+ const ScrollArea = ({ children, style, locked = false, fillHeight = false, overflowIndicator = "shadow", ref, ...props }) => {
16032
+ return /* @__PURE__ */ jsxs(Root, {
16033
+ style,
16034
+ children: [
16035
+ overflowIndicator === "shadow" ? /* @__PURE__ */ jsxs(Fragment, { children: [
16036
+ /* @__PURE__ */ jsx(ShadowAtTop, {}),
16037
+ /* @__PURE__ */ jsx(ShadowAtBottom, {}),
16038
+ /* @__PURE__ */ jsx(ShadowAtInlineStart, {}),
16039
+ /* @__PURE__ */ jsx(ShadowAtInlineEnd, {})
16040
+ ] }) : null,
16041
+ /* @__PURE__ */ jsx(Viewport, {
16042
+ ref,
16043
+ $fillHeight: fillHeight,
16044
+ $overflowIndicator: overflowIndicator,
16045
+ style: locked ? { overflow: "hidden" } : void 0,
16046
+ ...props,
16047
+ children: /* @__PURE__ */ jsx(ScrollArea$1.Content, {
16048
+ style: fillHeight ? FILL_HEIGHT_CONTENT_STYLE : CONTENT_STYLE,
16049
+ children
16050
+ })
16051
+ }),
16052
+ locked ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
16053
+ /* @__PURE__ */ jsx(Scrollbar, {
16054
+ orientation: "vertical",
16055
+ children: /* @__PURE__ */ jsx(Thumb, {})
16056
+ }),
16057
+ /* @__PURE__ */ jsx(Scrollbar, {
16058
+ orientation: "horizontal",
16059
+ children: /* @__PURE__ */ jsx(Thumb, {})
16060
+ }),
16061
+ /* @__PURE__ */ jsx(ScrollArea$1.Corner, {})
16062
+ ] })
16063
+ ]
16064
+ });
16065
+ };
16066
+ //#endregion
16076
16067
  //#region src/components/SegmentedControl/useSegmentedControlValue.tsx
16077
16068
  const SegmentedControlValueContext = createContext(null);
16078
16069
  const SegmentedControlValueProvider = SegmentedControlValueContext;