@wistia/ui 0.0.9 → 0.0.11

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
@@ -56,8 +56,58 @@ type AriaLiveContextType = {
56
56
  };
57
57
  declare const useAriaLive: () => AriaLiveContextType;
58
58
 
59
- declare const colorSchemeValues: readonly ["inherit", "default", "info", "success", "warning", "error", "blue", "green", "orange", "pink", "purple", "yellow"];
60
- type ColorSchemeTypes = (typeof colorSchemeValues)[number];
59
+ type AvatarInstanceType = 'image' | 'initials';
60
+ type AvatarProps = ComponentPropsWithoutRef<'div'> & {
61
+ /**
62
+ * The height and width of the avatar (overrides size prop)
63
+ */
64
+ heightAndWidth?: number;
65
+ /**
66
+ * The URL of the image to display
67
+ */
68
+ imageUrl?: string | null;
69
+ /**
70
+ * A string that will deterministically set the initials & background color of the avatar
71
+ *
72
+ * _note: only first initial shown regardless of characters provided_
73
+ */
74
+ name?: string | null;
75
+ /**
76
+ * A predefined size for the avatar
77
+ */
78
+ size?: 'lg' | 'md' | 'sm';
79
+ /**
80
+ * A callback that is invoked after the image has loaded or failed to load
81
+ */
82
+ onImageLoad?: (avatarType: AvatarInstanceType) => void;
83
+ };
84
+ /**
85
+ * An avatar uses a photo, initials or icon to represent an entity
86
+ */
87
+ declare const Avatar: {
88
+ ({ imageUrl, heightAndWidth, name, size, onImageLoad, ...otherProps }: AvatarProps): JSX.Element;
89
+ displayName: string;
90
+ };
91
+
92
+ declare const colorSchemeOptions: readonly ["inherit", "default", "info", "success", "warning", "error", "blue", "green", "orange", "pink", "purple", "yellow"];
93
+ type ColorSchemeTypes = (typeof colorSchemeOptions)[number];
94
+ type ColorSchemeWrapperProps = ComponentPropsWithoutRef<'div'> & {
95
+ /**
96
+ * The color scheme to apply
97
+ */
98
+ colorScheme: ColorSchemeTypes;
99
+ /**
100
+ * Children
101
+ */
102
+ children: ReactNode;
103
+ };
104
+ /**
105
+ * A wrapper to apply a color scheme to its children.
106
+ */
107
+ declare const ColorSchemeWrapper: {
108
+ ({ colorScheme, children, ...otherProps }: ColorSchemeWrapperProps): JSX.Element;
109
+ displayName: string;
110
+ };
61
111
 
62
112
  type BadgeProps = ComponentPropsWithoutRef<'div'> & {
63
113
  /**
@@ -103,6 +153,16 @@ type Gap = {
103
153
  column: number | string;
104
154
  row: number | string;
105
155
  };
156
+ /**
157
+ * CSS property => Box prop:
158
+ * flex-direction => direction
159
+ * justify-content => justifyContent
160
+ * align-items => alignItems
161
+ * align-content => alignContent
162
+ * flex-wrap => wrapItems
163
+ * gap => gap
164
+ * display: inline-flex => inline
165
+ */
106
166
  type BoxProps = ComponentPropsWithoutRef<'div'> & {
107
167
  /**
108
168
  * Specifies how the browser distributes space between and around
@@ -196,11 +256,10 @@ type BoxProps = ComponentPropsWithoutRef<'div'> & {
196
256
  * Box is a layout container using [CSS Flexbox](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox).
197
257
  */
198
258
  declare const Box: {
199
- ({ alignContent, alignItems, children, direction, hasBoxParent, fill, fillViewport, inline, justifyContent, wrapItems, ...otherProps }: BoxProps): JSX.Element;
259
+ ({ alignContent, alignItems, children, direction, hasBoxParent, fill, fillViewport, gap, inline, justifyContent, wrapItems, ...otherProps }: BoxProps): JSX.Element;
200
260
  displayName: string;
201
261
  };
202
262
 
203
- type ButtonSizes = 'hero' | 'large' | 'medium' | 'small';
204
263
  type ButtonVariants = 'ghost' | 'outline' | 'soft' | 'solid';
205
264
 
206
265
  type LinkTypes = 'default' | 'email' | 'external' | 'phone';
@@ -264,6 +323,7 @@ type ResponsiveObject<T> = AtLeastOneBreakpoint<Record<Breakpoints, T>> & {
264
323
  base: T;
265
324
  };
266
325
 
326
+ type ButtonSizes = 'lg' | 'md' | 'sm' | 'xl';
267
327
  type BaseButtonProps = {
268
328
  /**
269
329
  * Text that appears inside of the button
@@ -303,7 +363,7 @@ type BaseButtonProps = {
303
363
  * If true, the button will fill its container
304
364
  *
305
365
  * @type boolean | ResponsiveObject<boolean>
306
- * */
366
+ */
307
367
  fullWidth?: ResponsiveObject<boolean> | boolean;
308
368
  /**
309
369
  * Provides a button without any styling (useful for wrapping another element)
@@ -315,8 +375,6 @@ type BaseButtonProps = {
315
375
  rightIcon?: JSX.Element | undefined;
316
376
  /**
317
377
  * The size of button to display. Can be used as a [responsive prop](/docs/ui-docs-responsive-props--docs)
318
- *
319
- * @type 'small' | 'medium' | 'large' | 'hero'
320
378
  */
321
379
  size?: ButtonSizes | ResponsiveObject<ButtonSizes>;
322
380
  /**
@@ -808,6 +866,37 @@ declare const IconButton: react.ForwardRefExoticComponent<(Omit<{
808
866
  children: JSX.Element;
809
867
  } & Omit<ButtonAsLinkProps, "leftIcon" | "fullWidth" | "rightIcon">, "ref">) & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
810
868
 
869
+ type LabelProps = ComponentPropsWithoutRef<'label'> & {
870
+ /**
871
+ * Pass an arbitrary child node
872
+ */
873
+ children?: ReactNode;
874
+ /**
875
+ * To indicate that the label is for a disabled form component
876
+ */
877
+ disabled?: boolean;
878
+ /**
879
+ * ID of the form component that the label should be associated with
880
+ */
881
+ htmlFor?: string | undefined;
882
+ /**
883
+ * Use if label describes a required form component
884
+ */
885
+ required?: boolean;
886
+ /**
887
+ * For label text that needs to be available to assistive technology (e.g. screen readers)
888
+ * but otherwise hidden on screen.
889
+ */
890
+ screenReaderOnly?: boolean;
891
+ };
892
+ /**
893
+ * Labels are used to give a title to a form component (eg. Input, Select, etc.)
894
+ */
895
+ declare const Label: {
896
+ ({ children, disabled, htmlFor, required, screenReaderOnly, ...otherProps }: LabelProps): JSX.Element;
897
+ displayName: string;
898
+ };
899
+
811
900
  type ScreenReaderOnlyProps = ComponentPropsWithoutRef<'div'> & {
812
901
  /**
813
902
  * Pass an arbitrary child node
@@ -834,17 +923,18 @@ declare const ScreenReaderOnly: {
834
923
  type Spacings = 'space-01' | 'space-02' | 'space-03' | 'space-04' | 'space-05' | 'space-06' | 'space-07' | 'space-08' | 'space-09' | 'space-10' | 'space-11';
835
924
 
836
925
  type StackProps = {
926
+ /**
927
+ * Optional children
928
+ */
837
929
  children?: ReactNode | undefined;
838
930
  /**
839
931
  * The gap between each item in the stack. Can be a [responsive prop](/docs/ui-docs-responsive-props--docs).
840
932
  * TODO: add link to Spacing docs
841
- *
842
933
  */
843
934
  gap?: Spacings;
844
935
  /**
845
936
  * Vertical is equivalent to `flex-direction: column;`, horizontal is equivalent to `flex-direction: row;`.
846
937
  * The default behavior is `vertical`. Can be a [responsive prop](/docs/ui-docs-responsive-props--docs).
847
- *
848
938
  */
849
939
  direction?: 'horizontal' | 'vertical';
850
940
  renderAs?: ElementType$1;
@@ -918,6 +1008,9 @@ type TextProps = ComponentPropsWithoutRef<'div'> & {
918
1008
  * Text prominence affects color. Use 'highContrast' for main non-interactive text, 'vibrant' for interactive elements, and 'secondary' for less important or supplementary content.
919
1009
  */
920
1010
  prominence?: keyof typeof prominenceMap;
1011
+ /**
1012
+ * This will inherit the jsdoc block from PolymorphicComponent
1013
+ */
921
1014
  renderAs?: ElementType$1;
922
1015
  /**
923
1016
  * The text style to display
@@ -966,6 +1059,9 @@ declare const Text: (<C = "div">(props: PolymorphicComponentProps<C, TextProps>)
966
1059
  * Text prominence affects color. Use 'highContrast' for main non-interactive text, 'vibrant' for interactive elements, and 'secondary' for less important or supplementary content.
967
1060
  */
968
1061
  prominence?: keyof typeof prominenceMap;
1062
+ /**
1063
+ * This will inherit the jsdoc block from PolymorphicComponent
1064
+ */
969
1065
  renderAs?: ElementType$1;
970
1066
  /**
971
1067
  * The text style to display
@@ -1010,6 +1106,9 @@ declare const Text: (<C = "div">(props: PolymorphicComponentProps<C, TextProps>)
1010
1106
  * Text prominence affects color. Use 'highContrast' for main non-interactive text, 'vibrant' for interactive elements, and 'secondary' for less important or supplementary content.
1011
1107
  */
1012
1108
  prominence?: keyof typeof prominenceMap;
1109
+ /**
1110
+ * This will inherit the jsdoc block from PolymorphicComponent
1111
+ */
1013
1112
  renderAs?: ElementType$1;
1014
1113
  /**
1015
1114
  * The text style to display
@@ -1098,22 +1197,4 @@ declare const WistiaLogo: {
1098
1197
  displayName: string;
1099
1198
  };
1100
1199
 
1101
- type ColorSchemeWrapperProps = ComponentPropsWithoutRef<'div'> & {
1102
- /**
1103
- * The color scheme to apply
1104
- */
1105
- colorScheme: ColorSchemeTypes;
1106
- /**
1107
- * Children
1108
- */
1109
- children: ReactNode;
1110
- };
1111
- /**
1112
- * A wrapper to apply a color scheme to its children.
1113
- */
1114
- declare const ColorSchemeWrapper: {
1115
- ({ colorScheme, children, ...otherProps }: ColorSchemeWrapperProps): JSX.Element;
1116
- displayName: string;
1117
- };
1118
-
1119
- export { Badge, type BadgeProps, Box, Button, ButtonGroup, type ButtonProps, ColorSchemeWrapper, type ColorSchemeWrapperProps, Divider, Ellipsis, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Link, type LinkProps, ScreenReaderOnly, Stack, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useMq, useWindowSize };
1200
+ export { Avatar, type AvatarInstanceType, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Button, ButtonGroup, type ButtonProps, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Divider, Ellipsis, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Label, type LabelProps, Link, type LinkProps, ScreenReaderOnly, Stack, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useMq, useWindowSize };
package/dist/index.d.ts CHANGED
@@ -56,8 +56,58 @@ type AriaLiveContextType = {
56
56
  };
57
57
  declare const useAriaLive: () => AriaLiveContextType;
58
58
 
59
- declare const colorSchemeValues: readonly ["inherit", "default", "info", "success", "warning", "error", "blue", "green", "orange", "pink", "purple", "yellow"];
60
- type ColorSchemeTypes = (typeof colorSchemeValues)[number];
59
+ type AvatarInstanceType = 'image' | 'initials';
60
+ type AvatarProps = ComponentPropsWithoutRef<'div'> & {
61
+ /**
62
+ * The height and width of the avatar (overrides size prop)
63
+ */
64
+ heightAndWidth?: number;
65
+ /**
66
+ * The URL of the image to display
67
+ */
68
+ imageUrl?: string | null;
69
+ /**
70
+ * A string that will deterministically set the initials & background color of the avatar
71
+ *
72
+ * _note: only first initial shown regardless of characters provided_
73
+ */
74
+ name?: string | null;
75
+ /**
76
+ * A predefined size for the avatar
77
+ */
78
+ size?: 'lg' | 'md' | 'sm';
79
+ /**
80
+ * A callback that is invoked after the image has loaded or failed to load
81
+ */
82
+ onImageLoad?: (avatarType: AvatarInstanceType) => void;
83
+ };
84
+ /**
85
+ * An avatar uses a photo, initials or icon to represent an entity
86
+ */
87
+ declare const Avatar: {
88
+ ({ imageUrl, heightAndWidth, name, size, onImageLoad, ...otherProps }: AvatarProps): JSX.Element;
89
+ displayName: string;
90
+ };
91
+
92
+ declare const colorSchemeOptions: readonly ["inherit", "default", "info", "success", "warning", "error", "blue", "green", "orange", "pink", "purple", "yellow"];
93
+ type ColorSchemeTypes = (typeof colorSchemeOptions)[number];
94
+ type ColorSchemeWrapperProps = ComponentPropsWithoutRef<'div'> & {
95
+ /**
96
+ * The color scheme to apply
97
+ */
98
+ colorScheme: ColorSchemeTypes;
99
+ /**
100
+ * Children
101
+ */
102
+ children: ReactNode;
103
+ };
104
+ /**
105
+ * A wrapper to apply a color scheme to its children.
106
+ */
107
+ declare const ColorSchemeWrapper: {
108
+ ({ colorScheme, children, ...otherProps }: ColorSchemeWrapperProps): JSX.Element;
109
+ displayName: string;
110
+ };
61
111
 
62
112
  type BadgeProps = ComponentPropsWithoutRef<'div'> & {
63
113
  /**
@@ -103,6 +153,16 @@ type Gap = {
103
153
  column: number | string;
104
154
  row: number | string;
105
155
  };
156
+ /**
157
+ * CSS property => Box prop:
158
+ * flex-direction => direction
159
+ * justify-content => justifyContent
160
+ * align-items => alignItems
161
+ * align-content => alignContent
162
+ * flex-wrap => wrapItems
163
+ * gap => gap
164
+ * display: inline-flex => inline
165
+ */
106
166
  type BoxProps = ComponentPropsWithoutRef<'div'> & {
107
167
  /**
108
168
  * Specifies how the browser distributes space between and around
@@ -196,11 +256,10 @@ type BoxProps = ComponentPropsWithoutRef<'div'> & {
196
256
  * Box is a layout container using [CSS Flexbox](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox).
197
257
  */
198
258
  declare const Box: {
199
- ({ alignContent, alignItems, children, direction, hasBoxParent, fill, fillViewport, inline, justifyContent, wrapItems, ...otherProps }: BoxProps): JSX.Element;
259
+ ({ alignContent, alignItems, children, direction, hasBoxParent, fill, fillViewport, gap, inline, justifyContent, wrapItems, ...otherProps }: BoxProps): JSX.Element;
200
260
  displayName: string;
201
261
  };
202
262
 
203
- type ButtonSizes = 'hero' | 'large' | 'medium' | 'small';
204
263
  type ButtonVariants = 'ghost' | 'outline' | 'soft' | 'solid';
205
264
 
206
265
  type LinkTypes = 'default' | 'email' | 'external' | 'phone';
@@ -264,6 +323,7 @@ type ResponsiveObject<T> = AtLeastOneBreakpoint<Record<Breakpoints, T>> & {
264
323
  base: T;
265
324
  };
266
325
 
326
+ type ButtonSizes = 'lg' | 'md' | 'sm' | 'xl';
267
327
  type BaseButtonProps = {
268
328
  /**
269
329
  * Text that appears inside of the button
@@ -303,7 +363,7 @@ type BaseButtonProps = {
303
363
  * If true, the button will fill its container
304
364
  *
305
365
  * @type boolean | ResponsiveObject<boolean>
306
- * */
366
+ */
307
367
  fullWidth?: ResponsiveObject<boolean> | boolean;
308
368
  /**
309
369
  * Provides a button without any styling (useful for wrapping another element)
@@ -315,8 +375,6 @@ type BaseButtonProps = {
315
375
  rightIcon?: JSX.Element | undefined;
316
376
  /**
317
377
  * The size of button to display. Can be used as a [responsive prop](/docs/ui-docs-responsive-props--docs)
318
- *
319
- * @type 'small' | 'medium' | 'large' | 'hero'
320
378
  */
321
379
  size?: ButtonSizes | ResponsiveObject<ButtonSizes>;
322
380
  /**
@@ -808,6 +866,37 @@ declare const IconButton: react.ForwardRefExoticComponent<(Omit<{
808
866
  children: JSX.Element;
809
867
  } & Omit<ButtonAsLinkProps, "leftIcon" | "fullWidth" | "rightIcon">, "ref">) & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
810
868
 
869
+ type LabelProps = ComponentPropsWithoutRef<'label'> & {
870
+ /**
871
+ * Pass an arbitrary child node
872
+ */
873
+ children?: ReactNode;
874
+ /**
875
+ * To indicate that the label is for a disabled form component
876
+ */
877
+ disabled?: boolean;
878
+ /**
879
+ * ID of the form component that the label should be associated with
880
+ */
881
+ htmlFor?: string | undefined;
882
+ /**
883
+ * Use if label describes a required form component
884
+ */
885
+ required?: boolean;
886
+ /**
887
+ * For label text that needs to be available to assistive technology (e.g. screen readers)
888
+ * but otherwise hidden on screen.
889
+ */
890
+ screenReaderOnly?: boolean;
891
+ };
892
+ /**
893
+ * Labels are used to give a title to a form component (eg. Input, Select, etc.)
894
+ */
895
+ declare const Label: {
896
+ ({ children, disabled, htmlFor, required, screenReaderOnly, ...otherProps }: LabelProps): JSX.Element;
897
+ displayName: string;
898
+ };
899
+
811
900
  type ScreenReaderOnlyProps = ComponentPropsWithoutRef<'div'> & {
812
901
  /**
813
902
  * Pass an arbitrary child node
@@ -834,17 +923,18 @@ declare const ScreenReaderOnly: {
834
923
  type Spacings = 'space-01' | 'space-02' | 'space-03' | 'space-04' | 'space-05' | 'space-06' | 'space-07' | 'space-08' | 'space-09' | 'space-10' | 'space-11';
835
924
 
836
925
  type StackProps = {
926
+ /**
927
+ * Optional children
928
+ */
837
929
  children?: ReactNode | undefined;
838
930
  /**
839
931
  * The gap between each item in the stack. Can be a [responsive prop](/docs/ui-docs-responsive-props--docs).
840
932
  * TODO: add link to Spacing docs
841
- *
842
933
  */
843
934
  gap?: Spacings;
844
935
  /**
845
936
  * Vertical is equivalent to `flex-direction: column;`, horizontal is equivalent to `flex-direction: row;`.
846
937
  * The default behavior is `vertical`. Can be a [responsive prop](/docs/ui-docs-responsive-props--docs).
847
- *
848
938
  */
849
939
  direction?: 'horizontal' | 'vertical';
850
940
  renderAs?: ElementType$1;
@@ -918,6 +1008,9 @@ type TextProps = ComponentPropsWithoutRef<'div'> & {
918
1008
  * Text prominence affects color. Use 'highContrast' for main non-interactive text, 'vibrant' for interactive elements, and 'secondary' for less important or supplementary content.
919
1009
  */
920
1010
  prominence?: keyof typeof prominenceMap;
1011
+ /**
1012
+ * This will inherit the jsdoc block from PolymorphicComponent
1013
+ */
921
1014
  renderAs?: ElementType$1;
922
1015
  /**
923
1016
  * The text style to display
@@ -966,6 +1059,9 @@ declare const Text: (<C = "div">(props: PolymorphicComponentProps<C, TextProps>)
966
1059
  * Text prominence affects color. Use 'highContrast' for main non-interactive text, 'vibrant' for interactive elements, and 'secondary' for less important or supplementary content.
967
1060
  */
968
1061
  prominence?: keyof typeof prominenceMap;
1062
+ /**
1063
+ * This will inherit the jsdoc block from PolymorphicComponent
1064
+ */
969
1065
  renderAs?: ElementType$1;
970
1066
  /**
971
1067
  * The text style to display
@@ -1010,6 +1106,9 @@ declare const Text: (<C = "div">(props: PolymorphicComponentProps<C, TextProps>)
1010
1106
  * Text prominence affects color. Use 'highContrast' for main non-interactive text, 'vibrant' for interactive elements, and 'secondary' for less important or supplementary content.
1011
1107
  */
1012
1108
  prominence?: keyof typeof prominenceMap;
1109
+ /**
1110
+ * This will inherit the jsdoc block from PolymorphicComponent
1111
+ */
1013
1112
  renderAs?: ElementType$1;
1014
1113
  /**
1015
1114
  * The text style to display
@@ -1098,22 +1197,4 @@ declare const WistiaLogo: {
1098
1197
  displayName: string;
1099
1198
  };
1100
1199
 
1101
- type ColorSchemeWrapperProps = ComponentPropsWithoutRef<'div'> & {
1102
- /**
1103
- * The color scheme to apply
1104
- */
1105
- colorScheme: ColorSchemeTypes;
1106
- /**
1107
- * Children
1108
- */
1109
- children: ReactNode;
1110
- };
1111
- /**
1112
- * A wrapper to apply a color scheme to its children.
1113
- */
1114
- declare const ColorSchemeWrapper: {
1115
- ({ colorScheme, children, ...otherProps }: ColorSchemeWrapperProps): JSX.Element;
1116
- displayName: string;
1117
- };
1118
-
1119
- export { Badge, type BadgeProps, Box, Button, ButtonGroup, type ButtonProps, ColorSchemeWrapper, type ColorSchemeWrapperProps, Divider, Ellipsis, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Link, type LinkProps, ScreenReaderOnly, Stack, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useMq, useWindowSize };
1200
+ export { Avatar, type AvatarInstanceType, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Button, ButtonGroup, type ButtonProps, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Divider, Ellipsis, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Label, type LabelProps, Link, type LinkProps, ScreenReaderOnly, Stack, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useMq, useWindowSize };