vueless 1.1.1-beta.8 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/adapter.locale/locales/en.ts +11 -11
- package/adapter.locale/vue-i18n.ts +2 -3
- package/adapter.locale/vueless.ts +3 -3
- package/bin/commands/init.js +90 -59
- package/bin/constants.d.ts +3 -0
- package/bin/constants.js +0 -14
- package/composables/tests/useUI.test.ts +3 -3
- package/composables/useAutoPosition.ts +1 -1
- package/composables/useBreakpoint.ts +1 -1
- package/composables/useComponentLocaleMassages.ts +3 -3
- package/composables/useDarkMode.ts +2 -2
- package/composables/useLocale.ts +2 -2
- package/composables/useMutationObserver.ts +1 -1
- package/composables/useUI.ts +5 -5
- package/constants.d.ts +334 -0
- package/constants.js +23 -1
- package/icons/storybook/contact_mail.svg +1 -0
- package/icons/storybook/vpn_key.svg +1 -0
- package/icons/storybook/web_traffic.svg +1 -0
- package/index.d.ts +153 -18
- package/index.ts +158 -20
- package/modules.d.ts +33 -0
- package/package.json +33 -10
- package/plugin-vite.d.ts +1 -28
- package/plugin-vite.js +33 -28
- package/tailwind.css +30 -0
- package/types.ts +66 -74
- package/ui.boilerplate/UBoilerplate.vue +5 -5
- package/ui.boilerplate/storybook/{docs.hidden.mdx → docs.mdx} +3 -3
- package/ui.boilerplate/storybook/{stories.hidden.ts → stories.ts} +2 -2
- package/ui.boilerplate/tests/UBoilerplate.test.ts +1 -1
- package/ui.boilerplate/types.ts +2 -2
- package/ui.button/UButton.vue +6 -6
- package/ui.button/storybook/docs.mdx +3 -3
- package/ui.button/storybook/stories.ts +2 -2
- package/ui.button/tests/UButton.test.ts +1 -1
- package/ui.button/types.ts +2 -2
- package/ui.button-link/ULink.vue +6 -6
- package/ui.button-link/storybook/docs.mdx +3 -3
- package/ui.button-link/storybook/stories.ts +3 -3
- package/ui.button-link/tests/ULink.test.ts +1 -1
- package/ui.button-link/types.ts +2 -2
- package/ui.button-toggle/UToggle.vue +5 -5
- package/ui.button-toggle/storybook/docs.mdx +3 -3
- package/ui.button-toggle/storybook/stories.ts +4 -3
- package/ui.button-toggle/tests/UToggle.test.ts +1 -1
- package/ui.button-toggle/types.ts +2 -2
- package/ui.container-accordion/UAccordion.vue +26 -8
- package/ui.container-accordion/config.ts +1 -0
- package/ui.container-accordion/storybook/docs.mdx +3 -3
- package/ui.container-accordion/storybook/stories.ts +30 -3
- package/ui.container-accordion/tests/UAccordion.test.ts +47 -1
- package/ui.container-accordion/types.ts +2 -2
- package/ui.container-card/UCard.vue +6 -6
- package/ui.container-card/storybook/docs.mdx +3 -3
- package/ui.container-card/storybook/stories.ts +2 -2
- package/ui.container-card/tests/UCard.test.ts +1 -1
- package/ui.container-card/types.ts +2 -2
- package/ui.container-col/UCol.vue +5 -5
- package/ui.container-col/storybook/docs.mdx +3 -3
- package/ui.container-col/storybook/stories.ts +2 -2
- package/ui.container-col/tests/UCol.test.ts +1 -1
- package/ui.container-col/types.ts +2 -2
- package/ui.container-divider/UDivider.vue +6 -6
- package/ui.container-divider/storybook/docs.mdx +3 -3
- package/ui.container-divider/storybook/stories.ts +2 -2
- package/ui.container-divider/tests/UDivider.test.ts +1 -1
- package/ui.container-divider/types.ts +2 -2
- package/ui.container-group/UGroup.vue +5 -5
- package/ui.container-group/storybook/docs.mdx +3 -3
- package/ui.container-group/storybook/stories.ts +2 -2
- package/ui.container-group/types.ts +2 -2
- package/ui.container-groups/UGroups.vue +5 -5
- package/ui.container-groups/storybook/docs.mdx +3 -3
- package/ui.container-groups/storybook/stories.ts +2 -2
- package/ui.container-groups/tests/UGroups.test.ts +1 -1
- package/ui.container-groups/types.ts +2 -2
- package/ui.container-modal/UModal.vue +6 -6
- package/ui.container-modal/storybook/docs.mdx +3 -3
- package/ui.container-modal/storybook/stories.ts +3 -3
- package/ui.container-modal/tests/UModal.test.ts +2 -2
- package/ui.container-modal/types.ts +2 -2
- package/ui.container-modal-confirm/UModalConfirm.vue +7 -7
- package/ui.container-modal-confirm/storybook/docs.mdx +3 -3
- package/ui.container-modal-confirm/storybook/stories.ts +3 -3
- package/ui.container-modal-confirm/tests/UModalConfirm.test.ts +1 -1
- package/ui.container-modal-confirm/types.ts +2 -2
- package/ui.container-page/UPage.vue +6 -6
- package/ui.container-page/storybook/docs.mdx +3 -3
- package/ui.container-page/storybook/stories.ts +2 -2
- package/ui.container-page/tests/UPage.test.ts +2 -2
- package/ui.container-page/types.ts +2 -2
- package/ui.container-row/URow.vue +5 -5
- package/ui.container-row/storybook/docs.mdx +3 -3
- package/ui.container-row/storybook/stories.ts +2 -2
- package/ui.container-row/tests/URow.test.ts +1 -1
- package/ui.container-row/types.ts +2 -2
- package/ui.data-list/UDataList.vue +8 -8
- package/ui.data-list/storybook/docs.mdx +3 -3
- package/ui.data-list/storybook/stories.ts +3 -3
- package/ui.data-list/tests/UDataList.test.ts +1 -1
- package/ui.data-list/types.ts +2 -2
- package/ui.data-table/UTable.vue +29 -23
- package/ui.data-table/UTableRow.vue +8 -8
- package/ui.data-table/config.ts +1 -1
- package/ui.data-table/storybook/docs.mdx +3 -3
- package/ui.data-table/storybook/stories.ts +14 -3
- package/ui.data-table/tests/UTable.test.ts +20 -2
- package/ui.data-table/tests/UTableRow.test.ts +1 -1
- package/ui.data-table/types.ts +3 -3
- package/ui.data-table/utilTable.ts +1 -1
- package/ui.dropdown-badge/UDropdownBadge.vue +7 -7
- package/ui.dropdown-badge/storybook/docs.mdx +3 -3
- package/ui.dropdown-badge/storybook/stories.ts +2 -2
- package/ui.dropdown-badge/tests/UDropdownBadge.test.ts +1 -1
- package/ui.dropdown-badge/types.ts +3 -3
- package/ui.dropdown-button/UDropdownButton.vue +8 -7
- package/ui.dropdown-button/config.ts +9 -1
- package/ui.dropdown-button/storybook/docs.mdx +3 -3
- package/ui.dropdown-button/storybook/stories.ts +3 -3
- package/ui.dropdown-button/tests/UDropdownButton.test.ts +17 -1
- package/ui.dropdown-button/types.ts +8 -3
- package/ui.dropdown-link/UDropdownLink.vue +7 -7
- package/ui.dropdown-link/config.ts +1 -1
- package/ui.dropdown-link/storybook/docs.mdx +3 -3
- package/ui.dropdown-link/storybook/stories.ts +2 -2
- package/ui.dropdown-link/tests/UDropdownLink.test.ts +1 -1
- package/ui.dropdown-link/types.ts +3 -3
- package/ui.form-calendar/UCalendar.vue +11 -11
- package/ui.form-calendar/UCalendarDayView.vue +6 -6
- package/ui.form-calendar/UCalendarMonthView.vue +6 -6
- package/ui.form-calendar/UCalendarYearView.vue +6 -6
- package/ui.form-calendar/storybook/docs.mdx +3 -3
- package/ui.form-calendar/storybook/stories.ts +3 -3
- package/ui.form-calendar/tests/UCalendar.test.ts +2 -2
- package/ui.form-calendar/tests/UCalendarDayView.test.ts +2 -2
- package/ui.form-calendar/tests/UCalendarMonthView.test.ts +2 -2
- package/ui.form-calendar/tests/UCalendarYearView.test.ts +2 -2
- package/ui.form-calendar/types.ts +3 -3
- package/ui.form-calendar/utilCalendar.ts +4 -4
- package/ui.form-calendar/utilDate.ts +1 -1
- package/ui.form-calendar/utilFormatting.ts +1 -1
- package/ui.form-checkbox/UCheckbox.vue +6 -6
- package/ui.form-checkbox/storybook/docs.mdx +3 -3
- package/ui.form-checkbox/storybook/stories.ts +2 -2
- package/ui.form-checkbox/tests/UCheckbox.test.ts +1 -1
- package/ui.form-checkbox/types.ts +2 -2
- package/ui.form-checkbox-group/UCheckboxGroup.vue +6 -6
- package/ui.form-checkbox-group/storybook/docs.mdx +3 -3
- package/ui.form-checkbox-group/storybook/stories.ts +2 -2
- package/ui.form-checkbox-group/tests/UCheckboxGroup.test.ts +1 -1
- package/ui.form-checkbox-group/types.ts +3 -3
- package/ui.form-checkbox-multi-state/UCheckboxMultiState.vue +8 -8
- package/ui.form-checkbox-multi-state/storybook/docs.mdx +3 -3
- package/ui.form-checkbox-multi-state/storybook/stories.ts +2 -2
- package/ui.form-checkbox-multi-state/tests/UCheckboxMultiState.test.ts +1 -1
- package/ui.form-checkbox-multi-state/types.ts +3 -3
- package/ui.form-color-picker/UColorPicker.vue +6 -6
- package/ui.form-color-picker/storybook/docs.mdx +3 -3
- package/ui.form-color-picker/storybook/stories.ts +2 -2
- package/ui.form-color-picker/tests/UColorPicker.test.ts +1 -1
- package/ui.form-color-picker/types.ts +2 -2
- package/ui.form-date-picker/UDatePicker.vue +14 -14
- package/ui.form-date-picker/storybook/docs.mdx +3 -3
- package/ui.form-date-picker/storybook/stories.ts +3 -3
- package/ui.form-date-picker/tests/UDatePicker.test.ts +1 -1
- package/ui.form-date-picker/types.ts +2 -2
- package/ui.form-date-picker-range/UDatePickerRange.vue +14 -14
- package/ui.form-date-picker-range/UDatePickerRangeInputs.vue +6 -6
- package/ui.form-date-picker-range/UDatePickerRangePeriodMenu.vue +5 -5
- package/ui.form-date-picker-range/storybook/docs.mdx +3 -3
- package/ui.form-date-picker-range/storybook/stories.ts +4 -4
- package/ui.form-date-picker-range/tests/UDatePickerRange.test.ts +1 -1
- package/ui.form-date-picker-range/types.ts +4 -4
- package/ui.form-date-picker-range/useLocale.ts +6 -6
- package/ui.form-date-picker-range/useUserFormat.ts +5 -5
- package/ui.form-date-picker-range/utilDateRange.ts +2 -2
- package/ui.form-date-picker-range/utilValidation.ts +1 -1
- package/ui.form-input/UInput.vue +7 -7
- package/ui.form-input/config.ts +1 -1
- package/ui.form-input/storybook/docs.mdx +3 -3
- package/ui.form-input/storybook/stories.ts +2 -2
- package/ui.form-input/tests/UInput.test.ts +1 -1
- package/ui.form-input/types.ts +2 -2
- package/ui.form-input-counter/UInputCounter.vue +5 -5
- package/ui.form-input-counter/storybook/docs.mdx +3 -3
- package/ui.form-input-counter/storybook/stories.ts +2 -2
- package/ui.form-input-counter/tests/UInputCounter.test.ts +1 -1
- package/ui.form-input-counter/types.ts +2 -2
- package/ui.form-input-file/UInputFile.vue +8 -8
- package/ui.form-input-file/storybook/docs.mdx +3 -3
- package/ui.form-input-file/storybook/stories.ts +2 -2
- package/ui.form-input-file/tests/UInputFile.test.ts +1 -1
- package/ui.form-input-file/types.ts +2 -2
- package/ui.form-input-number/UInputNumber.vue +7 -7
- package/ui.form-input-number/storybook/docs.mdx +3 -3
- package/ui.form-input-number/storybook/stories.ts +2 -2
- package/ui.form-input-number/tests/UInputNumber.test.ts +1 -1
- package/ui.form-input-number/types.ts +2 -2
- package/ui.form-input-number/useFormatNumber.ts +3 -3
- package/ui.form-input-number/utilFormat.ts +2 -2
- package/ui.form-input-password/UInputPassword.vue +6 -6
- package/ui.form-input-password/storybook/docs.mdx +3 -3
- package/ui.form-input-password/storybook/stories.ts +2 -2
- package/ui.form-input-password/tests/UInputPassword.test.ts +1 -1
- package/ui.form-input-password/types.ts +2 -2
- package/ui.form-input-rating/UInputRating.vue +6 -6
- package/ui.form-input-rating/storybook/docs.mdx +3 -3
- package/ui.form-input-rating/storybook/stories.ts +2 -2
- package/ui.form-input-rating/tests/UInputRating.test.ts +1 -1
- package/ui.form-input-rating/types.ts +2 -2
- package/ui.form-input-search/UInputSearch.vue +6 -6
- package/ui.form-input-search/storybook/docs.mdx +3 -3
- package/ui.form-input-search/storybook/stories.ts +2 -2
- package/ui.form-input-search/tests/UInputSearch.test.ts +1 -1
- package/ui.form-input-search/types.ts +2 -2
- package/ui.form-label/ULabel.vue +6 -6
- package/ui.form-label/storybook/docs.mdx +3 -3
- package/ui.form-label/storybook/stories.ts +2 -2
- package/ui.form-label/tests/ULabel.test.ts +1 -1
- package/ui.form-label/types.ts +2 -2
- package/ui.form-listbox/UListbox.vue +10 -10
- package/ui.form-listbox/storybook/docs.mdx +3 -3
- package/ui.form-listbox/storybook/stories.ts +7 -7
- package/ui.form-listbox/tests/UListbox.test.ts +1 -1
- package/ui.form-listbox/types.ts +2 -2
- package/ui.form-listbox/usePointer.ts +1 -1
- package/ui.form-listbox/utilListbox.ts +1 -1
- package/ui.form-radio/URadio.vue +6 -6
- package/ui.form-radio/storybook/docs.mdx +3 -3
- package/ui.form-radio/storybook/stories.ts +2 -2
- package/ui.form-radio/tests/URadio.test.ts +1 -1
- package/ui.form-radio/types.ts +2 -2
- package/ui.form-radio-group/URadioGroup.vue +5 -5
- package/ui.form-radio-group/storybook/docs.mdx +3 -3
- package/ui.form-radio-group/storybook/stories.ts +2 -2
- package/ui.form-radio-group/tests/URadioGroup.test.ts +6 -2
- package/ui.form-radio-group/types.ts +2 -2
- package/ui.form-select/USelect.vue +13 -12
- package/ui.form-select/config.ts +1 -1
- package/ui.form-select/storybook/docs.mdx +3 -3
- package/ui.form-select/storybook/stories.ts +7 -7
- package/ui.form-select/tests/USelect.test.ts +1 -1
- package/ui.form-select/types.ts +3 -3
- package/ui.form-select/utilSelect.ts +1 -1
- package/ui.form-switch/USwitch.vue +6 -6
- package/ui.form-switch/storybook/docs.mdx +3 -3
- package/ui.form-switch/storybook/stories.ts +2 -2
- package/ui.form-switch/tests/USwitch.test.ts +1 -1
- package/ui.form-switch/types.ts +2 -2
- package/ui.form-textarea/UTextarea.vue +7 -7
- package/ui.form-textarea/storybook/docs.mdx +3 -3
- package/ui.form-textarea/storybook/stories.ts +3 -3
- package/ui.form-textarea/tests/UTextarea.test.ts +1 -1
- package/ui.form-textarea/types.ts +2 -2
- package/ui.image-avatar/UAvatar.vue +5 -5
- package/ui.image-avatar/storybook/docs.mdx +3 -3
- package/ui.image-avatar/storybook/stories.ts +3 -3
- package/ui.image-avatar/tests/UAvatar.test.ts +1 -1
- package/ui.image-avatar/types.ts +2 -2
- package/ui.image-icon/UIcon.vue +6 -6
- package/ui.image-icon/storybook/docs.mdx +3 -3
- package/ui.image-icon/storybook/stories.ts +2 -2
- package/ui.image-icon/tests/UIcon.test.ts +0 -1
- package/ui.image-icon/types.ts +2 -2
- package/ui.loader/ULoader.vue +5 -5
- package/ui.loader/storybook/docs.mdx +3 -3
- package/ui.loader/storybook/stories.ts +2 -2
- package/ui.loader/tests/ULoader.test.ts +1 -1
- package/ui.loader/types.ts +2 -2
- package/ui.loader-overlay/ULoaderOverlay.vue +6 -6
- package/ui.loader-overlay/storybook/docs.mdx +3 -3
- package/ui.loader-overlay/storybook/stories.ts +2 -2
- package/ui.loader-overlay/tests/ULoaderOverlay.test.ts +2 -2
- package/ui.loader-overlay/types.ts +2 -2
- package/ui.loader-progress/ULoaderProgress.vue +7 -7
- package/ui.loader-progress/storybook/docs.mdx +3 -3
- package/ui.loader-progress/storybook/stories.ts +4 -4
- package/ui.loader-progress/tests/ULoaderProgress.test.ts +2 -2
- package/ui.loader-progress/types.ts +2 -2
- package/ui.loader-progress/useLoaderProgress.ts +1 -1
- package/ui.navigation-breadcrumbs/UBreadcrumbs.vue +6 -6
- package/ui.navigation-breadcrumbs/storybook/docs.mdx +3 -3
- package/ui.navigation-breadcrumbs/storybook/stories.ts +13 -2
- package/ui.navigation-breadcrumbs/tests/UBreadcrumbs.test.ts +2 -2
- package/ui.navigation-breadcrumbs/types.ts +3 -3
- package/ui.navigation-pagination/UPagination.vue +7 -12
- package/ui.navigation-pagination/config.ts +1 -0
- package/ui.navigation-pagination/storybook/docs.mdx +3 -3
- package/ui.navigation-pagination/storybook/stories.ts +5 -3
- package/ui.navigation-pagination/tests/UPagination.test.ts +2 -2
- package/ui.navigation-pagination/types.ts +3 -3
- package/ui.navigation-progress/UProgress.vue +5 -5
- package/ui.navigation-progress/UStepperProgress.vue +3 -3
- package/ui.navigation-progress/storybook/docs.mdx +3 -3
- package/ui.navigation-progress/storybook/stories.ts +2 -2
- package/ui.navigation-progress/tests/UProgress.test.ts +1 -1
- package/ui.navigation-progress/types.ts +2 -2
- package/ui.navigation-tab/UTab.vue +6 -6
- package/ui.navigation-tab/storybook/docs.mdx +3 -3
- package/ui.navigation-tab/storybook/stories.ts +2 -2
- package/ui.navigation-tab/types.ts +2 -2
- package/ui.navigation-tabs/UTabs.vue +5 -5
- package/ui.navigation-tabs/storybook/docs.mdx +3 -3
- package/ui.navigation-tabs/storybook/stories.ts +2 -2
- package/ui.navigation-tabs/tests/UTabs.test.ts +1 -1
- package/ui.navigation-tabs/types.ts +2 -2
- package/ui.other-chip/UChip.vue +5 -5
- package/ui.other-chip/storybook/docs.mdx +3 -3
- package/ui.other-chip/storybook/stories.ts +13 -2
- package/ui.other-chip/tests/UChip.test.ts +1 -1
- package/ui.other-chip/types.ts +2 -2
- package/ui.other-dot/UDot.vue +5 -5
- package/ui.other-dot/storybook/docs.mdx +3 -3
- package/ui.other-dot/storybook/stories.ts +2 -2
- package/ui.other-dot/tests/UDot.test.ts +1 -1
- package/ui.other-dot/types.ts +2 -2
- package/ui.other-theme-color-toggle/UThemeColorToggle.vue +6 -6
- package/ui.other-theme-color-toggle/storybook/docs.mdx +3 -3
- package/ui.other-theme-color-toggle/storybook/stories.ts +2 -2
- package/ui.other-theme-color-toggle/tests/UThemeColorToggle.test.ts +1 -1
- package/ui.other-theme-color-toggle/types.ts +2 -2
- package/ui.skeleton/USkeleton.vue +5 -5
- package/ui.skeleton/storybook/docs.mdx +3 -3
- package/ui.skeleton/storybook/stories.ts +7 -2
- package/ui.skeleton/tests/USkeleton.test.ts +1 -1
- package/ui.skeleton/types.ts +2 -2
- package/ui.skeleton-choice/USkeletonChoice.vue +5 -5
- package/ui.skeleton-choice/storybook/docs.mdx +3 -3
- package/ui.skeleton-choice/storybook/stories.ts +7 -2
- package/ui.skeleton-choice/tests/USkeletonChoice.test.ts +1 -1
- package/ui.skeleton-choice/types.ts +2 -2
- package/ui.skeleton-input/USkeletonInput.vue +5 -5
- package/ui.skeleton-input/storybook/docs.mdx +3 -3
- package/ui.skeleton-input/storybook/stories.ts +13 -2
- package/ui.skeleton-input/tests/USkeletonInput.test.ts +1 -1
- package/ui.skeleton-input/types.ts +2 -2
- package/ui.skeleton-text/USkeletonText.vue +5 -5
- package/ui.skeleton-text/storybook/docs.mdx +3 -3
- package/ui.skeleton-text/storybook/stories.ts +7 -2
- package/ui.skeleton-text/tests/USkeletonText.test.ts +1 -1
- package/ui.skeleton-text/types.ts +2 -2
- package/ui.text-alert/UAlert.vue +6 -6
- package/ui.text-alert/storybook/docs.mdx +3 -3
- package/ui.text-alert/storybook/stories.ts +2 -2
- package/ui.text-alert/tests/UAlert.test.ts +1 -1
- package/ui.text-alert/types.ts +2 -2
- package/ui.text-badge/UBadge.vue +6 -6
- package/ui.text-badge/storybook/docs.mdx +3 -3
- package/ui.text-badge/storybook/stories.ts +2 -2
- package/ui.text-badge/tests/UBadge.test.ts +1 -1
- package/ui.text-badge/types.ts +2 -2
- package/ui.text-block/UText.vue +5 -5
- package/ui.text-block/storybook/docs.mdx +3 -3
- package/ui.text-block/storybook/stories.ts +2 -2
- package/ui.text-block/tests/UText.test.ts +1 -1
- package/ui.text-block/types.ts +2 -2
- package/ui.text-empty/UEmpty.vue +5 -5
- package/ui.text-empty/storybook/docs.mdx +3 -3
- package/ui.text-empty/storybook/stories.ts +2 -2
- package/ui.text-empty/tests/UEmpty.test.ts +1 -1
- package/ui.text-empty/types.ts +2 -2
- package/ui.text-file/UFile.vue +5 -5
- package/ui.text-file/storybook/docs.mdx +3 -3
- package/ui.text-file/storybook/stories.ts +2 -2
- package/ui.text-file/tests/UFile.test.ts +1 -1
- package/ui.text-file/types.ts +2 -2
- package/ui.text-files/UFiles.vue +6 -6
- package/ui.text-files/storybook/docs.mdx +3 -3
- package/ui.text-files/storybook/stories.ts +2 -2
- package/ui.text-files/tests/UFiles.test.ts +1 -1
- package/ui.text-files/types.ts +2 -2
- package/ui.text-header/UHeader.vue +5 -5
- package/ui.text-header/storybook/docs.mdx +3 -3
- package/ui.text-header/storybook/stories.ts +2 -2
- package/ui.text-header/tests/UHeader.test.ts +1 -1
- package/ui.text-header/types.ts +2 -2
- package/ui.text-notify/UNotify.vue +6 -6
- package/ui.text-notify/storybook/docs.mdx +3 -3
- package/ui.text-notify/storybook/stories.ts +3 -3
- package/ui.text-notify/tests/UNotify.test.ts +4 -4
- package/ui.text-notify/types.ts +3 -3
- package/ui.text-notify/utilNotify.ts +3 -3
- package/ui.text-number/UNumber.vue +6 -6
- package/ui.text-number/storybook/docs.mdx +3 -3
- package/ui.text-number/storybook/stories.ts +13 -2
- package/ui.text-number/tests/UNumber.test.ts +2 -2
- package/ui.text-number/types.ts +2 -2
- package/utils/helper.ts +1 -1
- package/utils/node/dynamicProps.d.ts +2 -0
- package/utils/node/dynamicProps.js +17 -8
- package/utils/node/helper.d.ts +15 -0
- package/utils/node/helper.js +73 -27
- package/utils/node/loaderIcon.d.ts +7 -0
- package/utils/node/loaderIcon.js +12 -8
- package/utils/node/loaderSvg.d.ts +1 -0
- package/utils/node/mergeConfigs.d.ts +13 -0
- package/utils/node/storybook.d.ts +2 -0
- package/utils/node/storybook.js +93 -0
- package/utils/node/tailwindSafelist.d.ts +6 -0
- package/utils/node/vuelessConfig.d.ts +9 -0
- package/utils/node/vuelessConfig.js +30 -11
- package/utils/node/vuelessResolver.d.ts +13 -0
- package/utils/node/vuelessResolver.js +30 -14
- package/utils/node/webTypes.d.ts +1 -0
- package/utils/node/webTypes.js +4 -2
- package/utils/platform.ts +1 -1
- package/utils/storybook.ts +2 -2
- package/utils/theme.ts +20 -18
- package/utils/ui.ts +33 -8
- package/{directives/clickOutside → v.click-outside}/storybook/docs.mdx +2 -2
- package/{directives/clickOutside → v.click-outside}/storybook/stories.ts +5 -5
- package/{directives/clickOutside → v.click-outside}/vClickOutside.ts +1 -1
- package/v.tooltip/storybook/docs.mdx +47 -0
- package/{directives/tooltip → v.tooltip}/storybook/stories.ts +14 -11
- package/{directives/tooltip → v.tooltip}/vTooltip.ts +4 -9
- package/directives/index.js +0 -7
- package/directives/tooltip/storybook/docs.mdx +0 -10
- package/utils/node/dynamicStories.js +0 -62
- package/utils/tailwindConfig.ts +0 -36
- /package/{directives/clickOutside → v.click-outside}/types.ts +0 -0
- /package/{directives/tooltip → v.tooltip}/types.ts +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, useTemplateRef } from "vue";
|
|
3
3
|
|
|
4
|
-
import useUI from "../composables/useUI
|
|
5
|
-
import { getDefaults } from "../utils/ui
|
|
4
|
+
import useUI from "../composables/useUI";
|
|
5
|
+
import { getDefaults } from "../utils/ui";
|
|
6
6
|
|
|
7
|
-
import { COMPONENT_NAME } from "./constants
|
|
8
|
-
import defaultConfig from "./config
|
|
9
|
-
import { separatedNumber, MATH_SIGN_TYPE, MATH_SIGN } from "./utilNumber
|
|
7
|
+
import { COMPONENT_NAME } from "./constants";
|
|
8
|
+
import defaultConfig from "./config";
|
|
9
|
+
import { separatedNumber, MATH_SIGN_TYPE, MATH_SIGN } from "./utilNumber";
|
|
10
10
|
|
|
11
|
-
import type { Props, Config } from "./types
|
|
11
|
+
import type { Props, Config } from "./types";
|
|
12
12
|
|
|
13
13
|
defineOptions({ inheritAttrs: false });
|
|
14
14
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/addon-docs/blocks";
|
|
2
|
-
import { getSource } from "../../utils/storybook
|
|
2
|
+
import { getSource } from "../../utils/storybook";
|
|
3
3
|
|
|
4
|
-
import * as stories from "./stories
|
|
5
|
-
import defaultConfig from "../config
|
|
4
|
+
import * as stories from "./stories";
|
|
5
|
+
import defaultConfig from "../config?raw"
|
|
6
6
|
|
|
7
7
|
<Meta of={stories} />
|
|
8
8
|
<Title of={stories} />
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
getArgs,
|
|
3
|
+
getArgTypes,
|
|
4
|
+
getSlotNames,
|
|
5
|
+
getSlotsFragment,
|
|
6
|
+
getDocsDescription,
|
|
7
|
+
} from "../../utils/storybook";
|
|
2
8
|
|
|
3
9
|
import UNumber from "../../ui.text-number/UNumber.vue";
|
|
4
10
|
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
@@ -6,7 +12,7 @@ import URow from "../../ui.container-row/URow.vue";
|
|
|
6
12
|
import UCol from "../../ui.container-col/UCol.vue";
|
|
7
13
|
|
|
8
14
|
import type { Meta, StoryFn } from "@storybook/vue3-vite";
|
|
9
|
-
import type { Props } from "../types
|
|
15
|
+
import type { Props } from "../types";
|
|
10
16
|
|
|
11
17
|
interface UNumberArgs extends Props {
|
|
12
18
|
slotTemplate?: string;
|
|
@@ -23,6 +29,11 @@ export default {
|
|
|
23
29
|
argTypes: {
|
|
24
30
|
...getArgTypes(UNumber.__name),
|
|
25
31
|
},
|
|
32
|
+
parameters: {
|
|
33
|
+
docs: {
|
|
34
|
+
...getDocsDescription(UNumber.__name),
|
|
35
|
+
},
|
|
36
|
+
},
|
|
26
37
|
} as Meta;
|
|
27
38
|
|
|
28
39
|
const DefaultTemplate: StoryFn<UNumberArgs> = (args: UNumberArgs) => ({
|
|
@@ -2,9 +2,9 @@ import { mount } from "@vue/test-utils";
|
|
|
2
2
|
import { describe, it, expect, beforeAll } from "vitest";
|
|
3
3
|
|
|
4
4
|
import UNumber from "../UNumber.vue";
|
|
5
|
-
import { MATH_SIGN, MATH_SIGN_TYPE } from "../utilNumber
|
|
5
|
+
import { MATH_SIGN, MATH_SIGN_TYPE } from "../utilNumber";
|
|
6
6
|
|
|
7
|
-
import type { Props } from "../types
|
|
7
|
+
import type { Props } from "../types";
|
|
8
8
|
|
|
9
9
|
describe("UNumber.vue", () => {
|
|
10
10
|
let value: number;
|
package/ui.text-number/types.ts
CHANGED
package/utils/helper.ts
CHANGED
|
@@ -2,9 +2,11 @@ import fs from "node:fs/promises";
|
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
|
|
5
|
+
import { removeFolderIfEmpty } from "./helper.js";
|
|
5
6
|
import { vuelessConfig } from "./vuelessConfig.js";
|
|
6
7
|
|
|
7
8
|
import {
|
|
9
|
+
CACHE_DIR,
|
|
8
10
|
COMPONENTS,
|
|
9
11
|
GRAYSCALE_COLOR,
|
|
10
12
|
INHERIT_COLOR,
|
|
@@ -74,9 +76,8 @@ export async function setCustomPropTypes(srcDir) {
|
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
const isCustomProps = componentGlobalConfig && componentGlobalConfig.props;
|
|
77
|
-
const isHiddenStories = componentGlobalConfig && componentGlobalConfig.storybook === false;
|
|
78
79
|
|
|
79
|
-
if (isCustomProps
|
|
80
|
+
if (isCustomProps) {
|
|
80
81
|
await cacheComponentTypes(path.join(srcDir, componentDir));
|
|
81
82
|
await modifyComponentTypes(path.join(srcDir, componentDir), componentGlobalConfig.props);
|
|
82
83
|
}
|
|
@@ -91,26 +92,34 @@ export async function removeCustomPropTypes(srcDir) {
|
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
async function cacheComponentTypes(filePath) {
|
|
94
|
-
const cacheDir = path.join(filePath,
|
|
95
|
+
const cacheDir = path.join(filePath, CACHE_DIR);
|
|
95
96
|
const sourceFile = path.join(filePath, "types.ts");
|
|
96
97
|
const destFile = path.join(cacheDir, "types.ts");
|
|
97
98
|
|
|
98
|
-
if (existsSync(
|
|
99
|
+
if (existsSync(destFile) || !existsSync(sourceFile)) {
|
|
99
100
|
return;
|
|
100
101
|
}
|
|
101
102
|
|
|
102
|
-
if (existsSync(
|
|
103
|
+
if (!existsSync(cacheDir)) {
|
|
103
104
|
await fs.mkdir(cacheDir);
|
|
104
|
-
await fs.cp(sourceFile, destFile);
|
|
105
105
|
}
|
|
106
|
+
|
|
107
|
+
await fs.cp(sourceFile, destFile);
|
|
106
108
|
}
|
|
107
109
|
|
|
108
110
|
async function clearComponentTypesCache(filePath) {
|
|
109
|
-
|
|
111
|
+
const cacheDir = path.join(filePath, CACHE_DIR);
|
|
112
|
+
const sourceFile = path.join(cacheDir, "types.ts");
|
|
113
|
+
|
|
114
|
+
if (existsSync(sourceFile)) {
|
|
115
|
+
await fs.rm(sourceFile, { force: true });
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
await removeFolderIfEmpty(cacheDir);
|
|
110
119
|
}
|
|
111
120
|
|
|
112
121
|
async function restoreComponentTypes(filePath) {
|
|
113
|
-
const cacheDir = path.join(filePath,
|
|
122
|
+
const cacheDir = path.join(filePath, CACHE_DIR);
|
|
114
123
|
const sourceFile = path.join(cacheDir, "types.ts");
|
|
115
124
|
const destFile = path.join(filePath, "types.ts");
|
|
116
125
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function getDirFiles(dirPath: any, ext: any, { recursive, exclude }?: {
|
|
2
|
+
recursive?: boolean | undefined;
|
|
3
|
+
exclude?: never[] | undefined;
|
|
4
|
+
}): Promise<string[]>;
|
|
5
|
+
export function getNuxtDirs(): string[];
|
|
6
|
+
export function getVueDirs(): string[];
|
|
7
|
+
export function getVuelessConfigDirs(): string[];
|
|
8
|
+
export function getMergedComponentConfig(name: any): Promise<any>;
|
|
9
|
+
export function getDefaultComponentConfig(name: any, configDir: any): Promise<{}>;
|
|
10
|
+
export function cacheMergedConfigs(srcDir: any): Promise<void>;
|
|
11
|
+
export function buildTSFile(entryPath: any, configOutFile: any): Promise<void>;
|
|
12
|
+
export function removeFolderIfEmpty(dirPath: any): Promise<void>;
|
|
13
|
+
export function detectTypeScript(): Promise<boolean>;
|
|
14
|
+
export function autoImportUserConfigs(basePath?: string): Promise<void>;
|
|
15
|
+
export function generateConfigIndexContent(imports?: string[], componentEntries?: string[]): Promise<string>;
|
package/utils/node/helper.js
CHANGED
|
@@ -3,7 +3,7 @@ import path from "node:path";
|
|
|
3
3
|
import { cwd } from "node:process";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
import { existsSync, statSync } from "node:fs";
|
|
6
|
-
import { mkdir, readdir, readFile, writeFile } from "node:fs/promises";
|
|
6
|
+
import { mkdir, readdir, rmdir, readFile, writeFile } from "node:fs/promises";
|
|
7
7
|
|
|
8
8
|
import { vuelessConfig, getMergedConfig } from "./vuelessConfig.js";
|
|
9
9
|
|
|
@@ -11,15 +11,14 @@ import {
|
|
|
11
11
|
COMPONENTS,
|
|
12
12
|
JAVASCRIPT_EXT,
|
|
13
13
|
TYPESCRIPT_EXT,
|
|
14
|
-
VUELESS_CONFIGS_CACHED_DIR,
|
|
15
|
-
VUELESS_MERGED_CONFIGS_CACHED_DIR,
|
|
16
|
-
} from "../../constants.js";
|
|
17
|
-
|
|
18
|
-
import {
|
|
19
14
|
SUPPRESS_TS_CHECK,
|
|
15
|
+
VUELESS_CONFIG_DIR,
|
|
20
16
|
COMPONENTS_INDEX_EXPORT,
|
|
21
17
|
COMPONENTS_INDEX_COMMENT,
|
|
22
|
-
|
|
18
|
+
VUELESS_CONFIGS_CACHED_DIR,
|
|
19
|
+
VUELESS_MERGED_CONFIGS_CACHED_DIR,
|
|
20
|
+
CONFIG_INDEX_FILE_NAME,
|
|
21
|
+
} from "../../constants.js";
|
|
23
22
|
|
|
24
23
|
export async function getDirFiles(dirPath, ext, { recursive = true, exclude = [] } = {}) {
|
|
25
24
|
let fileNames = [];
|
|
@@ -68,6 +67,7 @@ export async function getDirFiles(dirPath, ext, { recursive = true, exclude = []
|
|
|
68
67
|
|
|
69
68
|
export function getNuxtDirs() {
|
|
70
69
|
return [
|
|
70
|
+
path.join(cwd(), "app"),
|
|
71
71
|
path.join(cwd(), "composables"),
|
|
72
72
|
path.join(cwd(), "components"),
|
|
73
73
|
path.join(cwd(), "layouts"),
|
|
@@ -87,7 +87,7 @@ export function getVueDirs() {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
export function getVuelessConfigDirs() {
|
|
90
|
-
return [path.join(cwd(),
|
|
90
|
+
return [path.join(cwd(), VUELESS_CONFIG_DIR)];
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
export async function getMergedComponentConfig(name) {
|
|
@@ -157,25 +157,64 @@ export async function buildTSFile(entryPath, configOutFile) {
|
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
export async function
|
|
161
|
-
|
|
160
|
+
export async function removeFolderIfEmpty(dirPath) {
|
|
161
|
+
if (existsSync(dirPath)) {
|
|
162
|
+
const files = await readdir(dirPath);
|
|
163
|
+
|
|
164
|
+
if (!files.length) {
|
|
165
|
+
await rmdir(dirPath);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Detects if TypeScript is a dependency in the project's package.json
|
|
172
|
+
* @returns {Promise<boolean>} True if TypeScript is found in dependencies or devDependencies
|
|
173
|
+
*/
|
|
174
|
+
export async function detectTypeScript() {
|
|
175
|
+
try {
|
|
176
|
+
const packageJsonPath = path.join(cwd(), "package.json");
|
|
177
|
+
const packageJsonContent = await readFile(packageJsonPath, "utf-8");
|
|
178
|
+
const pkg = JSON.parse(packageJsonContent);
|
|
179
|
+
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
162
180
|
|
|
163
|
-
|
|
164
|
-
|
|
181
|
+
return Boolean(deps.typescript);
|
|
182
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
183
|
+
} catch (error) {
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
165
187
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
188
|
+
/**
|
|
189
|
+
* Automatically imports user configuration files from a specified directory, generates index file entries for them,
|
|
190
|
+
* and writes the configuration index file in the appropriate format (TypeScript or JavaScript).
|
|
191
|
+
*
|
|
192
|
+
* @param {string} [basePath=""] The base directory path where the user configuration files are located.
|
|
193
|
+
* @return {Promise<void>} A promise that resolves when the configuration import and index file generation is completed.
|
|
194
|
+
*/
|
|
195
|
+
export async function autoImportUserConfigs(basePath = "") {
|
|
196
|
+
const vuelessConfigDir = path.join(cwd(), basePath, VUELESS_CONFIG_DIR);
|
|
197
|
+
|
|
198
|
+
const indexTsPath = path.join(vuelessConfigDir, `${CONFIG_INDEX_FILE_NAME}${TYPESCRIPT_EXT}`);
|
|
199
|
+
const indexJsPath = path.join(vuelessConfigDir, `${CONFIG_INDEX_FILE_NAME}${JAVASCRIPT_EXT}`);
|
|
200
|
+
|
|
201
|
+
const hasTypeScript = await detectTypeScript();
|
|
202
|
+
|
|
203
|
+
const indexFilePath = hasTypeScript ? indexTsPath : indexJsPath;
|
|
204
|
+
const fileExt = hasTypeScript ? TYPESCRIPT_EXT : JAVASCRIPT_EXT;
|
|
169
205
|
|
|
170
206
|
const configFiles = await getDirFiles(vuelessConfigDir, fileExt, {
|
|
171
207
|
recursive: true,
|
|
172
|
-
exclude: [
|
|
208
|
+
exclude: [
|
|
209
|
+
`${CONFIG_INDEX_FILE_NAME}${TYPESCRIPT_EXT}`,
|
|
210
|
+
`${CONFIG_INDEX_FILE_NAME}${JAVASCRIPT_EXT}`,
|
|
211
|
+
],
|
|
173
212
|
});
|
|
174
213
|
|
|
175
214
|
const componentConfigFiles = configFiles.filter((filePath) => {
|
|
176
215
|
const fileName = path.basename(filePath);
|
|
177
216
|
|
|
178
|
-
return /^U\w+\.
|
|
217
|
+
return /^U\w+\.(ts|js)$/.test(fileName);
|
|
179
218
|
});
|
|
180
219
|
|
|
181
220
|
const imports = [];
|
|
@@ -184,12 +223,11 @@ export async function autoImportUserConfigs() {
|
|
|
184
223
|
if (componentConfigFiles.length) {
|
|
185
224
|
for (const configFilePath of componentConfigFiles) {
|
|
186
225
|
const fileName = path.basename(configFilePath, path.extname(configFilePath));
|
|
187
|
-
const componentName = fileName.replace(".config", "");
|
|
188
226
|
const relativePath = path.relative(vuelessConfigDir, configFilePath);
|
|
189
227
|
const importPath = "./" + relativePath.replace(/\\/g, "/");
|
|
190
228
|
|
|
191
|
-
imports.push(`import ${
|
|
192
|
-
componentEntries.push(` ${
|
|
229
|
+
imports.push(`import ${fileName} from "${importPath}";`);
|
|
230
|
+
componentEntries.push(` ${fileName},`);
|
|
193
231
|
}
|
|
194
232
|
}
|
|
195
233
|
|
|
@@ -197,17 +235,25 @@ export async function autoImportUserConfigs() {
|
|
|
197
235
|
await mkdir(vuelessConfigDir, { recursive: true });
|
|
198
236
|
}
|
|
199
237
|
|
|
200
|
-
await
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
"utf-8",
|
|
204
|
-
);
|
|
238
|
+
const indexFileContent = await generateConfigIndexContent(imports, componentEntries);
|
|
239
|
+
|
|
240
|
+
await writeFile(indexFilePath, indexFileContent, "utf-8");
|
|
205
241
|
}
|
|
206
242
|
|
|
207
|
-
|
|
243
|
+
/**
|
|
244
|
+
* Generates the content for a configuration index file by combining imports, component entries,
|
|
245
|
+
* and TypeScript-related handling.
|
|
246
|
+
*
|
|
247
|
+
* @param {string[]} imports - An array of import statements to include in the configuration index file.
|
|
248
|
+
* @param {string[]} componentEntries - An array of component entry definitions to export in the configuration index file.
|
|
249
|
+
* @return {Promise<string>} The constructed configuration indexes file content as a string.
|
|
250
|
+
*/
|
|
251
|
+
export async function generateConfigIndexContent(imports = [], componentEntries = []) {
|
|
208
252
|
const importsSection = imports.length ? `\n${imports.join("\n")}\n\n` : "";
|
|
209
253
|
const entriesSection = componentEntries.length ? `\n${componentEntries.join("\n")}\n` : "";
|
|
210
|
-
|
|
254
|
+
|
|
255
|
+
const hasTypeScript = await detectTypeScript();
|
|
256
|
+
const suppressTsCheck = hasTypeScript ? `${SUPPRESS_TS_CHECK}\n` : "";
|
|
211
257
|
|
|
212
258
|
return `${suppressTsCheck}${COMPONENTS_INDEX_COMMENT}\n${importsSection}${COMPONENTS_INDEX_EXPORT.replace(
|
|
213
259
|
"{}",
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function createIconsCache({ env, debug, targetFiles }?: string): Promise<void>;
|
|
2
|
+
export function removeIconsCache(basePath: string, isVuelessEnv?: boolean): Promise<void>;
|
|
3
|
+
export function copyIconsCache(basePath: string, isVuelessEnv?: boolean): Promise<void>;
|
|
4
|
+
export function generateIconExports(): string;
|
|
5
|
+
export function reloadServerOnIconsCacheUpdate(server: Object): void;
|
|
6
|
+
export function extractIconLines(content: string): string[];
|
|
7
|
+
export function isIconChanged(currentLines: string[], previousLines: string[]): boolean;
|
package/utils/node/loaderIcon.js
CHANGED
|
@@ -77,18 +77,20 @@ export async function createIconsCache({ env, debug = false, targetFiles = [] }
|
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* Remove cached icons.
|
|
80
|
-
* @param {string}
|
|
80
|
+
* @param {string} basePath
|
|
81
|
+
* @param {boolean} isVuelessEnv
|
|
81
82
|
* @returns {Promise<void>}
|
|
82
83
|
*/
|
|
83
|
-
export async function removeIconsCache(
|
|
84
|
+
export async function removeIconsCache(basePath, isVuelessEnv = false) {
|
|
84
85
|
const cachePath = path.join(cwd(), ICONS_CACHED_DIR);
|
|
85
86
|
|
|
86
87
|
if (fs.existsSync(cachePath)) {
|
|
87
88
|
await rm(cachePath, { recursive: true, force: true });
|
|
88
89
|
}
|
|
89
90
|
|
|
90
|
-
if (
|
|
91
|
-
const
|
|
91
|
+
if (basePath) {
|
|
92
|
+
const iconsDir = isVuelessEnv ? ICONS_DIR : ICONS_CACHED_DIR;
|
|
93
|
+
const mirrorCacheIconsPath = path.join(cwd(), basePath, iconsDir);
|
|
92
94
|
|
|
93
95
|
if (fs.existsSync(mirrorCacheIconsPath)) {
|
|
94
96
|
await rm(mirrorCacheIconsPath, { recursive: true, force: true });
|
|
@@ -98,14 +100,16 @@ export async function removeIconsCache(mirrorCacheDir) {
|
|
|
98
100
|
|
|
99
101
|
/**
|
|
100
102
|
* Copy cached icons in the provided folder by path.
|
|
101
|
-
* @param {string}
|
|
103
|
+
* @param {string} basePath
|
|
104
|
+
* @param {boolean} isVuelessEnv
|
|
102
105
|
* @returns {Promise<void>}
|
|
103
106
|
*/
|
|
104
|
-
export async function copyIconsCache(
|
|
107
|
+
export async function copyIconsCache(basePath, isVuelessEnv = false) {
|
|
105
108
|
const cachePath = path.join(cwd(), ICONS_CACHED_DIR);
|
|
106
109
|
|
|
107
|
-
if (
|
|
108
|
-
const
|
|
110
|
+
if (basePath && fs.existsSync(cachePath)) {
|
|
111
|
+
const iconsDir = isVuelessEnv ? ICONS_DIR : ICONS_CACHED_DIR;
|
|
112
|
+
const mirrorPath = path.join(cwd(), basePath, iconsDir);
|
|
109
113
|
|
|
110
114
|
await cp(cachePath, mirrorPath, { recursive: true });
|
|
111
115
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function loadSvg(id: any, options: any): Promise<string | undefined>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function createMergeConfigs(cx: any): ({ defaultConfig, globalConfig, propsConfig, config, isVariants, }: {
|
|
2
|
+
defaultConfig: any;
|
|
3
|
+
globalConfig: any;
|
|
4
|
+
propsConfig: any;
|
|
5
|
+
config?: {} | undefined;
|
|
6
|
+
isVariants?: boolean | undefined;
|
|
7
|
+
}) => {};
|
|
8
|
+
export function createGetMergedConfig(cx: any): ({ defaultConfig, globalConfig, propsConfig, unstyled }: {
|
|
9
|
+
defaultConfig: any;
|
|
10
|
+
globalConfig: any;
|
|
11
|
+
propsConfig: any;
|
|
12
|
+
unstyled: any;
|
|
13
|
+
}) => {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { getVuelessConfig } from "./vuelessConfig.js";
|
|
2
|
+
import { autoImportUserConfigs } from "./helper.js";
|
|
3
|
+
import {
|
|
4
|
+
COMPONENTS,
|
|
5
|
+
DIRECTIVES,
|
|
6
|
+
INTERNAL_ENV,
|
|
7
|
+
VUELESS_LOCAL_DIR,
|
|
8
|
+
VUELESS_PACKAGE_DIR,
|
|
9
|
+
} from "../../constants.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Defines the config for Storybook.
|
|
13
|
+
*
|
|
14
|
+
* @param {Object} config - The config object.
|
|
15
|
+
* @return {Promise<Object>} A promise that resolves to the modified config object.
|
|
16
|
+
*/
|
|
17
|
+
export function defineConfigWithVueless(config) {
|
|
18
|
+
return (async () => ({
|
|
19
|
+
...config,
|
|
20
|
+
stories: [
|
|
21
|
+
...config.stories,
|
|
22
|
+
...(await getVuelessStoriesGlob(config?.vuelessEnv, config?.basePath)),
|
|
23
|
+
],
|
|
24
|
+
addons: [
|
|
25
|
+
...new Set([
|
|
26
|
+
...(config.addons || []),
|
|
27
|
+
"@storybook/addon-docs",
|
|
28
|
+
"@storybook/addon-links",
|
|
29
|
+
"@vueless/storybook-dark-mode",
|
|
30
|
+
"@storybook/addon-themes",
|
|
31
|
+
]),
|
|
32
|
+
],
|
|
33
|
+
framework: {
|
|
34
|
+
...config.framework,
|
|
35
|
+
name: "@storybook/vue3-vite",
|
|
36
|
+
options: {
|
|
37
|
+
...config.framework?.options,
|
|
38
|
+
builder: {
|
|
39
|
+
...config.framework?.options?.builder,
|
|
40
|
+
viteConfigPath: ".storybook/vite.config.js",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
env: (envConfig) => ({
|
|
45
|
+
...envConfig,
|
|
46
|
+
BASE_URL: "/",
|
|
47
|
+
}),
|
|
48
|
+
}))();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Retrieves the glob pattern for Vueless stories based on the provided Vueless environment.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} vuelessEnv - The Vueless environment.
|
|
55
|
+
* @param {string} basePath - The Project base path.
|
|
56
|
+
* @return {Promise<string[]>} A promise that resolves to an array of glob patterns for Vueless stories.
|
|
57
|
+
*/
|
|
58
|
+
export async function getVuelessStoriesGlob(vuelessEnv, basePath) {
|
|
59
|
+
/* Auto import user configs. */
|
|
60
|
+
await autoImportUserConfigs(basePath);
|
|
61
|
+
|
|
62
|
+
const vuelessSrcDir = vuelessEnv === INTERNAL_ENV ? VUELESS_LOCAL_DIR : VUELESS_PACKAGE_DIR;
|
|
63
|
+
const vuelessConfig = await getVuelessConfig();
|
|
64
|
+
const storiesGlob = [];
|
|
65
|
+
|
|
66
|
+
for (const [directiveName, directiveDir] of Object.entries(DIRECTIVES)) {
|
|
67
|
+
const directiveGlobalConfig = vuelessConfig.directives?.[directiveName];
|
|
68
|
+
const isHiddenStoriesByDirective = directiveGlobalConfig === false;
|
|
69
|
+
const isHiddenStoriesByKey = directiveGlobalConfig?.storybook === false;
|
|
70
|
+
|
|
71
|
+
if (isHiddenStoriesByDirective || isHiddenStoriesByKey) {
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
storiesGlob.push(`../${vuelessSrcDir}/${directiveDir}/storybook/stories.{js,ts}`);
|
|
76
|
+
storiesGlob.push(`../${vuelessSrcDir}/${directiveDir}/storybook/docs.mdx`);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
for (const [componentName, componentDir] of Object.entries(COMPONENTS)) {
|
|
80
|
+
const componentGlobalConfig = vuelessConfig.components?.[componentName];
|
|
81
|
+
const isHiddenStoriesByComponent = componentGlobalConfig === false;
|
|
82
|
+
const isHiddenStoriesByKey = componentGlobalConfig?.storybook === false;
|
|
83
|
+
|
|
84
|
+
if (isHiddenStoriesByComponent || isHiddenStoriesByKey) {
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
storiesGlob.push(`../${vuelessSrcDir}/${componentDir}/storybook/stories.{js,ts}`);
|
|
89
|
+
storiesGlob.push(`../${vuelessSrcDir}/${componentDir}/storybook/docs.mdx`);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return storiesGlob;
|
|
93
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function getVuelessConfig(basePath?: string): Promise<Object>;
|
|
2
|
+
export let vuelessConfig: {};
|
|
3
|
+
export const cx: import("cva").CX;
|
|
4
|
+
export const getMergedConfig: ({ defaultConfig, globalConfig, propsConfig, unstyled }: {
|
|
5
|
+
defaultConfig: any;
|
|
6
|
+
globalConfig: any;
|
|
7
|
+
propsConfig: any;
|
|
8
|
+
unstyled: any;
|
|
9
|
+
}) => {};
|
|
@@ -3,10 +3,10 @@ import path from "node:path";
|
|
|
3
3
|
import { cwd } from "node:process";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
import { defineConfig } from "cva";
|
|
6
|
-
import { createGetMergedConfig } from "./mergeConfigs.js";
|
|
7
6
|
import { merge } from "lodash-es";
|
|
8
7
|
import { extendTailwindMerge } from "tailwind-merge";
|
|
9
8
|
|
|
9
|
+
import { createGetMergedConfig } from "./mergeConfigs.js";
|
|
10
10
|
import { buildTSFile } from "./helper.js";
|
|
11
11
|
import {
|
|
12
12
|
VUELESS_CACHE_DIR,
|
|
@@ -15,21 +15,33 @@ import {
|
|
|
15
15
|
NESTED_COMPONENT_PATTERN_REG_EXP,
|
|
16
16
|
} from "../../constants.js";
|
|
17
17
|
|
|
18
|
+
export let vuelessConfig = {};
|
|
19
|
+
|
|
18
20
|
/**
|
|
19
21
|
* Load Vueless config from the project root.
|
|
20
22
|
* IIFE is used to prevent top level await issue.
|
|
21
23
|
*/
|
|
22
|
-
export let vuelessConfig = {};
|
|
23
|
-
|
|
24
24
|
(async () => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const configOutPath = path.join(cwd(), `${VUELESS_CACHE_DIR}/${VUELESS_CONFIG_FILE_NAME}.mjs`);
|
|
25
|
+
vuelessConfig = await getVuelessConfig();
|
|
26
|
+
})();
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves the Vueless config from the project root.
|
|
30
|
+
*
|
|
31
|
+
* This method checks for the existence of a `vueless.config.{js,ts}` file in the project root.
|
|
32
|
+
* If the file exists, it reads the config and returns it as an object.
|
|
33
|
+
* @param {string} basePath - The application base path.
|
|
34
|
+
*
|
|
35
|
+
* @return {Promise<Object>} A promise that resolves to the Vueless configuration object.
|
|
36
|
+
*/
|
|
37
|
+
export async function getVuelessConfig(basePath = "") {
|
|
38
|
+
const configPathJs = path.join(cwd(), basePath, `${VUELESS_CONFIG_FILE_NAME}.js`);
|
|
39
|
+
const configPathTs = path.join(cwd(), basePath, `${VUELESS_CONFIG_FILE_NAME}.ts`);
|
|
40
|
+
// eslint-disable-next-line prettier/prettier
|
|
41
|
+
const configOutPath = path.join(cwd(), basePath, `${VUELESS_CACHE_DIR}/${VUELESS_CONFIG_FILE_NAME}.mjs`);
|
|
31
42
|
|
|
32
|
-
|
|
43
|
+
if (!fs.existsSync(configPathJs) && !fs.existsSync(configPathTs)) {
|
|
44
|
+
return {};
|
|
33
45
|
}
|
|
34
46
|
|
|
35
47
|
fs.existsSync(configPathJs) && (await buildTSFile(configPathJs, configOutPath));
|
|
@@ -38,16 +50,23 @@ export let vuelessConfig = {};
|
|
|
38
50
|
if (fs.existsSync(configOutPath)) {
|
|
39
51
|
const module = await import(pathToFileURL(configOutPath));
|
|
40
52
|
|
|
41
|
-
|
|
53
|
+
return module.default;
|
|
42
54
|
}
|
|
43
|
-
}
|
|
55
|
+
}
|
|
44
56
|
|
|
57
|
+
/* Merge tailwind classes with removing duplicates. */
|
|
45
58
|
const twMerge = extendTailwindMerge(merge(TAILWIND_MERGE_EXTENSION, vuelessConfig.tailwindMerge));
|
|
46
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Export cx (class merge) method:
|
|
62
|
+
* – extended with tailwind-merge
|
|
63
|
+
* – remove all Vueless nested component names ({U...} strings) from the class list string.
|
|
64
|
+
*/
|
|
47
65
|
export const { cx } = defineConfig({
|
|
48
66
|
hooks: {
|
|
49
67
|
onComplete: (classNames) => twMerge(classNames).replace(NESTED_COMPONENT_PATTERN_REG_EXP, ""),
|
|
50
68
|
},
|
|
51
69
|
});
|
|
52
70
|
|
|
71
|
+
/* Get merged config based on config merging strategy. */
|
|
53
72
|
export const getMergedConfig = createGetMergedConfig(cx);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export namespace componentResolver {
|
|
2
|
+
let type: string;
|
|
3
|
+
function resolve(componentName: any): {
|
|
4
|
+
from: string;
|
|
5
|
+
} | undefined;
|
|
6
|
+
}
|
|
7
|
+
export namespace directiveResolver {
|
|
8
|
+
let type_1: string;
|
|
9
|
+
export { type_1 as type };
|
|
10
|
+
export function resolve(directive: any): {
|
|
11
|
+
from: string;
|
|
12
|
+
} | undefined;
|
|
13
|
+
}
|