@wistia/ui 0.6.35 → 0.6.36-beta.1511ebd6.856ba13
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.cjs +307 -289
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.mjs +95 -79
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import react__default, { ReactNode, Dispatch, SetStateAction, ComponentPropsWithoutRef, JSX, ComponentPropsWithRef, MouseEvent, ElementType, ChangeEvent,
|
|
3
|
+
import react__default, { ReactNode, LegacyRef, MutableRefObject, RefCallback, Dispatch, SetStateAction, ComponentPropsWithoutRef, JSX, ComponentPropsWithRef, MouseEvent, ElementType, ChangeEvent, ForwardedRef, Ref, InputHTMLAttributes, RefObject, ForwardRefExoticComponent, RefAttributes, HTMLAttributes } from 'react';
|
|
4
4
|
export * from 'use-file-picker/types';
|
|
5
5
|
export { useFilePicker, useImperativeFilePicker } from 'use-file-picker';
|
|
6
6
|
export { FileAmountLimitValidator, FileSizeValidator, FileTypeValidator, ImageDimensionsValidator, PersistentFileAmountLimitValidator } from 'use-file-picker/validators';
|
|
@@ -56,6 +56,8 @@ declare const dateTime: {
|
|
|
56
56
|
timeOnlyString: (date: unknown, { timeZone }?: DateOnlyStringOptions) => string;
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
+
declare const mergeRefs: <T = unknown>(refs: (LegacyRef<T> | MutableRefObject<T> | null | undefined)[]) => RefCallback<T>;
|
|
60
|
+
|
|
59
61
|
declare const mq: {
|
|
60
62
|
xsAndUp: () => string;
|
|
61
63
|
smAndUp: () => string;
|
|
@@ -100,6 +102,8 @@ declare const useKey: (key: KeyFilter, eventHandler: EventHandler, { eventName,
|
|
|
100
102
|
type SetItemType = Storage['setItem'];
|
|
101
103
|
declare const useLocalStorage: <T, _>(key: Parameters<SetItemType>[0], initialValue: T, storage?: Storage) => [T | undefined, (newValue: T) => void, () => void];
|
|
102
104
|
|
|
105
|
+
declare const useLockBodyScroll: (locked: boolean) => void;
|
|
106
|
+
|
|
103
107
|
type MediaQueryBooleans = {
|
|
104
108
|
isXlAndUp: boolean;
|
|
105
109
|
isLgAndUp: boolean;
|
|
@@ -3024,4 +3028,4 @@ declare const WistiaLogo: {
|
|
|
3024
3028
|
displayName: string;
|
|
3025
3029
|
};
|
|
3026
3030
|
|
|
3027
|
-
export { ActionButton, type ActionButtonProps, Avatar, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, 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, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, DataCard, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, Divider, EditableHeading, type EditableHeadingProps, Ellipsis, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Stack, SubMenu, Switch, type SwitchProps, Tab, type TabProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, type UseToastProps, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useBoolean, useFormState, useKey, useLocalStorage, useMq, useToast, useWindowSize };
|
|
3031
|
+
export { ActionButton, type ActionButtonProps, Avatar, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, 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, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, DataCard, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, Divider, EditableHeading, type EditableHeadingProps, Ellipsis, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Stack, SubMenu, Switch, type SwitchProps, Tab, type TabProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, type UseToastProps, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mergeRefs, mq, useActiveMq, useAriaLive, useBoolean, useFormState, useKey, useLocalStorage, useLockBodyScroll, useMq, useToast, useWindowSize };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import react__default, { ReactNode, Dispatch, SetStateAction, ComponentPropsWithoutRef, JSX, ComponentPropsWithRef, MouseEvent, ElementType, ChangeEvent,
|
|
3
|
+
import react__default, { ReactNode, LegacyRef, MutableRefObject, RefCallback, Dispatch, SetStateAction, ComponentPropsWithoutRef, JSX, ComponentPropsWithRef, MouseEvent, ElementType, ChangeEvent, ForwardedRef, Ref, InputHTMLAttributes, RefObject, ForwardRefExoticComponent, RefAttributes, HTMLAttributes } from 'react';
|
|
4
4
|
export * from 'use-file-picker/types';
|
|
5
5
|
export { useFilePicker, useImperativeFilePicker } from 'use-file-picker';
|
|
6
6
|
export { FileAmountLimitValidator, FileSizeValidator, FileTypeValidator, ImageDimensionsValidator, PersistentFileAmountLimitValidator } from 'use-file-picker/validators';
|
|
@@ -56,6 +56,8 @@ declare const dateTime: {
|
|
|
56
56
|
timeOnlyString: (date: unknown, { timeZone }?: DateOnlyStringOptions) => string;
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
+
declare const mergeRefs: <T = unknown>(refs: (LegacyRef<T> | MutableRefObject<T> | null | undefined)[]) => RefCallback<T>;
|
|
60
|
+
|
|
59
61
|
declare const mq: {
|
|
60
62
|
xsAndUp: () => string;
|
|
61
63
|
smAndUp: () => string;
|
|
@@ -100,6 +102,8 @@ declare const useKey: (key: KeyFilter, eventHandler: EventHandler, { eventName,
|
|
|
100
102
|
type SetItemType = Storage['setItem'];
|
|
101
103
|
declare const useLocalStorage: <T, _>(key: Parameters<SetItemType>[0], initialValue: T, storage?: Storage) => [T | undefined, (newValue: T) => void, () => void];
|
|
102
104
|
|
|
105
|
+
declare const useLockBodyScroll: (locked: boolean) => void;
|
|
106
|
+
|
|
103
107
|
type MediaQueryBooleans = {
|
|
104
108
|
isXlAndUp: boolean;
|
|
105
109
|
isLgAndUp: boolean;
|
|
@@ -3024,4 +3028,4 @@ declare const WistiaLogo: {
|
|
|
3024
3028
|
displayName: string;
|
|
3025
3029
|
};
|
|
3026
3030
|
|
|
3027
|
-
export { ActionButton, type ActionButtonProps, Avatar, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, 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, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, DataCard, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, Divider, EditableHeading, type EditableHeadingProps, Ellipsis, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Stack, SubMenu, Switch, type SwitchProps, Tab, type TabProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, type UseToastProps, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useBoolean, useFormState, useKey, useLocalStorage, useMq, useToast, useWindowSize };
|
|
3031
|
+
export { ActionButton, type ActionButtonProps, Avatar, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, 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, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, DataCard, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, Divider, EditableHeading, type EditableHeadingProps, Ellipsis, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Stack, SubMenu, Switch, type SwitchProps, Tab, type TabProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, type UseToastProps, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mergeRefs, mq, useActiveMq, useAriaLive, useBoolean, useFormState, useKey, useLocalStorage, useLockBodyScroll, useMq, useToast, useWindowSize };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.6.
|
|
3
|
+
* @license @wistia/ui v0.6.36-beta.1511ebd6.856ba13
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -1879,6 +1879,20 @@ var dateTime = {
|
|
|
1879
1879
|
timeOnlyString
|
|
1880
1880
|
};
|
|
1881
1881
|
|
|
1882
|
+
// src/helpers/mergeRefs/mergeRefs.ts
|
|
1883
|
+
import { isNotNil, isFunction } from "@wistia/type-guards";
|
|
1884
|
+
var mergeRefs = (refs) => (value) => {
|
|
1885
|
+
refs.forEach((ref) => {
|
|
1886
|
+
if (isFunction(ref)) {
|
|
1887
|
+
ref(value);
|
|
1888
|
+
return;
|
|
1889
|
+
}
|
|
1890
|
+
if (isNotNil(ref)) {
|
|
1891
|
+
ref.current = value;
|
|
1892
|
+
}
|
|
1893
|
+
});
|
|
1894
|
+
};
|
|
1895
|
+
|
|
1882
1896
|
// src/helpers/mq/mq.ts
|
|
1883
1897
|
import { getValueAndUnit } from "polished";
|
|
1884
1898
|
|
|
@@ -1963,9 +1977,9 @@ import { useCallback as useCallback3 } from "react";
|
|
|
1963
1977
|
import { useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
1964
1978
|
|
|
1965
1979
|
// src/private/helpers/isValidRef/isValidRef.ts
|
|
1966
|
-
import { isNotNil, isRecord } from "@wistia/type-guards";
|
|
1980
|
+
import { isNotNil as isNotNil2, isRecord } from "@wistia/type-guards";
|
|
1967
1981
|
var isValidRef = (value) => {
|
|
1968
|
-
return
|
|
1982
|
+
return isNotNil2(value) && isRecord(value) && "current" in value;
|
|
1969
1983
|
};
|
|
1970
1984
|
|
|
1971
1985
|
// src/private/hooks/useEvent/useEvent.ts
|
|
@@ -2056,11 +2070,27 @@ var useLocalStorage = (key, initialValue, storage = window.localStorage) => {
|
|
|
2056
2070
|
return [storedValue, setValue, removeValue];
|
|
2057
2071
|
};
|
|
2058
2072
|
|
|
2073
|
+
// src/hooks/useLockBodyScroll/useLockBodyScroll.ts
|
|
2074
|
+
import { useLayoutEffect } from "react";
|
|
2075
|
+
var useLockBodyScroll = (locked) => {
|
|
2076
|
+
useLayoutEffect(() => {
|
|
2077
|
+
if (locked) {
|
|
2078
|
+
const originalStyle = window.getComputedStyle(document.body).overflow;
|
|
2079
|
+
document.body.style.overflow = "hidden";
|
|
2080
|
+
return () => {
|
|
2081
|
+
document.body.style.overflow = originalStyle;
|
|
2082
|
+
};
|
|
2083
|
+
}
|
|
2084
|
+
return () => {
|
|
2085
|
+
};
|
|
2086
|
+
}, [locked]);
|
|
2087
|
+
};
|
|
2088
|
+
|
|
2059
2089
|
// src/hooks/useMq/useMq.ts
|
|
2060
2090
|
import { isBoolean } from "@wistia/type-guards";
|
|
2061
2091
|
|
|
2062
2092
|
// src/hooks/useWindowSize/useWindowSize.ts
|
|
2063
|
-
import { useState as useState4, useLayoutEffect } from "react";
|
|
2093
|
+
import { useState as useState4, useLayoutEffect as useLayoutEffect2 } from "react";
|
|
2064
2094
|
import { debounce } from "throttle-debounce";
|
|
2065
2095
|
|
|
2066
2096
|
// src/private/helpers/isClient/isClient.ts
|
|
@@ -2072,7 +2102,7 @@ var useWindowSize = (interval = 0) => {
|
|
|
2072
2102
|
width: isClient() ? window.innerWidth : 0,
|
|
2073
2103
|
height: isClient() ? window.innerHeight : 0
|
|
2074
2104
|
});
|
|
2075
|
-
|
|
2105
|
+
useLayoutEffect2(() => {
|
|
2076
2106
|
const handleResize = debounce(
|
|
2077
2107
|
interval,
|
|
2078
2108
|
() => setDimensions({
|
|
@@ -2130,10 +2160,10 @@ import { toast as sonnerToast } from "sonner";
|
|
|
2130
2160
|
// src/private/components/Toast/Toast.tsx
|
|
2131
2161
|
import { cloneElement, isValidElement } from "react";
|
|
2132
2162
|
import styled2 from "styled-components";
|
|
2133
|
-
import { isNotNil as
|
|
2163
|
+
import { isNotNil as isNotNil4 } from "@wistia/type-guards";
|
|
2134
2164
|
|
|
2135
2165
|
// src/components/Ellipsis/Ellipsis.tsx
|
|
2136
|
-
import { isNotNil as
|
|
2166
|
+
import { isNotNil as isNotNil3 } from "@wistia/type-guards";
|
|
2137
2167
|
import styled, { css as css12 } from "styled-components";
|
|
2138
2168
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
2139
2169
|
var ellipsisStyle = css12`
|
|
@@ -2166,7 +2196,7 @@ var ellipsisFlexParentStyle = css12`
|
|
|
2166
2196
|
var EllipsisComponent = styled.span`
|
|
2167
2197
|
${ellipsisStyle};
|
|
2168
2198
|
${({ $lines }) => {
|
|
2169
|
-
if (
|
|
2199
|
+
if (isNotNil3($lines)) {
|
|
2170
2200
|
return css12`
|
|
2171
2201
|
-webkit-box-orient: vertical;
|
|
2172
2202
|
-webkit-line-clamp: ${$lines};
|
|
@@ -2358,7 +2388,7 @@ var StyledToast = styled2.div`
|
|
|
2358
2388
|
}
|
|
2359
2389
|
`;
|
|
2360
2390
|
var Action = ({ actionButton }) => {
|
|
2361
|
-
if (
|
|
2391
|
+
if (isNotNil4(actionButton) && isValidElement(actionButton)) {
|
|
2362
2392
|
return /* @__PURE__ */ jsx5(ActionWrapper, { children: cloneElement(actionButton, {
|
|
2363
2393
|
variant: "soft",
|
|
2364
2394
|
// force Button variant
|
|
@@ -2382,7 +2412,7 @@ var Toast = ({
|
|
|
2382
2412
|
$colorScheme: colorScheme,
|
|
2383
2413
|
children: [
|
|
2384
2414
|
/* @__PURE__ */ jsxs2(MessageWrapper, { children: [
|
|
2385
|
-
|
|
2415
|
+
isNotNil4(icon) ? icon : null,
|
|
2386
2416
|
/* @__PURE__ */ jsx5(Message, { lines: 3, children: message })
|
|
2387
2417
|
] }),
|
|
2388
2418
|
/* @__PURE__ */ jsx5(Action, { actionButton: action })
|
|
@@ -2423,7 +2453,7 @@ import styled6, { css as css16 } from "styled-components";
|
|
|
2423
2453
|
// src/components/Button/Button.tsx
|
|
2424
2454
|
import { forwardRef as forwardRef2 } from "react";
|
|
2425
2455
|
import styled5 from "styled-components";
|
|
2426
|
-
import { isNotNil as
|
|
2456
|
+
import { isNotNil as isNotNil6, isNotUndefined as isNotUndefined3 } from "@wistia/type-guards";
|
|
2427
2457
|
|
|
2428
2458
|
// src/css/buttonResetCss.tsx
|
|
2429
2459
|
import { css as css14 } from "styled-components";
|
|
@@ -6557,7 +6587,7 @@ Icon.displayName = "Icon";
|
|
|
6557
6587
|
|
|
6558
6588
|
// src/components/Link/Link.tsx
|
|
6559
6589
|
import { forwardRef } from "react";
|
|
6560
|
-
import { isFunction, isNil as isNil6, isNotNil as
|
|
6590
|
+
import { isFunction as isFunction2, isNil as isNil6, isNotNil as isNotNil5, isNotUndefined as isNotUndefined2, isUndefined as isUndefined2 } from "@wistia/type-guards";
|
|
6561
6591
|
import styled4 from "styled-components";
|
|
6562
6592
|
import { Link as RouterLink, useInRouterContext } from "react-router-dom";
|
|
6563
6593
|
import { jsx as jsx192, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
@@ -6620,16 +6650,16 @@ var Link = forwardRef(
|
|
|
6620
6650
|
} catch (error) {
|
|
6621
6651
|
console.error(error);
|
|
6622
6652
|
} finally {
|
|
6623
|
-
if (
|
|
6653
|
+
if (isFunction2(props.onClick)) {
|
|
6624
6654
|
props.onClick(event);
|
|
6625
6655
|
} else if (routingCallback !== null) {
|
|
6626
6656
|
routingCallback();
|
|
6627
|
-
} else if (
|
|
6657
|
+
} else if (isNotNil5(to)) {
|
|
6628
6658
|
window.location.assign(to);
|
|
6629
6659
|
} else {
|
|
6630
6660
|
}
|
|
6631
6661
|
}
|
|
6632
|
-
} else if (
|
|
6662
|
+
} else if (isFunction2(props.onClick)) {
|
|
6633
6663
|
props.onClick(event);
|
|
6634
6664
|
} else {
|
|
6635
6665
|
}
|
|
@@ -6730,8 +6760,8 @@ var ButtonContent = ({
|
|
|
6730
6760
|
/* @__PURE__ */ jsxs8(
|
|
6731
6761
|
StyledButtonContent,
|
|
6732
6762
|
{
|
|
6733
|
-
$hasLeftIcon:
|
|
6734
|
-
$hasRightIcon:
|
|
6763
|
+
$hasLeftIcon: isNotNil6(leftIcon),
|
|
6764
|
+
$hasRightIcon: isNotNil6(rightIcon),
|
|
6735
6765
|
$isLoading: isLoading,
|
|
6736
6766
|
children: [
|
|
6737
6767
|
leftIcon ?? null,
|
|
@@ -6799,7 +6829,7 @@ var Button = forwardRef2(
|
|
|
6799
6829
|
event.preventDefault();
|
|
6800
6830
|
return;
|
|
6801
6831
|
}
|
|
6802
|
-
if (
|
|
6832
|
+
if (isNotNil6(onClick)) {
|
|
6803
6833
|
onClick(event);
|
|
6804
6834
|
}
|
|
6805
6835
|
};
|
|
@@ -7142,7 +7172,7 @@ Avatar.displayName = "Avatar";
|
|
|
7142
7172
|
// src/components/Badge/Badge.tsx
|
|
7143
7173
|
import { forwardRef as forwardRef4 } from "react";
|
|
7144
7174
|
import styled9 from "styled-components";
|
|
7145
|
-
import { isNotNil as
|
|
7175
|
+
import { isNotNil as isNotNil7 } from "@wistia/type-guards";
|
|
7146
7176
|
import { jsx as jsx197, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
7147
7177
|
var StyledBadge = styled9.div`
|
|
7148
7178
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
@@ -7166,7 +7196,7 @@ var StyledBadge = styled9.div`
|
|
|
7166
7196
|
`;
|
|
7167
7197
|
var Badge = forwardRef4(
|
|
7168
7198
|
({ colorScheme = "inherit", label, icon, ...otherProps }, ref) => {
|
|
7169
|
-
const hasIcon =
|
|
7199
|
+
const hasIcon = isNotNil7(icon);
|
|
7170
7200
|
return /* @__PURE__ */ jsxs10(
|
|
7171
7201
|
StyledBadge,
|
|
7172
7202
|
{
|
|
@@ -7187,7 +7217,7 @@ Badge.displayName = "Badge";
|
|
|
7187
7217
|
// src/components/Box/Box.tsx
|
|
7188
7218
|
import { Children, cloneElement as cloneElement2, forwardRef as forwardRef5 } from "react";
|
|
7189
7219
|
import styled10, { css as css17 } from "styled-components";
|
|
7190
|
-
import { isNotNil as
|
|
7220
|
+
import { isNotNil as isNotNil8, isNil as isNil9, isRecord as isRecord3, isNotUndefined as isNotUndefined4 } from "@wistia/type-guards";
|
|
7191
7221
|
|
|
7192
7222
|
// src/private/helpers/makePolymorphic/makePolymorphic.tsx
|
|
7193
7223
|
var makePolymorphic = (component) => {
|
|
@@ -7198,7 +7228,7 @@ var makePolymorphic = (component) => {
|
|
|
7198
7228
|
import { jsx as jsx198 } from "react/jsx-runtime";
|
|
7199
7229
|
var isDev = process.env["NODE_ENV"] === "development" || process.env["NODE_ENV"] === "test";
|
|
7200
7230
|
var getGapStyle = (gap) => {
|
|
7201
|
-
if (
|
|
7231
|
+
if (isNotNil8(gap)) {
|
|
7202
7232
|
if (isRecord3(gap)) {
|
|
7203
7233
|
return Object.entries(gap).map(([key, value]) => {
|
|
7204
7234
|
return `${key}-gap: var(--wui-${value})};`;
|
|
@@ -7274,8 +7304,8 @@ var StyledBoxComponent = styled10.div`
|
|
|
7274
7304
|
align-content: ${({ $alignContent }) => $alignContent};
|
|
7275
7305
|
align-items: ${({ $alignItems }) => $alignItems};
|
|
7276
7306
|
align-self: ${({ $alignSelf }) => $alignSelf ?? null};
|
|
7277
|
-
display: ${({ $inline }) =>
|
|
7278
|
-
flex-basis: ${({ $basis }) =>
|
|
7307
|
+
display: ${({ $inline }) => isNotNil8($inline) && $inline ? "inline-flex" : "flex"};
|
|
7308
|
+
flex-basis: ${({ $basis }) => isNotNil8($basis) ? $basis : null};
|
|
7279
7309
|
flex-direction: ${({ $flexDirection }) => $flexDirection};
|
|
7280
7310
|
${({ $fillBox: fill }) => getFillStyle(fill)};
|
|
7281
7311
|
${({ $fillViewport }) => getFillViewportStyle($fillViewport)};
|
|
@@ -7285,14 +7315,14 @@ var StyledBoxComponent = styled10.div`
|
|
|
7285
7315
|
width: ${({ $width }) => $width ?? null};
|
|
7286
7316
|
|
|
7287
7317
|
/* Box children styles */
|
|
7288
|
-
flex-grow: ${({ $grow }) =>
|
|
7289
|
-
flex-shrink: ${({ $shrink }) =>
|
|
7318
|
+
flex-grow: ${({ $grow }) => isNotNil8($grow) ? $grow : null};
|
|
7319
|
+
flex-shrink: ${({ $shrink }) => isNotNil8($shrink) ? $shrink : null};
|
|
7290
7320
|
flex-wrap: ${({ $wrapItems }) => $wrapItems ? "wrap" : "nowrap"};
|
|
7291
7321
|
justify-content: ${({ $justifyContent }) => $justifyContent};
|
|
7292
|
-
order: ${({ $order }) =>
|
|
7322
|
+
order: ${({ $order }) => isNotNil8($order) ? $order : null};
|
|
7293
7323
|
`;
|
|
7294
7324
|
var wrapChildren = (children) => {
|
|
7295
|
-
if (
|
|
7325
|
+
if (isNotNil8(children)) {
|
|
7296
7326
|
if (typeof children === "object" && isDev) {
|
|
7297
7327
|
return Children.map(children, (child) => {
|
|
7298
7328
|
if (isNil9(child)) return null;
|
|
@@ -7625,7 +7655,7 @@ import { isNonEmptyString as isNonEmptyString2 } from "@wistia/type-guards";
|
|
|
7625
7655
|
|
|
7626
7656
|
// src/private/components/FormControlLabel/FormControlLabel.tsx
|
|
7627
7657
|
import styled18, { css as css19 } from "styled-components";
|
|
7628
|
-
import { isNil as isNil12, isNotNil as
|
|
7658
|
+
import { isNil as isNil12, isNotNil as isNotNil10 } from "@wistia/type-guards";
|
|
7629
7659
|
|
|
7630
7660
|
// src/private/components/FormControlLabel/FormControlLabelDescription.tsx
|
|
7631
7661
|
import styled16, { css as css18 } from "styled-components";
|
|
@@ -7665,7 +7695,7 @@ FormControlLabelDescription.displayName = "FormControlLabelDescription";
|
|
|
7665
7695
|
|
|
7666
7696
|
// src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
|
|
7667
7697
|
import styled17 from "styled-components";
|
|
7668
|
-
import { isNotNil as
|
|
7698
|
+
import { isNotNil as isNotNil9 } from "@wistia/type-guards";
|
|
7669
7699
|
import { jsx as jsx205 } from "react/jsx-runtime";
|
|
7670
7700
|
var VisuallyHidden = styled17.div({ ...visuallyHiddenStyle });
|
|
7671
7701
|
var VisuallyHiddenButFocusable = styled17.div({
|
|
@@ -7677,7 +7707,7 @@ var ScreenReaderOnly = ({
|
|
|
7677
7707
|
focusable = false,
|
|
7678
7708
|
...otherProps
|
|
7679
7709
|
}) => {
|
|
7680
|
-
const accessibleText =
|
|
7710
|
+
const accessibleText = isNotNil9(text) ? text : children;
|
|
7681
7711
|
if (focusable) {
|
|
7682
7712
|
return /* @__PURE__ */ jsx205(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
|
|
7683
7713
|
}
|
|
@@ -7731,7 +7761,7 @@ var FormControlLabel = ({
|
|
|
7731
7761
|
htmlFor,
|
|
7732
7762
|
...props,
|
|
7733
7763
|
children: [
|
|
7734
|
-
|
|
7764
|
+
isNotNil10(controlSlot) ? controlSlot : null,
|
|
7735
7765
|
labelContent
|
|
7736
7766
|
]
|
|
7737
7767
|
}
|
|
@@ -7933,7 +7963,7 @@ ClickRegion.displayName = "ClickRegion";
|
|
|
7933
7963
|
|
|
7934
7964
|
// src/components/Collapsible/Collapsible.tsx
|
|
7935
7965
|
import { Root } from "@radix-ui/react-collapsible";
|
|
7936
|
-
import { isNotNil as
|
|
7966
|
+
import { isNotNil as isNotNil11 } from "@wistia/type-guards";
|
|
7937
7967
|
import styled20 from "styled-components";
|
|
7938
7968
|
import { jsx as jsx208 } from "react/jsx-runtime";
|
|
7939
7969
|
var StyledRoot = styled20(Root)`
|
|
@@ -7950,7 +7980,7 @@ var Collapsible = ({
|
|
|
7950
7980
|
onOpenChange
|
|
7951
7981
|
}) => {
|
|
7952
7982
|
const controlProps = {
|
|
7953
|
-
...
|
|
7983
|
+
...isNotNil11(onOpenChange) && isNotNil11(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
7954
7984
|
};
|
|
7955
7985
|
return /* @__PURE__ */ jsx208(StyledRoot, { ...controlProps, children });
|
|
7956
7986
|
};
|
|
@@ -8638,7 +8668,7 @@ Tooltip.displayName = "Tooltip";
|
|
|
8638
8668
|
// src/components/Input/Input.tsx
|
|
8639
8669
|
import { forwardRef as forwardRef10, cloneElement as cloneElement4, useRef as useRef3 } from "react";
|
|
8640
8670
|
import styled29, { css as css25 } from "styled-components";
|
|
8641
|
-
import { isNil as isNil13, isNotNil as
|
|
8671
|
+
import { isNil as isNil13, isNotNil as isNotNil12, isRecord as isRecord4 } from "@wistia/type-guards";
|
|
8642
8672
|
import { jsx as jsx218, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
8643
8673
|
var inputStyles = css25`
|
|
8644
8674
|
--wui-input-color-bg: var(--wui-color-bg-surface);
|
|
@@ -8738,27 +8768,27 @@ var Input = forwardRef10(
|
|
|
8738
8768
|
const internalRef = useRef3();
|
|
8739
8769
|
const ref = (
|
|
8740
8770
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
8741
|
-
|
|
8771
|
+
isNotNil12(externalRef) && isRecord4(externalRef) && "current" in externalRef ? externalRef : internalRef
|
|
8742
8772
|
);
|
|
8743
8773
|
let leftIconToDisplay = leftIcon;
|
|
8744
8774
|
if (isNil13(leftIcon) && type === "search") {
|
|
8745
8775
|
leftIconToDisplay = /* @__PURE__ */ jsx218(Icon, { type: "search" });
|
|
8746
8776
|
}
|
|
8747
|
-
if (
|
|
8777
|
+
if (isNotNil12(leftIconToDisplay)) {
|
|
8748
8778
|
leftIconToDisplay = cloneElement4(leftIconToDisplay, {
|
|
8749
8779
|
size: "md",
|
|
8750
8780
|
className: "wui-input-left-icon"
|
|
8751
8781
|
});
|
|
8752
8782
|
}
|
|
8753
8783
|
let rightIconToDisplay = rightIcon;
|
|
8754
|
-
if (
|
|
8784
|
+
if (isNotNil12(rightIconToDisplay)) {
|
|
8755
8785
|
rightIconToDisplay = cloneElement4(rightIconToDisplay, {
|
|
8756
8786
|
size: "md",
|
|
8757
8787
|
className: "wui-input-right-icon"
|
|
8758
8788
|
});
|
|
8759
8789
|
}
|
|
8760
8790
|
const handleFocus = (event) => {
|
|
8761
|
-
if (
|
|
8791
|
+
if (isNotNil12(props.onFocus)) {
|
|
8762
8792
|
props.onFocus(event);
|
|
8763
8793
|
}
|
|
8764
8794
|
if (autoSelect && isValidRef(ref) && "current" in ref) {
|
|
@@ -9151,7 +9181,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9151
9181
|
// src/components/FormField/FormField.tsx
|
|
9152
9182
|
import { Children as Children5, cloneElement as cloneElement5, useContext as useContext3 } from "react";
|
|
9153
9183
|
import styled35 from "styled-components";
|
|
9154
|
-
import { isArray as isArray2, isNotNil as
|
|
9184
|
+
import { isArray as isArray2, isNotNil as isNotNil13, isNotUndefined as isNotUndefined8, isUndefined as isUndefined4 } from "@wistia/type-guards";
|
|
9155
9185
|
|
|
9156
9186
|
// src/components/Label/Label.tsx
|
|
9157
9187
|
import styled33, { css as css27 } from "styled-components";
|
|
@@ -9367,8 +9397,8 @@ var FormField = ({
|
|
|
9367
9397
|
defaultValue
|
|
9368
9398
|
};
|
|
9369
9399
|
}
|
|
9370
|
-
if (
|
|
9371
|
-
const computedName =
|
|
9400
|
+
if (isNotNil13(checkboxGroup)) {
|
|
9401
|
+
const computedName = isNotNil13(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
|
|
9372
9402
|
const handleChange = (event) => {
|
|
9373
9403
|
if (isNotUndefined8(props.onChange)) {
|
|
9374
9404
|
props.onChange(event);
|
|
@@ -9381,7 +9411,7 @@ var FormField = ({
|
|
|
9381
9411
|
...childProps,
|
|
9382
9412
|
name: computedName,
|
|
9383
9413
|
onChange: handleChange,
|
|
9384
|
-
"aria-invalid":
|
|
9414
|
+
"aria-invalid": isNotNil13(error)
|
|
9385
9415
|
};
|
|
9386
9416
|
}
|
|
9387
9417
|
Children5.only(children);
|
|
@@ -9392,9 +9422,9 @@ var FormField = ({
|
|
|
9392
9422
|
"data-label-position": labelPosition ?? formState.labelPosition,
|
|
9393
9423
|
children: [
|
|
9394
9424
|
!isIntegratedLabel && /* @__PURE__ */ jsx226(Label, { htmlFor: computedId, children: label }),
|
|
9395
|
-
|
|
9425
|
+
isNotNil13(description) ? /* @__PURE__ */ jsx226(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
9396
9426
|
cloneElement5(children, childProps),
|
|
9397
|
-
|
|
9427
|
+
isNotNil13(computedError) ? /* @__PURE__ */ jsxs23(Fragment6, { children: [
|
|
9398
9428
|
/* @__PURE__ */ jsx226("div", {}),
|
|
9399
9429
|
/* @__PURE__ */ jsx226(
|
|
9400
9430
|
ErrorMessages,
|
|
@@ -9471,7 +9501,7 @@ IconButton.displayName = "IconButton";
|
|
|
9471
9501
|
|
|
9472
9502
|
// src/components/Image/Image.tsx
|
|
9473
9503
|
import styled37 from "styled-components";
|
|
9474
|
-
import { isNotNil as
|
|
9504
|
+
import { isNotNil as isNotNil14 } from "@wistia/type-guards";
|
|
9475
9505
|
import { jsx as jsx229 } from "react/jsx-runtime";
|
|
9476
9506
|
var getFillStyle2 = (fillContainer) => {
|
|
9477
9507
|
if (fillContainer === "horizontal") {
|
|
@@ -9489,7 +9519,7 @@ var getFillStyle2 = (fillContainer) => {
|
|
|
9489
9519
|
return void 0;
|
|
9490
9520
|
};
|
|
9491
9521
|
var StyledImage = styled37.img`
|
|
9492
|
-
border-radius: ${({ $borderRadius }) =>
|
|
9522
|
+
border-radius: ${({ $borderRadius }) => isNotNil14($borderRadius) ? `var(--wui-${$borderRadius})` : void 0};
|
|
9493
9523
|
${({ $fillContainer }) => getFillStyle2($fillContainer)};
|
|
9494
9524
|
object-fit: ${({ $objFit }) => $objFit};
|
|
9495
9525
|
object-position: ${({ $objPosition }) => $objPosition};
|
|
@@ -9526,7 +9556,7 @@ import {
|
|
|
9526
9556
|
DropdownMenuPortal,
|
|
9527
9557
|
DropdownMenuContent
|
|
9528
9558
|
} from "@radix-ui/react-dropdown-menu";
|
|
9529
|
-
import { isNotNil as
|
|
9559
|
+
import { isNotNil as isNotNil15, isNotUndefined as isNotUndefined9 } from "@wistia/type-guards";
|
|
9530
9560
|
import { useMemo as useMemo7 } from "react";
|
|
9531
9561
|
|
|
9532
9562
|
// src/components/Menu/MenuContext.tsx
|
|
@@ -9638,7 +9668,7 @@ var Menu = ({
|
|
|
9638
9668
|
}) => {
|
|
9639
9669
|
const contextValue = useMemo7(() => ({ compact }), [compact]);
|
|
9640
9670
|
let controlProps = {
|
|
9641
|
-
...
|
|
9671
|
+
...isNotNil15(onOpenChange) && isNotNil15(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
9642
9672
|
};
|
|
9643
9673
|
if (disabled) {
|
|
9644
9674
|
controlProps = {
|
|
@@ -9720,12 +9750,12 @@ import {
|
|
|
9720
9750
|
DropdownMenuSubTrigger,
|
|
9721
9751
|
DropdownMenuItem
|
|
9722
9752
|
} from "@radix-ui/react-dropdown-menu";
|
|
9723
|
-
import { isNotNil as
|
|
9753
|
+
import { isNotNil as isNotNil17 } from "@wistia/type-guards";
|
|
9724
9754
|
|
|
9725
9755
|
// src/components/Menu/MenuItemButton.tsx
|
|
9726
9756
|
import { forwardRef as forwardRef14 } from "react";
|
|
9727
9757
|
import styled40 from "styled-components";
|
|
9728
|
-
import { isNotNil as
|
|
9758
|
+
import { isNotNil as isNotNil16, isNotUndefined as isNotUndefined10 } from "@wistia/type-guards";
|
|
9729
9759
|
import { jsx as jsx232, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
9730
9760
|
var StyledButton3 = styled40(Button)`
|
|
9731
9761
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
@@ -9833,7 +9863,7 @@ var MenuItemButton = forwardRef14(({ children, appearance, command, icon, ...pro
|
|
|
9833
9863
|
children: [
|
|
9834
9864
|
props.leftIcon ? /* @__PURE__ */ jsx232(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
9835
9865
|
/* @__PURE__ */ jsx232(StyledLabelAndDescriptionContainer, { children }),
|
|
9836
|
-
|
|
9866
|
+
isNotNil16(badge) || isNotNil16(command) ? /* @__PURE__ */ jsx232(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
9837
9867
|
props.rightIcon ? /* @__PURE__ */ jsx232(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
9838
9868
|
]
|
|
9839
9869
|
}
|
|
@@ -9901,7 +9931,7 @@ var SubMenu = ({
|
|
|
9901
9931
|
return isSmAndUp ? /* @__PURE__ */ jsxs26(DropdownMenuSub, { onOpenChange, children: [
|
|
9902
9932
|
/* @__PURE__ */ jsxs26(SubMenuTrigger, { ...props, children: [
|
|
9903
9933
|
/* @__PURE__ */ jsx234(MenuItemLabel, { children: label }),
|
|
9904
|
-
|
|
9934
|
+
isNotNil17(description) ? /* @__PURE__ */ jsx234(MenuItemDescription, { children: description }) : null
|
|
9905
9935
|
] }),
|
|
9906
9936
|
/* @__PURE__ */ jsx234(DropdownMenuPortal2, { children: /* @__PURE__ */ jsx234(SubMenuContent, { $compact: compact, children }) })
|
|
9907
9937
|
] }) : /* @__PURE__ */ jsxs26(DropdownMenuGroup, { children: [
|
|
@@ -10088,7 +10118,7 @@ CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
|
10088
10118
|
import { forwardRef as forwardRef18 } from "react";
|
|
10089
10119
|
import styled47 from "styled-components";
|
|
10090
10120
|
import { Root as DialogRoot, Portal as DialogPortal } from "@radix-ui/react-dialog";
|
|
10091
|
-
import { isNotNil as
|
|
10121
|
+
import { isNotNil as isNotNil19 } from "@wistia/type-guards";
|
|
10092
10122
|
|
|
10093
10123
|
// src/components/Modal/ModalHeader.tsx
|
|
10094
10124
|
import styled44 from "styled-components";
|
|
@@ -10151,7 +10181,7 @@ import { Content as DialogContent } from "@radix-ui/react-dialog";
|
|
|
10151
10181
|
|
|
10152
10182
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
10153
10183
|
import { useRef as useRef8, useEffect as useEffect5 } from "react";
|
|
10154
|
-
import { isNotNil as
|
|
10184
|
+
import { isNotNil as isNotNil18 } from "@wistia/type-guards";
|
|
10155
10185
|
var useFocusRestore = () => {
|
|
10156
10186
|
const previouslyFocusedRef = useRef8(null);
|
|
10157
10187
|
useEffect5(() => {
|
|
@@ -10159,7 +10189,7 @@ var useFocusRestore = () => {
|
|
|
10159
10189
|
}, []);
|
|
10160
10190
|
useEffect5(() => {
|
|
10161
10191
|
return () => {
|
|
10162
|
-
if (
|
|
10192
|
+
if (isNotNil18(previouslyFocusedRef.current)) {
|
|
10163
10193
|
setTimeout(() => {
|
|
10164
10194
|
previouslyFocusedRef.current?.focus();
|
|
10165
10195
|
}, 0);
|
|
@@ -10306,7 +10336,7 @@ var Modal = forwardRef18(
|
|
|
10306
10336
|
DialogRoot,
|
|
10307
10337
|
{
|
|
10308
10338
|
onOpenChange: (open2) => {
|
|
10309
|
-
if (!open2 &&
|
|
10339
|
+
if (!open2 && isNotNil19(onRequestClose)) {
|
|
10310
10340
|
onRequestClose();
|
|
10311
10341
|
}
|
|
10312
10342
|
},
|
|
@@ -10319,7 +10349,7 @@ var Modal = forwardRef18(
|
|
|
10319
10349
|
ref,
|
|
10320
10350
|
fullHeight,
|
|
10321
10351
|
onOpenAutoFocus: (event) => {
|
|
10322
|
-
if (
|
|
10352
|
+
if (isNotNil19(initialFocusRef) && initialFocusRef.current) {
|
|
10323
10353
|
event.preventDefault();
|
|
10324
10354
|
requestAnimationFrame(() => {
|
|
10325
10355
|
initialFocusRef.current?.focus();
|
|
@@ -10353,9 +10383,9 @@ import { Root as Root2, Trigger as Trigger2, Portal, Content as Content2, Close
|
|
|
10353
10383
|
import styled48, { css as css29 } from "styled-components";
|
|
10354
10384
|
|
|
10355
10385
|
// src/private/helpers/getControls/getControlProps.tsx
|
|
10356
|
-
import { isNotNil as
|
|
10386
|
+
import { isNotNil as isNotNil20 } from "@wistia/type-guards";
|
|
10357
10387
|
var getControlProps = (isOpen, onOpenChange) => {
|
|
10358
|
-
return
|
|
10388
|
+
return isNotNil20(onOpenChange) && isNotNil20(isOpen) ? { open: isOpen, onOpenChange } : {};
|
|
10359
10389
|
};
|
|
10360
10390
|
|
|
10361
10391
|
// src/components/Popover/Popover.tsx
|
|
@@ -10414,7 +10444,7 @@ Popover.displayName = "Popover";
|
|
|
10414
10444
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
10415
10445
|
import styled49 from "styled-components";
|
|
10416
10446
|
import { Root as ProgressRoot, Indicator as ProgressIndicator } from "@radix-ui/react-progress";
|
|
10417
|
-
import { isNotNil as
|
|
10447
|
+
import { isNotNil as isNotNil21 } from "@wistia/type-guards";
|
|
10418
10448
|
import { jsx as jsx245, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
10419
10449
|
var ProgressBarWrapper = styled49.div`
|
|
10420
10450
|
--progress-bar-height: 8px;
|
|
@@ -10469,7 +10499,7 @@ var ProgressBar = ({
|
|
|
10469
10499
|
...props
|
|
10470
10500
|
}) => {
|
|
10471
10501
|
return /* @__PURE__ */ jsxs32(ProgressBarWrapper, { children: [
|
|
10472
|
-
|
|
10502
|
+
isNotNil21(labelLeft) ? /* @__PURE__ */ jsx245(ProgressBarLabel, { children: labelLeft }) : null,
|
|
10473
10503
|
/* @__PURE__ */ jsx245(
|
|
10474
10504
|
StyledProgressBar,
|
|
10475
10505
|
{
|
|
@@ -10485,7 +10515,7 @@ var ProgressBar = ({
|
|
|
10485
10515
|
)
|
|
10486
10516
|
}
|
|
10487
10517
|
),
|
|
10488
|
-
|
|
10518
|
+
isNotNil21(labelRight) ? /* @__PURE__ */ jsx245(ProgressBarLabel, { children: labelRight }) : null
|
|
10489
10519
|
] });
|
|
10490
10520
|
};
|
|
10491
10521
|
ProgressBar.displayName = "ProgressBar";
|
|
@@ -10803,22 +10833,6 @@ import { forwardRef as forwardRef21, useEffect as useEffect6, useRef as useRef9
|
|
|
10803
10833
|
import styled53, { css as css32 } from "styled-components";
|
|
10804
10834
|
import { Item as ToggleGroupItem } from "@radix-ui/react-toggle-group";
|
|
10805
10835
|
import { isNotNil as isNotNil22 } from "@wistia/type-guards";
|
|
10806
|
-
|
|
10807
|
-
// src/private/helpers/mergeRefs/mergeRefs.ts
|
|
10808
|
-
import { isNotNil as isNotNil21, isFunction as isFunction2 } from "@wistia/type-guards";
|
|
10809
|
-
var mergeRefs = (refs) => (value) => {
|
|
10810
|
-
refs.forEach((ref) => {
|
|
10811
|
-
if (isFunction2(ref)) {
|
|
10812
|
-
ref(value);
|
|
10813
|
-
return;
|
|
10814
|
-
}
|
|
10815
|
-
if (isNotNil21(ref)) {
|
|
10816
|
-
ref.current = value;
|
|
10817
|
-
}
|
|
10818
|
-
});
|
|
10819
|
-
};
|
|
10820
|
-
|
|
10821
|
-
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
10822
10836
|
import { jsxs as jsxs35 } from "react/jsx-runtime";
|
|
10823
10837
|
var segmentedControlItemStyles = css32`
|
|
10824
10838
|
all: unset; /* ToggleGroupItem is a button element */
|
|
@@ -12086,6 +12100,7 @@ export {
|
|
|
12086
12100
|
ellipsisFlexParentStyle,
|
|
12087
12101
|
ellipsisStyle,
|
|
12088
12102
|
iconSizeMap,
|
|
12103
|
+
mergeRefs,
|
|
12089
12104
|
mq,
|
|
12090
12105
|
useActiveMq,
|
|
12091
12106
|
useAriaLive,
|
|
@@ -12095,6 +12110,7 @@ export {
|
|
|
12095
12110
|
useImperativeFilePicker,
|
|
12096
12111
|
useKey,
|
|
12097
12112
|
useLocalStorage,
|
|
12113
|
+
useLockBodyScroll,
|
|
12098
12114
|
useMq,
|
|
12099
12115
|
useToast,
|
|
12100
12116
|
useWindowSize
|