@wistia/ui 0.20.10 → 0.20.12-beta.194021cb.7ecdb1f
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 +30 -1
- package/dist/index.js +41 -7
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,15 @@ type UIProviderProps = {
|
|
|
21
21
|
};
|
|
22
22
|
declare const UIProvider: ({ children }: UIProviderProps) => react_jsx_runtime.JSX.Element;
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Converts a boolean string value `value` into a boolean. If passed
|
|
26
|
+
* something other than 'true' or 'false' will coerce value to boolean.
|
|
27
|
+
*
|
|
28
|
+
* @param {*} value - a value of any type
|
|
29
|
+
* @returns {boolean} - that value as a boolean
|
|
30
|
+
*/
|
|
31
|
+
declare const coerceToBoolean: (value: unknown) => boolean;
|
|
32
|
+
|
|
24
33
|
/**
|
|
25
34
|
* Copies a string to user's clipboard for easy pasting in another location
|
|
26
35
|
*
|
|
@@ -228,6 +237,10 @@ type BaseProps$2 = {
|
|
|
228
237
|
* Disables the link
|
|
229
238
|
*/
|
|
230
239
|
disabled?: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* When true, the link will inherit its color from the parent element instead of using the default link color
|
|
242
|
+
*/
|
|
243
|
+
inheritColor?: boolean;
|
|
231
244
|
/**
|
|
232
245
|
* Icon to display on the left side of the link. Must be an instance of [Icon](?path=/docs/components-icon--docs)
|
|
233
246
|
*/
|
|
@@ -372,6 +385,7 @@ declare const Button: react.ForwardRefExoticComponent<(Omit<BaseButtonProps & re
|
|
|
372
385
|
children: ReactNode;
|
|
373
386
|
colorScheme?: ColorSchemeTypes;
|
|
374
387
|
disabled?: boolean;
|
|
388
|
+
inheritColor?: boolean;
|
|
375
389
|
leftIcon?: ReactNode | undefined;
|
|
376
390
|
rightIcon?: ReactNode | undefined;
|
|
377
391
|
type?: LinkTypes | undefined;
|
|
@@ -403,6 +417,7 @@ declare const Button: react.ForwardRefExoticComponent<(Omit<BaseButtonProps & re
|
|
|
403
417
|
children: ReactNode;
|
|
404
418
|
colorScheme?: ColorSchemeTypes;
|
|
405
419
|
disabled?: boolean;
|
|
420
|
+
inheritColor?: boolean;
|
|
406
421
|
leftIcon?: ReactNode | undefined;
|
|
407
422
|
rightIcon?: ReactNode | undefined;
|
|
408
423
|
type?: LinkTypes | undefined;
|
|
@@ -2924,6 +2939,7 @@ declare const MenuItem: react.ForwardRefExoticComponent<(Omit<DropdownMenuItemPr
|
|
|
2924
2939
|
children: react.ReactNode;
|
|
2925
2940
|
colorScheme?: ColorSchemeTypes;
|
|
2926
2941
|
disabled?: boolean;
|
|
2942
|
+
inheritColor?: boolean;
|
|
2927
2943
|
leftIcon?: react.ReactNode | undefined;
|
|
2928
2944
|
rightIcon?: react.ReactNode | undefined;
|
|
2929
2945
|
type?: LinkTypes | undefined;
|
|
@@ -2965,6 +2981,7 @@ declare const MenuItem: react.ForwardRefExoticComponent<(Omit<DropdownMenuItemPr
|
|
|
2965
2981
|
children: react.ReactNode;
|
|
2966
2982
|
colorScheme?: ColorSchemeTypes;
|
|
2967
2983
|
disabled?: boolean;
|
|
2984
|
+
inheritColor?: boolean;
|
|
2968
2985
|
leftIcon?: react.ReactNode | undefined;
|
|
2969
2986
|
rightIcon?: react.ReactNode | undefined;
|
|
2970
2987
|
type?: LinkTypes | undefined;
|
|
@@ -3637,6 +3654,10 @@ type SegmentedControlProps = Omit<ToggleGroupSingleProps, 'type'> & {
|
|
|
3637
3654
|
* `SegmentedControlItem`s that will be rendered in grouping
|
|
3638
3655
|
*/
|
|
3639
3656
|
children?: ReactNode;
|
|
3657
|
+
/**
|
|
3658
|
+
* Determines the color scheme for the SegmentedControl and its children.
|
|
3659
|
+
*/
|
|
3660
|
+
colorScheme?: ColorSchemeTypes;
|
|
3640
3661
|
/**
|
|
3641
3662
|
* Set the entire `SegmentedControl` to be disabled
|
|
3642
3663
|
*/
|
|
@@ -3868,6 +3889,14 @@ type StackProps = {
|
|
|
3868
3889
|
* @type 'baseline' | 'center' | 'flex-end' | 'flex-start' | 'stretch' | ResponsiveObject<'baseline' | 'center' | 'flex-end' | 'flex-start' | 'stretch'>
|
|
3869
3890
|
*/
|
|
3870
3891
|
alignItems?: AlignItemsType | ResponsiveObject<AlignItemsType>;
|
|
3892
|
+
/**
|
|
3893
|
+
* Padding to apply to the stack container. Use `x` for horizontal (left/right) padding and `y` for vertical (top/bottom) padding.
|
|
3894
|
+
* Each value can be a [responsive prop](/docs/ui-docs-responsive-props--docs).
|
|
3895
|
+
*/
|
|
3896
|
+
padding?: {
|
|
3897
|
+
x?: ResponsiveObject<Spacings> | Spacings;
|
|
3898
|
+
y?: ResponsiveObject<Spacings> | Spacings;
|
|
3899
|
+
};
|
|
3871
3900
|
renderAs?: ElementType;
|
|
3872
3901
|
};
|
|
3873
3902
|
/**
|
|
@@ -4427,4 +4456,4 @@ declare const CustomizableThemeWrapper: {
|
|
|
4427
4456
|
displayName: string;
|
|
4428
4457
|
};
|
|
4429
4458
|
|
|
4430
|
-
export { ActionButton, type ActionButtonProps, Avatar, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, Banner, BannerImage, type BannerProps, Box, type BoxProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, Button, ButtonGroup, type ButtonProps, Card, type CardProps, Center, type CenterProps, Checkbox, CheckboxGroup, CheckboxMenuItem, ClickRegion, type ClickRegionProps, Collapsible, CollapsibleContent, type CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerIcon, ColorGrid, ColorGridOption, type ColorGridOptionProps, type ColorGridProps, ColorList, ColorListGroup, type ColorListGroupProps, ColorListOption, type ColorListOptionProps, type ColorListProps, ColorPicker, ColorPickerPopoverContent, type ColorPickerPopoverContentProps, type ColorPickerProps, ColorPickerSection, type ColorPickerSectionProps, ColorPickerTrigger, type ColorPickerTriggerProps, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Combobox, ComboboxOption, type ComboboxOptionProps, type ComboboxProps, ContextMenu, type ContextMenuProps, ContrastControls, CustomizableThemeWrapper, type CustomizableThemeWrapperProps, DataCard, DataCardHoverArrow, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, DataList, DataListItem, DataListItemLabel, DataListItemValue, type DataListProps, Divider, EditableHeading, type EditableHeadingProps, EditableText, EditableTextCancelButton, EditableTextContext, EditableTextDisplay, EditableTextInput, EditableTextLabel, type EditableTextProps, EditableTextRoot, type EditableTextRootProps, EditableTextSubmitButton, EditableTextTrigger, Ellipsis, type EllipsisProps, FilterMenu, FilterMenuItem, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Grid, type GridProps, Heading, type HeadingProps, HexColorInput, type HexColorInputProps, HueSlider, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, InputClickToCopy, type InputClickToCopyProps, InputPassword, type InputPasswordProps, type InputProps, type KeyboardKeys, KeyboardShortcut, Label, type LabelProps, Link, type LinkProps, List, ListItem, type ListItemProps, type ListProps, Mark, type MarkProps, Markdown, type MarkdownProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, ModalCallout, ModalCallouts, type ModalProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, Radio, RadioCard, RadioCardImage, type RadioCardImageProps, type RadioCardProps, RadioGroup, RadioMenuItem, type RadioProps, SaturationAndValuePicker, ScreenReaderOnly, ScrollArea, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Slider, type SliderProps, SplitButton, type SplitButtonProps, Stack, SubMenu, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableFoot, type TableFootProps, TableHead, type TableHeadProps, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, Text, type TextProps, Thumbnail, ThumbnailBadge, type ThumbnailBadgeProps, ThumbnailCollage, type ThumbnailCollageProps, type ThumbnailProps, Tooltip, type TooltipProps, UIProvider, type UseActiveMqReturnType, type UseIsHoveredReturnType, type UseMqReturnType, type UseToastProps, ValueNameOrHexCode, ValueSwatch, WistiaLogo, calculateContrast, colorSchemeOptions, copyToClipboard, dateTime, iconSizeMap, mergeRefs, mq, useActiveMq, useAriaLive, useBoolean, useClipboard, useElementObserver, useFilePicker, useFocusTrap, useForceUpdate, useFormState, useImperativeFilePicker, useIsHovered, useKey, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize, validateWithYup };
|
|
4459
|
+
export { ActionButton, type ActionButtonProps, Avatar, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, Banner, BannerImage, type BannerProps, Box, type BoxProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, Button, ButtonGroup, type ButtonProps, Card, type CardProps, Center, type CenterProps, Checkbox, CheckboxGroup, CheckboxMenuItem, ClickRegion, type ClickRegionProps, Collapsible, CollapsibleContent, type CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerIcon, ColorGrid, ColorGridOption, type ColorGridOptionProps, type ColorGridProps, ColorList, ColorListGroup, type ColorListGroupProps, ColorListOption, type ColorListOptionProps, type ColorListProps, ColorPicker, ColorPickerPopoverContent, type ColorPickerPopoverContentProps, type ColorPickerProps, ColorPickerSection, type ColorPickerSectionProps, ColorPickerTrigger, type ColorPickerTriggerProps, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Combobox, ComboboxOption, type ComboboxOptionProps, type ComboboxProps, ContextMenu, type ContextMenuProps, ContrastControls, CustomizableThemeWrapper, type CustomizableThemeWrapperProps, DataCard, DataCardHoverArrow, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, DataList, DataListItem, DataListItemLabel, DataListItemValue, type DataListProps, Divider, EditableHeading, type EditableHeadingProps, EditableText, EditableTextCancelButton, EditableTextContext, EditableTextDisplay, EditableTextInput, EditableTextLabel, type EditableTextProps, EditableTextRoot, type EditableTextRootProps, EditableTextSubmitButton, EditableTextTrigger, Ellipsis, type EllipsisProps, FilterMenu, FilterMenuItem, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Grid, type GridProps, Heading, type HeadingProps, HexColorInput, type HexColorInputProps, HueSlider, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, InputClickToCopy, type InputClickToCopyProps, InputPassword, type InputPasswordProps, type InputProps, type KeyboardKeys, KeyboardShortcut, Label, type LabelProps, Link, type LinkProps, List, ListItem, type ListItemProps, type ListProps, Mark, type MarkProps, Markdown, type MarkdownProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, ModalCallout, ModalCallouts, type ModalProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, Radio, RadioCard, RadioCardImage, type RadioCardImageProps, type RadioCardProps, RadioGroup, RadioMenuItem, type RadioProps, SaturationAndValuePicker, ScreenReaderOnly, ScrollArea, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Slider, type SliderProps, SplitButton, type SplitButtonProps, Stack, SubMenu, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableFoot, type TableFootProps, TableHead, type TableHeadProps, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, Text, type TextProps, Thumbnail, ThumbnailBadge, type ThumbnailBadgeProps, ThumbnailCollage, type ThumbnailCollageProps, type ThumbnailProps, Tooltip, type TooltipProps, UIProvider, type UseActiveMqReturnType, type UseIsHoveredReturnType, type UseMqReturnType, type UseToastProps, ValueNameOrHexCode, ValueSwatch, WistiaLogo, calculateContrast, coerceToBoolean, colorSchemeOptions, copyToClipboard, dateTime, iconSizeMap, mergeRefs, mq, useActiveMq, useAriaLive, useBoolean, useClipboard, useElementObserver, useFilePicker, useFocusTrap, useForceUpdate, useFormState, useImperativeFilePicker, useIsHovered, useKey, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize, validateWithYup };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.20.
|
|
3
|
+
* @license @wistia/ui v0.20.12-beta.194021cb.7ecdb1f
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -2001,6 +2001,14 @@ var UIProvider = ({ children }) => {
|
|
|
2001
2001
|
] }) }) });
|
|
2002
2002
|
};
|
|
2003
2003
|
|
|
2004
|
+
// src/helpers/coerceToBoolean/coerceToBoolean.ts
|
|
2005
|
+
var coerceToBoolean = (value) => {
|
|
2006
|
+
if (value === "true" || value === "false") {
|
|
2007
|
+
return value === "true";
|
|
2008
|
+
}
|
|
2009
|
+
return Boolean(value);
|
|
2010
|
+
};
|
|
2011
|
+
|
|
2004
2012
|
// src/helpers/copyToClipboard/copyToClipboard.ts
|
|
2005
2013
|
import { isNil } from "@wistia/type-guards";
|
|
2006
2014
|
var copyToClipboard = async (textToCopy) => {
|
|
@@ -8034,18 +8042,21 @@ var StyledLink = styled5.a`
|
|
|
8034
8042
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
8035
8043
|
cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
|
|
8036
8044
|
font-family: inherit;
|
|
8037
|
-
color: ${({ $disabled }) =>
|
|
8045
|
+
color: ${({ $disabled, $inheritColor }) => {
|
|
8046
|
+
if ($disabled) return "var(--wui-color-text-disabled)";
|
|
8047
|
+
if ($inheritColor) return "inherit";
|
|
8048
|
+
return "var(--wui-color-text-link)";
|
|
8049
|
+
}};
|
|
8038
8050
|
text-decoration: ${({ $underline }) => $underline === "always" ? "underline" : "none"};
|
|
8039
|
-
display: inline-flex;
|
|
8040
|
-
align-items: baseline;
|
|
8041
|
-
gap: var(--wui-space-01);
|
|
8051
|
+
display: ${({ $hasIcons }) => $hasIcons ? "inline-flex" : "inline"};
|
|
8052
|
+
align-items: ${({ $hasIcons }) => $hasIcons ? "baseline" : "initial"};
|
|
8053
|
+
gap: ${({ $hasIcons }) => $hasIcons ? "var(--wui-space-01)" : "0"};
|
|
8042
8054
|
|
|
8043
8055
|
&:hover {
|
|
8044
8056
|
text-decoration: ${({ $underline }) => $underline === "hover" || $underline === "always" ? "underline" : "none"};
|
|
8045
8057
|
}
|
|
8046
8058
|
|
|
8047
8059
|
button& {
|
|
8048
|
-
display: inline;
|
|
8049
8060
|
line-height: inherit;
|
|
8050
8061
|
vertical-align: baseline;
|
|
8051
8062
|
}
|
|
@@ -8066,6 +8077,7 @@ var Link = forwardRef(
|
|
|
8066
8077
|
disabled = false,
|
|
8067
8078
|
colorScheme = "inherit",
|
|
8068
8079
|
underline = "none",
|
|
8080
|
+
inheritColor = false,
|
|
8069
8081
|
leftIcon,
|
|
8070
8082
|
rightIcon,
|
|
8071
8083
|
"aria-disabled": ariaDisabled,
|
|
@@ -8075,6 +8087,7 @@ var Link = forwardRef(
|
|
|
8075
8087
|
const inRouterContext = useInRouterContext();
|
|
8076
8088
|
const to = generateHref(props.href, type, disabled);
|
|
8077
8089
|
const shouldUseReactRouterLink = inRouterContext && type !== "external" && !to?.startsWith("http");
|
|
8090
|
+
const hasIcons = isNotNil5(leftIcon) || isNotNil5(rightIcon);
|
|
8078
8091
|
const handleClick = async (event) => {
|
|
8079
8092
|
if (disabled) {
|
|
8080
8093
|
event.preventDefault();
|
|
@@ -8103,6 +8116,8 @@ var Link = forwardRef(
|
|
|
8103
8116
|
$colorScheme: colorScheme,
|
|
8104
8117
|
$disabled: disabled,
|
|
8105
8118
|
$underline: underline,
|
|
8119
|
+
$inheritColor: inheritColor,
|
|
8120
|
+
$hasIcons: hasIcons,
|
|
8106
8121
|
onClick: handleClick,
|
|
8107
8122
|
"aria-disabled": ariaDisabled ?? (disabled ? "true" : void 0)
|
|
8108
8123
|
};
|
|
@@ -10042,12 +10057,23 @@ var StyledStack = styled26.div`
|
|
|
10042
10057
|
flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
|
|
10043
10058
|
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
10044
10059
|
align-items: ${({ $alignItems }) => $alignItems};
|
|
10060
|
+
${({ $paddingX }) => $paddingX && `padding-left: var(--wui-${$paddingX}); padding-right: var(--wui-${$paddingX});`}
|
|
10061
|
+
${({ $paddingY }) => $paddingY && `padding-top: var(--wui-${$paddingY}); padding-bottom: var(--wui-${$paddingY});`}
|
|
10045
10062
|
`;
|
|
10046
10063
|
var StackComponent = forwardRef10(
|
|
10047
|
-
({
|
|
10064
|
+
({
|
|
10065
|
+
renderAs,
|
|
10066
|
+
direction = "vertical",
|
|
10067
|
+
gap = "space-02",
|
|
10068
|
+
alignItems = "stretch",
|
|
10069
|
+
padding,
|
|
10070
|
+
...props
|
|
10071
|
+
}, ref) => {
|
|
10048
10072
|
const responsiveGap = useResponsiveProp(gap);
|
|
10049
10073
|
const responsiveDirection = useResponsiveProp(direction);
|
|
10050
10074
|
const responsiveAlignItems = useResponsiveProp(alignItems);
|
|
10075
|
+
const responsivePaddingX = useResponsiveProp(padding?.x);
|
|
10076
|
+
const responsivePaddingY = useResponsiveProp(padding?.y);
|
|
10051
10077
|
return /* @__PURE__ */ jsx240(
|
|
10052
10078
|
StyledStack,
|
|
10053
10079
|
{
|
|
@@ -10055,6 +10081,8 @@ var StackComponent = forwardRef10(
|
|
|
10055
10081
|
$alignItems: responsiveAlignItems,
|
|
10056
10082
|
$direction: responsiveDirection,
|
|
10057
10083
|
$gap: responsiveGap,
|
|
10084
|
+
$paddingX: responsivePaddingX,
|
|
10085
|
+
$paddingY: responsivePaddingY,
|
|
10058
10086
|
as: renderAs ?? DEFAULT_ELEMENT4,
|
|
10059
10087
|
...props
|
|
10060
10088
|
}
|
|
@@ -17553,6 +17581,9 @@ var SelectedItemIndicator = () => {
|
|
|
17553
17581
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
17554
17582
|
import { jsx as jsx330, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
17555
17583
|
var segmentedControlStyles = css46`
|
|
17584
|
+
${({ $colorScheme }) => $colorScheme && getColorScheme($colorScheme)};
|
|
17585
|
+
--wui-color-text-selected: var(--wui-color-text-link);
|
|
17586
|
+
|
|
17556
17587
|
display: inline-flex;
|
|
17557
17588
|
background-color: var(--wui-color-bg-surface-secondary);
|
|
17558
17589
|
border-radius: var(--wui-border-radius-rounded);
|
|
@@ -17569,6 +17600,7 @@ var StyledSegmentedControl = styled92(ToggleGroupRoot2)`
|
|
|
17569
17600
|
var SegmentedControl = forwardRef32(
|
|
17570
17601
|
({
|
|
17571
17602
|
children,
|
|
17603
|
+
colorScheme = "inherit",
|
|
17572
17604
|
disabled = false,
|
|
17573
17605
|
fullWidth = false,
|
|
17574
17606
|
selectedValue,
|
|
@@ -17582,6 +17614,7 @@ var SegmentedControl = forwardRef32(
|
|
|
17582
17614
|
StyledSegmentedControl,
|
|
17583
17615
|
{
|
|
17584
17616
|
ref,
|
|
17617
|
+
$colorScheme: colorScheme,
|
|
17585
17618
|
$fullWidth: fullWidth,
|
|
17586
17619
|
disabled,
|
|
17587
17620
|
loop: true,
|
|
@@ -19388,6 +19421,7 @@ export {
|
|
|
19388
19421
|
ValueSwatch,
|
|
19389
19422
|
WistiaLogo,
|
|
19390
19423
|
calculateContrast,
|
|
19424
|
+
coerceToBoolean,
|
|
19391
19425
|
colorSchemeOptions,
|
|
19392
19426
|
copyToClipboard,
|
|
19393
19427
|
dateTime,
|