@wistia/ui 2.10.0 → 2.10.1-beta.0d9af5ab.011259b
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.map +1 -1
- package/dist/index.js +259 -230
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/CHANGELOG.md +0 -2471
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v2.10.
|
|
3
|
+
* @license @wistia/ui v2.10.1-beta.0d9af5ab.011259b
|
|
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:
|
|
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__ */
|
|
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:
|
|
10676
|
-
|
|
10677
|
-
|
|
10678
|
-
|
|
10679
|
-
|
|
10680
|
-
|
|
10681
|
-
|
|
10682
|
-
|
|
10683
|
-
|
|
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
|
};
|
|
@@ -10699,6 +10908,20 @@ const ComboboxOption = ({ value, children }) => {
|
|
|
10699
10908
|
const MenuContext = createContext({ compact: false });
|
|
10700
10909
|
const useMenuContext = () => useContext(MenuContext);
|
|
10701
10910
|
//#endregion
|
|
10911
|
+
//#region src/components/Menu/MenuScrollArea.tsx
|
|
10912
|
+
const MenuList = styled.div`
|
|
10913
|
+
padding: var(--menu-padding);
|
|
10914
|
+
`;
|
|
10915
|
+
/**
|
|
10916
|
+
* Scrolls the items of a menu popup. The popup is the capped surface and the items scroll
|
|
10917
|
+
* inside it. Items take focus themselves as the arrow keys move through them, so the scroll
|
|
10918
|
+
* area is kept out of the tab order.
|
|
10919
|
+
*/
|
|
10920
|
+
const MenuScrollArea = ({ children }) => /* @__PURE__ */ jsx(ScrollArea, {
|
|
10921
|
+
tabIndex: -1,
|
|
10922
|
+
children: /* @__PURE__ */ jsx(MenuList, { children })
|
|
10923
|
+
});
|
|
10924
|
+
//#endregion
|
|
10702
10925
|
//#region src/components/Menu/Menu.tsx
|
|
10703
10926
|
const open = keyframes`
|
|
10704
10927
|
from {
|
|
@@ -10762,8 +10985,12 @@ const menuContentCss = css`
|
|
|
10762
10985
|
max-height: var(--available-height);
|
|
10763
10986
|
min-width: var(--menu-min-width);
|
|
10764
10987
|
max-width: var(--menu-max-width);
|
|
10765
|
-
|
|
10766
|
-
|
|
10988
|
+
|
|
10989
|
+
/* the popup is the capped surface; MenuScrollArea scrolls the items inside it and
|
|
10990
|
+
carries the padding */
|
|
10991
|
+
display: flex;
|
|
10992
|
+
flex-direction: column;
|
|
10993
|
+
overflow: hidden;
|
|
10767
10994
|
transform-origin: var(--transform-origin);
|
|
10768
10995
|
border: 1px solid var(--wui-color-border);
|
|
10769
10996
|
|
|
@@ -10773,7 +11000,6 @@ const menuContentCss = css`
|
|
|
10773
11000
|
|
|
10774
11001
|
${mq.smAndUp} {
|
|
10775
11002
|
bottom: 0;
|
|
10776
|
-
padding: var(--menu-padding);
|
|
10777
11003
|
right: 0;
|
|
10778
11004
|
top: 0;
|
|
10779
11005
|
transform: initial;
|
|
@@ -10828,7 +11054,7 @@ const Menu = ({ align = "start", children, disabled = false, compact = false, tr
|
|
|
10828
11054
|
children: /* @__PURE__ */ jsx(MenuPopup, {
|
|
10829
11055
|
...props,
|
|
10830
11056
|
$compact: compact,
|
|
10831
|
-
children
|
|
11057
|
+
children: /* @__PURE__ */ jsx(MenuScrollArea, { children })
|
|
10832
11058
|
})
|
|
10833
11059
|
}) })]
|
|
10834
11060
|
})
|
|
@@ -10900,7 +11126,7 @@ const ContextMenu = ({ position, triggerRef, children, side = "bottom", onReques
|
|
|
10900
11126
|
style: { zIndex: "var(--wui-zindex-menu)" },
|
|
10901
11127
|
children: /* @__PURE__ */ jsx(ContextMenuPopup, {
|
|
10902
11128
|
$compact: compact,
|
|
10903
|
-
children
|
|
11129
|
+
children: /* @__PURE__ */ jsx(MenuScrollArea, { children })
|
|
10904
11130
|
})
|
|
10905
11131
|
}) })
|
|
10906
11132
|
})
|
|
@@ -14909,7 +15135,7 @@ const SubMenu = ({ label, description, children, onOpenChange = NOOP$3, ...props
|
|
|
14909
15135
|
style: { zIndex: "var(--wui-zindex-menu)" },
|
|
14910
15136
|
children: /* @__PURE__ */ jsx(SubMenuPopup, {
|
|
14911
15137
|
$compact: compact,
|
|
14912
|
-
children
|
|
15138
|
+
children: /* @__PURE__ */ jsx(MenuScrollArea, { children })
|
|
14913
15139
|
})
|
|
14914
15140
|
}) })]
|
|
14915
15141
|
}) : /* @__PURE__ */ jsxs(Menu$1.Group, { children: [/* @__PURE__ */ jsxs(SubMenuTrigger, {
|
|
@@ -15034,7 +15260,7 @@ const FilterMenu = ({ value, onChange, searchValue, onSearchValueChange, childre
|
|
|
15034
15260
|
top: 0,
|
|
15035
15261
|
left: 0,
|
|
15036
15262
|
right: 0,
|
|
15037
|
-
|
|
15263
|
+
zIndex: 3
|
|
15038
15264
|
},
|
|
15039
15265
|
children: /* @__PURE__ */ jsx(Input, {
|
|
15040
15266
|
autoFocus: true,
|
|
@@ -15465,14 +15691,14 @@ const ModalBody = styled.div`
|
|
|
15465
15691
|
flex: 1 0 0;
|
|
15466
15692
|
padding: 0 var(--wui-space-05);
|
|
15467
15693
|
`;
|
|
15468
|
-
const
|
|
15469
|
-
|
|
15470
|
-
|
|
15471
|
-
|
|
15472
|
-
height: 100%;
|
|
15473
|
-
`;
|
|
15694
|
+
const MODAL_SCROLL_AREA_STYLE = {
|
|
15695
|
+
order: 2,
|
|
15696
|
+
maxHeight: "90vh"
|
|
15697
|
+
};
|
|
15474
15698
|
const ModalFooter = styled.footer`
|
|
15475
|
-
padding
|
|
15699
|
+
/* with the gap above it, this matches the modal's bottom padding so the space around
|
|
15700
|
+
the footer's contents is even */
|
|
15701
|
+
padding: var(--wui-space-03) var(--wui-space-05) 0;
|
|
15476
15702
|
order: 3;
|
|
15477
15703
|
`;
|
|
15478
15704
|
/**
|
|
@@ -15497,7 +15723,10 @@ const Modal = ({ children, footer, hideCloseButton = false, hideTitle = false, i
|
|
|
15497
15723
|
width,
|
|
15498
15724
|
...props,
|
|
15499
15725
|
children: [
|
|
15500
|
-
/* @__PURE__ */ jsx(
|
|
15726
|
+
/* @__PURE__ */ jsx(ScrollArea, {
|
|
15727
|
+
style: MODAL_SCROLL_AREA_STYLE,
|
|
15728
|
+
children: /* @__PURE__ */ jsx(ModalBody, { children })
|
|
15729
|
+
}),
|
|
15501
15730
|
isNotNil(footer) ? /* @__PURE__ */ jsx(ModalFooter, { children: footer }) : null,
|
|
15502
15731
|
hideCloseButton && hideTitle ? null : /* @__PURE__ */ jsx(ModalHeader, {
|
|
15503
15732
|
hideCloseButton,
|
|
@@ -15864,206 +16093,6 @@ const RadioCardImage = ({ label, imageSrc, aspectRatio, padding = "space-04", re
|
|
|
15864
16093
|
});
|
|
15865
16094
|
};
|
|
15866
16095
|
//#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
|
|
16067
16096
|
//#region src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
16068
16097
|
const SegmentedControlValueContext = createContext(null);
|
|
16069
16098
|
const SegmentedControlValueProvider = SegmentedControlValueContext;
|