vueless 1.1.1-beta.6 → 1.1.1-beta.60
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 +15 -38
- package/bin/constants.d.ts +3 -0
- package/bin/constants.js +0 -14
- package/composables/tests/useUI.test.ts +30 -15
- package/composables/useAutoPosition.ts +1 -1
- package/composables/useBreakpoint.ts +1 -1
- package/composables/useComponentLocaleMassages.ts +9 -6
- 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 +25 -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 +20 -7
- 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 +10 -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 +89 -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
package/utils/theme.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cloneDeep, merge } from "lodash-es";
|
|
2
2
|
|
|
3
|
-
import { vuelessConfig } from "./ui
|
|
4
|
-
import { isCSR, setCookie } from "./helper
|
|
3
|
+
import { vuelessConfig } from "./ui";
|
|
4
|
+
import { isCSR, setCookie } from "./helper";
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
PX_IN_REM,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
TEXT_DECREMENT,
|
|
34
34
|
DISABLED_OPACITY,
|
|
35
35
|
DEFAULT_DISABLED_OPACITY,
|
|
36
|
-
} from "../constants
|
|
36
|
+
} from "../constants";
|
|
37
37
|
|
|
38
38
|
import type {
|
|
39
39
|
NeutralColors,
|
|
@@ -43,8 +43,8 @@ import type {
|
|
|
43
43
|
ThemeConfigOutline,
|
|
44
44
|
ThemeConfigRounding,
|
|
45
45
|
VuelessCssVariables,
|
|
46
|
-
} from "../types
|
|
47
|
-
import { ColorMode } from "../types
|
|
46
|
+
} from "../types";
|
|
47
|
+
import { ColorMode } from "../types";
|
|
48
48
|
|
|
49
49
|
declare interface RootCSSVariableOptions {
|
|
50
50
|
primary: PrimaryColors | string;
|
|
@@ -314,10 +314,10 @@ function getText(text?: ThemeConfig["text"]) {
|
|
|
314
314
|
};
|
|
315
315
|
|
|
316
316
|
const mergedText = {
|
|
317
|
-
xs: runtimeText.xs === undefined ? textXs : definedText.xs,
|
|
318
|
-
sm: runtimeText.sm === undefined ? textSm : definedText.sm,
|
|
319
|
-
md: runtimeText.md === undefined ? textMd : definedText.md,
|
|
320
|
-
lg: runtimeText.lg === undefined ? textLg : definedText.lg,
|
|
317
|
+
xs: runtimeText.xs === undefined && globalText.xs === undefined ? textXs : definedText.xs,
|
|
318
|
+
sm: runtimeText.sm === undefined && globalText.sm === undefined ? textSm : definedText.sm,
|
|
319
|
+
md: runtimeText.md === undefined && globalText.md === undefined ? textMd : definedText.md,
|
|
320
|
+
lg: runtimeText.lg === undefined && globalText.lg === undefined ? textLg : definedText.lg,
|
|
321
321
|
};
|
|
322
322
|
|
|
323
323
|
if (isCSR && text) {
|
|
@@ -346,8 +346,8 @@ function getOutlines(outline?: ThemeConfig["outline"]) {
|
|
|
346
346
|
lg: `vl-${OUTLINE}-lg`,
|
|
347
347
|
};
|
|
348
348
|
|
|
349
|
-
const runtimeOutline = primitiveToObject(outline) as
|
|
350
|
-
const globalOutline = primitiveToObject(vuelessConfig.outline) as
|
|
349
|
+
const runtimeOutline = primitiveToObject(outline) as ThemeConfigOutline;
|
|
350
|
+
const globalOutline = primitiveToObject(vuelessConfig.outline) as ThemeConfigOutline;
|
|
351
351
|
|
|
352
352
|
const outlineMd = Math.max(0, Number(runtimeOutline.md ?? globalOutline.md ?? DEFAULT_OUTLINE));
|
|
353
353
|
const outlineSm = Math.max(0, outlineMd - OUTLINE_DECREMENT);
|
|
@@ -363,11 +363,13 @@ function getOutlines(outline?: ThemeConfig["outline"]) {
|
|
|
363
363
|
lg: Math.max(0, Number(runtimeOutline.lg ?? getStored(storageKey.lg) ?? globalOutline.lg ?? 0)),
|
|
364
364
|
};
|
|
365
365
|
|
|
366
|
+
/* eslint-disable prettier/prettier */
|
|
366
367
|
const mergedOutline = {
|
|
367
|
-
sm: runtimeOutline.sm === undefined ? outlineSm : definedOutline.sm,
|
|
368
|
-
md: runtimeOutline.md === undefined ? outlineMd : definedOutline.md,
|
|
369
|
-
lg: runtimeOutline.lg === undefined ? outlineLg : definedOutline.lg,
|
|
368
|
+
sm: runtimeOutline.sm === undefined && globalOutline.sm === undefined ? outlineSm : definedOutline.sm,
|
|
369
|
+
md: runtimeOutline.md === undefined && globalOutline.md === undefined ? outlineMd : definedOutline.md,
|
|
370
|
+
lg: runtimeOutline.lg === undefined && globalOutline.lg === undefined ? outlineLg : definedOutline.lg,
|
|
370
371
|
};
|
|
372
|
+
/* eslint-enable prettier/prettier */
|
|
371
373
|
|
|
372
374
|
if (isCSR && outline) {
|
|
373
375
|
setCookie(storageKey.sm, String(mergedOutline.sm));
|
|
@@ -419,13 +421,13 @@ function getRoundings(rounding?: ThemeConfig["rounding"]) {
|
|
|
419
421
|
md: Math.max(0, Number(runtimeRounding.md ?? getStored(storageKey.md) ?? globalRounding.md ?? 0)),
|
|
420
422
|
lg: Math.max(0, Number(runtimeRounding.lg ?? getStored(storageKey.lg) ?? globalRounding.lg ?? 0)),
|
|
421
423
|
};
|
|
422
|
-
/* eslint-enable prettier/prettier */
|
|
423
424
|
|
|
424
425
|
const mergedRounding = {
|
|
425
|
-
sm: runtimeRounding.sm === undefined ? roundingSm : definedRounding.sm,
|
|
426
|
-
md: runtimeRounding.md === undefined ? roundingMd : definedRounding.md,
|
|
427
|
-
lg: runtimeRounding.lg === undefined ? roundingLg : definedRounding.lg,
|
|
426
|
+
sm: runtimeRounding.sm === undefined && globalRounding.sm === undefined ? roundingSm : definedRounding.sm,
|
|
427
|
+
md: runtimeRounding.md === undefined && globalRounding.md === undefined ? roundingMd : definedRounding.md,
|
|
428
|
+
lg: runtimeRounding.lg === undefined && globalRounding.lg === undefined ? roundingLg : definedRounding.lg,
|
|
428
429
|
};
|
|
430
|
+
/* eslint-enable prettier/prettier */
|
|
429
431
|
|
|
430
432
|
if (isCSR && rounding) {
|
|
431
433
|
setCookie(storageKey.sm, String(mergedRounding.sm));
|
package/utils/ui.ts
CHANGED
|
@@ -2,12 +2,18 @@ import { merge } from "lodash-es";
|
|
|
2
2
|
import { defineConfig } from "cva";
|
|
3
3
|
import { extendTailwindMerge } from "tailwind-merge";
|
|
4
4
|
|
|
5
|
-
import { isCSR } from "./helper
|
|
6
|
-
import { createGetMergedConfig } from "./node/mergeConfigs
|
|
7
|
-
import { COMPONENT_NAME as U_ICON } from "../ui.image-icon/constants
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import { isCSR, isSSR } from "./helper";
|
|
6
|
+
import { createGetMergedConfig } from "./node/mergeConfigs";
|
|
7
|
+
import { COMPONENT_NAME as U_ICON } from "../ui.image-icon/constants";
|
|
8
|
+
import {
|
|
9
|
+
JAVASCRIPT_EXT,
|
|
10
|
+
TYPESCRIPT_EXT,
|
|
11
|
+
VUELESS_CONFIG_FILE_NAME,
|
|
12
|
+
TAILWIND_MERGE_EXTENSION,
|
|
13
|
+
ICON_NON_PROPS_DEFAULTS,
|
|
14
|
+
} from "../constants";
|
|
15
|
+
|
|
16
|
+
import type { Config, ComponentDefaults, UnknownObject, ComponentNames } from "../types";
|
|
11
17
|
|
|
12
18
|
interface MergedConfigOptions {
|
|
13
19
|
defaultConfig: unknown;
|
|
@@ -33,13 +39,32 @@ export function setVuelessConfig(config?: Config) {
|
|
|
33
39
|
if (isCSR) {
|
|
34
40
|
vuelessConfig =
|
|
35
41
|
Object.values(
|
|
36
|
-
import.meta.glob(["/vueless.config.{js,ts}"
|
|
42
|
+
import.meta.glob(["/vueless.config.{js,ts}"], {
|
|
37
43
|
eager: true,
|
|
38
44
|
import: "default",
|
|
39
45
|
}),
|
|
40
46
|
)[0] || {};
|
|
41
47
|
}
|
|
42
48
|
|
|
49
|
+
if (isSSR) {
|
|
50
|
+
/* Load Tailwind config from the project root in IIFE (no top-level await). */
|
|
51
|
+
(async () => {
|
|
52
|
+
try {
|
|
53
|
+
vuelessConfig = (
|
|
54
|
+
await import(/* @vite-ignore */ `/${VUELESS_CONFIG_FILE_NAME}${JAVASCRIPT_EXT}`)
|
|
55
|
+
).default;
|
|
56
|
+
|
|
57
|
+
if (!vuelessConfig) {
|
|
58
|
+
vuelessConfig = (
|
|
59
|
+
await import(/* @vite-ignore */ `/${VUELESS_CONFIG_FILE_NAME}${TYPESCRIPT_EXT}`)
|
|
60
|
+
).default;
|
|
61
|
+
}
|
|
62
|
+
} catch {
|
|
63
|
+
vuelessConfig = {} as Config;
|
|
64
|
+
}
|
|
65
|
+
})();
|
|
66
|
+
}
|
|
67
|
+
|
|
43
68
|
/**
|
|
44
69
|
* Extend twMerge (tailwind merge) by vueless and user config:
|
|
45
70
|
*/
|
|
@@ -79,7 +104,7 @@ export function getDefaults<Props, Config>(defaultConfig: Config, name: Componen
|
|
|
79
104
|
const componentDefaults = (defaultConfig as UnknownObject).defaults || {};
|
|
80
105
|
const globalDefaults = vuelessConfig.components?.[name]?.defaults || {};
|
|
81
106
|
|
|
82
|
-
const defaults = merge({}, componentDefaults, globalDefaults) as Props &
|
|
107
|
+
const defaults = merge({}, componentDefaults, globalDefaults) as Props & ComponentDefaults;
|
|
83
108
|
|
|
84
109
|
/* Remove non a props defaults. */
|
|
85
110
|
for (const key in defaults) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Meta, Title, Subtitle, Description,
|
|
1
|
+
import { Meta, Title, Subtitle, Description, Controls, Stories } from "@storybook/addon-docs/blocks";
|
|
2
2
|
|
|
3
|
-
import * as stories from "./stories
|
|
3
|
+
import * as stories from "./stories";
|
|
4
4
|
|
|
5
5
|
<Meta of={stories} />
|
|
6
6
|
<Title of={stories} />
|
|
@@ -2,11 +2,11 @@ import type { Meta, StoryFn } from "@storybook/vue3-vite";
|
|
|
2
2
|
|
|
3
3
|
import { ref, computed, onMounted, useTemplateRef } from "vue";
|
|
4
4
|
|
|
5
|
-
import UAlert from "
|
|
6
|
-
import UButton from "
|
|
7
|
-
import UCalendar from "
|
|
8
|
-
import clickOutside from "../vClickOutside
|
|
9
|
-
import type { ClickCallback } from "../types
|
|
5
|
+
import UAlert from "../../ui.text-alert/UAlert.vue";
|
|
6
|
+
import UButton from "../../ui.button/UButton.vue";
|
|
7
|
+
import UCalendar from "../../ui.form-calendar/UCalendar.vue";
|
|
8
|
+
import clickOutside from "../vClickOutside";
|
|
9
|
+
import type { ClickCallback } from "../types";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* The `v-click-outside` directive. | [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/directives/clickOutside)
|
|
@@ -8,7 +8,7 @@ import type {
|
|
|
8
8
|
ClickOutsideTargetElement,
|
|
9
9
|
DirectiveBindingCallback,
|
|
10
10
|
DirectiveBindingOptions,
|
|
11
|
-
} from "./types
|
|
11
|
+
} from "./types";
|
|
12
12
|
|
|
13
13
|
function isElement(element: EventTarget | null) {
|
|
14
14
|
return element instanceof HTMLElement || element instanceof SVGElement;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Meta, Title, Subtitle, Description, Controls, Stories, Source } from "@storybook/addon-docs/blocks";
|
|
2
|
+
|
|
3
|
+
import * as stories from "./stories";
|
|
4
|
+
|
|
5
|
+
<Meta of={stories} />
|
|
6
|
+
<Title of={stories} />
|
|
7
|
+
<Subtitle of={stories} />
|
|
8
|
+
<Description of={stories} />
|
|
9
|
+
<Controls of={stories.Default} />
|
|
10
|
+
<Stories of={stories} />
|
|
11
|
+
|
|
12
|
+
## Theme Configuration
|
|
13
|
+
You can use the default `vueless` theme or create your own [custom one](https://atomiks.github.io/tippyjs/v6/themes/) via the global Vueless config:
|
|
14
|
+
|
|
15
|
+
<Source code={`
|
|
16
|
+
directives: {
|
|
17
|
+
tooltip: {
|
|
18
|
+
theme: "custom",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
`} language="jsx" dark />
|
|
22
|
+
|
|
23
|
+
## Customizing Styles
|
|
24
|
+
To customize the default `vueless` or your own custom theme, simply update your CSS as shown below:
|
|
25
|
+
|
|
26
|
+
<Source code={`
|
|
27
|
+
.tippy-box[data-theme~="custom"] {
|
|
28
|
+
background-color: var(--vl-neutral-accented);
|
|
29
|
+
color: var(--vl-text-inverted);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.tippy-box[data-theme~="custom"][data-placement^="top"] > .tippy-arrow:before {
|
|
33
|
+
border-top-color: var(--vl-neutral-accented);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.tippy-box[data-theme~="custom"][data-placement^="bottom"] > .tippy-arrow:before {
|
|
37
|
+
border-bottom-color: var(--vl-neutral-accented);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.tippy-box[data-theme~="custom"][data-placement^="left"] > .tippy-arrow:before {
|
|
41
|
+
border-left-color: var(--vl-neutral-accented);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.tippy-box[data-theme~="custom"][data-placement^="right"] > .tippy-arrow:before {
|
|
45
|
+
border-right-color: var(--vl-neutral-accented);
|
|
46
|
+
}
|
|
47
|
+
`} language="jsx" dark />
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import type { Meta, StoryFn } from "@storybook/vue3-vite";
|
|
2
2
|
|
|
3
|
-
import UIcon from "
|
|
4
|
-
import UCol from "
|
|
5
|
-
import
|
|
6
|
-
import ULink from "../../../ui.button-link/ULink.vue";
|
|
7
|
-
import UText from "../../../ui.text-block/UText.vue";
|
|
8
|
-
import tooltip from "../vTooltip.ts";
|
|
3
|
+
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
4
|
+
import UCol from "../../ui.container-col/UCol.vue";
|
|
5
|
+
import tooltip from "../vTooltip";
|
|
9
6
|
|
|
10
7
|
import type { Props } from "tippy.js";
|
|
11
8
|
|
|
@@ -35,7 +32,7 @@ const DefaultTemplate: StoryFn<VTooltipArgs> = (args: VTooltipArgs) => ({
|
|
|
35
32
|
});
|
|
36
33
|
|
|
37
34
|
const TooltipSettingsTemplate: StoryFn<VTooltipArgs> = (args: VTooltipArgs) => ({
|
|
38
|
-
components: { UIcon, UCol
|
|
35
|
+
components: { UIcon, UCol },
|
|
39
36
|
directives: { tooltip },
|
|
40
37
|
setup() {
|
|
41
38
|
return { args };
|
|
@@ -45,7 +42,13 @@ const TooltipSettingsTemplate: StoryFn<VTooltipArgs> = (args: VTooltipArgs) => (
|
|
|
45
42
|
<UIcon
|
|
46
43
|
interactive
|
|
47
44
|
name="sentiment_satisfied"
|
|
48
|
-
v-tooltip="{
|
|
45
|
+
v-tooltip="{
|
|
46
|
+
content: '<b>Tooltip</b>',
|
|
47
|
+
placement: 'bottom',
|
|
48
|
+
allowHTML: true,
|
|
49
|
+
hideOnClick: true,
|
|
50
|
+
trigger: 'click'
|
|
51
|
+
}"
|
|
49
52
|
/>
|
|
50
53
|
</UCol>
|
|
51
54
|
`,
|
|
@@ -60,9 +63,9 @@ TooltipSettings.parameters = {
|
|
|
60
63
|
docs: {
|
|
61
64
|
description: {
|
|
62
65
|
story: `
|
|
63
|
-
This
|
|
64
|
-
including HTML content and
|
|
65
|
-
refer to the <a href="https://atomiks.github.io/tippyjs/v6/all-props/" target="_blank" class="!no-underline">Tippy.js documentation</a>.
|
|
66
|
+
This example shows how to configure the \`v-tooltip\` directive with custom options,
|
|
67
|
+
including HTML content, specific placement, click-triggered display, and persistent visibility after a click.
|
|
68
|
+
For a full list of available settings, refer to the <a href="https://atomiks.github.io/tippyjs/v6/all-props/" target="_blank" class="!no-underline">Tippy.js documentation</a>.
|
|
66
69
|
`,
|
|
67
70
|
},
|
|
68
71
|
},
|
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
import tippy from "tippy.js";
|
|
2
2
|
import { merge } from "lodash-es";
|
|
3
3
|
|
|
4
|
-
import { vuelessConfig } from "
|
|
5
|
-
import { isCSR, isSSR } from "
|
|
4
|
+
import { vuelessConfig } from "../utils/ui";
|
|
5
|
+
import { isCSR, isSSR } from "../utils/helper";
|
|
6
6
|
|
|
7
7
|
import type { DefaultProps, Instance as TippyInstance, Props as TippyProps } from "tippy.js";
|
|
8
|
-
import type {
|
|
9
|
-
TippyTargetElement,
|
|
10
|
-
DirectiveBindingContent,
|
|
11
|
-
DirectiveBindingProps,
|
|
12
|
-
} from "./types.ts";
|
|
8
|
+
import type { TippyTargetElement, DirectiveBindingContent, DirectiveBindingProps } from "./types";
|
|
13
9
|
|
|
14
10
|
let settings: Partial<DefaultProps> = {};
|
|
15
11
|
|
|
16
12
|
if (isCSR) {
|
|
17
13
|
import("tippy.js/dist/tippy.css");
|
|
18
|
-
import("tippy.js/themes/light.css");
|
|
19
14
|
import("tippy.js/animations/shift-away.css");
|
|
20
15
|
|
|
21
16
|
const defaultSettings = {
|
|
22
17
|
arrow: true,
|
|
23
|
-
theme: "
|
|
18
|
+
theme: "vueless",
|
|
24
19
|
animation: "shift-away",
|
|
25
20
|
};
|
|
26
21
|
|
package/directives/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The file should have `.js` extension to allow import from the folder without adding `/index.ts` in the end.
|
|
3
|
-
* Vite doesn't recognize `.ts` files without extension.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export { default as vTooltip } from "./tooltip/vTooltip.ts";
|
|
7
|
-
export { default as vClickOutside } from "./clickOutside/vClickOutside.ts";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/addon-docs/blocks";
|
|
2
|
-
|
|
3
|
-
import * as stories from "./stories.ts";
|
|
4
|
-
|
|
5
|
-
<Meta of={stories} />
|
|
6
|
-
<Title of={stories} />
|
|
7
|
-
<Subtitle of={stories} />
|
|
8
|
-
<Description of={stories} />
|
|
9
|
-
<Controls of={stories.Default} />
|
|
10
|
-
<Stories of={stories} />
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { cwd } from "node:process";
|
|
3
|
-
import { existsSync, promises as fsPromises } from "node:fs";
|
|
4
|
-
|
|
5
|
-
import { vuelessConfig } from "./vuelessConfig.js";
|
|
6
|
-
import { COMPONENTS } from "../../constants.js";
|
|
7
|
-
|
|
8
|
-
const STORYBOOK_DIR = "storybook";
|
|
9
|
-
|
|
10
|
-
export async function hideHiddenStories(srcDir) {
|
|
11
|
-
for await (const [componentName, componentDir] of Object.entries(COMPONENTS)) {
|
|
12
|
-
const componentGlobalConfig = vuelessConfig.components?.[componentName];
|
|
13
|
-
const isHiddenStories = componentGlobalConfig && componentGlobalConfig.storybook === false;
|
|
14
|
-
|
|
15
|
-
if (isHiddenStories) {
|
|
16
|
-
await hideComponentStories(path.join(cwd(), srcDir, componentDir, STORYBOOK_DIR));
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export async function showHiddenStories(srcDir) {
|
|
22
|
-
for await (const componentDir of Object.values(COMPONENTS)) {
|
|
23
|
-
await showComponentStories(path.join(cwd(), srcDir, componentDir, STORYBOOK_DIR));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async function hideComponentStories(storybookPath) {
|
|
28
|
-
if (existsSync(storybookPath)) {
|
|
29
|
-
const storyFiles = await fsPromises.readdir(storybookPath);
|
|
30
|
-
const visibleFiles = storyFiles.filter((storybookFile) => !storybookFile.includes("hidden"));
|
|
31
|
-
|
|
32
|
-
await Promise.all(
|
|
33
|
-
visibleFiles.map((storybookFile) => {
|
|
34
|
-
const [fileName, extension] = storybookFile.split(".");
|
|
35
|
-
|
|
36
|
-
return fsPromises.rename(
|
|
37
|
-
path.join(storybookPath, storybookFile),
|
|
38
|
-
path.join(storybookPath, `${fileName}_hidden.${extension}`),
|
|
39
|
-
);
|
|
40
|
-
}),
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
async function showComponentStories(storybookPath) {
|
|
46
|
-
if (existsSync(storybookPath)) {
|
|
47
|
-
const storyFiles = await fsPromises.readdir(storybookPath);
|
|
48
|
-
const hiddenFiles = storyFiles.filter((storybookFile) => storybookFile.includes("hidden"));
|
|
49
|
-
|
|
50
|
-
await Promise.all(
|
|
51
|
-
hiddenFiles.map((storybookFile) => {
|
|
52
|
-
const [fileName, extension] = storybookFile.split(".");
|
|
53
|
-
const [originalFileName] = fileName.split("_");
|
|
54
|
-
|
|
55
|
-
return fsPromises.rename(
|
|
56
|
-
path.join(storybookPath, storybookFile),
|
|
57
|
-
path.join(storybookPath, `${originalFileName}.${extension}`),
|
|
58
|
-
);
|
|
59
|
-
}),
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
}
|
package/utils/tailwindConfig.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { isSSR, isCSR } from "./helper.ts";
|
|
2
|
-
|
|
3
|
-
import type { Config } from "tailwindcss";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Load Tailwind config from the project root.
|
|
7
|
-
* Both for server and client side renderings.
|
|
8
|
-
* IIFE for SSR is used to prevent top level await issue.
|
|
9
|
-
*/
|
|
10
|
-
export let tailwindConfig: Config;
|
|
11
|
-
|
|
12
|
-
if (isSSR) {
|
|
13
|
-
/* Load Tailwind config from the project root in IIFE (no top-level await). */
|
|
14
|
-
(async () => {
|
|
15
|
-
try {
|
|
16
|
-
const filePath = `${process.cwd()}/tailwind.config`;
|
|
17
|
-
|
|
18
|
-
tailwindConfig = (await import(/* @vite-ignore */ `${filePath}.js`)).default;
|
|
19
|
-
|
|
20
|
-
if (!tailwindConfig) {
|
|
21
|
-
tailwindConfig = (await import(/* @vite-ignore */ `${filePath}.ts`)).default;
|
|
22
|
-
}
|
|
23
|
-
} catch {
|
|
24
|
-
tailwindConfig = {} as Config;
|
|
25
|
-
}
|
|
26
|
-
})();
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (isCSR) {
|
|
30
|
-
tailwindConfig = Object.values(
|
|
31
|
-
import.meta.glob(["/tailwind.config.{js,ts}", "/**/tailwind.config.{js,ts}"], {
|
|
32
|
-
eager: true,
|
|
33
|
-
import: "default",
|
|
34
|
-
}),
|
|
35
|
-
)[0] as Config;
|
|
36
|
-
}
|
|
File without changes
|
|
File without changes
|