@godxjp/ui 33.22.1 → 33.24.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/DESIGN.md +1 -1
- package/README.md +4 -4
- package/agent/DESIGN.md +1 -1
- package/agent/START-HERE.md +7 -7
- package/agent/components/AgentBadge.json +43 -0
- package/agent/components/AppShell.json +6 -0
- package/agent/components/Avatar.json +7 -0
- package/agent/components/PageContainer.json +5 -0
- package/agent/components/PageErrorBoundary.json +48 -0
- package/agent/components/Toaster.json +1 -1
- package/agent/components/Toolbar.json +1 -1
- package/agent/components/Topbar.json +1 -1
- package/agent/components-index.json +10 -0
- package/agent/components.json +112 -3
- package/agent/index.json +7 -7
- package/agent/llms.txt +6 -6
- package/agent/tokens.json +84 -0
- package/dist/components/data-display/avatar.d.ts +1 -1
- package/dist/components/data-display/avatar.js +7 -1
- package/dist/components/data-display/badge.d.ts +11 -0
- package/dist/components/data-display/badge.js +20 -0
- package/dist/components/data-display/image.js +1 -1
- package/dist/components/data-display/index.d.ts +2 -2
- package/dist/components/data-display/index.js +2 -1
- package/dist/components/data-entry/record-picker.js +122 -98
- package/dist/components/data-entry/select.js +13 -3
- package/dist/components/layout/app-shell.d.ts +1 -1
- package/dist/components/layout/app-shell.js +3 -1
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/components/layout/index.js +2 -0
- package/dist/components/layout/page-container.d.ts +1 -1
- package/dist/components/layout/page-container.js +6 -3
- package/dist/components/layout/page-error-boundary.d.ts +32 -0
- package/dist/components/layout/page-error-boundary.js +57 -0
- package/dist/components/layout/sidebar.d.ts +1 -1
- package/dist/components/layout/sidebar.js +100 -49
- package/dist/components/layout/topbar.js +108 -21
- package/dist/components/navigation/toolbar.js +2 -1
- package/dist/contracts/measurement.json +1 -1
- package/dist/i18n/messages/en.json +6 -0
- package/dist/i18n/messages/ja.json +6 -0
- package/dist/i18n/messages/vi.json +6 -0
- package/dist/props/components/data-display.prop.d.ts +27 -0
- package/dist/props/components/layout.prop.d.ts +45 -0
- package/dist/props/components/navigation.prop.d.ts +12 -1
- package/dist/props/registry.d.ts +50 -2
- package/dist/props/registry.js +72 -3
- package/dist/styles/alert-layout.css +4 -0
- package/dist/styles/badge-layout.css +14 -0
- package/dist/styles/data-display-layout.css +44 -0
- package/dist/styles/icon-layout.css +3 -0
- package/dist/styles/layers.json +22 -2
- package/dist/styles/layout.css +11 -0
- package/dist/styles/shell-layout.css +17 -1
- package/dist/styles/table-layout.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/tokens/components/badge.css +3 -0
- package/dist/tokens/components/data-display.css +9 -0
- package/dist/tokens/components/shell.css +2 -0
- package/dist/tokens/foundation.css +8 -0
- package/docs/CONSUMER-RULES.md +1 -1
- package/package.json +3 -2
- package/scripts/consumer-rule.md +1 -1
- package/skills/godxjp-ui-navigation/SKILL.md +14 -9
- package/skills/godxjp-ui-navigation/references/principles.md +2 -2
|
@@ -144,6 +144,15 @@
|
|
|
144
144
|
--avatar-presence-busy-color: initial;
|
|
145
145
|
--avatar-presence-offline-color: initial;
|
|
146
146
|
|
|
147
|
+
--avatar-agent-font-size: initial;
|
|
148
|
+
--avatar-agent-font-weight: initial;
|
|
149
|
+
--avatar-agent-padding-inline: initial;
|
|
150
|
+
--avatar-agent-inset: initial;
|
|
151
|
+
--avatar-agent-ring-width: initial;
|
|
152
|
+
--avatar-agent-background: initial;
|
|
153
|
+
--avatar-agent-foreground: initial;
|
|
154
|
+
--avatar-agent-ring-color: initial;
|
|
155
|
+
|
|
147
156
|
--progress-track-background: initial;
|
|
148
157
|
--progress-track-background-alpha: initial;
|
|
149
158
|
--progress-fill-background: initial;
|
|
@@ -100,6 +100,8 @@
|
|
|
100
100
|
--app-shell-bar-inset-compact: var(--space-page-compact-x);
|
|
101
101
|
--app-shell-bar-gap: var(--space-3);
|
|
102
102
|
|
|
103
|
+
--app-shell-rail-gap: var(--space-3);
|
|
104
|
+
|
|
103
105
|
--app-shell-brand-max-inline-size: none;
|
|
104
106
|
--app-shell-brand-compact-max-inline-size: var(--app-shell-bar-height);
|
|
105
107
|
|
|
@@ -41,6 +41,10 @@
|
|
|
41
41
|
--attention: 25 99% 46%;
|
|
42
42
|
--attention-foreground: 48 8% 13%;
|
|
43
43
|
|
|
44
|
+
--agent: 262 83% 58%;
|
|
45
|
+
--agent-foreground: 0 0% 100%;
|
|
46
|
+
--text-agent: 263 70% 50%;
|
|
47
|
+
|
|
44
48
|
--brand: 240 6% 10%;
|
|
45
49
|
--brand-foreground: 60 33% 99%;
|
|
46
50
|
|
|
@@ -383,6 +387,10 @@
|
|
|
383
387
|
--attention: 25 95% 56%;
|
|
384
388
|
--attention-foreground: 48 9% 9%;
|
|
385
389
|
|
|
390
|
+
--agent: 262 83% 58%;
|
|
391
|
+
--agent-foreground: 0 0% 100%;
|
|
392
|
+
--text-agent: 252 95% 85%;
|
|
393
|
+
|
|
386
394
|
--brand: 0 0% 98%;
|
|
387
395
|
--brand-foreground: 48 9% 9%;
|
|
388
396
|
|
package/docs/CONSUMER-RULES.md
CHANGED
|
@@ -7,7 +7,7 @@ should look like) is in the package's `DESIGN.md`. Everything else in `docs/` is
|
|
|
7
7
|
2. **Mount `<AppProvider defaultLocale="…">` once, at the root.** Without it the kit's OWN strings (dialog close/cancel/delete, counters, picker labels) fall to the resting locale (`<html lang>` when it names a registered locale, else `en`) and pickers to UTC (gh#1005). A development build now warns once when a kit component renders outside it; `syncI18nLocale(locale, fallback)` is the escape for an app that truly cannot mount the provider. Every page is `<PageContainer title extra footer>` (a `subtitle` only when it adds a fact the title does not); its sections are spaced by the page. Group items inside a section with `<Flex direction="col" gap>` or `<ResponsiveGrid>`.
|
|
8
8
|
3. No Tailwind layout on your own elements: no `flex`, `grid`, `gap-*`, `p-*`, `m-*`, `space-*`. Rows are `<Flex>` (default row), stacks are `<Flex direction="col">`, grids are `<ResponsiveGrid>`. A list's filters are ONE `<FilterBar>` that wraps at every width — never a sideways-scrolling strip of filters or filter chips; past 2–4 filters the rest go behind one "More filters" `Sheet` (cardinal rule #51, pattern `list-filters`, audit rules `filter-bar-no-overflow`, `filter-strip-no-scroll` and `hand-rolled-filter-bar`). Filters are packed at the start: never a hand-built `<Flex justify="between">` of FormFields above a table. Many conditions or an explicit 検索 button → `SearchForm` (pattern `search-form`); field × operator rows saved as views → pattern `condition-builder`.
|
|
9
9
|
4. No hand-rolled surfaces: no `rounded-* border bg-*` divs. A box is `Card`, a pill is `Badge`, a person is `Avatar`, a row is `ListRow`, a label/value pair is `Descriptions`, an empty area is `EmptyState`, a read-only sample of a colour the USER chose is `Swatch`. A LIST of those rows is `<Flex as="ul" marker="none" direction="col" gap="none">` with `<ListRow as="li">` children — `marker="none"` keeps the `<ul>`, the `<li>` semantics and the gap token while dropping the bullet and the indent. Never a raw `<ul>`/`<ol>` (it carries no gap token), never `<div role="list">` + `<div role="listitem">`, and never a wrapper around each row: the divider is `:not(:last-child)` among siblings, so a row alone in its own wrapper is always the last one and EVERY divider disappears silently. A bulleted prose list is the same `<Flex as="ul">` without `marker`.
|
|
10
|
-
5. Real controls only: `Button`, `Input`, `Select`, `Textarea`, `Checkbox`… never raw `<button>`/`<input>`; a labelled control lives in `<FormField label>`. A Select outside a form takes `width="auto"`. **A disabled control's reason is visible text, never a tooltip** — see below. **Fields live in a `<Form
|
|
10
|
+
5. Real controls only: `Button`, `Input`, `Select`, `Textarea`, `Checkbox`… never raw `<button>`/`<input>`; a labelled control lives in `<FormField label>`. A Select outside a form takes `width="auto"`. **A disabled control's reason is visible text, never a tooltip** — see below. **Fields live in a `<Form>`** — never a group of `FormField`s without one, never a hand-rolled `<Flex>` row of fields (a row that belongs together is `<Flex attached>` or `<Form columns>`). `layout="horizontal"` with `labelWidth`/`controlWidth` is the desktop default; `layout="vertical"` (labels above the inputs, as GOV.UK and the W3C WAI forms tutorial show) is equally valid when labels are long, the container is narrow, or the page asks one short question per row (gh#1496). Size each control for its content with `controlWidth` (GOV.UK text-input width: a port ~7rem, a short enum ~10rem). **GoDX house rule:** a form with three or more fields is its own page, not a Dialog (audit `dialog-form-too-big`) — a product decision for task focus and recovery, not a WCAG requirement. The audit rules are `formfield-needs-form`, `dialog-form-too-big` and `select-width-hint`. **A case the kit cannot express is an issue, not a hand-roll:** open it on godx-jp/godxjp-ui, use the nearest valid composition, and mark it `// TODO(godxjp-ui#<n>)` (gh#998). **One action row, one Button size:** every `Button` under one parent takes the same `size` — a missing size is `default`, and `icon-sm` pairs with `sm`, `icon-xs` with `xs`, `icon` with default. Never `size="sm"` beside a default Button. The audit rules are `mixed-button-size` (static) and `mixed-button-height` (visual-audit, within 0.5px) (gh#1084).
|
|
11
11
|
6. Text is `<Text>` / `<Heading>` with `tone`, `size`, `weight`, `truncate`, `mono` — not `className="text-muted-foreground font-semibold"`. A STANDALONE glyph is `<Icon as={Lock} size="sm" tone="muted" />` from `@godxjp/ui/general`: a bare lucide icon carries its own `width="24" height="24"` and only four places re-size it for you (`Button`, a `DropdownMenuItem`, a `TopbarItem`, a `ListRow` leading slot), so everywhere else — in a `Text`, a table cell, an `<a>` — it draws at 24px beside 14px type. `size-4` and `w-[16px]` are closed to you by rules 3 and 8, and `size={16}` hard-codes a number the theme owns; `Icon` puts the glyph on the `--icon-size-*` scale (`2xs…4xl`) instead, and is `aria-hidden` unless you give it a `label` (then it is `role="img"` with that name). The audit rule is `lucide-icon-needs-size`.
|
|
12
12
|
7. Colours are semantic tokens (`tone="destructive"`, `bg-primary`), never palette names, hex, or `bg-black` / `text-white`.
|
|
13
13
|
8. Sizes come from props (`size`, `width`, `columns`), never `w-[240px]` / `max-h-[420px]`.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@godxjp/ui",
|
|
3
|
-
"version": "33.
|
|
4
|
-
"godxUiMcp": "33.
|
|
3
|
+
"version": "33.24.0",
|
|
4
|
+
"godxUiMcp": "33.24.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -406,6 +406,7 @@
|
|
|
406
406
|
"check:no-tailwind-class-assertions": "node scripts/check-no-tailwind-class-assertions.mjs",
|
|
407
407
|
"check:number-input-step-target": "node scripts/check-number-input-step-target.mjs",
|
|
408
408
|
"check:packed-public-contract": "node scripts/check-packed-public-contract.mjs",
|
|
409
|
+
"check:packed-export-types": "node scripts/check-packed-export-types.mjs",
|
|
409
410
|
"check:pr-closes-keyword": "node scripts/check-pr-closes-keyword.mjs",
|
|
410
411
|
"check:prop-vocabulary": "node scripts/check-prop-vocabulary.mjs",
|
|
411
412
|
"check:radix-surface": "node scripts/check-radix-surface.mjs",
|
package/scripts/consumer-rule.md
CHANGED
|
@@ -109,7 +109,7 @@ godx-mailer dính bốn lỗi form trong một ngày, cả bốn đều là kit
|
|
|
109
109
|
|
|
110
110
|
| Sai | Đúng | rule |
|
|
111
111
|
| ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ---------------------- |
|
|
112
|
-
| ≥2 `FormField` không có `Form`, hoặc xếp hàng bằng `<Flex>` | `<Form layout="horizontal" labelWidth controlWidth
|
|
112
|
+
| ≥2 `FormField` không có `Form`, hoặc xếp hàng bằng `<Flex>` | `<Form>` (`layout="horizontal" labelWidth controlWidth` là mặc định desktop; `layout="vertical"` hợp lệ khi nhãn dài/khung hẹp); hàng = `<Flex attached>` / `Form columns` | `formfield-needs-form` |
|
|
113
113
|
| ≥3 `FormField` trong `DialogBody` | page riêng (route riêng) | `dialog-form-too-big` |
|
|
114
114
|
| `Select` hai lựa chọn kéo full width | `controlWidth` trên field hoặc một lần trên `Form` | `select-width-hint` |
|
|
115
115
|
|
|
@@ -42,12 +42,16 @@ comparisons, domain vocabulary) in its own repository; they do not belong in thi
|
|
|
42
42
|
## 2. Hard rules
|
|
43
43
|
|
|
44
44
|
**Count and form**
|
|
45
|
-
- Phone: **bottom bar with 3–5
|
|
46
|
-
|
|
45
|
+
- Phone: **bottom bar with 3–5 destinations**; every slot navigates, never an action slot (see
|
|
46
|
+
principles §1.6 and rule 11). The #1 create action sits above the bar (a FAB) or in the top bar.
|
|
47
|
+
Everything else goes under "More". Never put setup on the bottom bar. Desktop: **an always-visible sidebar**, not
|
|
47
48
|
only a ☰ button. Choose by window width, not by device. (@godxjp/ui's `MobileShell` has a bottom
|
|
48
49
|
bar — use it; don't rely on a drawer alone.)
|
|
49
|
-
-
|
|
50
|
-
|
|
50
|
+
- Keep the sidebar shallow (aim for **2 levels**, groups with short headings) and each role's primary
|
|
51
|
+
list short (**~7 items**). These numbers are **review signals, not pass/fail limits**: when a role
|
|
52
|
+
exceeds them, validate the tree with the role's real tasks (tree test or walkthrough) and split by
|
|
53
|
+
work area rather than hiding items in a catch-all group. Record data deeper than the menu →
|
|
54
|
+
list → detail inside the page.
|
|
51
55
|
|
|
52
56
|
**Grouping and labels**
|
|
53
57
|
- Group by **task / work area**. Never group by data table, org chart or developer vocabulary
|
|
@@ -59,8 +63,8 @@ comparisons, domain vocabulary) in its own repository; they do not belong in thi
|
|
|
59
63
|
- **Each destination appears once** in the menu. Two items leading to the same kind of record = a
|
|
60
64
|
defect.
|
|
61
65
|
- Action buttons (Log/Create) are **not menu items**: one prominent primary button (top of the menu,
|
|
62
|
-
or
|
|
63
|
-
their parent's page.
|
|
66
|
+
or a create button above the bottom bar — never inside a bar slot) for the #1 task; child objects
|
|
67
|
+
are created right inside their parent's page.
|
|
64
68
|
|
|
65
69
|
**Per role**
|
|
66
70
|
- Each role has its **own fixed landing page**: frontline staff → "Today" (due, overdue, my tasks);
|
|
@@ -99,14 +103,15 @@ An example only, for apps that run recurring checks across many sites:
|
|
|
99
103
|
stay **permanently linked** to their source record.
|
|
100
104
|
- Staff land on "Today" plus a separate place for "Overdue/Missed"; managers land on a rate table plus
|
|
101
105
|
exceptions.
|
|
102
|
-
- Phone bottom bar: 4–5
|
|
106
|
+
- Phone bottom bar: 4–5 destinations (e.g. Today · Inspections · Nonconformities · More), with
|
|
107
|
+
+ Log as a button above the bar.
|
|
103
108
|
- Vocabulary: avoid "Reports"/"レポート" as the label for *records* (in English "Reports" means
|
|
104
109
|
analytics; in Japanese "レポート" often means an individual record).
|
|
105
110
|
|
|
106
111
|
## 4. Self-check gate (before asking for approval / before merging)
|
|
107
112
|
|
|
108
|
-
- [ ] A task table per role and a text menu tree per role exist;
|
|
109
|
-
3–5
|
|
113
|
+
- [ ] A task table per role and a text menu tree per role exist; a role past ~7 primary items or 2
|
|
114
|
+
levels has a tree test or walkthrough behind it; phone 3–5 destinations, no action slot.
|
|
110
115
|
- [ ] Walkthrough of 8–10 tasks per role: no step answered "no"; no pair of competing labels.
|
|
111
116
|
- [ ] No duplicate destinations; no grouping by data table; label = H1 = `<title>`, consistent across
|
|
112
117
|
every locale.
|
|
@@ -215,7 +215,7 @@ The Atlassian Design System's public navigation page and the Salesforce Lightnin
|
|
|
215
215
|
| Breadcrumb as history, or a breadcrumb plus a back link | Breadcrumbs show hierarchy [P] NN/g; "Never use the back link… together with the Breadcrumbs" [P] GOV.UK |
|
|
216
216
|
| Losing list position or filters on Back | "the page often resets to the top of the list" [P] NN/g saving scroll position |
|
|
217
217
|
| Main navigation in the page header, or repeated in the page body | "Avoid placing the main navigation in the page header"; avoid "replicating the app nav content in the app body" [P] Shopify |
|
|
218
|
-
| More than 2 levels of sidebar or cascading menus | [P] HIG sidebars; Carbon; Fluent; NN/g menu design |
|
|
218
|
+
| More than 2 levels of sidebar or cascading menus, with no tree test or walkthrough behind them | [P] HIG sidebars; Carbon; Fluent; NN/g menu design |
|
|
219
219
|
| Dead ends on object pages | Give paths onward from every object instance [Pr] OOUX (A List Apart) |
|
|
220
220
|
|
|
221
221
|
---
|
|
@@ -232,7 +232,7 @@ The Atlassian Design System's public navigation page and the Salesforce Lightnin
|
|
|
232
232
|
| 6 | Labels are short nouns in the users' words, 1–2 words, never coined terms. | https://shopify.dev/docs/apps/design/navigation ; https://www.nngroup.com/articles/top-10-ia-mistakes/ |
|
|
233
233
|
| 7 | Every navigation item has a visible text label. Icons only support the label. Never truncate. | https://m3.material.io/components/navigation-bar/guidelines |
|
|
234
234
|
| 8 | Order by frequency of use measured from users (top-tasks vote or field study). Positions stay fixed. | https://www.nngroup.com/articles/progressive-disclosure/ ; https://www.w3.org/WAI/WCAG22/Understanding/consistent-navigation.html |
|
|
235
|
-
| 9 | Sidebar:
|
|
235
|
+
| 9 | Sidebar: aim for 2 levels, with short group headings — a review signal, not a pass/fail limit. A third level is for a work area that needs it, validated by a tree test or walkthrough; record data goes into list → detail inside the page. | https://developer.apple.com/design/human-interface-guidelines/sidebars |
|
|
236
236
|
| 10 | Settings, admin and configuration live apart from daily work (utility area or admin section), behind a second level at most. | https://www.nngroup.com/articles/utility-navigation/ ; https://www.nngroup.com/articles/progressive-disclosure/ |
|
|
237
237
|
| 11 | Navigation slots navigate; they never perform actions. Put Create in a FAB or top bar for the main object, and in context for children. | https://developer.apple.com/design/human-interface-guidelines/tab-bars |
|
|
238
238
|
| 12 | Each role gets its own fixed start page, named after the work area, with task-oriented sections. | https://www.sap.com/design-system/fiori-design-web/v1-148/foundations/integration-and-services/sap-fiori-launchpad/sap-fiori-launchpad-spaces |
|