@godxjp/ui 28.13.0 → 29.0.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/agent/START-HERE.md +29 -10
- package/agent/components/Anchor.json +6 -1
- package/agent/components/AppShell.json +1 -1
- package/agent/components/AreaChart.json +19 -1
- package/agent/components/BarChart.json +11 -1
- package/agent/components/Cascader.json +1 -1
- package/agent/components/CompactBarTrend.json +1 -1
- package/agent/components/DataState.json +1 -1
- package/agent/components/DataTable.json +4 -4
- package/agent/components/FormField.json +1 -1
- package/agent/components/InfiniteQueryState.json +1 -1
- package/agent/components/Input.json +1 -1
- package/agent/components/LineChart.json +20 -2
- package/agent/components/ListRow.json +1 -1
- package/agent/components/Masonry.json +1 -1
- package/agent/components/MasterDetail.json +1 -1
- package/agent/components/PasswordStrength.json +1 -1
- package/agent/components/PermissionMatrix.json +1 -1
- package/agent/components/Select.json +1 -0
- package/agent/components/Sidebar.json +1 -1
- package/agent/components/Table.json +8 -3
- package/agent/components/ThemeScope.json +49 -0
- package/agent/components/Topbar.json +1 -0
- package/agent/components/TopbarItem.json +2 -1
- package/agent/components/Transfer.json +1 -1
- package/agent/components/TreeSelect.json +1 -1
- package/agent/components/UploadCropDialog.json +1 -1
- package/agent/components/formatDate.json +1 -1
- package/agent/components-index.json +5 -0
- package/agent/components.json +138 -30
- package/agent/index.json +19 -9
- package/agent/llms.txt +10 -10
- package/agent/patterns/tenant-brand-color.json +28 -0
- package/agent/patterns-index.json +27 -0
- package/agent/patterns.json +28 -0
- package/agent/rules.json +15 -0
- package/agent/tokens.json +4965 -970
- package/dist/app/index.d.ts +3 -0
- package/dist/app/index.js +3 -0
- package/dist/app/tenant-theme.d.ts +80 -0
- package/dist/app/tenant-theme.js +154 -0
- package/dist/app/theme-axes.d.ts +14 -1
- package/dist/app/theme-axes.js +24 -31
- package/dist/components/charts/chart-cartesian.d.ts +5 -1
- package/dist/components/charts/chart-cartesian.js +15 -8
- package/dist/components/data-display/badge.d.ts +1 -1
- package/dist/components/data-display/badge.js +20 -2
- package/dist/components/data-display/carousel.js +4 -4
- package/dist/components/data-display/data-table.js +13 -2
- package/dist/components/data-display/permission-matrix.js +1 -1
- package/dist/components/data-display/table.d.ts +11 -2
- package/dist/components/data-display/table.js +18 -2
- package/dist/components/data-entry/control-appearance.d.ts +12 -6
- package/dist/components/data-entry/control-appearance.js +1 -1
- package/dist/components/data-entry/select.js +4 -3
- package/dist/components/feedback/dialog.js +6 -3
- package/dist/components/feedback/overlay-header-tone.d.ts +7 -0
- package/dist/components/feedback/overlay-header-tone.js +4 -4
- package/dist/components/feedback/sheet.d.ts +1 -1
- package/dist/components/feedback/sheet.js +6 -9
- package/dist/components/feedback/sonner.js +16 -3
- package/dist/components/general/button.js +22 -5
- package/dist/components/layout/affix.js +15 -1
- package/dist/components/layout/sidebar.js +7 -1
- package/dist/components/navigation/anchor.d.ts +1 -1
- package/dist/components/navigation/anchor.js +5 -4
- package/dist/components/navigation/app-setting-picker.js +1 -1
- package/dist/components/navigation/pagination.js +1 -1
- package/dist/components/navigation/tabs.js +15 -2
- package/dist/components/query/infinite-query-state.d.ts +22 -6
- package/dist/lib/control-styles.d.ts +31 -11
- package/dist/lib/control-styles.js +6 -6
- package/dist/lib/overlay-portal.d.ts +20 -0
- package/dist/lib/overlay-portal.js +93 -0
- package/dist/props/components/app.prop.d.ts +12 -0
- package/dist/props/components/charts.prop.d.ts +30 -0
- package/dist/props/components/index.d.ts +1 -1
- package/dist/props/components/navigation.prop.d.ts +21 -2
- package/dist/props/components/query.prop.d.ts +36 -2
- package/dist/props/registry.d.ts +46 -1
- package/dist/props/registry.js +38 -3
- package/dist/styles/alert-layout.css +34 -14
- package/dist/styles/badge-layout.css +10 -6
- package/dist/styles/base.css +14 -5
- package/dist/styles/card-layout.css +19 -8
- package/dist/styles/chart-layout.css +22 -3
- package/dist/styles/control.css +165 -59
- package/dist/styles/data-display-layout.css +129 -36
- package/dist/styles/data-entry-layout.css +23 -87
- package/dist/styles/dialog-layout.css +49 -19
- package/dist/styles/float-button-layout.css +5 -5
- package/dist/styles/focus-ring.css +9 -5
- package/dist/styles/layout.css +42 -15
- package/dist/styles/logo-layout.css +1 -1
- package/dist/styles/motion.css +1 -1
- package/dist/styles/navigation-layout.css +90 -29
- package/dist/styles/shell-layout.css +63 -40
- package/dist/styles/table-layout.css +56 -17
- package/dist/styles/text-layout.css +13 -4
- package/dist/styles/toggle.css +8 -2
- package/dist/tokens/components/actions.css +1 -1
- package/dist/tokens/components/attachments.css +4 -4
- package/dist/tokens/components/badge.css +4 -4
- package/dist/tokens/components/callout.css +1 -1
- package/dist/tokens/components/card.css +9 -4
- package/dist/tokens/components/chart.css +10 -1
- package/dist/tokens/components/chat-bubble.css +1 -1
- package/dist/tokens/components/control.css +28 -10
- package/dist/tokens/components/conversations.css +2 -1
- package/dist/tokens/components/data-display.css +12 -7
- package/dist/tokens/components/descriptions.css +1 -1
- package/dist/tokens/components/draggable-panel.css +1 -1
- package/dist/tokens/components/feedback.css +28 -8
- package/dist/tokens/components/float-button.css +1 -1
- package/dist/tokens/components/legal-document.css +1 -1
- package/dist/tokens/components/logo.css +1 -1
- package/dist/tokens/components/mega-menu.css +5 -3
- package/dist/tokens/components/navigation.css +21 -7
- package/dist/tokens/components/segmented.css +8 -3
- package/dist/tokens/components/shell.css +19 -5
- package/dist/tokens/components/table.css +9 -1
- package/dist/tokens/components/thought-chain.css +1 -1
- package/dist/tokens/components/toggle.css +2 -0
- package/dist/tokens/components/tree.css +3 -1
- package/dist/tokens/components/upload.css +6 -6
- package/dist/tokens/components/welcome.css +1 -1
- package/dist/tokens/foundation.css +28 -1
- package/docs/COMPOSITION-VS-COMPONENT.md +31 -0
- package/docs/CUSTOMER-THEMING.md +637 -1
- package/docs/FRAME-COVERAGE-REPORT.md +3 -2
- package/docs/GLASSMORPHISM-STANDARD.md +196 -0
- package/docs/THEME-API-COVERAGE.md +538 -0
- package/docs/TOKEN-RESOLUTION.md +195 -0
- package/docs/TOKENS.md +63 -24
- package/docs/asset-modules.d.ts +7 -0
- package/docs/data-display/charts.tsx +80 -0
- package/docs/data-display/data-table/index.tsx +30 -0
- package/docs/data-display/popover.tsx +1 -1
- package/docs/data-display/table.tsx +52 -0
- package/docs/feedback/sheet.tsx +10 -10
- package/docs/foundation/density.tsx +4 -4
- package/docs/i18n/messages/en.json +502 -0
- package/docs/i18n/messages/ja.json +502 -0
- package/docs/i18n/messages/vi.json +502 -0
- package/docs/layout/account-chip.tsx +2 -2
- package/docs/layout/responsive-grid.tsx +1 -1
- package/docs/navigation/toolbar.tsx +20 -12
- package/docs/providers/theme-scope.tsx +186 -0
- package/docs/showcase/caimono-price-comparison.tsx +911 -0
- package/docs/showcase/case4-login.tsx +2 -2
- package/docs/showcase/permission-matrix.tsx +13 -5
- package/docs/showcase/table-pagination.tsx +2 -1
- package/docs/showcase/tenant-brand-color.tsx +338 -0
- package/docs/showcase/theme-lab.tsx +2125 -0
- package/docs/themes/flat.css +462 -0
- package/docs/themes/glassmorphism.css +958 -0
- package/docs/themes/index.ts +200 -0
- package/package.json +4 -3
- package/scripts/explain-token.mjs +382 -0
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
--tree-node-padding-inline: var(--space-2);
|
|
10
10
|
--tree-node-gap: var(--space-2);
|
|
11
|
-
--tree-node-radius:
|
|
11
|
+
--tree-node-radius: initial;
|
|
12
12
|
--tree-node-font-size: var(--font-size-sm, var(--font-size-base));
|
|
13
13
|
|
|
14
14
|
--tree-switcher-size: 1.25rem;
|
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
--tree-divider-color: initial;
|
|
23
23
|
|
|
24
24
|
--tree-node-hover-background: initial;
|
|
25
|
+
--tree-node-hover-background-alpha: initial;
|
|
25
26
|
--tree-node-selected-background: initial;
|
|
27
|
+
--tree-node-selected-background-alpha: initial;
|
|
26
28
|
--tree-node-selected-foreground: initial;
|
|
27
29
|
|
|
28
30
|
--tree-loading-bar-inline-size: 40%;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
:root {
|
|
4
4
|
|
|
5
5
|
--upload-dropzone-space-inset: var(--space-10);
|
|
6
|
-
--upload-dropzone-radius:
|
|
6
|
+
--upload-dropzone-radius: initial;
|
|
7
7
|
--upload-dropzone-border-width: var(--stroke-md);
|
|
8
8
|
--upload-dropzone-icon-size: var(--icon-size-3xl);
|
|
9
9
|
--upload-dropzone-hint-space-block-start: var(--space-3);
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
);
|
|
16
16
|
|
|
17
17
|
--upload-tile-size: 6rem;
|
|
18
|
-
--upload-tile-radius:
|
|
18
|
+
--upload-tile-radius: initial;
|
|
19
19
|
--upload-tile-space-gap: var(--space-3);
|
|
20
20
|
--upload-tile-icon-size: var(--icon-size-xl);
|
|
21
21
|
--upload-tile-label-space-block-start: var(--space-1);
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
--upload-remove-icon-size: var(--icon-size-sm);
|
|
37
37
|
|
|
38
38
|
--upload-picture-max-width: 20rem;
|
|
39
|
-
--upload-picture-radius:
|
|
39
|
+
--upload-picture-radius: initial;
|
|
40
40
|
--upload-picture-preview-max-height: 12rem;
|
|
41
41
|
--upload-picture-empty-height: 8rem;
|
|
42
42
|
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
--upload-picture-empty-label-font-size: var(--font-size-sm, var(--font-size-base));
|
|
46
46
|
--upload-picture-overlay-font-size: var(--font-size-sm, var(--font-size-base));
|
|
47
47
|
|
|
48
|
-
--upload-picture-badge-radius:
|
|
48
|
+
--upload-picture-badge-radius: initial;
|
|
49
49
|
--upload-picture-badge-offset: var(--space-2);
|
|
50
50
|
--upload-picture-badge-space-inline: var(--space-2);
|
|
51
51
|
--upload-picture-badge-space-block: 0.125rem;
|
|
@@ -68,14 +68,14 @@
|
|
|
68
68
|
--upload-draft-space-inline: var(--space-3);
|
|
69
69
|
--upload-draft-space-block: var(--space-2);
|
|
70
70
|
--upload-draft-space-gap: var(--space-2);
|
|
71
|
-
--upload-draft-radius:
|
|
71
|
+
--upload-draft-radius: initial;
|
|
72
72
|
--upload-draft-font-size: var(--font-size-sm, var(--font-size-base));
|
|
73
73
|
--upload-draft-icon-size: var(--icon-size-sm);
|
|
74
74
|
|
|
75
75
|
--upload-row-space-inline: var(--space-3);
|
|
76
76
|
--upload-row-space-block: var(--space-2);
|
|
77
77
|
--upload-row-space-gap: var(--space-3);
|
|
78
|
-
--upload-row-radius:
|
|
78
|
+
--upload-row-radius: initial;
|
|
79
79
|
--upload-row-font-size: var(--font-size-sm, var(--font-size-base));
|
|
80
80
|
--upload-row-icon-size: var(--icon-size-md);
|
|
81
81
|
|
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
--background: 60 33% 99%;
|
|
6
6
|
--foreground: 48 8% 13%;
|
|
7
|
+
|
|
8
|
+
--card-alpha: 100%;
|
|
9
|
+
--popover-alpha: 100%;
|
|
10
|
+
--input-alpha: 100%;
|
|
11
|
+
--secondary-hover-alpha: 100%;
|
|
12
|
+
--secondary-active-alpha: 100%;
|
|
13
|
+
|
|
7
14
|
--card: 60 33% 99%;
|
|
8
15
|
--card-foreground: 48 8% 13%;
|
|
9
16
|
--popover: 60 33% 99%;
|
|
@@ -52,6 +59,15 @@
|
|
|
52
59
|
--mark-destructive: initial;
|
|
53
60
|
--mark-attention: initial;
|
|
54
61
|
|
|
62
|
+
--surface-success: initial;
|
|
63
|
+
--surface-success-alpha: initial;
|
|
64
|
+
--surface-warning: initial;
|
|
65
|
+
--surface-warning-alpha: initial;
|
|
66
|
+
--surface-info: initial;
|
|
67
|
+
--surface-info-alpha: initial;
|
|
68
|
+
--surface-destructive: initial;
|
|
69
|
+
--surface-destructive-alpha: initial;
|
|
70
|
+
|
|
55
71
|
--secondary-hover: 45 15% 91%;
|
|
56
72
|
--secondary-active: 45 15% 88%;
|
|
57
73
|
|
|
@@ -71,7 +87,7 @@
|
|
|
71
87
|
|
|
72
88
|
--chart-1: #0077c7;
|
|
73
89
|
--chart-2: #006e54;
|
|
74
|
-
--chart-3: #
|
|
90
|
+
--chart-3: #af8000;
|
|
75
91
|
--chart-4: #b7282e;
|
|
76
92
|
--chart-5: #4c6cb3;
|
|
77
93
|
--chart-6: #eb6101;
|
|
@@ -138,6 +154,12 @@
|
|
|
138
154
|
--font-sans-base:
|
|
139
155
|
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui,
|
|
140
156
|
sans-serif;
|
|
157
|
+
|
|
158
|
+
--font-sans-ja: initial;
|
|
159
|
+
--font-sans-ko: initial;
|
|
160
|
+
--font-sans-vi: initial;
|
|
161
|
+
--font-sans-zh-hans: initial;
|
|
162
|
+
--font-sans-zh-hant: initial;
|
|
141
163
|
--font-family-sans: var(--font-sans-base);
|
|
142
164
|
--font-family-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
143
165
|
|
|
@@ -219,6 +241,8 @@
|
|
|
219
241
|
--blur-md: 8px;
|
|
220
242
|
--blur-lg: 16px;
|
|
221
243
|
|
|
244
|
+
--surface-backdrop-saturate: initial;
|
|
245
|
+
|
|
222
246
|
--band-height-xs: 1.5rem;
|
|
223
247
|
--band-height-sm: 1.75rem;
|
|
224
248
|
--band-height-md: 2rem;
|
|
@@ -358,4 +382,7 @@
|
|
|
358
382
|
|
|
359
383
|
--secondary-hover: 45 6% 22%;
|
|
360
384
|
--secondary-active: 45 6% 26%;
|
|
385
|
+
|
|
386
|
+
--chart-2: #008465;
|
|
387
|
+
--chart-4: #d43b42;
|
|
361
388
|
}
|
|
@@ -85,6 +85,7 @@ new UI need
|
|
|
85
85
|
| Dashboard **page layout** | ❌ | ❌ | ❌ | ❌ | ➖ | ❌ | ❌ | **Composition** — `AppShell` + `PageContainer` + `ResponsiveGrid` |
|
|
86
86
|
| "Icon medallion" | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | **Composition** — `Avatar` (square) + a Lucide glyph |
|
|
87
87
|
| **Section** / **Band** (full-bleed + measured column) | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | **Composition** — `<section>` + `Flex measure` + `pad`; see §3.1 |
|
|
88
|
+
| `TenantTheme` (customer hex at runtime) | ✅ | ➖ | ❌ | ❌ | ✅ | ❌ | ➖ | **Composition + a published FUNCTION** — `tenantTheme()`; see §3.2 |
|
|
88
89
|
|
|
89
90
|
`✅ pass · ❌ fail · ➖ borderline`. **StatCard** is the instructive borderline: C2 is weak (it owns little behavior), but it is a universal KPI tile with a controlled API, fully tokenized, broadly reused — so it earns its place. A **Hero** fails six of seven; it is unambiguously a composition.
|
|
90
91
|
|
|
@@ -147,6 +148,36 @@ primitive is missing ONE AXIS before you ask whether a new component is missing.
|
|
|
147
148
|
fails C1–C7 and a prop that closes the same gap are not the same proposal, and the test above is
|
|
148
149
|
only asking about the first.
|
|
149
150
|
|
|
151
|
+
### 3.2 `<TenantTheme>` — the case that was answered with a FUNCTION (gh#861, gh#868)
|
|
152
|
+
|
|
153
|
+
Two consumer repos asked for the same wrapper, in the same words: `<TenantTheme primary={hex}>`,
|
|
154
|
+
so that one region of a page can wear a **customer's** brand colour at runtime. One repo had
|
|
155
|
+
already hand-rolled it and shipped it to production; the other deliberately had not, because
|
|
156
|
+
copying it would have been the third private version of the same thing.
|
|
157
|
+
|
|
158
|
+
| # | verdict | why |
|
|
159
|
+
| ---------------------------------------------------- | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
160
|
+
| **C1** universal | **PASS** | Multi-tenant branding is not one design's block; two unrelated repos hit it independently, and a third (`AppSettingPicker kind="brand"`) already covers the PRESET axis, which is what makes the arbitrary-hex axis missing rather than duplicated. |
|
|
161
|
+
| **C2** owns reusable behaviour | ➖ **borderline, and it is the interesting one** | There IS behaviour that must not be re-derived per consumer — hex → HSL triplet, and the WCAG contrast rule that picks the label. But it is arithmetic, not interaction: no state, no keyboard, no focus, no ARIA, nothing a `<div>` does. C2 asks for behaviour a COMPONENT must own; a pure function owns this better, because it is then callable from a server (Platform already computes its pair at write time), from a `<style>` block with no hydration flash, and from a test with no DOM. |
|
|
162
|
+
| **C3** not expressible from primitives + tokens | **FAIL** | Once the arithmetic is published, the wrapper is `<div data-tenant={slug} style={tenantTheme(hex).vars}>` — a scoped token override, which §4.3 of this document names as the remedy for a composition. `docs/showcase/theme-customization.tsx` had already recorded the same verdict for the same shape. |
|
|
163
|
+
| **C4** single responsibility + controlled vocabulary | **FAIL** | The requested API is `primary` / `secondary` / `primaryForeground` / `tenant`. There is no `value`/`defaultValue`/`onValueChange`, no `size`, no `tone` — it is a configuration carrier with a screen-shaped API, which is the shape C4 names by name. |
|
|
164
|
+
| **C5** token-themeable, zero baked brand | **PASS** (vacuously) | It IS the theming mechanism; it bakes nothing. |
|
|
165
|
+
| **C6** earns the international contract | **FAIL** | It renders no text, has no role, no keyboard and no ARIA, so there is nothing for `t()` or the APG to say. The accessibility content of this feature is CONTRAST, and that lives in the computation and its tests — not in a component contract. |
|
|
166
|
+
| **C7** earns its bundle cost | ➖ | The arithmetic is ~60 lines and every consumer that stores a customer colour needs it. A React wrapper around a `<div>` is not what earns that. |
|
|
167
|
+
|
|
168
|
+
**Three hard FAILs. Verdict: composition pattern — plus a published function.** `tenantTheme(hex)`
|
|
169
|
+
in `@godxjp/ui/app` returns the declarations (`--primary`, `--primary-foreground`, `--ring`, and
|
|
170
|
+
the hover / pressed steps), the label it chose, the WCAG 2.2 ratio it achieves and whether that
|
|
171
|
+
clears AA. `hexToHsl` / `contrastRatio` / `relativeLuminance` ship beside it. The `<div>` lives in
|
|
172
|
+
the consumer app; `docs/showcase/tenant-brand-color.tsx` is the worked screen.
|
|
173
|
+
|
|
174
|
+
**The rule this leaves behind, and it is the twin of §3.1.** §3.1 says: when a composition repeats
|
|
175
|
+
a SHAPE, ask whether a primitive is missing one axis before you ask whether a component is missing.
|
|
176
|
+
This says: when a composition repeats a CALCULATION, ask whether the package is missing a FUNCTION.
|
|
177
|
+
A wrapper component and a published function are not the same proposal, and C1–C7 is only asking
|
|
178
|
+
about the first. The tell is C6 — if there is no text, no role and no keyboard for the
|
|
179
|
+
international contract to apply to, the thing you are holding is probably not a component.
|
|
180
|
+
|
|
150
181
|
---
|
|
151
182
|
|
|
152
183
|
## 4. How to build a composition pattern correctly
|