@fldr/ui 0.3.7 → 0.3.9
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 -448
- package/THEMING.md +2 -6
- package/ai/component-registry.json +25 -13
- package/ai/component-registry.md +2 -2
- 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/share-dialog/share-dialog.test.tsx +9 -3
- package/dist/blocks-source/share-dialog/share-dialog.tsx +50 -35
- package/dist/blocks.d.ts +21 -4
- package/dist/blocks.js +246 -195
- 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/highlighter-kb7huz24pcziin6d.js +57 -0
- package/dist/chunks/{layer-dialog-m8qb0wzfg3k7406a.js → layer-dialog-mnaw06pxom8q771w.js} +3 -2
- package/dist/chunks/{table-ngl1b5yc8mcur662.js → table-bdye068ekayq3u1n.js} +1 -1
- package/dist/chunks/table-f8vl74hdx3bzqqbf.js +448 -0
- 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/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.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 +206 -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 +3 -4
- 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 +10 -0
- package/dist/styles/kumo-standalone.css +1 -1
- package/dist/styles/theme-fldr.css +18 -29
- package/dist/table.d.ts +245 -0
- package/dist/table.js +3 -0
- package/dist/theming.d.ts +8 -28
- package/dist/theming.js +6 -17
- package/package.json +41 -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,107 @@
|
|
|
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/skeleton` | [skullet](https://skullet.lochie.me) skeletons that measure your real component, themed to fldr |
|
|
47
|
+
| `@fldr/ui/code` | `CodeHighlighted` and `highlightCode` on TanStack Highlight, server or client |
|
|
48
|
+
| `@fldr/ui/theming` | `defineTheme`, `extendTheme`, `generateThemeCSS` and the built-in fldr themes |
|
|
49
|
+
| `@fldr/ui/panda` | A PandaCSS preset mapping fldr tokens to Panda semantic tokens |
|
|
82
50
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
Kumo bundles [Base UI](https://base-ui.com) and re-exports all primitives for advanced use cases:
|
|
51
|
+
## Examples
|
|
86
52
|
|
|
87
53
|
```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):
|
|
54
|
+
import { Button, LayerDialog } from "@fldr/ui";
|
|
55
|
+
import { FileTable } from "@fldr/ui/blocks";
|
|
56
|
+
import { QueryState } from "@fldr/ui/query";
|
|
230
57
|
|
|
231
|
-
|
|
232
|
-
pnpm dev
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
Terminal 2 (from workspace root or kumo-docs):
|
|
58
|
+
const files = useQuery({ queryKey: ["files", folderId], queryFn: fetchFiles });
|
|
236
59
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
60
|
+
<QueryState query={files} sample={SAMPLE_FILES}>
|
|
61
|
+
{(files) => (
|
|
62
|
+
<FileTable
|
|
63
|
+
items={files}
|
|
64
|
+
onOpen={(file) => navigate(file.id)}
|
|
65
|
+
actions={[{ label: "Delete", variant: "danger", onSelect: remove }]}
|
|
66
|
+
bulkActions={(ids) => <Button size="sm" onClick={() => share(ids)}>Share</Button>}
|
|
67
|
+
/>
|
|
68
|
+
)}
|
|
69
|
+
</QueryState>
|
|
240
70
|
```
|
|
241
71
|
|
|
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:
|
|
72
|
+
```tsx
|
|
73
|
+
import { useAppForm } from "@fldr/ui/form";
|
|
74
|
+
import { z } from "zod";
|
|
347
75
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
76
|
+
const form = useAppForm({
|
|
77
|
+
defaultValues: { name: "", email: "" },
|
|
78
|
+
validators: { onChange: z.object({ name: z.string().min(1), email: z.email() }) },
|
|
79
|
+
onSubmit: ({ value }) => invite(value),
|
|
80
|
+
});
|
|
351
81
|
```
|
|
352
82
|
|
|
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
|
|
83
|
+
Every block takes data and callbacks; none of them fetch. Labels can be overridden for translation through a `labels` prop.
|
|
364
84
|
|
|
365
|
-
|
|
85
|
+
## Themes
|
|
366
86
|
|
|
367
|
-
|
|
368
|
-
# List any pending changesets
|
|
369
|
-
ls .changeset/*.md 2>/dev/null | grep -v "README\|USAGE" || echo "No pending changesets"
|
|
370
|
-
```
|
|
87
|
+
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
88
|
|
|
372
|
-
|
|
89
|
+
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
90
|
|
|
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:
|
|
91
|
+
## Component reference
|
|
395
92
|
|
|
396
93
|
```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
|
|
94
|
+
pnpm exec kumo ls # list components and blocks
|
|
95
|
+
pnpm exec kumo doc Button # props and examples for one component
|
|
96
|
+
pnpm exec kumo add file-table # copy a block's source into your app to customise
|
|
409
97
|
```
|
|
410
98
|
|
|
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:
|
|
99
|
+
Kumo's documentation at [kumo-ui.com](https://kumo-ui.com) covers the shared components in depth.
|
|
476
100
|
|
|
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
|
|
101
|
+
## Versioning
|
|
481
102
|
|
|
482
|
-
|
|
103
|
+
Every push to `main` that touches the package publishes the next patch. Breaking changes are called out in the [changelog](./CHANGELOG.md).
|
|
483
104
|
|
|
484
|
-
|
|
105
|
+
## License
|
|
485
106
|
|
|
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
|
|
107
|
+
MIT. Based on Cloudflare Kumo, also MIT.
|
package/THEMING.md
CHANGED
|
@@ -75,13 +75,9 @@ export const teal = extendTheme(fldrTheme, {
|
|
|
75
75
|
|
|
76
76
|
## Density
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
fldr ships one density, `comfortable`, applied on `:root` so it needs no attribute: spacing `0.24rem` and 13.67px body text, slightly tighter than Kumo's stock `0.25rem`/14px. Every Kumo size is a multiple of `--spacing`, so controls, gaps and padding scale together.
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
<html data-theme="fldr-green" data-density="compact">
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Two densities ship in `theme-fldr.css`. `comfortable` is the default and applies without an attribute: spacing `0.24rem` and 13.67px body text, a third of the way from Kumo's stock `0.25rem`/14px toward compact. `compact` goes to `0.22rem` and 13px. Every Kumo size is a multiple of `--spacing`, so controls, gaps and padding all tighten together. Define your own with `defineDensity({ name, spacing, typography })` and `generateDensityCSS()`; pass `default: true` to also apply it on `:root`.
|
|
80
|
+
To add your own scale, define it with `defineDensity({ name, spacing, typography })`, generate it with `generateDensityCSS()`, and apply it with `data-density="<name>"` on any element. Pass `default: true` to also apply it on `:root`.
|
|
85
81
|
|
|
86
82
|
## PandaCSS
|
|
87
83
|
|
|
@@ -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",
|
|
@@ -8515,8 +8515,7 @@
|
|
|
8515
8515
|
],
|
|
8516
8516
|
"dependencies": [
|
|
8517
8517
|
"Banner",
|
|
8518
|
-
"Button"
|
|
8519
|
-
"Input"
|
|
8518
|
+
"Button"
|
|
8520
8519
|
]
|
|
8521
8520
|
},
|
|
8522
8521
|
"DashboardPage": {
|
|
@@ -8796,6 +8795,26 @@
|
|
|
8796
8795
|
"optional": true,
|
|
8797
8796
|
"description": "Locale for size and date formatting. Defaults to the runtime locale."
|
|
8798
8797
|
},
|
|
8798
|
+
"searchable": {
|
|
8799
|
+
"type": "boolean",
|
|
8800
|
+
"optional": true,
|
|
8801
|
+
"description": "Show a search field that filters by name and owner."
|
|
8802
|
+
},
|
|
8803
|
+
"loading": {
|
|
8804
|
+
"type": "boolean",
|
|
8805
|
+
"optional": true,
|
|
8806
|
+
"description": "Shows skeleton rows instead of items."
|
|
8807
|
+
},
|
|
8808
|
+
"virtualize": {
|
|
8809
|
+
"type": "boolean",
|
|
8810
|
+
"optional": true,
|
|
8811
|
+
"description": "Render only visible rows; for folders with thousands of items."
|
|
8812
|
+
},
|
|
8813
|
+
"height": {
|
|
8814
|
+
"type": "number | string",
|
|
8815
|
+
"optional": true,
|
|
8816
|
+
"description": "Scroll container height (sticky header)."
|
|
8817
|
+
},
|
|
8799
8818
|
"className": {
|
|
8800
8819
|
"type": "string",
|
|
8801
8820
|
"optional": true
|
|
@@ -8803,19 +8822,13 @@
|
|
|
8803
8822
|
},
|
|
8804
8823
|
"examples": [],
|
|
8805
8824
|
"colors": [
|
|
8806
|
-
"bg-kumo-base",
|
|
8807
|
-
"bg-kumo-tint",
|
|
8808
|
-
"text-kumo-default",
|
|
8809
8825
|
"text-kumo-subtle"
|
|
8810
8826
|
],
|
|
8811
8827
|
"files": [
|
|
8812
8828
|
"file-table/file-table.tsx",
|
|
8813
8829
|
"file-table/file-table.test.tsx"
|
|
8814
8830
|
],
|
|
8815
|
-
"dependencies": [
|
|
8816
|
-
"Button",
|
|
8817
|
-
"Table"
|
|
8818
|
-
]
|
|
8831
|
+
"dependencies": []
|
|
8819
8832
|
},
|
|
8820
8833
|
"FolderGrid": {
|
|
8821
8834
|
"name": "FolderGrid",
|
|
@@ -9266,7 +9279,6 @@
|
|
|
9266
9279
|
"dependencies": [
|
|
9267
9280
|
"Button",
|
|
9268
9281
|
"ClipboardText",
|
|
9269
|
-
"Input",
|
|
9270
9282
|
"LayerDialog",
|
|
9271
9283
|
"Select"
|
|
9272
9284
|
]
|
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
|
|
package/dist/.build-complete
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1795502513466
|