@hirobius/design-system 0.18.0 → 0.19.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/CONSUMING.md +150 -0
- package/DESIGN.md +220 -0
- package/README.md +14 -2
- package/dist/chunks/{LanguageContext-CH_bwzCq.js → LanguageContext-BxdCwiFg.js} +20 -8
- package/dist/chunks/{TokenDisplayContext-evZi_214.js → TokenDisplayContext-DKYJMVWk.js} +10 -2
- package/dist/chunks/{activity-feed-C8_e-Btq.js → activity-feed-BGQ6v3wc.js} +5248 -3163
- package/dist/chunks/{form-DnGRy27o.js → form-COP3vK9_.js} +31 -29
- package/dist/contexts.js +4 -4
- package/dist/form.js +5 -5
- package/dist/hirobius-ui.js +2790 -3257
- package/dist/icons.js +53 -0
- package/dist/manifest.js +15 -14
- package/dist/patterns.js +284 -101
- package/dist/static.css +3 -3
- package/dist/styles.css +1 -1
- package/dist/tokens.css +1 -1
- package/dist/types/src/app/components/alert-dialog.d.ts +9 -1
- package/dist/types/src/app/components/alert.d.ts +4 -0
- package/dist/types/src/app/components/avatar.d.ts +4 -0
- package/dist/types/src/app/components/badge.d.ts +4 -0
- package/dist/types/src/app/components/box.d.ts +5 -0
- package/dist/types/src/app/components/breadcrumb.d.ts +4 -0
- package/dist/types/src/app/components/button-group.d.ts +4 -0
- package/dist/types/src/app/components/button.d.ts +3 -0
- package/dist/types/src/app/components/card.d.ts +9 -0
- package/dist/types/src/app/components/checkbox.d.ts +4 -0
- package/dist/types/src/app/components/combobox.d.ts +10 -0
- package/dist/types/src/app/components/command-palette.d.ts +3 -1
- package/dist/types/src/app/components/container.d.ts +5 -0
- package/dist/types/src/app/components/context-menu.d.ts +25 -2
- package/dist/types/src/app/components/data-table-section.d.ts +45 -0
- package/dist/types/src/app/components/destructive-section.d.ts +32 -0
- package/dist/types/src/app/components/dialog.d.ts +20 -2
- package/dist/types/src/app/components/disclosure.d.ts +3 -0
- package/dist/types/src/app/components/divider.d.ts +4 -0
- package/dist/types/src/app/components/empty-state.d.ts +4 -0
- package/dist/types/src/app/components/field.d.ts +4 -0
- package/dist/types/src/app/components/form-actions.d.ts +26 -0
- package/dist/types/src/app/components/grid.d.ts +4 -0
- package/dist/types/src/app/components/hds-tooltip.d.ts +14 -2
- package/dist/types/src/app/components/hover-card.d.ts +16 -1
- package/dist/types/src/app/components/icon.d.ts +4 -0
- package/dist/types/src/app/components/inline-link.d.ts +4 -0
- package/dist/types/src/app/components/input.d.ts +5 -0
- package/dist/types/src/app/components/kbd.d.ts +3 -0
- package/dist/types/src/app/components/menu.d.ts +26 -2
- package/dist/types/src/app/components/metric-tiles.d.ts +40 -0
- package/dist/types/src/app/components/page-header.d.ts +34 -0
- package/dist/types/src/app/components/pagination.d.ts +3 -0
- package/dist/types/src/app/components/popover.d.ts +14 -2
- package/dist/types/src/app/components/progress.d.ts +4 -0
- package/dist/types/src/app/components/radio.d.ts +5 -0
- package/dist/types/src/app/components/select.d.ts +16 -0
- package/dist/types/src/app/components/skeleton.d.ts +4 -0
- package/dist/types/src/app/components/slider.d.ts +3 -0
- package/dist/types/src/app/components/spinner.d.ts +4 -0
- package/dist/types/src/app/components/stack.d.ts +4 -0
- package/dist/types/src/app/components/stat.d.ts +4 -0
- package/dist/types/src/app/components/status-tile.d.ts +4 -0
- package/dist/types/src/app/components/table.d.ts +36 -4
- package/dist/types/src/app/components/tabs.d.ts +4 -0
- package/dist/types/src/app/components/tag.d.ts +3 -0
- package/dist/types/src/app/components/text.d.ts +4 -0
- package/dist/types/src/app/components/textarea.d.ts +3 -0
- package/dist/types/src/app/components/toast.d.ts +4 -0
- package/dist/types/src/app/components/toggle.d.ts +4 -0
- package/dist/types/src/app/components/tooltip.d.ts +1 -1
- package/dist/types/src/app/components/visually-hidden.d.ts +3 -0
- package/dist/types/src/app/context/hds-portal.d.ts +52 -0
- package/dist/types/src/app/context/hds-theme.d.ts +10 -0
- package/dist/types/src/app/data/manifest-types.d.ts +27 -0
- package/dist/types/src/app/design-system/generated-token-refs.d.ts +2 -0
- package/dist/types/src/icons.d.ts +13 -0
- package/dist/types/src/index.d.ts +20 -1
- package/dist/types/src/patterns.d.ts +5 -0
- package/dist/variables.css +4 -0
- package/docs/CONSUMING.md +758 -0
- package/hirobius.tokens.json +17 -0
- package/llms.txt +261 -0
- package/package.json +22 -4
- package/public/hds-manifest.json +1605 -105
- package/public/llms/components.txt +1090 -0
- package/public/llms/layout.txt +54 -0
- package/public/llms/scroll.txt +22 -0
- package/public/llms/tokens.txt +32 -0
- package/public/llms-full.txt +1561 -0
- package/public/llms.txt +261 -0
- package/src/app/data/component-api.json +6156 -0
|
@@ -30,7 +30,15 @@ declare const AlertDialogPortal: React.FC<AlertDialogPrimitive.AlertDialogPortal
|
|
|
30
30
|
declare const AlertDialogAction: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>>;
|
|
31
31
|
declare const AlertDialogCancel: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>>;
|
|
32
32
|
declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
-
|
|
33
|
+
/** @public */
|
|
34
|
+
export interface AlertDialogContentProps extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content> {
|
|
35
|
+
/**
|
|
36
|
+
* Element to portal into. Defaults to the nearest `data-hds` scope, so the
|
|
37
|
+
* overlay inherits its theme; pass `null` to use `document.body`.
|
|
38
|
+
*/
|
|
39
|
+
container?: HTMLElement | null;
|
|
40
|
+
}
|
|
41
|
+
declare const AlertDialogContent: React.ForwardRefExoticComponent<AlertDialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
34
42
|
declare const AlertDialogHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
35
43
|
declare const AlertDialogFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
36
44
|
declare const AlertDialogTitle: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Alert - compact feedback surface with contextual severity.
|
|
3
3
|
* @category Feedback
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Show a persistent inline message with a severity, next to the content it concerns.
|
|
6
|
+
* @whenNot A brief confirmation that should disappear on its own, or a status label.
|
|
7
|
+
* @useInstead ToastProvider a brief confirmation that fades away
|
|
8
|
+
* @useInstead Badge a short status label
|
|
5
9
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=33-34
|
|
6
10
|
*/
|
|
7
11
|
import React from 'react';
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Avatar - user or entity image with an initials fallback.
|
|
3
3
|
* @category Display
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Show a person or entity as an image with an initials fallback.
|
|
6
|
+
* @whenNot A generic pictogram, or a status marker.
|
|
7
|
+
* @useInstead Icon a generic pictogram
|
|
8
|
+
* @useInstead Badge a status marker
|
|
5
9
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=34-18
|
|
6
10
|
*/
|
|
7
11
|
import * as React from 'react';
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Badge - compact feedback badge for neutral and semantic states.
|
|
3
3
|
* @category Feedback
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Label a status, state or count with a compact neutral or semantic chip.
|
|
6
|
+
* @whenNot A chip people can toggle, or a message that needs a sentence.
|
|
7
|
+
* @useInstead Tag an interactive filter or category chip
|
|
8
|
+
* @useInstead Alert a message that needs a sentence
|
|
5
9
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=31-15
|
|
6
10
|
*/
|
|
7
11
|
import * as React from 'react';
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
* Box — polymorphic layout primitive with a token-first `sx` engine.
|
|
3
3
|
* @category Layout
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Build one-off layout that no named layout primitive covers, using token keys through `sx`.
|
|
6
|
+
* @whenNot Ordinary vertical or horizontal spacing, columns, or page-width constraint.
|
|
7
|
+
* @useInstead Stack a row or column of content with even gaps
|
|
8
|
+
* @useInstead Grid multi-column layout
|
|
9
|
+
* @useInstead Container a width-constrained page region
|
|
5
10
|
* @ai-intent Provides one narrow escape hatch for genuinely one-off layout that no
|
|
6
11
|
* named primitive covers, without inviting ad hoc inline styles or raw hex/px values
|
|
7
12
|
* back into the system — the `sx` engine only accepts HDS token keys and a small,
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Breadcrumb - hierarchical navigation trail.
|
|
3
3
|
* @category Navigation
|
|
4
4
|
* @tier pattern
|
|
5
|
+
* @usage Show where the current page sits in a hierarchy and link back up it.
|
|
6
|
+
* @whenNot Switching between sibling views, or stepping through pages of results.
|
|
7
|
+
* @useInstead Tabs switching between sibling views
|
|
8
|
+
* @useInstead Pagination stepping through pages of results
|
|
5
9
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=86-159
|
|
6
10
|
*/
|
|
7
11
|
import * as React from 'react';
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* ButtonGroup — attaches Button children into one segmented control.
|
|
3
3
|
* @category Actions
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Attach related Buttons into one segmented row or column that reads as a single control.
|
|
6
|
+
* @whenNot Buttons that are unrelated, or choosing one of several views.
|
|
7
|
+
* @useInstead SegmentedControl choosing one of several views
|
|
8
|
+
* @useInstead Stack loosely spaced buttons
|
|
5
9
|
*/
|
|
6
10
|
import * as React from 'react';
|
|
7
11
|
import { type VariantProps } from 'class-variance-authority';
|
|
@@ -33,6 +33,9 @@ export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonE
|
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Triggers an action when activated.
|
|
36
|
+
* @usage Trigger an action (submit, save, open a dialog) with a text label and optional icons; for an icon-only control pass iconOnly with iconLeft.
|
|
37
|
+
* @whenNot Navigating to another page, where a link is the correct element.
|
|
38
|
+
* @useInstead InlineLink navigation to another page
|
|
36
39
|
*/
|
|
37
40
|
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
38
41
|
/** @internal — CVA variant helper; compose via Button props instead. */
|
|
@@ -128,11 +128,20 @@ export interface CardMetricProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
128
128
|
/** Tone for the value — applies semantic color. Defaults to neutral. */
|
|
129
129
|
tone?: CardTone;
|
|
130
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Card.Metric — one uppercase label, a large value and an optional sub-line inside a Card.
|
|
133
|
+
* @usage Show one headline figure (a KPI, a count, a total) with its label inside a Card.
|
|
134
|
+
* @whenNot A metric outside a Card, or several figures that share one label.
|
|
135
|
+
*/
|
|
131
136
|
declare const CardMetric: React.ForwardRefExoticComponent<CardMetricProps & React.RefAttributes<HTMLDivElement>>;
|
|
132
137
|
/**
|
|
133
138
|
* Tagged per-export, not on the file block: this module exports eight
|
|
134
139
|
* components and a file-level @figma would hand all eight this one node.
|
|
135
140
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=39-11
|
|
141
|
+
* @usage Group related content on a raised surface with header, body, footer and metric slots.
|
|
142
|
+
* @whenNot A bare padded background with no slot anatomy, or a single headline figure.
|
|
143
|
+
* @useInstead Surface a padded background without slot anatomy
|
|
144
|
+
* @useInstead Card.Metric a single headline figure
|
|
136
145
|
*/
|
|
137
146
|
export declare const Card: CardComponent;
|
|
138
147
|
export { CardHeader, CardTitle, CardDescription, CardBody, CardFooter, CardProgress, CardMetric };
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Checkbox — custom-drawn checkbox with check / indeterminate glyph.
|
|
3
3
|
* @category Inputs
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Let people tick one or more independent options, or a parent choice that is partly selected.
|
|
6
|
+
* @whenNot An immediate on/off setting, or a choice of exactly one option from a set.
|
|
7
|
+
* @useInstead Toggle a setting that applies as soon as it flips
|
|
8
|
+
* @useInstead Radio exactly one choice from a set
|
|
5
9
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=35-29
|
|
6
10
|
*/
|
|
7
11
|
import type { InputHTMLAttributes } from 'react';
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
* Combobox — searchable single-select (Popover + filtered listbox).
|
|
3
3
|
* @category Inputs
|
|
4
4
|
* @tier pattern
|
|
5
|
+
* @usage Pick one value from a long list of options, with a search field that filters as you type.
|
|
6
|
+
* @whenNot A short list that needs no search, or an action list.
|
|
7
|
+
* @useInstead Select a short list without search
|
|
8
|
+
* @useInstead Menu firing actions from a trigger
|
|
9
|
+
* @keyboard Enter/Space Opens the list from the trigger and moves focus to the search field.
|
|
10
|
+
* @keyboard ArrowDown/ArrowUp Moves the active option and wraps at the ends.
|
|
11
|
+
* @keyboard Character Filters the options to those matching the typed text.
|
|
12
|
+
* @keyboard Enter Commits the active option and closes the list.
|
|
13
|
+
* @keyboard Escape Closes the list.
|
|
14
|
+
* @keyboard Tab Stays inside the open list.
|
|
5
15
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=82-237
|
|
6
16
|
* @doc-exempt: no Inputs-overlay doc page yet — add demo when created
|
|
7
17
|
*
|
|
@@ -39,6 +39,8 @@ export interface CommandPaletteProps {
|
|
|
39
39
|
* Mountable trigger + dialog. Drop into header slot; component manages its
|
|
40
40
|
* own open state and Cmd-K / Ctrl-K global keybinding.
|
|
41
41
|
*/
|
|
42
|
-
export declare const CommandPalette: React.ForwardRefExoticComponent<CommandPaletteProps & React.RefAttributes<HTMLInputElement
|
|
42
|
+
export declare const CommandPalette: React.ForwardRefExoticComponent<CommandPaletteProps & React.RefAttributes<HTMLInputElement>> & {
|
|
43
|
+
displayName: string;
|
|
44
|
+
};
|
|
43
45
|
/** @internal — CVA variant helpers; compose via CommandPalette instead. */
|
|
44
46
|
export { cmdkRowVariants, cmdkKindBadgeVariants, cmdkDescriptionVariants };
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
* Container — semantic width-constrained layout.
|
|
3
3
|
* @category Layout
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Constrain a page region to the content or maximum width and centre it.
|
|
6
|
+
* @whenNot Spacing between siblings, columns, or a surface with padding.
|
|
7
|
+
* @useInstead Stack spacing between siblings
|
|
8
|
+
* @useInstead Grid columns
|
|
9
|
+
* @useInstead Box one-off layout that no named primitive covers
|
|
5
10
|
* @ai-intent Solves horizontal width constraint and page centering with a
|
|
6
11
|
* semantic max-width scale, so agents stop hand-rolling `marginInline: auto`
|
|
7
12
|
* plus an ad hoc max-width pixel value for page shells.
|
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
* ContextMenu — right-click context menu on Radix ContextMenu.
|
|
3
3
|
* @category Overlays
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Offer actions for an item on right-click, or the equivalent keyboard gesture.
|
|
6
|
+
* @whenNot The only way to reach an action, or actions from a visible trigger.
|
|
7
|
+
* @useInstead Menu actions from a visible trigger
|
|
8
|
+
* @slot trigger The area that opens the menu on right-click (ContextMenu.Trigger).
|
|
9
|
+
* @slot content The popup holding the items (ContextMenu.Content).
|
|
10
|
+
* @keyboard ArrowDown/ArrowUp Moves the highlight and stops at the first and last item.
|
|
11
|
+
* @keyboard End Jumps to the last item.
|
|
12
|
+
* @keyboard Character Highlights the next item that starts with the typed letter.
|
|
13
|
+
* @keyboard Enter Selects the highlighted item and closes the menu.
|
|
14
|
+
* @keyboard Escape Closes the menu without leaving focus inside the removed content.
|
|
15
|
+
* @keyboard Tab Does not leave the open menu.
|
|
5
16
|
* @doc-exempt: no Overlays doc page yet — add demo when the overlays page is created
|
|
6
17
|
*
|
|
7
18
|
* Radix ContextMenu (@radix-ui/react-context-menu) themed with the same overlay
|
|
@@ -24,14 +35,26 @@ declare const ContextMenuTrigger: React.ForwardRefExoticComponent<ContextMenuPri
|
|
|
24
35
|
declare const ContextMenuGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
36
|
declare const ContextMenuRadioGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
26
37
|
declare const ContextMenuSub: React.FC<ContextMenuPrimitive.ContextMenuSubProps>;
|
|
27
|
-
declare const ContextMenuContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> &
|
|
38
|
+
declare const ContextMenuContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
39
|
+
/**
|
|
40
|
+
* Element to portal into. Defaults to the nearest `data-hds` scope, so the
|
|
41
|
+
* overlay inherits its theme; pass `null` to use `document.body`.
|
|
42
|
+
*/
|
|
43
|
+
container?: HTMLElement | null;
|
|
44
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
28
45
|
declare const ContextMenuItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
29
46
|
declare const ContextMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
30
47
|
declare const ContextMenuRadioItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
31
48
|
declare const ContextMenuLabel: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
32
49
|
declare const ContextMenuSeparator: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
33
50
|
declare const ContextMenuSubTrigger: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
-
declare const ContextMenuSubContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> &
|
|
51
|
+
declare const ContextMenuSubContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
52
|
+
/**
|
|
53
|
+
* Element to portal into. Defaults to the nearest `data-hds` scope, so the
|
|
54
|
+
* overlay inherits its theme; pass `null` to use `document.body`.
|
|
55
|
+
*/
|
|
56
|
+
container?: HTMLElement | null;
|
|
57
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
35
58
|
interface ContextMenuComponent extends React.FC<React.ComponentProps<typeof ContextMenuPrimitive.Root>> {
|
|
36
59
|
Trigger: typeof ContextMenuTrigger;
|
|
37
60
|
Content: typeof ContextMenuContent;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DataTableSection - a titled table with a toolbar, row actions and an empty state.
|
|
3
|
+
* @category Display
|
|
4
|
+
* @tier pattern
|
|
5
|
+
*/
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { type TableColumn } from './table.js';
|
|
8
|
+
/** @public */
|
|
9
|
+
export interface DataTableSectionRow {
|
|
10
|
+
/** Stable row key. */
|
|
11
|
+
key: string;
|
|
12
|
+
/** One node per column, in column order. */
|
|
13
|
+
cells: React.ReactNode[];
|
|
14
|
+
/**
|
|
15
|
+
* Row actions (a `Button` group, a `Menu` trigger, `IconButton`s). Rendered in a
|
|
16
|
+
* trailing column; the pattern bakes in no icon.
|
|
17
|
+
*/
|
|
18
|
+
actions?: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
/** @public */
|
|
21
|
+
export interface DataTableSectionProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {
|
|
22
|
+
/** Section heading. */
|
|
23
|
+
title: React.ReactNode;
|
|
24
|
+
/** Toolbar beside the heading: a search field, a filter, an "Add" button. */
|
|
25
|
+
toolbar?: React.ReactNode;
|
|
26
|
+
/** Data columns, in order. Do not include the actions column; it is added for you. */
|
|
27
|
+
columns: TableColumn[];
|
|
28
|
+
/** Data rows. An empty array renders the empty state instead of the table. */
|
|
29
|
+
rows: DataTableSectionRow[];
|
|
30
|
+
/** Header of the trailing actions column. Defaults to "Actions". */
|
|
31
|
+
actionsLabel?: string;
|
|
32
|
+
/** Empty-state message when there are no rows. Defaults to "Nothing here yet". */
|
|
33
|
+
emptyTitle?: React.ReactNode;
|
|
34
|
+
/** Optional supporting line under the empty-state message. */
|
|
35
|
+
emptyDescription?: React.ReactNode;
|
|
36
|
+
/** Heading element for the title. Changes the DOM element only. Defaults to 2. */
|
|
37
|
+
level?: 2 | 3 | 4 | 5 | 6;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Section heading and toolbar over a `Table`. Row actions are consumer nodes in a
|
|
41
|
+
* trailing column, the table scrolls horizontally on narrow widths without a
|
|
42
|
+
* `minWidth` from the caller, and zero rows shows an `EmptyState`.
|
|
43
|
+
* @screenPattern
|
|
44
|
+
*/
|
|
45
|
+
export declare const DataTableSection: React.ForwardRefExoticComponent<DataTableSectionProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DestructiveSection - the one place a screen puts an irreversible action.
|
|
3
|
+
* @category Actions
|
|
4
|
+
* @tier pattern
|
|
5
|
+
*/
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
/** @public */
|
|
8
|
+
export interface DestructiveSectionProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {
|
|
9
|
+
/** What the zone does, as a short action ("Archive client"). Also the dialog title. */
|
|
10
|
+
title: React.ReactNode;
|
|
11
|
+
/** What happens and what is kept. One or two plain sentences. */
|
|
12
|
+
description: React.ReactNode;
|
|
13
|
+
/** Label of the danger button that opens the confirmation. Defaults to `confirmLabel`. */
|
|
14
|
+
actionLabel?: React.ReactNode;
|
|
15
|
+
/** Label of the confirm button inside the dialog. Name the action ("Archive client"). */
|
|
16
|
+
confirmLabel: string;
|
|
17
|
+
/** Body of the confirmation dialog: the consequence, stated plainly. */
|
|
18
|
+
confirmBody: React.ReactNode;
|
|
19
|
+
/** Called once, only when the dialog's confirm button is pressed. */
|
|
20
|
+
onConfirm: () => void;
|
|
21
|
+
/** Label of the dialog's cancel button. Defaults to "Cancel". */
|
|
22
|
+
cancelLabel?: string;
|
|
23
|
+
/** Heading element for the title. Changes the DOM element only. Defaults to 2. */
|
|
24
|
+
level?: 2 | 3 | 4 | 5 | 6;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Titled danger zone: a title, an explanation, and one danger `Button` that
|
|
28
|
+
* opens an `AlertDialog`. Pressing the button never runs the action; only the
|
|
29
|
+
* dialog's confirm does. Place it last on the screen, below the form.
|
|
30
|
+
* @screenPattern
|
|
31
|
+
*/
|
|
32
|
+
export declare const DestructiveSection: React.ForwardRefExoticComponent<DestructiveSectionProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -28,8 +28,10 @@
|
|
|
28
28
|
*
|
|
29
29
|
* Surface uses role.popover (semantic.color.surface.overlay) +
|
|
30
30
|
* shadow-overlay (semantic.shadow.overlay from 8e-1). The scrim is
|
|
31
|
-
*
|
|
32
|
-
* black. The
|
|
31
|
+
* role.scrim (semantic.color.surface.scrim) at 60% alpha: dark in both
|
|
32
|
+
* themes, black in dark mode. The overlay portals into the nearest
|
|
33
|
+
* `data-hds` scope so it inherits the active theme; pass `container` to
|
|
34
|
+
* override. The close affordance is rendered as an absolutely-positioned
|
|
33
35
|
* X inside Content; pass `hideClose` to opt out for fully-custom layouts.
|
|
34
36
|
*/
|
|
35
37
|
import * as React from 'react';
|
|
@@ -42,6 +44,11 @@ declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitiv
|
|
|
42
44
|
export interface DialogContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
|
|
43
45
|
/** Hide the built-in close affordance. Useful for fully custom layouts. */
|
|
44
46
|
hideClose?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Element to portal into. Defaults to the nearest `data-hds` scope, so the
|
|
49
|
+
* overlay inherits its theme; pass `null` to use `document.body`.
|
|
50
|
+
*/
|
|
51
|
+
container?: HTMLElement | null;
|
|
45
52
|
}
|
|
46
53
|
declare const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
47
54
|
declare const DialogHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -72,6 +79,17 @@ interface DialogComponent extends React.FC<DialogProps> {
|
|
|
72
79
|
/**
|
|
73
80
|
* Tagged per-export, not on the file block: this module exports ten components
|
|
74
81
|
* and a file-level @figma would hand all ten this one node.
|
|
82
|
+
* @usage Interrupt the page with a modal that needs a decision or focused input before people continue.
|
|
83
|
+
* @whenNot A preview on hover, a message that needs no reply, or content that can stay inline.
|
|
84
|
+
* @useInstead HoverCard a preview on hover or focus
|
|
85
|
+
* @useInstead Alert a message that needs no reply
|
|
86
|
+
* @useInstead ToastProvider a brief confirmation
|
|
87
|
+
* @slot trigger The element that opens the dialog (Dialog.Trigger).
|
|
88
|
+
* @slot surface The modal surface (Dialog.Content).
|
|
89
|
+
* @keyboard Enter/Space Opens the dialog from the trigger and moves focus inside it.
|
|
90
|
+
* @keyboard Escape Closes the dialog and returns focus to the trigger.
|
|
91
|
+
* @keyboard Tab Cycles focus inside the open dialog.
|
|
92
|
+
* @keyboard Shift+Tab Cycles focus backwards inside the open dialog.
|
|
75
93
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=93-27
|
|
76
94
|
*/
|
|
77
95
|
export declare const Dialog: DialogComponent;
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* Disclosure - compact disclosure surface for optional explanatory content.
|
|
3
3
|
* @category Layout
|
|
4
4
|
* @tier pattern
|
|
5
|
+
* @usage Hide optional explanatory content behind a heading that people can expand.
|
|
6
|
+
* @whenNot Content people must see, or switching between panels.
|
|
7
|
+
* @useInstead Tabs switching between panels of content
|
|
5
8
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=88-453
|
|
6
9
|
*/
|
|
7
10
|
import React, { type CSSProperties, type ReactNode } from 'react';
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Divider — semantic separator between content regions.
|
|
3
3
|
* @category Layout
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Separate two regions of content with a thin semantic rule.
|
|
6
|
+
* @whenNot Spacing alone would do, or the separation needs a container.
|
|
7
|
+
* @useInstead Stack gap-based spacing between siblings
|
|
8
|
+
* @useInstead Surface a bounded region with its own background
|
|
5
9
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=89-26
|
|
6
10
|
*/
|
|
7
11
|
import * as React from 'react';
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* EmptyState — consistent no-data placeholder for lists, grids, and sections.
|
|
3
3
|
* @category Display
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Say that a list, grid or section has no data yet, with a title and an optional description.
|
|
6
|
+
* @whenNot Content that is still loading, or a full-page error.
|
|
7
|
+
* @useInstead Skeleton content that is still loading
|
|
8
|
+
* @useInstead Alert a message about something that went wrong
|
|
5
9
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=88-352
|
|
6
10
|
* @ai-intent Inline empty-state placeholder so any list, grid, or section can
|
|
7
11
|
* communicate "no data yet" with consistent muted typography instead of agents
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @category Display
|
|
3
3
|
* @tier primitive
|
|
4
|
+
* @usage Show a labelled read-only value, such as a name and its value in a detail view.
|
|
5
|
+
* @whenNot Editable input, or a single headline figure.
|
|
6
|
+
* @useInstead Input an editable single-line value
|
|
7
|
+
* @useInstead Card.Metric a headline figure inside a Card
|
|
4
8
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=85-81
|
|
5
9
|
*/
|
|
6
10
|
import * as React from 'react';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormActions - the footer row of a form: primary right-most, secondary to its left.
|
|
3
|
+
* @category Actions
|
|
4
|
+
* @tier pattern
|
|
5
|
+
*/
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
/** @public */
|
|
8
|
+
export interface FormActionsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
9
|
+
/** The submit action (a primary `Button`). Always last in DOM order and right-most. */
|
|
10
|
+
primary: React.ReactNode;
|
|
11
|
+
/** The cancel or back action, placed immediately left of the primary. */
|
|
12
|
+
secondary?: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* A destructive action (delete, remove). Placed on the far left, apart from the
|
|
15
|
+
* primary and secondary so a mis-click never lands on it. Never right of the primary.
|
|
16
|
+
*/
|
|
17
|
+
destructive?: React.ReactNode;
|
|
18
|
+
/** Pin the row to the bottom of the scroll container. Off by default. */
|
|
19
|
+
sticky?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Form footer with one fixed order: destructive (far left, if any), then secondary,
|
|
23
|
+
* then primary last and right-most. Gap is the tight layout token.
|
|
24
|
+
* @screenPattern
|
|
25
|
+
*/
|
|
26
|
+
export declare const FormActions: React.ForwardRefExoticComponent<FormActionsProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Grid — responsive grid composition primitive.
|
|
3
3
|
* @category Layout
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Lay out content in responsive columns with token-governed gaps, or align nested content with subgrid.
|
|
6
|
+
* @whenNot A single row or column, or styling a surface.
|
|
7
|
+
* @useInstead Stack a single row or column
|
|
8
|
+
* @useInstead Box one-off layout that no named primitive covers
|
|
5
9
|
* @ai-intent Solves multi-column layout and repeatable alignment with token-governed gaps, responsive column collapse, and a first-class subgrid escape hatch for nested structure.
|
|
6
10
|
* @ai-rules Use Grid for spatial layout, not for surface styling or content padding. Do NOT apply background, border, or internal padding directly to Grid to mimic a card. Do NOT use arbitrary CSS grid templates when fixed, auto-fit, or subgrid modes already express the layout. Do NOT use Grid for simple one-dimensional stacks where Stack is sufficient.
|
|
7
11
|
*
|
|
@@ -26,8 +26,20 @@
|
|
|
26
26
|
import * as React from 'react';
|
|
27
27
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
28
28
|
/** @public */
|
|
29
|
-
export type HdsTooltipContentProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content
|
|
30
|
-
|
|
29
|
+
export type HdsTooltipContentProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {
|
|
30
|
+
/**
|
|
31
|
+
* Element to portal into. Defaults to the nearest `data-hds` scope, so the
|
|
32
|
+
* overlay inherits its theme; pass `null` to use `document.body`.
|
|
33
|
+
*/
|
|
34
|
+
container?: HTMLElement | null;
|
|
35
|
+
};
|
|
36
|
+
declare const HdsTooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
37
|
+
/**
|
|
38
|
+
* Element to portal into. Defaults to the nearest `data-hds` scope, so the
|
|
39
|
+
* overlay inherits its theme; pass `null` to use `document.body`.
|
|
40
|
+
*/
|
|
41
|
+
container?: HTMLElement | null;
|
|
42
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
31
43
|
interface HdsTooltipComponent extends React.FC<React.ComponentProps<typeof TooltipPrimitive.Root> & {
|
|
32
44
|
/** Hover-open delay in ms (Radix Provider). Default 300. */
|
|
33
45
|
delayDuration?: number;
|
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
* HoverCard — rich preview shown on hover/focus, on Radix HoverCard.
|
|
3
3
|
* @category Overlays
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Preview extra detail about a link or mention when it is hovered or focused, without navigating.
|
|
6
|
+
* @whenNot Content people must reach, or a label for an interactive control.
|
|
7
|
+
* @useInstead Dialog content people must act on
|
|
8
|
+
* @useInstead Tooltip a short label for a control
|
|
9
|
+
* @slot trigger The link or element that opens the card (HoverCard.Trigger).
|
|
10
|
+
* @slot content The preview (HoverCard.Content).
|
|
11
|
+
* @keyboard Focus Opens the card when the trigger receives keyboard focus.
|
|
12
|
+
* @keyboard Escape Closes the card and keeps focus on the trigger.
|
|
13
|
+
* @keyboard Tab Moves on to the next element and closes the card.
|
|
5
14
|
* @doc-exempt: no Overlays doc page yet — add demo when the overlays page is created
|
|
6
15
|
*
|
|
7
16
|
* Radix HoverCard (@radix-ui/react-hover-card) themed with the overlay role
|
|
@@ -17,7 +26,13 @@
|
|
|
17
26
|
import * as React from 'react';
|
|
18
27
|
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
19
28
|
declare const HoverCardTrigger: React.ForwardRefExoticComponent<HoverCardPrimitive.HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
20
|
-
declare const HoverCardContent: React.ForwardRefExoticComponent<Omit<HoverCardPrimitive.HoverCardContentProps & React.RefAttributes<HTMLDivElement>, "ref"> &
|
|
29
|
+
declare const HoverCardContent: React.ForwardRefExoticComponent<Omit<HoverCardPrimitive.HoverCardContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
30
|
+
/**
|
|
31
|
+
* Element to portal into. Defaults to the nearest `data-hds` scope, so the
|
|
32
|
+
* overlay inherits its theme; pass `null` to use `document.body`.
|
|
33
|
+
*/
|
|
34
|
+
container?: HTMLElement | null;
|
|
35
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
21
36
|
interface HoverCardComponent extends React.FC<React.ComponentProps<typeof HoverCardPrimitive.Root>> {
|
|
22
37
|
Trigger: typeof HoverCardTrigger;
|
|
23
38
|
Content: typeof HoverCardContent;
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Icon — semantic icon wrapper for Lucide icons.
|
|
3
3
|
* @category Display
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Draw a Lucide glyph at a size and colour from the design tokens.
|
|
6
|
+
* @whenNot A control someone can activate, or a picture that carries content.
|
|
7
|
+
* @useInstead Button a clickable control, with iconOnly for an icon-only one
|
|
8
|
+
* @useInstead Avatar a picture of a person or entity
|
|
5
9
|
*/
|
|
6
10
|
import React from 'react';
|
|
7
11
|
import type { LucideIcon } from 'lucide-react';
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* InlineLink ” inline navigation and external-link primitive for body copy.
|
|
3
3
|
* @category Navigation
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Link to a route or external URL from inside body copy.
|
|
6
|
+
* @whenNot An action that changes something, or a control that needs button styling.
|
|
7
|
+
* @useInstead Button an action or a link that needs button styling
|
|
8
|
+
* @useInstead Text unlinked body copy
|
|
5
9
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=89-161
|
|
6
10
|
*/
|
|
7
11
|
import React from 'react';
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
* Input — text field primitive with label, helper, and error slots.
|
|
3
3
|
* @category Inputs
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Collect a single line of text, a number, an email or a password, with label, helper and error slots.
|
|
6
|
+
* @whenNot Multi-line text, or choosing from a fixed list of options.
|
|
7
|
+
* @useInstead Textarea multi-line text
|
|
8
|
+
* @useInstead Select a short fixed list
|
|
9
|
+
* @useInstead Combobox a long fixed list that needs search
|
|
5
10
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=38-20
|
|
6
11
|
*/
|
|
7
12
|
import * as React from 'react';
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* Kbd — inline keyboard key / shortcut hint rendered as a native <kbd>.
|
|
3
3
|
* @category Display
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Show a keyboard key or shortcut hint inline, as a native kbd element.
|
|
6
|
+
* @whenNot Code samples, or a control that runs the shortcut.
|
|
7
|
+
* @useInstead Text inline code and other typography
|
|
5
8
|
*/
|
|
6
9
|
import * as React from 'react';
|
|
7
10
|
import { type VariantProps } from 'class-variance-authority';
|
|
@@ -26,14 +26,26 @@ declare const MenuTrigger: React.ForwardRefExoticComponent<MenuPrimitive.Dropdow
|
|
|
26
26
|
declare const MenuGroup: React.ForwardRefExoticComponent<MenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
27
|
declare const MenuRadioGroup: React.ForwardRefExoticComponent<MenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
28
|
declare const MenuSub: React.FC<MenuPrimitive.DropdownMenuSubProps>;
|
|
29
|
-
declare const MenuContent: React.ForwardRefExoticComponent<Omit<MenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> &
|
|
29
|
+
declare const MenuContent: React.ForwardRefExoticComponent<Omit<MenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
30
|
+
/**
|
|
31
|
+
* Element to portal into. Defaults to the nearest `data-hds` scope, so the
|
|
32
|
+
* overlay inherits its theme; pass `null` to use `document.body`.
|
|
33
|
+
*/
|
|
34
|
+
container?: HTMLElement | null;
|
|
35
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
30
36
|
declare const MenuItem: React.ForwardRefExoticComponent<Omit<MenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
31
37
|
declare const MenuCheckboxItem: React.ForwardRefExoticComponent<Omit<MenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
32
38
|
declare const MenuRadioItem: React.ForwardRefExoticComponent<Omit<MenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
33
39
|
declare const MenuLabel: React.ForwardRefExoticComponent<Omit<MenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
34
40
|
declare const MenuSeparator: React.ForwardRefExoticComponent<Omit<MenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
35
41
|
declare const MenuSubTrigger: React.ForwardRefExoticComponent<Omit<MenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
36
|
-
declare const MenuSubContent: React.ForwardRefExoticComponent<Omit<MenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> &
|
|
42
|
+
declare const MenuSubContent: React.ForwardRefExoticComponent<Omit<MenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
43
|
+
/**
|
|
44
|
+
* Element to portal into. Defaults to the nearest `data-hds` scope, so the
|
|
45
|
+
* overlay inherits its theme; pass `null` to use `document.body`.
|
|
46
|
+
*/
|
|
47
|
+
container?: HTMLElement | null;
|
|
48
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
37
49
|
interface MenuComponent extends React.FC<React.ComponentProps<typeof MenuPrimitive.Root>> {
|
|
38
50
|
Trigger: typeof MenuTrigger;
|
|
39
51
|
Content: typeof MenuContent;
|
|
@@ -51,6 +63,18 @@ interface MenuComponent extends React.FC<React.ComponentProps<typeof MenuPrimiti
|
|
|
51
63
|
/**
|
|
52
64
|
* Menu root + parts. Controlled via `open`/`onOpenChange`, or uncontrolled with
|
|
53
65
|
* `defaultOpen`.
|
|
66
|
+
* @usage Offer a list of actions from a trigger, closed until opened.
|
|
67
|
+
* @whenNot Choosing one value for a form field, or a set of options that must stay visible.
|
|
68
|
+
* @useInstead Select choosing a value for a form field
|
|
69
|
+
* @slot trigger The element that opens the menu (Menu.Trigger).
|
|
70
|
+
* @slot content The popup holding the items (Menu.Content).
|
|
71
|
+
* @keyboard Enter/Space/ArrowDown Opens the menu from the trigger and highlights the first item.
|
|
72
|
+
* @keyboard ArrowDown/ArrowUp Moves the highlight; it stops at the first and last item.
|
|
73
|
+
* @keyboard Home/End Jumps to the first or last item.
|
|
74
|
+
* @keyboard Character Highlights the next item that starts with the typed letter.
|
|
75
|
+
* @keyboard Enter Selects the highlighted item and closes the menu.
|
|
76
|
+
* @keyboard Escape Closes the menu and returns focus to the trigger.
|
|
77
|
+
* @keyboard Tab Does not leave the open menu.
|
|
54
78
|
* @public
|
|
55
79
|
*/
|
|
56
80
|
declare const Menu: MenuComponent;
|