@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,54 @@
|
|
|
1
|
+
# Hirobius Design System - layout slice
|
|
2
|
+
|
|
3
|
+
See `public/llms.txt` for the index. Generated from the same sections as llms.txt.
|
|
4
|
+
|
|
5
|
+
## How To Lay Out A Screen
|
|
6
|
+
|
|
7
|
+
Canonical skeleton, outermost to innermost:
|
|
8
|
+
|
|
9
|
+
1. `Page` (or `Container`/`Center` for a full-bleed, non-page surface) for the outermost width constraint. Never import `Container` directly inside `src/app/pages/**` — use `Page`, which wraps it and owns vertical rhythm.
|
|
10
|
+
2. `Stack` (vertical rhythm between sections) or `Grid` (two-dimensional/column layout) for the structural skeleton. One section = one Section/Stack — never add a second wrapper to fake a section boundary.
|
|
11
|
+
3. Reach for a named every-layout primitive before hand-rolling flex/grid math for a common intent: `Cluster` (wrapping row of same-ish things), `Center` (centered max-width column with optional gutter), `Sidebar` (fixed-width rail + fluid content, no media query), `Switcher` (row that flips to a column below a threshold, no media query), `Cover` (full-height shell with a centered main region), `Frame` (aspect-ratio-locked clipped media box), `Bleed` (controlled negative margin to escape a parent padding).
|
|
12
|
+
4. `Surface` for any background-bearing, padded wrapper (card, panel, inset). Never a raw element with backgroundColor + padding hand-rolled inline.
|
|
13
|
+
5. Use the screen patterns (`@hirobius/design-system/patterns`) for the parts every screen repeats: `PageHeader` once at the top (breadcrumb, `heading2` title, status, actions), `MetricTiles` for any row of headline numbers, `FormActions` for a form footer (primary right-most and last in DOM order, destructive on the far left), `DataTableSection` for a titled table (toolbar slot, consumer row actions, empty state, scrolls on narrow widths without a caller `minWidth`), and `DestructiveSection` last for an irreversible action (danger button, then an `AlertDialog` confirm). Pick between `MetricTiles`, `Stat`, `Card.Metric` and `StatusTile`, and between `Card` and `Surface`, with the "Which one, when" table in `DESIGN.md`.
|
|
14
|
+
6. `Box` `sx` LAST — only for genuinely one-off layout that no named primitive covers. `sx` spacing/color keys MUST be HDS token keys, never raw hex/px.
|
|
15
|
+
|
|
16
|
+
Negative rules (apply everywhere, checked by `scripts/audit-tokens.mjs --full`, `check-hardcoded-spacing.mjs`, `check-hardcoded-colors.mjs`):
|
|
17
|
+
|
|
18
|
+
- No inline margins on children to fake spacing between siblings — gap/spacing on the parent (Stack/Grid/Cluster/Switcher/Sidebar/Cover) owns rhythm, not margin on the child.
|
|
19
|
+
- No raw px or hex values in any layout or color prop — every spacing value comes from the semantic gap scale (`tight | normal | inset | spacious`, or a component/subgrid step) and every color comes from a `semantic.color.*` token.
|
|
20
|
+
- No repeated outlined cards as the default structure for roadmap/status/process/overview UI — use open bands, dividers, rails, disclosures, and whitespace instead.
|
|
21
|
+
|
|
22
|
+
Density: put `data-density="compact"` on the same `[data-hds]` scope element (or `<html>`) to tighten `semantic.space.scale.*`, surface padding and region gutter; `Table` follows it unless given a `density` prop.
|
|
23
|
+
|
|
24
|
+
Reference: `docs/architecture/variant-contract.md` for structural/semantic/size/density variance; `src/app/data/component-api.json` for every layout primitive's full prop table and `@ai-rules` guidance.
|
|
25
|
+
|
|
26
|
+
## HDS Card Anatomy (mandatory — every property is non-negotiable)
|
|
27
|
+
|
|
28
|
+
When building any card component or card-like surface, ALL of the following rules apply. There is no creative latitude here — deviation from any property is a bug.
|
|
29
|
+
|
|
30
|
+
| Property | Required value | Forbidden |
|
|
31
|
+
| --- | --- | --- |
|
|
32
|
+
| Background | `var(--semantic-color-surface-raised)` | Custom colors, gradients, tinted fills, any non-token value |
|
|
33
|
+
| Border | `1px solid var(--semantic-color-border-default)` | `box-shadow` as an elevation substitute |
|
|
34
|
+
| Border radius | `rounded-lg` (`role.radius` + 4 px: 12 px by default, follows the tenant) | `var(--component-card-radius)`, `rounded-full`, or any hard-coded value |
|
|
35
|
+
| Padding | `var(--semantic-space-surface-padding)` or `<Surface padding="component">` | Raw pixel values, Tailwind spacing classes, ad hoc insets |
|
|
36
|
+
| Shadow | Resting cards: none (`elevation.flat`). Interactive lifted state: `shadow.subtle` via `elevation.raised`. Never reach for shadow values directly — bind via `var(--semantic-elevation-{role}-shadow)` | Raw `box-shadow` values, `drop-shadow`, glow, or any depth effect not bound to a role token |
|
|
37
|
+
| Title | `hds.typeStyles.heading3` / `<Text variant="heading3">` | Any other type style for the primary card heading |
|
|
38
|
+
| Subtitle / meta | `hds.typeStyles.caption` / `<Text variant="caption">` + `var(--semantic-color-content-secondary)` | Primary color, body size, or custom color for secondary text |
|
|
39
|
+
| Hover (interactive cards only) | `transform: scale(1.02)` CSS transform | Background color change, fill swap, border color shift on hover |
|
|
40
|
+
|
|
41
|
+
**NEVER on any card surface:** gradient backgrounds, glow effects, frosted glass (`backdrop-filter: blur`), decorative overlays, gradient borders, colored or tinted card backgrounds, inner shadows, patterned backgrounds, AI-aesthetic shimmer or particle effects. Never reach for shadow values directly — bind to a `semantic.elevation.*` role bundle so surface + shadow + border stay coherent.
|
|
42
|
+
|
|
43
|
+
## Elevation roles
|
|
44
|
+
|
|
45
|
+
| Surface | Role token | Background | Shadow | Border |
|
|
46
|
+
| --- | --- | --- | --- | --- |
|
|
47
|
+
| Card / panel resting | `semantic.elevation.flat` | `surface.page` | none | `border.subtle` 1px |
|
|
48
|
+
| Card / panel lifted (interactive only) | `semantic.elevation.raised` | `surface.raised` | `shadow.subtle` | none |
|
|
49
|
+
| Popover / dropdown / tooltip | `semantic.elevation.floating` | `surface.raised` | `shadow.floating` | none |
|
|
50
|
+
| Dialog / sheet / modal | `semantic.elevation.overlay` | `surface.overlay` | `shadow.overlay` | none |
|
|
51
|
+
|
|
52
|
+
Cards default to `elevation.flat`. Popovers/tooltips/dropdowns use `elevation.floating`. Dialogs/sheets use `elevation.overlay`. Interactive cards lift to `elevation.raised` on hover. Never combine `raised` with a border — depth is one mechanism (border OR shadow), not both stacked.
|
|
53
|
+
|
|
54
|
+
Overlays (Dialog, AlertDialog, Menu, ContextMenu, Popover, Select, HoverCard, Tooltip) portal into the nearest `data-hds` scope, so they inherit its theme (for example `<div data-hds data-theme="dark">`); pass `container` on the Content part to override.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Hirobius Design System - scroll slice
|
|
2
|
+
|
|
3
|
+
See `public/llms.txt` for the index. Generated from the same sections as llms.txt.
|
|
4
|
+
|
|
5
|
+
## How To Build A Scroll-Driven Section
|
|
6
|
+
|
|
7
|
+
Canonical primitives, cheapest-first (CSS before JS, JS before an opt-in dependency):
|
|
8
|
+
|
|
9
|
+
1. `Reveal` (CSS `animation-timeline: view()`) for fade/slide/scale-in-on-enter — zero JS, zero deps. Pick `animation` from `fade | fade-up | fade-down | scale`. Content is visible by DEFAULT; the effect applies only where `animation-timeline` is supported and the user has not requested reduced motion — never gate visibility behind either.
|
|
10
|
+
2. `Pin` (`position: sticky`) for a pinned scroll scene — the dependency-free basis for the "tall section + sticky child" pattern (GSAP's `pin: true`, done with zero JS). Give the pinned element a TALLER scrolling parent (e.g. `height: 300vh`) so it has room to travel; `top` is a CSS length offset, not a spacing token.
|
|
11
|
+
3. `useScrollProgress` (from `@hirobius/design-system/scroll`) only when the 0→1 scroll value is needed in React — cross-element choreography, canvas/WebGL, or a Motion (`motion/react`) `useTransform` binding that CSS `animation-timeline` cannot express. Thin, SSR-guarded wrapper over Motion `useScroll`; adds no new dependency.
|
|
12
|
+
4. `SmoothScroll` (from `@hirobius/design-system/scroll`, `lenis` as an OPTIONAL peer dep) only for opt-in momentum ("inertia") scrolling, mounted once at the app/site root. Never imported from the main barrel — consumers who skip it pay nothing. Reduced-motion-first: Lenis is not instantiated when the user prefers reduced motion, unless `ignoreReducedMotion` is set for a deliberate art-directed exception.
|
|
13
|
+
5. Do not adopt GSAP/ScrollTrigger, and do not wire Lenis directly outside `SmoothScroll`, inside the core library — the CSS + Motion stack above covers reveal/pin/scrub without new dependencies. Bespoke GSAP/Lenis/WebGL scenes stay app-level/downstream (marketing sites, the clients factory), composed from these primitives (ADR-021, #116).
|
|
14
|
+
|
|
15
|
+
Negative rules:
|
|
16
|
+
|
|
17
|
+
- No hand-rolled IntersectionObserver reveal-on-scroll logic — use `Reveal`.
|
|
18
|
+
- No hand-rolled `position: sticky` scroll scenes — use `Pin`.
|
|
19
|
+
- No GSAP/ScrollTrigger or bespoke Lenis wiring inside `@hirobius/design-system` — those stay app-level/downstream, composed from `Reveal`/`Pin`/`useScrollProgress`/`SmoothScroll`.
|
|
20
|
+
- Every scroll effect must degrade to fully visible/static content — never gate content visibility behind `animation-timeline` support or a scroll listener with no fallback.
|
|
21
|
+
|
|
22
|
+
Reference: `src/app/components/reveal.tsx`, `src/app/components/pin.tsx`, `src/scroll/` (`use-scroll-progress.ts`, `smooth-scroll.tsx`), ADR-021, and `src/stories/patterns-scroll.stories.tsx` for golden-path examples.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Hirobius Design System - tokens slice
|
|
2
|
+
|
|
3
|
+
See `public/llms.txt` for the index. Generated from the same sections as llms.txt.
|
|
4
|
+
|
|
5
|
+
## Tokens (Primary Source Of Truth)
|
|
6
|
+
|
|
7
|
+
- Primary token source of truth: `hirobius.tokens.json` (W3C DTCG).
|
|
8
|
+
- Prefer `semantic.*` and `component.*` tokens for product UI. Use `primitive.*` only when editing the token system itself.
|
|
9
|
+
- CSS variable naming convention: token path `semantic.color.surface.page` maps to `var(--semantic-color-surface-page)`.
|
|
10
|
+
|
|
11
|
+
## Quick Token Reference
|
|
12
|
+
|
|
13
|
+
| Need | Token path examples | CSS var examples |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| Page/background surfaces | `semantic.color.surface.page`, `semantic.color.surface.raised` | `--semantic-color-surface-page`, `--semantic-color-surface-raised` |
|
|
16
|
+
| Text/content colors | `semantic.color.content.primary`, `semantic.color.content.secondary` | `--semantic-color-content-primary`, `--semantic-color-content-secondary` |
|
|
17
|
+
| Borders/dividers | `semantic.color.border.default`, `semantic.color.border.interactive` | `--semantic-color-border-default`, `--semantic-color-border-interactive` |
|
|
18
|
+
| Feedback states | `semantic.color.feedback.error`, `semantic.color.feedback.success` | `--semantic-color-feedback-error`, `--semantic-color-feedback-success` |
|
|
19
|
+
| Spacing (semantic tiers) | `semantic.space.scale.xs`, `semantic.space.surface.padding`, `semantic.space.region.gutter` | use semantic tokens or `--hds-space-px12` style vars |
|
|
20
|
+
| Radius | `semantic.radius.action` | `--semantic-radius-action` |
|
|
21
|
+
| Motion | `semantic.motion.productive`, `semantic.motion.expressive`, `semantic.motion.exit` | use token refs; values are structured (duration/easing) |
|
|
22
|
+
| Typography | `semantic.typography.body`, `semantic.typography.h2`, `semantic.typography.caption` | use token refs; values are structured (family/size/weight/etc) |
|
|
23
|
+
|
|
24
|
+
## Token Rules
|
|
25
|
+
|
|
26
|
+
- Component inventory: read `public/hds-manifest.json`. Do not duplicate inventories in markdown.
|
|
27
|
+
- Component prop API: read `src/app/data/component-api.json`. Do not inline prop tables in `llms.txt`.
|
|
28
|
+
- Token source of truth: read `hirobius.tokens.json` (W3C DTCG). Prefer `semantic.*` and `component.*` tokens over `primitive.*` for product UI.
|
|
29
|
+
- CSS variables: token path `semantic.color.surface.page` maps to `var(--semantic-color-surface-page)` (see generated token refs).
|
|
30
|
+
- Docs: use `DESIGN.md` as the default lean visual spec. Load `DESIGN-HANDOFF.md` only on-demand.
|
|
31
|
+
- Load `TOKEN_GOVERNANCE.md` and `SYSTEMS_REGISTRY.md` only on-demand (when explicitly requested or required by the task).
|
|
32
|
+
- Read `public/llms.txt` before touching code so AI workflows start from the same system map as humans.
|