@aviala-design/spiral 0.1.0 → 0.2.0
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 +291 -71
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +46 -1
- package/dist/index.d.ts +46 -1
- package/dist/index.js +293 -75
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1577,6 +1577,51 @@ type NavigationActionsProps = HTMLAttributes<HTMLDivElement>;
|
|
|
1577
1577
|
declare const NavigationActions: react.ForwardRefExoticComponent<NavigationActionsProps & react.RefAttributes<HTMLDivElement>>;
|
|
1578
1578
|
type NavigationActionsSlotProps = HTMLAttributes<HTMLDivElement>;
|
|
1579
1579
|
declare const NavigationActionsSlot: react.ForwardRefExoticComponent<NavigationActionsSlotProps & react.RefAttributes<HTMLDivElement>>;
|
|
1580
|
+
type NavigationItemMenuProps = {
|
|
1581
|
+
/** Selected child value — similar to Select `value`. */
|
|
1582
|
+
value?: string;
|
|
1583
|
+
defaultValue?: string;
|
|
1584
|
+
onValueChange?: (value: string) => void;
|
|
1585
|
+
open?: boolean;
|
|
1586
|
+
onOpenChange?: (open: boolean) => void;
|
|
1587
|
+
children: ReactNode;
|
|
1588
|
+
};
|
|
1589
|
+
declare function NavigationItemMenu({ value: valueProp, defaultValue, onValueChange, open: openProp, onOpenChange, children, }: NavigationItemMenuProps): react.JSX.Element;
|
|
1590
|
+
type NavigationItemMenuTriggerProps = Omit<ComponentPropsWithoutRef<"button">, "children"> & {
|
|
1591
|
+
/** Defaults to highlighted when the menu has a selected child. */
|
|
1592
|
+
active?: boolean;
|
|
1593
|
+
leftIcon?: ReactNode;
|
|
1594
|
+
rightIcon?: ReactNode;
|
|
1595
|
+
children: ReactNode;
|
|
1596
|
+
};
|
|
1597
|
+
/** Parent item — renders as a Navigation tab item and anchors the flyout. */
|
|
1598
|
+
declare const NavigationItemMenuTrigger: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "children"> & {
|
|
1599
|
+
/** Defaults to highlighted when the menu has a selected child. */
|
|
1600
|
+
active?: boolean;
|
|
1601
|
+
leftIcon?: ReactNode;
|
|
1602
|
+
rightIcon?: ReactNode;
|
|
1603
|
+
children: ReactNode;
|
|
1604
|
+
} & react.RefAttributes<HTMLButtonElement>>;
|
|
1605
|
+
type NavigationItemMenuContentProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>;
|
|
1606
|
+
/** Flyout surface — right of the item in vertical, below it in horizontal. */
|
|
1607
|
+
declare const NavigationItemMenuContent: react.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1608
|
+
type NavigationItemMenuItemProps = Omit<ComponentPropsWithoutRef<"button">, "children" | "value"> & {
|
|
1609
|
+
value: string;
|
|
1610
|
+
/** Defaults to highlighted when it matches the menu value. */
|
|
1611
|
+
selected?: boolean;
|
|
1612
|
+
leftIcon?: ReactNode;
|
|
1613
|
+
rightIcon?: ReactNode;
|
|
1614
|
+
children: ReactNode;
|
|
1615
|
+
};
|
|
1616
|
+
/** Child option — highlighted when selected, no check icon by default. */
|
|
1617
|
+
declare const NavigationItemMenuItem: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "children" | "value"> & {
|
|
1618
|
+
value: string;
|
|
1619
|
+
/** Defaults to highlighted when it matches the menu value. */
|
|
1620
|
+
selected?: boolean;
|
|
1621
|
+
leftIcon?: ReactNode;
|
|
1622
|
+
rightIcon?: ReactNode;
|
|
1623
|
+
children: ReactNode;
|
|
1624
|
+
} & react.RefAttributes<HTMLButtonElement>>;
|
|
1580
1625
|
|
|
1581
1626
|
/** Figma Components → Information Collect → Slider (384:21585) */
|
|
1582
1627
|
type SliderSize = "default" | "big";
|
|
@@ -1914,4 +1959,4 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
1914
1959
|
*/
|
|
1915
1960
|
declare function initKeyboardFocus(): void;
|
|
1916
1961
|
|
|
1917
|
-
export { Alert, type AlertAppearance, type AlertProps, type AlertSize, type AlertType, Anchor, type AnchorIndentLevel, AnchorItem, type AnchorItemProps, type AnchorProps, Avatar, type AvatarContent, type AvatarLevel, type AvatarProps, Badge, type BadgeLevel, type BadgeLineHeightFix, type BadgeProps, type BadgeStyle, Breadcrumb, BreadcrumbEllipsis, BreadcrumbEllipsisItem, type BreadcrumbEllipsisItemProps, type BreadcrumbEllipsisProps, BreadcrumbItem, type BreadcrumbItemProps, type BreadcrumbProps, BreadcrumbSeparator, type BreadcrumbSeparatorProps, type BreadcrumbSize, Button, type ButtonMode, type ButtonProps, type ButtonSize, Card, CardBody, type CardBodyProps, CardBottom, type CardBottomProps, CardHead, type CardHeadProps, type CardProps, type CardSlotType, Cascader, CascaderColumn, type CascaderColumnProps, CascaderContent, type CascaderContentProps, CascaderField, type CascaderFieldProps, CascaderItem, type CascaderItemFunction, CascaderItemGroup, type CascaderItemGroupProps, type CascaderItemLayout, type CascaderItemProps, CascaderMenu, type CascaderMenuProps, type CascaderOption, CascaderOptionsMenu, type CascaderOptionsMenuProps, type CascaderProps, type CascaderSize, CascaderTrigger, type CascaderTriggerProps, Checkbox, CheckboxGroup, type CheckboxGroupDirection, type CheckboxGroupProps, CheckboxInput, type CheckboxInputProps, type CheckboxProps, type ColorFormat, ColorPickButton, type ColorPickButtonProps, ColorPicker, ColorPickerArea, type ColorPickerAreaProps, ColorPickerContent, type ColorPickerContentProps, ColorPickerInputs, type ColorPickerInputsProps, ColorPickerPanel, type ColorPickerPanelProps, ColorPickerPresets, type ColorPickerPresetsProps, type ColorPickerProps, ColorPickerSlider, type ColorPickerSliderProps, ColorPickerTrigger, type ColorPickerTriggerProps, DEFAULT_COLOR, DatePicker, DatePickerCalendar, type DatePickerCalendarProps, DatePickerContent, type DatePickerContentProps, DatePickerField, type DatePickerFieldProps, type DatePickerMode, type DatePickerPanel, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DatePickerSize, type DatePickerTimeValue, DatePickerTrigger, type DatePickerTriggerProps, type DateRange, Feedback, type FeedbackMode, type FeedbackProps, type FeedbackSize, type FeedbackType, Fieldset, FormField, type FormFieldProps, type HSVA, Input, InputGroup, InputGroupAddon, type InputGroupProps, type InputProps, type InputSize, Label, Link, type LinkLevel, type LinkMode, type LinkProps, List, ListDivider, type ListDividerProps, ListGroup, type ListGroupProps, ListItem, ListItemGroup, type ListItemGroupProps, type ListItemLeading, type ListItemProps, type ListItemType, type ListProps, ListSeparator, type ListSeparatorProps, ListTitle, type ListTitleProps, Loading, type LoadingButtonSize, type LoadingLevel, type LoadingMode, type LoadingProps, Modal, ModalBody, type ModalBodyProps, ModalClose, ModalContent, type ModalContentProps, ModalDescription, type ModalDescriptionProps, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, ModalHeaderText, type ModalHeaderTextProps, ModalOverlay, type ModalOverlayProps, ModalPortal, type ModalProps, type ModalSize, ModalTitle, type ModalTitleProps, ModalTrigger, Navigation, NavigationActions, type NavigationActionsProps, NavigationActionsSlot, type NavigationActionsSlotProps, type NavigationBackground, NavigationBrand, type NavigationBrandProps, NavigationBrandTitle, type NavigationBrandTitleProps, type NavigationDirection, NavigationGroup, type NavigationGroupProps, NavigationItem, NavigationItemGroup, type NavigationItemGroupProps, type NavigationItemProps, type NavigationItemType, type NavigationProps, NavigationSection, type NavigationSectionProps, Pagehead, type PageheadProps, Pagination, type PaginationProps, Popover, PopoverAnchor, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, Progress, type ProgressProps, type ProgressShape, type ProgressSize, type ProgressType, RadioGroup, type RadioGroupDirection, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, RadioInput, type RadioInputProps, type RadioInputVariant, Scroll, type ScrollOrientation, ScrollPicker, ScrollPickerColumn, type ScrollPickerColumnProps, ScrollPickerItem, type ScrollPickerItemProps, type ScrollPickerProps, type ScrollProps, type ScrollSize, SegmentatorGroup, type SegmentatorGroupProps, SegmentatorItem, type SegmentatorItemProps, type SegmentatorMode, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, type SelectItemFunction, SelectItemGroup, type SelectItemGroupProps, type SelectItemLayout, SelectItemPeople, type SelectItemPeopleProps, type SelectItemProps, SelectLabel, type SelectLabelProps, SelectSeparator, type SelectSeparatorProps, type SelectSize, SelectSubItem, SelectSubItemPeople, type SelectSubItemPeopleProps, type SelectSubItemProps, SelectSubMenu, type SelectSubMenuProps, SelectTrigger, type SelectTriggerProps, SelectValue, Slider, type SliderProps, type SliderSize, type SliderType, Stack, type StackProps, Steps, type StepsDirection, StepsIcon, type StepsIconProps, StepsItem, type StepsItemProps, type StepsProps, type StepsState, Switch, type SwitchProps, type SwitchSize, TOOLTIP_DELAY_DURATION, Table, TableCell, type TableCellContent, type TableCellProps, TableHead, type TableHeadProps, type TableProps, TableRow, type TableRowProps, Tag, TagClose, type TagCloseProps, type TagContent, type TagLevel, type TagLineHeightFix, type TagProps, Textarea, type TextareaProps, type TextareaSize, ThemeProvider, type ThemeProviderProps, ThemeScript, TimePicker, TimePickerContent, type TimePickerContentProps, TimePickerField, type TimePickerFieldProps, TimePickerPanel, type TimePickerPanelProps, type TimePickerProps, type TimePickerSize, TimePickerTrigger, type TimePickerTriggerProps, type TimePickerValue, TimePickerWheels, type TimePickerWheelsValue, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, type TooltipProviderProps, TooltipTrigger, Typeface, type TypefaceContent, TypefacePair, type TypefacePairProps, type TypefaceProps, Typography, type TypographyContent, type TypographyLevel, type TypographyProps, type TypographyTone, Upload, type UploadProps, type UploadStyle, type UseColorPickerStateOptions, alertVariants, buttonVariants, cn, formatDisplayDate, formatMonthYear, formatTimeValue, initKeyboardFocus, inputRootVariants, loadingLevelForButtonSize, modalContentVariants, typographyVariants, useColorPickerState, useTheme, useThemeLayoutKey };
|
|
1962
|
+
export { Alert, type AlertAppearance, type AlertProps, type AlertSize, type AlertType, Anchor, type AnchorIndentLevel, AnchorItem, type AnchorItemProps, type AnchorProps, Avatar, type AvatarContent, type AvatarLevel, type AvatarProps, Badge, type BadgeLevel, type BadgeLineHeightFix, type BadgeProps, type BadgeStyle, Breadcrumb, BreadcrumbEllipsis, BreadcrumbEllipsisItem, type BreadcrumbEllipsisItemProps, type BreadcrumbEllipsisProps, BreadcrumbItem, type BreadcrumbItemProps, type BreadcrumbProps, BreadcrumbSeparator, type BreadcrumbSeparatorProps, type BreadcrumbSize, Button, type ButtonMode, type ButtonProps, type ButtonSize, Card, CardBody, type CardBodyProps, CardBottom, type CardBottomProps, CardHead, type CardHeadProps, type CardProps, type CardSlotType, Cascader, CascaderColumn, type CascaderColumnProps, CascaderContent, type CascaderContentProps, CascaderField, type CascaderFieldProps, CascaderItem, type CascaderItemFunction, CascaderItemGroup, type CascaderItemGroupProps, type CascaderItemLayout, type CascaderItemProps, CascaderMenu, type CascaderMenuProps, type CascaderOption, CascaderOptionsMenu, type CascaderOptionsMenuProps, type CascaderProps, type CascaderSize, CascaderTrigger, type CascaderTriggerProps, Checkbox, CheckboxGroup, type CheckboxGroupDirection, type CheckboxGroupProps, CheckboxInput, type CheckboxInputProps, type CheckboxProps, type ColorFormat, ColorPickButton, type ColorPickButtonProps, ColorPicker, ColorPickerArea, type ColorPickerAreaProps, ColorPickerContent, type ColorPickerContentProps, ColorPickerInputs, type ColorPickerInputsProps, ColorPickerPanel, type ColorPickerPanelProps, ColorPickerPresets, type ColorPickerPresetsProps, type ColorPickerProps, ColorPickerSlider, type ColorPickerSliderProps, ColorPickerTrigger, type ColorPickerTriggerProps, DEFAULT_COLOR, DatePicker, DatePickerCalendar, type DatePickerCalendarProps, DatePickerContent, type DatePickerContentProps, DatePickerField, type DatePickerFieldProps, type DatePickerMode, type DatePickerPanel, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DatePickerSize, type DatePickerTimeValue, DatePickerTrigger, type DatePickerTriggerProps, type DateRange, Feedback, type FeedbackMode, type FeedbackProps, type FeedbackSize, type FeedbackType, Fieldset, FormField, type FormFieldProps, type HSVA, Input, InputGroup, InputGroupAddon, type InputGroupProps, type InputProps, type InputSize, Label, Link, type LinkLevel, type LinkMode, type LinkProps, List, ListDivider, type ListDividerProps, ListGroup, type ListGroupProps, ListItem, ListItemGroup, type ListItemGroupProps, type ListItemLeading, type ListItemProps, type ListItemType, type ListProps, ListSeparator, type ListSeparatorProps, ListTitle, type ListTitleProps, Loading, type LoadingButtonSize, type LoadingLevel, type LoadingMode, type LoadingProps, Modal, ModalBody, type ModalBodyProps, ModalClose, ModalContent, type ModalContentProps, ModalDescription, type ModalDescriptionProps, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, ModalHeaderText, type ModalHeaderTextProps, ModalOverlay, type ModalOverlayProps, ModalPortal, type ModalProps, type ModalSize, ModalTitle, type ModalTitleProps, ModalTrigger, Navigation, NavigationActions, type NavigationActionsProps, NavigationActionsSlot, type NavigationActionsSlotProps, type NavigationBackground, NavigationBrand, type NavigationBrandProps, NavigationBrandTitle, type NavigationBrandTitleProps, type NavigationDirection, NavigationGroup, type NavigationGroupProps, NavigationItem, NavigationItemGroup, type NavigationItemGroupProps, NavigationItemMenu, NavigationItemMenuContent, type NavigationItemMenuContentProps, NavigationItemMenuItem, type NavigationItemMenuItemProps, type NavigationItemMenuProps, NavigationItemMenuTrigger, type NavigationItemMenuTriggerProps, type NavigationItemProps, type NavigationItemType, type NavigationProps, NavigationSection, type NavigationSectionProps, Pagehead, type PageheadProps, Pagination, type PaginationProps, Popover, PopoverAnchor, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, Progress, type ProgressProps, type ProgressShape, type ProgressSize, type ProgressType, RadioGroup, type RadioGroupDirection, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, RadioInput, type RadioInputProps, type RadioInputVariant, Scroll, type ScrollOrientation, ScrollPicker, ScrollPickerColumn, type ScrollPickerColumnProps, ScrollPickerItem, type ScrollPickerItemProps, type ScrollPickerProps, type ScrollProps, type ScrollSize, SegmentatorGroup, type SegmentatorGroupProps, SegmentatorItem, type SegmentatorItemProps, type SegmentatorMode, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, type SelectItemFunction, SelectItemGroup, type SelectItemGroupProps, type SelectItemLayout, SelectItemPeople, type SelectItemPeopleProps, type SelectItemProps, SelectLabel, type SelectLabelProps, SelectSeparator, type SelectSeparatorProps, type SelectSize, SelectSubItem, SelectSubItemPeople, type SelectSubItemPeopleProps, type SelectSubItemProps, SelectSubMenu, type SelectSubMenuProps, SelectTrigger, type SelectTriggerProps, SelectValue, Slider, type SliderProps, type SliderSize, type SliderType, Stack, type StackProps, Steps, type StepsDirection, StepsIcon, type StepsIconProps, StepsItem, type StepsItemProps, type StepsProps, type StepsState, Switch, type SwitchProps, type SwitchSize, TOOLTIP_DELAY_DURATION, Table, TableCell, type TableCellContent, type TableCellProps, TableHead, type TableHeadProps, type TableProps, TableRow, type TableRowProps, Tag, TagClose, type TagCloseProps, type TagContent, type TagLevel, type TagLineHeightFix, type TagProps, Textarea, type TextareaProps, type TextareaSize, ThemeProvider, type ThemeProviderProps, ThemeScript, TimePicker, TimePickerContent, type TimePickerContentProps, TimePickerField, type TimePickerFieldProps, TimePickerPanel, type TimePickerPanelProps, type TimePickerProps, type TimePickerSize, TimePickerTrigger, type TimePickerTriggerProps, type TimePickerValue, TimePickerWheels, type TimePickerWheelsValue, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, type TooltipProviderProps, TooltipTrigger, Typeface, type TypefaceContent, TypefacePair, type TypefacePairProps, type TypefaceProps, Typography, type TypographyContent, type TypographyLevel, type TypographyProps, type TypographyTone, Upload, type UploadProps, type UploadStyle, type UseColorPickerStateOptions, alertVariants, buttonVariants, cn, formatDisplayDate, formatMonthYear, formatTimeValue, initKeyboardFocus, inputRootVariants, loadingLevelForButtonSize, modalContentVariants, typographyVariants, useColorPickerState, useTheme, useThemeLayoutKey };
|
package/dist/index.d.ts
CHANGED
|
@@ -1577,6 +1577,51 @@ type NavigationActionsProps = HTMLAttributes<HTMLDivElement>;
|
|
|
1577
1577
|
declare const NavigationActions: react.ForwardRefExoticComponent<NavigationActionsProps & react.RefAttributes<HTMLDivElement>>;
|
|
1578
1578
|
type NavigationActionsSlotProps = HTMLAttributes<HTMLDivElement>;
|
|
1579
1579
|
declare const NavigationActionsSlot: react.ForwardRefExoticComponent<NavigationActionsSlotProps & react.RefAttributes<HTMLDivElement>>;
|
|
1580
|
+
type NavigationItemMenuProps = {
|
|
1581
|
+
/** Selected child value — similar to Select `value`. */
|
|
1582
|
+
value?: string;
|
|
1583
|
+
defaultValue?: string;
|
|
1584
|
+
onValueChange?: (value: string) => void;
|
|
1585
|
+
open?: boolean;
|
|
1586
|
+
onOpenChange?: (open: boolean) => void;
|
|
1587
|
+
children: ReactNode;
|
|
1588
|
+
};
|
|
1589
|
+
declare function NavigationItemMenu({ value: valueProp, defaultValue, onValueChange, open: openProp, onOpenChange, children, }: NavigationItemMenuProps): react.JSX.Element;
|
|
1590
|
+
type NavigationItemMenuTriggerProps = Omit<ComponentPropsWithoutRef<"button">, "children"> & {
|
|
1591
|
+
/** Defaults to highlighted when the menu has a selected child. */
|
|
1592
|
+
active?: boolean;
|
|
1593
|
+
leftIcon?: ReactNode;
|
|
1594
|
+
rightIcon?: ReactNode;
|
|
1595
|
+
children: ReactNode;
|
|
1596
|
+
};
|
|
1597
|
+
/** Parent item — renders as a Navigation tab item and anchors the flyout. */
|
|
1598
|
+
declare const NavigationItemMenuTrigger: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "children"> & {
|
|
1599
|
+
/** Defaults to highlighted when the menu has a selected child. */
|
|
1600
|
+
active?: boolean;
|
|
1601
|
+
leftIcon?: ReactNode;
|
|
1602
|
+
rightIcon?: ReactNode;
|
|
1603
|
+
children: ReactNode;
|
|
1604
|
+
} & react.RefAttributes<HTMLButtonElement>>;
|
|
1605
|
+
type NavigationItemMenuContentProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>;
|
|
1606
|
+
/** Flyout surface — right of the item in vertical, below it in horizontal. */
|
|
1607
|
+
declare const NavigationItemMenuContent: react.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1608
|
+
type NavigationItemMenuItemProps = Omit<ComponentPropsWithoutRef<"button">, "children" | "value"> & {
|
|
1609
|
+
value: string;
|
|
1610
|
+
/** Defaults to highlighted when it matches the menu value. */
|
|
1611
|
+
selected?: boolean;
|
|
1612
|
+
leftIcon?: ReactNode;
|
|
1613
|
+
rightIcon?: ReactNode;
|
|
1614
|
+
children: ReactNode;
|
|
1615
|
+
};
|
|
1616
|
+
/** Child option — highlighted when selected, no check icon by default. */
|
|
1617
|
+
declare const NavigationItemMenuItem: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "children" | "value"> & {
|
|
1618
|
+
value: string;
|
|
1619
|
+
/** Defaults to highlighted when it matches the menu value. */
|
|
1620
|
+
selected?: boolean;
|
|
1621
|
+
leftIcon?: ReactNode;
|
|
1622
|
+
rightIcon?: ReactNode;
|
|
1623
|
+
children: ReactNode;
|
|
1624
|
+
} & react.RefAttributes<HTMLButtonElement>>;
|
|
1580
1625
|
|
|
1581
1626
|
/** Figma Components → Information Collect → Slider (384:21585) */
|
|
1582
1627
|
type SliderSize = "default" | "big";
|
|
@@ -1914,4 +1959,4 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
1914
1959
|
*/
|
|
1915
1960
|
declare function initKeyboardFocus(): void;
|
|
1916
1961
|
|
|
1917
|
-
export { Alert, type AlertAppearance, type AlertProps, type AlertSize, type AlertType, Anchor, type AnchorIndentLevel, AnchorItem, type AnchorItemProps, type AnchorProps, Avatar, type AvatarContent, type AvatarLevel, type AvatarProps, Badge, type BadgeLevel, type BadgeLineHeightFix, type BadgeProps, type BadgeStyle, Breadcrumb, BreadcrumbEllipsis, BreadcrumbEllipsisItem, type BreadcrumbEllipsisItemProps, type BreadcrumbEllipsisProps, BreadcrumbItem, type BreadcrumbItemProps, type BreadcrumbProps, BreadcrumbSeparator, type BreadcrumbSeparatorProps, type BreadcrumbSize, Button, type ButtonMode, type ButtonProps, type ButtonSize, Card, CardBody, type CardBodyProps, CardBottom, type CardBottomProps, CardHead, type CardHeadProps, type CardProps, type CardSlotType, Cascader, CascaderColumn, type CascaderColumnProps, CascaderContent, type CascaderContentProps, CascaderField, type CascaderFieldProps, CascaderItem, type CascaderItemFunction, CascaderItemGroup, type CascaderItemGroupProps, type CascaderItemLayout, type CascaderItemProps, CascaderMenu, type CascaderMenuProps, type CascaderOption, CascaderOptionsMenu, type CascaderOptionsMenuProps, type CascaderProps, type CascaderSize, CascaderTrigger, type CascaderTriggerProps, Checkbox, CheckboxGroup, type CheckboxGroupDirection, type CheckboxGroupProps, CheckboxInput, type CheckboxInputProps, type CheckboxProps, type ColorFormat, ColorPickButton, type ColorPickButtonProps, ColorPicker, ColorPickerArea, type ColorPickerAreaProps, ColorPickerContent, type ColorPickerContentProps, ColorPickerInputs, type ColorPickerInputsProps, ColorPickerPanel, type ColorPickerPanelProps, ColorPickerPresets, type ColorPickerPresetsProps, type ColorPickerProps, ColorPickerSlider, type ColorPickerSliderProps, ColorPickerTrigger, type ColorPickerTriggerProps, DEFAULT_COLOR, DatePicker, DatePickerCalendar, type DatePickerCalendarProps, DatePickerContent, type DatePickerContentProps, DatePickerField, type DatePickerFieldProps, type DatePickerMode, type DatePickerPanel, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DatePickerSize, type DatePickerTimeValue, DatePickerTrigger, type DatePickerTriggerProps, type DateRange, Feedback, type FeedbackMode, type FeedbackProps, type FeedbackSize, type FeedbackType, Fieldset, FormField, type FormFieldProps, type HSVA, Input, InputGroup, InputGroupAddon, type InputGroupProps, type InputProps, type InputSize, Label, Link, type LinkLevel, type LinkMode, type LinkProps, List, ListDivider, type ListDividerProps, ListGroup, type ListGroupProps, ListItem, ListItemGroup, type ListItemGroupProps, type ListItemLeading, type ListItemProps, type ListItemType, type ListProps, ListSeparator, type ListSeparatorProps, ListTitle, type ListTitleProps, Loading, type LoadingButtonSize, type LoadingLevel, type LoadingMode, type LoadingProps, Modal, ModalBody, type ModalBodyProps, ModalClose, ModalContent, type ModalContentProps, ModalDescription, type ModalDescriptionProps, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, ModalHeaderText, type ModalHeaderTextProps, ModalOverlay, type ModalOverlayProps, ModalPortal, type ModalProps, type ModalSize, ModalTitle, type ModalTitleProps, ModalTrigger, Navigation, NavigationActions, type NavigationActionsProps, NavigationActionsSlot, type NavigationActionsSlotProps, type NavigationBackground, NavigationBrand, type NavigationBrandProps, NavigationBrandTitle, type NavigationBrandTitleProps, type NavigationDirection, NavigationGroup, type NavigationGroupProps, NavigationItem, NavigationItemGroup, type NavigationItemGroupProps, type NavigationItemProps, type NavigationItemType, type NavigationProps, NavigationSection, type NavigationSectionProps, Pagehead, type PageheadProps, Pagination, type PaginationProps, Popover, PopoverAnchor, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, Progress, type ProgressProps, type ProgressShape, type ProgressSize, type ProgressType, RadioGroup, type RadioGroupDirection, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, RadioInput, type RadioInputProps, type RadioInputVariant, Scroll, type ScrollOrientation, ScrollPicker, ScrollPickerColumn, type ScrollPickerColumnProps, ScrollPickerItem, type ScrollPickerItemProps, type ScrollPickerProps, type ScrollProps, type ScrollSize, SegmentatorGroup, type SegmentatorGroupProps, SegmentatorItem, type SegmentatorItemProps, type SegmentatorMode, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, type SelectItemFunction, SelectItemGroup, type SelectItemGroupProps, type SelectItemLayout, SelectItemPeople, type SelectItemPeopleProps, type SelectItemProps, SelectLabel, type SelectLabelProps, SelectSeparator, type SelectSeparatorProps, type SelectSize, SelectSubItem, SelectSubItemPeople, type SelectSubItemPeopleProps, type SelectSubItemProps, SelectSubMenu, type SelectSubMenuProps, SelectTrigger, type SelectTriggerProps, SelectValue, Slider, type SliderProps, type SliderSize, type SliderType, Stack, type StackProps, Steps, type StepsDirection, StepsIcon, type StepsIconProps, StepsItem, type StepsItemProps, type StepsProps, type StepsState, Switch, type SwitchProps, type SwitchSize, TOOLTIP_DELAY_DURATION, Table, TableCell, type TableCellContent, type TableCellProps, TableHead, type TableHeadProps, type TableProps, TableRow, type TableRowProps, Tag, TagClose, type TagCloseProps, type TagContent, type TagLevel, type TagLineHeightFix, type TagProps, Textarea, type TextareaProps, type TextareaSize, ThemeProvider, type ThemeProviderProps, ThemeScript, TimePicker, TimePickerContent, type TimePickerContentProps, TimePickerField, type TimePickerFieldProps, TimePickerPanel, type TimePickerPanelProps, type TimePickerProps, type TimePickerSize, TimePickerTrigger, type TimePickerTriggerProps, type TimePickerValue, TimePickerWheels, type TimePickerWheelsValue, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, type TooltipProviderProps, TooltipTrigger, Typeface, type TypefaceContent, TypefacePair, type TypefacePairProps, type TypefaceProps, Typography, type TypographyContent, type TypographyLevel, type TypographyProps, type TypographyTone, Upload, type UploadProps, type UploadStyle, type UseColorPickerStateOptions, alertVariants, buttonVariants, cn, formatDisplayDate, formatMonthYear, formatTimeValue, initKeyboardFocus, inputRootVariants, loadingLevelForButtonSize, modalContentVariants, typographyVariants, useColorPickerState, useTheme, useThemeLayoutKey };
|
|
1962
|
+
export { Alert, type AlertAppearance, type AlertProps, type AlertSize, type AlertType, Anchor, type AnchorIndentLevel, AnchorItem, type AnchorItemProps, type AnchorProps, Avatar, type AvatarContent, type AvatarLevel, type AvatarProps, Badge, type BadgeLevel, type BadgeLineHeightFix, type BadgeProps, type BadgeStyle, Breadcrumb, BreadcrumbEllipsis, BreadcrumbEllipsisItem, type BreadcrumbEllipsisItemProps, type BreadcrumbEllipsisProps, BreadcrumbItem, type BreadcrumbItemProps, type BreadcrumbProps, BreadcrumbSeparator, type BreadcrumbSeparatorProps, type BreadcrumbSize, Button, type ButtonMode, type ButtonProps, type ButtonSize, Card, CardBody, type CardBodyProps, CardBottom, type CardBottomProps, CardHead, type CardHeadProps, type CardProps, type CardSlotType, Cascader, CascaderColumn, type CascaderColumnProps, CascaderContent, type CascaderContentProps, CascaderField, type CascaderFieldProps, CascaderItem, type CascaderItemFunction, CascaderItemGroup, type CascaderItemGroupProps, type CascaderItemLayout, type CascaderItemProps, CascaderMenu, type CascaderMenuProps, type CascaderOption, CascaderOptionsMenu, type CascaderOptionsMenuProps, type CascaderProps, type CascaderSize, CascaderTrigger, type CascaderTriggerProps, Checkbox, CheckboxGroup, type CheckboxGroupDirection, type CheckboxGroupProps, CheckboxInput, type CheckboxInputProps, type CheckboxProps, type ColorFormat, ColorPickButton, type ColorPickButtonProps, ColorPicker, ColorPickerArea, type ColorPickerAreaProps, ColorPickerContent, type ColorPickerContentProps, ColorPickerInputs, type ColorPickerInputsProps, ColorPickerPanel, type ColorPickerPanelProps, ColorPickerPresets, type ColorPickerPresetsProps, type ColorPickerProps, ColorPickerSlider, type ColorPickerSliderProps, ColorPickerTrigger, type ColorPickerTriggerProps, DEFAULT_COLOR, DatePicker, DatePickerCalendar, type DatePickerCalendarProps, DatePickerContent, type DatePickerContentProps, DatePickerField, type DatePickerFieldProps, type DatePickerMode, type DatePickerPanel, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DatePickerSize, type DatePickerTimeValue, DatePickerTrigger, type DatePickerTriggerProps, type DateRange, Feedback, type FeedbackMode, type FeedbackProps, type FeedbackSize, type FeedbackType, Fieldset, FormField, type FormFieldProps, type HSVA, Input, InputGroup, InputGroupAddon, type InputGroupProps, type InputProps, type InputSize, Label, Link, type LinkLevel, type LinkMode, type LinkProps, List, ListDivider, type ListDividerProps, ListGroup, type ListGroupProps, ListItem, ListItemGroup, type ListItemGroupProps, type ListItemLeading, type ListItemProps, type ListItemType, type ListProps, ListSeparator, type ListSeparatorProps, ListTitle, type ListTitleProps, Loading, type LoadingButtonSize, type LoadingLevel, type LoadingMode, type LoadingProps, Modal, ModalBody, type ModalBodyProps, ModalClose, ModalContent, type ModalContentProps, ModalDescription, type ModalDescriptionProps, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, ModalHeaderText, type ModalHeaderTextProps, ModalOverlay, type ModalOverlayProps, ModalPortal, type ModalProps, type ModalSize, ModalTitle, type ModalTitleProps, ModalTrigger, Navigation, NavigationActions, type NavigationActionsProps, NavigationActionsSlot, type NavigationActionsSlotProps, type NavigationBackground, NavigationBrand, type NavigationBrandProps, NavigationBrandTitle, type NavigationBrandTitleProps, type NavigationDirection, NavigationGroup, type NavigationGroupProps, NavigationItem, NavigationItemGroup, type NavigationItemGroupProps, NavigationItemMenu, NavigationItemMenuContent, type NavigationItemMenuContentProps, NavigationItemMenuItem, type NavigationItemMenuItemProps, type NavigationItemMenuProps, NavigationItemMenuTrigger, type NavigationItemMenuTriggerProps, type NavigationItemProps, type NavigationItemType, type NavigationProps, NavigationSection, type NavigationSectionProps, Pagehead, type PageheadProps, Pagination, type PaginationProps, Popover, PopoverAnchor, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, Progress, type ProgressProps, type ProgressShape, type ProgressSize, type ProgressType, RadioGroup, type RadioGroupDirection, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, RadioInput, type RadioInputProps, type RadioInputVariant, Scroll, type ScrollOrientation, ScrollPicker, ScrollPickerColumn, type ScrollPickerColumnProps, ScrollPickerItem, type ScrollPickerItemProps, type ScrollPickerProps, type ScrollProps, type ScrollSize, SegmentatorGroup, type SegmentatorGroupProps, SegmentatorItem, type SegmentatorItemProps, type SegmentatorMode, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, type SelectItemFunction, SelectItemGroup, type SelectItemGroupProps, type SelectItemLayout, SelectItemPeople, type SelectItemPeopleProps, type SelectItemProps, SelectLabel, type SelectLabelProps, SelectSeparator, type SelectSeparatorProps, type SelectSize, SelectSubItem, SelectSubItemPeople, type SelectSubItemPeopleProps, type SelectSubItemProps, SelectSubMenu, type SelectSubMenuProps, SelectTrigger, type SelectTriggerProps, SelectValue, Slider, type SliderProps, type SliderSize, type SliderType, Stack, type StackProps, Steps, type StepsDirection, StepsIcon, type StepsIconProps, StepsItem, type StepsItemProps, type StepsProps, type StepsState, Switch, type SwitchProps, type SwitchSize, TOOLTIP_DELAY_DURATION, Table, TableCell, type TableCellContent, type TableCellProps, TableHead, type TableHeadProps, type TableProps, TableRow, type TableRowProps, Tag, TagClose, type TagCloseProps, type TagContent, type TagLevel, type TagLineHeightFix, type TagProps, Textarea, type TextareaProps, type TextareaSize, ThemeProvider, type ThemeProviderProps, ThemeScript, TimePicker, TimePickerContent, type TimePickerContentProps, TimePickerField, type TimePickerFieldProps, TimePickerPanel, type TimePickerPanelProps, type TimePickerProps, type TimePickerSize, TimePickerTrigger, type TimePickerTriggerProps, type TimePickerValue, TimePickerWheels, type TimePickerWheelsValue, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, type TooltipProviderProps, TooltipTrigger, Typeface, type TypefaceContent, TypefacePair, type TypefacePairProps, type TypefaceProps, Typography, type TypographyContent, type TypographyLevel, type TypographyProps, type TypographyTone, Upload, type UploadProps, type UploadStyle, type UseColorPickerStateOptions, alertVariants, buttonVariants, cn, formatDisplayDate, formatMonthYear, formatTimeValue, initKeyboardFocus, inputRootVariants, loadingLevelForButtonSize, modalContentVariants, typographyVariants, useColorPickerState, useTheme, useThemeLayoutKey };
|
package/dist/index.js
CHANGED
|
@@ -6980,13 +6980,16 @@ var ListItem = forwardRef33(
|
|
|
6980
6980
|
ListItem.displayName = "ListItem";
|
|
6981
6981
|
|
|
6982
6982
|
// src/components/navigation.tsx
|
|
6983
|
+
import * as PopoverPrimitive7 from "@radix-ui/react-popover";
|
|
6983
6984
|
import { Slot as Slot5 } from "@radix-ui/react-slot";
|
|
6984
6985
|
import {
|
|
6985
6986
|
createContext as createContext8,
|
|
6986
6987
|
forwardRef as forwardRef34,
|
|
6987
6988
|
useCallback as useCallback14,
|
|
6988
6989
|
useContext as useContext8,
|
|
6990
|
+
useEffect as useEffect9,
|
|
6989
6991
|
useLayoutEffect as useLayoutEffect5,
|
|
6992
|
+
useMemo as useMemo8,
|
|
6990
6993
|
useRef as useRef10,
|
|
6991
6994
|
useState as useState13
|
|
6992
6995
|
} from "react";
|
|
@@ -7100,6 +7103,9 @@ function measureIndicatorFromElement(indicatorEl, groupEl) {
|
|
|
7100
7103
|
visible: indicatorEl.dataset.visible === "true"
|
|
7101
7104
|
};
|
|
7102
7105
|
}
|
|
7106
|
+
function easeOutCubic(t) {
|
|
7107
|
+
return 1 - Math.pow(1 - t, 3);
|
|
7108
|
+
}
|
|
7103
7109
|
function metricsApproxEqual2(a, b, epsilon = 0.5) {
|
|
7104
7110
|
return Math.abs(a.x - b.x) < epsilon && Math.abs(a.y - b.y) < epsilon && Math.abs(a.width - b.width) < epsilon && Math.abs(a.height - b.height) < epsilon && a.visible === b.visible;
|
|
7105
7111
|
}
|
|
@@ -7185,73 +7191,63 @@ function useNavigationIndicator(groupRef, direction, layoutKey) {
|
|
|
7185
7191
|
isAnimatingRef.current = false;
|
|
7186
7192
|
syncIndicator(metrics, true);
|
|
7187
7193
|
}, [measureIndicator, syncIndicator]);
|
|
7188
|
-
const startExpandCollapseTracking = useCallback14(
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
durationMs,
|
|
7219
|
-
easing,
|
|
7220
|
-
generation,
|
|
7221
|
-
animationGenerationRef,
|
|
7222
|
-
animationRef,
|
|
7223
|
-
isAnimatingRef,
|
|
7224
|
-
syncIndicator
|
|
7225
|
-
);
|
|
7226
|
-
window.setTimeout(() => {
|
|
7227
|
-
if (!isLayoutTrackingRef.current) return;
|
|
7228
|
-
isLayoutTrackingRef.current = false;
|
|
7229
|
-
const final = measureIndicator();
|
|
7230
|
-
if (final) syncIndicator(final, true);
|
|
7231
|
-
}, durationMs);
|
|
7194
|
+
const startExpandCollapseTracking = useCallback14(() => {
|
|
7195
|
+
const group = groupRef.current;
|
|
7196
|
+
const el = indicatorRef.current;
|
|
7197
|
+
if (!group || !el) return;
|
|
7198
|
+
cancelLayoutTracking();
|
|
7199
|
+
animationRef.current?.cancel();
|
|
7200
|
+
animationRef.current = null;
|
|
7201
|
+
isAnimatingRef.current = false;
|
|
7202
|
+
const prefersReducedMotion2 = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
7203
|
+
if (prefersReducedMotion2) {
|
|
7204
|
+
const metrics = measureIndicator();
|
|
7205
|
+
if (metrics) syncIndicator(metrics, true);
|
|
7206
|
+
return;
|
|
7207
|
+
}
|
|
7208
|
+
const { durationMs } = getNavigationAnimationTiming(group);
|
|
7209
|
+
const startRect = el.getBoundingClientRect();
|
|
7210
|
+
const startVisible = el.dataset.visible === "true";
|
|
7211
|
+
const startTime = performance.now();
|
|
7212
|
+
isLayoutTrackingRef.current = true;
|
|
7213
|
+
const finish = () => {
|
|
7214
|
+
layoutTrackingFrameRef.current = null;
|
|
7215
|
+
isLayoutTrackingRef.current = false;
|
|
7216
|
+
const final = measureIndicator();
|
|
7217
|
+
if (final) syncIndicator(final, true);
|
|
7218
|
+
};
|
|
7219
|
+
const tick = (now) => {
|
|
7220
|
+
if (!isLayoutTrackingRef.current) return;
|
|
7221
|
+
const progress = Math.min(1, (now - startTime) / durationMs);
|
|
7222
|
+
if (progress >= 1) {
|
|
7223
|
+
finish();
|
|
7232
7224
|
return;
|
|
7233
7225
|
}
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
const tick = () => {
|
|
7239
|
-
if (!isLayoutTrackingRef.current) return;
|
|
7240
|
-
const metrics = measureIndicator();
|
|
7241
|
-
if (metrics) syncIndicator(metrics, true);
|
|
7242
|
-
if (performance.now() < deadline) {
|
|
7243
|
-
layoutTrackingFrameRef.current = requestAnimationFrame(tick);
|
|
7226
|
+
const target = measureIndicator();
|
|
7227
|
+
if (target) {
|
|
7228
|
+
if (!startVisible || !target.visible) {
|
|
7229
|
+
syncIndicator(target, true);
|
|
7244
7230
|
} else {
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
const
|
|
7248
|
-
|
|
7231
|
+
const eased = easeOutCubic(progress);
|
|
7232
|
+
const groupRect = group.getBoundingClientRect();
|
|
7233
|
+
const targetAbsX = groupRect.left + target.x;
|
|
7234
|
+
const targetAbsY = groupRect.top + target.y;
|
|
7235
|
+
syncIndicator(
|
|
7236
|
+
{
|
|
7237
|
+
x: startRect.left + (targetAbsX - startRect.left) * eased - groupRect.left,
|
|
7238
|
+
y: startRect.top + (targetAbsY - startRect.top) * eased - groupRect.top,
|
|
7239
|
+
width: startRect.width + (target.width - startRect.width) * eased,
|
|
7240
|
+
height: startRect.height + (target.height - startRect.height) * eased,
|
|
7241
|
+
visible: true
|
|
7242
|
+
},
|
|
7243
|
+
true
|
|
7244
|
+
);
|
|
7249
7245
|
}
|
|
7250
|
-
}
|
|
7246
|
+
}
|
|
7251
7247
|
layoutTrackingFrameRef.current = requestAnimationFrame(tick);
|
|
7252
|
-
}
|
|
7253
|
-
|
|
7254
|
-
);
|
|
7248
|
+
};
|
|
7249
|
+
layoutTrackingFrameRef.current = requestAnimationFrame(tick);
|
|
7250
|
+
}, [cancelLayoutTracking, groupRef, measureIndicator, syncIndicator]);
|
|
7255
7251
|
const onIndicatorRef = useCallback14((node) => {
|
|
7256
7252
|
indicatorRef.current = node;
|
|
7257
7253
|
if (node && metricsRef.current && isInitialMount.current) {
|
|
@@ -7311,14 +7307,11 @@ function useNavigationIndicator(groupRef, direction, layoutKey) {
|
|
|
7311
7307
|
const group = groupRef.current;
|
|
7312
7308
|
if (!group) return;
|
|
7313
7309
|
const observer = new MutationObserver((mutations) => {
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
|
|
7319
|
-
}
|
|
7320
|
-
if (expandCollapseChange !== null) {
|
|
7321
|
-
startExpandCollapseTracking(expandCollapseChange);
|
|
7310
|
+
const expandCollapseChanged = mutations.some(
|
|
7311
|
+
(mutation) => mutation.type === "attributes" && mutation.attributeName === "data-expanded" && mutation.target instanceof HTMLElement
|
|
7312
|
+
);
|
|
7313
|
+
if (expandCollapseChanged) {
|
|
7314
|
+
startExpandCollapseTracking();
|
|
7322
7315
|
}
|
|
7323
7316
|
setActiveRevision((revision) => revision + 1);
|
|
7324
7317
|
});
|
|
@@ -7338,7 +7331,9 @@ function useNavigationIndicator(groupRef, direction, layoutKey) {
|
|
|
7338
7331
|
resizeObserver.observe(inner);
|
|
7339
7332
|
});
|
|
7340
7333
|
const onTransitionEnd = (event) => {
|
|
7341
|
-
if (event.propertyName !== "grid-template-rows")
|
|
7334
|
+
if (event.propertyName !== "grid-template-rows" && event.propertyName !== "width") {
|
|
7335
|
+
return;
|
|
7336
|
+
}
|
|
7342
7337
|
if (!(event.target instanceof HTMLElement)) return;
|
|
7343
7338
|
if (!event.target.classList.contains("aviala-navigation-item-group")) {
|
|
7344
7339
|
return;
|
|
@@ -7569,6 +7564,225 @@ var NavigationActionsSlot = forwardRef34(({ className, ...props }, ref) => /* @_
|
|
|
7569
7564
|
}
|
|
7570
7565
|
));
|
|
7571
7566
|
NavigationActionsSlot.displayName = "NavigationActionsSlot";
|
|
7567
|
+
var NAVIGATION_MENU_CLOSE_DELAY_MS = 150;
|
|
7568
|
+
var NavigationItemMenuContext = createContext8(null);
|
|
7569
|
+
function useNavigationItemMenuContext(component) {
|
|
7570
|
+
const context = useContext8(NavigationItemMenuContext);
|
|
7571
|
+
if (!context) {
|
|
7572
|
+
throw new Error(`${component} must be used within <NavigationItemMenu>`);
|
|
7573
|
+
}
|
|
7574
|
+
return context;
|
|
7575
|
+
}
|
|
7576
|
+
function NavigationItemMenu({
|
|
7577
|
+
value: valueProp,
|
|
7578
|
+
defaultValue,
|
|
7579
|
+
onValueChange,
|
|
7580
|
+
open: openProp,
|
|
7581
|
+
onOpenChange,
|
|
7582
|
+
children
|
|
7583
|
+
}) {
|
|
7584
|
+
const [internalValue, setInternalValue] = useState13(defaultValue);
|
|
7585
|
+
const isValueControlled = valueProp !== void 0;
|
|
7586
|
+
const value = isValueControlled ? valueProp : internalValue;
|
|
7587
|
+
const [internalOpen, setInternalOpen] = useState13(false);
|
|
7588
|
+
const isOpenControlled = openProp !== void 0;
|
|
7589
|
+
const open = isOpenControlled ? openProp : internalOpen;
|
|
7590
|
+
const closeTimerRef = useRef10(null);
|
|
7591
|
+
const openedByHoverRef = useRef10(false);
|
|
7592
|
+
const setOpen = useCallback14(
|
|
7593
|
+
(nextOpen) => {
|
|
7594
|
+
if (!isOpenControlled) setInternalOpen(nextOpen);
|
|
7595
|
+
onOpenChange?.(nextOpen);
|
|
7596
|
+
},
|
|
7597
|
+
[isOpenControlled, onOpenChange]
|
|
7598
|
+
);
|
|
7599
|
+
const cancelClose = useCallback14(() => {
|
|
7600
|
+
if (closeTimerRef.current != null) {
|
|
7601
|
+
window.clearTimeout(closeTimerRef.current);
|
|
7602
|
+
closeTimerRef.current = null;
|
|
7603
|
+
}
|
|
7604
|
+
}, []);
|
|
7605
|
+
const openMenu = useCallback14(
|
|
7606
|
+
(viaHover) => {
|
|
7607
|
+
cancelClose();
|
|
7608
|
+
openedByHoverRef.current = viaHover;
|
|
7609
|
+
setOpen(true);
|
|
7610
|
+
},
|
|
7611
|
+
[cancelClose, setOpen]
|
|
7612
|
+
);
|
|
7613
|
+
const scheduleClose = useCallback14(() => {
|
|
7614
|
+
cancelClose();
|
|
7615
|
+
closeTimerRef.current = window.setTimeout(() => {
|
|
7616
|
+
closeTimerRef.current = null;
|
|
7617
|
+
setOpen(false);
|
|
7618
|
+
}, NAVIGATION_MENU_CLOSE_DELAY_MS);
|
|
7619
|
+
}, [cancelClose, setOpen]);
|
|
7620
|
+
const select = useCallback14(
|
|
7621
|
+
(nextValue) => {
|
|
7622
|
+
if (!isValueControlled) setInternalValue(nextValue);
|
|
7623
|
+
onValueChange?.(nextValue);
|
|
7624
|
+
cancelClose();
|
|
7625
|
+
setOpen(false);
|
|
7626
|
+
},
|
|
7627
|
+
[cancelClose, isValueControlled, onValueChange, setOpen]
|
|
7628
|
+
);
|
|
7629
|
+
useEffect9(() => cancelClose, [cancelClose]);
|
|
7630
|
+
const contextValue = useMemo8(
|
|
7631
|
+
() => ({
|
|
7632
|
+
value,
|
|
7633
|
+
hasSelection: value != null && value !== "",
|
|
7634
|
+
select,
|
|
7635
|
+
openMenu,
|
|
7636
|
+
scheduleClose,
|
|
7637
|
+
cancelClose,
|
|
7638
|
+
openedByHoverRef
|
|
7639
|
+
}),
|
|
7640
|
+
[cancelClose, openMenu, scheduleClose, select, value]
|
|
7641
|
+
);
|
|
7642
|
+
const handleOpenChange = useCallback14(
|
|
7643
|
+
(nextOpen) => {
|
|
7644
|
+
if (nextOpen) openedByHoverRef.current = false;
|
|
7645
|
+
cancelClose();
|
|
7646
|
+
setOpen(nextOpen);
|
|
7647
|
+
},
|
|
7648
|
+
[cancelClose, setOpen]
|
|
7649
|
+
);
|
|
7650
|
+
return /* @__PURE__ */ jsx45(NavigationItemMenuContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx45(Popover, { open, onOpenChange: handleOpenChange, children }) });
|
|
7651
|
+
}
|
|
7652
|
+
var NavigationItemMenuTrigger = forwardRef34(
|
|
7653
|
+
({
|
|
7654
|
+
className,
|
|
7655
|
+
active,
|
|
7656
|
+
leftIcon,
|
|
7657
|
+
rightIcon,
|
|
7658
|
+
children,
|
|
7659
|
+
...props
|
|
7660
|
+
}, ref) => {
|
|
7661
|
+
const menu = useNavigationItemMenuContext("NavigationItemMenuTrigger");
|
|
7662
|
+
const isActive = active ?? menu.hasSelection;
|
|
7663
|
+
const mode = navigationItemButtonMode(isActive);
|
|
7664
|
+
return /* @__PURE__ */ jsx45(
|
|
7665
|
+
"span",
|
|
7666
|
+
{
|
|
7667
|
+
className: cn("aviala-navigation-item", className),
|
|
7668
|
+
"data-item-type": "default",
|
|
7669
|
+
"data-active": isActive ? "true" : "false",
|
|
7670
|
+
onMouseEnter: () => menu.openMenu(true),
|
|
7671
|
+
onMouseLeave: menu.scheduleClose,
|
|
7672
|
+
children: /* @__PURE__ */ jsx45(PopoverPrimitive7.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs35(
|
|
7673
|
+
"button",
|
|
7674
|
+
{
|
|
7675
|
+
ref,
|
|
7676
|
+
type: "button",
|
|
7677
|
+
className: cn(
|
|
7678
|
+
buttonVariants({ mode }),
|
|
7679
|
+
"aviala-navigation-item__control whitespace-normal"
|
|
7680
|
+
),
|
|
7681
|
+
"data-size": "regular",
|
|
7682
|
+
...props,
|
|
7683
|
+
children: [
|
|
7684
|
+
renderItemIcon3(leftIcon),
|
|
7685
|
+
/* @__PURE__ */ jsx45(
|
|
7686
|
+
Typography,
|
|
7687
|
+
{
|
|
7688
|
+
level: "text",
|
|
7689
|
+
as: "span",
|
|
7690
|
+
className: "aviala-navigation-item__label",
|
|
7691
|
+
children
|
|
7692
|
+
}
|
|
7693
|
+
),
|
|
7694
|
+
rightIcon ? /* @__PURE__ */ jsx45("span", { className: "aviala-navigation-item__chevron", children: renderItemIcon3(rightIcon) }) : null
|
|
7695
|
+
]
|
|
7696
|
+
}
|
|
7697
|
+
) })
|
|
7698
|
+
}
|
|
7699
|
+
);
|
|
7700
|
+
}
|
|
7701
|
+
);
|
|
7702
|
+
NavigationItemMenuTrigger.displayName = "NavigationItemMenuTrigger";
|
|
7703
|
+
var NavigationItemMenuContent = forwardRef34(
|
|
7704
|
+
({
|
|
7705
|
+
className,
|
|
7706
|
+
side,
|
|
7707
|
+
align = "start",
|
|
7708
|
+
sideOffset = 6,
|
|
7709
|
+
collisionPadding = 8,
|
|
7710
|
+
onOpenAutoFocus,
|
|
7711
|
+
...props
|
|
7712
|
+
}, ref) => {
|
|
7713
|
+
const direction = useNavigationDirection();
|
|
7714
|
+
const menu = useNavigationItemMenuContext("NavigationItemMenuContent");
|
|
7715
|
+
return /* @__PURE__ */ jsx45(PopoverPrimitive7.Portal, { children: /* @__PURE__ */ jsx45(
|
|
7716
|
+
PopoverPrimitive7.Content,
|
|
7717
|
+
{
|
|
7718
|
+
ref,
|
|
7719
|
+
side: side ?? (direction === "vertical" ? "right" : "bottom"),
|
|
7720
|
+
align,
|
|
7721
|
+
sideOffset,
|
|
7722
|
+
collisionPadding,
|
|
7723
|
+
className: cn("aviala-navigation-menu", className),
|
|
7724
|
+
onMouseEnter: menu.cancelClose,
|
|
7725
|
+
onMouseLeave: menu.scheduleClose,
|
|
7726
|
+
onOpenAutoFocus: (event) => {
|
|
7727
|
+
if (menu.openedByHoverRef.current) event.preventDefault();
|
|
7728
|
+
onOpenAutoFocus?.(event);
|
|
7729
|
+
},
|
|
7730
|
+
...props
|
|
7731
|
+
}
|
|
7732
|
+
) });
|
|
7733
|
+
}
|
|
7734
|
+
);
|
|
7735
|
+
NavigationItemMenuContent.displayName = "NavigationItemMenuContent";
|
|
7736
|
+
var NavigationItemMenuItem = forwardRef34(
|
|
7737
|
+
({
|
|
7738
|
+
className,
|
|
7739
|
+
value,
|
|
7740
|
+
selected,
|
|
7741
|
+
leftIcon,
|
|
7742
|
+
rightIcon,
|
|
7743
|
+
disabled,
|
|
7744
|
+
onClick,
|
|
7745
|
+
children,
|
|
7746
|
+
...props
|
|
7747
|
+
}, ref) => {
|
|
7748
|
+
const menu = useNavigationItemMenuContext("NavigationItemMenuItem");
|
|
7749
|
+
const isSelected = selected ?? menu.value === value;
|
|
7750
|
+
return /* @__PURE__ */ jsxs35(
|
|
7751
|
+
"button",
|
|
7752
|
+
{
|
|
7753
|
+
ref,
|
|
7754
|
+
type: "button",
|
|
7755
|
+
disabled,
|
|
7756
|
+
className: cn(
|
|
7757
|
+
"aviala-navigation-menu-item aviala-focus-ring",
|
|
7758
|
+
className
|
|
7759
|
+
),
|
|
7760
|
+
"data-selected": isSelected ? "true" : "false",
|
|
7761
|
+
"data-disabled": disabled ? "" : void 0,
|
|
7762
|
+
"aria-current": isSelected ? "true" : void 0,
|
|
7763
|
+
onClick: (event) => {
|
|
7764
|
+
onClick?.(event);
|
|
7765
|
+
if (!event.defaultPrevented) menu.select(value);
|
|
7766
|
+
},
|
|
7767
|
+
...props,
|
|
7768
|
+
children: [
|
|
7769
|
+
renderItemIcon3(leftIcon),
|
|
7770
|
+
/* @__PURE__ */ jsx45(
|
|
7771
|
+
Typography,
|
|
7772
|
+
{
|
|
7773
|
+
level: "text",
|
|
7774
|
+
as: "span",
|
|
7775
|
+
className: "aviala-navigation-menu-item__label",
|
|
7776
|
+
children
|
|
7777
|
+
}
|
|
7778
|
+
),
|
|
7779
|
+
rightIcon ? /* @__PURE__ */ jsx45("span", { className: "aviala-navigation-menu-item__trailing", children: renderItemIcon3(rightIcon) }) : null
|
|
7780
|
+
]
|
|
7781
|
+
}
|
|
7782
|
+
);
|
|
7783
|
+
}
|
|
7784
|
+
);
|
|
7785
|
+
NavigationItemMenuItem.displayName = "NavigationItemMenuItem";
|
|
7572
7786
|
|
|
7573
7787
|
// src/components/slider.tsx
|
|
7574
7788
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
@@ -7759,10 +7973,10 @@ Upload.displayName = "Upload";
|
|
|
7759
7973
|
// src/components/scroll-picker.tsx
|
|
7760
7974
|
import {
|
|
7761
7975
|
useCallback as useCallback15,
|
|
7762
|
-
useEffect as
|
|
7976
|
+
useEffect as useEffect10,
|
|
7763
7977
|
useId as useId3,
|
|
7764
7978
|
useLayoutEffect as useLayoutEffect6,
|
|
7765
|
-
useMemo as
|
|
7979
|
+
useMemo as useMemo9,
|
|
7766
7980
|
useRef as useRef12
|
|
7767
7981
|
} from "react";
|
|
7768
7982
|
import { jsx as jsx48, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
@@ -7809,7 +8023,7 @@ function ScrollPickerColumn({
|
|
|
7809
8023
|
},
|
|
7810
8024
|
[values]
|
|
7811
8025
|
);
|
|
7812
|
-
const repeatedValues =
|
|
8026
|
+
const repeatedValues = useMemo9(() => {
|
|
7813
8027
|
if (!loop) return [...values];
|
|
7814
8028
|
return Array.from({ length: LOOP_SECTIONS2 }, () => values).flat();
|
|
7815
8029
|
}, [loop, values]);
|
|
@@ -7876,7 +8090,7 @@ function ScrollPickerColumn({
|
|
|
7876
8090
|
if (currentValueIndex === valueIndex && inMiddleSection) return;
|
|
7877
8091
|
scrollToIndex(targetIndex, "auto");
|
|
7878
8092
|
}, [getIndex, loop, scrollToIndex, value, values.length]);
|
|
7879
|
-
|
|
8093
|
+
useEffect10(() => {
|
|
7880
8094
|
const container = scrollRef.current;
|
|
7881
8095
|
if (!container) return;
|
|
7882
8096
|
const onScrollEnd = () => {
|
|
@@ -8876,6 +9090,10 @@ export {
|
|
|
8876
9090
|
NavigationGroup,
|
|
8877
9091
|
NavigationItem,
|
|
8878
9092
|
NavigationItemGroup,
|
|
9093
|
+
NavigationItemMenu,
|
|
9094
|
+
NavigationItemMenuContent,
|
|
9095
|
+
NavigationItemMenuItem,
|
|
9096
|
+
NavigationItemMenuTrigger,
|
|
8879
9097
|
NavigationSection,
|
|
8880
9098
|
PALETTE_HUE_FAMILIES,
|
|
8881
9099
|
Pagehead,
|