@wistia/ui 0.20.6 → 0.20.8-beta.26ed9341.000ecec

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
@@ -7,6 +7,7 @@ import { CollapsibleContentProps as CollapsibleContentProps$1 } from '@radix-ui/
7
7
  import { Color } from 'culori/fn';
8
8
  import * as Ariakit from '@ariakit/react';
9
9
  import * as styled_components from 'styled-components';
10
+ import { Schema } from 'yup';
10
11
  import * as _radix_ui_react_dropdown_menu from '@radix-ui/react-dropdown-menu';
11
12
  import { DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuRadioGroupProps, DropdownMenuRadioItemProps, DropdownMenuCheckboxItemProps } from '@radix-ui/react-dropdown-menu';
12
13
  import { PopoverContentProps } from '@radix-ui/react-popover';
@@ -479,7 +480,7 @@ type ActionButtonProps = {
479
480
  /**
480
481
  * Set the [color scheme](../?path=/docs/docs-color-schemes--docs) of the `ActionButton` when hovered. By default, it will inherit the `colorScheme` prop.
481
482
  */
482
- hoverColorScheme?: ColorSchemeTypes;
483
+ hoverColorScheme?: ColorSchemeTypes | undefined;
483
484
  /**
484
485
  * Changes the secondary icon for different use cases
485
486
  */
@@ -512,7 +513,7 @@ declare const ActionButton: react.ForwardRefExoticComponent<(Omit<{
512
513
  /**
513
514
  * Set the [color scheme](../?path=/docs/docs-color-schemes--docs) of the `ActionButton` when hovered. By default, it will inherit the `colorScheme` prop.
514
515
  */
515
- hoverColorScheme?: ColorSchemeTypes;
516
+ hoverColorScheme?: ColorSchemeTypes | undefined;
516
517
  /**
517
518
  * Changes the secondary icon for different use cases
518
519
  */
@@ -541,7 +542,7 @@ declare const ActionButton: react.ForwardRefExoticComponent<(Omit<{
541
542
  /**
542
543
  * Set the [color scheme](../?path=/docs/docs-color-schemes--docs) of the `ActionButton` when hovered. By default, it will inherit the `colorScheme` prop.
543
544
  */
544
- hoverColorScheme?: ColorSchemeTypes;
545
+ hoverColorScheme?: ColorSchemeTypes | undefined;
545
546
  /**
546
547
  * Changes the secondary icon for different use cases
547
548
  */
@@ -1924,12 +1925,16 @@ type DividerProps = ComponentPropsWithoutRef<'div'> & {
1924
1925
  * Orientation of the divider.
1925
1926
  */
1926
1927
  orientation?: ResponsiveObject<'horizontal' | 'vertical'> | 'horizontal' | 'vertical';
1928
+ /**
1929
+ * The amount of space to inset the divider.
1930
+ */
1931
+ inset?: ResponsiveObject<Spacings> | Spacings;
1927
1932
  };
1928
1933
  /**
1929
- * A line used to visually separate content; note that dividers have no margin/spacing on their own.
1934
+ * A line used to visually separate content; note that dividers have no external margin/spacing on their own.
1930
1935
  */
1931
1936
  declare const Divider: {
1932
- ({ orientation, ...props }: DividerProps): JSX.Element;
1937
+ ({ orientation, inset, ...props }: DividerProps): JSX.Element;
1933
1938
  displayName: string;
1934
1939
  };
1935
1940
 
@@ -2409,6 +2414,8 @@ type FormErrorSummaryProps = {
2409
2414
  };
2410
2415
  declare const FormErrorSummary: ({ description }: FormErrorSummaryProps) => react_jsx_runtime.JSX.Element | null;
2411
2416
 
2417
+ declare const validateWithYup: <T>(schema: Schema<T>) => (data: object) => {};
2418
+
2412
2419
  type FormFieldProps = ComponentPropsWithoutRef<'div'> & {
2413
2420
  /**
2414
2421
  * This should be a single child that is a valid form field (or can pretend to be one).
@@ -4398,4 +4405,4 @@ declare const CustomizableThemeWrapper: {
4398
4405
  displayName: string;
4399
4406
  };
4400
4407
 
4401
- export { ActionButton, type ActionButtonProps, Avatar, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, Banner, BannerImage, type BannerProps, Box, type BoxProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, Button, ButtonGroup, type ButtonProps, Card, type CardProps, Center, type CenterProps, Checkbox, CheckboxGroup, CheckboxMenuItem, ClickRegion, type ClickRegionProps, Collapsible, CollapsibleContent, type CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerIcon, ColorGrid, ColorGridOption, type ColorGridOptionProps, type ColorGridProps, ColorList, ColorListGroup, type ColorListGroupProps, ColorListOption, type ColorListOptionProps, type ColorListProps, ColorPicker, ColorPickerPopoverContent, type ColorPickerPopoverContentProps, type ColorPickerProps, ColorPickerSection, type ColorPickerSectionProps, ColorPickerTrigger, type ColorPickerTriggerProps, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Combobox, ComboboxOption, type ComboboxOptionProps, type ComboboxProps, ContextMenu, type ContextMenuProps, ContrastControls, CustomizableThemeWrapper, type CustomizableThemeWrapperProps, DataCard, DataCardHoverArrow, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, DataList, DataListItem, DataListItemLabel, DataListItemValue, type DataListProps, Divider, EditableHeading, type EditableHeadingProps, EditableText, EditableTextCancelButton, EditableTextContext, EditableTextDisplay, EditableTextInput, EditableTextLabel, type EditableTextProps, EditableTextRoot, type EditableTextRootProps, EditableTextSubmitButton, EditableTextTrigger, Ellipsis, type EllipsisProps, FilterMenu, FilterMenuItem, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Grid, type GridProps, Heading, type HeadingProps, HexColorInput, type HexColorInputProps, HueSlider, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, InputClickToCopy, type InputClickToCopyProps, InputPassword, type InputPasswordProps, type InputProps, type KeyboardKeys, KeyboardShortcut, Label, type LabelProps, Link, type LinkProps, List, ListItem, type ListItemProps, type ListProps, Mark, type MarkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, ModalCallout, ModalCallouts, type ModalProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, Radio, RadioCard, RadioCardImage, type RadioCardImageProps, type RadioCardProps, RadioGroup, RadioMenuItem, type RadioProps, SaturationAndValuePicker, ScreenReaderOnly, ScrollArea, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Slider, type SliderProps, SplitButton, type SplitButtonProps, Stack, SubMenu, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableFoot, type TableFootProps, TableHead, type TableHeadProps, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, Text, type TextProps, Thumbnail, ThumbnailBadge, type ThumbnailBadgeProps, ThumbnailCollage, type ThumbnailCollageProps, type ThumbnailProps, Tooltip, type TooltipProps, UIProvider, type UseActiveMqReturnType, type UseIsHoveredReturnType, type UseMqReturnType, type UseToastProps, ValueNameOrHexCode, ValueSwatch, WistiaLogo, calculateContrast, colorSchemeOptions, copyToClipboard, dateTime, iconSizeMap, mergeRefs, mq, useActiveMq, useAriaLive, useBoolean, useClipboard, useElementObserver, useFilePicker, useFocusTrap, useForceUpdate, useFormState, useImperativeFilePicker, useIsHovered, useKey, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize };
4408
+ export { ActionButton, type ActionButtonProps, Avatar, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, Banner, BannerImage, type BannerProps, Box, type BoxProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, Button, ButtonGroup, type ButtonProps, Card, type CardProps, Center, type CenterProps, Checkbox, CheckboxGroup, CheckboxMenuItem, ClickRegion, type ClickRegionProps, Collapsible, CollapsibleContent, type CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerIcon, ColorGrid, ColorGridOption, type ColorGridOptionProps, type ColorGridProps, ColorList, ColorListGroup, type ColorListGroupProps, ColorListOption, type ColorListOptionProps, type ColorListProps, ColorPicker, ColorPickerPopoverContent, type ColorPickerPopoverContentProps, type ColorPickerProps, ColorPickerSection, type ColorPickerSectionProps, ColorPickerTrigger, type ColorPickerTriggerProps, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Combobox, ComboboxOption, type ComboboxOptionProps, type ComboboxProps, ContextMenu, type ContextMenuProps, ContrastControls, CustomizableThemeWrapper, type CustomizableThemeWrapperProps, DataCard, DataCardHoverArrow, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, DataList, DataListItem, DataListItemLabel, DataListItemValue, type DataListProps, Divider, EditableHeading, type EditableHeadingProps, EditableText, EditableTextCancelButton, EditableTextContext, EditableTextDisplay, EditableTextInput, EditableTextLabel, type EditableTextProps, EditableTextRoot, type EditableTextRootProps, EditableTextSubmitButton, EditableTextTrigger, Ellipsis, type EllipsisProps, FilterMenu, FilterMenuItem, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Grid, type GridProps, Heading, type HeadingProps, HexColorInput, type HexColorInputProps, HueSlider, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, InputClickToCopy, type InputClickToCopyProps, InputPassword, type InputPasswordProps, type InputProps, type KeyboardKeys, KeyboardShortcut, Label, type LabelProps, Link, type LinkProps, List, ListItem, type ListItemProps, type ListProps, Mark, type MarkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, ModalCallout, ModalCallouts, type ModalProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, Radio, RadioCard, RadioCardImage, type RadioCardImageProps, type RadioCardProps, RadioGroup, RadioMenuItem, type RadioProps, SaturationAndValuePicker, ScreenReaderOnly, ScrollArea, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Slider, type SliderProps, SplitButton, type SplitButtonProps, Stack, SubMenu, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableFoot, type TableFootProps, TableHead, type TableHeadProps, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, Text, type TextProps, Thumbnail, ThumbnailBadge, type ThumbnailBadgeProps, ThumbnailCollage, type ThumbnailCollageProps, type ThumbnailProps, Tooltip, type TooltipProps, UIProvider, type UseActiveMqReturnType, type UseIsHoveredReturnType, type UseMqReturnType, type UseToastProps, ValueNameOrHexCode, ValueSwatch, WistiaLogo, calculateContrast, colorSchemeOptions, copyToClipboard, dateTime, iconSizeMap, mergeRefs, mq, useActiveMq, useAriaLive, useBoolean, useClipboard, useElementObserver, useFilePicker, useFocusTrap, useForceUpdate, useFormState, useImperativeFilePicker, useIsHovered, useKey, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize, validateWithYup };
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.20.6
3
+ * @license @wistia/ui v0.20.8-beta.26ed9341.000ecec
4
4
  *
5
- * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
5
+ * Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
6
6
  *
7
7
  * This source code is unlicensed, all rights reserved.
8
8
  */
@@ -8780,7 +8780,7 @@ var getGapStyle = (gap) => {
8780
8780
  return `${key}-gap: var(--wui-${value});`;
8781
8781
  }).join("");
8782
8782
  }
8783
- return `gap: var(--wui-${gap.toString()});`;
8783
+ return `gap: var(--wui-${gap});`;
8784
8784
  }
8785
8785
  return void 0;
8786
8786
  };
@@ -9877,7 +9877,7 @@ var StyledCenter = styled22.div`
9877
9877
  margin-left: auto;
9878
9878
  margin-right: auto;
9879
9879
  max-width: ${({ $maxWidth }) => $maxWidth};
9880
- ${({ $gutterWidth }) => $gutterWidth && `padding: 0 var(--wui-${$gutterWidth.toString()});`}
9880
+ ${({ $gutterWidth }) => $gutterWidth && `padding: 0 var(--wui-${$gutterWidth});`}
9881
9881
  ${({ $intrinsic }) => $intrinsic && `
9882
9882
  display: flex;
9883
9883
  flex-direction: column;
@@ -14617,12 +14617,16 @@ var horizontalBorderCss = css33`
14617
14617
  border-top-width: 1px;
14618
14618
  clear: both; /* for horizontal dividers, ensure it clears any floats */
14619
14619
  height: 0;
14620
+ margin-left: var(--wui-divider-inset);
14621
+ margin-right: var(--wui-divider-inset);
14620
14622
  `;
14621
14623
  var verticalBorderCss = css33`
14622
14624
  background-color: var(--wui-color-border);
14623
14625
  max-width: 1px;
14624
14626
  min-height: 100%;
14625
14627
  width: 1px;
14628
+ margin-top: var(--wui-divider-inset);
14629
+ margin-bottom: var(--wui-divider-inset);
14626
14630
  `;
14627
14631
  var DividerComponent = styled63.div`
14628
14632
  ${({ $orientation }) => {
@@ -14634,12 +14638,21 @@ var DividerComponent = styled63.div`
14634
14638
  return horizontalBorderCss;
14635
14639
  }
14636
14640
  }}
14641
+ --wui-divider-inset: ${({ $inset }) => `var(--wui-${$inset})`};
14642
+
14643
+ align-self: stretch;
14637
14644
  `;
14638
- var Divider = ({ orientation = "horizontal", ...props }) => {
14645
+ var Divider = ({
14646
+ orientation = "horizontal",
14647
+ inset = "space-00",
14648
+ ...props
14649
+ }) => {
14639
14650
  const responsiveOrientation = useResponsiveProp(orientation);
14651
+ const responsiveInset = useResponsiveProp(inset);
14640
14652
  return /* @__PURE__ */ jsx296(
14641
14653
  DividerComponent,
14642
14654
  {
14655
+ $inset: responsiveInset,
14643
14656
  $orientation: responsiveOrientation,
14644
14657
  "aria-orientation": responsiveOrientation,
14645
14658
  role: "separator",
@@ -15362,10 +15375,34 @@ var FormErrorSummary = ({ description }) => {
15362
15375
  ] });
15363
15376
  };
15364
15377
 
15378
+ // src/components/Form/validateWithYup.tsx
15379
+ import { ValidationError } from "yup";
15380
+ import { isNotUndefined as isNotUndefined12 } from "@wistia/type-guards";
15381
+ var validateWithYup = (schema) => {
15382
+ return (data) => {
15383
+ const parsed = schema.cast(data, { assert: false });
15384
+ try {
15385
+ schema.validateSync(parsed, { abortEarly: false });
15386
+ return {};
15387
+ } catch (err) {
15388
+ if (err instanceof ValidationError) {
15389
+ return err.inner.reduce((acc, error) => {
15390
+ if (isNotUndefined12(error.path)) {
15391
+ acc[error.path] = error.message;
15392
+ return acc;
15393
+ }
15394
+ return acc;
15395
+ }, {});
15396
+ }
15397
+ throw err;
15398
+ }
15399
+ };
15400
+ };
15401
+
15365
15402
  // src/components/FormField/FormField.tsx
15366
15403
  import { Children as Children10, cloneElement as cloneElement8, useContext as useContext13 } from "react";
15367
15404
  import { styled as styled68, css as css36 } from "styled-components";
15368
- import { isArray as isArray4, isNotNil as isNotNil28, isNotUndefined as isNotUndefined12, isUndefined as isUndefined4 } from "@wistia/type-guards";
15405
+ import { isArray as isArray4, isNotNil as isNotNil28, isNotUndefined as isNotUndefined13, isUndefined as isUndefined4 } from "@wistia/type-guards";
15369
15406
  import { jsx as jsx304, jsxs as jsxs47 } from "react/jsx-runtime";
15370
15407
  var inlineErrorStyles = css36`
15371
15408
  grid-template-rows: 1fr auto;
@@ -15500,7 +15537,7 @@ var FormField = ({
15500
15537
  style: { gridArea: "input" },
15501
15538
  ...props
15502
15539
  };
15503
- if (isUndefined4(value) && isNotUndefined12(defaultValue)) {
15540
+ if (isUndefined4(value) && isNotUndefined13(defaultValue)) {
15504
15541
  childProps = {
15505
15542
  ...childProps,
15506
15543
  defaultValue
@@ -15509,10 +15546,10 @@ var FormField = ({
15509
15546
  if (isNotNil28(checkboxGroup)) {
15510
15547
  const computedName = isNotNil28(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
15511
15548
  const handleChange = (event) => {
15512
- if (isNotUndefined12(props.onChange)) {
15549
+ if (isNotUndefined13(props.onChange)) {
15513
15550
  props.onChange(event);
15514
15551
  }
15515
- if (isNotUndefined12(checkboxGroup.onChange)) {
15552
+ if (isNotUndefined13(checkboxGroup.onChange)) {
15516
15553
  checkboxGroup.onChange(event);
15517
15554
  }
15518
15555
  };
@@ -16694,7 +16731,7 @@ var ProgressBar = ({
16694
16731
  ProgressBar.displayName = "ProgressBar_UI";
16695
16732
 
16696
16733
  // src/components/Radio/Radio.tsx
16697
- import { isNonEmptyString as isNonEmptyString7, isNotUndefined as isNotUndefined13 } from "@wistia/type-guards";
16734
+ import { isNonEmptyString as isNonEmptyString7, isNotUndefined as isNotUndefined14 } from "@wistia/type-guards";
16698
16735
  import { forwardRef as forwardRef27, useId as useId5 } from "react";
16699
16736
  import { styled as styled84, css as css42 } from "styled-components";
16700
16737
  import { jsx as jsx321, jsxs as jsxs56 } from "react/jsx-runtime";
@@ -16805,7 +16842,7 @@ var Radio = forwardRef27(
16805
16842
  const contextValue = radioGroupContext?.value;
16806
16843
  const radioName = name ?? contextName;
16807
16844
  const handleOnChange = onChange ?? contextOnChange;
16808
- const isChecked = isNotUndefined13(value) && isNotUndefined13(contextValue) ? contextValue === value : checked;
16845
+ const isChecked = isNotUndefined14(value) && isNotUndefined14(contextValue) ? contextValue === value : checked;
16809
16846
  return /* @__PURE__ */ jsxs56(
16810
16847
  StyledRadioWrapper,
16811
16848
  {
@@ -16852,7 +16889,7 @@ import { forwardRef as forwardRef29 } from "react";
16852
16889
  // src/components/RadioCard/RadioCardRoot.tsx
16853
16890
  import { forwardRef as forwardRef28, useId as useId6 } from "react";
16854
16891
  import { styled as styled85, css as css43 } from "styled-components";
16855
- import { isNonEmptyString as isNonEmptyString8, isNotUndefined as isNotUndefined14 } from "@wistia/type-guards";
16892
+ import { isNonEmptyString as isNonEmptyString8, isNotUndefined as isNotUndefined15 } from "@wistia/type-guards";
16856
16893
  import { jsx as jsx322, jsxs as jsxs57 } from "react/jsx-runtime";
16857
16894
  var checkedStyles = css43`
16858
16895
  --wui-radio-card-border-color: var(--wui-color-focus-ring);
@@ -16981,7 +17018,7 @@ var RadioCardRoot = forwardRef28(
16981
17018
  const contextValue = radioGroupContext?.value;
16982
17019
  const radioName = name ?? contextName;
16983
17020
  const handleOnChange = onChange ?? contextOnChange;
16984
- const isChecked = isNotUndefined14(value) && isNotUndefined14(contextValue) ? contextValue === value : checked;
17021
+ const isChecked = isNotUndefined15(value) && isNotUndefined15(contextValue) ? contextValue === value : checked;
16985
17022
  return /* @__PURE__ */ jsxs57(
16986
17023
  StyledCard2,
16987
17024
  {
@@ -19224,6 +19261,7 @@ export {
19224
19261
  useOnClickOutside,
19225
19262
  usePreviousValue,
19226
19263
  useToast,
19227
- useWindowSize
19264
+ useWindowSize,
19265
+ validateWithYup
19228
19266
  };
19229
19267
  //# sourceMappingURL=index.js.map