@wistia/ui 0.5.7 → 0.6.0

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
@@ -5,6 +5,7 @@ import { LinkProps as LinkProps$1 } from 'react-router-dom';
5
5
  import { CollapsibleContentProps as CollapsibleContentProps$1 } from '@radix-ui/react-collapsible';
6
6
  import * as styled_components from 'styled-components';
7
7
  import { DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuRadioGroupProps, DropdownMenuRadioItemProps, DropdownMenuCheckboxItemProps } from '@radix-ui/react-dropdown-menu';
8
+ import { PopoverContentProps } from '@radix-ui/react-popover';
8
9
  import { ToggleGroupSingleProps } from '@radix-ui/react-toggle-group';
9
10
 
10
11
  type UIProviderProps = {
@@ -622,13 +623,18 @@ type ButtonGroupProps = ComponentPropsWithoutRef<'div'> & {
622
623
  * Force ButtonGroup to fill the width of it's container
623
624
  */
624
625
  fullWidth?: boolean;
626
+ /**
627
+ * If true, the button group will collapse to a single column on small screens
628
+ * and the buttons will be stacked on top of each other.
629
+ */
630
+ collapseOnSmallScreens?: boolean;
625
631
  };
626
632
  /**
627
633
  * ButtonGroup is a layout component that groups buttons together,
628
634
  * with a standardized gap between them.
629
635
  */
630
636
  declare const ButtonGroup: {
631
- ({ children, align, fullWidth, ...otherProps }: ButtonGroupProps): JSX.Element | null;
637
+ ({ children, align, fullWidth, collapseOnSmallScreens, ...otherProps }: ButtonGroupProps): JSX.Element | null;
632
638
  displayName: string;
633
639
  };
634
640
 
@@ -1913,6 +1919,45 @@ declare const Modal: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProp
1913
1919
  width?: string;
1914
1920
  } & react.RefAttributes<HTMLDivElement>>;
1915
1921
 
1922
+ type ControlledPopoverProps = {
1923
+ /**
1924
+ * Is the popover open.
1925
+ * Must be used with `onOpenChange`.
1926
+ * */
1927
+ isOpen: boolean;
1928
+ /** When an attempt to toggle the popover is triggered.
1929
+ * Must be used with `isOpen`.
1930
+ */
1931
+ onOpenChange: (isOpen: boolean) => void;
1932
+ };
1933
+ type UncontrolledPopoverProps = {
1934
+ isOpen?: never;
1935
+ onOpenChange?: never;
1936
+ };
1937
+ type PopoverControlProps = ControlledPopoverProps | UncontrolledPopoverProps;
1938
+ type ContentProps = Omit<PopoverContentProps, 'alignOffset' | 'arrowPadding' | 'asChild' | 'collisionPadding' | 'hideWhenDetached' | 'sideOffset' | 'updatePositionStrategy'>;
1939
+ type PopoverProps = ContentProps & PopoverControlProps & {
1940
+ /**
1941
+ * The content of the popover
1942
+ */
1943
+ children: ReactNode;
1944
+ /**
1945
+ * Determines if the close button is visible (if false, `esc` will still close the Modal)
1946
+ */
1947
+ hideCloseButton?: boolean;
1948
+ /**
1949
+ * An interactive element. Most commonly a [Button](?path=/docs/components-button--docs) or [IconButton]([Button](?path=/docs/components-iconbutton--docs)).
1950
+ * */
1951
+ trigger: JSX.Element;
1952
+ };
1953
+ /**
1954
+ * Displays rich content in a portal, triggered by a button.
1955
+ */
1956
+ declare const Popover: {
1957
+ ({ children, trigger, isOpen, hideCloseButton, onOpenChange, ...props }: PopoverProps): JSX.Element;
1958
+ displayName: string;
1959
+ };
1960
+
1916
1961
  type RadioProps = ComponentPropsWithoutRef<'input'> & {
1917
1962
  /**
1918
1963
  * Indicates the state of the radio
@@ -2405,4 +2450,4 @@ type SelectOptionGroupProps = {
2405
2450
  };
2406
2451
  declare const SelectOptionGroup: ({ children, label, ...props }: SelectOptionGroupProps) => react_jsx_runtime.JSX.Element;
2407
2452
 
2408
- 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, Checkbox, CheckboxGroup, CheckboxMenuItem, 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, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Stack, SubMenu, Tab, type TabProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useBoolean, useFormState, useKey, useMq, useToast, useWindowSize };
2453
+ 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, Checkbox, CheckboxGroup, CheckboxMenuItem, 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, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Popover, type PopoverProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Stack, SubMenu, Tab, type TabProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useBoolean, useFormState, useKey, useMq, useToast, useWindowSize };
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ import { LinkProps as LinkProps$1 } from 'react-router-dom';
5
5
  import { CollapsibleContentProps as CollapsibleContentProps$1 } from '@radix-ui/react-collapsible';
6
6
  import * as styled_components from 'styled-components';
7
7
  import { DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuRadioGroupProps, DropdownMenuRadioItemProps, DropdownMenuCheckboxItemProps } from '@radix-ui/react-dropdown-menu';
8
+ import { PopoverContentProps } from '@radix-ui/react-popover';
8
9
  import { ToggleGroupSingleProps } from '@radix-ui/react-toggle-group';
9
10
 
10
11
  type UIProviderProps = {
@@ -622,13 +623,18 @@ type ButtonGroupProps = ComponentPropsWithoutRef<'div'> & {
622
623
  * Force ButtonGroup to fill the width of it's container
623
624
  */
624
625
  fullWidth?: boolean;
626
+ /**
627
+ * If true, the button group will collapse to a single column on small screens
628
+ * and the buttons will be stacked on top of each other.
629
+ */
630
+ collapseOnSmallScreens?: boolean;
625
631
  };
626
632
  /**
627
633
  * ButtonGroup is a layout component that groups buttons together,
628
634
  * with a standardized gap between them.
629
635
  */
630
636
  declare const ButtonGroup: {
631
- ({ children, align, fullWidth, ...otherProps }: ButtonGroupProps): JSX.Element | null;
637
+ ({ children, align, fullWidth, collapseOnSmallScreens, ...otherProps }: ButtonGroupProps): JSX.Element | null;
632
638
  displayName: string;
633
639
  };
634
640
 
@@ -1913,6 +1919,45 @@ declare const Modal: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProp
1913
1919
  width?: string;
1914
1920
  } & react.RefAttributes<HTMLDivElement>>;
1915
1921
 
1922
+ type ControlledPopoverProps = {
1923
+ /**
1924
+ * Is the popover open.
1925
+ * Must be used with `onOpenChange`.
1926
+ * */
1927
+ isOpen: boolean;
1928
+ /** When an attempt to toggle the popover is triggered.
1929
+ * Must be used with `isOpen`.
1930
+ */
1931
+ onOpenChange: (isOpen: boolean) => void;
1932
+ };
1933
+ type UncontrolledPopoverProps = {
1934
+ isOpen?: never;
1935
+ onOpenChange?: never;
1936
+ };
1937
+ type PopoverControlProps = ControlledPopoverProps | UncontrolledPopoverProps;
1938
+ type ContentProps = Omit<PopoverContentProps, 'alignOffset' | 'arrowPadding' | 'asChild' | 'collisionPadding' | 'hideWhenDetached' | 'sideOffset' | 'updatePositionStrategy'>;
1939
+ type PopoverProps = ContentProps & PopoverControlProps & {
1940
+ /**
1941
+ * The content of the popover
1942
+ */
1943
+ children: ReactNode;
1944
+ /**
1945
+ * Determines if the close button is visible (if false, `esc` will still close the Modal)
1946
+ */
1947
+ hideCloseButton?: boolean;
1948
+ /**
1949
+ * An interactive element. Most commonly a [Button](?path=/docs/components-button--docs) or [IconButton]([Button](?path=/docs/components-iconbutton--docs)).
1950
+ * */
1951
+ trigger: JSX.Element;
1952
+ };
1953
+ /**
1954
+ * Displays rich content in a portal, triggered by a button.
1955
+ */
1956
+ declare const Popover: {
1957
+ ({ children, trigger, isOpen, hideCloseButton, onOpenChange, ...props }: PopoverProps): JSX.Element;
1958
+ displayName: string;
1959
+ };
1960
+
1916
1961
  type RadioProps = ComponentPropsWithoutRef<'input'> & {
1917
1962
  /**
1918
1963
  * Indicates the state of the radio
@@ -2405,4 +2450,4 @@ type SelectOptionGroupProps = {
2405
2450
  };
2406
2451
  declare const SelectOptionGroup: ({ children, label, ...props }: SelectOptionGroupProps) => react_jsx_runtime.JSX.Element;
2407
2452
 
2408
- 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, Checkbox, CheckboxGroup, CheckboxMenuItem, 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, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Stack, SubMenu, Tab, type TabProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useBoolean, useFormState, useKey, useMq, useToast, useWindowSize };
2453
+ 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, Checkbox, CheckboxGroup, CheckboxMenuItem, 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, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Popover, type PopoverProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Stack, SubMenu, Tab, type TabProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useBoolean, useFormState, useKey, useMq, useToast, useWindowSize };