nuance-ui 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -0
- package/dist/module.d.mts +24 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +96 -0
- package/dist/runtime/components/action-icon/action-icon-group.d.vue.ts +17 -0
- package/dist/runtime/components/action-icon/action-icon-group.vue +13 -0
- package/dist/runtime/components/action-icon/action-icon-group.vue.d.ts +17 -0
- package/dist/runtime/components/action-icon/action-icon-section.d.vue.ts +23 -0
- package/dist/runtime/components/action-icon/action-icon-section.vue +45 -0
- package/dist/runtime/components/action-icon/action-icon-section.vue.d.ts +23 -0
- package/dist/runtime/components/action-icon/action-icon.d.vue.ts +29 -0
- package/dist/runtime/components/action-icon/action-icon.module.css +1 -0
- package/dist/runtime/components/action-icon/action-icon.vue +71 -0
- package/dist/runtime/components/action-icon/action-icon.vue.d.ts +29 -0
- package/dist/runtime/components/action-icon/index.d.ts +3 -0
- package/dist/runtime/components/action-icon/index.js +0 -0
- package/dist/runtime/components/app-shell/app-shell-aside.d.vue.ts +14 -0
- package/dist/runtime/components/app-shell/app-shell-aside.vue +43 -0
- package/dist/runtime/components/app-shell/app-shell-aside.vue.d.ts +14 -0
- package/dist/runtime/components/app-shell/app-shell-footer.d.vue.ts +14 -0
- package/dist/runtime/components/app-shell/app-shell-footer.vue +42 -0
- package/dist/runtime/components/app-shell/app-shell-footer.vue.d.ts +14 -0
- package/dist/runtime/components/app-shell/app-shell-header.d.vue.ts +14 -0
- package/dist/runtime/components/app-shell/app-shell-header.vue +43 -0
- package/dist/runtime/components/app-shell/app-shell-header.vue.d.ts +14 -0
- package/dist/runtime/components/app-shell/app-shell-main.d.vue.ts +14 -0
- package/dist/runtime/components/app-shell/app-shell-main.vue +30 -0
- package/dist/runtime/components/app-shell/app-shell-main.vue.d.ts +14 -0
- package/dist/runtime/components/app-shell/app-shell-navbar.d.vue.ts +14 -0
- package/dist/runtime/components/app-shell/app-shell-navbar.vue +47 -0
- package/dist/runtime/components/app-shell/app-shell-navbar.vue.d.ts +14 -0
- package/dist/runtime/components/app-shell/app-shell-section.d.vue.ts +18 -0
- package/dist/runtime/components/app-shell/app-shell-section.vue +22 -0
- package/dist/runtime/components/app-shell/app-shell-section.vue.d.ts +18 -0
- package/dist/runtime/components/app-shell/app-shell.d.vue.ts +27 -0
- package/dist/runtime/components/app-shell/app-shell.vue +70 -0
- package/dist/runtime/components/app-shell/app-shell.vue.d.ts +27 -0
- package/dist/runtime/components/app-shell/index.d.ts +7 -0
- package/dist/runtime/components/app-shell/index.js +0 -0
- package/dist/runtime/components/background-image.d.vue.ts +10 -0
- package/dist/runtime/components/background-image.vue +37 -0
- package/dist/runtime/components/background-image.vue.d.ts +10 -0
- package/dist/runtime/components/box.d.vue.ts +20 -0
- package/dist/runtime/components/box.vue +14 -0
- package/dist/runtime/components/box.vue.d.ts +20 -0
- package/dist/runtime/components/button/button-group.d.vue.ts +17 -0
- package/dist/runtime/components/button/button-group.vue +13 -0
- package/dist/runtime/components/button/button-group.vue.d.ts +17 -0
- package/dist/runtime/components/button/button.d.vue.ts +40 -0
- package/dist/runtime/components/button/button.module.css +1 -0
- package/dist/runtime/components/button/button.vue +108 -0
- package/dist/runtime/components/button/button.vue.d.ts +40 -0
- package/dist/runtime/components/button/index.d.ts +3 -0
- package/dist/runtime/components/button/index.js +0 -0
- package/dist/runtime/components/button/unstyled-button.d.vue.ts +16 -0
- package/dist/runtime/components/button/unstyled-button.vue +37 -0
- package/dist/runtime/components/button/unstyled-button.vue.d.ts +16 -0
- package/dist/runtime/components/card/card-section.d.vue.ts +19 -0
- package/dist/runtime/components/card/card-section.vue +14 -0
- package/dist/runtime/components/card/card-section.vue.d.ts +19 -0
- package/dist/runtime/components/card/card.d.vue.ts +18 -0
- package/dist/runtime/components/card/card.module.css +1 -0
- package/dist/runtime/components/card/card.vue +18 -0
- package/dist/runtime/components/card/card.vue.d.ts +18 -0
- package/dist/runtime/components/card/index.d.ts +2 -0
- package/dist/runtime/components/card/index.js +0 -0
- package/dist/runtime/components/checkbox/checkbox-card.d.vue.ts +30 -0
- package/dist/runtime/components/checkbox/checkbox-card.vue +76 -0
- package/dist/runtime/components/checkbox/checkbox-card.vue.d.ts +30 -0
- package/dist/runtime/components/checkbox/checkbox-group.d.vue.ts +34 -0
- package/dist/runtime/components/checkbox/checkbox-group.vue +32 -0
- package/dist/runtime/components/checkbox/checkbox-group.vue.d.ts +34 -0
- package/dist/runtime/components/checkbox/checkbox-indicator.d.vue.ts +37 -0
- package/dist/runtime/components/checkbox/checkbox-indicator.vue +161 -0
- package/dist/runtime/components/checkbox/checkbox-indicator.vue.d.ts +37 -0
- package/dist/runtime/components/checkbox/checkbox.d.vue.ts +36 -0
- package/dist/runtime/components/checkbox/checkbox.vue +190 -0
- package/dist/runtime/components/checkbox/checkbox.vue.d.ts +36 -0
- package/dist/runtime/components/checkbox/index.d.ts +6 -0
- package/dist/runtime/components/checkbox/index.js +2 -0
- package/dist/runtime/components/checkbox/lib/card.context.d.ts +7 -0
- package/dist/runtime/components/checkbox/lib/card.context.js +8 -0
- package/dist/runtime/components/checkbox/lib/group.context.d.ts +16 -0
- package/dist/runtime/components/checkbox/lib/group.context.js +15 -0
- package/dist/runtime/components/chip/chip-group.d.vue.ts +24 -0
- package/dist/runtime/components/chip/chip-group.vue +20 -0
- package/dist/runtime/components/chip/chip-group.vue.d.ts +24 -0
- package/dist/runtime/components/chip/chip.d.vue.ts +35 -0
- package/dist/runtime/components/chip/chip.vue +270 -0
- package/dist/runtime/components/chip/chip.vue.d.ts +35 -0
- package/dist/runtime/components/chip/index.d.ts +3 -0
- package/dist/runtime/components/chip/index.js +1 -0
- package/dist/runtime/components/chip/lib.d.ts +14 -0
- package/dist/runtime/components/chip/lib.js +25 -0
- package/dist/runtime/components/combobox/combobox-dropdown.d.vue.ts +13 -0
- package/dist/runtime/components/combobox/combobox-dropdown.vue +33 -0
- package/dist/runtime/components/combobox/combobox-dropdown.vue.d.ts +13 -0
- package/dist/runtime/components/combobox/combobox-empty.d.vue.ts +16 -0
- package/dist/runtime/components/combobox/combobox-empty.vue +11 -0
- package/dist/runtime/components/combobox/combobox-empty.vue.d.ts +16 -0
- package/dist/runtime/components/combobox/combobox-group.d.vue.ts +27 -0
- package/dist/runtime/components/combobox/combobox-group.vue +47 -0
- package/dist/runtime/components/combobox/combobox-group.vue.d.ts +27 -0
- package/dist/runtime/components/combobox/combobox-option-list.d.vue.ts +18 -0
- package/dist/runtime/components/combobox/combobox-option-list.vue +13 -0
- package/dist/runtime/components/combobox/combobox-option-list.vue.d.ts +18 -0
- package/dist/runtime/components/combobox/combobox-option.d.vue.ts +23 -0
- package/dist/runtime/components/combobox/combobox-option.vue +65 -0
- package/dist/runtime/components/combobox/combobox-option.vue.d.ts +23 -0
- package/dist/runtime/components/combobox/combobox-options-dropdown.d.vue.ts +34 -0
- package/dist/runtime/components/combobox/combobox-options-dropdown.vue +74 -0
- package/dist/runtime/components/combobox/combobox-options-dropdown.vue.d.ts +34 -0
- package/dist/runtime/components/combobox/combobox-root.d.vue.ts +49 -0
- package/dist/runtime/components/combobox/combobox-root.vue +46 -0
- package/dist/runtime/components/combobox/combobox-root.vue.d.ts +49 -0
- package/dist/runtime/components/combobox/combobox-target.d.vue.ts +29 -0
- package/dist/runtime/components/combobox/combobox-target.vue +32 -0
- package/dist/runtime/components/combobox/combobox-target.vue.d.ts +29 -0
- package/dist/runtime/components/combobox/combobox.module.css +1 -0
- package/dist/runtime/components/combobox/index.d.ts +11 -0
- package/dist/runtime/components/combobox/index.js +2 -0
- package/dist/runtime/components/combobox/lib/const.d.ts +7 -0
- package/dist/runtime/components/combobox/lib/const.js +6 -0
- package/dist/runtime/components/combobox/lib/context.d.ts +16 -0
- package/dist/runtime/components/combobox/lib/context.js +8 -0
- package/dist/runtime/components/combobox/lib/use-combobox/get-index.d.ts +3 -0
- package/dist/runtime/components/combobox/lib/use-combobox/get-index.js +33 -0
- package/dist/runtime/components/combobox/lib/use-combobox/handlers.d.ts +36 -0
- package/dist/runtime/components/combobox/lib/use-combobox/handlers.js +82 -0
- package/dist/runtime/components/combobox/lib/use-combobox/index.d.ts +1 -0
- package/dist/runtime/components/combobox/lib/use-combobox/index.js +1 -0
- package/dist/runtime/components/combobox/lib/use-combobox/use-combobox.d.ts +70 -0
- package/dist/runtime/components/combobox/lib/use-combobox/use-combobox.js +97 -0
- package/dist/runtime/components/combobox/lib/use-combobox-data/get-parsed-combobox-data.d.ts +2 -0
- package/dist/runtime/components/combobox/lib/use-combobox-data/get-parsed-combobox-data.js +23 -0
- package/dist/runtime/components/combobox/lib/use-combobox-data/index.d.ts +1 -0
- package/dist/runtime/components/combobox/lib/use-combobox-data/index.js +1 -0
- package/dist/runtime/components/combobox/lib/use-combobox-data/use-combobox-data.d.ts +7 -0
- package/dist/runtime/components/combobox/lib/use-combobox-data/use-combobox-data.js +23 -0
- package/dist/runtime/components/combobox/lib/use-combobox-target.d.ts +25 -0
- package/dist/runtime/components/combobox/lib/use-combobox-target.js +65 -0
- package/dist/runtime/components/combobox/lib/utils/default-option-filter.d.ts +7 -0
- package/dist/runtime/components/combobox/lib/utils/default-option-filter.js +27 -0
- package/dist/runtime/components/combobox/lib/utils/index.d.ts +5 -0
- package/dist/runtime/components/combobox/lib/utils/index.js +6 -0
- package/dist/runtime/components/combobox/lib/utils/is-empty-combobox-data.d.ts +2 -0
- package/dist/runtime/components/combobox/lib/utils/is-empty-combobox-data.js +11 -0
- package/dist/runtime/components/combobox/lib/utils/is-options-group.d.ts +2 -0
- package/dist/runtime/components/combobox/lib/utils/is-options-group.js +3 -0
- package/dist/runtime/components/combobox/types/index.d.ts +19 -0
- package/dist/runtime/components/combobox/types/index.js +1 -0
- package/dist/runtime/components/combobox/types/item.d.ts +22 -0
- package/dist/runtime/components/combobox/types/item.js +0 -0
- package/dist/runtime/components/container.d.vue.ts +19 -0
- package/dist/runtime/components/container.vue +33 -0
- package/dist/runtime/components/container.vue.d.ts +19 -0
- package/dist/runtime/components/dialog/dialog-close-button.d.vue.ts +14 -0
- package/dist/runtime/components/dialog/dialog-close-button.vue +28 -0
- package/dist/runtime/components/dialog/dialog-close-button.vue.d.ts +14 -0
- package/dist/runtime/components/dialog/dialog-header.d.vue.ts +16 -0
- package/dist/runtime/components/dialog/dialog-header.vue +11 -0
- package/dist/runtime/components/dialog/dialog-header.vue.d.ts +16 -0
- package/dist/runtime/components/dialog/dialog-root.d.vue.ts +54 -0
- package/dist/runtime/components/dialog/dialog-root.vue +93 -0
- package/dist/runtime/components/dialog/dialog-root.vue.d.ts +54 -0
- package/dist/runtime/components/dialog/dialog-title.d.vue.ts +16 -0
- package/dist/runtime/components/dialog/dialog-title.vue +11 -0
- package/dist/runtime/components/dialog/dialog-title.vue.d.ts +16 -0
- package/dist/runtime/components/dialog/dialog.module.css +1 -0
- package/dist/runtime/components/dialog/index.d.ts +5 -0
- package/dist/runtime/components/dialog/index.js +1 -0
- package/dist/runtime/components/dialog/lib.d.ts +2 -0
- package/dist/runtime/components/dialog/lib.js +8 -0
- package/dist/runtime/components/dialog/types/index.d.ts +9 -0
- package/dist/runtime/components/dialog/types/index.js +0 -0
- package/dist/runtime/components/drawer/drawer-close-button.d.vue.ts +14 -0
- package/dist/runtime/components/drawer/drawer-close-button.vue +20 -0
- package/dist/runtime/components/drawer/drawer-close-button.vue.d.ts +14 -0
- package/dist/runtime/components/drawer/drawer-header.d.vue.ts +16 -0
- package/dist/runtime/components/drawer/drawer-header.vue +10 -0
- package/dist/runtime/components/drawer/drawer-header.vue.d.ts +16 -0
- package/dist/runtime/components/drawer/drawer-root.d.vue.ts +31 -0
- package/dist/runtime/components/drawer/drawer-root.vue +45 -0
- package/dist/runtime/components/drawer/drawer-root.vue.d.ts +31 -0
- package/dist/runtime/components/drawer/drawer-title.d.vue.ts +16 -0
- package/dist/runtime/components/drawer/drawer-title.vue +10 -0
- package/dist/runtime/components/drawer/drawer-title.vue.d.ts +16 -0
- package/dist/runtime/components/drawer/drawer.module.css +1 -0
- package/dist/runtime/components/drawer/index.d.ts +3 -0
- package/dist/runtime/components/drawer/index.js +0 -0
- package/dist/runtime/components/index.d.ts +26 -0
- package/dist/runtime/components/index.js +26 -0
- package/dist/runtime/components/input/index.d.ts +10 -0
- package/dist/runtime/components/input/index.js +1 -0
- package/dist/runtime/components/input/input.d.vue.ts +38 -0
- package/dist/runtime/components/input/input.vue +38 -0
- package/dist/runtime/components/input/input.vue.d.ts +38 -0
- package/dist/runtime/components/input/lib/input-wrapper.context.d.ts +18 -0
- package/dist/runtime/components/input/lib/input-wrapper.context.js +9 -0
- package/dist/runtime/components/input/number-input.d.vue.ts +36 -0
- package/dist/runtime/components/input/number-input.vue +172 -0
- package/dist/runtime/components/input/number-input.vue.d.ts +36 -0
- package/dist/runtime/components/input/password-input.d.vue.ts +4 -0
- package/dist/runtime/components/input/password-input.vue +28 -0
- package/dist/runtime/components/input/password-input.vue.d.ts +4 -0
- package/dist/runtime/components/input/text-input.d.vue.ts +32 -0
- package/dist/runtime/components/input/text-input.vue +38 -0
- package/dist/runtime/components/input/text-input.vue.d.ts +32 -0
- package/dist/runtime/components/input/types/index.d.ts +5 -0
- package/dist/runtime/components/input/types/index.js +0 -0
- package/dist/runtime/components/input/ui/input-base.d.vue.ts +28 -0
- package/dist/runtime/components/input/ui/input-base.vue +343 -0
- package/dist/runtime/components/input/ui/input-base.vue.d.ts +28 -0
- package/dist/runtime/components/input/ui/input-inline.d.vue.ts +30 -0
- package/dist/runtime/components/input/ui/input-inline.vue +138 -0
- package/dist/runtime/components/input/ui/input-inline.vue.d.ts +30 -0
- package/dist/runtime/components/input/ui/input-label.d.vue.ts +18 -0
- package/dist/runtime/components/input/ui/input-label.vue +26 -0
- package/dist/runtime/components/input/ui/input-label.vue.d.ts +18 -0
- package/dist/runtime/components/input/ui/input-wrapper.d.vue.ts +26 -0
- package/dist/runtime/components/input/ui/input-wrapper.vue +96 -0
- package/dist/runtime/components/input/ui/input-wrapper.vue.d.ts +26 -0
- package/dist/runtime/components/link/index.d.ts +3 -0
- package/dist/runtime/components/link/index.js +1 -0
- package/dist/runtime/components/link/lib.d.ts +16 -0
- package/dist/runtime/components/link/lib.js +25 -0
- package/dist/runtime/components/link/link-button.d.vue.ts +21 -0
- package/dist/runtime/components/link/link-button.vue +42 -0
- package/dist/runtime/components/link/link-button.vue.d.ts +21 -0
- package/dist/runtime/components/link/link.d.vue.ts +18 -0
- package/dist/runtime/components/link/link.vue +47 -0
- package/dist/runtime/components/link/link.vue.d.ts +18 -0
- package/dist/runtime/components/loader/_loaders/bars-loader.d.vue.ts +3 -0
- package/dist/runtime/components/loader/_loaders/bars-loader.vue +11 -0
- package/dist/runtime/components/loader/_loaders/bars-loader.vue.d.ts +3 -0
- package/dist/runtime/components/loader/_loaders/dots-loader.d.vue.ts +3 -0
- package/dist/runtime/components/loader/_loaders/dots-loader.vue +11 -0
- package/dist/runtime/components/loader/_loaders/dots-loader.vue.d.ts +3 -0
- package/dist/runtime/components/loader/_loaders/oval-loader.d.vue.ts +3 -0
- package/dist/runtime/components/loader/_loaders/oval-loader.vue +7 -0
- package/dist/runtime/components/loader/_loaders/oval-loader.vue.d.ts +3 -0
- package/dist/runtime/components/loader/index.d.ts +1 -0
- package/dist/runtime/components/loader/index.js +0 -0
- package/dist/runtime/components/loader/loader.d.vue.ts +10 -0
- package/dist/runtime/components/loader/loader.vue +37 -0
- package/dist/runtime/components/loader/loader.vue.d.ts +10 -0
- package/dist/runtime/components/modal/index.d.ts +3 -0
- package/dist/runtime/components/modal/index.js +0 -0
- package/dist/runtime/components/modal/modal-close-button.d.vue.ts +14 -0
- package/dist/runtime/components/modal/modal-close-button.vue +20 -0
- package/dist/runtime/components/modal/modal-close-button.vue.d.ts +14 -0
- package/dist/runtime/components/modal/modal-header.d.vue.ts +16 -0
- package/dist/runtime/components/modal/modal-header.vue +10 -0
- package/dist/runtime/components/modal/modal-header.vue.d.ts +16 -0
- package/dist/runtime/components/modal/modal-root.d.vue.ts +33 -0
- package/dist/runtime/components/modal/modal-root.vue +30 -0
- package/dist/runtime/components/modal/modal-root.vue.d.ts +33 -0
- package/dist/runtime/components/modal/modal-title.d.vue.ts +16 -0
- package/dist/runtime/components/modal/modal-title.vue +10 -0
- package/dist/runtime/components/modal/modal-title.vue.d.ts +16 -0
- package/dist/runtime/components/modal/modal.module.css +1 -0
- package/dist/runtime/components/nav-link/index.d.ts +1 -0
- package/dist/runtime/components/nav-link/index.js +0 -0
- package/dist/runtime/components/nav-link/nav-link.d.vue.ts +35 -0
- package/dist/runtime/components/nav-link/nav-link.vue +201 -0
- package/dist/runtime/components/nav-link/nav-link.vue.d.ts +35 -0
- package/dist/runtime/components/paper.d.vue.ts +20 -0
- package/dist/runtime/components/paper.vue +53 -0
- package/dist/runtime/components/paper.vue.d.ts +20 -0
- package/dist/runtime/components/popover/index.d.ts +1 -0
- package/dist/runtime/components/popover/index.js +0 -0
- package/dist/runtime/components/popover/lib/context.d.ts +14 -0
- package/dist/runtime/components/popover/lib/context.js +8 -0
- package/dist/runtime/components/popover/lib/get-arrow-position.d.ts +12 -0
- package/dist/runtime/components/popover/lib/get-arrow-position.js +88 -0
- package/dist/runtime/components/popover/lib/use-popover.d.ts +23 -0
- package/dist/runtime/components/popover/lib/use-popover.js +47 -0
- package/dist/runtime/components/popover/popover-dropdown.d.vue.ts +13 -0
- package/dist/runtime/components/popover/popover-dropdown.vue +90 -0
- package/dist/runtime/components/popover/popover-dropdown.vue.d.ts +13 -0
- package/dist/runtime/components/popover/popover-target.d.vue.ts +13 -0
- package/dist/runtime/components/popover/popover-target.vue +11 -0
- package/dist/runtime/components/popover/popover-target.vue.d.ts +13 -0
- package/dist/runtime/components/popover/popover.d.vue.ts +27 -0
- package/dist/runtime/components/popover/popover.vue +79 -0
- package/dist/runtime/components/popover/popover.vue.d.ts +27 -0
- package/dist/runtime/components/popover/types/index.d.ts +42 -0
- package/dist/runtime/components/popover/types/index.js +0 -0
- package/dist/runtime/components/renderless/renderless-slot.d.ts +6 -0
- package/dist/runtime/components/renderless/renderless-slot.js +32 -0
- package/dist/runtime/components/renderless/renderless.d.vue.ts +13 -0
- package/dist/runtime/components/renderless/renderless.vue +12 -0
- package/dist/runtime/components/renderless/renderless.vue.d.ts +13 -0
- package/dist/runtime/components/select/index.d.ts +1 -0
- package/dist/runtime/components/select/index.js +0 -0
- package/dist/runtime/components/select/select.d.vue.ts +45 -0
- package/dist/runtime/components/select/select.vue +131 -0
- package/dist/runtime/components/select/select.vue.d.ts +45 -0
- package/dist/runtime/components/tabs/index.d.ts +1 -0
- package/dist/runtime/components/tabs/index.js +1 -0
- package/dist/runtime/components/tabs/lib.d.ts +142 -0
- package/dist/runtime/components/tabs/lib.js +18 -0
- package/dist/runtime/components/tabs/tabs-list.d.vue.ts +19 -0
- package/dist/runtime/components/tabs/tabs-list.vue +31 -0
- package/dist/runtime/components/tabs/tabs-list.vue.d.ts +19 -0
- package/dist/runtime/components/tabs/tabs-panel.d.vue.ts +17 -0
- package/dist/runtime/components/tabs/tabs-panel.vue +23 -0
- package/dist/runtime/components/tabs/tabs-panel.vue.d.ts +17 -0
- package/dist/runtime/components/tabs/tabs-root.d.vue.ts +47 -0
- package/dist/runtime/components/tabs/tabs-root.vue +71 -0
- package/dist/runtime/components/tabs/tabs-root.vue.d.ts +47 -0
- package/dist/runtime/components/tabs/tabs-tab.d.vue.ts +22 -0
- package/dist/runtime/components/tabs/tabs-tab.vue +41 -0
- package/dist/runtime/components/tabs/tabs-tab.vue.d.ts +22 -0
- package/dist/runtime/components/tabs/tabs.module.css +1 -0
- package/dist/runtime/components/text.d.vue.ts +37 -0
- package/dist/runtime/components/text.vue +122 -0
- package/dist/runtime/components/text.vue.d.ts +37 -0
- package/dist/runtime/components/textarea.d.vue.ts +33 -0
- package/dist/runtime/components/textarea.vue +48 -0
- package/dist/runtime/components/textarea.vue.d.ts +33 -0
- package/dist/runtime/components/title.d.vue.ts +18 -0
- package/dist/runtime/components/title.vue +34 -0
- package/dist/runtime/components/title.vue.d.ts +18 -0
- package/dist/runtime/components/transition/index.d.ts +1 -0
- package/dist/runtime/components/transition/index.js +0 -0
- package/dist/runtime/components/transition/transition.d.vue.ts +25 -0
- package/dist/runtime/components/transition/transition.vue +31 -0
- package/dist/runtime/components/transition/transition.vue.d.ts +25 -0
- package/dist/runtime/components/visually-hidden/index.d.ts +2 -0
- package/dist/runtime/components/visually-hidden/index.js +0 -0
- package/dist/runtime/components/visually-hidden/visually-hidden-input.d.vue.ts +22 -0
- package/dist/runtime/components/visually-hidden/visually-hidden-input.vue +13 -0
- package/dist/runtime/components/visually-hidden/visually-hidden-input.vue.d.ts +22 -0
- package/dist/runtime/components/visually-hidden/visually-hidden.d.vue.ts +17 -0
- package/dist/runtime/components/visually-hidden/visually-hidden.vue +22 -0
- package/dist/runtime/components/visually-hidden/visually-hidden.vue.d.ts +17 -0
- package/dist/runtime/composals/index.d.ts +4 -0
- package/dist/runtime/composals/index.js +4 -0
- package/dist/runtime/composals/use-active-link.d.ts +5 -0
- package/dist/runtime/composals/use-active-link.js +20 -0
- package/dist/runtime/composals/use-mod.d.ts +2 -0
- package/dist/runtime/composals/use-mod.js +25 -0
- package/dist/runtime/composals/use-style-resolver.d.ts +3 -0
- package/dist/runtime/composals/use-style-resolver.js +5 -0
- package/dist/runtime/composals/use-theme.d.ts +9 -0
- package/dist/runtime/composals/use-theme.js +4 -0
- package/dist/runtime/const/index.d.ts +2 -0
- package/dist/runtime/const/index.js +6 -0
- package/dist/runtime/helpers/create-strict-injection.d.ts +94 -0
- package/dist/runtime/helpers/create-strict-injection.js +11 -0
- package/dist/runtime/helpers/index.d.ts +1 -0
- package/dist/runtime/helpers/index.js +1 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/styles/baseline.css +1 -0
- package/dist/runtime/styles/colors.css +1 -0
- package/dist/runtime/styles/const.css +1 -0
- package/dist/runtime/styles/dark-theme.css +1 -0
- package/dist/runtime/styles/global.css +1 -0
- package/dist/runtime/styles/light-theme.css +1 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +0 -0
- package/dist/runtime/types/theme.d.ts +25 -0
- package/dist/runtime/types/theme.js +0 -0
- package/dist/runtime/utils/boolean/is-falsy.d.ts +1 -0
- package/dist/runtime/utils/boolean/is-falsy.js +7 -0
- package/dist/runtime/utils/boolean/is-number-like.d.ts +1 -0
- package/dist/runtime/utils/boolean/is-number-like.js +13 -0
- package/dist/runtime/utils/color-functions/get-gradient.d.ts +3 -0
- package/dist/runtime/utils/color-functions/get-gradient.js +25 -0
- package/dist/runtime/utils/converters/rem.d.ts +2 -0
- package/dist/runtime/utils/converters/rem.js +43 -0
- package/dist/runtime/utils/get-color-var.d.ts +2 -0
- package/dist/runtime/utils/get-color-var.js +6 -0
- package/dist/runtime/utils/get-safe-id.d.ts +1 -0
- package/dist/runtime/utils/get-safe-id.js +8 -0
- package/dist/runtime/utils/get-size/get-size.d.ts +6 -0
- package/dist/runtime/utils/get-size/get-size.js +24 -0
- package/dist/runtime/utils/index.d.ts +7 -0
- package/dist/runtime/utils/index.js +7 -0
- package/dist/runtime/utils/parse-theme-color/parse-theme-color.d.ts +14 -0
- package/dist/runtime/utils/parse-theme-color/parse-theme-color.js +73 -0
- package/dist/runtime/utils/vars-resolver/create-variant-color-resolver.d.ts +14 -0
- package/dist/runtime/utils/vars-resolver/create-variant-color-resolver.js +106 -0
- package/dist/types.d.mts +3 -0
- package/package.json +96 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import Box from "../box.vue";
|
|
4
|
+
import css from "./combobox.module.css";
|
|
5
|
+
import { COMBOBOX_ATTRS } from "./lib/const";
|
|
6
|
+
import { useComboboxState } from "./lib/context";
|
|
7
|
+
const {
|
|
8
|
+
data,
|
|
9
|
+
iconPosition = "left",
|
|
10
|
+
checkIcon = "gravity-ui:check",
|
|
11
|
+
withCheckIcon,
|
|
12
|
+
mod: _mod,
|
|
13
|
+
checked,
|
|
14
|
+
selected
|
|
15
|
+
} = defineProps({
|
|
16
|
+
data: { type: Object, required: true },
|
|
17
|
+
checked: { type: Boolean, required: true },
|
|
18
|
+
selected: { type: Boolean, required: false },
|
|
19
|
+
withCheckIcon: { type: Boolean, required: false },
|
|
20
|
+
checkIcon: { type: String, required: false },
|
|
21
|
+
iconPosition: { type: String, required: false }
|
|
22
|
+
});
|
|
23
|
+
defineSlots();
|
|
24
|
+
const { onOptionSubmit } = useComboboxState();
|
|
25
|
+
const mod = computed(() => [
|
|
26
|
+
{
|
|
27
|
+
[COMBOBOX_ATTRS.option]: true,
|
|
28
|
+
[COMBOBOX_ATTRS.active]: checked,
|
|
29
|
+
[COMBOBOX_ATTRS.selected]: selected,
|
|
30
|
+
[COMBOBOX_ATTRS.disabled]: data?.disabled,
|
|
31
|
+
reverse: iconPosition === "right",
|
|
32
|
+
checked
|
|
33
|
+
},
|
|
34
|
+
_mod
|
|
35
|
+
]);
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<Box
|
|
40
|
+
:class='css.option'
|
|
41
|
+
:mod
|
|
42
|
+
role='option'
|
|
43
|
+
:aria-selected='checked'
|
|
44
|
+
@click='() => !data?.disabled && onOptionSubmit?.(data.value, data)'
|
|
45
|
+
>
|
|
46
|
+
<slot
|
|
47
|
+
:with-check-icon
|
|
48
|
+
:icon-position
|
|
49
|
+
:data
|
|
50
|
+
:checked
|
|
51
|
+
>
|
|
52
|
+
<Icon
|
|
53
|
+
v-if='withCheckIcon && iconPosition === "left"'
|
|
54
|
+
:class='css.optionCheck'
|
|
55
|
+
:name='data?.icon ?? checkIcon'
|
|
56
|
+
/>
|
|
57
|
+
<span>{{ data.label }}</span>
|
|
58
|
+
<Icon
|
|
59
|
+
v-if='withCheckIcon && iconPosition === "right"'
|
|
60
|
+
:class='css.optionCheck'
|
|
61
|
+
:name='data?.icon ?? checkIcon'
|
|
62
|
+
/>
|
|
63
|
+
</slot>
|
|
64
|
+
</Box>
|
|
65
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { BoxProps } from '../box.vue.js';
|
|
2
|
+
import type { ComboboxItem, ComboboxItemExt, ComboboxItemProps } from './types/index.js';
|
|
3
|
+
export interface ComboboxOptionProps<Value extends string = string, Ext extends ComboboxItemExt = object> extends /* @vue-ignore */ Omit<BoxProps, 'is'>, ComboboxItemProps {
|
|
4
|
+
data: ComboboxItem<Value, Ext>;
|
|
5
|
+
checked: boolean;
|
|
6
|
+
selected?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const __VLS_export: <Value extends string = string, Ext extends ComboboxItemExt = object>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
9
|
+
props: __VLS_PrettifyLocal<ComboboxOptionProps<Value, Ext>> & import("vue").PublicProps;
|
|
10
|
+
expose: (exposed: {}) => void;
|
|
11
|
+
attrs: any;
|
|
12
|
+
slots: {
|
|
13
|
+
default?: (props: Required<Pick<ComboboxOptionProps<Value, Ext>, "withCheckIcon" | "iconPosition" | "data" | "checked">>) => any;
|
|
14
|
+
};
|
|
15
|
+
emit: {};
|
|
16
|
+
}>) => import("vue").VNode & {
|
|
17
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
18
|
+
};
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_PrettifyLocal<T> = {
|
|
22
|
+
[K in keyof T as K]: T[K];
|
|
23
|
+
} & {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { FilterOptionsInput } from './lib/utils/index.js';
|
|
2
|
+
import type { ComboboxItem, ComboboxItemExt, ComboboxParsedItem } from './types/index.js';
|
|
3
|
+
export interface ComboboxOptionsDropdownProps<Value extends string = string, Ext extends ComboboxItemExt = object> {
|
|
4
|
+
data: ComboboxParsedItem<Value, Ext>[];
|
|
5
|
+
filter?: (input: FilterOptionsInput<Value, Ext>) => ComboboxParsedItem<Value, Ext>[];
|
|
6
|
+
limit?: number;
|
|
7
|
+
withScrollArea?: boolean;
|
|
8
|
+
maxDropdownHeight?: number | string;
|
|
9
|
+
hiddenWhenEmpty?: boolean;
|
|
10
|
+
filterOptions?: boolean;
|
|
11
|
+
nothingFoundMessage?: string;
|
|
12
|
+
labelId: string | undefined;
|
|
13
|
+
ariaLabel: string | undefined;
|
|
14
|
+
withCheckIcon?: boolean;
|
|
15
|
+
iconPosition?: 'left' | 'right';
|
|
16
|
+
checkIcon?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const __VLS_export: <Value extends string = string, Ext extends ComboboxItemExt = object>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
19
|
+
props: __VLS_PrettifyLocal<(ComboboxOptionsDropdownProps<Value, Ext> & {
|
|
20
|
+
search?: string | undefined;
|
|
21
|
+
modelValue?: ComboboxItem<Value, Ext> | ComboboxItem<Value, Ext>[] | null;
|
|
22
|
+
}) & __VLS_EmitsToProps<__VLS_NormalizeEmits<((evt: "update:modelValue", value: ComboboxItem<Value, Ext> | ComboboxItem<Value, Ext>[] | null | undefined) => void) & ((evt: "update:search", value: string | undefined) => void)>>> & import("vue").PublicProps;
|
|
23
|
+
expose: (exposed: {}) => void;
|
|
24
|
+
attrs: any;
|
|
25
|
+
slots: {};
|
|
26
|
+
emit: ((evt: "update:modelValue", value: ComboboxItem<Value, Ext> | ComboboxItem<Value, Ext>[] | null | undefined) => void) & ((evt: "update:search", value: string | undefined) => void);
|
|
27
|
+
}>) => import("vue").VNode & {
|
|
28
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
29
|
+
};
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_PrettifyLocal<T> = {
|
|
33
|
+
[K in keyof T as K]: T[K];
|
|
34
|
+
} & {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import ComboboxDropdown from "./combobox-dropdown.vue";
|
|
4
|
+
import ComboboxEmpty from "./combobox-empty.vue";
|
|
5
|
+
import ComboboxGroup from "./combobox-group.vue";
|
|
6
|
+
import ComboboxOptionList from "./combobox-option-list.vue";
|
|
7
|
+
import ComboboxOption from "./combobox-option.vue";
|
|
8
|
+
import { defaultOptionsFilter, isEmptyComboboxData, isOptionsGroup, isValueChecked } from "./lib/utils";
|
|
9
|
+
const {
|
|
10
|
+
data,
|
|
11
|
+
labelId,
|
|
12
|
+
ariaLabel,
|
|
13
|
+
nothingFoundMessage = "\u041D\u0435\u0442 \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u043E\u0432",
|
|
14
|
+
withCheckIcon = true,
|
|
15
|
+
filterOptions = true,
|
|
16
|
+
iconPosition,
|
|
17
|
+
checkIcon,
|
|
18
|
+
filter,
|
|
19
|
+
limit
|
|
20
|
+
} = defineProps({
|
|
21
|
+
data: { type: Array, required: true },
|
|
22
|
+
filter: { type: Function, required: false },
|
|
23
|
+
limit: { type: Number, required: false },
|
|
24
|
+
withScrollArea: { type: Boolean, required: false },
|
|
25
|
+
maxDropdownHeight: { type: [Number, String], required: false },
|
|
26
|
+
hiddenWhenEmpty: { type: Boolean, required: false },
|
|
27
|
+
filterOptions: { type: Boolean, required: false },
|
|
28
|
+
nothingFoundMessage: { type: String, required: false },
|
|
29
|
+
labelId: { type: null, required: true },
|
|
30
|
+
ariaLabel: { type: null, required: true },
|
|
31
|
+
withCheckIcon: { type: Boolean, required: false },
|
|
32
|
+
iconPosition: { type: String, required: false },
|
|
33
|
+
checkIcon: { type: String, required: false }
|
|
34
|
+
});
|
|
35
|
+
const search = defineModel("search", { type: null });
|
|
36
|
+
const value = defineModel({ type: [Object, Array, null] });
|
|
37
|
+
const isEmpty = computed(() => isEmptyComboboxData(data));
|
|
38
|
+
const filteredData = computed(() => typeof search.value === "string" ? (filter || defaultOptionsFilter)({
|
|
39
|
+
options: data,
|
|
40
|
+
search: filterOptions ? search.value : "",
|
|
41
|
+
limit: limit ?? Infinity
|
|
42
|
+
}) : data);
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<template>
|
|
46
|
+
<ComboboxDropdown data-composed>
|
|
47
|
+
<ComboboxOptionList :labelled-by='labelId' :aria-label='ariaLabel'>
|
|
48
|
+
<template
|
|
49
|
+
v-for='item in filteredData'
|
|
50
|
+
:key='isOptionsGroup(item) ? item.group : item?.value'
|
|
51
|
+
>
|
|
52
|
+
<ComboboxGroup
|
|
53
|
+
v-if='isOptionsGroup(item)'
|
|
54
|
+
v-model:value='value'
|
|
55
|
+
:data='item'
|
|
56
|
+
:with-check-icon
|
|
57
|
+
:icon-position
|
|
58
|
+
:check-icon
|
|
59
|
+
/>
|
|
60
|
+
<ComboboxOption
|
|
61
|
+
v-else
|
|
62
|
+
:data='item'
|
|
63
|
+
:with-check-icon
|
|
64
|
+
:icon-position
|
|
65
|
+
:check-icon
|
|
66
|
+
:checked='isValueChecked(value, item)'
|
|
67
|
+
/>
|
|
68
|
+
</template>
|
|
69
|
+
<ComboboxEmpty v-if='isEmpty'>
|
|
70
|
+
{{ nothingFoundMessage }}
|
|
71
|
+
</ComboboxEmpty>
|
|
72
|
+
</ComboboxOptionList>
|
|
73
|
+
</ComboboxDropdown>
|
|
74
|
+
</template>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { FilterOptionsInput } from './lib/utils/index.js';
|
|
2
|
+
import type { ComboboxItem, ComboboxItemExt, ComboboxParsedItem } from './types/index.js';
|
|
3
|
+
export interface ComboboxOptionsDropdownProps<Value extends string = string, Ext extends ComboboxItemExt = object> {
|
|
4
|
+
data: ComboboxParsedItem<Value, Ext>[];
|
|
5
|
+
filter?: (input: FilterOptionsInput<Value, Ext>) => ComboboxParsedItem<Value, Ext>[];
|
|
6
|
+
limit?: number;
|
|
7
|
+
withScrollArea?: boolean;
|
|
8
|
+
maxDropdownHeight?: number | string;
|
|
9
|
+
hiddenWhenEmpty?: boolean;
|
|
10
|
+
filterOptions?: boolean;
|
|
11
|
+
nothingFoundMessage?: string;
|
|
12
|
+
labelId: string | undefined;
|
|
13
|
+
ariaLabel: string | undefined;
|
|
14
|
+
withCheckIcon?: boolean;
|
|
15
|
+
iconPosition?: 'left' | 'right';
|
|
16
|
+
checkIcon?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const __VLS_export: <Value extends string = string, Ext extends ComboboxItemExt = object>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
19
|
+
props: __VLS_PrettifyLocal<(ComboboxOptionsDropdownProps<Value, Ext> & {
|
|
20
|
+
search?: string | undefined;
|
|
21
|
+
modelValue?: ComboboxItem<Value, Ext> | ComboboxItem<Value, Ext>[] | null;
|
|
22
|
+
}) & __VLS_EmitsToProps<__VLS_NormalizeEmits<((evt: "update:modelValue", value: ComboboxItem<Value, Ext> | ComboboxItem<Value, Ext>[] | null | undefined) => void) & ((evt: "update:search", value: string | undefined) => void)>>> & import("vue").PublicProps;
|
|
23
|
+
expose: (exposed: {}) => void;
|
|
24
|
+
attrs: any;
|
|
25
|
+
slots: {};
|
|
26
|
+
emit: ((evt: "update:modelValue", value: ComboboxItem<Value, Ext> | ComboboxItem<Value, Ext>[] | null | undefined) => void) & ((evt: "update:search", value: string | undefined) => void);
|
|
27
|
+
}>) => import("vue").VNode & {
|
|
28
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
29
|
+
};
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_PrettifyLocal<T> = {
|
|
33
|
+
[K in keyof T as K]: T[K];
|
|
34
|
+
} & {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { UiKitSize } from '@nui/types';
|
|
2
|
+
import type { CSSProperties } from 'vue';
|
|
3
|
+
import type { PopoverProps } from '../popover/index.js';
|
|
4
|
+
import type { ComboboxStore } from './lib/use-combobox/index.js';
|
|
5
|
+
export interface ComboboxProps extends /* @vue-ignore */ PopoverProps {
|
|
6
|
+
store?: ComboboxStore;
|
|
7
|
+
/** Determines whether arrow key presses should loop though items (first to last and last to first), `true` by default */
|
|
8
|
+
loop?: boolean;
|
|
9
|
+
/** `behavior` passed down to `element.scrollIntoView`, `'instant'` by default */
|
|
10
|
+
scrollBehavior?: ScrollBehavior;
|
|
11
|
+
/** Controls items `font-size` and `padding` @default `'sm'` */
|
|
12
|
+
size?: UiKitSize;
|
|
13
|
+
/** Controls `padding` of the dropdown @default `4` */
|
|
14
|
+
dropdownPadding?: UiKitSize | CSSProperties['padding'];
|
|
15
|
+
/** Determines whether the `Combobox` value can be changed */
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
}
|
|
18
|
+
type __VLS_Props = ComboboxProps;
|
|
19
|
+
type __VLS_ModelProps = {
|
|
20
|
+
'open'?: boolean;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
23
|
+
declare var __VLS_6: {};
|
|
24
|
+
type __VLS_Slots = {} & {
|
|
25
|
+
default?: (props: typeof __VLS_6) => any;
|
|
26
|
+
};
|
|
27
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
|
+
select: (args_0: number) => any;
|
|
29
|
+
clear: () => any;
|
|
30
|
+
close: (args_0: import("./types/index.js").ComboboxDropdownEventSource) => any;
|
|
31
|
+
submit: (args_0: string, args_1: import("./types/index.js").ComboboxItem) => any;
|
|
32
|
+
open: (args_0: import("./types/index.js").ComboboxDropdownEventSource) => any;
|
|
33
|
+
"update:open": (value: boolean) => any;
|
|
34
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
35
|
+
onSelect?: ((args_0: number) => any) | undefined;
|
|
36
|
+
onClear?: (() => any) | undefined;
|
|
37
|
+
onClose?: ((args_0: import("./types/index.js").ComboboxDropdownEventSource) => any) | undefined;
|
|
38
|
+
onSubmit?: ((args_0: string, args_1: import("./types/index.js").ComboboxItem) => any) | undefined;
|
|
39
|
+
onOpen?: ((args_0: import("./types/index.js").ComboboxDropdownEventSource) => any) | undefined;
|
|
40
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
41
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
43
|
+
declare const _default: typeof __VLS_export;
|
|
44
|
+
export default _default;
|
|
45
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import Popover from "../popover/popover.vue";
|
|
3
|
+
import { useProvideComboboxState } from "./lib/context";
|
|
4
|
+
import { useCombobox } from "./lib/use-combobox";
|
|
5
|
+
const {
|
|
6
|
+
scrollBehavior = "instant",
|
|
7
|
+
loop = true,
|
|
8
|
+
readOnly = false,
|
|
9
|
+
size = "sm",
|
|
10
|
+
store: _store,
|
|
11
|
+
dropdownPadding,
|
|
12
|
+
...rest
|
|
13
|
+
} = defineProps({
|
|
14
|
+
store: { type: Object, required: false },
|
|
15
|
+
loop: { type: Boolean, required: false },
|
|
16
|
+
scrollBehavior: { type: null, required: false },
|
|
17
|
+
size: { type: String, required: false },
|
|
18
|
+
dropdownPadding: { type: null, required: false },
|
|
19
|
+
readOnly: { type: Boolean, required: false }
|
|
20
|
+
});
|
|
21
|
+
const emit = defineEmits(["clear", "select", "open", "close", "submit"]);
|
|
22
|
+
const opened = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
23
|
+
const store = _store ?? useCombobox({
|
|
24
|
+
loop,
|
|
25
|
+
scrollBehavior,
|
|
26
|
+
onSelect: (ix) => emit("select", ix),
|
|
27
|
+
onClear: () => emit("clear"),
|
|
28
|
+
onOpenDropdown: (source) => emit("open", source),
|
|
29
|
+
onCloseDropdown: (source) => emit("close", source),
|
|
30
|
+
opened
|
|
31
|
+
});
|
|
32
|
+
useProvideComboboxState({
|
|
33
|
+
store,
|
|
34
|
+
opened,
|
|
35
|
+
readOnly,
|
|
36
|
+
size,
|
|
37
|
+
onOptionSubmit: (value, option) => emit("submit", value, option),
|
|
38
|
+
dropdownPadding
|
|
39
|
+
});
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<template>
|
|
43
|
+
<Popover v-bind='rest' v-model:open='opened'>
|
|
44
|
+
<slot />
|
|
45
|
+
</Popover>
|
|
46
|
+
</template>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { UiKitSize } from '@nui/types';
|
|
2
|
+
import type { CSSProperties } from 'vue';
|
|
3
|
+
import type { PopoverProps } from '../popover/index.js';
|
|
4
|
+
import type { ComboboxStore } from './lib/use-combobox/index.js';
|
|
5
|
+
export interface ComboboxProps extends /* @vue-ignore */ PopoverProps {
|
|
6
|
+
store?: ComboboxStore;
|
|
7
|
+
/** Determines whether arrow key presses should loop though items (first to last and last to first), `true` by default */
|
|
8
|
+
loop?: boolean;
|
|
9
|
+
/** `behavior` passed down to `element.scrollIntoView`, `'instant'` by default */
|
|
10
|
+
scrollBehavior?: ScrollBehavior;
|
|
11
|
+
/** Controls items `font-size` and `padding` @default `'sm'` */
|
|
12
|
+
size?: UiKitSize;
|
|
13
|
+
/** Controls `padding` of the dropdown @default `4` */
|
|
14
|
+
dropdownPadding?: UiKitSize | CSSProperties['padding'];
|
|
15
|
+
/** Determines whether the `Combobox` value can be changed */
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
}
|
|
18
|
+
type __VLS_Props = ComboboxProps;
|
|
19
|
+
type __VLS_ModelProps = {
|
|
20
|
+
'open'?: boolean;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
23
|
+
declare var __VLS_6: {};
|
|
24
|
+
type __VLS_Slots = {} & {
|
|
25
|
+
default?: (props: typeof __VLS_6) => any;
|
|
26
|
+
};
|
|
27
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
|
+
select: (args_0: number) => any;
|
|
29
|
+
clear: () => any;
|
|
30
|
+
close: (args_0: import("./types/index.js").ComboboxDropdownEventSource) => any;
|
|
31
|
+
submit: (args_0: string, args_1: import("./types/index.js").ComboboxItem) => any;
|
|
32
|
+
open: (args_0: import("./types/index.js").ComboboxDropdownEventSource) => any;
|
|
33
|
+
"update:open": (value: boolean) => any;
|
|
34
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
35
|
+
onSelect?: ((args_0: number) => any) | undefined;
|
|
36
|
+
onClear?: (() => any) | undefined;
|
|
37
|
+
onClose?: ((args_0: import("./types/index.js").ComboboxDropdownEventSource) => any) | undefined;
|
|
38
|
+
onSubmit?: ((args_0: string, args_1: import("./types/index.js").ComboboxItem) => any) | undefined;
|
|
39
|
+
onOpen?: ((args_0: import("./types/index.js").ComboboxDropdownEventSource) => any) | undefined;
|
|
40
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
41
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
43
|
+
declare const _default: typeof __VLS_export;
|
|
44
|
+
export default _default;
|
|
45
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface ComboboxTargetProps {
|
|
2
|
+
/** If set, the component responds to keyboard events @default `true` */
|
|
3
|
+
withKeyboardNavigation?: boolean;
|
|
4
|
+
/** If set, the target has `aria-` attributes @default `true` */
|
|
5
|
+
withAriaAttributes?: boolean;
|
|
6
|
+
/** If set, the target has `aria-expanded` attribute @default `false` */
|
|
7
|
+
withExpandedAttribute?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Determines which events is handled by the target element.
|
|
10
|
+
* `button` target type handles `Space` and `Enter` keys to toggle dropdown opened state.
|
|
11
|
+
* @default `input`
|
|
12
|
+
*/
|
|
13
|
+
targetType?: 'button' | 'input';
|
|
14
|
+
/** Input autocomplete attribute */
|
|
15
|
+
autoComplete?: string;
|
|
16
|
+
}
|
|
17
|
+
declare var __VLS_7: {};
|
|
18
|
+
type __VLS_Slots = {} & {
|
|
19
|
+
default?: (props: typeof __VLS_7) => any;
|
|
20
|
+
};
|
|
21
|
+
declare const __VLS_base: import("vue").DefineComponent<ComboboxTargetProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ComboboxTargetProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import PopoverTarget from "../popover/popover-target.vue";
|
|
3
|
+
import { useComboboxState } from "./lib/context";
|
|
4
|
+
import { useComboboxTarget } from "./lib/use-combobox-target";
|
|
5
|
+
const {
|
|
6
|
+
withAriaAttributes = true,
|
|
7
|
+
withExpandedAttribute = true,
|
|
8
|
+
withKeyboardNavigation = true,
|
|
9
|
+
targetType = "input",
|
|
10
|
+
autoComplete = "off"
|
|
11
|
+
} = defineProps({
|
|
12
|
+
withKeyboardNavigation: { type: Boolean, required: false },
|
|
13
|
+
withAriaAttributes: { type: Boolean, required: false },
|
|
14
|
+
withExpandedAttribute: { type: Boolean, required: false },
|
|
15
|
+
targetType: { type: String, required: false },
|
|
16
|
+
autoComplete: { type: String, required: false }
|
|
17
|
+
});
|
|
18
|
+
const aria = useComboboxTarget({
|
|
19
|
+
targetType,
|
|
20
|
+
withKeyboardNavigation,
|
|
21
|
+
withExpandedAttribute,
|
|
22
|
+
autoComplete,
|
|
23
|
+
withAriaAttributes
|
|
24
|
+
});
|
|
25
|
+
const { store: { targetRef } } = useComboboxState();
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<PopoverTarget ref='targetRef' v-bind='aria'>
|
|
30
|
+
<slot />
|
|
31
|
+
</PopoverTarget>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface ComboboxTargetProps {
|
|
2
|
+
/** If set, the component responds to keyboard events @default `true` */
|
|
3
|
+
withKeyboardNavigation?: boolean;
|
|
4
|
+
/** If set, the target has `aria-` attributes @default `true` */
|
|
5
|
+
withAriaAttributes?: boolean;
|
|
6
|
+
/** If set, the target has `aria-expanded` attribute @default `false` */
|
|
7
|
+
withExpandedAttribute?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Determines which events is handled by the target element.
|
|
10
|
+
* `button` target type handles `Space` and `Enter` keys to toggle dropdown opened state.
|
|
11
|
+
* @default `input`
|
|
12
|
+
*/
|
|
13
|
+
targetType?: 'button' | 'input';
|
|
14
|
+
/** Input autocomplete attribute */
|
|
15
|
+
autoComplete?: string;
|
|
16
|
+
}
|
|
17
|
+
declare var __VLS_7: {};
|
|
18
|
+
type __VLS_Slots = {} & {
|
|
19
|
+
default?: (props: typeof __VLS_7) => any;
|
|
20
|
+
};
|
|
21
|
+
declare const __VLS_base: import("vue").DefineComponent<ComboboxTargetProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ComboboxTargetProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.dropdown{--combobox-padding:.25rem;padding:var(--combobox-padding)}.dropdown:has([data-scrollbar]) .search{max-width:calc(100% + var(--combobox-padding))}.dropdown[data-composed]{padding-inline-end:0}.dropdown[data-hidden]{display:none}.dropdown,.options{--combobox-option-padding-xs:rem(4px) rem(8px);--combobox-option-padding-sm:rem(6px) rem(10px);--combobox-option-padding-md:rem(8px) rem(12px);--combobox-option-padding-lg:rem(10px) rem(16px);--combobox-option-padding-xl:rem(14px) rem(20px);--combobox-option-padding:var(--combobox-option-padding-sm)}.option{align-items:center;background-color:transparent;border-radius:var(--radius-default);color:inherit;cursor:pointer;display:flex;font-size:var(--combobox-option-fz,var(--font-size-sm));gap:8px;overflow-wrap:break-word;padding:var(--combobox-option-padding)}.option:where([data-combobox-selected]){background-color:var(--color-primary-filled);color:var(--color-white)}.option:where([data-combobox-disabled]){cursor:not-allowed;opacity:.35}.option:where([data-reverse]){justify-content:space-between}.option{@mixin hover{&:where(:not([data-combobox-selected],[data-combobox-disabled])){@mixin where-light{background-color:var(--color-gray-0)}@mixin where-dark{background-color:var(--color-dark-7)}}}}.optionCheck{height:.8em;min-width:.8em;opacity:.4;width:.8em}:where([data-combobox-selected]) .optionCheck{opacity:1}.search{border-end-end-radius:0;border-end-start-radius:0;border-inline-width:0;border-top-width:0;margin-inline:calc(var(--combobox-padding)*-1);margin-bottom:var(--combobox-padding);margin-top:calc(var(--combobox-padding)*-1);position:relative;width:calc(100% + var(--combobox-padding)*2)}.search,.search:focus{@mixin where-light{border-color:var(--color-gray-2)}@mixin where-dark{border-color:var(--color-dark-4)}}.search{@mixin where-light{background-color:var(--color-white)}}.search{@mixin where-dark{background-color:var(--color-dark-7)}}.empty{color:var(--color-dimmed);font-size:var(--combobox-option-fz,var(--font-size-sm));padding:var(--combobox-option-padding);text-align:center}.footer,.header{border:0 solid transparent;font-size:var(--combobox-option-fz,var(--font-size-sm));margin-inline:calc(var(--combobox-padding)*-1);padding:var(--combobox-option-padding);@mixin where-light{border-color:var(--color-gray-2)}@mixin where-dark{border-color:var(--color-dark-4)}}.footer{border-top-width:1px;margin-bottom:calc(var(--combobox-padding)*-1);margin-top:var(--combobox-padding)}.header{border-bottom-width:1px;margin-bottom:var(--combobox-padding);margin-top:calc(var(--combobox-padding)*-1)}.group:has(.groupLabel:only-child){display:none}.groupLabel{align-items:center;color:var(--color-dimmed);display:flex;font-size:calc(var(--combobox-option-fz, var(--font-size-sm))*.85);font-weight:500;padding:var(--combobox-option-padding);position:relative}.groupLabel:after{content:"";flex:1;height:1px;inset-inline:0;margin-inline-start:var(--spacing-xs);@mixin where-light{background-color:var(--color-gray-2)}@mixin where-dark{background-color:var(--color-dark-4)}}.groupLabel:only-child{display:none}.chevron{--combobox-chevron-size-xs:rem(14px);--combobox-chevron-size-sm:rem(18px);--combobox-chevron-size-md:rem(20px);--combobox-chevron-size-lg:rem(24px);--combobox-chevron-size-xl:rem(28px);--combobox-chevron-size:var(--combobox-chevron-size-sm);@mixin where-light{--_combobox-chevron-color:var(--combobox-chevron-color,var(--color-gray-6))}@mixin where-dark{--_combobox-chevron-color:var(--combobox-chevron-color,var(--color-dark-3))}color:var(--_combobox-chevron-color);height:var(--combobox-chevron-size);width:var(--combobox-chevron-size)}.chevron:where([data-error]){color:var(--combobox-chevron-color,var(--color-error))}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type * from './combobox-dropdown.vue';
|
|
2
|
+
export type * from './combobox-empty.vue';
|
|
3
|
+
export type * from './combobox-group.vue';
|
|
4
|
+
export type * from './combobox-option-list.vue';
|
|
5
|
+
export type * from './combobox-option.vue';
|
|
6
|
+
export type * from './combobox-options-dropdown.vue';
|
|
7
|
+
export type * from './combobox-root.vue';
|
|
8
|
+
export type * from './combobox-target.vue';
|
|
9
|
+
export { type ComboboxStore, useCombobox } from './lib/use-combobox/index.js';
|
|
10
|
+
export { useComboboxData } from './lib/use-combobox-data/index.js';
|
|
11
|
+
export type * from './types';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { UiKitSize } from '@nui/types';
|
|
2
|
+
import type { CSSProperties, ModelRef } from 'vue';
|
|
3
|
+
import type { ComboboxItem } from '../types/index.js';
|
|
4
|
+
import type { ComboboxStore } from './use-combobox/use-combobox.js';
|
|
5
|
+
interface ComboboxState {
|
|
6
|
+
opened: ModelRef<boolean>;
|
|
7
|
+
onOptionSubmit?: (value: string, option: ComboboxItem) => void;
|
|
8
|
+
size: UiKitSize;
|
|
9
|
+
readOnly: boolean;
|
|
10
|
+
store: ComboboxStore;
|
|
11
|
+
dropdownPadding?: UiKitSize | CSSProperties['padding'];
|
|
12
|
+
}
|
|
13
|
+
export declare const useProvide: (args_0: ComboboxState) => ComboboxState, useState: () => ComboboxState;
|
|
14
|
+
export declare const useProvideComboboxState: (args_0: ComboboxState) => ComboboxState;
|
|
15
|
+
export declare const useComboboxState: () => ComboboxState;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createStrictInjection } from "@nui/helpers";
|
|
2
|
+
const injectionKey = Symbol("combobox-store");
|
|
3
|
+
export const [useProvide, useState] = createStrictInjection((state) => state, {
|
|
4
|
+
injectionKey,
|
|
5
|
+
name: "ComboboxState"
|
|
6
|
+
});
|
|
7
|
+
export const useProvideComboboxState = useProvide;
|
|
8
|
+
export const useComboboxState = useState;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function getPreviousIndex(currentIndex: number, elements: NodeListOf<HTMLDivElement> | HTMLDivElement[], loop: boolean, disabledAttr: string): number;
|
|
2
|
+
export declare function getNextIndex(currentIndex: number, elements: NodeListOf<HTMLDivElement> | HTMLDivElement[], loop: boolean, disabledAttr: string): number;
|
|
3
|
+
export declare function getFirstIndex(elements: NodeListOf<HTMLDivElement> | HTMLDivElement[], disabledAttr: string): number;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export function getPreviousIndex(currentIndex, elements, loop, disabledAttr) {
|
|
2
|
+
for (let i = currentIndex - 1; i >= 0; i -= 1) {
|
|
3
|
+
if (!elements[i]?.hasAttribute(disabledAttr))
|
|
4
|
+
return i;
|
|
5
|
+
}
|
|
6
|
+
if (loop) {
|
|
7
|
+
for (let i = elements.length - 1; i > -1; i -= 1) {
|
|
8
|
+
if (!elements[i]?.hasAttribute(disabledAttr))
|
|
9
|
+
return i;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return currentIndex;
|
|
13
|
+
}
|
|
14
|
+
export function getNextIndex(currentIndex, elements, loop, disabledAttr) {
|
|
15
|
+
for (let i = currentIndex + 1; i < elements.length; i += 1) {
|
|
16
|
+
if (!elements[i]?.hasAttribute(disabledAttr))
|
|
17
|
+
return i;
|
|
18
|
+
}
|
|
19
|
+
if (loop) {
|
|
20
|
+
for (let i = 0; i < elements.length; i += 1) {
|
|
21
|
+
if (!elements[i]?.hasAttribute(disabledAttr))
|
|
22
|
+
return i;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return currentIndex;
|
|
26
|
+
}
|
|
27
|
+
export function getFirstIndex(elements, disabledAttr) {
|
|
28
|
+
for (let i = 0; i < elements.length; i += 1) {
|
|
29
|
+
if (!elements[i]?.hasAttribute(disabledAttr))
|
|
30
|
+
return i;
|
|
31
|
+
}
|
|
32
|
+
return -1;
|
|
33
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ComboboxAttrs } from '../const.js';
|
|
2
|
+
type ComboboxHandlerOptions<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
3
|
+
listId: string;
|
|
4
|
+
attrs: ComboboxAttrs;
|
|
5
|
+
} & T;
|
|
6
|
+
export type SelectHandlerReturn = {
|
|
7
|
+
ix: number;
|
|
8
|
+
value: string | null;
|
|
9
|
+
} | void;
|
|
10
|
+
type ExtFn = (ix: number) => unknown;
|
|
11
|
+
type DefaultFn = (ix: number) => unknown;
|
|
12
|
+
export declare function clearSelected({ listId, attrs }: ComboboxHandlerOptions): void;
|
|
13
|
+
export declare function selectOption(ix: number, { listId, attrs, scrollBehavior, clearFn, }: ComboboxHandlerOptions<{
|
|
14
|
+
scrollBehavior: ScrollBehavior;
|
|
15
|
+
clearFn: (listId: string) => void;
|
|
16
|
+
}>): SelectHandlerReturn;
|
|
17
|
+
export declare function selectActiveOption<T extends ExtFn = DefaultFn>({ listId, attrs, selectFn, }: ComboboxHandlerOptions<{
|
|
18
|
+
selectFn: T;
|
|
19
|
+
}>): ReturnType<T>;
|
|
20
|
+
export declare function selectNextOption<T extends ExtFn = DefaultFn>(ix: number, { listId, loop, attrs, selectFn, }: ComboboxHandlerOptions<{
|
|
21
|
+
loop: boolean;
|
|
22
|
+
selectFn: T;
|
|
23
|
+
}>): ReturnType<T>;
|
|
24
|
+
export declare function selectPrevOption<T extends ExtFn = DefaultFn>(ix: number, { listId, loop, attrs, selectFn, }: ComboboxHandlerOptions<{
|
|
25
|
+
loop: boolean;
|
|
26
|
+
selectFn: T;
|
|
27
|
+
}>): ReturnType<T>;
|
|
28
|
+
export declare function selectFirstOption<T extends ExtFn = DefaultFn>({ listId, attrs, selectFn }: ComboboxHandlerOptions<{
|
|
29
|
+
loop: boolean;
|
|
30
|
+
selectFn: T;
|
|
31
|
+
}>): ReturnType<T>;
|
|
32
|
+
export declare function updateSelectedOptionIx(target: "active" | "selected" | undefined, { listId, attrs, scrollIntoView, scrollBehavior }: ComboboxHandlerOptions<{
|
|
33
|
+
scrollIntoView?: boolean;
|
|
34
|
+
scrollBehavior: ScrollBehavior;
|
|
35
|
+
}>): number;
|
|
36
|
+
export {};
|