@wistia/ui 0.21.7 → 0.21.8-beta.7d0080e7.cf35bb3

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
@@ -3,17 +3,11 @@ import * as react from 'react';
3
3
  import { ReactNode, LegacyRef, MutableRefObject, RefCallback, Dispatch, SetStateAction, RefObject, ComponentPropsWithoutRef, JSX, ComponentPropsWithRef, AnchorHTMLAttributes, MouseEvent, ReactElement, ElementType, ChangeEvent, PropsWithChildren, InputHTMLAttributes, Ref, SyntheticEvent, ComponentProps, CSSProperties, 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
- import { CollapsibleContentProps as CollapsibleContentProps$1 } from '@radix-ui/react-collapsible';
7
6
  import { Color } from 'culori/fn';
8
7
  import * as Ariakit from '@ariakit/react';
9
8
  import * as styled_components from 'styled-components';
10
9
  import { Schema } from 'yup';
11
- import { HoverCardContentProps } from '@radix-ui/react-hover-card';
12
10
  import ReactMarkdown from 'react-markdown';
13
- import { DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuRadioGroupProps, DropdownMenuRadioItemProps, DropdownMenuCheckboxItemProps } from '@radix-ui/react-dropdown-menu';
14
- import { PopoverContentProps } from '@radix-ui/react-popover';
15
- import { ToggleGroupSingleProps } from '@radix-ui/react-toggle-group';
16
- import { TabsProps as TabsProps$1, TabsContentProps as TabsContentProps$1, TabsListProps as TabsListProps$1, TabsTriggerProps as TabsTriggerProps$1 } from '@radix-ui/react-tabs';
17
11
  export { FileAmountLimitValidator, FileSizeValidator, FileTypeValidator, ImageDimensionsValidator, PersistentFileAmountLimitValidator } from 'use-file-picker/validators';
18
12
 
19
13
  type UIProviderProps = {
@@ -1146,7 +1140,7 @@ declare const Checkbox: react.ForwardRefExoticComponent<Omit<Omit<react.Detailed
1146
1140
  /**
1147
1141
  * Callback function invoked when the value changes
1148
1142
  */
1149
- onChange?: (event: ChangeEvent) => unknown;
1143
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
1150
1144
  /**
1151
1145
  * Indicates if the input is required
1152
1146
  */
@@ -1217,7 +1211,7 @@ type CollapsibleTriggerProps = {
1217
1211
  * A trigger element that will toggle the collapsible content.
1218
1212
  * Usually a [Button](?path=/docs/components-button--docs).
1219
1213
  */
1220
- children: ReactNode;
1214
+ children: ReactElement;
1221
1215
  };
1222
1216
  declare const CollapsibleTrigger: ({ children }: CollapsibleTriggerProps) => react_jsx_runtime.JSX.Element;
1223
1217
 
@@ -1505,7 +1499,7 @@ type CollapsibleContentProps = {
1505
1499
  /**
1506
1500
  * The content that will be hidden when `Collapsible` is closed.
1507
1501
  */
1508
- children: CollapsibleContentProps$1['children'];
1502
+ children: ReactNode;
1509
1503
  };
1510
1504
  declare const CollapsibleContent: ({ clamp, children }: CollapsibleContentProps) => react_jsx_runtime.JSX.Element;
1511
1505
 
@@ -2712,8 +2706,7 @@ type GridProps = ComponentPropsWithoutRef<'div'> & {
2712
2706
  };
2713
2707
  declare const Grid: (<C extends ElementType = "div">(props: PolymorphicComponentProps<C, GridProps>) => react.ReactElement | null) & UnknownRecord;
2714
2708
 
2715
- type ContentProps$1 = Omit<HoverCardContentProps, 'alignOffset' | 'arrowPadding' | 'asChild' | 'collisionPadding' | 'hideWhenDetached' | 'sideOffset'>;
2716
- type PreviewCardProps = ContentProps$1 & {
2709
+ type PreviewCardProps = {
2717
2710
  /**
2718
2711
  * The content of the preview card
2719
2712
  */
@@ -2730,7 +2723,7 @@ type PreviewCardProps = ContentProps$1 & {
2730
2723
  * The [Link](?path=/docs/components-link--docs) that opens the preview card when hovered.
2731
2724
  * Preview cards should only be used on links—do not use on non-interactive elements (e.g. buttons or plain text).
2732
2725
  */
2733
- trigger: JSX.Element;
2726
+ trigger: ReactElement;
2734
2727
  /**
2735
2728
  * If true, the preview card will use the unstyled Content component instead of StyledContent
2736
2729
  */
@@ -2753,12 +2746,20 @@ type PreviewCardProps = ContentProps$1 & {
2753
2746
  * Force the preview card to be open without user interaction (for debugging and CI)
2754
2747
  */
2755
2748
  forceOpen?: boolean;
2749
+ /**
2750
+ * The preferred side of the trigger to render on
2751
+ */
2752
+ side?: 'bottom' | 'left' | 'right' | 'top';
2753
+ /**
2754
+ * The preferred alignment against the trigger
2755
+ */
2756
+ align?: 'center' | 'end' | 'start';
2756
2757
  };
2757
2758
  /**
2758
2759
  * Preview cards reveal content on hover. **Everything in the card must also exist at the destination**—never put information only in the preview. This pattern is for sighted-only, so treat the card as a preview, not a source of truth.
2759
2760
  */
2760
2761
  declare const PreviewCard: {
2761
- ({ children, trigger, maxWidth, maxHeight, unstyled, paddingSize, openDelay, closeDelay, colorScheme, forceOpen, ...props }: PreviewCardProps): JSX.Element;
2762
+ ({ children, trigger, maxWidth, maxHeight, unstyled, paddingSize, openDelay, closeDelay, colorScheme, forceOpen, side, align, ...props }: PreviewCardProps): JSX.Element;
2762
2763
  displayName: string;
2763
2764
  };
2764
2765
 
@@ -3031,10 +3032,6 @@ type MenuProps = MenuControlProps & {
3031
3032
  * The label for the trigger element, this is ignored if `trigger` is defined
3032
3033
  */
3033
3034
  label?: string;
3034
- /**
3035
- * Callback for when the user clicks or focuses outside of the menu
3036
- */
3037
- onInteractOutside?: DropdownMenuContentProps['onInteractOutside'];
3038
3035
  /**
3039
3036
  * The side the menu appears on, relative to the trigger
3040
3037
  */
@@ -3143,7 +3140,7 @@ type MenuItemButtonProps = ButtonProps & {
3143
3140
  unstyled?: never;
3144
3141
  };
3145
3142
 
3146
- declare const MenuItem: react.ForwardRefExoticComponent<(Omit<DropdownMenuItemProps & BaseButtonProps & react.ClassAttributes<HTMLAnchorElement> & react.AnchorHTMLAttributes<HTMLAnchorElement> & {
3143
+ declare const MenuItem: react.ForwardRefExoticComponent<(Omit<BaseButtonProps & react.ClassAttributes<HTMLAnchorElement> & react.AnchorHTMLAttributes<HTMLAnchorElement> & {
3147
3144
  beforeAction?: (() => Promise<void>) | (() => void);
3148
3145
  children: react.ReactNode;
3149
3146
  colorScheme?: ColorSchemeTypes;
@@ -3185,7 +3182,16 @@ declare const MenuItem: react.ForwardRefExoticComponent<(Omit<DropdownMenuItemPr
3185
3182
  * Treats the menu item as a link when provided
3186
3183
  */
3187
3184
  href?: MenuItemButtonProps["href"];
3188
- }, "ref"> | Omit<DropdownMenuItemProps & BaseButtonProps & react.ClassAttributes<HTMLAnchorElement> & react.AnchorHTMLAttributes<HTMLAnchorElement> & {
3185
+ /**
3186
+ * Whether the menu should close when this item is clicked
3187
+ * @default true
3188
+ */
3189
+ closeOnClick?: boolean;
3190
+ /**
3191
+ * Callback when the item is selected
3192
+ */
3193
+ onSelect?: (event: Event | SyntheticEvent) => void;
3194
+ }, "ref"> | Omit<BaseButtonProps & react.ClassAttributes<HTMLAnchorElement> & react.AnchorHTMLAttributes<HTMLAnchorElement> & {
3189
3195
  beforeAction?: (() => Promise<void>) | (() => void);
3190
3196
  children: react.ReactNode;
3191
3197
  colorScheme?: ColorSchemeTypes;
@@ -3221,7 +3227,16 @@ declare const MenuItem: react.ForwardRefExoticComponent<(Omit<DropdownMenuItemPr
3221
3227
  * Treats the menu item as a link when provided
3222
3228
  */
3223
3229
  href?: MenuItemButtonProps["href"];
3224
- }, "ref"> | Omit<DropdownMenuItemProps & BaseButtonProps & react.ClassAttributes<HTMLButtonElement> & react.ButtonHTMLAttributes<HTMLButtonElement> & {
3230
+ /**
3231
+ * Whether the menu should close when this item is clicked
3232
+ * @default true
3233
+ */
3234
+ closeOnClick?: boolean;
3235
+ /**
3236
+ * Callback when the item is selected
3237
+ */
3238
+ onSelect?: (event: Event | SyntheticEvent) => void;
3239
+ }, "ref"> | Omit<BaseButtonProps & react.ClassAttributes<HTMLButtonElement> & react.ButtonHTMLAttributes<HTMLButtonElement> & {
3225
3240
  href?: never;
3226
3241
  type?: "button" | "reset" | "submit";
3227
3242
  children: react.ReactNode;
@@ -3243,6 +3258,15 @@ declare const MenuItem: react.ForwardRefExoticComponent<(Omit<DropdownMenuItemPr
3243
3258
  * Treats the menu item as a link when provided
3244
3259
  */
3245
3260
  href?: MenuItemButtonProps["href"];
3261
+ /**
3262
+ * Whether the menu should close when this item is clicked
3263
+ * @default true
3264
+ */
3265
+ closeOnClick?: boolean;
3266
+ /**
3267
+ * Callback when the item is selected
3268
+ */
3269
+ onSelect?: (event: Event | SyntheticEvent) => void;
3246
3270
  }, "ref">) & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
3247
3271
 
3248
3272
  type MenuItemLabelProps = {
@@ -3261,22 +3285,26 @@ type MenuItemDescriptionProps = {
3261
3285
  };
3262
3286
  declare const MenuItemDescription: ({ children }: MenuItemDescriptionProps) => react_jsx_runtime.JSX.Element;
3263
3287
 
3264
- type MenuRadioGroupProps = DropdownMenuRadioGroupProps & {
3288
+ type MenuRadioGroupProps = {
3265
3289
  /**
3266
3290
  * The radio items
3267
3291
  */
3268
3292
  children: ReactNode | ReactNode[];
3269
3293
  /**
3270
- * @ignore
3294
+ * The value of the selected radio item
3271
3295
  */
3272
- asChild?: never;
3296
+ value?: string;
3297
+ /**
3298
+ * Callback when the value changes
3299
+ */
3300
+ onValueChange?: (value: string) => void;
3273
3301
  };
3274
3302
  declare const MenuRadioGroup: {
3275
3303
  ({ children, ...props }: MenuRadioGroupProps): react_jsx_runtime.JSX.Element;
3276
3304
  displayName: string;
3277
3305
  };
3278
3306
 
3279
- type RadioMenuItemProps = DropdownMenuRadioItemProps & MenuItemButtonProps & {
3307
+ type RadioMenuItemProps = MenuItemButtonProps & {
3280
3308
  /**
3281
3309
  * Optional `Icon` to use as the indicator that the radio item is selected. Must be an instance of [Icon](../?path=/docs/components-icon--docs)
3282
3310
  */
@@ -3284,7 +3312,7 @@ type RadioMenuItemProps = DropdownMenuRadioItemProps & MenuItemButtonProps & {
3284
3312
  /**
3285
3313
  * The value of the item
3286
3314
  */
3287
- value: DropdownMenuRadioItemProps['value'];
3315
+ value: string;
3288
3316
  /**
3289
3317
  * @ignore
3290
3318
  */
@@ -3297,13 +3325,17 @@ type RadioMenuItemProps = DropdownMenuRadioItemProps & MenuItemButtonProps & {
3297
3325
  * @ignore
3298
3326
  */
3299
3327
  ref?: never;
3328
+ /**
3329
+ * Callback when the item is selected
3330
+ */
3331
+ onSelect?: (event: Event | SyntheticEvent) => void;
3300
3332
  };
3301
3333
  declare const RadioMenuItem: {
3302
3334
  ({ onSelect, value, indicator, ...props }: RadioMenuItemProps): react_jsx_runtime.JSX.Element;
3303
3335
  displayName: string;
3304
3336
  };
3305
3337
 
3306
- type CheckboxMenuItemProps = DropdownMenuCheckboxItemProps & MenuItemButtonProps & {
3338
+ type CheckboxMenuItemProps = MenuItemButtonProps & {
3307
3339
  /** Callback to fire when the checked status changes */
3308
3340
  onCheckedChange: (checked: boolean) => void;
3309
3341
  /**
@@ -3326,6 +3358,10 @@ type CheckboxMenuItemProps = DropdownMenuCheckboxItemProps & MenuItemButtonProps
3326
3358
  * @ignore
3327
3359
  */
3328
3360
  ref?: never;
3361
+ /**
3362
+ * Callback when the item is selected
3363
+ */
3364
+ onSelect?: (event: Event | SyntheticEvent) => void;
3329
3365
  };
3330
3366
  declare const CheckboxMenuItem: {
3331
3367
  ({ onSelect, checked, onCheckedChange, ...props }: CheckboxMenuItemProps): react_jsx_runtime.JSX.Element;
@@ -3540,8 +3576,7 @@ type UncontrolledPopoverProps = {
3540
3576
  onOpenChange?: never;
3541
3577
  };
3542
3578
  type PopoverControlProps = ControlledPopoverProps | UncontrolledPopoverProps;
3543
- type ContentProps = Omit<PopoverContentProps, 'alignOffset' | 'arrowPadding' | 'asChild' | 'collisionPadding' | 'hideWhenDetached' | 'sideOffset' | 'updatePositionStrategy'>;
3544
- type PopoverProps = ContentProps & PopoverControlProps & {
3579
+ type PopoverProps = PopoverControlProps & {
3545
3580
  /**
3546
3581
  * The content of the popover
3547
3582
  */
@@ -3565,13 +3600,13 @@ type PopoverProps = ContentProps & PopoverControlProps & {
3565
3600
  /**
3566
3601
  * An interactive element. Most commonly a [Button](?path=/docs/components-button--docs) or [IconButton]([Button](?path=/docs/components-iconbutton--docs)).
3567
3602
  */
3568
- trigger: JSX.Element;
3603
+ trigger: ReactElement;
3569
3604
  /**
3570
3605
  * If true, the popover will use the unstyled Content component instead of StyledContent
3571
3606
  */
3572
3607
  unstyled?: boolean;
3573
3608
  /**
3574
- * If true, the popover will use a custom radix arrow to trigger
3609
+ * If true, the popover will use a custom arrow on the trigger
3575
3610
  */
3576
3611
  withArrow?: boolean;
3577
3612
  /**
@@ -3583,12 +3618,20 @@ type PopoverProps = ContentProps & PopoverControlProps & {
3583
3618
  * Inline styles applied to the popover popup
3584
3619
  */
3585
3620
  style?: CSSProperties;
3621
+ /**
3622
+ * The preferred side of the trigger to render on
3623
+ */
3624
+ side?: 'bottom' | 'left' | 'right' | 'top';
3625
+ /**
3626
+ * The preferred alignment against the trigger
3627
+ */
3628
+ align?: 'center' | 'end' | 'start';
3586
3629
  };
3587
3630
  /**
3588
3631
  * Displays rich content in a portal, triggered by a button.
3589
3632
  */
3590
3633
  declare const Popover: {
3591
- ({ children, trigger, isOpen, hideCloseButton, maxWidth, maxHeight, onOpenChange, unstyled, withArrow, isAnimated, colorScheme, style, ...props }: PopoverProps): JSX.Element;
3634
+ ({ children, trigger, isOpen, hideCloseButton, maxWidth, maxHeight, onOpenChange, unstyled, withArrow, isAnimated, colorScheme, style, side, align, ...props }: PopoverProps): JSX.Element;
3592
3635
  displayName: string;
3593
3636
  };
3594
3637
 
@@ -3656,7 +3699,7 @@ type RadioProps = Omit<ComponentPropsWithoutRef<'input'>, 'hideLabel' | 'label'
3656
3699
  /**
3657
3700
  * Callback function invoked when the value changes
3658
3701
  */
3659
- onChange?: (event: ChangeEvent) => unknown;
3702
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
3660
3703
  /**
3661
3704
  * Indicates if the input is required
3662
3705
  */
@@ -3707,7 +3750,7 @@ declare const Radio: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTM
3707
3750
  /**
3708
3751
  * Callback function invoked when the value changes
3709
3752
  */
3710
- onChange?: (event: ChangeEvent) => unknown;
3753
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
3711
3754
  /**
3712
3755
  * Indicates if the input is required
3713
3756
  */
@@ -3925,7 +3968,7 @@ declare const ScrollArea: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDiv
3925
3968
  locked?: boolean;
3926
3969
  } & react.RefAttributes<HTMLDivElement>>;
3927
3970
 
3928
- type SegmentedControlProps = Omit<ToggleGroupSingleProps, 'type'> & {
3971
+ type SegmentedControlProps = {
3929
3972
  /**
3930
3973
  * `SegmentedControlItem`s that will be rendered in grouping
3931
3974
  */
@@ -3954,7 +3997,7 @@ type SegmentedControlProps = Omit<ToggleGroupSingleProps, 'type'> & {
3954
3997
  /**
3955
3998
  * Provides a horizontal set of segments for switching between different values
3956
3999
  */
3957
- declare const SegmentedControl: ForwardRefExoticComponent<RefAttributes<HTMLDivElement> & SegmentedControlProps>;
4000
+ declare const SegmentedControl: ForwardRefExoticComponent<RefAttributes<HTMLDivElement> & SegmentedControlProps & HTMLAttributes<HTMLDivElement>>;
3958
4001
 
3959
4002
  type BaseProps$1 = {
3960
4003
  /**
@@ -4132,7 +4175,7 @@ type SliderProps = Omit<ComponentPropsWithoutRef<'div'>, 'onChange'> & {
4132
4175
  * (e.g. on mouseup, touchend, or keyup). Useful for analytics or
4133
4176
  * expensive operations where only the final value matters.
4134
4177
  */
4135
- onValueCommit?: (value: number[]) => void;
4178
+ onValueCommitted?: (value: number[]) => void;
4136
4179
  /**
4137
4180
  * Value to be added or subtracted on each step
4138
4181
  */
@@ -4144,7 +4187,7 @@ type SliderProps = Omit<ComponentPropsWithoutRef<'div'>, 'onChange'> & {
4144
4187
  value?: number[];
4145
4188
  };
4146
4189
  declare const Slider: {
4147
- ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, disabled, initialValue, max, min, onChange, onValueCommit, step, value, "data-testid": dataTestId, ...otherProps }: SliderProps): JSX.Element;
4190
+ ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, disabled, initialValue, max, min, onChange, onValueCommitted, step, value, "data-testid": dataTestId, ...otherProps }: SliderProps): JSX.Element;
4148
4191
  displayName: string;
4149
4192
  };
4150
4193
 
@@ -4262,7 +4305,7 @@ type SwitchProps = Omit<ComponentPropsWithoutRef<'input'>, 'hideLabel' | 'label'
4262
4305
  /**
4263
4306
  * Callback function invoked when the value changes
4264
4307
  */
4265
- onChange?: (event: ChangeEvent) => unknown;
4308
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
4266
4309
  /**
4267
4310
  * Indicates if the input is required
4268
4311
  */
@@ -4312,7 +4355,7 @@ declare const Switch: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHT
4312
4355
  /**
4313
4356
  * Callback function invoked when the value changes
4314
4357
  */
4315
- onChange?: (event: ChangeEvent) => unknown;
4358
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
4316
4359
  /**
4317
4360
  * Indicates if the input is required
4318
4361
  */
@@ -4382,19 +4425,29 @@ type TableRowProps = HTMLAttributes<HTMLTableRowElement> & {
4382
4425
  };
4383
4426
  declare const TableRow: ({ children, ...props }: TableRowProps) => JSX.Element;
4384
4427
 
4385
- type TabsProps = Pick<TabsProps$1, 'children' | 'defaultValue' | 'onValueChange' | 'value'>;
4428
+ type TabsProps = {
4429
+ children?: React.ReactNode;
4430
+ defaultValue?: string;
4431
+ onValueChange?: (value: string) => void;
4432
+ value?: string;
4433
+ };
4386
4434
  declare const Tabs: {
4387
4435
  ({ children, value: valueProp, onValueChange: onValueChangeProp, defaultValue, ...props }: TabsProps): JSX.Element;
4388
4436
  displayName: string;
4389
4437
  };
4390
4438
 
4391
- type TabsContentProps = Pick<TabsContentProps$1, 'children' | 'value'>;
4439
+ type TabsContentProps = {
4440
+ children?: ReactNode;
4441
+ value: string;
4442
+ };
4392
4443
  declare const TabsContent: {
4393
4444
  ({ children, value }: TabsContentProps): JSX.Element;
4394
4445
  displayName: string;
4395
4446
  };
4396
4447
 
4397
- type TabsListProps = Pick<TabsListProps$1, 'aria-label'> & PropsWithChildren<{
4448
+ type TabsListProps = {
4449
+ 'aria-label'?: string;
4450
+ } & PropsWithChildren<{
4398
4451
  fullWidth?: boolean;
4399
4452
  }>;
4400
4453
  declare const TabsList: {
@@ -4402,7 +4455,10 @@ declare const TabsList: {
4402
4455
  displayName: string;
4403
4456
  };
4404
4457
 
4405
- type BaseProps = Pick<TabsTriggerProps$1, 'disabled' | 'value'>;
4458
+ type BaseProps = {
4459
+ disabled?: boolean;
4460
+ value: string;
4461
+ };
4406
4462
  type IconWithLabel = {
4407
4463
  /**
4408
4464
  * The [Icon](?path=/docs/components-icon--docs) component to use, e.g. `<Icon type="favorite" />`