@apostel/bedrock 0.1.0 → 0.1.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/README.md +51 -165
- package/dist/menu/parts.d.ts.map +1 -1
- package/dist/menu/parts.js +16 -6
- package/dist/menu/parts.js.map +1 -1
- package/dist/open-state.d.ts.map +1 -1
- package/dist/open-state.js +21 -3
- package/dist/open-state.js.map +1 -1
- package/package.json +11 -3
package/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
# bedrock
|
|
2
2
|
|
|
3
|
-
Headless React primitives
|
|
3
|
+
Headless React primitives that let the browser do the layering, positioning and
|
|
4
|
+
dismissal.
|
|
4
5
|
|
|
5
|
-
Radix-shaped anatomy — compound components, `asChild`, the
|
|
6
|
-
already type.
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
Radix-shaped anatomy — compound components, `asChild`, the part names you
|
|
7
|
+
already type. Underneath, the top layer, invoker commands and anchor positioning
|
|
8
|
+
do the work that `Portal`, `Presence`, `DismissableLayer` and Floating UI used to
|
|
9
|
+
do.
|
|
9
10
|
|
|
10
11
|
```bash
|
|
11
12
|
npm i @apostel/bedrock
|
|
12
13
|
```
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
**<https://bedrock.sams.land>**
|
|
15
|
+
<!-- demo: dialog -->
|
|
16
16
|
|
|
17
17
|
## The shape
|
|
18
18
|
|
|
@@ -30,124 +30,20 @@ import { Dialog } from '@apostel/bedrock'
|
|
|
30
30
|
</Dialog.Root>
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
renders roughly this:
|
|
34
34
|
|
|
35
35
|
```html
|
|
36
36
|
<button commandfor="d1" command="show-modal">Delete project</button>
|
|
37
37
|
<dialog id="d1">…</dialog>
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
No effect opens it. No state hook holds it. No portal moves it. The
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
No effect opens it. No state hook holds it. No portal moves it. The parser wires
|
|
41
|
+
the button to the dialog, so it works before hydration and keeps working if your
|
|
42
|
+
bundle never arrives.
|
|
43
43
|
|
|
44
|
-
##
|
|
44
|
+
## What it saves
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
default — and it costs nothing.
|
|
48
|
-
|
|
49
|
-
**`Dialog.Root`** — the DOM opens and closes itself. Accepts `defaultOpen` and a
|
|
50
|
-
read-only `onOpenChange`, which is a `toggle` listener and nothing more. This
|
|
51
|
-
covers the common case that gets miscategorised as "controlled": *I need to know
|
|
52
|
-
when it closed so I can reset the form.*
|
|
53
|
-
|
|
54
|
-
**`Dialog.Root` from `@apostel/bedrock/controlled`** — React gets a veto. Your
|
|
55
|
-
`open` prop decides whether an open is allowed to proceed.
|
|
56
|
-
|
|
57
|
-
```tsx
|
|
58
|
-
import { Dialog } from '@apostel/bedrock/controlled'
|
|
59
|
-
|
|
60
|
-
<Dialog.Root open={open} onOpenChange={setOpen}>
|
|
61
|
-
{/* identical children */}
|
|
62
|
-
</Dialog.Root>
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Same component names, same parts, same props on every part. Swapping is a
|
|
66
|
-
one-line import change, and a codemod if you're doing it across a repo.
|
|
67
|
-
|
|
68
|
-
The two entry points are separate module graphs, so if nothing in your app
|
|
69
|
-
imports `/controlled`, none of the reconciliation code reaches your bundle. This
|
|
70
|
-
is a real guarantee from the `exports` map, not a tree-shaking hope.
|
|
71
|
-
|
|
72
|
-
### How the veto works
|
|
73
|
-
|
|
74
|
-
Controlled mode is **DOM leads, React vetoes**, not React-owns-state:
|
|
75
|
-
|
|
76
|
-
1. User clicks. The browser fires `beforetoggle`, which is cancelable for
|
|
77
|
-
popovers. If your `open` prop disagrees, we `preventDefault()` and nothing
|
|
78
|
-
moved.
|
|
79
|
-
2. `onOpenChange` fires either way, so you can decide.
|
|
80
|
-
3. If your prop changes without user interaction, a reconciliation effect moves
|
|
81
|
-
the DOM to match.
|
|
82
|
-
|
|
83
|
-
Where the platform gives no cancelable hook, step 1 is skipped and step 3 puts
|
|
84
|
-
things back — one frame of visible movement in the refuse case only. Modal
|
|
85
|
-
dialogs get an extra veto on close via `request-close` and the `cancel` event.
|
|
86
|
-
|
|
87
|
-
## `asChild` and the button rule
|
|
88
|
-
|
|
89
|
-
Invoker commands work on `<button>` only. Interest invokers also work on `<a>`.
|
|
90
|
-
So this is fine:
|
|
91
|
-
|
|
92
|
-
```tsx
|
|
93
|
-
<Tooltip.Trigger asChild><a href="/pricing">Pricing</a></Tooltip.Trigger>
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
and this is not:
|
|
97
|
-
|
|
98
|
-
```tsx
|
|
99
|
-
<Dialog.Trigger asChild><div onClick={…}>Open</div></Dialog.Trigger>
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
A trigger that isn't a button gets no `commandfor` wiring, which means no
|
|
103
|
-
keyboard activation and no implicit `aria-expanded`. That's an accessibility
|
|
104
|
-
regression, and it's silent, so we make noise about it: **development throws**
|
|
105
|
-
at mount, with the tag it found and the tags that part accepts. Production logs
|
|
106
|
-
an error at the same check point.
|
|
107
|
-
|
|
108
|
-
There is no fallback click handler. Attaching one would ship the exact
|
|
109
|
-
imperative trigger machinery this library exists to delete, to every consumer,
|
|
110
|
-
forever — and nobody removes a fallback that works.
|
|
111
|
-
|
|
112
|
-
If you're wrapping a third-party component that renders a div and can't change
|
|
113
|
-
it, take the props and own the consequences:
|
|
114
|
-
|
|
115
|
-
```tsx
|
|
116
|
-
const props = useDialogTrigger(id)
|
|
117
|
-
<ThirdPartyThing {...props} />
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
The same check catches `<button>` inside a `<form>` without `type="button"`.
|
|
121
|
-
Submit buttons can't invoke popovers — submitting and opening are conflicting
|
|
122
|
-
behaviours — and that one bites people more often than the div case.
|
|
123
|
-
|
|
124
|
-
## What's native and what still ships JS
|
|
125
|
-
|
|
126
|
-
Be clear-eyed about this. The platform deleted positioning and layering. It did
|
|
127
|
-
not delete focus management.
|
|
128
|
-
|
|
129
|
-
**Almost entirely native** — AspectRatio, Separator, Label, VisuallyHidden,
|
|
130
|
-
Progress, Slider, ScrollArea, Collapsible, Accordion, Checkbox, Switch,
|
|
131
|
-
RadioGroup, Select, Dialog, AlertDialog, Popover.
|
|
132
|
-
|
|
133
|
-
Several of those are one element and no state at all: `Progress` is
|
|
134
|
-
`<progress>`, `Slider` is `<input type="range">`, `Select` is a `<select>` under
|
|
135
|
-
`appearance: base-select`, and `Accordion` gets single-open exclusivity from
|
|
136
|
-
`<details name>` rather than from an effect that closes its siblings.
|
|
137
|
-
|
|
138
|
-
**Native layering, small JS state layer** — Tooltip, HoverCard, Avatar, Toggle,
|
|
139
|
-
Toast.
|
|
140
|
-
|
|
141
|
-
**Still substantially JS** — DropdownMenu, ContextMenu, Menubar,
|
|
142
|
-
NavigationMenu, Tabs, Toolbar, ToggleGroup.
|
|
143
|
-
|
|
144
|
-
The reason is short: there is no native roving tabindex, no native typeahead, no
|
|
145
|
-
focus trap for non-modal layers, and no way to anchor to a pointer coordinate.
|
|
146
|
-
Every menu-shaped primitive needs all four, and they all share one `roving.ts` —
|
|
147
|
-
which ships from either entry point, so the two-root split saves them almost
|
|
148
|
-
nothing. The docs say that rather than implying otherwise.
|
|
149
|
-
|
|
150
|
-
Measured, not estimated — esbuild, minified, gzipped, React external:
|
|
46
|
+
Measured with esbuild, minified and gzipped, React external:
|
|
151
47
|
|
|
152
48
|
| primitive | bedrock | Radix | |
|
|
153
49
|
| --- | --- | --- | --- |
|
|
@@ -160,57 +56,47 @@ Measured, not estimated — esbuild, minified, gzipped, React external:
|
|
|
160
56
|
| Tooltip | **2.55 kB** | 19.3 kB | 7.6× |
|
|
161
57
|
| DropdownMenu | **3.55 kB** | 31.6 kB | 8.9× |
|
|
162
58
|
|
|
163
|
-
The
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
## Browser support
|
|
169
|
-
|
|
170
|
-
Latest Chrome, deliberately, for now.
|
|
171
|
-
|
|
172
|
-
`appearance: base-select`, `interpolate-size`, `::scroll-marker`, and
|
|
173
|
-
`popover=hint` are shipped or shipping across engines, so that bet is about
|
|
174
|
-
timing. `interestfor` is the one that isn't standardised yet, and it's what
|
|
175
|
-
drives Tooltip and HoverCard triggers.
|
|
176
|
-
|
|
177
|
-
Because of that, **no platform feature appears in a public prop name.**
|
|
178
|
-
`Tooltip.Root` takes `delayDuration`; today it becomes `interest-show-delay`,
|
|
179
|
-
tomorrow it might become a timer. Feature detection lives in one module, every
|
|
180
|
-
non-Baseline CSS block sits behind `@supports`, and the implementation can be
|
|
181
|
-
swapped without a major version.
|
|
182
|
-
|
|
183
|
-
## Styling
|
|
59
|
+
The gap widens where the platform hands over a whole element and narrows where
|
|
60
|
+
roving focus gets involved — menus save least, and
|
|
61
|
+
[should you switch?](./docs/should-you-switch.md#3-the-saving-is-uneven-and-menus-barely-save-anything)
|
|
62
|
+
says so in detail. The larger win is behavioural: no z-index fights, no portal
|
|
63
|
+
clipping, no repositioning on every scroll frame.
|
|
184
64
|
|
|
185
|
-
|
|
186
|
-
element. Open and closed states are selectable with `:open` and
|
|
187
|
-
`:popover-open`; enter and exit animation is `@starting-style` plus
|
|
188
|
-
`transition-behavior: allow-discrete`, no `forceMount`, no presence wrapper.
|
|
65
|
+
## What it costs
|
|
189
66
|
|
|
190
|
-
|
|
67
|
+
bedrock targets current browsers on purpose, and the price is a hard floor.
|
|
68
|
+
Triggers are invoker commands with no JavaScript standing behind them, so:
|
|
191
69
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
[
|
|
208
|
-
|
|
209
|
-
[
|
|
210
|
-
first if you are evaluating.
|
|
70
|
+
| | Chrome | Firefox | Safari |
|
|
71
|
+
| --- | --- | --- | --- |
|
|
72
|
+
| Minimum | **135** | **144** | **26.2** |
|
|
73
|
+
|
|
74
|
+
Above that line, missing features degrade: placement falls back to the centre of
|
|
75
|
+
the viewport, transitions are skipped, a `<select>` renders as the OS dropdown.
|
|
76
|
+
The component still opens, closes, traps focus and is announced correctly. Below
|
|
77
|
+
it, nothing opens at all.
|
|
78
|
+
|
|
79
|
+
[Browser support](./docs/compat.md) has every feature, its minimum version in
|
|
80
|
+
each engine, and what its absence does to your UI — measured in the browser you
|
|
81
|
+
open it in.
|
|
82
|
+
|
|
83
|
+
## Where to start
|
|
84
|
+
|
|
85
|
+
- **[Getting started](./docs/getting-started.md)** — install, first dialog, the
|
|
86
|
+
two roots.
|
|
87
|
+
- **[Should you switch?](./docs/should-you-switch.md)** — the case against
|
|
88
|
+
adopting this. Read it first if you are evaluating.
|
|
89
|
+
- **[Migrating from Radix](./docs/migration-from-radix.md)** — what changes,
|
|
90
|
+
what breaks, and what to do about it.
|
|
91
|
+
- **[shadcn registry](./docs/shadcn-registry.md)** — shadcn's own components with
|
|
92
|
+
Radix swapped for bedrock, installable with `npx shadcn add`.
|
|
93
|
+
- **[Agent skill](./skills/migrate-to-bedrock/SKILL.md)** — does the mechanical
|
|
94
|
+
migration and brings you the four decisions it cannot make for you.
|
|
211
95
|
|
|
212
96
|
## Status
|
|
213
97
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
98
|
+
`0.1.0` on npm. All 29 primitives, 141 Playwright tests against real Chrome.
|
|
99
|
+
What is missing is soak time and other engines — not components.
|
|
100
|
+
|
|
101
|
+
[Contributing](./CONTRIBUTING.md) · [Releasing](./RELEASING.md) ·
|
|
102
|
+
[Changelog](./CHANGELOG.md)
|
package/dist/menu/parts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.d.ts","sourceRoot":"","sources":["../../src/menu/parts.tsx"],"names":[],"mappings":"AAA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ent({ asChild, children, side = 'bottom', align = 'start
|
|
|
29
29
|
useEffect(() => {
|
|
30
30
|
if (!open)
|
|
31
31
|
return;
|
|
32
|
-
// The popover opens synchronously on the invoker's click; this effect runs
|
|
33
|
-
// a frame or two later. Anything the user did in between — a key that
|
|
34
|
-
// already moved focus into the menu — wins, because re-focusing the first
|
|
35
|
-
// item here would silently undo it.
|
|
36
32
|
const menu = nodeRef.current;
|
|
37
|
-
if (!menu
|
|
33
|
+
if (!menu)
|
|
38
34
|
return;
|
|
39
|
-
|
|
35
|
+
// A frame, because `open` is set on `beforetoggle` — which fires while the
|
|
36
|
+
// popover is still `display: none`, and `focus()` on a hidden element does
|
|
37
|
+
// nothing at all. By the next frame `toggle` has fired and it is painted.
|
|
38
|
+
//
|
|
39
|
+
// This used to work by accident: the open state was briefly cleared and
|
|
40
|
+
// re-set, so the effect ran a second time, late enough to land. Fixing that
|
|
41
|
+
// churn is what exposed this.
|
|
42
|
+
const frame = requestAnimationFrame(() => {
|
|
43
|
+
// Anything the user did in between wins — a key that already moved focus
|
|
44
|
+
// into the menu must not be silently undone.
|
|
45
|
+
if (menu.contains(document.activeElement))
|
|
46
|
+
return;
|
|
47
|
+
menu.querySelector('[data-bedrock-roving-item]')?.focus();
|
|
48
|
+
});
|
|
49
|
+
return () => cancelAnimationFrame(frame);
|
|
40
50
|
}, [open]);
|
|
41
51
|
return (_jsx(Part, { ...props, id: id, popover: "auto", role: "menu", style: { ...placementStyles(anchor, { side, align, sideOffset, avoidCollisions }), ...style }, "data-side": side, "data-align": align, ref: useComposedRefs(ref, registerContent, registerContainer, (node) => {
|
|
42
52
|
nodeRef.current = node;
|
package/dist/menu/parts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.js","sourceRoot":"","sources":["../../src/menu/parts.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,KAAK,EACL,OAAO,EACP,MAAM,EAC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AC,QAAQ,EACb,IAAI,EAAC,UAAU,EACf,UAAU,EAAE,EAAE,EACd,OAAO,EAAC,gBAAgB,mBACV,MAAM,EACpB,SAAS,EAAE,aAAa,EACxB,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,KAAK,EAAkB,EACvD,GAAG,EAAE,eAAe,CAAc,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAC9C,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAC,CACpD,8BACwB,EAAE,4BACJ,EAAE,GACzB,CACH,CAAA;AACH,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAuB;IACpD,OAAO,KAAC,WAAW,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,OAAO,KAAK,KAAK,GAAI,CAAA;AAC9D,CAAC"}
|
package/dist/open-state.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-state.d.ts","sourceRoot":"","sources":["../src/open-state.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"open-state.d.ts","sourceRoot":"","sources":["../src/open-state.ts"],"names":[],"mappings":"AA8BA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,EAAE,WAAW,UAAQ;;oBA2DzE,WAAW,GAAG,IAAI;;EA+B5B"}
|
package/dist/open-state.js
CHANGED
|
@@ -1,13 +1,31 @@
|
|
|
1
1
|
import { useCallback, useRef, useState } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Separate calls, not `:open, :popover-open`. An unknown selector invalidates a
|
|
4
|
+
* whole selector list and makes `matches()` throw, so combining them would mean
|
|
5
|
+
* an engine missing either one reports every element as closed.
|
|
6
|
+
*/
|
|
7
|
+
function matchesSelector(node, selector) {
|
|
4
8
|
try {
|
|
5
|
-
return node.matches(
|
|
9
|
+
return node.matches(selector);
|
|
6
10
|
}
|
|
7
11
|
catch {
|
|
8
12
|
return false;
|
|
9
13
|
}
|
|
10
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Whether the element is open, by the DOM's own reckoning.
|
|
17
|
+
*
|
|
18
|
+
* `:open` covers `<dialog>`, `<details>` and `<select>`. It does **not** match
|
|
19
|
+
* an open popover in Chrome today — measured, not assumed — which is why
|
|
20
|
+
* `:popover-open` is asked separately rather than trusted to be covered.
|
|
21
|
+
*
|
|
22
|
+
* Getting this wrong is not subtle: `settle()` reads it a frame after opening,
|
|
23
|
+
* concludes a perfectly open popover is closed, and unmounts the children. The
|
|
24
|
+
* popover stays open and empty, collapsing to the width of nothing.
|
|
25
|
+
*/
|
|
26
|
+
function isOpen(node) {
|
|
27
|
+
return matchesSelector(node, ':popover-open') || matchesSelector(node, ':open');
|
|
28
|
+
}
|
|
11
29
|
/**
|
|
12
30
|
* Tracks what the DOM is actually doing, so parts can render children only
|
|
13
31
|
* while there is something to see.
|
package/dist/open-state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-state.js","sourceRoot":"","sources":["../src/open-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAErD
|
|
1
|
+
{"version":3,"file":"open-state.js","sourceRoot":"","sources":["../src/open-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAErD;;;;GAIG;AACH,SAAS,eAAe,CAAC,IAAiB,EAAE,QAAgB;IAC1D,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAS,MAAM,CAAC,IAAiB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mB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;QACtD,CAAC;QAED,OAAO,CAAC,OAAO,GAAG,IAAI,CAAA;QACtB,IAAI,CAAC,IAAI;YAAE,OAAM;QAEjB,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAA;QACzD,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;QAE7C,yEAAyE;QACzE,sEAAsE;QACtE,uEAAuE;QACvE,wEAAwE;QACxE,4CAA4C;QAC5C,EAAE;QACF,qEAAqE;QACrE,0EAA0E;QAC1E,uEAAuE;QACvE,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YACjB,OAAO,CAAC,IAAI,CAAC,CAAA;YACb,IAAI,CAAC,WAAW,CAAC,OAAO;gBAAE,MAAM,CAAC,IAAI,CAAC,CAAA;QACxC,CAAC;IACH,CAAC,EACD,CAAC,kBAAkB,EAAE,YAAY,EAAE,MAAM,CAAC,CAC3C,CAAA;IAED,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA;AACnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apostel/bedrock",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Headless React primitives built on native platform features",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -53,21 +53,29 @@
|
|
|
53
53
|
"test:install": "playwright install chromium",
|
|
54
54
|
"verify": "npm run format:check && npm run lint && npm run typecheck && npm run lint:graph && npm run build && npm run test",
|
|
55
55
|
"prepublishOnly": "npm run verify",
|
|
56
|
-
"docs:build": "node scripts/build-docs.mjs",
|
|
56
|
+
"docs:build": "node scripts/build-docs.mjs && npm run demos:build",
|
|
57
57
|
"changeset": "changeset",
|
|
58
58
|
"version": "changeset version",
|
|
59
|
-
"release": "changeset publish"
|
|
59
|
+
"release": "changeset publish",
|
|
60
|
+
"demos:build": "vite build --config vite.demos.config.ts",
|
|
61
|
+
"docs:baseline": "node scripts/build-baseline.mjs"
|
|
60
62
|
},
|
|
61
63
|
"devDependencies": {
|
|
62
64
|
"@axe-core/playwright": "^4.12.1",
|
|
63
65
|
"@changesets/cli": "^3.0.1",
|
|
64
66
|
"@playwright/test": "^1.62.1",
|
|
67
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
65
68
|
"@types/react": "^19.0.0",
|
|
69
|
+
"@types/react-dom": "^19.2.5",
|
|
66
70
|
"@vitejs/plugin-react": "^6.0.5",
|
|
71
|
+
"clsx": "^2.1.1",
|
|
67
72
|
"dependency-cruiser": "^16.0.0",
|
|
73
|
+
"lucide-react": "^1.39.0",
|
|
68
74
|
"marked": "^15.0.12",
|
|
69
75
|
"oxfmt": "^0.61.0",
|
|
70
76
|
"oxlint": "^1.76.0",
|
|
77
|
+
"tailwind-merge": "^3.6.0",
|
|
78
|
+
"tailwindcss": "^4.3.3",
|
|
71
79
|
"typescript": "^5.6.0",
|
|
72
80
|
"vite": "^8.2.0"
|
|
73
81
|
},
|