@wistia/ui 0.20.12 → 0.20.13-beta.9f5bed57.0b3f624
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 +16 -1
- package/dist/index.js +83 -60
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -157,6 +157,9 @@ type UseKeyOptions = {
|
|
|
157
157
|
};
|
|
158
158
|
declare const useKey: (key: KeyFilter, eventHandler: EventHandler, { eventName, eventTarget, eventOptions }?: UseKeyOptions) => void;
|
|
159
159
|
|
|
160
|
+
type KeyPressState = [boolean, KeyboardEvent | null];
|
|
161
|
+
declare const useKeyPress: (keyFilter: Parameters<typeof useKey>[0]) => KeyPressState;
|
|
162
|
+
|
|
160
163
|
type SetItemType = Storage['setItem'];
|
|
161
164
|
declare const useLocalStorage: <T, _>(key: Parameters<SetItemType>[0], initialValue: T, storage?: Storage) => [T | undefined, (newValue: T) => void, () => void];
|
|
162
165
|
|
|
@@ -237,6 +240,10 @@ type BaseProps$2 = {
|
|
|
237
240
|
* Disables the link
|
|
238
241
|
*/
|
|
239
242
|
disabled?: boolean;
|
|
243
|
+
/**
|
|
244
|
+
* When true, the link will inherit its color from the parent element instead of using the default link color
|
|
245
|
+
*/
|
|
246
|
+
inheritColor?: boolean;
|
|
240
247
|
/**
|
|
241
248
|
* Icon to display on the left side of the link. Must be an instance of [Icon](?path=/docs/components-icon--docs)
|
|
242
249
|
*/
|
|
@@ -381,6 +388,7 @@ declare const Button: react.ForwardRefExoticComponent<(Omit<BaseButtonProps & re
|
|
|
381
388
|
children: ReactNode;
|
|
382
389
|
colorScheme?: ColorSchemeTypes;
|
|
383
390
|
disabled?: boolean;
|
|
391
|
+
inheritColor?: boolean;
|
|
384
392
|
leftIcon?: ReactNode | undefined;
|
|
385
393
|
rightIcon?: ReactNode | undefined;
|
|
386
394
|
type?: LinkTypes | undefined;
|
|
@@ -412,6 +420,7 @@ declare const Button: react.ForwardRefExoticComponent<(Omit<BaseButtonProps & re
|
|
|
412
420
|
children: ReactNode;
|
|
413
421
|
colorScheme?: ColorSchemeTypes;
|
|
414
422
|
disabled?: boolean;
|
|
423
|
+
inheritColor?: boolean;
|
|
415
424
|
leftIcon?: ReactNode | undefined;
|
|
416
425
|
rightIcon?: ReactNode | undefined;
|
|
417
426
|
type?: LinkTypes | undefined;
|
|
@@ -2933,6 +2942,7 @@ declare const MenuItem: react.ForwardRefExoticComponent<(Omit<DropdownMenuItemPr
|
|
|
2933
2942
|
children: react.ReactNode;
|
|
2934
2943
|
colorScheme?: ColorSchemeTypes;
|
|
2935
2944
|
disabled?: boolean;
|
|
2945
|
+
inheritColor?: boolean;
|
|
2936
2946
|
leftIcon?: react.ReactNode | undefined;
|
|
2937
2947
|
rightIcon?: react.ReactNode | undefined;
|
|
2938
2948
|
type?: LinkTypes | undefined;
|
|
@@ -2974,6 +2984,7 @@ declare const MenuItem: react.ForwardRefExoticComponent<(Omit<DropdownMenuItemPr
|
|
|
2974
2984
|
children: react.ReactNode;
|
|
2975
2985
|
colorScheme?: ColorSchemeTypes;
|
|
2976
2986
|
disabled?: boolean;
|
|
2987
|
+
inheritColor?: boolean;
|
|
2977
2988
|
leftIcon?: react.ReactNode | undefined;
|
|
2978
2989
|
rightIcon?: react.ReactNode | undefined;
|
|
2979
2990
|
type?: LinkTypes | undefined;
|
|
@@ -3646,6 +3657,10 @@ type SegmentedControlProps = Omit<ToggleGroupSingleProps, 'type'> & {
|
|
|
3646
3657
|
* `SegmentedControlItem`s that will be rendered in grouping
|
|
3647
3658
|
*/
|
|
3648
3659
|
children?: ReactNode;
|
|
3660
|
+
/**
|
|
3661
|
+
* Determines the color scheme for the SegmentedControl and its children.
|
|
3662
|
+
*/
|
|
3663
|
+
colorScheme?: ColorSchemeTypes;
|
|
3649
3664
|
/**
|
|
3650
3665
|
* Set the entire `SegmentedControl` to be disabled
|
|
3651
3666
|
*/
|
|
@@ -4444,4 +4459,4 @@ declare const CustomizableThemeWrapper: {
|
|
|
4444
4459
|
displayName: string;
|
|
4445
4460
|
};
|
|
4446
4461
|
|
|
4447
|
-
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 };
|
|
4462
|
+
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, useKeyPress, 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.13-beta.9f5bed57.0b3f624
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -2932,10 +2932,19 @@ var useKey = (key, eventHandler, { eventName = "keydown", eventTarget, eventOpti
|
|
|
2932
2932
|
useEvent(eventName, memoizedEventHandler, eventTarget, eventOptions);
|
|
2933
2933
|
};
|
|
2934
2934
|
|
|
2935
|
-
// src/hooks/
|
|
2935
|
+
// src/hooks/useKeyPress/useKeyPress.ts
|
|
2936
2936
|
import { useState as useState7 } from "react";
|
|
2937
|
+
var useKeyPress = (keyFilter) => {
|
|
2938
|
+
const [state, setState] = useState7([false, null]);
|
|
2939
|
+
useKey(keyFilter, (event) => setState([true, event]), { eventName: "keydown" });
|
|
2940
|
+
useKey(keyFilter, (event) => setState([false, event]), { eventName: "keyup" });
|
|
2941
|
+
return state;
|
|
2942
|
+
};
|
|
2943
|
+
|
|
2944
|
+
// src/hooks/useLocalStorage/useLocalStorage.ts
|
|
2945
|
+
import { useState as useState8 } from "react";
|
|
2937
2946
|
var useLocalStorage = (key, initialValue, storage = window.localStorage) => {
|
|
2938
|
-
const [storedValue, setStoredValue] =
|
|
2947
|
+
const [storedValue, setStoredValue] = useState8(() => {
|
|
2939
2948
|
try {
|
|
2940
2949
|
const item = storage.getItem(key);
|
|
2941
2950
|
return item !== null && Boolean(item) ? JSON.parse(item) : initialValue;
|
|
@@ -2979,7 +2988,7 @@ var useLockBodyScroll = (locked) => {
|
|
|
2979
2988
|
import { isBoolean } from "@wistia/type-guards";
|
|
2980
2989
|
|
|
2981
2990
|
// src/hooks/useWindowSize/useWindowSize.ts
|
|
2982
|
-
import { useState as
|
|
2991
|
+
import { useState as useState9, useLayoutEffect as useLayoutEffect3 } from "react";
|
|
2983
2992
|
import { debounce } from "throttle-debounce";
|
|
2984
2993
|
|
|
2985
2994
|
// src/private/helpers/isClient/isClient.ts
|
|
@@ -2987,7 +2996,7 @@ var isClient = () => typeof window !== "undefined" && typeof document !== "undef
|
|
|
2987
2996
|
|
|
2988
2997
|
// src/hooks/useWindowSize/useWindowSize.ts
|
|
2989
2998
|
var useWindowSize = (interval = 0) => {
|
|
2990
|
-
const [dimensions, setDimensions] =
|
|
2999
|
+
const [dimensions, setDimensions] = useState9({
|
|
2991
3000
|
width: isClient() ? window.innerWidth : 0,
|
|
2992
3001
|
height: isClient() ? window.innerHeight : 0
|
|
2993
3002
|
});
|
|
@@ -8042,7 +8051,11 @@ var StyledLink = styled5.a`
|
|
|
8042
8051
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
8043
8052
|
cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
|
|
8044
8053
|
font-family: inherit;
|
|
8045
|
-
color: ${({ $disabled }) =>
|
|
8054
|
+
color: ${({ $disabled, $inheritColor }) => {
|
|
8055
|
+
if ($disabled) return "var(--wui-color-text-disabled)";
|
|
8056
|
+
if ($inheritColor) return "inherit";
|
|
8057
|
+
return "var(--wui-color-text-link)";
|
|
8058
|
+
}};
|
|
8046
8059
|
text-decoration: ${({ $underline }) => $underline === "always" ? "underline" : "none"};
|
|
8047
8060
|
display: inline-flex;
|
|
8048
8061
|
align-items: baseline;
|
|
@@ -8074,6 +8087,7 @@ var Link = forwardRef(
|
|
|
8074
8087
|
disabled = false,
|
|
8075
8088
|
colorScheme = "inherit",
|
|
8076
8089
|
underline = "none",
|
|
8090
|
+
inheritColor = false,
|
|
8077
8091
|
leftIcon,
|
|
8078
8092
|
rightIcon,
|
|
8079
8093
|
"aria-disabled": ariaDisabled,
|
|
@@ -8083,6 +8097,7 @@ var Link = forwardRef(
|
|
|
8083
8097
|
const inRouterContext = useInRouterContext();
|
|
8084
8098
|
const to = generateHref(props.href, type, disabled);
|
|
8085
8099
|
const shouldUseReactRouterLink = inRouterContext && type !== "external" && !to?.startsWith("http");
|
|
8100
|
+
const hasIcons = isNotNil5(leftIcon) || isNotNil5(rightIcon);
|
|
8086
8101
|
const handleClick = async (event) => {
|
|
8087
8102
|
if (disabled) {
|
|
8088
8103
|
event.preventDefault();
|
|
@@ -8111,6 +8126,8 @@ var Link = forwardRef(
|
|
|
8111
8126
|
$colorScheme: colorScheme,
|
|
8112
8127
|
$disabled: disabled,
|
|
8113
8128
|
$underline: underline,
|
|
8129
|
+
$inheritColor: inheritColor,
|
|
8130
|
+
$hasIcons: hasIcons,
|
|
8114
8131
|
onClick: handleClick,
|
|
8115
8132
|
"aria-disabled": ariaDisabled ?? (disabled ? "true" : void 0)
|
|
8116
8133
|
};
|
|
@@ -8460,7 +8477,7 @@ var ActionButton = forwardRef3(
|
|
|
8460
8477
|
ActionButton.displayName = "ActionButton_UI";
|
|
8461
8478
|
|
|
8462
8479
|
// src/components/Avatar/Avatar.tsx
|
|
8463
|
-
import { useState as
|
|
8480
|
+
import { useState as useState10, useMemo as useMemo4, useEffect as useEffect7 } from "react";
|
|
8464
8481
|
import { isNil as isNil8, isNotNil as isNotNil8 } from "@wistia/type-guards";
|
|
8465
8482
|
import { styled as styled10 } from "styled-components";
|
|
8466
8483
|
|
|
@@ -8673,7 +8690,7 @@ var Avatar = ({
|
|
|
8673
8690
|
onImageLoad,
|
|
8674
8691
|
...props
|
|
8675
8692
|
}) => {
|
|
8676
|
-
const [imageLoadState, setImageLoadState] =
|
|
8693
|
+
const [imageLoadState, setImageLoadState] = useState10("loading");
|
|
8677
8694
|
useEffect7(() => {
|
|
8678
8695
|
setImageLoadState("loading");
|
|
8679
8696
|
}, [imageUrl]);
|
|
@@ -8765,7 +8782,7 @@ var Badge = forwardRef4(
|
|
|
8765
8782
|
Badge.displayName = "Badge_UI";
|
|
8766
8783
|
|
|
8767
8784
|
// src/components/Banner/Banner.tsx
|
|
8768
|
-
import { useEffect as useEffect8, useState as
|
|
8785
|
+
import { useEffect as useEffect8, useState as useState11, useMemo as useMemo5 } from "react";
|
|
8769
8786
|
import { styled as styled17 } from "styled-components";
|
|
8770
8787
|
import { isNil as isNil11, isNotNil as isNotNil13 } from "@wistia/type-guards";
|
|
8771
8788
|
|
|
@@ -9540,8 +9557,8 @@ var Banner = ({
|
|
|
9540
9557
|
}) => {
|
|
9541
9558
|
const [containerRef, { width }] = useElementObserver();
|
|
9542
9559
|
const [contentRef, { height: contentHeight }] = useElementObserver();
|
|
9543
|
-
const [isSmallContainer, setIsSmallContainer] =
|
|
9544
|
-
const [isVerticalLayout, setIsVerticalLayout] =
|
|
9560
|
+
const [isSmallContainer, setIsSmallContainer] = useState11(false);
|
|
9561
|
+
const [isVerticalLayout, setIsVerticalLayout] = useState11(orientation === "vertical");
|
|
9545
9562
|
useEffect8(() => {
|
|
9546
9563
|
const breakpoint = orientation === "vertical" ? VERTICAL_BREAKPOINT_WIDTH : BREAKPOINT_WIDTH;
|
|
9547
9564
|
setIsSmallContainer(width <= breakpoint);
|
|
@@ -10143,7 +10160,7 @@ var FormGroup = ({
|
|
|
10143
10160
|
FormGroup.displayName = "FormGroup_UI";
|
|
10144
10161
|
|
|
10145
10162
|
// src/components/Form/Form.tsx
|
|
10146
|
-
import { forwardRef as forwardRef11, useRef as useRef8, useMemo as useMemo6, createContext as createContext3, useState as
|
|
10163
|
+
import { forwardRef as forwardRef11, useRef as useRef8, useMemo as useMemo6, createContext as createContext3, useState as useState12, useId } from "react";
|
|
10147
10164
|
import { styled as styled28 } from "styled-components";
|
|
10148
10165
|
import { isNotUndefined as isNotUndefined6, isUndefined as isUndefined3 } from "@wistia/type-guards";
|
|
10149
10166
|
|
|
@@ -10186,8 +10203,8 @@ var Form = forwardRef11(
|
|
|
10186
10203
|
fullWidth = false,
|
|
10187
10204
|
...props
|
|
10188
10205
|
}, forwardedRef) => {
|
|
10189
|
-
const [errors, setErrors] =
|
|
10190
|
-
const [hasSubmitted, setHasSubmitted] =
|
|
10206
|
+
const [errors, setErrors] = useState12({});
|
|
10207
|
+
const [hasSubmitted, setHasSubmitted] = useState12(false);
|
|
10191
10208
|
const innerRef = useRef8(null);
|
|
10192
10209
|
const ref = forwardedRef ?? innerRef;
|
|
10193
10210
|
const autoId = useId();
|
|
@@ -10622,7 +10639,7 @@ import { styled as styled34 } from "styled-components";
|
|
|
10622
10639
|
import { Root as RadioGroupRoot } from "@radix-ui/react-radio-group";
|
|
10623
10640
|
|
|
10624
10641
|
// src/components/ColorPicker/ColorPickerContext.tsx
|
|
10625
|
-
import { createContext as createContext5, useCallback as useCallback9, useContext as useContext4, useEffect as useEffect10, useMemo as useMemo8, useState as
|
|
10642
|
+
import { createContext as createContext5, useCallback as useCallback9, useContext as useContext4, useEffect as useEffect10, useMemo as useMemo8, useState as useState13 } from "react";
|
|
10626
10643
|
import { formatHex as formatHex2 } from "culori/fn";
|
|
10627
10644
|
|
|
10628
10645
|
// src/components/ColorPicker/color-conversion-utils.ts
|
|
@@ -11021,11 +11038,11 @@ var ColorPickerProvider = ({
|
|
|
11021
11038
|
opacityForContrastCalculation,
|
|
11022
11039
|
value: valueAsHex
|
|
11023
11040
|
}) => {
|
|
11024
|
-
const [isTransitioning, setIsTransitioning] =
|
|
11025
|
-
const [isDragging, setIsDragging] =
|
|
11026
|
-
const [nonDerivedValueAsHsv, setNonDerivedValueAsHsv] =
|
|
11027
|
-
const [valueAsHsv, setValueAsHsv] =
|
|
11028
|
-
const [shouldEnforceMinContrast, setShouldEnforceMinContrast] =
|
|
11041
|
+
const [isTransitioning, setIsTransitioning] = useState13(false);
|
|
11042
|
+
const [isDragging, setIsDragging] = useState13(false);
|
|
11043
|
+
const [nonDerivedValueAsHsv, setNonDerivedValueAsHsv] = useState13(convertToHsv(valueAsHex));
|
|
11044
|
+
const [valueAsHsv, setValueAsHsv] = useState13(convertToHsv(valueAsHex));
|
|
11045
|
+
const [shouldEnforceMinContrast, setShouldEnforceMinContrast] = useState13(false);
|
|
11029
11046
|
const getAccessibleDerivativeColor = useCallback9(
|
|
11030
11047
|
(originalColor) => getAccessibleColor({
|
|
11031
11048
|
originalColor,
|
|
@@ -12090,7 +12107,7 @@ var ContrastControls = () => {
|
|
|
12090
12107
|
ContrastControls.displayName = "ContrastControls_UI";
|
|
12091
12108
|
|
|
12092
12109
|
// src/components/ColorPicker/HexColorInput.tsx
|
|
12093
|
-
import { useCallback as useCallback13, useEffect as useEffect11, useRef as useRef10, useState as
|
|
12110
|
+
import { useCallback as useCallback13, useEffect as useEffect11, useRef as useRef10, useState as useState14 } from "react";
|
|
12094
12111
|
import { parseHex as parseHex2 } from "culori/fn";
|
|
12095
12112
|
|
|
12096
12113
|
// src/components/Input/Input.tsx
|
|
@@ -12369,7 +12386,7 @@ var normalizeHexInput = (input) => {
|
|
|
12369
12386
|
var HexColorInput = ({ autoFocus = true }) => {
|
|
12370
12387
|
const { valueAsHex, nonDerivedValueAsHsv, onChangeNonDerivedValueAsHsv } = useColorPickerState();
|
|
12371
12388
|
const inputRef = useRef10(null);
|
|
12372
|
-
const [textInputValue, setTextInputValue] =
|
|
12389
|
+
const [textInputValue, setTextInputValue] = useState14(valueAsHex);
|
|
12373
12390
|
const onChangeInputValue = useCallback13(
|
|
12374
12391
|
(event) => {
|
|
12375
12392
|
const newValue = (event.target.value || "#").trim().toLocaleLowerCase();
|
|
@@ -12659,7 +12676,7 @@ var HueSlider = () => {
|
|
|
12659
12676
|
HueSlider.displayName = "HueSlider_UI";
|
|
12660
12677
|
|
|
12661
12678
|
// src/components/ColorPicker/SaturationAndValuePicker.tsx
|
|
12662
|
-
import { useCallback as useCallback15, useEffect as useEffect14, useLayoutEffect as useLayoutEffect4, useMemo as useMemo10, useRef as useRef13, useState as
|
|
12679
|
+
import { useCallback as useCallback15, useEffect as useEffect14, useLayoutEffect as useLayoutEffect4, useMemo as useMemo10, useRef as useRef13, useState as useState15 } from "react";
|
|
12663
12680
|
import { styled as styled50 } from "styled-components";
|
|
12664
12681
|
|
|
12665
12682
|
// src/components/ColorPicker/HSVSaturationValueCanvas.tsx
|
|
@@ -12868,7 +12885,7 @@ var SaturationAndValuePicker = ({
|
|
|
12868
12885
|
}
|
|
12869
12886
|
return valueAsHexConvertedToHsv;
|
|
12870
12887
|
}, [isTransitioning, valueAsHexConvertedToHsv, valueAsHsv]);
|
|
12871
|
-
const [thumbStyle, setThumbStyle] =
|
|
12888
|
+
const [thumbStyle, setThumbStyle] = useState15({
|
|
12872
12889
|
backgroundColor: valueAsHex
|
|
12873
12890
|
});
|
|
12874
12891
|
useLayoutEffect4(() => {
|
|
@@ -13036,7 +13053,7 @@ import * as Ariakit from "@ariakit/react";
|
|
|
13036
13053
|
import {
|
|
13037
13054
|
useMemo as useMemo11,
|
|
13038
13055
|
useRef as useRef14,
|
|
13039
|
-
useState as
|
|
13056
|
+
useState as useState16,
|
|
13040
13057
|
useTransition,
|
|
13041
13058
|
useEffect as useEffect15,
|
|
13042
13059
|
Children as Children5,
|
|
@@ -13386,9 +13403,9 @@ var Combobox2 = ({
|
|
|
13386
13403
|
flipPopover = true,
|
|
13387
13404
|
fullWidth = true
|
|
13388
13405
|
}) => {
|
|
13389
|
-
const [isOpen, setIsOpen] =
|
|
13406
|
+
const [isOpen, setIsOpen] = useState16(false);
|
|
13390
13407
|
const [isPending, startTransition] = useTransition();
|
|
13391
|
-
const [wrapperWidth, setWrapperWidth] =
|
|
13408
|
+
const [wrapperWidth, setWrapperWidth] = useState16("auto");
|
|
13392
13409
|
const comboboxWrapperRef = useRef14(null);
|
|
13393
13410
|
const options = useMemo11(() => extractOptions(children), [children]);
|
|
13394
13411
|
const isMultiSelect = isArray2(value);
|
|
@@ -13492,7 +13509,7 @@ var Combobox2 = ({
|
|
|
13492
13509
|
|
|
13493
13510
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
13494
13511
|
import { isNil as isNil16, isNotNil as isNotNil24 } from "@wistia/type-guards";
|
|
13495
|
-
import { useEffect as useEffect16, useState as
|
|
13512
|
+
import { useEffect as useEffect16, useState as useState18 } from "react";
|
|
13496
13513
|
import { createPortal } from "react-dom";
|
|
13497
13514
|
|
|
13498
13515
|
// src/components/Menu/Menu.tsx
|
|
@@ -13694,7 +13711,7 @@ var MenuLabel = ({ children, ...props }) => {
|
|
|
13694
13711
|
MenuLabel.displayName = "MenuLabel_UI";
|
|
13695
13712
|
|
|
13696
13713
|
// src/components/Menu/SubMenu.tsx
|
|
13697
|
-
import { useState as
|
|
13714
|
+
import { useState as useState17 } from "react";
|
|
13698
13715
|
import { styled as styled57 } from "styled-components";
|
|
13699
13716
|
import {
|
|
13700
13717
|
DropdownMenuPortal as DropdownMenuPortal2,
|
|
@@ -13890,7 +13907,7 @@ var SubMenu = ({
|
|
|
13890
13907
|
...props
|
|
13891
13908
|
}) => {
|
|
13892
13909
|
const { isSmAndUp } = useMq();
|
|
13893
|
-
const [isExpanded, setIsExpanded] =
|
|
13910
|
+
const [isExpanded, setIsExpanded] = useState17(false);
|
|
13894
13911
|
const { compact } = useMenuContext();
|
|
13895
13912
|
return isSmAndUp ? /* @__PURE__ */ jsxs38(DropdownMenuSub, { onOpenChange, children: [
|
|
13896
13913
|
/* @__PURE__ */ jsxs38(SubMenuTrigger, { ...props, children: [
|
|
@@ -14182,8 +14199,8 @@ var ContextMenu = ({
|
|
|
14182
14199
|
onRequestClose = () => null,
|
|
14183
14200
|
compact = false
|
|
14184
14201
|
}) => {
|
|
14185
|
-
const [isRightClicked, setIsRightClicked] =
|
|
14186
|
-
const [menuPosition, setMenuPosition] =
|
|
14202
|
+
const [isRightClicked, setIsRightClicked] = useState18(false);
|
|
14203
|
+
const [menuPosition, setMenuPosition] = useState18(position ?? { x: 0, y: 0 });
|
|
14187
14204
|
useEffect16(() => {
|
|
14188
14205
|
if (isNil16(position)) {
|
|
14189
14206
|
const onContextMenu = (event) => {
|
|
@@ -14685,7 +14702,7 @@ Divider.displayName = "Divider_UI";
|
|
|
14685
14702
|
|
|
14686
14703
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
14687
14704
|
import { styled as styled64, css as css34 } from "styled-components";
|
|
14688
|
-
import { useState as
|
|
14705
|
+
import { useState as useState19, useRef as useRef16 } from "react";
|
|
14689
14706
|
import { Fragment as Fragment8, jsx as jsx297, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
14690
14707
|
var StyledInput = styled64(Input)`
|
|
14691
14708
|
&:not([rows]) {
|
|
@@ -14740,10 +14757,10 @@ var EditableHeading = ({
|
|
|
14740
14757
|
__forceEditing = false,
|
|
14741
14758
|
editingDisabled = false
|
|
14742
14759
|
}) => {
|
|
14743
|
-
const [isEditing, setIsEditing] =
|
|
14744
|
-
const [value, setValue] =
|
|
14745
|
-
const [previousValue, setPreviousValue] =
|
|
14746
|
-
const [headingHeight, setHeadingHeight] =
|
|
14760
|
+
const [isEditing, setIsEditing] = useState19(false);
|
|
14761
|
+
const [value, setValue] = useState19(children);
|
|
14762
|
+
const [previousValue, setPreviousValue] = useState19(children);
|
|
14763
|
+
const [headingHeight, setHeadingHeight] = useState19("60");
|
|
14747
14764
|
const headingRef = useRef16(null);
|
|
14748
14765
|
const handleSetEditing = (editing) => {
|
|
14749
14766
|
if (editingDisabled) {
|
|
@@ -14831,7 +14848,7 @@ import { styled as styled66, css as css35 } from "styled-components";
|
|
|
14831
14848
|
import { isNotNil as isNotNil26 } from "@wistia/type-guards";
|
|
14832
14849
|
|
|
14833
14850
|
// src/components/EditableText/EditableTextRoot.tsx
|
|
14834
|
-
import { createContext as createContext7, useMemo as useMemo13, useState as
|
|
14851
|
+
import { createContext as createContext7, useMemo as useMemo13, useState as useState20, useCallback as useCallback16, useId as useId4 } from "react";
|
|
14835
14852
|
import { isNonEmptyString as isNonEmptyString6 } from "@wistia/type-guards";
|
|
14836
14853
|
import { styled as styled65 } from "styled-components";
|
|
14837
14854
|
import { jsx as jsx298 } from "react/jsx-runtime";
|
|
@@ -14896,9 +14913,9 @@ var EditableTextRoot = ({
|
|
|
14896
14913
|
...props
|
|
14897
14914
|
}) => {
|
|
14898
14915
|
const isControlled = controlledValue !== void 0;
|
|
14899
|
-
const [internalValue, setInternalValue] =
|
|
14900
|
-
const [originalValue, setOriginalValue] =
|
|
14901
|
-
const [isEditing, setIsEditing] =
|
|
14916
|
+
const [internalValue, setInternalValue] = useState20(defaultValue);
|
|
14917
|
+
const [originalValue, setOriginalValue] = useState20(defaultValue);
|
|
14918
|
+
const [isEditing, setIsEditing] = useState20(false);
|
|
14902
14919
|
const value = isControlled ? controlledValue : internalValue;
|
|
14903
14920
|
const generatedId = useId4();
|
|
14904
14921
|
const computedId = isNonEmptyString6(id) ? id : `wistia-ui-editable-text-${generatedId}`;
|
|
@@ -15323,11 +15340,11 @@ var EditableTextTrigger = ({
|
|
|
15323
15340
|
};
|
|
15324
15341
|
|
|
15325
15342
|
// src/components/Form/useFormState.tsx
|
|
15326
|
-
import { useCallback as useCallback17, useState as
|
|
15343
|
+
import { useCallback as useCallback17, useState as useState21 } from "react";
|
|
15327
15344
|
var useFormState = (action, initialData = {}) => {
|
|
15328
|
-
const [data, setData] =
|
|
15329
|
-
const [isPending, setIsPending] =
|
|
15330
|
-
const [error, setError] =
|
|
15345
|
+
const [data, setData] = useState21(initialData);
|
|
15346
|
+
const [isPending, setIsPending] = useState21(false);
|
|
15347
|
+
const [error, setError] = useState21(null);
|
|
15331
15348
|
const formAction = useCallback17(
|
|
15332
15349
|
async (nextFormData) => {
|
|
15333
15350
|
if (nextFormData === null) {
|
|
@@ -15727,7 +15744,7 @@ var Grid = makePolymorphic(GridComponent);
|
|
|
15727
15744
|
|
|
15728
15745
|
// src/components/InputClickToCopy/InputClickToCopy.tsx
|
|
15729
15746
|
import { styled as styled70 } from "styled-components";
|
|
15730
|
-
import { forwardRef as forwardRef23, useEffect as useEffect18, useState as
|
|
15747
|
+
import { forwardRef as forwardRef23, useEffect as useEffect18, useState as useState22 } from "react";
|
|
15731
15748
|
import { isFunction as isFunction3 } from "@wistia/type-guards";
|
|
15732
15749
|
import { jsx as jsx307 } from "react/jsx-runtime";
|
|
15733
15750
|
var StyledIconButton = styled70(IconButton)`
|
|
@@ -15741,7 +15758,7 @@ var StyledIconButton = styled70(IconButton)`
|
|
|
15741
15758
|
var COPY_SUCCESS_DURATION = 2e3;
|
|
15742
15759
|
var InputClickToCopy = forwardRef23(
|
|
15743
15760
|
({ value, onCopy, disabled = false, ...props }, ref) => {
|
|
15744
|
-
const [isCopied, setIsCopied] =
|
|
15761
|
+
const [isCopied, setIsCopied] = useState22(false);
|
|
15745
15762
|
useEffect18(() => {
|
|
15746
15763
|
if (isCopied) {
|
|
15747
15764
|
const timeout = setTimeout(() => {
|
|
@@ -15797,7 +15814,7 @@ InputClickToCopy.displayName = "InputClickToCopy_UI";
|
|
|
15797
15814
|
|
|
15798
15815
|
// src/components/InputPassword/InputPassword.tsx
|
|
15799
15816
|
import { styled as styled71 } from "styled-components";
|
|
15800
|
-
import { forwardRef as forwardRef24, useState as
|
|
15817
|
+
import { forwardRef as forwardRef24, useState as useState23 } from "react";
|
|
15801
15818
|
import { isFunction as isFunction4 } from "@wistia/type-guards";
|
|
15802
15819
|
import { jsx as jsx308 } from "react/jsx-runtime";
|
|
15803
15820
|
var StyledIconButton2 = styled71(IconButton)`
|
|
@@ -15810,7 +15827,7 @@ var StyledIconButton2 = styled71(IconButton)`
|
|
|
15810
15827
|
`;
|
|
15811
15828
|
var InputPassword = forwardRef24(
|
|
15812
15829
|
({ onVisibilityToggle, disabled = false, ...props }, ref) => {
|
|
15813
|
-
const [isVisible, setIsVisible] =
|
|
15830
|
+
const [isVisible, setIsVisible] = useState23(false);
|
|
15814
15831
|
const handleClick = () => {
|
|
15815
15832
|
const newVisibility = !isVisible;
|
|
15816
15833
|
setIsVisible(newVisibility);
|
|
@@ -17381,7 +17398,7 @@ var RadioCardImage = forwardRef30(
|
|
|
17381
17398
|
RadioCardImage.displayName = "RadioCardImage_UI";
|
|
17382
17399
|
|
|
17383
17400
|
// src/components/ScrollArea/ScrollArea.tsx
|
|
17384
|
-
import { forwardRef as forwardRef31, useCallback as useCallback18, useEffect as useEffect20, useMemo as useMemo15, useRef as useRef21, useState as
|
|
17401
|
+
import { forwardRef as forwardRef31, useCallback as useCallback18, useEffect as useEffect20, useMemo as useMemo15, useRef as useRef21, useState as useState24 } from "react";
|
|
17385
17402
|
import { styled as styled90 } from "styled-components";
|
|
17386
17403
|
import { throttle } from "throttle-debounce";
|
|
17387
17404
|
import { jsx as jsx327, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
@@ -17434,7 +17451,7 @@ var ShadowAtRight = styled90(Shadow)`
|
|
|
17434
17451
|
var ScrollArea = forwardRef31(
|
|
17435
17452
|
({ children, onScroll, style, locked = false, ...props }, forwardedRef) => {
|
|
17436
17453
|
const scrollContainerRefInternal = useRef21(null);
|
|
17437
|
-
const [shadowState, setShadowState] =
|
|
17454
|
+
const [shadowState, setShadowState] = useState24({
|
|
17438
17455
|
canScrollUp: false,
|
|
17439
17456
|
canScrollLeft: false,
|
|
17440
17457
|
canScrollDown: false,
|
|
@@ -17491,13 +17508,13 @@ import { Root as ToggleGroupRoot2 } from "@radix-ui/react-toggle-group";
|
|
|
17491
17508
|
import { isNil as isNil18 } from "@wistia/type-guards";
|
|
17492
17509
|
|
|
17493
17510
|
// src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
17494
|
-
import { createContext as createContext9, useContext as useContext15, useMemo as useMemo16, useState as
|
|
17511
|
+
import { createContext as createContext9, useContext as useContext15, useMemo as useMemo16, useState as useState25 } from "react";
|
|
17495
17512
|
import { jsx as jsx328 } from "react/jsx-runtime";
|
|
17496
17513
|
var SelectedItemStyleContext = createContext9(null);
|
|
17497
17514
|
var SelectedItemStyleProvider = ({
|
|
17498
17515
|
children
|
|
17499
17516
|
}) => {
|
|
17500
|
-
const [selectedItemMeasurements, setSelectedItemMeasurements] =
|
|
17517
|
+
const [selectedItemMeasurements, setSelectedItemMeasurements] = useState25(null);
|
|
17501
17518
|
const selectedItemIndicatorStyle = useMemo16(
|
|
17502
17519
|
() => selectedItemMeasurements != null ? {
|
|
17503
17520
|
height: `${selectedItemMeasurements.offsetHeight}px`,
|
|
@@ -17574,6 +17591,9 @@ var SelectedItemIndicator = () => {
|
|
|
17574
17591
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
17575
17592
|
import { jsx as jsx330, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
17576
17593
|
var segmentedControlStyles = css46`
|
|
17594
|
+
${({ $colorScheme }) => $colorScheme && getColorScheme($colorScheme)};
|
|
17595
|
+
--wui-color-text-selected: var(--wui-color-text-link);
|
|
17596
|
+
|
|
17577
17597
|
display: inline-flex;
|
|
17578
17598
|
background-color: var(--wui-color-bg-surface-secondary);
|
|
17579
17599
|
border-radius: var(--wui-border-radius-rounded);
|
|
@@ -17590,6 +17610,7 @@ var StyledSegmentedControl = styled92(ToggleGroupRoot2)`
|
|
|
17590
17610
|
var SegmentedControl = forwardRef32(
|
|
17591
17611
|
({
|
|
17592
17612
|
children,
|
|
17613
|
+
colorScheme = "inherit",
|
|
17593
17614
|
disabled = false,
|
|
17594
17615
|
fullWidth = false,
|
|
17595
17616
|
selectedValue,
|
|
@@ -17603,6 +17624,7 @@ var SegmentedControl = forwardRef32(
|
|
|
17603
17624
|
StyledSegmentedControl,
|
|
17604
17625
|
{
|
|
17605
17626
|
ref,
|
|
17627
|
+
$colorScheme: colorScheme,
|
|
17606
17628
|
$fullWidth: fullWidth,
|
|
17607
17629
|
disabled,
|
|
17608
17630
|
loop: true,
|
|
@@ -18251,7 +18273,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
18251
18273
|
|
|
18252
18274
|
// src/components/Tabs/Tabs.tsx
|
|
18253
18275
|
import { Root as RadixTabsRoot } from "@radix-ui/react-tabs";
|
|
18254
|
-
import { useCallback as useCallback19, useState as
|
|
18276
|
+
import { useCallback as useCallback19, useState as useState26 } from "react";
|
|
18255
18277
|
import { isNotNil as isNotNil38 } from "@wistia/type-guards";
|
|
18256
18278
|
|
|
18257
18279
|
// src/components/Tabs/useTabsValue.tsx
|
|
@@ -18275,7 +18297,7 @@ var Tabs = ({
|
|
|
18275
18297
|
defaultValue,
|
|
18276
18298
|
...props
|
|
18277
18299
|
}) => {
|
|
18278
|
-
const [value, setValue] =
|
|
18300
|
+
const [value, setValue] = useState26(valueProp ?? defaultValue);
|
|
18279
18301
|
const onValueChange = useCallback19(
|
|
18280
18302
|
(newValue) => {
|
|
18281
18303
|
setValue(newValue);
|
|
@@ -18464,7 +18486,7 @@ var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
|
18464
18486
|
ThumbnailBadge.displayName = "ThumbnailBadge_UI";
|
|
18465
18487
|
|
|
18466
18488
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
18467
|
-
import { forwardRef as forwardRef37, useState as
|
|
18489
|
+
import { forwardRef as forwardRef37, useState as useState27, useRef as useRef24, useCallback as useCallback20, useMemo as useMemo17 } from "react";
|
|
18468
18490
|
import { styled as styled109 } from "styled-components";
|
|
18469
18491
|
import {
|
|
18470
18492
|
isNil as isNil19,
|
|
@@ -18865,11 +18887,11 @@ var Thumbnail = forwardRef37(
|
|
|
18865
18887
|
aspectRatio = "wide",
|
|
18866
18888
|
...props
|
|
18867
18889
|
}, ref) => {
|
|
18868
|
-
const [percent, setPercent] =
|
|
18869
|
-
const [isMouseOver, setIsMouseOver] =
|
|
18870
|
-
const [isStoryboardReady, setIsStoryboardReady] =
|
|
18890
|
+
const [percent, setPercent] = useState27(0);
|
|
18891
|
+
const [isMouseOver, setIsMouseOver] = useState27(false);
|
|
18892
|
+
const [isStoryboardReady, setIsStoryboardReady] = useState27(false);
|
|
18871
18893
|
const storyboardElementRef = useRef24(null);
|
|
18872
|
-
const [cursorPosition, setCursorPosition] =
|
|
18894
|
+
const [cursorPosition, setCursorPosition] = useState27(null);
|
|
18873
18895
|
const backgroundUrl = useMemo17(
|
|
18874
18896
|
() => thumbnailImageType === "square" && hasValidThumbnailUrl(thumbnailUrl) ? thumbnailUrl : void 0,
|
|
18875
18897
|
[thumbnailImageType, thumbnailUrl]
|
|
@@ -19428,6 +19450,7 @@ export {
|
|
|
19428
19450
|
useImperativeFilePicker,
|
|
19429
19451
|
useIsHovered,
|
|
19430
19452
|
useKey,
|
|
19453
|
+
useKeyPress,
|
|
19431
19454
|
useLocalStorage,
|
|
19432
19455
|
useLockBodyScroll,
|
|
19433
19456
|
useMq,
|