@lumx/react 4.28.0-next.1 → 4.28.0-next.2

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.
Files changed (4) hide show
  1. package/index.d.ts +182 -6
  2. package/index.js +2452 -1311
  3. package/index.js.map +1 -1
  4. package/package.json +3 -4
package/index.d.ts CHANGED
@@ -1544,7 +1544,7 @@ interface ComboboxPopoverComponentProps extends ComboboxPopoverProps {
1544
1544
  }
1545
1545
 
1546
1546
  /**
1547
- * Pattern of a mounted composite element (from its role, e.g. `'listbox'` or `'grid'`): each composite
1547
+ * Pattern of a mounted composite element (from its role, e.g. `'listbox'`, `'grid'` or `'tree'`): each composite
1548
1548
  * specialization (see {@link setupComposite}) defines its own patterns.
1549
1549
  */
1550
1550
  type CompositeType = string;
@@ -1672,7 +1672,7 @@ interface CompositeHandle extends CompositeEventSource {
1672
1672
  flushPendingNavigation(): void;
1673
1673
  /** Clear the active item and discard the pending navigation intent. No-op while not mounted. */
1674
1674
  clearActiveItem(): void;
1675
- /** Make an item active. No-op while not mounted. */
1675
+ /** Make an item active (e.g. a parent tree item when its group closes). No-op while not mounted. */
1676
1676
  setActiveItem(item: HTMLElement): void;
1677
1677
  /**
1678
1678
  * Make the first selected item active, or else the first (`'first'`) or the last (`'last'`) item.
@@ -1714,8 +1714,9 @@ interface ComboboxInputOptions {
1714
1714
  * Controls how the combobox filters options as the user types.
1715
1715
  *
1716
1716
  * - `'auto'` (default) — Options are automatically filtered client-side.
1717
- * - `'manual'` — Filtering is the consumer's responsibility.
1718
- * - `'off'` — Like `'manual'`, but the input is rendered as `readOnly`
1717
+ * - `'manual'` — Filtering is the consumer's responsibility. The list still gets the filter text
1718
+ * (a tree list opens its parent items with rendered sub-items while the text is not empty).
1719
+ * - `'off'` — Like `'manual'`, but the list gets no filter text, the input is rendered as `readOnly`
1719
1720
  * and `openOnFocus` defaults to `true`.
1720
1721
  */
1721
1722
  filter?: 'auto' | 'manual' | 'off';
@@ -5921,6 +5922,181 @@ interface ToolbarProps extends GenericProps$1, ReactToJSX<ToolbarProps$1> {
5921
5922
  */
5922
5923
  declare const Toolbar: Comp<ToolbarProps, HTMLDivElement>;
5923
5924
 
5925
+ /**
5926
+ * Defines the props for the core TreeListItem template.
5927
+ */
5928
+ interface TreeListItemProps$1 extends HasClassName {
5929
+ /** Content of the row (the tree item label). */
5930
+ label?: JSXElement;
5931
+ /** The sub-items (`TreeListItem` or `ListboxOptionSkeleton` elements). */
5932
+ children?: JSXElement;
5933
+ /** A component to be rendered before the label (e.g. an icon or avatar). */
5934
+ before?: JSXElement;
5935
+ /** A component to be rendered after the label. */
5936
+ after?: JSXElement;
5937
+ /** Helper description (part of the filter match text). */
5938
+ description?: string;
5939
+ /** The value of the tree item. With a value, the tree item is selectable; without, it is not. */
5940
+ value?: string;
5941
+ /** Whether the tree item is selected (internal: from the tree `value`; no effect on a non-selectable tree item). */
5942
+ isSelected?: boolean;
5943
+ /** Props forwarded to a Tooltip wrapping the `role="treeitem"` element. */
5944
+ tooltipProps?: Record<string, any>;
5945
+ /** Extra props forwarded to the inner `role="treeitem"` element. */
5946
+ actionProps?: Record<string, any>;
5947
+ /** ref to the root `<li>` element. */
5948
+ ref?: CommonRef;
5949
+ /**
5950
+ * Unique ID for the tree item element (internal). The IDs of the label, the description and the group are
5951
+ * `<id>-label`, `<id>-description` and `<id>-group`.
5952
+ */
5953
+ id?: string;
5954
+ /** Whether the tree item is a parent item (internal: it has sub-items, or it loads them on open). */
5955
+ isParent?: boolean;
5956
+ /** Whether the parent item is open (internal). */
5957
+ isOpen?: boolean;
5958
+ /** Whether the filter hides the tree item (internal). */
5959
+ hidden?: boolean;
5960
+ /** Nesting level of the tree item (internal, 0 at the root). Its group sets the level of the sub-items. */
5961
+ level?: number;
5962
+ /** On click on the tree item (and on Enter). */
5963
+ handleClick?(): void;
5964
+ /** On click on the expand toggle. */
5965
+ handleToggleClick?(): void;
5966
+ }
5967
+ /**
5968
+ * Props that React/Vue wrappers need to re-declare with framework-specific types.
5969
+ */
5970
+ type TreeListItemPropsToOverride = 'label' | 'before' | 'after' | 'children' | 'tooltipProps' | 'actionProps';
5971
+
5972
+ /** Props computed by the component (not public). */
5973
+ type InternalProps = 'id' | 'isParent' | 'isOpen' | 'isSelected' | 'hidden' | 'level' | 'handleClick' | 'handleToggleClick';
5974
+ /**
5975
+ * Props for the TreeListItem component.
5976
+ */
5977
+ interface TreeListItemProps extends GenericProps$1, ReactToJSX<TreeListItemProps$1, TreeListItemPropsToOverride | InternalProps> {
5978
+ /** Content of the row (the tree item label). */
5979
+ label: ReactNode;
5980
+ /**
5981
+ * The sub-items: `TreeListItem`, `Combobox.OptionSkeleton` or `Combobox.State`.
5982
+ * A tree item with sub-items is a parent item.
5983
+ */
5984
+ children?: ReactNode;
5985
+ /**
5986
+ * Make a lazy parent item: a parent item with no sub-items until the user opens it (load the
5987
+ * sub-items in `onOpenChange`). Not needed when sub-items are present.
5988
+ * In a combobox, the open state resets on each popup open: cache the loaded sub-items.
5989
+ */
5990
+ hasSubItems?: boolean;
5991
+ /**
5992
+ * Called on every open and close by the user (expand toggle, Right, Left, Enter or a click on a
5993
+ * non-selectable parent item). Not called for the initial state or for the filter.
5994
+ */
5995
+ onOpenChange?(isOpen: boolean): void;
5996
+ /** On tree item clicked (or activated with Enter), selectable or not. */
5997
+ onClick?(): void;
5998
+ /** Content rendered before the label (e.g. an icon). */
5999
+ before?: ReactNode;
6000
+ /** Content rendered after the label. */
6001
+ after?: ReactNode;
6002
+ /** Props forwarded to a Tooltip wrapping the `role="treeitem"` element. */
6003
+ tooltipProps?: Partial<TooltipProps>;
6004
+ /** Props forwarded to the inner `role="treeitem"` element. */
6005
+ actionProps?: CompositeItemActionProps<any>;
6006
+ }
6007
+ /**
6008
+ * TreeListItem component: one tree item of a `TreeList`, with its sub-items.
6009
+ *
6010
+ * - With a `value`, the tree item is selectable (Enter or a click selects it), and it is selected when the
6011
+ * tree `value` holds it. Without, it is not selectable: Enter or a click on a non-selectable parent item
6012
+ * opens or closes it, and on a non-selectable leaf item only calls `onClick` (e.g. an action such as
6013
+ * "Create a new list…").
6014
+ * - The open state is internal: a parent item starts open when a sub-item at any depth is selected.
6015
+ * In a combobox, it resets on each popup open.
6016
+ * - Touch screen readers: TalkBack (Chrome) can open and close the parent items. On iOS, a user can
6017
+ * only reach the sub-items of a selectable parent item through the filter. To support it, use a
6018
+ * non-selectable parent item with an "All <name>" leaf item that carries the parent value.
6019
+ *
6020
+ * @param props Component props.
6021
+ * @param ref Component ref.
6022
+ * @return React element.
6023
+ */
6024
+ declare const TreeListItem: Comp<TreeListItemProps, HTMLLIElement>;
6025
+
6026
+ /** Selection type of a tree list: one selected value, or several. */
6027
+ type TreeListSelectionType = 'single' | 'multiple';
6028
+
6029
+ /**
6030
+ * Defines the props for the core TreeList template.
6031
+ */
6032
+ interface TreeListProps$1 extends HasClassName {
6033
+ /** Accessible label of the tree (one of `aria-label` or `aria-labelledby` is required). */
6034
+ 'aria-label'?: string;
6035
+ /** ID of the element that labels the tree. */
6036
+ 'aria-labelledby'?: string;
6037
+ /**
6038
+ * Indicates that the tree content is incomplete (root skeletons, the first load of the tree). Not rendered
6039
+ * when false.
6040
+ */
6041
+ 'aria-busy'?: boolean;
6042
+ /**
6043
+ * Selection type: one selected tree item, or several (`aria-multiselectable`).
6044
+ */
6045
+ selectionType?: TreeListSelectionType;
6046
+ /** Content (`TreeListItem` or `ListboxOptionSkeleton` elements). Render the states outside the tree. */
6047
+ children?: JSXElement;
6048
+ /** The ID of the tree element. */
6049
+ id?: string;
6050
+ /** Tab index (`0` on a standalone list, which owns focus). */
6051
+ tabIndex?: number;
6052
+ /** ref to the root element */
6053
+ ref?: CommonRef;
6054
+ }
6055
+
6056
+ /** Props common to the single and multiple selection trees. */
6057
+ interface BaseTreeListProps extends ReactToJSX<TreeListProps$1, 'aria-busy' | 'children' | 'selectionType'> {
6058
+ /** The tree items (`TreeListItem`), and `Combobox.OptionSkeleton` or `Combobox.State`. */
6059
+ children?: ReactNode;
6060
+ /**
6061
+ * Called when a selectable tree item is selected (Enter, Space or a click), in a standalone tree only.
6062
+ * In a combobox, the trigger `onSelect` (`Combobox.Input` or `Combobox.Button`) handles the selection.
6063
+ */
6064
+ onSelect?(option: {
6065
+ value: string;
6066
+ }): void;
6067
+ }
6068
+ /** Single selection tree props (`selectionType` defaults to `'single'`). */
6069
+ interface SingleTreeListProps extends BaseTreeListProps {
6070
+ /** Selection type. Optional: defaults to `'single'`. */
6071
+ selectionType?: 'single';
6072
+ /** The value of the selected tree item (or `undefined` when nothing is selected). */
6073
+ value?: string;
6074
+ /** Called with the value of the selected tree item when the selection changes. */
6075
+ onChange?(newValue: string): void;
6076
+ }
6077
+ /** Multiple selection tree props (`selectionType: 'multiple'` is required to opt in). */
6078
+ interface MultipleTreeListProps extends BaseTreeListProps {
6079
+ /** Selection type. */
6080
+ selectionType: 'multiple';
6081
+ /** The values of the selected tree items. */
6082
+ value?: string[];
6083
+ /** Called with the values of the selected tree items when the selection changes (the selected item is toggled). */
6084
+ onChange?(newValue: string[]): void;
6085
+ }
6086
+ /**
6087
+ * Props of the TreeList component. Discriminated on `selectionType`: with `'multiple'`, `value` and `onChange`
6088
+ * take arrays.
6089
+ */
6090
+ type TreeListProps = SingleTreeListProps | MultipleTreeListProps;
6091
+
6092
+ /**
6093
+ * TreeList compound component: `TreeList.Item` is the tree item (also exported as `TreeListItem`).
6094
+ */
6095
+ declare const TreeList: Comp<TreeListProps, HTMLUListElement> & {
6096
+ /** One tree item of the tree, with its sub-items. */
6097
+ Item: Comp<TreeListItemProps, HTMLLIElement>;
6098
+ };
6099
+
5924
6100
  /**
5925
6101
  * Uploader variants.
5926
6102
  */
@@ -6141,5 +6317,5 @@ declare const ThemeProvider: React__default.FC<{
6141
6317
  /** Get the theme in the current context. */
6142
6318
  declare function useTheme(): ThemeContextValue;
6143
6319
 
6144
- export { AlertDialog, Autocomplete, AutocompleteMultiple, Avatar, Badge, BadgeWrapper, Button, ButtonEmphasis, ButtonGroup, CLASSNAME$2 as CLASSNAME, COMPONENT_NAME$2 as COMPONENT_NAME, Card, Checkbox, Chip, ChipGroup, Combobox, CommentBlock, CommentBlockVariant, DEFAULT_PROPS$1 as DEFAULT_PROPS, DatePicker, DatePickerControlled, DatePickerField, Dialog, DialogHeading, Divider, DragHandle, Dropdown, ExpansionPanel, Flag, FlexBox, GenericBlock, GenericBlockGapSize, Grid, GridColumn, GridItem, Heading, HeadingLevelProvider, Icon, IconButton, ImageBlock, ImageBlockCaptionPosition, ImageLightbox, InlineList, InputHelper, InputLabel, InputRequiredLegend, Lightbox, Link, LinkPreview, List, ListDivider, ListItem, ListSection, ListSubheader, MenuButton, ListDivider as MenuDivider, MenuItem, Message, Mosaic, Navigation, Notification, Placement, Popover, PopoverDialog, PostBlock, Progress, ProgressCircular, ProgressLinear, ProgressTracker, ProgressTrackerProvider, ProgressTrackerStep, ProgressTrackerStepPanel, ProgressVariant, RadioButton, RadioGroup, RawInputText, RawInputTextarea, Select, SelectButton, SelectMultiple, SelectMultipleField, SelectTextField, SelectVariant, SelectionChipGroup, SideNavigation, SideNavigationItem, SkeletonCircle, SkeletonRectangle, SkeletonRectangleVariant, SkeletonTypography, Slider, Slides, Slideshow, SlideshowControls, SlideshowItem, Switch, CLASSNAME as TIME_PICKER_FIELD_CLASSNAME, COMPONENT_NAME as TIME_PICKER_FIELD_COMPONENT_NAME, Tab, TabList, TabListLayout, TabPanel, TabProvider, Table, TableBody, TableCell, TableCellVariant, TableCellVariant as TableCellVariantType, TableHeader, TableRow, Text, TextField, ThOrder, ThOrder as ThOrderType, ThemeProvider, Thumbnail, ThumbnailAspectRatio, ThumbnailObjectFit, ThumbnailVariant, TimePickerField, Toolbar, Tooltip, Uploader, UploaderVariant, UserBlock, clamp, useFocusPointStyle, useHeadingLevel, useTheme };
6145
- export type { AlertDialogProps, AutocompleteMultipleProps, AutocompleteProps, AvatarProps, AvatarSize, BadgeProps, BadgeWrapperProps, BaseButtonProps, ButtonGroupProps, ButtonProps, ButtonSize, CardProps, CheckboxProps, ChipGroupProps, ChipProps, ComboboxButtonProps, ComboboxInputProps, ListboxListProps as ComboboxListProps, ListboxOptionActionProps as ComboboxOptionActionProps, ListboxOptionMoreInfoProps as ComboboxOptionMoreInfoProps, ListboxOptionProps as ComboboxOptionProps, ListboxOptionSkeletonProps as ComboboxOptionSkeletonProps, ComboboxPopoverComponentProps, ComboboxPopoverProps, ComboboxProviderProps, ListboxSectionProps as ComboboxSectionProps, CompositeStatusProps as ComboboxStateProps, CommentBlockProps, DatePickerControlledProps, DatePickerFieldProps, DatePickerProps, DialogHeadingProps, DialogProps, DialogSizes, DividerProps, DragHandleProps, DropdownProps, Elevation, ExpansionPanelProps, FlagProps, FlexBoxProps, FlexHorizontalAlignment, FlexVerticalAlignment, FocusPoint, GapSize, GenericBlockProps, GenericBlockSectionProps, GridColumnGapSize, GridColumnProps, GridItemProps, GridProps, HeadingLevelProviderProps, HeadingProps, IconButtonProps, IconProps, IconSizes, ImageBlockProps, ImageBlockSize, ImageLightboxProps, InlineListProps, InputHelperProps, InputLabelProps, InputRequiredLegendProps, LightboxProps, LinkPreviewProps, LinkProps, ListDividerProps, ListItemProps, ListItemSize, ListProps, ListSectionProps, ListSubheaderProps, MarginAutoAlignment, MenuButtonProps, ListDividerProps as MenuDividerProps, MenuItemActionProps, MenuItemProps, MessageProps, MosaicProps, MultipleSelectButtonProps, MultipleSelectTextFieldProps, NavigationProps, NotificationProps, Offset, PopoverDialogProps, PopoverHeight, PopoverProps, PopoverWidth, PostBlockProps, ProgressCircularProps, ProgressCircularSize, ProgressLinearProps, ProgressProps, ProgressTrackerProps, ProgressTrackerProviderProps, ProgressTrackerStepPanelProps, ProgressTrackerStepProps, RadioButtonProps, RadioGroupProps, RawInputTextProps, RawInputTextareaProps, SelectButtonProps, SelectListStatus as SelectButtonStatus, SelectButtonTranslations, SelectListStatus, SelectMultipleProps, SelectProps, SelectTextFieldProps, SelectListStatus as SelectTextFieldStatus, SelectTextFieldTranslations, SelectionChipGroupProps, SideNavigationItemProps, SideNavigationProps, SingleSelectButtonProps, SingleSelectTextFieldProps, SkeletonCircleProps, SkeletonRectangleProps, SkeletonTypographyProps, SliderProps, SlidesProps, SlideshowControlsProps, SlideshowItemProps, SlideshowProps, SwitchProps, TabListProps, TabPanelProps, TabProps, TabProviderProps, TableBodyProps, TableCellProps, TableHeaderProps, TableProps, TableRowProps, TextFieldProps, TextProps, ThumbnailProps, ThumbnailSize, TimePickerFieldProps, ToolbarProps, TooltipPlacement, TooltipProps, UploaderProps, UploaderSize, UserBlockProps, UserBlockSize };
6320
+ export { AlertDialog, Autocomplete, AutocompleteMultiple, Avatar, Badge, BadgeWrapper, Button, ButtonEmphasis, ButtonGroup, CLASSNAME$2 as CLASSNAME, COMPONENT_NAME$2 as COMPONENT_NAME, Card, Checkbox, Chip, ChipGroup, Combobox, CommentBlock, CommentBlockVariant, DEFAULT_PROPS$1 as DEFAULT_PROPS, DatePicker, DatePickerControlled, DatePickerField, Dialog, DialogHeading, Divider, DragHandle, Dropdown, ExpansionPanel, Flag, FlexBox, GenericBlock, GenericBlockGapSize, Grid, GridColumn, GridItem, Heading, HeadingLevelProvider, Icon, IconButton, ImageBlock, ImageBlockCaptionPosition, ImageLightbox, InlineList, InputHelper, InputLabel, InputRequiredLegend, Lightbox, Link, LinkPreview, List, ListDivider, ListItem, ListSection, ListSubheader, MenuButton, ListDivider as MenuDivider, MenuItem, Message, Mosaic, Navigation, Notification, Placement, Popover, PopoverDialog, PostBlock, Progress, ProgressCircular, ProgressLinear, ProgressTracker, ProgressTrackerProvider, ProgressTrackerStep, ProgressTrackerStepPanel, ProgressVariant, RadioButton, RadioGroup, RawInputText, RawInputTextarea, Select, SelectButton, SelectMultiple, SelectMultipleField, SelectTextField, SelectVariant, SelectionChipGroup, SideNavigation, SideNavigationItem, SkeletonCircle, SkeletonRectangle, SkeletonRectangleVariant, SkeletonTypography, Slider, Slides, Slideshow, SlideshowControls, SlideshowItem, Switch, CLASSNAME as TIME_PICKER_FIELD_CLASSNAME, COMPONENT_NAME as TIME_PICKER_FIELD_COMPONENT_NAME, Tab, TabList, TabListLayout, TabPanel, TabProvider, Table, TableBody, TableCell, TableCellVariant, TableCellVariant as TableCellVariantType, TableHeader, TableRow, Text, TextField, ThOrder, ThOrder as ThOrderType, ThemeProvider, Thumbnail, ThumbnailAspectRatio, ThumbnailObjectFit, ThumbnailVariant, TimePickerField, Toolbar, Tooltip, TreeList, TreeListItem, Uploader, UploaderVariant, UserBlock, clamp, useFocusPointStyle, useHeadingLevel, useTheme };
6321
+ export type { AlertDialogProps, AutocompleteMultipleProps, AutocompleteProps, AvatarProps, AvatarSize, BadgeProps, BadgeWrapperProps, BaseButtonProps, ButtonGroupProps, ButtonProps, ButtonSize, CardProps, CheckboxProps, ChipGroupProps, ChipProps, ComboboxButtonProps, ComboboxInputProps, ListboxListProps as ComboboxListProps, ListboxOptionActionProps as ComboboxOptionActionProps, ListboxOptionMoreInfoProps as ComboboxOptionMoreInfoProps, ListboxOptionProps as ComboboxOptionProps, ListboxOptionSkeletonProps as ComboboxOptionSkeletonProps, ComboboxPopoverComponentProps, ComboboxPopoverProps, ComboboxProviderProps, ListboxSectionProps as ComboboxSectionProps, CompositeStatusProps as ComboboxStateProps, CommentBlockProps, DatePickerControlledProps, DatePickerFieldProps, DatePickerProps, DialogHeadingProps, DialogProps, DialogSizes, DividerProps, DragHandleProps, DropdownProps, Elevation, ExpansionPanelProps, FlagProps, FlexBoxProps, FlexHorizontalAlignment, FlexVerticalAlignment, FocusPoint, GapSize, GenericBlockProps, GenericBlockSectionProps, GridColumnGapSize, GridColumnProps, GridItemProps, GridProps, HeadingLevelProviderProps, HeadingProps, IconButtonProps, IconProps, IconSizes, ImageBlockProps, ImageBlockSize, ImageLightboxProps, InlineListProps, InputHelperProps, InputLabelProps, InputRequiredLegendProps, LightboxProps, LinkPreviewProps, LinkProps, ListDividerProps, ListItemProps, ListItemSize, ListProps, ListSectionProps, ListSubheaderProps, MarginAutoAlignment, MenuButtonProps, ListDividerProps as MenuDividerProps, MenuItemActionProps, MenuItemProps, MessageProps, MosaicProps, MultipleSelectButtonProps, MultipleSelectTextFieldProps, MultipleTreeListProps, NavigationProps, NotificationProps, Offset, PopoverDialogProps, PopoverHeight, PopoverProps, PopoverWidth, PostBlockProps, ProgressCircularProps, ProgressCircularSize, ProgressLinearProps, ProgressProps, ProgressTrackerProps, ProgressTrackerProviderProps, ProgressTrackerStepPanelProps, ProgressTrackerStepProps, RadioButtonProps, RadioGroupProps, RawInputTextProps, RawInputTextareaProps, SelectButtonProps, SelectListStatus as SelectButtonStatus, SelectButtonTranslations, SelectListStatus, SelectMultipleProps, SelectProps, SelectTextFieldProps, SelectListStatus as SelectTextFieldStatus, SelectTextFieldTranslations, SelectionChipGroupProps, SideNavigationItemProps, SideNavigationProps, SingleSelectButtonProps, SingleSelectTextFieldProps, SingleTreeListProps, SkeletonCircleProps, SkeletonRectangleProps, SkeletonTypographyProps, SliderProps, SlidesProps, SlideshowControlsProps, SlideshowItemProps, SlideshowProps, SwitchProps, TabListProps, TabPanelProps, TabProps, TabProviderProps, TableBodyProps, TableCellProps, TableHeaderProps, TableProps, TableRowProps, TextFieldProps, TextProps, ThumbnailProps, ThumbnailSize, TimePickerFieldProps, ToolbarProps, TooltipPlacement, TooltipProps, TreeListItemProps, TreeListProps, UploaderProps, UploaderSize, UserBlockProps, UserBlockSize };