@hirobius/design-system 0.11.0 → 0.13.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.
Files changed (93) hide show
  1. package/README.md +50 -9
  2. package/dist/brand.js +36 -0
  3. package/dist/contexts.js +63 -59
  4. package/dist/hirobius-ui.js +22636 -3818
  5. package/dist/manifest.js +9 -9
  6. package/dist/scroll.js +42 -0
  7. package/dist/static.css +388 -0
  8. package/dist/styles.css +1 -1
  9. package/dist/tokens.css +1 -1
  10. package/dist/tokens.js +14 -1
  11. package/dist/types/src/app/components/activity-feed.d.ts +24 -2
  12. package/dist/types/src/app/components/alert-dialog.d.ts +56 -0
  13. package/dist/types/src/app/components/app-shell.d.ts +38 -0
  14. package/dist/types/src/app/components/aspect-ratio.d.ts +25 -0
  15. package/dist/types/src/app/components/avatar-group.d.ts +22 -0
  16. package/dist/types/src/app/components/bleed.d.ts +39 -0
  17. package/dist/types/src/app/components/blockquote.d.ts +20 -0
  18. package/dist/types/src/app/components/box-sx.d.ts +69 -0
  19. package/dist/types/src/app/components/box.d.ts +42 -0
  20. package/dist/types/src/app/components/breadcrumb.d.ts +5 -0
  21. package/dist/types/src/app/components/button-group.d.ts +18 -0
  22. package/dist/types/src/app/components/calendar.d.ts +20 -0
  23. package/dist/types/src/app/components/card.d.ts +29 -13
  24. package/dist/types/src/app/components/carousel.d.ts +24 -0
  25. package/dist/types/src/app/components/center.d.ts +36 -0
  26. package/dist/types/src/app/components/circular-progress.d.ts +28 -0
  27. package/dist/types/src/app/components/cluster.d.ts +39 -0
  28. package/dist/types/src/app/components/code-block.d.ts +19 -1
  29. package/dist/types/src/app/components/command-palette.d.ts +44 -0
  30. package/dist/types/src/app/components/container.d.ts +10 -0
  31. package/dist/types/src/app/components/context-menu.d.ts +55 -0
  32. package/dist/types/src/app/components/cover.d.ts +43 -0
  33. package/dist/types/src/app/components/date-input.d.ts +31 -0
  34. package/dist/types/src/app/components/date-range-input.d.ts +34 -0
  35. package/dist/types/src/app/components/date-time-input.d.ts +30 -0
  36. package/dist/types/src/app/components/disclosure.d.ts +5 -1
  37. package/dist/types/src/app/components/divider.d.ts +14 -10
  38. package/dist/types/src/app/components/doc-link-card.d.ts +5 -1
  39. package/dist/types/src/app/components/field.d.ts +9 -11
  40. package/dist/types/src/app/components/file-input.d.ts +28 -0
  41. package/dist/types/src/app/components/frame.d.ts +38 -0
  42. package/dist/types/src/app/components/heading-stack.d.ts +15 -5
  43. package/dist/types/src/app/components/hover-card.d.ts +31 -0
  44. package/dist/types/src/app/components/image-lightbox.d.ts +13 -0
  45. package/dist/types/src/app/components/inline-code.d.ts +14 -3
  46. package/dist/types/src/app/components/input-group.d.ts +23 -0
  47. package/dist/types/src/app/components/kbd.d.ts +18 -0
  48. package/dist/types/src/app/components/metadata-list.d.ts +43 -0
  49. package/dist/types/src/app/components/multi-selector.d.ts +40 -0
  50. package/dist/types/src/app/components/nav-group.d.ts +7 -2
  51. package/dist/types/src/app/components/nav-item.d.ts +12 -2
  52. package/dist/types/src/app/components/overflow-list.d.ts +19 -0
  53. package/dist/types/src/app/components/pin.d.ts +30 -0
  54. package/dist/types/src/app/components/reveal.d.ts +31 -0
  55. package/dist/types/src/app/components/segmented-control.d.ts +37 -3
  56. package/dist/types/src/app/components/selectable-card.d.ts +29 -0
  57. package/dist/types/src/app/components/side-nav.d.ts +21 -0
  58. package/dist/types/src/app/components/sidebar.d.ts +45 -0
  59. package/dist/types/src/app/components/stat.d.ts +8 -10
  60. package/dist/types/src/app/components/status-dot.d.ts +25 -0
  61. package/dist/types/src/app/components/status-list-item.d.ts +10 -11
  62. package/dist/types/src/app/components/stepper.d.ts +31 -0
  63. package/dist/types/src/app/components/switcher.d.ts +41 -0
  64. package/dist/types/src/app/components/table.d.ts +12 -1
  65. package/dist/types/src/app/components/tag.d.ts +19 -18
  66. package/dist/types/src/app/components/text.d.ts +8 -2
  67. package/dist/types/src/app/components/time-input.d.ts +24 -0
  68. package/dist/types/src/app/components/timestamp.d.ts +24 -0
  69. package/dist/types/src/app/components/toast.d.ts +8 -2
  70. package/dist/types/src/app/components/toggle-button.d.ts +32 -0
  71. package/dist/types/src/app/components/token.d.ts +26 -1
  72. package/dist/types/src/app/components/tokenizer.d.ts +24 -0
  73. package/dist/types/src/app/components/toolbar.d.ts +36 -0
  74. package/dist/types/src/app/components/top-nav.d.ts +21 -0
  75. package/dist/types/src/app/components/tree-list.d.ts +28 -0
  76. package/dist/types/src/app/components/visually-hidden.d.ts +17 -0
  77. package/dist/types/src/app/context/TenantContext.d.ts +1 -1
  78. package/dist/types/src/app/data/nav-model.d.ts +39 -0
  79. package/dist/types/src/app/design-system/generated-token-refs.d.ts +13 -0
  80. package/dist/types/src/app/design-system/generated-token-values.d.ts +14 -1
  81. package/dist/types/src/app/{pages/hds → layouts}/HdsSystemDocLayout.d.ts +1 -1
  82. package/dist/types/src/app/lib/hds-search.d.ts +45 -0
  83. package/dist/types/src/brand/index.d.ts +9 -0
  84. package/dist/types/src/brand/overlay.d.ts +71 -0
  85. package/dist/types/src/index.d.ts +92 -2
  86. package/dist/types/src/scroll/index.d.ts +16 -0
  87. package/dist/types/src/scroll/smooth-scroll.d.ts +48 -0
  88. package/dist/types/src/scroll/use-scroll-progress.d.ts +34 -0
  89. package/dist/variables.css +16 -5
  90. package/hirobius.tokens.json +57 -10
  91. package/package.json +37 -67
  92. package/public/hds-manifest.json +6167 -4929
  93. package/dist/types/src/app/components/info-page.d.ts +0 -10
package/dist/tokens.js CHANGED
@@ -48,6 +48,19 @@ const a = {
48
48
  700: "#6d28d9",
49
49
  950: "#2e1065"
50
50
  },
51
+ lilac: {
52
+ 50: "#f7f4fe",
53
+ 100: "#efe9fd",
54
+ 200: "#ddd0fb",
55
+ 300: "#c3aef6",
56
+ 400: "#a585ee",
57
+ 450: "#9a6fe8",
58
+ 500: "#6f3fd4",
59
+ 600: "#5f33c0",
60
+ 700: "#4f2aa3",
61
+ 800: "#3a1f78",
62
+ 900: "#2a1659"
63
+ },
51
64
  amber: {
52
65
  50: "#fffbeb",
53
66
  400: "#fbbf24",
@@ -108,7 +121,7 @@ const a = {
108
121
  typography: {
109
122
  family: {
110
123
  primary: ["Satoshi", "system-ui", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "sans-serif"],
111
- display: ["Clash Display", "system-ui", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "sans-serif"],
124
+ display: ["Satoshi", "system-ui", "-apple-system", "BlinkMacSystemFont", "Segoe UI", "sans-serif"],
112
125
  mono: ["Geist Mono", "Courier New", "monospace"]
113
126
  },
114
127
  size: {
@@ -16,8 +16,15 @@
16
16
  * category → ui (14px/1.5)
17
17
  */
18
18
  import type { ReactNode } from 'react';
19
- /** @public */
19
+ /**
20
+ * @deprecated Use `ActivityTone` instead — values are renamed to match the
21
+ * fixed HDS tone vocabulary (`neutral | danger | success | warning | info`,
22
+ * see docs/architecture/variant-contract.md). `'error'` remains supported
23
+ * here as a back-compat alias for `'danger'`; new code should use `tone`.
24
+ */
20
25
  export type ActivityStatus = 'success' | 'error' | 'warning' | 'info' | 'neutral';
26
+ /** @public */
27
+ export type ActivityTone = 'neutral' | 'danger' | 'success' | 'warning' | 'info';
21
28
  export interface ActivityEvent {
22
29
  id: string;
23
30
  title: string;
@@ -25,7 +32,16 @@ export interface ActivityEvent {
25
32
  timestamp: string;
26
33
  category: string;
27
34
  icon: ReactNode;
28
- status: ActivityStatus;
35
+ /**
36
+ * Semantic tone for this event's icon and category color.
37
+ * `neutral | danger | success | warning | info`. Supersedes `status`.
38
+ */
39
+ tone?: ActivityTone;
40
+ /**
41
+ * @deprecated Use `tone` instead. Retained for back-compat; `'error'`
42
+ * resolves to the `danger` tone.
43
+ */
44
+ status?: ActivityStatus;
29
45
  action?: {
30
46
  label: string;
31
47
  onClick?: () => void;
@@ -38,6 +54,12 @@ export interface ActivityEvent {
38
54
  export interface ActivityFeedProps {
39
55
  events: ActivityEvent[];
40
56
  }
57
+ declare const activityToneVariants: (props?: {
58
+ tone?: "success" | "danger" | "warning" | "info" | "neutral";
59
+ } & import("class-variance-authority/dist/types").ClassProp) => string;
60
+ declare const activityAvatarVariants: (props?: import("class-variance-authority/dist/types").ClassProp) => string;
41
61
  /** @internal — demo placeholder data; supply your own ActivityEvent[] via the events prop. */
42
62
  export declare const defaultActivityEvents: ActivityEvent[];
43
63
  export declare function ActivityFeed({ events }: ActivityFeedProps): import("react/jsx-runtime").JSX.Element;
64
+ /** @internal — CVA variant helpers; compose via ActivityFeed/ActivityEvent props instead. */
65
+ export { activityToneVariants, activityAvatarVariants };
@@ -0,0 +1,56 @@
1
+ /**
2
+ * AlertDialog — modal confirmation dialog on Radix AlertDialog.
3
+ * @category Overlays
4
+ * @tier primitive
5
+ * @doc-exempt: no Overlays doc page yet — add demo when the overlays page is created
6
+ *
7
+ * Radix AlertDialog (@radix-ui/react-alert-dialog) themed with the overlay role
8
+ * tokens to match Dialog. Unlike Dialog it forces a decision: no
9
+ * dismiss-on-outside-click, focus defaults to Cancel, and it exposes
10
+ * Action/Cancel affordances for destructive or irreversible confirmations.
11
+ *
12
+ * <AlertDialog>
13
+ * <AlertDialog.Trigger asChild><Button tone="danger">Delete</Button></AlertDialog.Trigger>
14
+ * <AlertDialog.Content>
15
+ * <AlertDialog.Header>
16
+ * <AlertDialog.Title>Delete project?</AlertDialog.Title>
17
+ * <AlertDialog.Description>This cannot be undone.</AlertDialog.Description>
18
+ * </AlertDialog.Header>
19
+ * <AlertDialog.Footer>
20
+ * <AlertDialog.Cancel asChild><Button variant="secondary">Cancel</Button></AlertDialog.Cancel>
21
+ * <AlertDialog.Action asChild><Button tone="danger">Delete</Button></AlertDialog.Action>
22
+ * </AlertDialog.Footer>
23
+ * </AlertDialog.Content>
24
+ * </AlertDialog>
25
+ */
26
+ import * as React from 'react';
27
+ import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
28
+ declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
29
+ declare const AlertDialogPortal: React.FC<AlertDialogPrimitive.AlertDialogPortalProps>;
30
+ declare const AlertDialogAction: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>>;
31
+ declare const AlertDialogCancel: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>>;
32
+ declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
33
+ declare const AlertDialogContent: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
34
+ declare const AlertDialogHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
35
+ declare const AlertDialogFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
36
+ declare const AlertDialogTitle: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
37
+ declare const AlertDialogDescription: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
38
+ interface AlertDialogComponent extends React.FC<React.ComponentProps<typeof AlertDialogPrimitive.Root>> {
39
+ Trigger: typeof AlertDialogTrigger;
40
+ Portal: typeof AlertDialogPortal;
41
+ Overlay: typeof AlertDialogOverlay;
42
+ Content: typeof AlertDialogContent;
43
+ Header: typeof AlertDialogHeader;
44
+ Footer: typeof AlertDialogFooter;
45
+ Title: typeof AlertDialogTitle;
46
+ Description: typeof AlertDialogDescription;
47
+ Action: typeof AlertDialogAction;
48
+ Cancel: typeof AlertDialogCancel;
49
+ }
50
+ /**
51
+ * AlertDialog root + parts. Controlled via `open`/`onOpenChange`, or
52
+ * uncontrolled with `defaultOpen`.
53
+ * @public
54
+ */
55
+ export declare const AlertDialog: AlertDialogComponent;
56
+ export {};
@@ -0,0 +1,38 @@
1
+ /**
2
+ * AppShell — application layout scaffold with semantic header, sidebar, and main regions, built for dashboards and admin surfaces.
3
+ * @category Layout
4
+ * @tier template
5
+ * @public
6
+ *
7
+ * Composes a full-height page frame from three optional/required regions: an
8
+ * optional top `header` (spans full width), an optional left `sidebar` (fixed
9
+ * width via `sidebarWidth`), and required `children` rendered in `<main>`.
10
+ * Regions map to native landmark elements (`<header>`, `<aside>`, `<main>`)
11
+ * so assistive tech gets banner/complementary/main roles for free.
12
+ *
13
+ * Usage:
14
+ * <AppShell header={<TopBar />} sidebar={<NavRail />}>
15
+ * <PageContent />
16
+ * </AppShell>
17
+ */
18
+ import * as React from 'react';
19
+ import { type VariantProps } from 'class-variance-authority';
20
+ declare const appShellVariants: (props?: {
21
+ sidebarWidth?: "sm" | "md" | "lg";
22
+ } & import("class-variance-authority/dist/types").ClassProp) => string;
23
+ type AppShellVariantProps = VariantProps<typeof appShellVariants>;
24
+ /** @public */
25
+ export interface AppShellProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
26
+ /** Optional top region, rendered full-width above the sidebar/main row. */
27
+ header?: React.ReactNode;
28
+ /** Optional left region, rendered as a fixed-width `<aside>` beside main. */
29
+ sidebar?: React.ReactNode;
30
+ /** Main content, rendered inside `<main>`. */
31
+ children: React.ReactNode;
32
+ /** Sidebar width token: sm (224px) / md (256px) / lg (288px). Defaults to 'md'. */
33
+ sidebarWidth?: NonNullable<AppShellVariantProps['sidebarWidth']>;
34
+ }
35
+ /** Renders a header/sidebar/main application frame, e.g. `<AppShell sidebar={<Nav />}>...</AppShell>`. */
36
+ export declare const AppShell: React.ForwardRefExoticComponent<AppShellProps & React.RefAttributes<HTMLDivElement>>;
37
+ /** @internal — CVA variant helper; compose via AppShell props instead. */
38
+ export { appShellVariants };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * AspectRatio — constrains its child to a fixed width:height ratio.
3
+ * @category Layout
4
+ * @tier primitive
5
+ *
6
+ * Thin token-free wrapper over Radix AspectRatio (@radix-ui/react-aspect-ratio),
7
+ * which holds a responsive aspect box via the padding-bottom technique so media
8
+ * (images, video, embeds, map tiles) never causes layout shift while loading.
9
+ *
10
+ * <AspectRatio ratio={16 / 9}>
11
+ * <img src="…" alt="…" className="h-full w-full object-cover" />
12
+ * </AspectRatio>
13
+ */
14
+ import * as React from 'react';
15
+ import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
16
+ /** @public */
17
+ export interface AspectRatioProps extends React.ComponentPropsWithoutRef<typeof AspectRatioPrimitive.Root> {
18
+ /** Desired width-to-height ratio, e.g. `16 / 9`. Defaults to `1` (square). */
19
+ ratio?: number;
20
+ }
21
+ /**
22
+ * Locks its single child to the given width-to-height `ratio` so media reserves
23
+ * its box up front and never causes layout shift while it loads.
24
+ */
25
+ export declare const AspectRatio: React.ForwardRefExoticComponent<AspectRatioProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * AvatarGroup — an overlapping cluster of Avatars with an overflow count.
3
+ * @category Display
4
+ * @tier primitive
5
+ */
6
+ import * as React from 'react';
7
+ import { type VariantProps } from 'class-variance-authority';
8
+ declare const overflowBubbleVariants: (props?: {
9
+ size?: "sm" | "md" | "lg";
10
+ } & import("class-variance-authority/dist/types").ClassProp) => string;
11
+ type OverflowBubbleVariantProps = VariantProps<typeof overflowBubbleVariants>;
12
+ /** @public */
13
+ export interface AvatarGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>, OverflowBubbleVariantProps {
14
+ /** Avatar elements to cluster. Extra items beyond `max` collapse into +N. */
15
+ children: React.ReactNode;
16
+ /** Maximum avatars shown before collapsing into an overflow chip. */
17
+ max?: number;
18
+ }
19
+ /** Renders up to `max` overlapping avatars followed by a `+N` overflow chip. */
20
+ export declare const AvatarGroup: React.ForwardRefExoticComponent<AvatarGroupProps & React.RefAttributes<HTMLDivElement>>;
21
+ /** @internal — CVA variant helper; compose via AvatarGroup props instead. */
22
+ export { overflowBubbleVariants };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Bleed — controlled negative-margin full-bleed within a padded container.
3
+ * @category Layout
4
+ * @tier primitive
5
+ * @ai-intent Solves "this one child needs to visually escape its parent's
6
+ * padding" (a full-width image inside a padded card, a divider that should
7
+ * touch both edges) with a single tokenized negative-margin wrapper, so
8
+ * agents stop hand-rolling `margin: -24px` guesses that drift from the
9
+ * parent's actual padding token.
10
+ * @ai-rules Reach for this named layout intent before Box/sx. amount MUST
11
+ * use a semantic space step, never raw px, and MUST match the ancestor
12
+ * padding it is meant to cancel out. Do NOT use Bleed to fake extra spacing
13
+ * — its only job is canceling a specific known padding value on a specific
14
+ * axis.
15
+ *
16
+ * Every Layout reference: https://every-layout.dev/layouts/the-stack/ (bleed
17
+ * is the inverse of a padded Center/Container — HDS names it separately
18
+ * since "every-layout" itself does not ship a dedicated Bleed recipe).
19
+ */
20
+ import React from 'react';
21
+ type LayoutGap = 'tight' | 'normal' | 'inset' | 'spacious';
22
+ type BleedAxis = 'x' | 'y' | 'both';
23
+ interface BleedProps {
24
+ /** Bleed content. */
25
+ children: React.ReactNode;
26
+ /** Semantic space step to negate. Defaults to 'normal'. */
27
+ amount?: LayoutGap;
28
+ /** Which axis the negative margin applies to. Defaults to 'x'. */
29
+ axis?: BleedAxis;
30
+ /** Escape hatch: only use when tokenized props cannot express the required wrapper class. */
31
+ className?: string;
32
+ /** Escape hatch: only use for narrow layout adjustments that do not belong in the primitive API. */
33
+ style?: React.CSSProperties;
34
+ /** Element rendered as the outer wrapper. Defaults to 'div'. */
35
+ as?: React.ElementType;
36
+ }
37
+ /** @public */
38
+ export declare const Bleed: React.ForwardRefExoticComponent<BleedProps & React.RefAttributes<HTMLDivElement>>;
39
+ export {};
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Blockquote — quoted passage with an optional attribution.
3
+ * @category Typography
4
+ * @tier primitive
5
+ */
6
+ import * as React from 'react';
7
+ import { type VariantProps } from 'class-variance-authority';
8
+ declare const blockquoteVariants: (props?: {
9
+ size?: "sm" | "md" | "lg";
10
+ } & import("class-variance-authority/dist/types").ClassProp) => string;
11
+ type BlockquoteVariantProps = VariantProps<typeof blockquoteVariants>;
12
+ /** @public */
13
+ export interface BlockquoteProps extends React.BlockquoteHTMLAttributes<HTMLQuoteElement>, BlockquoteVariantProps {
14
+ /** Optional attribution rendered beneath the quote (e.g. the author). */
15
+ attribution?: React.ReactNode;
16
+ }
17
+ /** A quoted passage; pass `cite` for the source URL and `attribution` for a byline. */
18
+ export declare const Blockquote: React.ForwardRefExoticComponent<BlockquoteProps & React.RefAttributes<HTMLQuoteElement>>;
19
+ /** @internal — CVA variant helper; compose via Blockquote props instead. */
20
+ export { blockquoteVariants };
@@ -0,0 +1,69 @@
1
+ /**
2
+ * box-sx.ts — pure resolver + CSS injector for Box's `sx` prop.
3
+ *
4
+ * Deliberately dependency-free (no React import) so the resolver is unit
5
+ * testable in isolation from the component tree. `box.tsx` is the only
6
+ * consumer; it re-exports the types below as part of the public `Box` API.
7
+ *
8
+ * @internal — the resolver internals (`resolveSx`, `sxClassName`, `injectSx`)
9
+ * are exported for testing but the supported public surface is `Box` + the
10
+ * `Sx*` types, both re-exported from `box.tsx`.
11
+ */
12
+ export declare const BOX_BREAKPOINTS: {
13
+ readonly xs: 375;
14
+ readonly sm: 640;
15
+ readonly md: 768;
16
+ readonly lg: 1024;
17
+ readonly xl: 1280;
18
+ };
19
+ export type Breakpoint = keyof typeof BOX_BREAKPOINTS;
20
+ export type SxValue = string | number;
21
+ export type ResponsiveValue<T> = T | Partial<Record<Breakpoint, T>>;
22
+ /**
23
+ * The `sx` object shape. Keys are either:
24
+ * - a CSS-property-ish key (camelCase, e.g. `p`, `color`, `marginTop`) whose
25
+ * value is a plain `SxValue` or a `{ xs, sm, md, lg, xl }` responsive map, or
26
+ * - a `&`-prefixed nested-selector key (`'&:hover'`, `'& > *'`,
27
+ * `'&[data-state=open]'`) whose value is itself a nested `SxObject`.
28
+ */
29
+ export interface SxObject {
30
+ [key: string]: ResponsiveValue<SxValue> | SxObject | undefined;
31
+ }
32
+ /**
33
+ * Resolves an `SxObject` into an ordered array of standalone, top-level CSS
34
+ * rule strings ready for individual `CSSStyleSheet.insertRule()` calls.
35
+ *
36
+ * Pure — no DOM access. Order: base (non-responsive) rules for every selector
37
+ * encountered (outer class first, then each `&`-selector in declaration
38
+ * order), followed by `@media (min-width: …)` blocks in ascending breakpoint
39
+ * order. Each media block is ONE rule string containing its inner selector
40
+ * rules concatenated as plain text — that concatenation is safe (and
41
+ * required) because a single `insertRule()` call for an `@media {...}` block
42
+ * is one rule; only top-level rule concatenation breaks `insertRule()` (see
43
+ * `injectSx` below).
44
+ */
45
+ export declare function resolveSx(sx: SxObject, className: string): string[];
46
+ /** Deterministic class name for an sx object — identical objects (by value) share one class/hash. */
47
+ export declare function sxClassName(sx: SxObject): string;
48
+ /**
49
+ * Resolves `sx` to its class name and (in a DOM environment) injects its CSS
50
+ * rules into a single managed `<style data-hds-sx>` element, once per unique
51
+ * hash — identical `sx` objects across renders/components share one rule set.
52
+ *
53
+ * SSR-safe: `document` is guarded, so this is a no-op on the server beyond
54
+ * computing the deterministic class name, which is all hydration needs to
55
+ * match markup — the client-side injection then fills in the actual rules.
56
+ *
57
+ * ⚠ CSSStyleSheet.insertRule() bug this fixes: it accepts exactly ONE rule
58
+ * per call. Naively concatenating an sx's base declarations with a
59
+ * `&`-selector (or responsive) rule into one string and calling
60
+ * `insertRule()` once throws a SyntaxError — and if that throw is swallowed
61
+ * (as it was previously), ALL rules are silently dropped, including the base
62
+ * ones: the element gets its class but renders completely unstyled. The fix
63
+ * is `resolveSx()` returning already-split, individually-insertable rule
64
+ * strings, each inserted in its own try/catch here so one bad/unsupported
65
+ * rule can never take the others down with it.
66
+ */
67
+ export declare function injectSx(sx: SxObject): string;
68
+ /** @internal test-only — clears the injection cache and managed stylesheet between test runs. */
69
+ export declare function __resetBoxSxForTests(): void;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Box — polymorphic layout primitive with a token-first `sx` engine.
3
+ * @category Layout
4
+ * @tier primitive
5
+ * @ai-intent Provides one narrow escape hatch for genuinely one-off layout that no
6
+ * named primitive covers, without inviting ad hoc inline styles or raw hex/px values
7
+ * back into the system — the `sx` engine only accepts HDS token keys and a small,
8
+ * deliberate CSS subset.
9
+ * @ai-rules Reach for Stack/Grid/Container/the every-layout primitives first. Use
10
+ * Box `sx` ONLY for genuinely one-off layout. sx colors/spacing MUST use token
11
+ * keys, not raw hex/px. Prefer named layout primitives over ad-hoc flex.
12
+ *
13
+ * `sx` is a deliberate SUBSET of MUI's sx — not all of CSS-in-JS is a feature:
14
+ * - Spacing shorthands (m/p/gap family) resolve numbers off the 4px HDS scale
15
+ * (`--primitive-space-<n>`) and named steps ('tight'|'normal'|'inset'|'spacious')
16
+ * off `--semantic-space-layout-*`.
17
+ * - `color`/`bgcolor`/`borderColor`/`fill`/`stroke` resolve dotted token keys
18
+ * ('content.primary', 'surface.raised', 'border.subtle', 'accent',
19
+ * 'accent.hover', 'feedback.success', …) to the matching semantic CSS var.
20
+ * - Responsive `{ xs, sm, md, lg, xl }` objects compile to `min-width` media
21
+ * queries off the HDS breakpoint scale.
22
+ * - `&`-prefixed keys ('&:hover', '& > *', '&[data-state=open]') nest a
23
+ * selector, composable with responsive values.
24
+ * - Everything else passes through as a plain camelCase→kebab-case CSS
25
+ * declaration (numbers get `px` unless in the unitless allowlist).
26
+ *
27
+ * See `box-sx.ts` for the pure resolver + hashing/injection engine.
28
+ */
29
+ import React from 'react';
30
+ import { type SxObject } from './box-sx';
31
+ export type { SxObject, SxValue, ResponsiveValue, Breakpoint } from './box-sx';
32
+ /** @public */
33
+ export interface BoxProps extends React.HTMLAttributes<HTMLElement> {
34
+ /** Element (or component) rendered as the outer wrapper. Defaults to 'div'. */
35
+ as?: React.ElementType;
36
+ /** Token-first `sx` layout engine — see the file-level docstring for the supported subset. */
37
+ sx?: SxObject;
38
+ /** Box content. */
39
+ children?: React.ReactNode;
40
+ }
41
+ /** @public */
42
+ export declare const Box: React.ForwardRefExoticComponent<BoxProps & React.RefAttributes<HTMLDivElement>>;
@@ -4,6 +4,9 @@
4
4
  * @tier pattern
5
5
  */
6
6
  import * as React from 'react';
7
+ declare const crumbLabelVariants: (props?: {
8
+ current?: boolean;
9
+ } & import("class-variance-authority/dist/types").ClassProp) => string;
7
10
  /** @public */
8
11
  export interface BreadcrumbItem {
9
12
  /** Visible label for the crumb. */
@@ -24,3 +27,5 @@ export interface BreadcrumbProps extends Omit<React.HTMLAttributes<HTMLElement>,
24
27
  * is marked aria-current="page".
25
28
  */
26
29
  export declare const Breadcrumb: React.ForwardRefExoticComponent<BreadcrumbProps & React.RefAttributes<HTMLElement>>;
30
+ /** @internal — CVA variant helper; compose via Breadcrumb instead. */
31
+ export { crumbLabelVariants };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * ButtonGroup — attaches Button children into one segmented control.
3
+ * @category Actions
4
+ * @tier primitive
5
+ */
6
+ import * as React from 'react';
7
+ import { type VariantProps } from 'class-variance-authority';
8
+ declare const buttonGroupVariants: (props?: {
9
+ orientation?: "horizontal" | "vertical";
10
+ } & import("class-variance-authority/dist/types").ClassProp) => string;
11
+ type ButtonGroupVariantProps = VariantProps<typeof buttonGroupVariants>;
12
+ /** @public */
13
+ export interface ButtonGroupProps extends React.HTMLAttributes<HTMLDivElement>, ButtonGroupVariantProps {
14
+ }
15
+ /** Groups Button (or button-like) children into a single attached segment. */
16
+ export declare const ButtonGroup: React.ForwardRefExoticComponent<ButtonGroupProps & React.RefAttributes<HTMLDivElement>>;
17
+ /** @internal — CVA variant helper; compose via ButtonGroup props instead. */
18
+ export { buttonGroupVariants };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Calendar — month calendar / date picker, HDS-skinned over react-day-picker.
3
+ * @category Inputs
4
+ * @tier primitive
5
+ * @public
6
+ *
7
+ * A thin token-skin over react-day-picker's DayPicker (ADR-020). Passes through
8
+ * every DayPicker prop — `mode` ('single' | 'range' | 'multiple'), `selected`,
9
+ * `onSelect`, `disabled`, `month`, min/max, locale — and applies the HDS role
10
+ * tokens via `classNames` so the grid matches the rest of the system. Correct
11
+ * grid ARIA and keyboard navigation come from the underlying library.
12
+ *
13
+ * <Calendar mode="single" selected={date} onSelect={setDate} />
14
+ */
15
+ import * as React from 'react';
16
+ import { DayPicker } from 'react-day-picker';
17
+ /** @public */
18
+ export type CalendarProps = React.ComponentProps<typeof DayPicker>;
19
+ /** Renders an accessible month grid; compose it inside a Popover for the date inputs. */
20
+ export declare function Calendar({ className, classNames, showOutsideDays, ...props }: CalendarProps): import("react/jsx-runtime").JSX.Element;
@@ -6,7 +6,7 @@
6
6
  * Slot anatomy (DESIGN.md §"Card Anatomy"). Status, progress, and metadata are
7
7
  * layout-bearing — they live in slots, never inline next to prose.
8
8
  *
9
- * <Card tone="accent">
9
+ * <Card variant="accent">
10
10
  * <Card.Header metadata={<Badge tone="warning">in-progress</Badge>}>
11
11
  * <Card.Title>Discovery phase</Card.Title>
12
12
  * <Card.Description>Stakeholder interviews and audit prep.</Card.Description>
@@ -28,9 +28,12 @@
28
28
  * thin colored bars. Group sections via separate <Card.Body> blocks.
29
29
  * - Footer: actions, secondary metadata, timestamps.
30
30
  *
31
- * Tone prop: 'default' (neutral border) | 'accent' (border-accent + raised bg)
32
- * for highlighted variants like "recommended package", or feedback tones for
33
- * status-driven cards. Tone replaces hand-rolled `pkgHighlight`-style overrides.
31
+ * `variant`: 'default' (borderless) | 'accent' (2px accent border) — the
32
+ * structural axis, for highlighted entries like "recommended package".
33
+ * `tone`: neutral | danger | success | warning | info — the fixed feedback
34
+ * axis (#60 variant contract), for status-driven cards where the border IS
35
+ * the signal. `variant`/`tone` together replace hand-rolled
36
+ * `pkgHighlight`-style overrides.
34
37
  *
35
38
  * Legacy props (padding / gap / noPadding / as / style) are retained.
36
39
  * Existing callers that pass raw children continue to work; new callers
@@ -44,7 +47,15 @@ import * as React from 'react';
44
47
  import hds from '../design-system/tokens';
45
48
  import { type PaddingOption } from './surface-padding';
46
49
  type GapOption = 'tight' | 'normal' | 'inset' | 'spacious' | keyof typeof hds.space;
47
- type CardTone = 'default' | 'accent' | 'success' | 'warning' | 'danger';
50
+ /** @public */
51
+ export type CardVariant = 'default' | 'accent';
52
+ /** @public */
53
+ export type CardTone = 'neutral' | 'danger' | 'success' | 'warning' | 'info';
54
+ declare const cardVariants: (props?: {
55
+ variant?: "default" | "accent";
56
+ tone?: "success" | "danger" | "warning" | "info" | "neutral";
57
+ bordered?: boolean;
58
+ } & import("class-variance-authority/dist/types").ClassProp) => string;
48
59
  /** @public */
49
60
  export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
50
61
  /** Render-as element for the root wrapper. */
@@ -55,13 +66,15 @@ export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
55
66
  gap?: GapOption;
56
67
  /** Legacy convenience flag that removes inner padding. */
57
68
  noPadding?: boolean;
58
- /** Visual tone — controls border color/weight. Default is BORDERLESS;
59
- * `accent` for highlighted entries (e.g. recommended package);
60
- * semantic tones for status-driven cards (border IS the signal).
61
- * For a neutral-bordered card without semantic meaning, pass
62
- * `bordered` instead of overloading tone. */
69
+ /** Structural treatment — `default` (borderless) or `accent` (2px accent
70
+ * border) for highlighted entries (e.g. recommended package). For a
71
+ * neutral-bordered card without semantic meaning, pass `bordered`
72
+ * instead of `accent`. */
73
+ variant?: CardVariant;
74
+ /** Feedback tone — border IS the signal for status-driven cards. Defaults
75
+ * to `neutral` (no feedback border; falls back to `variant`/`bordered`). */
63
76
  tone?: CardTone;
64
- /** Opt in to a neutral 1px border on the default tone. Use for genuinely
77
+ /** Opt in to a neutral 1px border on the default variant. Use for genuinely
65
78
  * discrete standalone records in sparse layouts where containment helps
66
79
  * legibility. Default false — repeated cards in grids should stay
67
80
  * borderless and rely on whitespace, rails, or section dividers. */
@@ -99,8 +112,9 @@ interface CardProgressProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
99
112
  /** Optional caption rendered beneath the bar. Reserved baseline so it
100
113
  * never crowds the slot above. Accepts strings or react nodes. */
101
114
  label?: React.ReactNode;
102
- /** Visual tone for the fill. Defaults to accent. Use feedback tones to
103
- * signal status without a separate badge (e.g. red bar for over-budget). */
115
+ /** Visual tone for the fill. Defaults to `neutral` (accent-blue fill). Use
116
+ * feedback tones to signal status without a separate badge (e.g. red bar
117
+ * for over-budget). */
104
118
  tone?: CardTone;
105
119
  }
106
120
  declare const CardProgress: React.ForwardRefExoticComponent<CardProgressProps & React.RefAttributes<HTMLDivElement>>;
@@ -117,3 +131,5 @@ interface CardMetricProps extends React.HTMLAttributes<HTMLDivElement> {
117
131
  declare const CardMetric: React.ForwardRefExoticComponent<CardMetricProps & React.RefAttributes<HTMLDivElement>>;
118
132
  export declare const Card: CardComponent;
119
133
  export { CardHeader, CardTitle, CardDescription, CardBody, CardFooter, CardProgress, CardMetric };
134
+ /** @internal — CVA variant helper; compose via Card props instead. */
135
+ export { cardVariants };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Carousel — a horizontally-scrollable, scroll-snap track of slides with
3
+ * Prev/Next affordances, implemented natively on top of CSS scroll-snap.
4
+ * @category Display
5
+ * @tier pattern
6
+ * @public
7
+ */
8
+ import * as React from 'react';
9
+ declare const carouselControlVariants: (props?: {
10
+ variant?: "next" | "prev";
11
+ } & import("class-variance-authority/dist/types").ClassProp) => string;
12
+ /** @public */
13
+ export interface CarouselProps extends React.HTMLAttributes<HTMLDivElement> {
14
+ /** Slides rendered inside the scroll-snap track. */
15
+ children: React.ReactNode;
16
+ /** Accessible name for the carousel region. Defaults to 'Carousel'. */
17
+ ariaLabel?: string;
18
+ /** Show the Prev/Next scroll affordance buttons. Defaults to true. */
19
+ showControls?: boolean;
20
+ }
21
+ /** Renders children as a snap-scrolling track with Prev/Next scroll buttons. */
22
+ export declare const Carousel: React.ForwardRefExoticComponent<CarouselProps & React.RefAttributes<HTMLElement>>;
23
+ /** @internal — CVA variant helper; compose via Carousel instead. */
24
+ export { carouselControlVariants };
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Center — max-width column, auto-centered horizontally.
3
+ * @category Layout
4
+ * @tier primitive
5
+ * @ai-intent Solves the "centered prose/content column" problem — a
6
+ * max-width box with auto horizontal margins and, optionally, matching
7
+ * horizontal gutters — so agents stop hand-rolling `marginInline: auto` plus
8
+ * an ad hoc max-width value.
9
+ * @ai-rules Reach for this named layout intent before Box/sx. maxWidth MUST
10
+ * use the semantic width scale ('content' | 'max'), never a raw px value.
11
+ * gutter, when set, MUST use a semantic space step, never raw px. Do NOT use
12
+ * Center for full-bleed page shells — use Container. Do NOT use Center when
13
+ * you need the deprecated Container padding prop — gutter replaces it.
14
+ *
15
+ * Every Layout reference: https://every-layout.dev/layouts/center/
16
+ */
17
+ import React from 'react';
18
+ type CenterMaxWidth = 'content' | 'max';
19
+ type LayoutGap = 'tight' | 'normal' | 'inset' | 'spacious';
20
+ interface CenterProps {
21
+ /** Center content. */
22
+ children: React.ReactNode;
23
+ /** Max width: 'content' (760px prose) | 'max' (1200px full layouts). Defaults to 'content'. */
24
+ maxWidth?: CenterMaxWidth;
25
+ /** Optional matching horizontal gutter (padding-inline) from the semantic space scale. */
26
+ gutter?: LayoutGap;
27
+ /** Escape hatch: only use when tokenized props cannot express the required wrapper class. */
28
+ className?: string;
29
+ /** Escape hatch: only use for narrow layout adjustments that do not belong in the primitive API. */
30
+ style?: React.CSSProperties;
31
+ /** Element rendered as the outer wrapper. Defaults to 'div'. */
32
+ as?: React.ElementType;
33
+ }
34
+ /** @public */
35
+ export declare const Center: React.ForwardRefExoticComponent<CenterProps & React.RefAttributes<HTMLDivElement>>;
36
+ export {};
@@ -0,0 +1,28 @@
1
+ /**
2
+ * CircularProgress — an SVG ring showing determinate or indeterminate progress.
3
+ * @category Feedback
4
+ * @tier primitive
5
+ */
6
+ import * as React from 'react';
7
+ import { type VariantProps } from 'class-variance-authority';
8
+ declare const circularProgressVariants: (props?: {
9
+ tone?: "success" | "danger" | "warning" | "info" | "neutral";
10
+ } & import("class-variance-authority/dist/types").ClassProp) => string;
11
+ type CircularProgressVariantProps = VariantProps<typeof circularProgressVariants>;
12
+ /** @public */
13
+ export interface CircularProgressProps extends React.HTMLAttributes<HTMLSpanElement>, CircularProgressVariantProps {
14
+ /** Current value. Ignored (and the ring animates) when `indeterminate`. */
15
+ value?: number;
16
+ /** Upper bound for `value`. Defaults to 100. */
17
+ max?: number;
18
+ /** Ring diameter preset. Defaults to `md`. */
19
+ size?: 'sm' | 'md' | 'lg';
20
+ /** Show a continuous spinner instead of a measured arc. */
21
+ indeterminate?: boolean;
22
+ /** Accessible name for the progress indicator. */
23
+ label?: string;
24
+ }
25
+ /** A circular progress ring; pass `value`/`max` or set `indeterminate`. */
26
+ export declare const CircularProgress: React.ForwardRefExoticComponent<CircularProgressProps & React.RefAttributes<HTMLSpanElement>>;
27
+ /** @internal — CVA variant helper; compose via CircularProgress props instead. */
28
+ export { circularProgressVariants };