@witchcraft/ui 0.4.0 → 0.4.2
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 +56 -61
- package/dist/module.d.mts +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +13 -9
- package/dist/runtime/assets/animations.css +1 -1
- package/dist/runtime/assets/locales/en.json +2 -0
- package/dist/runtime/assets/utils.css +1 -1
- package/dist/runtime/build/WitchcraftUiResolver.js +1 -2
- package/dist/runtime/components/TestControls/TestControls.d.vue.ts +2 -1
- package/dist/runtime/components/TestControls/TestControls.vue +3 -3
- package/dist/runtime/components/TestControls/TestControls.vue.d.ts +2 -1
- package/dist/runtime/components/WButton/WButton.d.vue.ts +34 -0
- package/dist/runtime/components/{LibButton/LibButton.vue → WButton/WButton.vue} +26 -38
- package/dist/runtime/components/WButton/WButton.vue.d.ts +34 -0
- package/dist/runtime/components/WCheckbox/WCheckbox.d.vue.ts +33 -0
- package/dist/runtime/components/WCheckbox/WCheckbox.vue +110 -0
- package/dist/runtime/components/WCheckbox/WCheckbox.vue.d.ts +33 -0
- package/dist/runtime/components/{LibColorInput/LibColorInput.d.vue.ts → WColorInput/WColorInput.d.vue.ts} +18 -36
- package/dist/runtime/components/WColorInput/WColorInput.vue +85 -0
- package/dist/runtime/components/{LibColorInput/LibColorInput.vue.d.ts → WColorInput/WColorInput.vue.d.ts} +18 -36
- package/dist/runtime/components/WColorInput/WColorSwatchButton.d.vue.ts +28 -0
- package/dist/runtime/components/WColorInput/WColorSwatchButton.vue +86 -0
- package/dist/runtime/components/WColorInput/WColorSwatchButton.vue.d.ts +28 -0
- package/dist/runtime/components/{LibColorPicker/LibColorPicker.d.vue.ts → WColorPicker/WColorPicker.d.vue.ts} +12 -9
- package/dist/runtime/components/{LibColorPicker/LibColorPicker.vue → WColorPicker/WColorPicker.vue} +41 -29
- package/dist/runtime/components/{LibColorPicker/LibColorPicker.vue.d.ts → WColorPicker/WColorPicker.vue.d.ts} +12 -9
- package/dist/runtime/components/WCombobox/WCombobox.d.vue.ts +111 -0
- package/dist/runtime/components/WCombobox/WCombobox.vue +405 -0
- package/dist/runtime/components/WCombobox/WCombobox.vue.d.ts +111 -0
- package/dist/runtime/components/WCombobox/storyPlays.d.ts +18 -0
- package/dist/runtime/components/WCombobox/storyPlays.js +68 -0
- package/dist/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.d.vue.ts → WDarkModeSwitcher/WDarkModeSwitcher.d.vue.ts} +9 -13
- package/dist/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.vue → WDarkModeSwitcher/WDarkModeSwitcher.vue} +11 -14
- package/dist/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.vue.d.ts → WDarkModeSwitcher/WDarkModeSwitcher.vue.d.ts} +9 -13
- package/dist/runtime/components/{LibDatePicker/LibDatePicker.d.vue.ts → WDatePicker/WDatePicker.d.vue.ts} +7 -7
- package/dist/runtime/components/{LibDatePicker/LibDatePicker.vue → WDatePicker/WDatePicker.vue} +3 -7
- package/dist/runtime/components/{LibDatePicker/LibDatePicker.vue.d.ts → WDatePicker/WDatePicker.vue.d.ts} +7 -7
- package/dist/runtime/components/WDatePicker/WRangeDatePicker.d.vue.ts +182 -0
- package/dist/runtime/components/{LibDatePicker/LibRangeDatePicker.vue → WDatePicker/WRangeDatePicker.vue} +29 -25
- package/dist/runtime/components/WDatePicker/WRangeDatePicker.vue.d.ts +182 -0
- package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.d.vue.ts → WDatePicker/WSingleDatePicker.d.vue.ts} +7 -5
- package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.vue → WDatePicker/WSingleDatePicker.vue} +21 -21
- package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.vue.d.ts → WDatePicker/WSingleDatePicker.vue.d.ts} +7 -5
- package/dist/runtime/components/WDatePicker/WTimeZonePicker.d.vue.ts +13 -0
- package/dist/runtime/components/{LibDatePicker/LibTimeZonePicker.vue → WDatePicker/WTimeZonePicker.vue} +5 -12
- package/dist/runtime/components/WDatePicker/WTimeZonePicker.vue.d.ts +13 -0
- package/dist/runtime/components/{LibDebug/LibDebug.d.vue.ts → WDebug/WDebug.d.vue.ts} +3 -2
- package/dist/runtime/components/{LibDebug/LibDebug.vue → WDebug/WDebug.vue} +10 -12
- package/dist/runtime/components/{LibDebug/LibDebug.vue.d.ts → WDebug/WDebug.vue.d.ts} +3 -2
- package/dist/runtime/components/{LibDevOnly/LibDevOnly.d.vue.ts → WDevOnly/WDevOnly.d.vue.ts} +3 -5
- package/dist/runtime/components/{LibDevOnly/LibDevOnly.vue.d.ts → WDevOnly/WDevOnly.vue.d.ts} +3 -5
- package/dist/runtime/components/WFileInput/WFileInput.d.vue.ts +58 -0
- package/dist/runtime/components/WFileInput/WFileInput.vue +348 -0
- package/dist/runtime/components/WFileInput/WFileInput.vue.d.ts +58 -0
- package/dist/runtime/components/WIcon/WIcon.d.vue.ts +18 -0
- package/dist/runtime/components/{Icon/Icon.vue → WIcon/WIcon.vue} +1 -1
- package/dist/runtime/components/WIcon/WIcon.vue.d.ts +18 -0
- package/dist/runtime/components/WMultiValues/WMultiValues.d.vue.ts +28 -0
- package/dist/runtime/components/WMultiValues/WMultiValues.vue +150 -0
- package/dist/runtime/components/WMultiValues/WMultiValues.vue.d.ts +28 -0
- package/dist/runtime/components/WNotifications/WNotification.d.vue.ts +37 -0
- package/dist/runtime/components/{LibNotifications/LibNotification.vue → WNotifications/WNotification.vue} +61 -35
- package/dist/runtime/components/WNotifications/WNotification.vue.d.ts +37 -0
- package/dist/runtime/components/WNotifications/WNotificationTestMessageComponent.d.vue.ts +7 -0
- package/dist/runtime/components/WNotifications/WNotificationTestMessageComponent.vue +29 -0
- package/dist/runtime/components/WNotifications/WNotificationTestMessageComponent.vue.d.ts +7 -0
- package/dist/runtime/components/WNotifications/WNotifications.d.vue.ts +11 -0
- package/dist/runtime/components/{LibNotifications/LibNotifications.vue → WNotifications/WNotifications.vue} +72 -36
- package/dist/runtime/components/WNotifications/WNotifications.vue.d.ts +11 -0
- package/dist/runtime/components/WNotifications/calculateNotificationProgress.d.ts +2 -0
- package/dist/runtime/components/WNotifications/calculateNotificationProgress.js +4 -0
- package/dist/runtime/components/WNumberInput/WNumberInput.d.vue.ts +27 -0
- package/dist/runtime/components/WNumberInput/WNumberInput.vue +96 -0
- package/dist/runtime/components/WNumberInput/WNumberInput.vue.d.ts +27 -0
- package/dist/runtime/components/WPagination/WPagination.d.vue.ts +59 -0
- package/dist/runtime/components/WPagination/WPagination.vue +182 -0
- package/dist/runtime/components/WPagination/WPagination.vue.d.ts +59 -0
- package/dist/runtime/components/WPalette/WPalette.d.vue.ts +11 -0
- package/dist/runtime/components/{LibPalette/LibPalette.vue → WPalette/WPalette.vue} +3 -8
- package/dist/runtime/components/WPalette/WPalette.vue.d.ts +11 -0
- package/dist/runtime/components/WPopover/WPopover.d.vue.ts +45 -0
- package/dist/runtime/components/WPopover/WPopover.vue +144 -0
- package/dist/runtime/components/WPopover/WPopover.vue.d.ts +45 -0
- package/dist/runtime/components/WPopup/WPopup.d.vue.ts +51 -0
- package/dist/runtime/components/WPopup/WPopup.vue +115 -0
- package/dist/runtime/components/WPopup/WPopup.vue.d.ts +51 -0
- package/dist/runtime/components/{LibProgressBar/LibProgressBar.d.vue.ts → WProgressBar/WProgressBar.d.vue.ts} +13 -16
- package/dist/runtime/components/WProgressBar/WProgressBar.vue +150 -0
- package/dist/runtime/components/{LibProgressBar/LibProgressBar.vue.d.ts → WProgressBar/WProgressBar.vue.d.ts} +13 -16
- package/dist/runtime/components/{LibRecorder/LibRecorder.d.vue.ts → WRecorder/WRecorder.d.vue.ts} +13 -27
- package/dist/runtime/components/{LibRecorder/LibRecorder.vue → WRecorder/WRecorder.vue} +37 -36
- package/dist/runtime/components/{LibRecorder/LibRecorder.vue.d.ts → WRecorder/WRecorder.vue.d.ts} +13 -27
- package/dist/runtime/components/{LibRoot/LibRoot.d.vue.ts → WRoot/WRoot.d.vue.ts} +11 -9
- package/dist/runtime/components/{LibRoot/LibRoot.vue → WRoot/WRoot.vue} +17 -15
- package/dist/runtime/components/{LibRoot/LibRoot.vue.d.ts → WRoot/WRoot.vue.d.ts} +11 -9
- package/dist/runtime/components/WSimpleInput/WSimpleInput.d.vue.ts +34 -0
- package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.vue → WSimpleInput/WSimpleInput.vue} +14 -24
- package/dist/runtime/components/WSimpleInput/WSimpleInput.vue.d.ts +34 -0
- package/dist/runtime/components/WTable/WTable.d.vue.ts +102 -0
- package/dist/runtime/components/WTable/WTable.vue +370 -0
- package/dist/runtime/components/WTable/WTable.vue.d.ts +102 -0
- package/dist/runtime/components/WTooltip/WTooltip.d.vue.ts +40 -0
- package/dist/runtime/components/WTooltip/WTooltip.vue +112 -0
- package/dist/runtime/components/WTooltip/WTooltip.vue.d.ts +40 -0
- package/dist/runtime/components/index.d.ts +20 -20
- package/dist/runtime/components/index.js +20 -20
- package/dist/runtime/composables/index.d.ts +4 -4
- package/dist/runtime/composables/index.js +4 -4
- package/dist/runtime/composables/useDelayedLoadingIndicator.d.ts +9 -0
- package/dist/runtime/composables/useDelayedLoadingIndicator.js +18 -0
- package/dist/runtime/composables/useDisplayForReka.d.ts +25 -0
- package/dist/runtime/composables/useDisplayForReka.js +16 -0
- package/dist/runtime/composables/useFallbackId.d.ts +3 -0
- package/dist/runtime/composables/useFallbackId.js +5 -0
- package/dist/runtime/composables/useInjectedDarkMode.d.ts +1 -1
- package/dist/runtime/composables/usePopupConstrainToStyle.d.ts +8 -0
- package/dist/runtime/composables/usePopupConstrainToStyle.js +8 -0
- package/dist/runtime/composables/useSetupDarkMode.d.ts +2 -3
- package/dist/runtime/composables/useSetupDarkMode.js +90 -4
- package/dist/runtime/composables/useTimeConditionally.d.ts +16 -0
- package/dist/runtime/composables/useTimeConditionally.js +27 -0
- package/dist/runtime/directives/vResizableCols.js +101 -34
- package/dist/runtime/helpers/NotificationHandler.d.ts +28 -3
- package/dist/runtime/helpers/NotificationHandler.js +7 -10
- package/dist/runtime/injectionKeys.d.ts +1 -5
- package/dist/runtime/injectionKeys.js +0 -2
- package/dist/runtime/types/index.d.ts +97 -31
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/utils/notifyIfError.d.ts +3 -1
- package/dist/runtime/utils/notifyIfError.js +4 -2
- package/dist/runtime/utils/twMerge.d.ts +1 -0
- package/dist/runtime/utils/twMerge.js +2 -1
- package/package.json +59 -56
- package/src/module.ts +16 -8
- package/src/runtime/assets/animations.css +53 -6
- package/src/runtime/assets/locales/en.json +2 -0
- package/src/runtime/assets/tailwind.css +1 -1
- package/src/runtime/assets/utils.css +52 -4
- package/src/runtime/build/WitchcraftUiResolver.ts +1 -2
- package/src/runtime/components/TestControls/TestControls.vue +3 -3
- package/src/runtime/components/WButton/WButton.stories.ts +112 -0
- package/src/runtime/components/{LibButton/LibButton.vue → WButton/WButton.vue} +34 -50
- package/src/runtime/components/{LibCheckbox/LibCheckbox.stories.ts → WCheckbox/WCheckbox.stories.ts} +5 -5
- package/src/runtime/components/WCheckbox/WCheckbox.vue +125 -0
- package/src/runtime/components/{LibColorInput/LibColorInput.stories.ts → WColorInput/WColorInput.stories.ts} +8 -8
- package/src/runtime/components/WColorInput/WColorInput.vue +112 -0
- package/src/runtime/components/WColorInput/WColorSwatchButton.vue +102 -0
- package/src/runtime/components/{LibColorPicker/LibColorPicker.stories.ts → WColorPicker/WColorPicker.stories.ts} +12 -12
- package/src/runtime/components/{LibColorPicker/LibColorPicker.vue → WColorPicker/WColorPicker.vue} +44 -31
- package/src/runtime/components/WCombobox/WCombobox.stories.ts +209 -0
- package/src/runtime/components/WCombobox/WCombobox.vue +450 -0
- package/src/runtime/components/WCombobox/storyPlays.ts +92 -0
- package/src/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.stories.ts → WDarkModeSwitcher/WDarkModeSwitcher.stories.ts} +6 -6
- package/src/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.vue → WDarkModeSwitcher/WDarkModeSwitcher.vue} +19 -30
- package/src/runtime/components/{LibDatePicker/LibDatePicker.stories.ts → WDatePicker/WDatePicker.stories.ts} +42 -34
- package/src/runtime/components/{LibDatePicker/LibDatePicker.vue → WDatePicker/WDatePicker.vue} +3 -7
- package/src/runtime/components/{LibDatePicker/LibRangeDatePicker.vue → WDatePicker/WRangeDatePicker.vue} +29 -25
- package/src/runtime/components/{LibDatePicker/LibSingleDatePicker.vue → WDatePicker/WSingleDatePicker.vue} +21 -21
- package/src/runtime/components/{LibDatePicker/LibTimeZonePicker.vue → WDatePicker/WTimeZonePicker.vue} +5 -12
- package/src/runtime/components/{LibDebug/LibDebug.stories.ts → WDebug/WDebug.stories.ts} +5 -5
- package/src/runtime/components/{LibDebug/LibDebug.vue → WDebug/WDebug.vue} +9 -10
- package/src/runtime/components/{LibDevOnly/LibDevOnly.vue → WDevOnly/WDevOnly.vue} +0 -4
- package/src/runtime/components/{LibFileInput/LibFileInput.stories.ts → WFileInput/WFileInput.stories.ts} +20 -10
- package/src/runtime/components/WFileInput/WFileInput.vue +392 -0
- package/src/runtime/components/{Icon/Icon.vue → WIcon/WIcon.vue} +5 -8
- package/src/runtime/components/{LibMultiValues/LibMultiValues.stories.ts → WMultiValues/WMultiValues.stories.ts} +9 -9
- package/src/runtime/components/WMultiValues/WMultiValues.vue +163 -0
- package/src/runtime/components/{LibNotifications/LibNotification.stories.ts → WNotifications/WNotification.stories.ts} +42 -6
- package/src/runtime/components/{LibNotifications/LibNotification.vue → WNotifications/WNotification.vue} +72 -45
- package/src/runtime/components/WNotifications/WNotificationTestMessageComponent.vue +27 -0
- package/src/runtime/components/WNotifications/WNotifications.stories.ts +139 -0
- package/src/runtime/components/{LibNotifications/LibNotifications.vue → WNotifications/WNotifications.vue} +87 -47
- package/src/runtime/components/WNotifications/calculateNotificationProgress.ts +8 -0
- package/src/runtime/components/WNumberInput/WNumberInput.vue +109 -0
- package/src/runtime/components/WPagination/WPagination.stories.ts +51 -0
- package/src/runtime/components/WPagination/WPagination.vue +207 -0
- package/src/runtime/components/{LibPalette/LibPalette.stories.ts → WPalette/WPalette.stories.ts} +6 -6
- package/src/runtime/components/{LibPalette/LibPalette.vue → WPalette/WPalette.vue} +3 -8
- package/src/runtime/components/WPopover/WPopover.stories.ts +218 -0
- package/src/runtime/components/WPopover/WPopover.vue +168 -0
- package/src/runtime/components/WPopup/WPopup.stories.ts +104 -0
- package/src/runtime/components/WPopup/WPopup.vue +134 -0
- package/src/runtime/components/WProgressBar/WProgressBar.stories.ts +119 -0
- package/src/runtime/components/WProgressBar/WProgressBar.vue +185 -0
- package/src/runtime/components/{LibRecorder/LibRecorder.stories.ts → WRecorder/WRecorder.stories.ts} +9 -6
- package/src/runtime/components/{LibRecorder/LibRecorder.vue → WRecorder/WRecorder.vue} +69 -68
- package/src/runtime/components/{LibRoot/LibRoot.vue → WRoot/WRoot.vue} +18 -15
- package/src/runtime/components/{LibSimpleInput/LibSimpleInput.stories.ts → WSimpleInput/WSimpleInput.stories.ts} +11 -12
- package/src/runtime/components/{LibSimpleInput/LibSimpleInput.vue → WSimpleInput/WSimpleInput.vue} +28 -42
- package/src/runtime/components/WTable/WTable.stories.ts +334 -0
- package/src/runtime/components/WTable/WTable.vue +471 -0
- package/src/runtime/components/WTooltip/WTooltip.stories.ts +82 -0
- package/src/runtime/components/WTooltip/WTooltip.vue +128 -0
- package/src/runtime/components/index.ts +20 -20
- package/src/runtime/composables/index.ts +4 -4
- package/src/runtime/composables/useDelayedLoadingIndicator.ts +30 -0
- package/src/runtime/composables/useDisplayForReka.ts +37 -0
- package/src/runtime/composables/useFallbackId.ts +6 -0
- package/src/runtime/composables/useInjectedDarkMode.ts +1 -2
- package/src/runtime/composables/usePopupConstrainToStyle.ts +29 -0
- package/src/runtime/composables/useSetupDarkMode.ts +122 -4
- package/src/runtime/composables/useTimeConditionally.ts +51 -0
- package/src/runtime/directives/vResizableCols.ts +121 -38
- package/src/runtime/helpers/NotificationHandler.ts +30 -11
- package/src/runtime/injectionKeys.ts +1 -7
- package/src/runtime/types/index.ts +118 -36
- package/src/runtime/utils/notifyIfError.ts +6 -2
- package/src/runtime/utils/twMerge.ts +2 -1
- package/types/components.d.ts +14 -15
- package/dist/runtime/components/Aria/Aria.d.vue.ts +0 -5
- package/dist/runtime/components/Aria/Aria.vue +0 -16
- package/dist/runtime/components/Aria/Aria.vue.d.ts +0 -5
- package/dist/runtime/components/Icon/Icon.d.vue.ts +0 -21
- package/dist/runtime/components/Icon/Icon.vue.d.ts +0 -21
- package/dist/runtime/components/LibButton/LibButton.d.vue.ts +0 -36
- package/dist/runtime/components/LibButton/LibButton.vue.d.ts +0 -36
- package/dist/runtime/components/LibCheckbox/LibCheckbox.d.vue.ts +0 -42
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +0 -103
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +0 -42
- package/dist/runtime/components/LibColorInput/LibColorInput.vue +0 -162
- package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.d.vue.ts +0 -34
- package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue.d.ts +0 -34
- package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.d.vue.ts +0 -22
- package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue.d.ts +0 -22
- package/dist/runtime/components/LibFileInput/LibFileInput.d.vue.ts +0 -43
- package/dist/runtime/components/LibFileInput/LibFileInput.vue +0 -274
- package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +0 -43
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.d.vue.ts +0 -165
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -387
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue.d.ts +0 -165
- package/dist/runtime/components/LibLabel/LibLabel.d.vue.ts +0 -26
- package/dist/runtime/components/LibLabel/LibLabel.vue +0 -45
- package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +0 -26
- package/dist/runtime/components/LibMultiValues/LibMultiValues.d.vue.ts +0 -29
- package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +0 -109
- package/dist/runtime/components/LibMultiValues/LibMultiValues.vue.d.ts +0 -29
- package/dist/runtime/components/LibNotifications/LibNotification.d.vue.ts +0 -30
- package/dist/runtime/components/LibNotifications/LibNotification.vue.d.ts +0 -30
- package/dist/runtime/components/LibNotifications/LibNotifications.d.vue.ts +0 -13
- package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +0 -13
- package/dist/runtime/components/LibPagination/LibPagination.d.vue.ts +0 -104
- package/dist/runtime/components/LibPagination/LibPagination.vue +0 -229
- package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +0 -104
- package/dist/runtime/components/LibPalette/LibPalette.d.vue.ts +0 -14
- package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +0 -14
- package/dist/runtime/components/LibPopup/LibPopup.d.vue.ts +0 -46
- package/dist/runtime/components/LibPopup/LibPopup.vue +0 -365
- package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +0 -46
- package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +0 -169
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.d.vue.ts +0 -35
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue.d.ts +0 -35
- package/dist/runtime/components/LibSuggestions/LibSuggestions.d.vue.ts +0 -94
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +0 -178
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +0 -94
- package/dist/runtime/components/LibTable/LibTable.d.vue.ts +0 -45
- package/dist/runtime/components/LibTable/LibTable.vue +0 -155
- package/dist/runtime/components/LibTable/LibTable.vue.d.ts +0 -45
- package/dist/runtime/components/Template/NAME.d.vue.ts +0 -17
- package/dist/runtime/components/Template/NAME.vue +0 -27
- package/dist/runtime/components/Template/NAME.vue.d.ts +0 -17
- package/dist/runtime/components/Template/TemplateStory.d.ts +0 -7
- package/dist/runtime/components/Template/TemplateStory.js +0 -22
- package/dist/runtime/components/shared/props.d.ts +0 -171
- package/dist/runtime/components/shared/props.js +0 -2
- package/dist/runtime/composables/useAriaLabel.d.ts +0 -6
- package/dist/runtime/composables/useAriaLabel.js +0 -15
- package/dist/runtime/composables/useDarkMode.d.ts +0 -77
- package/dist/runtime/composables/useDarkMode.js +0 -89
- package/dist/runtime/composables/useDivideAttrs.d.ts +0 -27
- package/dist/runtime/composables/useDivideAttrs.js +0 -27
- package/dist/runtime/composables/useSuggestions.d.ts +0 -40
- package/dist/runtime/composables/useSuggestions.js +0 -263
- package/src/runtime/components/Aria/Aria.vue +0 -26
- package/src/runtime/components/LibButton/LibButton.stories.ts +0 -106
- package/src/runtime/components/LibCheckbox/LibCheckbox.vue +0 -129
- package/src/runtime/components/LibColorInput/LibColorInput.vue +0 -203
- package/src/runtime/components/LibFileInput/LibFileInput.vue +0 -320
- package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.ts +0 -405
- package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -414
- package/src/runtime/components/LibLabel/LibLabel.stories.ts +0 -33
- package/src/runtime/components/LibLabel/LibLabel.vue +0 -65
- package/src/runtime/components/LibMultiValues/LibMultiValues.vue +0 -123
- package/src/runtime/components/LibNotifications/LibNotifications.stories.ts +0 -120
- package/src/runtime/components/LibPagination/LibPagination.stories.ts +0 -49
- package/src/runtime/components/LibPagination/LibPagination.vue +0 -274
- package/src/runtime/components/LibPopup/LibPopup.stories.ts +0 -153
- package/src/runtime/components/LibPopup/LibPopup.vue +0 -396
- package/src/runtime/components/LibProgressBar/LibProgressBar.stories.ts +0 -90
- package/src/runtime/components/LibProgressBar/LibProgressBar.vue +0 -197
- package/src/runtime/components/LibSuggestions/LibSuggestions.stories.ts +0 -134
- package/src/runtime/components/LibSuggestions/LibSuggestions.vue +0 -212
- package/src/runtime/components/LibTable/LibTable.stories.ts +0 -167
- package/src/runtime/components/LibTable/LibTable.vue +0 -190
- package/src/runtime/components/Template/NAME.vue +0 -49
- package/src/runtime/components/Template/TemplateStory.ts +0 -37
- package/src/runtime/components/shared/props.ts +0 -199
- package/src/runtime/composables/useAriaLabel.ts +0 -23
- package/src/runtime/composables/useDarkMode.ts +0 -199
- package/src/runtime/composables/useDivideAttrs.ts +0 -53
- package/src/runtime/composables/useSuggestions.ts +0 -339
- /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToHsva.d.ts +0 -0
- /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToHsva.js +0 -0
- /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToRgba.d.ts +0 -0
- /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToRgba.js +0 -0
- /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/toLowPrecisionRgbaString.d.ts +0 -0
- /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/toLowPrecisionRgbaString.js +0 -0
- /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/truncate.d.ts +0 -0
- /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/truncate.js +0 -0
- /package/dist/runtime/components/{LibDatePicker → WDatePicker}/helpers.d.ts +0 -0
- /package/dist/runtime/components/{LibDatePicker → WDatePicker}/helpers.js +0 -0
- /package/dist/runtime/components/{LibDevOnly/LibDevOnly.vue → WDevOnly/WDevOnly.vue} +0 -0
- /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToHsva.ts +0 -0
- /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToRgba.ts +0 -0
- /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/toLowPrecisionRgbaString.ts +0 -0
- /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/truncate.ts +0 -0
- /package/src/runtime/components/{LibDatePicker → WDatePicker}/helpers.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AnyFunction, MakeRequired } from "@alanscodelog/utils";
|
|
2
|
-
import { type Reactive } from "vue";
|
|
2
|
+
import { type Component, type Reactive } from "vue";
|
|
3
3
|
export declare class NotificationHandler<TRawEntry extends RawNotificationEntry<any, any> = RawNotificationEntry<any, any>, TEntry extends NotificationEntry<TRawEntry> = NotificationEntry<TRawEntry>> {
|
|
4
4
|
timeout: number;
|
|
5
5
|
debug: boolean;
|
|
@@ -26,21 +26,46 @@ export declare class NotificationHandler<TRawEntry extends RawNotificationEntry<
|
|
|
26
26
|
}
|
|
27
27
|
export type NotificationPromise<TOption extends string = string> = Promise<TOption>;
|
|
28
28
|
export type RawNotificationEntry<TOptions extends string[] = ["Ok", "Cancel"], TCancellable extends boolean | TOptions[number] = "Cancel"> = {
|
|
29
|
-
message: string;
|
|
30
29
|
title?: string;
|
|
31
30
|
code?: string;
|
|
32
31
|
/** @default ["Ok", "Cancel"] */
|
|
33
32
|
options?: TOptions;
|
|
34
33
|
/** @default false */
|
|
35
34
|
requiresAction?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* If true or a string (the cancel option) ensures the option exists and that is the "default" cancel action when a notification is dismissed in some manner that is not clicking one of the options (escaped, background click, etc.).
|
|
37
|
+
*
|
|
38
|
+
* This also enables cancelling via those secondary methods, otherwise the notification won't allow itself to be dismissed.
|
|
39
|
+
*
|
|
40
|
+
* @default undefined / false
|
|
41
|
+
*/
|
|
36
42
|
cancellable?: TCancellable;
|
|
37
43
|
/** @default "Ok" */
|
|
38
44
|
default?: TOptions[number];
|
|
39
45
|
/** @default [] */
|
|
40
46
|
dangerous?: TOptions[number][];
|
|
41
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Overrides the default timeout, can be set to true to just enable it. An entry must be cancellable to have a timeout.
|
|
49
|
+
*
|
|
50
|
+
* @default global timeout / false if cancellable is false
|
|
51
|
+
*/
|
|
42
52
|
timeout?: number | boolean;
|
|
43
53
|
icon?: string;
|
|
54
|
+
message: string;
|
|
55
|
+
component?: string | Component;
|
|
56
|
+
/** Props for the custom component. By default the component is passed the message, the messageClasses, and the full notification. Both will be overriden if you set them on componentProps. */
|
|
57
|
+
componentProps?: Record<string, any> & Partial<{
|
|
58
|
+
notification: NotificationEntry;
|
|
59
|
+
message: string;
|
|
60
|
+
messageClasses: string;
|
|
61
|
+
}>;
|
|
62
|
+
/**
|
|
63
|
+
* Attributes for the notification component itself. They are bound to the root of the element and the class property is merged with twMerge.
|
|
64
|
+
*
|
|
65
|
+
* The most likely use is needing to adjust the width of fullscreen notifications, but fullscreen notifications have two widths (one for big screens and one for small ones (sm). You will usually want to do something like `{notificationProps: {class: 'sm:max-w-[90dvw]'}}` to change only the large one.
|
|
66
|
+
*
|
|
67
|
+
*/
|
|
68
|
+
notificationAttrs?: Record<string, any>;
|
|
44
69
|
};
|
|
45
70
|
export type NotificationEntry<TRawEntry extends RawNotificationEntry<any, any> = RawNotificationEntry<any, any>> = Omit<MakeRequired<TRawEntry, "options" | "requiresAction" | "default" | "dangerous">, "cancellable"> & {
|
|
46
71
|
promise: NotificationPromise;
|
|
@@ -4,7 +4,7 @@ import { indent } from "@alanscodelog/utils/indent";
|
|
|
4
4
|
import { isBlank } from "@alanscodelog/utils/isBlank";
|
|
5
5
|
import { pretty } from "@alanscodelog/utils/pretty";
|
|
6
6
|
import { setReadOnly } from "@alanscodelog/utils/setReadOnly";
|
|
7
|
-
import { reactive } from "vue";
|
|
7
|
+
import { markRaw, reactive } from "vue";
|
|
8
8
|
export class NotificationHandler {
|
|
9
9
|
timeout = 5e3;
|
|
10
10
|
debug = false;
|
|
@@ -57,13 +57,6 @@ export class NotificationHandler {
|
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
if (entry.timeout !== void 0 && !entry.cancellable) {
|
|
61
|
-
throw new Error(
|
|
62
|
-
crop`Cannot timeout notification that is not cancellable:
|
|
63
|
-
${indent(pretty(entry), 5)}
|
|
64
|
-
`
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
60
|
if (entry.timeout !== void 0 && entry.requiresAction) {
|
|
68
61
|
throw new Error(
|
|
69
62
|
crop`Cannot timeout notification that requires action:
|
|
@@ -85,8 +78,8 @@ export class NotificationHandler {
|
|
|
85
78
|
requiresAction: false,
|
|
86
79
|
options: ["Ok", "Cancel"],
|
|
87
80
|
default: "Ok",
|
|
88
|
-
cancellable: rawEntry.cancellable,
|
|
89
81
|
...rawEntry,
|
|
82
|
+
component: rawEntry.component && typeof rawEntry.component !== "string" ? markRaw(rawEntry.component) : void 0,
|
|
90
83
|
dangerous: rawEntry.dangerous ?? [],
|
|
91
84
|
timeout: rawEntry.timeout === true ? this.timeout : rawEntry.timeout !== void 0 && rawEntry.timeout !== false ? rawEntry.timeout : void 0
|
|
92
85
|
};
|
|
@@ -152,7 +145,11 @@ export class NotificationHandler {
|
|
|
152
145
|
const remaining = notification.timeout - notification._timer.elapsedBeforePause;
|
|
153
146
|
clearTimeout(notification._timer.id);
|
|
154
147
|
notification._timer.id = setTimeout(() => {
|
|
155
|
-
|
|
148
|
+
if (notification.cancellable) {
|
|
149
|
+
notification.resolve(notification.cancellable);
|
|
150
|
+
} else {
|
|
151
|
+
notification.resolve(notification.default);
|
|
152
|
+
}
|
|
156
153
|
}, remaining);
|
|
157
154
|
}
|
|
158
155
|
static resolveToDefault(notification) {
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type { InjectionKey, Ref } from "vue";
|
|
2
|
-
import type { DarkModeCommands, DarkModeState } from "./composables/useDarkMode.js";
|
|
3
2
|
import type { TranslationFunction } from "./composables/useSetupI18n.js";
|
|
4
|
-
|
|
5
|
-
export declare const isDarkModeInjectionKey: InjectionKey<Ref<boolean>>;
|
|
6
|
-
/** @deprecated */
|
|
7
|
-
export declare const manualDarkModeInjectionKey: InjectionKey<Ref<boolean | undefined>>;
|
|
3
|
+
import type { DarkModeCommands, DarkModeState } from "./types/index.js";
|
|
8
4
|
export declare const darkModeCommandsInjectionKey: InjectionKey<DarkModeCommands>;
|
|
9
5
|
export declare const darkModeStateInjectionKey: InjectionKey<DarkModeState>;
|
|
10
6
|
export declare const languageLocaleInjectionKey: InjectionKey<Ref<string>>;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export const isDarkModeInjectionKey = Symbol("isDarkMode");
|
|
2
|
-
export const manualDarkModeInjectionKey = Symbol("manualDarkMode");
|
|
3
1
|
export const darkModeCommandsInjectionKey = Symbol("darkModeCommands");
|
|
4
2
|
export const darkModeStateInjectionKey = Symbol("darkModeState");
|
|
5
3
|
export const languageLocaleInjectionKey = Symbol("witchcraftUiLanguageLocale");
|
|
@@ -2,9 +2,7 @@ import type { ErrorW } from "@alanscodelog/utils";
|
|
|
2
2
|
import type { Ref } from "vue";
|
|
3
3
|
export type ResizableOptions = {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* ### true
|
|
5
|
+
* ### true (default)
|
|
8
6
|
* The directive will shrink/expand the columns when the table is resized and will use percentage widths on the table cells. This disables resizing of the last column (from the right handle).
|
|
9
7
|
*
|
|
10
8
|
* Additionally because of the way `table-layout:fixed` works, a min-width cannot be set on the elements via css, so instead, if the table shrinks past `opts.margin * col #`, `min-width` is set on the table until it's resized larger.
|
|
@@ -16,6 +14,8 @@ export type ResizableOptions = {
|
|
|
16
14
|
* The table can be resized past it's normal width and uses pixel widths on the table cells. You might want to set `overscroll-x: scroll` on a parent wrapping element.
|
|
17
15
|
*
|
|
18
16
|
* This will set the table width to `min-content`, else it doesn't work. Note that it does this after the initial reading/setting of sizes so you can, for example, layout the table with `width: 100%`.
|
|
17
|
+
*
|
|
18
|
+
* @default true
|
|
19
19
|
*/
|
|
20
20
|
fitWidth: boolean;
|
|
21
21
|
/**
|
|
@@ -40,8 +40,12 @@ export type ResizableOptions = {
|
|
|
40
40
|
* It can then be used as needed by the component.
|
|
41
41
|
*/
|
|
42
42
|
widths: Ref<string[]>;
|
|
43
|
-
/** The selector to use for the cells. "tr >
|
|
43
|
+
/** The selector to use for the header cells. "tr > th" by default. */
|
|
44
44
|
selector: string;
|
|
45
|
+
/** Is called just after the `resizable-cols-setup` class is added. Can be useful for controlling the styling of wrappers or doing additional things post-setup. The default table element uses it to set the class on the wrapper also. */
|
|
46
|
+
onSetup?: (el: Element) => void;
|
|
47
|
+
/** Is called on teardown (after the `resizable-cols-setup` class is removed). */
|
|
48
|
+
onTeardown?: (el: Element) => void;
|
|
45
49
|
};
|
|
46
50
|
export type TableColConfig<T = {}> = Record<keyof T, {
|
|
47
51
|
name?: string;
|
|
@@ -91,35 +95,97 @@ export type ScrollNearContainerEdgesOptions = {
|
|
|
91
95
|
timerInterval?: number;
|
|
92
96
|
};
|
|
93
97
|
export type SimpleDOMRect = Omit<DOMRect, "toJSON">;
|
|
94
|
-
export interface IPopupReference {
|
|
95
|
-
getBoundingClientRect: () => SimpleDOMRect;
|
|
96
|
-
}
|
|
97
|
-
export type PopupPosition = {
|
|
98
|
-
x: number;
|
|
99
|
-
y: number;
|
|
100
|
-
maxWidth?: number;
|
|
101
|
-
maxHeight?: number;
|
|
102
|
-
};
|
|
103
|
-
export type PopupSpaceInfo = {
|
|
104
|
-
left: number;
|
|
105
|
-
right: number;
|
|
106
|
-
leftLeft: number;
|
|
107
|
-
rightRight: number;
|
|
108
|
-
leftFromCenter: number;
|
|
109
|
-
rightFromCenter: number;
|
|
110
|
-
topFromCenter: number;
|
|
111
|
-
bottomFromCenter: number;
|
|
112
|
-
top: number;
|
|
113
|
-
bottom: number;
|
|
114
|
-
};
|
|
115
|
-
export type PopupPositioner = (
|
|
116
|
-
/** Reference is only undefined, if you did not specify a button element or use the exposed setReference. The function is still called, because there are other ways you might want to still position the popup (e.g. center-screen or some similar variation). */
|
|
117
|
-
reference: SimpleDOMRect | undefined, popup: SimpleDOMRect | DOMRect, bg: SimpleDOMRect | DOMRect, space: PopupSpaceInfo) => number;
|
|
118
|
-
export type PopupPositionModifier = (pos: PopupPosition,
|
|
119
|
-
/** This will only be called with the reference element as undefined when one of the preferred positions is center-screen or it's a function. */
|
|
120
|
-
reference: SimpleDOMRect | undefined, popup: SimpleDOMRect | DOMRect, bg: SimpleDOMRect | DOMRect, space: PopupSpaceInfo) => PopupPosition;
|
|
121
98
|
export type SingleDate = Date | undefined;
|
|
122
99
|
export type RangeDate = {
|
|
123
100
|
start?: SingleDate;
|
|
124
101
|
end?: SingleDate;
|
|
125
102
|
};
|
|
103
|
+
export type CustomNotificationComponentProps = {
|
|
104
|
+
message: string;
|
|
105
|
+
messageClasses?: string;
|
|
106
|
+
};
|
|
107
|
+
export type BaseInteractiveProps = {
|
|
108
|
+
/** Default is false. */
|
|
109
|
+
disabled?: boolean;
|
|
110
|
+
/** Default is false. */
|
|
111
|
+
readonly?: boolean;
|
|
112
|
+
/** Default is true. */
|
|
113
|
+
border?: boolean;
|
|
114
|
+
/** Removes styles from the component. Default is false. */
|
|
115
|
+
unstyle?: boolean;
|
|
116
|
+
};
|
|
117
|
+
export type TailwindClassProp = {
|
|
118
|
+
/** Tailwind classes. */
|
|
119
|
+
class?: string | false;
|
|
120
|
+
};
|
|
121
|
+
export declare const defaultDarkModeOrder: readonly ["system", "dark", "light"];
|
|
122
|
+
export type DarkModeOptions = {
|
|
123
|
+
useLocalStorage?: boolean | string;
|
|
124
|
+
darkModeOrder?: readonly ("system" | "dark" | "light")[];
|
|
125
|
+
/** True by default, should be passed import.meta.client if using nuxt, or false when running server side. */
|
|
126
|
+
isClientSide?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Whether to use the view transition to animate the dark mode switch (you just need to add the css).
|
|
129
|
+
*
|
|
130
|
+
* Note that the transitition is NOT triggered if visually the mode does not change (e.g. system mode is dark and the user switches from system to dark, visually nothing changes so transitioning is skipped).
|
|
131
|
+
*
|
|
132
|
+
* There is an example in storybook. But basically:
|
|
133
|
+
*
|
|
134
|
+
* ```css
|
|
135
|
+
*
|
|
136
|
+
* #root { // the dark mode switcher works on the WRoot component not the html root
|
|
137
|
+
* view-transition-name: wroot;
|
|
138
|
+
* height: 100dvh;
|
|
139
|
+
* padding: 0;
|
|
140
|
+
* }
|
|
141
|
+
*
|
|
142
|
+
* ::view-transition-new(wroot) {
|
|
143
|
+
* animation: grow var(--story-anim-length) ease-in-out;
|
|
144
|
+
* animation-fill-mode: both;
|
|
145
|
+
* z-index: 2;
|
|
146
|
+
* mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><circle cx="20" cy="20" r="20" fill="white"/></svg>') center / 0 no-repeat;
|
|
147
|
+
* }
|
|
148
|
+
*
|
|
149
|
+
* ::view-transition-old(wroot) {
|
|
150
|
+
* animation: none;
|
|
151
|
+
* animation-fill-mode: both;
|
|
152
|
+
* z-index: 1;
|
|
153
|
+
* }
|
|
154
|
+
*
|
|
155
|
+
* @keyframes grow {
|
|
156
|
+
* from {
|
|
157
|
+
* mask-size: 0dvw;
|
|
158
|
+
* }
|
|
159
|
+
* to {
|
|
160
|
+
* mask-size: 300dvw;
|
|
161
|
+
* }
|
|
162
|
+
* }
|
|
163
|
+
* ```
|
|
164
|
+
*
|
|
165
|
+
* See https://theme-toggle.rdsx.dev/ for more ideas.
|
|
166
|
+
*
|
|
167
|
+
* @default true
|
|
168
|
+
*/
|
|
169
|
+
useViewTransition?: boolean;
|
|
170
|
+
};
|
|
171
|
+
export interface DarkModeCommands {
|
|
172
|
+
setDarkMode: (value: "dark" | "light" | "system") => void;
|
|
173
|
+
cycleDarkMode: () => void;
|
|
174
|
+
}
|
|
175
|
+
export interface DarkModeState {
|
|
176
|
+
/** Whether the dark mode should be enabled or not */
|
|
177
|
+
darkMode: Ref<boolean>;
|
|
178
|
+
/** The current state of the darkMode but as a string (dark, light, system) */
|
|
179
|
+
darkModeState: Ref<"dark" | "light" | "system">;
|
|
180
|
+
/** The value of the manuably controllable dark mode. You can set this to true/false or undefined to allow the systemDarkMode to take priority. Alternatively use setDarkMode instead. */
|
|
181
|
+
manualDarkMode: Ref<boolean | undefined>;
|
|
182
|
+
/** The value of the system dark mode. This is automatically set depending on the user's `prefer-color-scheme` and should not be set directly. */
|
|
183
|
+
systemDarkMode: Ref<boolean>;
|
|
184
|
+
}
|
|
185
|
+
export type PopupConstrainToProps = {
|
|
186
|
+
constrainWidthTo?: number | "trigger" | "available" | string | null;
|
|
187
|
+
constrainHeightTo?: number | "trigger" | "available" | string | null;
|
|
188
|
+
};
|
|
189
|
+
export type EmitsToProps<T> = {
|
|
190
|
+
[K in keyof T as K extends string ? `on${Capitalize<K>}` : never]?: T[K] extends (...args: infer Args) => any ? (...args: Args) => void : T[K] extends any[] ? (...args: T[K]) => void : T[K];
|
|
191
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const defaultDarkModeOrder = ["system", "dark", "light"];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { NotificationEntry } from "../helpers/NotificationHandler.js";
|
|
1
2
|
/**
|
|
2
3
|
* Notifies the user if the given value is an error. Useful for making non-critical errors don't go unnoticed.
|
|
3
4
|
*
|
|
@@ -5,10 +6,11 @@
|
|
|
5
6
|
*
|
|
6
7
|
* If the value is not an error, it is returned.
|
|
7
8
|
*/
|
|
8
|
-
export declare function notifyIfError<T>(err: T, { logger, ns, force }?: {
|
|
9
|
+
export declare function notifyIfError<T>(err: T, { logger, ns, force, entry }?: {
|
|
9
10
|
logger?: {
|
|
10
11
|
debug: (...args: any[]) => void;
|
|
11
12
|
};
|
|
12
13
|
ns?: string;
|
|
13
14
|
force?: boolean;
|
|
15
|
+
entry?: Partial<NotificationEntry<any>>;
|
|
14
16
|
}): T;
|
|
@@ -3,7 +3,8 @@ import { useNotificationHandler } from "../composables/useNotificationHandler.js
|
|
|
3
3
|
export function notifyIfError(err, {
|
|
4
4
|
logger,
|
|
5
5
|
ns,
|
|
6
|
-
force = false
|
|
6
|
+
force = false,
|
|
7
|
+
entry
|
|
7
8
|
} = {}) {
|
|
8
9
|
if (force || err instanceof Error) {
|
|
9
10
|
const errMessage = {
|
|
@@ -22,7 +23,8 @@ export function notifyIfError(err, {
|
|
|
22
23
|
...errMessage,
|
|
23
24
|
options: ["Ok"],
|
|
24
25
|
cancellable: "Ok",
|
|
25
|
-
timeout: true
|
|
26
|
+
timeout: true,
|
|
27
|
+
...entry
|
|
26
28
|
});
|
|
27
29
|
}
|
|
28
30
|
return err;
|
|
@@ -2,7 +2,8 @@ import { extendTailwindMerge } from "tailwind-merge";
|
|
|
2
2
|
const _twMergeExtend = {
|
|
3
3
|
extend: {
|
|
4
4
|
classGroups: {
|
|
5
|
-
"focus-outline": [{ "focus-outline": ["", "no-offset", "none"] }]
|
|
5
|
+
"focus-outline": [{ "focus-outline": ["", "no-offset", "none"] }],
|
|
6
|
+
"no-truncate": ["truncate", "no-truncate"]
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
9
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@witchcraft/ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Vue component library.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/runtime/main.lib.js",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"./utils.css": "./src/runtime/assets/utils.css",
|
|
34
34
|
"./base.css": "./src/runtime/assets/base.css",
|
|
35
|
+
"./animations.css": "./src/runtime/assets/animations.css",
|
|
35
36
|
"./nuxt": {
|
|
36
37
|
"types": "./dist/types.d.mts",
|
|
37
38
|
"import": "./dist/module.mjs"
|
|
@@ -49,9 +50,9 @@
|
|
|
49
50
|
"failOnWarn": false
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
|
52
|
-
"tailwindcss": "^4.1
|
|
53
|
-
"unplugin-icons": "^22.
|
|
54
|
-
"vue": "^3.5.
|
|
53
|
+
"tailwindcss": "^4.2.1",
|
|
54
|
+
"unplugin-icons": "^22.5.0",
|
|
55
|
+
"vue": "^3.5.30"
|
|
55
56
|
},
|
|
56
57
|
"peerDependenciesMeta": {
|
|
57
58
|
"tailwindcss": {
|
|
@@ -62,80 +63,82 @@
|
|
|
62
63
|
}
|
|
63
64
|
},
|
|
64
65
|
"dependencies": {
|
|
65
|
-
"@alanscodelog/utils": "^6.0
|
|
66
|
-
"@iconify/json": "^2.2.
|
|
67
|
-
"@nuxt/kit": "^4.
|
|
68
|
-
"@nuxt/schema": "^4.
|
|
66
|
+
"@alanscodelog/utils": "^6.2.0",
|
|
67
|
+
"@iconify/json": "^2.2.450",
|
|
68
|
+
"@nuxt/kit": "^4.4.2",
|
|
69
|
+
"@nuxt/schema": "^4.4.2",
|
|
69
70
|
"@nuxt/types": "^2.18.1",
|
|
70
|
-
"@tailwindcss/vite": "^4.1
|
|
71
|
+
"@tailwindcss/vite": "^4.2.1",
|
|
71
72
|
"@witchcraft/nuxt-utils": "^0.3.6",
|
|
72
73
|
"colord": "^2.9.3",
|
|
73
74
|
"colorjs.io": "0.6.0-alpha.1",
|
|
74
75
|
"defu": "^6.1.4",
|
|
75
76
|
"fast-glob": "^3.3.3",
|
|
76
77
|
"metamorphosis": "^0.6.1",
|
|
77
|
-
"reka-ui": "^2.5
|
|
78
|
-
"tailwind-merge": "^3.
|
|
79
|
-
"unplugin-icons": "^22.
|
|
78
|
+
"reka-ui": "^2.9.5",
|
|
79
|
+
"tailwind-merge": "^3.5.0",
|
|
80
|
+
"unplugin-icons": "^22.5.0",
|
|
80
81
|
"unplugin-vue-components": "^28.8.0",
|
|
81
82
|
"vue-component-type-helpers": "^2.2.12"
|
|
82
83
|
},
|
|
83
84
|
"devDependencies": {
|
|
84
85
|
"@alanscodelog/commitlint-config": "^3.1.2",
|
|
85
|
-
"@alanscodelog/eslint-config": "^6.3.
|
|
86
|
-
"@alanscodelog/semantic-release-config": "^6.0.
|
|
87
|
-
"@alanscodelog/tsconfigs": "^6.
|
|
88
|
-
"@alanscodelog/vite-config": "^0.0.
|
|
86
|
+
"@alanscodelog/eslint-config": "^6.3.1",
|
|
87
|
+
"@alanscodelog/semantic-release-config": "^6.0.2",
|
|
88
|
+
"@alanscodelog/tsconfigs": "^6.3.0",
|
|
89
|
+
"@alanscodelog/vite-config": "^0.0.7",
|
|
89
90
|
"@chromatic-com/storybook": "^3.2.7",
|
|
90
|
-
"@commitlint/cli": "^
|
|
91
|
-
"@internationalized/date": "^3.
|
|
92
|
-
"@
|
|
91
|
+
"@commitlint/cli": "^20.5.0",
|
|
92
|
+
"@internationalized/date": "^3.12.0",
|
|
93
|
+
"@faker-js/faker": "^10.3.0",
|
|
94
|
+
"@nuxt/eslint-config": "^1.15.2",
|
|
93
95
|
"@nuxt/module-builder": "^1.0.2",
|
|
94
96
|
"@nuxtjs/i18n": "^9.5.6",
|
|
95
|
-
"@playwright/test": "=1.
|
|
96
|
-
"@rollup/plugin-node-resolve": "^16.0.
|
|
97
|
-
"@storybook/addon-a11y": "^8.6.
|
|
98
|
-
"@storybook/addon-actions": "^8.6.
|
|
99
|
-
"@storybook/addon-essentials": "^8.6.
|
|
100
|
-
"@storybook/addon-interactions": "^8.6.
|
|
101
|
-
"@storybook/addon-links": "^8.6.
|
|
102
|
-
"@storybook/addon-storysource": "^8.6.
|
|
103
|
-
"@storybook/blocks": "^8.6.
|
|
104
|
-
"@storybook/manager-api": "^8.6.
|
|
105
|
-
"@storybook/test": "^8.6.
|
|
97
|
+
"@playwright/test": "=1.58.2",
|
|
98
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
99
|
+
"@storybook/addon-a11y": "^8.6.18",
|
|
100
|
+
"@storybook/addon-actions": "^8.6.18",
|
|
101
|
+
"@storybook/addon-essentials": "^8.6.18",
|
|
102
|
+
"@storybook/addon-interactions": "^8.6.18",
|
|
103
|
+
"@storybook/addon-links": "^8.6.18",
|
|
104
|
+
"@storybook/addon-storysource": "^8.6.18",
|
|
105
|
+
"@storybook/blocks": "^8.6.18",
|
|
106
|
+
"@storybook/manager-api": "^8.6.18",
|
|
107
|
+
"@storybook/test": "^8.6.18",
|
|
106
108
|
"@storybook/test-runner": "^0.22.1",
|
|
107
|
-
"@storybook/vue3": "^8.6.
|
|
108
|
-
"@storybook/vue3-vite": "^8.6.
|
|
109
|
-
"@
|
|
110
|
-
"@tailwindcss/
|
|
111
|
-
"@
|
|
112
|
-
"@
|
|
113
|
-
"@
|
|
114
|
-
"@vue/runtime-
|
|
115
|
-
"@
|
|
116
|
-
"@vueuse/
|
|
117
|
-
"
|
|
109
|
+
"@storybook/vue3": "^8.6.18",
|
|
110
|
+
"@storybook/vue3-vite": "^8.6.18",
|
|
111
|
+
"@tanstack/vue-virtual": "^3.13.23",
|
|
112
|
+
"@tailwindcss/cli": "^4.2.1",
|
|
113
|
+
"@tailwindcss/postcss": "^4.2.1",
|
|
114
|
+
"@types/node": "^24.12.0",
|
|
115
|
+
"@vitejs/plugin-vue": "^6.0.5",
|
|
116
|
+
"@vue/runtime-core": "^3.5.30",
|
|
117
|
+
"@vue/runtime-dom": "^3.5.30",
|
|
118
|
+
"@vueuse/components": "^13.9.0",
|
|
119
|
+
"@vueuse/core": "^13.9.0",
|
|
120
|
+
"autoprefixer": "^10.4.27",
|
|
118
121
|
"concurrently": "^9.2.1",
|
|
119
|
-
"eslint": "^9.
|
|
122
|
+
"eslint": "^9.39.4",
|
|
120
123
|
"http-server": "^14.1.1",
|
|
121
124
|
"husky": "^9.1.7",
|
|
122
125
|
"indexit": "2.1.0-beta.3",
|
|
123
126
|
"madge": "^7.0.0",
|
|
124
|
-
"nuxt": "^4.
|
|
125
|
-
"playwright": "=1.
|
|
126
|
-
"playwright-core": "=1.
|
|
127
|
-
"semantic-release": "^24.2.
|
|
128
|
-
"storybook": "^8.6.
|
|
127
|
+
"nuxt": "^4.4.2",
|
|
128
|
+
"playwright": "=1.58.2",
|
|
129
|
+
"playwright-core": "=1.58.2",
|
|
130
|
+
"semantic-release": "^24.2.9",
|
|
131
|
+
"storybook": "^8.6.18",
|
|
129
132
|
"storybook-dark-mode": "^4.0.2",
|
|
130
|
-
"tailwindcss": "^4.1
|
|
133
|
+
"tailwindcss": "^4.2.1",
|
|
131
134
|
"ts-node": "^10.9.2",
|
|
132
|
-
"typescript": "^5.9.
|
|
135
|
+
"typescript": "^5.9.3",
|
|
133
136
|
"unbuild": "^3.6.1",
|
|
134
|
-
"vite": "^7.1
|
|
135
|
-
"vite-tsconfig-paths": "^
|
|
136
|
-
"vue": "^3.5.
|
|
137
|
-
"vue-tsc": "3.
|
|
138
|
-
"wait-on": "^8.0.
|
|
137
|
+
"vite": "^7.3.1",
|
|
138
|
+
"vite-tsconfig-paths": "^6.1.1",
|
|
139
|
+
"vue": "^3.5.30",
|
|
140
|
+
"vue-tsc": "3.2.4",
|
|
141
|
+
"wait-on": "^8.0.5"
|
|
139
142
|
},
|
|
140
143
|
"author": "Alan <alanscodelog@gmail.com>",
|
|
141
144
|
"repository": "https://github.com/witchcraftjs/ui",
|
|
@@ -173,10 +176,10 @@
|
|
|
173
176
|
"build:only": "nuxt-module-build build",
|
|
174
177
|
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
|
|
175
178
|
"dev": "nuxi dev playground",
|
|
176
|
-
"storybook": "BROWSER=none storybook dev -p 6006",
|
|
179
|
+
"storybook": "BROWSER=none storybook dev -p 6006 --no-open",
|
|
177
180
|
"storybook:clear-cache": "BROWSER=none storybook dev -p 6006 --no-manager-cache",
|
|
178
181
|
"storybook:build": "pnpm nuxt prepare && storybook build -o docs/storybook",
|
|
179
|
-
"storybook:test": "pnpm storybook:build && pnpm concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"pnpm http-server docs/storybook --port 6006 --silent\" \"pnpm wait-on tcp:6006 && pnpm test-storybook\"",
|
|
182
|
+
"storybook:test": "pnpm storybook:build && pnpm concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"pnpm http-server docs/storybook --port 6006 --silent\" \"pnpm wait-on tcp:6006 && pnpm test-storybook --excludeTags 'skip-smoke-test'\"",
|
|
180
183
|
"test": "pnpm storybook:test && pnpm lint:types",
|
|
181
184
|
"test:dev": "pnpm concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"pnpm storybook\" \"pnpm wait-on tcp:6006 && pnpm test-storybook --watch\"",
|
|
182
185
|
"doc": "pnpm test && pnpm storybook:build",
|
package/src/module.ts
CHANGED
|
@@ -35,7 +35,7 @@ const componentsInfo: {
|
|
|
35
35
|
`!**/Template/**.vue`
|
|
36
36
|
], [], (filepath: string, name: string) => ({
|
|
37
37
|
originalName: name,
|
|
38
|
-
name: name.startsWith("
|
|
38
|
+
name: name.startsWith("W") ? name.replace("W", "PREFIX") : `PREFIX${name}`,
|
|
39
39
|
filepath
|
|
40
40
|
}))
|
|
41
41
|
|
|
@@ -75,7 +75,7 @@ export interface ModuleOptions {
|
|
|
75
75
|
*/
|
|
76
76
|
mainCssFile?: string
|
|
77
77
|
/** @internal */
|
|
78
|
-
_playgroundWorkaround?:
|
|
78
|
+
_playgroundWorkaround?: string
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
export default defineNuxtModule<ModuleOptions>({
|
|
@@ -93,7 +93,7 @@ export default defineNuxtModule<ModuleOptions>({
|
|
|
93
93
|
componentPrefix: "W",
|
|
94
94
|
debug: true,
|
|
95
95
|
mainCssFile: "~/assets/css/tailwind.css",
|
|
96
|
-
_playgroundWorkaround:
|
|
96
|
+
_playgroundWorkaround: undefined
|
|
97
97
|
},
|
|
98
98
|
moduleDependencies: {
|
|
99
99
|
// not working, see note for unpluginOptions
|
|
@@ -133,20 +133,25 @@ export default defineNuxtModule<ModuleOptions>({
|
|
|
133
133
|
}
|
|
134
134
|
)
|
|
135
135
|
|
|
136
|
+
const assetDir = resolve("runtime/assets")
|
|
137
|
+
const tailwindFiles = globFiles([
|
|
138
|
+
`${assetDir}/**/*.css`,
|
|
139
|
+
`!${assetDir}/**/tailwind.css`,
|
|
140
|
+
`!${assetDir}/**/theme.css`
|
|
141
|
+
], [])
|
|
142
|
+
|
|
136
143
|
addTemplate({
|
|
137
144
|
filename: "witchcraft-ui.css",
|
|
138
145
|
write: true,
|
|
139
|
-
getContents: () => options._playgroundWorkaround
|
|
146
|
+
getContents: () => options._playgroundWorkaround === "@witchcraft/ui"
|
|
140
147
|
? crop`
|
|
141
148
|
${indent(themeAsTailwindCss(theme, themeConvertionOpts), 5)}
|
|
142
|
-
|
|
143
|
-
@import "${resolve("runtime/assets/utils.css")}";
|
|
149
|
+
${indent(tailwindFiles.map(_ => `@import "${_.filepath}";`).join("\n"), 5)}
|
|
144
150
|
${indent(filteredComponentsInfo.map(_ => `@source "${_.filepath}";`).join("\n"), 5)}
|
|
145
151
|
`
|
|
146
152
|
: crop`
|
|
147
153
|
${indent(themeAsTailwindCss(theme, themeConvertionOpts), 5)}
|
|
148
|
-
|
|
149
|
-
@import "@witchcraft/ui/utils.css";
|
|
154
|
+
${indent(tailwindFiles.map(_ => `@import "${_.filepath.replace(assetDir, "@witchcraft/ui")}";`).join("\n"), 5)}
|
|
150
155
|
${indent(filteredComponentsInfo.map(_ => `@source "${_.filepath}";`).join("\n"), 5)}
|
|
151
156
|
`
|
|
152
157
|
})
|
|
@@ -177,7 +182,9 @@ export default defineNuxtModule<ModuleOptions>({
|
|
|
177
182
|
nuxt.hook("vite:extendConfig", async config => {
|
|
178
183
|
if (options.includeUnpluginIconsPlugins) {
|
|
179
184
|
logger.info(`Adding unplugin-icons`)
|
|
185
|
+
// @ts-expect-error .
|
|
180
186
|
config.plugins ??= []
|
|
187
|
+
// @ts-expect-error .
|
|
181
188
|
config.plugins = [
|
|
182
189
|
...(
|
|
183
190
|
options.includeUnpluginIconsPlugins
|
|
@@ -199,6 +206,7 @@ export default defineNuxtModule<ModuleOptions>({
|
|
|
199
206
|
tailwindcss() as any,
|
|
200
207
|
...config.plugins
|
|
201
208
|
]
|
|
209
|
+
// @ts-expect-error .
|
|
202
210
|
config.optimizeDeps ??= {}
|
|
203
211
|
config.optimizeDeps.exclude ??= []
|
|
204
212
|
config.optimizeDeps.exclude.push("~icons")
|