compote-ui 0.62.0 → 0.62.2
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 +6 -0
- package/dist/components/password-input/password-input.svelte +2 -0
- package/dist/components/password-input/password-input.svelte.d.ts +1 -1
- package/dist/components/password-input/types.d.ts +1 -0
- package/package.json +13 -3
- package/skills/component-usage/SKILL.md +202 -0
- package/skills/component-usage/references/buttons.md +27 -0
- package/skills/component-usage/references/component-export-map.md +54 -0
- package/skills/component-usage/references/files-and-images.md +75 -0
- package/skills/component-usage/references/forms-and-inputs.md +94 -0
- package/skills/component-usage/references/interactive-components.md +33 -0
- package/skills/component-usage/references/layout-and-display.md +82 -0
- package/skills/component-usage/references/overlays-and-floating-ui.md +80 -0
- package/skills/data-table/SKILL.md +247 -0
- package/skills/data-table/references/column-options.md +53 -0
- package/skills/data-table/references/table-state-and-reactivity.md +45 -0
- package/skills/data-table/references/virtual-table.md +44 -0
- package/skills/getting-started/SKILL.md +173 -0
- package/skills/getting-started/references/install-and-peers.md +45 -0
- package/skills/production-checklist/SKILL.md +181 -0
- package/skills/production-checklist/references/production-audit.md +40 -0
- package/skills/theming/SKILL.md +147 -0
- package/skills/theming/references/theme-tokens.md +56 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: production-checklist
|
|
3
|
+
description: >
|
|
4
|
+
Load before shipping or reviewing a compote-ui integration. Checks peer
|
|
5
|
+
dependencies, theme import, SSR/browser-only image utility boundaries,
|
|
6
|
+
accessible labels, optional data-table peers, excluded companion libraries,
|
|
7
|
+
and local verification with bun run check and bun run lint.
|
|
8
|
+
metadata:
|
|
9
|
+
type: lifecycle
|
|
10
|
+
library: compote-ui
|
|
11
|
+
library_version: '0.62.1'
|
|
12
|
+
requires:
|
|
13
|
+
- getting-started
|
|
14
|
+
- component-usage
|
|
15
|
+
- theming
|
|
16
|
+
sources:
|
|
17
|
+
- package.json
|
|
18
|
+
- CLAUDE.md
|
|
19
|
+
- .claude/skills/verify/SKILL.md
|
|
20
|
+
- src/lib/utils/image-processing.ts
|
|
21
|
+
- src/lib/components/data-table-v9/virtual/data-table-virtual-rows.svelte
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
This checklist builds on getting-started, component-usage, and theming.
|
|
25
|
+
|
|
26
|
+
# Compote UI — Production Checklist
|
|
27
|
+
|
|
28
|
+
Run through each section before shipping a compote-ui integration or library change.
|
|
29
|
+
|
|
30
|
+
## Setup Checks
|
|
31
|
+
|
|
32
|
+
### Check: Theme import order
|
|
33
|
+
|
|
34
|
+
Expected:
|
|
35
|
+
|
|
36
|
+
```css
|
|
37
|
+
@import 'tailwindcss';
|
|
38
|
+
@import 'compote-ui/theme.css';
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Fail condition: components render without Compote token utilities or CSS variables.
|
|
42
|
+
Fix: import `compote-ui/theme.css` after `tailwindcss`.
|
|
43
|
+
|
|
44
|
+
### Check: Optional peers match imports
|
|
45
|
+
|
|
46
|
+
Expected:
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import * as DataTable from 'compote-ui/data-table';
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Fail condition: app imports `compote-ui/data-table` without `@tanstack/svelte-table`.
|
|
53
|
+
Fix: install `@tanstack/svelte-table`.
|
|
54
|
+
|
|
55
|
+
Expected:
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import * as VirtualDataTable from 'compote-ui/data-table/virtual';
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Fail condition: app imports the virtual subpath without `@tanstack/svelte-virtual`.
|
|
62
|
+
Fix: install `@tanstack/svelte-virtual`.
|
|
63
|
+
|
|
64
|
+
## SSR And Browser Checks
|
|
65
|
+
|
|
66
|
+
### Check: Image utilities run in browser handlers
|
|
67
|
+
|
|
68
|
+
Expected:
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
async function handleFile(file: File) {
|
|
72
|
+
const src = await fileToDataUrl(file);
|
|
73
|
+
const blob = await processImage(src);
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Fail condition: `processImage`, `cropImage`, `fileToDataUrl`, or `loadImage` run in SvelteKit server code or a `load` function.
|
|
78
|
+
Fix: call Canvas and File APIs from browser event handlers.
|
|
79
|
+
|
|
80
|
+
## Accessibility Checks
|
|
81
|
+
|
|
82
|
+
### Check: Icon-only controls have names
|
|
83
|
+
|
|
84
|
+
Expected:
|
|
85
|
+
|
|
86
|
+
```svelte
|
|
87
|
+
<Button size="icon" aria-label="Settings">
|
|
88
|
+
<SettingsIcon class="size-4" />
|
|
89
|
+
</Button>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Fail condition: icon-only `Button`, `Toggle`, trigger, or menu control has no accessible name.
|
|
93
|
+
Fix: add `aria-label` or visible text.
|
|
94
|
+
|
|
95
|
+
## Boundary Checks
|
|
96
|
+
|
|
97
|
+
### Check: Companion libraries stay separate
|
|
98
|
+
|
|
99
|
+
Expected:
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
import { Button } from 'compote-ui';
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Fail condition: charts or TipTap editor imports are expected from `compote-ui`.
|
|
106
|
+
Fix: use `compote-echart` for charts and `compote-editor` for editor work.
|
|
107
|
+
|
|
108
|
+
## Common Mistakes
|
|
109
|
+
|
|
110
|
+
### HIGH Skipping local verification
|
|
111
|
+
|
|
112
|
+
Wrong:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
git commit -m "change component"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Correct:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
bun run check
|
|
122
|
+
bun run lint
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The repository expects Svelte type checking and linting after changes.
|
|
126
|
+
|
|
127
|
+
Source: `.claude/skills/verify/SKILL.md`, `CLAUDE.md`
|
|
128
|
+
|
|
129
|
+
### MEDIUM Assuming charts and editors are included
|
|
130
|
+
|
|
131
|
+
Wrong:
|
|
132
|
+
|
|
133
|
+
```ts
|
|
134
|
+
import { Chart, RichTextEditor } from 'compote-ui';
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Correct:
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
import { Button } from 'compote-ui';
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Charts belong to `compote-echart`; TipTap editor functionality belongs to `compote-editor`.
|
|
144
|
+
|
|
145
|
+
Source: maintainer interview
|
|
146
|
+
|
|
147
|
+
### HIGH Forgetting component-specific peers
|
|
148
|
+
|
|
149
|
+
Wrong:
|
|
150
|
+
|
|
151
|
+
```ts
|
|
152
|
+
import * as VirtualDataTable from 'compote-ui/data-table/virtual';
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Correct:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
bun add @tanstack/svelte-virtual
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
```ts
|
|
162
|
+
import * as VirtualDataTable from 'compote-ui/data-table/virtual';
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
The virtual table subpath imports the optional virtualizer peer.
|
|
166
|
+
|
|
167
|
+
Source: `package.json`, `src/lib/components/data-table-v9/virtual/data-table-virtual-rows.svelte`
|
|
168
|
+
|
|
169
|
+
## Pre-Deploy Summary
|
|
170
|
+
|
|
171
|
+
- [ ] App imports `tailwindcss` before `compote-ui/theme.css`.
|
|
172
|
+
- [ ] Data table imports have matching TanStack peers.
|
|
173
|
+
- [ ] Browser-only image utilities are not called during SSR.
|
|
174
|
+
- [ ] Icon-only controls have accessible names.
|
|
175
|
+
- [ ] Charts and editor features use their separate packages.
|
|
176
|
+
- [ ] Repository changes pass `bun run check`.
|
|
177
|
+
- [ ] Repository changes pass `bun run lint`.
|
|
178
|
+
|
|
179
|
+
## References
|
|
180
|
+
|
|
181
|
+
- [Production audit](references/production-audit.md)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Production Audit
|
|
2
|
+
|
|
3
|
+
Commands for repository changes:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
bun run check
|
|
7
|
+
bun run lint
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Theme:
|
|
11
|
+
|
|
12
|
+
```css
|
|
13
|
+
@import 'tailwindcss';
|
|
14
|
+
@import 'compote-ui/theme.css';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Data table peers:
|
|
18
|
+
|
|
19
|
+
- `compote-ui/data-table` needs `@tanstack/svelte-table`.
|
|
20
|
+
- `compote-ui/data-table/virtual` needs `@tanstack/svelte-virtual`.
|
|
21
|
+
|
|
22
|
+
Browser-only APIs:
|
|
23
|
+
|
|
24
|
+
- `loadImage`
|
|
25
|
+
- `fileToDataUrl`
|
|
26
|
+
- `cropImage`
|
|
27
|
+
- `processImage`
|
|
28
|
+
|
|
29
|
+
Do not call these in SvelteKit server modules or `load` functions.
|
|
30
|
+
|
|
31
|
+
Accessibility:
|
|
32
|
+
|
|
33
|
+
- Icon-only buttons need `aria-label`.
|
|
34
|
+
- Data tables should have `caption`.
|
|
35
|
+
- Dialogs should include `Dialog.Title`.
|
|
36
|
+
|
|
37
|
+
Package boundaries:
|
|
38
|
+
|
|
39
|
+
- Charts: `compote-echart`.
|
|
40
|
+
- TipTap editor: `compote-editor`.
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: theming
|
|
3
|
+
description: >
|
|
4
|
+
Load when configuring compote-ui/theme.css, Tailwind CSS 4 integration, CSS
|
|
5
|
+
variables, dark and light mode, class overrides, focus rings, consumer brand
|
|
6
|
+
tokens, --compote-* variables, @theme inline, or color-scheme behavior.
|
|
7
|
+
metadata:
|
|
8
|
+
type: core
|
|
9
|
+
library: compote-ui
|
|
10
|
+
library_version: '0.62.1'
|
|
11
|
+
sources:
|
|
12
|
+
- src/lib/theme.css
|
|
13
|
+
- src/routes/layout.css
|
|
14
|
+
- .prettierrc
|
|
15
|
+
- CLAUDE.md
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Compote UI — Theming
|
|
19
|
+
|
|
20
|
+
Import `tailwindcss` first, then `compote-ui/theme.css`. Override `--compote-*` variables in the consuming app.
|
|
21
|
+
|
|
22
|
+
## Setup
|
|
23
|
+
|
|
24
|
+
```css
|
|
25
|
+
@import 'tailwindcss';
|
|
26
|
+
@import 'compote-ui/theme.css';
|
|
27
|
+
|
|
28
|
+
:root {
|
|
29
|
+
--compote-primary: oklch(55% 0.2 270);
|
|
30
|
+
--compote-ring: var(--compote-primary);
|
|
31
|
+
--radius: 4px;
|
|
32
|
+
--font-sans: Inter, sans-serif;
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Core Patterns
|
|
37
|
+
|
|
38
|
+
### Override semantic tokens
|
|
39
|
+
|
|
40
|
+
```css
|
|
41
|
+
:root {
|
|
42
|
+
--compote-ink: light-dark(var(--gray-15), var(--gray-1));
|
|
43
|
+
--compote-ink-dim: light-dark(var(--gray-11), var(--gray-5));
|
|
44
|
+
--compote-surface-1: light-dark(var(--gray-3), var(--gray-13));
|
|
45
|
+
--compote-surface-document: light-dark(var(--gray-2), var(--gray-14));
|
|
46
|
+
--compote-border: var(--compote-surface-3);
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`theme.css` maps these to Tailwind utilities such as `text-ink`, `bg-surface-1`, `border-border`, and `ring-ring`.
|
|
51
|
+
|
|
52
|
+
### Force light or dark mode
|
|
53
|
+
|
|
54
|
+
```svelte
|
|
55
|
+
<svelte:head>
|
|
56
|
+
<script>
|
|
57
|
+
document.documentElement.classList.toggle('dark', true);
|
|
58
|
+
</script>
|
|
59
|
+
</svelte:head>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The theme follows system preference by default through `color-scheme: light dark`.
|
|
63
|
+
|
|
64
|
+
### Extend component classes through class props
|
|
65
|
+
|
|
66
|
+
```svelte
|
|
67
|
+
<Button class="rounded-full px-5">Save</Button>
|
|
68
|
+
<Dialog.Root contentClass="max-w-4xl">
|
|
69
|
+
<Dialog.Title>Wide dialog</Dialog.Title>
|
|
70
|
+
</Dialog.Root>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Components merge class props with defaults; use token utilities instead of hard-coded colors.
|
|
74
|
+
|
|
75
|
+
## Common Mistakes
|
|
76
|
+
|
|
77
|
+
### HIGH Adding duplicate dark media block
|
|
78
|
+
|
|
79
|
+
Wrong:
|
|
80
|
+
|
|
81
|
+
```css
|
|
82
|
+
@media (prefers-color-scheme: dark) {
|
|
83
|
+
:root {
|
|
84
|
+
--compote-surface-1: #111;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Correct:
|
|
90
|
+
|
|
91
|
+
```css
|
|
92
|
+
:root {
|
|
93
|
+
--compote-surface-1: light-dark(var(--gray-3), var(--gray-13));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.dark {
|
|
97
|
+
color-scheme: dark;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.light {
|
|
101
|
+
color-scheme: light;
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The theme uses `light-dark()` plus `color-scheme`, so duplicating dark variables fights the model.
|
|
106
|
+
|
|
107
|
+
Source: `src/lib/theme.css`, `CLAUDE.md`
|
|
108
|
+
|
|
109
|
+
### MEDIUM Styling colored text as white
|
|
110
|
+
|
|
111
|
+
Wrong:
|
|
112
|
+
|
|
113
|
+
```svelte
|
|
114
|
+
<Button class="text-white">Save</Button>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Correct:
|
|
118
|
+
|
|
119
|
+
```svelte
|
|
120
|
+
<Button class="text-ink-inverse">Save</Button>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Text on colored backgrounds should use `text-ink-inverse` so consumers can retheme it.
|
|
124
|
+
|
|
125
|
+
Source: `CLAUDE.md`, `src/lib/theme.css`
|
|
126
|
+
|
|
127
|
+
### MEDIUM Using primary for focus rings
|
|
128
|
+
|
|
129
|
+
Wrong:
|
|
130
|
+
|
|
131
|
+
```svelte
|
|
132
|
+
<input class="focus-visible:ring-primary" />
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Correct:
|
|
136
|
+
|
|
137
|
+
```svelte
|
|
138
|
+
<input class="focus-visible:ring-ring" />
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Focus rings should use `ring-ring` so `--compote-ring` can be customized independently.
|
|
142
|
+
|
|
143
|
+
Source: `CLAUDE.md`, `src/lib/theme.css`
|
|
144
|
+
|
|
145
|
+
## References
|
|
146
|
+
|
|
147
|
+
- [Theme tokens](references/theme-tokens.md)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Theme Tokens
|
|
2
|
+
|
|
3
|
+
Primary CSS variables:
|
|
4
|
+
|
|
5
|
+
```css
|
|
6
|
+
:root {
|
|
7
|
+
--radius: 6px;
|
|
8
|
+
--font-sans: 'Nunito Sans Variable', sans-serif;
|
|
9
|
+
--font-serif: Merriweather, serif;
|
|
10
|
+
--font-mono: Fira Code, monospace;
|
|
11
|
+
|
|
12
|
+
--compote-ink: light-dark(var(--gray-15), var(--gray-1));
|
|
13
|
+
--compote-ink-dim: light-dark(var(--gray-11), var(--gray-5));
|
|
14
|
+
--compote-ink-inverse: white;
|
|
15
|
+
--compote-surface-3: light-dark(var(--gray-5), var(--gray-10));
|
|
16
|
+
--compote-surface-2: light-dark(var(--gray-4), var(--gray-12));
|
|
17
|
+
--compote-surface-1: light-dark(var(--gray-3), var(--gray-13));
|
|
18
|
+
--compote-surface-document: light-dark(var(--gray-2), var(--gray-14));
|
|
19
|
+
--compote-well: light-dark(var(--gray-1), var(--gray-15));
|
|
20
|
+
|
|
21
|
+
--compote-primary: oklch(from var(--color-7) l c var(--hue-orange));
|
|
22
|
+
--compote-danger: oklch(from var(--color-7) l c var(--hue-red));
|
|
23
|
+
--compote-warning: oklch(from var(--color-7) l c var(--hue-yellow));
|
|
24
|
+
--compote-success: oklch(from var(--color-7) l c var(--hue-green));
|
|
25
|
+
--compote-info: oklch(from var(--color-7) l c var(--hue-blue));
|
|
26
|
+
|
|
27
|
+
--compote-border: var(--compote-surface-3);
|
|
28
|
+
--compote-ring: var(--compote-primary);
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Tailwind utility mapping from `@theme inline`:
|
|
33
|
+
|
|
34
|
+
- `text-ink`
|
|
35
|
+
- `text-ink-dim`
|
|
36
|
+
- `text-ink-inverse`
|
|
37
|
+
- `bg-surface-1`
|
|
38
|
+
- `bg-surface-2`
|
|
39
|
+
- `bg-surface-3`
|
|
40
|
+
- `bg-surface-document`
|
|
41
|
+
- `bg-well`
|
|
42
|
+
- `bg-primary`, `text-primary`
|
|
43
|
+
- `border-border`
|
|
44
|
+
- `ring-ring`
|
|
45
|
+
|
|
46
|
+
Dark/light control:
|
|
47
|
+
|
|
48
|
+
```css
|
|
49
|
+
.dark {
|
|
50
|
+
color-scheme: dark;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.light {
|
|
54
|
+
color-scheme: light;
|
|
55
|
+
}
|
|
56
|
+
```
|