@wistia/ui 0.20.22 → 0.21.0-beta.301c9582.86213f8

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 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 { ReactNode, LegacyRef, MutableRefObject, RefCallback, Dispatch, SetStateAction, RefObject, ComponentPropsWithoutRef, JSX, ComponentPropsWithRef, AnchorHTMLAttributes, MouseEvent, ReactElement, ElementType, ChangeEvent, PropsWithChildren, InputHTMLAttributes, Ref, SyntheticEvent, ComponentProps, HTMLAttributes, ForwardRefExoticComponent, RefAttributes, TdHTMLAttributes, ThHTMLAttributes } from 'react';
3
+ import { ComponentType, AnchorHTMLAttributes, ReactNode, LegacyRef, MutableRefObject, RefCallback, Dispatch, SetStateAction, RefObject, ComponentPropsWithoutRef, JSX, ComponentPropsWithRef, MouseEvent, ReactElement, ElementType, ChangeEvent, PropsWithChildren, InputHTMLAttributes, Ref, SyntheticEvent, ComponentProps, HTMLAttributes, ForwardRefExoticComponent, RefAttributes, TdHTMLAttributes, ThHTMLAttributes } from 'react';
4
4
  import { UseFilePickerConfig, FilePickerReturnTypes, ExtractContentTypeFromConfig, useImperativeFilePickerConfig, ImperativeFilePickerReturnTypes } from 'use-file-picker/types';
5
5
  export * from 'use-file-picker/types';
6
6
  import { CollapsibleContentProps as CollapsibleContentProps$1 } from '@radix-ui/react-collapsible';
@@ -15,10 +15,24 @@ import { ToggleGroupSingleProps } from '@radix-ui/react-toggle-group';
15
15
  import { TabsProps as TabsProps$1, TabsContentProps as TabsContentProps$1, TabsListProps as TabsListProps$1, TabsTriggerProps as TabsTriggerProps$1 } from '@radix-ui/react-tabs';
16
16
  export { FileAmountLimitValidator, FileSizeValidator, FileTypeValidator, ImageDimensionsValidator, PersistentFileAmountLimitValidator } from 'use-file-picker/validators';
17
17
 
18
+ type RouterLinkProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> & {
19
+ reloadDocument?: boolean;
20
+ replace?: boolean;
21
+ state?: unknown;
22
+ preventScrollReset?: boolean;
23
+ viewTransition?: boolean;
24
+ to: string;
25
+ };
26
+ type RouterAdapter = {
27
+ Link: ComponentType<RouterLinkProps>;
28
+ useInRouterContext: () => boolean;
29
+ };
30
+
18
31
  type UIProviderProps = {
19
32
  children: ReactNode;
33
+ router?: RouterAdapter;
20
34
  };
21
- declare const UIProvider: ({ children }: UIProviderProps) => react_jsx_runtime.JSX.Element;
35
+ declare const UIProvider: ({ children, router }: UIProviderProps) => react_jsx_runtime.JSX.Element;
22
36
 
23
37
  /**
24
38
  * Converts a boolean string value `value` into a boolean. If passed
@@ -216,10 +230,10 @@ declare const ColorSchemeWrapper: {
216
230
  type ButtonVariants = 'ghost' | 'outline' | 'soft' | 'solid';
217
231
 
218
232
  type LinkTypes = 'default' | 'email' | 'external' | 'phone';
219
- type ReactRouterLinkProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> & {
233
+ type RouterSpecificProps = {
220
234
  reloadDocument?: boolean;
221
235
  replace?: boolean;
222
- state?: any;
236
+ state?: unknown;
223
237
  preventScrollReset?: boolean;
224
238
  viewTransition?: boolean;
225
239
  };
@@ -272,7 +286,7 @@ type BaseProps$2 = {
272
286
  */
273
287
  underline?: 'always' | 'hover' | 'none';
274
288
  };
275
- type LinkAsLinkProps = BaseProps$2 & ComponentPropsWithRef<'a'> & ReactRouterLinkProps & {
289
+ type LinkAsLinkProps = BaseProps$2 & ComponentPropsWithRef<'a'> & RouterSpecificProps & {
276
290
  href: string | undefined;
277
291
  type?: LinkTypes;
278
292
  };
@@ -283,11 +297,12 @@ type LinkAsButtonProps = BaseProps$2 & ComponentPropsWithRef<'button'> & {
283
297
  type LinkProps = LinkAsButtonProps | LinkAsLinkProps;
284
298
  /**
285
299
  * Links are used for navigation. If no `href` is supplied, a button that is visually styled to appear as a link
286
- * is rendered. If used in a `react-router` context, their [Link](https://reactrouter.com/en/main/components/link).
287
- * component is used, otherwise a native `a` element.
300
+ * is rendered. If a router adapter is provided via `UIProvider`, the adapter's `Link` component is used for
301
+ * client-side navigation, otherwise a native `a` element is rendered.
288
302
  *
289
- * This means in addition to its own props, `Link` can use props from `react-router`'s `Link` component. View their documentation [here](https://reactrouter.com/en/main/components/link).
290
- * The one prop we ignore from react-router is `to`. We use `href` instead and map it under the hood.
303
+ * To enable client-side routing, pass a `router` prop to `UIProvider` with a `Link` component and
304
+ * `useInRouterContext` hook from your router library. The `href` prop is mapped to the router's `to` prop
305
+ * under the hood.
291
306
  */
292
307
  declare const Link: react.ForwardRefExoticComponent<(Omit<LinkAsLinkProps, "ref"> | Omit<LinkAsButtonProps, "ref">) & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
293
308
 
@@ -396,10 +411,10 @@ declare const Button: react.ForwardRefExoticComponent<(Omit<BaseButtonProps & re
396
411
  rightIcon?: ReactNode | undefined;
397
412
  type?: LinkTypes | undefined;
398
413
  underline?: "always" | "hover" | "none";
399
- } & Omit<react.AnchorHTMLAttributes<HTMLAnchorElement>, "href"> & {
414
+ } & {
400
415
  reloadDocument?: boolean;
401
416
  replace?: boolean;
402
- state?: any;
417
+ state?: unknown;
403
418
  preventScrollReset?: boolean;
404
419
  viewTransition?: boolean;
405
420
  } & {
@@ -664,19 +679,7 @@ type BannerProps = ComponentPropsWithoutRef<'div'> & {
664
679
  * Optional `Icon` component to use. Must be an instance of [Icon](../?path=/docs/components-icon--docs)
665
680
  */
666
681
  icon?: JSX.Element;
667
- /**
668
- * Controls the visual prominence of the banner
669
- */
670
- prominence?: 'primary' | 'secondary';
671
682
  colorScheme?: ColorSchemeTypes;
672
- /**
673
- * Optional image element to display in the banner
674
- */
675
- image?: JSX.Element | undefined;
676
- /**
677
- * Controls the layout direction. If set to 'auto', the banner will switch between horizontal and vertical based on the container width.
678
- */
679
- orientation?: 'auto' | 'horizontal' | 'vertical';
680
683
  /**
681
684
  * Primary call-to-action element (typically a [Button]() of the `solid` variant)
682
685
  */
@@ -694,26 +697,10 @@ type BannerProps = ComponentPropsWithoutRef<'div'> & {
694
697
  * The `Banner` component is for displaying contextual information to the user such as alerts or feature announcements.
695
698
  */
696
699
  declare const Banner: {
697
- ({ bodyText, colorScheme, headingText, icon, image, onClose, orientation, primaryAction, prominence, secondaryAction, ...props }: BannerProps): JSX.Element;
700
+ ({ bodyText, colorScheme, headingText, icon, onClose, primaryAction, secondaryAction, ...props }: BannerProps): JSX.Element;
698
701
  displayName: string;
699
702
  };
700
703
 
701
- type BannerImageProps = ComponentPropsWithoutRef<'div'> & {
702
- /**
703
- * The URL of the image to display in the banner
704
- */
705
- src: string;
706
- /**
707
- * Alternative text description of the image for accessibility
708
- */
709
- alt?: string;
710
- /**
711
- * Position of the image within the banner layout. Only applies in horizontal orientation.
712
- */
713
- alignment?: 'left' | 'right';
714
- };
715
- declare const BannerImage: ({ alignment, alt, src, ...props }: BannerImageProps) => react_jsx_runtime.JSX.Element;
716
-
717
704
  type UnknownRecord = Record<string, unknown>;
718
705
  type PropsOf<Component extends ElementType> = ComponentPropsWithoutRef<Component>;
719
706
  type ExtendedProps<Props = UnknownRecord, OverrideProps = UnknownRecord> = Omit<Props, keyof OverrideProps> & OverrideProps;
@@ -3038,10 +3025,10 @@ declare const MenuItem: react.ForwardRefExoticComponent<(Omit<DropdownMenuItemPr
3038
3025
  rightIcon?: react.ReactNode | undefined;
3039
3026
  type?: LinkTypes | undefined;
3040
3027
  underline?: "always" | "hover" | "none";
3041
- } & Omit<react.AnchorHTMLAttributes<HTMLAnchorElement>, "href"> & {
3028
+ } & {
3042
3029
  reloadDocument?: boolean;
3043
3030
  replace?: boolean;
3044
- state?: any;
3031
+ state?: unknown;
3045
3032
  preventScrollReset?: boolean;
3046
3033
  viewTransition?: boolean;
3047
3034
  } & {
@@ -4595,4 +4582,4 @@ declare const WistiaLogo: {
4595
4582
  displayName: string;
4596
4583
  };
4597
4584
 
4598
- 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, FeatureCard, FeatureCardImage, type FeatureCardProps, 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, Meter, type MeterProps, type MeterSegment, 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, type ScrollAreaProps, 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 };
4585
+ export { ActionButton, type ActionButtonProps, Avatar, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, Banner, 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, FeatureCard, FeatureCardImage, type FeatureCardProps, 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, Meter, type MeterProps, type MeterSegment, Modal, ModalCallout, ModalCallouts, type ModalProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, Radio, RadioCard, RadioCardImage, type RadioCardImageProps, type RadioCardProps, RadioGroup, RadioMenuItem, type RadioProps, type RouterAdapter, type RouterLinkProps, SaturationAndValuePicker, ScreenReaderOnly, ScrollArea, type ScrollAreaProps, 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 UIProviderProps, 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 };