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

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.9.1
3
+ * @license @wistia/ui v2.10.0-beta.468cd2d8.96512f1
4
4
  *
5
5
  * Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
6
6
  *
@@ -28,6 +28,7 @@ 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";
31
32
  import { ContextMenu as ContextMenu$1 } from "@base-ui/react/context-menu";
32
33
  import { Menu as Menu$1 } from "@base-ui/react/menu";
33
34
  import { createPortal } from "react-dom";
@@ -37,7 +38,6 @@ import { PreviewCard as PreviewCard$1 } from "@base-ui/react/preview-card";
37
38
  import ReactMarkdown from "react-markdown";
38
39
  import { Dialog } from "@base-ui/react/dialog";
39
40
  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,6 +10350,206 @@ 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
10353
10553
  //#region src/components/Tag/Tag.tsx
10354
10554
  const TagLabel = styled.a`
10355
10555
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
@@ -10548,7 +10748,6 @@ const ComboboxPopover = styled(Ariakit.ComboboxPopover)`
10548
10748
  --wui-combobox-option-bg-hover: var(--wui-color-bg-surface-hover);
10549
10749
 
10550
10750
  border-radius: var(--wui-border-radius-02);
10551
- padding: var(--wui-space-02);
10552
10751
  max-height: var(--wui-popover-max-height, 300px);
10553
10752
  background-color: var(--wui-color-bg-surface);
10554
10753
  box-shadow: var(--wui-elevation-01);
@@ -10557,14 +10756,21 @@ const ComboboxPopover = styled(Ariakit.ComboboxPopover)`
10557
10756
  z-index: 50;
10558
10757
  display: flex;
10559
10758
  flex-direction: column;
10560
- overflow: auto;
10561
- overscroll-behavior: contain;
10759
+ overflow: hidden;
10562
10760
  margin-top: var(--wui-space-02);
10563
10761
 
10564
10762
  &[aria-busy='true'] {
10565
10763
  --item-opacity: 0.5;
10566
10764
  }
10567
10765
  `;
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
+ `;
10568
10774
  const ComboboxItem = styled(Ariakit.ComboboxItem)`
10569
10775
  ${getTypographicStyles("body3")};
10570
10776
  display: flex;
@@ -10665,22 +10871,25 @@ const Combobox = ({ "aria-label": ariaLabel, placeholder, value, onChange, searc
10665
10871
  autoSelect: true,
10666
10872
  placeholder
10667
10873
  })]
10668
- }), /* @__PURE__ */ jsxs(ComboboxPopover, {
10874
+ }), /* @__PURE__ */ jsx(ComboboxPopover, {
10669
10875
  "aria-busy": isPending,
10670
10876
  flip: flipPopover,
10671
10877
  gutter: 8,
10672
10878
  onClose: () => onSearchValueChange(""),
10673
10879
  sameWidth: false,
10674
10880
  style: { width: wrapperWidth },
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" })]
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
+ })
10684
10893
  })]
10685
10894
  });
10686
10895
  };
@@ -15864,194 +16073,6 @@ const RadioCardImage = ({ label, imageSrc, aspectRatio, padding = "space-04", re
15864
16073
  });
15865
16074
  };
15866
16075
  //#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
- ${({ $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 };
16015
- /**
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.
16019
- */
16020
- const ScrollArea = ({ children, style, locked = false, overflowIndicator = "shadow", ref, ...props }) => {
16021
- return /* @__PURE__ */ jsxs(Root, {
16022
- style,
16023
- children: [
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,
16034
- ...props,
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
- ] })
16051
- ]
16052
- });
16053
- };
16054
- //#endregion
16055
16076
  //#region src/components/SegmentedControl/useSegmentedControlValue.tsx
16056
16077
  const SegmentedControlValueContext = createContext(null);
16057
16078
  const SegmentedControlValueProvider = SegmentedControlValueContext;