@dashforge/tw 0.4.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.
- package/CHANGELOG.md +123 -0
- package/dist/index.esm.js +564 -2
- package/dist/src/components/Pagination/Pagination.d.ts +32 -0
- package/dist/src/components/Pagination/Pagination.d.ts.map +1 -0
- package/dist/src/components/Pagination/pagination.helpers.d.ts +23 -0
- package/dist/src/components/Pagination/pagination.helpers.d.ts.map +1 -0
- package/dist/src/components/Pagination/pagination.types.d.ts +120 -0
- package/dist/src/components/Pagination/pagination.types.d.ts.map +1 -0
- package/dist/src/components/Pagination/pagination.variants.d.ts +150 -0
- package/dist/src/components/Pagination/pagination.variants.d.ts.map +1 -0
- package/dist/src/components/Skeleton/Skeleton.d.ts +23 -0
- package/dist/src/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/src/components/Skeleton/skeleton.types.d.ts +56 -0
- package/dist/src/components/Skeleton/skeleton.types.d.ts.map +1 -0
- package/dist/src/components/Skeleton/skeleton.variants.d.ts +110 -0
- package/dist/src/components/Skeleton/skeleton.variants.d.ts.map +1 -0
- package/dist/src/index.d.ts +7 -1
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Pagination/Pagination.test.tsx +314 -0
- package/src/components/Pagination/Pagination.tsx +275 -0
- package/src/components/Pagination/pagination.helpers.ts +102 -0
- package/src/components/Pagination/pagination.types.ts +117 -0
- package/src/components/Pagination/pagination.variants.ts +111 -0
- package/src/components/Skeleton/Skeleton.test.tsx +127 -0
- package/src/components/Skeleton/Skeleton.tsx +49 -0
- package/src/components/Skeleton/skeleton.types.ts +59 -0
- package/src/components/Skeleton/skeleton.variants.ts +86 -0
- package/src/index.ts +18 -1
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,129 @@ 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
|
+
|
|
15
138
|
## [0.4.0-beta] — 2026-05-19
|
|
16
139
|
|
|
17
140
|
**Sprint 3 release.** Five new Tier-4 overlay & disclosure
|