@wistia/ui 0.22.2-beta.21d69964.f14fca2 → 0.22.2-beta.24175277.1d1e49f

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.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.22.2-beta.21d69964.f14fca2
3
+ * @license @wistia/ui v0.22.2-beta.24175277.1d1e49f
4
4
  *
5
5
  * Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
6
6
  *
@@ -6359,50 +6359,6 @@ const Breadcrumb = ({ icon, href, children, ...props }) => {
6359
6359
  })] });
6360
6360
  };
6361
6361
  //#endregion
6362
- //#region src/components/Divider/Divider.tsx
6363
- const horizontalBorderCss = css`
6364
- border-top-color: var(--wui-color-border);
6365
- border-top-style: solid;
6366
- border-top-width: 1px;
6367
- clear: both; /* for horizontal dividers, ensure it clears any floats */
6368
- height: 0;
6369
- margin-left: var(--wui-divider-inset);
6370
- margin-right: var(--wui-divider-inset);
6371
- `;
6372
- const verticalBorderCss = css`
6373
- background-color: var(--wui-color-border);
6374
- max-width: 1px;
6375
- min-height: 100%;
6376
- width: 1px;
6377
- margin-top: var(--wui-divider-inset);
6378
- margin-bottom: var(--wui-divider-inset);
6379
- `;
6380
- const DividerComponent = styled.div`
6381
- ${({ $orientation }) => {
6382
- switch ($orientation) {
6383
- case "vertical": return verticalBorderCss;
6384
- default: return horizontalBorderCss;
6385
- }
6386
- }}
6387
- --wui-divider-inset: ${({ $inset }) => `var(--wui-${$inset})`};
6388
-
6389
- align-self: stretch;
6390
- `;
6391
- /**
6392
- * A line used to visually separate content; note that dividers have no external margin/spacing on their own.
6393
- */
6394
- const Divider = ({ orientation = "horizontal", inset = "space-00", ...props }) => {
6395
- const responsiveOrientation = useResponsiveProp(orientation);
6396
- return /* @__PURE__ */ jsx(DividerComponent, {
6397
- $inset: useResponsiveProp(inset),
6398
- $orientation: responsiveOrientation,
6399
- "aria-orientation": responsiveOrientation,
6400
- role: "separator",
6401
- ...props
6402
- });
6403
- };
6404
- Divider.displayName = "Divider_UI";
6405
- //#endregion
6406
6362
  //#region src/components/Calendar/CalendarNavigation.tsx
6407
6363
  const StyledNav = styled.div`
6408
6364
  position: absolute;
@@ -6430,15 +6386,6 @@ const CalendarNavigation = ({ onPreviousClick, onNextClick, previousMonth, nextM
6430
6386
  };
6431
6387
  CalendarNavigation.displayName = "CalendarNavigation_UI";
6432
6388
  //#endregion
6433
- //#region src/components/Calendar/CalendarContext.tsx
6434
- const CalendarContext = createContext(null);
6435
- const CalendarProvider = CalendarContext.Provider;
6436
- const useCalendarContext = () => {
6437
- const context = useContext(CalendarContext);
6438
- if (!context) throw new Error("CalendarPreset must be rendered inside a Calendar");
6439
- return context;
6440
- };
6441
- //#endregion
6442
6389
  //#region src/components/Calendar/calendarStyles.ts
6443
6390
  const calendarCss = css`
6444
6391
  /* stylelint-disable selector-class-pattern, no-descending-specificity --
@@ -6447,10 +6394,6 @@ const calendarCss = css`
6447
6394
  descending-specificity rule is disabled because state rules (.rdp-today, .rdp-selected,
6448
6395
  .rdp-range_*) intentionally layer on top of the base .rdp-day_button block. */
6449
6396
 
6450
- display: flex;
6451
- align-items: flex-start;
6452
- gap: var(--wui-space-04);
6453
-
6454
6397
  /* Root */
6455
6398
  .rdp-root {
6456
6399
  --rdp-day-size: 40px;
@@ -6626,37 +6569,6 @@ const calendarCss = css`
6626
6569
  }
6627
6570
  `;
6628
6571
  //#endregion
6629
- //#region src/components/Stack/Stack.tsx
6630
- const DEFAULT_ELEMENT$1 = "div";
6631
- const StyledStack = styled.div`
6632
- display: flex;
6633
- flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
6634
- gap: ${({ $gap }) => `var(--wui-${$gap})`};
6635
- align-items: ${({ $alignItems }) => $alignItems};
6636
- ${({ $paddingX }) => $paddingX && `padding-left: var(--wui-${$paddingX}); padding-right: var(--wui-${$paddingX});`}
6637
- ${({ $paddingY }) => $paddingY && `padding-top: var(--wui-${$paddingY}); padding-bottom: var(--wui-${$paddingY});`}
6638
- `;
6639
- const StackComponent = forwardRef(({ renderAs, direction = "vertical", gap = "space-02", alignItems = "stretch", padding, ...props }, ref) => {
6640
- const responsiveGap = useResponsiveProp(gap);
6641
- const responsiveDirection = useResponsiveProp(direction);
6642
- return /* @__PURE__ */ jsx(StyledStack, {
6643
- ref,
6644
- $alignItems: useResponsiveProp(alignItems),
6645
- $direction: responsiveDirection,
6646
- $gap: responsiveGap,
6647
- $paddingX: useResponsiveProp(padding?.x),
6648
- $paddingY: useResponsiveProp(padding?.y),
6649
- as: renderAs ?? DEFAULT_ELEMENT$1,
6650
- ...props
6651
- });
6652
- });
6653
- StackComponent.displayName = "Stack_UI";
6654
- /**
6655
- * Used to layout its children in a vertical or horizontal stack. The gap between each item in the stack can be customized.
6656
- * This allows for layouting children in a consistent way without needing to manually add margins or padding.
6657
- */
6658
- const Stack = makePolymorphic(StackComponent);
6659
- //#endregion
6660
6572
  //#region src/components/Calendar/Calendar.tsx
6661
6573
  const StyledCalendarWrapper = styled.div`
6662
6574
  ${calendarCss}
@@ -6668,19 +6580,12 @@ const StyledCalendarWrapper = styled.div`
6668
6580
  const stripUndefined = (obj) => Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== void 0));
6669
6581
  /**
6670
6582
  * A calendar grid for selecting dates or date ranges. Built on
6671
- * react-day-picker and styled with WUI design tokens. Pass `CalendarPreset`
6672
- * children to render preset shortcuts next to the grid.
6583
+ * react-day-picker and styled with WUI design tokens.
6673
6584
  */
6674
6585
  const Calendar = (props) => {
6675
- const { mode, selected, onSelect, month, defaultMonth, onMonthChange, startMonth, endMonth, disabled, numberOfMonths = 1, showOutsideDays, weekStartsOn, children, ...rest } = props;
6586
+ const { mode, selected, onSelect, month, defaultMonth, onMonthChange, startMonth, endMonth, disabled, numberOfMonths = 1, showOutsideDays, weekStartsOn, ...rest } = props;
6676
6587
  const rangeMin = mode === "range" ? props.min : void 0;
6677
6588
  const rangeMax = mode === "range" ? props.max : void 0;
6678
- const [internalMonth, setInternalMonth] = useState(() => month ?? defaultMonth);
6679
- const displayMonth = month ?? internalMonth;
6680
- const handleMonthChange = useCallback((nextMonth) => {
6681
- setInternalMonth(nextMonth);
6682
- onMonthChange?.(nextMonth);
6683
- }, [onMonthChange]);
6684
6589
  const dayPickerProps = stripUndefined({
6685
6590
  ...mode === "range" ? {
6686
6591
  mode: "range",
@@ -6694,110 +6599,22 @@ const Calendar = (props) => {
6694
6599
  onSelect
6695
6600
  },
6696
6601
  components: { Nav: CalendarNavigation },
6602
+ defaultMonth,
6697
6603
  disabled,
6698
6604
  endMonth,
6699
- month: displayMonth,
6605
+ month,
6700
6606
  numberOfMonths,
6701
- onMonthChange: handleMonthChange,
6607
+ onMonthChange,
6702
6608
  showOutsideDays,
6703
6609
  startMonth,
6704
6610
  weekStartsOn
6705
6611
  });
6706
- const contextValue = useMemo(() => ({
6707
- selected,
6708
- onSelectPreset: (value) => {
6709
- if (value instanceof Date) {
6710
- onSelect?.(value);
6711
- handleMonthChange(value);
6712
- return;
6713
- }
6714
- onSelect?.(value);
6715
- if (value.from) handleMonthChange(value.from);
6716
- }
6717
- }), [
6718
- selected,
6719
- onSelect,
6720
- handleMonthChange
6721
- ]);
6722
- const hasPresets = Children.toArray(children).length > 0;
6723
- return /* @__PURE__ */ jsx(CalendarProvider, {
6724
- value: contextValue,
6725
- children: /* @__PURE__ */ jsxs(StyledCalendarWrapper, {
6726
- ...rest,
6727
- children: [hasPresets ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Stack, {
6728
- direction: "vertical",
6729
- gap: "space-02",
6730
- children
6731
- }), /* @__PURE__ */ jsx(Divider, { orientation: "vertical" })] }) : null, /* @__PURE__ */ jsx(DayPicker, { ...dayPickerProps })]
6732
- })
6733
- });
6734
- };
6735
- Calendar.displayName = "Calendar_UI";
6736
- //#endregion
6737
- //#region src/components/Calendar/CalendarPreset.tsx
6738
- const StyledPreset = styled.button`
6739
- background: none;
6740
- border: none;
6741
- border-radius: var(--wui-border-radius-02);
6742
- color: var(--wui-color-text);
6743
- cursor: pointer;
6744
- font-family: var(--wui-typography-label-3-family);
6745
- font-size: var(--wui-typography-label-3-size);
6746
- font-weight: var(--wui-typography-label-3-weight);
6747
- line-height: var(--wui-typography-label-3-line-height);
6748
- padding: var(--wui-space-02);
6749
- text-align: start;
6750
- transition: background-color var(--wui-motion-duration-01) var(--wui-motion-ease);
6751
- white-space: nowrap;
6752
-
6753
- &:hover:not([disabled]) {
6754
- background-color: var(--wui-color-bg-surface-hover);
6755
- }
6756
-
6757
- &:focus-visible {
6758
- outline: 2px solid var(--wui-color-focus-ring);
6759
- outline-offset: 1px;
6760
- }
6761
-
6762
- &[aria-pressed='true'] {
6763
- background-color: var(--wui-color-bg-surface-selected);
6764
- color: var(--wui-color-text-selected);
6765
-
6766
- &:hover:not([disabled]) {
6767
- background-color: var(--wui-color-bg-surface-selected-hover);
6768
- }
6769
- }
6770
- `;
6771
- const isDateRange = (value) => !(value instanceof Date);
6772
- const isSameDay = (left, right) => {
6773
- if (!left || !right) return false;
6774
- return left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() === right.getDate();
6775
- };
6776
- const isActivePreset = (selected, value) => {
6777
- if (!selected) return false;
6778
- if (isDateRange(value)) {
6779
- if (selected instanceof Date) return false;
6780
- return isSameDay(selected.from, value.from) && isSameDay(selected.to, value.to);
6781
- }
6782
- if (selected instanceof Date) return isSameDay(selected, value);
6783
- return false;
6784
- };
6785
- /**
6786
- * A single preset button rendered inside a `Calendar`. Clicking a preset
6787
- * selects its `value` and navigates the calendar to show it.
6788
- */
6789
- const CalendarPreset = ({ value, children, ...rest }) => {
6790
- const { selected, onSelectPreset } = useCalendarContext();
6791
- const isActive = isActivePreset(selected, value);
6792
- return /* @__PURE__ */ jsx(StyledPreset, {
6612
+ return /* @__PURE__ */ jsx(StyledCalendarWrapper, {
6793
6613
  ...rest,
6794
- "aria-pressed": isActive,
6795
- onClick: () => onSelectPreset(value),
6796
- type: "button",
6797
- children
6614
+ children: /* @__PURE__ */ jsx(DayPicker, { ...dayPickerProps })
6798
6615
  });
6799
6616
  };
6800
- CalendarPreset.displayName = "CalendarPreset_UI";
6617
+ Calendar.displayName = "Calendar_UI";
6801
6618
  //#endregion
6802
6619
  //#region src/components/Card/Card.tsx
6803
6620
  const StyledCard$1 = styled(Box)`
@@ -6957,6 +6774,37 @@ const FormControlLabel = ({ align = "left", label, description, disabled = false
6957
6774
  };
6958
6775
  FormControlLabel.displayName = "FormControlLabel";
6959
6776
  //#endregion
6777
+ //#region src/components/Stack/Stack.tsx
6778
+ const DEFAULT_ELEMENT$1 = "div";
6779
+ const StyledStack = styled.div`
6780
+ display: flex;
6781
+ flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
6782
+ gap: ${({ $gap }) => `var(--wui-${$gap})`};
6783
+ align-items: ${({ $alignItems }) => $alignItems};
6784
+ ${({ $paddingX }) => $paddingX && `padding-left: var(--wui-${$paddingX}); padding-right: var(--wui-${$paddingX});`}
6785
+ ${({ $paddingY }) => $paddingY && `padding-top: var(--wui-${$paddingY}); padding-bottom: var(--wui-${$paddingY});`}
6786
+ `;
6787
+ const StackComponent = forwardRef(({ renderAs, direction = "vertical", gap = "space-02", alignItems = "stretch", padding, ...props }, ref) => {
6788
+ const responsiveGap = useResponsiveProp(gap);
6789
+ const responsiveDirection = useResponsiveProp(direction);
6790
+ return /* @__PURE__ */ jsx(StyledStack, {
6791
+ ref,
6792
+ $alignItems: useResponsiveProp(alignItems),
6793
+ $direction: responsiveDirection,
6794
+ $gap: responsiveGap,
6795
+ $paddingX: useResponsiveProp(padding?.x),
6796
+ $paddingY: useResponsiveProp(padding?.y),
6797
+ as: renderAs ?? DEFAULT_ELEMENT$1,
6798
+ ...props
6799
+ });
6800
+ });
6801
+ StackComponent.displayName = "Stack_UI";
6802
+ /**
6803
+ * Used to layout its children in a vertical or horizontal stack. The gap between each item in the stack can be customized.
6804
+ * This allows for layouting children in a consistent way without needing to manually add margins or padding.
6805
+ */
6806
+ const Stack = makePolymorphic(StackComponent);
6807
+ //#endregion
6960
6808
  //#region src/components/FormGroup/FormGroup.tsx
6961
6809
  const StyledFieldset = styled.fieldset`
6962
6810
  padding: 0;
@@ -10588,6 +10436,50 @@ const DataListItemValue = (props) => {
10588
10436
  };
10589
10437
  DataListItemValue.displayName = "DataListItemValue_UI";
10590
10438
  //#endregion
10439
+ //#region src/components/Divider/Divider.tsx
10440
+ const horizontalBorderCss = css`
10441
+ border-top-color: var(--wui-color-border);
10442
+ border-top-style: solid;
10443
+ border-top-width: 1px;
10444
+ clear: both; /* for horizontal dividers, ensure it clears any floats */
10445
+ height: 0;
10446
+ margin-left: var(--wui-divider-inset);
10447
+ margin-right: var(--wui-divider-inset);
10448
+ `;
10449
+ const verticalBorderCss = css`
10450
+ background-color: var(--wui-color-border);
10451
+ max-width: 1px;
10452
+ min-height: 100%;
10453
+ width: 1px;
10454
+ margin-top: var(--wui-divider-inset);
10455
+ margin-bottom: var(--wui-divider-inset);
10456
+ `;
10457
+ const DividerComponent = styled.div`
10458
+ ${({ $orientation }) => {
10459
+ switch ($orientation) {
10460
+ case "vertical": return verticalBorderCss;
10461
+ default: return horizontalBorderCss;
10462
+ }
10463
+ }}
10464
+ --wui-divider-inset: ${({ $inset }) => `var(--wui-${$inset})`};
10465
+
10466
+ align-self: stretch;
10467
+ `;
10468
+ /**
10469
+ * A line used to visually separate content; note that dividers have no external margin/spacing on their own.
10470
+ */
10471
+ const Divider = ({ orientation = "horizontal", inset = "space-00", ...props }) => {
10472
+ const responsiveOrientation = useResponsiveProp(orientation);
10473
+ return /* @__PURE__ */ jsx(DividerComponent, {
10474
+ $inset: useResponsiveProp(inset),
10475
+ $orientation: responsiveOrientation,
10476
+ "aria-orientation": responsiveOrientation,
10477
+ role: "separator",
10478
+ ...props
10479
+ });
10480
+ };
10481
+ Divider.displayName = "Divider_UI";
10482
+ //#endregion
10591
10483
  //#region src/components/EditableHeading/EditableHeading.tsx
10592
10484
  const StyledInput$1 = styled(Input)`
10593
10485
  &:not([rows]) {
@@ -14760,6 +14652,6 @@ const WistiaLogo = ({ description = void 0, height = 100, hoverColor = void 0, h
14760
14652
  };
14761
14653
  WistiaLogo.displayName = "WistiaLogo_UI";
14762
14654
  //#endregion
14763
- export { ActionButton, Avatar, Badge, Banner, Box, Breadcrumb, Breadcrumbs, Button, ButtonGroup, Calendar, CalendarPreset, Card, Center, Checkbox, CheckboxGroup, CheckboxMenuItem, ClickRegion, Collapsible, CollapsibleContent, CollapsibleTrigger, CollapsibleTriggerIcon, ColorGrid, ColorGridOption, ColorList, ColorListGroup, ColorListOption, ColorPicker, ColorPickerPopoverContent, ColorPickerSection, ColorPickerTrigger, ColorSchemeWrapper, Combobox, ComboboxOption, ContextMenu, ContrastControls, CustomizableThemeWrapper, DataCard, DataCardHoverArrow, DataCardTrend, DataCards, DataList, DataListItem, DataListItemLabel, DataListItemValue, Divider, EditableHeading, EditableText, EditableTextCancelButton, EditableTextContext, EditableTextDisplay, EditableTextInput, EditableTextLabel, EditableTextRoot, EditableTextSubmitButton, EditableTextTrigger, Ellipsis, FeatureCard, FeatureCardImage, FileAmountLimitValidator, FileSizeValidator, FileTypeValidator, FilterMenu, FilterMenuItem, Form, FormErrorSummary, FormField, FormGroup, Grid, Heading, HexColorInput, HueSlider, Icon, IconButton, Image, ImageDimensionsValidator, Input, InputClickToCopy, InputPassword, KeyboardShortcut, Label, Link, List, ListItem, Mark, Markdown, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Meter, Modal, ModalCallout, ModalCallouts, PersistentFileAmountLimitValidator, Popover, PreviewCard, ProgressBar, Radio, RadioCard, RadioCardImage, RadioGroup, RadioMenuItem, SaturationAndValuePicker, ScreenReaderOnly, ScrollArea, SegmentedControl, SegmentedControlItem, Select, SelectOption, SelectOptionGroup, Slider, SplitButton, Stack, SubMenu, Switch, Table, TableBody, TableCell, TableFoot, TableHead, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Text, Thumbnail, ThumbnailBadge, ThumbnailCollage, Tooltip, UIProvider, ValueNameOrHexCode, ValueSwatch, WistiaLogo, calculateContrast, coerceToBoolean, colorSchemeOptions, copyToClipboard, dateTime, iconSizeMap, isKeyboardKey, mergeRefs, mq, useActiveMq, useAriaLive, useBoolean, useClipboard, useElementObserver, useFilePicker, useFocusTrap, useForceUpdate, useFormState, useImperativeFilePicker, useIsHovered, useKey, useKeyPress, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize, validateWithYup };
14655
+ export { ActionButton, Avatar, Badge, Banner, Box, Breadcrumb, Breadcrumbs, Button, ButtonGroup, Calendar, Card, Center, Checkbox, CheckboxGroup, CheckboxMenuItem, ClickRegion, Collapsible, CollapsibleContent, CollapsibleTrigger, CollapsibleTriggerIcon, ColorGrid, ColorGridOption, ColorList, ColorListGroup, ColorListOption, ColorPicker, ColorPickerPopoverContent, ColorPickerSection, ColorPickerTrigger, ColorSchemeWrapper, Combobox, ComboboxOption, ContextMenu, ContrastControls, CustomizableThemeWrapper, DataCard, DataCardHoverArrow, DataCardTrend, DataCards, DataList, DataListItem, DataListItemLabel, DataListItemValue, Divider, EditableHeading, EditableText, EditableTextCancelButton, EditableTextContext, EditableTextDisplay, EditableTextInput, EditableTextLabel, EditableTextRoot, EditableTextSubmitButton, EditableTextTrigger, Ellipsis, FeatureCard, FeatureCardImage, FileAmountLimitValidator, FileSizeValidator, FileTypeValidator, FilterMenu, FilterMenuItem, Form, FormErrorSummary, FormField, FormGroup, Grid, Heading, HexColorInput, HueSlider, Icon, IconButton, Image, ImageDimensionsValidator, Input, InputClickToCopy, InputPassword, KeyboardShortcut, Label, Link, List, ListItem, Mark, Markdown, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Meter, Modal, ModalCallout, ModalCallouts, PersistentFileAmountLimitValidator, Popover, PreviewCard, ProgressBar, Radio, RadioCard, RadioCardImage, RadioGroup, RadioMenuItem, SaturationAndValuePicker, ScreenReaderOnly, ScrollArea, SegmentedControl, SegmentedControlItem, Select, SelectOption, SelectOptionGroup, Slider, SplitButton, Stack, SubMenu, Switch, Table, TableBody, TableCell, TableFoot, TableHead, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Text, Thumbnail, ThumbnailBadge, ThumbnailCollage, Tooltip, UIProvider, ValueNameOrHexCode, ValueSwatch, WistiaLogo, calculateContrast, coerceToBoolean, colorSchemeOptions, copyToClipboard, dateTime, iconSizeMap, isKeyboardKey, mergeRefs, mq, useActiveMq, useAriaLive, useBoolean, useClipboard, useElementObserver, useFilePicker, useFocusTrap, useForceUpdate, useFormState, useImperativeFilePicker, useIsHovered, useKey, useKeyPress, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize, validateWithYup };
14764
14656
 
14765
14657
  //# sourceMappingURL=index.js.map