@ai-matrx/design-system 0.6.0 → 0.7.1

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,128 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.1 — 2026-09-07
4
+
5
+ - **`ResizableHandle` defaults to `xs` (2px), not `sm` (4px).** Caught in the
6
+ live spot-check of the 0.7.0 adoption: matrx-frontend's `/notes` split
7
+ rendered a 4px rule where its fork had drawn 2px. The port was supposed to be
8
+ behaviour-verbatim, and `size="sm"` was simply the wrong rung to call the
9
+ default. Every explicit `size=` is unaffected, and
10
+ `components/ui/matrx/resizable.tsx` still binds `md`.
11
+
12
+ ### Consumer action (C28)
13
+
14
+ None. If you adopted 0.7.0 and liked the slightly thicker default, pass
15
+ `size="sm"`.
16
+
17
+ ## 0.7.0 — 2026-09-07
18
+
19
+ **GROWTH WAVE 2 (C18).** Wave 1 (0.5.0) deleted 34 forked primitives but had
20
+ to KEEP every primitive this package did not ship. A fresh import-site census
21
+ of matrx-frontend `components/ui/` ranked what was left; this release ships all
22
+ of it, so those forks die too.
23
+
24
+ Ten new primitive families, ordered by the host fan-out they close:
25
+ `Tooltip` (182 sites), `Drawer` (121), `AlertDialog` (78), `Alert` (76),
26
+ `Slider` (46), `Resizable` (38), `RadioGroup` (30), `HoverCard` (16),
27
+ `ToggleGroup` + `Toggle` (10). Each was built from EVERY host variant, not from
28
+ one repo's copy.
29
+
30
+ ### The tooltip collapse
31
+
32
+ `@ai-matrx/tap-target` shipped a Tooltip family that four repos adopted — and
33
+ its own file header said what it was: an inlined PORT of matrx-frontend's
34
+ `components/ui/tooltip.tsx`. So the fleet ran TWO copies, and a
35
+ button-geometry package was the accidental owner of a design-system surface.
36
+ A tooltip is a design-system surface: it lives here now. `tap-target@0.2.0`
37
+ takes this package as an ordinary sibling dependency, imports the Tooltip from
38
+ it, deletes its own copy, and **re-exports nothing** — one implementation, one
39
+ import path. The sibling DAG already ordered design-system before tap-target,
40
+ so no cycle is introduced.
41
+
42
+ The port also restores the seam tap-target's copy had dropped: tooltips resolve
43
+ their portal target through `PortalContainerProvider`, so a tooltip inside a
44
+ popped-out panel lands in the right document instead of always `document.body`.
45
+
46
+ ### Real defects fixed in the port (never "preserved")
47
+
48
+ - **`AlertDialogContent` was not clamped to the viewport.** A confirm dialog
49
+ listing what is about to be deleted pushed Cancel/Continue below the fold on
50
+ a short viewport — and Radix does NOT dismiss an ALERT dialog on backdrop
51
+ click, so the surface was a genuine dead end. It is now
52
+ `max-h-[85dvh] overflow-y-auto` with a sticky, edge-bleeding footer, matching
53
+ `Dialog`.
54
+ - **`Slider` rendered exactly one thumb.** The host copy hardcoded a single
55
+ `Thumb`, so any two-value range silently lost its upper handle. One thumb is
56
+ now rendered per value.
57
+ - **`HoverCard` rendered inline instead of portalling**, so a card inside an
58
+ `overflow-hidden` ancestor was clipped and one inside a popped-out panel could
59
+ not exist. It now portals through the same seam — which is why its layer moved
60
+ from `z-50` to `z-[10001]`: at the body it would otherwise sit UNDER a modal.
61
+ - **`ResizableHandle` always said `cursor: col-resize`**, inline, including on
62
+ the horizontal separator of a vertical group, which wants `row-resize`. The
63
+ cursor is now orientation-aware.
64
+ - **Every touch target under 44px** on `Slider`, `RadioGroup`, `ResizableHandle`
65
+ and the `Drawer` grab handle. The visible control keeps its size; an invisible
66
+ pseudo-target expands the hit area on coarse pointers only, so desktop density
67
+ is untouched.
68
+
69
+ ### Density is a prop, not a fork (C18), on four more primitives
70
+
71
+ `Slider size`, `RadioGroup size` (declared on the root, inherited by items),
72
+ `Toggle`/`ToggleGroup size`, `ResizableHandle size`. That last one collapses
73
+ TWO host files: matrx-frontend shipped `components/ui/resizable.tsx` AND
74
+ `components/ui/matrx/resizable.tsx`, whose only difference was an eight-step
75
+ handle-thickness scale.
76
+
77
+ ### The Drawer owns the mobile-first rules
78
+
79
+ matrx-frontend's doctrine is "Drawer, not Dialog, on mobile", so the Drawer is
80
+ where most of the platform's mobile UX lands. It now owns those rules so no
81
+ host re-derives them: `dvh` never `vh`; `pb-safe` / `pt-safe` safe-area padding
82
+ (`pt-safe` is new in `styles.css`); a 44px grab-handle target around the 4px
83
+ pill; `DrawerBody` as the `flex-1 min-h-0` scroll shard with a `mt-auto` footer;
84
+ and `direction` as a prop, so a side or top drawer is not a fork.
85
+
86
+ It also closes the last CONTEXT twin: `RadixDialogModalProvider` still had a
87
+ host copy at `components/ui/radix-dialog-modal-context.tsx`, and a host copy of
88
+ a React context is the quiet twin — `useContext` matches by object identity, so
89
+ the host Drawer's provider and this package's Sheet consumer were two different
90
+ contexts that merely looked alike. `BottomSheet` now composes `Drawer` too, so
91
+ there is ONE vaul wrapper in the package instead of two.
92
+
93
+ ### Alert ships the whole status vocabulary
94
+
95
+ `default | destructive | warning | success | info`, all token-driven. The host
96
+ copy had only two variants, which is why the census found dozens of hand-rolled
97
+ amber/emerald banners with literal palette classes across four repos.
98
+
99
+ ### Consumer action (C28)
100
+
101
+ Install `@ai-matrx/design-system@0.7.0` (and `@ai-matrx/tap-target@0.2.0`), then:
102
+
103
+ 1. **Tooltip imports move.** Anything importing `Tooltip`, `TooltipTrigger`,
104
+ `TooltipContent` or `TooltipProvider` from `@ai-matrx/tap-target` must import
105
+ them from `@ai-matrx/design-system` instead — tap-target no longer exports
106
+ them. Affected today: aidream `apps/dashboard` (10 files), aidream
107
+ `apps/workflow-studio` (18 files), matrx-extend (1), matrx-frontend (1).
108
+ 2. **Delete these host forks** and re-point or shim their imports:
109
+ - matrx-frontend `components/ui/tooltip.tsx`, `drawer.tsx`,
110
+ `alert-dialog.tsx`, `alert.tsx`, `slider.tsx`, `resizable.tsx`,
111
+ `matrx/resizable.tsx`, `radio-group.tsx`, `hover-card.tsx`,
112
+ `toggle-group.tsx`, `toggle.tsx`, `radix-dialog-modal-context.tsx`.
113
+ - No other consumer repo carries a fork of these — verified by census on
114
+ 2026-09-07 across matrx-extend, matrx-games, aidream `apps/dashboard` and
115
+ `apps/workflow-studio`.
116
+ 3. **`matrx/resizable.tsx` callers keep their `size` prop** — it is the same
117
+ eight-step scale, now on the one component. Callers of the plain
118
+ `resizable.tsx` get the identical 2px default (`size="sm"`).
119
+ 4. **Check any `z-50` assumption around HoverCard**; it now portals to the body
120
+ at `z-[10001]`.
121
+ 5. **`react-resizable-panels` v4 overwrites `data-testid`** with its own
122
+ generated id. Tests that query a handle by test id must query
123
+ `role="separator"` instead.
124
+ 6. Register the new names in each repo's `package-twins.json`.
125
+
3
126
  ## 0.6.0 — 2026-09-07
4
127
 
5
128
  **THE BUTTON SCALE.** matrx-frontend carried a 127-line CVA button fork
package/README.md CHANGED
@@ -2,13 +2,17 @@
2
2
 
3
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
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.
5
+ **Controls:** Button, Badge, Label, Separator, the Input family, the Textarea family, Checkbox, Switch, RadioGroup, Slider, Toggle + ToggleGroup, Avatar, Progress.
6
+ **Surfaces:** Card, Table, Tabs, Collapsible, ScrollArea, Popover, Tooltip, HoverCard, Sheet, Dialog, AlertDialog, Drawer, BottomSheet + TabbedBottomSheet, Alert, Resizable, Skeleton.
7
7
  **Menus:** DropdownMenu, ContextMenu, Command / CommandDialog, Select, CreatablePicker.
8
8
  **Composed:** EditableLabel, SegmentedControl, ScoreRing, OverflowToolbar.
9
- **Hooks + utilities:** `useScrollFade`, `useIsMobile`, `usePortalContainer`, `useDialogContainer`, `cn`.
9
+ **Hooks + utilities:** `useScrollFade`, `useIsMobile`, `usePortalContainer`, `useDialogContainer`, `useDrawerDirection`, `cn`.
10
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.
11
+ **The Tooltip lives here, and only here.** `@ai-matrx/tap-target` used to ship its own copy; since design-system 0.7.0 / tap-target 0.2.0 it consumes this one and re-exports nothing.
12
+
13
+ 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`/`Slider`/`RadioGroup`/`Toggle` `size`, `ResizableHandle size="xs".."4xl"`. It is declared once on the root and every item reads it from context, so a card cannot mix paddings and a radio group cannot mix control sizes.
14
+
15
+ **Mobile is the Drawer's job.** `Drawer` owns the iOS rules every host was re-deriving — `dvh` never `vh`, `pb-safe`/`pt-safe` safe-area padding, a 44px grab-handle target, `DrawerBody` as the `flex-1 min-h-0` scroll shard — and `direction` makes a top/side drawer a prop rather than a fork. Every touch control (`Slider`, `RadioGroup`, `ResizableHandle`) carries an invisible 44px target on coarse pointers, with desktop density untouched.
12
16
 
13
17
  ```bash
14
18
  pnpm add @ai-matrx/design-system