@hirobius/design-system 0.10.0 → 0.12.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/README.md +44 -1
- package/dist/brand.js +36 -0
- package/dist/contexts.js +63 -59
- package/dist/hirobius-ui.js +22641 -3700
- package/dist/manifest.js +9 -9
- package/dist/scroll.js +42 -0
- package/dist/styles.css +1 -1
- package/dist/tokens.css +1 -1
- package/dist/tokens.js +26 -5
- package/dist/types/src/app/components/activity-feed.d.ts +24 -2
- package/dist/types/src/app/components/alert-dialog.d.ts +56 -0
- package/dist/types/src/app/components/app-shell.d.ts +38 -0
- package/dist/types/src/app/components/aspect-ratio.d.ts +25 -0
- package/dist/types/src/app/components/avatar-group.d.ts +22 -0
- package/dist/types/src/app/components/bleed.d.ts +39 -0
- package/dist/types/src/app/components/blockquote.d.ts +20 -0
- package/dist/types/src/app/components/box-sx.d.ts +69 -0
- package/dist/types/src/app/components/box.d.ts +42 -0
- package/dist/types/src/app/components/breadcrumb.d.ts +5 -0
- package/dist/types/src/app/components/button-group.d.ts +18 -0
- package/dist/types/src/app/components/calendar.d.ts +20 -0
- package/dist/types/src/app/components/card.d.ts +29 -13
- package/dist/types/src/app/components/carousel.d.ts +24 -0
- package/dist/types/src/app/components/center.d.ts +36 -0
- package/dist/types/src/app/components/circular-progress.d.ts +28 -0
- package/dist/types/src/app/components/cluster.d.ts +39 -0
- package/dist/types/src/app/components/code-block.d.ts +19 -1
- package/dist/types/src/app/components/command-palette.d.ts +44 -0
- package/dist/types/src/app/components/container.d.ts +10 -0
- package/dist/types/src/app/components/context-menu.d.ts +55 -0
- package/dist/types/src/app/components/cover.d.ts +43 -0
- package/dist/types/src/app/components/date-input.d.ts +31 -0
- package/dist/types/src/app/components/date-range-input.d.ts +34 -0
- package/dist/types/src/app/components/date-time-input.d.ts +30 -0
- package/dist/types/src/app/components/disclosure.d.ts +5 -1
- package/dist/types/src/app/components/divider.d.ts +14 -10
- package/dist/types/src/app/components/doc-link-card.d.ts +5 -1
- package/dist/types/src/app/components/field.d.ts +9 -11
- package/dist/types/src/app/components/file-input.d.ts +28 -0
- package/dist/types/src/app/components/frame.d.ts +38 -0
- package/dist/types/src/app/components/hds-tooltip.d.ts +45 -0
- package/dist/types/src/app/components/heading-stack.d.ts +15 -5
- package/dist/types/src/app/components/hover-card.d.ts +31 -0
- package/dist/types/src/app/components/image-lightbox.d.ts +13 -0
- package/dist/types/src/app/components/inline-code.d.ts +14 -3
- package/dist/types/src/app/components/input-group.d.ts +23 -0
- package/dist/types/src/app/components/kbd.d.ts +18 -0
- package/dist/types/src/app/components/metadata-list.d.ts +43 -0
- package/dist/types/src/app/components/multi-selector.d.ts +40 -0
- package/dist/types/src/app/components/nav-group.d.ts +7 -2
- package/dist/types/src/app/components/nav-item.d.ts +12 -2
- package/dist/types/src/app/components/overflow-list.d.ts +19 -0
- package/dist/types/src/app/components/pin.d.ts +30 -0
- package/dist/types/src/app/components/reveal.d.ts +31 -0
- package/dist/types/src/app/components/segmented-control.d.ts +37 -3
- package/dist/types/src/app/components/selectable-card.d.ts +29 -0
- package/dist/types/src/app/components/side-nav.d.ts +21 -0
- package/dist/types/src/app/components/sidebar.d.ts +45 -0
- package/dist/types/src/app/components/stat.d.ts +8 -10
- package/dist/types/src/app/components/status-dot.d.ts +25 -0
- package/dist/types/src/app/components/status-list-item.d.ts +10 -11
- package/dist/types/src/app/components/stepper.d.ts +31 -0
- package/dist/types/src/app/components/switcher.d.ts +41 -0
- package/dist/types/src/app/components/table.d.ts +12 -1
- package/dist/types/src/app/components/tag.d.ts +19 -18
- package/dist/types/src/app/components/text.d.ts +8 -2
- package/dist/types/src/app/components/textarea.d.ts +38 -0
- package/dist/types/src/app/components/time-input.d.ts +24 -0
- package/dist/types/src/app/components/timestamp.d.ts +24 -0
- package/dist/types/src/app/components/toast.d.ts +8 -2
- package/dist/types/src/app/components/toggle-button.d.ts +32 -0
- package/dist/types/src/app/components/token.d.ts +26 -1
- package/dist/types/src/app/components/tokenizer.d.ts +24 -0
- package/dist/types/src/app/components/toolbar.d.ts +36 -0
- package/dist/types/src/app/components/top-nav.d.ts +21 -0
- package/dist/types/src/app/components/tree-list.d.ts +28 -0
- package/dist/types/src/app/components/visually-hidden.d.ts +17 -0
- package/dist/types/src/app/context/TenantContext.d.ts +1 -1
- package/dist/types/src/app/context/hds-theme.d.ts +68 -0
- package/dist/types/src/app/data/nav-model.d.ts +39 -0
- package/dist/types/src/app/design-system/generated-token-refs.d.ts +20 -0
- package/dist/types/src/app/design-system/generated-token-values.d.ts +14 -1
- package/dist/types/src/app/{pages/hds → layouts}/HdsSystemDocLayout.d.ts +1 -1
- package/dist/types/src/app/lib/hds-search.d.ts +45 -0
- package/dist/types/src/brand/index.d.ts +9 -0
- package/dist/types/src/brand/overlay.d.ts +71 -0
- package/dist/types/src/index.d.ts +109 -2
- package/dist/types/src/scroll/index.d.ts +16 -0
- package/dist/types/src/scroll/smooth-scroll.d.ts +48 -0
- package/dist/types/src/scroll/use-scroll-progress.d.ts +34 -0
- package/dist/variables.css +22 -5
- package/hirobius.tokens.json +70 -10
- package/package.json +41 -68
- package/public/hds-manifest.json +6057 -4732
- package/dist/types/src/app/components/info-page.d.ts +0 -10
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface LightboxProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
src: string;
|
|
5
|
+
alt?: string;
|
|
6
|
+
naturalWidth?: number;
|
|
7
|
+
naturalHeight?: number;
|
|
8
|
+
caption?: string;
|
|
9
|
+
captionHref?: string;
|
|
10
|
+
captionLabel?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function Lightbox({ open, onClose, src, alt, naturalWidth, naturalHeight, caption, captionHref, captionLabel, }: LightboxProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const inlineCodeVariants: (props?: {
|
|
4
|
+
density?: "compact" | "comfortable";
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
6
|
+
type InlineCodeVariantProps = VariantProps<typeof inlineCodeVariants>;
|
|
2
7
|
type InlineCodeProps = {
|
|
3
8
|
children: ReactNode;
|
|
4
9
|
style?: CSSProperties;
|
|
5
|
-
/**
|
|
10
|
+
/** Layout density. `compact` tightens vertical rhythm for dense body copy and table prose. Defaults to `comfortable`. */
|
|
11
|
+
density?: InlineCodeVariantProps['density'];
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `density="compact"` instead. Kept for backward
|
|
14
|
+
* compatibility; when set, it takes precedence over `density`.
|
|
15
|
+
*/
|
|
6
16
|
compact?: boolean;
|
|
7
17
|
/** Show a copy-to-clipboard button. children must be a string when true. */
|
|
8
18
|
copyable?: boolean;
|
|
9
19
|
};
|
|
10
20
|
/** @public */
|
|
11
|
-
export declare function InlineCode({ children, style, compact, copyable }: InlineCodeProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
|
|
21
|
+
export declare function InlineCode({ children, style, density, compact, copyable, }: InlineCodeProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
/** @internal — CVA variant helper; compose via InlineCode props instead. */
|
|
23
|
+
export { inlineCodeVariants };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InputGroup — a text input framed with leading and/or trailing adornments.
|
|
3
|
+
* @category Inputs
|
|
4
|
+
* @tier primitive
|
|
5
|
+
*/
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
8
|
+
declare const inputGroupVariants: (props?: {
|
|
9
|
+
size?: "sm" | "md" | "lg";
|
|
10
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
11
|
+
type InputGroupVariantProps = VariantProps<typeof inputGroupVariants>;
|
|
12
|
+
/** @public */
|
|
13
|
+
export interface InputGroupProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>, InputGroupVariantProps {
|
|
14
|
+
/** Content rendered before the input, e.g. an icon or a static prefix. */
|
|
15
|
+
leading?: React.ReactNode;
|
|
16
|
+
/** Content rendered after the input, e.g. a unit or a clear button. */
|
|
17
|
+
trailing?: React.ReactNode;
|
|
18
|
+
/** Class applied to the wrapper (the input itself stays transparent). */
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
/** A single-line input with optional `leading`/`trailing` adornments. */
|
|
22
|
+
export declare const InputGroup: React.ForwardRefExoticComponent<InputGroupProps & React.RefAttributes<HTMLInputElement>>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kbd — inline keyboard key / shortcut hint rendered as a native <kbd>.
|
|
3
|
+
* @category Display
|
|
4
|
+
* @tier primitive
|
|
5
|
+
*/
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
8
|
+
declare const kbdVariants: (props?: {
|
|
9
|
+
size?: "sm" | "md" | "lg";
|
|
10
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
11
|
+
type KbdVariantProps = VariantProps<typeof kbdVariants>;
|
|
12
|
+
/** @public */
|
|
13
|
+
export interface KbdProps extends React.HTMLAttributes<HTMLElement>, KbdVariantProps {
|
|
14
|
+
}
|
|
15
|
+
/** Renders a keyboard key or shortcut token, e.g. `<Kbd>⌘K</Kbd>`. */
|
|
16
|
+
export declare const Kbd: React.ForwardRefExoticComponent<KbdProps & React.RefAttributes<HTMLElement>>;
|
|
17
|
+
/** @internal — CVA variant helper; compose via Kbd props instead. */
|
|
18
|
+
export { kbdVariants };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MetadataList — semantic term/description list for object metadata (Status,
|
|
3
|
+
* Owner, Updated…). The idiomatic replacement for badge-stickers-on-prose.
|
|
4
|
+
* @category Display
|
|
5
|
+
* @tier pattern
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
10
|
+
declare const metadataListVariants: (props?: {
|
|
11
|
+
orientation?: "horizontal" | "vertical";
|
|
12
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
13
|
+
type MetadataListVariantProps = VariantProps<typeof metadataListVariants>;
|
|
14
|
+
/** A single term/description pair rendered by MetadataList. */
|
|
15
|
+
export interface MetadataListItem {
|
|
16
|
+
/** The metadata key, e.g. "Status". */
|
|
17
|
+
term: React.ReactNode;
|
|
18
|
+
/** The metadata value, e.g. "Active". `description` may be rich content
|
|
19
|
+
* (chips, prose, multiple lines) — useful with the `divided` variant. */
|
|
20
|
+
description: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
/** @public */
|
|
23
|
+
export interface MetadataListProps extends Omit<React.HTMLAttributes<HTMLDListElement>, 'children'>, MetadataListVariantProps {
|
|
24
|
+
/** The term/description pairs to render. */
|
|
25
|
+
items: MetadataListItem[];
|
|
26
|
+
/**
|
|
27
|
+
* Visual treatment.
|
|
28
|
+
* - `'plain'` (default) — bare term/description pairs; honours `orientation`.
|
|
29
|
+
* - `'divided'` — one bordered, rounded container with a full-width rule
|
|
30
|
+
* between each pair (term above its rich description). Ignores `orientation`
|
|
31
|
+
* (always term-above-description). Use for spec sheets / namespace tables.
|
|
32
|
+
*/
|
|
33
|
+
variant?: 'plain' | 'divided';
|
|
34
|
+
/**
|
|
35
|
+
* Optional summary band rendered as the final row on a subtle surface —
|
|
36
|
+
* e.g. a footnote or aggregate note. Only rendered by the `divided` variant.
|
|
37
|
+
*/
|
|
38
|
+
footer?: React.ReactNode;
|
|
39
|
+
}
|
|
40
|
+
/** Renders object metadata as a semantic `<dl>` of term/description pairs. */
|
|
41
|
+
export declare const MetadataList: React.ForwardRefExoticComponent<MetadataListProps & React.RefAttributes<HTMLDListElement>>;
|
|
42
|
+
/** @internal — CVA variant helper; compose via MetadataList props instead. */
|
|
43
|
+
export { metadataListVariants };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MultiSelector — multi-select dropdown composing the existing Popover with
|
|
3
|
+
* a checkbox option list, so choosing several values from a fixed set reads
|
|
4
|
+
* as one overlay pattern with Combobox and Menu rather than a bespoke widget.
|
|
5
|
+
* @category Inputs
|
|
6
|
+
* @tier pattern
|
|
7
|
+
* @public
|
|
8
|
+
*
|
|
9
|
+
* No new dependency — built entirely on the HDS Popover. The trigger reads
|
|
10
|
+
* like a secondary Button, showing a placeholder or a `${n} selected` count;
|
|
11
|
+
* the content is a token-skinned list where each row is a checkbox toggling
|
|
12
|
+
* membership in `value`.
|
|
13
|
+
*
|
|
14
|
+
* <MultiSelector
|
|
15
|
+
* options={[{ value: 'a', label: 'Apple' }, { value: 'b', label: 'Banana' }]}
|
|
16
|
+
* value={fruits}
|
|
17
|
+
* onChange={setFruits}
|
|
18
|
+
* />
|
|
19
|
+
*/
|
|
20
|
+
import * as React from 'react';
|
|
21
|
+
/** @public */
|
|
22
|
+
export interface MultiSelectorOption {
|
|
23
|
+
value: string;
|
|
24
|
+
label: string;
|
|
25
|
+
}
|
|
26
|
+
/** @public */
|
|
27
|
+
export interface MultiSelectorProps {
|
|
28
|
+
/** Selectable options. */
|
|
29
|
+
options: MultiSelectorOption[];
|
|
30
|
+
/** Currently selected values. */
|
|
31
|
+
value: string[];
|
|
32
|
+
/** Fired with the next selected-values array whenever an option is toggled. */
|
|
33
|
+
onChange: (next: string[]) => void;
|
|
34
|
+
/** Trigger text when nothing is selected. */
|
|
35
|
+
placeholder?: string;
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
className?: string;
|
|
38
|
+
}
|
|
39
|
+
/** @public */
|
|
40
|
+
export declare const MultiSelector: React.ForwardRefExoticComponent<MultiSelectorProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -6,9 +6,13 @@ type NavItem = {
|
|
|
6
6
|
label: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
};
|
|
9
|
+
type NavGroupVariant = 'side' | 'toc';
|
|
10
|
+
declare const navGroupLabelVariants: (props?: {
|
|
11
|
+
variant?: "side" | "toc";
|
|
12
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
9
13
|
type NavGroupProps = {
|
|
10
14
|
label?: string;
|
|
11
|
-
variant?:
|
|
15
|
+
variant?: NavGroupVariant;
|
|
12
16
|
level?: NavLevel;
|
|
13
17
|
items?: NavItem[];
|
|
14
18
|
children?: ReactNode;
|
|
@@ -21,4 +25,5 @@ type NavGroupProps = {
|
|
|
21
25
|
};
|
|
22
26
|
/** @public */
|
|
23
27
|
export declare function NavGroup({ label, variant, level, items, children, collapsible, onNavigate, getExact, className, style, contentStyle, }: NavGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
|
|
28
|
+
/** @internal — CVA variant helper; compose via NavGroup props instead. */
|
|
29
|
+
export { navGroupLabelVariants };
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import type { AnchorHTMLAttributes, MouseEvent } from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
3
|
import { type NavLevel } from '../lib/navLevels';
|
|
3
|
-
|
|
4
|
+
declare const navItemVariants: (props?: {
|
|
5
|
+
variant?: "side" | "toc";
|
|
6
|
+
state?: "default" | "active" | "disabled" | "focus" | "hover";
|
|
7
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
8
|
+
declare const navIndicatorVariants: (props?: {
|
|
9
|
+
state?: "default" | "active" | "disabled" | "focus" | "hover";
|
|
10
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
11
|
+
type NavItemVariantProps = VariantProps<typeof navItemVariants>;
|
|
12
|
+
type NavVariant = NonNullable<NavItemVariantProps['variant']>;
|
|
4
13
|
type NavNativeProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'children' | 'onClick'>;
|
|
5
14
|
interface NavProps extends NavNativeProps {
|
|
6
15
|
/** Visual layout variant for side nav or table of contents usage. */
|
|
@@ -18,4 +27,5 @@ interface NavProps extends NavNativeProps {
|
|
|
18
27
|
}
|
|
19
28
|
/** @public */
|
|
20
29
|
export declare function NavItem({ variant, label, href, active, disabled, level, onNavigate, className, style, onFocus, onMouseEnter, onMouseLeave, onPointerDown, onPointerUp, onPointerCancel, onBlur, ...rest }: NavProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
|
|
30
|
+
/** @internal — CVA variant helpers; compose via NavItem props instead. */
|
|
31
|
+
export { navItemVariants, navIndicatorVariants };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OverflowList — a horizontal list that caps visible children by count and
|
|
3
|
+
* collapses the remainder into a trailing +N chip. Count-based (via `max`),
|
|
4
|
+
* not width-measured, so layout is deterministic and safe under SSR and jsdom.
|
|
5
|
+
* @category Layout
|
|
6
|
+
* @tier pattern
|
|
7
|
+
*/
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
/** @public */
|
|
10
|
+
export interface OverflowListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
/** Items to lay out. Extra items beyond `max` collapse into the overflow node. */
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/** Maximum items shown before collapsing into overflow. Unset or >= count shows all. */
|
|
14
|
+
max?: number;
|
|
15
|
+
/** Custom renderer for the overflow node. Defaults to a muted `+N` chip. */
|
|
16
|
+
renderOverflow?: (count: number) => React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/** Renders up to `max` children followed by a `+N` overflow chip (or custom node). */
|
|
19
|
+
export declare const OverflowList: React.ForwardRefExoticComponent<OverflowListProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pin — sticky-pin an element within its scroll region.
|
|
3
|
+
* @category Layout
|
|
4
|
+
* @tier primitive
|
|
5
|
+
* @ai-intent Pins content in view (`position: sticky`) while its surrounding
|
|
6
|
+
* section scrolls — the dependency-free basis for pinned scroll scenes (the
|
|
7
|
+
* "tall section + sticky child" pattern that GSAP's `pin: true` solves
|
|
8
|
+
* imperatively). Reach for this before hand-rolling sticky positioning.
|
|
9
|
+
* @ai-rules `top` is a CSS length offset (a dimension, not a spacing step).
|
|
10
|
+
* Give the pinned element a TALLER scrolling parent so it has room to travel.
|
|
11
|
+
* For the scroll-scrubbed animation inside a pinned scene, use CSS
|
|
12
|
+
* `animation-timeline` (see Reveal) or `useScrollProgress` from
|
|
13
|
+
* `@hirobius/design-system/scroll`. See ADR-021.
|
|
14
|
+
*/
|
|
15
|
+
import React from 'react';
|
|
16
|
+
interface PinProps {
|
|
17
|
+
/** Content pinned within the scroll region. */
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
/** Sticky offset from the top of the scroll region (CSS length). Defaults to '0'. */
|
|
20
|
+
top?: string;
|
|
21
|
+
/** Escape hatch: extra wrapper classes. */
|
|
22
|
+
className?: string;
|
|
23
|
+
/** Escape hatch: narrow style adjustments that do not belong in the primitive API. */
|
|
24
|
+
style?: React.CSSProperties;
|
|
25
|
+
/** Element rendered as the wrapper. Defaults to 'div'. */
|
|
26
|
+
as?: React.ElementType;
|
|
27
|
+
}
|
|
28
|
+
/** @public */
|
|
29
|
+
export declare const Pin: React.ForwardRefExoticComponent<PinProps & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reveal — reveal-on-scroll primitive via CSS scroll-driven animation.
|
|
3
|
+
* @category Motion
|
|
4
|
+
* @tier primitive
|
|
5
|
+
* @ai-intent Fades/slides/scales content in as it enters the viewport, driven
|
|
6
|
+
* purely by scroll position (`animation-timeline: view()`) — no JS, no deps, no
|
|
7
|
+
* IntersectionObserver. Reach for this before hand-rolling reveal logic.
|
|
8
|
+
* @ai-rules Content is fully visible by DEFAULT; the effect applies only where
|
|
9
|
+
* `animation-timeline` is supported AND the user has not requested reduced
|
|
10
|
+
* motion (both fall back to visible, never stuck hidden). Pick `animation` from
|
|
11
|
+
* the fixed set — do not hand-roll keyframes. For momentum/inertia scrolling
|
|
12
|
+
* wrap the app in `SmoothScroll`; for a scroll-progress value in JS use
|
|
13
|
+
* `useScrollProgress` — both from `@hirobius/design-system/scroll`. See ADR-021.
|
|
14
|
+
*/
|
|
15
|
+
import React from 'react';
|
|
16
|
+
export type RevealAnimation = 'fade' | 'fade-up' | 'fade-down' | 'scale';
|
|
17
|
+
interface RevealProps {
|
|
18
|
+
/** Content revealed as it scrolls into view. */
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
/** Entrance animation. Defaults to 'fade-up'. */
|
|
21
|
+
animation?: RevealAnimation;
|
|
22
|
+
/** Escape hatch: extra wrapper classes. */
|
|
23
|
+
className?: string;
|
|
24
|
+
/** Escape hatch: narrow style adjustments that do not belong in the primitive API. */
|
|
25
|
+
style?: React.CSSProperties;
|
|
26
|
+
/** Element rendered as the wrapper. Defaults to 'div'. */
|
|
27
|
+
as?: React.ElementType;
|
|
28
|
+
}
|
|
29
|
+
/** @public */
|
|
30
|
+
export declare const Reveal: React.ForwardRefExoticComponent<RevealProps & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
export {};
|
|
@@ -1,3 +1,36 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
declare const segmentedControlWrapperVariants: (props?: {
|
|
3
|
+
fullWidth?: boolean;
|
|
4
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
5
|
+
declare const segmentedControlRailVariants: (props?: {
|
|
6
|
+
variant?: "primary" | "secondary";
|
|
7
|
+
fullWidth?: boolean;
|
|
8
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
9
|
+
declare const segmentedControlItemVariants: (props?: {
|
|
10
|
+
size?: "sm" | "md";
|
|
11
|
+
fullWidth?: boolean;
|
|
12
|
+
variant?: "primary" | "secondary";
|
|
13
|
+
active?: boolean;
|
|
14
|
+
interaction?: "rest" | "hover" | "pressed";
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
17
|
+
declare const segmentedControlIndicatorVariants: (props?: {
|
|
18
|
+
variant?: "primary" | "secondary";
|
|
19
|
+
active?: boolean;
|
|
20
|
+
interaction?: "rest" | "hover" | "pressed";
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
23
|
+
declare const segmentedControlDescriptionVariants: (props?: {
|
|
24
|
+
variant?: "primary" | "secondary";
|
|
25
|
+
active?: boolean;
|
|
26
|
+
interaction?: "rest" | "hover" | "pressed";
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
29
|
+
declare const segmentedControlFocusRingVariants: (props?: {
|
|
30
|
+
variant?: "primary" | "secondary";
|
|
31
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
32
|
+
declare const segmentedControlLabelVariants: (props?: import("class-variance-authority/dist/types").ClassProp) => string;
|
|
33
|
+
type SegmentedItemVariantProps = VariantProps<typeof segmentedControlItemVariants>;
|
|
1
34
|
interface HdsSegmentedOption {
|
|
2
35
|
/** Value submitted when this option is selected. */
|
|
3
36
|
value: string;
|
|
@@ -18,9 +51,9 @@ interface SegmentedControlProps {
|
|
|
18
51
|
/** Called when the user selects a different option. */
|
|
19
52
|
onChange: (value: string) => void;
|
|
20
53
|
/** Size on the sm/md ramp shared with Button/Input. */
|
|
21
|
-
size?: '
|
|
54
|
+
size?: NonNullable<SegmentedItemVariantProps['size']>;
|
|
22
55
|
/** Visual treatment for the rail and active segment. */
|
|
23
|
-
variant?: '
|
|
56
|
+
variant?: NonNullable<SegmentedItemVariantProps['variant']>;
|
|
24
57
|
/** Whether the control should stretch to the width of its container. */
|
|
25
58
|
fullWidth?: boolean;
|
|
26
59
|
/** Padding inside the rail container. */
|
|
@@ -30,4 +63,5 @@ interface SegmentedControlProps {
|
|
|
30
63
|
}
|
|
31
64
|
/** @public */
|
|
32
65
|
export declare const SegmentedControl: import("react").ForwardRefExoticComponent<SegmentedControlProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
33
|
-
|
|
66
|
+
/** @internal — CVA variant helpers; compose via SegmentedControl props instead. */
|
|
67
|
+
export { segmentedControlWrapperVariants, segmentedControlRailVariants, segmentedControlItemVariants, segmentedControlIndicatorVariants, segmentedControlDescriptionVariants, segmentedControlFocusRingVariants, segmentedControlLabelVariants, };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SelectableCard — a full-surface card that behaves as a single checkbox-like
|
|
3
|
+
* selectable option, with native aria-checked semantics and full keyboard support.
|
|
4
|
+
* @category Actions
|
|
5
|
+
* @tier pattern
|
|
6
|
+
*
|
|
7
|
+
* <SelectableCard selected={selected} onSelectedChange={setSelected}>
|
|
8
|
+
* Plan A
|
|
9
|
+
* </SelectableCard>
|
|
10
|
+
*/
|
|
11
|
+
import * as React from 'react';
|
|
12
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
13
|
+
declare const selectableCardVariants: (props?: {
|
|
14
|
+
selected?: boolean;
|
|
15
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
16
|
+
type SelectableCardVariantProps = VariantProps<typeof selectableCardVariants>;
|
|
17
|
+
/** @public */
|
|
18
|
+
export interface SelectableCardProps extends Omit<React.HTMLAttributes<HTMLButtonElement>, 'onSelect'>, Omit<SelectableCardVariantProps, 'selected'> {
|
|
19
|
+
/** Whether this card is currently selected. */
|
|
20
|
+
selected?: boolean;
|
|
21
|
+
/** Called with the toggled selection state when the card is activated. */
|
|
22
|
+
onSelectedChange?: (selected: boolean) => void;
|
|
23
|
+
/** Disable interaction. */
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/** A card-shaped single checkbox — click or activate to toggle selection. */
|
|
27
|
+
export declare const SelectableCard: React.ForwardRefExoticComponent<SelectableCardProps & React.RefAttributes<HTMLButtonElement>>;
|
|
28
|
+
/** @internal — CVA variant helper; compose via SelectableCard props instead. */
|
|
29
|
+
export { selectableCardVariants };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { MouseEvent } from 'react';
|
|
2
|
+
export type SideNavLevel = 'root' | 'nested';
|
|
3
|
+
export interface SideNavProps {
|
|
4
|
+
label: string;
|
|
5
|
+
href?: string;
|
|
6
|
+
active?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
titleLabel?: boolean;
|
|
9
|
+
/** Visual level — root matches group-header altitude, nested is an indented page link. */
|
|
10
|
+
level?: SideNavLevel;
|
|
11
|
+
/** Nested depth offset applied via inner padding while keeping the row full width. */
|
|
12
|
+
indent?: boolean | number;
|
|
13
|
+
onNavigate?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
14
|
+
}
|
|
15
|
+
declare const sideNavVariants: (props?: {
|
|
16
|
+
level?: "root" | "nested";
|
|
17
|
+
state?: "default" | "active" | "disabled" | "focus" | "hover";
|
|
18
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
19
|
+
export declare function SideNav({ label, href, active, disabled, titleLabel, level, indent, onNavigate, }: SideNavProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
/** @internal — CVA variant helper; compose via SideNav props instead. */
|
|
21
|
+
export { sideNavVariants };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sidebar — fixed-width rail beside fluid content, no media query.
|
|
3
|
+
* @category Layout
|
|
4
|
+
* @tier primitive
|
|
5
|
+
* @ai-intent Solves the "rail + fluid content that stacks below a threshold"
|
|
6
|
+
* problem with the flex-basis/flex-grow disparity technique — the rail holds
|
|
7
|
+
* `sideWidth` and the content flex-basis 0 with an overwhelming flex-grow, so
|
|
8
|
+
* the pair wraps to stacked automatically once the container can no longer
|
|
9
|
+
* fit both without squeezing content below `contentMin`. No CSS media
|
|
10
|
+
* query, no JS resize observer.
|
|
11
|
+
* @ai-rules Reach for this named layout intent before Box/sx. Sidebar expects
|
|
12
|
+
* EXACTLY two children — the rail and the content — passed in that order.
|
|
13
|
+
* `side` controls which one visually renders as the rail; DOM order is
|
|
14
|
+
* unchanged. gap MUST use a semantic space step, never raw px. sideWidth and
|
|
15
|
+
* contentMin are CSS length dimensions (not spacing) — a length string like
|
|
16
|
+
* '16rem' or '50%' is expected, matching the check-hardcoded-spacing gate's
|
|
17
|
+
* own dimension-prop exemption. Do NOT use Sidebar for more than two regions
|
|
18
|
+
* — use Grid.
|
|
19
|
+
*
|
|
20
|
+
* Every Layout reference: https://every-layout.dev/layouts/sidebar/
|
|
21
|
+
*/
|
|
22
|
+
import React from 'react';
|
|
23
|
+
type SidebarSide = 'start' | 'end';
|
|
24
|
+
type LayoutGap = 'tight' | 'normal' | 'inset' | 'spacious';
|
|
25
|
+
interface SidebarProps {
|
|
26
|
+
/** Exactly two children: the rail first, the fluid content second (DOM order — `side` only changes visual order). */
|
|
27
|
+
children: [React.ReactNode, React.ReactNode];
|
|
28
|
+
/** Which visual edge the rail renders on. Defaults to 'start'. */
|
|
29
|
+
side?: SidebarSide;
|
|
30
|
+
/** Fixed width of the rail (CSS length, e.g. '16rem'). Defaults to '16rem'. */
|
|
31
|
+
sideWidth?: string;
|
|
32
|
+
/** Minimum inline size the content is allowed to shrink to before the pair wraps to stacked (CSS length). Defaults to '50%'. */
|
|
33
|
+
contentMin?: string;
|
|
34
|
+
/** Gap between the rail and the content, and between the two once stacked. Defaults to 'normal'. */
|
|
35
|
+
gap?: LayoutGap;
|
|
36
|
+
/** Escape hatch: only use when tokenized props cannot express the required wrapper class. */
|
|
37
|
+
className?: string;
|
|
38
|
+
/** Escape hatch: only use for narrow layout adjustments that do not belong in the primitive API. */
|
|
39
|
+
style?: React.CSSProperties;
|
|
40
|
+
/** Element rendered as the outer wrapper. Defaults to 'div'. */
|
|
41
|
+
as?: React.ElementType;
|
|
42
|
+
}
|
|
43
|
+
/** @public */
|
|
44
|
+
export declare const Sidebar: React.ForwardRefExoticComponent<SidebarProps & React.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
export {};
|
|
@@ -3,22 +3,20 @@
|
|
|
3
3
|
* @tier primitive
|
|
4
4
|
*/
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
export type StatTone = keyof typeof TONE_CLASSES;
|
|
6
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
7
|
+
declare const statVariants: (props?: {
|
|
8
|
+
tone?: "success" | "danger" | "warning" | "info" | "neutral";
|
|
9
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
10
|
+
type StatVariantProps = VariantProps<typeof statVariants>;
|
|
13
11
|
/** @public */
|
|
14
|
-
export interface StatProps extends React.HTMLAttributes<HTMLDivElement
|
|
12
|
+
export interface StatProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>, StatVariantProps {
|
|
15
13
|
label: string;
|
|
16
14
|
value: React.ReactNode;
|
|
17
15
|
sub?: React.ReactNode;
|
|
18
|
-
tone?: StatTone;
|
|
19
16
|
}
|
|
20
17
|
/**
|
|
21
18
|
* Headline metric — large value, uppercase caption label, optional sub-line.
|
|
22
19
|
*/
|
|
23
20
|
export declare const Stat: React.ForwardRefExoticComponent<StatProps & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
-
|
|
21
|
+
/** @internal — CVA variant helper; compose via Stat props instead. */
|
|
22
|
+
export { statVariants };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StatusDot — compact solid status indicator dot.
|
|
3
|
+
* @category Feedback
|
|
4
|
+
* @tier primitive
|
|
5
|
+
*/
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
8
|
+
declare const statusDotVariants: (props?: {
|
|
9
|
+
tone?: "success" | "danger" | "warning" | "info" | "neutral" | "inProgress";
|
|
10
|
+
size?: "sm" | "md" | "lg";
|
|
11
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
12
|
+
type StatusDotVariantProps = VariantProps<typeof statusDotVariants>;
|
|
13
|
+
/** @public */
|
|
14
|
+
export interface StatusDotProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'>, StatusDotVariantProps {
|
|
15
|
+
/**
|
|
16
|
+
* Accessible name for the status. When provided the dot is exposed as a
|
|
17
|
+
* `role="status"` with this label; when omitted the dot is decorative
|
|
18
|
+
* (`aria-hidden`) and a sibling should carry the meaning.
|
|
19
|
+
*/
|
|
20
|
+
label?: string;
|
|
21
|
+
}
|
|
22
|
+
/** A small solid dot conveying a semantic status via `tone`. */
|
|
23
|
+
export declare const StatusDot: React.ForwardRefExoticComponent<StatusDotProps & React.RefAttributes<HTMLSpanElement>>;
|
|
24
|
+
/** @internal — CVA variant helper; compose via StatusDot props instead. */
|
|
25
|
+
export { statusDotVariants };
|
|
@@ -3,17 +3,15 @@
|
|
|
3
3
|
* @tier pattern
|
|
4
4
|
*/
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
readonly neutral: "bg-[var(--semantic-color-border-default)]";
|
|
12
|
-
};
|
|
13
|
-
export type StatusListItemTone = keyof typeof DOT_TONE;
|
|
6
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
7
|
+
declare const statusListItemDotVariants: (props?: {
|
|
8
|
+
tone?: "success" | "danger" | "warning" | "info" | "neutral";
|
|
9
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
10
|
+
type StatusListItemVariantProps = VariantProps<typeof statusListItemDotVariants>;
|
|
14
11
|
/** @public */
|
|
15
|
-
export
|
|
16
|
-
|
|
12
|
+
export type StatusListItemTone = NonNullable<StatusListItemVariantProps['tone']>;
|
|
13
|
+
/** @public */
|
|
14
|
+
export interface StatusListItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>, StatusListItemVariantProps {
|
|
17
15
|
title: React.ReactNode;
|
|
18
16
|
notes?: React.ReactNode[];
|
|
19
17
|
trailing?: React.ReactNode;
|
|
@@ -22,4 +20,5 @@ export interface StatusListItemProps extends Omit<React.HTMLAttributes<HTMLDivEl
|
|
|
22
20
|
* Status dot + title row with optional muted notes and trailing slot (e.g. badge).
|
|
23
21
|
*/
|
|
24
22
|
export declare const StatusListItem: React.ForwardRefExoticComponent<StatusListItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
-
|
|
23
|
+
/** @internal — CVA variant helper; compose via StatusListItem props instead. */
|
|
24
|
+
export { statusListItemDotVariants };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stepper - horizontal or vertical step indicator for multi-step wizard and
|
|
3
|
+
* checkout flows, marking each step as complete, current, or upcoming.
|
|
4
|
+
* @category Navigation
|
|
5
|
+
* @tier pattern
|
|
6
|
+
*/
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
/** @internal */
|
|
9
|
+
declare const stepMarkerVariants: (props?: {
|
|
10
|
+
state?: "current" | "complete" | "upcoming";
|
|
11
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
12
|
+
/** @public */
|
|
13
|
+
export interface Step {
|
|
14
|
+
/** Visible label for the step. */
|
|
15
|
+
label: React.ReactNode;
|
|
16
|
+
/** Optional supporting copy shown under the label. */
|
|
17
|
+
description?: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
/** @public */
|
|
20
|
+
export interface StepperProps extends React.HTMLAttributes<HTMLOListElement> {
|
|
21
|
+
/** Ordered steps from first to last. */
|
|
22
|
+
steps: Step[];
|
|
23
|
+
/** 0-based index of the current step. */
|
|
24
|
+
activeStep: number;
|
|
25
|
+
/** Layout direction. Defaults to 'horizontal'. */
|
|
26
|
+
orientation?: 'horizontal' | 'vertical';
|
|
27
|
+
}
|
|
28
|
+
/** Step indicator for multi-step flows. Purely presentational — no navigation. */
|
|
29
|
+
export declare const Stepper: React.ForwardRefExoticComponent<StepperProps & React.RefAttributes<HTMLOListElement>>;
|
|
30
|
+
/** @internal — CVA variant helper; compose via Stepper's internal state instead. */
|
|
31
|
+
export { stepMarkerVariants };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Switcher — flips a row to a column below a width threshold, no media query.
|
|
3
|
+
* @category Layout
|
|
4
|
+
* @tier primitive
|
|
5
|
+
* @ai-intent Solves "horizontal row of peer items that should become a
|
|
6
|
+
* vertical stack once the container gets narrow" without a breakpoint or a
|
|
7
|
+
* resize observer, using the flex-basis calc() technique: each item's
|
|
8
|
+
* flex-basis resolves to a huge negative or huge positive number depending on
|
|
9
|
+
* whether the container is above or below `threshold`, forcing every item
|
|
10
|
+
* onto its own line once it flips.
|
|
11
|
+
* @ai-rules Reach for this named layout intent before Box/sx. gap MUST use a
|
|
12
|
+
* semantic space step, never raw px. threshold is a CSS length dimension
|
|
13
|
+
* (not spacing), e.g. '30rem'. `limit` unconditionally forces the stacked
|
|
14
|
+
* (column) layout once there are more than `limit` children, regardless of
|
|
15
|
+
* container width — use it to stop a row from thinning out into an
|
|
16
|
+
* unreadable N-up strip. Do NOT use Switcher for content that should always
|
|
17
|
+
* wrap in place — use Cluster.
|
|
18
|
+
*
|
|
19
|
+
* Every Layout reference: https://every-layout.dev/layouts/the-switcher/
|
|
20
|
+
*/
|
|
21
|
+
import React from 'react';
|
|
22
|
+
type LayoutGap = 'tight' | 'normal' | 'inset' | 'spacious';
|
|
23
|
+
interface SwitcherProps {
|
|
24
|
+
/** Switcher content — peer items that flip between row and column as a unit. */
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
/** Container width below which items stack vertically (CSS length, e.g. '30rem'). Defaults to '30rem'. */
|
|
27
|
+
threshold?: string;
|
|
28
|
+
/** Gap between items in both the row and the stacked layout. Defaults to 'normal'. */
|
|
29
|
+
gap?: LayoutGap;
|
|
30
|
+
/** Maximum number of children before the layout is unconditionally forced to stacked, regardless of width. */
|
|
31
|
+
limit?: number;
|
|
32
|
+
/** Escape hatch: only use when tokenized props cannot express the required wrapper class. */
|
|
33
|
+
className?: string;
|
|
34
|
+
/** Escape hatch: only use for narrow layout adjustments that do not belong in the primitive API. */
|
|
35
|
+
style?: React.CSSProperties;
|
|
36
|
+
/** Element rendered as the outer wrapper. Defaults to 'div'. */
|
|
37
|
+
as?: React.ElementType;
|
|
38
|
+
}
|
|
39
|
+
/** @public */
|
|
40
|
+
export declare const Switcher: React.ForwardRefExoticComponent<SwitcherProps & React.RefAttributes<HTMLDivElement>>;
|
|
41
|
+
export {};
|