lituix 0.0.1
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/README.md +31 -0
- package/dist/apis/context-menu.d.ts +29 -0
- package/dist/apis/context-menu.d.ts.map +1 -0
- package/dist/apis/dialog.d.ts +72 -0
- package/dist/apis/dialog.d.ts.map +1 -0
- package/dist/apis/form.d.ts +44 -0
- package/dist/apis/form.d.ts.map +1 -0
- package/dist/apis/toast.d.ts +57 -0
- package/dist/apis/toast.d.ts.map +1 -0
- package/dist/components/button-group-collapse.d.ts +14 -0
- package/dist/components/button-group-collapse.d.ts.map +1 -0
- package/dist/components/button-group-state.d.ts +13 -0
- package/dist/components/button-group-state.d.ts.map +1 -0
- package/dist/components/context-menu-tree.d.ts +2 -0
- package/dist/components/context-menu-tree.d.ts.map +1 -0
- package/dist/components/lui-avatar-group.d.ts +44 -0
- package/dist/components/lui-avatar-group.d.ts.map +1 -0
- package/dist/components/lui-avatar.d.ts +60 -0
- package/dist/components/lui-avatar.d.ts.map +1 -0
- package/dist/components/lui-background.d.ts +42 -0
- package/dist/components/lui-background.d.ts.map +1 -0
- package/dist/components/lui-badge.d.ts +37 -0
- package/dist/components/lui-badge.d.ts.map +1 -0
- package/dist/components/lui-breadcrumb.d.ts +91 -0
- package/dist/components/lui-breadcrumb.d.ts.map +1 -0
- package/dist/components/lui-button-group-item.d.ts +33 -0
- package/dist/components/lui-button-group-item.d.ts.map +1 -0
- package/dist/components/lui-button-group.d.ts +97 -0
- package/dist/components/lui-button-group.d.ts.map +1 -0
- package/dist/components/lui-button.d.ts +36 -0
- package/dist/components/lui-button.d.ts.map +1 -0
- package/dist/components/lui-calendar.d.ts +53 -0
- package/dist/components/lui-calendar.d.ts.map +1 -0
- package/dist/components/lui-card.d.ts +35 -0
- package/dist/components/lui-card.d.ts.map +1 -0
- package/dist/components/lui-checkbox-group.d.ts +60 -0
- package/dist/components/lui-checkbox-group.d.ts.map +1 -0
- package/dist/components/lui-checkbox.d.ts +43 -0
- package/dist/components/lui-checkbox.d.ts.map +1 -0
- package/dist/components/lui-color-picker.d.ts +101 -0
- package/dist/components/lui-color-picker.d.ts.map +1 -0
- package/dist/components/lui-command-palette.d.ts +72 -0
- package/dist/components/lui-command-palette.d.ts.map +1 -0
- package/dist/components/lui-config-provider.d.ts +30 -0
- package/dist/components/lui-config-provider.d.ts.map +1 -0
- package/dist/components/lui-context-menu.d.ts +114 -0
- package/dist/components/lui-context-menu.d.ts.map +1 -0
- package/dist/components/lui-date-range-picker.d.ts +2 -0
- package/dist/components/lui-date-range-picker.d.ts.map +1 -0
- package/dist/components/lui-datepicker.d.ts +52 -0
- package/dist/components/lui-datepicker.d.ts.map +1 -0
- package/dist/components/lui-dialog.d.ts +84 -0
- package/dist/components/lui-dialog.d.ts.map +1 -0
- package/dist/components/lui-divider.d.ts +31 -0
- package/dist/components/lui-divider.d.ts.map +1 -0
- package/dist/components/lui-drawer.d.ts +71 -0
- package/dist/components/lui-drawer.d.ts.map +1 -0
- package/dist/components/lui-dropdown.d.ts +15 -0
- package/dist/components/lui-dropdown.d.ts.map +1 -0
- package/dist/components/lui-dropmenu.d.ts +89 -0
- package/dist/components/lui-dropmenu.d.ts.map +1 -0
- package/dist/components/lui-empty-state.d.ts +22 -0
- package/dist/components/lui-empty-state.d.ts.map +1 -0
- package/dist/components/lui-file-input.d.ts +23 -0
- package/dist/components/lui-file-input.d.ts.map +1 -0
- package/dist/components/lui-form-item.d.ts +33 -0
- package/dist/components/lui-form-item.d.ts.map +1 -0
- package/dist/components/lui-form.d.ts +255 -0
- package/dist/components/lui-form.d.ts.map +1 -0
- package/dist/components/lui-icon-picker.d.ts +101 -0
- package/dist/components/lui-icon-picker.d.ts.map +1 -0
- package/dist/components/lui-icon.d.ts +55 -0
- package/dist/components/lui-icon.d.ts.map +1 -0
- package/dist/components/lui-image-cropper.d.ts +64 -0
- package/dist/components/lui-image-cropper.d.ts.map +1 -0
- package/dist/components/lui-image.d.ts +87 -0
- package/dist/components/lui-image.d.ts.map +1 -0
- package/dist/components/lui-input-number.d.ts +42 -0
- package/dist/components/lui-input-number.d.ts.map +1 -0
- package/dist/components/lui-input-opt.d.ts +31 -0
- package/dist/components/lui-input-opt.d.ts.map +1 -0
- package/dist/components/lui-input.d.ts +58 -0
- package/dist/components/lui-input.d.ts.map +1 -0
- package/dist/components/lui-menu-divider.d.ts +12 -0
- package/dist/components/lui-menu-divider.d.ts.map +1 -0
- package/dist/components/lui-menu-item.d.ts +36 -0
- package/dist/components/lui-menu-item.d.ts.map +1 -0
- package/dist/components/lui-menu.d.ts +49 -0
- package/dist/components/lui-menu.d.ts.map +1 -0
- package/dist/components/lui-overlay-root.d.ts +20 -0
- package/dist/components/lui-overlay-root.d.ts.map +1 -0
- package/dist/components/lui-pagination.d.ts +77 -0
- package/dist/components/lui-pagination.d.ts.map +1 -0
- package/dist/components/lui-popover.d.ts +126 -0
- package/dist/components/lui-popover.d.ts.map +1 -0
- package/dist/components/lui-progress.d.ts +44 -0
- package/dist/components/lui-progress.d.ts.map +1 -0
- package/dist/components/lui-radio-group.d.ts +53 -0
- package/dist/components/lui-radio-group.d.ts.map +1 -0
- package/dist/components/lui-radio.d.ts +39 -0
- package/dist/components/lui-radio.d.ts.map +1 -0
- package/dist/components/lui-row.d.ts +57 -0
- package/dist/components/lui-row.d.ts.map +1 -0
- package/dist/components/lui-scroll-area.d.ts +66 -0
- package/dist/components/lui-scroll-area.d.ts.map +1 -0
- package/dist/components/lui-select.d.ts +166 -0
- package/dist/components/lui-select.d.ts.map +1 -0
- package/dist/components/lui-skeleton.d.ts +35 -0
- package/dist/components/lui-skeleton.d.ts.map +1 -0
- package/dist/components/lui-slider.d.ts +54 -0
- package/dist/components/lui-slider.d.ts.map +1 -0
- package/dist/components/lui-statistic.d.ts +43 -0
- package/dist/components/lui-statistic.d.ts.map +1 -0
- package/dist/components/lui-switch.d.ts +29 -0
- package/dist/components/lui-switch.d.ts.map +1 -0
- package/dist/components/lui-tab.d.ts +103 -0
- package/dist/components/lui-tab.d.ts.map +1 -0
- package/dist/components/lui-table.d.ts +314 -0
- package/dist/components/lui-table.d.ts.map +1 -0
- package/dist/components/lui-tag.d.ts +31 -0
- package/dist/components/lui-tag.d.ts.map +1 -0
- package/dist/components/lui-text.d.ts +53 -0
- package/dist/components/lui-text.d.ts.map +1 -0
- package/dist/components/lui-textarea.d.ts +42 -0
- package/dist/components/lui-textarea.d.ts.map +1 -0
- package/dist/components/lui-toast.d.ts +109 -0
- package/dist/components/lui-toast.d.ts.map +1 -0
- package/dist/components/lui-tooltip.d.ts +25 -0
- package/dist/components/lui-tooltip.d.ts.map +1 -0
- package/dist/components/lui-tree.d.ts +258 -0
- package/dist/components/lui-tree.d.ts.map +1 -0
- package/dist/components/menu-model.d.ts +54 -0
- package/dist/components/menu-model.d.ts.map +1 -0
- package/dist/components/menu-render.d.ts +56 -0
- package/dist/components/menu-render.d.ts.map +1 -0
- package/dist/components/menu-state.d.ts +19 -0
- package/dist/components/menu-state.d.ts.map +1 -0
- package/dist/icons/builtin-iconify.d.ts +6002 -0
- package/dist/icons/builtin-iconify.d.ts.map +1 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/index.browser.css +2 -0
- package/dist/index.browser.css.map +7 -0
- package/dist/index.browser.js +13316 -0
- package/dist/index.browser.js.map +7 -0
- package/dist/index.cjs +13149 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +122 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +13149 -0
- package/dist/index.mjs.map +7 -0
- package/dist/themes/index.d.ts +2 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/tokens.d.ts +11 -0
- package/dist/themes/tokens.d.ts.map +1 -0
- package/dist/utils/apply-element-props.d.ts +9 -0
- package/dist/utils/apply-element-props.d.ts.map +1 -0
- package/dist/utils/config-provider.d.ts +39 -0
- package/dist/utils/config-provider.d.ts.map +1 -0
- package/dist/utils/format.d.ts +4 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/i18n.d.ts +13 -0
- package/dist/utils/i18n.d.ts.map +1 -0
- package/dist/utils/interact-draggable.d.ts +20 -0
- package/dist/utils/interact-draggable.d.ts.map +1 -0
- package/dist/utils/overlay-stack.d.ts +14 -0
- package/dist/utils/overlay-stack.d.ts.map +1 -0
- package/llm.txt +245 -0
- package/llms-full.txt +428 -0
- package/llms.txt +61 -0
- package/package.json +85 -0
package/llms-full.txt
ADDED
|
@@ -0,0 +1,428 @@
|
|
|
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-progress`
|
|
171
|
+
- `lui-skeleton`
|
|
172
|
+
- `lui-toast`
|
|
173
|
+
- `lui-empty-state`
|
|
174
|
+
- `lui-image`
|
|
175
|
+
- `lui-image-cropper`
|
|
176
|
+
- `lui-table`
|
|
177
|
+
- `lui-tree`
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## 6. Imperative APIs
|
|
182
|
+
|
|
183
|
+
Defined under `src/apis/` and exported from `src/index.ts`.
|
|
184
|
+
|
|
185
|
+
### `dialog`
|
|
186
|
+
Used for alert / confirm / prompt / loading / general modal open workflows.
|
|
187
|
+
|
|
188
|
+
### `toast`
|
|
189
|
+
Used for transient notifications.
|
|
190
|
+
Capabilities include:
|
|
191
|
+
- show
|
|
192
|
+
- close
|
|
193
|
+
- update
|
|
194
|
+
- loading state
|
|
195
|
+
- success / warning / error shortcuts
|
|
196
|
+
- promise-style lifecycle helpers
|
|
197
|
+
|
|
198
|
+
### `form`
|
|
199
|
+
Used to open schema-driven forms in imperative workflows.
|
|
200
|
+
|
|
201
|
+
### `showContextMenu()`
|
|
202
|
+
Singleton right-click menu helper.
|
|
203
|
+
Good for one-off menu display.
|
|
204
|
+
|
|
205
|
+
### `createContextMenu()`
|
|
206
|
+
Returns a reusable controller.
|
|
207
|
+
Good for repeated long-lived menu usage.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## 7. Key architecture notes
|
|
212
|
+
|
|
213
|
+
### 7.1 Overlay architecture
|
|
214
|
+
The repo uses shared overlay infrastructure built around:
|
|
215
|
+
- `lui-overlay-root`
|
|
216
|
+
- overlay layer helpers
|
|
217
|
+
- stack / z-index helpers
|
|
218
|
+
|
|
219
|
+
Common overlay concepts across components:
|
|
220
|
+
- `portal`
|
|
221
|
+
- `overlayLayer`
|
|
222
|
+
- `backdrop`
|
|
223
|
+
- outside-click closing rules
|
|
224
|
+
- popup vs modal-like mount containers
|
|
225
|
+
|
|
226
|
+
`lui-popover` is the main floating primitive.
|
|
227
|
+
These build on or align with popover behavior:
|
|
228
|
+
- `lui-tooltip`
|
|
229
|
+
- `lui-dropdown`
|
|
230
|
+
- parts of `lui-dropmenu`
|
|
231
|
+
|
|
232
|
+
Dialog / drawer / toast / context menu use related overlay infrastructure too.
|
|
233
|
+
|
|
234
|
+
### 7.2 Config provider
|
|
235
|
+
`lui-config-provider` is the global config boundary.
|
|
236
|
+
It can provide:
|
|
237
|
+
- locale
|
|
238
|
+
- translations
|
|
239
|
+
- theme
|
|
240
|
+
- size
|
|
241
|
+
- disabled
|
|
242
|
+
- variant
|
|
243
|
+
- direction
|
|
244
|
+
- popup container
|
|
245
|
+
- overlay container
|
|
246
|
+
- z-index base
|
|
247
|
+
- renderEmpty
|
|
248
|
+
- component defaults via `componentConfig`
|
|
249
|
+
|
|
250
|
+
Read:
|
|
251
|
+
- `src/components/lui-config-provider.ts`
|
|
252
|
+
- `src/utils/config-provider.ts`
|
|
253
|
+
|
|
254
|
+
### 7.3 Theming
|
|
255
|
+
The library relies heavily on CSS custom properties using `--lui-*` naming.
|
|
256
|
+
Shared design tokens live in `src/themes/`.
|
|
257
|
+
|
|
258
|
+
When editing visuals:
|
|
259
|
+
- verify light theme
|
|
260
|
+
- verify dark theme
|
|
261
|
+
- keep token-driven styling where possible
|
|
262
|
+
|
|
263
|
+
### 7.4 Storybook-first public understanding
|
|
264
|
+
In this repo, Storybook stories are high-value public API references.
|
|
265
|
+
Often the correct reading order for a component is:
|
|
266
|
+
1. component code
|
|
267
|
+
2. matching story
|
|
268
|
+
3. related utility / base primitive
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## 8. High-value components to understand deeply
|
|
273
|
+
|
|
274
|
+
### `lui-form`
|
|
275
|
+
Schema-driven dynamic form system.
|
|
276
|
+
Supports:
|
|
277
|
+
- field definitions
|
|
278
|
+
- validation
|
|
279
|
+
- custom render hooks
|
|
280
|
+
- steps
|
|
281
|
+
- complex layout
|
|
282
|
+
- array / repeatable structures
|
|
283
|
+
|
|
284
|
+
Best story:
|
|
285
|
+
- `stories/lui-form.stories.ts`
|
|
286
|
+
|
|
287
|
+
### `lui-table`
|
|
288
|
+
Rich data grid.
|
|
289
|
+
Supports:
|
|
290
|
+
- columns and data-driven configuration
|
|
291
|
+
- sorting
|
|
292
|
+
- selection
|
|
293
|
+
- pagination
|
|
294
|
+
- virtual scroll
|
|
295
|
+
- row animation
|
|
296
|
+
- column resize
|
|
297
|
+
- column reorder
|
|
298
|
+
- context menu integration
|
|
299
|
+
|
|
300
|
+
Best story:
|
|
301
|
+
- `stories/lui-table.stories.ts`
|
|
302
|
+
|
|
303
|
+
### `lui-tree`
|
|
304
|
+
Rich tree component.
|
|
305
|
+
Supports:
|
|
306
|
+
- expand/collapse
|
|
307
|
+
- single/multiple select
|
|
308
|
+
- checkbox cascade
|
|
309
|
+
- async loading
|
|
310
|
+
- search/filtering
|
|
311
|
+
- highlight
|
|
312
|
+
- drag and drop
|
|
313
|
+
- virtual scroll
|
|
314
|
+
- built-in context menu integration
|
|
315
|
+
|
|
316
|
+
Best story:
|
|
317
|
+
- `stories/lui-tree.stories.ts`
|
|
318
|
+
|
|
319
|
+
### `lui-image`
|
|
320
|
+
Image with richer UX than a plain `<img>`.
|
|
321
|
+
Supports:
|
|
322
|
+
- skeleton state
|
|
323
|
+
- error state
|
|
324
|
+
- preview viewer
|
|
325
|
+
- pan/zoom
|
|
326
|
+
- rotate
|
|
327
|
+
- download
|
|
328
|
+
|
|
329
|
+
Preferred modern events:
|
|
330
|
+
- `open`
|
|
331
|
+
- `close`
|
|
332
|
+
- `change`
|
|
333
|
+
|
|
334
|
+
### `lui-dialog` / `lui-drawer`
|
|
335
|
+
Modal-like overlays with portal/backdrop/outside-click behavior.
|
|
336
|
+
Need careful handling of:
|
|
337
|
+
- open/close
|
|
338
|
+
- backdrop style
|
|
339
|
+
- portal container
|
|
340
|
+
- shake / block outside close behavior
|
|
341
|
+
|
|
342
|
+
### `lui-dropdown` / `lui-dropmenu` / `lui-popover`
|
|
343
|
+
Floating layers with overlapping but distinct responsibilities.
|
|
344
|
+
Use stories to understand intended public differences.
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## 9. Read order for coding agents
|
|
349
|
+
|
|
350
|
+
For fast repo understanding, use this order:
|
|
351
|
+
1. `README.md`
|
|
352
|
+
2. `package.json`
|
|
353
|
+
3. `src/index.ts`
|
|
354
|
+
4. `llm.txt`
|
|
355
|
+
5. `llms.txt`
|
|
356
|
+
6. target `src/components/lui-*.ts`
|
|
357
|
+
7. matching `stories/lui-*.stories.ts`
|
|
358
|
+
8. related helpers in `src/utils/` or `src/apis/`
|
|
359
|
+
|
|
360
|
+
Recommended high-value stories:
|
|
361
|
+
- `stories/lui-api-conventions.stories.ts`
|
|
362
|
+
- `stories/lui-form.stories.ts`
|
|
363
|
+
- `stories/lui-table.stories.ts`
|
|
364
|
+
- `stories/lui-tree.stories.ts`
|
|
365
|
+
- `stories/lui-dialog.stories.ts`
|
|
366
|
+
- `stories/lui-dropdown.stories.ts`
|
|
367
|
+
- `stories/lui-image.stories.ts`
|
|
368
|
+
- `stories/lui-config-provider.stories.ts`
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
## 10. Build and validation commands
|
|
373
|
+
|
|
374
|
+
Preferred validation commands:
|
|
375
|
+
- `pnpm -s typecheck`
|
|
376
|
+
- `pnpm -s build`
|
|
377
|
+
- `pnpm -s build-storybook`
|
|
378
|
+
|
|
379
|
+
Other useful commands:
|
|
380
|
+
- `pnpm storybook`
|
|
381
|
+
- `pnpm example:music`
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
## 11. Working guidance for LLMs / coding agents
|
|
386
|
+
|
|
387
|
+
- Prefer small, reviewable edits.
|
|
388
|
+
- Preserve native-style event naming.
|
|
389
|
+
- Keep Storybook docs / controls aligned with code.
|
|
390
|
+
- When changing overlay behavior, consider:
|
|
391
|
+
- portal
|
|
392
|
+
- overlay layer
|
|
393
|
+
- backdrop
|
|
394
|
+
- outside click close rules
|
|
395
|
+
- mount container rules
|
|
396
|
+
- When changing table / tree / form behavior, inspect rich stories before editing.
|
|
397
|
+
- When changing visual styling, verify both light and dark themes.
|
|
398
|
+
- If unsure whether something is public, confirm it is exported from `src/index.ts`.
|
|
399
|
+
|
|
400
|
+
---
|
|
401
|
+
|
|
402
|
+
## 12. Files especially useful for orientation
|
|
403
|
+
|
|
404
|
+
- `README.md`
|
|
405
|
+
- `package.json`
|
|
406
|
+
- `src/index.ts`
|
|
407
|
+
- `src/components/lui-popover.ts`
|
|
408
|
+
- `src/components/lui-dialog.ts`
|
|
409
|
+
- `src/components/lui-form.ts`
|
|
410
|
+
- `src/components/lui-table.ts`
|
|
411
|
+
- `src/components/lui-tree.ts`
|
|
412
|
+
- `src/components/lui-config-provider.ts`
|
|
413
|
+
- `src/utils/config-provider.ts`
|
|
414
|
+
- `src/components/lui-overlay-root.ts`
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
## 13. Notes on documentation style
|
|
419
|
+
|
|
420
|
+
Current repo direction:
|
|
421
|
+
- stories are mostly Chinese-facing
|
|
422
|
+
- public descriptions should be concise and practical
|
|
423
|
+
- technical terms may remain in English when they are API names or established UI concepts
|
|
424
|
+
|
|
425
|
+
If adding docs, keep them:
|
|
426
|
+
- short
|
|
427
|
+
- user-facing
|
|
428
|
+
- synchronized with actual props and events
|
package/llms.txt
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# litui
|
|
2
|
+
|
|
3
|
+
> Lit Web Components UI library with Storybook docs, native-style DOM events, overlay infrastructure, schema-driven forms, rich table/tree components, and imperative APIs (`dialog`, `toast`, `form`, `showContextMenu`).
|
|
4
|
+
|
|
5
|
+
## Project Summary
|
|
6
|
+
|
|
7
|
+
- Package: `litui`
|
|
8
|
+
- Stack: Lit 3, TypeScript, Storybook 10, Vite, esbuild
|
|
9
|
+
- Style system: CSS custom properties with `--lui-*` tokens
|
|
10
|
+
- Public components use `lui-*` custom elements
|
|
11
|
+
- Public events prefer native-style names like `click`, `input`, `change`, `select`, `open`, `close`, `submit`, `clear`
|
|
12
|
+
- Public data-source naming is unified to `source`, including `lui-form` field schema
|
|
13
|
+
|
|
14
|
+
## Read First
|
|
15
|
+
|
|
16
|
+
- `README.md` — overview, install, usage, theming, API naming
|
|
17
|
+
- `package.json` — scripts, build outputs, dependencies
|
|
18
|
+
- `src/index.ts` — complete public export surface
|
|
19
|
+
- `llm.txt` — concise repo guide for coding agents
|
|
20
|
+
- `llms-full.txt` — expanded component and architecture guide
|
|
21
|
+
|
|
22
|
+
## High-Value Stories
|
|
23
|
+
|
|
24
|
+
- `stories/lui-api-conventions.stories.ts`
|
|
25
|
+
- `stories/lui-form.stories.ts`
|
|
26
|
+
- `stories/lui-table.stories.ts`
|
|
27
|
+
- `stories/lui-tree.stories.ts`
|
|
28
|
+
- `stories/lui-dialog.stories.ts`
|
|
29
|
+
- `stories/lui-dropdown.stories.ts`
|
|
30
|
+
- `stories/lui-image.stories.ts`
|
|
31
|
+
- `stories/lui-config-provider.stories.ts`
|
|
32
|
+
|
|
33
|
+
## Main Public APIs
|
|
34
|
+
|
|
35
|
+
### Components
|
|
36
|
+
- Foundation/display: `lui-button`, `lui-icon`, `lui-text`, `lui-card`, `lui-tag`, `lui-badge`, `lui-statistic`, `lui-avatar`, `lui-avatar-group`
|
|
37
|
+
- Navigation/layout: `lui-tab`, `lui-breadcrumb`, `lui-pagination`, `lui-row`, `lui-divider`, `lui-background`, `lui-scroll-area`
|
|
38
|
+
- Form: `lui-form`, `lui-form-item`, `lui-input`, `lui-input-number`, `lui-input-opt`, `lui-textarea`, `lui-select`, `lui-checkbox`, `lui-radio`, `lui-switch`, `lui-slider`, `lui-datepicker`, `lui-calendar`, `lui-date-range-picker`, `lui-file-input`, `lui-color-picker`
|
|
39
|
+
- Overlay/menu: `lui-popover`, `lui-tooltip`, `lui-dropdown`, `lui-dropmenu`, `lui-dialog`, `lui-drawer`, `lui-command-palette`, `lui-menu`, `lui-context-menu`
|
|
40
|
+
- Rich data/feedback: `lui-progress`, `lui-skeleton`, `lui-toast`, `lui-empty-state`, `lui-image`, `lui-image-cropper`, `lui-table`, `lui-tree`
|
|
41
|
+
|
|
42
|
+
### Imperative APIs
|
|
43
|
+
- `dialog`
|
|
44
|
+
- `toast`
|
|
45
|
+
- `form`
|
|
46
|
+
- `showContextMenu()`
|
|
47
|
+
- `createContextMenu()`
|
|
48
|
+
|
|
49
|
+
## Key Conventions
|
|
50
|
+
|
|
51
|
+
- Do not add legacy compatibility prop / event aliases back
|
|
52
|
+
- Keep Storybook props/controls/docs aligned with component code
|
|
53
|
+
- When changing visuals, verify both light and dark themes
|
|
54
|
+
- Overlay-related changes should consider `portal`, `overlayLayer`, `backdrop`, outside click behavior, and mount container rules
|
|
55
|
+
- If unsure whether an API is public, confirm it is exported from `src/index.ts`
|
|
56
|
+
|
|
57
|
+
## Validation Commands
|
|
58
|
+
|
|
59
|
+
- `pnpm -s typecheck`
|
|
60
|
+
- `pnpm -s build`
|
|
61
|
+
- `pnpm -s build-storybook`
|
package/package.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lituix",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Framework-agnostic UI components based on Lit Web Components",
|
|
5
|
+
"main": "./dist/index.cjs",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.cjs",
|
|
13
|
+
"default": "./dist/index.mjs"
|
|
14
|
+
},
|
|
15
|
+
"./styles": "./dist/index.browser.css",
|
|
16
|
+
"./browser": "./dist/index.browser.js"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"README.md",
|
|
21
|
+
"llm.txt",
|
|
22
|
+
"llms.txt",
|
|
23
|
+
"llms-full.txt"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build:esm": "cross-env BUILD_FORMAT=es node esbuild.config.js",
|
|
27
|
+
"build:cjs": "cross-env BUILD_FORMAT=cjs node esbuild.config.js",
|
|
28
|
+
"build:umd": "cross-env BUILD_FORMAT=umd node esbuild.config.js",
|
|
29
|
+
"build": "pnpm run build:types && pnpm run build:esm && pnpm run build:cjs && pnpm run build:umd",
|
|
30
|
+
"dev": "cross-env BUILD_FORMAT=es node esbuild.config.js --watch",
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
32
|
+
"storybook": "storybook dev --host 0.0.0.0 -p 6006 --no-open",
|
|
33
|
+
"build-storybook": "storybook build",
|
|
34
|
+
"build:types": "tsc -p tsconfig.build.json",
|
|
35
|
+
"pack:dry-run": "npm pack --dry-run",
|
|
36
|
+
"release:check": "pnpm typecheck && pnpm build && pnpm pack:dry-run",
|
|
37
|
+
"prepack": "pnpm build",
|
|
38
|
+
"prepublishOnly": "pnpm typecheck && pnpm build"
|
|
39
|
+
},
|
|
40
|
+
"keywords": [
|
|
41
|
+
"web-components",
|
|
42
|
+
"lit",
|
|
43
|
+
"ui-components",
|
|
44
|
+
"design-system"
|
|
45
|
+
],
|
|
46
|
+
"author": "ppnow",
|
|
47
|
+
"license": "MIT",
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@floating-ui/dom": "^1.7.6",
|
|
50
|
+
"@iconify-json/lucide": "^1.2.104",
|
|
51
|
+
"@lit-labs/virtualizer": "^2.0.13",
|
|
52
|
+
"@lit/context": "^1.1.5",
|
|
53
|
+
"@panzoom/panzoom": "^4.6.2",
|
|
54
|
+
"@tanstack/lit-form": "^1.23.28",
|
|
55
|
+
"cropperjs": "^2.1.1",
|
|
56
|
+
"flatpickr": "^4.6.13",
|
|
57
|
+
"iconify-icon": "^3.0.2",
|
|
58
|
+
"interactjs": "^1.10.27",
|
|
59
|
+
"just-debounce-it": "^3.2.0",
|
|
60
|
+
"lit": "^3.3.1"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@storybook/addon-docs": "^10.3.5",
|
|
64
|
+
"@storybook/addon-links": "^10.3.5",
|
|
65
|
+
"@storybook/addon-themes": "^10.3.5",
|
|
66
|
+
"@storybook/web-components": "^10.3.5",
|
|
67
|
+
"@storybook/web-components-vite": "^10.3.5",
|
|
68
|
+
"@types/node": "^22.5.4",
|
|
69
|
+
"cross-env": "^7.0.3",
|
|
70
|
+
"esbuild": "^0.24.0",
|
|
71
|
+
"storybook": "^10.3.5",
|
|
72
|
+
"typescript": "^5.5.4",
|
|
73
|
+
"vite": "^6.4.2"
|
|
74
|
+
},
|
|
75
|
+
"pnpm": {
|
|
76
|
+
"onlyBuiltDependencies": [
|
|
77
|
+
"esbuild"
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"types": "./dist/index.d.ts",
|
|
81
|
+
"sideEffects": true,
|
|
82
|
+
"publishConfig": {
|
|
83
|
+
"access": "public"
|
|
84
|
+
}
|
|
85
|
+
}
|