@wistia/ui 0.4.2 → 0.4.3-beta.a3a51555.977dc5c

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
@@ -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, ComponentPropsWithoutRef, JSX, ComponentPropsWithRef, MouseEvent, ChangeEvent, ForwardedRef, Ref, JSXElementConstructor, ElementType as ElementType$1, InputHTMLAttributes, RefObject } from 'react';
3
+ import { ReactNode, Dispatch, SetStateAction, ComponentPropsWithoutRef, JSX, ComponentPropsWithRef, MouseEvent, ChangeEvent, ForwardedRef, Ref, JSXElementConstructor, ElementType as ElementType$1, InputHTMLAttributes, RefObject } from 'react';
4
4
  import { LinkProps as LinkProps$1 } from 'react-router-dom';
5
5
  import * as styled_components from 'styled-components';
6
6
  import { DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuRadioGroupProps, DropdownMenuRadioItemProps, DropdownMenuCheckboxItemProps } from '@radix-ui/react-dropdown-menu';
@@ -31,6 +31,15 @@ declare const mq: {
31
31
  xlAndDown: () => string;
32
32
  };
33
33
 
34
+ type UseBooleanReturn = [
35
+ boolean,
36
+ () => void,
37
+ () => void,
38
+ () => void,
39
+ Dispatch<SetStateAction<boolean>>
40
+ ];
41
+ declare const useBoolean: (initialValue?: boolean) => UseBooleanReturn;
42
+
34
43
  type MediaQueryBooleans = {
35
44
  isXlAndUp: boolean;
36
45
  isLgAndUp: boolean;
@@ -47,6 +56,25 @@ declare const useMq: () => MediaQueryBooleans;
47
56
  type MediaQueryLabels = keyof MediaQueryBooleans;
48
57
  declare const useActiveMq: () => MediaQueryLabels[];
49
58
 
59
+ type AddEventListenerType = (type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions | boolean) => void;
60
+ type RemoveEventListenerType = (type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions | boolean) => void;
61
+ declare const useEvent: <T extends Event>(eventName: Parameters<AddEventListenerType>[0], eventHandler: (event: T) => unknown, eventTarget?: unknown, eventOptions?: Parameters<RemoveEventListenerType>[2]) => void;
62
+
63
+ type KeyFilterPredicate = (evt: KeyboardEvent) => boolean;
64
+ type KeyFilter = KeyFilterPredicate | boolean | string | null | undefined;
65
+ type EventHandler = (event: KeyboardEvent) => unknown;
66
+ type UseKeyOptions = {
67
+ eventName?: string;
68
+ eventTarget?: Parameters<typeof useEvent>[2];
69
+ eventOptions?: Parameters<typeof useEvent>[3];
70
+ };
71
+ declare const useKey: (key: KeyFilter, eventHandler: EventHandler, options?: UseKeyOptions, dependencies?: unknown[]) => void;
72
+
73
+ type AriaLiveContextType = {
74
+ announce: (message: string, politeness?: 'assertive' | 'polite') => void;
75
+ };
76
+ declare const useAriaLive: () => AriaLiveContextType;
77
+
50
78
  declare const colorSchemeOptions: readonly ["inherit", "default", "info", "success", "warning", "error", "blue", "green", "orange", "pink", "purple", "yellow", "vendor-hubspot", "vendor-marketo", "vendor-pardot"];
51
79
  type ColorSchemeTypes = (typeof colorSchemeOptions)[number];
52
80
  type ColorSchemeWrapperProps = ComponentPropsWithoutRef<'div'> & {
@@ -250,11 +278,6 @@ declare const useWindowSize: (interval?: number) => {
250
278
  height: number;
251
279
  };
252
280
 
253
- type AriaLiveContextType = {
254
- announce: (message: string, politeness?: 'assertive' | 'polite') => void;
255
- };
256
- declare const useAriaLive: () => AriaLiveContextType;
257
-
258
281
  type ActionButtonProps = {
259
282
  /**
260
283
  * The Icon component to use, e.g. `<Icon type="favorite" />`
@@ -496,6 +519,36 @@ declare const Box: {
496
519
  displayName: string;
497
520
  };
498
521
 
522
+ type BreadcrumbsProps = ComponentPropsWithoutRef<'div'> & {
523
+ /**
524
+ * Should be at least one `Breadcrumb` component
525
+ */
526
+ children: ReactNode;
527
+ };
528
+ /**
529
+ * Used to display a screens's location within a hierarchical structure
530
+ */
531
+ declare const Breadcrumbs: {
532
+ ({ children, ...props }: BreadcrumbsProps): JSX.Element;
533
+ displayName: string;
534
+ };
535
+
536
+ type BreadcrumbProps = {
537
+ /**
538
+ * An [Icon](../?path=/docs/components-icon--docs) to show at the beginning of the breadcrumb
539
+ * */
540
+ icon?: ButtonAsLinkProps['leftIcon'];
541
+ /**
542
+ * The text of the breadcrumb link
543
+ */
544
+ children: ReactNode;
545
+ /**
546
+ * The link to the page of the breadcrumb
547
+ */
548
+ href: string;
549
+ };
550
+ declare const Breadcrumb: ({ icon, href, children }: BreadcrumbProps) => react_jsx_runtime.JSX.Element;
551
+
499
552
  type ButtonGroupProps = ComponentPropsWithoutRef<'div'> & {
500
553
  /**
501
554
  * Align buttons to the left or right of their container
@@ -2109,34 +2162,4 @@ declare const WistiaLogo: {
2109
2162
  displayName: string;
2110
2163
  };
2111
2164
 
2112
- type BreadcrumbsProps = ComponentPropsWithoutRef<'div'> & {
2113
- /**
2114
- * Should be at least one `Breadcrumb` component
2115
- */
2116
- children: ReactNode;
2117
- };
2118
- /**
2119
- * Used to display a screens's location within a hierarchical structure
2120
- */
2121
- declare const Breadcrumbs: {
2122
- ({ children, ...props }: BreadcrumbsProps): JSX.Element;
2123
- displayName: string;
2124
- };
2125
-
2126
- type BreadcrumbProps = {
2127
- /**
2128
- * An [Icon](../?path=/docs/components-icon--docs) to show at the beginning of the breadcrumb
2129
- * */
2130
- icon?: ButtonAsLinkProps['leftIcon'];
2131
- /**
2132
- * The text of the breadcrumb link
2133
- */
2134
- children: ReactNode;
2135
- /**
2136
- * The link to the page of the breadcrumb
2137
- */
2138
- href: string;
2139
- };
2140
- declare const Breadcrumb: ({ icon, href, children }: BreadcrumbProps) => react_jsx_runtime.JSX.Element;
2141
-
2142
- export { ActionButton, type ActionButtonProps, Avatar, type AvatarInstanceType, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Breadcrumb, Breadcrumbs, type BreadcrumbsProps, Button, ButtonGroup, type ButtonProps, Card, type CardProps, Checkbox, CheckboxGroup, CheckboxMenuItem, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Divider, 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, Stack, SubMenu, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useFormState, useMq, useToast, useWindowSize };
2165
+ export { ActionButton, type ActionButtonProps, Avatar, type AvatarInstanceType, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Breadcrumb, Breadcrumbs, type BreadcrumbsProps, Button, ButtonGroup, type ButtonProps, Card, type CardProps, Checkbox, CheckboxGroup, CheckboxMenuItem, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Divider, 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, Stack, SubMenu, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useBoolean, useFormState, useKey, 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 { ReactNode, ComponentPropsWithoutRef, JSX, ComponentPropsWithRef, MouseEvent, ChangeEvent, ForwardedRef, Ref, JSXElementConstructor, ElementType as ElementType$1, InputHTMLAttributes, RefObject } from 'react';
3
+ import { ReactNode, Dispatch, SetStateAction, ComponentPropsWithoutRef, JSX, ComponentPropsWithRef, MouseEvent, ChangeEvent, ForwardedRef, Ref, JSXElementConstructor, ElementType as ElementType$1, InputHTMLAttributes, RefObject } from 'react';
4
4
  import { LinkProps as LinkProps$1 } from 'react-router-dom';
5
5
  import * as styled_components from 'styled-components';
6
6
  import { DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuRadioGroupProps, DropdownMenuRadioItemProps, DropdownMenuCheckboxItemProps } from '@radix-ui/react-dropdown-menu';
@@ -31,6 +31,15 @@ declare const mq: {
31
31
  xlAndDown: () => string;
32
32
  };
33
33
 
34
+ type UseBooleanReturn = [
35
+ boolean,
36
+ () => void,
37
+ () => void,
38
+ () => void,
39
+ Dispatch<SetStateAction<boolean>>
40
+ ];
41
+ declare const useBoolean: (initialValue?: boolean) => UseBooleanReturn;
42
+
34
43
  type MediaQueryBooleans = {
35
44
  isXlAndUp: boolean;
36
45
  isLgAndUp: boolean;
@@ -47,6 +56,25 @@ declare const useMq: () => MediaQueryBooleans;
47
56
  type MediaQueryLabels = keyof MediaQueryBooleans;
48
57
  declare const useActiveMq: () => MediaQueryLabels[];
49
58
 
59
+ type AddEventListenerType = (type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions | boolean) => void;
60
+ type RemoveEventListenerType = (type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions | boolean) => void;
61
+ declare const useEvent: <T extends Event>(eventName: Parameters<AddEventListenerType>[0], eventHandler: (event: T) => unknown, eventTarget?: unknown, eventOptions?: Parameters<RemoveEventListenerType>[2]) => void;
62
+
63
+ type KeyFilterPredicate = (evt: KeyboardEvent) => boolean;
64
+ type KeyFilter = KeyFilterPredicate | boolean | string | null | undefined;
65
+ type EventHandler = (event: KeyboardEvent) => unknown;
66
+ type UseKeyOptions = {
67
+ eventName?: string;
68
+ eventTarget?: Parameters<typeof useEvent>[2];
69
+ eventOptions?: Parameters<typeof useEvent>[3];
70
+ };
71
+ declare const useKey: (key: KeyFilter, eventHandler: EventHandler, options?: UseKeyOptions, dependencies?: unknown[]) => void;
72
+
73
+ type AriaLiveContextType = {
74
+ announce: (message: string, politeness?: 'assertive' | 'polite') => void;
75
+ };
76
+ declare const useAriaLive: () => AriaLiveContextType;
77
+
50
78
  declare const colorSchemeOptions: readonly ["inherit", "default", "info", "success", "warning", "error", "blue", "green", "orange", "pink", "purple", "yellow", "vendor-hubspot", "vendor-marketo", "vendor-pardot"];
51
79
  type ColorSchemeTypes = (typeof colorSchemeOptions)[number];
52
80
  type ColorSchemeWrapperProps = ComponentPropsWithoutRef<'div'> & {
@@ -250,11 +278,6 @@ declare const useWindowSize: (interval?: number) => {
250
278
  height: number;
251
279
  };
252
280
 
253
- type AriaLiveContextType = {
254
- announce: (message: string, politeness?: 'assertive' | 'polite') => void;
255
- };
256
- declare const useAriaLive: () => AriaLiveContextType;
257
-
258
281
  type ActionButtonProps = {
259
282
  /**
260
283
  * The Icon component to use, e.g. `<Icon type="favorite" />`
@@ -496,6 +519,36 @@ declare const Box: {
496
519
  displayName: string;
497
520
  };
498
521
 
522
+ type BreadcrumbsProps = ComponentPropsWithoutRef<'div'> & {
523
+ /**
524
+ * Should be at least one `Breadcrumb` component
525
+ */
526
+ children: ReactNode;
527
+ };
528
+ /**
529
+ * Used to display a screens's location within a hierarchical structure
530
+ */
531
+ declare const Breadcrumbs: {
532
+ ({ children, ...props }: BreadcrumbsProps): JSX.Element;
533
+ displayName: string;
534
+ };
535
+
536
+ type BreadcrumbProps = {
537
+ /**
538
+ * An [Icon](../?path=/docs/components-icon--docs) to show at the beginning of the breadcrumb
539
+ * */
540
+ icon?: ButtonAsLinkProps['leftIcon'];
541
+ /**
542
+ * The text of the breadcrumb link
543
+ */
544
+ children: ReactNode;
545
+ /**
546
+ * The link to the page of the breadcrumb
547
+ */
548
+ href: string;
549
+ };
550
+ declare const Breadcrumb: ({ icon, href, children }: BreadcrumbProps) => react_jsx_runtime.JSX.Element;
551
+
499
552
  type ButtonGroupProps = ComponentPropsWithoutRef<'div'> & {
500
553
  /**
501
554
  * Align buttons to the left or right of their container
@@ -2109,34 +2162,4 @@ declare const WistiaLogo: {
2109
2162
  displayName: string;
2110
2163
  };
2111
2164
 
2112
- type BreadcrumbsProps = ComponentPropsWithoutRef<'div'> & {
2113
- /**
2114
- * Should be at least one `Breadcrumb` component
2115
- */
2116
- children: ReactNode;
2117
- };
2118
- /**
2119
- * Used to display a screens's location within a hierarchical structure
2120
- */
2121
- declare const Breadcrumbs: {
2122
- ({ children, ...props }: BreadcrumbsProps): JSX.Element;
2123
- displayName: string;
2124
- };
2125
-
2126
- type BreadcrumbProps = {
2127
- /**
2128
- * An [Icon](../?path=/docs/components-icon--docs) to show at the beginning of the breadcrumb
2129
- * */
2130
- icon?: ButtonAsLinkProps['leftIcon'];
2131
- /**
2132
- * The text of the breadcrumb link
2133
- */
2134
- children: ReactNode;
2135
- /**
2136
- * The link to the page of the breadcrumb
2137
- */
2138
- href: string;
2139
- };
2140
- declare const Breadcrumb: ({ icon, href, children }: BreadcrumbProps) => react_jsx_runtime.JSX.Element;
2141
-
2142
- export { ActionButton, type ActionButtonProps, Avatar, type AvatarInstanceType, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Breadcrumb, Breadcrumbs, type BreadcrumbsProps, Button, ButtonGroup, type ButtonProps, Card, type CardProps, Checkbox, CheckboxGroup, CheckboxMenuItem, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Divider, 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, Stack, SubMenu, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useFormState, useMq, useToast, useWindowSize };
2165
+ export { ActionButton, type ActionButtonProps, Avatar, type AvatarInstanceType, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Breadcrumb, Breadcrumbs, type BreadcrumbsProps, Button, ButtonGroup, type ButtonProps, Card, type CardProps, Checkbox, CheckboxGroup, CheckboxMenuItem, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Divider, 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, Stack, SubMenu, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useBoolean, useFormState, useKey, useMq, useToast, useWindowSize };