dalila 1.7.5 → 1.7.6
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 +45 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,6 +65,10 @@ bind(document.getElementById('app')!, ctx);
|
|
|
65
65
|
|
|
66
66
|
- [Router](./docs/router.md) — Client-side routing with nested layouts, preloading, and file-based route generation
|
|
67
67
|
|
|
68
|
+
### UI Components
|
|
69
|
+
|
|
70
|
+
- [UI Components](./docs/ui.md) — Interactive components (Dialog, Drawer, Toast, Tabs, Calendar, etc.) with native HTML and full ARIA support
|
|
71
|
+
|
|
68
72
|
### Rendering
|
|
69
73
|
|
|
70
74
|
- [when](./docs/core/when.md) — Conditional visibility
|
|
@@ -236,6 +240,47 @@ async function handleSubmit(data, { signal }) {
|
|
|
236
240
|
</form>
|
|
237
241
|
```
|
|
238
242
|
|
|
243
|
+
### UI Components with Router
|
|
244
|
+
|
|
245
|
+
```ts
|
|
246
|
+
// page.ts
|
|
247
|
+
import { signal } from 'dalila';
|
|
248
|
+
import { createDialog, mountUI } from 'dalila/components/ui';
|
|
249
|
+
|
|
250
|
+
const dialog = createDialog();
|
|
251
|
+
|
|
252
|
+
export function loader() {
|
|
253
|
+
const count = signal(0);
|
|
254
|
+
|
|
255
|
+
return {
|
|
256
|
+
count,
|
|
257
|
+
increment: () => count.update(n => n + 1),
|
|
258
|
+
openDialog: () => dialog.show(),
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// Called after view is mounted
|
|
263
|
+
export function onMount(root: HTMLElement) {
|
|
264
|
+
mountUI(root, {
|
|
265
|
+
dialogs: { dialog }
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
```html
|
|
271
|
+
<!-- page.html -->
|
|
272
|
+
<d-button d-on-click="openDialog">Open Dialog</d-button>
|
|
273
|
+
|
|
274
|
+
<d-dialog d-ui="dialog">
|
|
275
|
+
<d-dialog-header>
|
|
276
|
+
<d-dialog-title>Count: {count}</d-dialog-title>
|
|
277
|
+
</d-dialog-header>
|
|
278
|
+
<d-dialog-body>
|
|
279
|
+
<d-button d-on-click="increment">Increment</d-button>
|
|
280
|
+
</d-dialog-body>
|
|
281
|
+
</d-dialog>
|
|
282
|
+
```
|
|
283
|
+
|
|
239
284
|
## Development
|
|
240
285
|
|
|
241
286
|
```bash
|