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,47 @@
|
|
|
1
|
+
import { arrow, autoUpdate, flip, hide, inline, limitShift, offset, shift, size, useFloating } from "@floating-ui/vue";
|
|
2
|
+
import { computed, shallowRef } from "vue";
|
|
3
|
+
import { getArrowPosition } from "./get-arrow-position.js";
|
|
4
|
+
export function usePopover(options) {
|
|
5
|
+
const { opened, strategy, placement } = options;
|
|
6
|
+
const arrowRef = shallowRef(null);
|
|
7
|
+
const targetRef = shallowRef(null);
|
|
8
|
+
const dropdownRef = shallowRef(null);
|
|
9
|
+
const middleware = computed(() => [
|
|
10
|
+
offset(options.offset),
|
|
11
|
+
hide(),
|
|
12
|
+
shift({ limiter: limitShift(), padding: 5 }),
|
|
13
|
+
inline(),
|
|
14
|
+
flip(),
|
|
15
|
+
size(({ elements }) => ({
|
|
16
|
+
padding: 4,
|
|
17
|
+
apply({ rects, availableWidth, availableHeight }) {
|
|
18
|
+
const floating = elements.floating;
|
|
19
|
+
const styles = floating.style ?? {};
|
|
20
|
+
floating.style.maxWidth = `${Math.max(0, availableWidth)}px`;
|
|
21
|
+
floating.style.maxHeight = availableHeight >= floating.scrollHeight ? "" : `${Math.max(0, availableHeight)}px`;
|
|
22
|
+
if (options.width === "target")
|
|
23
|
+
Object.assign(styles, { width: `${rects.reference.width}px` });
|
|
24
|
+
}
|
|
25
|
+
})),
|
|
26
|
+
arrow({ element: arrowRef.value, padding: options.arrowOffset })
|
|
27
|
+
]);
|
|
28
|
+
const { middlewareData, floatingStyles } = useFloating(targetRef, dropdownRef, {
|
|
29
|
+
strategy,
|
|
30
|
+
placement,
|
|
31
|
+
middleware,
|
|
32
|
+
whileElementsMounted: autoUpdate,
|
|
33
|
+
open: opened
|
|
34
|
+
});
|
|
35
|
+
const arrowStyles = computed(() => getArrowPosition({
|
|
36
|
+
...options,
|
|
37
|
+
arrowX: middlewareData.value.arrow?.x,
|
|
38
|
+
arrowY: middlewareData.value.arrow?.y
|
|
39
|
+
}));
|
|
40
|
+
return {
|
|
41
|
+
arrowStyles,
|
|
42
|
+
floatingStyles,
|
|
43
|
+
arrowRef,
|
|
44
|
+
targetRef,
|
|
45
|
+
dropdownRef
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { getRadius, getShadow } from "@nui/utils";
|
|
3
|
+
import { computed } from "vue";
|
|
4
|
+
import { usePopoverState } from "./lib/context";
|
|
5
|
+
const {
|
|
6
|
+
id,
|
|
7
|
+
onToggle,
|
|
8
|
+
store: { floatingStyles, arrowStyles, arrowRef, dropdownRef },
|
|
9
|
+
withArrow,
|
|
10
|
+
radius,
|
|
11
|
+
shadow
|
|
12
|
+
} = usePopoverState();
|
|
13
|
+
const style = computed(() => ({
|
|
14
|
+
"--popover-radius": radius ? getRadius(radius) : void 0,
|
|
15
|
+
"--popover-shadow": getShadow(shadow)
|
|
16
|
+
}));
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<div
|
|
21
|
+
:id='id'
|
|
22
|
+
ref='dropdownRef'
|
|
23
|
+
popover
|
|
24
|
+
:style='{ ...floatingStyles, ...style }'
|
|
25
|
+
:class='$style.dropdown'
|
|
26
|
+
@toggle='onToggle'
|
|
27
|
+
>
|
|
28
|
+
<slot />
|
|
29
|
+
<span
|
|
30
|
+
v-if='withArrow'
|
|
31
|
+
ref='arrowRef'
|
|
32
|
+
:class='$style.arrow'
|
|
33
|
+
:style='arrowStyles'
|
|
34
|
+
/>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<style module lang="postcss">
|
|
39
|
+
.dropdown {
|
|
40
|
+
--popover-radius: var(--radius-default);
|
|
41
|
+
--popover-shadow: none;
|
|
42
|
+
|
|
43
|
+
overflow: visible;
|
|
44
|
+
|
|
45
|
+
padding: var(--spacing-xs) var(--spacing-sm);
|
|
46
|
+
border: 1px solid var(--popover-border-color);
|
|
47
|
+
border-radius: var(--popover-radius);
|
|
48
|
+
|
|
49
|
+
opacity: 0;
|
|
50
|
+
box-shadow: var(--popover-shadow);
|
|
51
|
+
|
|
52
|
+
transition: opacity 0.2s, overlay 0.2s allow-discrete, display 0.2s allow-discrete;
|
|
53
|
+
|
|
54
|
+
&:popover-open {
|
|
55
|
+
opacity: 1;
|
|
56
|
+
|
|
57
|
+
@starting-style {
|
|
58
|
+
opacity: 0;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@mixin where-light {
|
|
63
|
+
--popover-border-color: var(--color-gray-2);
|
|
64
|
+
|
|
65
|
+
background-color: var(--color-white);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@mixin where-dark {
|
|
69
|
+
--popover-border-color: var(--color-dark-4);
|
|
70
|
+
|
|
71
|
+
background-color: var(--color-dark-6);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.arrow {
|
|
76
|
+
--arrow-size: 7px;
|
|
77
|
+
--arrow-radius: 0px;
|
|
78
|
+
--arrow-placement: calc(var(--arrow-size) / 2 * -1);
|
|
79
|
+
|
|
80
|
+
position: absolute;
|
|
81
|
+
transform: rotate(45deg);
|
|
82
|
+
|
|
83
|
+
width: var(--arrow-size);
|
|
84
|
+
height: var(--arrow-size);
|
|
85
|
+
|
|
86
|
+
border: 1px solid var(--popover-border-color);
|
|
87
|
+
|
|
88
|
+
background-color: inherit;
|
|
89
|
+
}
|
|
90
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_7: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_7) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import Renderless from "../renderless/renderless.vue";
|
|
3
|
+
import { usePopoverState } from "./lib/context";
|
|
4
|
+
const { id, store: { targetRef }, disabled } = usePopoverState();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<Renderless ref='targetRef' :disabled :popovertarget='id'>
|
|
9
|
+
<slot />
|
|
10
|
+
</Renderless>
|
|
11
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_7: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_7) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { PopoverModel, PopoverProps } from './types/index.js';
|
|
2
|
+
type __VLS_Props = PopoverProps;
|
|
3
|
+
type __VLS_ModelProps = {
|
|
4
|
+
'open'?: PopoverModel['open'];
|
|
5
|
+
};
|
|
6
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
7
|
+
declare var __VLS_1: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
default?: (props: typeof __VLS_1) => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
close: () => any;
|
|
13
|
+
open: () => any;
|
|
14
|
+
"update:open": (value: boolean) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
16
|
+
onClose?: (() => any) | undefined;
|
|
17
|
+
onOpen?: (() => any) | undefined;
|
|
18
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { unrefElement } from "@vueuse/core";
|
|
3
|
+
import { onBeforeMount, onMounted, useId, watch } from "vue";
|
|
4
|
+
import { useProvidePopoverState } from "./lib/context";
|
|
5
|
+
import { usePopover } from "./lib/use-popover";
|
|
6
|
+
defineOptions({ inheritAttrs: false });
|
|
7
|
+
const {
|
|
8
|
+
placement = "bottom",
|
|
9
|
+
offset = 8,
|
|
10
|
+
arrowSize,
|
|
11
|
+
arrowRadius,
|
|
12
|
+
arrowOffset = 5,
|
|
13
|
+
arrowPosition = "center",
|
|
14
|
+
width = "max-content",
|
|
15
|
+
disabled,
|
|
16
|
+
floatingStrategy = "fixed",
|
|
17
|
+
radius,
|
|
18
|
+
shadow,
|
|
19
|
+
withArrow = false
|
|
20
|
+
} = defineProps({
|
|
21
|
+
placement: { type: null, required: false },
|
|
22
|
+
offset: { type: [Number, Object, Function], required: false },
|
|
23
|
+
keepMounted: { type: Boolean, required: false },
|
|
24
|
+
width: { type: null, required: false },
|
|
25
|
+
withArrow: { type: Boolean, required: false },
|
|
26
|
+
arrowSize: { type: Number, required: false },
|
|
27
|
+
arrowOffset: { type: Number, required: false },
|
|
28
|
+
arrowRadius: { type: Number, required: false },
|
|
29
|
+
arrowPosition: { type: String, required: false },
|
|
30
|
+
radius: { type: [String, Number], required: false },
|
|
31
|
+
shadow: { type: String, required: false },
|
|
32
|
+
disabled: { type: Boolean, required: false },
|
|
33
|
+
floatingStrategy: { type: String, required: false }
|
|
34
|
+
});
|
|
35
|
+
const emit = defineEmits(["open", "close"]);
|
|
36
|
+
const uid = useId();
|
|
37
|
+
const opened = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
38
|
+
const store = usePopover({
|
|
39
|
+
placement,
|
|
40
|
+
strategy: floatingStrategy,
|
|
41
|
+
opened,
|
|
42
|
+
arrowOffset,
|
|
43
|
+
arrowPosition,
|
|
44
|
+
arrowRadius,
|
|
45
|
+
arrowSize,
|
|
46
|
+
offset: typeof offset === "number" ? offset + (withArrow ? (arrowSize ?? 7) / 2 : 0) : offset,
|
|
47
|
+
width,
|
|
48
|
+
withArrow
|
|
49
|
+
});
|
|
50
|
+
function sync(value, emitting = true) {
|
|
51
|
+
if (value) {
|
|
52
|
+
unrefElement(store.dropdownRef)?.showPopover();
|
|
53
|
+
emitting && emit("open");
|
|
54
|
+
} else {
|
|
55
|
+
unrefElement(store.dropdownRef)?.hidePopover();
|
|
56
|
+
emitting && emit("close");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
watch(opened, (isOpen) => sync(isOpen), { flush: "post" });
|
|
60
|
+
onMounted(() => {
|
|
61
|
+
if (!opened.value)
|
|
62
|
+
return;
|
|
63
|
+
sync(opened.value, false);
|
|
64
|
+
});
|
|
65
|
+
onBeforeMount(() => sync(false));
|
|
66
|
+
useProvidePopoverState({
|
|
67
|
+
id: uid,
|
|
68
|
+
disabled,
|
|
69
|
+
onToggle: (e) => opened.value = e.newState === "open",
|
|
70
|
+
store,
|
|
71
|
+
withArrow,
|
|
72
|
+
shadow,
|
|
73
|
+
radius
|
|
74
|
+
});
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<template>
|
|
78
|
+
<slot />
|
|
79
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { PopoverModel, PopoverProps } from './types/index.js';
|
|
2
|
+
type __VLS_Props = PopoverProps;
|
|
3
|
+
type __VLS_ModelProps = {
|
|
4
|
+
'open'?: PopoverModel['open'];
|
|
5
|
+
};
|
|
6
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
7
|
+
declare var __VLS_1: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
default?: (props: typeof __VLS_1) => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
close: () => any;
|
|
13
|
+
open: () => any;
|
|
14
|
+
"update:open": (value: boolean) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
16
|
+
onClose?: (() => any) | undefined;
|
|
17
|
+
onOpen?: (() => any) | undefined;
|
|
18
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { AlignedPlacement, OffsetOptions, Side, Strategy } from '@floating-ui/vue';
|
|
2
|
+
import type { CSSProperties } from 'vue';
|
|
3
|
+
import type { UiKitRadius, UiKitShadow } from '~/src/runtime/types/theme';
|
|
4
|
+
export type ArrowPosition = 'center' | 'side';
|
|
5
|
+
export type PopoverWidth = 'target' | CSSProperties['width'] | null;
|
|
6
|
+
export interface PopoverProps {
|
|
7
|
+
/** Dropdown position relative to the target element @default `'bottom'` */
|
|
8
|
+
placement?: Side | AlignedPlacement;
|
|
9
|
+
/** Offset of the dropdown element @default `8` */
|
|
10
|
+
offset?: OffsetOptions;
|
|
11
|
+
/** If set, the dropdown is not unmounted from the DOM when hidden. `display: none` styles are added instead. */
|
|
12
|
+
keepMounted?: boolean;
|
|
13
|
+
/** Dropdown width, or `'target'` to make dropdown width the same as target element @default `'max-content'` */
|
|
14
|
+
width?: PopoverWidth;
|
|
15
|
+
/** Determines whether component should have an arrow @default `false` */
|
|
16
|
+
withArrow?: boolean;
|
|
17
|
+
/** Arrow size in px @default `7` */
|
|
18
|
+
arrowSize?: number;
|
|
19
|
+
/** Arrow offset in px @default `5` */
|
|
20
|
+
arrowOffset?: number;
|
|
21
|
+
/** Arrow `border-radius` in px @default `0` */
|
|
22
|
+
arrowRadius?: number;
|
|
23
|
+
/** Arrow position */
|
|
24
|
+
arrowPosition?: ArrowPosition;
|
|
25
|
+
/** Key of `theme.radius` or any valid CSS value to set border-radius @default `theme.defaultRadius` */
|
|
26
|
+
radius?: UiKitRadius;
|
|
27
|
+
/** Key of `theme.shadows` or any other valid CSS `box-shadow` value */
|
|
28
|
+
shadow?: UiKitShadow;
|
|
29
|
+
/** If set, popover dropdown will not be rendered */
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/** Changes floating ui [position strategy](https://floating-ui.com/docs/usefloating#strategy) @default `'absolute'` */
|
|
32
|
+
floatingStrategy?: Strategy;
|
|
33
|
+
}
|
|
34
|
+
export interface PopoverModel {
|
|
35
|
+
open: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface PopoverEmits {
|
|
38
|
+
/** Event handler called when the popover open */
|
|
39
|
+
open: [];
|
|
40
|
+
/** Event handler called when the popover closed */
|
|
41
|
+
close: [];
|
|
42
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
export declare const Slot: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}> | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}>[] | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { cloneVNode, Comment, defineComponent, Fragment, mergeProps } from "vue";
|
|
2
|
+
function renderSlotFragments(children) {
|
|
3
|
+
if (!children)
|
|
4
|
+
return [];
|
|
5
|
+
return children.flatMap((child) => {
|
|
6
|
+
if (child.type === Fragment)
|
|
7
|
+
return renderSlotFragments(child.children);
|
|
8
|
+
return [child];
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const Slot = defineComponent({
|
|
12
|
+
name: "PrimitiveSlot",
|
|
13
|
+
inheritAttrs: false,
|
|
14
|
+
setup(_, { attrs, slots }) {
|
|
15
|
+
return () => {
|
|
16
|
+
if (!slots.default)
|
|
17
|
+
return null;
|
|
18
|
+
const children = renderSlotFragments(slots.default());
|
|
19
|
+
const firstNonCommentChildrenIndex = children.findIndex((child) => child.type !== Comment);
|
|
20
|
+
if (firstNonCommentChildrenIndex === -1)
|
|
21
|
+
return children;
|
|
22
|
+
const firstNonCommentChildren = children[firstNonCommentChildrenIndex];
|
|
23
|
+
delete firstNonCommentChildren.props?.ref;
|
|
24
|
+
const mergedProps = firstNonCommentChildren.props ? mergeProps(attrs, firstNonCommentChildren.props) : attrs;
|
|
25
|
+
const cloned = cloneVNode({ ...firstNonCommentChildren, props: {} }, mergedProps);
|
|
26
|
+
if (children.length === 1)
|
|
27
|
+
return cloned;
|
|
28
|
+
children[firstNonCommentChildrenIndex] = cloned;
|
|
29
|
+
return children;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_7: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_7) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_7: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_7) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './select.vue';
|
|
File without changes
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ComboboxData, ComboboxItem, ComboboxItemExt, ComboboxTargetProps } from '../combobox/index.js';
|
|
2
|
+
import type { InputProps } from '../input/index.js';
|
|
3
|
+
export interface SelectProps<Value extends string = string, Ext extends ComboboxItemExt = object> extends /* @vue-ignore */ Omit<InputProps, 'modelValue' | 'multiline' | 'resize' | 'is' | 'id'>, Pick<ComboboxTargetProps, 'autoComplete'> {
|
|
4
|
+
data: ComboboxData<Value, Ext>;
|
|
5
|
+
/** Determines whether the select should be searchable @default `false` */
|
|
6
|
+
searchable?: boolean;
|
|
7
|
+
/** If set, the check icon is displayed near the selected option label @default `true` */
|
|
8
|
+
withCheckIcon?: boolean;
|
|
9
|
+
/** Position of the check icon relative to the option label @default `'left'` */
|
|
10
|
+
iconPosition?: 'left' | 'right';
|
|
11
|
+
/** Message displayed when no option matches the current search query when the `searchable` prop is set or there is no data */
|
|
12
|
+
nothingFoundMessage?: string;
|
|
13
|
+
/** If set, it becomes possible to deselect value by clicking on the selected option @default `true` */
|
|
14
|
+
allowDeselect?: boolean;
|
|
15
|
+
/** If set, the clear button is displayed in the right section when the component has value @default `false` */
|
|
16
|
+
limit?: number;
|
|
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<(SelectProps<Value, Ext> & {
|
|
20
|
+
open?: boolean;
|
|
21
|
+
modelValue?: ComboboxItem<Value, Ext> | null;
|
|
22
|
+
search?: string;
|
|
23
|
+
}) & __VLS_EmitsToProps<__VLS_NormalizeEmits<((evt: "select", args_0: number) => void) & ((evt: "clear") => void) & ((evt: "close", args_0: import("../combobox/index.js").ComboboxDropdownEventSource) => void) & ((evt: "submit", args_0: string, args_1: ComboboxItem) => void) & ((evt: "open", args_0: import("../combobox/index.js").ComboboxDropdownEventSource) => void) & ((evt: "update:modelValue", value: ComboboxItem<Value, Ext> | null) => void) & ((evt: "update:search", value: string) => void) & ((evt: "update:open", value: boolean) => void)>>> & import("vue").PublicProps;
|
|
24
|
+
expose: (exposed: {}) => void;
|
|
25
|
+
attrs: any;
|
|
26
|
+
slots: {
|
|
27
|
+
label?: (props: {}) => any;
|
|
28
|
+
} & {
|
|
29
|
+
description?: (props: {}) => any;
|
|
30
|
+
} & {
|
|
31
|
+
error?: (props: {}) => any;
|
|
32
|
+
} & {
|
|
33
|
+
leftSection?: (props: {}) => any;
|
|
34
|
+
} & {
|
|
35
|
+
rightSection?: (props: {}) => any;
|
|
36
|
+
};
|
|
37
|
+
emit: (((evt: "select", args_0: number) => void) & ((evt: "clear") => void) & ((evt: "close", args_0: import("../combobox/index.js").ComboboxDropdownEventSource) => void) & ((evt: "submit", args_0: string, args_1: ComboboxItem) => void) & ((evt: "open", args_0: import("../combobox/index.js").ComboboxDropdownEventSource) => void)) & (((evt: "update:modelValue", value: ComboboxItem<Value, Ext> | null) => void) & ((evt: "update:search", value: string) => void) & ((evt: "update:open", value: boolean) => void));
|
|
38
|
+
}>) => import("vue").VNode & {
|
|
39
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
40
|
+
};
|
|
41
|
+
declare const _default: typeof __VLS_export;
|
|
42
|
+
export default _default;
|
|
43
|
+
type __VLS_PrettifyLocal<T> = {
|
|
44
|
+
[K in keyof T as K]: T[K];
|
|
45
|
+
} & {};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { nextTick, useId, watch } from "vue";
|
|
3
|
+
import Button from "../button/button.vue";
|
|
4
|
+
import { useCombobox, useComboboxData } from "../combobox";
|
|
5
|
+
import ComboboxOptionsDropdown from "../combobox/combobox-options-dropdown.vue";
|
|
6
|
+
import ComboboxRoot from "../combobox/combobox-root.vue";
|
|
7
|
+
import ComboboxTarget from "../combobox/combobox-target.vue";
|
|
8
|
+
import Input from "../input/input.vue";
|
|
9
|
+
const {
|
|
10
|
+
data,
|
|
11
|
+
disabled,
|
|
12
|
+
searchable = false,
|
|
13
|
+
rightSectionPE = "none",
|
|
14
|
+
readonly = false,
|
|
15
|
+
allowDeselect = false,
|
|
16
|
+
autoComplete = "off",
|
|
17
|
+
limit,
|
|
18
|
+
iconPosition,
|
|
19
|
+
nothingFoundMessage,
|
|
20
|
+
withCheckIcon,
|
|
21
|
+
...rest
|
|
22
|
+
} = defineProps({
|
|
23
|
+
data: { type: Array, required: true },
|
|
24
|
+
searchable: { type: Boolean, required: false },
|
|
25
|
+
withCheckIcon: { type: Boolean, required: false },
|
|
26
|
+
iconPosition: { type: String, required: false },
|
|
27
|
+
nothingFoundMessage: { type: String, required: false },
|
|
28
|
+
allowDeselect: { type: Boolean, required: false },
|
|
29
|
+
limit: { type: Number, required: false },
|
|
30
|
+
autoComplete: { type: String, required: false }
|
|
31
|
+
});
|
|
32
|
+
const emit = defineEmits(["clear", "select", "open", "close", "submit"]);
|
|
33
|
+
const opened = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
34
|
+
const value = defineModel({ type: [Object, null], ...{ default: null } });
|
|
35
|
+
const { parsed, options } = useComboboxData(data);
|
|
36
|
+
const id = useId();
|
|
37
|
+
const store = useCombobox({
|
|
38
|
+
listId: id,
|
|
39
|
+
opened,
|
|
40
|
+
loop: true,
|
|
41
|
+
scrollBehavior: "instant",
|
|
42
|
+
onSelect: (ix) => emit("select", ix),
|
|
43
|
+
onClear: () => emit("clear"),
|
|
44
|
+
onOpenDropdown: (source) => {
|
|
45
|
+
emit("open", source);
|
|
46
|
+
store.updateSelectedOptionIx("active", { scrollIntoView: true });
|
|
47
|
+
},
|
|
48
|
+
onCloseDropdown: (source) => {
|
|
49
|
+
emit("close", source);
|
|
50
|
+
nextTick(() => store.resetSelectedOption());
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
const search = defineModel("search", { type: String, ...{ default: "" } });
|
|
54
|
+
watch(search, () => nextTick(() => store.resetSelectedOption()));
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<template>
|
|
58
|
+
<ComboboxRoot
|
|
59
|
+
v-model:open='opened'
|
|
60
|
+
width='target'
|
|
61
|
+
:store
|
|
62
|
+
@submit='(val, option) => {
|
|
63
|
+
$emit("submit", val, option);
|
|
64
|
+
const optionsLockup = allowDeselect ? options[val]?.value === value?.value ? null : options[val] : options[val];
|
|
65
|
+
const nextValue = optionsLockup ? optionsLockup : null;
|
|
66
|
+
value = nextValue;
|
|
67
|
+
search = nextValue?.label ?? "";
|
|
68
|
+
store.closeDropdown();
|
|
69
|
+
}'
|
|
70
|
+
>
|
|
71
|
+
<ComboboxTarget :target-type='searchable ? "input" : "button"' :auto-complete>
|
|
72
|
+
<component
|
|
73
|
+
:is='searchable ? Input : Button'
|
|
74
|
+
:id
|
|
75
|
+
v-bind='{ ...rest, ...$attrs }'
|
|
76
|
+
v-model='search'
|
|
77
|
+
:disabled
|
|
78
|
+
:right-section-p-e
|
|
79
|
+
:readonly='readonly || !searchable'
|
|
80
|
+
:class='$style.input'
|
|
81
|
+
@focus='() => searchable && store.openDropdown()'
|
|
82
|
+
@blur='() => {
|
|
83
|
+
searchable && store.closeDropdown();
|
|
84
|
+
search = value?.label ?? "";
|
|
85
|
+
}'
|
|
86
|
+
@click.prevent.stop='() => searchable ? store.openDropdown() : store.toggleDropdown()'
|
|
87
|
+
>
|
|
88
|
+
{{ value?.value ?? null }}
|
|
89
|
+
|
|
90
|
+
<template v-if='$slots?.label' #label>
|
|
91
|
+
<slot name='label' />
|
|
92
|
+
</template>
|
|
93
|
+
<template v-if='$slots?.description' #description>
|
|
94
|
+
<slot name='description' />
|
|
95
|
+
</template>
|
|
96
|
+
<template v-if='$slots?.error' #error>
|
|
97
|
+
<slot name='error' />
|
|
98
|
+
</template>
|
|
99
|
+
|
|
100
|
+
<template v-if='$slots.leftSection || value?.icon' #leftSection>
|
|
101
|
+
<slot name='leftSection'>
|
|
102
|
+
<Icon v-if='value?.icon' :name='value?.icon' />
|
|
103
|
+
</slot>
|
|
104
|
+
</template>
|
|
105
|
+
<template #rightSection>
|
|
106
|
+
<slot name='rightSection'>
|
|
107
|
+
<Icon name='gravity-ui:chevrons-expand-vertical' />
|
|
108
|
+
</slot>
|
|
109
|
+
</template>
|
|
110
|
+
</component>
|
|
111
|
+
</ComboboxTarget>
|
|
112
|
+
<ComboboxOptionsDropdown
|
|
113
|
+
v-model='value'
|
|
114
|
+
:data='parsed'
|
|
115
|
+
:limit
|
|
116
|
+
:with-check-icon
|
|
117
|
+
:icon-position
|
|
118
|
+
:nothing-found-message
|
|
119
|
+
:aria-label='id'
|
|
120
|
+
:label-id='id'
|
|
121
|
+
/>
|
|
122
|
+
</ComboboxRoot>
|
|
123
|
+
</template>
|
|
124
|
+
|
|
125
|
+
<style module lang="postcss">
|
|
126
|
+
.input {
|
|
127
|
+
:where([readonly]) {
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
</style>
|