@hirobius/design-system 0.19.1 → 0.20.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 (142) hide show
  1. package/CONSUMING.md +9 -6
  2. package/DESIGN.md +7 -5
  3. package/README.md +14 -11
  4. package/codemods/hds-prefix.mjs +231 -0
  5. package/codemods/jsx-fold.mjs +515 -0
  6. package/codemods/not-found-pattern.mjs +71 -0
  7. package/codemods/patterns-subpath.mjs +242 -81
  8. package/codemods/patterns-subpath.names.json +41 -15
  9. package/codemods/removed-0.20.json +194 -0
  10. package/codemods/tile-grid.mjs +283 -0
  11. package/codemods/unrewritable.mjs +291 -0
  12. package/dist/chunks/DemoStateContext-Cz5TmrYu.js +32 -0
  13. package/dist/chunks/empty-state-BBqhCx0S.js +1217 -0
  14. package/dist/contexts.js +157 -78
  15. package/dist/hirobius-ui.js +1517 -5270
  16. package/dist/manifest.js +12 -13
  17. package/dist/patterns.js +780 -513
  18. package/dist/styles.css +1 -1
  19. package/dist/tokens.css +1 -1
  20. package/dist/tokens.js +29 -8
  21. package/dist/types/src/app/components/avatar-group.d.ts +1 -2
  22. package/dist/types/src/app/components/badge.d.ts +8 -3
  23. package/dist/types/src/app/components/blockquote.d.ts +1 -2
  24. package/dist/types/src/app/components/box-sx.d.ts +110 -13
  25. package/dist/types/src/app/components/box.d.ts +6 -3
  26. package/dist/types/src/app/components/breadcrumb.d.ts +0 -5
  27. package/dist/types/src/app/components/button.d.ts +33 -4
  28. package/dist/types/src/app/components/card.d.ts +7 -8
  29. package/dist/types/src/app/components/combobox.d.ts +47 -11
  30. package/dist/types/src/app/components/container.d.ts +2 -2
  31. package/dist/types/src/app/components/data-table-section.d.ts +1 -1
  32. package/dist/types/src/app/components/dialog.d.ts +7 -1
  33. package/dist/types/src/app/components/disclosure.d.ts +1 -5
  34. package/dist/types/src/app/components/field.d.ts +1 -2
  35. package/dist/types/src/app/components/grid.d.ts +10 -6
  36. package/dist/types/src/app/components/hds-tooltip.d.ts +12 -2
  37. package/dist/types/src/app/components/inline-code.d.ts +1 -2
  38. package/dist/types/src/app/components/input.d.ts +8 -5
  39. package/dist/types/src/app/components/kbd.d.ts +1 -2
  40. package/dist/types/src/app/components/metadata-list.d.ts +1 -2
  41. package/dist/types/src/app/components/page-header.d.ts +0 -2
  42. package/dist/types/src/app/components/popover.d.ts +8 -0
  43. package/dist/types/src/app/components/progress.d.ts +33 -6
  44. package/dist/types/src/app/components/segmented-control.d.ts +2 -26
  45. package/dist/types/src/app/components/select.d.ts +10 -1
  46. package/dist/types/src/app/components/skeleton.d.ts +2 -3
  47. package/dist/types/src/app/components/spinner.d.ts +1 -2
  48. package/dist/types/src/app/components/stack.d.ts +4 -1
  49. package/dist/types/src/app/components/stat.d.ts +1 -2
  50. package/dist/types/src/app/components/status-dot.d.ts +18 -4
  51. package/dist/types/src/app/components/status-list-item.d.ts +1 -2
  52. package/dist/types/src/app/components/surface.d.ts +2 -3
  53. package/dist/types/src/app/components/switcher.d.ts +1 -1
  54. package/dist/types/src/app/components/table.d.ts +1 -15
  55. package/dist/types/src/app/components/tag.d.ts +0 -6
  56. package/dist/types/src/app/components/text.d.ts +1 -2
  57. package/dist/types/src/app/components/textarea.d.ts +1 -2
  58. package/dist/types/src/app/components/toast.d.ts +1 -2
  59. package/dist/types/src/app/components/tooltip.d.ts +1 -1
  60. package/dist/types/src/app/context/DemoStateContext.d.ts +1 -1
  61. package/dist/types/src/app/context/RouterContext.d.ts +5 -5
  62. package/dist/types/src/app/data/manifest-types.d.ts +6 -5
  63. package/dist/types/src/app/design-system/generated-token-refs.d.ts +8 -0
  64. package/dist/types/src/app/design-system/generated-token-values.d.ts +1 -0
  65. package/dist/types/src/app/design-system/tokens.d.ts +22 -3
  66. package/dist/types/src/icons.d.ts +1 -1
  67. package/dist/types/src/index.d.ts +33 -124
  68. package/dist/types/src/patterns.d.ts +20 -25
  69. package/dist/variables.css +6 -0
  70. package/docs/CONSUMING.md +21 -13
  71. package/hirobius.tokens.json +48 -15
  72. package/llms.txt +19 -20
  73. package/package.json +17 -22
  74. package/public/hds-manifest.json +2405 -6537
  75. package/public/llms/components.txt +41 -423
  76. package/public/llms/layout.txt +4 -4
  77. package/public/llms-full.txt +67 -448
  78. package/public/llms.txt +19 -20
  79. package/src/app/data/component-api.json +1379 -3271
  80. package/dist/chunks/LanguageContext-BxdCwiFg.js +0 -95
  81. package/dist/chunks/TokenDisplayContext-DKYJMVWk.js +0 -26
  82. package/dist/chunks/activity-feed-BGQ6v3wc.js +0 -22040
  83. package/dist/types/src/app/components/activity-feed.d.ts +0 -73
  84. package/dist/types/src/app/components/app-shell.d.ts +0 -40
  85. package/dist/types/src/app/components/aspect-ratio.d.ts +0 -25
  86. package/dist/types/src/app/components/bleed.d.ts +0 -39
  87. package/dist/types/src/app/components/button-group.d.ts +0 -22
  88. package/dist/types/src/app/components/calendar.d.ts +0 -22
  89. package/dist/types/src/app/components/carousel.d.ts +0 -26
  90. package/dist/types/src/app/components/center.d.ts +0 -36
  91. package/dist/types/src/app/components/cinematic-link.d.ts +0 -18
  92. package/dist/types/src/app/components/circular-progress.d.ts +0 -28
  93. package/dist/types/src/app/components/cluster.d.ts +0 -39
  94. package/dist/types/src/app/components/command-palette.d.ts +0 -46
  95. package/dist/types/src/app/components/component-instance-matrix.d.ts +0 -27
  96. package/dist/types/src/app/components/context-menu.d.ts +0 -78
  97. package/dist/types/src/app/components/cover.d.ts +0 -43
  98. package/dist/types/src/app/components/date-input.d.ts +0 -31
  99. package/dist/types/src/app/components/date-range-input.d.ts +0 -34
  100. package/dist/types/src/app/components/date-time-input.d.ts +0 -30
  101. package/dist/types/src/app/components/doc-link-card.d.ts +0 -32
  102. package/dist/types/src/app/components/error-boundary.d.ts +0 -25
  103. package/dist/types/src/app/components/file-input.d.ts +0 -30
  104. package/dist/types/src/app/components/foundation-swatch.d.ts +0 -45
  105. package/dist/types/src/app/components/frame.d.ts +0 -38
  106. package/dist/types/src/app/components/heading-stack.d.ts +0 -52
  107. package/dist/types/src/app/components/history-card.d.ts +0 -12
  108. package/dist/types/src/app/components/hover-card.d.ts +0 -46
  109. package/dist/types/src/app/components/icon-button.d.ts +0 -22
  110. package/dist/types/src/app/components/image-lightbox.d.ts +0 -14
  111. package/dist/types/src/app/components/input-group.d.ts +0 -23
  112. package/dist/types/src/app/components/multi-selector.d.ts +0 -40
  113. package/dist/types/src/app/components/nav-group.d.ts +0 -29
  114. package/dist/types/src/app/components/nav-item.d.ts +0 -33
  115. package/dist/types/src/app/components/not-found-pattern.d.ts +0 -1
  116. package/dist/types/src/app/components/overflow-list.d.ts +0 -21
  117. package/dist/types/src/app/components/selectable-card.d.ts +0 -29
  118. package/dist/types/src/app/components/side-nav.d.ts +0 -23
  119. package/dist/types/src/app/components/sketch.d.ts +0 -19
  120. package/dist/types/src/app/components/stacked-card-rail.d.ts +0 -32
  121. package/dist/types/src/app/components/stepper-field.d.ts +0 -12
  122. package/dist/types/src/app/components/stepper.d.ts +0 -33
  123. package/dist/types/src/app/components/text-lockup.d.ts +0 -38
  124. package/dist/types/src/app/components/tile-grid.d.ts +0 -17
  125. package/dist/types/src/app/components/time-input.d.ts +0 -24
  126. package/dist/types/src/app/components/toggle-button.d.ts +0 -32
  127. package/dist/types/src/app/components/token.d.ts +0 -90
  128. package/dist/types/src/app/components/tokenUtils.d.ts +0 -38
  129. package/dist/types/src/app/components/tokenizer.d.ts +0 -24
  130. package/dist/types/src/app/components/toolbar.d.ts +0 -36
  131. package/dist/types/src/app/components/top-nav.d.ts +0 -23
  132. package/dist/types/src/app/components/tree-list.d.ts +0 -30
  133. package/dist/types/src/app/data/nav-model.d.ts +0 -39
  134. package/dist/types/src/app/hooks/useFocusVisible.d.ts +0 -9
  135. package/dist/types/src/app/layouts/CaseStudyLayout.d.ts +0 -20
  136. package/dist/types/src/app/layouts/DocLayout.d.ts +0 -14
  137. package/dist/types/src/app/layouts/EmbeddedDocLayoutContext.d.ts +0 -6
  138. package/dist/types/src/app/layouts/HdsDocsShell.d.ts +0 -72
  139. package/dist/types/src/app/layouts/HdsSystemDocLayout.d.ts +0 -14
  140. package/dist/types/src/app/lib/hds-search.d.ts +0 -45
  141. package/dist/types/src/app/lib/nav-active.d.ts +0 -16
  142. package/dist/types/src/app/lib/navLevels.d.ts +0 -4
package/dist/contexts.js CHANGED
@@ -1,9 +1,8 @@
1
1
  'use client';
2
- import { jsx as l, Fragment as x } from "react/jsx-runtime";
3
- import { useState as i, useCallback as a, useEffect as s, useContext as E, createContext as S } from "react";
4
- import { F as j, H as q, L as N, u as V, a as J, b as Q } from "./chunks/LanguageContext-BxdCwiFg.js";
5
- import { T as W, u as X } from "./chunks/TokenDisplayContext-DKYJMVWk.js";
6
- const I = ["system", "light", "dark"], d = "hds-theme-mode", P = "hds-theme", T = /* @__PURE__ */ S({
2
+ import { jsx as m, Fragment as P } from "react/jsx-runtime";
3
+ import { useState as l, useCallback as a, useEffect as u, useContext as h, createContext as y } from "react";
4
+ import { F as X, H as Z, u as $, a as tt } from "./chunks/DemoStateContext-Cz5TmrYu.js";
5
+ const M = ["system", "light", "dark"], D = "hds-theme-mode", R = "hds-theme", b = /* @__PURE__ */ y({
7
6
  isDark: !0,
8
7
  toggleDark: () => {
9
8
  },
@@ -16,22 +15,22 @@ const I = ["system", "light", "dark"], d = "hds-theme-mode", P = "hds-theme", T
16
15
  setDensity: () => {
17
16
  }
18
17
  });
19
- function y() {
18
+ function S() {
20
19
  try {
21
- const t = localStorage.getItem(d);
22
- if (t && I.includes(t)) return t;
20
+ const t = localStorage.getItem(D);
21
+ if (t && M.includes(t)) return t;
23
22
  } catch {
24
23
  }
25
24
  return "system";
26
25
  }
27
- function L() {
26
+ function _() {
28
27
  var t;
29
28
  return typeof window > "u" ? !1 : !!((t = window.matchMedia) != null && t.call(window, "(prefers-color-scheme: dark)").matches);
30
29
  }
31
- function D(t) {
32
- return t === "dark" ? !0 : t === "light" ? !1 : L();
30
+ function v(t) {
31
+ return t === "dark" ? !0 : t === "light" ? !1 : _();
33
32
  }
34
- function C() {
33
+ function O() {
35
34
  try {
36
35
  const t = localStorage.getItem("hds-density");
37
36
  if (t === "compact" || t === "comfortable") return t;
@@ -39,103 +38,183 @@ function C() {
39
38
  }
40
39
  return "comfortable";
41
40
  }
42
- function F({ children: t }) {
43
- const [n, f] = i(y), [r, u] = i(() => D(y())), [c, h] = i(C), g = a((e) => {
44
- const o = e ? "dark" : "light";
41
+ function H({ children: t }) {
42
+ const [e, r] = l(S), [o, d] = l(() => v(S())), [c, g] = l(O), f = a((n) => {
43
+ const s = n ? "dark" : "light";
45
44
  try {
46
- localStorage.setItem(P, o);
45
+ localStorage.setItem(R, s);
47
46
  } catch {
48
47
  }
49
- document.documentElement.setAttribute("data-theme", o), document.documentElement.classList.toggle("dark", e);
48
+ document.documentElement.setAttribute("data-theme", s), document.documentElement.classList.toggle("dark", n);
50
49
  }, []);
51
- s(() => {
50
+ u(() => {
52
51
  try {
53
52
  localStorage.setItem("hds-density", c);
54
53
  } catch {
55
54
  }
56
55
  document.documentElement.setAttribute("data-density", c);
57
- }, [c]), s(() => {
58
- g(r);
59
- }, [r, g]), s(() => {
60
- if (n !== "system" || typeof window > "u" || !window.matchMedia) return;
61
- const e = window.matchMedia("(prefers-color-scheme: dark)"), o = () => {
62
- u(e.matches);
56
+ }, [c]), u(() => {
57
+ f(o);
58
+ }, [o, f]), u(() => {
59
+ if (e !== "system" || typeof window > "u" || !window.matchMedia) return;
60
+ const n = window.matchMedia("(prefers-color-scheme: dark)"), s = () => {
61
+ d(n.matches);
63
62
  };
64
- return e.addEventListener("change", o), () => {
65
- e.removeEventListener("change", o);
63
+ return n.addEventListener("change", s), () => {
64
+ n.removeEventListener("change", s);
66
65
  };
67
- }, [n]);
68
- const b = a(() => {
69
- const e = !r, o = e ? "dark" : "light";
70
- f(o), u(e);
66
+ }, [e]);
67
+ const i = a(() => {
68
+ const n = !o, s = n ? "dark" : "light";
69
+ r(s), d(n);
71
70
  try {
72
- localStorage.setItem(d, o);
71
+ localStorage.setItem(D, s);
73
72
  } catch {
74
73
  }
75
- }, [r]), A = a((e) => {
76
- f(e), u(D(e));
74
+ }, [o]), I = a((n) => {
75
+ r(n), d(v(n));
77
76
  try {
78
- localStorage.setItem(d, e);
77
+ localStorage.setItem(D, n);
79
78
  } catch {
80
79
  }
81
- }, []), w = a(
82
- () => h((e) => e === "comfortable" ? "compact" : "comfortable"),
80
+ }, []), x = a(
81
+ () => g((n) => n === "comfortable" ? "compact" : "comfortable"),
83
82
  []
84
- ), M = a((e) => h(e), []);
85
- return /* @__PURE__ */ l(
86
- T.Provider,
83
+ ), L = a((n) => g(n), []);
84
+ return /* @__PURE__ */ m(
85
+ b.Provider,
87
86
  {
88
- value: { isDark: r, toggleDark: b, mode: n, setMode: A, density: c, toggleDensity: w, setDensity: M },
87
+ value: { isDark: o, toggleDark: i, mode: e, setMode: I, density: c, toggleDensity: x, setDensity: L },
89
88
  children: t
90
89
  }
91
90
  );
92
91
  }
93
- function O() {
94
- return E(T);
92
+ function N() {
93
+ return h(b);
95
94
  }
96
- const k = /* @__PURE__ */ S({ tenantSlug: null }), p = ["data-brand", "data-tenant"];
97
- function m(t) {
98
- for (const n of p) document.documentElement.setAttribute(n, t);
95
+ const p = {
96
+ en: {
97
+ language: "en",
98
+ dir: "ltr",
99
+ label: "English",
100
+ nativeLabel: "English"
101
+ }
102
+ }, A = /* @__PURE__ */ y({
103
+ language: "en",
104
+ direction: "ltr",
105
+ isRtl: !1,
106
+ setLanguage: () => {
107
+ },
108
+ setDirection: () => {
109
+ },
110
+ toggleDirection: () => {
111
+ },
112
+ options: p
113
+ });
114
+ function F() {
115
+ try {
116
+ const t = localStorage.getItem("hds-direction");
117
+ if (t === "ltr" || t === "rtl") return t;
118
+ } catch {
119
+ }
120
+ return "ltr";
99
121
  }
100
- function v() {
101
- for (const t of p) document.documentElement.removeAttribute(t);
122
+ function z({ children: t }) {
123
+ const [e, r] = l(F), o = "en", d = e === "rtl";
124
+ u(() => {
125
+ try {
126
+ localStorage.setItem("hds-direction", e);
127
+ } catch {
128
+ }
129
+ document.documentElement.setAttribute("lang", "en"), document.documentElement.setAttribute("data-language", "en"), document.documentElement.setAttribute("dir", e), document.documentElement.setAttribute("data-reading-direction", e);
130
+ }, [e]);
131
+ const c = a((i) => {
132
+ }, []), g = a((i) => {
133
+ r(i);
134
+ }, []), f = a(() => {
135
+ r((i) => i === "ltr" ? "rtl" : "ltr");
136
+ }, []);
137
+ return /* @__PURE__ */ m(
138
+ A.Provider,
139
+ {
140
+ value: {
141
+ language: o,
142
+ direction: e,
143
+ isRtl: d,
144
+ setLanguage: c,
145
+ setDirection: g,
146
+ toggleDirection: f,
147
+ options: p
148
+ },
149
+ children: t
150
+ }
151
+ );
152
+ }
153
+ function K() {
154
+ return h(A);
102
155
  }
103
- function B({
156
+ const T = /* @__PURE__ */ y({ tenantSlug: null }), k = ["data-brand", "data-tenant"];
157
+ function E(t) {
158
+ for (const e of k) document.documentElement.setAttribute(e, t);
159
+ }
160
+ function w() {
161
+ for (const t of k) document.documentElement.removeAttribute(t);
162
+ }
163
+ function Y({
104
164
  children: t,
105
- slug: n = null
165
+ slug: e = null
106
166
  }) {
107
- return s(() => {
108
- if (n)
109
- return m(n), () => v();
110
- }, [n]), /* @__PURE__ */ l(k.Provider, { value: { tenantSlug: n }, children: t });
111
- }
112
- function H() {
113
- return E(k);
114
- }
115
- function z(t) {
116
- s(() => {
117
- const n = document.documentElement.getAttribute("data-brand");
118
- return m(t), () => {
119
- n !== null ? m(n) : v();
167
+ return u(() => {
168
+ if (e)
169
+ return E(e), () => w();
170
+ }, [e]), /* @__PURE__ */ m(T.Provider, { value: { tenantSlug: e }, children: t });
171
+ }
172
+ function j() {
173
+ return h(T);
174
+ }
175
+ function q(t) {
176
+ u(() => {
177
+ const e = document.documentElement.getAttribute("data-brand");
178
+ return E(t), () => {
179
+ e !== null ? E(e) : w();
120
180
  };
121
181
  }, [t]);
122
182
  }
123
- function G({ children: t }) {
124
- return /* @__PURE__ */ l(x, { children: t });
183
+ function U({ children: t }) {
184
+ return /* @__PURE__ */ m(P, { children: t });
185
+ }
186
+ const C = /* @__PURE__ */ y(
187
+ void 0
188
+ );
189
+ function V({ children: t }) {
190
+ const [e, r] = l(!1);
191
+ return /* @__PURE__ */ m(
192
+ C.Provider,
193
+ {
194
+ value: { showCss: e, setShowCss: r, toggleCss: () => r((o) => !o) },
195
+ children: t
196
+ }
197
+ );
198
+ }
199
+ function J() {
200
+ const t = h(C);
201
+ return t || { showCss: !1, setShowCss: () => {
202
+ }, toggleCss: () => {
203
+ } };
125
204
  }
126
205
  export {
127
- G as FontProvider,
128
- j as FreezeState,
129
- q as HdsRouterProvider,
130
- N as LanguageProvider,
131
- B as TenantProvider,
132
- F as ThemeProvider,
133
- W as TokenDisplayProvider,
134
- V as useFrozenState,
135
- J as useHdsRouter,
136
- Q as useLanguage,
137
- H as useTenant,
138
- z as useTenantOnDocument,
139
- O as useTheme,
140
- X as useTokenDisplay
206
+ U as FontProvider,
207
+ X as FreezeState,
208
+ Z as HdsRouterProvider,
209
+ z as LanguageProvider,
210
+ Y as TenantProvider,
211
+ H as ThemeProvider,
212
+ V as TokenDisplayProvider,
213
+ $ as useFrozenState,
214
+ tt as useHdsRouter,
215
+ K as useLanguage,
216
+ j as useTenant,
217
+ q as useTenantOnDocument,
218
+ N as useTheme,
219
+ J as useTokenDisplay
141
220
  };