baseline-kit 5.0.0 → 5.2.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 +243 -0
- package/README.md +227 -353
- package/dist/baseline-kit.css +5 -2
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +25 -9
- package/dist/core.mjs +1 -1
- package/dist/guide.cjs +1 -1
- package/dist/guide.cjs.map +1 -1
- package/dist/guide.css +1 -1
- package/dist/guide.d.ts +16 -16
- package/dist/guide.mjs +147 -150
- package/dist/guide.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +22 -12
- package/dist/index.mjs +169 -158
- package/dist/index.mjs.map +1 -1
- package/dist/remix-server.d.ts +8 -0
- package/dist/remix-server.mjs +15 -0
- package/dist/remix-server.mjs.map +1 -0
- package/dist/remix.css +2 -0
- package/dist/remix.d.ts +191 -0
- package/dist/remix.mjs +984 -0
- package/dist/remix.mjs.map +1 -0
- package/dist/{src-QHaSfgVe.js → src-D0nL1BwZ.js} +96 -165
- package/dist/src-D0nL1BwZ.js.map +1 -0
- package/dist/src-R5usYJol.cjs +2 -0
- package/dist/src-R5usYJol.cjs.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/theme/default.css +0 -1
- package/dist/theme/tokens.css +0 -1
- package/dist/theme.css +4 -1
- package/package.json +86 -37
- package/dist/README.md +0 -468
- package/dist/core/src/config/defaults.d.ts +0 -2
- package/dist/core/src/config/index.d.ts +0 -3
- package/dist/core/src/config/merge.d.ts +0 -21
- package/dist/core/src/config/schema.d.ts +0 -33
- package/dist/core/src/descriptors/baseline.d.ts +0 -26
- package/dist/core/src/descriptors/box.d.ts +0 -20
- package/dist/core/src/descriptors/guide.d.ts +0 -44
- package/dist/core/src/descriptors/index.d.ts +0 -5
- package/dist/core/src/descriptors/padder.d.ts +0 -19
- package/dist/core/src/descriptors/spacer.d.ts +0 -24
- package/dist/core/src/index.d.ts +0 -10
- package/dist/core/src/types.d.ts +0 -62
- package/dist/core/src/utils/convert.d.ts +0 -10
- package/dist/core/src/utils/grid.d.ts +0 -18
- package/dist/core/src/utils/index.d.ts +0 -8
- package/dist/core/src/utils/math.d.ts +0 -9
- package/dist/core/src/utils/merge.d.ts +0 -28
- package/dist/core/src/utils/normalize.d.ts +0 -13
- package/dist/core/src/utils/padding.d.ts +0 -2
- package/dist/core/src/utils/parse.d.ts +0 -5
- package/dist/core/src/utils/snapping.d.ts +0 -2
- package/dist/core/src/validation/guide.d.ts +0 -3
- package/dist/core/src/validation/index.d.ts +0 -1
- package/dist/dom/src/index.d.ts +0 -11
- package/dist/dom/src/measure.d.ts +0 -18
- package/dist/dom/src/observers.d.ts +0 -5
- package/dist/dom/src/ssr.d.ts +0 -20
- package/dist/dom/src/timing.d.ts +0 -2
- package/dist/dom/src/viewport.d.ts +0 -7
- package/dist/dom/src/virtual.d.ts +0 -23
- package/dist/react/src/components/Baseline/Baseline.d.ts +0 -13
- package/dist/react/src/components/Baseline/index.d.ts +0 -1
- package/dist/react/src/components/Box/Box.d.ts +0 -26
- package/dist/react/src/components/Box/index.d.ts +0 -1
- package/dist/react/src/components/Config/Config.d.ts +0 -20
- package/dist/react/src/components/Config/index.d.ts +0 -2
- package/dist/react/src/components/Guide/Guide.d.ts +0 -16
- package/dist/react/src/components/Guide/index.d.ts +0 -1
- package/dist/react/src/components/Padder/Padder.d.ts +0 -20
- package/dist/react/src/components/Padder/index.d.ts +0 -1
- package/dist/react/src/components/Spacer/Spacer.d.ts +0 -14
- package/dist/react/src/components/Spacer/index.d.ts +0 -1
- package/dist/react/src/components/index.d.ts +0 -12
- package/dist/react/src/components/types.d.ts +0 -29
- package/dist/react/src/guide.d.ts +0 -10
- package/dist/react/src/hooks/index.d.ts +0 -10
- package/dist/react/src/hooks/useBaseline.d.ts +0 -26
- package/dist/react/src/hooks/useConfig.d.ts +0 -9
- package/dist/react/src/hooks/useDebug.d.ts +0 -6
- package/dist/react/src/hooks/useGuide.d.ts +0 -7
- package/dist/react/src/hooks/useIsClient.d.ts +0 -4
- package/dist/react/src/hooks/useMeasure.d.ts +0 -10
- package/dist/react/src/hooks/useVirtual.d.ts +0 -14
- package/dist/react/src/index.d.ts +0 -21
- package/dist/react/src/utils/index.d.ts +0 -9
- package/dist/react/src/utils/merge.d.ts +0 -10
- package/dist/react/src/utils/ssr.d.ts +0 -1
- package/dist/src-CMjyHjX5.cjs +0 -2
- package/dist/src-CMjyHjX5.cjs.map +0 -1
- package/dist/src-QHaSfgVe.js.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
# baseline-kit
|
|
2
|
+
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
### Improvements
|
|
6
|
+
|
|
7
|
+
- Added the React-free Remix 3 entry point and its dedicated CSS entry.
|
|
8
|
+
- Added a Node-only Remix SSR compatibility entry that preserves nested Config
|
|
9
|
+
context during serialization and fails closed if the pinned Remix renderer
|
|
10
|
+
changes.
|
|
11
|
+
- Added TypeScript 7 compiler support while keeping lint and declaration tools
|
|
12
|
+
on the official TypeScript 6 compatibility API until their TypeScript 7 APIs
|
|
13
|
+
are released.
|
|
14
|
+
- Simplified the public documentation around entry points, sizing, themes,
|
|
15
|
+
text-box alignment, SSR, and release checks.
|
|
16
|
+
- Removed unused CSS and linting dependencies, including `cssnano`.
|
|
17
|
+
|
|
18
|
+
### Bug fixes
|
|
19
|
+
|
|
20
|
+
- Fixed relative browser sizing, scoped Config color propagation, and delayed
|
|
21
|
+
hydration regressions across the React and native Remix adapters.
|
|
22
|
+
- Box and Padder now opt into `text-box: trim-both ex alphabetic` when the
|
|
23
|
+
browser supports it, while retaining normal line boxes as a fallback.
|
|
24
|
+
|
|
25
|
+
## 5.2.0
|
|
26
|
+
|
|
27
|
+
### Minor Changes
|
|
28
|
+
|
|
29
|
+
- 906488c: Use readable TSX source for the native Remix adapter, keep Maestro workflow
|
|
30
|
+
state local-only, and let Box choose whether height-snap correction goes to the
|
|
31
|
+
top or bottom padding edge.
|
|
32
|
+
|
|
33
|
+
## 5.1.0
|
|
34
|
+
|
|
35
|
+
### Minor Changes
|
|
36
|
+
|
|
37
|
+
- fbc8acc: Validation complete: the delayed-entry nested Config regressions and complete
|
|
38
|
+
browser matrix pass in the packed consumer. Version and publish this candidate
|
|
39
|
+
through the normal Changesets workflow after review.
|
|
40
|
+
|
|
41
|
+
Use the new Node-only `baseline-kit/remix/server` renderer for SSR with the
|
|
42
|
+
pinned Remix RC. It preserves nested provider context during serialization,
|
|
43
|
+
validates the upstream source digest, and leaves installed dependencies unchanged.
|
|
44
|
+
|
|
45
|
+
Add a React-free `baseline-kit/remix` adapter and `baseline-kit/styles/remix`, tested with Remix 3.0.0-rc.2. React applications keep using the root or guide entry without installing Remix.
|
|
46
|
+
|
|
47
|
+
Fix browser-resolved Baseline sizing, scoped Config color propagation, default paint without a theme, shared React Config across root/guide imports, and observer lifecycle regressions. Box and Padder now apply CSS text-box trimming using x-height (`ex`) and alphabetic baseline metrics; unsupported browsers retain normal line boxes.
|
|
48
|
+
|
|
49
|
+
Update the public installation, SSR, asset loading, spacing, browser support, and contributor documentation. Keep internal workspaces private, include the changelog in npm packages, and verify browser behavior using the packed native adapter before release.
|
|
50
|
+
|
|
51
|
+
## 5.0.0
|
|
52
|
+
|
|
53
|
+
### Breaking changes
|
|
54
|
+
|
|
55
|
+
- **Removed `Layout` and `Stack` components.** The library now focuses on its
|
|
56
|
+
core mission — baseline-grid visualization (`Baseline`, `Guide`) and spacing
|
|
57
|
+
primitives (`Box`, `Padder`, `Spacer`, `Config`). The following exports are
|
|
58
|
+
gone:
|
|
59
|
+
- Components: `Layout`, `Stack`
|
|
60
|
+
- Types: `LayoutProps`, `StackProps`
|
|
61
|
+
- Pure descriptors: `createLayoutDescriptor`, `createStackDescriptor`,
|
|
62
|
+
`getGridTemplate`, `LayoutDescriptor`, `LayoutDescriptorParams`,
|
|
63
|
+
`StackDescriptor`, `StackDescriptorParams`, `DIRECTION_AXIS`
|
|
64
|
+
- `Config` schema: `stack` and `layout` branches on `ConfigSchema`,
|
|
65
|
+
corresponding `stack` / `layout` props on `<Config>`
|
|
66
|
+
- CSS variables: `--bksk-*`, `--bkly-*`, and their themed counterparts
|
|
67
|
+
`--bk-stack-color-*`, `--bk-layout-color-*`
|
|
68
|
+
|
|
69
|
+
**Migration** — replace `<Layout>` with a plain `<div>` using `display: grid`
|
|
70
|
+
(or your design system's grid wrapper), and `<Stack>` with `display: flex`:
|
|
71
|
+
|
|
72
|
+
```tsx
|
|
73
|
+
// Before
|
|
74
|
+
<Layout columns={3} gap={16}>{children}</Layout>
|
|
75
|
+
<Stack direction="column" gap={8}>{children}</Stack>
|
|
76
|
+
|
|
77
|
+
// After
|
|
78
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 16 }}>
|
|
79
|
+
{children}
|
|
80
|
+
</div>
|
|
81
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
|
|
82
|
+
{children}
|
|
83
|
+
</div>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Bug fixes
|
|
87
|
+
|
|
88
|
+
- `Stack` gap / rowGap / columnGap values are now emitted with `px` units.
|
|
89
|
+
Numeric gaps were stringified to unitless values (`"8"`), which browsers
|
|
90
|
+
drop for non-zero `row-gap` / `column-gap` declarations, silently breaking
|
|
91
|
+
spacing. _(This fix landed before the `Stack` component was retired; it
|
|
92
|
+
matters now for any code still using `createStackDescriptor` from the core
|
|
93
|
+
package up to 5.0.0 — though that descriptor itself has also been removed.)_
|
|
94
|
+
- `useBaseline` snapping now fires on the first real measurement. The previous
|
|
95
|
+
implementation flipped a "did-snap" latch during the initial render (when
|
|
96
|
+
`useMeasure` has not yet reported a height), so `Box` and `Padder` using
|
|
97
|
+
`snapping="height"` or `"clamp"` silently skipped the snap entirely.
|
|
98
|
+
- `createMeasureObserver` and `createVirtualTracker` now cancel their pending
|
|
99
|
+
`requestAnimationFrame` callback inside `disconnect()`. Previously an
|
|
100
|
+
in-flight frame could invoke `onChange` after the consumer had already
|
|
101
|
+
unmounted the observer.
|
|
102
|
+
- `calculateGuideTemplate` and `normalizeValue` accept a `ConversionContext`
|
|
103
|
+
that threads the real browser viewport through for `vw` / `vh` / `vmin` /
|
|
104
|
+
`vmax` conversion. The React hooks pass it via a new `getViewportContext()`
|
|
105
|
+
helper in `@baseline-kit/dom`. Core stays zero-dependency.
|
|
106
|
+
|
|
107
|
+
### Architecture
|
|
108
|
+
|
|
109
|
+
- Source is now a monorepo under `packages/{core, dom, react}`.
|
|
110
|
+
`@baseline-kit/core` is pure TypeScript (zero dependencies), `@baseline-kit/dom`
|
|
111
|
+
holds imperative observers and timing utilities, `@baseline-kit/react` is the
|
|
112
|
+
React adapter that consumers publish-install as plain `baseline-kit`.
|
|
113
|
+
Types for the top-level `baseline-kit` entry are now bundled flat into
|
|
114
|
+
`dist/index.d.ts` via `rollup-plugin-dts`, so consumers don't see workspace
|
|
115
|
+
paths in their editor.
|
|
116
|
+
|
|
117
|
+
### Improvements
|
|
118
|
+
|
|
119
|
+
- Spacer measurement labels (e.g. `"8px"`) are marked `aria-hidden="true"` —
|
|
120
|
+
they're developer annotations, not content screen readers should announce.
|
|
121
|
+
- `Baseline` (`.bas`) and `Guide` (`.cols`) overlays get
|
|
122
|
+
`contain: layout style paint`, isolating debug-grid updates from surrounding
|
|
123
|
+
page layout.
|
|
124
|
+
- Removed dead `createStyleOverride` calls in Box / Stack / Layout / Baseline
|
|
125
|
+
descriptors where the "override" value was always identical to its default.
|
|
126
|
+
CSS module defaults in `base.css` carry the values the user sees.
|
|
127
|
+
- Hydration state consolidated: `Box`, `Spacer`, `Padder` now use a single
|
|
128
|
+
`useIsClient` hook instead of five copies of the `useState` + `useEffect`
|
|
129
|
+
pattern.
|
|
130
|
+
- Dropped the dead `warnOnMisalignment` option from `BaselineOptions` (the
|
|
131
|
+
hook had been ignoring it since deprecation).
|
|
132
|
+
- Standardised ref typing (`HTMLDivElement | null`) across components.
|
|
133
|
+
|
|
134
|
+
### Dependencies
|
|
135
|
+
|
|
136
|
+
- `jsdom` 26 → 29 (test env)
|
|
137
|
+
- `rollup-plugin-visualizer` 5 → 7 (dev-only bundle analyzer)
|
|
138
|
+
- `typescript` peer range widened to `^5.8.2 || ^6.0.0` so consumers can use
|
|
139
|
+
TS 6; devDep pinned at `^5.9.3` for reproducible builds.
|
|
140
|
+
- `eslint` 10 held back — upstream `eslint-plugin-react` 7.37.5 still uses
|
|
141
|
+
APIs removed in ESLint 10. Will revisit when the plugin ships a compatible
|
|
142
|
+
release.
|
|
143
|
+
- `eslint-plugin-react-hooks` 7 held back — its new rules flag longstanding
|
|
144
|
+
patterns (`useBaseline` ref-latch, `useIsClient` setState-in-effect) that
|
|
145
|
+
need their own refactor.
|
|
146
|
+
- `@types/node` kept on 22 (LTS alignment).
|
|
147
|
+
|
|
148
|
+
### CI
|
|
149
|
+
|
|
150
|
+
- Pinned Node to `22` in `test.yml` and `publish.yml` via
|
|
151
|
+
`actions/setup-node@v4` to satisfy engine requirements of the bumped
|
|
152
|
+
`jsdom` and `rollup-plugin-visualizer`.
|
|
153
|
+
- `typescript` added to `devDependencies` so CI resolves the same version as
|
|
154
|
+
local development (fresh checkouts were otherwise pulling the peer range's
|
|
155
|
+
latest satisfying version).
|
|
156
|
+
|
|
157
|
+
### Testing
|
|
158
|
+
|
|
159
|
+
- 206 tests, up from 174 at the start of the v5 cycle. Coverage added for
|
|
160
|
+
every pure descriptor (`baseline`, `box`, `guide`, `padder`, `spacer`, plus
|
|
161
|
+
pre-existing `stack` regression test), viewport context threading,
|
|
162
|
+
`rafThrottle` cancel, and the `useBaseline` first-measurement snap.
|
|
163
|
+
|
|
164
|
+
## 3.0.2
|
|
165
|
+
|
|
166
|
+
### Patch Changes
|
|
167
|
+
|
|
168
|
+
- More Readme fix
|
|
169
|
+
|
|
170
|
+
## 3.0.1
|
|
171
|
+
|
|
172
|
+
### Patch Changes
|
|
173
|
+
|
|
174
|
+
- Update README
|
|
175
|
+
|
|
176
|
+
## 3.0.0
|
|
177
|
+
|
|
178
|
+
### Major Changes
|
|
179
|
+
|
|
180
|
+
- comprehensive component library redesign with improved theming system and optimized rendering
|
|
181
|
+
|
|
182
|
+
## 2.1.0
|
|
183
|
+
|
|
184
|
+
### Minor Changes
|
|
185
|
+
|
|
186
|
+
- Added comprehensive Server-Side Rendering (SSR) support:
|
|
187
|
+
- Created new SSR utilities for stable rendering between server and client
|
|
188
|
+
- Updated package exports for proper CSS file resolution in SSR environments
|
|
189
|
+
- Added deterministic initial rendering for all components
|
|
190
|
+
- Implemented hydration-aware components that enhance after client-side hydration
|
|
191
|
+
- Added `ssrMode` prop for explicit SSR optimization
|
|
192
|
+
- Improved compatibility with Next.js, Remix, and other React Router applications
|
|
193
|
+
|
|
194
|
+
## 2.0.2
|
|
195
|
+
|
|
196
|
+
### Patch Changes
|
|
197
|
+
|
|
198
|
+
- React 19 compatibility:
|
|
199
|
+
- Replaced useContext with the React 19 `use` hook
|
|
200
|
+
- Updated Context Provider syntax
|
|
201
|
+
- Improved theme system organization and documentation
|
|
202
|
+
- Fixed gitignore and repository organization
|
|
203
|
+
- Updated dependencies
|
|
204
|
+
|
|
205
|
+
## 2.0.1
|
|
206
|
+
|
|
207
|
+
### Patch Changes
|
|
208
|
+
|
|
209
|
+
- 63a10ba: Fix readme, remove the demo and improved layout
|
|
210
|
+
|
|
211
|
+
## 2.0.0
|
|
212
|
+
|
|
213
|
+
### Major Changes
|
|
214
|
+
|
|
215
|
+
- 883f42d: API Refactor and added Stack Layout components
|
|
216
|
+
|
|
217
|
+
## 1.1.2
|
|
218
|
+
|
|
219
|
+
### Patch Changes
|
|
220
|
+
|
|
221
|
+
- type and lint fixing
|
|
222
|
+
|
|
223
|
+
## 1.1.1
|
|
224
|
+
|
|
225
|
+
### Patch Changes
|
|
226
|
+
|
|
227
|
+
- documentation update
|
|
228
|
+
|
|
229
|
+
## 1.1.0
|
|
230
|
+
|
|
231
|
+
### Minor Changes
|
|
232
|
+
|
|
233
|
+
- Added Spacer component
|
|
234
|
+
|
|
235
|
+
## 1.0.0
|
|
236
|
+
|
|
237
|
+
### Major Changes
|
|
238
|
+
|
|
239
|
+
- Removed PaddedGrid Component and update API
|
|
240
|
+
|
|
241
|
+
### Patch Changes
|
|
242
|
+
|
|
243
|
+
- 4ec1a23: Refactor the props configurations
|