@ai-matrx/design-system 0.4.1 → 0.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,140 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.0 — 2026-09-07
4
+
5
+ **THE GROWTH WAVE (C18).** The 2026-09-07 adoption lane deleted 34 forked
6
+ primitives across four repos but had to KEEP every primitive this package did
7
+ not ship. This release ships them, so those forks can die too.
8
+
9
+ Thirteen new primitives, each built from EVERY host variant rather than from
10
+ one repo's copy: `Avatar`, `Card`, `Checkbox`, `Collapsible`, `ContextMenu`,
11
+ `Dialog`, `DropdownMenu`, `Progress`, `ScrollArea`, `Switch`, `Table`, `Tabs`,
12
+ `Textarea`. Plus `useIsMobile` / `MOBILE_BREAKPOINT`, lifted out of
13
+ `command.tsx` (where it was private) because Dialog needed the same answer and
14
+ two breakpoint hooks in one package is the duplication this package exists to
15
+ end.
16
+
17
+ **Density is a prop, never a fork.** The single biggest reason four hosts kept
18
+ four cards and four tables was padding. `Card` (`size` sm/md/lg → p-2/p-4/p-6)
19
+ and `Table` (`size` sm/md → p-2/p-3) declare density ONCE on the root; every
20
+ section reads it from context, so a card cannot end up with a `p-6` header
21
+ above a `p-2` body. `Switch`, `Avatar` and `Checkbox` carry the same treatment
22
+ for the box sizes their forks disagreed on.
23
+
24
+ **Rulings the forks had already paid for, now carried once:**
25
+
26
+ - **No hydration mount gates.** Dialog, DropdownMenu, ContextMenu, Tabs and
27
+ Collapsible all render their roots unconditionally. The gate they inherited
28
+ rested on a false premise (Radix ids come from React's SSR-stable `useId`)
29
+ and deleted always-visible triggers from SSR and the first client paint —
30
+ around a list row, the list painted EMPTY and filled in after hydration.
31
+ - **The dialog is clamped and scrolls inside itself; its footer is sticky.**
32
+ From the live incident where an 851px dialog in a 657px viewport put its
33
+ Create button below the fold, leaving only a backdrop click that dismisses
34
+ WITHOUT writing.
35
+ - **Inactive tab panels UNMOUNT.** `forceMount` is opt-in. Force-mounting every
36
+ panel once let a HIDDEN tab win a provider tie-break and serve the VISIBLE
37
+ tab another tab's rows.
38
+ - **A menu longer than the viewport scrolls instead of growing off-screen** —
39
+ both menus cap at the height Radix measured.
40
+ - **An indeterminate `Progress` no longer renders as a confident 0%.** The
41
+ shadcn body every host copied computed `translateX(-${100 - (value || 0)}%)`,
42
+ turning "nobody knows" into "not started". Indeterminate now sweeps and
43
+ carries `data-state="indeterminate"`.
44
+ - **An indeterminate `Checkbox` shows a different glyph than a checked one** —
45
+ a half-selected "select all" wearing a full check states something false.
46
+
47
+ **Seams.** Dialog, DropdownMenu and ContextMenu portal through
48
+ `usePortalContainer`; `DialogContent` PROVIDES that container to its own
49
+ children, so a popover or menu opened inside a dialog mounts inside it (staying
50
+ in the scroll shard where its wheel events work). `useDialogContainer` exposes
51
+ the same element. An explicit `container` prop always wins.
52
+ `ScrollArea` exposes `viewportClassName` / `viewportRef` / `scrollBarClassName`
53
+ — the viewport being unreachable is precisely why workflow-studio forked it,
54
+ and `viewportRef` is the scrolling element programmatic scroll-to-bottom needs.
55
+
56
+ **CSS (C26):**
57
+
58
+ - `styles.css` gains `.shadow-textarea` and `.matrx-progress-indeterminate`
59
+ (plus its keyframes, declared unlayered because keyframes cannot live inside
60
+ a layer's rule set portably). Still zero hardcoded colour.
61
+ - `tokens.css` gains `--shadow-textarea`, defaulting to `--shadow-input`.
62
+
63
+ **Corrections shipped with the ports (visual, deliberate, listed so nobody
64
+ reports them as regressions):**
65
+
66
+ - `shadow-textarea` NOW EXISTS. The ported Textarea asked for it at every call
67
+ site and NO host defined the token or generated the utility, so ~125 fields
68
+ rendered flat while their code said otherwise. Set `--shadow-textarea: none`
69
+ for the old flat look.
70
+ - Textarea colour moves onto tokens (literal black/white body text, raw
71
+ palette placeholder and focus ring, and a dark elevation referencing a
72
+ property no host defined — which computed to no shadow at all).
73
+ - `Input` / `BasicInput` gain `file:text-foreground`, so a file input's button
74
+ label follows the theme instead of the UA default.
75
+ - Switch's OFF track reads `bg-input` everywhere (workflow-studio's fork used
76
+ `bg-muted`, which makes an off switch vanish into a muted panel).
77
+ - `CardHeader` / `CardFooter` corner rounding is `rounded-t/b-[inherit]`, so it
78
+ matches whatever radius the card actually has (matrx-frontend's fork rounded
79
+ sections to `lg` inside an `xl` card).
80
+ - `AvatarFallback` carries defined type (`text-muted-foreground`, sized by the
81
+ avatar's `size`) instead of inheriting whatever the surrounding row used.
82
+ - `Table` keeps matrx-frontend's horizontal-scroll wrapper as the default
83
+ (`wrap={false}` to opt out) and offers dashboard's sticky header as
84
+ `<TableHeader sticky>`.
85
+
86
+ **Radix packages are ordinary dependencies of this package, not peers** (only
87
+ `react`/`react-dom` are peers), and all of them moved to current latest.
88
+
89
+ ### Consumer action (C28)
90
+
91
+ Install `@ai-matrx/design-system@0.5.0` and DELETE these forks. Every one is a
92
+ copy of something this version now ships:
93
+
94
+ - **matrx-frontend** — `components/ui/{avatar,card,checkbox,collapsible,dialog,dropdown-menu,progress,scroll-area,switch,table,tabs,textarea}.tsx`
95
+ and `components/ui/context-menu/context-menu.tsx`. High-fanout files become
96
+ re-export shims that bind this repo's historical variant (`Card size="sm"`,
97
+ `Switch size="sm"`, `Table size="sm"`), matching what the 08-30 swap
98
+ established for `button` / `badge` / `label` / `separator`. The
99
+ clipboard/motion variants (`CopyInput`, `FancyInput`, `DeleteInput`,
100
+ `CopyTextarea`, `FancyTextarea`) stay host-owned under the C8 split-out law.
101
+ - **matrx-extend** — `src/components/ui/{card,scroll-area,switch,tabs,textarea}.tsx`.
102
+ `src/components/ui/collapsible.tsx` is NOT a fork of this package's
103
+ `Collapsible` — it is a bespoke labelled-section control with its own API —
104
+ and stays.
105
+ - **matrx-games** — `components/ui/{avatar,dropdown-menu,progress,tabs}.tsx`
106
+ (dead code: zero import sites) and `components/ui/scroll-area.tsx`.
107
+ `card.tsx` and `dialog.tsx` are a different generation (Base UI, not Radix)
108
+ carrying that app's own visual language; they are DEFERRED, not forgotten —
109
+ see FEATURE.md § Deferred.
110
+ - **aidream/apps/dashboard** — `src/components/ui/{avatar,card,checkbox,context-menu,dialog,dropdown-menu,scroll-area,switch,table,tabs,textarea}.tsx`.
111
+ Pass `Card size="lg"` and `Table size="md"` to keep this app's density.
112
+ - **aidream/apps/workflow-studio** — `src/components/ui/{dialog,dropdown-menu,scroll-area,switch,tabs,textarea}.tsx`.
113
+ Its ScrollArea viewport hack becomes `viewportClassName="[&>div]:!block [&>div]:min-w-0"`.
114
+
115
+ Hosts that do not already import the stylesheets must, or the new structural
116
+ rules do nothing:
117
+
118
+ ```ts
119
+ import "@ai-matrx/design-system/tokens.css";
120
+ import "@ai-matrx/design-system/styles.css";
121
+ ```
122
+
123
+ ## 0.4.2
124
+
125
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
126
+ `git diff npm/design-system/v0.4.1..npm/design-system/v0.4.2 -- apps/shared/design-system`).
127
+ No source changes intended and no consumer action required.
128
+
129
+ ## 0.4.1
130
+
131
+ Automatic changed-only republish (docs/metadata drift since v0.4.0 — the
132
+ FEATURE.md header moved to STATE-not-version, and the `@ai-matrx/kit` spec
133
+ became `workspace:*` under the sibling-graph guard; pnpm substitutes the same
134
+ published version at pack time). No source changes and no consumer action
135
+ required. Verify with
136
+ `git diff npm/design-system/v0.4.0..npm/design-system/v0.4.1 -- apps/shared/design-system`.
137
+
3
138
  ## 0.4.0 — 2026-08-30
4
139
 
5
140
  **The package ships its CSS.** Closes the C26 clause of the all-inclusive
@@ -66,12 +201,28 @@ palette colour.
66
201
  ```
67
202
 
68
203
  2. **Declare the layer order once**, as the first line of your Tailwind/CSS
69
- entry, so the package's default token values stay below your own:
204
+ entry:
70
205
 
71
206
  ```css
72
207
  @layer matrx-design-system-tokens, matrx-design-system;
73
208
  ```
74
209
 
210
+ **What actually protects your brand (corrected 2026-09-07, learned adopting four
211
+ more apps):** Tailwind v4 does NOT emit this statement into the built sheet — it
212
+ survives only as the relative order of the two package layers. Your tokens win
213
+ because host `:root` declarations are UNLAYERED and unlayered beats every layer.
214
+ So: keep your `:root { --primary: … }` declarations unlayered (never wrap them in
215
+ `@layer`), or the package defaults will override them. Verify on the BUILT css:
216
+ the package `--success` should appear inside `@layer matrx-design-system-tokens`
217
+ and your own `--success` later, unlayered.
218
+
219
+ 2b. **Map the status colours or Badge/ScoreRing render NO css.** The package's
220
+ `Badge` `success`/`warning`/`info` variants and the ScoreRing helpers resolve
221
+ `--color-success` / `--color-warning` / `--color-info`. A host whose `@theme`
222
+ does not define those three gets empty utilities — silently. Four consumer apps
223
+ shipped that way for a week (found 2026-09-07). Define them in your `@theme`
224
+ (or import `theme.css` if you have no theme of your own).
225
+
75
226
  3. **Delete your host copies of the moved rules** — `.matrx-scroll-fade[…]`,
76
227
  the `.matrx-mobile-sheet` block, `.matrx-glass-thin-border` (+ its
77
228
  `:hover` / `:active` / `:has(> a:…)` states). They now ship in the package;
package/README.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # @ai-matrx/design-system
2
2
 
3
- The small, semantic UI foundation shared by AI Matrx React applications — primitives whose behavior and variants are identical across Vite and Next.js hosts. Version 0.2 ships Button, Badge, Label, Separator, the Input family, Popover, Sheet, Skeleton, EditableLabel, SegmentedControl, ScoreRing, BottomSheet + TabbedBottomSheet, OverflowToolbar, the `useScrollFade` hook, and the `cn` utility.
3
+ The small, semantic UI foundation shared by AI Matrx React applications — primitives whose behavior and variants are identical across Vite and Next.js hosts.
4
+
5
+ **Controls:** Button, Badge, Label, Separator, the Input family, the Textarea family, Checkbox, Switch, Avatar, Progress.
6
+ **Surfaces:** Card, Table, Tabs, Collapsible, ScrollArea, Popover, Sheet, Dialog, BottomSheet + TabbedBottomSheet, Skeleton.
7
+ **Menus:** DropdownMenu, ContextMenu, Command / CommandDialog, Select, CreatablePicker.
8
+ **Composed:** EditableLabel, SegmentedControl, ScoreRing, OverflowToolbar.
9
+ **Hooks + utilities:** `useScrollFade`, `useIsMobile`, `usePortalContainer`, `useDialogContainer`, `cn`.
10
+
11
+ Where hosts had forked a primitive over DENSITY, density is a prop, not a fork: `Card size="sm|md|lg"`, `Table size="sm|md"`, `Switch`/`Avatar`/`Checkbox` `size`. It is declared once on the root and every section reads it from context, so a card cannot mix paddings.
4
12
 
5
13
  ```bash
6
14
  pnpm add @ai-matrx/design-system