@hirobius/design-system 0.19.1 → 0.21.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/AGENTS.md +123 -0
- package/CONSUMING.md +11 -6
- package/DESIGN.md +34 -21
- package/NOTICE.md +1 -1
- package/README.md +48 -13
- 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-DNoThgfV.js +1227 -0
- package/dist/chunks/form-By82qZcC.js +66 -0
- package/dist/contexts.js +157 -78
- package/dist/fonts/geist-mono-400.woff2 +0 -0
- package/dist/fonts/satoshi-400.woff2 +0 -0
- package/dist/fonts/satoshi-500.woff2 +0 -0
- package/dist/fonts/satoshi-700.woff2 +0 -0
- package/dist/fonts.css +53 -0
- package/dist/form.js +1 -1
- package/dist/hirobius-ui.js +1600 -5354
- package/dist/manifest.js +12 -13
- package/dist/patterns.js +796 -510
- package/dist/styles.css +2 -2
- package/dist/tokens.css +1 -1
- package/dist/tokens.js +165 -65
- package/dist/types/src/app/components/alert-dialog.d.ts +5 -0
- package/dist/types/src/app/components/asset-img.d.ts +1 -0
- package/dist/types/src/app/components/avatar-group.d.ts +2 -2
- package/dist/types/src/app/components/badge.d.ts +8 -3
- package/dist/types/src/app/components/blockquote.d.ts +2 -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 +35 -4
- package/dist/types/src/app/components/card.d.ts +10 -10
- 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 +2 -1
- package/dist/types/src/app/components/destructive-section.d.ts +1 -0
- package/dist/types/src/app/components/dialog.d.ts +8 -1
- package/dist/types/src/app/components/disclosure.d.ts +1 -5
- package/dist/types/src/app/components/error-pattern.d.ts +6 -1
- package/dist/types/src/app/components/field.d.ts +1 -2
- package/dist/types/src/app/components/form-actions.d.ts +1 -0
- package/dist/types/src/app/components/form-control.d.ts +10 -0
- package/dist/types/src/app/components/grid.d.ts +15 -6
- package/dist/types/src/app/components/hds-tooltip.d.ts +12 -2
- package/dist/types/src/app/components/icon.d.ts +1 -0
- 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 +2 -2
- package/dist/types/src/app/components/metadata-list.d.ts +2 -2
- package/dist/types/src/app/components/metric-tiles.d.ts +1 -0
- 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 +3 -4
- 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 +5 -5
- package/dist/types/src/app/components/status-list-item.d.ts +1 -2
- package/dist/types/src/app/components/status-tile.d.ts +3 -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 +6 -15
- package/dist/types/src/app/components/tag.d.ts +0 -6
- package/dist/types/src/app/components/text.d.ts +54 -8
- package/dist/types/src/app/components/textarea.d.ts +1 -2
- package/dist/types/src/app/components/timestamp.d.ts +1 -0
- 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 +10 -5
- package/dist/types/src/app/design-system/generated-token-refs.d.ts +45 -28
- package/dist/types/src/app/design-system/generated-token-values.d.ts +4 -0
- package/dist/types/src/app/design-system/tokens.d.ts +139 -18
- package/dist/types/src/icons.d.ts +1 -1
- package/dist/types/src/index.d.ts +76 -164
- package/dist/types/src/patterns.d.ts +20 -25
- package/dist/variables.css +47 -33
- package/docs/CONSUMING.md +80 -48
- package/hirobius.tokens.json +125 -88
- package/llms.txt +166 -59
- package/mcp/catalog.mjs +366 -0
- package/mcp/guide.mjs +315 -0
- package/mcp/hds-mcp.mjs +49 -0
- package/mcp/server.mjs +94 -0
- package/package.json +48 -27
- package/public/hds-manifest.json +2667 -6705
- package/public/llms/components.txt +45 -426
- package/public/llms/layout.txt +5 -5
- package/public/llms-full.txt +245 -506
- package/public/llms.txt +166 -59
- package/scripts/eslint-plugin-hds/index.d.mts +29 -0
- package/scripts/eslint-plugin-hds/index.mjs +55 -0
- package/scripts/eslint-plugin-hds/package.json +30 -0
- package/scripts/eslint-plugin-hds/rules/no-raw-controls.mjs +47 -0
- package/scripts/eslint-plugin-hds/rules/no-raw-hex.mjs +70 -0
- package/scripts/eslint-plugin-hds/rules/no-raw-px-spacing.mjs +125 -0
- package/scripts/eslint-plugin-hds/rules/prefer-hds-layout-primitive.mjs +54 -0
- package/scripts/eslint-plugin-hds/rules/sx-token-first.mjs +111 -0
- package/scripts/eslint-plugin-hds/rules/utils.mjs +66 -0
- package/src/app/data/component-api.json +1082 -2913
- 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/chunks/form-COP3vK9_.js +0 -66
- 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/status-dot.d.ts +0 -25
- 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
|
@@ -1,42 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @hirobius/design-system/patterns
|
|
3
3
|
*
|
|
4
|
-
* The
|
|
5
|
-
* 2026-09-26): composed, higher-level surfaces (
|
|
6
|
-
*
|
|
7
|
-
* toward. Split into their own subpath so a consumer that only needs
|
|
4
|
+
* The `pattern`-tier modules (hds#254 disposition table, ratified
|
|
5
|
+
* 2026-09-26): composed, higher-level surfaces (page shells, forms, code
|
|
6
|
+
* blocks, page sections) as opposed to the `core` primitives the main barrel
|
|
7
|
+
* is trending toward. Split into their own subpath so a consumer that only needs
|
|
8
8
|
* primitives doesn't pull in this tier's weight.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* `
|
|
14
|
-
*
|
|
10
|
+
* This is the only entry that exports them. Until 0.20.0 the package root
|
|
11
|
+
* also re-exported 21 of these modules behind `@deprecated` aliases (hds#254);
|
|
12
|
+
* hds#389 R1 removed those root re-exports, and
|
|
13
|
+
* `npx -p @hirobius/design-system@^0.20.0 hds-patterns-subpath`
|
|
14
|
+
* (codemods/patterns-subpath.mjs) moves consumer imports here.
|
|
15
|
+
*
|
|
16
|
+
* The same release removed 16 of these modules outright (hds#394 wave 4a, no
|
|
17
|
+
* survivor): ActivityFeed, AppShell, Calendar, Carousel, CommandPalette,
|
|
18
|
+
* DocLinkCard, FileInput, Lightbox, NavItem, OverflowList, SideNav,
|
|
19
|
+
* StackedCardRail, Stepper, Toolbar, TopNav and TreeList. The codemod reports
|
|
20
|
+
* an import of any of them for a manual edit (codemods/removed-0.20.json).
|
|
21
|
+
*
|
|
22
|
+
* StatusTile joined this entry in the same release (hds#389 D5, hds#395): the
|
|
23
|
+
* root stopped exporting it, and hds-patterns-subpath moves a root import of
|
|
24
|
+
* StatusTile, StatusTileProps or StatusTileTone here.
|
|
15
25
|
*/
|
|
16
|
-
export * from './app/components/calendar.js';
|
|
17
|
-
export * from './app/components/file-input.js';
|
|
18
26
|
export * from './app/components/form.js';
|
|
19
|
-
export * from './app/components/app-shell.js';
|
|
20
|
-
export * from './app/components/overflow-list.js';
|
|
21
27
|
export * from './app/components/page.js';
|
|
22
|
-
export * from './app/components/activity-feed.js';
|
|
23
28
|
export * from './app/components/asset-img.js';
|
|
24
|
-
export * from './app/components/carousel.js';
|
|
25
29
|
export * from './app/components/code-block.js';
|
|
26
|
-
export * from './app/components/stacked-card-rail.js';
|
|
27
|
-
export * from './app/components/doc-link-card.js';
|
|
28
|
-
export * from './app/components/nav-item.js';
|
|
29
|
-
export * from './app/components/side-nav.js';
|
|
30
|
-
export * from './app/components/stepper.js';
|
|
31
|
-
export * from './app/components/top-nav.js';
|
|
32
|
-
export * from './app/components/tree-list.js';
|
|
33
30
|
export * from './app/components/error-pattern.js';
|
|
34
|
-
export * from './app/components/toolbar.js';
|
|
35
|
-
export * from './app/components/command-palette.js';
|
|
36
|
-
export * from './app/components/image-lightbox.js';
|
|
37
31
|
export * from './app/components/reveal.js';
|
|
38
32
|
export * from './app/components/page-header.js';
|
|
39
33
|
export * from './app/components/metric-tiles.js';
|
|
40
34
|
export * from './app/components/form-actions.js';
|
|
41
35
|
export * from './app/components/destructive-section.js';
|
|
42
36
|
export * from './app/components/data-table-section.js';
|
|
37
|
+
export * from './app/components/status-tile.js';
|
package/dist/variables.css
CHANGED
|
@@ -118,6 +118,7 @@
|
|
|
118
118
|
--primitive-typography-size-4xl: 36px;
|
|
119
119
|
--primitive-typography-size-5xl: 48px;
|
|
120
120
|
--primitive-typography-size-6xl: 60px;
|
|
121
|
+
--primitive-typography-size-code: 13px;
|
|
121
122
|
--primitive-typography-weight-regular: 400;
|
|
122
123
|
--primitive-typography-weight-medium: 500;
|
|
123
124
|
--primitive-typography-weight-bold: 700;
|
|
@@ -127,6 +128,8 @@
|
|
|
127
128
|
--primitive-typography-lineHeight-snug: 1.375;
|
|
128
129
|
--primitive-typography-lineHeight-normal: 1.5;
|
|
129
130
|
--primitive-typography-lineHeight-relaxed: 1.625;
|
|
131
|
+
--primitive-typography-lineHeight-display: 1.05;
|
|
132
|
+
--primitive-typography-lineHeight-body: 1.6;
|
|
130
133
|
--primitive-typography-letterSpacing-tight: -0.01em;
|
|
131
134
|
--primitive-typography-letterSpacing-normal: 0em;
|
|
132
135
|
--primitive-typography-letterSpacing-caps: 0.06em;
|
|
@@ -156,6 +159,7 @@
|
|
|
156
159
|
--primitive-size-64: 64px;
|
|
157
160
|
--primitive-size-80: 80px;
|
|
158
161
|
--primitive-size-96: 96px;
|
|
162
|
+
--primitive-size-120: 120px;
|
|
159
163
|
--primitive-size-interactive-min: 44px;
|
|
160
164
|
--primitive-size-interactive-minCompact: 24px;
|
|
161
165
|
--primitive-size-width-96: 96px;
|
|
@@ -227,6 +231,7 @@
|
|
|
227
231
|
--semantic-color-feedback-bg-warning: var(--primitive-color-amber-50);
|
|
228
232
|
--semantic-color-feedback-bg-info: var(--primitive-color-blue-50);
|
|
229
233
|
--semantic-color-feedback-bg-inProgress: var(--primitive-color-violet-50);
|
|
234
|
+
--semantic-color-state-pressed-overlay: var(--primitive-color-neutral-black);
|
|
230
235
|
--semantic-space-scale-xs: var(--primitive-space-2);
|
|
231
236
|
--semantic-space-scale-sm: var(--primitive-space-4);
|
|
232
237
|
--semantic-space-scale-md: var(--primitive-space-6);
|
|
@@ -265,62 +270,67 @@
|
|
|
265
270
|
--semantic-layout-grid-columns-desktop: var(--primitive-grid-columns-3);
|
|
266
271
|
/* semantic.typography.display */
|
|
267
272
|
--semantic-typography-display-font-family: var(--primitive-typography-family-display);
|
|
268
|
-
--semantic-typography-display-font-size: var(--primitive-typography-size-
|
|
273
|
+
--semantic-typography-display-font-size: var(--primitive-typography-size-5xl);
|
|
269
274
|
--semantic-typography-display-font-weight: var(--primitive-typography-weight-bold);
|
|
270
275
|
--semantic-typography-display-letter-spacing: var(--primitive-typography-letterSpacing-tight);
|
|
271
|
-
--semantic-typography-display-line-height: var(--primitive-typography-lineHeight-
|
|
272
|
-
/* semantic.typography.
|
|
273
|
-
--semantic-typography-
|
|
274
|
-
--semantic-typography-
|
|
275
|
-
--semantic-typography-
|
|
276
|
-
--semantic-typography-
|
|
277
|
-
--semantic-typography-
|
|
278
|
-
/* semantic.typography.h2 */
|
|
279
|
-
--semantic-typography-h2-font-family: var(--primitive-typography-family-display);
|
|
280
|
-
--semantic-typography-h2-font-size: var(--primitive-typography-size-3xl);
|
|
281
|
-
--semantic-typography-h2-font-weight: var(--primitive-typography-weight-bold);
|
|
282
|
-
--semantic-typography-h2-letter-spacing: var(--primitive-typography-letterSpacing-tight);
|
|
283
|
-
--semantic-typography-h2-line-height: 40px;
|
|
284
|
-
/* semantic.typography.h3 */
|
|
285
|
-
--semantic-typography-h3-font-family: var(--primitive-typography-family-display);
|
|
286
|
-
--semantic-typography-h3-font-size: var(--primitive-typography-size-xl);
|
|
287
|
-
--semantic-typography-h3-font-weight: var(--primitive-typography-weight-bold);
|
|
288
|
-
--semantic-typography-h3-letter-spacing: var(--primitive-typography-letterSpacing-normal);
|
|
289
|
-
--semantic-typography-h3-line-height: 28px;
|
|
276
|
+
--semantic-typography-display-line-height: var(--primitive-typography-lineHeight-display);
|
|
277
|
+
/* semantic.typography.title */
|
|
278
|
+
--semantic-typography-title-font-family: var(--primitive-typography-family-display);
|
|
279
|
+
--semantic-typography-title-font-size: var(--primitive-typography-size-2xl);
|
|
280
|
+
--semantic-typography-title-font-weight: var(--primitive-typography-weight-bold);
|
|
281
|
+
--semantic-typography-title-letter-spacing: var(--primitive-typography-letterSpacing-tight);
|
|
282
|
+
--semantic-typography-title-line-height: var(--primitive-typography-lineHeight-tight);
|
|
290
283
|
/* semantic.typography.body */
|
|
291
284
|
--semantic-typography-body-font-family: var(--primitive-typography-family-primary);
|
|
292
285
|
--semantic-typography-body-font-size: var(--primitive-typography-size-base);
|
|
293
|
-
--semantic-typography-body-font-weight: var(--primitive-typography-weight-
|
|
286
|
+
--semantic-typography-body-font-weight: var(--primitive-typography-weight-regular);
|
|
294
287
|
--semantic-typography-body-letter-spacing: var(--primitive-typography-letterSpacing-normal);
|
|
295
|
-
--semantic-typography-body-line-height:
|
|
288
|
+
--semantic-typography-body-line-height: var(--primitive-typography-lineHeight-body);
|
|
296
289
|
--semantic-typography-body-max-width: 60ch;
|
|
297
290
|
/* semantic.typography.ui */
|
|
298
291
|
--semantic-typography-ui-font-family: var(--primitive-typography-family-primary);
|
|
299
292
|
--semantic-typography-ui-font-size: var(--primitive-typography-size-sm);
|
|
300
293
|
--semantic-typography-ui-font-weight: var(--primitive-typography-weight-medium);
|
|
301
294
|
--semantic-typography-ui-letter-spacing: var(--primitive-typography-letterSpacing-normal);
|
|
302
|
-
--semantic-typography-ui-line-height:
|
|
295
|
+
--semantic-typography-ui-line-height: var(--primitive-typography-lineHeight-normal);
|
|
303
296
|
--semantic-typography-ui-max-width: 60ch;
|
|
304
297
|
/* semantic.typography.caption */
|
|
305
298
|
--semantic-typography-caption-font-family: var(--primitive-typography-family-primary);
|
|
306
299
|
--semantic-typography-caption-font-size: var(--primitive-typography-size-xs);
|
|
307
300
|
--semantic-typography-caption-font-weight: var(--primitive-typography-weight-medium);
|
|
308
301
|
--semantic-typography-caption-letter-spacing: var(--primitive-typography-letterSpacing-normal);
|
|
309
|
-
--semantic-typography-caption-line-height:
|
|
310
|
-
/* semantic.typography.eyebrow */
|
|
311
|
-
--semantic-typography-eyebrow-font-family: var(--primitive-typography-family-primary);
|
|
312
|
-
--semantic-typography-eyebrow-font-size: var(--primitive-typography-size-xs);
|
|
313
|
-
--semantic-typography-eyebrow-font-weight: var(--primitive-typography-weight-medium);
|
|
314
|
-
--semantic-typography-eyebrow-letter-spacing: var(--primitive-typography-letterSpacing-caps);
|
|
315
|
-
--semantic-typography-eyebrow-line-height: 16px;
|
|
316
|
-
--semantic-typography-eyebrow-text-transform: uppercase;
|
|
302
|
+
--semantic-typography-caption-line-height: var(--primitive-typography-lineHeight-normal);
|
|
317
303
|
/* semantic.typography.mono */
|
|
318
304
|
--semantic-typography-mono-font-family: var(--primitive-typography-family-mono);
|
|
319
|
-
--semantic-typography-mono-font-size: var(--primitive-typography-size-
|
|
305
|
+
--semantic-typography-mono-font-size: var(--primitive-typography-size-code);
|
|
320
306
|
--semantic-typography-mono-font-weight: var(--primitive-typography-weight-regular);
|
|
321
307
|
--semantic-typography-mono-letter-spacing: var(--primitive-typography-letterSpacing-normal);
|
|
322
|
-
--semantic-typography-mono-line-height:
|
|
308
|
+
--semantic-typography-mono-line-height: var(--primitive-typography-lineHeight-normal);
|
|
323
309
|
--semantic-typography-mono-max-width: 60ch;
|
|
310
|
+
/* semantic.typography.h1 */
|
|
311
|
+
--semantic-typography-h1-font-family: var(--primitive-typography-family-display);
|
|
312
|
+
--semantic-typography-h1-font-size: var(--primitive-typography-size-2xl);
|
|
313
|
+
--semantic-typography-h1-font-weight: var(--primitive-typography-weight-bold);
|
|
314
|
+
--semantic-typography-h1-letter-spacing: var(--primitive-typography-letterSpacing-tight);
|
|
315
|
+
--semantic-typography-h1-line-height: var(--primitive-typography-lineHeight-tight);
|
|
316
|
+
/* semantic.typography.h2 */
|
|
317
|
+
--semantic-typography-h2-font-family: var(--primitive-typography-family-display);
|
|
318
|
+
--semantic-typography-h2-font-size: var(--primitive-typography-size-2xl);
|
|
319
|
+
--semantic-typography-h2-font-weight: var(--primitive-typography-weight-bold);
|
|
320
|
+
--semantic-typography-h2-letter-spacing: var(--primitive-typography-letterSpacing-tight);
|
|
321
|
+
--semantic-typography-h2-line-height: var(--primitive-typography-lineHeight-tight);
|
|
322
|
+
/* semantic.typography.h3 */
|
|
323
|
+
--semantic-typography-h3-font-family: var(--primitive-typography-family-display);
|
|
324
|
+
--semantic-typography-h3-font-size: var(--primitive-typography-size-2xl);
|
|
325
|
+
--semantic-typography-h3-font-weight: var(--primitive-typography-weight-bold);
|
|
326
|
+
--semantic-typography-h3-letter-spacing: var(--primitive-typography-letterSpacing-tight);
|
|
327
|
+
--semantic-typography-h3-line-height: var(--primitive-typography-lineHeight-tight);
|
|
328
|
+
/* semantic.typography.eyebrow */
|
|
329
|
+
--semantic-typography-eyebrow-font-family: var(--primitive-typography-family-primary);
|
|
330
|
+
--semantic-typography-eyebrow-font-size: var(--primitive-typography-size-xs);
|
|
331
|
+
--semantic-typography-eyebrow-font-weight: var(--primitive-typography-weight-medium);
|
|
332
|
+
--semantic-typography-eyebrow-letter-spacing: var(--primitive-typography-letterSpacing-normal);
|
|
333
|
+
--semantic-typography-eyebrow-line-height: var(--primitive-typography-lineHeight-normal);
|
|
324
334
|
--semantic-typography-lineHeight-none: var(--primitive-typography-lineHeight-none);
|
|
325
335
|
--semantic-docs-space-section: var(--primitive-space-12);
|
|
326
336
|
--semantic-docs-space-paragraph: var(--primitive-space-6);
|
|
@@ -363,6 +373,7 @@
|
|
|
363
373
|
--semantic-size-icon-md: var(--primitive-size-20);
|
|
364
374
|
--semantic-size-icon-lg: var(--primitive-size-24);
|
|
365
375
|
--semantic-size-avatar: var(--primitive-size-40);
|
|
376
|
+
--semantic-size-tile: var(--primitive-size-120);
|
|
366
377
|
--semantic-size-row-compact: var(--primitive-size-40);
|
|
367
378
|
--semantic-size-row-comfortable: var(--primitive-size-48);
|
|
368
379
|
--semantic-zIndex-control: var(--primitive-zIndex-10);
|
|
@@ -456,6 +467,7 @@
|
|
|
456
467
|
--role-card-foreground: var(--semantic-color-content-primary);
|
|
457
468
|
--role-popover: var(--semantic-color-surface-overlay);
|
|
458
469
|
--role-scrim: var(--semantic-color-surface-scrim);
|
|
470
|
+
--role-pressed-overlay: var(--semantic-color-state-pressed-overlay);
|
|
459
471
|
--role-popover-foreground: var(--semantic-color-content-primary);
|
|
460
472
|
--role-primary: var(--semantic-color-surface-accent);
|
|
461
473
|
--role-primary-foreground: var(--semantic-color-content-onAccent);
|
|
@@ -515,6 +527,7 @@
|
|
|
515
527
|
--semantic-color-feedback-bg-warning: var(--primitive-color-amber-950);
|
|
516
528
|
--semantic-color-feedback-bg-info: var(--primitive-color-blue-900);
|
|
517
529
|
--semantic-color-feedback-bg-inProgress: var(--primitive-color-violet-950);
|
|
530
|
+
--semantic-color-state-pressed-overlay: var(--primitive-color-neutral-white);
|
|
518
531
|
--semantic-accent-rest: var(--primitive-color-neutral-100);
|
|
519
532
|
--semantic-accent-hover: var(--primitive-color-neutral-200);
|
|
520
533
|
--semantic-accent-pressed: var(--primitive-color-neutral-300);
|
|
@@ -567,6 +580,7 @@
|
|
|
567
580
|
--role-card-foreground: var(--semantic-color-content-primary);
|
|
568
581
|
--role-popover: var(--semantic-color-surface-overlay);
|
|
569
582
|
--role-scrim: var(--semantic-color-surface-scrim);
|
|
583
|
+
--role-pressed-overlay: var(--semantic-color-state-pressed-overlay);
|
|
570
584
|
--role-popover-foreground: var(--semantic-color-content-primary);
|
|
571
585
|
--role-primary: var(--semantic-color-surface-accent);
|
|
572
586
|
--role-primary-foreground: var(--semantic-color-content-onAccent);
|
package/docs/CONSUMING.md
CHANGED
|
@@ -15,7 +15,7 @@ is the canonical consumption guide — point other teams here.
|
|
|
15
15
|
>
|
|
16
16
|
> 1. **`react-router` is now optional** — components route through an adapter and
|
|
17
17
|
> fall back to plain anchors when no router is provided (§5).
|
|
18
|
-
> 2. **Fonts are
|
|
18
|
+
> 2. **Fonts are opt-in** — `import '@hirobius/design-system/fonts.css'` for the brand typefaces; the woff2 ship in the package, nothing to copy (§3).
|
|
19
19
|
> 3. **Base styles are scoped to `[data-hds]`** — add that attribute to your root
|
|
20
20
|
> or section so HDS doesn't fight a host app's resets/fonts (§4, §6).
|
|
21
21
|
|
|
@@ -43,7 +43,7 @@ HDS ships **three** stylesheets. Pick one by how much you want HDS to own:
|
|
|
43
43
|
|
|
44
44
|
```ts
|
|
45
45
|
// RECOMMENDED for embedding in an existing app (e.g. MUI): tokens + component
|
|
46
|
-
// styles + utilities
|
|
46
|
+
// styles + utilities, with NO global reset. Styles every HDS
|
|
47
47
|
// component and changes ZERO host-element styles.
|
|
48
48
|
import '@hirobius/design-system/styles.css';
|
|
49
49
|
|
|
@@ -56,17 +56,31 @@ import '@hirobius/design-system/tokens.css';
|
|
|
56
56
|
import '@hirobius/design-system/variables.css';
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
| Stylesheet | Tokens | Components + utilities |
|
|
60
|
-
| ------------------- | :----: | :--------------------: |
|
|
61
|
-
| **`styles.css`** | ✅ | ✅ |
|
|
62
|
-
| **`tokens.css`** | ✅ | ✅ |
|
|
63
|
-
| **`variables.css`** | ✅ | ❌ |
|
|
59
|
+
| Stylesheet | Tokens | Components + utilities | Global reset |
|
|
60
|
+
| ------------------- | :----: | :--------------------: | :-------------------: |
|
|
61
|
+
| **`styles.css`** | ✅ | ✅ | ❌ none |
|
|
62
|
+
| **`tokens.css`** | ✅ | ✅ | ⚠️ Tailwind preflight |
|
|
63
|
+
| **`variables.css`** | ✅ | ❌ | ❌ none |
|
|
64
64
|
|
|
65
65
|
All three:
|
|
66
66
|
|
|
67
67
|
- **Need no Tailwind config** in the consumer — utilities ship compiled.
|
|
68
|
-
- **
|
|
69
|
-
|
|
68
|
+
- **Carry no font files.** Fonts are a separate, optional import (below).
|
|
69
|
+
|
|
70
|
+
### Brand fonts (optional)
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
import '@hirobius/design-system/fonts.css'; // Satoshi 400/500/700 + Geist Mono 400
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`fonts.css` declares the four `@font-face` blocks with `font-display: swap`. Its
|
|
77
|
+
URLs are relative (`./fonts/satoshi-400.woff2`), and the woff2 files ship in the
|
|
78
|
+
package, so Vite, Next and webpack resolve and hash them; there is nothing to
|
|
79
|
+
copy. Import it alongside one of the stylesheets above to keep the HDS fonts.
|
|
80
|
+
Skip it to bring your own: `tokens.css` and `styles.css` keep the
|
|
81
|
+
`--hds-font-family*` variables, so text falls back to the family stack
|
|
82
|
+
(`"Satoshi", system-ui, …`) and uses your font if you declare that family
|
|
83
|
+
yourself.
|
|
70
84
|
|
|
71
85
|
HDS's own base styles (type baseline, resets) are scoped to the `[data-hds]`
|
|
72
86
|
subtree (§4) in **all** bundles, so they never touch host elements. The only
|
|
@@ -101,7 +115,7 @@ Without `data-hds`, components still get their own token-driven styling, but the
|
|
|
101
115
|
global type baseline and resets won't apply (text falls back to the host font).
|
|
102
116
|
Put `data-hds` as high as makes sense — on `<html>`/`<body>` for an
|
|
103
117
|
HDS-first app, or on a wrapper for a section. Overlays (Dialog, AlertDialog,
|
|
104
|
-
Menu,
|
|
118
|
+
Menu, Popover, Select, Tooltip) inherit the nearest
|
|
105
119
|
`data-hds` scope, so a `<div data-hds data-theme="dark">` themes them too; pass
|
|
106
120
|
`container` on the Content part to portal elsewhere. If the scope element
|
|
107
121
|
creates a containing block or stacking context (`transform`, `filter`, `z-index`,
|
|
@@ -155,7 +169,7 @@ If your app runs MUI `<CssBaseline>` + Emotion (or any opinionated global CSS),
|
|
|
155
169
|
resets will fight if both target `body`.
|
|
156
170
|
- **Styled path (recommended for MUI/host embedding):** import
|
|
157
171
|
`@hirobius/design-system/styles.css` instead of `tokens.css`. It ships the full
|
|
158
|
-
component styling (tokens + utilities
|
|
172
|
+
component styling (tokens + utilities) but **no global reset** — HDS's
|
|
159
173
|
own base is scoped to `[data-hds]`, so it styles every HDS component and
|
|
160
174
|
**cannot** restyle your host's `*`, `body`, headings, `button`, `a`, or form
|
|
161
175
|
controls. This is the clean way to run HDS next to `<CssBaseline>`: no reset
|
|
@@ -211,21 +225,25 @@ export function Example() {
|
|
|
211
225
|
|
|
212
226
|
### Subpath exports
|
|
213
227
|
|
|
214
|
-
| Import | What you get
|
|
215
|
-
| --------------------------------------- |
|
|
216
|
-
| `@hirobius/design-system` |
|
|
217
|
-
| `@hirobius/design-system/styles.css` | Components + utilities + tokens
|
|
218
|
-
| `@hirobius/design-system/
|
|
219
|
-
| `@hirobius/design-system/
|
|
220
|
-
| `@hirobius/design-system/
|
|
221
|
-
| `@hirobius/design-system/
|
|
222
|
-
| `@hirobius/design-system/
|
|
223
|
-
| `@hirobius/design-system/
|
|
224
|
-
| `@hirobius/design-system/
|
|
225
|
-
| `@hirobius/design-system/
|
|
226
|
-
| `@hirobius/design-system/
|
|
227
|
-
| `@hirobius/design-system/
|
|
228
|
-
| `@hirobius/design-system/
|
|
228
|
+
| Import | What you get |
|
|
229
|
+
| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
230
|
+
| `@hirobius/design-system` | The 43-component core set ([README → What belongs in the system](../README.md#what-belongs-in-the-system)), the rest of the allow-list, and the router seam (`HdsRouterProvider`, `useHdsRouter`); the `pattern` tier is in `/patterns` |
|
|
231
|
+
| `@hirobius/design-system/styles.css` | Components + utilities + tokens, NO global reset (host-safe; recommended for embedding) |
|
|
232
|
+
| `@hirobius/design-system/fonts.css` | Optional brand fonts: Satoshi 400/500/700 + Geist Mono 400 (`@font-face`, relative woff2 URLs) |
|
|
233
|
+
| `@hirobius/design-system/tokens.css` | The complete stylesheet — styles.css PLUS a global Tailwind-preflight reset |
|
|
234
|
+
| `@hirobius/design-system/variables.css` | Design tokens as CSS custom properties ONLY — no reset/preflight (host-safe) |
|
|
235
|
+
| `@hirobius/design-system/tokens` | Design-token values as typed TS |
|
|
236
|
+
| `@hirobius/design-system/cn` | The `cn()` className-merge helper |
|
|
237
|
+
| `@hirobius/design-system/manifest` | Machine-readable component inventory (`hds-manifest.json`) |
|
|
238
|
+
| `@hirobius/design-system/contexts` | React context providers, incl. the router seam (see below) |
|
|
239
|
+
| `@hirobius/design-system/form` | Optional React Hook Form + Zod form adapter (see §8.5) |
|
|
240
|
+
| `@hirobius/design-system/mui` | Optional Material UI theme preset — maps HDS tokens to an MUI palette (see §6) |
|
|
241
|
+
| `@hirobius/design-system/brand` | Framework-free palette → HDS-semantic overlay bridge for static/SSR targets (see §12) |
|
|
242
|
+
| `@hirobius/design-system/scroll` | Opt-in scroll-motion: `SmoothScroll` (Lenis) + `useScrollProgress` (Motion). Optional peer `lenis` (see §13) |
|
|
243
|
+
| `@hirobius/design-system/static.css` | CSS-only static-primitive layer — `.hds-badge`/`.hds-card`/`.hds-alert`/`.hds-divider`/`.hds-tag` classes, no React (see §14) |
|
|
244
|
+
| `@hirobius/design-system/patterns` | The 12 pattern modules (`Page`, `PageHeader`, `Form`, `FormField`, `CodeBlock`, …); root copies removed in 0.20.0 |
|
|
245
|
+
| `@hirobius/design-system/icons` | Curated Lucide icon set for `Icon` and `Button iconOnly` (see §15) |
|
|
246
|
+
| `@hirobius/design-system/eslint-plugin` | The consumer ESLint plugin; spread `configs.recommended` into `eslint.config.mjs` (see §11) |
|
|
229
247
|
|
|
230
248
|
### Semantic feedback / status tokens
|
|
231
249
|
|
|
@@ -287,8 +305,9 @@ import {
|
|
|
287
305
|
|
|
288
306
|
## 8.5 Optional — typed, schema-validated forms (React Hook Form + Zod)
|
|
289
307
|
|
|
290
|
-
The
|
|
291
|
-
string, so you bring your own
|
|
308
|
+
The plain `FormField` (from `@hirobius/design-system/patterns`) is
|
|
309
|
+
validation-agnostic: it takes a plain `error` string, so you bring your own
|
|
310
|
+
validation. If you want a batteries-included
|
|
292
311
|
layer, the `/form` subpath wires [React Hook Form](https://react-hook-form.com)
|
|
293
312
|
to [Zod](https://zod.dev). It's opt-in — `react-hook-form`, `zod`, and
|
|
294
313
|
`@hookform/resolvers` are **optional peer deps**, so they only land in your
|
|
@@ -338,7 +357,8 @@ function ApplyForm() {
|
|
|
338
357
|
validation (no native browser popups racing your schema).
|
|
339
358
|
- `HdsFormField` — a **render-prop**: spread the supplied props onto your
|
|
340
359
|
control. It binds the control to RHF by `name` and shows the field's Zod
|
|
341
|
-
error through the same label/error/aria markup as the
|
|
360
|
+
error through the same label/error/aria markup as the `FormField` in
|
|
361
|
+
`@hirobius/design-system/patterns`. (It's
|
|
342
362
|
a render-prop, not a cloned child, so RHF's callback ref attaches cleanly.)
|
|
343
363
|
|
|
344
364
|
**SSR / Astro / Next.js RSC:** this layer is client-only (RHF uses hooks +
|
|
@@ -428,16 +448,15 @@ by `scripts/check-hardcoded-colors.mjs`, `scripts/check-hardcoded-spacing.mjs`,
|
|
|
428
448
|
and `scripts/check-layout-discipline.mjs` — internal scripts that only run
|
|
429
449
|
here. `@hirobius/eslint-plugin-hds` (`scripts/eslint-plugin-hds/`) ships the
|
|
430
450
|
same discipline as an installable ESLint plugin for consumer apps, flagging
|
|
431
|
-
raw hex/px values in `style`, `className`, and `Box` `sx` props
|
|
432
|
-
reach code review.
|
|
451
|
+
raw hex/px values in `style`, `className`, and `Box` `sx` props, and raw HTML
|
|
452
|
+
form controls, before they reach code review.
|
|
433
453
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
```
|
|
454
|
+
It ships inside this package as the `@hirobius/design-system/eslint-plugin`
|
|
455
|
+
subpath, so an app that has the design system installed needs only `eslint`:
|
|
437
456
|
|
|
438
457
|
```js
|
|
439
458
|
// eslint.config.mjs
|
|
440
|
-
import hds from '@hirobius/eslint-plugin
|
|
459
|
+
import hds from '@hirobius/design-system/eslint-plugin';
|
|
441
460
|
|
|
442
461
|
export default [
|
|
443
462
|
{
|
|
@@ -448,12 +467,21 @@ export default [
|
|
|
448
467
|
];
|
|
449
468
|
```
|
|
450
469
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
470
|
+
Without the package (for example in a repo that only lints), install the same
|
|
471
|
+
plugin from git:
|
|
472
|
+
|
|
473
|
+
```bash
|
|
474
|
+
pnpm add -D "@hirobius/eslint-plugin-hds@github:hirobius/hds#path:/scripts/eslint-plugin-hds"
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
and import it as `@hirobius/eslint-plugin-hds`.
|
|
478
|
+
|
|
479
|
+
Five rules ship in `recommended`: `no-raw-hex` (error), `no-raw-px-spacing`
|
|
480
|
+
(error), `no-raw-controls` (error — raw `<button>`, `<input>`, `<select>`,
|
|
481
|
+
`<textarea>` or `<form>` where an HDS component exists), `sx-token-first`
|
|
482
|
+
(error — raw hex/px inside `Box` `sx`, where token keys are mandatory), and
|
|
483
|
+
`prefer-hds-layout-primitive` (warn — ad-hoc `display: flex`/`grid` where
|
|
484
|
+
Stack/Grid likely fits). Full rule docs and examples live in
|
|
457
485
|
[`scripts/eslint-plugin-hds/README.md`](../scripts/eslint-plugin-hds/README.md).
|
|
458
486
|
|
|
459
487
|
### Agent skill
|
|
@@ -736,23 +764,27 @@ CSS, only the visual surface of the five primitives above.
|
|
|
736
764
|
|
|
737
765
|
## 15. Icons — the `/icons` subpath
|
|
738
766
|
|
|
739
|
-
`
|
|
740
|
-
`lucide-react` does not need to be installed separately.
|
|
767
|
+
`Icon` takes an `icon` prop. Get one from the curated subpath;
|
|
768
|
+
`lucide-react` does not need to be installed separately. An icon-only button is
|
|
769
|
+
`Button iconOnly` with a `label` (its accessible name) and the `Icon` in
|
|
770
|
+
`iconLeft`.
|
|
741
771
|
|
|
742
772
|
```tsx
|
|
743
|
-
import {
|
|
773
|
+
import { Button, Icon } from '@hirobius/design-system';
|
|
744
774
|
import { Ellipsis } from '@hirobius/design-system/icons';
|
|
745
775
|
|
|
746
|
-
<
|
|
776
|
+
<Button iconOnly label="Row actions" iconLeft={<Icon icon={Ellipsis} />} />;
|
|
747
777
|
```
|
|
748
778
|
|
|
749
779
|
The full name list is `iconSet.names` in the manifest (and the Icons section of
|
|
750
780
|
`llms.txt`). Canonical Lucide 0.487.0 names only: `MoreHorizontal` is
|
|
751
781
|
`Ellipsis`, `MoreVertical` is `EllipsisVertical`, `AlertTriangle` is
|
|
752
782
|
`TriangleAlert`, `Home` is `House`, `Filter` is `Funnel`. Icon-only actions (row
|
|
753
|
-
menus, close, edit) use `
|
|
783
|
+
menus, close, edit) use `Button iconOnly`; do not hand-roll a button with a glyph. For
|
|
754
784
|
an icon outside the set, install `lucide-react@0.487.0` so the `LucideIcon` type
|
|
755
785
|
stays identical.
|
|
756
786
|
|
|
757
|
-
`
|
|
758
|
-
`import {
|
|
787
|
+
`Menu` shares its name with the HDS `Menu` component; alias it:
|
|
788
|
+
`import { Menu as MenuIcon } from '@hirobius/design-system/icons'`. (`Calendar`
|
|
789
|
+
collided too until the HDS `Calendar` was removed in 0.20.0, hds#394; it imports
|
|
790
|
+
under its own name now.)
|