@ryanhelsing/ry-ui 1.0.11 → 1.0.13

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/README.dev.md +0 -302
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryanhelsing/ry-ui",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
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",
@@ -29,8 +29,8 @@
29
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/",
30
30
  "preview": "vite preview",
31
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",
32
+ "prepack": "cp README.md .readme-backup && cp CDN_README.md README.md",
33
+ "postpack": "mv .readme-backup README.md",
34
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"
35
35
  },
36
36
  "devDependencies": {
package/README.dev.md DELETED
@@ -1,302 +0,0 @@
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.