@dryui/ui 1.1.2 → 1.1.4
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/dist/alert/alert.svelte +1 -1
- package/dist/alert/alert.svelte.d.ts +1 -1
- package/dist/alert/index.d.ts +1 -1
- package/dist/dialog/dialog-body.svelte +1 -1
- package/dist/dialog/dialog-content.svelte +3 -3
- package/dist/drawer/drawer-dialog-content.svelte +7 -3
- package/package.json +2 -2
- package/skills/dryui/SKILL.md +60 -32
- package/skills/dryui/rules/composition.md +3 -3
- package/skills/dryui/rules/compound-components.md +2 -2
- package/skills/dryui/rules/theming.md +2 -1
package/dist/alert/alert.svelte
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
export type AlertVariant = 'info' | 'success' | 'warning' | 'error';
|
|
7
7
|
|
|
8
|
-
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'title'> {
|
|
9
9
|
variant?: AlertVariant;
|
|
10
10
|
dismissible?: boolean;
|
|
11
11
|
onDismiss?: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
3
|
export type AlertVariant = 'info' | 'success' | 'warning' | 'error';
|
|
4
|
-
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'title'> {
|
|
5
5
|
variant?: AlertVariant;
|
|
6
6
|
dismissible?: boolean;
|
|
7
7
|
onDismiss?: () => void;
|
package/dist/alert/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Snippet } from 'svelte';
|
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
3
|
import Alert from './alert.svelte';
|
|
4
4
|
export type AlertVariant = 'info' | 'success' | 'warning' | 'error';
|
|
5
|
-
export interface AlertProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
export interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'title'> {
|
|
6
6
|
variant?: AlertVariant;
|
|
7
7
|
dismissible?: boolean;
|
|
8
8
|
onDismiss?: () => void;
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
background: transparent;
|
|
54
54
|
color: var(--dry-color-text-strong);
|
|
55
55
|
padding: 0;
|
|
56
|
-
margin: 0;
|
|
57
56
|
display: grid;
|
|
58
57
|
grid-template-columns: min(90vw, var(--dry-dialog-max-width, 32rem));
|
|
58
|
+
place-content: center;
|
|
59
59
|
place-items: center;
|
|
60
60
|
overflow: visible;
|
|
61
61
|
}
|
|
@@ -89,9 +89,9 @@
|
|
|
89
89
|
color: var(--dry-color-text-strong);
|
|
90
90
|
box-shadow: var(--dry-dialog-shadow, var(--dry-overlay-shadow, var(--dry-shadow-overlay)));
|
|
91
91
|
padding: 0;
|
|
92
|
-
max-
|
|
92
|
+
max-block-size: var(--dry-dialog-max-block-size, 85vh);
|
|
93
93
|
display: grid;
|
|
94
|
-
overflow: auto;
|
|
94
|
+
overflow: var(--dry-dialog-overflow, auto);
|
|
95
95
|
|
|
96
96
|
transition:
|
|
97
97
|
opacity var(--dry-duration-normal) var(--dry-ease-spring-snappy),
|
|
@@ -14,10 +14,15 @@
|
|
|
14
14
|
let dialogEl = $state<HTMLDialogElement>();
|
|
15
15
|
|
|
16
16
|
$effect(() => {
|
|
17
|
-
if (
|
|
17
|
+
if (!dialogEl) return;
|
|
18
|
+
|
|
19
|
+
// Native <dialog> applies a max-width that leaves a strip beside edge drawers.
|
|
20
|
+
dialogEl.style.setProperty('max-width', 'none');
|
|
21
|
+
|
|
22
|
+
if (ctx.open && !dialogEl.open) {
|
|
18
23
|
dialogEl.showModal();
|
|
19
24
|
}
|
|
20
|
-
if (!ctx.open && dialogEl
|
|
25
|
+
if (!ctx.open && dialogEl.open) {
|
|
21
26
|
dialogEl.close();
|
|
22
27
|
}
|
|
23
28
|
});
|
|
@@ -55,7 +60,6 @@
|
|
|
55
60
|
background: transparent;
|
|
56
61
|
color: var(--dry-color-text-strong);
|
|
57
62
|
padding: 0;
|
|
58
|
-
margin: 0;
|
|
59
63
|
box-sizing: border-box;
|
|
60
64
|
display: grid;
|
|
61
65
|
grid-template-columns: minmax(0, 1fr);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dryui/ui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"author": "Rob Balfre",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -770,7 +770,7 @@
|
|
|
770
770
|
"postpack": "bun ../../scripts/postpack-exports.ts"
|
|
771
771
|
},
|
|
772
772
|
"dependencies": {
|
|
773
|
-
"@dryui/primitives": "^1.1.
|
|
773
|
+
"@dryui/primitives": "^1.1.4"
|
|
774
774
|
},
|
|
775
775
|
"peerDependencies": {
|
|
776
776
|
"svelte": "^5.55.1"
|
package/skills/dryui/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dryui
|
|
3
|
-
description: 'Use when building UIs with DryUI (@dryui/ui) Svelte 5 components. Teaches correct patterns for compound components, theming, forms, and accessibility. Use
|
|
3
|
+
description: 'Use when building UIs with DryUI (@dryui/ui) Svelte 5 components. Teaches correct patterns for compound components, theming, forms, and accessibility. Use the CLI as the default entry point; MCP mirrors the same workflow when available.'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# DryUI
|
|
@@ -13,18 +13,18 @@ Zero-dependency Svelte 5 components. All imports from `@dryui/ui`. Requires a th
|
|
|
13
13
|
|
|
14
14
|
**Never guess a component API. Always verify first.**
|
|
15
15
|
|
|
16
|
-
- Call `info
|
|
16
|
+
- Call `dryui info <component>` or `dryui compose "<query>"` before using any component for the first time. If MCP is available, `ask --scope component` and `ask --scope recipe` are equivalent.
|
|
17
17
|
- Component APIs vary — `bind:value`, `bind:open`, `bind:checked` are NOT interchangeable
|
|
18
18
|
- Compound vs simple, required parts, available props — all differ per component
|
|
19
19
|
- If you skip the lookup, you'll write plausible-looking code that silently breaks
|
|
20
20
|
|
|
21
|
-
The test: can you point to
|
|
21
|
+
The test: can you point to a `dryui info`, `dryui compose`, or `ask` call for every component or pattern in your output?
|
|
22
22
|
|
|
23
23
|
## 2. Everything is Compound Until Proven Otherwise
|
|
24
24
|
|
|
25
25
|
**Use `.Root`. Always check.**
|
|
26
26
|
|
|
27
|
-
Most DryUI components are compound — they require `<Card.Root>`, not `<Card>`. The bare name silently fails or renders wrong. Assume compound; verify with `info`.
|
|
27
|
+
Most DryUI components are compound — they require `<Card.Root>`, not `<Card>`. The bare name silently fails or renders wrong. Assume compound; verify with `dryui info <Component>` or `ask --scope component`.
|
|
28
28
|
|
|
29
29
|
```svelte
|
|
30
30
|
<!-- Wrong -->
|
|
@@ -33,7 +33,7 @@ Most DryUI components are compound — they require `<Card.Root>`, not `<Card>`.
|
|
|
33
33
|
<Card.Root>content</Card.Root>
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
Compound components are tracked in the manifest at `packages/mcp/src/component-catalog.ts`. Verify with `info` before you assume a bare name works, then use `.Root` and wrap the parts inside it.
|
|
36
|
+
Compound components are tracked in the manifest at `packages/mcp/src/component-catalog.ts`. Verify with `dryui info <Component>` or `ask --scope component` before you assume a bare name works, then use `.Root` and wrap the parts inside it.
|
|
37
37
|
|
|
38
38
|
The test: every compound component in your markup uses `.Root`, and its parts are wrapped inside it. See `rules/compound-components.md` for the parts reference.
|
|
39
39
|
|
|
@@ -118,21 +118,19 @@ The test: search your markup for raw `<input`, `<select>`, `<dialog>`, `<button>
|
|
|
118
118
|
|
|
119
119
|
## Quick Start
|
|
120
120
|
|
|
121
|
-
**1. Install
|
|
121
|
+
**1. Install the CLI** so every subsequent command is short and fast:
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
- Codex: public install today is `$skill-installer install https://github.com/rob-balfre/dryui/tree/main/packages/ui/skills/dryui` then `codex mcp add dryui -- npx -y @dryui/mcp`. If you're working inside the DryUI repo itself, install the repo-local plugin from `/plugins` via `.agents/plugins/marketplace.json`.
|
|
127
|
-
- Copilot/Cursor/Windsurf: `npx degit rob-balfre/dryui/packages/ui/skills/dryui .agents/skills/dryui` + add MCP config (see https://dryui.dev/tools)
|
|
123
|
+
```bash
|
|
124
|
+
bun install -g @dryui/cli@latest # or: npm install -g @dryui/cli@latest
|
|
125
|
+
```
|
|
128
126
|
|
|
129
|
-
**
|
|
127
|
+
**2. Start with bare `dryui`** when you want editor integration and feedback:
|
|
130
128
|
|
|
131
129
|
```bash
|
|
132
|
-
|
|
130
|
+
dryui
|
|
133
131
|
```
|
|
134
132
|
|
|
135
|
-
**
|
|
133
|
+
**3. Bootstrap or inspect the project** with the CLI:
|
|
136
134
|
|
|
137
135
|
```bash
|
|
138
136
|
dryui init # existing project
|
|
@@ -140,26 +138,54 @@ dryui init my-app # new project — scaffolds SvelteKit + DryUI in one step
|
|
|
140
138
|
cd my-app && bun run dev
|
|
141
139
|
```
|
|
142
140
|
|
|
143
|
-
This works for greenfield (empty directory), brownfield (existing non-SvelteKit project), and existing SvelteKit projects.
|
|
141
|
+
This works for greenfield (empty directory), brownfield (existing non-SvelteKit project), and existing SvelteKit projects. On existing projects, `dryui install` prints the ordered plan and `dryui detect` verifies that setup is complete.
|
|
144
142
|
|
|
145
143
|
> **No global install?** `bunx @dryui/cli <cmd>` and `npx -y @dryui/cli <cmd>` work anywhere without installing — same commands, just slower (re-fetches on each call).
|
|
146
144
|
|
|
145
|
+
**4. Add the agent integration layer manually** if you do not want to use `dryui` / `dryui setup`:
|
|
146
|
+
|
|
147
|
+
- Claude Code: `claude plugin marketplace add rob-balfre/dryui && claude plugin install dryui@dryui` (installs skill + MCP in one step)
|
|
148
|
+
- Codex: public install today is `$skill-installer install https://github.com/rob-balfre/dryui/tree/main/packages/ui/skills/dryui` then `codex mcp add dryui -- npx -y @dryui/mcp`. If you're working inside the DryUI repo itself, install the repo-local plugin from `/plugins` via `.agents/plugins/marketplace.json`.
|
|
149
|
+
- Copilot/Cursor/Windsurf: `npx degit rob-balfre/dryui/packages/ui/skills/dryui .agents/skills/dryui` + add MCP config (see https://dryui.dev/tools)
|
|
150
|
+
|
|
147
151
|
### Manual setup
|
|
148
152
|
|
|
149
153
|
1. `bun add @dryui/ui`
|
|
150
|
-
2.
|
|
151
|
-
3.
|
|
154
|
+
2. `bun add -d @dryui/lint` — enforces grid-only layout, bans flexbox/inline-style/width at build time. Without this step the CSS discipline rules are not enforced at build time, and only post-write `check` / CLI validation remain.
|
|
155
|
+
3. Wire the lint preprocessor in `svelte.config.js` (add `dryuiLint` as the **first** item in the `preprocess` array):
|
|
156
|
+
|
|
157
|
+
```js
|
|
158
|
+
import { dryuiLint } from '@dryui/lint';
|
|
159
|
+
|
|
160
|
+
/** @type {import('@sveltejs/kit').Config} */
|
|
161
|
+
const config = {
|
|
162
|
+
preprocess: [
|
|
163
|
+
dryuiLint({
|
|
164
|
+
strict: true,
|
|
165
|
+
exclude: ['.svelte-kit/', '/dist/']
|
|
166
|
+
})
|
|
167
|
+
// keep any existing preprocessors after this
|
|
168
|
+
]
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export default config;
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
4. Add `class="theme-auto"` to `<html>` in `src/app.html`
|
|
175
|
+
5. In root layout (`src/routes/+layout.svelte`), import themes:
|
|
152
176
|
```svelte
|
|
153
177
|
<script>
|
|
154
178
|
import '@dryui/ui/themes/default.css';
|
|
155
179
|
import '@dryui/ui/themes/dark.css';
|
|
156
180
|
</script>
|
|
157
181
|
```
|
|
158
|
-
|
|
182
|
+
6. Import `app.css` AFTER theme CSS if you have custom styles
|
|
183
|
+
|
|
184
|
+
> `dryui init` applies all six steps automatically — prefer it over manual setup when you can.
|
|
159
185
|
|
|
160
186
|
## Bindable Props — Common Confusion
|
|
161
187
|
|
|
162
|
-
Always verify with `info`, but these are the most common mistakes:
|
|
188
|
+
Always verify with `dryui info <Component>` or `ask --scope component`, but these are the most common mistakes:
|
|
163
189
|
|
|
164
190
|
- `bind:value` (Input, Select, Tabs...) vs `bind:checked` (Checkbox, Switch) vs `bind:pressed` (Toggle) vs `bind:open` (Dialog, Popover, Drawer...)
|
|
165
191
|
- Select and Combobox support both `bind:value` and `bind:open`
|
|
@@ -172,25 +198,18 @@ Use these to look up APIs, discover components, plan setup, and validate code.
|
|
|
172
198
|
|
|
173
199
|
### Recommended workflow
|
|
174
200
|
|
|
175
|
-
1. `
|
|
201
|
+
1. `dryui info <Component>` or `dryui compose "<query>"` before writing so you confirm kind, required parts, bindables, and canonical usage. If MCP is available, `ask --scope component` and `ask --scope recipe` are the equivalent surface.
|
|
176
202
|
2. Build the route or component with raw CSS grid, `Container` for constrained width, and `@container` for responsive layout.
|
|
177
|
-
3. `review` or `doctor` after implementation to catch composition drift, layout violations, and accessibility regressions.
|
|
203
|
+
3. `dryui review`, `dryui diagnose`, or `dryui doctor` after implementation to catch composition drift, layout violations, and accessibility regressions. If MCP is available, `check` is the equivalent surface.
|
|
178
204
|
4. Never guess component shape from memory. DryUI is intentionally strict, and the lookup cost is lower than rework.
|
|
179
205
|
|
|
180
|
-
###
|
|
206
|
+
### CLI (default entry point)
|
|
181
207
|
|
|
182
|
-
|
|
183
|
-
| -------------------- | -------------------------------------------- |
|
|
184
|
-
| Project setup | `detect_project`, `plan_install`, `plan_add` |
|
|
185
|
-
| Lookup & composition | `info`, `get`, `list`, `compose` |
|
|
186
|
-
| Validation | `review`, `diagnose` |
|
|
187
|
-
| Audit | `doctor`, `lint` |
|
|
188
|
-
|
|
189
|
-
### CLI fallback
|
|
190
|
-
|
|
191
|
-
Install once with `bun install -g @dryui/cli` (or `npm install -g @dryui/cli`), then use the short form below. Every command outputs TOON (token-optimized, agent-friendly) by default. Pass `--text` for human-readable plain text, `--json` where supported, or `--full` to disable truncation.
|
|
208
|
+
Install once with `bun install -g @dryui/cli@latest` (or `npm install -g @dryui/cli@latest`), then use the short form below. Every command outputs TOON (token-optimized, agent-friendly) by default. Pass `--text` for human-readable plain text, `--json` where supported, or `--full` to disable truncation.
|
|
192
209
|
|
|
193
210
|
```bash
|
|
211
|
+
dryui # default onboarding entry point
|
|
212
|
+
dryui setup # explicit onboarding subcommand
|
|
194
213
|
dryui init [path] [--pm bun] # Bootstrap SvelteKit + DryUI project
|
|
195
214
|
dryui info <component> # Look up component API
|
|
196
215
|
dryui compose "date input" # Composition guidance
|
|
@@ -205,6 +224,15 @@ dryui list # List components
|
|
|
205
224
|
|
|
206
225
|
Without a global install, prefix any command with `bunx @dryui/cli …` or `npx -y @dryui/cli …` — same behaviour, just slower (re-fetches on each call).
|
|
207
226
|
|
|
227
|
+
### MCP tools (same workflow in-editor)
|
|
228
|
+
|
|
229
|
+
| Workflow | Tools |
|
|
230
|
+
| -------------------- | ----------------------------------------------------------------- |
|
|
231
|
+
| Project setup | `ask --scope setup ""` |
|
|
232
|
+
| Lookup & composition | `ask --scope component`, `ask --scope recipe`, `ask --scope list` |
|
|
233
|
+
| Validation | `check <file.svelte>`, `check <theme.css>` |
|
|
234
|
+
| Audit | `check`, `check <directory>` |
|
|
235
|
+
|
|
208
236
|
Categories: action, input, form, layout, navigation, overlay, display, feedback, interaction, utility
|
|
209
237
|
|
|
210
238
|
## Rule Files
|
|
@@ -398,7 +398,7 @@ Use Field.Error to show validation messages.
|
|
|
398
398
|
|
|
399
399
|
## Component Selection Quick Reference
|
|
400
400
|
|
|
401
|
-
Before using any component, call `compose` to get the correct component and usage snippet. This table is a quick reference —
|
|
401
|
+
Before using any component, call `dryui compose "<query>"` or `dryui info <Component>` to get the correct component and usage snippet. If MCP is available, `ask --scope recipe` and `ask --scope component` are equivalent. This table is a quick reference — the CLI and MCP surfaces both return the fuller snippets and anti-patterns.
|
|
402
402
|
|
|
403
403
|
| UI Need | Use This | NOT This |
|
|
404
404
|
| ----------------- | -------------------------------------- | ---------------------------- |
|
|
@@ -431,7 +431,7 @@ Before using any component, call `compose` to get the correct component and usag
|
|
|
431
431
|
|
|
432
432
|
## Composition Recipes
|
|
433
433
|
|
|
434
|
-
Call `compose` with any recipe name to get a full working snippet.
|
|
434
|
+
Call `dryui compose "<recipe>"` with any recipe name to get a full working snippet. If MCP is available, `ask --scope recipe "<recipe>"` is equivalent.
|
|
435
435
|
|
|
436
436
|
| Recipe | Description | Key Components |
|
|
437
437
|
| ------------------------- | ------------------------- | -------------------------------------- |
|
|
@@ -457,7 +457,7 @@ DryUI is a presentation and accessibility system, not a workflow engine. For dep
|
|
|
457
457
|
- Normalize route/session state in script before rendering DryUI inputs.
|
|
458
458
|
- Reset dependent `Select.Root` values when their parent choice changes; do not rely on stale child state surviving domain changes.
|
|
459
459
|
- Use raw CSS grid to lay out planner sections, and keep orchestration logic in route-level stores or derived state.
|
|
460
|
-
- Run `
|
|
460
|
+
- Run `dryui info <Component>` or `dryui compose "<pattern>"` before introducing a new field shape, then run `dryui review` or `dryui doctor` after the flow is wired. If MCP is available, `ask` / `check` are equivalent.
|
|
461
461
|
|
|
462
462
|
```svelte
|
|
463
463
|
<script lang="ts">
|
|
@@ -18,7 +18,7 @@ Every compound component uses `.Root` as the container. Never use the bare name.
|
|
|
18
18
|
|
|
19
19
|
## Parts Reference
|
|
20
20
|
|
|
21
|
-
Below are the parts for the most commonly used compound components.
|
|
21
|
+
Below are the parts for the most commonly used compound components. Prefer `dryui info <name>` for the full, up-to-date parts list; if MCP is available, `ask --scope component "<name>"` is equivalent.
|
|
22
22
|
|
|
23
23
|
### Card
|
|
24
24
|
|
|
@@ -311,6 +311,6 @@ Parts: Root, Input, Content, Item, Empty
|
|
|
311
311
|
|
|
312
312
|
## Full Compound Component List
|
|
313
313
|
|
|
314
|
-
Run `dryui info <name>` for any component's complete parts list:
|
|
314
|
+
Run `dryui info <name>` for any component's complete parts list. If MCP is available, `ask --scope component "<name>"` is equivalent:
|
|
315
315
|
|
|
316
316
|
Accordion, AlertDialog, Breadcrumb, Card, Collapsible, ColorPicker, Combobox, CommandPalette, ContextMenu, DataGrid, DatePicker, Dialog, DragAndDrop, Drawer, DropdownMenu, EmptyState, Field, FileUpload, FloatButton, Pagination, Popover, RadioGroup, RichTextEditor, Select, Splitter, Stepper, Table, Tabs, TagsInput, Toast, ToggleGroup, Toolbar, Tooltip, Tour, Transfer
|
|
@@ -268,10 +268,11 @@ Ensure sufficient contrast between text and background.
|
|
|
268
268
|
|
|
269
269
|
## Validating Theme CSS
|
|
270
270
|
|
|
271
|
-
Run
|
|
271
|
+
Run `dryui diagnose <theme.css>` to catch theme issues. If MCP is available, `check <theme.css>` is equivalent:
|
|
272
272
|
|
|
273
273
|
```bash
|
|
274
274
|
dryui diagnose src/styles/global.css
|
|
275
|
+
check src/styles/global.css
|
|
275
276
|
```
|
|
276
277
|
|
|
277
278
|
Common diagnostic codes:
|