backend-server-v2/codex-prompt/prompt-9.txt

34 lines
1.0 KiB
Plaintext

Crea /ui-kit come progetto Vite + Svelte per custom elements.
Requisiti:
- build deve scrivere direttamente in ../web/static/ui:
- ui.esm.js
- ui.css (tokens+base)
- src/index.ts registra:
- ui-modal
- ui-drop-down
- ui-data-table-shell (driver JS per aggiornare un target)
Componenti:
1) UiModal.svelte:
- <svelte:options customElement="ui-modal" />
- attributi: title, open (boolean presence)
- close on ESC, backdrop click
- focus trap minimale
- emette evento "ui:close" (bubbles+composed)
- slot contenuto (HTMX swappa dentro al tag)
2) UiDropDown.svelte:
- usa <option> del light DOM
- espone value/name/placeholder/disabled
- integra con form MVC (hidden input name=...)
- emette change + ui:change
3) UiDataTableShell.svelte:
- attributi: endpoint, target, page-size
- input search -> usa fetch('GET', url) e aggiorna il target
- non renderizza tabella, solo toolbar
Aggiorna layout per includere /static/ui/ui.css e /static/ui/ui.esm.js con ?v={{.BuildHash}}.
Aggiorna README con comandi npm.