@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.
- package/README.md +50 -9
- package/dist/brand.js +36 -0
- package/dist/contexts.js +63 -59
- package/dist/hirobius-ui.js +22636 -3818
- package/dist/manifest.js +9 -9
- package/dist/scroll.js +42 -0
- package/dist/static.css +388 -0
- package/dist/styles.css +1 -1
- package/dist/tokens.css +1 -1
- package/dist/tokens.js +14 -1
- 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/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/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/data/nav-model.d.ts +39 -0
- package/dist/types/src/app/design-system/generated-token-refs.d.ts +13 -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 +92 -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 +16 -5
- package/hirobius.tokens.json +57 -10
- package/package.json +37 -67
- package/public/hds-manifest.json +6167 -4929
- package/dist/types/src/app/components/info-page.d.ts +0 -10
package/README.md
CHANGED
|
@@ -1,12 +1,48 @@
|
|
|
1
1
|
# Hirobius Design System
|
|
2
2
|
|
|
3
|
+
> ## 🧊 FROZEN — on the shelf (2026-07-09)
|
|
4
|
+
>
|
|
5
|
+
> **HDS is a complete, shelved package. Active development is paused.** It is not
|
|
6
|
+
> being ditched — it's a finished, tested body of work kept in git to check out
|
|
7
|
+
> later: 133 components (Radix + `cva`), 351 DTCG tokens, ~110 Storybook stories,
|
|
8
|
+
> a full guardrail suite, and the published `@hirobius/design-system@0.13.0` on npm.
|
|
9
|
+
>
|
|
10
|
+
> **Why:** the design system was absorbing more maintenance (its highest-commit
|
|
11
|
+
> month) than its two consumers justified — the marketing-site factory
|
|
12
|
+
> (`hirobius/clients`) uses only its token spine (no React components), and the
|
|
13
|
+
> only component consumer (the internal `hirobius/ops` dashboard) is dormant.
|
|
14
|
+
>
|
|
15
|
+
> **What "frozen" means:** no new development. `0.13.0` is the **final clean cut**
|
|
16
|
+
> (it folds in the icon fix + the static-primitive CSS layer + the scroll recipe);
|
|
17
|
+
> the release workflow was re-enabled just to ship it and may be re-frozen after.
|
|
18
|
+
> Chromatic stays manual-only. The published package stays installable. All future
|
|
19
|
+
> work is tracked in the wind-down epic **#80**.
|
|
20
|
+
>
|
|
21
|
+
> **To take it off the shelf:** restore the `pull_request`/`push` triggers in
|
|
22
|
+
> `.github/workflows/{chromatic,release}.yml`, resume from `main`, and pick work
|
|
23
|
+
> from #80.
|
|
24
|
+
>
|
|
25
|
+
> **One human step (credential-gated, not automatable):** optionally run `npm
|
|
26
|
+
deprecate "@hirobius/design-system@<=0.12.0" "Frozen — see the repo README"` to
|
|
27
|
+
> flag the package as paused for npm browsers. It does not break installs.
|
|
28
|
+
|
|
3
29
|
A publishable React + TypeScript component library, backed by a governed design-token pipeline, a documentation site, and an automated verification suite — all in one repository.
|
|
4
30
|
|
|
5
31
|
## Using the published package
|
|
6
32
|
|
|
7
33
|
Installing HDS in another project? It ships to the **public npm registry** as
|
|
8
34
|
`@hirobius/design-system` (ESM) — no `.npmrc`, no token, no registry config. Full
|
|
9
|
-
guide: **[docs/CONSUMING.md](docs/CONSUMING.md)**.
|
|
35
|
+
guide: **[docs/CONSUMING.md](docs/CONSUMING.md)**.
|
|
36
|
+
|
|
37
|
+
> **Not on GitHub Packages.** This repo's **Packages** sidebar still shows an old
|
|
38
|
+
> `@hirobius/design-system` entry under GitHub Packages
|
|
39
|
+
> (`/pkgs/npm/design-system`). That listing is **frozen and no longer updated** —
|
|
40
|
+
> publishing moved to the public npm registry in
|
|
41
|
+
> [#39](https://github.com/hirobius/hirobius-design-system/pull/39). Always
|
|
42
|
+
> install from npm:
|
|
43
|
+
> **[npmjs.com/package/@hirobius/design-system](https://www.npmjs.com/package/@hirobius/design-system)**.
|
|
44
|
+
|
|
45
|
+
The short version:
|
|
10
46
|
|
|
11
47
|
```bash
|
|
12
48
|
npm install @hirobius/design-system react react-dom
|
|
@@ -36,17 +72,22 @@ HDS theming is driven by root attributes + CSS variables, so it works with **zer
|
|
|
36
72
|
JavaScript** — set them on any element (React, Astro, plain HTML) and every HDS
|
|
37
73
|
descendant re-skins:
|
|
38
74
|
|
|
39
|
-
| Dial
|
|
40
|
-
|
|
|
41
|
-
| theme
|
|
42
|
-
| density | `data-density`
|
|
43
|
-
| brand
|
|
44
|
-
| font
|
|
75
|
+
| Dial | Attribute / var | Values | Default |
|
|
76
|
+
| ------- | ---------------------------------------------- | --------------- | -------------------- |
|
|
77
|
+
| theme | `data-theme` | `dark` | light (unset) |
|
|
78
|
+
| density | `data-density` | `compact` | comfortable (unset) |
|
|
79
|
+
| brand | `data-brand` (+ `data-tenant` alias) | overlay slug | base (unset) |
|
|
80
|
+
| font | `--hds-font-family` / `--hds-font-family-mono` | any font-family | Satoshi / Geist Mono |
|
|
45
81
|
|
|
46
82
|
```html
|
|
47
83
|
<!-- zero-JS: static markup (e.g. an Astro layout) -->
|
|
48
|
-
<div
|
|
49
|
-
|
|
84
|
+
<div
|
|
85
|
+
data-hds
|
|
86
|
+
data-theme="dark"
|
|
87
|
+
data-density="compact"
|
|
88
|
+
data-brand="acme"
|
|
89
|
+
style="--hds-font-family: 'Inter', sans-serif"
|
|
90
|
+
>
|
|
50
91
|
…
|
|
51
92
|
</div>
|
|
52
93
|
```
|
package/dist/brand.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const l = (c, n) => `color-mix(in srgb, ${c} ${n}%, #000)`, E = (c, n) => `color-mix(in srgb, ${c} ${n}%, #fff)`, C = (c, n, t) => `color-mix(in srgb, ${c} ${t}%, ${n})`;
|
|
2
|
+
function d(c) {
|
|
3
|
+
const { primary: n, onPrimary: t, bg: r, fg: a, muted: f, accent: i, radius: o, fontHeading: s, fontBody: m } = c, e = {
|
|
4
|
+
// ── accent ramp (rest + derived interactive states) ──
|
|
5
|
+
"--semantic-accent-rest": n,
|
|
6
|
+
"--semantic-accent-hover": l(n, 88),
|
|
7
|
+
"--semantic-accent-pressed": l(n, 76),
|
|
8
|
+
"--semantic-accent-subtle": E(n, 12),
|
|
9
|
+
"--semantic-accent-content": n,
|
|
10
|
+
"--semantic-color-surface-accent": n,
|
|
11
|
+
"--semantic-color-surface-accentSubtle": E(n, 12),
|
|
12
|
+
"--semantic-color-border-accent": n,
|
|
13
|
+
"--semantic-color-content-onAccent": t,
|
|
14
|
+
// ── page + content ──
|
|
15
|
+
"--semantic-color-surface-page": r,
|
|
16
|
+
"--semantic-color-surface-raised": f,
|
|
17
|
+
"--semantic-color-content-primary": a,
|
|
18
|
+
"--semantic-color-content-secondary": C(a, r, 66)
|
|
19
|
+
};
|
|
20
|
+
return i && (e["--brand-accent"] = i), o && (e["--semantic-radius-action"] = o, e["--brand-radius"] = o), s && (e["--primitive-typography-family-display"] = s), m && (e["--primitive-typography-family-primary"] = m), e;
|
|
21
|
+
}
|
|
22
|
+
function y(c) {
|
|
23
|
+
return Object.entries(d(c)).map(([n, t]) => `${n}:${t}`).join(";");
|
|
24
|
+
}
|
|
25
|
+
function _(c, n) {
|
|
26
|
+
const t = Object.entries(d(n)).map(([r, a]) => ` ${r}: ${a};`).join(`
|
|
27
|
+
`);
|
|
28
|
+
return `${c} {
|
|
29
|
+
${t}
|
|
30
|
+
}`;
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
_ as brandOverlayCss,
|
|
34
|
+
y as brandOverlayStyle,
|
|
35
|
+
d as brandOverlayVars
|
|
36
|
+
};
|
package/dist/contexts.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { F as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as f, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import { useState as u, useCallback as s, useEffect as a, useContext as S, createContext as D } from "react";
|
|
3
|
+
import { F as K, H as Y, L as j, T as q, b as J, u as Q, a as W, c as X } from "./chunks/TokenDisplayContext-B3gxyQN7.js";
|
|
4
|
+
const L = ["system", "light", "dark"], m = "hds-theme-mode", x = "hds-theme", _ = D({
|
|
5
5
|
isDark: !0,
|
|
6
6
|
toggleDark: () => {
|
|
7
7
|
},
|
|
@@ -14,22 +14,22 @@ const I = ["system", "light", "dark"], m = "hds-theme-mode", w = "hds-theme", S
|
|
|
14
14
|
setDensity: () => {
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
function
|
|
17
|
+
function T() {
|
|
18
18
|
try {
|
|
19
19
|
const t = localStorage.getItem(m);
|
|
20
|
-
if (t &&
|
|
20
|
+
if (t && L.includes(t)) return t;
|
|
21
21
|
} catch {
|
|
22
22
|
}
|
|
23
23
|
return "system";
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function P() {
|
|
26
26
|
var t;
|
|
27
27
|
return typeof window > "u" ? !1 : !!((t = window.matchMedia) != null && t.call(window, "(prefers-color-scheme: dark)").matches);
|
|
28
28
|
}
|
|
29
29
|
function E(t) {
|
|
30
|
-
return t === "dark" ? !0 : t === "light" ? !1 :
|
|
30
|
+
return t === "dark" ? !0 : t === "light" ? !1 : P();
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function N() {
|
|
33
33
|
try {
|
|
34
34
|
const t = localStorage.getItem("hds-density");
|
|
35
35
|
if (t === "compact" || t === "comfortable") return t;
|
|
@@ -37,97 +37,101 @@ function L() {
|
|
|
37
37
|
}
|
|
38
38
|
return "comfortable";
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
const [n,
|
|
40
|
+
function F({ children: t }) {
|
|
41
|
+
const [n, g] = u(T), [r, i] = u(() => E(T())), [c, h] = u(N), y = s((e) => {
|
|
42
42
|
const o = e ? "dark" : "light";
|
|
43
43
|
try {
|
|
44
|
-
localStorage.setItem(
|
|
44
|
+
localStorage.setItem(x, o);
|
|
45
45
|
} catch {
|
|
46
46
|
}
|
|
47
47
|
document.documentElement.setAttribute("data-theme", o), document.documentElement.classList.toggle("dark", e);
|
|
48
48
|
}, []);
|
|
49
|
-
|
|
49
|
+
a(() => {
|
|
50
50
|
try {
|
|
51
51
|
localStorage.setItem("hds-density", c);
|
|
52
52
|
} catch {
|
|
53
53
|
}
|
|
54
54
|
document.documentElement.setAttribute("data-density", c);
|
|
55
|
-
}, [c]),
|
|
56
|
-
|
|
57
|
-
}, [r,
|
|
55
|
+
}, [c]), a(() => {
|
|
56
|
+
y(r);
|
|
57
|
+
}, [r, y]), a(() => {
|
|
58
58
|
if (n !== "system" || typeof window > "u" || !window.matchMedia) return;
|
|
59
59
|
const e = window.matchMedia("(prefers-color-scheme: dark)"), o = () => {
|
|
60
|
-
|
|
60
|
+
i(e.matches);
|
|
61
61
|
};
|
|
62
62
|
return e.addEventListener("change", o), () => {
|
|
63
63
|
e.removeEventListener("change", o);
|
|
64
64
|
};
|
|
65
65
|
}, [n]);
|
|
66
|
-
const
|
|
66
|
+
const A = s(() => {
|
|
67
67
|
const e = !r, o = e ? "dark" : "light";
|
|
68
|
-
|
|
68
|
+
g(o), i(e);
|
|
69
69
|
try {
|
|
70
70
|
localStorage.setItem(m, o);
|
|
71
71
|
} catch {
|
|
72
72
|
}
|
|
73
|
-
}, [r]),
|
|
74
|
-
|
|
73
|
+
}, [r]), b = s((e) => {
|
|
74
|
+
g(e), i(E(e));
|
|
75
75
|
try {
|
|
76
76
|
localStorage.setItem(m, e);
|
|
77
77
|
} catch {
|
|
78
78
|
}
|
|
79
|
-
}, []),
|
|
80
|
-
() =>
|
|
79
|
+
}, []), I = s(
|
|
80
|
+
() => h((e) => e === "comfortable" ? "compact" : "comfortable"),
|
|
81
81
|
[]
|
|
82
|
-
),
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
|
|
82
|
+
), w = s((e) => h(e), []);
|
|
83
|
+
return /* @__PURE__ */ f(
|
|
84
|
+
_.Provider,
|
|
85
85
|
{
|
|
86
|
-
value: { isDark: r, toggleDark:
|
|
86
|
+
value: { isDark: r, toggleDark: A, mode: n, setMode: b, density: c, toggleDensity: I, setDensity: w },
|
|
87
87
|
children: t
|
|
88
88
|
}
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
return
|
|
91
|
+
function G() {
|
|
92
|
+
return S(_);
|
|
93
93
|
}
|
|
94
|
-
const d = {},
|
|
95
|
-
function
|
|
94
|
+
const d = {}, v = D({ tenantSlug: null }), p = ["data-brand", "data-tenant"];
|
|
95
|
+
function l(t) {
|
|
96
|
+
for (const n of p) document.documentElement.setAttribute(n, t);
|
|
97
|
+
}
|
|
98
|
+
function k() {
|
|
99
|
+
for (const t of p) document.documentElement.removeAttribute(t);
|
|
100
|
+
}
|
|
101
|
+
function O({ children: t }) {
|
|
96
102
|
const n = typeof d.VITE_TENANT_SLUG == "string" && d.VITE_TENANT_SLUG.trim().length > 0 ? d.VITE_TENANT_SLUG.trim() : null;
|
|
97
|
-
return
|
|
103
|
+
return a(() => {
|
|
98
104
|
if (n)
|
|
99
|
-
return
|
|
100
|
-
|
|
101
|
-
};
|
|
102
|
-
}, [n]), /* @__PURE__ */ l(D.Provider, { value: { tenantSlug: n }, children: t });
|
|
105
|
+
return l(n), () => k();
|
|
106
|
+
}, [n]), /* @__PURE__ */ f(v.Provider, { value: { tenantSlug: n }, children: t });
|
|
103
107
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
108
|
+
function B() {
|
|
109
|
+
return S(v);
|
|
106
110
|
}
|
|
107
|
-
function
|
|
108
|
-
|
|
109
|
-
const n = document.documentElement.getAttribute("data-
|
|
110
|
-
return
|
|
111
|
-
n !== null ?
|
|
111
|
+
function H(t) {
|
|
112
|
+
a(() => {
|
|
113
|
+
const n = document.documentElement.getAttribute("data-brand");
|
|
114
|
+
return l(t), () => {
|
|
115
|
+
n !== null ? l(n) : k();
|
|
112
116
|
};
|
|
113
117
|
}, [t]);
|
|
114
118
|
}
|
|
115
|
-
function
|
|
116
|
-
return /* @__PURE__ */
|
|
119
|
+
function V({ children: t }) {
|
|
120
|
+
return /* @__PURE__ */ f(M, { children: t });
|
|
117
121
|
}
|
|
118
122
|
export {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
123
|
+
V as FontProvider,
|
|
124
|
+
K as FreezeState,
|
|
125
|
+
Y as HdsRouterProvider,
|
|
126
|
+
j as LanguageProvider,
|
|
127
|
+
O as TenantProvider,
|
|
128
|
+
F as ThemeProvider,
|
|
129
|
+
q as TokenDisplayProvider,
|
|
130
|
+
J as useFrozenState,
|
|
131
|
+
Q as useHdsRouter,
|
|
132
|
+
W as useLanguage,
|
|
133
|
+
B as useTenant,
|
|
134
|
+
H as useTenantOnDocument,
|
|
135
|
+
G as useTheme,
|
|
136
|
+
X as useTokenDisplay
|
|
133
137
|
};
|