@dashforge/tw 0.3.0-beta → 0.5.0-beta

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 (81) hide show
  1. package/CHANGELOG.md +246 -0
  2. package/PARITY.md +483 -0
  3. package/PERFORMANCE.md +169 -0
  4. package/dist/index.esm.js +1055 -2
  5. package/dist/src/components/Accordion/Accordion.d.ts +21 -0
  6. package/dist/src/components/Accordion/Accordion.d.ts.map +1 -0
  7. package/dist/src/components/Accordion/accordion.types.d.ts +74 -0
  8. package/dist/src/components/Accordion/accordion.types.d.ts.map +1 -0
  9. package/dist/src/components/Accordion/accordion.variants.d.ts +58 -0
  10. package/dist/src/components/Accordion/accordion.variants.d.ts.map +1 -0
  11. package/dist/src/components/Dialog/Dialog.d.ts +17 -0
  12. package/dist/src/components/Dialog/Dialog.d.ts.map +1 -0
  13. package/dist/src/components/Dialog/dialog.types.d.ts +75 -0
  14. package/dist/src/components/Dialog/dialog.types.d.ts.map +1 -0
  15. package/dist/src/components/Dialog/dialog.variants.d.ts +80 -0
  16. package/dist/src/components/Dialog/dialog.variants.d.ts.map +1 -0
  17. package/dist/src/components/Pagination/Pagination.d.ts +32 -0
  18. package/dist/src/components/Pagination/Pagination.d.ts.map +1 -0
  19. package/dist/src/components/Pagination/pagination.helpers.d.ts +23 -0
  20. package/dist/src/components/Pagination/pagination.helpers.d.ts.map +1 -0
  21. package/dist/src/components/Pagination/pagination.types.d.ts +120 -0
  22. package/dist/src/components/Pagination/pagination.types.d.ts.map +1 -0
  23. package/dist/src/components/Pagination/pagination.variants.d.ts +150 -0
  24. package/dist/src/components/Pagination/pagination.variants.d.ts.map +1 -0
  25. package/dist/src/components/Popover/Popover.d.ts +15 -0
  26. package/dist/src/components/Popover/Popover.d.ts.map +1 -0
  27. package/dist/src/components/Popover/popover.types.d.ts +45 -0
  28. package/dist/src/components/Popover/popover.types.d.ts.map +1 -0
  29. package/dist/src/components/Popover/popover.variants.d.ts +34 -0
  30. package/dist/src/components/Popover/popover.variants.d.ts.map +1 -0
  31. package/dist/src/components/Skeleton/Skeleton.d.ts +23 -0
  32. package/dist/src/components/Skeleton/Skeleton.d.ts.map +1 -0
  33. package/dist/src/components/Skeleton/skeleton.types.d.ts +56 -0
  34. package/dist/src/components/Skeleton/skeleton.types.d.ts.map +1 -0
  35. package/dist/src/components/Skeleton/skeleton.variants.d.ts +110 -0
  36. package/dist/src/components/Skeleton/skeleton.variants.d.ts.map +1 -0
  37. package/dist/src/components/Tabs/Tabs.d.ts +15 -0
  38. package/dist/src/components/Tabs/Tabs.d.ts.map +1 -0
  39. package/dist/src/components/Tabs/tabs.types.d.ts +55 -0
  40. package/dist/src/components/Tabs/tabs.types.d.ts.map +1 -0
  41. package/dist/src/components/Tabs/tabs.variants.d.ts +82 -0
  42. package/dist/src/components/Tabs/tabs.variants.d.ts.map +1 -0
  43. package/dist/src/components/Tooltip/Tooltip.d.ts +29 -0
  44. package/dist/src/components/Tooltip/Tooltip.d.ts.map +1 -0
  45. package/dist/src/components/Tooltip/tooltip.types.d.ts +47 -0
  46. package/dist/src/components/Tooltip/tooltip.types.d.ts.map +1 -0
  47. package/dist/src/components/Tooltip/tooltip.variants.d.ts +34 -0
  48. package/dist/src/components/Tooltip/tooltip.variants.d.ts.map +1 -0
  49. package/dist/src/index.d.ts +22 -1
  50. package/dist/src/index.d.ts.map +1 -1
  51. package/package.json +8 -3
  52. package/src/components/Accordion/Accordion.test.tsx +95 -0
  53. package/src/components/Accordion/Accordion.tsx +97 -0
  54. package/src/components/Accordion/accordion.types.ts +66 -0
  55. package/src/components/Accordion/accordion.variants.ts +30 -0
  56. package/src/components/Dialog/Dialog.test.tsx +96 -0
  57. package/src/components/Dialog/Dialog.tsx +93 -0
  58. package/src/components/Dialog/dialog.types.ts +62 -0
  59. package/src/components/Dialog/dialog.variants.ts +62 -0
  60. package/src/components/Pagination/Pagination.test.tsx +314 -0
  61. package/src/components/Pagination/Pagination.tsx +275 -0
  62. package/src/components/Pagination/pagination.helpers.ts +102 -0
  63. package/src/components/Pagination/pagination.types.ts +117 -0
  64. package/src/components/Pagination/pagination.variants.ts +111 -0
  65. package/src/components/Popover/Popover.test.tsx +72 -0
  66. package/src/components/Popover/Popover.tsx +55 -0
  67. package/src/components/Popover/popover.types.ts +42 -0
  68. package/src/components/Popover/popover.variants.ts +18 -0
  69. package/src/components/Skeleton/Skeleton.test.tsx +127 -0
  70. package/src/components/Skeleton/Skeleton.tsx +49 -0
  71. package/src/components/Skeleton/skeleton.types.ts +59 -0
  72. package/src/components/Skeleton/skeleton.variants.ts +86 -0
  73. package/src/components/Tabs/Tabs.test.tsx +74 -0
  74. package/src/components/Tabs/Tabs.tsx +66 -0
  75. package/src/components/Tabs/tabs.types.ts +49 -0
  76. package/src/components/Tabs/tabs.variants.ts +58 -0
  77. package/src/components/Tooltip/Tooltip.test.tsx +73 -0
  78. package/src/components/Tooltip/Tooltip.tsx +70 -0
  79. package/src/components/Tooltip/tooltip.types.ts +44 -0
  80. package/src/components/Tooltip/tooltip.variants.ts +18 -0
  81. package/src/index.ts +57 -1
package/CHANGELOG.md CHANGED
@@ -12,6 +12,252 @@ This project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
12
12
  > duplicated intentionally — no shared "lowest common denominator" headless
13
13
  > layer.
14
14
 
15
+ ## [0.5.0-beta] — 2026-05-19
16
+
17
+ **Sprint 4 release.** Two TW-only utility primitives — `<Skeleton>`
18
+ and `<Pagination>` — that were missing from the catalog and are
19
+ prerequisite visuals for the upcoming Sprint 4.1 (Table + DataGrid).
20
+ Both are pure-UI, no bridge integration, no RBAC sensible — they
21
+ exist to compose with the data layer arriving next sprint.
22
+
23
+ **MUI side note.** Neither component ships in `@dashforge/ui`:
24
+ `@mui/material/Skeleton` and `@mui/material/Pagination` already
25
+ cover the bridge-free use case fully. Per the Dashforge design rule
26
+ (`@dashforge/ui` wraps MUI only when adding bridge / RBAC /
27
+ validation / custom-behavior value), MUI consumers reach for the
28
+ upstream components directly.
29
+
30
+ **Minor bump** for 2 new public exports. Strictly additive — zero
31
+ breaking changes. Drop-in upgrade from `0.4.0-beta`.
32
+
33
+ ### Added
34
+
35
+ - **`<Skeleton>`** — loading placeholder primitive.
36
+ Three shapes (`text` default · `rectangle` · `circle`), three
37
+ animations (`pulse` default · `wave` · `none`). Width / height as
38
+ inline CSS lengths; circle's height defaults to its width.
39
+ Rendered as `<span aria-hidden="true" role="presentation">` — screen
40
+ readers skip it; the surrounding container is responsible for
41
+ `aria-busy` / `aria-live` announcements. **WCAG 2.3.3**: both
42
+ animations gated on `prefers-reduced-motion: reduce`. Compose
43
+ multiple `<Skeleton>`s to mimic card / row shapes during fetch.
44
+ 19 unit tests covering variants × animations × sizing × sx +
45
+ slotProps override + a11y attributes.
46
+ - **`<Pagination>`** — controlled pagination primitive. Three
47
+ variants:
48
+ - `default` — summary + page numbers + first/prev/next/last +
49
+ page-size selector + direct jump input
50
+ - `compact` — page numbers + nav buttons only
51
+ - `minimal` — "Page X of Y" + prev/next (mobile-friendly)
52
+ Three sizes (`sm` / `md` / `lg`). Configurable
53
+ `siblingCount` / `boundaryCount` for the ellipsis range
54
+ algorithm — small totals (≤ `2·boundary + 2·sibling + 3` pages)
55
+ short-circuit to the full range, no ellipsis. Full i18n via
56
+ `labels` prop (English defaults). A11Y: `<nav aria-label="Pagination">`
57
+ landmark, `aria-current="page"` on the active button, native
58
+ `<select>` for page size, native `<input type="number">` for
59
+ the jump input (commit on Enter / blur, clamped to range).
60
+ Page-size selector hidden when `onPageSizeChange` is omitted.
61
+ Jump input toggle via `showJumpInput`. 28 unit tests covering
62
+ the range helper (7) + rendering / interactions / variants /
63
+ i18n / disabled / overrides / edge cases (21).
64
+
65
+ ### Internal
66
+
67
+ - **47 new unit tests** for the 2 components — full TW suite at
68
+ **681/681 passing** (39 files).
69
+ - **`TestUtilities.tsx`** added to the `dash` consumer
70
+ (`/test-utilities`) as the Sprint 4 smoke-test page: variant
71
+ matrix for both components + card-placeholder compose pattern +
72
+ Pagination i18n / size / variant / edge cases + a 50-instance
73
+ Skeleton stress test wrapped in `React.Profiler`. Validated
74
+ end-to-end before docs were written (per Dashforge workflow
75
+ policy: dash smoke test PRECEDES docs).
76
+ - **Sidebar entries** for the new `Skeleton` + `Pagination` doc
77
+ pages added to `dashforge-docs-lab/src/tw-docs/sidebar.model.ts`.
78
+
79
+ ### Compatibility
80
+
81
+ | Axis | Pre-`0.5.0` | Post-`0.5.0` |
82
+ |---|---|---|
83
+ | Public API surface | 29 components | **+ 2 (`Skeleton`, `Pagination`)** + their `*Props` / `*SlotProps` types + `*Variants` recipes + `PaginationLabels` i18n type |
84
+ | Peer deps | `react ^18 \|\| ^19`, `tw-theme workspace`, `tw-tokens workspace` | unchanged |
85
+ | Bridge deps | `forms` / `rbac` / `ui-core` `workspace:*` | unchanged |
86
+ | New runtime deps | — | **none** (no new external libraries — constraint honored) |
87
+ | Breaking changes | — | Zero |
88
+ | Bundle size | 312 KB raw / 68.85 KB gzipped | **336 KB raw / 73.9 KB gzipped** (+24 KB raw / +5.05 KB gz / **+7.3% gz**) |
89
+ | Migration | — | Drop-in. Zero code changes required on existing usages. |
90
+
91
+ > **Bundle regression note**: the +7.3% gzipped delta is **above
92
+ > the 5% threshold** documented in `PERFORMANCE.md`. Justification:
93
+ > Pagination contributes ~4 KB gz (3 variants × 3 sizes × i18n
94
+ > surface + range-computation helper + jump-input commit logic);
95
+ > Skeleton contributes ~1 KB gz. The delta sits well under the
96
+ > 10% reviewer-sign-off threshold and is the necessary cost of
97
+ > adding two new public components. Filed as informational per
98
+ > the regression policy.
99
+
100
+ ### Migration
101
+
102
+ No code changes required:
103
+
104
+ ```bash
105
+ pnpm up @dashforge/tw@^0.5.0-beta
106
+ ```
107
+
108
+ To adopt the new components:
109
+
110
+ ```tsx
111
+ import { Skeleton, Pagination } from '@dashforge/tw';
112
+
113
+ // Loading placeholder while fetching
114
+ {isLoading ? (
115
+ <Skeleton variant="text" width="200px" />
116
+ ) : (
117
+ <UserName>{user.name}</UserName>
118
+ )}
119
+
120
+ // Paginated list (controlled — wire to your data slice)
121
+ const [page, setPage] = useState(1);
122
+ const [pageSize, setPageSize] = useState(20);
123
+
124
+ <Pagination
125
+ page={page}
126
+ pageSize={pageSize}
127
+ totalCount={users.length}
128
+ onPageChange={setPage}
129
+ onPageSizeChange={setPageSize}
130
+ />
131
+ ```
132
+
133
+ MUI consumers: continue using `@mui/material/Skeleton` and
134
+ `@mui/material/Pagination` directly. `@dashforge/ui` will NOT ship
135
+ wrappers for these (per the design rule documented in
136
+ `PARITY.md` — no value-add wrappers).
137
+
138
+ ## [0.4.0-beta] — 2026-05-19
139
+
140
+ **Sprint 3 release.** Five new Tier-4 overlay & disclosure
141
+ components (Dialog, Tabs, Tooltip, Popover, Accordion) + the
142
+ internal **MUI ↔ TW parity audit** (`PARITY.md`) + the
143
+ **customization escape hatch playbook** in the docs lab + the
144
+ first **performance baseline** (`PERFORMANCE.md`). Strictly
145
+ additive — zero breaking changes on the existing 24-component
146
+ surface.
147
+
148
+ **Minor bump** for the 5 new public exports + new types. All
149
+ existing usages keep working byte-identical. Drop-in upgrade from
150
+ `0.3.0-beta`.
151
+
152
+ ### Added
153
+
154
+ - **`<Dialog>`** — declarative modal dialog (Radix `Dialog`-backed).
155
+ Three size variants (`sm` / `md` / `lg`), controlled `open` /
156
+ `onOpenChange`, optional title + description (wired to
157
+ `aria-labelledby` / `aria-describedby`), `showCloseButton` toggle,
158
+ `disableBackdropClose` / `disableEscapeClose` escapes. APG dialog
159
+ pattern out of the box: focus trap, restore focus on close, Esc
160
+ dismissal, scroll lock. Portal-rendered.
161
+ - **`<Tabs>`** — declarative tab navigation (Radix `Tabs`-backed).
162
+ Two variants (`underline` default / `pill`), two orientations
163
+ (`horizontal` default / `vertical`), controlled / uncontrolled
164
+ modes. APG tabs pattern: arrow-key navigation,
165
+ `role="tablist"` / `role="tab"` / `role="tabpanel"` wiring,
166
+ `aria-orientation`.
167
+ - **`<Tooltip>`** — hover/focus tooltip (Radix `Tooltip`-backed).
168
+ Per-component provider for delay configuration (default 200ms),
169
+ four placement sides, alignment options, optional arrow
170
+ indicator. APG tooltip pattern: `role="tooltip"`,
171
+ `aria-describedby` wired automatically.
172
+ - **`<Popover>`** — clickable floating panel (Radix
173
+ `Popover`-backed). For richer floating UI than tooltip — action
174
+ menus, color pickers, settings panels. Focus trap inside,
175
+ outside-click + Escape dismiss, portal-rendered.
176
+ - **`<Accordion>`** — collapsible section list (Radix
177
+ `Accordion`-backed). Two modes (`single` default with
178
+ `collapsible: true` / `multiple`), per-item disabled flag,
179
+ CSS-only chevron flip via `data-state=open` selector. APG
180
+ accordion pattern: arrow-key navigation between triggers,
181
+ `aria-expanded` on triggers, `role="region"` on panels.
182
+ - **`PARITY.md`** — internal parity audit between `@dashforge/tw`
183
+ and `@dashforge/ui` (MUI line). Covers the 10 bridge-integrated
184
+ components. Documents intentional deltas (Radix callback
185
+ signatures `onCheckedChange` / `onValueChange` vs MUI
186
+ `onChange(event, value)`; variant taxonomy `solid` / `outline` /
187
+ `soft` / `ghost` vs MUI's `contained` / `outlined` / `text`;
188
+ TW-only features like `loadOptions` async loader on Autocomplete,
189
+ `slotProps.prefix` / `suffix` on TextField, `showStepper` on
190
+ NumberField). Motivation: internal consistency + foundation for
191
+ Sprint 5 starter kits. Not a customer migration document — the
192
+ switch story was scrapped as a non-existent use case.
193
+ - **`/docs/guides/customization.mdx`** — customization escape
194
+ hatch playbook. Three sections: `sx` vs `slotProps` decision
195
+ tree with 4 canonical examples (outer wrapper styling, slot
196
+ styling, conflict resolution, combining both), preset extension
197
+ recipes (`extendPreset({ colors: { brand: { … } } })` + custom
198
+ intent augmentation + custom font stack), and a custom-component
199
+ tutorial (`PhoneInput` built on `useDashFieldMeta` +
200
+ `useAccessState`).
201
+ - **`PERFORMANCE.md`** — first formal performance baseline. Bundle
202
+ raw + gzipped (312 KB / 68.85 KB for 29 components),
203
+ per-component source size proxy, representative bundle subsets
204
+ (form / layout / foundation / tier-4 / full), render perf table
205
+ (12.1 ms mount / 7-8.6 ms update from `dash` consumer). Sets
206
+ the regression budget policy: any PR with >+5% gzipped delta
207
+ requires a justification line in the CHANGELOG; >+10% requires
208
+ explicit reviewer sign-off.
209
+
210
+ ### Internal
211
+
212
+ - **MUI ↔ TW parity audit pact.** Every release that touches a
213
+ bridge-integrated component on either line MUST re-run the
214
+ parity audit (low cost — ~30 min per component-level diff). The
215
+ pact is documented at the end of `PARITY.md`.
216
+ - **Performance regression budget.** 5% / 10% gzipped thresholds
217
+ documented in `PERFORMANCE.md`. To be enforced via CI in Sprint
218
+ 4+ (out of scope for Sprint 3 — the policy is the foundation).
219
+ - **Sidebar entry** for the new `Customization` guide added to
220
+ `dashforge-docs-lab/src/tw-docs/sidebar.model.ts`.
221
+ - **42 new unit tests** for the 5 Tier-4 components — full TW suite
222
+ now at 634/634 passing (37 files).
223
+
224
+ ### Compatibility
225
+
226
+ | Axis | Pre-`0.4.0` | Post-`0.4.0` |
227
+ |---|---|---|
228
+ | Public API surface | 24 components + foundation + bridge hooks | **+5 components + their `*Props` / `*SlotProps` types + their `*Variants` recipes** |
229
+ | Peer deps | `react ^18 \|\| ^19`, `tw-theme workspace`, `tw-tokens workspace` | unchanged |
230
+ | Bridge deps | `forms` / `rbac` / `ui-core` `workspace:*` | unchanged |
231
+ | New runtime deps | — | `@radix-ui/react-dialog ^1.1.0` · `@radix-ui/react-tabs ^1.1.0` · `@radix-ui/react-tooltip ^1.1.0` · `@radix-ui/react-popover ^1.1.0` · `@radix-ui/react-accordion ^1.2.0` |
232
+ | Breaking changes | — | **Zero**. The `sx` + `slotProps` design discussion concluded with "keep both, document only" — no rename. |
233
+ | Bundle size | 272 KB raw / ~60 KB gzipped | **312 KB raw / 68.85 KB gzipped** (+40 KB raw / +8.85 KB gz; within the projected 14% budget for 5 Radix-backed components) |
234
+ | Migration | — | Drop-in. Zero code changes required on existing usages. |
235
+
236
+ ### Migration
237
+
238
+ No code changes required:
239
+
240
+ ```bash
241
+ pnpm up @dashforge/tw@^0.4.0-beta
242
+ ```
243
+
244
+ To adopt the new Tier-4 components:
245
+
246
+ ```tsx
247
+ import { Dialog, Tabs, Tooltip, Popover, Accordion } from '@dashforge/tw';
248
+
249
+ <Tooltip content="Delete this item">
250
+ <Button variant="ghost"><TrashIcon /></Button>
251
+ </Tooltip>
252
+
253
+ <Tabs items={[
254
+ { value: 'overview', label: 'Overview', content: <OverviewPanel /> },
255
+ { value: 'details', label: 'Details', content: <DetailsPanel /> },
256
+ ]} />
257
+
258
+ <Accordion items={faqItems} type="single" defaultValue="q-1" />
259
+ ```
260
+
15
261
  ## [0.3.0-beta] — 2026-05-18
16
262
 
17
263
  **Sprint 2 release.** Bundle of 9 fixes across 7 components + 1 new