@hirobius/design-system 0.11.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.
Files changed (92) hide show
  1. package/README.md +11 -1
  2. package/dist/brand.js +36 -0
  3. package/dist/contexts.js +63 -59
  4. package/dist/hirobius-ui.js +22626 -3818
  5. package/dist/manifest.js +9 -9
  6. package/dist/scroll.js +42 -0
  7. package/dist/styles.css +1 -1
  8. package/dist/tokens.css +1 -1
  9. package/dist/tokens.js +14 -1
  10. package/dist/types/src/app/components/activity-feed.d.ts +24 -2
  11. package/dist/types/src/app/components/alert-dialog.d.ts +56 -0
  12. package/dist/types/src/app/components/app-shell.d.ts +38 -0
  13. package/dist/types/src/app/components/aspect-ratio.d.ts +25 -0
  14. package/dist/types/src/app/components/avatar-group.d.ts +22 -0
  15. package/dist/types/src/app/components/bleed.d.ts +39 -0
  16. package/dist/types/src/app/components/blockquote.d.ts +20 -0
  17. package/dist/types/src/app/components/box-sx.d.ts +69 -0
  18. package/dist/types/src/app/components/box.d.ts +42 -0
  19. package/dist/types/src/app/components/breadcrumb.d.ts +5 -0
  20. package/dist/types/src/app/components/button-group.d.ts +18 -0
  21. package/dist/types/src/app/components/calendar.d.ts +20 -0
  22. package/dist/types/src/app/components/card.d.ts +29 -13
  23. package/dist/types/src/app/components/carousel.d.ts +24 -0
  24. package/dist/types/src/app/components/center.d.ts +36 -0
  25. package/dist/types/src/app/components/circular-progress.d.ts +28 -0
  26. package/dist/types/src/app/components/cluster.d.ts +39 -0
  27. package/dist/types/src/app/components/code-block.d.ts +19 -1
  28. package/dist/types/src/app/components/command-palette.d.ts +44 -0
  29. package/dist/types/src/app/components/container.d.ts +10 -0
  30. package/dist/types/src/app/components/context-menu.d.ts +55 -0
  31. package/dist/types/src/app/components/cover.d.ts +43 -0
  32. package/dist/types/src/app/components/date-input.d.ts +31 -0
  33. package/dist/types/src/app/components/date-range-input.d.ts +34 -0
  34. package/dist/types/src/app/components/date-time-input.d.ts +30 -0
  35. package/dist/types/src/app/components/disclosure.d.ts +5 -1
  36. package/dist/types/src/app/components/divider.d.ts +14 -10
  37. package/dist/types/src/app/components/doc-link-card.d.ts +5 -1
  38. package/dist/types/src/app/components/field.d.ts +9 -11
  39. package/dist/types/src/app/components/file-input.d.ts +28 -0
  40. package/dist/types/src/app/components/frame.d.ts +38 -0
  41. package/dist/types/src/app/components/heading-stack.d.ts +15 -5
  42. package/dist/types/src/app/components/hover-card.d.ts +31 -0
  43. package/dist/types/src/app/components/image-lightbox.d.ts +13 -0
  44. package/dist/types/src/app/components/inline-code.d.ts +14 -3
  45. package/dist/types/src/app/components/input-group.d.ts +23 -0
  46. package/dist/types/src/app/components/kbd.d.ts +18 -0
  47. package/dist/types/src/app/components/metadata-list.d.ts +43 -0
  48. package/dist/types/src/app/components/multi-selector.d.ts +40 -0
  49. package/dist/types/src/app/components/nav-group.d.ts +7 -2
  50. package/dist/types/src/app/components/nav-item.d.ts +12 -2
  51. package/dist/types/src/app/components/overflow-list.d.ts +19 -0
  52. package/dist/types/src/app/components/pin.d.ts +30 -0
  53. package/dist/types/src/app/components/reveal.d.ts +31 -0
  54. package/dist/types/src/app/components/segmented-control.d.ts +37 -3
  55. package/dist/types/src/app/components/selectable-card.d.ts +29 -0
  56. package/dist/types/src/app/components/side-nav.d.ts +21 -0
  57. package/dist/types/src/app/components/sidebar.d.ts +45 -0
  58. package/dist/types/src/app/components/stat.d.ts +8 -10
  59. package/dist/types/src/app/components/status-dot.d.ts +25 -0
  60. package/dist/types/src/app/components/status-list-item.d.ts +10 -11
  61. package/dist/types/src/app/components/stepper.d.ts +31 -0
  62. package/dist/types/src/app/components/switcher.d.ts +41 -0
  63. package/dist/types/src/app/components/table.d.ts +12 -1
  64. package/dist/types/src/app/components/tag.d.ts +19 -18
  65. package/dist/types/src/app/components/text.d.ts +8 -2
  66. package/dist/types/src/app/components/time-input.d.ts +24 -0
  67. package/dist/types/src/app/components/timestamp.d.ts +24 -0
  68. package/dist/types/src/app/components/toast.d.ts +8 -2
  69. package/dist/types/src/app/components/toggle-button.d.ts +32 -0
  70. package/dist/types/src/app/components/token.d.ts +26 -1
  71. package/dist/types/src/app/components/tokenizer.d.ts +24 -0
  72. package/dist/types/src/app/components/toolbar.d.ts +36 -0
  73. package/dist/types/src/app/components/top-nav.d.ts +21 -0
  74. package/dist/types/src/app/components/tree-list.d.ts +28 -0
  75. package/dist/types/src/app/components/visually-hidden.d.ts +17 -0
  76. package/dist/types/src/app/context/TenantContext.d.ts +1 -1
  77. package/dist/types/src/app/data/nav-model.d.ts +39 -0
  78. package/dist/types/src/app/design-system/generated-token-refs.d.ts +13 -0
  79. package/dist/types/src/app/design-system/generated-token-values.d.ts +14 -1
  80. package/dist/types/src/app/{pages/hds → layouts}/HdsSystemDocLayout.d.ts +1 -1
  81. package/dist/types/src/app/lib/hds-search.d.ts +45 -0
  82. package/dist/types/src/brand/index.d.ts +9 -0
  83. package/dist/types/src/brand/overlay.d.ts +71 -0
  84. package/dist/types/src/index.d.ts +92 -2
  85. package/dist/types/src/scroll/index.d.ts +16 -0
  86. package/dist/types/src/scroll/smooth-scroll.d.ts +48 -0
  87. package/dist/types/src/scroll/use-scroll-progress.d.ts +34 -0
  88. package/dist/variables.css +16 -5
  89. package/hirobius.tokens.json +57 -10
  90. package/package.json +35 -66
  91. package/public/hds-manifest.json +6082 -4854
  92. package/dist/types/src/app/components/info-page.d.ts +0 -10
package/README.md CHANGED
@@ -6,7 +6,17 @@ A publishable React + TypeScript component library, backed by a governed design-
6
6
 
7
7
  Installing HDS in another project? It ships to the **public npm registry** as
8
8
  `@hirobius/design-system` (ESM) — no `.npmrc`, no token, no registry config. Full
9
- guide: **[docs/CONSUMING.md](docs/CONSUMING.md)**. The short version:
9
+ guide: **[docs/CONSUMING.md](docs/CONSUMING.md)**.
10
+
11
+ > **Not on GitHub Packages.** This repo's **Packages** sidebar still shows an old
12
+ > `@hirobius/design-system` entry under GitHub Packages
13
+ > (`/pkgs/npm/design-system`). That listing is **frozen and no longer updated** —
14
+ > publishing moved to the public npm registry in
15
+ > [#39](https://github.com/hirobius/hirobius-design-system/pull/39). Always
16
+ > install from npm:
17
+ > **[npmjs.com/package/@hirobius/design-system](https://www.npmjs.com/package/@hirobius/design-system)**.
18
+
19
+ The short version:
10
20
 
11
21
  ```bash
12
22
  npm install @hirobius/design-system react react-dom
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 l, Fragment as A } from "react/jsx-runtime";
2
- import { useState as i, useCallback as a, useEffect as s, useContext as T, createContext as v } from "react";
3
- import { F as U, H as z, L as K, T as Y, b as j, u as q, a as B, c as J } from "./chunks/TokenDisplayContext-B3gxyQN7.js";
4
- const I = ["system", "light", "dark"], m = "hds-theme-mode", w = "hds-theme", S = v({
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 y() {
17
+ function T() {
18
18
  try {
19
19
  const t = localStorage.getItem(m);
20
- if (t && I.includes(t)) return t;
20
+ if (t && L.includes(t)) return t;
21
21
  } catch {
22
22
  }
23
23
  return "system";
24
24
  }
25
- function M() {
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 : M();
30
+ return t === "dark" ? !0 : t === "light" ? !1 : P();
31
31
  }
32
- function L() {
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 C({ children: t }) {
41
- const [n, f] = i(y), [r, u] = i(() => E(y())), [c, g] = i(L), h = a((e) => {
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(w, o);
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
- s(() => {
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]), s(() => {
56
- h(r);
57
- }, [r, h]), s(() => {
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
- u(e.matches);
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 _ = a(() => {
66
+ const A = s(() => {
67
67
  const e = !r, o = e ? "dark" : "light";
68
- f(o), u(e);
68
+ g(o), i(e);
69
69
  try {
70
70
  localStorage.setItem(m, o);
71
71
  } catch {
72
72
  }
73
- }, [r]), k = a((e) => {
74
- f(e), u(E(e));
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
- }, []), b = a(
80
- () => g((e) => e === "comfortable" ? "compact" : "comfortable"),
79
+ }, []), I = s(
80
+ () => h((e) => e === "comfortable" ? "compact" : "comfortable"),
81
81
  []
82
- ), p = a((e) => g(e), []);
83
- return /* @__PURE__ */ l(
84
- S.Provider,
82
+ ), w = s((e) => h(e), []);
83
+ return /* @__PURE__ */ f(
84
+ _.Provider,
85
85
  {
86
- value: { isDark: r, toggleDark: _, mode: n, setMode: k, density: c, toggleDensity: b, setDensity: p },
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 N() {
92
- return T(S);
91
+ function G() {
92
+ return S(_);
93
93
  }
94
- const d = {}, D = v({ tenantSlug: null });
95
- function F({ children: t }) {
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 s(() => {
103
+ return a(() => {
98
104
  if (n)
99
- return document.documentElement.setAttribute("data-tenant", n), () => {
100
- document.documentElement.removeAttribute("data-tenant");
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 G() {
105
- return T(D);
108
+ function B() {
109
+ return S(v);
106
110
  }
107
- function O(t) {
108
- s(() => {
109
- const n = document.documentElement.getAttribute("data-tenant");
110
- return document.documentElement.setAttribute("data-tenant", t), () => {
111
- n !== null ? document.documentElement.setAttribute("data-tenant", n) : document.documentElement.removeAttribute("data-tenant");
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 H({ children: t }) {
116
- return /* @__PURE__ */ l(A, { children: t });
119
+ function V({ children: t }) {
120
+ return /* @__PURE__ */ f(M, { children: t });
117
121
  }
118
122
  export {
119
- H as FontProvider,
120
- U as FreezeState,
121
- z as HdsRouterProvider,
122
- K as LanguageProvider,
123
- F as TenantProvider,
124
- C as ThemeProvider,
125
- Y as TokenDisplayProvider,
126
- j as useFrozenState,
127
- q as useHdsRouter,
128
- B as useLanguage,
129
- G as useTenant,
130
- O as useTenantOnDocument,
131
- N as useTheme,
132
- J as useTokenDisplay
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
  };