@ryanhelsing/ry-ui 1.0.9 → 1.0.11

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.
@@ -0,0 +1,56 @@
1
+ /**
2
+ * ry-ui Antigravity Theme
3
+ *
4
+ * Rework of Google Antigravity's visual language.
5
+ * Clean, corporate, with large radii and subtle borders.
6
+ * Dark values auto-generated by darkify, then hand-tuned.
7
+ */
8
+
9
+ [data-ry-theme="antigravity"] {
10
+ /* Typography */
11
+ --ry-font-sans: "Google Sans Flex", system-ui, -apple-system, sans-serif;
12
+
13
+ /* Primary — dark charcoal light, light grey dark */
14
+ --ry-color-primary: light-dark(#121317, #e8e8ec);
15
+ --ry-color-primary-hover: light-dark(#2F3034, #d0d0d6);
16
+ --ry-color-primary-active: light-dark(#45474D, #b8b8c0);
17
+
18
+ /* Secondary — subtle grey tonal */
19
+ --ry-color-secondary: light-dark(rgba(183, 191, 217, 0.1), rgba(120, 128, 160, 0.15));
20
+ --ry-color-secondary-hover: light-dark(#F0F1F5, #2a2a32);
21
+ --ry-color-secondary-active: light-dark(#E6EAF0, #333340);
22
+
23
+ /* Text */
24
+ --ry-color-text: light-dark(#121317, #e0e1e6);
25
+ --ry-color-text-muted: light-dark(#45474D, #9a9ca3);
26
+ --ry-color-text-inverse: light-dark(#FFFFFF, #121317);
27
+
28
+ /* Background */
29
+ --ry-color-bg: light-dark(#FFFFFF, #121317);
30
+ --ry-color-bg-subtle: light-dark(#F8F9FC, #1a1a22);
31
+ --ry-color-bg-muted: light-dark(#EFF2F7, #222230);
32
+
33
+ /* Border — very subtle */
34
+ --ry-color-border: light-dark(rgba(33, 34, 38, 0.06), rgba(220, 222, 228, 0.08));
35
+ --ry-color-border-strong: light-dark(rgba(33, 34, 38, 0.12), rgba(220, 222, 228, 0.15));
36
+
37
+ /* Overlay */
38
+ --ry-color-overlay: light-dark(rgba(255, 255, 255, 0.95), rgba(18, 19, 23, 0.95));
39
+ --ry-color-hover-overlay: light-dark(rgba(33, 34, 38, 0.04), rgba(220, 222, 228, 0.06));
40
+
41
+ /* Radius — Antigravity uses large, pill-like radii */
42
+ --ry-radius-sm: 0.5rem;
43
+ --ry-radius-md: 1rem;
44
+ --ry-radius-lg: 1.5rem;
45
+ --ry-radius-xl: 2rem;
46
+ --ry-radius-2xl: 2rem;
47
+
48
+ /* Shadows — minimal */
49
+ --ry-shadow-sm: none;
50
+ --ry-shadow-md: none;
51
+ --ry-shadow-lg: none;
52
+ --ry-shadow-xl: none;
53
+
54
+ /* Focus */
55
+ --ry-focus-ring: light-dark(0 0 0 3px rgba(18, 19, 23, 0.2), 0 0 0 3px rgba(200, 200, 210, 0.3));
56
+ }
@@ -57,8 +57,14 @@ select.value = 'uk';
57
57
  | `checked` | boolean | Initially on |
58
58
  | `disabled` | boolean | Disable |
59
59
 
60
- Events: `ry:change` — `e.detail.checked`, `e.detail.name`
61
- API: `.checked`
60
+ Events: `ry:change` — detail shape:
61
+
62
+ | Property | Type | Example | Description |
63
+ |----------|--------|-----------|-------------|
64
+ | `value` | string | `"true"` | `"true"` or `"false"` (string, not boolean — `"false"` is truthy in JS!) |
65
+ | `label` | string | `"on"` | `"on"` or `"off"` |
66
+
67
+ API: `.checked` (boolean)
62
68
 
63
69
  ```html
64
70
  <ry-switch name="notifications" checked>Email notifications</ry-switch>
@@ -68,7 +74,8 @@ JS:
68
74
  ```js
69
75
  const sw = document.querySelector('ry-switch');
70
76
  sw.addEventListener('ry:change', (e) => {
71
- console.log(e.detail.checked); // true or false
77
+ const isOn = e.detail.value === 'true'; // compare string, not boolean
78
+ console.log(isOn, e.detail.label); // true, "on"
72
79
  });
73
80
  sw.checked = false;
74
81
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryanhelsing/ry-ui",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "Framework-agnostic, Light DOM web components. CSS is the source of truth.",
5
5
  "type": "module",
6
6
  "main": "./dist/ry-ui.js",
@@ -16,18 +16,21 @@
16
16
  },
17
17
  "files": [
18
18
  "dist",
19
- "AGENT.md",
20
- "AGENTS.md",
21
19
  "docs/components",
22
- "docs/theming.md"
20
+ "docs/theming.md",
21
+ ".claude/skills/ry-ui-builder"
23
22
  ],
24
23
  "scripts": {
25
24
  "dev": "vite",
26
- "build": "vite build && npm run build:types && npm run build:css",
25
+ "build": "npm run build:lib && npm run build:site",
26
+ "build:lib": "vite build --mode lib && npm run build:types && npm run build:css",
27
+ "build:site": "vite build",
27
28
  "build:types": "tsc --emitDeclarationOnly",
28
29
  "build:css": "mkdir -p dist/css && node -e \"const fs=require('fs'); const files=['src/css/ry-tokens.css','src/css/ry-structure.css','src/css/ry-theme.css']; const out=files.map(f=>fs.readFileSync(f,'utf8')).join('\\n'); fs.writeFileSync('dist/css/ry-ui.css',out);\" && cp src/css/ry-tokens.css src/css/ry-structure.css src/css/ry-theme.css dist/css/ && mkdir -p dist/themes && cp src/themes/*.css dist/themes/",
29
30
  "preview": "vite preview",
30
31
  "typecheck": "tsc --noEmit",
32
+ "prepack": "cp README.md README.dev.md && cp CDN_README.md README.md",
33
+ "postpack": "mv README.dev.md README.md",
31
34
  "release": "npm run build && git add -A && git diff-index --quiet HEAD || git commit -m 'new build' && npm version patch && npm publish --access public"
32
35
  },
33
36
  "devDependencies": {
@@ -42,5 +45,8 @@
42
45
  "components",
43
46
  "light-dom"
44
47
  ],
45
- "license": "MIT"
48
+ "license": "MIT",
49
+ "dependencies": {
50
+ "navigo": "^8.11.1"
51
+ }
46
52
  }
package/AGENT.md DELETED
@@ -1,490 +0,0 @@
1
- # ry-ui — Agent Reference
2
-
3
- > Framework-agnostic Light DOM web components. CSS is the source of truth.
4
- > This file is for AI agents building apps with ry-ui.
5
-
6
- ## Quick Start
7
-
8
- ```html
9
- <!-- CDN (full bundle) -->
10
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ryanhelsing/ry-ui/dist/css/ry-ui.css">
11
- <script type="module" src="https://cdn.jsdelivr.net/npm/@ryanhelsing/ry-ui/dist/ry-ui.js"></script>
12
-
13
- <!-- Or individual layers (for custom themes) -->
14
- <link rel="stylesheet" href="ry-tokens.css">
15
- <link rel="stylesheet" href="ry-structure.css">
16
- <link rel="stylesheet" href="your-theme.css">
17
- ```
18
-
19
- ## Clean Syntax
20
-
21
- Wrap markup in `<ry>` to use unprefixed tags:
22
-
23
- ```html
24
- <ry>
25
- <accordion>
26
- <accordion-item title="FAQ" open>No ry- prefix needed.</accordion-item>
27
- </accordion>
28
- </ry>
29
- ```
30
-
31
- ---
32
-
33
- ## Component Catalog
34
-
35
- ### Layout (CSS-only, no JS)
36
-
37
- | Component | Attributes | Description |
38
- |-----------|-----------|-------------|
39
- | `<ry-page>` | — | Root page container, flex column, min-height 100dvh, container queries |
40
- | `<ry-header>` | `sticky` | Flex row, space-between. `sticky` pins to top |
41
- | `<ry-main>` | — | Content area, max-width 1200px, centered |
42
- | `<ry-footer>` | — | Footer with border-top |
43
- | `<ry-section>` | — | Block section with bottom margin, container queries |
44
- | `<ry-grid>` | `cols="1-6\|auto-fit\|auto-fill"`, `cols-sm="1-3"`, `cols-md="1-4"`, `cols-lg="2-6"` | CSS grid. See [Grid](#grid) |
45
- | `<ry-stack>` | `gap="sm\|md\|lg\|xl"` | Vertical flex column |
46
- | `<ry-cluster>` | `gap="sm\|md\|lg"` | Horizontal flex row, wraps |
47
- | `<ry-split>` | `resizable`, `persist="key"`, CSS vars: `--ry-split-width`, `--ry-split-min-width`, `--ry-split-max-width` | Two-column: flex-1 left + fixed right. Stacks on mobile. Optional drag resize + localStorage persistence |
48
- | `<ry-center>` | — | Flex center (both axes) |
49
- | `<ry-nav>` | — | Horizontal nav links. Active: `a[aria-current="page"]` |
50
- | `<ry-logo>` | — | Inline-flex, bold text |
51
- | `<ry-actions>` | — | Flex row for action buttons |
52
- | `<ry-divider>` | `vertical` | Horizontal line; `vertical` for inline separator |
53
- | `<ry-aside>` | — | Sidebar content area |
54
-
55
- ### Interactive Components
56
-
57
- | Component | Key Attributes | Events |
58
- |-----------|---------------|--------|
59
- | `<ry-button>` | `variant="primary\|secondary\|outline\|ghost\|danger\|accent"`, `size="sm\|lg"`, `disabled`, `pressed`, `icon`, `modal="id"` | `ry:click` |
60
- | `<ry-button-group>` | `name`, `value` | `ry:change` `{value}` — radio-group behavior for child buttons |
61
- | `<ry-toggle-button>` | `pressed`, `name`, `value`, `size`, `icon`, `block`, `disabled` | `ry:change` `{pressed, value}` |
62
- | `<ry-modal>` | `id`, `title` | Trigger with `<ry-button modal="id">`. Centered with backdrop |
63
- | `<ry-drawer>` | `id`, `position="left\|right"`, `size` | Trigger with `<ry-button drawer="id">` |
64
- | `<ry-accordion>` | — | Container for accordion-items |
65
- | `<ry-accordion-item>` | `title`, `open` | Collapsible section |
66
- | `<ry-tabs>` | — | Container. Children: `<ry-tab title="...">content</ry-tab>` |
67
- | `<ry-dropdown>` | — | Dropdown trigger + menu |
68
- | `<ry-select>` | `placeholder`, `name`, `value`, `disabled` | `ry:change` `{value}`. Children: `<ry-option value="...">` |
69
- | `<ry-combobox>` | `placeholder`, `name`, `value`, `disabled` | `ry:change` `{value, label}`, `ry:input` `{value}`. Searchable dropdown — type to filter. Children: `<ry-option value="...">` |
70
- | `<ry-switch>` | `checked`, `disabled`, `name` | `ry:change` `{checked}` |
71
- | `<ry-tooltip>` | `content`, `position` | Hover tooltip |
72
- | `<ry-toast>` | — | Programmatic: `RyToast.success('msg')`, `.error()`, `.warning()`, `.info()` |
73
- | `<ry-slider>` | `min`, `max`, `step`, `value`, `color`, `disabled` | `ry:change` `{value}` |
74
- | `<ry-knob>` | `min`, `max`, `step`, `value`, `color`, `size`, `disabled` | `ry:change` `{value}` |
75
- | `<ry-number-select>` | `min`, `max`, `step`, `value`, `arrows`, `size`, `prefix`, `suffix`, `label` | `ry:change` `{value}` |
76
- | `<ry-color-picker>` | `value`, `format` | `ry:change` `{value}` |
77
- | `<ry-color-input>` | `value`, `format` | `ry:change` `{value}` |
78
- | `<ry-gradient-picker>` | `value` | `ry:change` `{value}` |
79
- | `<ry-tree>` | `data` (JSON) | `ry:select`, `ry:move` — file tree with drag-and-drop |
80
- | `<ry-tag>` | `removable` | `ry:remove` |
81
- | `<ry-tag-input>` | `name`, `value`, `placeholder` | `ry:change` `{tags}` |
82
- | `<ry-carousel>` | `autoplay`, `interval` | `ry:change` `{index}` |
83
- | `<ry-theme-toggle>` | `themes="light,dark"` | Cycles through themes |
84
-
85
- ### Display Components
86
-
87
- | Component | Key Attributes | Description |
88
- |-----------|---------------|-------------|
89
- | `<ry-card>` | `interactive`, `href` | Card container. All cards lift on hover. `interactive` adds click/keyboard + primary border hover. `href` navigates on click |
90
- | `<ry-badge>` | `variant="primary\|success\|warning\|danger\|accent"` | Pill badge. Arbitrary color: `style="--ry-badge-color: #8B5CF6"` |
91
- | `<ry-alert>` | `type="info\|success\|warning\|danger"` | Alert box with optional `[slot="title"]` |
92
- | `<ry-field>` | `label`, `error`, `hint` | Form field wrapper. See [Forms](#forms) |
93
- | `<ry-icon>` | `name` | SVG icon from registry |
94
- | `<ry-code>` | `language`, `title` | Syntax-highlighted code block |
95
- | `<ry-hero>` | `size="sm\|lg"`, `full-bleed`, `align="left"` | Marketing hero section. Children: h1, p, buttons |
96
- | `<ry-stat>` | `size="sm\|lg"` | Stat card with `slot="value"`, `slot="label"`, trend arrows |
97
- | `<ry-feature>` | `icon` | Feature card with icon from registry |
98
- | `<ry-feature-grid>` | `cols="2\|3\|4"` | Responsive grid for feature cards |
99
- | `<ry-pricing>` | — | Container for pricing cards (flex row, responsive) |
100
- | `<ry-pricing-card>` | `featured` | Pricing tier card. `featured` scales up with bold border |
101
-
102
- ---
103
-
104
- ## Patterns
105
-
106
- ### Grid
107
-
108
- ```html
109
- <!-- Fixed columns with auto-responsive -->
110
- <ry-grid cols="3">...</ry-grid>
111
- <!-- cols 3-6 → 2 at ≤1024px → 1 at ≤640px (automatic) -->
112
-
113
- <!-- Explicit per-breakpoint -->
114
- <ry-grid cols="5" cols-md="3" cols-sm="1">...</ry-grid>
115
-
116
- <!-- Fluid auto-fit (like repeat(auto-fit, minmax(280px, 1fr))) -->
117
- <ry-grid cols="auto-fit">...</ry-grid>
118
-
119
- <!-- Custom min-width for auto-fit -->
120
- <ry-grid cols="auto-fit" style="--ry-grid-min: 240px">...</ry-grid>
121
- ```
122
-
123
- ### Split Layout
124
-
125
- ```html
126
- <!-- Default 300px sidebar -->
127
- <ry-split>
128
- <div>Main content</div>
129
- <div>Sidebar</div>
130
- </ry-split>
131
-
132
- <!-- Custom width -->
133
- <ry-split style="--ry-split-width: 600px; --ry-split-min-width: 400px">
134
- <div>Main</div>
135
- <div>Panel</div>
136
- </ry-split>
137
-
138
- <!-- Resizable with persistence -->
139
- <ry-split resizable persist="my-panel" style="--ry-split-width: 400px">
140
- <div>Main</div>
141
- <div>Resizable panel — drag handle, keyboard arrows, double-click to reset</div>
142
- </ry-split>
143
- ```
144
-
145
- Split resize features:
146
- - **Drag handle** between panes (mouse + touch)
147
- - **Keyboard**: Arrow keys (±10px), Shift+Arrow (±50px), Home/End for min/max
148
- - **Double-click** handle to reset to default width
149
- - **`persist="key"`**: Saves width to `localStorage` as `ry-split:key`, restores on load
150
- - **`ry:resize`** event fires with `{ width }` after drag ends
151
-
152
- ### Forms
153
-
154
- ```html
155
- <ry-field label="Email" hint="We'll never share your email">
156
- <input type="email" placeholder="you@example.com">
157
- </ry-field>
158
-
159
- <ry-field label="Password" error="Must be at least 8 characters">
160
- <input type="password">
161
- </ry-field>
162
-
163
- <!-- Error hides hint automatically. Set error="" to clear and show hint again. -->
164
- ```
165
-
166
- ### Button Group (Segmented Control)
167
-
168
- ```html
169
- <!-- Radio-group behavior -->
170
- <ry-button-group name="billing" value="monthly">
171
- <ry-button value="monthly">Monthly</ry-button>
172
- <ry-button value="annually">Annually</ry-button>
173
- </ry-button-group>
174
-
175
- <!-- Mode switcher -->
176
- <ry-button-group name="mode" value="terminal">
177
- <ry-button value="direct">Direct</ry-button>
178
- <ry-button value="terminal">Terminal</ry-button>
179
- <ry-button value="release">Release</ry-button>
180
- </ry-button-group>
181
-
182
- <!-- Listen for changes -->
183
- <script>
184
- document.querySelector('ry-button-group').addEventListener('ry:change', e => {
185
- console.log(e.detail.value); // "monthly" | "annually"
186
- });
187
- </script>
188
- ```
189
-
190
- ### Button Variants
191
-
192
- ```html
193
- <ry-button>Primary (default)</ry-button>
194
- <ry-button variant="secondary">Secondary</ry-button>
195
- <ry-button variant="outline">Outline</ry-button>
196
- <ry-button variant="ghost">Ghost</ry-button>
197
- <ry-button variant="danger">Danger</ry-button>
198
- <ry-button variant="accent">Accent</ry-button>
199
- <ry-button pressed>Pressed/Active</ry-button>
200
- <ry-button size="sm">Small</ry-button>
201
- <ry-button size="lg">Large</ry-button>
202
- ```
203
-
204
- ### Interactive Card Grid
205
-
206
- ```html
207
- <!-- Clickable card grid (e.g., demo index, dashboard) -->
208
- <ry-grid cols="3">
209
- <ry-card interactive href="/demos/goap">
210
- <h3>GOAP</h3>
211
- <p>Goal-Oriented Action Planning</p>
212
- </ry-card>
213
- <ry-card interactive href="/demos/fsm">
214
- <h3>FSM</h3>
215
- <p>Finite State Machine</p>
216
- </ry-card>
217
- <ry-card interactive href="/demos/bt">
218
- <h3>Behavior Trees</h3>
219
- <p>Hierarchical task planning</p>
220
- </ry-card>
221
- </ry-grid>
222
-
223
- <!-- Listen for clicks -->
224
- <script>
225
- document.querySelectorAll('ry-card[interactive]').forEach(card => {
226
- card.addEventListener('ry:click', () => console.log('clicked', card.getAttribute('href')));
227
- });
228
- </script>
229
- ```
230
-
231
- All cards hover-lift by default. `interactive` adds: cursor pointer, stronger lift, primary border on hover, keyboard (Tab/Enter/Space), and `ry:click` event.
232
-
233
- ### Badge with Arbitrary Color
234
-
235
- ```html
236
- <ry-badge variant="success">Active</ry-badge>
237
- <ry-badge variant="accent">Pro</ry-badge>
238
- <ry-badge style="--ry-badge-color: #8B5CF6">Custom</ry-badge>
239
- <ry-badge style="--ry-badge-color: oklch(0.7 0.15 200); --ry-badge-text: #000">Custom + text</ry-badge>
240
- ```
241
-
242
- ### Check List (Pricing Features)
243
-
244
- ```html
245
- <ul class="ry-check-list">
246
- <li>Unlimited projects</li>
247
- <li>Priority support</li>
248
- <li>Custom domains</li>
249
- </ul>
250
- ```
251
-
252
- ### Nav Bar
253
-
254
- ```html
255
- <ry-header sticky>
256
- <ry-cluster>
257
- <ry-logo>MyApp</ry-logo>
258
- <ry-divider vertical></ry-divider>
259
- <ry-nav>
260
- <a href="/" aria-current="page">Home</a>
261
- <a href="/docs">Docs</a>
262
- <a href="/pricing">Pricing</a>
263
- </ry-nav>
264
- </ry-cluster>
265
- <ry-actions>
266
- <ry-button variant="ghost" size="sm">Login</ry-button>
267
- <ry-button size="sm">Sign Up</ry-button>
268
- </ry-actions>
269
- </ry-header>
270
- ```
271
-
272
- ### Pricing Page
273
-
274
- ```html
275
- <ry-pricing>
276
- <ry-pricing-card>
277
- <h3>Free</h3>
278
- <div class="ry-pricing__price">$0<span>/mo</span></div>
279
- <p>For individuals</p>
280
- <ul class="ry-check-list">
281
- <li>3 projects</li>
282
- <li>Basic support</li>
283
- </ul>
284
- <ry-button variant="outline">Get Started</ry-button>
285
- </ry-pricing-card>
286
-
287
- <ry-pricing-card featured>
288
- <h3>Pro</h3>
289
- <div class="ry-pricing__price">$19<span>/mo</span></div>
290
- <p>For teams</p>
291
- <ul class="ry-check-list">
292
- <li>Unlimited projects</li>
293
- <li>Priority support</li>
294
- </ul>
295
- <ry-button>Upgrade</ry-button>
296
- </ry-pricing-card>
297
- </ry-pricing>
298
- ```
299
-
300
- ### Hero Section
301
-
302
- ```html
303
- <ry-hero>
304
- <h1>Build faster with ry-ui</h1>
305
- <p>Framework-agnostic components for any app.</p>
306
- <ry-cluster>
307
- <ry-button size="lg">Get Started</ry-button>
308
- <ry-button variant="outline" size="lg">View Docs</ry-button>
309
- </ry-cluster>
310
- </ry-hero>
311
- ```
312
-
313
- ### Modal & Drawer
314
-
315
- ```html
316
- <!-- Modal -->
317
- <ry-button modal="confirm">Open Modal</ry-button>
318
- <ry-modal id="confirm" title="Confirm Action">
319
- <p>Are you sure?</p>
320
- <ry-cluster>
321
- <ry-button variant="danger">Delete</ry-button>
322
- <ry-button variant="ghost">Cancel</ry-button>
323
- </ry-cluster>
324
- </ry-modal>
325
-
326
- <!-- Drawer -->
327
- <ry-button drawer="settings">Settings</ry-button>
328
- <ry-drawer id="settings" position="right" size="400px">
329
- <h3>Settings</h3>
330
- <!-- content -->
331
- </ry-drawer>
332
- ```
333
-
334
- ---
335
-
336
- ## CSS Token System
337
-
338
- All visual properties use CSS custom properties. Override in your own CSS to customize.
339
-
340
- ### Colors
341
-
342
- | Token | Purpose |
343
- |-------|---------|
344
- | `--ry-color-primary` / `-hover` / `-active` | Primary action color (blue) |
345
- | `--ry-color-secondary` / `-hover` / `-active` | Secondary muted color |
346
- | `--ry-color-accent` / `-hover` / `-active` | Accent/highlight color (purple) |
347
- | `--ry-color-success` | Green for positive states |
348
- | `--ry-color-warning` | Yellow/orange for caution |
349
- | `--ry-color-danger` / `-hover` | Red for destructive actions |
350
- | `--ry-color-info` | Blue for informational |
351
- | `--ry-color-text` / `-muted` / `-inverse` | Text colors |
352
- | `--ry-color-bg` / `-subtle` / `-muted` | Background colors |
353
- | `--ry-color-border` / `-strong` | Border colors |
354
- | `--ry-color-overlay` | Modal/drawer backdrop |
355
-
356
- Each color also has `-bg` and `-text` variants for alert/badge backgrounds:
357
- `--ry-color-{info,success,warning,danger}-bg` / `--ry-color-{info,success,warning,danger}-text`
358
-
359
- ### Spacing
360
-
361
- `--ry-space-{0,1,2,3,4,5,6,8,10,12,16,20}` — 0 to 5rem
362
-
363
- ### Typography
364
-
365
- | Token | Value |
366
- |-------|-------|
367
- | `--ry-font-sans` | system-ui stack |
368
- | `--ry-font-mono` | ui-monospace stack |
369
- | `--ry-text-{xs,sm,base,lg,xl,2xl,3xl,4xl}` | 0.75rem to 2.25rem |
370
- | `--ry-font-{normal,medium,semibold,bold}` | 400 to 700 |
371
- | `--ry-leading-{tight,normal,relaxed}` | 1.25 to 1.75 |
372
-
373
- ### Borders & Shadows
374
-
375
- | Token | Value |
376
- |-------|-------|
377
- | `--ry-radius-{none,sm,md,lg,xl,2xl,full}` | 0 to 9999px |
378
- | `--ry-shadow-{sm,md,lg,xl}` | Elevation shadows |
379
- | `--ry-border-width` | 1px |
380
-
381
- ### Transitions
382
-
383
- | Token | Value |
384
- |-------|-------|
385
- | `--ry-duration-{fast,normal,slow}` | 100ms, 200ms, 300ms |
386
- | `--ry-ease` / `-in` / `-out` | Cubic bezier easing |
387
-
388
- ### Z-Index
389
-
390
- | Token | Value |
391
- |-------|-------|
392
- | `--ry-z-dropdown` | 1000 |
393
- | `--ry-z-sticky` | 1020 |
394
- | `--ry-z-fixed` | 1030 |
395
- | `--ry-z-modal-backdrop` | 1040 |
396
- | `--ry-z-modal` | 1050 |
397
- | `--ry-z-popover` | 1060 |
398
- | `--ry-z-tooltip` | 1070 |
399
- | `--ry-z-toast` | 1080 |
400
-
401
- ---
402
-
403
- ## CSS Architecture
404
-
405
- Three layers, ordered by specificity:
406
-
407
- 1. **ry-tokens** — CSS custom properties (colors, spacing, etc.)
408
- 2. **ry-structure** — Pure layout (no colors). Selectors: element names + `[data-ry-target]`
409
- 3. **ry-theme** — All visual styling. Selectors: `.ry-*` classes + element names
410
-
411
- ### Custom Theming
412
-
413
- Load structure only + your own theme:
414
-
415
- ```html
416
- <link rel="stylesheet" href="ry-tokens.css"> <!-- or your own tokens -->
417
- <link rel="stylesheet" href="ry-structure.css">
418
- <link rel="stylesheet" href="your-theme.css">
419
- ```
420
-
421
- ### Dark Mode
422
-
423
- Built into tokens via `light-dark()`. No separate dark.css needed.
424
-
425
- ```html
426
- <html data-ry-theme="dark"> <!-- force dark -->
427
- <html data-ry-theme="light"> <!-- force light -->
428
- <!-- omit attribute for OS preference -->
429
- ```
430
-
431
- ---
432
-
433
- ## Patterns NOT in ry-ui (Keep Custom)
434
-
435
- These patterns are intentionally outside the design system's scope:
436
-
437
- | Pattern | Reason | Recommended approach |
438
- |---------|--------|---------------------|
439
- | Click-positioned dialog / popover | GSAP animations, cursor anchoring | Use ry-ui tokens inside custom dialog |
440
- | File drop zone | App-specific UX | Custom component, tokenize colors |
441
- | Color swatch selector | Too specialized | Custom radio buttons with ry-ui tokens |
442
- | Terminal / xterm.js wrapper | Third-party integration | Custom container, tokenize colors |
443
- | Infinite canvas / artboard | Canvas 2D, not DOM | Use `getComputedStyle` to read ry-ui tokens for canvas rendering |
444
- | Chat / streaming replay | App-specific data format | Custom layout, use ry-ui header/badge/button inside |
445
- | Floating properties panel | Positioned at coordinates | Use `position: absolute` + ry-ui form components inside |
446
-
447
- For all of these: **use ry-ui tokens for colors, spacing, and typography** so they match the theme, but keep the structural markup custom.
448
-
449
- ---
450
-
451
- ## TypeScript
452
-
453
- ```ts
454
- import { RyElement, RyButton, RyToast } from '@ryanhelsing/ry-ui';
455
-
456
- // Programmatic toast
457
- RyToast.success('Saved!');
458
- RyToast.error('Failed to save');
459
-
460
- // Listen for component events
461
- document.querySelector('ry-select')?.addEventListener('ry:change', (e: CustomEvent) => {
462
- console.log(e.detail.value);
463
- });
464
-
465
- // Extend components
466
- class MyWidget extends RyElement {
467
- setup() {
468
- this.on(this, 'click', () => this.emit('activate'));
469
- }
470
- }
471
- ```
472
-
473
- ---
474
-
475
- ## Icon Registry
476
-
477
- ```ts
478
- import { registerIcon, registerIcons } from '@ryanhelsing/ry-ui';
479
-
480
- // Single icon
481
- registerIcon('custom', '<svg>...</svg>');
482
-
483
- // Batch
484
- registerIcons({
485
- 'app-logo': '<svg>...</svg>',
486
- 'custom-arrow': '<svg>...</svg>'
487
- });
488
- ```
489
-
490
- Built-in icons: `settings`, `heart`, `star`, `chevron-up`, `chevron-down`, `chevron-left`, `chevron-right`, `check`, `x`, `plus`, `minus`, `search`, `sun`, `moon`, `copy`, `trash`, `edit`, `eye`, `folder`, `file`, `drag`
package/AGENTS.md DELETED
@@ -1,57 +0,0 @@
1
- # AGENTS.md — ry-ui
2
-
3
- > Web components. No framework. Light DOM. CSS is the source of truth.
4
-
5
- ## Setup
6
-
7
- ```html
8
- <link rel="stylesheet" href="https://unpkg.com/@ryanhelsing/ry-ui/css/ry-ui.css">
9
- <script type="module" src="https://unpkg.com/@ryanhelsing/ry-ui"></script>
10
- ```
11
-
12
- Theme: `<html data-ry-theme="light">` — light | dark
13
-
14
- ## Concepts
15
-
16
- - **Light DOM** — no shadow DOM, your CSS just works
17
- - **Clean syntax** — `<ry><stack><card>Hi</card></stack></ry>` (drops `ry-` prefix inside `<ry>`)
18
- - **Tokens** — all visuals via `--ry-*` CSS custom properties, override to customize
19
- - **Structure vs Theme** — load `ry-structure.css` alone + your own theme for full control
20
- - **Events** — all prefixed `ry:` — `ry:change`, `ry:input`, `ry:open`, `ry:close`, `ry:toggle`, `ry:select`, `ry:move`
21
-
22
- ## Components
23
-
24
- | Category | Components |
25
- |----------|-----------|
26
- | **Layout** | page, header, main, footer, section, aside, grid, stack, cluster, split, center, card, nav, logo, actions, divider |
27
- | **Overlays** | modal, drawer, dropdown, tooltip, toast |
28
- | **Forms** | field, select, switch, button-group, toggle-button, checkbox/radio (native) |
29
- | **Values** | slider, knob, number-select, color-picker, color-input, gradient-picker |
30
- | **Display** | badge, alert, icon, code, table (native), tree |
31
- | **Utility** | theme-toggle |
32
-
33
- ## Docs
34
-
35
- Pull the page you need for full attributes, events, JS API, and examples:
36
-
37
- | Doc | What's in it |
38
- |-----|-------------|
39
- | [docs/components/layout.md](docs/components/layout.md) | page, header, main, footer, section, aside, grid, stack, cluster, split, center, card, nav, logo, actions, divider |
40
- | [docs/components/button.md](docs/components/button.md) | button, toggle-button |
41
- | [docs/components/button-group.md](docs/components/button-group.md) | button-group (segmented control) |
42
- | [docs/components/accordion.md](docs/components/accordion.md) | accordion, accordion-item |
43
- | [docs/components/tabs.md](docs/components/tabs.md) | tabs, tab |
44
- | [docs/components/modal.md](docs/components/modal.md) | modal |
45
- | [docs/components/drawer.md](docs/components/drawer.md) | drawer |
46
- | [docs/components/dropdown.md](docs/components/dropdown.md) | dropdown, menu, menu-item |
47
- | [docs/components/tooltip.md](docs/components/tooltip.md) | tooltip |
48
- | [docs/components/toast.md](docs/components/toast.md) | toast (programmatic) |
49
- | [docs/components/forms.md](docs/components/forms.md) | field, select, switch, checkbox, radio |
50
- | [docs/components/slider.md](docs/components/slider.md) | slider |
51
- | [docs/components/knob.md](docs/components/knob.md) | knob |
52
- | [docs/components/number-select.md](docs/components/number-select.md) | number-select |
53
- | [docs/components/color.md](docs/components/color.md) | color-picker, color-input, gradient-picker |
54
- | [docs/components/tree.md](docs/components/tree.md) | tree, tree-item |
55
- | [docs/components/display.md](docs/components/display.md) | badge, alert, icon, code, table |
56
- | [docs/components/theme-toggle.md](docs/components/theme-toggle.md) | theme-toggle |
57
- | [docs/theming.md](docs/theming.md) | tokens, custom themes, structure-only loading |