@godxjp/ui 2.1.0 → 5.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.
Files changed (46) hide show
  1. package/BRAND.md +39 -29
  2. package/CHANGELOG.md +554 -10
  3. package/README.md +143 -168
  4. package/config/eslint.js +54 -0
  5. package/config/prettier.cjs +20 -0
  6. package/config/tsconfig.base.json +22 -0
  7. package/config/vitest.base.ts +26 -0
  8. package/dist/MiniMonth-YAmPGEpC.d.ts +143 -0
  9. package/dist/Table.types-BbsxoIYE.d.ts +352 -0
  10. package/dist/color-DO0qqUAb.d.ts +38 -0
  11. package/dist/components/composites.d.ts +963 -0
  12. package/dist/components/composites.js +7340 -0
  13. package/dist/components/composites.js.map +1 -0
  14. package/dist/components/primitives.d.ts +2633 -163
  15. package/dist/components/primitives.js +7264 -165
  16. package/dist/components/primitives.js.map +1 -1
  17. package/dist/components/shell.d.ts +82 -12
  18. package/dist/components/shell.js +168 -162
  19. package/dist/components/shell.js.map +1 -1
  20. package/dist/hooks.d.ts +83 -8
  21. package/dist/hooks.js +497 -83
  22. package/dist/hooks.js.map +1 -1
  23. package/dist/i18n.d.ts +55 -3
  24. package/dist/i18n.js +456 -5
  25. package/dist/i18n.js.map +1 -1
  26. package/dist/index.d.ts +24 -5
  27. package/dist/index.js +12522 -267
  28. package/dist/index.js.map +1 -1
  29. package/dist/padding-DY0JV5Ja.d.ts +16 -0
  30. package/dist/preferences.d.ts +132 -0
  31. package/dist/preferences.js +262 -0
  32. package/dist/preferences.js.map +1 -0
  33. package/dist/props.d.ts +86 -0
  34. package/dist/props.js +16 -0
  35. package/dist/props.js.map +1 -0
  36. package/dist/size-CQwNvOWd.d.ts +19 -0
  37. package/dist/{data.d.ts → types-LTj-2bl-.d.ts} +7 -12
  38. package/dist/useTableViews-D5NIAJ7h.d.ts +154 -0
  39. package/package.json +92 -34
  40. package/src/tokens/tailwind.css +158 -0
  41. package/dist/components/screens.d.ts +0 -51
  42. package/dist/components/screens.js +0 -806
  43. package/dist/components/screens.js.map +0 -1
  44. package/dist/data.js +0 -93
  45. package/dist/data.js.map +0 -1
  46. package/src/tokens/tokens.css +0 -765
package/BRAND.md CHANGED
@@ -15,33 +15,40 @@ import "./app.tsx";
15
15
  ```
16
16
 
17
17
  That single import wires:
18
- - type scale, color palette, OKLCH dark mode, four tenants
19
- (godx / kintai / tempo / betoya), density modes, spacing grid,
20
- shadows, motion
18
+ - type scale, color palette, OKLCH dark mode, four canonical theme
19
+ axes (`data-theme` / `data-accent` / `data-density` /
20
+ `data-font-size` per cardinal rule 21), spacing grid, shadows,
21
+ motion
21
22
  - all application-shell CSS classes (`.app-root`, `.sb-*`, `.tb-*`,
22
23
  `.btn`, `.badge`, `.card`, `.kanban`, `.diff`, `.prose`,
23
24
  `.auth-shell`, …)
24
25
 
25
- For React: also pull pre-built primitives + screens:
26
+ For React: also pull pre-built primitives + shell:
26
27
 
27
28
  ```tsx
28
29
  import { AppShell, Sidebar, Topbar, TweaksPanel } from "@godxjp/ui/components/shell";
29
- import { DashboardScreen, PlansScreen, IssuesScreen, WikiScreen } from "@godxjp/ui/components/screens";
30
+ import { Button, Card, Input, Field } from "@godxjp/ui/components/primitives";
30
31
  import { useTweaks } from "@godxjp/ui/hooks";
31
32
  import { initI18n } from "@godxjp/ui/i18n";
32
33
  ```
33
34
 
35
+ (Page-level example screens — `DashboardScreen`, `PlansScreen`,
36
+ etc. — live in Storybook under `src/stories/examples/` only. There
37
+ is no `@godxjp/ui/components/screens` export per cardinal rule
38
+ 28 §D — copy-paste-and-modify the example screens into your app.)
39
+
34
40
  **There is no theming step.** No per-service "wire up tokens" boilerplate. If a screen needs more than this provides, the answer is to add the primitive to `@godxjp/ui`, not fork.
35
41
 
36
42
  ## Optional service-local overlay
37
43
 
38
- If — and only if — a service has a **brand-approved** deviation (e.g.
39
- a new tenant variant, a service-specific accent), the service ships
40
- a single overlay file:
44
+ If — and only if — a service has a **brand-approved** deviation
45
+ (e.g. a service-specific accent palette), the service ships a
46
+ single overlay file under the `data-accent` axis (per cardinal
47
+ rule 19 — the legacy `[data-tenant]` block is removed):
41
48
 
42
49
  ```css
43
50
  /* services/<svc>/frontend/src/theme.css */
44
- [data-tenant="my-svc"] {
51
+ [data-accent="my-svc"] {
45
52
  --primary: oklch(56% 0.15 200); /* still chroma ≤ 0.18 */
46
53
  --ring: oklch(56% 0.15 200);
47
54
  }
@@ -54,8 +61,8 @@ import "@godxjp/ui/tokens";
54
61
  import "./theme.css"; // overlay
55
62
  ```
56
63
 
57
- The overlay can **only** redeclare brand-token CSS variables under a
58
- `[data-tenant]` or `[data-theme]` attribute selector. Editing
64
+ The overlay can **only** redeclare brand-token CSS variables under
65
+ a `[data-accent]` or `[data-theme]` attribute selector. Editing
59
66
  foundational variables on `:root`, redefining the type scale, or
60
67
  overriding shell classes is forbidden and a review-block.
61
68
 
@@ -85,11 +92,13 @@ enterprise aesthetics):
85
92
  These are NOT taste choices — they're brand contracts. Any visual
86
93
  direction that breaks them needs operator sign-off in advance.
87
94
 
88
- ## Token surface (read from `src/tokens/tokens.css`)
95
+ ## Token surface (read from `src/styles/theme.css`)
89
96
 
90
- One file. Variables + application-shell classes mastered together so
91
- consumers do `import "@godxjp/ui/tokens"` once and get everything. The
92
- design handoff bundle split them into `tokens.css` + `tokens-ext.css`
97
+ Tokens + application-shell classes mastered together so consumers
98
+ do `import "@godxjp/ui/tokens"` once and get everything. Variables
99
+ live in `src/styles/theme.css` (canonical) + `src/styles/shell.css`
100
+ (shell-extension); the design handoff bundle originally split them
101
+ into `tokens.css` + `tokens-ext.css`
93
102
  for portability to Figma / theme tools — that split is preserved
94
103
  verbatim under `design/source-2026-05-13/` as an audit trail; the
95
104
  consumable artefact in `src/tokens/` is intentionally merged.
@@ -124,10 +133,11 @@ enterprise vibe: `--heading-h1 = 20px`, `--heading-h2 = 18px`,
124
133
 
125
134
  ### Color — OKLCH only
126
135
 
127
- Primary palette mastered in OKLCH so dark mode + tenant overrides are
136
+ Primary palette mastered in OKLCH so dark mode + accent overrides are
128
137
  mechanical. Never override `--primary` / `--foreground` /
129
138
  `--background` / `--card` / `--muted` in app code; switch via
130
- `[data-tenant]` or `[data-theme="dark"]` attributes.
139
+ `[data-accent="<palette>"]` or `[data-theme="dark"]` attributes
140
+ (per cardinal rule 19 — `[data-tenant]` is removed).
131
141
 
132
142
  ```
133
143
  --background warm off-white oklch(99% 0.002 60)
@@ -148,20 +158,19 @@ as a button color; use `--destructive`). The palette:
148
158
  `--wa-moegi` `--wa-yamabuki` `--wa-shu` `--wa-akane` `--wa-enji`
149
159
  `--wa-sakura` `--wa-sumi` `--wa-nezu`.
150
160
 
151
- ### Tenant overrides
152
-
153
- Brand palette swaps via `[data-tenant="<slug>"]` at `<html>` or any
154
- ancestor. Defined slugs:
161
+ ### Accent overrides
155
162
 
156
- - `godx` (default) Famgia emerald accent + SmartHR blue primary
157
- - `kintai`SmartHR blue primary
158
- - `tempo` deeper indigo
159
- - `betoya` Vietnamese green (Betoya restaurant brand)
163
+ Brand palette swaps via `[data-accent="<palette>"]` at `<html>` or
164
+ any ancestor (per cardinal rule 19 the legacy `[data-tenant]`
165
+ axis was collapsed into `data-accent`). Six framework-shipped
166
+ palettes: `blue` (default) · `green` · `violet` · `amber` · `rose`
167
+ · `slate`. Consumers register their own palettes in a service
168
+ `theme.css` overlay.
160
169
 
161
170
  ### Dark mode
162
171
 
163
- `[data-theme="dark"]` flips every surface + tenant. Already wired in
164
- `tokens-ext.css`.
172
+ `[data-theme="dark"]` flips every surface + accent. Already wired
173
+ in `src/styles/shell.css`.
165
174
 
166
175
  ### Density
167
176
 
@@ -272,8 +281,9 @@ and match its visual rhythm. Don't redesign solo without a precedent.
272
281
 
273
282
  When the operator approves a brand change:
274
283
 
275
- 1. Update `src/tokens/tokens.css` and/or `tokens-ext.css` here in
276
- `packages/godxjp-ui`.
284
+ 1. Update `src/styles/theme.css` (canonical tokens) and/or
285
+ `src/styles/shell.css` (shell-extension tokens) here in
286
+ `libs/ts/godxjp-ui`.
277
287
  2. Bump the package version.
278
288
  3. Bump the submodule pointer in `godx-admin` umbrella.
279
289
  4. Each portal pulls the new submodule SHA in a follow-up PR.