lituix 0.1.20 → 0.1.22
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/components.json +2 -2
- package/dist/components/lui-alert.d.ts +2 -0
- package/dist/components/lui-alert.d.ts.map +1 -1
- package/dist/components/lui-dialog.d.ts.map +1 -1
- package/dist/components/lui-table.d.ts.map +1 -1
- package/dist/index.browser.js +133 -136
- package/dist/index.browser.js.map +3 -3
- package/dist/index.cjs +161 -164
- package/dist/index.cjs.map +3 -3
- package/dist/index.mjs +106 -109
- package/dist/index.mjs.map +3 -3
- package/llm.txt +266 -266
- package/llms-full.txt +444 -444
- package/llms.txt +70 -70
- package/package.json +1 -1
- package/recipes.json +111 -111
package/llms-full.txt
CHANGED
|
@@ -1,444 +1,444 @@
|
|
|
1
|
-
# litui / Full LLM Guide
|
|
2
|
-
|
|
3
|
-
## 1. What this repo is
|
|
4
|
-
|
|
5
|
-
`litui` is a framework-agnostic UI component library based on Lit Web Components.
|
|
6
|
-
It provides:
|
|
7
|
-
|
|
8
|
-
- `lui-*` custom elements
|
|
9
|
-
- Storybook-driven public documentation
|
|
10
|
-
- native-style event naming
|
|
11
|
-
- overlay primitives and higher-level dialog/dropdown/drawer/menu systems
|
|
12
|
-
- schema-driven forms
|
|
13
|
-
- rich `table` and `tree` components
|
|
14
|
-
- imperative APIs for dialog, toast, form, and context menu usage
|
|
15
|
-
|
|
16
|
-
The main public surface is re-exported from `src/index.ts`.
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## 2. Stack and dependencies
|
|
21
|
-
|
|
22
|
-
### Core stack
|
|
23
|
-
- Lit 3
|
|
24
|
-
- TypeScript
|
|
25
|
-
- Storybook 10 (`@storybook/web-components` + Vite)
|
|
26
|
-
- esbuild
|
|
27
|
-
- Vite
|
|
28
|
-
|
|
29
|
-
### Important supporting libraries
|
|
30
|
-
- `@floating-ui/dom` — floating layer positioning
|
|
31
|
-
- `flatpickr` — date/time picker internals
|
|
32
|
-
- `cropperjs` — image cropper
|
|
33
|
-
- `@panzoom/panzoom` — image preview pan/zoom
|
|
34
|
-
- `@lit-labs/virtualizer` — virtualization
|
|
35
|
-
- `interactjs` — drag/resize interactions
|
|
36
|
-
- `@tanstack/lit-form` — schema-driven forms
|
|
37
|
-
- `iconify-icon` and `@iconify-json/lucide` — icon support
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
## 3. Directory map
|
|
42
|
-
|
|
43
|
-
### Core source
|
|
44
|
-
- `src/components/` — all custom elements and component-level helpers
|
|
45
|
-
- `src/apis/` — imperative APIs (`dialog`, `toast`, `form`, `context-menu`)
|
|
46
|
-
- `src/themes/` — tokens and shared base styles
|
|
47
|
-
- `src/utils/` — config provider, i18n, formatting, overlay stack, helpers
|
|
48
|
-
- `src/icons/` — builtin icon registry and setup helpers
|
|
49
|
-
- `src/index.ts` — export surface + side-effect registrations
|
|
50
|
-
|
|
51
|
-
### Docs and demos
|
|
52
|
-
- `stories/` — Storybook stories; often the best user-facing API reference
|
|
53
|
-
- `examples/` — standalone examples such as music player
|
|
54
|
-
|
|
55
|
-
### Output
|
|
56
|
-
- `dist/` — generated builds
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## 4. Public API conventions
|
|
61
|
-
|
|
62
|
-
### Element naming
|
|
63
|
-
- Public components are custom elements named `lui-*`
|
|
64
|
-
- Example tags:
|
|
65
|
-
- `lui-button`
|
|
66
|
-
- `lui-dialog`
|
|
67
|
-
- `lui-table`
|
|
68
|
-
- `lui-tree`
|
|
69
|
-
|
|
70
|
-
### Event naming
|
|
71
|
-
Use native-style or browser-like event names:
|
|
72
|
-
- `click`
|
|
73
|
-
- `input`
|
|
74
|
-
- `change`
|
|
75
|
-
- `select`
|
|
76
|
-
- `open`
|
|
77
|
-
- `close`
|
|
78
|
-
- `submit`
|
|
79
|
-
- `clear`
|
|
80
|
-
|
|
81
|
-
Notes:
|
|
82
|
-
- do **not** introduce new `lui-*` event names
|
|
83
|
-
- `open-change` is acceptable when synchronizing a boolean open state
|
|
84
|
-
- do **not** add legacy compatibility aliases back once APIs are unified
|
|
85
|
-
|
|
86
|
-
### Prop and schema naming
|
|
87
|
-
- public data-driven APIs use `source`
|
|
88
|
-
- `lui-form` schema field data sources also use `source`
|
|
89
|
-
- use `value / defaultValue` for controlled vs uncontrolled values
|
|
90
|
-
- use `open / defaultOpen` for overlay visibility
|
|
91
|
-
- use `closeOnSelect` for post-selection closing
|
|
92
|
-
- use `closeOnOutsidePress` for modal-like outside click closing
|
|
93
|
-
- use `placement` for floating layer placement
|
|
94
|
-
- use `size / variant / status / radius / disabled / loading` as the shared visual/state vocabulary
|
|
95
|
-
|
|
96
|
-
### Documentation expectation
|
|
97
|
-
If a public prop/behavior changes:
|
|
98
|
-
- update component code
|
|
99
|
-
- update matching story controls / docs
|
|
100
|
-
- preserve Storybook as a reliable public reference
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## 5. Public components by area
|
|
105
|
-
|
|
106
|
-
### 5.1 Foundation / display
|
|
107
|
-
- `lui-button`
|
|
108
|
-
- `lui-button-group`
|
|
109
|
-
- `lui-button-group-item`
|
|
110
|
-
- `lui-icon`
|
|
111
|
-
- `lui-icon-picker`
|
|
112
|
-
- `lui-text`
|
|
113
|
-
- `lui-card`
|
|
114
|
-
- `lui-tag`
|
|
115
|
-
- `lui-badge`
|
|
116
|
-
- `lui-statistic`
|
|
117
|
-
- `lui-avatar`
|
|
118
|
-
- `lui-avatar-group`
|
|
119
|
-
|
|
120
|
-
### 5.2 Navigation / layout
|
|
121
|
-
- `lui-tab`
|
|
122
|
-
- `lui-breadcrumb`
|
|
123
|
-
- `lui-pagination`
|
|
124
|
-
- `lui-row`
|
|
125
|
-
- `lui-divider`
|
|
126
|
-
- `lui-background`
|
|
127
|
-
- `lui-scroll-area`
|
|
128
|
-
|
|
129
|
-
### 5.3 Form
|
|
130
|
-
- `lui-form`
|
|
131
|
-
- `lui-form-item`
|
|
132
|
-
- `lui-input`
|
|
133
|
-
- `lui-input-number`
|
|
134
|
-
- `lui-input-opt`
|
|
135
|
-
- `lui-textarea`
|
|
136
|
-
- `lui-select`
|
|
137
|
-
- `lui-option`
|
|
138
|
-
- `lui-option-group`
|
|
139
|
-
- `lui-checkbox`
|
|
140
|
-
- `lui-checkbox-group`
|
|
141
|
-
- `lui-radio`
|
|
142
|
-
- `lui-radio-group`
|
|
143
|
-
- `lui-switch`
|
|
144
|
-
- `lui-slider`
|
|
145
|
-
- `lui-datepicker`
|
|
146
|
-
- `lui-calendar`
|
|
147
|
-
- `lui-date-range-picker`
|
|
148
|
-
- `lui-file-input`
|
|
149
|
-
- `lui-color-picker`
|
|
150
|
-
|
|
151
|
-
Form schema conventions:
|
|
152
|
-
- use `source` for select / radio / checkbox-group field data
|
|
153
|
-
- avoid `options` as a public schema field name
|
|
154
|
-
|
|
155
|
-
### 5.4 Overlay / menu / command
|
|
156
|
-
- `lui-popover`
|
|
157
|
-
- `lui-tooltip`
|
|
158
|
-
- `lui-dropdown`
|
|
159
|
-
- `lui-dropmenu`
|
|
160
|
-
- `lui-dialog`
|
|
161
|
-
- `lui-drawer`
|
|
162
|
-
- `lui-command-palette`
|
|
163
|
-
- `lui-menu`
|
|
164
|
-
- `lui-menu-item`
|
|
165
|
-
- `lui-menu-divider`
|
|
166
|
-
- `lui-context-menu`
|
|
167
|
-
- `lui-overlay-root`
|
|
168
|
-
|
|
169
|
-
### 5.5 Feedback / rich data
|
|
170
|
-
- `lui-alert` — inline notice; distinct from `dialog.alert()` and from toast
|
|
171
|
-
- `lui-spinner` — the one loading ring; button, card and tree all render it
|
|
172
|
-
- `lui-qrcode` — SVG QR code, encoder bundled in `src/utils/qrcode.ts`
|
|
173
|
-
- `lui-progress`
|
|
174
|
-
- `lui-skeleton`
|
|
175
|
-
- `lui-toast`
|
|
176
|
-
- `lui-empty-state`
|
|
177
|
-
- `lui-image`
|
|
178
|
-
- `lui-image-cropper`
|
|
179
|
-
- `lui-table`
|
|
180
|
-
- `lui-tree`
|
|
181
|
-
|
|
182
|
-
---
|
|
183
|
-
|
|
184
|
-
### 5.6 Added later
|
|
185
|
-
|
|
186
|
-
- `lui-collapse`, `lui-collapse-item` — accordion; every level shares one shell
|
|
187
|
-
- `lui-popconfirm` — bubble confirmation; composes `lui-popover` rather than extending it
|
|
188
|
-
- `lui-autocomplete` — free-text input with suggestions; the value is what was typed
|
|
189
|
-
- `lui-tree-select` — a tree behind a select trigger; the value is a single key
|
|
190
|
-
- `lui-cascader` — column-per-level picker; the value is the whole path
|
|
191
|
-
- Sub-elements that must be used inside their parent: `lui-tabs` / `lui-tab-panel`,
|
|
192
|
-
`lui-table-column`, `lui-breadcrumb-item`, `lui-option` / `lui-option-group`,
|
|
193
|
-
`lui-menu-item` / `lui-menu-divider`, `lui-collapse-item`
|
|
194
|
-
|
|
195
|
-
## 6. Imperative APIs
|
|
196
|
-
|
|
197
|
-
Defined under `src/apis/` and exported from `src/index.ts`.
|
|
198
|
-
|
|
199
|
-
### `dialog`
|
|
200
|
-
Used for alert / confirm / prompt / loading / general modal open workflows.
|
|
201
|
-
|
|
202
|
-
### `toast`
|
|
203
|
-
Used for transient notifications.
|
|
204
|
-
Capabilities include:
|
|
205
|
-
- show
|
|
206
|
-
- close
|
|
207
|
-
- update
|
|
208
|
-
- loading state
|
|
209
|
-
- success / warning / error shortcuts
|
|
210
|
-
- promise-style lifecycle helpers
|
|
211
|
-
|
|
212
|
-
### `form`
|
|
213
|
-
Used to open schema-driven forms in imperative workflows.
|
|
214
|
-
|
|
215
|
-
### `showContextMenu()`
|
|
216
|
-
Singleton right-click menu helper.
|
|
217
|
-
Good for one-off menu display.
|
|
218
|
-
|
|
219
|
-
### `createContextMenu()`
|
|
220
|
-
Returns a reusable controller.
|
|
221
|
-
Good for repeated long-lived menu usage.
|
|
222
|
-
|
|
223
|
-
---
|
|
224
|
-
|
|
225
|
-
## 7. Key architecture notes
|
|
226
|
-
|
|
227
|
-
### 7.1 Overlay architecture
|
|
228
|
-
The repo uses shared overlay infrastructure built around:
|
|
229
|
-
- `lui-overlay-root`
|
|
230
|
-
- overlay layer helpers
|
|
231
|
-
- stack / z-index helpers
|
|
232
|
-
|
|
233
|
-
Common overlay concepts across components:
|
|
234
|
-
- `portal`
|
|
235
|
-
- `overlayLayer`
|
|
236
|
-
- `backdrop`
|
|
237
|
-
- outside-click closing rules
|
|
238
|
-
- popup vs modal-like mount containers
|
|
239
|
-
|
|
240
|
-
`lui-popover` is the main floating primitive.
|
|
241
|
-
These build on or align with popover behavior:
|
|
242
|
-
- `lui-tooltip`
|
|
243
|
-
- `lui-dropdown`
|
|
244
|
-
- parts of `lui-dropmenu`
|
|
245
|
-
|
|
246
|
-
Dialog / drawer / toast / context menu use related overlay infrastructure too.
|
|
247
|
-
|
|
248
|
-
### 7.2 Config provider
|
|
249
|
-
`lui-config-provider` is the global config boundary.
|
|
250
|
-
It can provide:
|
|
251
|
-
- locale
|
|
252
|
-
- translations
|
|
253
|
-
- theme
|
|
254
|
-
- size
|
|
255
|
-
- disabled
|
|
256
|
-
- variant
|
|
257
|
-
- direction
|
|
258
|
-
- popup container
|
|
259
|
-
- overlay container
|
|
260
|
-
- z-index base
|
|
261
|
-
- renderEmpty
|
|
262
|
-
- component defaults via `componentConfig`
|
|
263
|
-
|
|
264
|
-
Read:
|
|
265
|
-
- `src/components/lui-config-provider.ts`
|
|
266
|
-
- `src/utils/config-provider.ts`
|
|
267
|
-
|
|
268
|
-
### 7.3 Theming
|
|
269
|
-
The library relies heavily on CSS custom properties using `--lui-*` naming.
|
|
270
|
-
Shared design tokens live in `src/themes/`.
|
|
271
|
-
|
|
272
|
-
When editing visuals:
|
|
273
|
-
- verify light theme
|
|
274
|
-
- verify dark theme
|
|
275
|
-
- keep token-driven styling where possible
|
|
276
|
-
|
|
277
|
-
### 7.4 Storybook-first public understanding
|
|
278
|
-
In this repo, Storybook stories are high-value public API references.
|
|
279
|
-
Often the correct reading order for a component is:
|
|
280
|
-
1. component code
|
|
281
|
-
2. matching story
|
|
282
|
-
3. related utility / base primitive
|
|
283
|
-
|
|
284
|
-
---
|
|
285
|
-
|
|
286
|
-
## 8. High-value components to understand deeply
|
|
287
|
-
|
|
288
|
-
### `lui-form`
|
|
289
|
-
Schema-driven dynamic form system.
|
|
290
|
-
Supports:
|
|
291
|
-
- field definitions
|
|
292
|
-
- validation
|
|
293
|
-
- custom render hooks
|
|
294
|
-
- steps
|
|
295
|
-
- complex layout
|
|
296
|
-
- array / repeatable structures
|
|
297
|
-
|
|
298
|
-
Best story:
|
|
299
|
-
- `stories/lui-form.stories.ts`
|
|
300
|
-
|
|
301
|
-
### `lui-table`
|
|
302
|
-
Rich data grid.
|
|
303
|
-
Supports:
|
|
304
|
-
- columns and data-driven configuration
|
|
305
|
-
- sorting
|
|
306
|
-
- selection
|
|
307
|
-
- pagination
|
|
308
|
-
- virtual scroll
|
|
309
|
-
- row animation
|
|
310
|
-
- column resize
|
|
311
|
-
- column reorder
|
|
312
|
-
- context menu integration
|
|
313
|
-
|
|
314
|
-
Best story:
|
|
315
|
-
- `stories/lui-table.stories.ts`
|
|
316
|
-
|
|
317
|
-
### `lui-tree`
|
|
318
|
-
Rich tree component.
|
|
319
|
-
Supports:
|
|
320
|
-
- expand/collapse
|
|
321
|
-
- single/multiple select
|
|
322
|
-
- checkbox cascade
|
|
323
|
-
- async loading
|
|
324
|
-
- search/filtering
|
|
325
|
-
- highlight
|
|
326
|
-
- drag and drop
|
|
327
|
-
- virtual scroll
|
|
328
|
-
- built-in context menu integration
|
|
329
|
-
|
|
330
|
-
Best story:
|
|
331
|
-
- `stories/lui-tree.stories.ts`
|
|
332
|
-
|
|
333
|
-
### `lui-image`
|
|
334
|
-
Image with richer UX than a plain `<img>`.
|
|
335
|
-
Supports:
|
|
336
|
-
- skeleton state
|
|
337
|
-
- error state
|
|
338
|
-
- preview viewer
|
|
339
|
-
- pan/zoom
|
|
340
|
-
- rotate
|
|
341
|
-
- download
|
|
342
|
-
|
|
343
|
-
Preferred modern events:
|
|
344
|
-
- `open`
|
|
345
|
-
- `close`
|
|
346
|
-
- `change`
|
|
347
|
-
|
|
348
|
-
### `lui-dialog` / `lui-drawer`
|
|
349
|
-
Modal-like overlays with portal/backdrop/outside-click behavior.
|
|
350
|
-
Need careful handling of:
|
|
351
|
-
- open/close
|
|
352
|
-
- backdrop style
|
|
353
|
-
- portal container
|
|
354
|
-
- shake / block outside close behavior
|
|
355
|
-
|
|
356
|
-
### `lui-dropdown` / `lui-dropmenu` / `lui-popover`
|
|
357
|
-
Floating layers with overlapping but distinct responsibilities.
|
|
358
|
-
Use stories to understand intended public differences.
|
|
359
|
-
|
|
360
|
-
---
|
|
361
|
-
|
|
362
|
-
## 9. Read order for coding agents
|
|
363
|
-
|
|
364
|
-
For fast repo understanding, use this order:
|
|
365
|
-
1. `README.md`
|
|
366
|
-
2. `package.json`
|
|
367
|
-
3. `components.json`
|
|
368
|
-
4. `src/index.ts`
|
|
369
|
-
5. `llm.txt`
|
|
370
|
-
6. `llms.txt`
|
|
371
|
-
7. target `src/components/lui-*.ts`
|
|
372
|
-
8. matching `stories/lui-*.stories.ts`
|
|
373
|
-
10. related helpers in `src/utils/` or `src/apis/`
|
|
374
|
-
|
|
375
|
-
Recommended high-value stories:
|
|
376
|
-
- `stories/lui-api-conventions.stories.ts`
|
|
377
|
-
- `stories/lui-form.stories.ts`
|
|
378
|
-
- `stories/lui-table.stories.ts`
|
|
379
|
-
- `stories/lui-tree.stories.ts`
|
|
380
|
-
- `stories/lui-dialog.stories.ts`
|
|
381
|
-
- `stories/lui-dropdown.stories.ts`
|
|
382
|
-
- `stories/lui-image.stories.ts`
|
|
383
|
-
- `stories/lui-config-provider.stories.ts`
|
|
384
|
-
|
|
385
|
-
---
|
|
386
|
-
|
|
387
|
-
## 10. Build and validation commands
|
|
388
|
-
|
|
389
|
-
Preferred validation commands:
|
|
390
|
-
- `pnpm -s typecheck`
|
|
391
|
-
- `pnpm -s build`
|
|
392
|
-
- `pnpm -s build-storybook`
|
|
393
|
-
|
|
394
|
-
Other useful commands:
|
|
395
|
-
- `pnpm storybook`
|
|
396
|
-
- `pnpm example:music`
|
|
397
|
-
|
|
398
|
-
---
|
|
399
|
-
|
|
400
|
-
## 11. Working guidance for LLMs / coding agents
|
|
401
|
-
|
|
402
|
-
- Prefer small, reviewable edits.
|
|
403
|
-
- Preserve native-style event naming.
|
|
404
|
-
- Keep Storybook docs / controls aligned with code.
|
|
405
|
-
- When changing overlay behavior, consider:
|
|
406
|
-
- portal
|
|
407
|
-
- overlay layer
|
|
408
|
-
- backdrop
|
|
409
|
-
- outside click close rules
|
|
410
|
-
- mount container rules
|
|
411
|
-
- When changing table / tree / form behavior, inspect rich stories before editing.
|
|
412
|
-
- When changing visual styling, verify both light and dark themes.
|
|
413
|
-
- If unsure whether something is public, confirm it is exported from `src/index.ts`.
|
|
414
|
-
|
|
415
|
-
---
|
|
416
|
-
|
|
417
|
-
## 12. Files especially useful for orientation
|
|
418
|
-
|
|
419
|
-
- `README.md`
|
|
420
|
-
- `package.json`
|
|
421
|
-
- `components.json`
|
|
422
|
-
- `src/index.ts`
|
|
423
|
-
- `src/components/lui-popover.ts`
|
|
424
|
-
- `src/components/lui-dialog.ts`
|
|
425
|
-
- `src/components/lui-form.ts`
|
|
426
|
-
- `src/components/lui-table.ts`
|
|
427
|
-
- `src/components/lui-tree.ts`
|
|
428
|
-
- `src/components/lui-config-provider.ts`
|
|
429
|
-
- `src/utils/config-provider.ts`
|
|
430
|
-
- `src/components/lui-overlay-root.ts`
|
|
431
|
-
|
|
432
|
-
---
|
|
433
|
-
|
|
434
|
-
## 13. Notes on documentation style
|
|
435
|
-
|
|
436
|
-
Current repo direction:
|
|
437
|
-
- stories are mostly Chinese-facing
|
|
438
|
-
- public descriptions should be concise and practical
|
|
439
|
-
- technical terms may remain in English when they are API names or established UI concepts
|
|
440
|
-
|
|
441
|
-
If adding docs, keep them:
|
|
442
|
-
- short
|
|
443
|
-
- user-facing
|
|
444
|
-
- synchronized with actual props and events
|
|
1
|
+
# litui / Full LLM Guide
|
|
2
|
+
|
|
3
|
+
## 1. What this repo is
|
|
4
|
+
|
|
5
|
+
`litui` is a framework-agnostic UI component library based on Lit Web Components.
|
|
6
|
+
It provides:
|
|
7
|
+
|
|
8
|
+
- `lui-*` custom elements
|
|
9
|
+
- Storybook-driven public documentation
|
|
10
|
+
- native-style event naming
|
|
11
|
+
- overlay primitives and higher-level dialog/dropdown/drawer/menu systems
|
|
12
|
+
- schema-driven forms
|
|
13
|
+
- rich `table` and `tree` components
|
|
14
|
+
- imperative APIs for dialog, toast, form, and context menu usage
|
|
15
|
+
|
|
16
|
+
The main public surface is re-exported from `src/index.ts`.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 2. Stack and dependencies
|
|
21
|
+
|
|
22
|
+
### Core stack
|
|
23
|
+
- Lit 3
|
|
24
|
+
- TypeScript
|
|
25
|
+
- Storybook 10 (`@storybook/web-components` + Vite)
|
|
26
|
+
- esbuild
|
|
27
|
+
- Vite
|
|
28
|
+
|
|
29
|
+
### Important supporting libraries
|
|
30
|
+
- `@floating-ui/dom` — floating layer positioning
|
|
31
|
+
- `flatpickr` — date/time picker internals
|
|
32
|
+
- `cropperjs` — image cropper
|
|
33
|
+
- `@panzoom/panzoom` — image preview pan/zoom
|
|
34
|
+
- `@lit-labs/virtualizer` — virtualization
|
|
35
|
+
- `interactjs` — drag/resize interactions
|
|
36
|
+
- `@tanstack/lit-form` — schema-driven forms
|
|
37
|
+
- `iconify-icon` and `@iconify-json/lucide` — icon support
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 3. Directory map
|
|
42
|
+
|
|
43
|
+
### Core source
|
|
44
|
+
- `src/components/` — all custom elements and component-level helpers
|
|
45
|
+
- `src/apis/` — imperative APIs (`dialog`, `toast`, `form`, `context-menu`)
|
|
46
|
+
- `src/themes/` — tokens and shared base styles
|
|
47
|
+
- `src/utils/` — config provider, i18n, formatting, overlay stack, helpers
|
|
48
|
+
- `src/icons/` — builtin icon registry and setup helpers
|
|
49
|
+
- `src/index.ts` — export surface + side-effect registrations
|
|
50
|
+
|
|
51
|
+
### Docs and demos
|
|
52
|
+
- `stories/` — Storybook stories; often the best user-facing API reference
|
|
53
|
+
- `examples/` — standalone examples such as music player
|
|
54
|
+
|
|
55
|
+
### Output
|
|
56
|
+
- `dist/` — generated builds
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 4. Public API conventions
|
|
61
|
+
|
|
62
|
+
### Element naming
|
|
63
|
+
- Public components are custom elements named `lui-*`
|
|
64
|
+
- Example tags:
|
|
65
|
+
- `lui-button`
|
|
66
|
+
- `lui-dialog`
|
|
67
|
+
- `lui-table`
|
|
68
|
+
- `lui-tree`
|
|
69
|
+
|
|
70
|
+
### Event naming
|
|
71
|
+
Use native-style or browser-like event names:
|
|
72
|
+
- `click`
|
|
73
|
+
- `input`
|
|
74
|
+
- `change`
|
|
75
|
+
- `select`
|
|
76
|
+
- `open`
|
|
77
|
+
- `close`
|
|
78
|
+
- `submit`
|
|
79
|
+
- `clear`
|
|
80
|
+
|
|
81
|
+
Notes:
|
|
82
|
+
- do **not** introduce new `lui-*` event names
|
|
83
|
+
- `open-change` is acceptable when synchronizing a boolean open state
|
|
84
|
+
- do **not** add legacy compatibility aliases back once APIs are unified
|
|
85
|
+
|
|
86
|
+
### Prop and schema naming
|
|
87
|
+
- public data-driven APIs use `source`
|
|
88
|
+
- `lui-form` schema field data sources also use `source`
|
|
89
|
+
- use `value / defaultValue` for controlled vs uncontrolled values
|
|
90
|
+
- use `open / defaultOpen` for overlay visibility
|
|
91
|
+
- use `closeOnSelect` for post-selection closing
|
|
92
|
+
- use `closeOnOutsidePress` for modal-like outside click closing
|
|
93
|
+
- use `placement` for floating layer placement
|
|
94
|
+
- use `size / variant / status / radius / disabled / loading` as the shared visual/state vocabulary
|
|
95
|
+
|
|
96
|
+
### Documentation expectation
|
|
97
|
+
If a public prop/behavior changes:
|
|
98
|
+
- update component code
|
|
99
|
+
- update matching story controls / docs
|
|
100
|
+
- preserve Storybook as a reliable public reference
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 5. Public components by area
|
|
105
|
+
|
|
106
|
+
### 5.1 Foundation / display
|
|
107
|
+
- `lui-button`
|
|
108
|
+
- `lui-button-group`
|
|
109
|
+
- `lui-button-group-item`
|
|
110
|
+
- `lui-icon`
|
|
111
|
+
- `lui-icon-picker`
|
|
112
|
+
- `lui-text`
|
|
113
|
+
- `lui-card`
|
|
114
|
+
- `lui-tag`
|
|
115
|
+
- `lui-badge`
|
|
116
|
+
- `lui-statistic`
|
|
117
|
+
- `lui-avatar`
|
|
118
|
+
- `lui-avatar-group`
|
|
119
|
+
|
|
120
|
+
### 5.2 Navigation / layout
|
|
121
|
+
- `lui-tab`
|
|
122
|
+
- `lui-breadcrumb`
|
|
123
|
+
- `lui-pagination`
|
|
124
|
+
- `lui-row`
|
|
125
|
+
- `lui-divider`
|
|
126
|
+
- `lui-background`
|
|
127
|
+
- `lui-scroll-area`
|
|
128
|
+
|
|
129
|
+
### 5.3 Form
|
|
130
|
+
- `lui-form`
|
|
131
|
+
- `lui-form-item`
|
|
132
|
+
- `lui-input`
|
|
133
|
+
- `lui-input-number`
|
|
134
|
+
- `lui-input-opt`
|
|
135
|
+
- `lui-textarea`
|
|
136
|
+
- `lui-select`
|
|
137
|
+
- `lui-option`
|
|
138
|
+
- `lui-option-group`
|
|
139
|
+
- `lui-checkbox`
|
|
140
|
+
- `lui-checkbox-group`
|
|
141
|
+
- `lui-radio`
|
|
142
|
+
- `lui-radio-group`
|
|
143
|
+
- `lui-switch`
|
|
144
|
+
- `lui-slider`
|
|
145
|
+
- `lui-datepicker`
|
|
146
|
+
- `lui-calendar`
|
|
147
|
+
- `lui-date-range-picker`
|
|
148
|
+
- `lui-file-input`
|
|
149
|
+
- `lui-color-picker`
|
|
150
|
+
|
|
151
|
+
Form schema conventions:
|
|
152
|
+
- use `source` for select / radio / checkbox-group field data
|
|
153
|
+
- avoid `options` as a public schema field name
|
|
154
|
+
|
|
155
|
+
### 5.4 Overlay / menu / command
|
|
156
|
+
- `lui-popover`
|
|
157
|
+
- `lui-tooltip`
|
|
158
|
+
- `lui-dropdown`
|
|
159
|
+
- `lui-dropmenu`
|
|
160
|
+
- `lui-dialog`
|
|
161
|
+
- `lui-drawer`
|
|
162
|
+
- `lui-command-palette`
|
|
163
|
+
- `lui-menu`
|
|
164
|
+
- `lui-menu-item`
|
|
165
|
+
- `lui-menu-divider`
|
|
166
|
+
- `lui-context-menu`
|
|
167
|
+
- `lui-overlay-root`
|
|
168
|
+
|
|
169
|
+
### 5.5 Feedback / rich data
|
|
170
|
+
- `lui-alert` — inline notice; distinct from `dialog.alert()` and from toast
|
|
171
|
+
- `lui-spinner` — the one loading ring; button, card and tree all render it
|
|
172
|
+
- `lui-qrcode` — SVG QR code, encoder bundled in `src/utils/qrcode.ts`
|
|
173
|
+
- `lui-progress`
|
|
174
|
+
- `lui-skeleton`
|
|
175
|
+
- `lui-toast`
|
|
176
|
+
- `lui-empty-state`
|
|
177
|
+
- `lui-image`
|
|
178
|
+
- `lui-image-cropper`
|
|
179
|
+
- `lui-table`
|
|
180
|
+
- `lui-tree`
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
### 5.6 Added later
|
|
185
|
+
|
|
186
|
+
- `lui-collapse`, `lui-collapse-item` — accordion; every level shares one shell
|
|
187
|
+
- `lui-popconfirm` — bubble confirmation; composes `lui-popover` rather than extending it
|
|
188
|
+
- `lui-autocomplete` — free-text input with suggestions; the value is what was typed
|
|
189
|
+
- `lui-tree-select` — a tree behind a select trigger; the value is a single key
|
|
190
|
+
- `lui-cascader` — column-per-level picker; the value is the whole path
|
|
191
|
+
- Sub-elements that must be used inside their parent: `lui-tabs` / `lui-tab-panel`,
|
|
192
|
+
`lui-table-column`, `lui-breadcrumb-item`, `lui-option` / `lui-option-group`,
|
|
193
|
+
`lui-menu-item` / `lui-menu-divider`, `lui-collapse-item`
|
|
194
|
+
|
|
195
|
+
## 6. Imperative APIs
|
|
196
|
+
|
|
197
|
+
Defined under `src/apis/` and exported from `src/index.ts`.
|
|
198
|
+
|
|
199
|
+
### `dialog`
|
|
200
|
+
Used for alert / confirm / prompt / loading / general modal open workflows.
|
|
201
|
+
|
|
202
|
+
### `toast`
|
|
203
|
+
Used for transient notifications.
|
|
204
|
+
Capabilities include:
|
|
205
|
+
- show
|
|
206
|
+
- close
|
|
207
|
+
- update
|
|
208
|
+
- loading state
|
|
209
|
+
- success / warning / error shortcuts
|
|
210
|
+
- promise-style lifecycle helpers
|
|
211
|
+
|
|
212
|
+
### `form`
|
|
213
|
+
Used to open schema-driven forms in imperative workflows.
|
|
214
|
+
|
|
215
|
+
### `showContextMenu()`
|
|
216
|
+
Singleton right-click menu helper.
|
|
217
|
+
Good for one-off menu display.
|
|
218
|
+
|
|
219
|
+
### `createContextMenu()`
|
|
220
|
+
Returns a reusable controller.
|
|
221
|
+
Good for repeated long-lived menu usage.
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## 7. Key architecture notes
|
|
226
|
+
|
|
227
|
+
### 7.1 Overlay architecture
|
|
228
|
+
The repo uses shared overlay infrastructure built around:
|
|
229
|
+
- `lui-overlay-root`
|
|
230
|
+
- overlay layer helpers
|
|
231
|
+
- stack / z-index helpers
|
|
232
|
+
|
|
233
|
+
Common overlay concepts across components:
|
|
234
|
+
- `portal`
|
|
235
|
+
- `overlayLayer`
|
|
236
|
+
- `backdrop`
|
|
237
|
+
- outside-click closing rules
|
|
238
|
+
- popup vs modal-like mount containers
|
|
239
|
+
|
|
240
|
+
`lui-popover` is the main floating primitive.
|
|
241
|
+
These build on or align with popover behavior:
|
|
242
|
+
- `lui-tooltip`
|
|
243
|
+
- `lui-dropdown`
|
|
244
|
+
- parts of `lui-dropmenu`
|
|
245
|
+
|
|
246
|
+
Dialog / drawer / toast / context menu use related overlay infrastructure too.
|
|
247
|
+
|
|
248
|
+
### 7.2 Config provider
|
|
249
|
+
`lui-config-provider` is the global config boundary.
|
|
250
|
+
It can provide:
|
|
251
|
+
- locale
|
|
252
|
+
- translations
|
|
253
|
+
- theme
|
|
254
|
+
- size
|
|
255
|
+
- disabled
|
|
256
|
+
- variant
|
|
257
|
+
- direction
|
|
258
|
+
- popup container
|
|
259
|
+
- overlay container
|
|
260
|
+
- z-index base
|
|
261
|
+
- renderEmpty
|
|
262
|
+
- component defaults via `componentConfig`
|
|
263
|
+
|
|
264
|
+
Read:
|
|
265
|
+
- `src/components/lui-config-provider.ts`
|
|
266
|
+
- `src/utils/config-provider.ts`
|
|
267
|
+
|
|
268
|
+
### 7.3 Theming
|
|
269
|
+
The library relies heavily on CSS custom properties using `--lui-*` naming.
|
|
270
|
+
Shared design tokens live in `src/themes/`.
|
|
271
|
+
|
|
272
|
+
When editing visuals:
|
|
273
|
+
- verify light theme
|
|
274
|
+
- verify dark theme
|
|
275
|
+
- keep token-driven styling where possible
|
|
276
|
+
|
|
277
|
+
### 7.4 Storybook-first public understanding
|
|
278
|
+
In this repo, Storybook stories are high-value public API references.
|
|
279
|
+
Often the correct reading order for a component is:
|
|
280
|
+
1. component code
|
|
281
|
+
2. matching story
|
|
282
|
+
3. related utility / base primitive
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## 8. High-value components to understand deeply
|
|
287
|
+
|
|
288
|
+
### `lui-form`
|
|
289
|
+
Schema-driven dynamic form system.
|
|
290
|
+
Supports:
|
|
291
|
+
- field definitions
|
|
292
|
+
- validation
|
|
293
|
+
- custom render hooks
|
|
294
|
+
- steps
|
|
295
|
+
- complex layout
|
|
296
|
+
- array / repeatable structures
|
|
297
|
+
|
|
298
|
+
Best story:
|
|
299
|
+
- `stories/lui-form.stories.ts`
|
|
300
|
+
|
|
301
|
+
### `lui-table`
|
|
302
|
+
Rich data grid.
|
|
303
|
+
Supports:
|
|
304
|
+
- columns and data-driven configuration
|
|
305
|
+
- sorting
|
|
306
|
+
- selection
|
|
307
|
+
- pagination
|
|
308
|
+
- virtual scroll
|
|
309
|
+
- row animation
|
|
310
|
+
- column resize
|
|
311
|
+
- column reorder
|
|
312
|
+
- context menu integration
|
|
313
|
+
|
|
314
|
+
Best story:
|
|
315
|
+
- `stories/lui-table.stories.ts`
|
|
316
|
+
|
|
317
|
+
### `lui-tree`
|
|
318
|
+
Rich tree component.
|
|
319
|
+
Supports:
|
|
320
|
+
- expand/collapse
|
|
321
|
+
- single/multiple select
|
|
322
|
+
- checkbox cascade
|
|
323
|
+
- async loading
|
|
324
|
+
- search/filtering
|
|
325
|
+
- highlight
|
|
326
|
+
- drag and drop
|
|
327
|
+
- virtual scroll
|
|
328
|
+
- built-in context menu integration
|
|
329
|
+
|
|
330
|
+
Best story:
|
|
331
|
+
- `stories/lui-tree.stories.ts`
|
|
332
|
+
|
|
333
|
+
### `lui-image`
|
|
334
|
+
Image with richer UX than a plain `<img>`.
|
|
335
|
+
Supports:
|
|
336
|
+
- skeleton state
|
|
337
|
+
- error state
|
|
338
|
+
- preview viewer
|
|
339
|
+
- pan/zoom
|
|
340
|
+
- rotate
|
|
341
|
+
- download
|
|
342
|
+
|
|
343
|
+
Preferred modern events:
|
|
344
|
+
- `open`
|
|
345
|
+
- `close`
|
|
346
|
+
- `change`
|
|
347
|
+
|
|
348
|
+
### `lui-dialog` / `lui-drawer`
|
|
349
|
+
Modal-like overlays with portal/backdrop/outside-click behavior.
|
|
350
|
+
Need careful handling of:
|
|
351
|
+
- open/close
|
|
352
|
+
- backdrop style
|
|
353
|
+
- portal container
|
|
354
|
+
- shake / block outside close behavior
|
|
355
|
+
|
|
356
|
+
### `lui-dropdown` / `lui-dropmenu` / `lui-popover`
|
|
357
|
+
Floating layers with overlapping but distinct responsibilities.
|
|
358
|
+
Use stories to understand intended public differences.
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
## 9. Read order for coding agents
|
|
363
|
+
|
|
364
|
+
For fast repo understanding, use this order:
|
|
365
|
+
1. `README.md`
|
|
366
|
+
2. `package.json`
|
|
367
|
+
3. `components.json`
|
|
368
|
+
4. `src/index.ts`
|
|
369
|
+
5. `llm.txt`
|
|
370
|
+
6. `llms.txt`
|
|
371
|
+
7. target `src/components/lui-*.ts`
|
|
372
|
+
8. matching `stories/lui-*.stories.ts`
|
|
373
|
+
10. related helpers in `src/utils/` or `src/apis/`
|
|
374
|
+
|
|
375
|
+
Recommended high-value stories:
|
|
376
|
+
- `stories/lui-api-conventions.stories.ts`
|
|
377
|
+
- `stories/lui-form.stories.ts`
|
|
378
|
+
- `stories/lui-table.stories.ts`
|
|
379
|
+
- `stories/lui-tree.stories.ts`
|
|
380
|
+
- `stories/lui-dialog.stories.ts`
|
|
381
|
+
- `stories/lui-dropdown.stories.ts`
|
|
382
|
+
- `stories/lui-image.stories.ts`
|
|
383
|
+
- `stories/lui-config-provider.stories.ts`
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
## 10. Build and validation commands
|
|
388
|
+
|
|
389
|
+
Preferred validation commands:
|
|
390
|
+
- `pnpm -s typecheck`
|
|
391
|
+
- `pnpm -s build`
|
|
392
|
+
- `pnpm -s build-storybook`
|
|
393
|
+
|
|
394
|
+
Other useful commands:
|
|
395
|
+
- `pnpm storybook`
|
|
396
|
+
- `pnpm example:music`
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
## 11. Working guidance for LLMs / coding agents
|
|
401
|
+
|
|
402
|
+
- Prefer small, reviewable edits.
|
|
403
|
+
- Preserve native-style event naming.
|
|
404
|
+
- Keep Storybook docs / controls aligned with code.
|
|
405
|
+
- When changing overlay behavior, consider:
|
|
406
|
+
- portal
|
|
407
|
+
- overlay layer
|
|
408
|
+
- backdrop
|
|
409
|
+
- outside click close rules
|
|
410
|
+
- mount container rules
|
|
411
|
+
- When changing table / tree / form behavior, inspect rich stories before editing.
|
|
412
|
+
- When changing visual styling, verify both light and dark themes.
|
|
413
|
+
- If unsure whether something is public, confirm it is exported from `src/index.ts`.
|
|
414
|
+
|
|
415
|
+
---
|
|
416
|
+
|
|
417
|
+
## 12. Files especially useful for orientation
|
|
418
|
+
|
|
419
|
+
- `README.md`
|
|
420
|
+
- `package.json`
|
|
421
|
+
- `components.json`
|
|
422
|
+
- `src/index.ts`
|
|
423
|
+
- `src/components/lui-popover.ts`
|
|
424
|
+
- `src/components/lui-dialog.ts`
|
|
425
|
+
- `src/components/lui-form.ts`
|
|
426
|
+
- `src/components/lui-table.ts`
|
|
427
|
+
- `src/components/lui-tree.ts`
|
|
428
|
+
- `src/components/lui-config-provider.ts`
|
|
429
|
+
- `src/utils/config-provider.ts`
|
|
430
|
+
- `src/components/lui-overlay-root.ts`
|
|
431
|
+
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
## 13. Notes on documentation style
|
|
435
|
+
|
|
436
|
+
Current repo direction:
|
|
437
|
+
- stories are mostly Chinese-facing
|
|
438
|
+
- public descriptions should be concise and practical
|
|
439
|
+
- technical terms may remain in English when they are API names or established UI concepts
|
|
440
|
+
|
|
441
|
+
If adding docs, keep them:
|
|
442
|
+
- short
|
|
443
|
+
- user-facing
|
|
444
|
+
- synchronized with actual props and events
|