@a4ui/core 0.38.0 → 0.39.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/README.md +66 -9
- package/dist/{Collapse-Cr5cDqAl.js → Collapse-CrKiFD8K.js} +173 -124
- package/dist/charts/Sparkline.d.ts +2 -0
- package/dist/charts.js +8 -5
- package/dist/commerce.js +59 -59
- package/dist/elements.css +248 -151
- package/dist/elements.iife.js +1 -1
- package/dist/elements.js +1025 -1015
- package/dist/full.css +248 -151
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4723 -4656
- package/dist/lib/anchored.d.ts +7 -0
- package/dist/lib/direction.d.ts +18 -0
- package/dist/styles.css +27 -11
- package/dist/theme.css +1559 -0
- package/dist/ui/DirectionProvider.d.ts +47 -0
- package/dist/ui/Drawer.d.ts +6 -2
- package/dist/ui/Sidebar.d.ts +8 -2
- package/dist/ui/Toast.d.ts +5 -1
- package/package.json +5 -3
- package/preset.d.ts +2 -1
- package/preset.js +16 -5
- package/src/charts/BarList.tsx +1 -1
- package/src/charts/Sparkline.tsx +5 -1
- package/src/commerce/CartLine.tsx +1 -1
- package/src/commerce/FacetSidebar.tsx +1 -1
- package/src/commerce/ProductCard.tsx +1 -1
- package/src/index.ts +7 -1
- package/src/layout/NavGroup.tsx +2 -2
- package/src/lib/anchored.ts +13 -0
- package/src/lib/direction.ts +35 -0
- package/src/ui/Accordion.tsx +2 -2
- package/src/ui/ActivityFeed.tsx +2 -2
- package/src/ui/AlertDialog.tsx +8 -4
- package/src/ui/Anchor.tsx +1 -1
- package/src/ui/AnnouncementBar.tsx +3 -3
- package/src/ui/ArtifactPanel.tsx +1 -1
- package/src/ui/AvailabilityPicker.tsx +2 -2
- package/src/ui/AvatarGroup.tsx +2 -2
- package/src/ui/BackToTop.tsx +1 -1
- package/src/ui/Badge.tsx +1 -1
- package/src/ui/BlockEditor.tsx +1 -1
- package/src/ui/ButtonGroup.tsx +1 -1
- package/src/ui/Callout.tsx +1 -1
- package/src/ui/Carousel.tsx +17 -9
- package/src/ui/Cascader.tsx +2 -2
- package/src/ui/CategoryStrip.tsx +4 -1
- package/src/ui/CodeEditor.tsx +5 -5
- package/src/ui/CodeTabs.tsx +1 -1
- package/src/ui/Combobox.tsx +2 -1
- package/src/ui/Command.tsx +9 -5
- package/src/ui/Comment.tsx +1 -1
- package/src/ui/Configurator.tsx +2 -2
- package/src/ui/ContextMenu.tsx +2 -1
- package/src/ui/DateField.tsx +4 -4
- package/src/ui/DateRangePicker.tsx +4 -4
- package/src/ui/DiffViewer.tsx +4 -3
- package/src/ui/DirectionProvider.tsx +82 -0
- package/src/ui/Drawer.tsx +29 -8
- package/src/ui/Dropdown.tsx +2 -1
- package/src/ui/EmojiPicker.tsx +5 -2
- package/src/ui/Expandable.tsx +2 -2
- package/src/ui/Faq.tsx +1 -1
- package/src/ui/Field.tsx +1 -1
- package/src/ui/FloatingActionButton.tsx +2 -2
- package/src/ui/FollowingPointer.tsx +2 -2
- package/src/ui/Hero.tsx +2 -2
- package/src/ui/HoldToConfirm.tsx +2 -2
- package/src/ui/HoverCard.tsx +2 -1
- package/src/ui/Image.tsx +9 -5
- package/src/ui/InlineSelect.tsx +1 -1
- package/src/ui/InputGroup.tsx +2 -2
- package/src/ui/Item.tsx +1 -1
- package/src/ui/JsonViewer.tsx +2 -2
- package/src/ui/Kanban.tsx +1 -1
- package/src/ui/KpiBlock.tsx +1 -1
- package/src/ui/Lightbox.tsx +9 -6
- package/src/ui/MasterDetail.tsx +1 -1
- package/src/ui/Mentions.tsx +1 -1
- package/src/ui/Menubar.tsx +9 -8
- package/src/ui/Modal.tsx +9 -5
- package/src/ui/ModelPicker.tsx +2 -1
- package/src/ui/MultiSelect.tsx +5 -5
- package/src/ui/NativeSelect.tsx +2 -2
- package/src/ui/NavigationMenu.tsx +5 -4
- package/src/ui/NotificationCenter.tsx +1 -1
- package/src/ui/NotificationStack.tsx +1 -1
- package/src/ui/NumberInput.tsx +2 -2
- package/src/ui/OnboardingChecklist.tsx +2 -2
- package/src/ui/Pagination.tsx +2 -2
- package/src/ui/PillSearch.tsx +3 -3
- package/src/ui/PivotTable.tsx +0 -0
- package/src/ui/Popover.tsx +2 -1
- package/src/ui/Portal.tsx +3 -1
- package/src/ui/PresenceAvatars.tsx +4 -4
- package/src/ui/PricingTable.tsx +1 -1
- package/src/ui/Prose.tsx +3 -3
- package/src/ui/QueryBuilder.tsx +4 -4
- package/src/ui/Rating.tsx +6 -2
- package/src/ui/ReasoningTrace.tsx +1 -1
- package/src/ui/ScrollArea.tsx +1 -1
- package/src/ui/ScrollProgress.tsx +2 -2
- package/src/ui/SideRail.tsx +3 -3
- package/src/ui/Sidebar.tsx +43 -23
- package/src/ui/SlashMenu.tsx +1 -1
- package/src/ui/Snippet.tsx +6 -3
- package/src/ui/Sortable.tsx +1 -1
- package/src/ui/SpecSheet.tsx +1 -1
- package/src/ui/SpeedDial.tsx +1 -1
- package/src/ui/Splitter.tsx +8 -3
- package/src/ui/SpreadsheetGrid.tsx +4 -4
- package/src/ui/Stepper.tsx +1 -1
- package/src/ui/SuggestionChips.tsx +1 -1
- package/src/ui/Switch.tsx +1 -1
- package/src/ui/Table.tsx +5 -2
- package/src/ui/TimeField.tsx +8 -8
- package/src/ui/Timeline.tsx +2 -2
- package/src/ui/Toast.tsx +9 -3
- package/src/ui/ToolCallTimeline.tsx +2 -2
- package/src/ui/Tooltip.tsx +2 -1
- package/src/ui/Tour.tsx +1 -1
- package/src/ui/TransactionFeed.tsx +1 -1
- package/src/ui/Transfer.tsx +2 -2
- package/src/ui/Tree.tsx +2 -2
- package/src/ui/TreeSelect.tsx +2 -2
- package/src/ui/TreeTable.tsx +4 -4
- package/src/ui/UsageMeter.tsx +1 -1
- package/src/ui/VideoPlayerShell.tsx +2 -2
- package/src/ui/internal/CalendarCore.tsx +6 -6
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
[](https://www.npmjs.com/package/@a4ui/core)
|
|
12
12
|
[](https://bundlephobia.com/package/@a4ui/core)
|
|
13
13
|
|
|
14
|
-
Accessible SolidJS **Spatial Glass** component library —
|
|
14
|
+
Accessible SolidJS **Spatial Glass** component library — 240+ components,
|
|
15
15
|
layouts, runtime themes, a motion system, **1500+ icons** (lucide), and
|
|
16
16
|
framework-agnostic Web Components. Named after the 4 people in the Rivera
|
|
17
17
|
family. 🙂
|
|
@@ -35,7 +35,8 @@ Three layers, one identity:
|
|
|
35
35
|
npm install @a4ui/core
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
Peer
|
|
38
|
+
Peer dependencies: `solid-js` (>= 1.9) and, optionally, `tailwindcss` (`^3.4.0` or
|
|
39
|
+
`^4.0.0`; the setup differs, see below).
|
|
39
40
|
|
|
40
41
|
**Starting fresh?** Scaffold a preconfigured Solid + Vite + A4ui app (with or
|
|
41
42
|
without Tailwind):
|
|
@@ -47,7 +48,33 @@ npm create a4ui@latest my-app
|
|
|
47
48
|
|
|
48
49
|
## Use
|
|
49
50
|
|
|
50
|
-
**With Tailwind**
|
|
51
|
+
**With Tailwind 4** — import `@a4ui/core/theme.css` after Tailwind in your CSS, and
|
|
52
|
+
nothing else. It carries the tokens, the glass classes, the `light:` variant and
|
|
53
|
+
the `@source` that scans the components:
|
|
54
|
+
|
|
55
|
+
```css
|
|
56
|
+
/* src/index.css */
|
|
57
|
+
@import 'tailwindcss';
|
|
58
|
+
@import '@a4ui/core/theme.css';
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
import './index.css'
|
|
63
|
+
import { Button } from '@a4ui/core'
|
|
64
|
+
|
|
65
|
+
export default () => <Button variant="primary">Save</Button>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Tailwind 4 ignores `tailwind.config.js` and its `presets:` unless `@config` names
|
|
69
|
+
it, so the Tailwind 3 setup below builds without error on Tailwind 4 and produces
|
|
70
|
+
no A4ui styles. If you see unstyled components, check this first.
|
|
71
|
+
|
|
72
|
+
`theme.css` pins the scales the components were written for, so in your own code
|
|
73
|
+
`shadow-sm`, `rounded-sm`, `blur-sm`, `ring`, the default palette and the default
|
|
74
|
+
border color mean what they mean in Tailwind 3 (details in
|
|
75
|
+
[`INTEGRATIONS.md`](./INTEGRATIONS.md#tailwind-4)).
|
|
76
|
+
|
|
77
|
+
**With Tailwind 3** — add the A4ui preset so the components'
|
|
51
78
|
utilities and glass classes (`bg-primary/90`, `.card`, `.glow-edge`) resolve
|
|
52
79
|
against A4ui's tokens, and import the token stylesheet once:
|
|
53
80
|
|
|
@@ -78,7 +105,8 @@ import { Button } from '@a4ui/core'
|
|
|
78
105
|
```
|
|
79
106
|
|
|
80
107
|
(`styles.css` ships only the CSS variables + motion keyframes — it needs the
|
|
81
|
-
Tailwind preset to generate the component utilities; `
|
|
108
|
+
Tailwind 3 preset to generate the component utilities; `theme.css` already includes it;
|
|
109
|
+
`full.css` is the
|
|
82
110
|
self-contained alternative. The framework-agnostic `elements` bundle ships its
|
|
83
111
|
own precompiled CSS too.)
|
|
84
112
|
|
|
@@ -108,7 +136,7 @@ Browse the full set at [lucide.dev/icons](https://lucide.dev/icons).
|
|
|
108
136
|
|
|
109
137
|
A4ui is **tree-shakeable** — `sideEffects` is `["**/*.css"]`, so the only thing
|
|
110
138
|
that lands in your bundle is what you actually `import`. You never pay for the
|
|
111
|
-
|
|
139
|
+
240+ components you don't use, and adding components to the library **doesn't grow
|
|
112
140
|
your app**. Import à la carte:
|
|
113
141
|
|
|
114
142
|
```tsx
|
|
@@ -122,11 +150,12 @@ Approximate **gzipped** weights (measured on 0.13.0; JS excludes the `solid-js`,
|
|
|
122
150
|
| ----------------------------------------------------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
123
151
|
| **First component** (e.g. `Button` + the `cn` helper) | ~10–11 kB | One-time baseline (includes `tailwind-merge`). Shared by every component. |
|
|
124
152
|
| **Typical extra primitive** | ~0.1–0.5 kB | `Button` alone 10.7 kB → `Button + Card + Badge + Input` 11.1 kB. Heavier ones (`DataGrid`, `Calendar`, `Combobox`, `Tour`) cost more via their Kobalte/behavior deps. |
|
|
125
|
-
| **Whole barrel** (`@a4ui/core`,
|
|
153
|
+
| **Whole barrel** (`@a4ui/core`, everything used) | ~53.0 kB | Only if you literally import everything — the realistic ceiling. |
|
|
126
154
|
| `@a4ui/core/commerce` | ~3.0 kB | ProductCard, CartSummary, PriceTag… |
|
|
127
155
|
| `@a4ui/core/charts` | ~2.5 kB | Sparkline, BarChart, DonutChart (native SVG). |
|
|
128
156
|
| `@a4ui/core/styles.css` | ~5.3 kB | Tokens + motion keyframes (needs the Tailwind preset for utilities). |
|
|
129
157
|
| `@a4ui/core/full.css` | ~14.1 kB | Every utility precompiled — for **no-Tailwind** apps. With Tailwind, your own purge ships far less. |
|
|
158
|
+
| `@a4ui/core/theme.css` | ~8 kB | Tailwind 4 entry: tokens, motion, starfield and glass rules, all emitted. Your Tailwind build adds the utilities. |
|
|
130
159
|
| `@a4ui/core/elements` (Web Components) | ~63.9 kB JS + ~14 kB CSS | Self-contained (Solid + motion compiled in). For React/Vue/vanilla. |
|
|
131
160
|
| `motion` (the animation engine) | ~45 kB | **External / opt-in** — pulled in **only** if you import an animated component (`Stat`, `HoldToConfirm`, `Curtain`, `Parallax`, `ScrambleText`, `FillText`, `TextReveal`, `NotificationStack`, `MultiStateBadge`, `Expandable`, `Magnetic`, `ScrollProgress`, `GradientText`, `SpeedDial`, or the `flyToCart`/`animate`/`createCountUp` helpers). Engine-free ones (`LoadingDots`, `NowPlaying`, `Typewriter`, `Spotlight`, `Ripple`, `TiltCard` — CSS/WAAPI) and static UIs never load it; that's also why `<Button ripple>` and `<Card tilt spotlight>` cost nothing. |
|
|
132
161
|
|
|
@@ -180,9 +209,36 @@ recolors live, then copy the exported CSS or JSON and apply it as a
|
|
|
180
209
|
`ThemeDefinition`. This is separate from the light/dark `setTheme`/`toggleTheme`
|
|
181
210
|
mode switch — a theme recolors underneath either mode.
|
|
182
211
|
|
|
212
|
+
### Right-to-left
|
|
213
|
+
|
|
214
|
+
Wrap the app (or any subtree) in `DirectionProvider`. It sets `dir` on the DOM,
|
|
215
|
+
tells Kobalte which way arrow keys move (Tabs, Menubar, Slider, menus), and
|
|
216
|
+
copies the direction onto overlays that render in `<body>` (Modal, Drawer,
|
|
217
|
+
Popover, Dropdown, Tooltip, Command):
|
|
218
|
+
|
|
219
|
+
```tsx
|
|
220
|
+
import { DirectionProvider, useDirection } from '@a4ui/core'
|
|
221
|
+
|
|
222
|
+
render(
|
|
223
|
+
() => (
|
|
224
|
+
<DirectionProvider dir="rtl" locale="ar">
|
|
225
|
+
<App />
|
|
226
|
+
</DirectionProvider>
|
|
227
|
+
),
|
|
228
|
+
document.getElementById('root')!,
|
|
229
|
+
)
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Components use logical Tailwind utilities (`ms-*`, `start-*`, `text-start`), so
|
|
233
|
+
nothing else needs configuring. Mount `<Toaster />` inside the provider. `Drawer`
|
|
234
|
+
and `Sidebar` take `side="start" | "end"`, which follows the direction;
|
|
235
|
+
`Drawer`'s `"left" | "right"` stay physical. Charts, maps, code blocks and
|
|
236
|
+
other geometry-bound widgets keep their own left-to-right layout. The docs have
|
|
237
|
+
an RTL switch on every example.
|
|
238
|
+
|
|
183
239
|
## Components
|
|
184
240
|
|
|
185
|
-
|
|
241
|
+
240+ components across eleven categories (this is a sample — see the
|
|
186
242
|
**[docs site](https://a4ui.pages.dev/)** or `src/index.ts` for the
|
|
187
243
|
full list):
|
|
188
244
|
|
|
@@ -193,7 +249,7 @@ full list):
|
|
|
193
249
|
| Data & display | `Table`, `DataGrid`, `Tree`, `Calendar`, `Timeline`, `Stat`, `Descriptions`, `SpecSheet`, `RatingsSummary`, `LogoWall`, `ChatThread`, `Message`, `Attachment`, `Citation`, `CodeTabs`, `DataView`, `BalanceCard`, `TransactionFeed`, `KpiBlock`, `BlockEditor`, `CalendarHeatmap` |
|
|
194
250
|
| Navigation | `Tabs`, `Breadcrumb`, `Pagination`, `Command`, `Anchor`, `Stepper`, `BottomNavigation`, `CategoryStrip`, `Spaces`, `SideRail`, `Sidebar`, `NavigationMenu` |
|
|
195
251
|
| Feedback | `Alert`, `AnnouncementBar`, `Toast`, `Progress`, `Skeleton`, `Empty`, `Result`, `NotificationCenter` |
|
|
196
|
-
| Layout | `AppShell`, `SpaceBackground`, `ThemedScenery`, `Card`, `Splitter`, `Affix`, `NavGroup`, `FloatingToolbar`, `ArtifactPanel`, `MasterDetail`, `ScrollArea`, `Item`, `Prose`
|
|
252
|
+
| Layout | `AppShell`, `SpaceBackground`, `ThemedScenery`, `DirectionProvider`, `Card`, `Splitter`, `Affix`, `NavGroup`, `FloatingToolbar`, `ArtifactPanel`, `MasterDetail`, `ScrollArea`, `Item`, `Prose` |
|
|
197
253
|
| Commerce | `ProductCard`, `ProductGrid`, `PriceTag`, `PriceBlock`, `QuantityStepper`, `CartLine`, `CartSummary`, `FilterGroup`, `FacetSidebar`, `ConditionScale` |
|
|
198
254
|
| Charts | `Sparkline`, `BarChart`, `AreaChart`, `PieChart`, `DonutChart`, `RadialBarChart` (native SVG, theme-tinted) |
|
|
199
255
|
| Sections | `SiteNav`, `Hero`, `FeatureGrid`, `Testimonials`, `Faq`, `CtaBanner`, `ContactSection`, `SiteFooter`, `TeamGrid` (data-driven page blocks: plain props, no JSX required) |
|
|
@@ -275,7 +331,8 @@ Drop this into your project's `AGENTS.md` / `CLAUDE.md` to prime your agent:
|
|
|
275
331
|
|
|
276
332
|
> This project uses **@a4ui/core** (SolidJS "Spatial Glass" design system). Import
|
|
277
333
|
> components as named exports from `@a4ui/core`; import `@a4ui/core/styles.css`
|
|
278
|
-
> once in the app entry; add `@a4ui/core/preset` to `tailwind.config` (optional).
|
|
334
|
+
> once in the app entry; add `@a4ui/core/preset` to `tailwind.config` (optional). On
|
|
335
|
+
> Tailwind 4, `@import '@a4ui/core/theme.css'` after Tailwind replaces both.
|
|
279
336
|
> Props are typed with JSDoc/`@example` in the package's `.d.ts`.
|
|
280
337
|
> **For the A4ui look, follow the Spatial Glass recipe** (in `llms.txt` and
|
|
281
338
|
> https://a4ui.pages.dev/#/guide-spatial-glass): put an `<Aurora/>` backdrop
|