@fldr/ui 0.3.8 → 0.3.10
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 +67 -448
- package/ai/component-registry.json +27 -14
- package/ai/component-registry.md +3 -3
- package/dist/.build-complete +1 -1
- package/dist/blocks-source/auth-card/auth-card.test.tsx +20 -14
- package/dist/blocks-source/auth-card/auth-card.tsx +73 -55
- package/dist/blocks-source/file-table/file-table.tsx +197 -150
- package/dist/blocks-source/login-page/login-page.tsx +3 -1
- package/dist/blocks-source/share-dialog/share-dialog.test.tsx +9 -3
- package/dist/blocks-source/share-dialog/share-dialog.tsx +50 -35
- package/dist/blocks.d.ts +24 -5
- package/dist/blocks.js +250 -197
- package/dist/brands.d.ts +143 -0
- package/dist/brands.js +92 -0
- package/dist/{button-DzavLWXm.d.ts → button-CS82eT0x.d.ts} +1 -1
- package/dist/chunks/{checkbox-eifiwbw34xwsikvf.js → checkbox-d5epe4dl78bzy4f8.js} +8 -8
- package/dist/chunks/{dropdown-e5zk0ez21busnt0b.js → dropdown-oec4g1w9kbsjsg15.js} +1 -1
- package/dist/chunks/highlighter-kb7huz24pcziin6d.js +57 -0
- package/dist/chunks/{layer-dialog-m8qb0wzfg3k7406a.js → layer-dialog-ioa3r4ayemppsspx.js} +4 -3
- package/dist/chunks/{table-ngl1b5yc8mcur662.js → table-bdye068ekayq3u1n.js} +1 -1
- package/dist/chunks/table-n5yarooiknhc18ln.js +448 -0
- package/dist/chunks/{table-of-contents-gkjv9ck8etbz64ej.js → table-of-contents-d3pmkrk223umdz9h.js} +1 -1
- package/dist/code/server.js +1 -1
- package/dist/code.js +4 -131
- package/dist/components/banner.d.ts +1 -1
- package/dist/components/button.d.ts +2 -2
- package/dist/components/checkbox.d.ts +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/input-group.d.ts +2 -1
- package/dist/components/input.d.ts +2 -2
- package/dist/components/layer-dialog.js +1 -1
- package/dist/components/link.d.ts +2 -67
- package/dist/components/sidebar.d.ts +2 -1
- package/dist/components/table-of-contents.js +1 -1
- package/dist/components/table.d.ts +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/toast.d.ts +1 -1
- package/dist/components/toolbar.d.ts +1 -1
- package/dist/form.d.ts +207 -0
- package/dist/form.js +317 -0
- package/dist/hotkeys.d.ts +135 -0
- package/dist/hotkeys.js +203 -0
- package/dist/index-9LwQy84o.d.ts +1 -0
- package/dist/index-B7iG0qDU.d.ts +1 -0
- package/dist/{index-B6JNUfG9.d.ts → index-BMXHK-3k.d.ts} +2 -2
- package/dist/{index-B6Wo_iiN.d.ts → index-B_ug9XY7.d.ts} +1 -1
- package/dist/{index-RP_rt8vB.d.ts → index-Bh9kuAvN.d.ts} +1 -1
- package/dist/{index-DjSGDESy.d.ts → index-CAUjUp2G.d.ts} +1 -1
- package/dist/{index-NnHba-T1.d.ts → index-DK28YxxP.d.ts} +2 -2
- package/dist/{index-aahL-0Zw.d.ts → index-DOVlARA6.d.ts} +2 -2
- package/dist/index-DTj6M6kA.d.ts +1 -0
- package/dist/index.d.ts +14 -12
- package/dist/index.js +5 -6
- package/dist/{input-group-8gEtPiKw.d.ts → input-group-Swzit45o.d.ts} +1 -1
- package/dist/link-CoVXE5W2.d.ts +68 -0
- package/dist/query.d.ts +156 -0
- package/dist/query.js +204 -0
- package/dist/router.d.ts +95 -0
- package/dist/router.js +146 -0
- package/dist/skeleton.d.ts +3 -0
- package/dist/skeleton.js +4 -0
- package/dist/styles/kumo-binding.css +36 -0
- package/dist/styles/kumo-standalone.css +1 -1
- package/dist/styles/theme-fldr.css +18 -18
- package/dist/table.d.ts +245 -0
- package/dist/table.js +3 -0
- package/dist/theming.d.ts +4 -4
- package/dist/theming.js +2 -2
- package/package.json +46 -1
- package/dist/chunks/highlighter-mouttug0tu8xg1i8.js +0 -1364
- package/dist/index-DL1-uSuH.d.ts +0 -1
- /package/dist/{index-BkTAB4wj.d.ts → sidebar-BkTAB4wj.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,489 +1,108 @@
|
|
|
1
1
|
# @fldr/ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
fldr's React UI kit: accessible components, page-level blocks, and TanStack integrations, themed to fldr out of the box.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**[Kitchen sink →](https://fldr-ui-kitchen-sink.fldr.workers.dev)**: every component, block and integration, live, with theme and dark-mode switches.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
pnpm add @fldr/ui
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
### Peer Dependencies
|
|
7
|
+
Built on [Cloudflare Kumo](https://github.com/cloudflare/kumo) (MIT): Base UI primitives for keyboard, focus and ARIA handling, styled with Tailwind v4 and semantic tokens.
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
## Install
|
|
14
10
|
|
|
15
11
|
```bash
|
|
16
|
-
pnpm add
|
|
12
|
+
pnpm add @fldr/ui @phosphor-icons/react
|
|
17
13
|
```
|
|
18
14
|
|
|
19
|
-
|
|
15
|
+
React 18 or 19 is required. Optional peers, only if you use their entry points: `@tanstack/react-query` (`@fldr/ui/query`), `@tanstack/react-router` (`@fldr/ui/router`), `zod` (schema validation in forms).
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
npx @fldr/ui ls # List all components
|
|
25
|
-
npx @fldr/ui doc Button # Get component documentation
|
|
26
|
-
npx @fldr/ui docs # Get all component docs
|
|
27
|
-
```
|
|
17
|
+
## Set up
|
|
28
18
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
## Usage
|
|
32
|
-
|
|
33
|
-
### Import Components
|
|
19
|
+
Load the styles once, then pick a theme and mode on any ancestor (usually `<html>` or `<body>`):
|
|
34
20
|
|
|
35
21
|
```tsx
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// Granular imports (recommended for tree-shaking)
|
|
40
|
-
import { Button } from "@fldr/ui/components/button";
|
|
22
|
+
import "@fldr/ui/styles/standalone"; // precompiled CSS, no Tailwind needed
|
|
23
|
+
// or, if your app runs Tailwind v4: @import "@fldr/ui/styles"; in your CSS
|
|
41
24
|
```
|
|
42
25
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
In your main CSS file (e.g. `app.css`):
|
|
50
|
-
|
|
51
|
-
```css
|
|
52
|
-
@source "../node_modules/@fldr/ui/dist/**/*.{js,jsx,ts,tsx}";
|
|
53
|
-
@import "@fldr/ui/styles/tailwind";
|
|
54
|
-
@import "tailwindcss";
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
> **Import order matters** — `@fldr/ui/styles` must come **before** `@import "tailwindcss"` so Kumo's `@theme` tokens are registered first.
|
|
58
|
-
|
|
59
|
-
> **Note:** The `@source` path is relative to your CSS file. Adjust it based on your project structure — e.g. if your CSS is in `src/styles/`, you may need `../../node_modules/@fldr/ui/dist/**/*.{js,jsx,ts,tsx}`.
|
|
60
|
-
|
|
61
|
-
Alternatively, you can use the default style export (`@fldr/ui/styles`) which is equivalent to `styles/tailwind`.
|
|
62
|
-
|
|
63
|
-
If you are **not** using Tailwind CSS, use the standalone build instead (see below) — no `@source` directive is needed.
|
|
64
|
-
|
|
65
|
-
#### For Non-Tailwind Users (Standalone)
|
|
66
|
-
|
|
67
|
-
```js
|
|
68
|
-
import "@fldr/ui/styles/standalone";
|
|
26
|
+
```html
|
|
27
|
+
<body data-theme="fldr" data-mode="light">
|
|
28
|
+
<!-- data-mode="dark" for dark mode; omit it to follow the system -->
|
|
29
|
+
<div id="root" class="isolate"></div>
|
|
30
|
+
</body>
|
|
69
31
|
```
|
|
70
32
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
**What's included in standalone:**
|
|
33
|
+
Popups portal to `<body>`, so put `data-theme`/`data-mode` there, and give your app root `isolation: isolate`.
|
|
74
34
|
|
|
75
|
-
|
|
76
|
-
- Kumo component styles
|
|
77
|
-
- Dark mode support (via `data-mode="dark"` attribute)
|
|
78
|
-
- All animations and keyframes
|
|
79
|
-
- Responsive utilities
|
|
35
|
+
## What's in the box
|
|
80
36
|
|
|
81
|
-
|
|
37
|
+
| Import | What you get |
|
|
38
|
+
|---|---|
|
|
39
|
+
| `@fldr/ui` | Components: Button, Input, Select, Combobox, Checkbox, Switch, Tabs, LayerDialog, DropdownMenu, Popover, Tooltip, Toast, Table, Sidebar, DatePicker, CommandPalette and more |
|
|
40
|
+
| `@fldr/ui/blocks` | Pages and sections: `LoginPage`, `DashboardPage`, `ErrorPage`, `AppShell`, `FileTable`, `FolderGrid`, `UploadDropzone`, `ShareDialog`, `ActivityFeed`, `StatGrid`, `SettingsSection`, `AuthCard`, `OnboardingChecklist` |
|
|
41
|
+
| `@fldr/ui/table` | `DataTable` on TanStack Table + Virtual: sorting, selection with a bulk bar, column visibility, search, paging or virtual scrolling |
|
|
42
|
+
| `@fldr/ui/form` | `useAppForm` on TanStack Form, with fields pre-wired to fldr inputs and Standard Schema (zod) validation |
|
|
43
|
+
| `@fldr/ui/query` | `QueryState` (skeleton / error + retry / empty / data), `useToastMutation`, `createFldrQueryClient` for TanStack Query |
|
|
44
|
+
| `@fldr/ui/router` | Typed TanStack Router links styled as fldr links, buttons, sidebar items and breadcrumbs |
|
|
45
|
+
| `@fldr/ui/hotkeys` | TanStack Hotkeys plus `Kbd`, `useShortcut`, ⌘K for the command palette, and a `?` shortcuts dialog |
|
|
46
|
+
| `@fldr/ui/brands` | Official full-colour company logos from [svgl](https://svgl.app) (Google, Apple, Microsoft, GitHub, Slack…). Apple, GitHub and X follow dark mode. Phosphor's redrawn `*LogoIcon` marks are banned by lint |
|
|
47
|
+
| `@fldr/ui/skeleton` | [skullet](https://skullet.lochie.me) skeletons that measure your real component, themed to fldr |
|
|
48
|
+
| `@fldr/ui/code` | `CodeHighlighted` and `highlightCode` on TanStack Highlight, server or client |
|
|
49
|
+
| `@fldr/ui/theming` | `defineTheme`, `extendTheme`, `generateThemeCSS` and the built-in fldr themes |
|
|
50
|
+
| `@fldr/ui/panda` | A PandaCSS preset mapping fldr tokens to Panda semantic tokens |
|
|
82
51
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
Kumo bundles [Base UI](https://base-ui.com) and re-exports all primitives for advanced use cases:
|
|
52
|
+
## Examples
|
|
86
53
|
|
|
87
54
|
```tsx
|
|
88
|
-
|
|
89
|
-
import {
|
|
90
|
-
|
|
91
|
-
// Granular imports - tree-shakeable, smaller bundles (recommended)
|
|
92
|
-
import { Popover } from "@fldr/ui/primitives/popover";
|
|
93
|
-
import { Slider } from "@fldr/ui/primitives/slider";
|
|
94
|
-
import { Accordion } from "@fldr/ui/primitives/accordion";
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
> **Note:** Prefer styled Kumo components when available. Primitives are for custom components not yet in Kumo or cases requiring fine-grained control.
|
|
98
|
-
>
|
|
99
|
-
> **Performance tip:** Use granular imports (`@fldr/ui/primitives/{name}`) for better tree-shaking and smaller bundle sizes.
|
|
100
|
-
|
|
101
|
-
#### Updating Primitives
|
|
102
|
-
|
|
103
|
-
Primitive exports are automatically generated from Base UI. After upgrading `@base-ui/react`:
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
# Regenerate primitive files to sync with new Base UI version
|
|
107
|
-
pnpm build:primitives
|
|
108
|
-
|
|
109
|
-
# Review changes (new/removed primitives)
|
|
110
|
-
git diff src/primitives/
|
|
111
|
-
|
|
112
|
-
# Commit if primitives changed
|
|
113
|
-
git add src/primitives/ package.json
|
|
114
|
-
git commit -m "chore: update primitives for base-ui@x.x.x"
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
The `build:primitives` script:
|
|
118
|
-
|
|
119
|
-
- Generates individual primitive files in `src/primitives/*.ts`
|
|
120
|
-
- Updates barrel export in `src/primitives/index.ts`
|
|
121
|
-
- Updates `package.json` with granular export paths
|
|
122
|
-
- Runs automatically before every build via the `prebuild` script
|
|
123
|
-
|
|
124
|
-
#### Validating Build Output
|
|
125
|
-
|
|
126
|
-
After building, validate the primitives output:
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
# Run post-build validation (checks dist/ structure)
|
|
130
|
-
pnpm validate:build
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
This validates:
|
|
134
|
-
|
|
135
|
-
- All primitive JS files exist in `dist/primitives/`
|
|
136
|
-
- All type definitions exist in `dist/src/primitives/`
|
|
137
|
-
- Base UI is bundled (not externalized)
|
|
138
|
-
- Import paths reference bundled modules
|
|
139
|
-
- Source maps are present
|
|
140
|
-
|
|
141
|
-
## Development
|
|
142
|
-
|
|
143
|
-
**For comprehensive contributor documentation, see [AGENTS.md](../../AGENTS.md).**
|
|
144
|
-
|
|
145
|
-
### Creating New Components
|
|
146
|
-
|
|
147
|
-
Use the scaffolding tool to quickly create new components with all required files and configurations:
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
# Create a new component
|
|
151
|
-
pnpm new-component
|
|
152
|
-
|
|
153
|
-
# Or use the shorthand
|
|
154
|
-
pnpm new
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
**What it creates:**
|
|
158
|
-
|
|
159
|
-
- Component file: `src/components/{name}/{name}.tsx`
|
|
160
|
-
- Index file: `src/components/{name}/index.ts`
|
|
161
|
-
- Test file: `src/components/{name}/{name}.test.tsx`
|
|
162
|
-
|
|
163
|
-
**What it updates:**
|
|
164
|
-
|
|
165
|
-
- `src/index.ts` - Adds component export
|
|
166
|
-
- `vite.config.ts` - Adds build entry
|
|
167
|
-
- `package.json` - Adds export configuration
|
|
168
|
-
|
|
169
|
-
**Example:**
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
? Component name: Alert Banner
|
|
173
|
-
|
|
174
|
-
✅ Component scaffolded successfully!
|
|
175
|
-
|
|
176
|
-
📁 Files created:
|
|
177
|
-
- src/components/alert-banner/alert-banner.tsx
|
|
178
|
-
- src/components/alert-banner/index.ts
|
|
179
|
-
- src/components/alert-banner/alert-banner.test.tsx
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
The scaffolding tool handles naming automatically - input any format (spaces, PascalCase, kebab-case) and it will convert appropriately.
|
|
183
|
-
|
|
184
|
-
### Creating New Blocks
|
|
185
|
-
|
|
186
|
-
Blocks are higher-level components that compose multiple base components to create common page patterns. Use the block scaffolding tool:
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
# Create a new block
|
|
190
|
-
pnpm new-block
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
**What it creates:**
|
|
194
|
-
|
|
195
|
-
- Block file: `src/blocks/{name}/{name}.tsx`
|
|
196
|
-
- Index file: `src/blocks/{name}/index.ts`
|
|
197
|
-
- Test file: `src/blocks/{name}/{name}.test.tsx`
|
|
198
|
-
|
|
199
|
-
**What it updates:**
|
|
200
|
-
|
|
201
|
-
- `src/index.ts` - Adds block export
|
|
202
|
-
- `vite.config.ts` - Adds build entry
|
|
203
|
-
- `package.json` - Adds export configuration
|
|
204
|
-
|
|
205
|
-
Blocks are higher-level components that compose multiple base components. See [AGENTS.md](../../AGENTS.md) for detailed documentation on blocks.
|
|
206
|
-
|
|
207
|
-
### Development Workflows
|
|
208
|
-
|
|
209
|
-
#### Watch Build Mode
|
|
210
|
-
|
|
211
|
-
To test components in the actual documentation site or consuming application:
|
|
212
|
-
|
|
213
|
-
**Start watch build:**
|
|
214
|
-
|
|
215
|
-
```bash
|
|
216
|
-
pnpm dev
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
This runs Vite in watch mode with optimizations for fast rebuilds:
|
|
220
|
-
|
|
221
|
-
- ⚡~400ms rebuild time (10x faster than production builds)
|
|
222
|
-
- Skips minification in development
|
|
223
|
-
- Incremental TypeScript compilation
|
|
224
|
-
- Selective file watching (ignores tests)
|
|
225
|
-
- Validates components against production build output
|
|
226
|
-
|
|
227
|
-
**Using with documentation site:**
|
|
228
|
-
|
|
229
|
-
Terminal 1 (this directory):
|
|
55
|
+
import { Button, LayerDialog } from "@fldr/ui";
|
|
56
|
+
import { FileTable } from "@fldr/ui/blocks";
|
|
57
|
+
import { QueryState } from "@fldr/ui/query";
|
|
230
58
|
|
|
231
|
-
|
|
232
|
-
pnpm dev
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
Terminal 2 (from workspace root or kumo-docs):
|
|
59
|
+
const files = useQuery({ queryKey: ["files", folderId], queryFn: fetchFiles });
|
|
236
60
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
61
|
+
<QueryState query={files} sample={SAMPLE_FILES}>
|
|
62
|
+
{(files) => (
|
|
63
|
+
<FileTable
|
|
64
|
+
items={files}
|
|
65
|
+
onOpen={(file) => navigate(file.id)}
|
|
66
|
+
actions={[{ label: "Delete", variant: "danger", onSelect: remove }]}
|
|
67
|
+
bulkActions={(ids) => <Button size="sm" onClick={() => share(ids)}>Share</Button>}
|
|
68
|
+
/>
|
|
69
|
+
)}
|
|
70
|
+
</QueryState>
|
|
240
71
|
```
|
|
241
72
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
2. Refresh browser to see changes in docs site
|
|
246
|
-
3. Changes are validated against the actual build output
|
|
247
|
-
|
|
248
|
-
**Build modes:**
|
|
249
|
-
|
|
250
|
-
- `pnpm dev` - Development mode (fast, optimized for iteration)
|
|
251
|
-
- `pnpm build` - Production mode (full optimization, minification, CSS processing)
|
|
252
|
-
|
|
253
|
-
### Testing
|
|
254
|
-
|
|
255
|
-
The package includes comprehensive import validation tests that ensure all components are properly exported and consumable.
|
|
256
|
-
|
|
257
|
-
**Run tests:**
|
|
258
|
-
|
|
259
|
-
```bash
|
|
260
|
-
# Watch mode
|
|
261
|
-
pnpm test
|
|
262
|
-
|
|
263
|
-
# Single run
|
|
264
|
-
pnpm test:run
|
|
265
|
-
|
|
266
|
-
# With UI
|
|
267
|
-
pnpm test:ui
|
|
268
|
-
|
|
269
|
-
# With coverage
|
|
270
|
-
pnpm test:coverage
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
**What's tested:**
|
|
274
|
-
|
|
275
|
-
- All components importable from main entry: `import { Component } from "@fldr/ui"`
|
|
276
|
-
- All components importable via deep imports: `import { Component } from "@fldr/ui/components/component-name"`
|
|
277
|
-
- All blocks importable from main entry: `import { Block } from "@fldr/ui"`
|
|
278
|
-
- All blocks importable via deep imports: `import { Block } from "@fldr/ui/blocks/block-name"`
|
|
279
|
-
- Package.json exports sync with actual components and blocks
|
|
280
|
-
- Export paths and formats are correct
|
|
281
|
-
- Build configuration consistency
|
|
282
|
-
|
|
283
|
-
**Zero maintenance:** Tests automatically discover components and blocks from the filesystem and validate against package.json. When adding new items, tests will fail with exact code snippets to fix configuration.
|
|
284
|
-
|
|
285
|
-
## Beta Releases
|
|
286
|
-
|
|
287
|
-
Beta releases allow you to test changes before publishing to production. Beta versions are automatically created for pull requests and include the commit hash for identification.
|
|
288
|
-
|
|
289
|
-
### Automated Beta Releases
|
|
290
|
-
|
|
291
|
-
Beta releases are automatically triggered for pull requests through GitHub Actions (`.github/workflows/package-preview-pr.yml`):
|
|
292
|
-
|
|
293
|
-
**Workflow Configuration:**
|
|
294
|
-
|
|
295
|
-
- **Workflow**: `package-preview-pr.yml`
|
|
296
|
-
- **Triggers**: Pull requests with changes to `packages/kumo/**` or `.changeset/**`
|
|
297
|
-
- **Dependencies**: Requires changeset to exist for `@fldr/ui`
|
|
298
|
-
|
|
299
|
-
**Process Flow:**
|
|
300
|
-
|
|
301
|
-
1. **Validate**: Ensures changeset exists for `@fldr/ui`
|
|
302
|
-
2. **Version**: Runs `pnpm run version:beta`
|
|
303
|
-
- Consumes pending changesets
|
|
304
|
-
- Appends `-beta.{commit-hash}` to version number
|
|
305
|
-
3. **Build**: Runs `pnpm --filter @fldr/ui build`
|
|
306
|
-
4. **Publish**: Publishes to npm with `beta` tag
|
|
307
|
-
5. **Notify**: Posts PR comment with installation instructions
|
|
308
|
-
|
|
309
|
-
**Secrets Required:**
|
|
310
|
-
|
|
311
|
-
- `NPM_TOKEN`: Authentication for npm registry
|
|
312
|
-
- `GITHUB_TOKEN`: For posting PR comments (built-in)
|
|
313
|
-
|
|
314
|
-
### Beta Version Format
|
|
315
|
-
|
|
316
|
-
Beta versions follow this pattern:
|
|
317
|
-
|
|
318
|
-
```
|
|
319
|
-
{base-version}-beta.{commit-hash}
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
For example: `0.1.0-beta.a1b2c3d`
|
|
323
|
-
|
|
324
|
-
### Installing Beta Versions
|
|
325
|
-
|
|
326
|
-
When a beta is published, the PR will include a comment with installation instructions:
|
|
327
|
-
|
|
328
|
-
```bash
|
|
329
|
-
# Install the specific beta version
|
|
330
|
-
npm install @fldr/ui@0.1.0-beta.a1b2c3d
|
|
331
|
-
|
|
332
|
-
# Or with pnpm
|
|
333
|
-
pnpm add @fldr/ui@0.1.0-beta.a1b2c3d
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
### Testing Beta Releases
|
|
337
|
-
|
|
338
|
-
1. **Create PR**: Submit your changes with a changeset
|
|
339
|
-
2. **Wait for Beta**: The beta job runs automatically after changeset validation passes
|
|
340
|
-
3. **Install Beta**: Use the version from the PR comment
|
|
341
|
-
4. **Test Changes**: Verify functionality in your project
|
|
342
|
-
5. **Merge**: Once tested, merge the PR for production release
|
|
343
|
-
|
|
344
|
-
### Changeset Validation
|
|
345
|
-
|
|
346
|
-
All pull requests with changes to `packages/kumo/` must include a changeset:
|
|
73
|
+
```tsx
|
|
74
|
+
import { useAppForm } from "@fldr/ui/form";
|
|
75
|
+
import { z } from "zod";
|
|
347
76
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
77
|
+
const form = useAppForm({
|
|
78
|
+
defaultValues: { name: "", email: "" },
|
|
79
|
+
validators: { onChange: z.object({ name: z.string().min(1), email: z.email() }) },
|
|
80
|
+
onSubmit: ({ value }) => invite(value),
|
|
81
|
+
});
|
|
351
82
|
```
|
|
352
83
|
|
|
353
|
-
|
|
354
|
-
- Choose the type of change: `patch`, `minor`, or `major`
|
|
355
|
-
- Write a clear description of what changed
|
|
356
|
-
|
|
357
|
-
The CI will automatically validate that a changeset exists before allowing beta publication.
|
|
358
|
-
|
|
359
|
-
## Production Releases
|
|
360
|
-
|
|
361
|
-
This package uses [Changesets](https://github.com/changesets/changesets) for version management and automated releases.
|
|
362
|
-
|
|
363
|
-
### Creating a Release
|
|
84
|
+
Every block takes data and callbacks; none of them fetch. Labels can be overridden for translation through a `labels` prop.
|
|
364
85
|
|
|
365
|
-
|
|
86
|
+
## Themes
|
|
366
87
|
|
|
367
|
-
|
|
368
|
-
# List any pending changesets
|
|
369
|
-
ls .changeset/*.md 2>/dev/null | grep -v "README\|USAGE" || echo "No pending changesets"
|
|
370
|
-
```
|
|
88
|
+
Six built-in themes ship in the stylesheet: `fldr` (Kumo blue on warm graphite) and the accents `fldr-violet`, `fldr-green`, `fldr-orange`, `fldr-rose` and `fldr-ink`. Kumo's own `kumo` and `fedramp` themes are still there.
|
|
371
89
|
|
|
372
|
-
|
|
90
|
+
Make your own with `defineTheme()` or `extendTheme()`, then generate CSS in code or with the CLI (`pnpm exec kumo theme my-theme.ts -o my-theme.css`). See [THEMING.md](./THEMING.md).
|
|
373
91
|
|
|
374
|
-
|
|
375
|
-
pnpm changeset
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
- Select `@fldr/ui` from the list
|
|
379
|
-
- Select the type of change: `patch`, `minor`, or `major`
|
|
380
|
-
- Write a clear description of what changed
|
|
381
|
-
- This creates a `.changeset/*.md` file describing the change
|
|
382
|
-
|
|
383
|
-
### Release Workflow
|
|
384
|
-
|
|
385
|
-
1. **Development**: Make changes to components or blocks
|
|
386
|
-
2. **Changeset**: Create changeset describing the changes
|
|
387
|
-
3. **Review**: Submit PR with changes and changeset
|
|
388
|
-
4. **Beta Test**: Test the beta version published to the PR
|
|
389
|
-
5. **Merge**: Merge PR to main branch
|
|
390
|
-
6. **Release**: Run the production release process
|
|
391
|
-
|
|
392
|
-
### Production Release Process
|
|
393
|
-
|
|
394
|
-
To publish a production release:
|
|
92
|
+
## Component reference
|
|
395
93
|
|
|
396
94
|
```bash
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
# 2. Version all packages (consumes changesets)
|
|
402
|
-
pnpm version
|
|
403
|
-
|
|
404
|
-
# 3. Build all packages
|
|
405
|
-
pnpm build:all
|
|
406
|
-
|
|
407
|
-
# 4. Publish to npm
|
|
408
|
-
pnpm release
|
|
95
|
+
pnpm exec kumo ls # list components and blocks
|
|
96
|
+
pnpm exec kumo doc Button # props and examples for one component
|
|
97
|
+
pnpm exec kumo add file-table # copy a block's source into your app to customise
|
|
409
98
|
```
|
|
410
99
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
- Update `package.json` with new version
|
|
414
|
-
- Generate/update `CHANGELOG.md`
|
|
415
|
-
- Remove consumed changeset files
|
|
416
|
-
- Publish to npm registry
|
|
417
|
-
- Create git tags
|
|
418
|
-
|
|
419
|
-
### Post-Release
|
|
420
|
-
|
|
421
|
-
After publishing:
|
|
422
|
-
|
|
423
|
-
1. **Commit version changes**:
|
|
424
|
-
|
|
425
|
-
```bash
|
|
426
|
-
git add .
|
|
427
|
-
git commit -m "chore: release @fldr/ui@{version}"
|
|
428
|
-
git push
|
|
429
|
-
```
|
|
430
|
-
|
|
431
|
-
2. **Push tags**:
|
|
432
|
-
|
|
433
|
-
```bash
|
|
434
|
-
git push --tags
|
|
435
|
-
```
|
|
436
|
-
|
|
437
|
-
3. **Verify publication**:
|
|
438
|
-
```bash
|
|
439
|
-
npm view @fldr/ui versions
|
|
440
|
-
```
|
|
441
|
-
|
|
442
|
-
### Semantic Versioning
|
|
443
|
-
|
|
444
|
-
Follow semantic versioning guidelines:
|
|
445
|
-
|
|
446
|
-
- **Patch** (`0.0.1`): Bug fixes, small component updates, style tweaks
|
|
447
|
-
- **Minor** (`0.1.0`): New components, new features, backwards-compatible changes
|
|
448
|
-
- **Major** (`1.0.0`): Breaking changes, removed components, API changes
|
|
449
|
-
|
|
450
|
-
### Release Notes
|
|
451
|
-
|
|
452
|
-
Changesets automatically generate:
|
|
453
|
-
|
|
454
|
-
- Updated `package.json` version
|
|
455
|
-
- `CHANGELOG.md` with release notes
|
|
456
|
-
- Git tags for each release
|
|
457
|
-
|
|
458
|
-
The changelog includes all changeset descriptions, providing clear documentation of what changed in each release.
|
|
459
|
-
|
|
460
|
-
## Troubleshooting
|
|
461
|
-
|
|
462
|
-
### Common Issues
|
|
463
|
-
|
|
464
|
-
**Changeset Validation Failed**
|
|
465
|
-
|
|
466
|
-
If the CI fails with a changeset validation error:
|
|
467
|
-
|
|
468
|
-
1. **Check if changeset exists**: Run `ls .changeset/*.md` to see pending changesets
|
|
469
|
-
2. **Create changeset**: Run `pnpm changeset` and select `@fldr/ui`
|
|
470
|
-
3. **Verify changeset targets correct package**: Open the changeset file and ensure it includes `@fldr/ui`
|
|
471
|
-
4. **Commit changeset**: Add and commit the changeset file to your branch
|
|
472
|
-
|
|
473
|
-
**Beta Publication Failed**
|
|
474
|
-
|
|
475
|
-
If the beta release job fails:
|
|
100
|
+
Kumo's documentation at [kumo-ui.com](https://kumo-ui.com) covers the shared components in depth.
|
|
476
101
|
|
|
477
|
-
|
|
478
|
-
2. **Check npm token**: Verify npm authentication is configured in CI
|
|
479
|
-
3. **Check version format**: Ensure version follows semver format
|
|
480
|
-
4. **Review CI logs**: Check GitHub Actions logs for specific error messages
|
|
102
|
+
## Versioning
|
|
481
103
|
|
|
482
|
-
|
|
104
|
+
Every push to `main` that touches the package publishes the next patch. Breaking changes are called out in the [changelog](./CHANGELOG.md).
|
|
483
105
|
|
|
484
|
-
|
|
106
|
+
## License
|
|
485
107
|
|
|
486
|
-
|
|
487
|
-
2. **Run tests**: Ensure `pnpm test:run` passes
|
|
488
|
-
3. **Check build output**: Verify `dist/` contains expected files
|
|
489
|
-
4. **Test locally**: Use `npm link` to test package locally before publishing
|
|
108
|
+
MIT. Based on Cloudflare Kumo, also MIT.
|
|
@@ -989,13 +989,13 @@
|
|
|
989
989
|
"error": "Error state for validation failures"
|
|
990
990
|
},
|
|
991
991
|
"classes": {
|
|
992
|
-
"default": "[&:focus-within>span]:ring-kumo-focus [&:hover>span]:ring-kumo-
|
|
992
|
+
"default": "[&:focus-within>span]:ring-kumo-focus [&:hover>span]:ring-kumo-interact",
|
|
993
993
|
"error": "[&>span]:ring-kumo-danger"
|
|
994
994
|
},
|
|
995
995
|
"stateClasses": {
|
|
996
996
|
"default": {
|
|
997
997
|
"focus": "[&:focus-within>span]:ring-kumo-focus",
|
|
998
|
-
"hover": "[&:hover>span]:ring-kumo-
|
|
998
|
+
"hover": "[&:hover>span]:ring-kumo-interact"
|
|
999
999
|
}
|
|
1000
1000
|
},
|
|
1001
1001
|
"default": "default"
|
|
@@ -1074,7 +1074,7 @@
|
|
|
1074
1074
|
"ring-kumo-contrast",
|
|
1075
1075
|
"ring-kumo-danger",
|
|
1076
1076
|
"ring-kumo-focus",
|
|
1077
|
-
"ring-kumo-
|
|
1077
|
+
"ring-kumo-interact",
|
|
1078
1078
|
"ring-kumo-line",
|
|
1079
1079
|
"text-kumo-danger",
|
|
1080
1080
|
"text-kumo-default",
|
|
@@ -3468,7 +3468,8 @@
|
|
|
3468
3468
|
"bg-kumo-tint",
|
|
3469
3469
|
"ring-kumo-line",
|
|
3470
3470
|
"text-kumo-danger",
|
|
3471
|
-
"text-kumo-default"
|
|
3471
|
+
"text-kumo-default",
|
|
3472
|
+
"text-kumo-subtle"
|
|
3472
3473
|
],
|
|
3473
3474
|
"subComponents": {
|
|
3474
3475
|
"Trigger": {
|
|
@@ -8515,8 +8516,7 @@
|
|
|
8515
8516
|
],
|
|
8516
8517
|
"dependencies": [
|
|
8517
8518
|
"Banner",
|
|
8518
|
-
"Button"
|
|
8519
|
-
"Input"
|
|
8519
|
+
"Button"
|
|
8520
8520
|
]
|
|
8521
8521
|
},
|
|
8522
8522
|
"DashboardPage": {
|
|
@@ -8796,6 +8796,26 @@
|
|
|
8796
8796
|
"optional": true,
|
|
8797
8797
|
"description": "Locale for size and date formatting. Defaults to the runtime locale."
|
|
8798
8798
|
},
|
|
8799
|
+
"searchable": {
|
|
8800
|
+
"type": "boolean",
|
|
8801
|
+
"optional": true,
|
|
8802
|
+
"description": "Show a search field that filters by name and owner."
|
|
8803
|
+
},
|
|
8804
|
+
"loading": {
|
|
8805
|
+
"type": "boolean",
|
|
8806
|
+
"optional": true,
|
|
8807
|
+
"description": "Shows skeleton rows instead of items."
|
|
8808
|
+
},
|
|
8809
|
+
"virtualize": {
|
|
8810
|
+
"type": "boolean",
|
|
8811
|
+
"optional": true,
|
|
8812
|
+
"description": "Render only visible rows; for folders with thousands of items."
|
|
8813
|
+
},
|
|
8814
|
+
"height": {
|
|
8815
|
+
"type": "number | string",
|
|
8816
|
+
"optional": true,
|
|
8817
|
+
"description": "Scroll container height (sticky header)."
|
|
8818
|
+
},
|
|
8799
8819
|
"className": {
|
|
8800
8820
|
"type": "string",
|
|
8801
8821
|
"optional": true
|
|
@@ -8803,19 +8823,13 @@
|
|
|
8803
8823
|
},
|
|
8804
8824
|
"examples": [],
|
|
8805
8825
|
"colors": [
|
|
8806
|
-
"bg-kumo-base",
|
|
8807
|
-
"bg-kumo-tint",
|
|
8808
|
-
"text-kumo-default",
|
|
8809
8826
|
"text-kumo-subtle"
|
|
8810
8827
|
],
|
|
8811
8828
|
"files": [
|
|
8812
8829
|
"file-table/file-table.tsx",
|
|
8813
8830
|
"file-table/file-table.test.tsx"
|
|
8814
8831
|
],
|
|
8815
|
-
"dependencies": [
|
|
8816
|
-
"Button",
|
|
8817
|
-
"Table"
|
|
8818
|
-
]
|
|
8832
|
+
"dependencies": []
|
|
8819
8833
|
},
|
|
8820
8834
|
"FolderGrid": {
|
|
8821
8835
|
"name": "FolderGrid",
|
|
@@ -9266,7 +9280,6 @@
|
|
|
9266
9280
|
"dependencies": [
|
|
9267
9281
|
"Button",
|
|
9268
9282
|
"ClipboardText",
|
|
9269
|
-
"Input",
|
|
9270
9283
|
"LayerDialog",
|
|
9271
9284
|
"Select"
|
|
9272
9285
|
]
|
package/ai/component-registry.md
CHANGED
|
@@ -1518,7 +1518,7 @@ Checkbox component
|
|
|
1518
1518
|
**State Classes:**
|
|
1519
1519
|
- `"default"`:
|
|
1520
1520
|
- `focus`: `[&:focus-within>span]:ring-kumo-focus`
|
|
1521
|
-
- `hover`: `[&:hover>span]:ring-kumo-
|
|
1521
|
+
- `hover`: `[&:hover>span]:ring-kumo-interact`
|
|
1522
1522
|
- `label`: ReactNode
|
|
1523
1523
|
Label content for the checkbox (enables built-in Field wrapper) - can be a string or any React node
|
|
1524
1524
|
- `labelTooltip`: ReactNode
|
|
@@ -1540,7 +1540,7 @@ Checkbox component
|
|
|
1540
1540
|
|
|
1541
1541
|
**Colors (kumo tokens used):**
|
|
1542
1542
|
|
|
1543
|
-
`bg-kumo-base`, `bg-kumo-contrast`, `bg-kumo-elevated`, `bg-kumo-tint`, `border-kumo-danger`, `border-kumo-hairline`, `border-kumo-interact`, `border-kumo-line`, `ring-kumo-brand`, `ring-kumo-contrast`, `ring-kumo-danger`, `ring-kumo-focus`, `ring-kumo-
|
|
1543
|
+
`bg-kumo-base`, `bg-kumo-contrast`, `bg-kumo-elevated`, `bg-kumo-tint`, `border-kumo-danger`, `border-kumo-hairline`, `border-kumo-interact`, `border-kumo-line`, `ring-kumo-brand`, `ring-kumo-contrast`, `ring-kumo-danger`, `ring-kumo-focus`, `ring-kumo-interact`, `ring-kumo-line`, `text-kumo-danger`, `text-kumo-default`, `text-kumo-inverse`, `text-kumo-subtle`
|
|
1544
1544
|
|
|
1545
1545
|
**Styling:**
|
|
1546
1546
|
|
|
@@ -4081,7 +4081,7 @@ DropdownMenu — accessible dropdown menu anchored to a trigger.
|
|
|
4081
4081
|
|
|
4082
4082
|
**Colors (kumo tokens used):**
|
|
4083
4083
|
|
|
4084
|
-
`bg-kumo-control`, `bg-kumo-danger`, `bg-kumo-hairline`, `bg-kumo-tint`, `ring-kumo-line`, `text-kumo-danger`, `text-kumo-default`
|
|
4084
|
+
`bg-kumo-control`, `bg-kumo-danger`, `bg-kumo-hairline`, `bg-kumo-tint`, `ring-kumo-line`, `text-kumo-danger`, `text-kumo-default`, `text-kumo-subtle`
|
|
4085
4085
|
|
|
4086
4086
|
**Sub-Components:**
|
|
4087
4087
|
|
package/dist/.build-complete
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1795502950437
|