@ssa-ui-kit/core 3.24.1 → 3.25.1
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/ai/source-map.md +119 -55
- package/dist/components/Breadcrumbs/styles.d.ts +1 -1
- package/dist/components/ContextMenu/ContextMenu.d.ts +74 -0
- package/dist/components/ContextMenu/ContextMenuOption.d.ts +18 -0
- package/dist/components/ContextMenu/index.d.ts +3 -0
- package/dist/components/ContextMenu/styles.d.ts +17 -0
- package/dist/components/ContextMenu/types.d.ts +153 -0
- package/dist/components/ContextMenu/utils.d.ts +79 -0
- package/dist/components/Dropdown/types.d.ts +7 -0
- package/dist/components/DropdownOptions/DropdownOptions.d.ts +5 -5
- package/dist/components/DropdownOptions/useToggleListKeys.d.ts +33 -0
- package/dist/components/DropdownOptions/utils.d.ts +9 -0
- package/dist/components/FiltersMultiSelect/FiltersMultiSelectProvider.d.ts +9 -0
- package/dist/components/FiltersMultiSelect/components/FiltersMultiSelectOption.d.ts +31 -1
- package/dist/components/FiltersMultiSelect/components/FiltersMultiSelectOptions.d.ts +29 -2
- package/dist/components/FiltersMultiSelect/utils.d.ts +15 -0
- package/dist/components/FloatingActionButton/FloatingActionButton.d.ts +79 -0
- package/dist/components/FloatingActionButton/index.d.ts +1 -0
- package/dist/components/FloatingActionButton/styles.d.ts +42 -0
- package/dist/components/FloatingActionButton/types.d.ts +129 -0
- package/dist/components/Header/Header.d.ts +43 -0
- package/dist/components/Header/HeaderMobileMenu.d.ts +19 -0
- package/dist/components/Header/HeaderNavMenu.d.ts +17 -0
- package/dist/components/Header/helpers.d.ts +13 -0
- package/dist/components/Header/index.d.ts +1 -0
- package/dist/components/Header/styles.d.ts +74 -0
- package/dist/components/Header/types.d.ts +104 -0
- package/dist/components/MultipleDropdown/MultipleDropdown.d.ts +4 -1
- package/dist/components/MultipleDropdown/types.d.ts +8 -0
- package/dist/components/MultipleDropdownOptions/MultipleDropdownOptions.d.ts +27 -0
- package/dist/components/Table/ColumnFreezeMenu.d.ts +2 -0
- package/dist/components/Typeahead/Typeahead.context.d.ts +9 -1
- package/dist/components/Typeahead/components/TypeaheadOptions.d.ts +13 -1
- package/dist/components/Typeahead/styles.d.ts +5 -0
- package/dist/components/Typeahead/types.d.ts +6 -0
- package/dist/components/Typeahead/useTypeahead.d.ts +10 -1
- package/dist/components/index.d.ts +6 -0
- package/dist/index.js +10204 -8167
- package/dist/index.mjs +12979 -10948
- package/dist/tsbuildcache +1 -1
- package/dist/utils/colorUtils.d.ts +15 -0
- package/package.json +3 -3
package/dist/ai/source-map.md
CHANGED
|
@@ -4,7 +4,7 @@ Generated from the TypeScript program at build time — do not edit by hand.
|
|
|
4
4
|
|
|
5
5
|
**Everything below is imported from the package root:** `import { X } from '@ssa-ui-kit/core'`
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
193 components · 20 contexts · 23 hooks · 20 functions · 16 constants · 340 exported types
|
|
8
8
|
|
|
9
9
|
## Reading this file
|
|
10
10
|
|
|
@@ -16,13 +16,13 @@ Generated from the TypeScript program at build time — do not edit by hand.
|
|
|
16
16
|
|
|
17
17
|
## Component roster
|
|
18
18
|
|
|
19
|
-
**Action & Form Controls** — BreadcrumbMenu, Breadcrumbs, Button, ButtonGroup, ButtonGroupButton, Checkbox, ColorPicker, DatePicker, DateRangePicker, DateRangePickerFormBridge, Dropdown, DropdownArrow, DropdownBase, DropdownOption, DropdownOptions, DropdownToggle, FileAttachment, FileUpload, IconButton, Input, MultipleDropdown, MultipleDropdownNotification, MultipleDropdownOptions, NumberField, Radio, RadioGroup, SearchBox, SearchBoxCrossIcon, SearchBoxInput, SearchBoxWrapper, Slider, SliderInputsRow, SliderLabel, SliderMarkItem, SliderMarkLabel, SliderMarksRow, SliderMarkTick, SliderNumberInput, SliderRangeInput, SliderRoot, SliderTrackBg, SliderTrackFill, SliderTrackRow, SliderTrackWrapper, SliderValueLabel, SliderValueLabelsContainer, Switch, Textarea, TextField, Typeahead, TypeaheadItemIcon, TypeaheadItemImage, TypeaheadOption, TypeaheadOptions
|
|
19
|
+
**Action & Form Controls** — BreadcrumbMenu, Breadcrumbs, Button, ButtonGroup, ButtonGroupButton, Checkbox, ColorPicker, ContextMenu, DatePicker, DateRangePicker, DateRangePickerFormBridge, Dropdown, DropdownArrow, DropdownBase, DropdownOption, DropdownOptions, DropdownToggle, FileAttachment, FileUpload, FloatingActionButton, IconButton, Input, MultipleDropdown, MultipleDropdownNotification, MultipleDropdownOptions, NumberField, Radio, RadioGroup, SearchBox, SearchBoxCrossIcon, SearchBoxInput, SearchBoxWrapper, Slider, SliderInputsRow, SliderLabel, SliderMarkItem, SliderMarkLabel, SliderMarksRow, SliderMarkTick, SliderNumberInput, SliderRangeInput, SliderRoot, SliderTrackBg, SliderTrackFill, SliderTrackRow, SliderTrackWrapper, SliderValueLabel, SliderValueLabelsContainer, Switch, Textarea, TextField, Typeahead, TypeaheadItemIcon, TypeaheadItemImage, TypeaheadOption, TypeaheadOptions
|
|
20
20
|
|
|
21
21
|
**Form Structure** — Filters, FiltersMultiSelect, FiltersMultiSelectEmpty, FiltersMultiSelectOption, FiltersMultiSelectOptions, Form, FormAction, FormCheckbox, FormGroup, FormHelperText, FormRadioGroup
|
|
22
22
|
|
|
23
23
|
**Data Display** — Avatar, Badge, BarGaugeChart, BarGaugeChartComponent, BarLineComplexChart, BigNumberChart, BigNumberChartComponent, Calendar, CalendarEventDetails, CandlestickChart, CandlestickChartComponent, Card, CardBase, CardContent, CardHeader, CardList, Carousel, ChartBackground, Chip, ColumnFreezeMenu, ColumnResizeHandle, Counter, FunnelChart, GaugeChart, ImageItem, Indicator, Label, NestedTable, NestedTableCell, NestedTableCellHeader, NestedTableCellSubHeader, NestedTableRow, PieChart, PieChartComponent, PieChartLegend, Progress, ProgressBar, ProgressCircle, ProgressInfo, ProgressInfoTotals, ProgressLegend, ProgressLegendItem, ProgressVertical, ResponsiveImage, SegmentedPieChart, SegmentedPieChartComponent, Table, TableBody, TableCell, TableCellHeader, TableContainer, TableFilterCheckbox, TableFilters, TableFiltersAccordion, TableFiltersAccordionContent, TableFiltersButtons, TableFiltersCancelButton, TableFiltersClearButton, TableFilterTrigger, TableFilterTriggerWithNotification, TableHead, TableRow, Tag, TreeMapChart, TreeMapChartComponent, TreeMapTooltipBase, Typography, WithNestedTableRow
|
|
24
24
|
|
|
25
|
-
**Navigation & Layout** — CollapsibleNavBar, CollapsibleNavBarCustomIconSVG, History, LargeTab, Link, LinksTabBar, NavBar, Pagination, Step, StepConnector, StepLabel, Stepper, Tab, TabBar, TreeView, WithLink, WithPagination, WithVisibleLG, WithVisibleMD, WithVisibleSM, WithVisibleUpToLG, Wrapper
|
|
25
|
+
**Navigation & Layout** — CollapsibleNavBar, CollapsibleNavBarCustomIconSVG, Header, History, LargeTab, Link, LinksTabBar, NavBar, Pagination, Step, StepConnector, StepLabel, Stepper, Tab, TabBar, TreeView, WithLink, WithPagination, WithVisibleLG, WithVisibleMD, WithVisibleSM, WithVisibleUpToLG, Wrapper
|
|
26
26
|
|
|
27
27
|
**Overlay & Feedback** — Modal, ModalContent, ModalDialog, ModalDismissButton, ModalOpenButton, NotificationCard, NotificationMenu, Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverHeading, PopoverTrigger, ProgressChartTooltip, SimpleChartTooltip, Tooltip, TooltipContent, TooltipContentBase, TooltipTrigger
|
|
28
28
|
|
|
@@ -122,6 +122,25 @@ Form control for selecting one or more options
|
|
|
122
122
|
- `classnames?: { trigger, content, button, colorPicker, colorDropdown, output }`
|
|
123
123
|
- `onChange?: (color: string) => void`
|
|
124
124
|
|
|
125
|
+
#### ContextMenu<V>
|
|
126
|
+
The list of options shown inside a dropdown, typeahead, filter or action menu.
|
|
127
|
+
|
|
128
|
+
- `items: ContextMenuEntry<V>[]` — Options and groups, in display order.
|
|
129
|
+
- `indicator?: ContextMenuIndicator` — How selected rows are marked. Defaults to `check` for `single`, `checkbox` for `multiple` and `none`…
|
|
130
|
+
- `onAction?: (value: V) => void` — Fires when an option is chosen by click, Enter or Space, in every mode — the hook for closing a popup.
|
|
131
|
+
- `activeValue?: V | null` — Controlled highlighted option (pointer or keyboard).
|
|
132
|
+
- `defaultActiveValue?: V | null` — Initially highlighted option when uncontrolled.
|
|
133
|
+
- `onActiveValueChange?: (value: V | null) => void` — Fires when the highlighted option changes.
|
|
134
|
+
- `renderItem?: (item: ContextMenuItem<V>, state: ContextMenuItemState) => ReactNode` — Replaces the row content between the start and end indicators.
|
|
135
|
+
- `renderGroupLabel?: (group: ContextMenuGroup<V>) => ReactNode` — Replaces the content of group titles.
|
|
136
|
+
- `emptyState?: ReactNode` `= 'No items'` — Shown when `items` has no options.
|
|
137
|
+
- `maxHeight?: string | number` — Scrolls the list beyond this height (px or any CSS length).
|
|
138
|
+
- `selectionMode?: 'none' | 'multiple' | 'single' | 'includeExclude'`
|
|
139
|
+
- `value?: V | V[] | ContextMenuIncludeExcludeEntry<V>[] | null` — Controlled selected value. `null` for none. Controlled selected values. Controlled chosen rows.
|
|
140
|
+
- `defaultValue?: V | V[] | ContextMenuIncludeExcludeEntry<V>[] | null` — Initially selected value when uncontrolled. Initially selected values when uncontrolled. Initially chosen…
|
|
141
|
+
- `onChange?: ((value: V) => void) | ((value: V[], toggled: V) => void) | …(1 more)` — Fires with the newly selected value. Choosing the selected option again keeps it selected. Fires with the new…
|
|
142
|
+
- _plus native element attributes_
|
|
143
|
+
|
|
125
144
|
#### DatePicker
|
|
126
145
|
Masked date input with a popover calendar. Use inside **`FormProvider`** (react-hook-form): the field value is the formatted string; **`onChange`** receives a JavaScript…
|
|
127
146
|
|
|
@@ -326,6 +345,26 @@ File input component with optional drag-and-drop support
|
|
|
326
345
|
- `onChange?: (files: File[]) => void`
|
|
327
346
|
- `onFileRejected?: (file: File, reason: FileRejectionReason) => void`
|
|
328
347
|
|
|
348
|
+
#### FloatingActionButton
|
|
349
|
+
A button fixed to a corner of the viewport for the page's primary action, optionally opening a speed-dial menu of related actions.
|
|
350
|
+
|
|
351
|
+
- `icon?: FloatingActionButtonIcon` `= 'plus'` — Icon of the button (of the menu trigger while the menu is closed).
|
|
352
|
+
- `label?: string` — Text shown next to the icon (the "extended" FAB). Without it the FAB is icon-only and needs an `aria-label`.
|
|
353
|
+
- `color?: FloatingActionButtonColor` `= 'primary'` — Background color. Pre-defined `primary` / `secondary`, a theme color key or any CSS color; custom colors get…
|
|
354
|
+
- `shadow?: boolean` `= true` — Draws the elevation shadow under the button.
|
|
355
|
+
- `shape?: 'square' | 'round'` `= 'square'` — Corner shape: `square` keeps the 8px radius, `round` is fully rounded (a circle when icon-only, a pill when…
|
|
356
|
+
- `size?: FloatingActionButtonSize` `= 'medium'` — Size of the button and of its menu items.
|
|
357
|
+
- `disabled?: boolean` `= false` — Disables the button (and, in menu mode, opening the menu).
|
|
358
|
+
- `onClick?: MouseEventHandler<HTMLButtonElement>` — Click handler. In menu mode it also runs, before the menu toggles.
|
|
359
|
+
- `actions?: FloatingActionButtonAction[]` — Items of the speed-dial menu. When given, the button toggles a stack of secondary FABs above it (below it for…
|
|
360
|
+
- `showActionLabels?: boolean` `= true` — Shows each action's `label` next to its icon. When `false` the items are icon-only and the label stays as…
|
|
361
|
+
- `open?: boolean` — Controlled open state of the menu.
|
|
362
|
+
- `defaultOpen?: boolean` `= false` — Initial open state of the menu when uncontrolled.
|
|
363
|
+
- `onOpenChange?: (open: boolean) => void` — Called when the menu opens or closes.
|
|
364
|
+
- `openIcon?: FloatingActionButtonIcon` `= 'cross'` — Icon of the trigger while the menu is open.
|
|
365
|
+
- `position?: FloatingActionButtonPosition` `= 'bottom-right'` — Viewport corner the FAB is fixed to.
|
|
366
|
+
- `offset?: number | { x: number; y: number; }` `= 24` — Distance from the corner in px — one value for both axes, or `{ x, y }`.
|
|
367
|
+
|
|
329
368
|
#### IconButton
|
|
330
369
|
Square icon-only button for icon actions
|
|
331
370
|
|
|
@@ -387,6 +426,7 @@ Dropdown component for multi-select and single-select
|
|
|
387
426
|
- _plus native element attributes_
|
|
388
427
|
|
|
389
428
|
#### MultipleDropdownOptions
|
|
429
|
+
Options menu container for MultipleDropdown
|
|
390
430
|
|
|
391
431
|
- `aria-labelledby?: string` — ARIA label reference Associates the listbox with its label
|
|
392
432
|
- `ariaLabelledby?: string` — ARIA label reference Associates the listbox with its label
|
|
@@ -738,8 +778,9 @@ Props for TypeaheadOption component Record type that allows any string or number
|
|
|
738
778
|
- `aria-selected?: boolean` — ARIA selected state
|
|
739
779
|
|
|
740
780
|
#### TypeaheadOptions
|
|
781
|
+
The Typeahead's option list: a `ContextMenu` driven from the Typeahead's input. The options themselves come from the `TypeaheadOption` children of `Typeahead`, filtered…
|
|
741
782
|
|
|
742
|
-
- `children?: ReactNode`
|
|
783
|
+
- `children?: ReactNode` — Ignored: the options come from the `TypeaheadOption` children of `Typeahead`, through context.
|
|
743
784
|
- `noItemsMessage?: string`
|
|
744
785
|
|
|
745
786
|
### Form Structure
|
|
@@ -782,12 +823,14 @@ Props for TypeaheadOption component Record type that allows any string or number
|
|
|
782
823
|
- _plus native element attributes_
|
|
783
824
|
|
|
784
825
|
#### FiltersMultiSelectOption
|
|
826
|
+
One filter row of a `FiltersMultiSelect`.
|
|
785
827
|
|
|
786
|
-
- `filter: Filter`
|
|
787
|
-
- `children: ReactNode`
|
|
828
|
+
- `filter: Filter` — The filter this row adds. `group: true` makes it a select-only row.
|
|
829
|
+
- `children: ReactNode` — Row content.
|
|
788
830
|
- `selected?: boolean`
|
|
789
831
|
|
|
790
832
|
#### FiltersMultiSelectOptions
|
|
833
|
+
The options list of a `FiltersMultiSelect`.
|
|
791
834
|
|
|
792
835
|
- `children: React.ReactNode`
|
|
793
836
|
- _plus native element attributes_
|
|
@@ -1543,6 +1586,17 @@ The app sidebar: a logo, a menu, and three layouts.
|
|
|
1543
1586
|
_No library-specific props._
|
|
1544
1587
|
- _plus native element attributes_
|
|
1545
1588
|
|
|
1589
|
+
#### Header
|
|
1590
|
+
The application's top bar: logo, main navigation and a free slot on the right for the user profile, notifications or log out.
|
|
1591
|
+
|
|
1592
|
+
- `logo?: ReactNode` — Project logo, placed in a box of fixed height. Leave it out and the box stays empty, so the layout does not…
|
|
1593
|
+
- `items?: HeaderNavItem[]` — Navigation items. Rendered centred; scrolls sideways when it overflows.
|
|
1594
|
+
- `rightSide?: ReactNode` — Right-hand content — user profile, notifications, log out, whatever the app needs. Rendered as-is on every…
|
|
1595
|
+
- `size?: HeaderSize` `= 'small'` — Bar height and logo size
|
|
1596
|
+
- `navLabel?: string` `= 'Main'` — Accessible name of the navigation landmark
|
|
1597
|
+
- `menuButtonLabel?: string` `= 'Open menu'` — Accessible name of the burger button shown below 900px
|
|
1598
|
+
- _plus native element attributes_
|
|
1599
|
+
|
|
1546
1600
|
#### History
|
|
1547
1601
|
Vertical timeline component for chronological events.
|
|
1548
1602
|
|
|
@@ -2296,7 +2350,10 @@ A sticky action bar across the bottom of the panel.
|
|
|
2296
2350
|
- `clearButtonStyles`
|
|
2297
2351
|
- `deriveBreadcrumbs` — Pure derivation of breadcrumb items from a route tree and a pathname. Extracted from the hook so it can be unit-tested without a router.
|
|
2298
2352
|
- `filterButtonStyles`
|
|
2353
|
+
- `getContextMenuOptionId` — DOM id of an option, for `aria-activedescendant` on an element outside the list (e.g. a combobox input). `menuId` is the `id` given to the ContextMenu. Characters not…
|
|
2354
|
+
- `getNextActiveValue` — Where a navigation key moves the highlight: ArrowDown / ArrowUp step over disabled options and wrap, Home / End jump to the ends. Returns `undefined` for any other key,…
|
|
2299
2355
|
- `highlightInputMatch`
|
|
2356
|
+
- `nextIncludeExcludeType` — Where Enter moves an `includeExclude` row: none → include → exclude → none, or none ⇄ selected for `selectOnly` rows. For driving that cycle from an input that keeps…
|
|
2300
2357
|
- `resetDeprecationWarnings` — Clears the once-per-pair warning cache.
|
|
2301
2358
|
- `resolveAriaProp` — Shorthand for the camelCase-ARIA → native-ARIA renames (issue #656, chunk 3 item 1).
|
|
2302
2359
|
- `resolveDeprecatedProp` — Resolves a prop that is mid-rename: returns the new prop's value when it is defined, otherwise falls back to the deprecated one and warns in dev.
|
|
@@ -2364,56 +2421,63 @@ _Names only — read the `.d.ts` for their shape._
|
|
|
2364
2421
|
`CollapsibleNavBarItem` · `ColoredButtonTextProps` · `ColorsKeys` · `ColumnFreezeApi`
|
|
2365
2422
|
`ColumnFreezeMenuProps` · `ColumnFreezeOptions` · `ColumnId` · `ColumnResizeApi`
|
|
2366
2423
|
`ColumnResizeHandleProps` · `ColumnResizeMode` · `ColumnResizeOptions` · `CommonProps`
|
|
2367
|
-
`
|
|
2368
|
-
`
|
|
2369
|
-
`
|
|
2370
|
-
`
|
|
2371
|
-
`
|
|
2372
|
-
`
|
|
2373
|
-
`
|
|
2374
|
-
`
|
|
2375
|
-
`
|
|
2424
|
+
`ContextMenuBaseProps` · `ContextMenuEntry` · `ContextMenuGroup` · `ContextMenuIncludeExcludeEntry`
|
|
2425
|
+
`ContextMenuIncludeExcludeSelectionProps` · `ContextMenuIncludeExcludeType` · `ContextMenuIndicator`
|
|
2426
|
+
`ContextMenuItemState` · `ContextMenuItem` · `ContextMenuMultipleSelectionProps`
|
|
2427
|
+
`ContextMenuNoSelectionProps` · `ContextMenuProps` · `ContextMenuSelectionProps`
|
|
2428
|
+
`ContextMenuSingleSelectionProps` · `ContextMenuValue` · `ContextType` · `ControlledButtonProps`
|
|
2429
|
+
`CounterProps` · `CounterSizes` · `CounterVariants` · `CustomIconProps` · `CustomTagStyles`
|
|
2430
|
+
`DatePickerContextProps` · `DatePickerFormat` · `DatePickerProps` · `DateRangePickerContextProps`
|
|
2431
|
+
`DateRangePickerFormBridgeProps` · `DateRangePickerFormBridgeValue` · `DateRangePickerOnChangeDates`
|
|
2432
|
+
`DateRangePickerProps` · `DateRangePresetValue` · `DateRangePreset` · `DateTimeTuple`
|
|
2433
|
+
`DeprecatedOpenStateProps` · `DropdownContextType` · `DropdownOptionProps` · `DropdownPositions`
|
|
2434
|
+
`DropdownProps` · `DropdownToggleProps` · `DynamicAlertParams` · `DynamicNotificationParams`
|
|
2435
|
+
`DynamicToastParams` · `FieldContextValue` · `FieldControlProps` · `FieldDescriptionProps`
|
|
2436
|
+
`FieldErrorProps` · `FieldLabelProps` · `FieldProps` · `FieldSuccessProps` · `FileAttachmentFile`
|
|
2376
2437
|
`FileAttachmentProps` · `FileRejectionReason` · `FileUploadProgressEntry` · `FileUploadProgress`
|
|
2377
2438
|
`FileUploadProps` · `Filter` · `FiltersMultiSelectEmptyProps` · `FiltersMultiSelectOptionProps`
|
|
2378
|
-
`FiltersMultiSelectProps` · `
|
|
2439
|
+
`FiltersMultiSelectProps` · `FloatingActionButtonAction` · `FloatingActionButtonColor`
|
|
2440
|
+
`FloatingActionButtonIcon` · `FloatingActionButtonPosition` · `FloatingActionButtonProps`
|
|
2441
|
+
`FloatingActionButtonSize` · `FloatingSurfaceColor` · `FloatingSurfaceSize` · `Format`
|
|
2379
2442
|
`FrozenColumns` · `FullscreenModeContextType` · `FunnelChartItem` · `FunnelChartProps`
|
|
2380
2443
|
`FunnelChartRender` · `FunnelChartType` · `GaugeBarProps` · `GaugeBarThreshold`
|
|
2381
|
-
`GaugeBarValueFormatter` · `GaugeChartFeature` · `GaugeChartProps` · `
|
|
2382
|
-
`
|
|
2383
|
-
`
|
|
2384
|
-
`
|
|
2385
|
-
`
|
|
2386
|
-
`
|
|
2387
|
-
`
|
|
2388
|
-
`
|
|
2389
|
-
`
|
|
2390
|
-
`
|
|
2391
|
-
`
|
|
2392
|
-
`
|
|
2393
|
-
`
|
|
2394
|
-
`
|
|
2395
|
-
`
|
|
2396
|
-
`
|
|
2397
|
-
`
|
|
2398
|
-
`
|
|
2399
|
-
`
|
|
2400
|
-
`
|
|
2401
|
-
`
|
|
2402
|
-
`
|
|
2403
|
-
`
|
|
2404
|
-
`
|
|
2405
|
-
`
|
|
2406
|
-
`
|
|
2407
|
-
`
|
|
2408
|
-
`
|
|
2409
|
-
`
|
|
2410
|
-
`
|
|
2411
|
-
`
|
|
2412
|
-
`
|
|
2413
|
-
`
|
|
2414
|
-
`
|
|
2415
|
-
`
|
|
2416
|
-
`
|
|
2417
|
-
`
|
|
2418
|
-
`
|
|
2419
|
-
`
|
|
2444
|
+
`GaugeBarValueFormatter` · `GaugeChartFeature` · `GaugeChartProps` · `HeaderNavItem` · `HeaderProps`
|
|
2445
|
+
`HeaderSize` · `HeaderTheme` · `HistoryItemType` · `HistoryProps` · `IFormCheckboxProps`
|
|
2446
|
+
`IconButtonProps` · `IconProps` · `ImageItemProps` · `IndicatorProps` · `InputColors` · `InputProps`
|
|
2447
|
+
`InputStatusColors` · `InteractionsEnabled` · `Item` · `LabelProps` · `LargeTabProps`
|
|
2448
|
+
`LastFocusedElement` · `LinkProps` · `LinksTabBarProps` · `MainColors` · `MainSizes`
|
|
2449
|
+
`MapIconsType` · `ModalContextProps` · `ModalDialogProps` · `ModalProps` · `ModalRootProps`
|
|
2450
|
+
`MountMode` · `MultipleStylesProps` · `NavBarExtendedGroup` · `NavBarExtendedItem`
|
|
2451
|
+
`NavBarExtendedProps` · `NavBarExtendedSubItem` · `NavBarProps` · `NestedTableCellHeaderProps`
|
|
2452
|
+
`NestedTableContextType` · `NestedTableContextValue` · `NestedTableProps`
|
|
2453
|
+
`NestedTableRowContextType` · `NotificationCardProps` · `NotificationDynamicProps`
|
|
2454
|
+
`NotificationGlobalSharedProps` · `NotificationMenuProps` · `NotificationPositions`
|
|
2455
|
+
`NotificationProps` · `NotificationSharedProps` · `NotificationSizes` · `NotificationStyleOverrides`
|
|
2456
|
+
`NotificationType` · `NotificationVariants` · `NumberFieldProps` · `OpenStateProps`
|
|
2457
|
+
`OpenedAccordion` · `PageButtonProps` · `PaginationButtonsProps` · `PaginationContextProps`
|
|
2458
|
+
`PaginationContextProviderProps` · `PaginationProps` · `PaletteColor` · `Palette` · `PeriodOption`
|
|
2459
|
+
`Period` · `PersonInfoAvatarProps` · `PersonInfoCounterProps` · `PersonInfoCounterTooltipUser`
|
|
2460
|
+
`PersonInfoCounterTooltip` · `PersonInfoLinkAttributes` · `PersonInfoProps` · `PersonInfoStyles`
|
|
2461
|
+
`PersonInfoValueProps` · `PickerType` · `PieChartFeatures` · `PieChartLegendItem`
|
|
2462
|
+
`PieChartLegendProps` · `PieChartProps` · `PieChartTooltipProps` · `PieChartTooltipViewProps`
|
|
2463
|
+
`PopoverArrowProps` · `PopoverContentProps` · `PopoverOptions` · `PopoverTriggerProps`
|
|
2464
|
+
`ProgressBarProps` · `ProgressChartTooltipProps` · `ProgressCircleProps` · `ProgressInfoItemProps`
|
|
2465
|
+
`ProgressInfoProps` · `ProgressInfoResp` · `ProgressInfoTotalsProps` · `ProgressProps` · `RGBString`
|
|
2466
|
+
`RadioGroupProps` · `RadioProps` · `RangePickerType` · `RenderContentProps` · `ResizeHandleProps`
|
|
2467
|
+
`ResolveDeprecatedPropOptions` · `ResolvedOpenState` · `ResponsiveImageProps` · `SVGProps`
|
|
2468
|
+
`SearchBoxProps` · `SelectedFilter` · `SetIDs` · `SimpleChartTooltipProps` · `SizeStyles`
|
|
2469
|
+
`SliderMark` · `SliderProps` · `SliderSize` · `SmallTabProps` · `StepperContextType`
|
|
2470
|
+
`StepperProps` · `SwitchContext` · `SwitchProps` · `TabBarContextProps` · `TabBarLink`
|
|
2471
|
+
`TabBarProps` · `TabBaseProps` · `TabProps` · `TableContainerProps` · `TableProps` · `TagsProps`
|
|
2472
|
+
`TextFieldProps` · `TextareaProps` · `Theme` · `ToastProps` · `ToastVariants` · `TooltipArrowProps`
|
|
2473
|
+
`TooltipColor` · `TooltipContentProps` · `TooltipContentSizes` · `TooltipContextType`
|
|
2474
|
+
`TooltipProps` · `TooltipSize` · `TooltipTriggerProps` · `TranslationContextContent`
|
|
2475
|
+
`TreeItemBase` · `TreeItemLevel2` · `TreeItemLevel3` · `TreeItemRenderProps` · `TreeItem`
|
|
2476
|
+
`TreeLevel` · `TreeMapChartFeature` · `TreeMapChartProps` · `TreeNode` · `TreeViewProps`
|
|
2477
|
+
`TypeaheadItemProps` · `TypeaheadItemsListProps` · `TypeaheadOptionProps` · `TypeaheadProps`
|
|
2478
|
+
`TypeaheadValue` · `TypographyProps` · `UseBreadcrumbsOptions` · `UseChartInfo`
|
|
2479
|
+
`UseColumnResizeOptions` · `UseDrawerOptions` · `UseFiltersMultiSelectOptions`
|
|
2480
|
+
`UseFiltersMultiSelectStore` · `UsePopover` · `UseTooltipArgs` · `UseTooltipContext` · `UseTooltip`
|
|
2481
|
+
`UseTypeaheadProps` · `UserProfileProps` · `ValueLabelDisplay` · `VariantStyle` · `WidgetCardProps`
|
|
2482
|
+
`WithNestedTableRowProps` · `WithWidgetCardProps` · `WrapperAlignItems` · `WrapperDirection`
|
|
2483
|
+
`WrapperJustifyContent`
|
|
@@ -6,4 +6,4 @@ export declare const crumbLink: import("@emotion/react").SerializedStyles;
|
|
|
6
6
|
export declare const crumbText: import("@emotion/react").SerializedStyles;
|
|
7
7
|
export declare const crumbCurrent: import("@emotion/react").SerializedStyles;
|
|
8
8
|
export declare const menu: import("@emotion/react").SerializedStyles;
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const menuLink: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ReactElement, Ref } from 'react';
|
|
2
|
+
import { ContextMenuProps, ContextMenuValue } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* ContextMenu - The list of options shown inside a dropdown, typeahead,
|
|
5
|
+
* filter or action menu.
|
|
6
|
+
*
|
|
7
|
+
* It renders only the list: open state, the trigger and positioning belong to
|
|
8
|
+
* the component hosting it, which places it inline or inside a `Popover`.
|
|
9
|
+
*
|
|
10
|
+
* ### Selection
|
|
11
|
+
* `selectionMode` picks the behaviour and the shape of `value` / `onChange`:
|
|
12
|
+
* - `none` (default): an action menu (`role="menu"`); rows only fire `onAction`
|
|
13
|
+
* - `single`: one value; marked with a check by default
|
|
14
|
+
* - `multiple`: an array of values; marked with checkboxes by default
|
|
15
|
+
* - `includeExclude`: `{ value, type }` entries; every row has + / − controls,
|
|
16
|
+
* `selectOnly` rows a single check-circle. Clicking the active control clears
|
|
17
|
+
* it; Enter cycles none → include → exclude → none.
|
|
18
|
+
*
|
|
19
|
+
* `indicator` overrides how selected rows are marked. Use `startContent` /
|
|
20
|
+
* `endContent` for anything the design does not cover.
|
|
21
|
+
*
|
|
22
|
+
* ### Rows
|
|
23
|
+
* Each option can carry an avatar, a status dot, a right-hand description and
|
|
24
|
+
* free start / end content. Text labels ellipsise and show the full text in a
|
|
25
|
+
* tooltip after a hover. Pass a `ContextMenuGroup` among `items` for a titled
|
|
26
|
+
* section; groups are separated by a divider.
|
|
27
|
+
*
|
|
28
|
+
* ### Keyboard
|
|
29
|
+
* The list is a single tab stop. Arrow keys, Home and End move the highlight
|
|
30
|
+
* (announced through `aria-activedescendant`), Enter or Space choose, and
|
|
31
|
+
* typing jumps to the next option starting with the typed text. Escape is left
|
|
32
|
+
* to the host. A host that keeps focus elsewhere (e.g. in an input) can drive
|
|
33
|
+
* the highlight with `activeValue` / `onActiveValueChange`.
|
|
34
|
+
*
|
|
35
|
+
* @category Components
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* const [value, setValue] = useState<string | null>(null);
|
|
40
|
+
*
|
|
41
|
+
* <ContextMenu
|
|
42
|
+
* selectionMode="single"
|
|
43
|
+
* value={value}
|
|
44
|
+
* onChange={setValue}
|
|
45
|
+
* items={[
|
|
46
|
+
* {
|
|
47
|
+
* id: 'project',
|
|
48
|
+
* label: 'Project Members',
|
|
49
|
+
* items: [
|
|
50
|
+
* { value: 'ann', label: 'Ann Lee', avatar: annPhotoUrl },
|
|
51
|
+
* { value: 'bob', label: 'Bob Stone', avatar: bobPhotoUrl },
|
|
52
|
+
* ],
|
|
53
|
+
* },
|
|
54
|
+
* ]}
|
|
55
|
+
* />
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* // Include / exclude filters
|
|
61
|
+
* <ContextMenu
|
|
62
|
+
* selectionMode="includeExclude"
|
|
63
|
+
* value={filters}
|
|
64
|
+
* onChange={setFilters}
|
|
65
|
+
* items={[
|
|
66
|
+
* { value: 'remote', label: 'Remote' },
|
|
67
|
+
* { value: 'my-team', label: 'My team', selectOnly: true },
|
|
68
|
+
* ]}
|
|
69
|
+
* />
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export declare const ContextMenu: <V extends ContextMenuValue = ContextMenuValue>(props: ContextMenuProps<V> & {
|
|
73
|
+
ref?: Ref<HTMLUListElement>;
|
|
74
|
+
}) => ReactElement;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ContextMenuIncludeExcludeType, ContextMenuIndicator, ContextMenuItem, ContextMenuItemState, ContextMenuValue } from './types';
|
|
3
|
+
export interface ContextMenuOptionProps<V extends ContextMenuValue> {
|
|
4
|
+
id: string;
|
|
5
|
+
item: ContextMenuItem<V>;
|
|
6
|
+
state: ContextMenuItemState;
|
|
7
|
+
role: 'option' | 'menuitem';
|
|
8
|
+
/** Resolved indicator; `null` in `includeExclude` mode. */
|
|
9
|
+
indicator: ContextMenuIndicator | null;
|
|
10
|
+
renderItem?: (item: ContextMenuItem<V>, state: ContextMenuItemState) => ReactNode;
|
|
11
|
+
/** Row click. Not called for include / exclude rows, whose controls choose. */
|
|
12
|
+
onActivate: () => void;
|
|
13
|
+
/** An include / exclude control was clicked. */
|
|
14
|
+
onIncludeExclude: (type: ContextMenuIncludeExcludeType) => void;
|
|
15
|
+
onHover: () => void;
|
|
16
|
+
}
|
|
17
|
+
/** One option row of a `ContextMenu`. Internal. */
|
|
18
|
+
export declare const ContextMenuOption: <V extends ContextMenuValue>({ id, item, state, role, indicator, renderItem, onActivate, onIncludeExclude, onHover, }: ContextMenuOptionProps<V>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Theme } from '@emotion/react';
|
|
2
|
+
/** Row height for options and group titles (Figma draws 32 and 34; 34 wins). */
|
|
3
|
+
export declare const ROW_HEIGHT = 34;
|
|
4
|
+
export declare const menu: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
5
|
+
export declare const group: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare const groupList: import("@emotion/react").SerializedStyles;
|
|
7
|
+
export declare const groupLabel: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
8
|
+
export declare const option: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
9
|
+
export declare const empty: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
10
|
+
export declare const label: import("@emotion/react").SerializedStyles;
|
|
11
|
+
export declare const description: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
12
|
+
export declare const status: import("@emotion/react").SerializedStyles;
|
|
13
|
+
export declare const slot: import("@emotion/react").SerializedStyles;
|
|
14
|
+
export declare const checkbox: import("@emotion/react").SerializedStyles;
|
|
15
|
+
export declare const includeExcludeControls: import("@emotion/react").SerializedStyles;
|
|
16
|
+
export declare const includeExcludeControl: import("@emotion/react").SerializedStyles;
|
|
17
|
+
export declare const visuallyHidden: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/** Value type a {@link ContextMenu} option can carry. */
|
|
3
|
+
export type ContextMenuValue = string | number;
|
|
4
|
+
/**
|
|
5
|
+
* One selectable row of a {@link ContextMenu}.
|
|
6
|
+
*
|
|
7
|
+
* The row is laid out as `[indicator] [status | avatar] [startContent] label
|
|
8
|
+
* [description] [endContent] [indicator]`; every part but the label is
|
|
9
|
+
* optional.
|
|
10
|
+
*/
|
|
11
|
+
export interface ContextMenuItem<V extends ContextMenuValue = ContextMenuValue> {
|
|
12
|
+
/** Identifies the option in `value`, `onChange` and `onAction`. Unique per menu. */
|
|
13
|
+
value: V;
|
|
14
|
+
/** Row content. Strings and numbers ellipsise and get a hover tooltip. */
|
|
15
|
+
label: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Plain-text form of `label`, used for type-to-find and the tooltip when
|
|
18
|
+
* `label` is a node. Defaults to `label` when that is a string or number.
|
|
19
|
+
*/
|
|
20
|
+
textValue?: string;
|
|
21
|
+
/** Secondary text at the right of the row, e.g. a date. */
|
|
22
|
+
description?: ReactNode;
|
|
23
|
+
/** Image URL (rendered as a 24px `Avatar`) or any node placed before the label. */
|
|
24
|
+
avatar?: string | ReactNode;
|
|
25
|
+
/** CSS color or gradient of a 12px status dot placed before the label. */
|
|
26
|
+
status?: string;
|
|
27
|
+
/** Extra content placed before the label, after the status dot / avatar. */
|
|
28
|
+
startContent?: ReactNode;
|
|
29
|
+
/** Extra content placed after the label and description. */
|
|
30
|
+
endContent?: ReactNode;
|
|
31
|
+
/** Skipped by keyboard navigation and ignores clicks. */
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* `includeExclude` mode only: the row is selected as a whole (one blue
|
|
35
|
+
* check-circle) instead of being included or excluded — e.g. a saved
|
|
36
|
+
* filter group.
|
|
37
|
+
*/
|
|
38
|
+
selectOnly?: boolean;
|
|
39
|
+
/** Class name added to the option's `<li>`. */
|
|
40
|
+
className?: string;
|
|
41
|
+
/** Test id set on the option's `<li>`. */
|
|
42
|
+
'data-testid'?: string;
|
|
43
|
+
}
|
|
44
|
+
/** A titled group of options. The title is not selectable. */
|
|
45
|
+
export interface ContextMenuGroup<V extends ContextMenuValue = ContextMenuValue> {
|
|
46
|
+
/** Unique per menu. */
|
|
47
|
+
id: string;
|
|
48
|
+
/** Group title. */
|
|
49
|
+
label: ReactNode;
|
|
50
|
+
items: ContextMenuItem<V>[];
|
|
51
|
+
}
|
|
52
|
+
/** A top-level entry of `items`: an option or a group of options. */
|
|
53
|
+
export type ContextMenuEntry<V extends ContextMenuValue = ContextMenuValue> = ContextMenuItem<V> | ContextMenuGroup<V>;
|
|
54
|
+
/**
|
|
55
|
+
* How a selected option is marked. Selected rows also get the selected
|
|
56
|
+
* background, except in `includeExclude` mode.
|
|
57
|
+
* - `check`: a check mark at the end of selected rows
|
|
58
|
+
* - `checkbox`: a checkbox at the start of every row
|
|
59
|
+
* - `checkCircle`: a blue check-circle at the end of every row, filled when selected
|
|
60
|
+
* - `none`: background only
|
|
61
|
+
*/
|
|
62
|
+
export type ContextMenuIndicator = 'check' | 'checkbox' | 'checkCircle' | 'none';
|
|
63
|
+
/** State of a row in `includeExclude` mode. `selected` is used by `selectOnly` rows. */
|
|
64
|
+
export type ContextMenuIncludeExcludeType = 'include' | 'exclude' | 'selected';
|
|
65
|
+
/** One chosen row in `includeExclude` mode. */
|
|
66
|
+
export interface ContextMenuIncludeExcludeEntry<V extends ContextMenuValue = ContextMenuValue> {
|
|
67
|
+
value: V;
|
|
68
|
+
type: ContextMenuIncludeExcludeType;
|
|
69
|
+
}
|
|
70
|
+
/** State passed to `renderItem`. */
|
|
71
|
+
export interface ContextMenuItemState {
|
|
72
|
+
/** The option is selected (in `includeExclude` mode: included, excluded or selected). */
|
|
73
|
+
selected: boolean;
|
|
74
|
+
/** The option is highlighted by the pointer or the keyboard. */
|
|
75
|
+
active: boolean;
|
|
76
|
+
disabled: boolean;
|
|
77
|
+
/** `includeExclude` mode only. */
|
|
78
|
+
includeExcludeType?: ContextMenuIncludeExcludeType;
|
|
79
|
+
}
|
|
80
|
+
/** Selection props for an action menu: rows only fire `onAction`. */
|
|
81
|
+
export interface ContextMenuNoSelectionProps {
|
|
82
|
+
selectionMode?: 'none';
|
|
83
|
+
value?: never;
|
|
84
|
+
defaultValue?: never;
|
|
85
|
+
onChange?: never;
|
|
86
|
+
}
|
|
87
|
+
/** Selection props for picking one option. */
|
|
88
|
+
export interface ContextMenuSingleSelectionProps<V extends ContextMenuValue> {
|
|
89
|
+
selectionMode: 'single';
|
|
90
|
+
/** Controlled selected value. `null` for none. */
|
|
91
|
+
value?: V | null;
|
|
92
|
+
/** Initially selected value when uncontrolled. */
|
|
93
|
+
defaultValue?: V | null;
|
|
94
|
+
/** Fires with the newly selected value. Choosing the selected option again keeps it selected. */
|
|
95
|
+
onChange?: (value: V) => void;
|
|
96
|
+
}
|
|
97
|
+
/** Selection props for picking any number of options. */
|
|
98
|
+
export interface ContextMenuMultipleSelectionProps<V extends ContextMenuValue> {
|
|
99
|
+
selectionMode: 'multiple';
|
|
100
|
+
/** Controlled selected values. */
|
|
101
|
+
value?: V[];
|
|
102
|
+
/** Initially selected values when uncontrolled. */
|
|
103
|
+
defaultValue?: V[];
|
|
104
|
+
/** Fires with the new selection and the option that was toggled. */
|
|
105
|
+
onChange?: (value: V[], toggled: V) => void;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Selection props for include / exclude filters. Each row is included,
|
|
109
|
+
* excluded or neither (`selectOnly` rows: selected or not).
|
|
110
|
+
*/
|
|
111
|
+
export interface ContextMenuIncludeExcludeSelectionProps<V extends ContextMenuValue> {
|
|
112
|
+
selectionMode: 'includeExclude';
|
|
113
|
+
/** Controlled chosen rows. */
|
|
114
|
+
value?: ContextMenuIncludeExcludeEntry<V>[];
|
|
115
|
+
/** Initially chosen rows when uncontrolled. */
|
|
116
|
+
defaultValue?: ContextMenuIncludeExcludeEntry<V>[];
|
|
117
|
+
/** Fires with the new list and the option that changed. */
|
|
118
|
+
onChange?: (value: ContextMenuIncludeExcludeEntry<V>[], changed: V) => void;
|
|
119
|
+
}
|
|
120
|
+
/** Selection behaviour of a {@link ContextMenu}, keyed by `selectionMode`. */
|
|
121
|
+
export type ContextMenuSelectionProps<V extends ContextMenuValue> = ContextMenuNoSelectionProps | ContextMenuSingleSelectionProps<V> | ContextMenuMultipleSelectionProps<V> | ContextMenuIncludeExcludeSelectionProps<V>;
|
|
122
|
+
/** Props shared by every `selectionMode` of a {@link ContextMenu}. */
|
|
123
|
+
export interface ContextMenuBaseProps<V extends ContextMenuValue> extends Omit<HTMLAttributes<HTMLUListElement>, 'onChange' | 'defaultValue' | 'children'> {
|
|
124
|
+
/** Options and groups, in display order. */
|
|
125
|
+
items: ContextMenuEntry<V>[];
|
|
126
|
+
/**
|
|
127
|
+
* How selected rows are marked. Defaults to `check` for `single`,
|
|
128
|
+
* `checkbox` for `multiple` and `none` otherwise. Ignored by
|
|
129
|
+
* `includeExclude`, which always shows include / exclude controls.
|
|
130
|
+
*/
|
|
131
|
+
indicator?: ContextMenuIndicator;
|
|
132
|
+
/**
|
|
133
|
+
* Fires when an option is chosen by click, Enter or Space, in every mode —
|
|
134
|
+
* the hook for closing a popup.
|
|
135
|
+
*/
|
|
136
|
+
onAction?: (value: V) => void;
|
|
137
|
+
/** Controlled highlighted option (pointer or keyboard). */
|
|
138
|
+
activeValue?: V | null;
|
|
139
|
+
/** Initially highlighted option when uncontrolled. */
|
|
140
|
+
defaultActiveValue?: V | null;
|
|
141
|
+
/** Fires when the highlighted option changes. */
|
|
142
|
+
onActiveValueChange?: (value: V | null) => void;
|
|
143
|
+
/** Replaces the row content between the start and end indicators. */
|
|
144
|
+
renderItem?: (item: ContextMenuItem<V>, state: ContextMenuItemState) => ReactNode;
|
|
145
|
+
/** Replaces the content of group titles. */
|
|
146
|
+
renderGroupLabel?: (group: ContextMenuGroup<V>) => ReactNode;
|
|
147
|
+
/** Shown when `items` has no options. @default 'No items' */
|
|
148
|
+
emptyState?: ReactNode;
|
|
149
|
+
/** Scrolls the list beyond this height (px or any CSS length). */
|
|
150
|
+
maxHeight?: number | string;
|
|
151
|
+
}
|
|
152
|
+
/** Props of {@link ContextMenu}. */
|
|
153
|
+
export type ContextMenuProps<V extends ContextMenuValue = ContextMenuValue> = ContextMenuBaseProps<V> & ContextMenuSelectionProps<V>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ContextMenuEntry, ContextMenuGroup, ContextMenuIncludeExcludeType, ContextMenuItem, ContextMenuValue } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Long enough that the label tooltip does not fire while the pointer is
|
|
4
|
+
* travelling down the list, short enough to feel like a deliberate hover
|
|
5
|
+
* (#669).
|
|
6
|
+
*/
|
|
7
|
+
export declare const LABEL_TOOLTIP_DELAY = 1000;
|
|
8
|
+
/** Keeps a long label from producing a tooltip as wide as the list itself. */
|
|
9
|
+
export declare const LABEL_TOOLTIP_MAX_WIDTH = 320;
|
|
10
|
+
/**
|
|
11
|
+
* Only a primitive is safe to repeat inside a tooltip. Rendering the same
|
|
12
|
+
* element twice mounts two independent copies of it, so labels made of
|
|
13
|
+
* components get no tooltip.
|
|
14
|
+
*/
|
|
15
|
+
export declare const asText: (value: unknown) => string | number | undefined;
|
|
16
|
+
export declare const isGroup: <V extends ContextMenuValue>(entry: ContextMenuEntry<V>) => entry is ContextMenuGroup<V>;
|
|
17
|
+
/** Every option in display order, groups unwrapped. */
|
|
18
|
+
export declare const flattenItems: <V extends ContextMenuValue>(entries: ContextMenuEntry<V>[]) => ContextMenuItem<V>[];
|
|
19
|
+
/** Text used for type-to-find and the label tooltip. */
|
|
20
|
+
export declare const getTextValue: <V extends ContextMenuValue>(item: ContextMenuItem<V>) => string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Where Enter moves an `includeExclude` row: none → include → exclude → none,
|
|
23
|
+
* or none ⇄ selected for `selectOnly` rows. For driving that cycle from an
|
|
24
|
+
* input that keeps focus while it highlights rows.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* nextIncludeExcludeType(undefined, false); // 'include'
|
|
29
|
+
* nextIncludeExcludeType('include', false); // 'exclude'
|
|
30
|
+
* nextIncludeExcludeType('exclude', false); // undefined
|
|
31
|
+
* nextIncludeExcludeType(undefined, true); // 'selected'
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare const nextIncludeExcludeType: (current: ContextMenuIncludeExcludeType | undefined, selectOnly: boolean) => ContextMenuIncludeExcludeType | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* The enabled option `step` places away from `from`, wrapping around the
|
|
37
|
+
* ends. With no `from`, ArrowDown lands on the first option and ArrowUp on
|
|
38
|
+
* the last.
|
|
39
|
+
*/
|
|
40
|
+
export declare const getSteppedIndex: (enabled: boolean[], from: number, step: 1 | -1) => number;
|
|
41
|
+
/**
|
|
42
|
+
* Makes any string safe inside an id and an IDREF list: characters other than
|
|
43
|
+
* letters, digits and `-` become `_<hex>_`, so distinct inputs stay distinct.
|
|
44
|
+
*/
|
|
45
|
+
export declare const escapeId: (value: string) => string;
|
|
46
|
+
/**
|
|
47
|
+
* DOM id of an option, for `aria-activedescendant` on an element outside the
|
|
48
|
+
* list (e.g. a combobox input). `menuId` is the `id` given to the ContextMenu.
|
|
49
|
+
* Characters not allowed in an id are escaped, so any value is safe.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```tsx
|
|
53
|
+
* <input
|
|
54
|
+
* aria-controls="people-menu"
|
|
55
|
+
* aria-activedescendant={
|
|
56
|
+
* active == null ? undefined : getContextMenuOptionId('people-menu', active)
|
|
57
|
+
* }
|
|
58
|
+
* />
|
|
59
|
+
* <ContextMenu id="people-menu" items={items} activeValue={active} />
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare const getContextMenuOptionId: (menuId: string, value: ContextMenuValue) => string;
|
|
63
|
+
/**
|
|
64
|
+
* Where a navigation key moves the highlight: ArrowDown / ArrowUp step over
|
|
65
|
+
* disabled options and wrap, Home / End jump to the ends. Returns `undefined`
|
|
66
|
+
* for any other key, so a host driving the list from its own input can tell
|
|
67
|
+
* whether the key was a navigation key.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```tsx
|
|
71
|
+
* const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {
|
|
72
|
+
* const next = getNextActiveValue(items, active, event.key);
|
|
73
|
+
* if (next === undefined) return; // not a navigation key
|
|
74
|
+
* event.preventDefault();
|
|
75
|
+
* setActive(next);
|
|
76
|
+
* };
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export declare const getNextActiveValue: <V extends ContextMenuValue>(entries: ContextMenuEntry<V>[], activeValue: V | null | undefined, key: string) => V | null | undefined;
|
|
@@ -232,4 +232,11 @@ export interface DropdownContextType {
|
|
|
232
232
|
* Computed by Dropdown based on dropdownPosition prop and available viewport space
|
|
233
233
|
*/
|
|
234
234
|
placement?: 'top' | 'bottom';
|
|
235
|
+
/**
|
|
236
|
+
* Option highlighted by the keyboard or the pointer. Focus stays on the
|
|
237
|
+
* toggle, so the list is driven from there.
|
|
238
|
+
*/
|
|
239
|
+
activeValue?: string | number | null;
|
|
240
|
+
/** Moves the highlight; called by the list on pointer moves. */
|
|
241
|
+
setActiveValue?: (value: string | number | null) => void;
|
|
235
242
|
}
|