@wistia/ui 0.0.9 → 0.0.10

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,25 @@ 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
+ declare const colorSchemeOptions: readonly ["inherit", "default", "info", "success", "warning", "error", "blue", "green", "orange", "pink", "purple", "yellow"];
60
+ type ColorSchemeTypes = (typeof colorSchemeOptions)[number];
61
+ type ColorSchemeWrapperProps = ComponentPropsWithoutRef<'div'> & {
62
+ /**
63
+ * The color scheme to apply
64
+ */
65
+ colorScheme: ColorSchemeTypes;
66
+ /**
67
+ * Children
68
+ */
69
+ children: ReactNode;
70
+ };
71
+ /**
72
+ * A wrapper to apply a color scheme to its children.
73
+ */
74
+ declare const ColorSchemeWrapper: {
75
+ ({ colorScheme, children, ...otherProps }: ColorSchemeWrapperProps): JSX.Element;
76
+ displayName: string;
77
+ };
61
78
 
62
79
  type BadgeProps = ComponentPropsWithoutRef<'div'> & {
63
80
  /**
@@ -103,6 +120,16 @@ type Gap = {
103
120
  column: number | string;
104
121
  row: number | string;
105
122
  };
123
+ /**
124
+ * CSS property => Box prop:
125
+ * flex-direction => direction
126
+ * justify-content => justifyContent
127
+ * align-items => alignItems
128
+ * align-content => alignContent
129
+ * flex-wrap => wrapItems
130
+ * gap => gap
131
+ * display: inline-flex => inline
132
+ */
106
133
  type BoxProps = ComponentPropsWithoutRef<'div'> & {
107
134
  /**
108
135
  * Specifies how the browser distributes space between and around
@@ -196,11 +223,10 @@ type BoxProps = ComponentPropsWithoutRef<'div'> & {
196
223
  * Box is a layout container using [CSS Flexbox](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox).
197
224
  */
198
225
  declare const Box: {
199
- ({ alignContent, alignItems, children, direction, hasBoxParent, fill, fillViewport, inline, justifyContent, wrapItems, ...otherProps }: BoxProps): JSX.Element;
226
+ ({ alignContent, alignItems, children, direction, hasBoxParent, fill, fillViewport, gap, inline, justifyContent, wrapItems, ...otherProps }: BoxProps): JSX.Element;
200
227
  displayName: string;
201
228
  };
202
229
 
203
- type ButtonSizes = 'hero' | 'large' | 'medium' | 'small';
204
230
  type ButtonVariants = 'ghost' | 'outline' | 'soft' | 'solid';
205
231
 
206
232
  type LinkTypes = 'default' | 'email' | 'external' | 'phone';
@@ -264,6 +290,7 @@ type ResponsiveObject<T> = AtLeastOneBreakpoint<Record<Breakpoints, T>> & {
264
290
  base: T;
265
291
  };
266
292
 
293
+ type ButtonSizes = 'lg' | 'md' | 'sm' | 'xl';
267
294
  type BaseButtonProps = {
268
295
  /**
269
296
  * Text that appears inside of the button
@@ -303,7 +330,7 @@ type BaseButtonProps = {
303
330
  * If true, the button will fill its container
304
331
  *
305
332
  * @type boolean | ResponsiveObject<boolean>
306
- * */
333
+ */
307
334
  fullWidth?: ResponsiveObject<boolean> | boolean;
308
335
  /**
309
336
  * Provides a button without any styling (useful for wrapping another element)
@@ -315,8 +342,6 @@ type BaseButtonProps = {
315
342
  rightIcon?: JSX.Element | undefined;
316
343
  /**
317
344
  * 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
345
  */
321
346
  size?: ButtonSizes | ResponsiveObject<ButtonSizes>;
322
347
  /**
@@ -808,6 +833,37 @@ declare const IconButton: react.ForwardRefExoticComponent<(Omit<{
808
833
  children: JSX.Element;
809
834
  } & Omit<ButtonAsLinkProps, "leftIcon" | "fullWidth" | "rightIcon">, "ref">) & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
810
835
 
836
+ type LabelProps = ComponentPropsWithoutRef<'label'> & {
837
+ /**
838
+ * Pass an arbitrary child node
839
+ */
840
+ children?: ReactNode;
841
+ /**
842
+ * To indicate that the label is for a disabled form component
843
+ */
844
+ disabled?: boolean;
845
+ /**
846
+ * ID of the form component that the label should be associated with
847
+ */
848
+ htmlFor?: string | undefined;
849
+ /**
850
+ * Use if label describes a required form component
851
+ */
852
+ required?: boolean;
853
+ /**
854
+ * For label text that needs to be available to assistive technology (e.g. screen readers)
855
+ * but otherwise hidden on screen.
856
+ */
857
+ screenReaderOnly?: boolean;
858
+ };
859
+ /**
860
+ * Labels are used to give a title to a form component (eg. Input, Select, etc.)
861
+ */
862
+ declare const Label: {
863
+ ({ children, disabled, htmlFor, required, screenReaderOnly, ...otherProps }: LabelProps): JSX.Element;
864
+ displayName: string;
865
+ };
866
+
811
867
  type ScreenReaderOnlyProps = ComponentPropsWithoutRef<'div'> & {
812
868
  /**
813
869
  * Pass an arbitrary child node
@@ -834,17 +890,18 @@ declare const ScreenReaderOnly: {
834
890
  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
891
 
836
892
  type StackProps = {
893
+ /**
894
+ * Optional children
895
+ */
837
896
  children?: ReactNode | undefined;
838
897
  /**
839
898
  * The gap between each item in the stack. Can be a [responsive prop](/docs/ui-docs-responsive-props--docs).
840
899
  * TODO: add link to Spacing docs
841
- *
842
900
  */
843
901
  gap?: Spacings;
844
902
  /**
845
903
  * Vertical is equivalent to `flex-direction: column;`, horizontal is equivalent to `flex-direction: row;`.
846
904
  * The default behavior is `vertical`. Can be a [responsive prop](/docs/ui-docs-responsive-props--docs).
847
- *
848
905
  */
849
906
  direction?: 'horizontal' | 'vertical';
850
907
  renderAs?: ElementType$1;
@@ -1098,22 +1155,4 @@ declare const WistiaLogo: {
1098
1155
  displayName: string;
1099
1156
  };
1100
1157
 
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 };
1158
+ export { 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,25 @@ 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
+ declare const colorSchemeOptions: readonly ["inherit", "default", "info", "success", "warning", "error", "blue", "green", "orange", "pink", "purple", "yellow"];
60
+ type ColorSchemeTypes = (typeof colorSchemeOptions)[number];
61
+ type ColorSchemeWrapperProps = ComponentPropsWithoutRef<'div'> & {
62
+ /**
63
+ * The color scheme to apply
64
+ */
65
+ colorScheme: ColorSchemeTypes;
66
+ /**
67
+ * Children
68
+ */
69
+ children: ReactNode;
70
+ };
71
+ /**
72
+ * A wrapper to apply a color scheme to its children.
73
+ */
74
+ declare const ColorSchemeWrapper: {
75
+ ({ colorScheme, children, ...otherProps }: ColorSchemeWrapperProps): JSX.Element;
76
+ displayName: string;
77
+ };
61
78
 
62
79
  type BadgeProps = ComponentPropsWithoutRef<'div'> & {
63
80
  /**
@@ -103,6 +120,16 @@ type Gap = {
103
120
  column: number | string;
104
121
  row: number | string;
105
122
  };
123
+ /**
124
+ * CSS property => Box prop:
125
+ * flex-direction => direction
126
+ * justify-content => justifyContent
127
+ * align-items => alignItems
128
+ * align-content => alignContent
129
+ * flex-wrap => wrapItems
130
+ * gap => gap
131
+ * display: inline-flex => inline
132
+ */
106
133
  type BoxProps = ComponentPropsWithoutRef<'div'> & {
107
134
  /**
108
135
  * Specifies how the browser distributes space between and around
@@ -196,11 +223,10 @@ type BoxProps = ComponentPropsWithoutRef<'div'> & {
196
223
  * Box is a layout container using [CSS Flexbox](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox).
197
224
  */
198
225
  declare const Box: {
199
- ({ alignContent, alignItems, children, direction, hasBoxParent, fill, fillViewport, inline, justifyContent, wrapItems, ...otherProps }: BoxProps): JSX.Element;
226
+ ({ alignContent, alignItems, children, direction, hasBoxParent, fill, fillViewport, gap, inline, justifyContent, wrapItems, ...otherProps }: BoxProps): JSX.Element;
200
227
  displayName: string;
201
228
  };
202
229
 
203
- type ButtonSizes = 'hero' | 'large' | 'medium' | 'small';
204
230
  type ButtonVariants = 'ghost' | 'outline' | 'soft' | 'solid';
205
231
 
206
232
  type LinkTypes = 'default' | 'email' | 'external' | 'phone';
@@ -264,6 +290,7 @@ type ResponsiveObject<T> = AtLeastOneBreakpoint<Record<Breakpoints, T>> & {
264
290
  base: T;
265
291
  };
266
292
 
293
+ type ButtonSizes = 'lg' | 'md' | 'sm' | 'xl';
267
294
  type BaseButtonProps = {
268
295
  /**
269
296
  * Text that appears inside of the button
@@ -303,7 +330,7 @@ type BaseButtonProps = {
303
330
  * If true, the button will fill its container
304
331
  *
305
332
  * @type boolean | ResponsiveObject<boolean>
306
- * */
333
+ */
307
334
  fullWidth?: ResponsiveObject<boolean> | boolean;
308
335
  /**
309
336
  * Provides a button without any styling (useful for wrapping another element)
@@ -315,8 +342,6 @@ type BaseButtonProps = {
315
342
  rightIcon?: JSX.Element | undefined;
316
343
  /**
317
344
  * 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
345
  */
321
346
  size?: ButtonSizes | ResponsiveObject<ButtonSizes>;
322
347
  /**
@@ -808,6 +833,37 @@ declare const IconButton: react.ForwardRefExoticComponent<(Omit<{
808
833
  children: JSX.Element;
809
834
  } & Omit<ButtonAsLinkProps, "leftIcon" | "fullWidth" | "rightIcon">, "ref">) & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
810
835
 
836
+ type LabelProps = ComponentPropsWithoutRef<'label'> & {
837
+ /**
838
+ * Pass an arbitrary child node
839
+ */
840
+ children?: ReactNode;
841
+ /**
842
+ * To indicate that the label is for a disabled form component
843
+ */
844
+ disabled?: boolean;
845
+ /**
846
+ * ID of the form component that the label should be associated with
847
+ */
848
+ htmlFor?: string | undefined;
849
+ /**
850
+ * Use if label describes a required form component
851
+ */
852
+ required?: boolean;
853
+ /**
854
+ * For label text that needs to be available to assistive technology (e.g. screen readers)
855
+ * but otherwise hidden on screen.
856
+ */
857
+ screenReaderOnly?: boolean;
858
+ };
859
+ /**
860
+ * Labels are used to give a title to a form component (eg. Input, Select, etc.)
861
+ */
862
+ declare const Label: {
863
+ ({ children, disabled, htmlFor, required, screenReaderOnly, ...otherProps }: LabelProps): JSX.Element;
864
+ displayName: string;
865
+ };
866
+
811
867
  type ScreenReaderOnlyProps = ComponentPropsWithoutRef<'div'> & {
812
868
  /**
813
869
  * Pass an arbitrary child node
@@ -834,17 +890,18 @@ declare const ScreenReaderOnly: {
834
890
  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
891
 
836
892
  type StackProps = {
893
+ /**
894
+ * Optional children
895
+ */
837
896
  children?: ReactNode | undefined;
838
897
  /**
839
898
  * The gap between each item in the stack. Can be a [responsive prop](/docs/ui-docs-responsive-props--docs).
840
899
  * TODO: add link to Spacing docs
841
- *
842
900
  */
843
901
  gap?: Spacings;
844
902
  /**
845
903
  * Vertical is equivalent to `flex-direction: column;`, horizontal is equivalent to `flex-direction: row;`.
846
904
  * The default behavior is `vertical`. Can be a [responsive prop](/docs/ui-docs-responsive-props--docs).
847
- *
848
905
  */
849
906
  direction?: 'horizontal' | 'vertical';
850
907
  renderAs?: ElementType$1;
@@ -1098,22 +1155,4 @@ declare const WistiaLogo: {
1098
1155
  displayName: string;
1099
1156
  };
1100
1157
 
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 };
1158
+ export { 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 };