@lumx/react 4.27.1-alpha.1 → 4.27.1-alpha.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.
- package/index.d.ts +339 -42
- package/index.js +6687 -5404
- package/index.js.map +1 -1
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -1543,6 +1543,35 @@ interface ComboboxPopoverComponentProps extends ComboboxPopoverProps {
|
|
|
1543
1543
|
children: ReactNode;
|
|
1544
1544
|
}
|
|
1545
1545
|
|
|
1546
|
+
/**
|
|
1547
|
+
* Pattern of a mounted composite element (from its role, e.g. `'listbox'`, `'grid'` or `'tree'`): each composite
|
|
1548
|
+
* specialization (see {@link setupComposite}) defines its own patterns.
|
|
1549
|
+
*/
|
|
1550
|
+
type CompositeType = string;
|
|
1551
|
+
/** Mode of the filter (see {@link CompositeHandle.setFilter}). */
|
|
1552
|
+
type CompositeFilterMode = 'auto' | 'manual';
|
|
1553
|
+
/**
|
|
1554
|
+
* State of a composite for its live region (see `CompositeStatus`): the item count, the loading state and the
|
|
1555
|
+
* open state, as one snapshot (see {@link CompositeEventMap.stateChange}).
|
|
1556
|
+
*/
|
|
1557
|
+
interface CompositeState {
|
|
1558
|
+
/** The number of visible items. */
|
|
1559
|
+
optionsLength: number;
|
|
1560
|
+
/** The current input value (combobox only, empty string otherwise). */
|
|
1561
|
+
inputValue: string;
|
|
1562
|
+
/** Whether the item count must not be announced (set by the composite specialization). */
|
|
1563
|
+
isCountHidden: boolean;
|
|
1564
|
+
/** Whether root skeletons are registered (loading), at once. */
|
|
1565
|
+
isLoading: boolean;
|
|
1566
|
+
/** Whether the loading lasted long enough to be announced (500ms after skeletons mount while open). */
|
|
1567
|
+
isLoadingAnnounced: boolean;
|
|
1568
|
+
/**
|
|
1569
|
+
* Whether the items are open for the live region: set 100ms after the composite opens (the popover must
|
|
1570
|
+
* be in the accessibility tree before the live region content changes), cleared at once when it closes.
|
|
1571
|
+
* A standalone composite is always open.
|
|
1572
|
+
*/
|
|
1573
|
+
isOpenForAnnouncement: boolean;
|
|
1574
|
+
}
|
|
1546
1575
|
/** Map of composite event names to their payload types. */
|
|
1547
1576
|
interface CompositeEventMap {
|
|
1548
1577
|
/** Fired when the active descendant changes (visual focus). Payload: the active item id or null. */
|
|
@@ -1559,20 +1588,22 @@ interface CompositeEventMap {
|
|
|
1559
1588
|
} | undefined;
|
|
1560
1589
|
/**
|
|
1561
1590
|
* Fired immediately when the aggregate loading state changes (root skeleton count transitions
|
|
1562
|
-
* between 0 and >0). Used for
|
|
1591
|
+
* between 0 and >0). Used for `aria-busy` on the list. The live region reads the loading state and
|
|
1592
|
+
* the loading announcement from {@link stateChange}.
|
|
1563
1593
|
*/
|
|
1564
1594
|
loadingChange: boolean;
|
|
1565
|
-
/**
|
|
1566
|
-
* Fired after a 500ms debounce when loading persists while the items are visible,
|
|
1567
|
-
* or immediately when loading ends. Used to control the loading message text in the live region.
|
|
1568
|
-
*/
|
|
1569
|
-
loadingAnnouncement: boolean;
|
|
1570
1595
|
/**
|
|
1571
1596
|
* Fired when the items become visible or hidden (see {@link CompositeHandle.setOpen}).
|
|
1572
1597
|
* Inside a combobox, this is the combobox open state. A standalone composite is open from
|
|
1573
1598
|
* creation and never closes.
|
|
1574
1599
|
*/
|
|
1575
1600
|
open: boolean;
|
|
1601
|
+
/**
|
|
1602
|
+
* Fired when any field of the live region state changes (see {@link CompositeState}): the visible count,
|
|
1603
|
+
* the loading state, the loading announcement, and the delayed open state. Has a value from creation
|
|
1604
|
+
* (`undefined` only as the initial value of the framework hooks, without a handle).
|
|
1605
|
+
*/
|
|
1606
|
+
stateChange: CompositeState | undefined;
|
|
1576
1607
|
/**
|
|
1577
1608
|
* Fired only when this item becomes the active descendant (true)
|
|
1578
1609
|
* or stops being the active descendant (false).
|
|
@@ -1580,6 +1611,91 @@ interface CompositeEventMap {
|
|
|
1580
1611
|
*/
|
|
1581
1612
|
[event: OptionActiveEvent]: boolean;
|
|
1582
1613
|
}
|
|
1614
|
+
/** Read-only event source of a composite handle (`subscribe` + `getSnapshot`). */
|
|
1615
|
+
interface CompositeEventSource<M = CompositeEventMap> {
|
|
1616
|
+
/** Subscribe to an event. Returns an unsubscribe function. */
|
|
1617
|
+
subscribe<K extends keyof M>(event: K, callback: (value: M[K]) => void): () => void;
|
|
1618
|
+
/** Read the last dispatched value of an event (for pull-based subscribers). */
|
|
1619
|
+
getSnapshot<K extends keyof M>(event: K): M[K] | undefined;
|
|
1620
|
+
}
|
|
1621
|
+
/**
|
|
1622
|
+
* Handle returned by {@link setupComposite}: the behavior shared by the composite widgets
|
|
1623
|
+
* (one active item among many: listbox, grid, …).
|
|
1624
|
+
*/
|
|
1625
|
+
interface CompositeHandle extends CompositeEventSource {
|
|
1626
|
+
/**
|
|
1627
|
+
* Mount the composite element: create the focus navigation and the delegated click/mousedown
|
|
1628
|
+
* listeners. In standalone mode, also attach the keyboard and focus listeners.
|
|
1629
|
+
* Returns a cleanup function that unmounts it. Mounting another element unmounts the previous one.
|
|
1630
|
+
*/
|
|
1631
|
+
mount(element: HTMLElement): () => void;
|
|
1632
|
+
/** Tear down all listeners and state. */
|
|
1633
|
+
destroy(): void;
|
|
1634
|
+
/** The mounted composite element. */
|
|
1635
|
+
readonly element: HTMLElement | null;
|
|
1636
|
+
/** Pattern of the mounted element (null while not mounted). */
|
|
1637
|
+
readonly type: CompositeType | null;
|
|
1638
|
+
/** The active item (null while there is none, or while not mounted). */
|
|
1639
|
+
readonly activeItem: HTMLElement | null;
|
|
1640
|
+
/** Whether the composite owns focus itself (no `focusOwner` link). */
|
|
1641
|
+
readonly isStandalone: boolean;
|
|
1642
|
+
/** Whether the items are visible (standalone: always; combobox: the open state). */
|
|
1643
|
+
readonly isOpen: boolean;
|
|
1644
|
+
/** Whether the composite is in multi-select mode (`aria-multiselectable="true"`). */
|
|
1645
|
+
readonly isMultiSelect: boolean;
|
|
1646
|
+
/**
|
|
1647
|
+
* Whether the composite has visible items or root skeletons. Without them, the mounted element gets
|
|
1648
|
+
* `hidden` (unless it holds a status: the live region, e.g. a `Combobox.State` inside the list).
|
|
1649
|
+
*/
|
|
1650
|
+
readonly hasVisibleContent: boolean;
|
|
1651
|
+
/**
|
|
1652
|
+
* Set whether the items are visible (standalone: always visible; combobox: open state).
|
|
1653
|
+
* The loading announcement only fires while the items are visible.
|
|
1654
|
+
*/
|
|
1655
|
+
setOpen(isOpen: boolean): void;
|
|
1656
|
+
/**
|
|
1657
|
+
* Select an item and fire `onSelect` with its value.
|
|
1658
|
+
* With `null`, clear the selection: `onSelect` receives an empty string value and a null element.
|
|
1659
|
+
*/
|
|
1660
|
+
select(option: HTMLElement | null): void;
|
|
1661
|
+
/**
|
|
1662
|
+
* Handle the navigation keys: arrows, Home/End, PageUp/PageDown, Enter, Space,
|
|
1663
|
+
* ArrowLeft/ArrowRight (delegated to the navigation module) and typeahead. The only navigation
|
|
1664
|
+
* implementation: a standalone composite calls it from its own keydown, a combobox calls it from
|
|
1665
|
+
* the trigger keydown.
|
|
1666
|
+
* Returns true when the key was handled: ArrowDown/ArrowUp/Home/End always; Enter/Space and
|
|
1667
|
+
* PageUp/PageDown with an active item; ArrowLeft/ArrowRight always in a standalone composite, and in a
|
|
1668
|
+
* linked one only when the navigation module handled them.
|
|
1669
|
+
*/
|
|
1670
|
+
handleKeydown(event: KeyboardEvent): boolean;
|
|
1671
|
+
/** Replay the pending navigation intent (see {@link activateDefaultItem}). */
|
|
1672
|
+
flushPendingNavigation(): void;
|
|
1673
|
+
/** Clear the active item and discard the pending navigation intent. No-op while not mounted. */
|
|
1674
|
+
clearActiveItem(): void;
|
|
1675
|
+
/** Make an item active (e.g. a parent tree item when its group closes). No-op while not mounted. */
|
|
1676
|
+
setActiveItem(item: HTMLElement): void;
|
|
1677
|
+
/**
|
|
1678
|
+
* Make the first selected item active, or else the first (`'first'`) or the last (`'last'`) item.
|
|
1679
|
+
* When no item can become active yet (e.g. the combobox popup is opening and its items are not
|
|
1680
|
+
* rendered), keep the intent until {@link flushPendingNavigation}. No-op while not mounted.
|
|
1681
|
+
*/
|
|
1682
|
+
activateDefaultItem(edge: 'first' | 'last'): void;
|
|
1683
|
+
/**
|
|
1684
|
+
* Set the filter value. The specialization applies it:
|
|
1685
|
+
* - `'auto'` (default): hide the items that do not match.
|
|
1686
|
+
* - `'manual'`: the consumer renders the result (the specialization hides nothing).
|
|
1687
|
+
*/
|
|
1688
|
+
setFilter(filterValue: string, mode?: CompositeFilterMode): void;
|
|
1689
|
+
/**
|
|
1690
|
+
* Register a skeleton placeholder. Returns a cleanup function (a second call does nothing).
|
|
1691
|
+
* A root skeleton makes the composite busy (`loadingChange`). A nested skeleton
|
|
1692
|
+
* (`isNested`, inside a nested level of items) does not make it busy, but it starts the loading
|
|
1693
|
+
* announcement.
|
|
1694
|
+
*/
|
|
1695
|
+
registerSkeleton(options?: {
|
|
1696
|
+
isNested?: boolean;
|
|
1697
|
+
}): () => void;
|
|
1698
|
+
}
|
|
1583
1699
|
|
|
1584
1700
|
/** Callbacks provided by the consumer (React/Vue) to react to combobox state changes. */
|
|
1585
1701
|
interface ComboboxCallbacks {
|
|
@@ -1598,7 +1714,8 @@ interface ComboboxInputOptions {
|
|
|
1598
1714
|
* Controls how the combobox filters options as the user types.
|
|
1599
1715
|
*
|
|
1600
1716
|
* - `'auto'` (default) — Options are automatically filtered client-side.
|
|
1601
|
-
* - `'manual'` — Filtering is the consumer's responsibility.
|
|
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).
|
|
1602
1719
|
* - `'off'` — Like `'manual'`, but the input is rendered as `readOnly`
|
|
1603
1720
|
* and `openOnFocus` defaults to `true`.
|
|
1604
1721
|
*/
|
|
@@ -1625,6 +1742,31 @@ interface ComboboxInputOptions {
|
|
|
1625
1742
|
*/
|
|
1626
1743
|
selectionMode?: 'fill' | 'keep' | 'clear';
|
|
1627
1744
|
}
|
|
1745
|
+
/**
|
|
1746
|
+
* Map of combobox event names to their payload types.
|
|
1747
|
+
*
|
|
1748
|
+
* The combobox owns `open`, `expanded` and `composite`. The other events are the ones of the attached list (see
|
|
1749
|
+
* {@link CompositeEventMap}): the combobox forwards them from the current list, re-subscribes when the list
|
|
1750
|
+
* changes, and then dispatches the snapshot of the new list (`undefined` when no list is attached).
|
|
1751
|
+
*/
|
|
1752
|
+
interface ComboboxEventMap extends CompositeEventMap {
|
|
1753
|
+
/**
|
|
1754
|
+
* Fired when the popup opens or closes (see {@link ComboboxHandle.setIsOpen}).
|
|
1755
|
+
* Owned by the combobox (it exists before any list registers) and forwarded to the registered list.
|
|
1756
|
+
* Replayed on subscribe while open.
|
|
1757
|
+
*/
|
|
1758
|
+
open: boolean;
|
|
1759
|
+
/**
|
|
1760
|
+
* Fired when the trigger `aria-expanded` changes: the popup is open and the list has something to show
|
|
1761
|
+
* (visible items or root skeletons, see {@link CompositeHandle.hasVisibleContent}).
|
|
1762
|
+
*/
|
|
1763
|
+
expanded: boolean;
|
|
1764
|
+
/**
|
|
1765
|
+
* Fired when a composite (listbox, grid, tree, …) attaches as the list of the combobox, or detaches (see
|
|
1766
|
+
* {@link ComboboxHandle.attachList}). Payload: the composite handle, or null.
|
|
1767
|
+
*/
|
|
1768
|
+
composite: CompositeHandle | null;
|
|
1769
|
+
}
|
|
1628
1770
|
|
|
1629
1771
|
/**
|
|
1630
1772
|
* Defines the props for the core ComboboxInput template.
|
|
@@ -1897,6 +2039,8 @@ interface ComboboxProviderProps {
|
|
|
1897
2039
|
*
|
|
1898
2040
|
* Provides shared context to sub-components. The vanilla JS combobox handle is
|
|
1899
2041
|
* created by the trigger sub-component (Combobox.Input or Combobox.Button) on mount.
|
|
2042
|
+
* The list handle is created by the list component, which registers it on the combobox handle:
|
|
2043
|
+
* the provider shares the registered list with the sub-components (composite context).
|
|
1900
2044
|
*
|
|
1901
2045
|
* @param props Component props.
|
|
1902
2046
|
* @return React element.
|
|
@@ -1907,12 +2051,14 @@ declare namespace ComboboxProvider {
|
|
|
1907
2051
|
}
|
|
1908
2052
|
|
|
1909
2053
|
/**
|
|
1910
|
-
* Hook to subscribe to a combobox event (`open`, `optionsChange`, `loadingChange`,
|
|
2054
|
+
* Hook to subscribe to a combobox event (`open`, `expanded`, `optionsChange`, `loadingChange`,
|
|
1911
2055
|
* `activeDescendantChange`, …). Must be used within a `Combobox.Provider`.
|
|
1912
2056
|
*
|
|
1913
|
-
* The
|
|
2057
|
+
* The combobox handle owns the `open` and `expanded` events (even before a list registers) and forwards the other events
|
|
2058
|
+
* from the registered list: it re-subscribes when the registered list changes and dispatches the snapshot of
|
|
2059
|
+
* the new list (see `ComboboxEventMap`).
|
|
1914
2060
|
*/
|
|
1915
|
-
declare function useComboboxEvent<K extends keyof
|
|
2061
|
+
declare function useComboboxEvent<K extends keyof ComboboxEventMap>(event: K, initialValue: ComboboxEventMap[K]): ComboboxEventMap[K];
|
|
1916
2062
|
|
|
1917
2063
|
/**
|
|
1918
2064
|
* Props for Combobox.Button component.
|
|
@@ -2207,7 +2353,7 @@ interface ListboxSectionProps extends GenericProps$1, ReactToJSX<ListboxSectionP
|
|
|
2207
2353
|
/**
|
|
2208
2354
|
* Defines the props for the core CompositeStatus template.
|
|
2209
2355
|
*/
|
|
2210
|
-
interface CompositeStatusProps$1 {
|
|
2356
|
+
interface CompositeStatusProps$1 extends HasClassName {
|
|
2211
2357
|
/**
|
|
2212
2358
|
* Message to display when the composite has no visible items.
|
|
2213
2359
|
* Can be a plain string or a function receiving the current input value (for dynamic messages).
|
|
@@ -2239,40 +2385,16 @@ interface CompositeStatusProps$1 {
|
|
|
2239
2385
|
*/
|
|
2240
2386
|
loadingMessage?: string;
|
|
2241
2387
|
/**
|
|
2242
|
-
*
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
* The number of currently visible items.
|
|
2247
|
-
* Driven by the framework wrapper via the composite handle's `optionsChange` event.
|
|
2248
|
-
*/
|
|
2249
|
-
optionsLength?: number;
|
|
2250
|
-
/**
|
|
2251
|
-
* The current value of the combobox input.
|
|
2252
|
-
* Passed to `emptyMessage` when it is a function.
|
|
2253
|
-
*/
|
|
2254
|
-
inputValue?: string;
|
|
2255
|
-
/**
|
|
2256
|
-
* Whether loading is active (immediate, from `loadingChange` event).
|
|
2257
|
-
* Used to suppress false "empty" state while data is loading.
|
|
2258
|
-
*/
|
|
2259
|
-
isLoading?: boolean;
|
|
2260
|
-
/**
|
|
2261
|
-
* Whether the combobox popover is open.
|
|
2262
|
-
* Used to gate live region content so screen readers announce messages
|
|
2263
|
-
* when the popover opens (content insertion triggers `aria-live` announcement).
|
|
2264
|
-
*/
|
|
2265
|
-
isOpen?: boolean;
|
|
2266
|
-
};
|
|
2388
|
+
* The live region state of the composite (the `stateChange` snapshot, see `CompositeState`).
|
|
2389
|
+
* Without it (no composite handle yet), nothing renders.
|
|
2390
|
+
*/
|
|
2391
|
+
state?: CompositeState;
|
|
2267
2392
|
}
|
|
2268
2393
|
|
|
2269
2394
|
/**
|
|
2270
2395
|
* Props of the composite status (`Combobox.State`, `Listbox.State`).
|
|
2271
2396
|
*/
|
|
2272
|
-
|
|
2273
|
-
/** Additional content rendered after the state message. */
|
|
2274
|
-
children?: ReactNode;
|
|
2275
|
-
}
|
|
2397
|
+
type CompositeStatusProps = ReactToJSX<CompositeStatusProps$1, 'state'>;
|
|
2276
2398
|
|
|
2277
2399
|
/**
|
|
2278
2400
|
* Combobox compound component namespace.
|
|
@@ -5800,6 +5922,181 @@ interface ToolbarProps extends GenericProps$1, ReactToJSX<ToolbarProps$1> {
|
|
|
5800
5922
|
*/
|
|
5801
5923
|
declare const Toolbar: Comp<ToolbarProps, HTMLDivElement>;
|
|
5802
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`, `ListboxOptionSkeleton` or `CompositeStatus` 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`, `ListboxOptionSkeleton` or `CompositeStatus` elements). */
|
|
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
|
+
|
|
5803
6100
|
/**
|
|
5804
6101
|
* Uploader variants.
|
|
5805
6102
|
*/
|
|
@@ -6020,5 +6317,5 @@ declare const ThemeProvider: React__default.FC<{
|
|
|
6020
6317
|
/** Get the theme in the current context. */
|
|
6021
6318
|
declare function useTheme(): ThemeContextValue;
|
|
6022
6319
|
|
|
6023
|
-
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 };
|
|
6024
|
-
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 };
|