@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.
- package/CONSUMING.md +9 -6
- package/DESIGN.md +7 -5
- package/README.md +14 -11
- package/codemods/hds-prefix.mjs +231 -0
- package/codemods/jsx-fold.mjs +515 -0
- package/codemods/not-found-pattern.mjs +71 -0
- package/codemods/patterns-subpath.mjs +242 -81
- package/codemods/patterns-subpath.names.json +41 -15
- package/codemods/removed-0.20.json +194 -0
- package/codemods/tile-grid.mjs +283 -0
- package/codemods/unrewritable.mjs +291 -0
- package/dist/chunks/DemoStateContext-Cz5TmrYu.js +32 -0
- package/dist/chunks/empty-state-BBqhCx0S.js +1217 -0
- package/dist/contexts.js +157 -78
- package/dist/hirobius-ui.js +1517 -5270
- package/dist/manifest.js +12 -13
- package/dist/patterns.js +780 -513
- package/dist/styles.css +1 -1
- package/dist/tokens.css +1 -1
- package/dist/tokens.js +29 -8
- package/dist/types/src/app/components/avatar-group.d.ts +1 -2
- package/dist/types/src/app/components/badge.d.ts +8 -3
- package/dist/types/src/app/components/blockquote.d.ts +1 -2
- package/dist/types/src/app/components/box-sx.d.ts +110 -13
- package/dist/types/src/app/components/box.d.ts +6 -3
- package/dist/types/src/app/components/breadcrumb.d.ts +0 -5
- package/dist/types/src/app/components/button.d.ts +33 -4
- package/dist/types/src/app/components/card.d.ts +7 -8
- package/dist/types/src/app/components/combobox.d.ts +47 -11
- package/dist/types/src/app/components/container.d.ts +2 -2
- package/dist/types/src/app/components/data-table-section.d.ts +1 -1
- package/dist/types/src/app/components/dialog.d.ts +7 -1
- package/dist/types/src/app/components/disclosure.d.ts +1 -5
- package/dist/types/src/app/components/field.d.ts +1 -2
- package/dist/types/src/app/components/grid.d.ts +10 -6
- package/dist/types/src/app/components/hds-tooltip.d.ts +12 -2
- package/dist/types/src/app/components/inline-code.d.ts +1 -2
- package/dist/types/src/app/components/input.d.ts +8 -5
- package/dist/types/src/app/components/kbd.d.ts +1 -2
- package/dist/types/src/app/components/metadata-list.d.ts +1 -2
- package/dist/types/src/app/components/page-header.d.ts +0 -2
- package/dist/types/src/app/components/popover.d.ts +8 -0
- package/dist/types/src/app/components/progress.d.ts +33 -6
- package/dist/types/src/app/components/segmented-control.d.ts +2 -26
- package/dist/types/src/app/components/select.d.ts +10 -1
- package/dist/types/src/app/components/skeleton.d.ts +2 -3
- package/dist/types/src/app/components/spinner.d.ts +1 -2
- package/dist/types/src/app/components/stack.d.ts +4 -1
- package/dist/types/src/app/components/stat.d.ts +1 -2
- package/dist/types/src/app/components/status-dot.d.ts +18 -4
- package/dist/types/src/app/components/status-list-item.d.ts +1 -2
- package/dist/types/src/app/components/surface.d.ts +2 -3
- package/dist/types/src/app/components/switcher.d.ts +1 -1
- package/dist/types/src/app/components/table.d.ts +1 -15
- package/dist/types/src/app/components/tag.d.ts +0 -6
- package/dist/types/src/app/components/text.d.ts +1 -2
- package/dist/types/src/app/components/textarea.d.ts +1 -2
- package/dist/types/src/app/components/toast.d.ts +1 -2
- package/dist/types/src/app/components/tooltip.d.ts +1 -1
- package/dist/types/src/app/context/DemoStateContext.d.ts +1 -1
- package/dist/types/src/app/context/RouterContext.d.ts +5 -5
- package/dist/types/src/app/data/manifest-types.d.ts +6 -5
- package/dist/types/src/app/design-system/generated-token-refs.d.ts +8 -0
- package/dist/types/src/app/design-system/generated-token-values.d.ts +1 -0
- package/dist/types/src/app/design-system/tokens.d.ts +22 -3
- package/dist/types/src/icons.d.ts +1 -1
- package/dist/types/src/index.d.ts +33 -124
- package/dist/types/src/patterns.d.ts +20 -25
- package/dist/variables.css +6 -0
- package/docs/CONSUMING.md +21 -13
- package/hirobius.tokens.json +48 -15
- package/llms.txt +19 -20
- package/package.json +17 -22
- package/public/hds-manifest.json +2405 -6537
- package/public/llms/components.txt +41 -423
- package/public/llms/layout.txt +4 -4
- package/public/llms-full.txt +67 -448
- package/public/llms.txt +19 -20
- package/src/app/data/component-api.json +1379 -3271
- package/dist/chunks/LanguageContext-BxdCwiFg.js +0 -95
- package/dist/chunks/TokenDisplayContext-DKYJMVWk.js +0 -26
- package/dist/chunks/activity-feed-BGQ6v3wc.js +0 -22040
- package/dist/types/src/app/components/activity-feed.d.ts +0 -73
- package/dist/types/src/app/components/app-shell.d.ts +0 -40
- package/dist/types/src/app/components/aspect-ratio.d.ts +0 -25
- package/dist/types/src/app/components/bleed.d.ts +0 -39
- package/dist/types/src/app/components/button-group.d.ts +0 -22
- package/dist/types/src/app/components/calendar.d.ts +0 -22
- package/dist/types/src/app/components/carousel.d.ts +0 -26
- package/dist/types/src/app/components/center.d.ts +0 -36
- package/dist/types/src/app/components/cinematic-link.d.ts +0 -18
- package/dist/types/src/app/components/circular-progress.d.ts +0 -28
- package/dist/types/src/app/components/cluster.d.ts +0 -39
- package/dist/types/src/app/components/command-palette.d.ts +0 -46
- package/dist/types/src/app/components/component-instance-matrix.d.ts +0 -27
- package/dist/types/src/app/components/context-menu.d.ts +0 -78
- package/dist/types/src/app/components/cover.d.ts +0 -43
- package/dist/types/src/app/components/date-input.d.ts +0 -31
- package/dist/types/src/app/components/date-range-input.d.ts +0 -34
- package/dist/types/src/app/components/date-time-input.d.ts +0 -30
- package/dist/types/src/app/components/doc-link-card.d.ts +0 -32
- package/dist/types/src/app/components/error-boundary.d.ts +0 -25
- package/dist/types/src/app/components/file-input.d.ts +0 -30
- package/dist/types/src/app/components/foundation-swatch.d.ts +0 -45
- package/dist/types/src/app/components/frame.d.ts +0 -38
- package/dist/types/src/app/components/heading-stack.d.ts +0 -52
- package/dist/types/src/app/components/history-card.d.ts +0 -12
- package/dist/types/src/app/components/hover-card.d.ts +0 -46
- package/dist/types/src/app/components/icon-button.d.ts +0 -22
- package/dist/types/src/app/components/image-lightbox.d.ts +0 -14
- package/dist/types/src/app/components/input-group.d.ts +0 -23
- package/dist/types/src/app/components/multi-selector.d.ts +0 -40
- package/dist/types/src/app/components/nav-group.d.ts +0 -29
- package/dist/types/src/app/components/nav-item.d.ts +0 -33
- package/dist/types/src/app/components/not-found-pattern.d.ts +0 -1
- package/dist/types/src/app/components/overflow-list.d.ts +0 -21
- package/dist/types/src/app/components/selectable-card.d.ts +0 -29
- package/dist/types/src/app/components/side-nav.d.ts +0 -23
- package/dist/types/src/app/components/sketch.d.ts +0 -19
- package/dist/types/src/app/components/stacked-card-rail.d.ts +0 -32
- package/dist/types/src/app/components/stepper-field.d.ts +0 -12
- package/dist/types/src/app/components/stepper.d.ts +0 -33
- package/dist/types/src/app/components/text-lockup.d.ts +0 -38
- package/dist/types/src/app/components/tile-grid.d.ts +0 -17
- package/dist/types/src/app/components/time-input.d.ts +0 -24
- package/dist/types/src/app/components/toggle-button.d.ts +0 -32
- package/dist/types/src/app/components/token.d.ts +0 -90
- package/dist/types/src/app/components/tokenUtils.d.ts +0 -38
- package/dist/types/src/app/components/tokenizer.d.ts +0 -24
- package/dist/types/src/app/components/toolbar.d.ts +0 -36
- package/dist/types/src/app/components/top-nav.d.ts +0 -23
- package/dist/types/src/app/components/tree-list.d.ts +0 -30
- package/dist/types/src/app/data/nav-model.d.ts +0 -39
- package/dist/types/src/app/hooks/useFocusVisible.d.ts +0 -9
- package/dist/types/src/app/layouts/CaseStudyLayout.d.ts +0 -20
- package/dist/types/src/app/layouts/DocLayout.d.ts +0 -14
- package/dist/types/src/app/layouts/EmbeddedDocLayoutContext.d.ts +0 -6
- package/dist/types/src/app/layouts/HdsDocsShell.d.ts +0 -72
- package/dist/types/src/app/layouts/HdsSystemDocLayout.d.ts +0 -14
- package/dist/types/src/app/lib/hds-search.d.ts +0 -45
- package/dist/types/src/app/lib/nav-active.d.ts +0 -16
- 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
|
|
3
|
-
import { useState as
|
|
4
|
-
import { F as
|
|
5
|
-
|
|
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
|
|
18
|
+
function S() {
|
|
20
19
|
try {
|
|
21
|
-
const t = localStorage.getItem(
|
|
22
|
-
if (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
|
|
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
|
|
32
|
-
return t === "dark" ? !0 : t === "light" ? !1 :
|
|
30
|
+
function v(t) {
|
|
31
|
+
return t === "dark" ? !0 : t === "light" ? !1 : _();
|
|
33
32
|
}
|
|
34
|
-
function
|
|
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
|
|
43
|
-
const [
|
|
44
|
-
const
|
|
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(
|
|
45
|
+
localStorage.setItem(R, s);
|
|
47
46
|
} catch {
|
|
48
47
|
}
|
|
49
|
-
document.documentElement.setAttribute("data-theme",
|
|
48
|
+
document.documentElement.setAttribute("data-theme", s), document.documentElement.classList.toggle("dark", n);
|
|
50
49
|
}, []);
|
|
51
|
-
|
|
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]),
|
|
58
|
-
|
|
59
|
-
}, [
|
|
60
|
-
if (
|
|
61
|
-
const
|
|
62
|
-
|
|
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
|
|
65
|
-
|
|
63
|
+
return n.addEventListener("change", s), () => {
|
|
64
|
+
n.removeEventListener("change", s);
|
|
66
65
|
};
|
|
67
|
-
}, [
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
|
|
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(
|
|
71
|
+
localStorage.setItem(D, s);
|
|
73
72
|
} catch {
|
|
74
73
|
}
|
|
75
|
-
}, [
|
|
76
|
-
|
|
74
|
+
}, [o]), I = a((n) => {
|
|
75
|
+
r(n), d(v(n));
|
|
77
76
|
try {
|
|
78
|
-
localStorage.setItem(
|
|
77
|
+
localStorage.setItem(D, n);
|
|
79
78
|
} catch {
|
|
80
79
|
}
|
|
81
|
-
}, []),
|
|
82
|
-
() =>
|
|
80
|
+
}, []), x = a(
|
|
81
|
+
() => g((n) => n === "comfortable" ? "compact" : "comfortable"),
|
|
83
82
|
[]
|
|
84
|
-
),
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
|
|
83
|
+
), L = a((n) => g(n), []);
|
|
84
|
+
return /* @__PURE__ */ m(
|
|
85
|
+
b.Provider,
|
|
87
86
|
{
|
|
88
|
-
value: { isDark:
|
|
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
|
|
94
|
-
return
|
|
92
|
+
function N() {
|
|
93
|
+
return h(b);
|
|
95
94
|
}
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
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
|
|
101
|
-
|
|
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
|
-
|
|
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:
|
|
165
|
+
slug: e = null
|
|
106
166
|
}) {
|
|
107
|
-
return
|
|
108
|
-
if (
|
|
109
|
-
return
|
|
110
|
-
}, [
|
|
111
|
-
}
|
|
112
|
-
function
|
|
113
|
-
return
|
|
114
|
-
}
|
|
115
|
-
function
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
return
|
|
119
|
-
|
|
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
|
|
124
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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
|
};
|