@wistia/ui 0.10.3 → 0.10.4-beta.1ec201d3.a525932
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.cjs +219 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +27 -2
- package/dist/index.d.ts +27 -2
- package/dist/index.mjs +215 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3303,6 +3303,31 @@ declare const List: {
|
|
|
3303
3303
|
displayName: string;
|
|
3304
3304
|
};
|
|
3305
3305
|
|
|
3306
|
+
type BannerProps = ComponentPropsWithoutRef<'div'> & {
|
|
3307
|
+
bodyText: ReactNode;
|
|
3308
|
+
colorScheme?: ColorSchemeTypes;
|
|
3309
|
+
headingText?: string;
|
|
3310
|
+
icon?: ReactNode;
|
|
3311
|
+
image?: JSX.Element;
|
|
3312
|
+
onClose?: () => void;
|
|
3313
|
+
orientation?: 'auto' | 'horizontal' | 'vertical';
|
|
3314
|
+
primaryAction?: ReactNode;
|
|
3315
|
+
prominence?: 'default' | 'secondary';
|
|
3316
|
+
secondaryAction?: ReactNode;
|
|
3317
|
+
};
|
|
3318
|
+
/**
|
|
3319
|
+
* Banner - A versatile banner component for highlighting features with customizable layout
|
|
3320
|
+
*/
|
|
3321
|
+
declare const Banner: {
|
|
3322
|
+
({ bodyText, colorScheme, headingText, icon, image, onClose, orientation, primaryAction, prominence, secondaryAction, ...props }: BannerProps): JSX.Element;
|
|
3323
|
+
displayName: string;
|
|
3324
|
+
};
|
|
3325
|
+
|
|
3326
|
+
type ComboboxOptionProps = {
|
|
3327
|
+
value: string;
|
|
3328
|
+
children: ReactNode;
|
|
3329
|
+
};
|
|
3330
|
+
declare const ComboboxOption: ({ value, children }: ComboboxOptionProps) => react_jsx_runtime.JSX.Element;
|
|
3306
3331
|
type ComboboxProps = {
|
|
3307
3332
|
/**
|
|
3308
3333
|
* If true, the combox will fill the width of its parent
|
|
@@ -3325,7 +3350,7 @@ type ComboboxProps = {
|
|
|
3325
3350
|
*/
|
|
3326
3351
|
searchValue: string;
|
|
3327
3352
|
/**
|
|
3328
|
-
*
|
|
3353
|
+
* Callback that fires when a value is selected
|
|
3329
3354
|
*/
|
|
3330
3355
|
onChange: (value: string[]) => void;
|
|
3331
3356
|
/**
|
|
@@ -3335,4 +3360,4 @@ type ComboboxProps = {
|
|
|
3335
3360
|
};
|
|
3336
3361
|
declare const Combobox: ({ placeholder, value, onChange, searchValue, onSearchValueChange, children, fullWidth, }: ComboboxProps) => react_jsx_runtime.JSX.Element;
|
|
3337
3362
|
|
|
3338
|
-
export { ActionButton, type ActionButtonProps, Avatar, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, 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, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Combobox, type ComboboxProps, DataCard, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, Divider, EditableHeading, type EditableHeadingProps, Ellipsis, type EllipsisProps, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, InputClickToCopy, type InputClickToCopyProps, type InputProps, type KeyboardKeys, KeyboardShortcut, Label, type LabelProps, Link, type LinkProps, List, type ListProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, 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 UseToastProps, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, iconSizeMap, mergeRefs, mq, useActiveMq, useAriaLive, useBoolean, useClipboard, useElementObserver, useFocusTrap, useForceUpdate, useFormState, useIsHovered, useKey, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize };
|
|
3363
|
+
export { ActionButton, type ActionButtonProps, Avatar, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, Banner, 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, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Combobox, ComboboxOption, type ComboboxOptionProps, type ComboboxProps, DataCard, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, Divider, EditableHeading, type EditableHeadingProps, Ellipsis, type EllipsisProps, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, InputClickToCopy, type InputClickToCopyProps, type InputProps, type KeyboardKeys, KeyboardShortcut, Label, type LabelProps, Link, type LinkProps, List, type ListProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, 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 UseToastProps, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, iconSizeMap, mergeRefs, mq, useActiveMq, useAriaLive, useBoolean, useClipboard, useElementObserver, useFocusTrap, useForceUpdate, useFormState, useIsHovered, useKey, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize };
|
package/dist/index.d.ts
CHANGED
|
@@ -3303,6 +3303,31 @@ declare const List: {
|
|
|
3303
3303
|
displayName: string;
|
|
3304
3304
|
};
|
|
3305
3305
|
|
|
3306
|
+
type BannerProps = ComponentPropsWithoutRef<'div'> & {
|
|
3307
|
+
bodyText: ReactNode;
|
|
3308
|
+
colorScheme?: ColorSchemeTypes;
|
|
3309
|
+
headingText?: string;
|
|
3310
|
+
icon?: ReactNode;
|
|
3311
|
+
image?: JSX.Element;
|
|
3312
|
+
onClose?: () => void;
|
|
3313
|
+
orientation?: 'auto' | 'horizontal' | 'vertical';
|
|
3314
|
+
primaryAction?: ReactNode;
|
|
3315
|
+
prominence?: 'default' | 'secondary';
|
|
3316
|
+
secondaryAction?: ReactNode;
|
|
3317
|
+
};
|
|
3318
|
+
/**
|
|
3319
|
+
* Banner - A versatile banner component for highlighting features with customizable layout
|
|
3320
|
+
*/
|
|
3321
|
+
declare const Banner: {
|
|
3322
|
+
({ bodyText, colorScheme, headingText, icon, image, onClose, orientation, primaryAction, prominence, secondaryAction, ...props }: BannerProps): JSX.Element;
|
|
3323
|
+
displayName: string;
|
|
3324
|
+
};
|
|
3325
|
+
|
|
3326
|
+
type ComboboxOptionProps = {
|
|
3327
|
+
value: string;
|
|
3328
|
+
children: ReactNode;
|
|
3329
|
+
};
|
|
3330
|
+
declare const ComboboxOption: ({ value, children }: ComboboxOptionProps) => react_jsx_runtime.JSX.Element;
|
|
3306
3331
|
type ComboboxProps = {
|
|
3307
3332
|
/**
|
|
3308
3333
|
* If true, the combox will fill the width of its parent
|
|
@@ -3325,7 +3350,7 @@ type ComboboxProps = {
|
|
|
3325
3350
|
*/
|
|
3326
3351
|
searchValue: string;
|
|
3327
3352
|
/**
|
|
3328
|
-
*
|
|
3353
|
+
* Callback that fires when a value is selected
|
|
3329
3354
|
*/
|
|
3330
3355
|
onChange: (value: string[]) => void;
|
|
3331
3356
|
/**
|
|
@@ -3335,4 +3360,4 @@ type ComboboxProps = {
|
|
|
3335
3360
|
};
|
|
3336
3361
|
declare const Combobox: ({ placeholder, value, onChange, searchValue, onSearchValueChange, children, fullWidth, }: ComboboxProps) => react_jsx_runtime.JSX.Element;
|
|
3337
3362
|
|
|
3338
|
-
export { ActionButton, type ActionButtonProps, Avatar, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, 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, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Combobox, type ComboboxProps, DataCard, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, Divider, EditableHeading, type EditableHeadingProps, Ellipsis, type EllipsisProps, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, InputClickToCopy, type InputClickToCopyProps, type InputProps, type KeyboardKeys, KeyboardShortcut, Label, type LabelProps, Link, type LinkProps, List, type ListProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, 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 UseToastProps, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, iconSizeMap, mergeRefs, mq, useActiveMq, useAriaLive, useBoolean, useClipboard, useElementObserver, useFocusTrap, useForceUpdate, useFormState, useIsHovered, useKey, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize };
|
|
3363
|
+
export { ActionButton, type ActionButtonProps, Avatar, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, Banner, 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, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Combobox, ComboboxOption, type ComboboxOptionProps, type ComboboxProps, DataCard, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, Divider, EditableHeading, type EditableHeadingProps, Ellipsis, type EllipsisProps, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, InputClickToCopy, type InputClickToCopyProps, type InputProps, type KeyboardKeys, KeyboardShortcut, Label, type LabelProps, Link, type LinkProps, List, type ListProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, 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 UseToastProps, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, iconSizeMap, mergeRefs, mq, useActiveMq, useAriaLive, useBoolean, useClipboard, useElementObserver, useFocusTrap, useForceUpdate, useFormState, useIsHovered, useKey, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.10.
|
|
3
|
+
* @license @wistia/ui v0.10.4-beta.1ec201d3.a525932
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -13598,21 +13598,200 @@ var List = ({
|
|
|
13598
13598
|
};
|
|
13599
13599
|
List.displayName = "List";
|
|
13600
13600
|
|
|
13601
|
+
// src/components/Banner/Banner.tsx
|
|
13602
|
+
import { useEffect as useEffect13, useState as useState18, useMemo as useMemo11 } from "react";
|
|
13603
|
+
import styled78, { css as css43 } from "styled-components";
|
|
13604
|
+
import { isNil as isNil17, isNotNil as isNotNil39 } from "@wistia/type-guards";
|
|
13605
|
+
import { jsx as jsx277, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
13606
|
+
var BREAKPOINT_WIDTH = 600;
|
|
13607
|
+
var VERTICAL_BREAKPOINT_WIDTH = 360;
|
|
13608
|
+
var MIN_IMAGE_WIDTH = 400;
|
|
13609
|
+
var StyledBanner = styled78.div`
|
|
13610
|
+
--wui-banner-padding: var(--wui-space-04);
|
|
13611
|
+
--wui-banner-content-height: ${({ $contentHeight }) => $contentHeight}px;
|
|
13612
|
+
|
|
13613
|
+
display: flex;
|
|
13614
|
+
flex-direction: row;
|
|
13615
|
+
background: var(--wui-color-bg-surface-secondary);
|
|
13616
|
+
border-radius: var(--wui-border-radius-03);
|
|
13617
|
+
position: relative;
|
|
13618
|
+
overflow: hidden;
|
|
13619
|
+
align-items: center;
|
|
13620
|
+
|
|
13621
|
+
&[data-wui-banner-content-prominence='secondary'] {
|
|
13622
|
+
--wui-banner-padding: var(--wui-space-05);
|
|
13623
|
+
|
|
13624
|
+
box-shadow: inset 0 0 0 2px var(--wui-color-border);
|
|
13625
|
+
}
|
|
13626
|
+
|
|
13627
|
+
&:has([data-wui-banner-image]) {
|
|
13628
|
+
--wui-banner-padding: var(--wui-space-05);
|
|
13629
|
+
}
|
|
13630
|
+
|
|
13631
|
+
&[data-wui-banner-content-prominence='small'] {
|
|
13632
|
+
--wui-banner-padding: var(--wui-space-04);
|
|
13633
|
+
}
|
|
13634
|
+
|
|
13635
|
+
&[data-wui-banner-orientation='vertical'] {
|
|
13636
|
+
flex-direction: column;
|
|
13637
|
+
align-items: stretch;
|
|
13638
|
+
}
|
|
13639
|
+
|
|
13640
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
13641
|
+
`;
|
|
13642
|
+
var IconWrapper = styled78(Box)`
|
|
13643
|
+
--wui-banner-icon-size: var(--font-size, 24px);
|
|
13644
|
+
|
|
13645
|
+
${({ $iconPosition }) => $iconPosition === "inline" && css43`
|
|
13646
|
+
display: inline-block;
|
|
13647
|
+
vertical-align: text-bottom;
|
|
13648
|
+
margin-right: calc(var(--wui-banner-icon-size) / 3);
|
|
13649
|
+
`}
|
|
13650
|
+
|
|
13651
|
+
svg {
|
|
13652
|
+
color: var(--wui-color-icon);
|
|
13653
|
+
width: var(--wui-banner-icon-size);
|
|
13654
|
+
height: var(--wui-banner-icon-size);
|
|
13655
|
+
}
|
|
13656
|
+
`;
|
|
13657
|
+
var Banner = ({
|
|
13658
|
+
bodyText,
|
|
13659
|
+
colorScheme = "inherit",
|
|
13660
|
+
headingText,
|
|
13661
|
+
icon,
|
|
13662
|
+
image,
|
|
13663
|
+
onClose,
|
|
13664
|
+
orientation = "horizontal",
|
|
13665
|
+
primaryAction,
|
|
13666
|
+
prominence = "default",
|
|
13667
|
+
secondaryAction,
|
|
13668
|
+
...props
|
|
13669
|
+
}) => {
|
|
13670
|
+
const [containerRef, { width }] = useElementObserver();
|
|
13671
|
+
const [contentRef, { height: contentHeight }] = useElementObserver();
|
|
13672
|
+
const [isSmallContainer, setIsSmallContainer] = useState18(false);
|
|
13673
|
+
const [isVerticalLayout, setIsVerticalLayout] = useState18(orientation === "vertical");
|
|
13674
|
+
useEffect13(() => {
|
|
13675
|
+
const breakpoint = orientation === "vertical" ? VERTICAL_BREAKPOINT_WIDTH : BREAKPOINT_WIDTH;
|
|
13676
|
+
setIsSmallContainer(width <= breakpoint);
|
|
13677
|
+
if (orientation === "auto") {
|
|
13678
|
+
setIsVerticalLayout(width <= BREAKPOINT_WIDTH);
|
|
13679
|
+
}
|
|
13680
|
+
}, [width, orientation]);
|
|
13681
|
+
const hasImage = isNotNil39(image);
|
|
13682
|
+
const shouldShowImage = hasImage && (isVerticalLayout || width >= MIN_IMAGE_WIDTH);
|
|
13683
|
+
const iconPosition = useMemo11(() => {
|
|
13684
|
+
if (isNil17(icon)) return "none";
|
|
13685
|
+
if (isSmallContainer) return shouldShowImage ? "inline" : "above";
|
|
13686
|
+
return prominence === "secondary" ? "inline" : "above";
|
|
13687
|
+
}, [icon, isSmallContainer, shouldShowImage, prominence]);
|
|
13688
|
+
const contentDirection = useMemo11(
|
|
13689
|
+
() => !shouldShowImage && prominence === "default" && !isSmallContainer && !isVerticalLayout ? "row" : "column",
|
|
13690
|
+
[shouldShowImage, prominence, isSmallContainer, isVerticalLayout]
|
|
13691
|
+
);
|
|
13692
|
+
const headingVariant = isSmallContainer || prominence === "default" ? "heading5" : "heading3";
|
|
13693
|
+
const textVariant = prominence === "default" || isSmallContainer ? "body3" : "body2";
|
|
13694
|
+
const buttonSize = isSmallContainer ? "sm" : "md";
|
|
13695
|
+
const hasActions = isNotNil39(primaryAction) || isNotNil39(secondaryAction);
|
|
13696
|
+
return /* @__PURE__ */ jsxs50(
|
|
13697
|
+
StyledBanner,
|
|
13698
|
+
{
|
|
13699
|
+
...props,
|
|
13700
|
+
ref: containerRef,
|
|
13701
|
+
$colorScheme: colorScheme,
|
|
13702
|
+
$contentHeight: contentHeight,
|
|
13703
|
+
$width: !isSmallContainer && !isVerticalLayout ? width : void 0,
|
|
13704
|
+
"data-wui-banner-content-prominence": isSmallContainer ? "small" : prominence,
|
|
13705
|
+
"data-wui-banner-orientation": isVerticalLayout ? "vertical" : "horizontal",
|
|
13706
|
+
children: [
|
|
13707
|
+
shouldShowImage ? image : null,
|
|
13708
|
+
/* @__PURE__ */ jsxs50(
|
|
13709
|
+
Box,
|
|
13710
|
+
{
|
|
13711
|
+
ref: contentRef,
|
|
13712
|
+
alignItems: "stretch",
|
|
13713
|
+
direction: contentDirection,
|
|
13714
|
+
flexMode: "grow",
|
|
13715
|
+
gap: "space-04",
|
|
13716
|
+
style: { padding: "var(--wui-banner-padding)" },
|
|
13717
|
+
children: [
|
|
13718
|
+
iconPosition === "above" && /* @__PURE__ */ jsx277(
|
|
13719
|
+
IconWrapper,
|
|
13720
|
+
{
|
|
13721
|
+
$iconPosition: "above",
|
|
13722
|
+
alignSelf: "stretch",
|
|
13723
|
+
direction: "column",
|
|
13724
|
+
justifyContent: "center",
|
|
13725
|
+
children: icon
|
|
13726
|
+
}
|
|
13727
|
+
),
|
|
13728
|
+
/* @__PURE__ */ jsxs50(
|
|
13729
|
+
Box,
|
|
13730
|
+
{
|
|
13731
|
+
direction: "column",
|
|
13732
|
+
flexMode: contentDirection === "row" ? "grow" : "initial",
|
|
13733
|
+
gap: iconPosition === "inline" ? "space-01" : "space-00",
|
|
13734
|
+
justifyContent: "center",
|
|
13735
|
+
children: [
|
|
13736
|
+
isNotNil39(headingText) ? /* @__PURE__ */ jsxs50(Heading, { variant: headingVariant, children: [
|
|
13737
|
+
iconPosition === "inline" && /* @__PURE__ */ jsx277(IconWrapper, { $iconPosition: "inline", children: icon }),
|
|
13738
|
+
headingText
|
|
13739
|
+
] }) : null,
|
|
13740
|
+
/* @__PURE__ */ jsx277(Text, { variant: textVariant, children: bodyText })
|
|
13741
|
+
]
|
|
13742
|
+
}
|
|
13743
|
+
),
|
|
13744
|
+
hasActions ? /* @__PURE__ */ jsxs50(
|
|
13745
|
+
ButtonGroup,
|
|
13746
|
+
{
|
|
13747
|
+
buttonSize,
|
|
13748
|
+
collapseOnSmallScreens: false,
|
|
13749
|
+
style: { paddingRight: "var(--wui-space-02)" },
|
|
13750
|
+
children: [
|
|
13751
|
+
isNotNil39(primaryAction) && primaryAction,
|
|
13752
|
+
isNotNil39(secondaryAction) && secondaryAction
|
|
13753
|
+
]
|
|
13754
|
+
}
|
|
13755
|
+
) : null
|
|
13756
|
+
]
|
|
13757
|
+
}
|
|
13758
|
+
),
|
|
13759
|
+
isNotNil39(onClose) && /* @__PURE__ */ jsx277(
|
|
13760
|
+
IconButton,
|
|
13761
|
+
{
|
|
13762
|
+
label: "Close",
|
|
13763
|
+
onClick: onClose,
|
|
13764
|
+
size: "sm",
|
|
13765
|
+
style: {
|
|
13766
|
+
position: "absolute",
|
|
13767
|
+
top: "var(--wui-space-01)",
|
|
13768
|
+
right: "var(--wui-space-01)"
|
|
13769
|
+
},
|
|
13770
|
+
variant: "soft",
|
|
13771
|
+
children: /* @__PURE__ */ jsx277(Icon, { type: "close" })
|
|
13772
|
+
}
|
|
13773
|
+
)
|
|
13774
|
+
]
|
|
13775
|
+
}
|
|
13776
|
+
);
|
|
13777
|
+
};
|
|
13778
|
+
Banner.displayName = "Banner";
|
|
13779
|
+
|
|
13601
13780
|
// src/components/Combobox/Combobox.tsx
|
|
13602
13781
|
import * as Ariakit from "@ariakit/react";
|
|
13603
13782
|
import {
|
|
13604
|
-
useMemo as
|
|
13783
|
+
useMemo as useMemo12,
|
|
13605
13784
|
useRef as useRef17,
|
|
13606
|
-
useState as
|
|
13785
|
+
useState as useState19,
|
|
13607
13786
|
useTransition,
|
|
13608
|
-
useEffect as
|
|
13787
|
+
useEffect as useEffect14,
|
|
13609
13788
|
Children as Children6,
|
|
13610
13789
|
isValidElement as isValidElement2
|
|
13611
13790
|
} from "react";
|
|
13612
13791
|
import { matchSorter } from "match-sorter";
|
|
13613
|
-
import
|
|
13614
|
-
import { jsx as
|
|
13615
|
-
var ComboboxWapper =
|
|
13792
|
+
import styled79 from "styled-components";
|
|
13793
|
+
import { jsx as jsx278, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
13794
|
+
var ComboboxWapper = styled79.div`
|
|
13616
13795
|
${inputCss};
|
|
13617
13796
|
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
13618
13797
|
padding: var(--wui-input-vertical-padding) var(--wui-input-horizontal-padding);
|
|
@@ -13661,7 +13840,7 @@ var ComboboxWapper = styled78.div`
|
|
|
13661
13840
|
}
|
|
13662
13841
|
}
|
|
13663
13842
|
`;
|
|
13664
|
-
var ComboboxInput =
|
|
13843
|
+
var ComboboxInput = styled79(Ariakit.Combobox)`
|
|
13665
13844
|
appearance: none;
|
|
13666
13845
|
padding: 0;
|
|
13667
13846
|
width: 100%;
|
|
@@ -13676,7 +13855,7 @@ var ComboboxInput = styled78(Ariakit.Combobox)`
|
|
|
13676
13855
|
outline-width: 2px;
|
|
13677
13856
|
}
|
|
13678
13857
|
`;
|
|
13679
|
-
var ComboboxPopover =
|
|
13858
|
+
var ComboboxPopover = styled79(Ariakit.Popover)`
|
|
13680
13859
|
--wui-combobox-content-border: var(--wui-color-border);
|
|
13681
13860
|
--wui-combobox-content-bg: var(--wui-color-bg-surface);
|
|
13682
13861
|
--wui-combobox-content-border-radius: var(--wui-border-radius-02);
|
|
@@ -13701,7 +13880,7 @@ var ComboboxPopover = styled78(Ariakit.Popover)`
|
|
|
13701
13880
|
--item-opacity: 0.5;
|
|
13702
13881
|
}
|
|
13703
13882
|
`;
|
|
13704
|
-
var ComboboxItem2 =
|
|
13883
|
+
var ComboboxItem2 = styled79(Ariakit.ComboboxItem)`
|
|
13705
13884
|
${variantStyleMap2.body3};
|
|
13706
13885
|
display: flex;
|
|
13707
13886
|
padding: var(--wui-combobox-option-padding);
|
|
@@ -13726,10 +13905,21 @@ var ComboboxItem2 = styled78(Ariakit.ComboboxItem)`
|
|
|
13726
13905
|
background-color: transparent;
|
|
13727
13906
|
}
|
|
13728
13907
|
`;
|
|
13729
|
-
var NoResults =
|
|
13908
|
+
var NoResults = styled79.div`
|
|
13730
13909
|
gap: var(--wui-space-02);
|
|
13731
13910
|
`;
|
|
13732
13911
|
var POPOVER_WIDTH_OFFSET = 20;
|
|
13912
|
+
var ComboboxOption = ({ value, children }) => {
|
|
13913
|
+
return /* @__PURE__ */ jsx278(
|
|
13914
|
+
ComboboxItem2,
|
|
13915
|
+
{
|
|
13916
|
+
className: "combobox-item",
|
|
13917
|
+
focusOnHover: true,
|
|
13918
|
+
value,
|
|
13919
|
+
children
|
|
13920
|
+
}
|
|
13921
|
+
);
|
|
13922
|
+
};
|
|
13733
13923
|
var extractOptions = (children) => {
|
|
13734
13924
|
const options = {};
|
|
13735
13925
|
Children6.forEach(children, (child) => {
|
|
@@ -13749,10 +13939,10 @@ var Combobox2 = ({
|
|
|
13749
13939
|
fullWidth = true
|
|
13750
13940
|
}) => {
|
|
13751
13941
|
const [isPending, startTransition] = useTransition();
|
|
13752
|
-
const [wrapperWidth, setWrapperWidth] =
|
|
13942
|
+
const [wrapperWidth, setWrapperWidth] = useState19("auto");
|
|
13753
13943
|
const comboboxWrapperRef = useRef17(null);
|
|
13754
|
-
const options =
|
|
13755
|
-
|
|
13944
|
+
const options = useMemo12(() => extractOptions(children), [children]);
|
|
13945
|
+
useEffect14(() => {
|
|
13756
13946
|
const comboboxWrapper = comboboxWrapperRef.current;
|
|
13757
13947
|
if (comboboxWrapper) {
|
|
13758
13948
|
const updateWidthVariable = () => {
|
|
@@ -13770,10 +13960,10 @@ var Combobox2 = ({
|
|
|
13770
13960
|
const handleRemoveValue = (valueToRemove) => {
|
|
13771
13961
|
onChange(value.filter((val) => val !== valueToRemove));
|
|
13772
13962
|
};
|
|
13773
|
-
const matches =
|
|
13963
|
+
const matches = useMemo12(() => {
|
|
13774
13964
|
return matchSorter(Object.keys(options), searchValue);
|
|
13775
13965
|
}, [options, searchValue]);
|
|
13776
|
-
return /* @__PURE__ */
|
|
13966
|
+
return /* @__PURE__ */ jsxs51(
|
|
13777
13967
|
Ariakit.ComboboxProvider,
|
|
13778
13968
|
{
|
|
13779
13969
|
selectedValue: value,
|
|
@@ -13784,13 +13974,13 @@ var Combobox2 = ({
|
|
|
13784
13974
|
});
|
|
13785
13975
|
},
|
|
13786
13976
|
children: [
|
|
13787
|
-
/* @__PURE__ */
|
|
13977
|
+
/* @__PURE__ */ jsxs51(
|
|
13788
13978
|
ComboboxWapper,
|
|
13789
13979
|
{
|
|
13790
13980
|
ref: comboboxWrapperRef,
|
|
13791
13981
|
$fullWidth: fullWidth,
|
|
13792
13982
|
children: [
|
|
13793
|
-
value.map((selectedValue) => /* @__PURE__ */
|
|
13983
|
+
value.map((selectedValue) => /* @__PURE__ */ jsx278(
|
|
13794
13984
|
Tag,
|
|
13795
13985
|
{
|
|
13796
13986
|
href: "https://example.com",
|
|
@@ -13800,11 +13990,11 @@ var Combobox2 = ({
|
|
|
13800
13990
|
},
|
|
13801
13991
|
selectedValue
|
|
13802
13992
|
)),
|
|
13803
|
-
/* @__PURE__ */
|
|
13993
|
+
/* @__PURE__ */ jsx278(ComboboxInput, { placeholder })
|
|
13804
13994
|
]
|
|
13805
13995
|
}
|
|
13806
13996
|
),
|
|
13807
|
-
/* @__PURE__ */
|
|
13997
|
+
/* @__PURE__ */ jsxs51(
|
|
13808
13998
|
ComboboxPopover,
|
|
13809
13999
|
{
|
|
13810
14000
|
"aria-busy": isPending,
|
|
@@ -13814,14 +14004,14 @@ var Combobox2 = ({
|
|
|
13814
14004
|
width: wrapperWidth
|
|
13815
14005
|
},
|
|
13816
14006
|
children: [
|
|
13817
|
-
matches.map((match) => /* @__PURE__ */
|
|
14007
|
+
matches.map((match) => /* @__PURE__ */ jsxs51(
|
|
13818
14008
|
ComboboxItem2,
|
|
13819
14009
|
{
|
|
13820
14010
|
className: "combobox-item",
|
|
13821
14011
|
focusOnHover: true,
|
|
13822
14012
|
value: match,
|
|
13823
14013
|
children: [
|
|
13824
|
-
/* @__PURE__ */
|
|
14014
|
+
/* @__PURE__ */ jsx278(
|
|
13825
14015
|
Icon,
|
|
13826
14016
|
{
|
|
13827
14017
|
size: "sm",
|
|
@@ -13836,7 +14026,7 @@ var Combobox2 = ({
|
|
|
13836
14026
|
},
|
|
13837
14027
|
match
|
|
13838
14028
|
)),
|
|
13839
|
-
!matches.length && /* @__PURE__ */
|
|
14029
|
+
!matches.length && /* @__PURE__ */ jsx278(NoResults, { children: "No results found" })
|
|
13840
14030
|
]
|
|
13841
14031
|
}
|
|
13842
14032
|
)
|
|
@@ -13848,6 +14038,7 @@ export {
|
|
|
13848
14038
|
ActionButton,
|
|
13849
14039
|
Avatar,
|
|
13850
14040
|
Badge,
|
|
14041
|
+
Banner,
|
|
13851
14042
|
Box,
|
|
13852
14043
|
Breadcrumb,
|
|
13853
14044
|
Breadcrumbs,
|
|
@@ -13864,6 +14055,7 @@ export {
|
|
|
13864
14055
|
CollapsibleTrigger,
|
|
13865
14056
|
ColorSchemeWrapper,
|
|
13866
14057
|
Combobox2 as Combobox,
|
|
14058
|
+
ComboboxOption,
|
|
13867
14059
|
DataCard,
|
|
13868
14060
|
DataCardTrend,
|
|
13869
14061
|
DataCards,
|