@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.
- package/.claude/skills/ry-ui-builder/SKILL.md +186 -0
- package/README.dev.md +302 -0
- package/README.md +462 -187
- package/dist/_redirects +1 -0
- package/dist/app.d.ts +2 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/components/ry-testimonial.d.ts +19 -0
- package/dist/components/ry-testimonial.d.ts.map +1 -0
- package/dist/components/ry-theme-panel.d.ts +25 -0
- package/dist/components/ry-theme-panel.d.ts.map +1 -0
- package/dist/core/ry-icons.d.ts.map +1 -1
- package/dist/core/ry-transform.d.ts.map +1 -1
- package/dist/css/ry-structure.css +122 -3
- package/dist/css/ry-theme.css +133 -0
- package/dist/css/ry-tokens.css +4 -26
- package/dist/css/ry-ui.css +259 -29
- package/dist/pages/components.html +1827 -0
- package/dist/pages/landing.html +229 -0
- package/dist/ry-ui.d.ts +2 -0
- package/dist/ry-ui.d.ts.map +1 -1
- package/dist/ry-ui.js +382 -245
- package/dist/ry-ui.js.map +1 -1
- package/dist/themes/antigravity.css +56 -0
- package/docs/components/forms.md +10 -3
- package/package.json +12 -6
- package/AGENT.md +0 -490
- package/AGENTS.md +0 -57
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ry-ui-builder
|
|
3
|
+
description: Build UIs with ry-ui web components. Use when creating pages, layouts, forms, dashboards, or any HTML interface. Provides component catalog, patterns, and anti-patterns so you use existing components instead of writing custom CSS/JS.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# ry-ui Component Builder
|
|
8
|
+
|
|
9
|
+
**ALWAYS use ry-ui components instead of writing custom CSS or JavaScript.**
|
|
10
|
+
|
|
11
|
+
## Setup
|
|
12
|
+
|
|
13
|
+
Add these two lines to any HTML page:
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ryanhelsing/ry-ui/dist/css/ry-ui.css">
|
|
17
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@ryanhelsing/ry-ui/dist/ry-ui.js"></script>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Set theme: `<html data-ry-theme="light">` (or `"dark"`, or omit for OS preference)
|
|
21
|
+
Set body: `<body style="background: var(--ry-color-bg); color: var(--ry-color-text);">`
|
|
22
|
+
|
|
23
|
+
## Rules
|
|
24
|
+
|
|
25
|
+
1. **NEVER write custom modal, dropdown, tab, accordion, toast, or button CSS.** ry-ui has these built in.
|
|
26
|
+
2. **NEVER write flexbox/grid layout CSS for page structure.** Use `<ry-page>`, `<ry-header>`, `<ry-main>`, `<ry-grid>`, `<ry-stack>`, `<ry-cluster>`.
|
|
27
|
+
3. **NEVER create CSS variables for colors or spacing.** Use `--ry-color-*`, `--ry-space-*`, `--ry-radius-*` tokens.
|
|
28
|
+
4. **DO use ry-ui tokens** in any custom CSS you write: `color: var(--ry-color-text-muted)`, `padding: var(--ry-space-4)`.
|
|
29
|
+
5. **DO compose pages from ry-ui primitives** — they handle accessibility, keyboard nav, focus trapping, and dark mode automatically.
|
|
30
|
+
|
|
31
|
+
## Page Template
|
|
32
|
+
|
|
33
|
+
```html
|
|
34
|
+
<!DOCTYPE html>
|
|
35
|
+
<html lang="en" data-ry-theme="light">
|
|
36
|
+
<head>
|
|
37
|
+
<meta charset="UTF-8">
|
|
38
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
39
|
+
<title>My App</title>
|
|
40
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ryanhelsing/ry-ui/dist/css/ry-ui.css">
|
|
41
|
+
</head>
|
|
42
|
+
<body style="background: var(--ry-color-bg); color: var(--ry-color-text);">
|
|
43
|
+
<ry-page>
|
|
44
|
+
<ry-header sticky>
|
|
45
|
+
<ry-cluster><strong>App Name</strong></ry-cluster>
|
|
46
|
+
<ry-actions><ry-theme-toggle themes="light,dark"></ry-theme-toggle></ry-actions>
|
|
47
|
+
</ry-header>
|
|
48
|
+
<ry-main>
|
|
49
|
+
<ry-section>
|
|
50
|
+
<!-- your content -->
|
|
51
|
+
</ry-section>
|
|
52
|
+
</ry-main>
|
|
53
|
+
<ry-footer>Footer</ry-footer>
|
|
54
|
+
</ry-page>
|
|
55
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@ryanhelsing/ry-ui/dist/ry-ui.js"></script>
|
|
56
|
+
</body>
|
|
57
|
+
</html>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Component Reference
|
|
61
|
+
|
|
62
|
+
### Layout (CSS-only)
|
|
63
|
+
- `<ry-page>` — root container, full height
|
|
64
|
+
- `<ry-header sticky>` — top bar, space-between
|
|
65
|
+
- `<ry-main>` — centered content, max-width 1200px
|
|
66
|
+
- `<ry-footer>` — footer with border-top
|
|
67
|
+
- `<ry-section>` — content block with margin
|
|
68
|
+
- `<ry-grid cols="3">` — responsive grid (cols-sm, cols-md, cols-lg for breakpoints)
|
|
69
|
+
- `<ry-stack gap="md">` — vertical flex
|
|
70
|
+
- `<ry-cluster gap="sm">` — horizontal flex, wraps
|
|
71
|
+
- `<ry-center>` — center both axes
|
|
72
|
+
- `<ry-card>` — card container (lifts on hover), `interactive` for clickable
|
|
73
|
+
- `<ry-split resizable persist="key">` — two-column with drag resize
|
|
74
|
+
- `<ry-divider>` / `<ry-divider vertical>` — separator line
|
|
75
|
+
- `<ry-nav>` — nav links, active: `<a aria-current="page">`
|
|
76
|
+
- `<ry-logo>` — bold inline text
|
|
77
|
+
- `<ry-actions>` — flex row for buttons
|
|
78
|
+
|
|
79
|
+
### Buttons
|
|
80
|
+
```html
|
|
81
|
+
<ry-button>Default</ry-button>
|
|
82
|
+
<ry-button variant="primary|secondary|outline|ghost|danger|accent">Styled</ry-button>
|
|
83
|
+
<ry-button size="sm|lg">Sized</ry-button>
|
|
84
|
+
<ry-button modal="modal-id">Opens modal</ry-button>
|
|
85
|
+
<ry-button drawer="drawer-id">Opens drawer</ry-button>
|
|
86
|
+
<ry-button disabled>Disabled</ry-button>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Modal
|
|
90
|
+
```html
|
|
91
|
+
<ry-button modal="my-modal">Open</ry-button>
|
|
92
|
+
<ry-modal id="my-modal" title="Title">Content</ry-modal>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Drawer
|
|
96
|
+
```html
|
|
97
|
+
<ry-button drawer="my-drawer">Open</ry-button>
|
|
98
|
+
<ry-drawer id="my-drawer" side="left|right|bottom" title="Title">Content</ry-drawer>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Tabs
|
|
102
|
+
```html
|
|
103
|
+
<ry-tabs>
|
|
104
|
+
<ry-tab title="Tab 1" active>Content 1</ry-tab>
|
|
105
|
+
<ry-tab title="Tab 2">Content 2</ry-tab>
|
|
106
|
+
</ry-tabs>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Accordion
|
|
110
|
+
```html
|
|
111
|
+
<ry-accordion>
|
|
112
|
+
<ry-accordion-item title="Section" open>Content</ry-accordion-item>
|
|
113
|
+
</ry-accordion>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Forms
|
|
117
|
+
```html
|
|
118
|
+
<ry-field label="Email" hint="Help text" error="Error msg">
|
|
119
|
+
<input type="email">
|
|
120
|
+
</ry-field>
|
|
121
|
+
|
|
122
|
+
<ry-select placeholder="Choose..." name="field">
|
|
123
|
+
<ry-option value="a">A</ry-option>
|
|
124
|
+
</ry-select>
|
|
125
|
+
|
|
126
|
+
<ry-switch name="toggle" checked></ry-switch>
|
|
127
|
+
<!-- ry:change event detail: { value: "true"/"false" (STRING not boolean!), label: "on"/"off" }
|
|
128
|
+
Use e.detail.value === 'true' to get a boolean — "false" is truthy in JS! -->
|
|
129
|
+
|
|
130
|
+
<ry-slider min="0" max="100" value="50"></ry-slider>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Dropdown Menu
|
|
134
|
+
```html
|
|
135
|
+
<ry-dropdown>
|
|
136
|
+
<ry-button slot="trigger">Menu</ry-button>
|
|
137
|
+
<ry-menu>
|
|
138
|
+
<ry-menu-item>Item</ry-menu-item>
|
|
139
|
+
</ry-menu>
|
|
140
|
+
</ry-dropdown>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Display
|
|
144
|
+
```html
|
|
145
|
+
<ry-alert type="info|success|warning|danger" dismissible>Message</ry-alert>
|
|
146
|
+
<ry-badge variant="primary|success|warning|danger|accent">Label</ry-badge>
|
|
147
|
+
<ry-tooltip content="Help" position="top|bottom|left|right"><span>Hover me</span></ry-tooltip>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Toast (JS only)
|
|
151
|
+
```javascript
|
|
152
|
+
RyToast.success('Saved!');
|
|
153
|
+
RyToast.error('Failed');
|
|
154
|
+
RyToast.info('FYI');
|
|
155
|
+
RyToast.warning('Careful');
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Button Group
|
|
159
|
+
```html
|
|
160
|
+
<ry-button-group name="view" value="grid">
|
|
161
|
+
<ry-button value="grid">Grid</ry-button>
|
|
162
|
+
<ry-button value="list">List</ry-button>
|
|
163
|
+
</ry-button-group>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Events
|
|
167
|
+
All events prefixed `ry:` — `ry:change`, `ry:open`, `ry:close`, `ry:click`, `ry:select`
|
|
168
|
+
|
|
169
|
+
```javascript
|
|
170
|
+
element.addEventListener('ry:change', (e) => console.log(e.detail));
|
|
171
|
+
document.querySelector('ry-modal').open();
|
|
172
|
+
document.querySelector('ry-modal').close();
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Theming
|
|
176
|
+
|
|
177
|
+
Override tokens — no build step:
|
|
178
|
+
```css
|
|
179
|
+
:root {
|
|
180
|
+
--ry-color-primary: oklch(0.541 0.218 293);
|
|
181
|
+
--ry-radius-md: 0;
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Key tokens: `--ry-color-{primary,secondary,accent,success,warning,danger,info,text,bg,border}`,
|
|
186
|
+
`--ry-space-{1-20}`, `--ry-radius-{sm,md,lg,full}`, `--ry-shadow-{sm,md,lg,xl}`
|
package/README.dev.md
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
# ry-ui
|
|
2
|
+
|
|
3
|
+
Framework-agnostic, Light DOM web components. CSS is the source of truth.
|
|
4
|
+
|
|
5
|
+
## North Star
|
|
6
|
+
|
|
7
|
+
There are only so many types of things we do in any app. There should be one opinionated default way to do each of them. Invent all the wheels once, then never again.
|
|
8
|
+
|
|
9
|
+
Every app is a composition of the same finite primitives: layout, navigation, data display, data entry, feedback, actions, auth, state. The patterns are solved. The industry just keeps re-solving them because engineers enjoy the puzzle.
|
|
10
|
+
|
|
11
|
+
ry-ui normalizes this. No decisions to make. No architecture to debate. An LLM can leverage these primitives to build any app, anywhere, with a structure that is grokkable, dumb, and repeatable. Over-engineering becomes irrelevant when there's nothing left to over-engineer.
|
|
12
|
+
|
|
13
|
+
**The goal:** Write once in HTML/CSS/JS. Deploy to web, iOS, Android, desktop. The primitives are portable because they're universal.
|
|
14
|
+
|
|
15
|
+
### FUNCTION / FORM / THEME
|
|
16
|
+
|
|
17
|
+
Every component is three independent layers:
|
|
18
|
+
|
|
19
|
+
- **FUNCTION** (JS) — Behavior. Extends `RyElement`. Manages state, events, keyboard, ARIA. Queries via `data-ry-target`.
|
|
20
|
+
- **FORM** (Structure CSS) — Layout. `ry-structure.css`. Display, flex, grid, padding, overflow, transform/opacity transitions. No colors.
|
|
21
|
+
- **THEME** (Visual CSS) — Appearance. `ry-theme.css`. Colors, shadows, borders, typography, focus rings. Entirely swappable.
|
|
22
|
+
|
|
23
|
+
These layers are independently replaceable. Structure works with any theme or no theme. Function works regardless of CSS loaded.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
- [x] separate the css minimal structure from the theme
|
|
28
|
+
- [x] separate the component behavior from the design (see `docs/arch/behavior-style-separation.md`)
|
|
29
|
+
|
|
30
|
+
### Next Up — Missing Primitives That Block Real Apps
|
|
31
|
+
|
|
32
|
+
- [ ] **Table / Data Grid** — sorting, column resize, virtual scrolling for large datasets. Highest-value missing component for any dashboard.
|
|
33
|
+
- [ ] **Form** — form orchestration around existing inputs. Validation, error states, submit handling, field grouping.
|
|
34
|
+
- [ ] **Menu / Context Menu** — right-click menus, nested submenus. Required for any desktop-targeting app.
|
|
35
|
+
- [ ] **Command Palette** — Cmd+K pattern. Table stakes for power-user apps and ry-os.
|
|
36
|
+
- [ ] **Toast stacking** — ry-toast exists but needs positioning, stacking multiple toasts, auto-dismiss timers, queue behavior.
|
|
37
|
+
- [ ] **Breadcrumb, Pagination, Stepper** — navigation patterns for any multi-page app.
|
|
38
|
+
|
|
39
|
+
### Backlog
|
|
40
|
+
|
|
41
|
+
- [ ] Placeholder, Step/Wizard, Loader/Progress, Comment/Feed, Statistic/Graph, Hero, Calendar, Rating, Search, Shape, Sticky, dialog/alert, carousel, qr-code, diff, format-bytes-number-currency, mutation-observer and resize observer
|
|
42
|
+
|
|
43
|
+
- [ ] This is a theme on its own: https://codepen.io/oathanrex/pen/EayVMqZ
|
|
44
|
+
|
|
45
|
+
- [ ] bring in examples and extract and normalize - Flat Clean (accord/tailwind) / Flat Fun Waves (zevo) / Game (mario/astrobot/stardew/animal crossing) / Brute (square game) / Skeuomorphic / Glass ( dark and light, color sets 1,2,3 )
|
|
46
|
+
- [ ] cross-platform transpiler - Swift/SwiftUI (see `docs/arch/cross-platform-transpiler.md`)
|
|
47
|
+
- [ ] animation system with GSAP (see `docs/plans/animation-system.md`)
|
|
48
|
+
- [ ] could use to write apps on ry-os lol.. rust based linux DE with html/js/css -> Dioxus -> rust apps / with an llm on device
|
|
49
|
+
- [ ] https://github.com/GrapheneOS — hardened Android, good reference for security-first OS/DE design patterns
|
|
50
|
+
|
|
51
|
+
## Quick Start
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<link rel="stylesheet" href="https://cdn.example.com/ry-ui.css">
|
|
55
|
+
<script type="module" src="https://cdn.example.com/ry-ui.js"></script>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Components
|
|
59
|
+
|
|
60
|
+
### Layout (CSS-only)
|
|
61
|
+
- `<ry-page>` - Page container
|
|
62
|
+
- `<ry-header>` / `<ry-footer>` - Page sections
|
|
63
|
+
- `<ry-main>` / `<ry-section>` - Content areas
|
|
64
|
+
- `<ry-grid cols="3">` - Responsive grid
|
|
65
|
+
- `<ry-stack>` / `<ry-cluster>` - Flex layouts
|
|
66
|
+
|
|
67
|
+
### Layout
|
|
68
|
+
- `<ry-split>` - Resizable two-column layout with optional `persist` for localStorage-backed width
|
|
69
|
+
|
|
70
|
+
### Interactive
|
|
71
|
+
- `<ry-button>` - Buttons with variants
|
|
72
|
+
- `<ry-button-group>` - Segmented control / radio button group
|
|
73
|
+
- `<ry-modal>` - Modal dialogs
|
|
74
|
+
- `<ry-drawer>` - Slide-out panels
|
|
75
|
+
- `<ry-accordion>` - Collapsible sections
|
|
76
|
+
- `<ry-tabs>` - Tabbed content
|
|
77
|
+
- `<ry-dropdown>` - Dropdown menus
|
|
78
|
+
- `<ry-select>` - Custom select
|
|
79
|
+
- `<ry-combobox>` - Searchable dropdown
|
|
80
|
+
- `<ry-switch>` - Toggle switch
|
|
81
|
+
- `<ry-tooltip>` - Hover tooltips
|
|
82
|
+
- `<ry-toast>` - Notifications
|
|
83
|
+
- `<ry-theme-panel>` - Floating theme/mode selector (none, default, ocean + light/dark)
|
|
84
|
+
- `<ry-testimonial>` - Customer testimonial / quote card with avatar and star rating
|
|
85
|
+
|
|
86
|
+
### Forms
|
|
87
|
+
- `<ry-field>` - Form field wrapper with auto label, error, and hint
|
|
88
|
+
|
|
89
|
+
### Display
|
|
90
|
+
- `<ry-card>` - Card containers
|
|
91
|
+
- `<ry-badge>` - Status badges
|
|
92
|
+
- `<ry-alert>` - Alert messages
|
|
93
|
+
|
|
94
|
+
## Clean Syntax
|
|
95
|
+
|
|
96
|
+
Use `<ry>` wrapper to write unprefixed markup:
|
|
97
|
+
|
|
98
|
+
```html
|
|
99
|
+
<ry>
|
|
100
|
+
<accordion>
|
|
101
|
+
<accordion-item title="FAQ" open>
|
|
102
|
+
No ry- prefix needed inside the wrapper.
|
|
103
|
+
</accordion-item>
|
|
104
|
+
</accordion>
|
|
105
|
+
</ry>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Examples
|
|
109
|
+
|
|
110
|
+
```html
|
|
111
|
+
<!-- Modal -->
|
|
112
|
+
<ry-button modal="demo">Open Modal</ry-button>
|
|
113
|
+
<ry-modal id="demo" title="Hello">Content here</ry-modal>
|
|
114
|
+
|
|
115
|
+
<!-- Drawer -->
|
|
116
|
+
<ry-button drawer="menu">Open</ry-button>
|
|
117
|
+
<ry-drawer id="menu" side="left">Menu content</ry-drawer>
|
|
118
|
+
|
|
119
|
+
<!-- Select -->
|
|
120
|
+
<ry-select placeholder="Country" name="country">
|
|
121
|
+
<ry-option value="us">United States</ry-option>
|
|
122
|
+
<ry-option value="uk">United Kingdom</ry-option>
|
|
123
|
+
</ry-select>
|
|
124
|
+
|
|
125
|
+
<!-- Split Panel (resizable, persistent) -->
|
|
126
|
+
<ry-split resizable persist="sidebar">
|
|
127
|
+
<main>Main content</main>
|
|
128
|
+
<aside>Sidebar</aside>
|
|
129
|
+
</ry-split>
|
|
130
|
+
|
|
131
|
+
<!-- Button Group -->
|
|
132
|
+
<ry-button-group value="monthly">
|
|
133
|
+
<ry-button value="monthly">Monthly</ry-button>
|
|
134
|
+
<ry-button value="annually">Annually</ry-button>
|
|
135
|
+
</ry-button-group>
|
|
136
|
+
|
|
137
|
+
<!-- Form Field -->
|
|
138
|
+
<ry-field label="Email" error="Invalid email">
|
|
139
|
+
<input type="email" name="email">
|
|
140
|
+
</ry-field>
|
|
141
|
+
|
|
142
|
+
<!-- Toast (programmatic) -->
|
|
143
|
+
<script>
|
|
144
|
+
RyToast.success('Saved!');
|
|
145
|
+
RyToast.error('Failed');
|
|
146
|
+
</script>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Themes
|
|
150
|
+
|
|
151
|
+
Theme and mode are orthogonal — every theme supports light and dark:
|
|
152
|
+
|
|
153
|
+
```html
|
|
154
|
+
<!-- Theme controls visual skin -->
|
|
155
|
+
<html data-ry-theme="ocean">
|
|
156
|
+
|
|
157
|
+
<!-- Mode controls light/dark (independent of theme) -->
|
|
158
|
+
<html data-ry-mode="dark">
|
|
159
|
+
|
|
160
|
+
<!-- "none" theme shows pure structure (no visual styling) -->
|
|
161
|
+
<html data-ry-theme="none">
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Available themes: `none`, `default`, `ocean`
|
|
165
|
+
Available modes: `auto` (OS preference), `light`, `dark`
|
|
166
|
+
|
|
167
|
+
Use `<ry-theme-panel>` for an interactive floating selector.
|
|
168
|
+
|
|
169
|
+
## CSS Architecture
|
|
170
|
+
|
|
171
|
+
ry-ui separates **structure** (layout/behavior) from **theme** (visual styling):
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
ry-tokens.css # Design tokens (CSS variables)
|
|
175
|
+
ry-structure.css # Pure layout - no colors, shadows, or borders
|
|
176
|
+
ry-theme.css # All visual styling
|
|
177
|
+
ry-ui.css # Bundled (all three combined)
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Custom Themes
|
|
181
|
+
|
|
182
|
+
For completely custom styling, load only structure + your own theme:
|
|
183
|
+
|
|
184
|
+
```html
|
|
185
|
+
<!-- Use default look -->
|
|
186
|
+
<link rel="stylesheet" href="ry-ui.css">
|
|
187
|
+
|
|
188
|
+
<!-- OR: Custom theme -->
|
|
189
|
+
<link rel="stylesheet" href="ry-structure.css">
|
|
190
|
+
<link rel="stylesheet" href="your-tokens.css">
|
|
191
|
+
<link rel="stylesheet" href="your-theme.css">
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Structure CSS contains only:
|
|
195
|
+
- Display modes, positioning, flexbox, grid
|
|
196
|
+
- Sizing, padding, margins, gaps
|
|
197
|
+
- State transitions (opacity, visibility, transform)
|
|
198
|
+
|
|
199
|
+
Theme CSS contains:
|
|
200
|
+
- Colors, backgrounds, borders
|
|
201
|
+
- Shadows, border-radius
|
|
202
|
+
- Typography styling
|
|
203
|
+
- Focus rings
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Development
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
npm install
|
|
211
|
+
npm run dev # Dev server with HMR
|
|
212
|
+
npm run build # Production build
|
|
213
|
+
npm run typecheck
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Publishing
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
npm run release
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Automatically available on CDN via [unpkg](https://unpkg.com/@ryanhelsing/ry-ui/) and [jsdelivr](https://cdn.jsdelivr.net/npm/@ryanhelsing/ry-ui/).
|
|
223
|
+
|
|
224
|
+
## TypeScript Philosophy
|
|
225
|
+
|
|
226
|
+
ry-ui is written in strict TypeScript with a "vanilla-first" approach:
|
|
227
|
+
|
|
228
|
+
### No Decorators, No Magic
|
|
229
|
+
We use plain class syntax with private fields (`#field`) instead of decorators. The code reads like standard JavaScript with type annotations.
|
|
230
|
+
|
|
231
|
+
```typescript
|
|
232
|
+
// What we do
|
|
233
|
+
class RySelect extends RyElement {
|
|
234
|
+
#highlightedIndex = -1;
|
|
235
|
+
#typeahead = '';
|
|
236
|
+
|
|
237
|
+
setup(): void { ... }
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// What we avoid
|
|
241
|
+
@customElement('ry-select')
|
|
242
|
+
class RySelect extends LitElement {
|
|
243
|
+
@property() value = '';
|
|
244
|
+
@state() private _open = false;
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Strict Mode, No Exceptions
|
|
249
|
+
```json
|
|
250
|
+
{
|
|
251
|
+
"strict": true,
|
|
252
|
+
"noUncheckedIndexedAccess": true,
|
|
253
|
+
"noImplicitReturns": true
|
|
254
|
+
}
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Type Patterns
|
|
258
|
+
|
|
259
|
+
**Explicit over inferred for public APIs:**
|
|
260
|
+
```typescript
|
|
261
|
+
get value(): string { return this.getAttribute('value') ?? ''; }
|
|
262
|
+
emit<T = void>(name: string, detail?: T): boolean { ... }
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
**Union types for constrained values:**
|
|
266
|
+
```typescript
|
|
267
|
+
type ToastVariant = 'info' | 'success' | 'warning' | 'error';
|
|
268
|
+
static observedAttributes = ['value', 'disabled'] as const;
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
**Extend globals for custom events:**
|
|
272
|
+
```typescript
|
|
273
|
+
declare global {
|
|
274
|
+
interface HTMLElementEventMap {
|
|
275
|
+
'ry:change': CustomEvent<{ value: string }>;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Build Output
|
|
281
|
+
|
|
282
|
+
Single bundled ESM file for CDN simplicity:
|
|
283
|
+
```
|
|
284
|
+
dist/
|
|
285
|
+
├── ry-ui.js # 32KB (7KB gzip)
|
|
286
|
+
├── ry-ui.js.map # Source maps
|
|
287
|
+
└── ry-ui.d.ts # Type declarations
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Vite builds with esbuild for speed, Rollup for optimization, and generates `.d.ts` for library consumers.
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## Inspiration
|
|
295
|
+
|
|
296
|
+
- [/e/OS](https://e.foundation/e-os/) — deGoogled Android OS focused on privacy and user freedom
|
|
297
|
+
- [Ramotion](https://dribbble.com/ramotion) — UI/UX design inspiration on Dribbble
|
|
298
|
+
- [Landing Folio](https://www.landingfolio.com/library) — Landing page design inspiration and components
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
See [CLAUDE.md](CLAUDE.md) for component development guide.
|