@ryanhelsing/ry-ui 1.0.10 → 1.0.12

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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryanhelsing/ry-ui",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
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,10 +16,6 @@
16
16
  },
17
17
  "files": [
18
18
  "dist",
19
- "AGENT.md",
20
- "AGENTS.md",
21
- "llms.txt",
22
- "examples",
23
19
  "docs/components",
24
20
  "docs/theming.md",
25
21
  ".claude/skills/ry-ui-builder"
@@ -33,6 +29,8 @@
33
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/",
34
30
  "preview": "vite preview",
35
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",
36
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"
37
35
  },
38
36
  "devDependencies": {
package/AGENT.md DELETED
@@ -1,492 +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` `{value, label}` — value is `"true"`/`"false"` (string), label is `"on"`/`"off"` |
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
- | `<ry-theme-panel>` | `theme`, `mode`, `base-path` | Floating theme/mode selector. Themes: `none`, `default`, `ocean`. Modes: `auto`, `light`, `dark`. Emits `ry:theme-panel-change` `{theme, mode}`. Persists to localStorage. |
85
- | `<ry-testimonial>` | `stars` | Customer quote card. Slots: `avatar` (img), `name`, `role`. Blockquote for quote text. Stars show star rating. |
86
-
87
- ### Display Components
88
-
89
- | Component | Key Attributes | Description |
90
- |-----------|---------------|-------------|
91
- | `<ry-card>` | `interactive`, `href` | Card container. All cards lift on hover. `interactive` adds click/keyboard + primary border hover. `href` navigates on click |
92
- | `<ry-badge>` | `variant="primary\|success\|warning\|danger\|accent"` | Pill badge. Arbitrary color: `style="--ry-badge-color: #8B5CF6"` |
93
- | `<ry-alert>` | `type="info\|success\|warning\|danger"` | Alert box with optional `[slot="title"]` |
94
- | `<ry-field>` | `label`, `error`, `hint` | Form field wrapper. See [Forms](#forms) |
95
- | `<ry-icon>` | `name` | SVG icon from registry |
96
- | `<ry-code>` | `language`, `title` | Syntax-highlighted code block |
97
- | `<ry-hero>` | `size="sm\|lg"`, `full-bleed`, `align="left"` | Marketing hero section. Children: h1, p, buttons |
98
- | `<ry-stat>` | `size="sm\|lg"` | Stat card with `slot="value"`, `slot="label"`, trend arrows |
99
- | `<ry-feature>` | `icon` | Feature card with icon from registry |
100
- | `<ry-feature-grid>` | `cols="2\|3\|4"` | Responsive grid for feature cards |
101
- | `<ry-pricing>` | — | Container for pricing cards (flex row, responsive) |
102
- | `<ry-pricing-card>` | `featured` | Pricing tier card. `featured` scales up with bold border |
103
-
104
- ---
105
-
106
- ## Patterns
107
-
108
- ### Grid
109
-
110
- ```html
111
- <!-- Fixed columns with auto-responsive -->
112
- <ry-grid cols="3">...</ry-grid>
113
- <!-- cols 3-6 → 2 at ≤1024px → 1 at ≤640px (automatic) -->
114
-
115
- <!-- Explicit per-breakpoint -->
116
- <ry-grid cols="5" cols-md="3" cols-sm="1">...</ry-grid>
117
-
118
- <!-- Fluid auto-fit (like repeat(auto-fit, minmax(280px, 1fr))) -->
119
- <ry-grid cols="auto-fit">...</ry-grid>
120
-
121
- <!-- Custom min-width for auto-fit -->
122
- <ry-grid cols="auto-fit" style="--ry-grid-min: 240px">...</ry-grid>
123
- ```
124
-
125
- ### Split Layout
126
-
127
- ```html
128
- <!-- Default 300px sidebar -->
129
- <ry-split>
130
- <div>Main content</div>
131
- <div>Sidebar</div>
132
- </ry-split>
133
-
134
- <!-- Custom width -->
135
- <ry-split style="--ry-split-width: 600px; --ry-split-min-width: 400px">
136
- <div>Main</div>
137
- <div>Panel</div>
138
- </ry-split>
139
-
140
- <!-- Resizable with persistence -->
141
- <ry-split resizable persist="my-panel" style="--ry-split-width: 400px">
142
- <div>Main</div>
143
- <div>Resizable panel — drag handle, keyboard arrows, double-click to reset</div>
144
- </ry-split>
145
- ```
146
-
147
- Split resize features:
148
- - **Drag handle** between panes (mouse + touch)
149
- - **Keyboard**: Arrow keys (±10px), Shift+Arrow (±50px), Home/End for min/max
150
- - **Double-click** handle to reset to default width
151
- - **`persist="key"`**: Saves width to `localStorage` as `ry-split:key`, restores on load
152
- - **`ry:resize`** event fires with `{ width }` after drag ends
153
-
154
- ### Forms
155
-
156
- ```html
157
- <ry-field label="Email" hint="We'll never share your email">
158
- <input type="email" placeholder="you@example.com">
159
- </ry-field>
160
-
161
- <ry-field label="Password" error="Must be at least 8 characters">
162
- <input type="password">
163
- </ry-field>
164
-
165
- <!-- Error hides hint automatically. Set error="" to clear and show hint again. -->
166
- ```
167
-
168
- ### Button Group (Segmented Control)
169
-
170
- ```html
171
- <!-- Radio-group behavior -->
172
- <ry-button-group name="billing" value="monthly">
173
- <ry-button value="monthly">Monthly</ry-button>
174
- <ry-button value="annually">Annually</ry-button>
175
- </ry-button-group>
176
-
177
- <!-- Mode switcher -->
178
- <ry-button-group name="mode" value="terminal">
179
- <ry-button value="direct">Direct</ry-button>
180
- <ry-button value="terminal">Terminal</ry-button>
181
- <ry-button value="release">Release</ry-button>
182
- </ry-button-group>
183
-
184
- <!-- Listen for changes -->
185
- <script>
186
- document.querySelector('ry-button-group').addEventListener('ry:change', e => {
187
- console.log(e.detail.value); // "monthly" | "annually"
188
- });
189
- </script>
190
- ```
191
-
192
- ### Button Variants
193
-
194
- ```html
195
- <ry-button>Primary (default)</ry-button>
196
- <ry-button variant="secondary">Secondary</ry-button>
197
- <ry-button variant="outline">Outline</ry-button>
198
- <ry-button variant="ghost">Ghost</ry-button>
199
- <ry-button variant="danger">Danger</ry-button>
200
- <ry-button variant="accent">Accent</ry-button>
201
- <ry-button pressed>Pressed/Active</ry-button>
202
- <ry-button size="sm">Small</ry-button>
203
- <ry-button size="lg">Large</ry-button>
204
- ```
205
-
206
- ### Interactive Card Grid
207
-
208
- ```html
209
- <!-- Clickable card grid (e.g., demo index, dashboard) -->
210
- <ry-grid cols="3">
211
- <ry-card interactive href="/demos/goap">
212
- <h3>GOAP</h3>
213
- <p>Goal-Oriented Action Planning</p>
214
- </ry-card>
215
- <ry-card interactive href="/demos/fsm">
216
- <h3>FSM</h3>
217
- <p>Finite State Machine</p>
218
- </ry-card>
219
- <ry-card interactive href="/demos/bt">
220
- <h3>Behavior Trees</h3>
221
- <p>Hierarchical task planning</p>
222
- </ry-card>
223
- </ry-grid>
224
-
225
- <!-- Listen for clicks -->
226
- <script>
227
- document.querySelectorAll('ry-card[interactive]').forEach(card => {
228
- card.addEventListener('ry:click', () => console.log('clicked', card.getAttribute('href')));
229
- });
230
- </script>
231
- ```
232
-
233
- All cards hover-lift by default. `interactive` adds: cursor pointer, stronger lift, primary border on hover, keyboard (Tab/Enter/Space), and `ry:click` event.
234
-
235
- ### Badge with Arbitrary Color
236
-
237
- ```html
238
- <ry-badge variant="success">Active</ry-badge>
239
- <ry-badge variant="accent">Pro</ry-badge>
240
- <ry-badge style="--ry-badge-color: #8B5CF6">Custom</ry-badge>
241
- <ry-badge style="--ry-badge-color: oklch(0.7 0.15 200); --ry-badge-text: #000">Custom + text</ry-badge>
242
- ```
243
-
244
- ### Check List (Pricing Features)
245
-
246
- ```html
247
- <ul class="ry-check-list">
248
- <li>Unlimited projects</li>
249
- <li>Priority support</li>
250
- <li>Custom domains</li>
251
- </ul>
252
- ```
253
-
254
- ### Nav Bar
255
-
256
- ```html
257
- <ry-header sticky>
258
- <ry-cluster>
259
- <ry-logo>MyApp</ry-logo>
260
- <ry-divider vertical></ry-divider>
261
- <ry-nav>
262
- <a href="/" aria-current="page">Home</a>
263
- <a href="/docs">Docs</a>
264
- <a href="/pricing">Pricing</a>
265
- </ry-nav>
266
- </ry-cluster>
267
- <ry-actions>
268
- <ry-button variant="ghost" size="sm">Login</ry-button>
269
- <ry-button size="sm">Sign Up</ry-button>
270
- </ry-actions>
271
- </ry-header>
272
- ```
273
-
274
- ### Pricing Page
275
-
276
- ```html
277
- <ry-pricing>
278
- <ry-pricing-card>
279
- <h3>Free</h3>
280
- <div class="ry-pricing__price">$0<span>/mo</span></div>
281
- <p>For individuals</p>
282
- <ul class="ry-check-list">
283
- <li>3 projects</li>
284
- <li>Basic support</li>
285
- </ul>
286
- <ry-button variant="outline">Get Started</ry-button>
287
- </ry-pricing-card>
288
-
289
- <ry-pricing-card featured>
290
- <h3>Pro</h3>
291
- <div class="ry-pricing__price">$19<span>/mo</span></div>
292
- <p>For teams</p>
293
- <ul class="ry-check-list">
294
- <li>Unlimited projects</li>
295
- <li>Priority support</li>
296
- </ul>
297
- <ry-button>Upgrade</ry-button>
298
- </ry-pricing-card>
299
- </ry-pricing>
300
- ```
301
-
302
- ### Hero Section
303
-
304
- ```html
305
- <ry-hero>
306
- <h1>Build faster with ry-ui</h1>
307
- <p>Framework-agnostic components for any app.</p>
308
- <ry-cluster>
309
- <ry-button size="lg">Get Started</ry-button>
310
- <ry-button variant="outline" size="lg">View Docs</ry-button>
311
- </ry-cluster>
312
- </ry-hero>
313
- ```
314
-
315
- ### Modal & Drawer
316
-
317
- ```html
318
- <!-- Modal -->
319
- <ry-button modal="confirm">Open Modal</ry-button>
320
- <ry-modal id="confirm" title="Confirm Action">
321
- <p>Are you sure?</p>
322
- <ry-cluster>
323
- <ry-button variant="danger">Delete</ry-button>
324
- <ry-button variant="ghost">Cancel</ry-button>
325
- </ry-cluster>
326
- </ry-modal>
327
-
328
- <!-- Drawer -->
329
- <ry-button drawer="settings">Settings</ry-button>
330
- <ry-drawer id="settings" position="right" size="400px">
331
- <h3>Settings</h3>
332
- <!-- content -->
333
- </ry-drawer>
334
- ```
335
-
336
- ---
337
-
338
- ## CSS Token System
339
-
340
- All visual properties use CSS custom properties. Override in your own CSS to customize.
341
-
342
- ### Colors
343
-
344
- | Token | Purpose |
345
- |-------|---------|
346
- | `--ry-color-primary` / `-hover` / `-active` | Primary action color (blue) |
347
- | `--ry-color-secondary` / `-hover` / `-active` | Secondary muted color |
348
- | `--ry-color-accent` / `-hover` / `-active` | Accent/highlight color (purple) |
349
- | `--ry-color-success` | Green for positive states |
350
- | `--ry-color-warning` | Yellow/orange for caution |
351
- | `--ry-color-danger` / `-hover` | Red for destructive actions |
352
- | `--ry-color-info` | Blue for informational |
353
- | `--ry-color-text` / `-muted` / `-inverse` | Text colors |
354
- | `--ry-color-bg` / `-subtle` / `-muted` | Background colors |
355
- | `--ry-color-border` / `-strong` | Border colors |
356
- | `--ry-color-overlay` | Modal/drawer backdrop |
357
-
358
- Each color also has `-bg` and `-text` variants for alert/badge backgrounds:
359
- `--ry-color-{info,success,warning,danger}-bg` / `--ry-color-{info,success,warning,danger}-text`
360
-
361
- ### Spacing
362
-
363
- `--ry-space-{0,1,2,3,4,5,6,8,10,12,16,20}` — 0 to 5rem
364
-
365
- ### Typography
366
-
367
- | Token | Value |
368
- |-------|-------|
369
- | `--ry-font-sans` | system-ui stack |
370
- | `--ry-font-mono` | ui-monospace stack |
371
- | `--ry-text-{xs,sm,base,lg,xl,2xl,3xl,4xl}` | 0.75rem to 2.25rem |
372
- | `--ry-font-{normal,medium,semibold,bold}` | 400 to 700 |
373
- | `--ry-leading-{tight,normal,relaxed}` | 1.25 to 1.75 |
374
-
375
- ### Borders & Shadows
376
-
377
- | Token | Value |
378
- |-------|-------|
379
- | `--ry-radius-{none,sm,md,lg,xl,2xl,full}` | 0 to 9999px |
380
- | `--ry-shadow-{sm,md,lg,xl}` | Elevation shadows |
381
- | `--ry-border-width` | 1px |
382
-
383
- ### Transitions
384
-
385
- | Token | Value |
386
- |-------|-------|
387
- | `--ry-duration-{fast,normal,slow}` | 100ms, 200ms, 300ms |
388
- | `--ry-ease` / `-in` / `-out` | Cubic bezier easing |
389
-
390
- ### Z-Index
391
-
392
- | Token | Value |
393
- |-------|-------|
394
- | `--ry-z-dropdown` | 1000 |
395
- | `--ry-z-sticky` | 1020 |
396
- | `--ry-z-fixed` | 1030 |
397
- | `--ry-z-modal-backdrop` | 1040 |
398
- | `--ry-z-modal` | 1050 |
399
- | `--ry-z-popover` | 1060 |
400
- | `--ry-z-tooltip` | 1070 |
401
- | `--ry-z-toast` | 1080 |
402
-
403
- ---
404
-
405
- ## CSS Architecture
406
-
407
- Three layers, ordered by specificity:
408
-
409
- 1. **ry-tokens** — CSS custom properties (colors, spacing, etc.)
410
- 2. **ry-structure** — Pure layout (no colors). Selectors: element names + `[data-ry-target]`
411
- 3. **ry-theme** — All visual styling. Selectors: `.ry-*` classes + element names
412
-
413
- ### Custom Theming
414
-
415
- Load structure only + your own theme:
416
-
417
- ```html
418
- <link rel="stylesheet" href="ry-tokens.css"> <!-- or your own tokens -->
419
- <link rel="stylesheet" href="ry-structure.css">
420
- <link rel="stylesheet" href="your-theme.css">
421
- ```
422
-
423
- ### Dark Mode
424
-
425
- Built into tokens via `light-dark()`. No separate dark.css needed.
426
-
427
- ```html
428
- <html data-ry-theme="dark"> <!-- force dark -->
429
- <html data-ry-theme="light"> <!-- force light -->
430
- <!-- omit attribute for OS preference -->
431
- ```
432
-
433
- ---
434
-
435
- ## Patterns NOT in ry-ui (Keep Custom)
436
-
437
- These patterns are intentionally outside the design system's scope:
438
-
439
- | Pattern | Reason | Recommended approach |
440
- |---------|--------|---------------------|
441
- | Click-positioned dialog / popover | GSAP animations, cursor anchoring | Use ry-ui tokens inside custom dialog |
442
- | File drop zone | App-specific UX | Custom component, tokenize colors |
443
- | Color swatch selector | Too specialized | Custom radio buttons with ry-ui tokens |
444
- | Terminal / xterm.js wrapper | Third-party integration | Custom container, tokenize colors |
445
- | Infinite canvas / artboard | Canvas 2D, not DOM | Use `getComputedStyle` to read ry-ui tokens for canvas rendering |
446
- | Chat / streaming replay | App-specific data format | Custom layout, use ry-ui header/badge/button inside |
447
- | Floating properties panel | Positioned at coordinates | Use `position: absolute` + ry-ui form components inside |
448
-
449
- For all of these: **use ry-ui tokens for colors, spacing, and typography** so they match the theme, but keep the structural markup custom.
450
-
451
- ---
452
-
453
- ## TypeScript
454
-
455
- ```ts
456
- import { RyElement, RyButton, RyToast } from '@ryanhelsing/ry-ui';
457
-
458
- // Programmatic toast
459
- RyToast.success('Saved!');
460
- RyToast.error('Failed to save');
461
-
462
- // Listen for component events
463
- document.querySelector('ry-select')?.addEventListener('ry:change', (e: CustomEvent) => {
464
- console.log(e.detail.value);
465
- });
466
-
467
- // Extend components
468
- class MyWidget extends RyElement {
469
- setup() {
470
- this.on(this, 'click', () => this.emit('activate'));
471
- }
472
- }
473
- ```
474
-
475
- ---
476
-
477
- ## Icon Registry
478
-
479
- ```ts
480
- import { registerIcon, registerIcons } from '@ryanhelsing/ry-ui';
481
-
482
- // Single icon
483
- registerIcon('custom', '<svg>...</svg>');
484
-
485
- // Batch
486
- registerIcons({
487
- 'app-logo': '<svg>...</svg>',
488
- 'custom-arrow': '<svg>...</svg>'
489
- });
490
- ```
491
-
492
- 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 |