@hirobius/design-system 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONSUMING.md +150 -0
- package/DESIGN.md +220 -0
- package/README.md +14 -2
- package/dist/chunks/{activity-feed-C8_e-Btq.js → activity-feed-DIMeUJpW.js} +4907 -2912
- package/dist/chunks/{form-DnGRy27o.js → form-BvNNnJ0t.js} +2 -2
- package/dist/form.js +5 -5
- package/dist/hirobius-ui.js +1986 -2529
- package/dist/icons.js +53 -0
- package/dist/manifest.js +15 -14
- package/dist/patterns.js +292 -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 +21 -4
- package/public/hds-manifest.json +1545 -89
- 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
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MetricTiles - the default row of headline numbers on a screen.
|
|
3
|
+
* @category Display
|
|
4
|
+
* @tier pattern
|
|
5
|
+
*/
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
/** Fixed feedback vocabulary for the value colour. */
|
|
8
|
+
export type MetricTileTone = 'neutral' | 'success' | 'warning' | 'danger' | 'info';
|
|
9
|
+
/** @public */
|
|
10
|
+
export interface MetricTileProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
11
|
+
/** Eyebrow label (for example "Open tasks"). */
|
|
12
|
+
label: React.ReactNode;
|
|
13
|
+
/** The headline number, set in the `heading2` type style. */
|
|
14
|
+
value: React.ReactNode;
|
|
15
|
+
/** Caption beneath the value. Its line is reserved even when this is absent. */
|
|
16
|
+
sub?: React.ReactNode;
|
|
17
|
+
/** Colours the value from the feedback vocabulary. Defaults to neutral. */
|
|
18
|
+
tone?: MetricTileTone;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* One metric tile: eyebrow label, `heading2` value, caption sub line, on a raised
|
|
22
|
+
* surface at one fixed min-height. Wraps `Card.Metric` (the sibling with the
|
|
23
|
+
* eyebrow / h2 / caption scale) and adds the surface and the fixed height, so a
|
|
24
|
+
* tile needs no enclosing `Card`.
|
|
25
|
+
*/
|
|
26
|
+
export declare const MetricTile: React.ForwardRefExoticComponent<MetricTileProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
/** @public */
|
|
28
|
+
export interface MetricTilesProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
29
|
+
/** `MetricTile` children. Fragments are looked through when counting tiles. */
|
|
30
|
+
children: React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A row of `MetricTile`s. The grid has `min(tiles, 4)` columns, so three tiles
|
|
34
|
+
* fill three columns and never leave an empty fourth. The default for any row of
|
|
35
|
+
* headline numbers on a screen; use `Stat` only for an inline number inside prose
|
|
36
|
+
* or a dense list, `Card.Metric` only inside an existing `Card`, and `StatusTile`
|
|
37
|
+
* for state with notes (never a number).
|
|
38
|
+
* @screenPattern
|
|
39
|
+
*/
|
|
40
|
+
export declare const MetricTiles: React.ForwardRefExoticComponent<MetricTilesProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PageHeader - the one header every screen opens with.
|
|
3
|
+
* @category Layout
|
|
4
|
+
* @tier pattern
|
|
5
|
+
*/
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
/** @public */
|
|
8
|
+
export type PageHeaderLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
9
|
+
/** @public */
|
|
10
|
+
export interface PageHeaderProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {
|
|
11
|
+
/** Trail above the title (a `Breadcrumb`). Omit on a top-level screen. */
|
|
12
|
+
breadcrumb?: React.ReactNode;
|
|
13
|
+
/** The screen title. Always set in the `heading2` type style; there is no size prop. */
|
|
14
|
+
title: React.ReactNode;
|
|
15
|
+
/** Status marker beside the title (a `Badge`). One marker, not a row of them. */
|
|
16
|
+
status?: React.ReactNode;
|
|
17
|
+
/** Screen-level actions, right-aligned; they wrap below the title on narrow widths. */
|
|
18
|
+
actions?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Heading element for the title. Changes only the DOM element, never the size:
|
|
21
|
+
* the size is fixed at `heading2` so every screen reads at the same scale.
|
|
22
|
+
* Defaults to 1; a screen has exactly one `PageHeader`.
|
|
23
|
+
*/
|
|
24
|
+
level?: PageHeaderLevel;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Screen header: breadcrumb slot, the title at the one canonical page-title size
|
|
28
|
+
* (`heading2`), a status slot and an actions slot. Every screen has exactly one.
|
|
29
|
+
* `display` and `h1` type are reserved for marketing and landing surfaces.
|
|
30
|
+
*
|
|
31
|
+
* Distinct from the docs-only page header in `src/docs-tooling`.
|
|
32
|
+
* @screenPattern
|
|
33
|
+
*/
|
|
34
|
+
export declare const PageHeader: React.ForwardRefExoticComponent<PageHeaderProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* Pagination - paged navigation control with truncation.
|
|
3
3
|
* @category Navigation
|
|
4
4
|
* @tier pattern
|
|
5
|
+
* @usage Move between pages of a long result set, with truncated page numbers.
|
|
6
|
+
* @whenNot A hierarchy trail, or a short list that fits on one page.
|
|
7
|
+
* @useInstead Breadcrumb a hierarchy trail
|
|
5
8
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=86-194
|
|
6
9
|
*/
|
|
7
10
|
import * as React from 'react';
|
|
@@ -28,8 +28,20 @@ declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.P
|
|
|
28
28
|
declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
29
|
declare const PopoverClose: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
30
30
|
/** @public */
|
|
31
|
-
export type PopoverContentProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content
|
|
32
|
-
|
|
31
|
+
export type PopoverContentProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {
|
|
32
|
+
/**
|
|
33
|
+
* Element to portal into. Defaults to the nearest `data-hds` scope, so the
|
|
34
|
+
* overlay inherits its theme; pass `null` to use `document.body`.
|
|
35
|
+
*/
|
|
36
|
+
container?: HTMLElement | null;
|
|
37
|
+
};
|
|
38
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & 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>>;
|
|
33
45
|
interface PopoverComponent extends React.FC<React.ComponentProps<typeof PopoverPrimitive.Root>> {
|
|
34
46
|
Trigger: typeof PopoverTrigger;
|
|
35
47
|
Anchor: typeof PopoverAnchor;
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Progress - linear progress bar (determinate or indeterminate).
|
|
3
3
|
* @category Feedback
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Show how far a task has got, as a bar that is determinate or indeterminate.
|
|
6
|
+
* @whenNot A wait of unknown length with no bar, or content that is still loading.
|
|
7
|
+
* @useInstead Spinner a wait of unknown length
|
|
8
|
+
* @useInstead Skeleton placeholder shapes for loading content
|
|
5
9
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=88-91
|
|
6
10
|
*/
|
|
7
11
|
import * as React from 'react';
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
* Radio — radio button with animated selection indicator.
|
|
3
3
|
* @category Inputs
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Choose exactly one option from a small set that should stay visible together.
|
|
6
|
+
* @whenNot Independent yes/no options, or a long list of options.
|
|
7
|
+
* @useInstead Checkbox independent options that can be ticked together
|
|
8
|
+
* @useInstead Select a long list that can collapse into a dropdown
|
|
9
|
+
* @useInstead SegmentedControl a compact switch between two to five views or modes
|
|
5
10
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=36-17
|
|
6
11
|
*/
|
|
7
12
|
import type { InputHTMLAttributes } from 'react';
|
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
* Select — dropdown selector built on Radix Select.
|
|
3
3
|
* @category Inputs
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Choose one value from a short list of options in a form field.
|
|
6
|
+
* @whenNot Firing actions, or choosing from a list long enough to need search.
|
|
7
|
+
* @useInstead Menu firing actions from a trigger
|
|
8
|
+
* @useInstead Combobox a long list that needs search
|
|
9
|
+
* @keyboard Enter/Space/ArrowDown Opens the listbox from the trigger with the selected option highlighted.
|
|
10
|
+
* @keyboard ArrowDown/ArrowUp Moves the highlight.
|
|
11
|
+
* @keyboard Home/End Jumps to the first or last option.
|
|
12
|
+
* @keyboard Character Highlights the option that matches the typed letters.
|
|
13
|
+
* @keyboard Enter Commits the highlighted option and returns focus to the trigger.
|
|
14
|
+
* @keyboard Escape Closes the listbox and returns focus to the trigger.
|
|
15
|
+
* @keyboard Tab Does not leave the open listbox.
|
|
5
16
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=82-49
|
|
6
17
|
*/
|
|
7
18
|
/**
|
|
@@ -25,5 +36,10 @@ export interface SelectProps {
|
|
|
25
36
|
value: string;
|
|
26
37
|
/** Called when the user picks a different option. */
|
|
27
38
|
onChange: (v: string) => void;
|
|
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;
|
|
28
44
|
}
|
|
29
45
|
export declare const Select: import("react").ForwardRefExoticComponent<SelectProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Skeleton - placeholder shimmer for content that is still loading.
|
|
3
3
|
* @category Feedback
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Reserve the shape of content that is still loading, so the layout does not jump.
|
|
6
|
+
* @whenNot A task with measurable progress, or a wait with no layout to reserve.
|
|
7
|
+
* @useInstead Progress a task with measurable progress
|
|
8
|
+
* @useInstead Spinner a short wait with no layout to reserve
|
|
5
9
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=88-95
|
|
6
10
|
*/
|
|
7
11
|
import * as React from 'react';
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* Slider — range slider with label and value display.
|
|
3
3
|
* @category Inputs
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Pick a number within a known range by dragging, when the exact value matters less than the position.
|
|
6
|
+
* @whenNot A precise number the person must type or read exactly.
|
|
7
|
+
* @useInstead Input a precise typed value (type="number")
|
|
5
8
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=82-265
|
|
6
9
|
*/
|
|
7
10
|
/** Slider — range slider with label and value display. */
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Spinner - indeterminate loading indicator.
|
|
3
3
|
* @category Feedback
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Show that something is loading when the wait is short or has no measurable end.
|
|
6
|
+
* @whenNot A task with measurable progress, or a region whose layout is known.
|
|
7
|
+
* @useInstead Progress a task with measurable progress
|
|
8
|
+
* @useInstead Skeleton a region whose layout is known
|
|
5
9
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=88-106
|
|
6
10
|
*/
|
|
7
11
|
import * as React from 'react';
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Stack — one-dimensional layout primitive.
|
|
3
3
|
* @category Layout
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Space a row or column of content with token gaps and simple flex alignment.
|
|
6
|
+
* @whenNot Multi-column layout, or giving content a background or padding.
|
|
7
|
+
* @useInstead Grid multi-column layout
|
|
8
|
+
* @useInstead Surface content that needs a background or padding
|
|
5
9
|
* @ai-intent Solves vertical and horizontal rhythm with tokenized flex gaps so agents can compose sequences of content without inventing ad hoc spacer divs or margin-based stacking.
|
|
6
10
|
* @ai-rules Use Stack for flow spacing and simple flex alignment only. Do NOT use Stack to create card chrome, internal surface padding, or page-width constraints. Do NOT apply arbitrary margins to Stack to fake spacing between children when the gap prop should own that rhythm. Do NOT use Stack for true two-dimensional layouts that require Grid.
|
|
7
11
|
*/
|
|
@@ -17,6 +17,10 @@ export interface StatProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'c
|
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Headline metric — large value, uppercase caption label, optional sub-line.
|
|
20
|
+
* @usage Show one standalone headline figure with its label and an optional sub-line.
|
|
21
|
+
* @whenNot A figure inside a Card, or a status with a trailing badge.
|
|
22
|
+
* @useInstead Card.Metric a figure inside a Card (hds#254 folds Stat into the Card slot)
|
|
23
|
+
* @useInstead StatusTile a titled status with notes and a trailing badge
|
|
20
24
|
*/
|
|
21
25
|
export declare const Stat: React.ForwardRefExoticComponent<StatProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
26
|
/** @internal — CVA variant helper; compose via Stat props instead. */
|
|
@@ -19,5 +19,9 @@ export interface StatusTileProps extends Omit<React.HTMLAttributes<HTMLDivElemen
|
|
|
19
19
|
* Status colour belongs in the trailing slot, never as a left rule on the tile
|
|
20
20
|
* — every tile should look the same so feedback signals stay reserved for
|
|
21
21
|
* genuinely interrupting states.
|
|
22
|
+
* @usage Show a titled status block with optional notes and a trailing badge or affordance.
|
|
23
|
+
* @whenNot A single headline figure, or a row inside a list.
|
|
24
|
+
* @useInstead Card.Metric a headline figure (hds#254 folds StatusTile into the Card slot)
|
|
25
|
+
* @useInstead StatusListItem a status row inside a list
|
|
22
26
|
*/
|
|
23
27
|
export declare const StatusTile: React.ForwardRefExoticComponent<StatusTileProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
* Table - structured data table primitive for documentation and compact UI matrices.
|
|
3
3
|
* @category Display
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Show rows of structured data in aligned columns, with optional sorting.
|
|
6
|
+
* @whenNot A single record, a short list of links, or content that reflows as cards.
|
|
7
|
+
* @useInstead Field one record as label and value pairs
|
|
8
|
+
* @useInstead Stack a short list of items
|
|
5
9
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=89-300
|
|
6
10
|
*/
|
|
7
11
|
import { type ReactNode } from 'react';
|
|
8
12
|
declare const tableHeaderCellVariants: (props?: ({
|
|
9
13
|
align?: "center" | "left" | "right" | null | undefined;
|
|
10
|
-
density?: "compact" | "comfortable" | null | undefined;
|
|
14
|
+
density?: "compact" | "comfortable" | "follow" | null | undefined;
|
|
11
15
|
sticky?: boolean | null | undefined;
|
|
12
16
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
13
17
|
declare const tableSortButtonVariants: (props?: ({
|
|
@@ -15,7 +19,7 @@ declare const tableSortButtonVariants: (props?: ({
|
|
|
15
19
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
16
20
|
declare const tableDataCellVariants: (props?: ({
|
|
17
21
|
align?: "center" | "left" | "right" | null | undefined;
|
|
18
|
-
density?: "compact" | "comfortable" | null | undefined;
|
|
22
|
+
density?: "compact" | "comfortable" | "follow" | null | undefined;
|
|
19
23
|
divider?: boolean | null | undefined;
|
|
20
24
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
21
25
|
/** @public */
|
|
@@ -34,7 +38,25 @@ export type TableColumn = {
|
|
|
34
38
|
/** Called when the sort button is activated (click, Enter, or Space). */
|
|
35
39
|
onSort?: () => void;
|
|
36
40
|
};
|
|
37
|
-
export type TableCellSlot =
|
|
41
|
+
export type TableCellSlot =
|
|
42
|
+
/** UI text: the row label. */
|
|
43
|
+
'label'
|
|
44
|
+
/** Renders in monospace: a literal value. */
|
|
45
|
+
| 'value'
|
|
46
|
+
/** Secondary-colour caption text explaining the row. */
|
|
47
|
+
| 'description'
|
|
48
|
+
/** Renders in monospace: a token name. */
|
|
49
|
+
| 'token'
|
|
50
|
+
/** Renders in monospace: a code snippet. */
|
|
51
|
+
| 'code'
|
|
52
|
+
/** UI text: arbitrary content you supply. */
|
|
53
|
+
| 'custom'
|
|
54
|
+
/** Caption-size text: an icon or glyph. */
|
|
55
|
+
| 'icon'
|
|
56
|
+
/** Caption-size text: a status badge. */
|
|
57
|
+
| 'badge'
|
|
58
|
+
/** UI text: a button or link. */
|
|
59
|
+
| 'action';
|
|
38
60
|
export type TableCell = {
|
|
39
61
|
slot: TableCellSlot;
|
|
40
62
|
content: ReactNode;
|
|
@@ -47,14 +69,24 @@ export type TableRow = {
|
|
|
47
69
|
cells: TableCell[];
|
|
48
70
|
};
|
|
49
71
|
type TableDensity = 'compact' | 'comfortable';
|
|
50
|
-
export declare function Table({ columns, rows, caption, captionAction, description, minWidth, density, flush, stickyHeader, }: {
|
|
72
|
+
export declare function Table({ columns, rows, caption, captionAction, description, labelledBy, minWidth, density, flush, stickyHeader, }: {
|
|
51
73
|
columns: TableColumn[];
|
|
52
74
|
rows: TableRow[];
|
|
53
75
|
caption?: ReactNode;
|
|
54
76
|
/** Optional action rendered to the right of the caption. */
|
|
55
77
|
captionAction?: ReactNode;
|
|
56
78
|
description?: ReactNode;
|
|
79
|
+
/**
|
|
80
|
+
* Id of an element that names the table when there is no `caption`. Applied to
|
|
81
|
+
* the `role="table"` element, and to the scroll region together with its own
|
|
82
|
+
* label so two tables on one screen keep distinct region names.
|
|
83
|
+
*/
|
|
84
|
+
labelledBy?: string;
|
|
57
85
|
minWidth?: number | string;
|
|
86
|
+
/**
|
|
87
|
+
* Row density. Omit it to follow the ancestor `data-density` dial (comfortable by
|
|
88
|
+
* default, compact inside `[data-density="compact"]`); pass a value to fix it.
|
|
89
|
+
*/
|
|
58
90
|
density?: TableDensity;
|
|
59
91
|
flush?: boolean;
|
|
60
92
|
stickyHeader?: boolean;
|
|
@@ -25,6 +25,10 @@ import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
|
25
25
|
* The tab set itself. Tagged here rather than in the file block because
|
|
26
26
|
* TabsList and TabsContent share this module and have no Figma node of their
|
|
27
27
|
* own — a file-level @figma would silently claim this node for all four.
|
|
28
|
+
* @usage Switch between panels of related content in the same place, one visible at a time.
|
|
29
|
+
* @whenNot A compact mode switch with no panels, or content that must all be visible.
|
|
30
|
+
* @useInstead SegmentedControl a compact switch with no panels
|
|
31
|
+
* @useInstead Disclosure optional content that expands in place
|
|
28
32
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=86-89
|
|
29
33
|
*/
|
|
30
34
|
export declare const Tabs: import("react").ForwardRefExoticComponent<TabsPrimitive.TabsProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* Tag — interactive filter and category chip.
|
|
3
3
|
* @category Inputs
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Show an interactive filter or category chip that people can toggle.
|
|
6
|
+
* @whenNot A read-only status or count label.
|
|
7
|
+
* @useInstead Badge a read-only status or count
|
|
5
8
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=32-11
|
|
6
9
|
*
|
|
7
10
|
* The outer <button> carries the accessible 44px hit target directly via the
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @category Typography
|
|
5
5
|
* @tier primitive
|
|
6
|
+
* @usage Set any text on the type ramp, with the element chosen by `as`.
|
|
7
|
+
* @whenNot Navigation links, or a keyboard hint.
|
|
8
|
+
* @useInstead InlineLink a link inside body copy
|
|
9
|
+
* @useInstead Kbd a keyboard key hint
|
|
6
10
|
* @doc-exempt: typography primitive is documented through the Typography ramp page (TypographyPage), not as a standalone component card
|
|
7
11
|
*/
|
|
8
12
|
import { type CSSProperties, type ElementType, type HTMLAttributes, type ReactNode } from 'react';
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* Textarea — multi-line text field primitive with label, helper, and error slots.
|
|
3
3
|
* @category Inputs
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Collect multi-line free text such as a message, note or description.
|
|
6
|
+
* @whenNot A single line of text, or choosing from a list.
|
|
7
|
+
* @useInstead Input a single line of text
|
|
5
8
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=85-14
|
|
6
9
|
*
|
|
7
10
|
* Mirrors Input's shell + token skin as a native `<textarea>`. Figma parity:
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Toast — transient feedback notifications (Radix Toast).
|
|
3
3
|
* @category Feedback
|
|
4
4
|
* @tier pattern
|
|
5
|
+
* @usage Confirm an action with a brief message that appears and dismisses itself, through useToast.
|
|
6
|
+
* @whenNot A message people must act on or that must stay next to its content.
|
|
7
|
+
* @useInstead Alert a message that stays next to its content
|
|
8
|
+
* @useInstead Dialog a message that needs a decision
|
|
5
9
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=93-367
|
|
6
10
|
* @doc-exempt: no Overlays/Feedback-overlay doc page yet — add demo when created
|
|
7
11
|
*
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Toggle — boolean on/off toggle with animated thumb.
|
|
3
3
|
* @category Inputs
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Switch one setting on or off, with the effect applying immediately.
|
|
6
|
+
* @whenNot A choice that only takes effect after submitting a form, or picking from several options.
|
|
7
|
+
* @useInstead Checkbox a form option confirmed on submit
|
|
8
|
+
* @useInstead Radio one choice from a set
|
|
5
9
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=37-19
|
|
6
10
|
*/
|
|
7
11
|
import type { InputHTMLAttributes } from 'react';
|
|
@@ -29,5 +29,5 @@ interface TooltipProps {
|
|
|
29
29
|
/** Cursor Y position in client coordinates. */
|
|
30
30
|
y?: number;
|
|
31
31
|
}
|
|
32
|
-
export declare function ExpandTooltip({ visible, mode, label, x, y }: TooltipProps): import("react/jsx-runtime").JSX.Element
|
|
32
|
+
export declare function ExpandTooltip({ visible, mode, label, x, y }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
33
33
|
export {};
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* VisuallyHidden — content available to assistive tech but hidden visually.
|
|
3
3
|
* @category Utility
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Give assistive technology a label or description that sighted people do not need to see.
|
|
6
|
+
* @whenNot Text everyone should read, or hiding an element from assistive technology too.
|
|
7
|
+
* @useInstead Text text that everyone should read
|
|
5
8
|
*/
|
|
6
9
|
import * as React from 'react';
|
|
7
10
|
/** @public */
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Portal container resolver for HDS overlay parts (hds#335). Internal — not
|
|
3
|
+
* exported from the package entry points.
|
|
4
|
+
*
|
|
5
|
+
* Radix `Portal` appends to `document.body`, which sits outside a
|
|
6
|
+
* `<div data-hds data-theme="dark">` scope, so overlays would render with light
|
|
7
|
+
* tokens on a dark page. Every portalled part goes through `HdsPortal` (or the
|
|
8
|
+
* `withHdsPortal` factory) so its container resolves, in order, to:
|
|
9
|
+
*
|
|
10
|
+
* 1. the caller's explicit `container` (`null` means `document.body`);
|
|
11
|
+
* 2. the element of the nearest `HdsThemeProvider`;
|
|
12
|
+
* 3. the nearest `[data-hds]` ancestor of a hidden in-place anchor, resolved
|
|
13
|
+
* in a layout effect (covers a bare `<div data-hds>` with no provider);
|
|
14
|
+
* 4. `undefined`, which the portal treats as `document.body`.
|
|
15
|
+
*
|
|
16
|
+
* Nothing is portalled until the container is known, so an overlay never
|
|
17
|
+
* flashes into `body` first and never remounts (which would break the focus trap).
|
|
18
|
+
* The hidden anchor (`<span hidden data-hds-portal-anchor>`) stays in place, also
|
|
19
|
+
* while the overlay is closed, until a provider or explicit container makes it
|
|
20
|
+
* unnecessary. It renders on the server too so the first client render hydrates
|
|
21
|
+
* cleanly. It takes no space, but is one extra child for `:last-child` / `> *`
|
|
22
|
+
* selectors and is not valid directly inside `ul`, `table` or `tr`.
|
|
23
|
+
* A scope on `<html>` or `<body>` resolves to `undefined`: `body` already
|
|
24
|
+
* inherits it, and a node appended to `<html>` would sit outside `<body>`.
|
|
25
|
+
*/
|
|
26
|
+
import * as React from 'react';
|
|
27
|
+
type PortalContainer = Element | DocumentFragment | null;
|
|
28
|
+
interface ResolvedPortal {
|
|
29
|
+
/** False until the container is known; render no portal while false. */
|
|
30
|
+
ready: boolean;
|
|
31
|
+
/** Element to portal into, or `undefined` for `document.body`. */
|
|
32
|
+
container: HTMLElement | undefined;
|
|
33
|
+
/** Hidden in-place node the layout effect measures from; render it beside the portal. */
|
|
34
|
+
anchor: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
/** Resolve where a portalled part should mount. @internal */
|
|
37
|
+
export declare function useHdsPortalContainer(explicit?: HTMLElement | null): ResolvedPortal;
|
|
38
|
+
/**
|
|
39
|
+
* Wrap a Radix `*.Portal` so it mounts into the resolved scope. The wrapped
|
|
40
|
+
* component keeps the original props, including `container` (explicit wins) and
|
|
41
|
+
* `forceMount`.
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
export declare function withHdsPortal<P extends {
|
|
45
|
+
container?: PortalContainer;
|
|
46
|
+
}>(Portal: React.ComponentType<P>): React.FC<P>;
|
|
47
|
+
/** Plain `createPortal` with the same container contract, for non-Radix overlays. */
|
|
48
|
+
export declare const hdsDomPortal: React.FC<{
|
|
49
|
+
container?: PortalContainer;
|
|
50
|
+
children?: React.ReactNode;
|
|
51
|
+
}>;
|
|
52
|
+
export {};
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* HdsThemeProvider — framework-agnostic theming contract for HDS.
|
|
3
3
|
* @category Theming
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @usage Wrap an app or region once to set theme, density and other root attributes for everything inside it.
|
|
6
|
+
* @whenNot Styling a single component, or per-component overrides.
|
|
7
|
+
* @useInstead Surface a single region with its own background
|
|
5
8
|
* @doc-exempt: API/contract primitive, documented in README (no doc page yet)
|
|
6
9
|
*
|
|
7
10
|
* HDS theming is driven entirely by root attributes + CSS custom properties, so
|
|
@@ -46,6 +49,13 @@ export interface HdsThemeValue {
|
|
|
46
49
|
/** Monospace font-family override (`--hds-font-family-mono`). */
|
|
47
50
|
fontFamilyMono?: string;
|
|
48
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* The nearest HdsThemeProvider's `data-hds` wrapper element, for overlay parts
|
|
54
|
+
* to portal into (hds#335). `null` until the wrapper mounts, and outside any
|
|
55
|
+
* provider.
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
export declare function useHdsScope(): HTMLElement | null;
|
|
49
59
|
/**
|
|
50
60
|
* Read the nearest HdsThemeProvider's active dial values. Returns an empty
|
|
51
61
|
* object when no provider is present (styles still work off the defaults).
|
|
@@ -24,9 +24,25 @@ export type ManifestPropSpec = {
|
|
|
24
24
|
default?: string | number | boolean;
|
|
25
25
|
optional?: boolean;
|
|
26
26
|
};
|
|
27
|
+
/** Contract parsed from the @usage / @whenNot / @useInstead JSDoc tags (hds#339). */
|
|
28
|
+
export type ManifestUsage = {
|
|
29
|
+
when?: string;
|
|
30
|
+
whenNot?: string;
|
|
31
|
+
useInstead?: Array<{
|
|
32
|
+
component: string;
|
|
33
|
+
reason?: string;
|
|
34
|
+
}>;
|
|
35
|
+
};
|
|
36
|
+
/** One @keyboard JSDoc line: the keys and what they do. */
|
|
37
|
+
export type ManifestKeyboardEntry = {
|
|
38
|
+
keys: string;
|
|
39
|
+
effect: string;
|
|
40
|
+
};
|
|
27
41
|
/** A named slot declared on a component spec. */
|
|
28
42
|
export type ManifestSlot = {
|
|
29
43
|
name?: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
source?: 'jsdoc';
|
|
30
46
|
figmaSlotName?: string;
|
|
31
47
|
tokenBinding?: Record<string, string>;
|
|
32
48
|
};
|
|
@@ -74,6 +90,9 @@ export type ManifestComponentSpec = {
|
|
|
74
90
|
propConstraints?: Record<string, ManifestPropSpec | Record<string, unknown>>;
|
|
75
91
|
requiredProps?: string[];
|
|
76
92
|
slots?: ManifestSlot[];
|
|
93
|
+
usage?: ManifestUsage;
|
|
94
|
+
keyboard?: ManifestKeyboardEntry[];
|
|
95
|
+
aiRules?: string;
|
|
77
96
|
};
|
|
78
97
|
/**
|
|
79
98
|
* Alias of ManifestComponentSpec for hds-search.ts back-compat.
|
|
@@ -109,8 +128,16 @@ export type ManifestApiComponent = {
|
|
|
109
128
|
hidden?: boolean;
|
|
110
129
|
figmaUrl?: string | null;
|
|
111
130
|
description?: string;
|
|
131
|
+
usage?: ManifestUsage;
|
|
132
|
+
keyboard?: ManifestKeyboardEntry[];
|
|
133
|
+
aiRules?: string;
|
|
112
134
|
/** Documentation prop rows — array, not a Record. */
|
|
113
135
|
props?: ManifestApiPropRow[];
|
|
136
|
+
/** Table only: what each `TableCellSlot` value renders. */
|
|
137
|
+
cellSlots?: Array<{
|
|
138
|
+
name: string;
|
|
139
|
+
description: string;
|
|
140
|
+
}>;
|
|
114
141
|
guides?: Array<{
|
|
115
142
|
label: string;
|
|
116
143
|
text: string;
|
|
@@ -259,6 +259,7 @@ export declare const tokenRefs: {
|
|
|
259
259
|
readonly page: "var(--semantic-color-surface-page)";
|
|
260
260
|
readonly raised: "var(--semantic-color-surface-raised)";
|
|
261
261
|
readonly overlay: "var(--semantic-color-surface-overlay)";
|
|
262
|
+
readonly scrim: "var(--semantic-color-surface-scrim)";
|
|
262
263
|
readonly inverse: "var(--semantic-color-surface-inverse)";
|
|
263
264
|
readonly accent: "var(--semantic-color-surface-accent)";
|
|
264
265
|
readonly accentSubtle: "var(--semantic-color-surface-accentSubtle)";
|
|
@@ -639,6 +640,7 @@ export declare const tokenRefs: {
|
|
|
639
640
|
readonly card: "var(--role-card)";
|
|
640
641
|
readonly "card-foreground": "var(--role-card-foreground)";
|
|
641
642
|
readonly popover: "var(--role-popover)";
|
|
643
|
+
readonly scrim: "var(--role-scrim)";
|
|
642
644
|
readonly "popover-foreground": "var(--role-popover-foreground)";
|
|
643
645
|
readonly primary: "var(--role-primary)";
|
|
644
646
|
readonly "primary-foreground": "var(--role-primary-foreground)";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hirobius/design-system/icons
|
|
3
|
+
*
|
|
4
|
+
* A curated subset of Lucide (canonical 0.487.0 names) so a consumer can get
|
|
5
|
+
* an `icon` for IconButton / Icon with nothing extra to install. Bare
|
|
6
|
+
* re-export from 'lucide-react' (external in the lib build, so it tree-shakes).
|
|
7
|
+
* Legacy aliases (MoreHorizontal, MoreVertical, AlertTriangle, Home, Filter)
|
|
8
|
+
* are intentionally not exported; use Ellipsis, EllipsisVertical,
|
|
9
|
+
* TriangleAlert, House, Funnel. Add new icons one line each (hds#342).
|
|
10
|
+
* The manifest `iconSet` list is generated from this file.
|
|
11
|
+
*/
|
|
12
|
+
export { Ellipsis, EllipsisVertical, Plus, Minus, Pencil, Trash2, Archive, Copy, Download, Upload, Search, X, Check, ChevronDown, ChevronUp, ChevronLeft, ChevronRight, ArrowLeft, ArrowRight, ArrowUp, ArrowDown, ExternalLink, Settings, Info, TriangleAlert, CircleAlert, CircleCheck, CircleHelp, Eye, EyeOff, Funnel, Calendar, Mail, User, House, Menu, Bell, Star, Heart, Link, Lock, Share, Save, RefreshCw, LogOut, LogIn, Bookmark, Clock, FileText, Image, } from 'lucide-react';
|
|
13
|
+
export type { LucideIcon } from 'lucide-react';
|
|
@@ -1123,6 +1123,18 @@ export declare const tokens: {
|
|
|
1123
1123
|
};
|
|
1124
1124
|
};
|
|
1125
1125
|
};
|
|
1126
|
+
scrim: {
|
|
1127
|
+
$value: string;
|
|
1128
|
+
$description: string;
|
|
1129
|
+
$extensions: {
|
|
1130
|
+
"com.figma.variables": {
|
|
1131
|
+
modes: {
|
|
1132
|
+
Light: string;
|
|
1133
|
+
Dark: string;
|
|
1134
|
+
};
|
|
1135
|
+
};
|
|
1136
|
+
};
|
|
1137
|
+
};
|
|
1126
1138
|
inverse: {
|
|
1127
1139
|
$value: string;
|
|
1128
1140
|
$description: string;
|
|
@@ -2590,6 +2602,11 @@ export declare const tokens: {
|
|
|
2590
2602
|
$value: string;
|
|
2591
2603
|
$description: string;
|
|
2592
2604
|
};
|
|
2605
|
+
scrim: {
|
|
2606
|
+
$type: string;
|
|
2607
|
+
$value: string;
|
|
2608
|
+
$description: string;
|
|
2609
|
+
};
|
|
2593
2610
|
"popover-foreground": {
|
|
2594
2611
|
$type: string;
|
|
2595
2612
|
$value: string;
|
|
@@ -2695,7 +2712,9 @@ export declare const Carousel: import("react").ForwardRefExoticComponent<import(
|
|
|
2695
2712
|
/** @deprecated Import from `@hirobius/design-system/patterns` instead — the root re-export is kept for one minor (hds#254) and removed at the next major once ops has a codemod. */
|
|
2696
2713
|
export declare const CodeBlock: typeof _CodeBlock254;
|
|
2697
2714
|
/** @deprecated Import from `@hirobius/design-system/patterns` instead — the root re-export is kept for one minor (hds#254) and removed at the next major once ops has a codemod. */
|
|
2698
|
-
export declare const CommandPalette: import("react").ForwardRefExoticComponent<import("./app/components/command-palette.js").CommandPaletteProps & import("react").RefAttributes<HTMLInputElement
|
|
2715
|
+
export declare const CommandPalette: import("react").ForwardRefExoticComponent<import("./app/components/command-palette.js").CommandPaletteProps & import("react").RefAttributes<HTMLInputElement>> & {
|
|
2716
|
+
displayName: string;
|
|
2717
|
+
};
|
|
2699
2718
|
/** @deprecated Import from `@hirobius/design-system/patterns` instead — the root re-export is kept for one minor (hds#254) and removed at the next major once ops has a codemod. */
|
|
2700
2719
|
export declare const DocLinkCard: typeof _DocLinkCard254;
|
|
2701
2720
|
/** @deprecated Import from `@hirobius/design-system/patterns` instead — the root re-export is kept for one minor (hds#254) and removed at the next major once ops has a codemod. */
|
|
@@ -35,3 +35,8 @@ export * from './app/components/toolbar.js';
|
|
|
35
35
|
export * from './app/components/command-palette.js';
|
|
36
36
|
export * from './app/components/image-lightbox.js';
|
|
37
37
|
export * from './app/components/reveal.js';
|
|
38
|
+
export * from './app/components/page-header.js';
|
|
39
|
+
export * from './app/components/metric-tiles.js';
|
|
40
|
+
export * from './app/components/form-actions.js';
|
|
41
|
+
export * from './app/components/destructive-section.js';
|
|
42
|
+
export * from './app/components/data-table-section.js';
|