@vielzeug/buildit 2.0.0
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 +124 -0
- package/dist/accordion-item.cjs +32 -0
- package/dist/accordion-item.cjs.map +1 -0
- package/dist/accordion-item.js +72 -0
- package/dist/accordion-item.js.map +1 -0
- package/dist/accordion.cjs +2 -0
- package/dist/accordion.cjs.map +1 -0
- package/dist/accordion.js +37 -0
- package/dist/accordion.js.map +1 -0
- package/dist/alert.cjs +31 -0
- package/dist/alert.cjs.map +1 -0
- package/dist/alert.js +85 -0
- package/dist/alert.js.map +1 -0
- package/dist/avatar.cjs +37 -0
- package/dist/avatar.cjs.map +1 -0
- package/dist/avatar.js +123 -0
- package/dist/avatar.js.map +1 -0
- package/dist/badge.cjs +7 -0
- package/dist/badge.cjs.map +1 -0
- package/dist/badge.js +60 -0
- package/dist/badge.js.map +1 -0
- package/dist/box.cjs +2 -0
- package/dist/box.cjs.map +1 -0
- package/dist/box.js +22 -0
- package/dist/box.js.map +1 -0
- package/dist/breadcrumb.cjs +21 -0
- package/dist/breadcrumb.cjs.map +1 -0
- package/dist/breadcrumb.js +58 -0
- package/dist/breadcrumb.js.map +1 -0
- package/dist/buildit.cjs +1892 -0
- package/dist/buildit.cjs.map +1 -0
- package/dist/buildit.js +1892 -0
- package/dist/buildit.js.map +1 -0
- package/dist/button-group.cjs +6 -0
- package/dist/button-group.cjs.map +1 -0
- package/dist/button-group.js +31 -0
- package/dist/button-group.js.map +1 -0
- package/dist/button.cjs +30 -0
- package/dist/button.cjs.map +1 -0
- package/dist/button.js +115 -0
- package/dist/button.js.map +1 -0
- package/dist/card.cjs +23 -0
- package/dist/card.cjs.map +1 -0
- package/dist/card.js +99 -0
- package/dist/card.js.map +1 -0
- package/dist/checkbox-group.cjs +20 -0
- package/dist/checkbox-group.cjs.map +1 -0
- package/dist/checkbox-group.js +88 -0
- package/dist/checkbox-group.js.map +1 -0
- package/dist/checkbox.cjs +37 -0
- package/dist/checkbox.cjs.map +1 -0
- package/dist/checkbox.js +115 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/chip.cjs +56 -0
- package/dist/chip.cjs.map +1 -0
- package/dist/chip.js +140 -0
- package/dist/chip.js.map +1 -0
- package/dist/combobox.cjs +93 -0
- package/dist/combobox.cjs.map +1 -0
- package/dist/combobox.js +401 -0
- package/dist/combobox.js.map +1 -0
- package/dist/content/avatar/avatar-group.css?inline.cjs +2 -0
- package/dist/content/avatar/avatar-group.css?inline.cjs.map +1 -0
- package/dist/content/avatar/avatar-group.css?inline.js +6 -0
- package/dist/content/avatar/avatar-group.css?inline.js.map +1 -0
- package/dist/content/avatar/avatar.css?inline.cjs +2 -0
- package/dist/content/avatar/avatar.css?inline.cjs.map +1 -0
- package/dist/content/avatar/avatar.css?inline.js +6 -0
- package/dist/content/avatar/avatar.css?inline.js.map +1 -0
- package/dist/content/avatar/avatar.d.ts +78 -0
- package/dist/content/avatar/avatar.d.ts.map +1 -0
- package/dist/content/breadcrumb/breadcrumb-item.css?inline.cjs +2 -0
- package/dist/content/breadcrumb/breadcrumb-item.css?inline.cjs.map +1 -0
- package/dist/content/breadcrumb/breadcrumb-item.css?inline.js +6 -0
- package/dist/content/breadcrumb/breadcrumb-item.css?inline.js.map +1 -0
- package/dist/content/breadcrumb/breadcrumb.css?inline.cjs +2 -0
- package/dist/content/breadcrumb/breadcrumb.css?inline.cjs.map +1 -0
- package/dist/content/breadcrumb/breadcrumb.css?inline.js +6 -0
- package/dist/content/breadcrumb/breadcrumb.css?inline.js.map +1 -0
- package/dist/content/breadcrumb/breadcrumb.d.ts +36 -0
- package/dist/content/breadcrumb/breadcrumb.d.ts.map +1 -0
- package/dist/content/card/card.css?inline.cjs +2 -0
- package/dist/content/card/card.css?inline.cjs.map +1 -0
- package/dist/content/card/card.css?inline.js +6 -0
- package/dist/content/card/card.css?inline.js.map +1 -0
- package/dist/content/card/card.d.ts +66 -0
- package/dist/content/card/card.d.ts.map +1 -0
- package/dist/content/index.cjs +1 -0
- package/dist/content/index.d.ts +15 -0
- package/dist/content/index.d.ts.map +1 -0
- package/dist/content/index.js +7 -0
- package/dist/content/pagination/pagination.css?inline.cjs +2 -0
- package/dist/content/pagination/pagination.css?inline.cjs.map +1 -0
- package/dist/content/pagination/pagination.css?inline.js +6 -0
- package/dist/content/pagination/pagination.css?inline.js.map +1 -0
- package/dist/content/pagination/pagination.d.ts +56 -0
- package/dist/content/pagination/pagination.d.ts.map +1 -0
- package/dist/content/separator/separator.css?inline.cjs +2 -0
- package/dist/content/separator/separator.css?inline.cjs.map +1 -0
- package/dist/content/separator/separator.css?inline.js +6 -0
- package/dist/content/separator/separator.css?inline.js.map +1 -0
- package/dist/content/separator/separator.d.ts +35 -0
- package/dist/content/separator/separator.d.ts.map +1 -0
- package/dist/content/table/table.css?inline.cjs +2 -0
- package/dist/content/table/table.css?inline.cjs.map +1 -0
- package/dist/content/table/table.css?inline.js +6 -0
- package/dist/content/table/table.css?inline.js.map +1 -0
- package/dist/content/table/table.d.ts +69 -0
- package/dist/content/table/table.d.ts.map +1 -0
- package/dist/content/text/text.css?inline.cjs +2 -0
- package/dist/content/text/text.css?inline.cjs.map +1 -0
- package/dist/content/text/text.css?inline.js +6 -0
- package/dist/content/text/text.css?inline.js.map +1 -0
- package/dist/content/text/text.d.ts +55 -0
- package/dist/content/text/text.d.ts.map +1 -0
- package/dist/craftit/dist/core/internal.cjs +2 -0
- package/dist/craftit/dist/core/internal.cjs.map +1 -0
- package/dist/craftit/dist/core/internal.js +25 -0
- package/dist/craftit/dist/core/internal.js.map +1 -0
- package/dist/craftit/dist/core/runtime-bindings.cjs +2 -0
- package/dist/craftit/dist/core/runtime-bindings.cjs.map +1 -0
- package/dist/craftit/dist/core/runtime-bindings.js +38 -0
- package/dist/craftit/dist/core/runtime-bindings.js.map +1 -0
- package/dist/craftit/dist/core/runtime-lifecycle.cjs +2 -0
- package/dist/craftit/dist/core/runtime-lifecycle.cjs.map +1 -0
- package/dist/craftit/dist/core/runtime-lifecycle.js +68 -0
- package/dist/craftit/dist/core/runtime-lifecycle.js.map +1 -0
- package/dist/craftit/dist/core/runtime.cjs +1 -0
- package/dist/craftit/dist/core/runtime.js +2 -0
- package/dist/craftit/dist/core/utilities.cjs +2 -0
- package/dist/craftit/dist/core/utilities.cjs.map +1 -0
- package/dist/craftit/dist/core/utilities.js +12 -0
- package/dist/craftit/dist/core/utilities.js.map +1 -0
- package/dist/craftit/dist/directives/attr.cjs +2 -0
- package/dist/craftit/dist/directives/attr.cjs.map +1 -0
- package/dist/craftit/dist/directives/attr.js +13 -0
- package/dist/craftit/dist/directives/attr.js.map +1 -0
- package/dist/craftit/dist/directives/bind.cjs +1 -0
- package/dist/craftit/dist/directives/bind.js +3 -0
- package/dist/craftit/dist/directives/choose.cjs +1 -0
- package/dist/craftit/dist/directives/choose.js +1 -0
- package/dist/craftit/dist/directives/classes.cjs +2 -0
- package/dist/craftit/dist/directives/classes.cjs.map +1 -0
- package/dist/craftit/dist/directives/classes.js +12 -0
- package/dist/craftit/dist/directives/classes.js.map +1 -0
- package/dist/craftit/dist/directives/each.cjs +2 -0
- package/dist/craftit/dist/directives/each.cjs.map +1 -0
- package/dist/craftit/dist/directives/each.js +96 -0
- package/dist/craftit/dist/directives/each.js.map +1 -0
- package/dist/craftit/dist/directives/index.cjs +1 -0
- package/dist/craftit/dist/directives/index.js +12 -0
- package/dist/craftit/dist/directives/match.cjs +1 -0
- package/dist/craftit/dist/directives/match.js +1 -0
- package/dist/craftit/dist/directives/memo.cjs +1 -0
- package/dist/craftit/dist/directives/memo.js +1 -0
- package/dist/craftit/dist/directives/raw.cjs +1 -0
- package/dist/craftit/dist/directives/raw.js +2 -0
- package/dist/craftit/dist/directives/spread.cjs +2 -0
- package/dist/craftit/dist/directives/spread.cjs.map +1 -0
- package/dist/craftit/dist/directives/spread.js +30 -0
- package/dist/craftit/dist/directives/spread.js.map +1 -0
- package/dist/craftit/dist/directives/style.cjs +1 -0
- package/dist/craftit/dist/directives/style.js +1 -0
- package/dist/craftit/dist/directives/until.cjs +1 -0
- package/dist/craftit/dist/directives/until.js +1 -0
- package/dist/craftit/dist/directives/when.cjs +2 -0
- package/dist/craftit/dist/directives/when.cjs.map +1 -0
- package/dist/craftit/dist/directives/when.js +14 -0
- package/dist/craftit/dist/directives/when.js.map +1 -0
- package/dist/craftit/dist/labs/a11y.cjs +2 -0
- package/dist/craftit/dist/labs/a11y.cjs.map +1 -0
- package/dist/craftit/dist/labs/a11y.js +38 -0
- package/dist/craftit/dist/labs/a11y.js.map +1 -0
- package/dist/craftit/dist/labs/list.cjs +2 -0
- package/dist/craftit/dist/labs/list.cjs.map +1 -0
- package/dist/craftit/dist/labs/list.js +87 -0
- package/dist/craftit/dist/labs/list.js.map +1 -0
- package/dist/craftit/dist/labs/observers.cjs +2 -0
- package/dist/craftit/dist/labs/observers.cjs.map +1 -0
- package/dist/craftit/dist/labs/observers.js +28 -0
- package/dist/craftit/dist/labs/observers.js.map +1 -0
- package/dist/craftit/dist/labs/overlay.cjs +2 -0
- package/dist/craftit/dist/labs/overlay.cjs.map +1 -0
- package/dist/craftit/dist/labs/overlay.js +49 -0
- package/dist/craftit/dist/labs/overlay.js.map +1 -0
- package/dist/craftit/dist/labs/selectable.cjs +2 -0
- package/dist/craftit/dist/labs/selectable.cjs.map +1 -0
- package/dist/craftit/dist/labs/selectable.js +29 -0
- package/dist/craftit/dist/labs/selectable.js.map +1 -0
- package/dist/craftit/dist/labs/selection.cjs +2 -0
- package/dist/craftit/dist/labs/selection.cjs.map +1 -0
- package/dist/craftit/dist/labs/selection.js +42 -0
- package/dist/craftit/dist/labs/selection.js.map +1 -0
- package/dist/craftit/dist/labs.cjs +1 -0
- package/dist/craftit/dist/labs.js +6 -0
- package/dist/custom-elements.json +2321 -0
- package/dist/dialog.cjs +33 -0
- package/dist/dialog.cjs.map +1 -0
- package/dist/dialog.js +94 -0
- package/dist/dialog.js.map +1 -0
- package/dist/disclosure/accordion/accordion.css?inline.cjs +2 -0
- package/dist/disclosure/accordion/accordion.css?inline.cjs.map +1 -0
- package/dist/disclosure/accordion/accordion.css?inline.js +6 -0
- package/dist/disclosure/accordion/accordion.css?inline.js.map +1 -0
- package/dist/disclosure/accordion/accordion.d.ts +47 -0
- package/dist/disclosure/accordion/accordion.d.ts.map +1 -0
- package/dist/disclosure/accordion-item/accordion-item.css?inline.cjs +2 -0
- package/dist/disclosure/accordion-item/accordion-item.css?inline.cjs.map +1 -0
- package/dist/disclosure/accordion-item/accordion-item.css?inline.js +6 -0
- package/dist/disclosure/accordion-item/accordion-item.css?inline.js.map +1 -0
- package/dist/disclosure/accordion-item/accordion-item.d.ts +62 -0
- package/dist/disclosure/accordion-item/accordion-item.d.ts.map +1 -0
- package/dist/disclosure/index.cjs +1 -0
- package/dist/disclosure/index.d.ts +11 -0
- package/dist/disclosure/index.d.ts.map +1 -0
- package/dist/disclosure/index.js +5 -0
- package/dist/disclosure/tab-item/tab-item.css?inline.cjs +2 -0
- package/dist/disclosure/tab-item/tab-item.css?inline.cjs.map +1 -0
- package/dist/disclosure/tab-item/tab-item.css?inline.js +6 -0
- package/dist/disclosure/tab-item/tab-item.css?inline.js.map +1 -0
- package/dist/disclosure/tab-item/tab-item.d.ts +39 -0
- package/dist/disclosure/tab-item/tab-item.d.ts.map +1 -0
- package/dist/disclosure/tab-panel/tab-panel.css?inline.cjs +2 -0
- package/dist/disclosure/tab-panel/tab-panel.css?inline.cjs.map +1 -0
- package/dist/disclosure/tab-panel/tab-panel.css?inline.js +6 -0
- package/dist/disclosure/tab-panel/tab-panel.css?inline.js.map +1 -0
- package/dist/disclosure/tab-panel/tab-panel.d.ts +30 -0
- package/dist/disclosure/tab-panel/tab-panel.d.ts.map +1 -0
- package/dist/disclosure/tabs/tabs.css?inline.cjs +2 -0
- package/dist/disclosure/tabs/tabs.css?inline.cjs.map +1 -0
- package/dist/disclosure/tabs/tabs.css?inline.js +6 -0
- package/dist/disclosure/tabs/tabs.css?inline.js.map +1 -0
- package/dist/disclosure/tabs/tabs.d.ts +64 -0
- package/dist/disclosure/tabs/tabs.d.ts.map +1 -0
- package/dist/drawer.cjs +31 -0
- package/dist/drawer.cjs.map +1 -0
- package/dist/drawer.js +98 -0
- package/dist/drawer.js.map +1 -0
- package/dist/feedback/alert/alert.css?inline.cjs +2 -0
- package/dist/feedback/alert/alert.css?inline.cjs.map +1 -0
- package/dist/feedback/alert/alert.css?inline.js +6 -0
- package/dist/feedback/alert/alert.css?inline.js.map +1 -0
- package/dist/feedback/alert/alert.d.ts +63 -0
- package/dist/feedback/alert/alert.d.ts.map +1 -0
- package/dist/feedback/badge/badge.css?inline.cjs +2 -0
- package/dist/feedback/badge/badge.css?inline.cjs.map +1 -0
- package/dist/feedback/badge/badge.css?inline.js +6 -0
- package/dist/feedback/badge/badge.css?inline.js.map +1 -0
- package/dist/feedback/badge/badge.d.ts +67 -0
- package/dist/feedback/badge/badge.d.ts.map +1 -0
- package/dist/feedback/chip/chip.css?inline.cjs +2 -0
- package/dist/feedback/chip/chip.css?inline.cjs.map +1 -0
- package/dist/feedback/chip/chip.css?inline.js +6 -0
- package/dist/feedback/chip/chip.css?inline.js.map +1 -0
- package/dist/feedback/chip/chip.d.ts +124 -0
- package/dist/feedback/chip/chip.d.ts.map +1 -0
- package/dist/feedback/index.cjs +1 -0
- package/dist/feedback/index.d.ts +13 -0
- package/dist/feedback/index.d.ts.map +1 -0
- package/dist/feedback/index.js +6 -0
- package/dist/feedback/progress/progress.css?inline.cjs +2 -0
- package/dist/feedback/progress/progress.css?inline.cjs.map +1 -0
- package/dist/feedback/progress/progress.css?inline.js +6 -0
- package/dist/feedback/progress/progress.css?inline.js.map +1 -0
- package/dist/feedback/progress/progress.d.ts +64 -0
- package/dist/feedback/progress/progress.d.ts.map +1 -0
- package/dist/feedback/skeleton/skeleton.css?inline.cjs +2 -0
- package/dist/feedback/skeleton/skeleton.css?inline.cjs.map +1 -0
- package/dist/feedback/skeleton/skeleton.css?inline.js +6 -0
- package/dist/feedback/skeleton/skeleton.css?inline.js.map +1 -0
- package/dist/feedback/skeleton/skeleton.d.ts +61 -0
- package/dist/feedback/skeleton/skeleton.d.ts.map +1 -0
- package/dist/feedback/toast/index.d.ts +2 -0
- package/dist/feedback/toast/index.d.ts.map +1 -0
- package/dist/feedback/toast/toast.css?inline.cjs +2 -0
- package/dist/feedback/toast/toast.css?inline.cjs.map +1 -0
- package/dist/feedback/toast/toast.css?inline.js +6 -0
- package/dist/feedback/toast/toast.css?inline.js.map +1 -0
- package/dist/feedback/toast/toast.d.ts +95 -0
- package/dist/feedback/toast/toast.d.ts.map +1 -0
- package/dist/file-input.cjs +66 -0
- package/dist/file-input.cjs.map +1 -0
- package/dist/file-input.js +210 -0
- package/dist/file-input.js.map +1 -0
- package/dist/form.cjs +11 -0
- package/dist/form.cjs.map +1 -0
- package/dist/form.js +49 -0
- package/dist/form.js.map +1 -0
- package/dist/grid-item.cjs +2 -0
- package/dist/grid-item.cjs.map +1 -0
- package/dist/grid-item.js +28 -0
- package/dist/grid-item.js.map +1 -0
- package/dist/grid.cjs +2 -0
- package/dist/grid.cjs.map +1 -0
- package/dist/grid.js +90 -0
- package/dist/grid.js.map +1 -0
- package/dist/icons.cjs +176 -0
- package/dist/icons.cjs.map +1 -0
- package/dist/icons.d.ts +15 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +181 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +53 -0
- package/dist/input.cjs +48 -0
- package/dist/input.cjs.map +1 -0
- package/dist/input.js +182 -0
- package/dist/input.js.map +1 -0
- package/dist/inputs/button/button.css?inline.cjs +2 -0
- package/dist/inputs/button/button.css?inline.cjs.map +1 -0
- package/dist/inputs/button/button.css?inline.js +6 -0
- package/dist/inputs/button/button.css?inline.js.map +1 -0
- package/dist/inputs/button/button.d.ts +73 -0
- package/dist/inputs/button/button.d.ts.map +1 -0
- package/dist/inputs/button-group/button-group.css?inline.cjs +2 -0
- package/dist/inputs/button-group/button-group.css?inline.cjs.map +1 -0
- package/dist/inputs/button-group/button-group.css?inline.js +6 -0
- package/dist/inputs/button-group/button-group.css?inline.js.map +1 -0
- package/dist/inputs/button-group/button-group.d.ts +52 -0
- package/dist/inputs/button-group/button-group.d.ts.map +1 -0
- package/dist/inputs/checkbox/checkbox.css?inline.cjs +2 -0
- package/dist/inputs/checkbox/checkbox.css?inline.cjs.map +1 -0
- package/dist/inputs/checkbox/checkbox.css?inline.js +6 -0
- package/dist/inputs/checkbox/checkbox.css?inline.js.map +1 -0
- package/dist/inputs/checkbox/checkbox.d.ts +43 -0
- package/dist/inputs/checkbox/checkbox.d.ts.map +1 -0
- package/dist/inputs/checkbox-group/checkbox-group.css?inline.cjs +2 -0
- package/dist/inputs/checkbox-group/checkbox-group.css?inline.cjs.map +1 -0
- package/dist/inputs/checkbox-group/checkbox-group.css?inline.js +6 -0
- package/dist/inputs/checkbox-group/checkbox-group.css?inline.js.map +1 -0
- package/dist/inputs/checkbox-group/checkbox-group.d.ts +56 -0
- package/dist/inputs/checkbox-group/checkbox-group.d.ts.map +1 -0
- package/dist/inputs/combobox/combobox-options.cjs +2 -0
- package/dist/inputs/combobox/combobox-options.cjs.map +1 -0
- package/dist/inputs/combobox/combobox-options.d.ts +7 -0
- package/dist/inputs/combobox/combobox-options.d.ts.map +1 -0
- package/dist/inputs/combobox/combobox-options.js +36 -0
- package/dist/inputs/combobox/combobox-options.js.map +1 -0
- package/dist/inputs/combobox/combobox-virtualizer.cjs +2 -0
- package/dist/inputs/combobox/combobox-virtualizer.cjs.map +1 -0
- package/dist/inputs/combobox/combobox-virtualizer.d.ts +20 -0
- package/dist/inputs/combobox/combobox-virtualizer.d.ts.map +1 -0
- package/dist/inputs/combobox/combobox-virtualizer.js +71 -0
- package/dist/inputs/combobox/combobox-virtualizer.js.map +1 -0
- package/dist/inputs/combobox/combobox.css?inline.cjs +2 -0
- package/dist/inputs/combobox/combobox.css?inline.cjs.map +1 -0
- package/dist/inputs/combobox/combobox.css?inline.js +6 -0
- package/dist/inputs/combobox/combobox.css?inline.js.map +1 -0
- package/dist/inputs/combobox/combobox.d.ts +28 -0
- package/dist/inputs/combobox/combobox.d.ts.map +1 -0
- package/dist/inputs/combobox/combobox.types.d.ts +36 -0
- package/dist/inputs/combobox/combobox.types.d.ts.map +1 -0
- package/dist/inputs/file-input/file-input.css?inline.cjs +2 -0
- package/dist/inputs/file-input/file-input.css?inline.cjs.map +1 -0
- package/dist/inputs/file-input/file-input.css?inline.js +6 -0
- package/dist/inputs/file-input/file-input.css?inline.js.map +1 -0
- package/dist/inputs/file-input/file-input.d.ts +94 -0
- package/dist/inputs/file-input/file-input.d.ts.map +1 -0
- package/dist/inputs/form/form.css?inline.cjs +2 -0
- package/dist/inputs/form/form.css?inline.cjs.map +1 -0
- package/dist/inputs/form/form.css?inline.js +6 -0
- package/dist/inputs/form/form.css?inline.js.map +1 -0
- package/dist/inputs/form/form.d.ts +61 -0
- package/dist/inputs/form/form.d.ts.map +1 -0
- package/dist/inputs/index.cjs +1 -0
- package/dist/inputs/index.d.ts +38 -0
- package/dist/inputs/index.d.ts.map +1 -0
- package/dist/inputs/index.js +18 -0
- package/dist/inputs/input/input.css?inline.cjs +2 -0
- package/dist/inputs/input/input.css?inline.cjs.map +1 -0
- package/dist/inputs/input/input.css?inline.js +6 -0
- package/dist/inputs/input/input.css?inline.js.map +1 -0
- package/dist/inputs/input/input.d.ts +82 -0
- package/dist/inputs/input/input.d.ts.map +1 -0
- package/dist/inputs/number-input/number-input.css?inline.cjs +2 -0
- package/dist/inputs/number-input/number-input.css?inline.cjs.map +1 -0
- package/dist/inputs/number-input/number-input.css?inline.js +6 -0
- package/dist/inputs/number-input/number-input.css?inline.js.map +1 -0
- package/dist/inputs/number-input/number-input.d.ts +76 -0
- package/dist/inputs/number-input/number-input.d.ts.map +1 -0
- package/dist/inputs/otp-input/otp-input.css?inline.cjs +2 -0
- package/dist/inputs/otp-input/otp-input.css?inline.cjs.map +1 -0
- package/dist/inputs/otp-input/otp-input.css?inline.js +6 -0
- package/dist/inputs/otp-input/otp-input.css?inline.js.map +1 -0
- package/dist/inputs/otp-input/otp-input.d.ts +71 -0
- package/dist/inputs/otp-input/otp-input.d.ts.map +1 -0
- package/dist/inputs/radio/radio.css?inline.cjs +2 -0
- package/dist/inputs/radio/radio.css?inline.cjs.map +1 -0
- package/dist/inputs/radio/radio.css?inline.js +6 -0
- package/dist/inputs/radio/radio.css?inline.js.map +1 -0
- package/dist/inputs/radio/radio.d.ts +41 -0
- package/dist/inputs/radio/radio.d.ts.map +1 -0
- package/dist/inputs/radio-group/radio-group.css?inline.cjs +2 -0
- package/dist/inputs/radio-group/radio-group.css?inline.cjs.map +1 -0
- package/dist/inputs/radio-group/radio-group.css?inline.js +6 -0
- package/dist/inputs/radio-group/radio-group.css?inline.js.map +1 -0
- package/dist/inputs/radio-group/radio-group.d.ts +61 -0
- package/dist/inputs/radio-group/radio-group.d.ts.map +1 -0
- package/dist/inputs/rating/rating.css?inline.cjs +2 -0
- package/dist/inputs/rating/rating.css?inline.cjs.map +1 -0
- package/dist/inputs/rating/rating.css?inline.js +6 -0
- package/dist/inputs/rating/rating.css?inline.js.map +1 -0
- package/dist/inputs/rating/rating.d.ts +48 -0
- package/dist/inputs/rating/rating.d.ts.map +1 -0
- package/dist/inputs/select/select.css?inline.cjs +2 -0
- package/dist/inputs/select/select.css?inline.cjs.map +1 -0
- package/dist/inputs/select/select.css?inline.js +6 -0
- package/dist/inputs/select/select.css?inline.js.map +1 -0
- package/dist/inputs/select/select.d.ts +79 -0
- package/dist/inputs/select/select.d.ts.map +1 -0
- package/dist/inputs/shared/base-props.d.ts +39 -0
- package/dist/inputs/shared/base-props.d.ts.map +1 -0
- package/dist/inputs/shared/composables/index.cjs +1 -0
- package/dist/inputs/shared/composables/index.d.ts +3 -0
- package/dist/inputs/shared/composables/index.d.ts.map +1 -0
- package/dist/inputs/shared/composables/index.js +2 -0
- package/dist/inputs/shared/composables/use-text-field.cjs +2 -0
- package/dist/inputs/shared/composables/use-text-field.cjs.map +1 -0
- package/dist/inputs/shared/composables/use-text-field.d.ts +33 -0
- package/dist/inputs/shared/composables/use-text-field.d.ts.map +1 -0
- package/dist/inputs/shared/composables/use-text-field.js +41 -0
- package/dist/inputs/shared/composables/use-text-field.js.map +1 -0
- package/dist/inputs/shared/composables/use-toggle-field.cjs +2 -0
- package/dist/inputs/shared/composables/use-toggle-field.cjs.map +1 -0
- package/dist/inputs/shared/composables/use-toggle-field.d.ts +18 -0
- package/dist/inputs/shared/composables/use-toggle-field.d.ts.map +1 -0
- package/dist/inputs/shared/composables/use-toggle-field.js +26 -0
- package/dist/inputs/shared/composables/use-toggle-field.js.map +1 -0
- package/dist/inputs/shared/design-presets.cjs +2 -0
- package/dist/inputs/shared/design-presets.cjs.map +1 -0
- package/dist/inputs/shared/design-presets.d.ts +97 -0
- package/dist/inputs/shared/design-presets.d.ts.map +1 -0
- package/dist/inputs/shared/design-presets.js +92 -0
- package/dist/inputs/shared/design-presets.js.map +1 -0
- package/dist/inputs/shared/dom-sync/dropdown.cjs +2 -0
- package/dist/inputs/shared/dom-sync/dropdown.cjs.map +1 -0
- package/dist/inputs/shared/dom-sync/dropdown.d.ts +7 -0
- package/dist/inputs/shared/dom-sync/dropdown.d.ts.map +1 -0
- package/dist/inputs/shared/dom-sync/dropdown.js +30 -0
- package/dist/inputs/shared/dom-sync/dropdown.js.map +1 -0
- package/dist/inputs/shared/dom-sync/field-sync.cjs +2 -0
- package/dist/inputs/shared/dom-sync/field-sync.cjs.map +1 -0
- package/dist/inputs/shared/dom-sync/field-sync.d.ts +36 -0
- package/dist/inputs/shared/dom-sync/field-sync.d.ts.map +1 -0
- package/dist/inputs/shared/dom-sync/field-sync.js +37 -0
- package/dist/inputs/shared/dom-sync/field-sync.js.map +1 -0
- package/dist/inputs/shared/dom-sync/form-context.cjs +2 -0
- package/dist/inputs/shared/dom-sync/form-context.cjs.map +1 -0
- package/dist/inputs/shared/dom-sync/form-context.d.ts +18 -0
- package/dist/inputs/shared/dom-sync/form-context.d.ts.map +1 -0
- package/dist/inputs/shared/dom-sync/form-context.js +20 -0
- package/dist/inputs/shared/dom-sync/form-context.js.map +1 -0
- package/dist/inputs/shared/dom-sync/index.cjs +1 -0
- package/dist/inputs/shared/dom-sync/index.d.ts +5 -0
- package/dist/inputs/shared/dom-sync/index.d.ts.map +1 -0
- package/dist/inputs/shared/dom-sync/index.js +4 -0
- package/dist/inputs/shared/dom-sync/label-sync.cjs +2 -0
- package/dist/inputs/shared/dom-sync/label-sync.cjs.map +1 -0
- package/dist/inputs/shared/dom-sync/label-sync.d.ts +16 -0
- package/dist/inputs/shared/dom-sync/label-sync.d.ts.map +1 -0
- package/dist/inputs/shared/dom-sync/label-sync.js +12 -0
- package/dist/inputs/shared/dom-sync/label-sync.js.map +1 -0
- package/dist/inputs/shared/form-context.cjs +2 -0
- package/dist/inputs/shared/form-context.cjs.map +1 -0
- package/dist/inputs/shared/form-context.d.ts +19 -0
- package/dist/inputs/shared/form-context.d.ts.map +1 -0
- package/dist/inputs/shared/form-context.js +7 -0
- package/dist/inputs/shared/form-context.js.map +1 -0
- package/dist/inputs/shared/utils/assistive-text.cjs +2 -0
- package/dist/inputs/shared/utils/assistive-text.cjs.map +1 -0
- package/dist/inputs/shared/utils/assistive-text.d.ts +24 -0
- package/dist/inputs/shared/utils/assistive-text.d.ts.map +1 -0
- package/dist/inputs/shared/utils/assistive-text.js +37 -0
- package/dist/inputs/shared/utils/assistive-text.js.map +1 -0
- package/dist/inputs/shared/utils/choice-change.cjs +2 -0
- package/dist/inputs/shared/utils/choice-change.cjs.map +1 -0
- package/dist/inputs/shared/utils/choice-change.d.ts +8 -0
- package/dist/inputs/shared/utils/choice-change.d.ts.map +1 -0
- package/dist/inputs/shared/utils/choice-change.js +13 -0
- package/dist/inputs/shared/utils/choice-change.js.map +1 -0
- package/dist/inputs/shared/utils/controlled-csv.cjs +2 -0
- package/dist/inputs/shared/utils/controlled-csv.cjs.map +1 -0
- package/dist/inputs/shared/utils/controlled-csv.d.ts +8 -0
- package/dist/inputs/shared/utils/controlled-csv.d.ts.map +1 -0
- package/dist/inputs/shared/utils/controlled-csv.js +15 -0
- package/dist/inputs/shared/utils/controlled-csv.js.map +1 -0
- package/dist/inputs/shared/utils/field-values.cjs +2 -0
- package/dist/inputs/shared/utils/field-values.cjs.map +1 -0
- package/dist/inputs/shared/utils/field-values.d.ts +5 -0
- package/dist/inputs/shared/utils/field-values.d.ts.map +1 -0
- package/dist/inputs/shared/utils/field-values.js +13 -0
- package/dist/inputs/shared/utils/field-values.js.map +1 -0
- package/dist/inputs/shared/utils/index.d.ts +5 -0
- package/dist/inputs/shared/utils/index.d.ts.map +1 -0
- package/dist/inputs/shared/validation/index.cjs +2 -0
- package/dist/inputs/shared/validation/index.cjs.map +1 -0
- package/dist/inputs/shared/validation/index.d.ts +14 -0
- package/dist/inputs/shared/validation/index.d.ts.map +1 -0
- package/dist/inputs/shared/validation/index.js +13 -0
- package/dist/inputs/shared/validation/index.js.map +1 -0
- package/dist/inputs/slider/slider.css?inline.cjs +2 -0
- package/dist/inputs/slider/slider.css?inline.cjs.map +1 -0
- package/dist/inputs/slider/slider.css?inline.js +6 -0
- package/dist/inputs/slider/slider.css?inline.js.map +1 -0
- package/dist/inputs/slider/slider.d.ts +82 -0
- package/dist/inputs/slider/slider.d.ts.map +1 -0
- package/dist/inputs/switch/switch.css?inline.cjs +2 -0
- package/dist/inputs/switch/switch.css?inline.cjs.map +1 -0
- package/dist/inputs/switch/switch.css?inline.js +6 -0
- package/dist/inputs/switch/switch.css?inline.js.map +1 -0
- package/dist/inputs/switch/switch.d.ts +40 -0
- package/dist/inputs/switch/switch.d.ts.map +1 -0
- package/dist/inputs/textarea/textarea.css?inline.cjs +2 -0
- package/dist/inputs/textarea/textarea.css?inline.cjs.map +1 -0
- package/dist/inputs/textarea/textarea.css?inline.js +6 -0
- package/dist/inputs/textarea/textarea.css?inline.js.map +1 -0
- package/dist/inputs/textarea/textarea.d.ts +57 -0
- package/dist/inputs/textarea/textarea.d.ts.map +1 -0
- package/dist/layout/box/box.css?inline.cjs +2 -0
- package/dist/layout/box/box.css?inline.cjs.map +1 -0
- package/dist/layout/box/box.css?inline.js +6 -0
- package/dist/layout/box/box.css?inline.js.map +1 -0
- package/dist/layout/box/box.d.ts +52 -0
- package/dist/layout/box/box.d.ts.map +1 -0
- package/dist/layout/grid/grid.css?inline.cjs +2 -0
- package/dist/layout/grid/grid.css?inline.cjs.map +1 -0
- package/dist/layout/grid/grid.css?inline.js +6 -0
- package/dist/layout/grid/grid.css?inline.js.map +1 -0
- package/dist/layout/grid/grid.d.ts +105 -0
- package/dist/layout/grid/grid.d.ts.map +1 -0
- package/dist/layout/grid-item/grid-item.css?inline.cjs +2 -0
- package/dist/layout/grid-item/grid-item.css?inline.cjs.map +1 -0
- package/dist/layout/grid-item/grid-item.css?inline.js +6 -0
- package/dist/layout/grid-item/grid-item.css?inline.js.map +1 -0
- package/dist/layout/grid-item/grid-item.d.ts +47 -0
- package/dist/layout/grid-item/grid-item.d.ts.map +1 -0
- package/dist/layout/index.cjs +1 -0
- package/dist/layout/index.d.ts +9 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.js +4 -0
- package/dist/layout/sidebar/sidebar-group.css?inline.cjs +2 -0
- package/dist/layout/sidebar/sidebar-group.css?inline.cjs.map +1 -0
- package/dist/layout/sidebar/sidebar-group.css?inline.js +6 -0
- package/dist/layout/sidebar/sidebar-group.css?inline.js.map +1 -0
- package/dist/layout/sidebar/sidebar-item.css?inline.cjs +2 -0
- package/dist/layout/sidebar/sidebar-item.css?inline.cjs.map +1 -0
- package/dist/layout/sidebar/sidebar-item.css?inline.js +6 -0
- package/dist/layout/sidebar/sidebar-item.css?inline.js.map +1 -0
- package/dist/layout/sidebar/sidebar.css?inline.cjs +2 -0
- package/dist/layout/sidebar/sidebar.css?inline.cjs.map +1 -0
- package/dist/layout/sidebar/sidebar.css?inline.js +6 -0
- package/dist/layout/sidebar/sidebar.css?inline.js.map +1 -0
- package/dist/layout/sidebar/sidebar.d.ts +190 -0
- package/dist/layout/sidebar/sidebar.d.ts.map +1 -0
- package/dist/menu.cjs +133 -0
- package/dist/menu.cjs.map +1 -0
- package/dist/menu.js +296 -0
- package/dist/menu.js.map +1 -0
- package/dist/number-input.cjs +55 -0
- package/dist/number-input.cjs.map +1 -0
- package/dist/number-input.js +158 -0
- package/dist/number-input.js.map +1 -0
- package/dist/otp-input.cjs +22 -0
- package/dist/otp-input.cjs.map +1 -0
- package/dist/otp-input.js +120 -0
- package/dist/otp-input.js.map +1 -0
- package/dist/overlay/dialog/dialog.css?inline.cjs +2 -0
- package/dist/overlay/dialog/dialog.css?inline.cjs.map +1 -0
- package/dist/overlay/dialog/dialog.css?inline.js +6 -0
- package/dist/overlay/dialog/dialog.css?inline.js.map +1 -0
- package/dist/overlay/dialog/dialog.d.ts +98 -0
- package/dist/overlay/dialog/dialog.d.ts.map +1 -0
- package/dist/overlay/drawer/drawer.css?inline.cjs +2 -0
- package/dist/overlay/drawer/drawer.css?inline.cjs.map +1 -0
- package/dist/overlay/drawer/drawer.css?inline.js +6 -0
- package/dist/overlay/drawer/drawer.css?inline.js.map +1 -0
- package/dist/overlay/drawer/drawer.d.ts +98 -0
- package/dist/overlay/drawer/drawer.d.ts.map +1 -0
- package/dist/overlay/index.cjs +1 -0
- package/dist/overlay/index.d.ts +11 -0
- package/dist/overlay/index.d.ts.map +1 -0
- package/dist/overlay/index.js +5 -0
- package/dist/overlay/menu/menu.css?inline.cjs +2 -0
- package/dist/overlay/menu/menu.css?inline.cjs.map +1 -0
- package/dist/overlay/menu/menu.css?inline.js +6 -0
- package/dist/overlay/menu/menu.css?inline.js.map +1 -0
- package/dist/overlay/menu/menu.d.ts +45 -0
- package/dist/overlay/menu/menu.d.ts.map +1 -0
- package/dist/overlay/popover/popover.css?inline.cjs +2 -0
- package/dist/overlay/popover/popover.css?inline.cjs.map +1 -0
- package/dist/overlay/popover/popover.css?inline.js +6 -0
- package/dist/overlay/popover/popover.css?inline.js.map +1 -0
- package/dist/overlay/popover/popover.d.ts +56 -0
- package/dist/overlay/popover/popover.d.ts.map +1 -0
- package/dist/overlay/tooltip/tooltip.css?inline.cjs +2 -0
- package/dist/overlay/tooltip/tooltip.css?inline.cjs.map +1 -0
- package/dist/overlay/tooltip/tooltip.css?inline.js +6 -0
- package/dist/overlay/tooltip/tooltip.css?inline.js.map +1 -0
- package/dist/overlay/tooltip/tooltip.d.ts +55 -0
- package/dist/overlay/tooltip/tooltip.d.ts.map +1 -0
- package/dist/pagination.cjs +102 -0
- package/dist/pagination.cjs.map +1 -0
- package/dist/pagination.js +168 -0
- package/dist/pagination.js.map +1 -0
- package/dist/popover.cjs +16 -0
- package/dist/popover.cjs.map +1 -0
- package/dist/popover.js +110 -0
- package/dist/popover.js.map +1 -0
- package/dist/progress.cjs +51 -0
- package/dist/progress.cjs.map +1 -0
- package/dist/progress.js +90 -0
- package/dist/progress.js.map +1 -0
- package/dist/radio-group.cjs +20 -0
- package/dist/radio-group.cjs.map +1 -0
- package/dist/radio-group.js +104 -0
- package/dist/radio-group.js.map +1 -0
- package/dist/radio.cjs +16 -0
- package/dist/radio.cjs.map +1 -0
- package/dist/radio.js +135 -0
- package/dist/radio.js.map +1 -0
- package/dist/rating.cjs +37 -0
- package/dist/rating.cjs.map +1 -0
- package/dist/rating.js +123 -0
- package/dist/rating.js.map +1 -0
- package/dist/select.cjs +77 -0
- package/dist/select.cjs.map +1 -0
- package/dist/select.js +317 -0
- package/dist/select.js.map +1 -0
- package/dist/separator.cjs +26 -0
- package/dist/separator.cjs.map +1 -0
- package/dist/separator.js +46 -0
- package/dist/separator.js.map +1 -0
- package/dist/sidebar.cjs +69 -0
- package/dist/sidebar.cjs.map +1 -0
- package/dist/sidebar.js +202 -0
- package/dist/sidebar.js.map +1 -0
- package/dist/skeleton.cjs +10 -0
- package/dist/skeleton.cjs.map +1 -0
- package/dist/skeleton.js +56 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/slider.cjs +24 -0
- package/dist/slider.cjs.map +1 -0
- package/dist/slider.js +209 -0
- package/dist/slider.js.map +1 -0
- package/dist/stateit/dist/computed.cjs +2 -0
- package/dist/stateit/dist/computed.cjs.map +1 -0
- package/dist/stateit/dist/computed.js +65 -0
- package/dist/stateit/dist/computed.js.map +1 -0
- package/dist/stateit/dist/effect.cjs +2 -0
- package/dist/stateit/dist/effect.cjs.map +1 -0
- package/dist/stateit/dist/effect.js +53 -0
- package/dist/stateit/dist/effect.js.map +1 -0
- package/dist/stateit/dist/index.cjs +1 -0
- package/dist/stateit/dist/index.js +5 -0
- package/dist/stateit/dist/runtime.cjs +2 -0
- package/dist/stateit/dist/runtime.cjs.map +1 -0
- package/dist/stateit/dist/runtime.js +43 -0
- package/dist/stateit/dist/runtime.js.map +1 -0
- package/dist/stateit/dist/signal.cjs +2 -0
- package/dist/stateit/dist/signal.cjs.map +1 -0
- package/dist/stateit/dist/signal.js +27 -0
- package/dist/stateit/dist/signal.js.map +1 -0
- package/dist/stateit/dist/store.cjs +2 -0
- package/dist/stateit/dist/store.cjs.map +1 -0
- package/dist/stateit/dist/store.js +17 -0
- package/dist/stateit/dist/store.js.map +1 -0
- package/dist/stateit/dist/types.cjs +2 -0
- package/dist/stateit/dist/types.cjs.map +1 -0
- package/dist/stateit/dist/types.js +6 -0
- package/dist/stateit/dist/types.js.map +1 -0
- package/dist/styles/animation.css +87 -0
- package/dist/styles/index.cjs +2 -0
- package/dist/styles/index.cjs.map +1 -0
- package/dist/styles/index.d.ts +48 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/styles/index.js +26 -0
- package/dist/styles/index.js.map +1 -0
- package/dist/styles/layer.css +18 -0
- package/dist/styles/mixins/accessibility.css.cjs +15 -0
- package/dist/styles/mixins/accessibility.css.cjs.map +1 -0
- package/dist/styles/mixins/accessibility.css.d.ts +46 -0
- package/dist/styles/mixins/accessibility.css.d.ts.map +1 -0
- package/dist/styles/mixins/accessibility.css.js +20 -0
- package/dist/styles/mixins/accessibility.css.js.map +1 -0
- package/dist/styles/mixins/animation.css.cjs +71 -0
- package/dist/styles/mixins/animation.css.cjs.map +1 -0
- package/dist/styles/mixins/animation.css.d.ts +22 -0
- package/dist/styles/mixins/animation.css.d.ts.map +1 -0
- package/dist/styles/mixins/animation.css.js +90 -0
- package/dist/styles/mixins/animation.css.js.map +1 -0
- package/dist/styles/mixins/shape.css.cjs +72 -0
- package/dist/styles/mixins/shape.css.cjs.map +1 -0
- package/dist/styles/mixins/shape.css.d.ts +97 -0
- package/dist/styles/mixins/shape.css.d.ts.map +1 -0
- package/dist/styles/mixins/shape.css.js +104 -0
- package/dist/styles/mixins/shape.css.js.map +1 -0
- package/dist/styles/mixins/states.css.cjs +18 -0
- package/dist/styles/mixins/states.css.cjs.map +1 -0
- package/dist/styles/mixins/states.css.d.ts +61 -0
- package/dist/styles/mixins/states.css.d.ts.map +1 -0
- package/dist/styles/mixins/states.css.js +26 -0
- package/dist/styles/mixins/states.css.js.map +1 -0
- package/dist/styles/mixins/theme.css.cjs +146 -0
- package/dist/styles/mixins/theme.css.cjs.map +1 -0
- package/dist/styles/mixins/theme.css.d.ts +93 -0
- package/dist/styles/mixins/theme.css.d.ts.map +1 -0
- package/dist/styles/mixins/theme.css.js +151 -0
- package/dist/styles/mixins/theme.css.js.map +1 -0
- package/dist/styles/mixins/variants.css.cjs +84 -0
- package/dist/styles/mixins/variants.css.cjs.map +1 -0
- package/dist/styles/mixins/variants.css.d.ts +22 -0
- package/dist/styles/mixins/variants.css.d.ts.map +1 -0
- package/dist/styles/mixins/variants.css.js +89 -0
- package/dist/styles/mixins/variants.css.js.map +1 -0
- package/dist/styles/preflight.css +237 -0
- package/dist/styles/styles.css +5 -0
- package/dist/styles/theme.css +457 -0
- package/dist/switch.cjs +16 -0
- package/dist/switch.cjs.map +1 -0
- package/dist/switch.js +82 -0
- package/dist/switch.js.map +1 -0
- package/dist/tab-item.cjs +17 -0
- package/dist/tab-item.cjs.map +1 -0
- package/dist/tab-item.js +57 -0
- package/dist/tab-item.js.map +1 -0
- package/dist/tab-panel.cjs +14 -0
- package/dist/tab-panel.cjs.map +1 -0
- package/dist/tab-panel.js +51 -0
- package/dist/tab-panel.js.map +1 -0
- package/dist/table.cjs +2 -0
- package/dist/table.cjs.map +1 -0
- package/dist/table.js +101 -0
- package/dist/table.js.map +1 -0
- package/dist/tabs.cjs +17 -0
- package/dist/tabs.cjs.map +1 -0
- package/dist/tabs.js +98 -0
- package/dist/tabs.js.map +1 -0
- package/dist/text.cjs +2 -0
- package/dist/text.cjs.map +1 -0
- package/dist/text.js +30 -0
- package/dist/text.js.map +1 -0
- package/dist/textarea.cjs +16 -0
- package/dist/textarea.cjs.map +1 -0
- package/dist/textarea.js +122 -0
- package/dist/textarea.js.map +1 -0
- package/dist/toast.cjs +63 -0
- package/dist/toast.cjs.map +1 -0
- package/dist/toast.js +221 -0
- package/dist/toast.js.map +1 -0
- package/dist/tooltip.cjs +15 -0
- package/dist/tooltip.cjs.map +1 -0
- package/dist/tooltip.js +111 -0
- package/dist/tooltip.js.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/shared.d.ts +120 -0
- package/dist/types/shared.d.ts.map +1 -0
- package/dist/utils/animation.cjs +2 -0
- package/dist/utils/animation.cjs.map +1 -0
- package/dist/utils/animation.d.ts +2 -0
- package/dist/utils/animation.d.ts.map +1 -0
- package/dist/utils/animation.js +29 -0
- package/dist/utils/animation.js.map +1 -0
- package/dist/utils/background-lock.cjs +2 -0
- package/dist/utils/background-lock.cjs.map +1 -0
- package/dist/utils/background-lock.d.ts +20 -0
- package/dist/utils/background-lock.d.ts.map +1 -0
- package/dist/utils/background-lock.js +21 -0
- package/dist/utils/background-lock.js.map +1 -0
- package/dist/utils/index.cjs +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/use-overlay.cjs +2 -0
- package/dist/utils/use-overlay.cjs.map +1 -0
- package/dist/utils/use-overlay.d.ts +26 -0
- package/dist/utils/use-overlay.d.ts.map +1 -0
- package/dist/utils/use-overlay.js +34 -0
- package/dist/utils/use-overlay.js.map +1 -0
- package/dist/virtualit/dist/dom/dom.cjs +2 -0
- package/dist/virtualit/dist/dom/dom.cjs.map +1 -0
- package/dist/virtualit/dist/dom/dom.js +47 -0
- package/dist/virtualit/dist/dom/dom.js.map +1 -0
- package/dist/virtualit/dist/dom.cjs +1 -0
- package/dist/virtualit/dist/dom.js +2 -0
- package/dist/virtualit/dist/virtualit.cjs +2 -0
- package/dist/virtualit/dist/virtualit.cjs.map +1 -0
- package/dist/virtualit/dist/virtualit.js +129 -0
- package/dist/virtualit/dist/virtualit.js.map +1 -0
- package/package.json +282 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=`@layer buildit.base{:host{--_position:var(--toast-position,fixed);--_inset-top:var(--toast-inset-top,auto);--_inset-bottom:var(--toast-inset-bottom,1rem);--_inset-right:var(--toast-inset-right,1rem);--_inset-left:var(--toast-inset-left,auto);--_z-index:var(--toast-z-index,9999);--_max-width:var(--toast-max-width,400px);--_gap:var(--toast-gap,.5rem);position:var(--_position);inset:var(--_inset-top) var(--_inset-right) var(--_inset-bottom) var(--_inset-left);z-index:var(--_z-index);gap:var(--_gap);max-width:var(--_max-width);pointer-events:none;flex-direction:column;display:flex}:host([position=top-left]){--_inset-top:1rem;--_inset-bottom:auto;--_inset-left:1rem;--_inset-right:auto}:host([position=top-center]){--_inset-top:1rem;--_inset-bottom:auto;--_inset-left:50%;--_inset-right:auto;transform:translate(-50%)}:host([position=top-right]){--_inset-top:1rem;--_inset-bottom:auto;--_inset-right:1rem;--_inset-left:auto}:host([position=bottom-left]){--_inset-bottom:1rem;--_inset-left:1rem;--_inset-right:auto;--_inset-top:auto}:host([position=bottom-center]){--_inset-bottom:1rem;--_inset-left:50%;--_inset-right:auto;--_inset-top:auto;transform:translate(-50%)}:host([position=bottom-right]){--_inset-bottom:1rem;--_inset-right:1rem;--_inset-left:auto;--_inset-top:auto}.toast-container{perspective:1200px;perspective-origin:50%;transition:var(--_motion-transition,row-gap var(--transition-normal,.35s) ease);grid-template-rows:1fr;grid-template-columns:1fr;row-gap:0;display:grid}.toast-live-region{display:contents}:host(.hovered) .toast-container{row-gap:var(--_gap)}:host(:not(.hovered)) .toast-wrapper{grid-area:1/1;align-self:end}:host([position^=top]:not(.hovered)) .toast-wrapper{align-self:start}.toast-wrapper{pointer-events:auto;transform-origin:bottom;transition:var(--_motion-transition,transform .5s cubic-bezier(.34, 1.1, .64, 1), opacity .5s cubic-bezier(.34, 1.1, .64, 1), filter .5s cubic-bezier(.34, 1.1, .64, 1));will-change:transform, opacity, filter;position:relative}@starting-style{.toast-wrapper{opacity:0;transform:translateY(1.5rem)scale(.92)}:host([position^=top]) .toast-wrapper{transform:translateY(-1.5rem)scale(.92)}}.toast-wrapper.exiting{pointer-events:none;animation:var(--_motion-animation,toast-exit .3s ease-out forwards);z-index:-1!important;transition:none!important}@keyframes toast-exit{to{opacity:0;transform:scale(.7)}}:host(:not(.hovered)) .toast-wrapper:last-child{z-index:3;opacity:1;filter:brightness();transform:translateY(0)scale(1)}:host(:not(.hovered)) .toast-wrapper:nth-last-child(2){z-index:2;pointer-events:none;opacity:.85;filter:brightness(.95);transform:translateY(-8px)scale(.95)rotateX(3deg)}:host(:not(.hovered)) .toast-wrapper:nth-last-child(3){z-index:1;pointer-events:none;opacity:.7;filter:brightness(.9);transform:translateY(-14px)scale(.9)rotateX(5deg)}:host(:not(.hovered)) .toast-wrapper:nth-last-child(n+4){pointer-events:none;opacity:0}:host(.hovered) .toast-wrapper{grid-area:auto/1;align-self:stretch;z-index:auto!important;pointer-events:auto!important;opacity:1!important;filter:brightness()!important;transform:none!important}:host(.hovered) .toast-wrapper:nth-last-child(2){transition-delay:50ms}:host(.hovered) .toast-wrapper:nth-last-child(3){transition-delay:.1s}:host(.hovered) .toast-wrapper:nth-last-child(n+4){transition-delay:.15s}:host([position^=top]) .toast-wrapper{transform-origin:top}:host([position^=top]:not(.hovered)) .toast-wrapper:nth-last-child(2){transform:translateY(8px)scale(.95)rotateX(-3deg)}:host([position^=top]:not(.hovered)) .toast-wrapper:nth-last-child(3){transform:translateY(14px)scale(.9)rotateX(-5deg)}::slotted(bit-alert){width:100%;box-shadow:var(--shadow-lg);margin:0}.toast-wrapper.exiting ::slotted(bit-alert){transition:none!important}.toast-actions{gap:var(--size-4);justify-content:flex-end;display:flex}@media (width<=480px){:host{--_max-width:calc(100vw - var(--size-4));--_inset-right:var(--size-2);--_inset-left:var(--size-2)}:host([position=top-center]){--_inset-left:var(--size-2);transform:none}:host([position=top-center]):not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:var(--size-2)}:host([position=top-center]):is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:var(--size-2)}:host([position=bottom-center]){--_inset-left:var(--size-2);transform:none}:host([position=bottom-center]):not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:var(--size-2)}:host([position=bottom-center]):is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:var(--size-2)}}}`;exports.default=e;
|
|
2
|
+
//# sourceMappingURL=toast.css?inline.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.css?inline.cjs","names":[],"sources":["../../../src/feedback/toast/toast.css?inline"],"sourcesContent":["@layer buildit.base {\n :host {\n --_position: var(--toast-position, fixed);\n --_inset-top: var(--toast-inset-top, auto);\n --_inset-bottom: var(--toast-inset-bottom, 1rem);\n --_inset-right: var(--toast-inset-right, 1rem);\n --_inset-left: var(--toast-inset-left, auto);\n --_z-index: var(--toast-z-index, 9999);\n --_max-width: var(--toast-max-width, 400px);\n --_gap: var(--toast-gap, 0.5rem);\n\n position: var(--_position);\n inset: var(--_inset-top) var(--_inset-right) var(--_inset-bottom) var(--_inset-left);\n z-index: var(--_z-index);\n display: flex;\n flex-direction: column;\n gap: var(--_gap);\n max-width: var(--_max-width);\n pointer-events: none;\n }\n\n /* Position variants */\n :host([position='top-left']) {\n --_inset-top: 1rem;\n --_inset-bottom: auto;\n --_inset-left: 1rem;\n --_inset-right: auto;\n }\n\n :host([position='top-center']) {\n --_inset-top: 1rem;\n --_inset-bottom: auto;\n --_inset-left: 50%;\n --_inset-right: auto;\n\n transform: translateX(-50%);\n }\n\n :host([position='top-right']) {\n --_inset-top: 1rem;\n --_inset-bottom: auto;\n --_inset-right: 1rem;\n --_inset-left: auto;\n }\n\n :host([position='bottom-left']) {\n --_inset-bottom: 1rem;\n --_inset-left: 1rem;\n --_inset-right: auto;\n --_inset-top: auto;\n }\n\n :host([position='bottom-center']) {\n --_inset-bottom: 1rem;\n --_inset-left: 50%;\n --_inset-right: auto;\n --_inset-top: auto;\n\n transform: translateX(-50%);\n }\n\n :host([position='bottom-right']) {\n --_inset-bottom: 1rem;\n --_inset-right: 1rem;\n --_inset-left: auto;\n --_inset-top: auto;\n }\n\n .toast-container {\n display: grid;\n grid-template-rows: 1fr;\n grid-template-columns: 1fr;\n row-gap: 0;\n perspective: 1200px;\n perspective-origin: center center;\n transition: var(--_motion-transition, row-gap var(--transition-normal, 0.35s) ease);\n }\n\n /* Keep ARIA live regions without affecting stacking layout geometry. */\n .toast-live-region {\n display: contents;\n }\n\n :host(.hovered) .toast-container {\n row-gap: var(--_gap);\n }\n\n :host(:not(.hovered)) .toast-wrapper {\n grid-row: 1;\n grid-column: 1;\n align-self: end;\n }\n\n :host([position^='top']:not(.hovered)) .toast-wrapper {\n align-self: start;\n }\n\n .toast-wrapper {\n position: relative;\n pointer-events: auto;\n transform-origin: center bottom;\n transition: var(\n --_motion-transition,\n transform 0.5s cubic-bezier(0.34, 1.1, 0.64, 1),\n opacity 0.5s cubic-bezier(0.34, 1.1, 0.64, 1),\n filter 0.5s cubic-bezier(0.34, 1.1, 0.64, 1)\n );\n will-change: transform, opacity, filter;\n }\n\n /* Enter animation via @starting-style — no JS class needed */\n @starting-style {\n .toast-wrapper {\n opacity: 0;\n transform: translateY(1.5rem) scale(0.92);\n }\n\n :host([position^='top']) .toast-wrapper {\n transform: translateY(-1.5rem) scale(0.92);\n }\n }\n\n /* Exit animation */\n .toast-wrapper.exiting {\n z-index: -1 !important;\n pointer-events: none;\n transition: none !important;\n animation: var(--_motion-animation, toast-exit 0.3s ease-out forwards);\n }\n\n @keyframes toast-exit {\n to {\n opacity: 0;\n transform: scale(0.7);\n }\n }\n\n /* Stacking (collapsed) */\n :host(:not(.hovered)) .toast-wrapper:nth-last-child(1) {\n z-index: 3;\n opacity: 1;\n filter: brightness(1);\n transform: translateY(0) scale(1);\n }\n\n :host(:not(.hovered)) .toast-wrapper:nth-last-child(2) {\n z-index: 2;\n pointer-events: none;\n opacity: 0.85;\n filter: brightness(0.95);\n transform: translateY(-8px) scale(0.95) rotateX(3deg);\n }\n\n :host(:not(.hovered)) .toast-wrapper:nth-last-child(3) {\n z-index: 1;\n pointer-events: none;\n opacity: 0.7;\n filter: brightness(0.9);\n transform: translateY(-14px) scale(0.9) rotateX(5deg);\n }\n\n :host(:not(.hovered)) .toast-wrapper:nth-last-child(n + 4) {\n pointer-events: none;\n opacity: 0;\n }\n\n /* Expanded (hovered) */\n :host(.hovered) .toast-wrapper {\n z-index: auto !important;\n grid-row: auto;\n grid-column: 1;\n align-self: stretch;\n pointer-events: auto !important;\n opacity: 1 !important;\n filter: brightness(1) !important;\n transform: none !important;\n }\n\n /* Staggered expand delays */\n :host(.hovered) .toast-wrapper:nth-last-child(2) {\n transition-delay: 0.05s;\n }\n\n :host(.hovered) .toast-wrapper:nth-last-child(3) {\n transition-delay: 0.1s;\n }\n\n :host(.hovered) .toast-wrapper:nth-last-child(n + 4) {\n transition-delay: 0.15s;\n }\n\n /* Top positions: reverse stacking direction */\n :host([position^='top']) .toast-wrapper {\n transform-origin: center top;\n }\n\n :host([position^='top']:not(.hovered)) .toast-wrapper:nth-last-child(2) {\n transform: translateY(8px) scale(0.95) rotateX(-3deg);\n }\n\n :host([position^='top']:not(.hovered)) .toast-wrapper:nth-last-child(3) {\n transform: translateY(14px) scale(0.9) rotateX(-5deg);\n }\n\n ::slotted(bit-alert) {\n width: 100%;\n margin: 0;\n box-shadow: var(--shadow-lg);\n }\n\n .toast-wrapper.exiting ::slotted(bit-alert) {\n transition: none !important;\n }\n\n .toast-actions {\n display: flex;\n gap: var(--size-4);\n justify-content: flex-end;\n }\n\n /* ========================================\n Responsive: small screens\n ======================================== */\n\n @media (width <= 480px) {\n :host {\n --_max-width: calc(100vw - var(--size-4));\n --_inset-right: var(--size-2);\n --_inset-left: var(--size-2);\n }\n\n :host([position='top-center']),\n :host([position='bottom-center']) {\n --_inset-left: var(--size-2);\n\n inset-inline-start: var(--size-2);\n transform: none;\n }\n }\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/feedback/toast/toast.css?inline
|
|
2
|
+
var e = "@layer buildit.base{:host{--_position:var(--toast-position,fixed);--_inset-top:var(--toast-inset-top,auto);--_inset-bottom:var(--toast-inset-bottom,1rem);--_inset-right:var(--toast-inset-right,1rem);--_inset-left:var(--toast-inset-left,auto);--_z-index:var(--toast-z-index,9999);--_max-width:var(--toast-max-width,400px);--_gap:var(--toast-gap,.5rem);position:var(--_position);inset:var(--_inset-top) var(--_inset-right) var(--_inset-bottom) var(--_inset-left);z-index:var(--_z-index);gap:var(--_gap);max-width:var(--_max-width);pointer-events:none;flex-direction:column;display:flex}:host([position=top-left]){--_inset-top:1rem;--_inset-bottom:auto;--_inset-left:1rem;--_inset-right:auto}:host([position=top-center]){--_inset-top:1rem;--_inset-bottom:auto;--_inset-left:50%;--_inset-right:auto;transform:translate(-50%)}:host([position=top-right]){--_inset-top:1rem;--_inset-bottom:auto;--_inset-right:1rem;--_inset-left:auto}:host([position=bottom-left]){--_inset-bottom:1rem;--_inset-left:1rem;--_inset-right:auto;--_inset-top:auto}:host([position=bottom-center]){--_inset-bottom:1rem;--_inset-left:50%;--_inset-right:auto;--_inset-top:auto;transform:translate(-50%)}:host([position=bottom-right]){--_inset-bottom:1rem;--_inset-right:1rem;--_inset-left:auto;--_inset-top:auto}.toast-container{perspective:1200px;perspective-origin:50%;transition:var(--_motion-transition,row-gap var(--transition-normal,.35s) ease);grid-template-rows:1fr;grid-template-columns:1fr;row-gap:0;display:grid}.toast-live-region{display:contents}:host(.hovered) .toast-container{row-gap:var(--_gap)}:host(:not(.hovered)) .toast-wrapper{grid-area:1/1;align-self:end}:host([position^=top]:not(.hovered)) .toast-wrapper{align-self:start}.toast-wrapper{pointer-events:auto;transform-origin:bottom;transition:var(--_motion-transition,transform .5s cubic-bezier(.34, 1.1, .64, 1), opacity .5s cubic-bezier(.34, 1.1, .64, 1), filter .5s cubic-bezier(.34, 1.1, .64, 1));will-change:transform, opacity, filter;position:relative}@starting-style{.toast-wrapper{opacity:0;transform:translateY(1.5rem)scale(.92)}:host([position^=top]) .toast-wrapper{transform:translateY(-1.5rem)scale(.92)}}.toast-wrapper.exiting{pointer-events:none;animation:var(--_motion-animation,toast-exit .3s ease-out forwards);z-index:-1!important;transition:none!important}@keyframes toast-exit{to{opacity:0;transform:scale(.7)}}:host(:not(.hovered)) .toast-wrapper:last-child{z-index:3;opacity:1;filter:brightness();transform:translateY(0)scale(1)}:host(:not(.hovered)) .toast-wrapper:nth-last-child(2){z-index:2;pointer-events:none;opacity:.85;filter:brightness(.95);transform:translateY(-8px)scale(.95)rotateX(3deg)}:host(:not(.hovered)) .toast-wrapper:nth-last-child(3){z-index:1;pointer-events:none;opacity:.7;filter:brightness(.9);transform:translateY(-14px)scale(.9)rotateX(5deg)}:host(:not(.hovered)) .toast-wrapper:nth-last-child(n+4){pointer-events:none;opacity:0}:host(.hovered) .toast-wrapper{grid-area:auto/1;align-self:stretch;z-index:auto!important;pointer-events:auto!important;opacity:1!important;filter:brightness()!important;transform:none!important}:host(.hovered) .toast-wrapper:nth-last-child(2){transition-delay:50ms}:host(.hovered) .toast-wrapper:nth-last-child(3){transition-delay:.1s}:host(.hovered) .toast-wrapper:nth-last-child(n+4){transition-delay:.15s}:host([position^=top]) .toast-wrapper{transform-origin:top}:host([position^=top]:not(.hovered)) .toast-wrapper:nth-last-child(2){transform:translateY(8px)scale(.95)rotateX(-3deg)}:host([position^=top]:not(.hovered)) .toast-wrapper:nth-last-child(3){transform:translateY(14px)scale(.9)rotateX(-5deg)}::slotted(bit-alert){width:100%;box-shadow:var(--shadow-lg);margin:0}.toast-wrapper.exiting ::slotted(bit-alert){transition:none!important}.toast-actions{gap:var(--size-4);justify-content:flex-end;display:flex}@media (width<=480px){:host{--_max-width:calc(100vw - var(--size-4));--_inset-right:var(--size-2);--_inset-left:var(--size-2)}:host([position=top-center]){--_inset-left:var(--size-2);transform:none}:host([position=top-center]):not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:var(--size-2)}:host([position=top-center]):is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:var(--size-2)}:host([position=bottom-center]){--_inset-left:var(--size-2);transform:none}:host([position=bottom-center]):not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:var(--size-2)}:host([position=bottom-center]):is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:var(--size-2)}}}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=toast.css?inline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.css?inline.js","names":[],"sources":["../../../src/feedback/toast/toast.css?inline"],"sourcesContent":["@layer buildit.base {\n :host {\n --_position: var(--toast-position, fixed);\n --_inset-top: var(--toast-inset-top, auto);\n --_inset-bottom: var(--toast-inset-bottom, 1rem);\n --_inset-right: var(--toast-inset-right, 1rem);\n --_inset-left: var(--toast-inset-left, auto);\n --_z-index: var(--toast-z-index, 9999);\n --_max-width: var(--toast-max-width, 400px);\n --_gap: var(--toast-gap, 0.5rem);\n\n position: var(--_position);\n inset: var(--_inset-top) var(--_inset-right) var(--_inset-bottom) var(--_inset-left);\n z-index: var(--_z-index);\n display: flex;\n flex-direction: column;\n gap: var(--_gap);\n max-width: var(--_max-width);\n pointer-events: none;\n }\n\n /* Position variants */\n :host([position='top-left']) {\n --_inset-top: 1rem;\n --_inset-bottom: auto;\n --_inset-left: 1rem;\n --_inset-right: auto;\n }\n\n :host([position='top-center']) {\n --_inset-top: 1rem;\n --_inset-bottom: auto;\n --_inset-left: 50%;\n --_inset-right: auto;\n\n transform: translateX(-50%);\n }\n\n :host([position='top-right']) {\n --_inset-top: 1rem;\n --_inset-bottom: auto;\n --_inset-right: 1rem;\n --_inset-left: auto;\n }\n\n :host([position='bottom-left']) {\n --_inset-bottom: 1rem;\n --_inset-left: 1rem;\n --_inset-right: auto;\n --_inset-top: auto;\n }\n\n :host([position='bottom-center']) {\n --_inset-bottom: 1rem;\n --_inset-left: 50%;\n --_inset-right: auto;\n --_inset-top: auto;\n\n transform: translateX(-50%);\n }\n\n :host([position='bottom-right']) {\n --_inset-bottom: 1rem;\n --_inset-right: 1rem;\n --_inset-left: auto;\n --_inset-top: auto;\n }\n\n .toast-container {\n display: grid;\n grid-template-rows: 1fr;\n grid-template-columns: 1fr;\n row-gap: 0;\n perspective: 1200px;\n perspective-origin: center center;\n transition: var(--_motion-transition, row-gap var(--transition-normal, 0.35s) ease);\n }\n\n /* Keep ARIA live regions without affecting stacking layout geometry. */\n .toast-live-region {\n display: contents;\n }\n\n :host(.hovered) .toast-container {\n row-gap: var(--_gap);\n }\n\n :host(:not(.hovered)) .toast-wrapper {\n grid-row: 1;\n grid-column: 1;\n align-self: end;\n }\n\n :host([position^='top']:not(.hovered)) .toast-wrapper {\n align-self: start;\n }\n\n .toast-wrapper {\n position: relative;\n pointer-events: auto;\n transform-origin: center bottom;\n transition: var(\n --_motion-transition,\n transform 0.5s cubic-bezier(0.34, 1.1, 0.64, 1),\n opacity 0.5s cubic-bezier(0.34, 1.1, 0.64, 1),\n filter 0.5s cubic-bezier(0.34, 1.1, 0.64, 1)\n );\n will-change: transform, opacity, filter;\n }\n\n /* Enter animation via @starting-style — no JS class needed */\n @starting-style {\n .toast-wrapper {\n opacity: 0;\n transform: translateY(1.5rem) scale(0.92);\n }\n\n :host([position^='top']) .toast-wrapper {\n transform: translateY(-1.5rem) scale(0.92);\n }\n }\n\n /* Exit animation */\n .toast-wrapper.exiting {\n z-index: -1 !important;\n pointer-events: none;\n transition: none !important;\n animation: var(--_motion-animation, toast-exit 0.3s ease-out forwards);\n }\n\n @keyframes toast-exit {\n to {\n opacity: 0;\n transform: scale(0.7);\n }\n }\n\n /* Stacking (collapsed) */\n :host(:not(.hovered)) .toast-wrapper:nth-last-child(1) {\n z-index: 3;\n opacity: 1;\n filter: brightness(1);\n transform: translateY(0) scale(1);\n }\n\n :host(:not(.hovered)) .toast-wrapper:nth-last-child(2) {\n z-index: 2;\n pointer-events: none;\n opacity: 0.85;\n filter: brightness(0.95);\n transform: translateY(-8px) scale(0.95) rotateX(3deg);\n }\n\n :host(:not(.hovered)) .toast-wrapper:nth-last-child(3) {\n z-index: 1;\n pointer-events: none;\n opacity: 0.7;\n filter: brightness(0.9);\n transform: translateY(-14px) scale(0.9) rotateX(5deg);\n }\n\n :host(:not(.hovered)) .toast-wrapper:nth-last-child(n + 4) {\n pointer-events: none;\n opacity: 0;\n }\n\n /* Expanded (hovered) */\n :host(.hovered) .toast-wrapper {\n z-index: auto !important;\n grid-row: auto;\n grid-column: 1;\n align-self: stretch;\n pointer-events: auto !important;\n opacity: 1 !important;\n filter: brightness(1) !important;\n transform: none !important;\n }\n\n /* Staggered expand delays */\n :host(.hovered) .toast-wrapper:nth-last-child(2) {\n transition-delay: 0.05s;\n }\n\n :host(.hovered) .toast-wrapper:nth-last-child(3) {\n transition-delay: 0.1s;\n }\n\n :host(.hovered) .toast-wrapper:nth-last-child(n + 4) {\n transition-delay: 0.15s;\n }\n\n /* Top positions: reverse stacking direction */\n :host([position^='top']) .toast-wrapper {\n transform-origin: center top;\n }\n\n :host([position^='top']:not(.hovered)) .toast-wrapper:nth-last-child(2) {\n transform: translateY(8px) scale(0.95) rotateX(-3deg);\n }\n\n :host([position^='top']:not(.hovered)) .toast-wrapper:nth-last-child(3) {\n transform: translateY(14px) scale(0.9) rotateX(-5deg);\n }\n\n ::slotted(bit-alert) {\n width: 100%;\n margin: 0;\n box-shadow: var(--shadow-lg);\n }\n\n .toast-wrapper.exiting ::slotted(bit-alert) {\n transition: none !important;\n }\n\n .toast-actions {\n display: flex;\n gap: var(--size-4);\n justify-content: flex-end;\n }\n\n /* ========================================\n Responsive: small screens\n ======================================== */\n\n @media (width <= 480px) {\n :host {\n --_max-width: calc(100vw - var(--size-4));\n --_inset-right: var(--size-2);\n --_inset-left: var(--size-2);\n }\n\n :host([position='top-center']),\n :host([position='bottom-center']) {\n --_inset-left: var(--size-2);\n\n inset-inline-start: var(--size-2);\n transform: none;\n }\n }\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { ComponentSize, RoundedSize, ThemeColor, VisualVariant } from '../../types';
|
|
2
|
+
/** Toast container properties */
|
|
3
|
+
export type BitToastEvents = {
|
|
4
|
+
add: {
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
dismiss: {
|
|
8
|
+
id: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export type BitToastProps = {
|
|
12
|
+
max?: number;
|
|
13
|
+
position?: 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
14
|
+
};
|
|
15
|
+
/** Individual toast notification */
|
|
16
|
+
export type ToastItem = {
|
|
17
|
+
actions?: Array<{
|
|
18
|
+
color?: ThemeColor;
|
|
19
|
+
label: string;
|
|
20
|
+
onClick?: () => void;
|
|
21
|
+
variant?: VisualVariant;
|
|
22
|
+
}>;
|
|
23
|
+
color?: ThemeColor;
|
|
24
|
+
dismissible?: boolean;
|
|
25
|
+
/** Auto-dismiss delay in ms. Set to 0 for persistent toasts (default: 5000) */
|
|
26
|
+
duration?: number;
|
|
27
|
+
heading?: string;
|
|
28
|
+
/** Show message and actions side-by-side (horizontal layout) */
|
|
29
|
+
horizontal?: boolean;
|
|
30
|
+
/** Auto-generated via crypto.randomUUID() if omitted */
|
|
31
|
+
id?: string;
|
|
32
|
+
message: string;
|
|
33
|
+
/** Metadata text (e.g. timestamp) shown in the alert meta slot */
|
|
34
|
+
meta?: string;
|
|
35
|
+
/** Called after the toast is fully dismissed and removed */
|
|
36
|
+
onDismiss?: () => void;
|
|
37
|
+
rounded?: RoundedSize | '';
|
|
38
|
+
size?: ComponentSize;
|
|
39
|
+
/**
|
|
40
|
+
* Urgency level for screen readers.
|
|
41
|
+
* - `'polite'` (default): uses `aria-live="polite"` — announced after the user finishes their current action.
|
|
42
|
+
* - `'assertive'`: uses `aria-live="assertive"` — interrupts the user immediately. Use only for critical errors.
|
|
43
|
+
*/
|
|
44
|
+
urgency?: 'polite' | 'assertive';
|
|
45
|
+
variant?: 'solid' | 'flat' | 'bordered';
|
|
46
|
+
};
|
|
47
|
+
/** Public API of the bit-toast element */
|
|
48
|
+
export interface ToastElement extends HTMLElement {
|
|
49
|
+
add: (toast: ToastItem) => string;
|
|
50
|
+
update: (id: string, updates: Partial<ToastItem>) => void;
|
|
51
|
+
dismiss: (id: string) => void;
|
|
52
|
+
clear: () => void;
|
|
53
|
+
}
|
|
54
|
+
export declare const TOAST_TAG: string;
|
|
55
|
+
/**
|
|
56
|
+
* Singleton service for triggering toasts without direct DOM references.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* import { toast } from '@vielzeug/buildit';
|
|
61
|
+
*
|
|
62
|
+
* toast.add({ message: 'Saved!', color: 'success' });
|
|
63
|
+
*
|
|
64
|
+
* const id = toast.add({ message: 'Uploading…', duration: 0, dismissible: false });
|
|
65
|
+
* toast.update(id, { message: 'Done!', color: 'success', duration: 3000, dismissible: true });
|
|
66
|
+
*
|
|
67
|
+
* await toast.promise(uploadFile(), {
|
|
68
|
+
* loading: 'Uploading…',
|
|
69
|
+
* success: (url) => `Uploaded to ${url}`,
|
|
70
|
+
* error: 'Upload failed',
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare const toast: {
|
|
75
|
+
/** Add a toast and return its id */
|
|
76
|
+
add(item: ToastItem): string;
|
|
77
|
+
/** Dismiss all toasts (animated) */
|
|
78
|
+
clear(): void;
|
|
79
|
+
/** Configure the auto-created container. Call before the first `add()` if the defaults need to change. */
|
|
80
|
+
configure(config: BitToastProps): void;
|
|
81
|
+
/**
|
|
82
|
+
* Shows a loading toast tied to a promise.
|
|
83
|
+
* Updates to success/error when the promise settles.
|
|
84
|
+
*/
|
|
85
|
+
promise<T>(promise: Promise<T>, messages: {
|
|
86
|
+
error: string | ((err: unknown) => string);
|
|
87
|
+
loading: string;
|
|
88
|
+
success: string | ((data: T) => string);
|
|
89
|
+
}): Promise<T>;
|
|
90
|
+
/** Dismiss a toast by id */
|
|
91
|
+
remove(id: string): void;
|
|
92
|
+
/** Update an existing toast in-place */
|
|
93
|
+
update(id: string, updates: Partial<ToastItem>): void;
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../src/feedback/toast/toast.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMzF,iCAAiC;AAEjC,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACpB,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,UAAU,GAAG,YAA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IAAI,CAAC;CACnB;AA6DD,eAAO,MAAM,SAAS,QAmPpB,CAAC;AAeH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,KAAK;IAChB,oCAAoC;cAC1B,SAAS,GAAG,MAAM;IAI5B,oCAAoC;aAC3B,IAAI;IAGb,0GAA0G;sBACxF,aAAa,GAAG,IAAI;IAQtC;;;OAGG;YACW,CAAC,WACJ,OAAO,CAAC,CAAC,CAAC,YACT;QACR,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,MAAM,CAAC,CAAC;QAC3C,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC,CAAC;KACzC,GACA,OAAO,CAAC,CAAC,CAAC;IAyBb,4BAA4B;eACjB,MAAM,GAAG,IAAI;IAIxB,wCAAwC;eAC7B,MAAM,WAAW,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI;CAGtD,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./styles/mixins/shape.css.cjs`),t=require(`./styles/mixins/states.css.cjs`),n=require(`./styles/mixins/theme.css.cjs`),r=require(`./styles/index.cjs`),i=require(`./craftit/dist/directives/each.cjs`);require(`./craftit/dist/directives/index.cjs`);const a=require(`./icons.cjs`),o=require(`./inputs/shared/design-presets.cjs`),s=require(`./inputs/file-input/file-input.css?inline.cjs`);let c=require(`@vielzeug/craftit`),l=require(`@vielzeug/dragit`);function u(e){if(e===0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=1024,r=Math.min(Math.floor(Math.log(e)/Math.log(n)),t.length-1);return`${Number.parseFloat((e/n**r).toFixed(1))} ${t[r]}`}function d(e,t){return t?t.split(`,`).map(e=>e.trim()).some(t=>t.startsWith(`.`)?e.name.toLowerCase().endsWith(t.toLowerCase()):t.endsWith(`/*`)?e.type.startsWith(t.slice(0,-1)):e.type===t):!0}function f(e,t){return!t||d(e,t)}function p(e,t){return t==null?!0:t===0||e.size<=t}var m=(0,c.defineComponent)({formAssociated:!0,props:{accept:{default:``},color:{default:void 0},disabled:{default:!1},error:{default:``,omit:!0},fullwidth:{default:!1},helper:{default:``},label:{default:``},"max-files":{default:0,type:Number},"max-size":{default:0,type:Number},multiple:{default:!1},name:{default:``},required:{default:!1},rounded:{default:void 0},size:{default:void 0},variant:{default:void 0}},setup({emit:e,host:t,props:n}){let r=(0,c.signal)([]),o=(0,c.signal)(!1);(0,c.defineField)({disabled:(0,c.computed)(()=>!!n.disabled.value),toFormValue:e=>{if(e.length===0)return null;let t=n.name.value||`file`,r=new FormData;for(let n of e)r.append(t,n);return r},value:r},{onReset:()=>{r.value=[]}});let s=(0,c.computed)(()=>!!n.error.value);(0,c.effect)(()=>{s.value?t.setAttribute(`invalid`,``):t.removeAttribute(`invalid`)}),(0,c.effect)(()=>{o.value?t.setAttribute(`drag-over`,``):t.removeAttribute(`drag-over`)});let d=(0,c.createId)(`file-input`),m=`label-${d}`,h=`helper-${d}`,g=`error-${d}`,_=(0,c.ref)(),v=(0,c.ref)(),y=(0,c.computed)(()=>{let e=[];n.accept.value&&e.push(n.accept.value.split(`,`).map(e=>e.trim()).join(`, `));let t=n[`max-size`].value??0;t>0&&e.push(`max ${u(t)}`);let r=n[`max-files`].value??0;return r>0&&e.push(`up to ${r} file${r===1?``:`s`}`),e.join(` · `)});function b(t,i){if(n.disabled.value)return;let a=n[`max-files`].value??0,o=n[`max-size`].value??0,s=n.accept.value,c=!!n.multiple.value,l=Array.from(t);c||(l=l.slice(0,1)),l=l.filter(e=>f(e,s)&&p(e,o));let u=c?[...r.value]:[];for(let e of l)u.includes(e)||u.push(e);a>0&&u.length>a&&(u=u.slice(0,a)),r.value=u,e(`change`,{files:r.value,originalEvent:i,value:r.value})}function x(t,n){r.value=r.value.filter(e=>e!==t),e(`remove`,{file:t,files:r.value,originalEvent:n,value:r.value}),e(`change`,{files:r.value,originalEvent:n,value:r.value})}return(0,c.onMount)(()=>{let e=v.value,t=_.value;(0,c.handle)(e,`change`,e=>{let t=e.target;t.files?.length&&b(Array.from(t.files),e),t.value=``}),(0,c.handle)(t,`click`,()=>{n.disabled.value||e.click()}),(0,c.handle)(t,`keydown`,t=>{(t.key===`Enter`||t.key===` `)&&!n.disabled.value&&(t.preventDefault(),e.click())});let r=(0,l.createDropZone)({disabled:()=>!!n.disabled.value,element:t,onDrop:(e,t)=>b(e,t),onHoverChange:e=>{o.value=e}});(0,c.onCleanup)(()=>r.destroy())}),c.html`
|
|
2
|
+
<div class="file-input-wrapper" part="wrapper">
|
|
3
|
+
<label class="label-outside" id="${m}" part="label" ?hidden=${()=>!n.label.value}
|
|
4
|
+
>${()=>n.label.value}</label
|
|
5
|
+
>
|
|
6
|
+
<div
|
|
7
|
+
class="dropzone"
|
|
8
|
+
part="dropzone"
|
|
9
|
+
ref=${_}
|
|
10
|
+
role="button"
|
|
11
|
+
:tabindex=${()=>n.disabled.value?`-1`:`0`}
|
|
12
|
+
:aria-disabled=${()=>String(n.disabled.value)}
|
|
13
|
+
:aria-label=${()=>n.label.value?null:`File upload drop zone`}
|
|
14
|
+
:aria-labelledby=${()=>n.label.value?m:null}
|
|
15
|
+
aria-describedby="${h}">
|
|
16
|
+
<input
|
|
17
|
+
type="file"
|
|
18
|
+
ref=${v}
|
|
19
|
+
part="input"
|
|
20
|
+
id="${d}"
|
|
21
|
+
:accept=${()=>n.accept.value}
|
|
22
|
+
?multiple=${()=>n.multiple.value}
|
|
23
|
+
?required=${()=>n.required.value}
|
|
24
|
+
?disabled=${()=>n.disabled.value}
|
|
25
|
+
:name=${()=>n.name.value}
|
|
26
|
+
hidden
|
|
27
|
+
inert
|
|
28
|
+
tabindex="-1" />
|
|
29
|
+
<div class="dropzone-content">
|
|
30
|
+
<span class="dropzone-icon" aria-hidden="true"> ${a.uploadIcon} </span>
|
|
31
|
+
<span class="dropzone-title">Drop files here or <u>click to browse</u></span>
|
|
32
|
+
<span class="dropzone-hint" ?hidden=${()=>!y.value}>${y}</span>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
<ul class="file-list" role="list" aria-label="Selected files" ?hidden=${()=>r.value.length===0}>
|
|
36
|
+
${i.d(r,e=>c.html`
|
|
37
|
+
<li class="file-item">
|
|
38
|
+
<span class="file-icon" aria-hidden="true"> ${a.fileIcon} </span>
|
|
39
|
+
<span class="file-meta">
|
|
40
|
+
<span class="file-name" title="${e.name}">${e.name}</span>
|
|
41
|
+
<span class="file-size">${u(e.size)}</span>
|
|
42
|
+
</span>
|
|
43
|
+
<button
|
|
44
|
+
class="file-remove"
|
|
45
|
+
type="button"
|
|
46
|
+
aria-label="${`Remove ${e.name}`}"
|
|
47
|
+
@click=${t=>x(e,t)}>
|
|
48
|
+
${a.clearIcon}
|
|
49
|
+
</button>
|
|
50
|
+
</li>
|
|
51
|
+
`,void 0,{key:e=>`${e.name}:${e.size}:${e.lastModified}`})}
|
|
52
|
+
</ul>
|
|
53
|
+
<div class="helper-text" id="${h}" part="helper" ?hidden=${()=>s.value||!n.helper.value}>
|
|
54
|
+
${()=>n.helper.value}
|
|
55
|
+
</div>
|
|
56
|
+
<div
|
|
57
|
+
class="helper-text helper-text-error"
|
|
58
|
+
id="${g}"
|
|
59
|
+
role="alert"
|
|
60
|
+
part="error"
|
|
61
|
+
?hidden=${()=>!s.value}>
|
|
62
|
+
${()=>n.error.value}
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
`},shadow:{delegatesFocus:!0},styles:[...r.formFieldMixins,e.sizeVariantMixin(o.FILE_INPUT_SIZE_PRESET),t.disabledLoadingMixin(),n.forcedColorsFocusMixin(`.dropzone`),s.default],tag:`bit-file-input`});exports.FILE_INPUT_TAG=m;
|
|
66
|
+
//# sourceMappingURL=file-input.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-input.cjs","names":[],"sources":["../src/inputs/file-input/file-input.ts"],"sourcesContent":["import {\n computed,\n createId,\n defineComponent,\n defineField,\n effect,\n handle,\n html,\n onCleanup,\n onMount,\n ref,\n signal,\n} from '@vielzeug/craftit';\nimport { each } from '@vielzeug/craftit/directives';\nimport { createDropZone } from '@vielzeug/dragit';\n\nimport type { ComponentSize, RoundedSize, ThemeColor, VisualVariant } from '../../types';\n\nimport { clearIcon, fileIcon, uploadIcon } from '../../icons';\nimport { disabledLoadingMixin, forcedColorsFocusMixin, formFieldMixins, sizeVariantMixin } from '../../styles';\nimport { FILE_INPUT_SIZE_PRESET } from '../shared/design-presets';\n\n// ============================================\n// Helpers\n// ============================================\n\nfunction formatBytes(bytes: number): string {\n if (bytes === 0) return '0 B';\n\n const units = ['B', 'KB', 'MB', 'GB'] as const;\n const k = 1024;\n const i = Math.min(Math.floor(Math.log(bytes) / Math.log(k)), units.length - 1);\n\n return `${Number.parseFloat((bytes / k ** i).toFixed(1))} ${units[i]}`;\n}\n\nfunction matchesAccept(file: File, accept: string | undefined): boolean {\n if (!accept) return true;\n\n return accept\n .split(',')\n .map((s) => s.trim())\n .some((pattern) => {\n if (pattern.startsWith('.')) return file.name.toLowerCase().endsWith(pattern.toLowerCase());\n\n if (pattern.endsWith('/*')) return file.type.startsWith(pattern.slice(0, -1));\n\n return file.type === pattern;\n });\n}\n\nfunction isFileAccepted(file: File, accept: string | undefined): boolean {\n return !accept || matchesAccept(file, accept);\n}\n\nfunction isFileSizeAllowed(file: File, maxBytes: number | undefined): boolean {\n if (maxBytes == null) return true;\n\n return maxBytes === 0 || file.size <= maxBytes;\n}\n\n// ============================================\n// Component Styles\n// ============================================\n\nimport componentStyles from './file-input.css?inline';\n\n// ============================================\n// Types\n// ============================================\n\n/** FileInput component properties */\n\nexport type BitFileInputEvents = {\n change: { files: File[]; originalEvent?: Event; value: File[] };\n remove: { file: File; files: File[]; originalEvent?: Event; value: File[] };\n};\n\nexport type BitFileInputProps = {\n /** Accepted file types (MIME types or extensions, comma-separated) */\n accept?: string;\n /** Theme color */\n color?: ThemeColor;\n /** Disable interaction */\n disabled?: boolean;\n /** Error message (marks field as invalid) */\n error?: string;\n /** Full width mode */\n fullwidth?: boolean;\n /** Helper text */\n helper?: string;\n /** Label text */\n label?: string;\n /** Maximum number of files (0 = unlimited) */\n 'max-files'?: number;\n /** Maximum file size in bytes (0 = unlimited) */\n 'max-size'?: number;\n /** Allow multiple file selection */\n multiple?: boolean;\n /** Form field name */\n name?: string;\n /** Mark as required */\n required?: boolean;\n /** Border radius */\n rounded?: Exclude<RoundedSize, 'full'>;\n /** Component size */\n size?: ComponentSize;\n /** Visual variant */\n variant?: Exclude<VisualVariant, 'glass' | 'text' | 'frost'>;\n};\n\n// ============================================\n// Component Definition\n// ============================================\n\n/**\n * A file upload component with drag-and-drop support, file list management,\n * and full form integration.\n *\n * @element bit-file-input\n *\n * @attr {string} accept - Accepted file types (MIME types or extensions, e.g. \"image/*,.pdf\")\n * @attr {string} color - Theme color: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'\n * @attr {boolean} disabled - Disable all interaction\n * @attr {string} error - Error message\n * @attr {boolean} fullwidth - Full width mode\n * @attr {string} helper - Helper text below the dropzone\n * @attr {string} label - Label text displayed above the dropzone\n * @attr {number} max-files - Maximum number of files (0 = unlimited)\n * @attr {number} max-size - Maximum file size in bytes (0 = unlimited)\n * @attr {boolean} multiple - Allow selecting multiple files\n * @attr {string} name - Form field name\n * @attr {boolean} required - Mark as required\n * @attr {string} rounded - Border radius: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'\n * @attr {string} size - Component size: 'sm' | 'md' | 'lg'\n * @attr {string} variant - Visual variant: 'solid' | 'flat' | 'bordered' | 'outline' | 'ghost'\n *\n * @fires change - Emitted when the file selection changes. detail: { value: File[], files: File[], originalEvent?: Event }\n * @fires remove - Emitted when a file is removed from the list. detail: { value: File[], file: File, files: File[], originalEvent?: Event }\n *\n * @part wrapper - The outer wrapper div\n * @part label - The label element\n * @part dropzone - The drag-and-drop zone\n * @part input - The hidden native file input\n * @part helper - The helper text element\n * @part error - The error text element\n *\n * @cssprop --file-input-bg - Dropzone background color\n * @cssprop --file-input-border-color - Dropzone border color\n * @cssprop --file-input-radius - Border radius\n * @cssprop --file-input-min-height - Minimum dropzone height\n * @cssprop --file-input-font-size - Font size\n *\n * @example\n * ```html\n * <bit-file-input label=\"Upload files\" accept=\"image/*\" multiple />\n * <bit-file-input label=\"Resume\" accept=\".pdf,.doc,.docx\" max-size=\"5242880\" />\n * <bit-file-input variant=\"bordered\" color=\"primary\" />\n * ```\n */\nexport const FILE_INPUT_TAG = defineComponent<BitFileInputProps, BitFileInputEvents>({\n formAssociated: true,\n props: {\n accept: { default: '' },\n color: { default: undefined },\n disabled: { default: false },\n error: { default: '', omit: true },\n fullwidth: { default: false },\n helper: { default: '' },\n label: { default: '' },\n 'max-files': { default: 0, type: Number },\n 'max-size': { default: 0, type: Number },\n multiple: { default: false },\n name: { default: '' },\n required: { default: false },\n rounded: { default: undefined },\n size: { default: undefined },\n variant: { default: undefined },\n },\n setup({ emit, host, props }) {\n // ============================================\n // State\n // ============================================\n const files = signal<File[]>([]);\n const isDragging = signal(false);\n\n // ============================================\n // Form Integration\n // ============================================\n defineField(\n {\n disabled: computed(() => Boolean(props.disabled.value)),\n toFormValue: (fi: File[]) => {\n if (fi.length === 0) return null;\n\n const name = props.name.value || 'file';\n const fd = new FormData();\n\n for (const file of fi) fd.append(name, file);\n\n return fd;\n },\n value: files,\n },\n {\n onReset: () => {\n files.value = [];\n },\n },\n );\n\n // Sync host attributes for CSS selectors\n const isInvalid = computed(() => Boolean(props.error.value));\n\n effect(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n isInvalid.value ? host.setAttribute('invalid', '') : host.removeAttribute('invalid');\n });\n effect(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n isDragging.value ? host.setAttribute('drag-over', '') : host.removeAttribute('drag-over');\n });\n\n // ============================================\n // IDs\n // ============================================\n const fileInputId = createId('file-input');\n const labelId = `label-${fileInputId}`;\n const helperId = `helper-${fileInputId}`;\n const errorId = `error-${fileInputId}`;\n // ============================================\n // Refs\n // ============================================\n const dropzoneRef = ref<HTMLDivElement>();\n const inputRef = ref<HTMLInputElement>();\n const hintText = computed(() => {\n const parts: string[] = [];\n\n if (props.accept.value) {\n parts.push(\n props.accept.value\n .split(',')\n .map((s: string) => s.trim())\n .join(', '),\n );\n }\n\n const maxSize = props['max-size'].value ?? 0;\n\n if (maxSize > 0) parts.push(`max ${formatBytes(maxSize)}`);\n\n const maxFiles = props['max-files'].value ?? 0;\n\n if (maxFiles > 0) parts.push(`up to ${maxFiles} file${maxFiles !== 1 ? 's' : ''}`);\n\n return parts.join(' · ');\n });\n\n // ============================================\n // File Management\n // ============================================\n function addFiles(newFiles: File[], originalEvent?: Event): void {\n if (props.disabled.value) return;\n\n const maxFilesLimit = props['max-files'].value ?? 0;\n const maxSizeLimit = props['max-size'].value ?? 0;\n const acceptVal = props.accept.value;\n const isMultiple = Boolean(props.multiple.value);\n let incoming = Array.from(newFiles);\n\n if (!isMultiple) incoming = incoming.slice(0, 1);\n\n incoming = incoming.filter((f) => isFileAccepted(f, acceptVal) && isFileSizeAllowed(f, maxSizeLimit));\n\n let updated: File[] = isMultiple ? [...files.value] : [];\n\n for (const f of incoming) {\n if (!updated.includes(f)) updated.push(f);\n }\n\n if (maxFilesLimit > 0 && updated.length > maxFilesLimit) {\n updated = updated.slice(0, maxFilesLimit);\n }\n\n files.value = updated;\n emit('change', { files: files.value, originalEvent, value: files.value });\n }\n function removeFile(file: File, originalEvent?: Event): void {\n files.value = files.value.filter((f) => f !== file);\n emit('remove', { file, files: files.value, originalEvent, value: files.value });\n emit('change', { files: files.value, originalEvent, value: files.value });\n }\n // ============================================\n // Mount\n // ============================================\n onMount(() => {\n const inp = inputRef.value!;\n const dz = dropzoneRef.value!;\n\n // Native input → add files\n handle(inp, 'change', (e: Event) => {\n const input = e.target as HTMLInputElement;\n\n if (input.files?.length) addFiles(Array.from(input.files), e);\n\n input.value = ''; // reset so the same file triggers change again\n });\n // Click dropzone → open file picker\n handle(dz, 'click', () => {\n if (!props.disabled.value) inp.click();\n });\n // Keyboard: Enter / Space → open picker\n handle(dz, 'keydown', (e: KeyboardEvent) => {\n if ((e.key === 'Enter' || e.key === ' ') && !props.disabled.value) {\n e.preventDefault();\n inp.click();\n }\n });\n\n const dropZone = createDropZone({\n disabled: () => Boolean(props.disabled.value),\n element: dz,\n onDrop: (droppedFiles, e) => addFiles(droppedFiles, e),\n onHoverChange: (hovered) => {\n isDragging.value = hovered;\n },\n });\n\n onCleanup(() => dropZone.destroy());\n });\n\n // ============================================\n // Template\n // ============================================\n return html`\n <div class=\"file-input-wrapper\" part=\"wrapper\">\n <label class=\"label-outside\" id=\"${labelId}\" part=\"label\" ?hidden=${() => !props.label.value}\n >${() => props.label.value}</label\n >\n <div\n class=\"dropzone\"\n part=\"dropzone\"\n ref=${dropzoneRef}\n role=\"button\"\n :tabindex=${() => (props.disabled.value ? '-1' : '0')}\n :aria-disabled=${() => String(props.disabled.value)}\n :aria-label=${() => (!props.label.value ? 'File upload drop zone' : null)}\n :aria-labelledby=${() => (props.label.value ? labelId : null)}\n aria-describedby=\"${helperId}\">\n <input\n type=\"file\"\n ref=${inputRef}\n part=\"input\"\n id=\"${fileInputId}\"\n :accept=${() => props.accept.value}\n ?multiple=${() => props.multiple.value}\n ?required=${() => props.required.value}\n ?disabled=${() => props.disabled.value}\n :name=${() => props.name.value}\n hidden\n inert\n tabindex=\"-1\" />\n <div class=\"dropzone-content\">\n <span class=\"dropzone-icon\" aria-hidden=\"true\"> ${uploadIcon} </span>\n <span class=\"dropzone-title\">Drop files here or <u>click to browse</u></span>\n <span class=\"dropzone-hint\" ?hidden=${() => !hintText.value}>${hintText}</span>\n </div>\n </div>\n <ul class=\"file-list\" role=\"list\" aria-label=\"Selected files\" ?hidden=${() => files.value.length === 0}>\n ${each(\n files,\n (file: File) => html`\n <li class=\"file-item\">\n <span class=\"file-icon\" aria-hidden=\"true\"> ${fileIcon} </span>\n <span class=\"file-meta\">\n <span class=\"file-name\" title=\"${file.name}\">${file.name}</span>\n <span class=\"file-size\">${formatBytes(file.size)}</span>\n </span>\n <button\n class=\"file-remove\"\n type=\"button\"\n aria-label=\"${`Remove ${file.name}`}\"\n @click=${(e: Event) => removeFile(file, e)}>\n ${clearIcon}\n </button>\n </li>\n `,\n undefined,\n {\n key: (file: File) => `${file.name}:${file.size}:${file.lastModified}`,\n },\n )}\n </ul>\n <div class=\"helper-text\" id=\"${helperId}\" part=\"helper\" ?hidden=${() => isInvalid.value || !props.helper.value}>\n ${() => props.helper.value}\n </div>\n <div\n class=\"helper-text helper-text-error\"\n id=\"${errorId}\"\n role=\"alert\"\n part=\"error\"\n ?hidden=${() => !isInvalid.value}>\n ${() => props.error.value}\n </div>\n </div>\n `;\n },\n shadow: { delegatesFocus: true },\n styles: [\n ...formFieldMixins,\n sizeVariantMixin(FILE_INPUT_SIZE_PRESET),\n disabledLoadingMixin(),\n forcedColorsFocusMixin('.dropzone'),\n componentStyles,\n ],\n tag: 'bit-file-input',\n});\n"],"mappings":"qhBA0BA,SAAS,EAAY,EAAuB,CAC1C,GAAI,IAAU,EAAG,MAAO,MAExB,IAAM,EAAQ,CAAC,IAAK,KAAM,KAAM,KAAK,CAC/B,EAAI,KACJ,EAAI,KAAK,IAAI,KAAK,MAAM,KAAK,IAAI,EAAM,CAAG,KAAK,IAAI,EAAE,CAAC,CAAE,EAAM,OAAS,EAAE,CAE/E,MAAO,GAAG,OAAO,YAAY,EAAQ,GAAK,GAAG,QAAQ,EAAE,CAAC,CAAC,GAAG,EAAM,KAGpE,SAAS,EAAc,EAAY,EAAqC,CAGtE,OAFK,EAEE,EACJ,MAAM,IAAI,CACV,IAAK,GAAM,EAAE,MAAM,CAAC,CACpB,KAAM,GACD,EAAQ,WAAW,IAAI,CAAS,EAAK,KAAK,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AAsB,CACtB,EAAA,uBAAuB,YAAY,CACnC,EAAA,QACD,CACD,IAAK,iBACN,CAAC"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { sizeVariantMixin as e } from "./styles/mixins/shape.css.js";
|
|
2
|
+
import { disabledLoadingMixin as t } from "./styles/mixins/states.css.js";
|
|
3
|
+
import { forcedColorsFocusMixin as n } from "./styles/mixins/theme.css.js";
|
|
4
|
+
import { formFieldMixins as r } from "./styles/index.js";
|
|
5
|
+
import { d as i } from "./craftit/dist/directives/each.js";
|
|
6
|
+
import "./craftit/dist/directives/index.js";
|
|
7
|
+
import { clearIcon as a, fileIcon as o, uploadIcon as s } from "./icons.js";
|
|
8
|
+
import { FILE_INPUT_SIZE_PRESET as c } from "./inputs/shared/design-presets.js";
|
|
9
|
+
import l from "./inputs/file-input/file-input.css?inline.js";
|
|
10
|
+
import { computed as u, createId as d, defineComponent as f, defineField as p, effect as m, handle as h, html as g, onCleanup as _, onMount as v, ref as y, signal as b } from "@vielzeug/craftit";
|
|
11
|
+
import { createDropZone as x } from "@vielzeug/dragit";
|
|
12
|
+
//#region src/inputs/file-input/file-input.ts
|
|
13
|
+
function S(e) {
|
|
14
|
+
if (e === 0) return "0 B";
|
|
15
|
+
let t = [
|
|
16
|
+
"B",
|
|
17
|
+
"KB",
|
|
18
|
+
"MB",
|
|
19
|
+
"GB"
|
|
20
|
+
], n = 1024, r = Math.min(Math.floor(Math.log(e) / Math.log(n)), t.length - 1);
|
|
21
|
+
return `${Number.parseFloat((e / n ** r).toFixed(1))} ${t[r]}`;
|
|
22
|
+
}
|
|
23
|
+
function C(e, t) {
|
|
24
|
+
return t ? t.split(",").map((e) => e.trim()).some((t) => t.startsWith(".") ? e.name.toLowerCase().endsWith(t.toLowerCase()) : t.endsWith("/*") ? e.type.startsWith(t.slice(0, -1)) : e.type === t) : !0;
|
|
25
|
+
}
|
|
26
|
+
function w(e, t) {
|
|
27
|
+
return !t || C(e, t);
|
|
28
|
+
}
|
|
29
|
+
function T(e, t) {
|
|
30
|
+
return t == null ? !0 : t === 0 || e.size <= t;
|
|
31
|
+
}
|
|
32
|
+
var E = f({
|
|
33
|
+
formAssociated: !0,
|
|
34
|
+
props: {
|
|
35
|
+
accept: { default: "" },
|
|
36
|
+
color: { default: void 0 },
|
|
37
|
+
disabled: { default: !1 },
|
|
38
|
+
error: {
|
|
39
|
+
default: "",
|
|
40
|
+
omit: !0
|
|
41
|
+
},
|
|
42
|
+
fullwidth: { default: !1 },
|
|
43
|
+
helper: { default: "" },
|
|
44
|
+
label: { default: "" },
|
|
45
|
+
"max-files": {
|
|
46
|
+
default: 0,
|
|
47
|
+
type: Number
|
|
48
|
+
},
|
|
49
|
+
"max-size": {
|
|
50
|
+
default: 0,
|
|
51
|
+
type: Number
|
|
52
|
+
},
|
|
53
|
+
multiple: { default: !1 },
|
|
54
|
+
name: { default: "" },
|
|
55
|
+
required: { default: !1 },
|
|
56
|
+
rounded: { default: void 0 },
|
|
57
|
+
size: { default: void 0 },
|
|
58
|
+
variant: { default: void 0 }
|
|
59
|
+
},
|
|
60
|
+
setup({ emit: e, host: t, props: n }) {
|
|
61
|
+
let r = b([]), c = b(!1);
|
|
62
|
+
p({
|
|
63
|
+
disabled: u(() => !!n.disabled.value),
|
|
64
|
+
toFormValue: (e) => {
|
|
65
|
+
if (e.length === 0) return null;
|
|
66
|
+
let t = n.name.value || "file", r = new FormData();
|
|
67
|
+
for (let n of e) r.append(t, n);
|
|
68
|
+
return r;
|
|
69
|
+
},
|
|
70
|
+
value: r
|
|
71
|
+
}, { onReset: () => {
|
|
72
|
+
r.value = [];
|
|
73
|
+
} });
|
|
74
|
+
let l = u(() => !!n.error.value);
|
|
75
|
+
m(() => {
|
|
76
|
+
l.value ? t.setAttribute("invalid", "") : t.removeAttribute("invalid");
|
|
77
|
+
}), m(() => {
|
|
78
|
+
c.value ? t.setAttribute("drag-over", "") : t.removeAttribute("drag-over");
|
|
79
|
+
});
|
|
80
|
+
let f = d("file-input"), C = `label-${f}`, E = `helper-${f}`, D = `error-${f}`, O = y(), k = y(), A = u(() => {
|
|
81
|
+
let e = [];
|
|
82
|
+
n.accept.value && e.push(n.accept.value.split(",").map((e) => e.trim()).join(", "));
|
|
83
|
+
let t = n["max-size"].value ?? 0;
|
|
84
|
+
t > 0 && e.push(`max ${S(t)}`);
|
|
85
|
+
let r = n["max-files"].value ?? 0;
|
|
86
|
+
return r > 0 && e.push(`up to ${r} file${r === 1 ? "" : "s"}`), e.join(" · ");
|
|
87
|
+
});
|
|
88
|
+
function j(t, i) {
|
|
89
|
+
if (n.disabled.value) return;
|
|
90
|
+
let a = n["max-files"].value ?? 0, o = n["max-size"].value ?? 0, s = n.accept.value, c = !!n.multiple.value, l = Array.from(t);
|
|
91
|
+
c || (l = l.slice(0, 1)), l = l.filter((e) => w(e, s) && T(e, o));
|
|
92
|
+
let u = c ? [...r.value] : [];
|
|
93
|
+
for (let e of l) u.includes(e) || u.push(e);
|
|
94
|
+
a > 0 && u.length > a && (u = u.slice(0, a)), r.value = u, e("change", {
|
|
95
|
+
files: r.value,
|
|
96
|
+
originalEvent: i,
|
|
97
|
+
value: r.value
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function M(t, n) {
|
|
101
|
+
r.value = r.value.filter((e) => e !== t), e("remove", {
|
|
102
|
+
file: t,
|
|
103
|
+
files: r.value,
|
|
104
|
+
originalEvent: n,
|
|
105
|
+
value: r.value
|
|
106
|
+
}), e("change", {
|
|
107
|
+
files: r.value,
|
|
108
|
+
originalEvent: n,
|
|
109
|
+
value: r.value
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
return v(() => {
|
|
113
|
+
let e = k.value, t = O.value;
|
|
114
|
+
h(e, "change", (e) => {
|
|
115
|
+
let t = e.target;
|
|
116
|
+
t.files?.length && j(Array.from(t.files), e), t.value = "";
|
|
117
|
+
}), h(t, "click", () => {
|
|
118
|
+
n.disabled.value || e.click();
|
|
119
|
+
}), h(t, "keydown", (t) => {
|
|
120
|
+
(t.key === "Enter" || t.key === " ") && !n.disabled.value && (t.preventDefault(), e.click());
|
|
121
|
+
});
|
|
122
|
+
let r = x({
|
|
123
|
+
disabled: () => !!n.disabled.value,
|
|
124
|
+
element: t,
|
|
125
|
+
onDrop: (e, t) => j(e, t),
|
|
126
|
+
onHoverChange: (e) => {
|
|
127
|
+
c.value = e;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
_(() => r.destroy());
|
|
131
|
+
}), g`
|
|
132
|
+
<div class="file-input-wrapper" part="wrapper">
|
|
133
|
+
<label class="label-outside" id="${C}" part="label" ?hidden=${() => !n.label.value}
|
|
134
|
+
>${() => n.label.value}</label
|
|
135
|
+
>
|
|
136
|
+
<div
|
|
137
|
+
class="dropzone"
|
|
138
|
+
part="dropzone"
|
|
139
|
+
ref=${O}
|
|
140
|
+
role="button"
|
|
141
|
+
:tabindex=${() => n.disabled.value ? "-1" : "0"}
|
|
142
|
+
:aria-disabled=${() => String(n.disabled.value)}
|
|
143
|
+
:aria-label=${() => n.label.value ? null : "File upload drop zone"}
|
|
144
|
+
:aria-labelledby=${() => n.label.value ? C : null}
|
|
145
|
+
aria-describedby="${E}">
|
|
146
|
+
<input
|
|
147
|
+
type="file"
|
|
148
|
+
ref=${k}
|
|
149
|
+
part="input"
|
|
150
|
+
id="${f}"
|
|
151
|
+
:accept=${() => n.accept.value}
|
|
152
|
+
?multiple=${() => n.multiple.value}
|
|
153
|
+
?required=${() => n.required.value}
|
|
154
|
+
?disabled=${() => n.disabled.value}
|
|
155
|
+
:name=${() => n.name.value}
|
|
156
|
+
hidden
|
|
157
|
+
inert
|
|
158
|
+
tabindex="-1" />
|
|
159
|
+
<div class="dropzone-content">
|
|
160
|
+
<span class="dropzone-icon" aria-hidden="true"> ${s} </span>
|
|
161
|
+
<span class="dropzone-title">Drop files here or <u>click to browse</u></span>
|
|
162
|
+
<span class="dropzone-hint" ?hidden=${() => !A.value}>${A}</span>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
<ul class="file-list" role="list" aria-label="Selected files" ?hidden=${() => r.value.length === 0}>
|
|
166
|
+
${i(r, (e) => g`
|
|
167
|
+
<li class="file-item">
|
|
168
|
+
<span class="file-icon" aria-hidden="true"> ${o} </span>
|
|
169
|
+
<span class="file-meta">
|
|
170
|
+
<span class="file-name" title="${e.name}">${e.name}</span>
|
|
171
|
+
<span class="file-size">${S(e.size)}</span>
|
|
172
|
+
</span>
|
|
173
|
+
<button
|
|
174
|
+
class="file-remove"
|
|
175
|
+
type="button"
|
|
176
|
+
aria-label="${`Remove ${e.name}`}"
|
|
177
|
+
@click=${(t) => M(e, t)}>
|
|
178
|
+
${a}
|
|
179
|
+
</button>
|
|
180
|
+
</li>
|
|
181
|
+
`, void 0, { key: (e) => `${e.name}:${e.size}:${e.lastModified}` })}
|
|
182
|
+
</ul>
|
|
183
|
+
<div class="helper-text" id="${E}" part="helper" ?hidden=${() => l.value || !n.helper.value}>
|
|
184
|
+
${() => n.helper.value}
|
|
185
|
+
</div>
|
|
186
|
+
<div
|
|
187
|
+
class="helper-text helper-text-error"
|
|
188
|
+
id="${D}"
|
|
189
|
+
role="alert"
|
|
190
|
+
part="error"
|
|
191
|
+
?hidden=${() => !l.value}>
|
|
192
|
+
${() => n.error.value}
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
`;
|
|
196
|
+
},
|
|
197
|
+
shadow: { delegatesFocus: !0 },
|
|
198
|
+
styles: [
|
|
199
|
+
...r,
|
|
200
|
+
e(c),
|
|
201
|
+
t(),
|
|
202
|
+
n(".dropzone"),
|
|
203
|
+
l
|
|
204
|
+
],
|
|
205
|
+
tag: "bit-file-input"
|
|
206
|
+
});
|
|
207
|
+
//#endregion
|
|
208
|
+
export { E as FILE_INPUT_TAG };
|
|
209
|
+
|
|
210
|
+
//# sourceMappingURL=file-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-input.js","names":[],"sources":["../src/inputs/file-input/file-input.ts"],"sourcesContent":["import {\n computed,\n createId,\n defineComponent,\n defineField,\n effect,\n handle,\n html,\n onCleanup,\n onMount,\n ref,\n signal,\n} from '@vielzeug/craftit';\nimport { each } from '@vielzeug/craftit/directives';\nimport { createDropZone } from '@vielzeug/dragit';\n\nimport type { ComponentSize, RoundedSize, ThemeColor, VisualVariant } from '../../types';\n\nimport { clearIcon, fileIcon, uploadIcon } from '../../icons';\nimport { disabledLoadingMixin, forcedColorsFocusMixin, formFieldMixins, sizeVariantMixin } from '../../styles';\nimport { FILE_INPUT_SIZE_PRESET } from '../shared/design-presets';\n\n// ============================================\n// Helpers\n// ============================================\n\nfunction formatBytes(bytes: number): string {\n if (bytes === 0) return '0 B';\n\n const units = ['B', 'KB', 'MB', 'GB'] as const;\n const k = 1024;\n const i = Math.min(Math.floor(Math.log(bytes) / Math.log(k)), units.length - 1);\n\n return `${Number.parseFloat((bytes / k ** i).toFixed(1))} ${units[i]}`;\n}\n\nfunction matchesAccept(file: File, accept: string | undefined): boolean {\n if (!accept) return true;\n\n return accept\n .split(',')\n .map((s) => s.trim())\n .some((pattern) => {\n if (pattern.startsWith('.')) return file.name.toLowerCase().endsWith(pattern.toLowerCase());\n\n if (pattern.endsWith('/*')) return file.type.startsWith(pattern.slice(0, -1));\n\n return file.type === pattern;\n });\n}\n\nfunction isFileAccepted(file: File, accept: string | undefined): boolean {\n return !accept || matchesAccept(file, accept);\n}\n\nfunction isFileSizeAllowed(file: File, maxBytes: number | undefined): boolean {\n if (maxBytes == null) return true;\n\n return maxBytes === 0 || file.size <= maxBytes;\n}\n\n// ============================================\n// Component Styles\n// ============================================\n\nimport componentStyles from './file-input.css?inline';\n\n// ============================================\n// Types\n// ============================================\n\n/** FileInput component properties */\n\nexport type BitFileInputEvents = {\n change: { files: File[]; originalEvent?: Event; value: File[] };\n remove: { file: File; files: File[]; originalEvent?: Event; value: File[] };\n};\n\nexport type BitFileInputProps = {\n /** Accepted file types (MIME types or extensions, comma-separated) */\n accept?: string;\n /** Theme color */\n color?: ThemeColor;\n /** Disable interaction */\n disabled?: boolean;\n /** Error message (marks field as invalid) */\n error?: string;\n /** Full width mode */\n fullwidth?: boolean;\n /** Helper text */\n helper?: string;\n /** Label text */\n label?: string;\n /** Maximum number of files (0 = unlimited) */\n 'max-files'?: number;\n /** Maximum file size in bytes (0 = unlimited) */\n 'max-size'?: number;\n /** Allow multiple file selection */\n multiple?: boolean;\n /** Form field name */\n name?: string;\n /** Mark as required */\n required?: boolean;\n /** Border radius */\n rounded?: Exclude<RoundedSize, 'full'>;\n /** Component size */\n size?: ComponentSize;\n /** Visual variant */\n variant?: Exclude<VisualVariant, 'glass' | 'text' | 'frost'>;\n};\n\n// ============================================\n// Component Definition\n// ============================================\n\n/**\n * A file upload component with drag-and-drop support, file list management,\n * and full form integration.\n *\n * @element bit-file-input\n *\n * @attr {string} accept - Accepted file types (MIME types or extensions, e.g. \"image/*,.pdf\")\n * @attr {string} color - Theme color: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'\n * @attr {boolean} disabled - Disable all interaction\n * @attr {string} error - Error message\n * @attr {boolean} fullwidth - Full width mode\n * @attr {string} helper - Helper text below the dropzone\n * @attr {string} label - Label text displayed above the dropzone\n * @attr {number} max-files - Maximum number of files (0 = unlimited)\n * @attr {number} max-size - Maximum file size in bytes (0 = unlimited)\n * @attr {boolean} multiple - Allow selecting multiple files\n * @attr {string} name - Form field name\n * @attr {boolean} required - Mark as required\n * @attr {string} rounded - Border radius: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'\n * @attr {string} size - Component size: 'sm' | 'md' | 'lg'\n * @attr {string} variant - Visual variant: 'solid' | 'flat' | 'bordered' | 'outline' | 'ghost'\n *\n * @fires change - Emitted when the file selection changes. detail: { value: File[], files: File[], originalEvent?: Event }\n * @fires remove - Emitted when a file is removed from the list. detail: { value: File[], file: File, files: File[], originalEvent?: Event }\n *\n * @part wrapper - The outer wrapper div\n * @part label - The label element\n * @part dropzone - The drag-and-drop zone\n * @part input - The hidden native file input\n * @part helper - The helper text element\n * @part error - The error text element\n *\n * @cssprop --file-input-bg - Dropzone background color\n * @cssprop --file-input-border-color - Dropzone border color\n * @cssprop --file-input-radius - Border radius\n * @cssprop --file-input-min-height - Minimum dropzone height\n * @cssprop --file-input-font-size - Font size\n *\n * @example\n * ```html\n * <bit-file-input label=\"Upload files\" accept=\"image/*\" multiple />\n * <bit-file-input label=\"Resume\" accept=\".pdf,.doc,.docx\" max-size=\"5242880\" />\n * <bit-file-input variant=\"bordered\" color=\"primary\" />\n * ```\n */\nexport const FILE_INPUT_TAG = defineComponent<BitFileInputProps, BitFileInputEvents>({\n formAssociated: true,\n props: {\n accept: { default: '' },\n color: { default: undefined },\n disabled: { default: false },\n error: { default: '', omit: true },\n fullwidth: { default: false },\n helper: { default: '' },\n label: { default: '' },\n 'max-files': { default: 0, type: Number },\n 'max-size': { default: 0, type: Number },\n multiple: { default: false },\n name: { default: '' },\n required: { default: false },\n rounded: { default: undefined },\n size: { default: undefined },\n variant: { default: undefined },\n },\n setup({ emit, host, props }) {\n // ============================================\n // State\n // ============================================\n const files = signal<File[]>([]);\n const isDragging = signal(false);\n\n // ============================================\n // Form Integration\n // ============================================\n defineField(\n {\n disabled: computed(() => Boolean(props.disabled.value)),\n toFormValue: (fi: File[]) => {\n if (fi.length === 0) return null;\n\n const name = props.name.value || 'file';\n const fd = new FormData();\n\n for (const file of fi) fd.append(name, file);\n\n return fd;\n },\n value: files,\n },\n {\n onReset: () => {\n files.value = [];\n },\n },\n );\n\n // Sync host attributes for CSS selectors\n const isInvalid = computed(() => Boolean(props.error.value));\n\n effect(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n isInvalid.value ? host.setAttribute('invalid', '') : host.removeAttribute('invalid');\n });\n effect(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n isDragging.value ? host.setAttribute('drag-over', '') : host.removeAttribute('drag-over');\n });\n\n // ============================================\n // IDs\n // ============================================\n const fileInputId = createId('file-input');\n const labelId = `label-${fileInputId}`;\n const helperId = `helper-${fileInputId}`;\n const errorId = `error-${fileInputId}`;\n // ============================================\n // Refs\n // ============================================\n const dropzoneRef = ref<HTMLDivElement>();\n const inputRef = ref<HTMLInputElement>();\n const hintText = computed(() => {\n const parts: string[] = [];\n\n if (props.accept.value) {\n parts.push(\n props.accept.value\n .split(',')\n .map((s: string) => s.trim())\n .join(', '),\n );\n }\n\n const maxSize = props['max-size'].value ?? 0;\n\n if (maxSize > 0) parts.push(`max ${formatBytes(maxSize)}`);\n\n const maxFiles = props['max-files'].value ?? 0;\n\n if (maxFiles > 0) parts.push(`up to ${maxFiles} file${maxFiles !== 1 ? 's' : ''}`);\n\n return parts.join(' · ');\n });\n\n // ============================================\n // File Management\n // ============================================\n function addFiles(newFiles: File[], originalEvent?: Event): void {\n if (props.disabled.value) return;\n\n const maxFilesLimit = props['max-files'].value ?? 0;\n const maxSizeLimit = props['max-size'].value ?? 0;\n const acceptVal = props.accept.value;\n const isMultiple = Boolean(props.multiple.value);\n let incoming = Array.from(newFiles);\n\n if (!isMultiple) incoming = incoming.slice(0, 1);\n\n incoming = incoming.filter((f) => isFileAccepted(f, acceptVal) && isFileSizeAllowed(f, maxSizeLimit));\n\n let updated: File[] = isMultiple ? [...files.value] : [];\n\n for (const f of incoming) {\n if (!updated.includes(f)) updated.push(f);\n }\n\n if (maxFilesLimit > 0 && updated.length > maxFilesLimit) {\n updated = updated.slice(0, maxFilesLimit);\n }\n\n files.value = updated;\n emit('change', { files: files.value, originalEvent, value: files.value });\n }\n function removeFile(file: File, originalEvent?: Event): void {\n files.value = files.value.filter((f) => f !== file);\n emit('remove', { file, files: files.value, originalEvent, value: files.value });\n emit('change', { files: files.value, originalEvent, value: files.value });\n }\n // ============================================\n // Mount\n // ============================================\n onMount(() => {\n const inp = inputRef.value!;\n const dz = dropzoneRef.value!;\n\n // Native input → add files\n handle(inp, 'change', (e: Event) => {\n const input = e.target as HTMLInputElement;\n\n if (input.files?.length) addFiles(Array.from(input.files), e);\n\n input.value = ''; // reset so the same file triggers change again\n });\n // Click dropzone → open file picker\n handle(dz, 'click', () => {\n if (!props.disabled.value) inp.click();\n });\n // Keyboard: Enter / Space → open picker\n handle(dz, 'keydown', (e: KeyboardEvent) => {\n if ((e.key === 'Enter' || e.key === ' ') && !props.disabled.value) {\n e.preventDefault();\n inp.click();\n }\n });\n\n const dropZone = createDropZone({\n disabled: () => Boolean(props.disabled.value),\n element: dz,\n onDrop: (droppedFiles, e) => addFiles(droppedFiles, e),\n onHoverChange: (hovered) => {\n isDragging.value = hovered;\n },\n });\n\n onCleanup(() => dropZone.destroy());\n });\n\n // ============================================\n // Template\n // ============================================\n return html`\n <div class=\"file-input-wrapper\" part=\"wrapper\">\n <label class=\"label-outside\" id=\"${labelId}\" part=\"label\" ?hidden=${() => !props.label.value}\n >${() => props.label.value}</label\n >\n <div\n class=\"dropzone\"\n part=\"dropzone\"\n ref=${dropzoneRef}\n role=\"button\"\n :tabindex=${() => (props.disabled.value ? '-1' : '0')}\n :aria-disabled=${() => String(props.disabled.value)}\n :aria-label=${() => (!props.label.value ? 'File upload drop zone' : null)}\n :aria-labelledby=${() => (props.label.value ? labelId : null)}\n aria-describedby=\"${helperId}\">\n <input\n type=\"file\"\n ref=${inputRef}\n part=\"input\"\n id=\"${fileInputId}\"\n :accept=${() => props.accept.value}\n ?multiple=${() => props.multiple.value}\n ?required=${() => props.required.value}\n ?disabled=${() => props.disabled.value}\n :name=${() => props.name.value}\n hidden\n inert\n tabindex=\"-1\" />\n <div class=\"dropzone-content\">\n <span class=\"dropzone-icon\" aria-hidden=\"true\"> ${uploadIcon} </span>\n <span class=\"dropzone-title\">Drop files here or <u>click to browse</u></span>\n <span class=\"dropzone-hint\" ?hidden=${() => !hintText.value}>${hintText}</span>\n </div>\n </div>\n <ul class=\"file-list\" role=\"list\" aria-label=\"Selected files\" ?hidden=${() => files.value.length === 0}>\n ${each(\n files,\n (file: File) => html`\n <li class=\"file-item\">\n <span class=\"file-icon\" aria-hidden=\"true\"> ${fileIcon} </span>\n <span class=\"file-meta\">\n <span class=\"file-name\" title=\"${file.name}\">${file.name}</span>\n <span class=\"file-size\">${formatBytes(file.size)}</span>\n </span>\n <button\n class=\"file-remove\"\n type=\"button\"\n aria-label=\"${`Remove ${file.name}`}\"\n @click=${(e: Event) => removeFile(file, e)}>\n ${clearIcon}\n </button>\n </li>\n `,\n undefined,\n {\n key: (file: File) => `${file.name}:${file.size}:${file.lastModified}`,\n },\n )}\n </ul>\n <div class=\"helper-text\" id=\"${helperId}\" part=\"helper\" ?hidden=${() => isInvalid.value || !props.helper.value}>\n ${() => props.helper.value}\n </div>\n <div\n class=\"helper-text helper-text-error\"\n id=\"${errorId}\"\n role=\"alert\"\n part=\"error\"\n ?hidden=${() => !isInvalid.value}>\n ${() => props.error.value}\n </div>\n </div>\n `;\n },\n shadow: { delegatesFocus: true },\n styles: [\n ...formFieldMixins,\n sizeVariantMixin(FILE_INPUT_SIZE_PRESET),\n disabledLoadingMixin(),\n forcedColorsFocusMixin('.dropzone'),\n componentStyles,\n ],\n tag: 'bit-file-input',\n});\n"],"mappings":";;;;;;;;;;;;AA0BA,SAAS,EAAY,GAAuB;AAC1C,KAAI,MAAU,EAAG,QAAO;CAExB,IAAM,IAAQ;EAAC;EAAK;EAAM;EAAM;EAAK,EAC/B,IAAI,MACJ,IAAI,KAAK,IAAI,KAAK,MAAM,KAAK,IAAI,EAAM,GAAG,KAAK,IAAI,EAAE,CAAC,EAAE,EAAM,SAAS,EAAE;AAE/E,QAAO,GAAG,OAAO,YAAY,IAAQ,KAAK,GAAG,QAAQ,EAAE,CAAC,CAAC,GAAG,EAAM;;AAGpE,SAAS,EAAc,GAAY,GAAqC;AAGtE,QAFK,IAEE,EACJ,MAAM,IAAI,CACV,KAAK,MAAM,EAAE,MAAM,CAAC,CACpB,MAAM,MACD,EAAQ,WAAW,IAAI,GAAS,EAAK,KAAK,aAA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,MAAM;mBAClF,EAAM,MAAM,MAAM;;;;;gBAKrB,EAAY;;4BAEC,EAAM,SAAS,QAAQ,OAAO,IAAK;iCAC/B,OAAO,EAAM,SAAS,MAAM,CAAC;8BAC9B,EAAM,MAAM,QAAkC,OAA1B,wBAAgC;mCAChD,EAAM,MAAM,QAAQ,IAAU,KAAM;8BAC1C,EAAS;;;kBAGrB,EAAS;;kBAET,EAAY;4BACF,EAAM,OAAO,MAAM;8BACjB,EAAM,SAAS,MAAM;8BACrB,EAAM,SAAS,MAAM;8BACrB,EAAM,SAAS,MAAM;0BACzB,EAAM,KAAK,MAAM;;;;;8DAKmB,EAAW;;wDAEjB,CAAC,EAAS,MAAM,GAAG,EAAS;;;sFAGE,EAAM,MAAM,WAAW,EAAE;YACnG,EACA,IACC,MAAe,CAAI;;8DAE8B,EAAS;;mDAEpB,EAAK,KAAK,IAAI,EAAK,KAAK;4CAC/B,EAAY,EAAK,KAAK,CAAC;;;;;gCAKnC,UAAU,EAAK,OAAO;4BAC1B,MAAa,EAAW,GAAM,EAAE,CAAC;oBACzC,EAAU;;;eAIlB,KAAA,GACA,EACE,MAAM,MAAe,GAAG,EAAK,KAAK,GAAG,EAAK,KAAK,GAAG,EAAK,gBACxD,CACF,CAAC;;uCAE2B,EAAS,gCAAgC,EAAU,SAAS,CAAC,EAAM,OAAO,MAAM;kBACrG,EAAM,OAAO,MAAM;;;;gBAIrB,EAAQ;;;0BAGE,CAAC,EAAU,MAAM;kBACzB,EAAM,MAAM,MAAM;;;;;CAKlC,QAAQ,EAAE,gBAAgB,IAAM;CAChC,QAAQ;EACN,GAAG;EACH,EAAiB,EAAuB;EACxC,GAAsB;EACtB,EAAuB,YAAY;EACnC;EACD;CACD,KAAK;CACN,CAAC"}
|
package/dist/form.cjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./inputs/shared/form-context.cjs`),t=require(`./inputs/form/form.css?inline.cjs`);let n=require(`@vielzeug/craftit`);var r=(0,n.defineComponent)({props:{disabled:(0,n.typed)(!1),novalidate:(0,n.typed)(!1),orientation:(0,n.typed)(`vertical`),size:(0,n.typed)(void 0),validateOn:(0,n.typed)(void 0),variant:(0,n.typed)(void 0)},setup({emit:t,host:r,props:i}){(0,n.provide)(e.FORM_CTX,{disabled:(0,n.computed)(()=>!!i.disabled.value),size:i.size,validateOn:(0,n.computed)(()=>i.validateOn.value??`submit`),variant:i.variant});function a(e){let n=e,i=r.shadowRoot?.querySelector(`form`);i&&(e.preventDefault(),t(`submit`,{formData:new FormData(i),originalEvent:n}))}function o(e){t(`reset`,{originalEvent:e})}return n.html`
|
|
2
|
+
<form
|
|
3
|
+
part="form"
|
|
4
|
+
:novalidate="${()=>i.novalidate.value||null}"
|
|
5
|
+
:aria-disabled="${()=>i.disabled.value?`true`:null}"
|
|
6
|
+
@submit="${a}"
|
|
7
|
+
@reset="${o}">
|
|
8
|
+
<slot></slot>
|
|
9
|
+
</form>
|
|
10
|
+
`},shadow:{delegatesFocus:!1},styles:[t.default],tag:`bit-form`});exports.FORM_TAG=r;
|
|
11
|
+
//# sourceMappingURL=form.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.cjs","names":[],"sources":["../src/inputs/form/form.ts"],"sourcesContent":["import { computed, defineComponent, html, typed, provide } from '@vielzeug/craftit';\n\nimport type { ComponentSize, VisualVariant } from '../../types';\n\nimport { FORM_CTX } from '../shared/form-context';\n// ============================================\n// Styles\n// ============================================\nimport componentStyles from './form.css?inline';\n\n// ============================================\n// Types\n// ============================================\n\nexport type BitFormEvents = {\n reset: { originalEvent: Event };\n submit: { formData: FormData; originalEvent: SubmitEvent };\n};\n\nexport type BitFormProps = {\n /** Disable all child form fields */\n disabled?: boolean;\n /** Native form novalidate */\n novalidate?: boolean;\n /** Form layout orientation */\n orientation?: 'vertical' | 'horizontal';\n /** Default size for all child fields */\n size?: ComponentSize;\n /**\n * When to validate child form controls.\n * - `'submit'` (default): validate only when the form is submitted\n * - `'blur'`: validate each field as it loses focus\n * - `'change'`: validate on every value change (most immediate feedback)\n */\n validateOn?: 'submit' | 'blur' | 'change';\n /** Default variant for all child fields */\n variant?: Exclude<VisualVariant, 'glass' | 'frost' | 'text'>;\n};\n\n/**\n * `bit-form` — Native `<form>` wrapper that propagates `disabled`, `size`, and `variant`\n * context to all child `bit-*` form fields. Intercepts submit/reset events.\n *\n * @element bit-form\n *\n * @attr {boolean} disabled - Disable all child form fields\n * @attr {string} size - Default size: 'sm' | 'md' | 'lg'\n * @attr {string} variant - Default visual variant for child fields\n * @attr {string} orientation - Layout direction: 'vertical' | 'horizontal'\n * @attr {boolean} novalidate - Skip native browser validation\n *\n * @fires submit - Fired on form submit; detail contains `formData` and `originalEvent`\n * @fires reset - Fired on form reset; detail contains `originalEvent`\n *\n * @slot - Form content (bit-input, bit-select, etc.)\n *\n * @cssprop --form-gap - Spacing between child form controls\n *\n * @example\n * ```html\n * <bit-form id=\"my-form\" size=\"sm\" variant=\"flat\">\n * <bit-input name=\"email\" label=\"Email\" type=\"email\"></bit-input>\n * <bit-select name=\"role\" label=\"Role\">\n * <option value=\"admin\">Admin</option>\n * </bit-select>\n * <bit-button type=\"submit\">Submit</bit-button>\n * </bit-form>\n * ```\n */\nexport const FORM_TAG = defineComponent<BitFormProps, BitFormEvents>({\n props: {\n disabled: typed<boolean>(false),\n novalidate: typed<boolean>(false),\n orientation: typed<BitFormProps['orientation']>('vertical'),\n size: typed<BitFormProps['size']>(undefined),\n validateOn: typed<BitFormProps['validateOn']>(undefined),\n variant: typed<BitFormProps['variant']>(undefined),\n },\n setup({ emit, host, props }) {\n // Provide context to all child bit-* form fields\n provide(FORM_CTX, {\n disabled: computed(() => Boolean(props.disabled.value)),\n size: props.size,\n validateOn: computed(() => props.validateOn.value ?? 'submit'),\n variant: props.variant,\n });\n // ── Event handlers ────────────────────────────────────────────────────────\n function handleSubmit(e: Event) {\n const submitEvent = e as SubmitEvent;\n const formEl = host.shadowRoot?.querySelector('form');\n\n if (!formEl) return;\n\n e.preventDefault();\n\n const formData = new FormData(formEl);\n\n emit('submit', { formData, originalEvent: submitEvent });\n }\n function handleReset(e: Event) {\n emit('reset', { originalEvent: e });\n }\n\n return html`\n <form\n part=\"form\"\n :novalidate=\"${() => props.novalidate.value || null}\"\n :aria-disabled=\"${() => (props.disabled.value ? 'true' : null)}\"\n @submit=\"${handleSubmit}\"\n @reset=\"${handleReset}\">\n <slot></slot>\n </form>\n `;\n },\n shadow: { delegatesFocus: false },\n styles: [componentStyles],\n tag: 'bit-form',\n});\n"],"mappings":"yMAqEA,IAAa,GAAA,EAAA,EAAA,iBAAwD,CACnE,MAAO,CACL,UAAA,EAAA,EAAA,OAAyB,GAAM,CAC/B,YAAA,EAAA,EAAA,OAA2B,GAAM,CACjC,aAAA,EAAA,EAAA,OAAgD,WAAW,CAC3D,MAAA,EAAA,EAAA,OAAkC,IAAA,GAAU,CAC5C,YAAA,EAAA,EAAA,OAA8C,IAAA,GAAU,CACxD,SAAA,EAAA,EAAA,OAAwC,IAAA,GAAU,CACnD,CACD,MAAM,CAAE,OAAM,OAAM,SAAS,EAE3B,EAAA,EAAA,SAAQ,EAAA,SAAU,CAChB,UAAA,EAAA,EAAA,cAAyB,EAAQ,EAAM,SAAS,MAAO,CACvD,KAAM,EAAM,KACZ,YAAA,EAAA,EAAA,cAA2B,EAAM,WAAW,OAAS,SAAS,CAC9D,QAAS,EAAM,QAChB,CAAC,CAEF,SAAS,EAAa,EAAU,CAC9B,IAAM,EAAc,EACd,EAAS,EAAK,YAAY,cAAc,OAAO,CAEhD,IAEL,EAAE,gBAAgB,CAIlB,EAAK,SAAU,CAAE,SAFA,IAAI,SAAS,EAAO,CAEV,cAAe,EAAa,CAAC,EAE1D,SAAS,EAAY,EAAU,CAC7B,EAAK,QAAS,CAAE,cAAe,EAAG,CAAC,CAGrC,MAAO,GAAA,IAAI;;;2BAGc,EAAM,WAAW,OAAS,KAAK;8BAC3B,EAAM,SAAS,MAAQ,OAAS,KAAM;mBACpD,EAAa;kBACd,EAAY;;;OAK5B,OAAQ,CAAE,eAAgB,GAAO,CACjC,OAAQ,CAAC,EAAA,QAAgB,CACzB,IAAK,WACN,CAAC"}
|
package/dist/form.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { FORM_CTX as e } from "./inputs/shared/form-context.js";
|
|
2
|
+
import t from "./inputs/form/form.css?inline.js";
|
|
3
|
+
import { computed as n, defineComponent as r, html as i, provide as a, typed as o } from "@vielzeug/craftit";
|
|
4
|
+
//#region src/inputs/form/form.ts
|
|
5
|
+
var s = r({
|
|
6
|
+
props: {
|
|
7
|
+
disabled: o(!1),
|
|
8
|
+
novalidate: o(!1),
|
|
9
|
+
orientation: o("vertical"),
|
|
10
|
+
size: o(void 0),
|
|
11
|
+
validateOn: o(void 0),
|
|
12
|
+
variant: o(void 0)
|
|
13
|
+
},
|
|
14
|
+
setup({ emit: t, host: r, props: o }) {
|
|
15
|
+
a(e, {
|
|
16
|
+
disabled: n(() => !!o.disabled.value),
|
|
17
|
+
size: o.size,
|
|
18
|
+
validateOn: n(() => o.validateOn.value ?? "submit"),
|
|
19
|
+
variant: o.variant
|
|
20
|
+
});
|
|
21
|
+
function s(e) {
|
|
22
|
+
let n = e, i = r.shadowRoot?.querySelector("form");
|
|
23
|
+
i && (e.preventDefault(), t("submit", {
|
|
24
|
+
formData: new FormData(i),
|
|
25
|
+
originalEvent: n
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
function c(e) {
|
|
29
|
+
t("reset", { originalEvent: e });
|
|
30
|
+
}
|
|
31
|
+
return i`
|
|
32
|
+
<form
|
|
33
|
+
part="form"
|
|
34
|
+
:novalidate="${() => o.novalidate.value || null}"
|
|
35
|
+
:aria-disabled="${() => o.disabled.value ? "true" : null}"
|
|
36
|
+
@submit="${s}"
|
|
37
|
+
@reset="${c}">
|
|
38
|
+
<slot></slot>
|
|
39
|
+
</form>
|
|
40
|
+
`;
|
|
41
|
+
},
|
|
42
|
+
shadow: { delegatesFocus: !1 },
|
|
43
|
+
styles: [t],
|
|
44
|
+
tag: "bit-form"
|
|
45
|
+
});
|
|
46
|
+
//#endregion
|
|
47
|
+
export { s as FORM_TAG };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=form.js.map
|