@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
package/dist/tooltip.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { forcedColorsMixin as e } from "./styles/mixins/theme.css.js";
|
|
2
|
+
import "./styles/index.js";
|
|
3
|
+
import t from "./overlay/tooltip/tooltip.css?inline.js";
|
|
4
|
+
import { computed as n, createId as r, defineComponent as i, html as a, onMount as o, onSlotChange as s, signal as c, watch as l } from "@vielzeug/craftit";
|
|
5
|
+
import { autoUpdate as u, computePosition as d, flip as f, offset as p, shift as m } from "@vielzeug/floatit";
|
|
6
|
+
//#region src/overlay/tooltip/tooltip.ts
|
|
7
|
+
var h = 8, g = 4, _ = i({
|
|
8
|
+
props: {
|
|
9
|
+
"close-delay": { default: 0 },
|
|
10
|
+
content: { default: "" },
|
|
11
|
+
delay: { default: 0 },
|
|
12
|
+
disabled: { default: !1 },
|
|
13
|
+
open: { default: void 0 },
|
|
14
|
+
placement: { default: "top" },
|
|
15
|
+
size: { default: void 0 },
|
|
16
|
+
trigger: { default: "hover,focus" },
|
|
17
|
+
variant: { default: void 0 }
|
|
18
|
+
},
|
|
19
|
+
setup({ host: e, props: t }) {
|
|
20
|
+
let i = c(!1), _ = c("top"), v = null, y = null, b = null, x = null, S = r("tooltip"), C = n(() => String(t.trigger.value).split(",").map((e) => e.trim()).filter(Boolean));
|
|
21
|
+
function w() {
|
|
22
|
+
return (e.shadowRoot?.querySelector("slot:not([name])"))?.assignedElements({ flatten: !0 })?.[0] ?? null;
|
|
23
|
+
}
|
|
24
|
+
function T() {
|
|
25
|
+
if (!x) return;
|
|
26
|
+
let e = w();
|
|
27
|
+
e && d(e, x, {
|
|
28
|
+
middleware: [
|
|
29
|
+
p(h),
|
|
30
|
+
f(),
|
|
31
|
+
m({ padding: 6 })
|
|
32
|
+
],
|
|
33
|
+
placement: t.placement.value
|
|
34
|
+
}).then(({ placement: e, x: t, y: n }) => {
|
|
35
|
+
if (!x) return;
|
|
36
|
+
let r = e.split("-")[0], i = r === "left" ? t - g : t;
|
|
37
|
+
x.style.left = `${i}px`, x.style.top = `${n}px`, _.value = r;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function E() {
|
|
41
|
+
t.open.value !== void 0 || t.disabled.value || !t.content.value && !(((e.shadowRoot?.querySelector("slot[name=\"content\"]"))?.assignedNodes({ flatten: !0 }).length ?? 0) > 0) || (b &&= (clearTimeout(b), null), y && clearTimeout(y), y = setTimeout(() => {
|
|
42
|
+
i.value = !0, x && !x.matches(":popover-open") && x.showPopover();
|
|
43
|
+
let e = w();
|
|
44
|
+
e && x ? (v?.(), v = u(e, x, T)) : requestAnimationFrame(() => T());
|
|
45
|
+
}, Number(t.delay.value) || 0));
|
|
46
|
+
}
|
|
47
|
+
function D() {
|
|
48
|
+
if (t.open.value !== void 0) return;
|
|
49
|
+
y &&= (clearTimeout(y), null);
|
|
50
|
+
let e = Number(t["close-delay"].value) || 0;
|
|
51
|
+
e > 0 ? (b && clearTimeout(b), b = setTimeout(() => {
|
|
52
|
+
b = null, O();
|
|
53
|
+
}, e)) : O();
|
|
54
|
+
}
|
|
55
|
+
function O() {
|
|
56
|
+
v?.(), v = null, i.value = !1, x?.matches(":popover-open") && x.hidePopover();
|
|
57
|
+
}
|
|
58
|
+
function k() {
|
|
59
|
+
i.value ? D() : E();
|
|
60
|
+
}
|
|
61
|
+
o(() => {
|
|
62
|
+
let n = e.shadowRoot?.querySelector("slot:not([name])");
|
|
63
|
+
if (!n) return;
|
|
64
|
+
let r = () => {
|
|
65
|
+
a();
|
|
66
|
+
let e = n.assignedElements({ flatten: !0 })[0];
|
|
67
|
+
if (!e) return;
|
|
68
|
+
e.setAttribute("aria-describedby", S);
|
|
69
|
+
let t = C.value;
|
|
70
|
+
t.includes("hover") && (e.addEventListener("pointerenter", E), e.addEventListener("pointerleave", D)), t.includes("focus") && (e.addEventListener("focusin", E), e.addEventListener("focusout", D)), t.includes("click") && e.addEventListener("click", k), document.addEventListener("keydown", A);
|
|
71
|
+
}, a = () => {
|
|
72
|
+
let e = n.assignedElements({ flatten: !0 })[0];
|
|
73
|
+
e && (e.removeAttribute("aria-describedby"), e.removeEventListener("pointerenter", E), e.removeEventListener("pointerleave", D), e.removeEventListener("focusin", E), e.removeEventListener("focusout", D), e.removeEventListener("click", k), document.removeEventListener("keydown", A));
|
|
74
|
+
};
|
|
75
|
+
return s("default", r), l(t.open, (e) => {
|
|
76
|
+
if (e != null) if (e) {
|
|
77
|
+
i.value = !0, x && !x.matches(":popover-open") && x.showPopover();
|
|
78
|
+
let e = w();
|
|
79
|
+
e && x ? (v?.(), v = u(e, x, T)) : requestAnimationFrame(() => T());
|
|
80
|
+
} else O();
|
|
81
|
+
}), () => {
|
|
82
|
+
a(), y && clearTimeout(y), b && clearTimeout(b), v?.(), v = null, x?.matches(":popover-open") && x.hidePopover();
|
|
83
|
+
};
|
|
84
|
+
});
|
|
85
|
+
function A(e) {
|
|
86
|
+
e.key === "Escape" && D();
|
|
87
|
+
}
|
|
88
|
+
return a`
|
|
89
|
+
<slot></slot>
|
|
90
|
+
<div
|
|
91
|
+
class="tooltip"
|
|
92
|
+
part="tooltip"
|
|
93
|
+
id="${S}"
|
|
94
|
+
role="tooltip"
|
|
95
|
+
popover="manual"
|
|
96
|
+
ref=${(e) => {
|
|
97
|
+
x = e;
|
|
98
|
+
}}
|
|
99
|
+
:data-placement="${_}"
|
|
100
|
+
:aria-hidden="${() => String(!i.value)}">
|
|
101
|
+
<slot name="content">${() => t.content.value}</slot>
|
|
102
|
+
</div>
|
|
103
|
+
`;
|
|
104
|
+
},
|
|
105
|
+
styles: [e, t],
|
|
106
|
+
tag: "bit-tooltip"
|
|
107
|
+
});
|
|
108
|
+
//#endregion
|
|
109
|
+
export { _ as TOOLTIP_TAG };
|
|
110
|
+
|
|
111
|
+
//# sourceMappingURL=tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.js","names":[],"sources":["../src/overlay/tooltip/tooltip.ts"],"sourcesContent":["import type { Placement } from '@vielzeug/floatit';\n\nimport { computed, createId, defineComponent, html, onMount, onSlotChange, signal, watch } from '@vielzeug/craftit';\nimport { autoUpdate, computePosition, flip, offset, shift } from '@vielzeug/floatit';\n\nimport type { ComponentSize } from '../../types';\n\nimport { forcedColorsMixin } from '../../styles';\n\ntype TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';\ntype TooltipTrigger = 'hover' | 'focus' | 'click';\n\nconst TOOLTIP_OFFSET = 8; // gap from trigger to tooltip edge\nconst LEFT_GAP_COMPENSATION = 4; // left placement looks visually tighter in practice\n\nimport styles from './tooltip.css?inline';\n\n/** Tooltip component properties */\nexport type BitTooltipProps = {\n /** Hide delay in ms (useful to keep tooltip open when moving focus between trigger and tooltip) */\n 'close-delay'?: number;\n /** Tooltip text content */\n content?: string;\n /** Show delay in ms */\n delay?: number;\n /** Disable the tooltip */\n disabled?: boolean;\n /** Controlled open state. When provided, the tooltip acts as a controlled component and ignores trigger events for open/close. */\n open?: boolean;\n /** Preferred placement relative to trigger */\n placement?: TooltipPlacement;\n /** Tooltip size */\n size?: ComponentSize;\n /** Which trigger(s) show/hide the tooltip — comma-separated if multiple, e.g. \"hover,focus\" */\n trigger?: string;\n /** Visual variant: 'dark' (default) or 'light' */\n variant?: 'dark' | 'light';\n};\n\n/**\n * A lightweight tooltip shown on hover/focus/click relative to the slotted trigger.\n *\n * @element bit-tooltip\n *\n * @attr {string} content - Tooltip text content\n * @attr {string} placement - 'top' | 'bottom' | 'left' | 'right' (default: 'top')\n * @attr {string} trigger - 'hover' | 'focus' | 'click' or comma-separated combination\n * @attr {number} delay - Show delay in milliseconds (default: 0)\n * @attr {string} size - Size: 'sm' | 'md' | 'lg'\n * @attr {string} variant - 'dark' (default) | 'light'\n * @attr {boolean} disabled - Disable the tooltip\n *\n * @slot - Trigger element that the tooltip is anchored to\n * @slot content - Complex tooltip content (overrides the `content` attribute)\n *\n * @cssprop --tooltip-max-width - Max width of the tooltip bubble\n *\n * @example\n * ```html\n * <bit-tooltip content=\"Copy to clipboard\">\n * <button>Copy</button>\n * </bit-tooltip>\n *\n * <bit-tooltip placement=\"right\" trigger=\"focus,hover\" content=\"Required field\">\n * <input type=\"text\" />\n * </bit-tooltip>\n * ```\n */\nexport const TOOLTIP_TAG = defineComponent<BitTooltipProps>({\n props: {\n 'close-delay': { default: 0 },\n content: { default: '' },\n delay: { default: 0 },\n disabled: { default: false },\n open: { default: undefined },\n placement: { default: 'top' },\n size: { default: undefined },\n trigger: { default: 'hover,focus' },\n variant: { default: undefined },\n },\n setup({ host, props }) {\n const visible = signal(false);\n const activePlacement = signal<TooltipPlacement>('top');\n let autoUpdateCleanup: (() => void) | null = null;\n let showTimer: ReturnType<typeof setTimeout> | null = null;\n let hideTimer: ReturnType<typeof setTimeout> | null = null;\n let tooltipEl: HTMLElement | null = null;\n const tooltipId = createId('tooltip');\n const triggers = computed<TooltipTrigger[]>(() =>\n String(props.trigger.value)\n .split(',')\n .map((t: string) => t.trim() as TooltipTrigger)\n .filter(Boolean),\n );\n\n function getTriggerEl(): Element | null {\n // First slotted element is the trigger\n const slot = host.shadowRoot?.querySelector<HTMLSlotElement>('slot:not([name])');\n const assigned = slot?.assignedElements({ flatten: true });\n\n return assigned?.[0] ?? null;\n }\n function updatePosition() {\n if (!tooltipEl) return;\n\n const triggerEl = getTriggerEl();\n\n if (!triggerEl) return;\n\n computePosition(triggerEl, tooltipEl, {\n middleware: [offset(TOOLTIP_OFFSET), flip(), shift({ padding: 6 })],\n placement: props.placement.value as Placement,\n }).then(({ placement, x, y }) => {\n if (!tooltipEl) return;\n\n const side = placement.split('-')[0] as TooltipPlacement;\n const adjustedX = side === 'left' ? x - LEFT_GAP_COMPENSATION : x;\n\n tooltipEl.style.left = `${adjustedX}px`;\n tooltipEl.style.top = `${y}px`;\n\n activePlacement.value = side;\n });\n }\n function show() {\n if (props.open.value !== undefined) return; // controlled mode\n\n const hasSlottedContent = () => {\n const contentSlot = host.shadowRoot?.querySelector<HTMLSlotElement>('slot[name=\"content\"]');\n\n return (contentSlot?.assignedNodes({ flatten: true }).length ?? 0) > 0;\n };\n\n if (props.disabled.value || (!props.content.value && !hasSlottedContent())) return;\n\n if (hideTimer) {\n clearTimeout(hideTimer);\n hideTimer = null;\n }\n\n if (showTimer) clearTimeout(showTimer);\n\n showTimer = setTimeout(\n () => {\n visible.value = true;\n\n if (tooltipEl && !tooltipEl.matches(':popover-open')) {\n tooltipEl.showPopover();\n }\n\n // Start autoUpdate: repositions on scroll, resize, and reference size change\n const triggerEl = getTriggerEl();\n\n if (triggerEl && tooltipEl) {\n autoUpdateCleanup?.();\n autoUpdateCleanup = autoUpdate(triggerEl, tooltipEl, updatePosition);\n } else {\n requestAnimationFrame(() => updatePosition());\n }\n },\n Number(props.delay.value) || 0,\n );\n }\n function hide() {\n if (props.open.value !== undefined) return; // controlled mode\n\n if (showTimer) {\n clearTimeout(showTimer);\n showTimer = null;\n }\n\n const closeDelay = Number(props['close-delay'].value) || 0;\n\n if (closeDelay > 0) {\n if (hideTimer) clearTimeout(hideTimer);\n\n hideTimer = setTimeout(() => {\n hideTimer = null;\n _doHide();\n }, closeDelay);\n } else {\n _doHide();\n }\n }\n function _doHide() {\n autoUpdateCleanup?.();\n autoUpdateCleanup = null;\n visible.value = false;\n\n if (tooltipEl?.matches(':popover-open')) {\n tooltipEl.hidePopover();\n }\n }\n function toggleClick() {\n if (visible.value) hide();\n else show();\n }\n onMount(() => {\n const slot = host.shadowRoot?.querySelector<HTMLSlotElement>('slot:not([name])');\n\n if (!slot) return;\n\n const bindTriggerEvents = () => {\n unbindTriggerEvents(); // clean up previous bindings\n\n const triggerEl = slot.assignedElements({ flatten: true })[0] as HTMLElement | undefined;\n\n if (!triggerEl) return;\n\n triggerEl.setAttribute('aria-describedby', tooltipId);\n\n const t = triggers.value;\n\n if (t.includes('hover')) {\n triggerEl.addEventListener('pointerenter', show);\n triggerEl.addEventListener('pointerleave', hide);\n }\n\n if (t.includes('focus')) {\n triggerEl.addEventListener('focusin', show);\n triggerEl.addEventListener('focusout', hide);\n }\n\n if (t.includes('click')) {\n triggerEl.addEventListener('click', toggleClick);\n }\n\n // Keyboard escape to dismiss\n document.addEventListener('keydown', handleKeydown);\n };\n const unbindTriggerEvents = () => {\n const triggerEl = slot.assignedElements({ flatten: true })[0] as HTMLElement | undefined;\n\n if (!triggerEl) return;\n\n triggerEl.removeAttribute('aria-describedby');\n triggerEl.removeEventListener('pointerenter', show);\n triggerEl.removeEventListener('pointerleave', hide);\n triggerEl.removeEventListener('focusin', show);\n triggerEl.removeEventListener('focusout', hide);\n triggerEl.removeEventListener('click', toggleClick);\n document.removeEventListener('keydown', handleKeydown);\n };\n\n onSlotChange('default', bindTriggerEvents);\n // Controlled mode: watch the `open` prop and show/hide accordingly\n watch(props.open, (openVal) => {\n if (openVal === undefined || openVal === null) return;\n\n if (openVal) {\n visible.value = true;\n\n if (tooltipEl && !tooltipEl.matches(':popover-open')) tooltipEl.showPopover();\n\n const triggerEl = getTriggerEl();\n\n if (triggerEl && tooltipEl) {\n autoUpdateCleanup?.();\n autoUpdateCleanup = autoUpdate(triggerEl, tooltipEl, updatePosition);\n } else {\n requestAnimationFrame(() => updatePosition());\n }\n } else {\n _doHide();\n }\n });\n\n return () => {\n unbindTriggerEvents();\n\n if (showTimer) clearTimeout(showTimer);\n\n if (hideTimer) clearTimeout(hideTimer);\n\n autoUpdateCleanup?.();\n autoUpdateCleanup = null;\n\n if (tooltipEl?.matches(':popover-open')) {\n tooltipEl.hidePopover();\n }\n };\n });\n function handleKeydown(e: KeyboardEvent) {\n if (e.key === 'Escape') hide();\n }\n\n return html`\n <slot></slot>\n <div\n class=\"tooltip\"\n part=\"tooltip\"\n id=\"${tooltipId}\"\n role=\"tooltip\"\n popover=\"manual\"\n ref=${(el: HTMLElement) => {\n tooltipEl = el;\n }}\n :data-placement=\"${activePlacement}\"\n :aria-hidden=\"${() => String(!visible.value)}\">\n <slot name=\"content\">${() => props.content.value}</slot>\n </div>\n `;\n },\n styles: [forcedColorsMixin, styles],\n tag: 'bit-tooltip',\n});\n"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared TypeScript Types for BuildIt Components
|
|
3
|
+
*
|
|
4
|
+
* This file provides reusable type utilities and common type definitions
|
|
5
|
+
* used across all BuildIt components for better type safety and DRX.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Form validity methods exposed on form-associated custom elements.
|
|
9
|
+
* Mirrors the constraint validation API so form libraries (React Hook Form,
|
|
10
|
+
* etc.) and native `<form>` can interact with bit-* form controls directly.
|
|
11
|
+
*/
|
|
12
|
+
export type FormValidityMethods = {
|
|
13
|
+
/** Returns true if the element's value satisfies all constraints. */
|
|
14
|
+
checkValidity(): boolean;
|
|
15
|
+
/** Same as checkValidity() but also fires an invalid event and shows the
|
|
16
|
+
* browser's validation UI when the element is invalid. */
|
|
17
|
+
reportValidity(): boolean;
|
|
18
|
+
/** Sets a custom validation message. Pass an empty string to clear. */
|
|
19
|
+
setCustomValidity(message: string): void;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Component size variants
|
|
23
|
+
* Consistent across all sized components
|
|
24
|
+
*/
|
|
25
|
+
export type ComponentSize = 'sm' | 'md' | 'lg';
|
|
26
|
+
/**
|
|
27
|
+
* Theme color options
|
|
28
|
+
* Semantic colors used across the design system
|
|
29
|
+
*/
|
|
30
|
+
export type ThemeColor = 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error';
|
|
31
|
+
/**
|
|
32
|
+
* Visual variant types
|
|
33
|
+
* Common across interactive components
|
|
34
|
+
*/
|
|
35
|
+
export type VisualVariant = 'solid' | 'flat' | 'bordered' | 'outline' | 'ghost' | 'text' | 'frost' | 'glass';
|
|
36
|
+
/**
|
|
37
|
+
* Rounded corner sizes
|
|
38
|
+
* Border radius variants
|
|
39
|
+
*/
|
|
40
|
+
export type RoundedSize = 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full';
|
|
41
|
+
/**
|
|
42
|
+
* Elevation levels
|
|
43
|
+
* Shadow depth from 0 (flat) to 5 (highest)
|
|
44
|
+
*/
|
|
45
|
+
export type ElevationLevel = 0 | 1 | 2 | 3 | 4 | 5;
|
|
46
|
+
/**
|
|
47
|
+
* Padding sizes
|
|
48
|
+
* Internal spacing variants
|
|
49
|
+
*/
|
|
50
|
+
export type PaddingSize = 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
|
51
|
+
/**
|
|
52
|
+
* Button types for form submission
|
|
53
|
+
*/
|
|
54
|
+
export type ButtonType = 'button' | 'submit' | 'reset';
|
|
55
|
+
/**
|
|
56
|
+
* Input types
|
|
57
|
+
* HTML5 input type attribute values
|
|
58
|
+
*/
|
|
59
|
+
export type InputType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search' | 'date' | 'time' | 'datetime-local' | 'month' | 'week';
|
|
60
|
+
/**
|
|
61
|
+
* Props for components that support theming
|
|
62
|
+
*/
|
|
63
|
+
export type ThemableProps = {
|
|
64
|
+
/** Theme color */
|
|
65
|
+
color?: ThemeColor;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Props for components with size variants
|
|
69
|
+
*/
|
|
70
|
+
export type SizableProps = {
|
|
71
|
+
/** Component size */
|
|
72
|
+
size?: ComponentSize;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Props for interactive components that can be disabled
|
|
76
|
+
*/
|
|
77
|
+
export type DisablableProps = {
|
|
78
|
+
/** Disable interaction */
|
|
79
|
+
disabled?: boolean;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Props for components with loading state
|
|
83
|
+
*/
|
|
84
|
+
export type LoadableProps = {
|
|
85
|
+
/** Loading state */
|
|
86
|
+
loading?: boolean;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Props for form elements
|
|
90
|
+
*/
|
|
91
|
+
export type FormElementProps = {
|
|
92
|
+
/** Form field name */
|
|
93
|
+
name?: string;
|
|
94
|
+
/** Field value */
|
|
95
|
+
value?: string;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Props for checkable elements (checkbox, radio)
|
|
99
|
+
*/
|
|
100
|
+
export type CheckableProps = FormElementProps & {
|
|
101
|
+
/** Checked state */
|
|
102
|
+
checked?: boolean;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Adds type-safe `addEventListener` / `removeEventListener` overloads to a custom element type.
|
|
106
|
+
*
|
|
107
|
+
* The event map `T` uses plain detail shapes (the same type passed to `defineEmits`):
|
|
108
|
+
* ```ts
|
|
109
|
+
* export interface BitInputEvents {
|
|
110
|
+
* change: { value: string; originalEvent: Event };
|
|
111
|
+
* input: { value: string; originalEvent: Event };
|
|
112
|
+
* }
|
|
113
|
+
* ```
|
|
114
|
+
* Each entry is automatically wrapped in `CustomEvent<Detail>` for the listener signature.
|
|
115
|
+
*/
|
|
116
|
+
export type AddEventListeners<T> = {
|
|
117
|
+
addEventListener<K extends keyof T & string>(type: K, listener: (this: HTMLElement, ev: CustomEvent<T[K]>) => void, options?: boolean | AddEventListenerOptions): void;
|
|
118
|
+
removeEventListener<K extends keyof T & string>(type: K, listener: (this: HTMLElement, ev: CustomEvent<T[K]>) => void, options?: boolean | EventListenerOptions): void;
|
|
119
|
+
};
|
|
120
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/types/shared.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=50;function t(t,n,r=`animation`){let i=!1,a=null,o=()=>{i||(i=!0,a!==null&&(clearTimeout(a),a=null),n())};queueMicrotask(()=>{let n=getComputedStyle(t);if(r===`animation`){let r=n.animationName.split(`,`).map(e=>e.trim()),i=n.animationDuration.split(`,`).map(e=>e.endsWith(`ms`)?Number.parseFloat(e):e.endsWith(`s`)?Number.parseFloat(e)*1e3:0),s=r.some(e=>e&&e!==`none`),c=Math.max(0,...i);if(!s||c<=0){o();return}t.addEventListener(`animationend`,o,{once:!0}),a=setTimeout(o,c+e)}else{let r=Number.parseFloat(n.transitionDuration);if(!r||r<=0){o();return}t.addEventListener(`transitionend`,o,{once:!0}),a=setTimeout(o,r*1e3+e)}})}exports.awaitExit=t;
|
|
2
|
+
//# sourceMappingURL=animation.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation.cjs","names":[],"sources":["../../src/utils/animation.ts"],"sourcesContent":["/**\n * Waits for a CSS exit animation or transition to finish, then calls `onDone`.\n *\n * When the element has no animation/transition running (e.g. reduced-motion or\n * overridden styles), `onDone` is called synchronously on the next microtask so\n * callers can safely set exit state before this call.\n *\n * @param el - The element whose animation/transition to observe.\n * @param onDone - Callback invoked exactly once when the animation ends.\n * @param type - `'animation'` (default) or `'transition'`.\n */\n/** Safety buffer added to the computed CSS duration before the fallback timer fires. */\nconst ANIMATION_FALLBACK_BUFFER_MS = 50;\n\nexport function awaitExit(el: Element, onDone: () => void, type: 'animation' | 'transition' = 'animation'): void {\n let finished = false;\n let fallbackTimer: ReturnType<typeof setTimeout> | null = null;\n\n const finish = () => {\n if (finished) return;\n\n finished = true;\n\n if (fallbackTimer !== null) {\n clearTimeout(fallbackTimer);\n fallbackTimer = null;\n }\n\n onDone();\n };\n\n queueMicrotask(() => {\n const styles = getComputedStyle(el);\n\n if (type === 'animation') {\n const names = styles.animationName.split(',').map((v) => v.trim());\n const durations = styles.animationDuration.split(',').map((v) => {\n if (v.endsWith('ms')) return Number.parseFloat(v);\n\n if (v.endsWith('s')) return Number.parseFloat(v) * 1000;\n\n return 0;\n });\n\n const hasAnimation = names.some((n) => n && n !== 'none');\n const maxDuration = Math.max(0, ...durations);\n\n if (!hasAnimation || maxDuration <= 0) {\n finish();\n\n return;\n }\n\n el.addEventListener('animationend', finish, { once: true });\n fallbackTimer = setTimeout(finish, maxDuration + ANIMATION_FALLBACK_BUFFER_MS);\n } else {\n const duration = Number.parseFloat(styles.transitionDuration);\n\n if (!duration || duration <= 0) {\n finish();\n\n return;\n }\n\n el.addEventListener('transitionend', finish, { once: true });\n fallbackTimer = setTimeout(finish, duration * 1000 + ANIMATION_FALLBACK_BUFFER_MS);\n }\n });\n}\n"],"mappings":"AAYA,IAAM,EAA+B,GAErC,SAAgB,EAAU,EAAa,EAAoB,EAAmC,YAAmB,CAC/G,IAAI,EAAW,GACX,EAAsD,KAEpD,MAAe,CACf,IAEJ,EAAW,GAEP,IAAkB,OACpB,aAAa,EAAc,CAC3B,EAAgB,MAGlB,GAAQ,GAGV,mBAAqB,CACnB,IAAM,EAAS,iBAAiB,EAAG,CAEnC,GAAI,IAAS,YAAa,CACxB,IAAM,EAAQ,EAAO,cAAc,MAAM,IAAI,CAAC,IAAK,GAAM,EAAE,MAAM,CAAC,CAC5D,EAAY,EAAO,kBAAkB,MAAM,IAAI,CAAC,IAAK,GACrD,EAAE,SAAS,KAAK,CAAS,OAAO,WAAW,EAAE,CAE7C,EAAE,SAAS,IAAI,CAAS,OAAO,WAAW,EAAE,CAAG,IAE5C,EACP,CAEI,EAAe,EAAM,KAAM,GAAM,GAAK,IAAM,OAAO,CACnD,EAAc,KAAK,IAAI,EAAG,GAAG,EAAU,CAE7C,GAAI,CAAC,GAAgB,GAAe,EAAG,CACrC,GAAQ,CAER,OAGF,EAAG,iBAAiB,eAAgB,EAAQ,CAAE,KAAM,GAAM,CAAC,CAC3D,EAAgB,WAAW,EAAQ,EAAc,EAA6B,KACzE,CACL,IAAM,EAAW,OAAO,WAAW,EAAO,mBAAmB,CAE7D,GAAI,CAAC,GAAY,GAAY,EAAG,CAC9B,GAAQ,CAER,OAGF,EAAG,iBAAiB,gBAAiB,EAAQ,CAAE,KAAM,GAAM,CAAC,CAC5D,EAAgB,WAAW,EAAQ,EAAW,IAAO,EAA6B,GAEpF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/utils/animation.ts"],"names":[],"mappings":"AAcA,wBAAgB,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,EAAE,IAAI,GAAE,WAAW,GAAG,YAA0B,GAAG,IAAI,CAsD/G"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/utils/animation.ts
|
|
2
|
+
var e = 50;
|
|
3
|
+
function t(t, n, r = "animation") {
|
|
4
|
+
let i = !1, a = null, o = () => {
|
|
5
|
+
i || (i = !0, a !== null && (clearTimeout(a), a = null), n());
|
|
6
|
+
};
|
|
7
|
+
queueMicrotask(() => {
|
|
8
|
+
let n = getComputedStyle(t);
|
|
9
|
+
if (r === "animation") {
|
|
10
|
+
let r = n.animationName.split(",").map((e) => e.trim()), i = n.animationDuration.split(",").map((e) => e.endsWith("ms") ? Number.parseFloat(e) : e.endsWith("s") ? Number.parseFloat(e) * 1e3 : 0), s = r.some((e) => e && e !== "none"), c = Math.max(0, ...i);
|
|
11
|
+
if (!s || c <= 0) {
|
|
12
|
+
o();
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
t.addEventListener("animationend", o, { once: !0 }), a = setTimeout(o, c + e);
|
|
16
|
+
} else {
|
|
17
|
+
let r = Number.parseFloat(n.transitionDuration);
|
|
18
|
+
if (!r || r <= 0) {
|
|
19
|
+
o();
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
t.addEventListener("transitionend", o, { once: !0 }), a = setTimeout(o, r * 1e3 + e);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { t as awaitExit };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=animation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation.js","names":[],"sources":["../../src/utils/animation.ts"],"sourcesContent":["/**\n * Waits for a CSS exit animation or transition to finish, then calls `onDone`.\n *\n * When the element has no animation/transition running (e.g. reduced-motion or\n * overridden styles), `onDone` is called synchronously on the next microtask so\n * callers can safely set exit state before this call.\n *\n * @param el - The element whose animation/transition to observe.\n * @param onDone - Callback invoked exactly once when the animation ends.\n * @param type - `'animation'` (default) or `'transition'`.\n */\n/** Safety buffer added to the computed CSS duration before the fallback timer fires. */\nconst ANIMATION_FALLBACK_BUFFER_MS = 50;\n\nexport function awaitExit(el: Element, onDone: () => void, type: 'animation' | 'transition' = 'animation'): void {\n let finished = false;\n let fallbackTimer: ReturnType<typeof setTimeout> | null = null;\n\n const finish = () => {\n if (finished) return;\n\n finished = true;\n\n if (fallbackTimer !== null) {\n clearTimeout(fallbackTimer);\n fallbackTimer = null;\n }\n\n onDone();\n };\n\n queueMicrotask(() => {\n const styles = getComputedStyle(el);\n\n if (type === 'animation') {\n const names = styles.animationName.split(',').map((v) => v.trim());\n const durations = styles.animationDuration.split(',').map((v) => {\n if (v.endsWith('ms')) return Number.parseFloat(v);\n\n if (v.endsWith('s')) return Number.parseFloat(v) * 1000;\n\n return 0;\n });\n\n const hasAnimation = names.some((n) => n && n !== 'none');\n const maxDuration = Math.max(0, ...durations);\n\n if (!hasAnimation || maxDuration <= 0) {\n finish();\n\n return;\n }\n\n el.addEventListener('animationend', finish, { once: true });\n fallbackTimer = setTimeout(finish, maxDuration + ANIMATION_FALLBACK_BUFFER_MS);\n } else {\n const duration = Number.parseFloat(styles.transitionDuration);\n\n if (!duration || duration <= 0) {\n finish();\n\n return;\n }\n\n el.addEventListener('transitionend', finish, { once: true });\n fallbackTimer = setTimeout(finish, duration * 1000 + ANIMATION_FALLBACK_BUFFER_MS);\n }\n });\n}\n"],"mappings":";AAYA,IAAM,IAA+B;AAErC,SAAgB,EAAU,GAAa,GAAoB,IAAmC,aAAmB;CAC/G,IAAI,IAAW,IACX,IAAsD,MAEpD,UAAe;AACf,QAEJ,IAAW,IAEP,MAAkB,SACpB,aAAa,EAAc,EAC3B,IAAgB,OAGlB,GAAQ;;AAGV,sBAAqB;EACnB,IAAM,IAAS,iBAAiB,EAAG;AAEnC,MAAI,MAAS,aAAa;GACxB,IAAM,IAAQ,EAAO,cAAc,MAAM,IAAI,CAAC,KAAK,MAAM,EAAE,MAAM,CAAC,EAC5D,IAAY,EAAO,kBAAkB,MAAM,IAAI,CAAC,KAAK,MACrD,EAAE,SAAS,KAAK,GAAS,OAAO,WAAW,EAAE,GAE7C,EAAE,SAAS,IAAI,GAAS,OAAO,WAAW,EAAE,GAAG,MAE5C,EACP,EAEI,IAAe,EAAM,MAAM,MAAM,KAAK,MAAM,OAAO,EACnD,IAAc,KAAK,IAAI,GAAG,GAAG,EAAU;AAE7C,OAAI,CAAC,KAAgB,KAAe,GAAG;AACrC,OAAQ;AAER;;AAIF,GADA,EAAG,iBAAiB,gBAAgB,GAAQ,EAAE,MAAM,IAAM,CAAC,EAC3D,IAAgB,WAAW,GAAQ,IAAc,EAA6B;SACzE;GACL,IAAM,IAAW,OAAO,WAAW,EAAO,mBAAmB;AAE7D,OAAI,CAAC,KAAY,KAAY,GAAG;AAC9B,OAAQ;AAER;;AAIF,GADA,EAAG,iBAAiB,iBAAiB,GAAQ,EAAE,MAAM,IAAM,CAAC,EAC5D,IAAgB,WAAW,GAAQ,IAAW,MAAO,EAA6B;;GAEpF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=0,t=[];function n(n){if(e===0){let e=n;for(;e.parentElement&&e.parentElement!==document.body;)e=e.parentElement;t=Array.from(document.body.children).filter(t=>t!==e&&!t.hasAttribute(`inert`));for(let e of t)e.setAttribute(`inert`,``)}e++}function r(){if(e=Math.max(0,e-1),e===0){for(let e of t)e.removeAttribute(`inert`);t=[]}}exports.lockBackground=n,exports.unlockBackground=r;
|
|
2
|
+
//# sourceMappingURL=background-lock.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"background-lock.cjs","names":[],"sources":["../../src/utils/background-lock.ts"],"sourcesContent":["/**\n * Shared background-lock utility for overlay components (dialog, drawer, etc.).\n *\n * Uses a reference count so that multiple stacked overlays each call\n * lockBackground / unlockBackground independently without interfering with\n * each other. The `inert` attribute is applied once when the first overlay\n * opens and removed once the last one closes.\n */\n\nlet lockCount = 0;\nlet lockedEls: Element[] = [];\n\n/**\n * Marks all `document.body` children except the direct ancestor of `host` as\n * `inert`. Safe to call from multiple overlays at once — only the first call\n * actually mutates the DOM.\n */\nexport function lockBackground(host: Element): void {\n if (lockCount === 0) {\n let ancestor: Element = host;\n\n while (ancestor.parentElement && ancestor.parentElement !== document.body) {\n ancestor = ancestor.parentElement;\n }\n\n lockedEls = Array.from(document.body.children).filter((el) => el !== ancestor && !el.hasAttribute('inert'));\n\n for (const el of lockedEls) el.setAttribute('inert', '');\n }\n\n lockCount++;\n}\n\n/**\n * Decrements the lock count. When it reaches zero, removes `inert` from all\n * elements that were locked by `lockBackground`.\n */\nexport function unlockBackground(): void {\n lockCount = Math.max(0, lockCount - 1);\n\n if (lockCount === 0) {\n for (const el of lockedEls) el.removeAttribute('inert');\n lockedEls = [];\n }\n}\n"],"mappings":"AASA,IAAI,EAAY,EACZ,EAAuB,EAAE,CAO7B,SAAgB,EAAe,EAAqB,CAClD,GAAI,IAAc,EAAG,CACnB,IAAI,EAAoB,EAExB,KAAO,EAAS,eAAiB,EAAS,gBAAkB,SAAS,MACnE,EAAW,EAAS,cAGtB,EAAY,MAAM,KAAK,SAAS,KAAK,SAAS,CAAC,OAAQ,GAAO,IAAO,GAAY,CAAC,EAAG,aAAa,QAAQ,CAAC,CAE3G,IAAK,IAAM,KAAM,EAAW,EAAG,aAAa,QAAS,GAAG,CAG1D,IAOF,SAAgB,GAAyB,CAGvC,GAFA,EAAY,KAAK,IAAI,EAAG,EAAY,EAAE,CAElC,IAAc,EAAG,CACnB,IAAK,IAAM,KAAM,EAAW,EAAG,gBAAgB,QAAQ,CACvD,EAAY,EAAE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared background-lock utility for overlay components (dialog, drawer, etc.).
|
|
3
|
+
*
|
|
4
|
+
* Uses a reference count so that multiple stacked overlays each call
|
|
5
|
+
* lockBackground / unlockBackground independently without interfering with
|
|
6
|
+
* each other. The `inert` attribute is applied once when the first overlay
|
|
7
|
+
* opens and removed once the last one closes.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Marks all `document.body` children except the direct ancestor of `host` as
|
|
11
|
+
* `inert`. Safe to call from multiple overlays at once — only the first call
|
|
12
|
+
* actually mutates the DOM.
|
|
13
|
+
*/
|
|
14
|
+
export declare function lockBackground(host: Element): void;
|
|
15
|
+
/**
|
|
16
|
+
* Decrements the lock count. When it reaches zero, removes `inert` from all
|
|
17
|
+
* elements that were locked by `lockBackground`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function unlockBackground(): void;
|
|
20
|
+
//# sourceMappingURL=background-lock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"background-lock.d.ts","sourceRoot":"","sources":["../../src/utils/background-lock.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAclD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAOvC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/utils/background-lock.ts
|
|
2
|
+
var e = 0, t = [];
|
|
3
|
+
function n(n) {
|
|
4
|
+
if (e === 0) {
|
|
5
|
+
let e = n;
|
|
6
|
+
for (; e.parentElement && e.parentElement !== document.body;) e = e.parentElement;
|
|
7
|
+
t = Array.from(document.body.children).filter((t) => t !== e && !t.hasAttribute("inert"));
|
|
8
|
+
for (let e of t) e.setAttribute("inert", "");
|
|
9
|
+
}
|
|
10
|
+
e++;
|
|
11
|
+
}
|
|
12
|
+
function r() {
|
|
13
|
+
if (e = Math.max(0, e - 1), e === 0) {
|
|
14
|
+
for (let e of t) e.removeAttribute("inert");
|
|
15
|
+
t = [];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { n as lockBackground, r as unlockBackground };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=background-lock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"background-lock.js","names":[],"sources":["../../src/utils/background-lock.ts"],"sourcesContent":["/**\n * Shared background-lock utility for overlay components (dialog, drawer, etc.).\n *\n * Uses a reference count so that multiple stacked overlays each call\n * lockBackground / unlockBackground independently without interfering with\n * each other. The `inert` attribute is applied once when the first overlay\n * opens and removed once the last one closes.\n */\n\nlet lockCount = 0;\nlet lockedEls: Element[] = [];\n\n/**\n * Marks all `document.body` children except the direct ancestor of `host` as\n * `inert`. Safe to call from multiple overlays at once — only the first call\n * actually mutates the DOM.\n */\nexport function lockBackground(host: Element): void {\n if (lockCount === 0) {\n let ancestor: Element = host;\n\n while (ancestor.parentElement && ancestor.parentElement !== document.body) {\n ancestor = ancestor.parentElement;\n }\n\n lockedEls = Array.from(document.body.children).filter((el) => el !== ancestor && !el.hasAttribute('inert'));\n\n for (const el of lockedEls) el.setAttribute('inert', '');\n }\n\n lockCount++;\n}\n\n/**\n * Decrements the lock count. When it reaches zero, removes `inert` from all\n * elements that were locked by `lockBackground`.\n */\nexport function unlockBackground(): void {\n lockCount = Math.max(0, lockCount - 1);\n\n if (lockCount === 0) {\n for (const el of lockedEls) el.removeAttribute('inert');\n lockedEls = [];\n }\n}\n"],"mappings":";AASA,IAAI,IAAY,GACZ,IAAuB,EAAE;AAO7B,SAAgB,EAAe,GAAqB;AAClD,KAAI,MAAc,GAAG;EACnB,IAAI,IAAoB;AAExB,SAAO,EAAS,iBAAiB,EAAS,kBAAkB,SAAS,MACnE,KAAW,EAAS;AAGtB,MAAY,MAAM,KAAK,SAAS,KAAK,SAAS,CAAC,QAAQ,MAAO,MAAO,KAAY,CAAC,EAAG,aAAa,QAAQ,CAAC;AAE3G,OAAK,IAAM,KAAM,EAAW,GAAG,aAAa,SAAS,GAAG;;AAG1D;;AAOF,SAAgB,IAAyB;AAGvC,KAFA,IAAY,KAAK,IAAI,GAAG,IAAY,EAAE,EAElC,MAAc,GAAG;AACnB,OAAK,IAAM,KAAM,EAAW,GAAG,gBAAgB,QAAQ;AACvD,MAAY,EAAE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./animation.cjs`),require(`./background-lock.cjs`),require(`./use-overlay.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require(`./animation.cjs`);require(`@vielzeug/craftit`);function t(t,n,r,i){let a=null,o=!1;return{applyInitialFocus:()=>{let e=i[`initial-focus`].value;if(e){let n=t.querySelector(e);n&&requestAnimationFrame(()=>n.focus())}},captureReturnFocus:()=>{a=document.activeElement},closeWithAnimation:()=>{let t=n.value;if(!t?.open||o)return;o=!0,t.classList.add(`closing`);let i=()=>{t.classList.remove(`closing`),o=!1,t.close()},a=r();a?e.awaitExit(a,i,`transition`):i()},restoreFocus:()=>{i[`return-focus`].value!==!1&&a&&(a.focus(),a=null)}}}exports.useOverlay=t;
|
|
2
|
+
//# sourceMappingURL=use-overlay.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-overlay.cjs","names":[],"sources":["../../src/utils/use-overlay.ts"],"sourcesContent":["import { type ReadonlySignal } from '@vielzeug/craftit';\n\nimport { awaitExit } from './animation';\n\nexport interface OverlayProps {\n 'initial-focus': ReadonlySignal<string | undefined>;\n 'return-focus': ReadonlySignal<boolean | undefined>;\n}\n\n/**\n * Shared overlay composable for dialog-based components.\n *\n * Encapsulates the `returnFocusEl` variable, `applyInitialFocus`, the guarded\n * `closeWithAnimation` (with `isClosing` flag to prevent double-close), and\n * the focus-restore helper so that `bit-dialog` and `bit-drawer` don't repeat\n * this logic.\n *\n * Call at **setup scope** (outside `onMount`) so that the returned\n * `closeWithAnimation` is available before mount (e.g. to expose as an\n * imperative API or use inside `requestClose`).\n */\nexport function useOverlay(\n host: HTMLElement,\n dialogRef: { value: HTMLDialogElement | null | undefined },\n getPanelEl: () => HTMLElement | null | undefined,\n props: OverlayProps,\n) {\n let returnFocusEl: HTMLElement | null = null;\n let isClosing = false;\n\n const captureReturnFocus = () => {\n returnFocusEl = document.activeElement as HTMLElement;\n };\n\n const restoreFocus = () => {\n if (props['return-focus'].value !== false && returnFocusEl) {\n returnFocusEl.focus();\n returnFocusEl = null;\n }\n };\n\n const applyInitialFocus = () => {\n const selector = props['initial-focus'].value;\n\n if (selector) {\n const target = host.querySelector<HTMLElement>(selector);\n\n if (target) requestAnimationFrame(() => target.focus());\n }\n };\n\n const closeWithAnimation = () => {\n const dialog = dialogRef.value;\n\n if (!dialog?.open || isClosing) return;\n\n isClosing = true;\n dialog.classList.add('closing');\n\n const finish = () => {\n dialog.classList.remove('closing');\n isClosing = false;\n dialog.close();\n };\n\n const panel = getPanelEl();\n\n if (panel) {\n awaitExit(panel, finish, 'transition');\n } else {\n finish();\n }\n };\n\n return {\n applyInitialFocus,\n captureReturnFocus,\n closeWithAnimation,\n restoreFocus,\n };\n}\n"],"mappings":"gEAqBA,SAAgB,EACd,EACA,EACA,EACA,EACA,CACA,IAAI,EAAoC,KACpC,EAAY,GA8ChB,MAAO,CACL,sBAlC8B,CAC9B,IAAM,EAAW,EAAM,iBAAiB,MAExC,GAAI,EAAU,CACZ,IAAM,EAAS,EAAK,cAA2B,EAAS,CAEpD,GAAQ,0BAA4B,EAAO,OAAO,CAAC,GA6BzD,uBA9C+B,CAC/B,EAAgB,SAAS,eA8CzB,uBA1B+B,CAC/B,IAAM,EAAS,EAAU,MAEzB,GAAI,CAAC,GAAQ,MAAQ,EAAW,OAEhC,EAAY,GACZ,EAAO,UAAU,IAAI,UAAU,CAE/B,IAAM,MAAe,CACnB,EAAO,UAAU,OAAO,UAAU,CAClC,EAAY,GACZ,EAAO,OAAO,EAGV,EAAQ,GAAY,CAEtB,EACF,EAAA,UAAU,EAAO,EAAQ,aAAa,CAEtC,GAAQ,EAQV,iBA5CyB,CACrB,EAAM,gBAAgB,QAAU,IAAS,IAC3C,EAAc,OAAO,CACrB,EAAgB,OA0CnB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ReadonlySignal } from '@vielzeug/craftit';
|
|
2
|
+
export interface OverlayProps {
|
|
3
|
+
'initial-focus': ReadonlySignal<string | undefined>;
|
|
4
|
+
'return-focus': ReadonlySignal<boolean | undefined>;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Shared overlay composable for dialog-based components.
|
|
8
|
+
*
|
|
9
|
+
* Encapsulates the `returnFocusEl` variable, `applyInitialFocus`, the guarded
|
|
10
|
+
* `closeWithAnimation` (with `isClosing` flag to prevent double-close), and
|
|
11
|
+
* the focus-restore helper so that `bit-dialog` and `bit-drawer` don't repeat
|
|
12
|
+
* this logic.
|
|
13
|
+
*
|
|
14
|
+
* Call at **setup scope** (outside `onMount`) so that the returned
|
|
15
|
+
* `closeWithAnimation` is available before mount (e.g. to expose as an
|
|
16
|
+
* imperative API or use inside `requestClose`).
|
|
17
|
+
*/
|
|
18
|
+
export declare function useOverlay(host: HTMLElement, dialogRef: {
|
|
19
|
+
value: HTMLDialogElement | null | undefined;
|
|
20
|
+
}, getPanelEl: () => HTMLElement | null | undefined, props: OverlayProps): {
|
|
21
|
+
applyInitialFocus: () => void;
|
|
22
|
+
captureReturnFocus: () => void;
|
|
23
|
+
closeWithAnimation: () => void;
|
|
24
|
+
restoreFocus: () => void;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=use-overlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-overlay.d.ts","sourceRoot":"","sources":["../../src/utils/use-overlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIxD,MAAM,WAAW,YAAY;IAC3B,eAAe,EAAE,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACpD,cAAc,EAAE,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;CACrD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE;IAAE,KAAK,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE,EAC1D,UAAU,EAAE,MAAM,WAAW,GAAG,IAAI,GAAG,SAAS,EAChD,KAAK,EAAE,YAAY;;;;;EAuDpB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { awaitExit as e } from "./animation.js";
|
|
2
|
+
import "@vielzeug/craftit";
|
|
3
|
+
//#region src/utils/use-overlay.ts
|
|
4
|
+
function t(t, n, r, i) {
|
|
5
|
+
let a = null, o = !1;
|
|
6
|
+
return {
|
|
7
|
+
applyInitialFocus: () => {
|
|
8
|
+
let e = i["initial-focus"].value;
|
|
9
|
+
if (e) {
|
|
10
|
+
let n = t.querySelector(e);
|
|
11
|
+
n && requestAnimationFrame(() => n.focus());
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
captureReturnFocus: () => {
|
|
15
|
+
a = document.activeElement;
|
|
16
|
+
},
|
|
17
|
+
closeWithAnimation: () => {
|
|
18
|
+
let t = n.value;
|
|
19
|
+
if (!t?.open || o) return;
|
|
20
|
+
o = !0, t.classList.add("closing");
|
|
21
|
+
let i = () => {
|
|
22
|
+
t.classList.remove("closing"), o = !1, t.close();
|
|
23
|
+
}, a = r();
|
|
24
|
+
a ? e(a, i, "transition") : i();
|
|
25
|
+
},
|
|
26
|
+
restoreFocus: () => {
|
|
27
|
+
i["return-focus"].value !== !1 && a && (a.focus(), a = null);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { t as useOverlay };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=use-overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-overlay.js","names":[],"sources":["../../src/utils/use-overlay.ts"],"sourcesContent":["import { type ReadonlySignal } from '@vielzeug/craftit';\n\nimport { awaitExit } from './animation';\n\nexport interface OverlayProps {\n 'initial-focus': ReadonlySignal<string | undefined>;\n 'return-focus': ReadonlySignal<boolean | undefined>;\n}\n\n/**\n * Shared overlay composable for dialog-based components.\n *\n * Encapsulates the `returnFocusEl` variable, `applyInitialFocus`, the guarded\n * `closeWithAnimation` (with `isClosing` flag to prevent double-close), and\n * the focus-restore helper so that `bit-dialog` and `bit-drawer` don't repeat\n * this logic.\n *\n * Call at **setup scope** (outside `onMount`) so that the returned\n * `closeWithAnimation` is available before mount (e.g. to expose as an\n * imperative API or use inside `requestClose`).\n */\nexport function useOverlay(\n host: HTMLElement,\n dialogRef: { value: HTMLDialogElement | null | undefined },\n getPanelEl: () => HTMLElement | null | undefined,\n props: OverlayProps,\n) {\n let returnFocusEl: HTMLElement | null = null;\n let isClosing = false;\n\n const captureReturnFocus = () => {\n returnFocusEl = document.activeElement as HTMLElement;\n };\n\n const restoreFocus = () => {\n if (props['return-focus'].value !== false && returnFocusEl) {\n returnFocusEl.focus();\n returnFocusEl = null;\n }\n };\n\n const applyInitialFocus = () => {\n const selector = props['initial-focus'].value;\n\n if (selector) {\n const target = host.querySelector<HTMLElement>(selector);\n\n if (target) requestAnimationFrame(() => target.focus());\n }\n };\n\n const closeWithAnimation = () => {\n const dialog = dialogRef.value;\n\n if (!dialog?.open || isClosing) return;\n\n isClosing = true;\n dialog.classList.add('closing');\n\n const finish = () => {\n dialog.classList.remove('closing');\n isClosing = false;\n dialog.close();\n };\n\n const panel = getPanelEl();\n\n if (panel) {\n awaitExit(panel, finish, 'transition');\n } else {\n finish();\n }\n };\n\n return {\n applyInitialFocus,\n captureReturnFocus,\n closeWithAnimation,\n restoreFocus,\n };\n}\n"],"mappings":";;;AAqBA,SAAgB,EACd,GACA,GACA,GACA,GACA;CACA,IAAI,IAAoC,MACpC,IAAY;AA8ChB,QAAO;EACL,yBAlC8B;GAC9B,IAAM,IAAW,EAAM,iBAAiB;AAExC,OAAI,GAAU;IACZ,IAAM,IAAS,EAAK,cAA2B,EAAS;AAExD,IAAI,KAAQ,4BAA4B,EAAO,OAAO,CAAC;;;EA6BzD,0BA9C+B;AAC/B,OAAgB,SAAS;;EA8CzB,0BA1B+B;GAC/B,IAAM,IAAS,EAAU;AAEzB,OAAI,CAAC,GAAQ,QAAQ,EAAW;AAGhC,GADA,IAAY,IACZ,EAAO,UAAU,IAAI,UAAU;GAE/B,IAAM,UAAe;AAGnB,IAFA,EAAO,UAAU,OAAO,UAAU,EAClC,IAAY,IACZ,EAAO,OAAO;MAGV,IAAQ,GAAY;AAE1B,GAAI,IACF,EAAU,GAAO,GAAQ,aAAa,GAEtC,GAAQ;;EAQV,oBA5CyB;AACzB,GAAI,EAAM,gBAAgB,UAAU,MAAS,MAC3C,EAAc,OAAO,EACrB,IAAgB;;EA0CnB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require(`../virtualit.cjs`);function t(t){let n=[],r=null,i=null,a=null,o=e=>typeof t.estimateSize==`number`?t.estimateSize:t.estimateSize(e,n[e]),s=()=>{!r||!a||(r.style.height=`${a.getTotalSize()}px`,r.style.position=`relative`,r.style.contain=`layout`)},c=()=>{r&&(t.clear(r),r.style.height=``,r.style.position=``,r.style.contain=``)},l=()=>{let l=t.getScrollElement(),u=t.getListElement();if(!l||!u||n.length===0){a?.destroy(),a=null,r=u,i=l,c();return}let d=i!==l||r!==u;r=u,i=l,!a||d?(a?.destroy(),a=e.t(i,{count:n.length,estimateSize:o,onChange:e=>{r&&t.render({items:n,listEl:r,virtualItems:e})},overscan:t.overscan??3})):(a.count=n.length,a.invalidate()),s()};return{destroy(){a?.destroy(),a=null,c()},scrollToIndex(e,t){a?.scrollToIndex(e,t)},update(e,o){if(n=e,!o||n.length===0){a?.destroy(),a=null,r=t.getListElement(),i=t.getScrollElement(),c();return}l()}}}exports.t=t;
|
|
2
|
+
//# sourceMappingURL=dom.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.cjs","names":["e"],"sources":["../../../../../virtualit/dist/dom/dom.js"],"sourcesContent":["import { createVirtualizer as e } from \"../virtualit.js\";\n//#region src/dom/dom.ts\nfunction t(t) {\n\tlet n = [], r = null, i = null, a = null, o = (e) => typeof t.estimateSize == \"number\" ? t.estimateSize : t.estimateSize(e, n[e]), s = () => {\n\t\t!r || !a || (r.style.height = `${a.getTotalSize()}px`, r.style.position = \"relative\", r.style.contain = \"layout\");\n\t}, c = () => {\n\t\tr && (t.clear(r), r.style.height = \"\", r.style.position = \"\", r.style.contain = \"\");\n\t}, l = () => {\n\t\tlet l = t.getScrollElement(), u = t.getListElement();\n\t\tif (!l || !u || n.length === 0) {\n\t\t\ta?.destroy(), a = null, r = u, i = l, c();\n\t\t\treturn;\n\t\t}\n\t\tlet d = i !== l || r !== u;\n\t\tr = u, i = l, !a || d ? (a?.destroy(), a = e(i, {\n\t\t\tcount: n.length,\n\t\t\testimateSize: o,\n\t\t\tonChange: (e) => {\n\t\t\t\tr && t.render({\n\t\t\t\t\titems: n,\n\t\t\t\t\tlistEl: r,\n\t\t\t\t\tvirtualItems: e\n\t\t\t\t});\n\t\t\t},\n\t\t\toverscan: t.overscan ?? 3\n\t\t})) : (a.count = n.length, a.invalidate()), s();\n\t};\n\treturn {\n\t\tdestroy() {\n\t\t\ta?.destroy(), a = null, c();\n\t\t},\n\t\tscrollToIndex(e, t) {\n\t\t\ta?.scrollToIndex(e, t);\n\t\t},\n\t\tupdate(e, o) {\n\t\t\tif (n = e, !o || n.length === 0) {\n\t\t\t\ta?.destroy(), a = null, r = t.getListElement(), i = t.getScrollElement(), c();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tl();\n\t\t}\n\t};\n}\n//#endregion\nexport { t as createDomVirtualList };\n\n//# sourceMappingURL=dom.js.map"],"mappings":"oCAEA,SAAS,EAAE,EAAG,CACb,IAAI,EAAI,EAAE,CAAE,EAAI,KAAM,EAAI,KAAM,EAAI,KAAM,EAAK,GAAM,OAAO,EAAE,cAAgB,SAAW,EAAE,aAAe,EAAE,aAAa,EAAG,EAAE,GAAG,CAAE,MAAU,CAC5I,CAAC,GAAK,CAAC,IAAM,EAAE,MAAM,OAAS,GAAG,EAAE,cAAc,CAAC,IAAK,EAAE,MAAM,SAAW,WAAY,EAAE,MAAM,QAAU,WACtG,MAAU,CACZ,IAAM,EAAE,MAAM,EAAE,CAAE,EAAE,MAAM,OAAS,GAAI,EAAE,MAAM,SAAW,GAAI,EAAE,MAAM,QAAU,KAC9E,MAAU,CACZ,IAAI,EAAI,EAAE,kBAAkB,CAAE,EAAI,EAAE,gBAAgB,CACpD,GAAI,CAAC,GAAK,CAAC,GAAK,EAAE,SAAW,EAAG,CAC/B,GAAG,SAAS,CAAE,EAAI,KAAM,EAAI,EAAG,EAAI,EAAG,GAAG,CACzC,OAED,IAAI,EAAI,IAAM,GAAK,IAAM,EACzB,EAAI,EAAG,EAAI,EAAG,CAAC,GAAK,GAAK,GAAG,SAAS,CAAE,EAAIA,EAAAA,EAAE,EAAG,CAC/C,MAAO,EAAE,OACT,aAAc,EACd,SAAW,GAAM,CAChB,GAAK,EAAE,OAAO,CACb,MAAO,EACP,OAAQ,EACR,aAAc,EACd,CAAC,EAEH,SAAU,EAAE,UAAY,EACxB,CAAC,GAAK,EAAE,MAAQ,EAAE,OAAQ,EAAE,YAAY,EAAG,GAAG,EAEhD,MAAO,CACN,SAAU,CACT,GAAG,SAAS,CAAE,EAAI,KAAM,GAAG,EAE5B,cAAc,EAAG,EAAG,CACnB,GAAG,cAAc,EAAG,EAAE,EAEvB,OAAO,EAAG,EAAG,CACZ,GAAI,EAAI,EAAG,CAAC,GAAK,EAAE,SAAW,EAAG,CAChC,GAAG,SAAS,CAAE,EAAI,KAAM,EAAI,EAAE,gBAAgB,CAAE,EAAI,EAAE,kBAAkB,CAAE,GAAG,CAC7E,OAED,GAAG,EAEJ"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { t as e } from "../virtualit.js";
|
|
2
|
+
//#region ../virtualit/dist/dom/dom.js
|
|
3
|
+
function t(t) {
|
|
4
|
+
let n = [], r = null, i = null, a = null, o = (e) => typeof t.estimateSize == "number" ? t.estimateSize : t.estimateSize(e, n[e]), s = () => {
|
|
5
|
+
!r || !a || (r.style.height = `${a.getTotalSize()}px`, r.style.position = "relative", r.style.contain = "layout");
|
|
6
|
+
}, c = () => {
|
|
7
|
+
r && (t.clear(r), r.style.height = "", r.style.position = "", r.style.contain = "");
|
|
8
|
+
}, l = () => {
|
|
9
|
+
let l = t.getScrollElement(), u = t.getListElement();
|
|
10
|
+
if (!l || !u || n.length === 0) {
|
|
11
|
+
a?.destroy(), a = null, r = u, i = l, c();
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
let d = i !== l || r !== u;
|
|
15
|
+
r = u, i = l, !a || d ? (a?.destroy(), a = e(i, {
|
|
16
|
+
count: n.length,
|
|
17
|
+
estimateSize: o,
|
|
18
|
+
onChange: (e) => {
|
|
19
|
+
r && t.render({
|
|
20
|
+
items: n,
|
|
21
|
+
listEl: r,
|
|
22
|
+
virtualItems: e
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
overscan: t.overscan ?? 3
|
|
26
|
+
})) : (a.count = n.length, a.invalidate()), s();
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
destroy() {
|
|
30
|
+
a?.destroy(), a = null, c();
|
|
31
|
+
},
|
|
32
|
+
scrollToIndex(e, t) {
|
|
33
|
+
a?.scrollToIndex(e, t);
|
|
34
|
+
},
|
|
35
|
+
update(e, o) {
|
|
36
|
+
if (n = e, !o || n.length === 0) {
|
|
37
|
+
a?.destroy(), a = null, r = t.getListElement(), i = t.getScrollElement(), c();
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
l();
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { t };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=dom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.js","names":["e"],"sources":["../../../../../virtualit/dist/dom/dom.js"],"sourcesContent":["import { createVirtualizer as e } from \"../virtualit.js\";\n//#region src/dom/dom.ts\nfunction t(t) {\n\tlet n = [], r = null, i = null, a = null, o = (e) => typeof t.estimateSize == \"number\" ? t.estimateSize : t.estimateSize(e, n[e]), s = () => {\n\t\t!r || !a || (r.style.height = `${a.getTotalSize()}px`, r.style.position = \"relative\", r.style.contain = \"layout\");\n\t}, c = () => {\n\t\tr && (t.clear(r), r.style.height = \"\", r.style.position = \"\", r.style.contain = \"\");\n\t}, l = () => {\n\t\tlet l = t.getScrollElement(), u = t.getListElement();\n\t\tif (!l || !u || n.length === 0) {\n\t\t\ta?.destroy(), a = null, r = u, i = l, c();\n\t\t\treturn;\n\t\t}\n\t\tlet d = i !== l || r !== u;\n\t\tr = u, i = l, !a || d ? (a?.destroy(), a = e(i, {\n\t\t\tcount: n.length,\n\t\t\testimateSize: o,\n\t\t\tonChange: (e) => {\n\t\t\t\tr && t.render({\n\t\t\t\t\titems: n,\n\t\t\t\t\tlistEl: r,\n\t\t\t\t\tvirtualItems: e\n\t\t\t\t});\n\t\t\t},\n\t\t\toverscan: t.overscan ?? 3\n\t\t})) : (a.count = n.length, a.invalidate()), s();\n\t};\n\treturn {\n\t\tdestroy() {\n\t\t\ta?.destroy(), a = null, c();\n\t\t},\n\t\tscrollToIndex(e, t) {\n\t\t\ta?.scrollToIndex(e, t);\n\t\t},\n\t\tupdate(e, o) {\n\t\t\tif (n = e, !o || n.length === 0) {\n\t\t\t\ta?.destroy(), a = null, r = t.getListElement(), i = t.getScrollElement(), c();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tl();\n\t\t}\n\t};\n}\n//#endregion\nexport { t as createDomVirtualList };\n\n//# sourceMappingURL=dom.js.map"],"mappings":";;AAEA,SAAS,EAAE,GAAG;CACb,IAAI,IAAI,EAAE,EAAE,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,KAAK,MAAM,OAAO,EAAE,gBAAgB,WAAW,EAAE,eAAe,EAAE,aAAa,GAAG,EAAE,GAAG,EAAE,UAAU;AAC5I,GAAC,KAAK,CAAC,MAAM,EAAE,MAAM,SAAS,GAAG,EAAE,cAAc,CAAC,KAAK,EAAE,MAAM,WAAW,YAAY,EAAE,MAAM,UAAU;IACtG,UAAU;AACZ,QAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,SAAS,IAAI,EAAE,MAAM,WAAW,IAAI,EAAE,MAAM,UAAU;IAC9E,UAAU;EACZ,IAAI,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,gBAAgB;AACpD,MAAI,CAAC,KAAK,CAAC,KAAK,EAAE,WAAW,GAAG;AAC/B,MAAG,SAAS,EAAE,IAAI,MAAM,IAAI,GAAG,IAAI,GAAG,GAAG;AACzC;;EAED,IAAI,IAAI,MAAM,KAAK,MAAM;AACzB,MAAI,GAAG,IAAI,GAAG,CAAC,KAAK,KAAK,GAAG,SAAS,EAAE,IAAIA,EAAE,GAAG;GAC/C,OAAO,EAAE;GACT,cAAc;GACd,WAAW,MAAM;AAChB,SAAK,EAAE,OAAO;KACb,OAAO;KACP,QAAQ;KACR,cAAc;KACd,CAAC;;GAEH,UAAU,EAAE,YAAY;GACxB,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,GAAG,GAAG;;AAEhD,QAAO;EACN,UAAU;AACT,MAAG,SAAS,EAAE,IAAI,MAAM,GAAG;;EAE5B,cAAc,GAAG,GAAG;AACnB,MAAG,cAAc,GAAG,EAAE;;EAEvB,OAAO,GAAG,GAAG;AACZ,OAAI,IAAI,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG;AAChC,OAAG,SAAS,EAAE,IAAI,MAAM,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,kBAAkB,EAAE,GAAG;AAC7E;;AAED,MAAG;;EAEJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./virtualit.cjs`),require(`./dom/dom.cjs`);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=class{_count;_estimateSizeFn;overscan;onChange;measuredHeights=new Map;virtualItems=[];totalSize=0;scrollOffsets=new Float64Array;containerHeight=0;scrollTop=0;prevRenderStart=-1;prevRenderEnd=-1;attachedEl=null;resizeObserver=null;scrollHandler=null;pendingBuild=!1;constructor(e){this._count=e.count;let t=e.estimateSize??36;this._estimateSizeFn=typeof t==`number`?()=>t:t,this.overscan=e.overscan??3,this.onChange=e.onChange,this.buildOffsets()}get count(){return this._count}set count(e){this._count=e,this.buildOffsets(),this.attachedEl&&this.computeVisible()}set estimateSize(e){this._estimateSizeFn=typeof e==`number`?()=>e:e,this.measuredHeights.clear(),this.buildOffsets(),this.attachedEl&&this.computeVisible()}attach(e){this.teardown(),this.attachedEl=e,this.containerHeight=e.clientHeight,this.scrollTop=e.scrollTop,this.scrollHandler=()=>{this.scrollTop=e.scrollTop,this.computeVisible()},e.addEventListener(`scroll`,this.scrollHandler,{passive:!0}),this.resizeObserver=new ResizeObserver(()=>{this.containerHeight=e.clientHeight,this.computeVisible()}),this.resizeObserver.observe(e),this.computeVisible()}destroy(){this.teardown()}[Symbol.dispose](){this.destroy()}getVirtualItems(){return this.virtualItems}getTotalSize(){return this.totalSize}measureElement(e,t){this.heightAt(e)!==t&&(this.measuredHeights.set(e,t),this.pendingBuild||(this.pendingBuild=!0,queueMicrotask(()=>{this.pendingBuild=!1,this.buildOffsets(),this.attachedEl&&this.computeVisible()})))}scrollToIndex(e,t={}){let n=this.attachedEl;if(!n)return;let r=Math.max(0,Math.min(e,this._count-1)),i=t.align??`auto`,a=t.behavior??`auto`,o=this.offsetAt(r),s=this.heightAt(r),c;if(i===`start`)c=o;else if(i===`end`)c=o+s-this.containerHeight;else if(i===`center`)c=o-(this.containerHeight-s)/2;else{let e=n.scrollTop,t=e+this.containerHeight;if(o>=e&&o+s<=t)return;c=o<e?o:o+s-this.containerHeight}n.scrollTo({behavior:a,top:Math.max(0,c)})}scrollToOffset(e,t={}){this.attachedEl?.scrollTo({behavior:t.behavior??`auto`,top:Math.max(0,e)})}invalidate(){this.measuredHeights.clear(),this.buildOffsets(),this.attachedEl&&this.computeVisible()}teardown(){this.scrollHandler&&this.attachedEl&&(this.attachedEl.removeEventListener(`scroll`,this.scrollHandler),this.scrollHandler=null),this.resizeObserver?.disconnect(),this.resizeObserver=null,this.attachedEl=null}heightAt(e){return this.measuredHeights.get(e)??this._estimateSizeFn(e)}offsetAt(e){return this.scrollOffsets[e]??0}buildOffsets(){this.prevRenderStart=-1,this.prevRenderEnd=-1;let e=new Float64Array(this._count+1);e[0]=0;for(let t=0;t<this._count;t++)e[t+1]=e[t]+this.heightAt(t);this.scrollOffsets=e,this.totalSize=e[this._count]??0}computeVisible(){let e=this.scrollTop,t=e+this.containerHeight,n=0,r=this._count-1;for(;n<r;){let t=n+r>>1;this.scrollOffsets[t+1]<=e?n=t+1:r=t}let i=n,a=i,o=this._count-1;for(;a<o;){let e=a+o+1>>1;this.scrollOffsets[e]<t?a=e:o=e-1}let s=a,c=Math.max(0,i-this.overscan),l=Math.min(this._count-1,s+this.overscan);if(c===this.prevRenderStart&&l===this.prevRenderEnd)return;this.prevRenderStart=c,this.prevRenderEnd=l;let u=[];for(let e=c;e<=l;e++)u.push({height:this.heightAt(e),index:e,top:this.scrollOffsets[e]});this.virtualItems=u,this.onChange?.(u,this.totalSize)}};function t(t,n){let r=new e(n);return r.attach(t),r}exports.e=e,exports.t=t;
|
|
2
|
+
//# sourceMappingURL=virtualit.cjs.map
|