@wistia/ui 0.8.13 → 0.8.14

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.mts CHANGED
@@ -86,6 +86,14 @@ type UseBooleanReturn = [
86
86
  ];
87
87
  declare const useBoolean: (initialValue?: boolean) => UseBooleanReturn;
88
88
 
89
+ declare const useClipboard: (textToCopy: string, timeout?: number) => [() => Promise<void>, boolean, boolean];
90
+
91
+ type UseFocusTrapOptions = {
92
+ disableAriaHider?: boolean;
93
+ focusSelector?: HTMLElement | RefObject<HTMLElement> | string | null | undefined;
94
+ };
95
+ declare const useFocusTrap: (active?: boolean, options?: UseFocusTrapOptions) => (node: HTMLElement | null | undefined) => void;
96
+
89
97
  type AddEventListenerType = (type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions | boolean) => void;
90
98
  type RemoveEventListenerType = (type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions | boolean) => void;
91
99
  declare const useEvent: <T extends Event>(eventName: Parameters<AddEventListenerType>[0], eventHandler: (event: T) => unknown, eventTarget?: unknown, eventOptions?: Parameters<RemoveEventListenerType>[2]) => void;
@@ -105,9 +113,6 @@ declare const useLocalStorage: <T, _>(key: Parameters<SetItemType>[0], initialVa
105
113
 
106
114
  declare const useLockBodyScroll: (locked: boolean) => void;
107
115
 
108
- type EventType = 'focusin' | 'focusout' | 'mousedown' | 'mouseup' | 'touchend' | 'touchstart';
109
- declare const useOnClickOutside: (ref: RefObject<HTMLElement | null | undefined>, handler: (event: Event) => unknown, eventTypes?: EventType | EventType[]) => void;
110
-
111
116
  type MediaQueryBooleans = {
112
117
  isXlAndUp: boolean;
113
118
  isLgAndUp: boolean;
@@ -124,6 +129,9 @@ declare const useMq: () => MediaQueryBooleans;
124
129
  type MediaQueryLabels = keyof MediaQueryBooleans;
125
130
  declare const useActiveMq: () => MediaQueryLabels[];
126
131
 
132
+ type EventType = 'focusin' | 'focusout' | 'mousedown' | 'mouseup' | 'touchend' | 'touchstart';
133
+ declare const useOnClickOutside: (ref: RefObject<HTMLElement | null | undefined>, handler: (event: Event) => unknown, eventTypes?: EventType | EventType[]) => void;
134
+
127
135
  declare const colorSchemeOptions: readonly ["default", "inherit", "error", "info", "success", "warning", "blue", "green", "orange", "pink", "purple", "yellow", "vendor-hubspot", "vendor-marketo", "vendor-pardot"];
128
136
  type ColorSchemeTypes = (typeof colorSchemeOptions)[number];
129
137
  type ColorSchemeWrapperProps = ComponentPropsWithoutRef<'div'> & {
@@ -395,12 +403,6 @@ declare const useWindowSize: (interval?: number) => {
395
403
  height: number;
396
404
  };
397
405
 
398
- type UseFocusTrapOptions = {
399
- disableAriaHider?: boolean;
400
- focusSelector?: HTMLElement | RefObject<HTMLElement> | string | null | undefined;
401
- };
402
- declare const useFocusTrap: (active?: boolean, options?: UseFocusTrapOptions) => (node: HTMLElement | null | undefined) => void;
403
-
404
406
  type ActionButtonProps = {
405
407
  /**
406
408
  * @override
@@ -2839,10 +2841,10 @@ type TableCellProps = CellAttrs & {
2839
2841
  };
2840
2842
  declare const TableCell: ({ children, ...props }: TableCellProps) => JSX.Element;
2841
2843
 
2842
- type TableFooterProps = react__default.HTMLAttributes<HTMLTableSectionElement> & {
2844
+ type TableFootProps = react__default.HTMLAttributes<HTMLTableSectionElement> & {
2843
2845
  children?: ReactNode;
2844
2846
  };
2845
- declare const TableFooter: ({ children, ...props }: TableFooterProps) => JSX.Element;
2847
+ declare const TableFoot: ({ children, ...props }: TableFootProps) => JSX.Element;
2846
2848
 
2847
2849
  type TableHeadProps = react__default.HTMLAttributes<HTMLTableSectionElement> & {
2848
2850
  children?: ReactNode;
@@ -2851,22 +2853,28 @@ declare const TableHead: ({ children, ...props }: TableHeadProps) => JSX.Element
2851
2853
 
2852
2854
  type TableProps = ComponentPropsWithoutRef<'table'> & {
2853
2855
  /**
2854
- * Should be some combination of `TableHead` and/or `TableBody` and/or `TableFooter`
2856
+ * Should be some combination of `TableHead` and/or `TableBody` and/or `TableFoot`
2855
2857
  */
2856
2858
  children: ReactNode;
2859
+ /**
2860
+ * If true, will add dividing lines between rows
2861
+ */
2862
+ divided?: boolean;
2857
2863
  /**
2858
2864
  * If true, will stripe every other row
2859
2865
  */
2860
2866
  striped?: boolean;
2861
2867
  /**
2862
- * If true, will add dividing lines between rows
2868
+ * If true, will visually hide the table header while keeping it accessible to screen readers
2869
+ *
2870
+ * @see https://www.accessibility-developer-guide.com/examples/tables/hidden-headers/
2863
2871
  */
2864
- divided?: boolean;
2872
+ visuallyHiddenHeader?: boolean;
2865
2873
  };
2866
2874
  /**
2867
2875
  * Semantic table element for presenting data
2868
2876
  */
2869
- declare const Table: ({ children, striped, divided, ...props }: TableProps) => JSX.Element;
2877
+ declare const Table: ({ children, divided, striped, visuallyHiddenHeader, ...props }: TableProps) => JSX.Element;
2870
2878
 
2871
2879
  type TableRowProps = HTMLAttributes<HTMLTableRowElement> & {
2872
2880
  children?: ReactNode;
@@ -3195,4 +3203,4 @@ declare const WistiaLogo: {
3195
3203
  displayName: string;
3196
3204
  };
3197
3205
 
3198
- 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, type EllipsisProps, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, InputClickToCopy, type InputClickToCopyProps, 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, Thumbnail, ThumbnailBadge, type ThumbnailBadgeProps, ThumbnailCollage, type ThumbnailCollageProps, type ThumbnailProps, Tooltip, type TooltipProps, UIProvider, type UseToastProps, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, iconSizeMap, mergeRefs, mq, useActiveMq, useAriaLive, useBoolean, useFocusTrap, useFormState, useKey, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, useToast, useWindowSize };
3206
+ 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, type EllipsisProps, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, InputClickToCopy, type InputClickToCopyProps, 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, TableFoot, type TableFootProps, TableHead, type TableHeadProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextProps, Thumbnail, ThumbnailBadge, type ThumbnailBadgeProps, ThumbnailCollage, type ThumbnailCollageProps, type ThumbnailProps, Tooltip, type TooltipProps, UIProvider, type UseToastProps, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, iconSizeMap, mergeRefs, mq, useActiveMq, useAriaLive, useBoolean, useClipboard, useFocusTrap, useFormState, useKey, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, useToast, useWindowSize };
package/dist/index.d.ts CHANGED
@@ -86,6 +86,14 @@ type UseBooleanReturn = [
86
86
  ];
87
87
  declare const useBoolean: (initialValue?: boolean) => UseBooleanReturn;
88
88
 
89
+ declare const useClipboard: (textToCopy: string, timeout?: number) => [() => Promise<void>, boolean, boolean];
90
+
91
+ type UseFocusTrapOptions = {
92
+ disableAriaHider?: boolean;
93
+ focusSelector?: HTMLElement | RefObject<HTMLElement> | string | null | undefined;
94
+ };
95
+ declare const useFocusTrap: (active?: boolean, options?: UseFocusTrapOptions) => (node: HTMLElement | null | undefined) => void;
96
+
89
97
  type AddEventListenerType = (type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions | boolean) => void;
90
98
  type RemoveEventListenerType = (type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions | boolean) => void;
91
99
  declare const useEvent: <T extends Event>(eventName: Parameters<AddEventListenerType>[0], eventHandler: (event: T) => unknown, eventTarget?: unknown, eventOptions?: Parameters<RemoveEventListenerType>[2]) => void;
@@ -105,9 +113,6 @@ declare const useLocalStorage: <T, _>(key: Parameters<SetItemType>[0], initialVa
105
113
 
106
114
  declare const useLockBodyScroll: (locked: boolean) => void;
107
115
 
108
- type EventType = 'focusin' | 'focusout' | 'mousedown' | 'mouseup' | 'touchend' | 'touchstart';
109
- declare const useOnClickOutside: (ref: RefObject<HTMLElement | null | undefined>, handler: (event: Event) => unknown, eventTypes?: EventType | EventType[]) => void;
110
-
111
116
  type MediaQueryBooleans = {
112
117
  isXlAndUp: boolean;
113
118
  isLgAndUp: boolean;
@@ -124,6 +129,9 @@ declare const useMq: () => MediaQueryBooleans;
124
129
  type MediaQueryLabels = keyof MediaQueryBooleans;
125
130
  declare const useActiveMq: () => MediaQueryLabels[];
126
131
 
132
+ type EventType = 'focusin' | 'focusout' | 'mousedown' | 'mouseup' | 'touchend' | 'touchstart';
133
+ declare const useOnClickOutside: (ref: RefObject<HTMLElement | null | undefined>, handler: (event: Event) => unknown, eventTypes?: EventType | EventType[]) => void;
134
+
127
135
  declare const colorSchemeOptions: readonly ["default", "inherit", "error", "info", "success", "warning", "blue", "green", "orange", "pink", "purple", "yellow", "vendor-hubspot", "vendor-marketo", "vendor-pardot"];
128
136
  type ColorSchemeTypes = (typeof colorSchemeOptions)[number];
129
137
  type ColorSchemeWrapperProps = ComponentPropsWithoutRef<'div'> & {
@@ -395,12 +403,6 @@ declare const useWindowSize: (interval?: number) => {
395
403
  height: number;
396
404
  };
397
405
 
398
- type UseFocusTrapOptions = {
399
- disableAriaHider?: boolean;
400
- focusSelector?: HTMLElement | RefObject<HTMLElement> | string | null | undefined;
401
- };
402
- declare const useFocusTrap: (active?: boolean, options?: UseFocusTrapOptions) => (node: HTMLElement | null | undefined) => void;
403
-
404
406
  type ActionButtonProps = {
405
407
  /**
406
408
  * @override
@@ -2839,10 +2841,10 @@ type TableCellProps = CellAttrs & {
2839
2841
  };
2840
2842
  declare const TableCell: ({ children, ...props }: TableCellProps) => JSX.Element;
2841
2843
 
2842
- type TableFooterProps = react__default.HTMLAttributes<HTMLTableSectionElement> & {
2844
+ type TableFootProps = react__default.HTMLAttributes<HTMLTableSectionElement> & {
2843
2845
  children?: ReactNode;
2844
2846
  };
2845
- declare const TableFooter: ({ children, ...props }: TableFooterProps) => JSX.Element;
2847
+ declare const TableFoot: ({ children, ...props }: TableFootProps) => JSX.Element;
2846
2848
 
2847
2849
  type TableHeadProps = react__default.HTMLAttributes<HTMLTableSectionElement> & {
2848
2850
  children?: ReactNode;
@@ -2851,22 +2853,28 @@ declare const TableHead: ({ children, ...props }: TableHeadProps) => JSX.Element
2851
2853
 
2852
2854
  type TableProps = ComponentPropsWithoutRef<'table'> & {
2853
2855
  /**
2854
- * Should be some combination of `TableHead` and/or `TableBody` and/or `TableFooter`
2856
+ * Should be some combination of `TableHead` and/or `TableBody` and/or `TableFoot`
2855
2857
  */
2856
2858
  children: ReactNode;
2859
+ /**
2860
+ * If true, will add dividing lines between rows
2861
+ */
2862
+ divided?: boolean;
2857
2863
  /**
2858
2864
  * If true, will stripe every other row
2859
2865
  */
2860
2866
  striped?: boolean;
2861
2867
  /**
2862
- * If true, will add dividing lines between rows
2868
+ * If true, will visually hide the table header while keeping it accessible to screen readers
2869
+ *
2870
+ * @see https://www.accessibility-developer-guide.com/examples/tables/hidden-headers/
2863
2871
  */
2864
- divided?: boolean;
2872
+ visuallyHiddenHeader?: boolean;
2865
2873
  };
2866
2874
  /**
2867
2875
  * Semantic table element for presenting data
2868
2876
  */
2869
- declare const Table: ({ children, striped, divided, ...props }: TableProps) => JSX.Element;
2877
+ declare const Table: ({ children, divided, striped, visuallyHiddenHeader, ...props }: TableProps) => JSX.Element;
2870
2878
 
2871
2879
  type TableRowProps = HTMLAttributes<HTMLTableRowElement> & {
2872
2880
  children?: ReactNode;
@@ -3195,4 +3203,4 @@ declare const WistiaLogo: {
3195
3203
  displayName: string;
3196
3204
  };
3197
3205
 
3198
- 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, type EllipsisProps, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, InputClickToCopy, type InputClickToCopyProps, 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, Thumbnail, ThumbnailBadge, type ThumbnailBadgeProps, ThumbnailCollage, type ThumbnailCollageProps, type ThumbnailProps, Tooltip, type TooltipProps, UIProvider, type UseToastProps, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, iconSizeMap, mergeRefs, mq, useActiveMq, useAriaLive, useBoolean, useFocusTrap, useFormState, useKey, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, useToast, useWindowSize };
3206
+ 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, type EllipsisProps, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, InputClickToCopy, type InputClickToCopyProps, 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, TableFoot, type TableFootProps, TableHead, type TableHeadProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextProps, Thumbnail, ThumbnailBadge, type ThumbnailBadgeProps, ThumbnailCollage, type ThumbnailCollageProps, type ThumbnailProps, Tooltip, type TooltipProps, UIProvider, type UseToastProps, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, iconSizeMap, mergeRefs, mq, useActiveMq, useAriaLive, useBoolean, useClipboard, useFocusTrap, useFormState, useKey, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, useToast, useWindowSize };