@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
package/README.md
CHANGED
|
@@ -31,6 +31,7 @@ It does not install "@nuxtjs/tailwindcss" for now since it's not compatible with
|
|
|
31
31
|
// without Nuxt:
|
|
32
32
|
@import "@witchcraft/ui/utils.css";
|
|
33
33
|
@import "@witchcraft/ui/base.css";
|
|
34
|
+
@import "@witchcraft/ui/animations.css";
|
|
34
35
|
// source used components
|
|
35
36
|
@source "@witchcraft/ui/components";
|
|
36
37
|
|
|
@@ -54,23 +55,6 @@ To make it easier to style parts of components or override behavior, some compon
|
|
|
54
55
|
|
|
55
56
|
I think this is nicer in general than having to pass an object with extra attributes. The only weird part, is because of how vue changes the case of props, for attributes like `innerHTML` you will need to pass `{prefix}-inner-h-t-m-l`, but all components have proper types to help this. Similarly events look like `{prefix}-on-click`.
|
|
56
57
|
|
|
57
|
-
# Slots
|
|
58
|
-
|
|
59
|
-
Usually it is possible to do most modifications through props, but slots to replace parts of components are available.
|
|
60
|
-
|
|
61
|
-
Most slots where possible are passed all properties needed to replace them except classes so you can do something like this, to for example replace the simple input component inside the input component.
|
|
62
|
-
|
|
63
|
-
```vue
|
|
64
|
-
<lib-simple-input-deprecated>
|
|
65
|
-
<template #input="slotProps">
|
|
66
|
-
<lib-simple-input
|
|
67
|
-
:class="'completely custom styles'"
|
|
68
|
-
v-bind="slotProps"
|
|
69
|
-
></lib-simple-input>
|
|
70
|
-
</template>
|
|
71
|
-
</lib-simple-input>
|
|
72
|
-
|
|
73
|
-
```
|
|
74
58
|
|
|
75
59
|
# Other
|
|
76
60
|
|
|
@@ -117,6 +101,7 @@ See [@witchcraft/editor/vite.config.dev.ts].
|
|
|
117
101
|
```css
|
|
118
102
|
@import "@witchcraft/ui/utils.css";
|
|
119
103
|
@import "@witchcraft/ui/base.css";
|
|
104
|
+
@import "@witchcraft/ui/animations.css";
|
|
120
105
|
@source "/path/to/node_modules/@witchcraft/ui/src/runtime/components";
|
|
121
106
|
```
|
|
122
107
|
Base just contains animation keyframes, basic styles for vue animations, and some basic global styles. They will get imported regardless of whether they are used since otherwise tailwind does not detect they are being used.
|
|
@@ -165,56 +150,66 @@ Note that using the strictTemplates compiler option can cause weird issues with
|
|
|
165
150
|
|
|
166
151
|
## Props
|
|
167
152
|
|
|
168
|
-
|
|
153
|
+
Props and attribute typing used to have a lot of issues with vue. It's improved a bit. A typical component looks like this:
|
|
169
154
|
|
|
170
|
-
Here is an example of the needed code for props to work correctly:
|
|
171
155
|
```vue
|
|
156
|
+
<template>
|
|
157
|
+
<div
|
|
158
|
+
:class="twMerge(`
|
|
159
|
+
our-classes
|
|
160
|
+
`, ($attrs as any).class)"
|
|
161
|
+
v-bind="{ ...$attrs, class: undefined }"
|
|
162
|
+
>
|
|
163
|
+
...
|
|
164
|
+
</div>
|
|
165
|
+
</template>
|
|
172
166
|
<script lang="ts">
|
|
173
|
-
|
|
174
|
-
// and we can have interface merging, a setup script cannot interface merge
|
|
175
|
-
|
|
176
|
-
import type { BaseInteractiveProps } from "../shared/props.js"
|
|
177
|
-
|
|
178
|
-
// real props vue can understand, they will show up under props.*
|
|
179
|
-
type RealProps =
|
|
180
|
-
// simple types are okay
|
|
181
|
-
& BaseInteractiveProps
|
|
182
|
-
& {
|
|
183
|
-
// any ignored props that we need to use in the component template
|
|
184
|
-
// will need to be re-defined so vue can see them
|
|
185
|
-
// in a way vue can see them if it's one of the problem properties
|
|
186
|
-
id?: InputHTMLAttributes["id"]
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
interface Props
|
|
190
|
-
extends
|
|
191
|
-
// we need to ignore the complex InputHTMLAttributes type
|
|
192
|
-
// otherwise vue compilation fails
|
|
193
|
-
// if we ignore it, all it's properties are passed as fallback attrs
|
|
194
|
-
// NOT to props as normal
|
|
195
|
-
// we also need to omit properties or events that the component overrides with a different type
|
|
196
|
-
/** @vue-ignore */
|
|
197
|
-
Partial<Omit<InputHTMLAttributes,"class" | "onSubmit"> & {
|
|
198
|
-
// overrides for the components
|
|
199
|
-
// usually, for example, class can only be a string (because of tailwind)
|
|
200
|
-
// this will be passed as an attr
|
|
201
|
-
class?:string
|
|
202
|
-
}>,
|
|
203
|
-
/** @vue-ignore */
|
|
204
|
-
RealProps
|
|
205
|
-
{ }
|
|
206
|
-
</script>
|
|
167
|
+
import type { BaseInteractiveProps } from "../../types/index.js"
|
|
207
168
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
id: "",
|
|
211
|
-
unstyle: false, disabled:false, readonly:false, border:true,
|
|
212
|
-
})
|
|
169
|
+
// only if it makes sense, otherwise prefer a prop (___Attrs for attributes, ___Props if it wraps reka-ui props)
|
|
170
|
+
// we do this regardless of whether we pass to the root or not (since we never allow non-tailwind classes)
|
|
213
171
|
const $attrs = useAttrs()
|
|
214
|
-
|
|
215
|
-
|
|
172
|
+
const props = withDefaults(defineProps<
|
|
173
|
+
& BaseInteractiveProps
|
|
174
|
+
& {
|
|
175
|
+
// if we need an id for hydration or some internal aria connection
|
|
176
|
+
id?: string
|
|
177
|
+
// if we allow setting a label via text
|
|
178
|
+
label?: string
|
|
179
|
+
// note we omitted it above, will be available via props.disabled
|
|
180
|
+
disabled?: boolean
|
|
181
|
+
// if we just need to pass "attributes" to the root
|
|
182
|
+
inputAttrs?: Omit<InputHTMLAttributes, "class"> & TailwindClassProp
|
|
183
|
+
// if we need to pass, to for example, a reka-ui Content component
|
|
184
|
+
contentProps?: PopoverContentProps & EmitsToProps<DialogContentEmits> & Omit<HTMLAttributes, "class"> & TailwindClassProp
|
|
185
|
+
}
|
|
186
|
+
// the parts under the ignore type the $attrs and are NOT available on props.*
|
|
187
|
+
// they must be accessed via $attrs and are not reactive
|
|
188
|
+
// if we need to change the type or need access to the prop via props.* we can omit it here
|
|
189
|
+
& /** @vue-ignore */ Omit<InputHTMLAttributes, "class" | "disabled">
|
|
190
|
+
& /** @vue-ignore */ TailwindClassProp
|
|
191
|
+
>(), {
|
|
192
|
+
label: "",
|
|
193
|
+
// the defaults for BaseInteractiveProps that are not false by default, and no, they can't be spread
|
|
194
|
+
// see https://github.com/nuxt/module-builder/issues/649
|
|
195
|
+
border: true
|
|
196
|
+
})
|
|
197
|
+
// uses useId if id is not set so we have an id if we need it for hydration
|
|
198
|
+
const finalId = useFallbackId(props)
|
|
199
|
+
const modelValue = defineModel<string>({ required: false, default: "" })
|
|
200
|
+
// use for inputs or elements where it's highly likely the user can start setting a value before hydration
|
|
201
|
+
usePreHydrationValue(finalId, modelValue)
|
|
216
202
|
|
|
217
|
-
|
|
203
|
+
</script>
|
|
204
|
+
<script lang="ts">
|
|
205
|
+
/**
|
|
206
|
+
* If the component requires general docs, they should be written here over the export default.
|
|
207
|
+
*/
|
|
208
|
+
export default {
|
|
209
|
+
name: "WComponentName"
|
|
210
|
+
// https://v3.vuejs.org/guide/typescript-support.html#annotating-props
|
|
211
|
+
}
|
|
212
|
+
</script>```
|
|
218
213
|
|
|
219
214
|
Related Links:
|
|
220
215
|
- https://github.com/vuejs/rfcs/discussions/397
|
package/dist/module.d.mts
CHANGED
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -19,10 +19,10 @@ const componentsInfo = globFiles([
|
|
|
19
19
|
`!**/Template/**.vue`
|
|
20
20
|
], [], (filepath, name) => ({
|
|
21
21
|
originalName: name,
|
|
22
|
-
name: name.startsWith("
|
|
22
|
+
name: name.startsWith("W") ? name.replace("W", "PREFIX") : `PREFIX${name}`,
|
|
23
23
|
filepath
|
|
24
24
|
}));
|
|
25
|
-
const module = defineNuxtModule({
|
|
25
|
+
const module$1 = defineNuxtModule({
|
|
26
26
|
meta: {
|
|
27
27
|
name: "witchcraftUi",
|
|
28
28
|
configKey: "witchcraftUi"
|
|
@@ -37,7 +37,7 @@ const module = defineNuxtModule({
|
|
|
37
37
|
componentPrefix: "W",
|
|
38
38
|
debug: true,
|
|
39
39
|
mainCssFile: "~/assets/css/tailwind.css",
|
|
40
|
-
_playgroundWorkaround:
|
|
40
|
+
_playgroundWorkaround: void 0
|
|
41
41
|
},
|
|
42
42
|
moduleDependencies: {
|
|
43
43
|
// not working, see note for unpluginOptions
|
|
@@ -73,18 +73,22 @@ const module = defineNuxtModule({
|
|
|
73
73
|
directives: options.directives
|
|
74
74
|
}
|
|
75
75
|
);
|
|
76
|
+
const assetDir = resolve("runtime/assets");
|
|
77
|
+
const tailwindFiles = globFiles([
|
|
78
|
+
`${assetDir}/**/*.css`,
|
|
79
|
+
`!${assetDir}/**/tailwind.css`,
|
|
80
|
+
`!${assetDir}/**/theme.css`
|
|
81
|
+
], []);
|
|
76
82
|
addTemplate({
|
|
77
83
|
filename: "witchcraft-ui.css",
|
|
78
84
|
write: true,
|
|
79
|
-
getContents: () => options._playgroundWorkaround ? crop`
|
|
85
|
+
getContents: () => options._playgroundWorkaround === "@witchcraft/ui" ? crop`
|
|
80
86
|
${indent(themeAsTailwindCss(theme, themeConvertionOpts), 5)}
|
|
81
|
-
|
|
82
|
-
@import "${resolve("runtime/assets/utils.css")}";
|
|
87
|
+
${indent(tailwindFiles.map((_) => `@import "${_.filepath}";`).join("\n"), 5)}
|
|
83
88
|
${indent(filteredComponentsInfo.map((_) => `@source "${_.filepath}";`).join("\n"), 5)}
|
|
84
89
|
` : crop`
|
|
85
90
|
${indent(themeAsTailwindCss(theme, themeConvertionOpts), 5)}
|
|
86
|
-
|
|
87
|
-
@import "@witchcraft/ui/utils.css";
|
|
91
|
+
${indent(tailwindFiles.map((_) => `@import "${_.filepath.replace(assetDir, "@witchcraft/ui")}";`).join("\n"), 5)}
|
|
88
92
|
${indent(filteredComponentsInfo.map((_) => `@source "${_.filepath}";`).join("\n"), 5)}
|
|
89
93
|
`
|
|
90
94
|
});
|
|
@@ -154,4 +158,4 @@ const module = defineNuxtModule({
|
|
|
154
158
|
}
|
|
155
159
|
});
|
|
156
160
|
|
|
157
|
-
export { module as default };
|
|
161
|
+
export { module$1 as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@theme{--animate-blinkInf:blink 1s linear
|
|
1
|
+
@utility animate-from-*{--animate-from:--value([length],[percentage]);--animate-from:calc(var(--spacing) * --value(integer))}@utility -animate-from-*{--animate-from:--value([length],[percentage]);--animate-from:calc(var(--spacing) * -1 * --value(integer))}@theme{--animate-blinkInf:blink 1s linear infinite;@keyframes blink{0%{opacity:0}25%{opacity:1}75%{opacity:1}to{opacity:0}}--animate-slideBgInf:slideBg 10s ease-in-out linear-infinite;@keyframes slideBg{0%{background-position:0}to{background-position:100%}}--animate-hide:hide 500ms ease-in;@keyframes hide{0%{opacity:1}to{opacity:0}}--animate-slideInLeft:slideInLeft 500ms cubic-bezier(0.16,1,0.3,1);@keyframes slideInLeft{0%{opacity:0;transform:translateX(var(--animate-from,100%))}to{opacity:1;transform:translateX(0)}}--animate-slideInRight:slideInRight 500ms cubic-bezier(0.16,1,0.3,1);@keyframes slideInRight{0%{opacity:0;transform:translateX(var(--animate-from,-100%))}to{opacity:1;transform:translateX(0)}}--animate-slideInUp:slideInUp 500ms cubic-bezier(0.16,1,0.3,1);@keyframes slideInUp{0%{opacity:0;transform:translateY(var(--animate-from,100%))}to{opacity:1;transform:translateY(0)}}--animate-slideInDown:slideInDown 500ms cubic-bezier(0.16,1,0.3,1);@keyframes slideInDown{0%{opacity:0;transform:translateY(var(--animate-from,-100%))}to{opacity:1;transform:translateY(0)}}--animate-overlayShow:overlayShow 500ms cubic-bezier(0.16,1,0.3,1);@keyframes overlayShow{0%{opacity:0}to{opacity:1}}--animate-contentShow:contentShow 500ms cubic-bezier(0.16,1,0.3,1);@keyframes contentShow{0%{opacity:0;transform:translateY(-10%) scale(.96)}to{opacity:1;transform:scale(1)}}}
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
"pagination.aria.go-to-next-page": "Go to next page. Page {count}",
|
|
26
26
|
"pagination.aria.go-to-page": "Go to page {count}",
|
|
27
27
|
"pagination.aria.current-page": "Current page {count}",
|
|
28
|
+
"pagination.aria.go-to-first-page": "Go to first page",
|
|
29
|
+
"pagination.aria.go-to-last-page": "Go to last page",
|
|
28
30
|
"pagination.previous-page": "Prev",
|
|
29
31
|
"pagination.next-page": "Next",
|
|
30
32
|
"recorder.recording": "Recording",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@custom-variant dark (&:where(.dark, .dark *));@utility focus-outline-within{@
|
|
1
|
+
@custom-variant dark (&:where(.dark, .dark *));@utility focus-outline-within{@apply outlined-within:outline-2 outlined-within:outline-accent-500 outlined-within:outline-offset-2}@utility focus-outline{@apply outlined:outline-2 outlined:outline-accent-500 outlined:outline-offset-2}@utility focus-outline-no-offset{@apply outlined:outline-2 outlined:outline-accent-500}@utility focus-outline-hidden{@apply outlined:outline-none}@utility bg-squares-gradient{--_square:var(--squareSize,5px);--_double_square:calc(var(--_square)*2);--_light_square:var(--lightSquare,var(--color-white));--_dark_square:var(--darkSquare,var(--color-black));background-color:var(--_light_square);background:repeating-conic-gradient(var(--_dark_square) 0 25%,var(--_light_square) 0 50%) 50% /var(--_double_square) var(--_double_square)}@utility square-light-*{--lightSquare:--value(--color- *)}@utility square-dark-*{--darkSquare:--value(--color- *)}@utility square-size-*{--squareSize:calc(--value(integer) * 1px)}@utility bg-bars-gradient{--_bg_color:var(--bars-bg-color,var(--color-accent-700));--_fg_color:var(--bars-fg-color,var(--color-accent-800));--_angle:var(--bars-angle,45deg);--_fg_width:var(--bars-fg-width,50%);--_bg_width:calc(100% - var(--_fg_width));background-color:var(--_bg_color);--_pos_1:calc(var(--_bg_width)/2);--_pos_2:calc(var(--_bg_width)/2 + var(--_fg_width)/2);--_pos_3:calc(var(--_bg_width) + var(--_fg_width)/2);background-image:repeating-linear-gradient(var(--_angle),var(--_bg_color),var(--_bg_color) var(--_pos_1),var(--_fg_color) var(--_pos_1),var(--_fg_color) var(--_pos_2),var(--_bg_color) var(--_pos_2),var(--_bg_color) var(--_pos_3),var(--_fg_color) var(--_pos_3),var(--_fg_color))}@utility bars-angle-*{--bars-angle:var(--value(integer) * 1deg)}@utility bars-fg-*{--bars-fg-color:--value(--color-*)}@utility bars-bg-*{--bars-bg-color:--value(--color-*)}@utility bars-w-*{--bars-fg-width:calc(--value(integer) * 1%, 50%)}@utility mix-from-*{--mix-from:--value(--color-*);--mix:color-mix(in srgb,var(--mix-from),var(--mix-to,transparent) var(--mix-percentage,50%))}@utility mix-to-*{--mix-to:--value(--color-*);--mix-percentage:calc(--modifier(integer) * 1%);--mix:color-mix(in srgb,var(--mix-from),var(--mix-to,transparent) var(--mix-percentage,50%))}@utility tint-*{--mix-from:--value(--color-*);--mix-to:#fff;--mix-percentage:calc(--modifier(integer) * 1%);--mix:color-mix(in srgb,var(--mix-from),var(--mix-to) var(--mix-percentage,20%))}@utility shade-*{--mix-from:--value(--color-*);--mix-to:#000;--mix-percentage:calc(--modifier(integer) * 1%);--mix:color-mix(in srgb,var(--mix-from),var(--mix-to) var(--mix-percentage))}@utility scrollbar-hidden{-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none}}@utility styled-scrollbar{--_scrollbar_width:var(--scrollbar-width,calc(var(--spacing)*3));--_scrollbar_border_width:var(--scrollbar-border-width,calc(var(--spacing)/2));--_scrollbar_color:var(--scrollbar-color,--alpha(var(--color-accent-500)/40%));--_scrollbar_hover_color:var(--scrollbar-hover-color,--alpha(var(--color-accent-500)/80%));--_scrollbar_bg_color:var(--scrollbar-bg-color,var(--color-bg));.dark &{--_scrollbar_bg_color:var(--scrollbar-bg-color,var(--color-fg))}&::-webkit-scrollbar{height:var(--_scrollbar_width);width:var(--_scrollbar_width)}&::-webkit-scrollbar-corner,&::-webkit-scrollbar-track{background-color:transparent}&::-webkit-scrollbar-thumb,&::-webkit-scrollbar-track{border-radius:var(--_scrollbar_width)}&::-webkit-scrollbar-thumb{background-color:var(--_scrollbar_color);border:var(--_scrollbar_border_width) solid var(--_scrollbar_bg_color)}&::-webkit-scrollbar-thumb:hover{cursor:pointer}&::-webkit-scrollbar-thumb:active,&::-webkit-scrollbar-thumb:hover{background-color:var(--_scrollbar_hover_color);border-radius:var(--_scrollbar_width)}}@utility styled-scrollbar-w-*{--scrollbar-width:--value(integer)}@utility styled-scrollbar-border-w-*{--scrollbar-border-width:--value(integer)}@utility styled-scrollbar-*{--scrollbar-color:--value(--color-*)}@utility styled-scrollbar-bg-*{--scrollbar-bg-color:--value(--color-*)}@utility styled-resizer{--_resizer_width:var(--resizer-width,8px);--_resizer_color:var(--resizer-color,var(--color-neutral-300));.dark &{--_resizer_color:var(--resizer-color,var(--color-neutral-700))}&::-webkit-resizer{border-bottom-color:var(--_resizer_color);border-left-color:transparent;border-right-color:var(--_resizer_color);border-style:solid;border-top-color:transparent;border-width:var(--_resizer_width)}}@utility styled-resizer-w-*{--resizer-width:--value(integer)}@utility styled-resizer-color-*{--resizer-color:--value(--color-*)}@utility content-vertical-holder{--tw-content:"\200b";content:var(--tw-content)}@utility no-touch-action{touch-action:none}@utility bg-transparency-squares{@apply bg-squares-gradient square-light-white square-dark-neutral-300 square-size-6}@utility link-like{@apply cursor-pointer hover:text-accent-500}@utility no-truncate{overflow:visible;text-overflow:unset;white-space:normal}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
const prefixless = ["Icon", "Aria"];
|
|
2
1
|
export const WitchcraftUiResolver = ({
|
|
3
2
|
prefix = "W",
|
|
4
3
|
filter = () => true
|
|
5
4
|
} = {}) => (componentName) => {
|
|
6
5
|
if (componentName.startsWith(prefix)) {
|
|
7
6
|
const n = componentName.slice(1);
|
|
8
|
-
const filename =
|
|
7
|
+
const filename = `W${n}`;
|
|
9
8
|
if (!filter(n)) {
|
|
10
9
|
return void 0;
|
|
11
10
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
showOutline: boolean;
|
|
3
3
|
};
|
|
4
|
-
declare const
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
5
6
|
export default _default;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<!-- Width 100% + 2xmargin in combination with the margins in
|
|
2
|
+
<!-- Width 100% + 2xmargin in combination with the margins in WRoot is a bit of a hack so that it looks like there's padding around the content in test mode (for storybook). We can't just absolutely position these controls or they make the container scroll. -->
|
|
3
3
|
<div class="test-controls flex gap-2 p-1 pb-10 -ml-10 w-[calc(100%_+_var(--spacing)*20)]">
|
|
4
4
|
<div class="flex-grow"/>
|
|
5
5
|
<div class="outline-indicator">
|
|
6
6
|
{{ showOutline ? "Outline Enabled" : "Outline Disabled" }}
|
|
7
7
|
</div>
|
|
8
|
-
<
|
|
8
|
+
<WDarkModeSwitcher/>
|
|
9
9
|
</div>
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
12
|
<script setup>
|
|
13
|
-
import
|
|
13
|
+
import WDarkModeSwitcher from "../WDarkModeSwitcher/WDarkModeSwitcher.vue";
|
|
14
14
|
defineOptions({ name: "TestControls" });
|
|
15
15
|
defineProps({
|
|
16
16
|
showOutline: { type: Boolean, required: true }
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
showOutline: boolean;
|
|
3
3
|
};
|
|
4
|
-
declare const
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
5
6
|
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes } from "vue";
|
|
2
|
+
import type { BaseInteractiveProps, TailwindClassProp } from "../../types/index.js";
|
|
3
|
+
type __VLS_Props = BaseInteractiveProps & {
|
|
4
|
+
label?: string;
|
|
5
|
+
border?: boolean;
|
|
6
|
+
color?: "warning" | "ok" | "danger" | "primary" | "secondary" | false;
|
|
7
|
+
} & /** @vue-ignore */ Omit<ButtonHTMLAttributes, "class" | "color"> & /** @vue-ignore */ TailwindClassProp;
|
|
8
|
+
declare var __VLS_1: {
|
|
9
|
+
classes: string;
|
|
10
|
+
}, __VLS_3: {}, __VLS_5: {
|
|
11
|
+
label: string;
|
|
12
|
+
}, __VLS_7: {};
|
|
13
|
+
type __VLS_Slots = {} & {
|
|
14
|
+
label?: (props: typeof __VLS_1) => any;
|
|
15
|
+
} & {
|
|
16
|
+
icon?: (props: typeof __VLS_3) => any;
|
|
17
|
+
} & {
|
|
18
|
+
default?: (props: typeof __VLS_5) => any;
|
|
19
|
+
} & {
|
|
20
|
+
'icon-after'?: (props: typeof __VLS_7) => any;
|
|
21
|
+
};
|
|
22
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
23
|
+
color: "warning" | "ok" | "danger" | "primary" | "secondary" | false;
|
|
24
|
+
border: boolean;
|
|
25
|
+
label: string;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<button
|
|
3
|
-
:
|
|
4
|
-
:class="!$attrs.unstyle && twMerge(
|
|
3
|
+
:class="!unstyle && twMerge(
|
|
5
4
|
`
|
|
6
5
|
button
|
|
7
6
|
flex
|
|
@@ -27,7 +26,8 @@
|
|
|
27
26
|
border && `
|
|
28
27
|
transition-all
|
|
29
28
|
bg-neutral-100
|
|
30
|
-
dark:
|
|
29
|
+
dark:tint-neutral-800/10
|
|
30
|
+
dark:bg-(--mix)
|
|
31
31
|
shadow-[0_1px_1px_0]
|
|
32
32
|
shadow-neutral-950/20
|
|
33
33
|
hover:shadow-[0_1px_3px_0]
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
after:shadow-[0_1px_0_0_inset]
|
|
43
43
|
after:shadow-bg/20
|
|
44
44
|
hover:after:shadow-bg/60
|
|
45
|
+
disabled:after:hidden
|
|
45
46
|
dark:after:shadow-bg/10
|
|
46
47
|
dark:hover:after:shadow-bg/50
|
|
47
48
|
after:pointer-events-none
|
|
@@ -50,15 +51,16 @@
|
|
|
50
51
|
active:shadow-fg/20
|
|
51
52
|
active:border-transparent
|
|
52
53
|
border
|
|
53
|
-
border-
|
|
54
|
+
border-black/10
|
|
54
55
|
disabled:border-neutral-200
|
|
55
|
-
disabled:bg-neutral-
|
|
56
|
+
disabled:bg-neutral-100
|
|
56
57
|
dark:hover:shadow-neutral-950/70
|
|
57
58
|
dark:active:shadow-fg/40
|
|
58
59
|
dark:active:border-neutral-900
|
|
59
|
-
dark:border-
|
|
60
|
+
dark:border-black/50
|
|
60
61
|
dark:disabled:border-neutral-800
|
|
61
|
-
dark:disabled:bg-
|
|
62
|
+
dark:disabled:bg-(--mix)
|
|
63
|
+
dark:disabled:shade-neutral-900/10
|
|
62
64
|
`,
|
|
63
65
|
border && (!color || color === `secondary`) && `
|
|
64
66
|
after:shadow-bg/90
|
|
@@ -154,26 +156,24 @@
|
|
|
154
156
|
`,
|
|
155
157
|
$attrs?.class
|
|
156
158
|
)"
|
|
157
|
-
:type="$attrs
|
|
159
|
+
:type="$attrs?.type || 'button'"
|
|
158
160
|
:tabindex="0"
|
|
159
161
|
:disabled="disabled"
|
|
160
162
|
:data-border="border"
|
|
161
163
|
:data-color="color"
|
|
162
|
-
:aria-disabled="disabled"
|
|
163
164
|
v-bind="{
|
|
164
|
-
...autoTitle,
|
|
165
165
|
...$attrs,
|
|
166
|
-
class: void 0
|
|
167
|
-
...ariaLabel
|
|
166
|
+
class: void 0
|
|
168
167
|
}"
|
|
169
168
|
>
|
|
170
169
|
<slot
|
|
171
170
|
name="label"
|
|
172
|
-
v-bind="{
|
|
171
|
+
v-bind="{
|
|
172
|
+
classes: 'button--label pointer-events-none flex flex-1 items-center justify-center gap-1'
|
|
173
|
+
}"
|
|
173
174
|
>
|
|
174
|
-
<
|
|
175
|
-
:
|
|
176
|
-
class="button--label pointer-events-none flex flex-1 items-center justify-center gap-1"
|
|
175
|
+
<div
|
|
176
|
+
:class="!unstyle && 'button--label pointer-events-none flex flex-1 items-center justify-center gap-1'"
|
|
177
177
|
>
|
|
178
178
|
<slot name="icon"/>
|
|
179
179
|
<slot
|
|
@@ -184,38 +184,26 @@
|
|
|
184
184
|
</span>
|
|
185
185
|
</slot>
|
|
186
186
|
<slot name="icon-after"/>
|
|
187
|
-
</
|
|
187
|
+
</div>
|
|
188
188
|
</slot>
|
|
189
189
|
</button>
|
|
190
190
|
</template>
|
|
191
191
|
|
|
192
192
|
<script setup>
|
|
193
193
|
import { isBlank } from "@alanscodelog/utils/isBlank";
|
|
194
|
-
import {
|
|
195
|
-
import { useAriaLabel } from "../../composables/useAriaLabel.js";
|
|
194
|
+
import { useAttrs } from "vue";
|
|
196
195
|
import { twMerge } from "../../utils/twMerge.js";
|
|
197
|
-
import { getFallbackId } from "../shared/props.js";
|
|
198
196
|
const $attrs = useAttrs();
|
|
199
197
|
defineOptions({
|
|
200
|
-
name: "
|
|
198
|
+
name: "WButton",
|
|
199
|
+
inheritAttrs: false
|
|
201
200
|
});
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
label: { type: String, required: false, default: "" },
|
|
206
|
-
disabled: { type: Boolean, required: false, default: false },
|
|
207
|
-
readonly: { type: Boolean, required: false, default: false },
|
|
201
|
+
defineProps({
|
|
202
|
+
disabled: { type: Boolean, required: false },
|
|
203
|
+
readonly: { type: Boolean, required: false },
|
|
208
204
|
border: { type: Boolean, required: false, default: true },
|
|
209
|
-
unstyle: { type: Boolean, required: false
|
|
210
|
-
|
|
211
|
-
|
|
205
|
+
unstyle: { type: Boolean, required: false },
|
|
206
|
+
label: { type: String, required: false, default: "" },
|
|
207
|
+
color: { type: [String, Boolean], required: false, default: false }
|
|
212
208
|
});
|
|
213
|
-
const ariaLabel = useAriaLabel(props, fallbackId);
|
|
214
|
-
const autoTitle = computed(() => ({
|
|
215
|
-
title: props.autoTitleFromAria ? $attrs["aria-label"] ?? props.label : void 0
|
|
216
|
-
}));
|
|
217
|
-
</script>
|
|
218
|
-
|
|
219
|
-
<script>
|
|
220
|
-
|
|
221
209
|
</script>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes } from "vue";
|
|
2
|
+
import type { BaseInteractiveProps, TailwindClassProp } from "../../types/index.js";
|
|
3
|
+
type __VLS_Props = BaseInteractiveProps & {
|
|
4
|
+
label?: string;
|
|
5
|
+
border?: boolean;
|
|
6
|
+
color?: "warning" | "ok" | "danger" | "primary" | "secondary" | false;
|
|
7
|
+
} & /** @vue-ignore */ Omit<ButtonHTMLAttributes, "class" | "color"> & /** @vue-ignore */ TailwindClassProp;
|
|
8
|
+
declare var __VLS_1: {
|
|
9
|
+
classes: string;
|
|
10
|
+
}, __VLS_3: {}, __VLS_5: {
|
|
11
|
+
label: string;
|
|
12
|
+
}, __VLS_7: {};
|
|
13
|
+
type __VLS_Slots = {} & {
|
|
14
|
+
label?: (props: typeof __VLS_1) => any;
|
|
15
|
+
} & {
|
|
16
|
+
icon?: (props: typeof __VLS_3) => any;
|
|
17
|
+
} & {
|
|
18
|
+
default?: (props: typeof __VLS_5) => any;
|
|
19
|
+
} & {
|
|
20
|
+
'icon-after'?: (props: typeof __VLS_7) => any;
|
|
21
|
+
};
|
|
22
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
23
|
+
color: "warning" | "ok" | "danger" | "primary" | "secondary" | false;
|
|
24
|
+
border: boolean;
|
|
25
|
+
label: string;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { HTMLAttributes, InputHTMLAttributes } from "vue";
|
|
2
|
+
import type { BaseInteractiveProps, TailwindClassProp } from "../../types/index.js";
|
|
3
|
+
type __VLS_Props = BaseInteractiveProps & {
|
|
4
|
+
id?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
labelAttrs?: Omit<HTMLAttributes, "class"> & TailwindClassProp;
|
|
7
|
+
wrapperAttrs?: Omit<HTMLAttributes, "class"> & TailwindClassProp;
|
|
8
|
+
} & /** @vue-ignore */ Omit<InputHTMLAttributes, "class" | "readonly" | "disabled" | "onSumbit" | "autocomplete"> & /** @vue-ignore */ TailwindClassProp;
|
|
9
|
+
type __VLS_ModelProps = {
|
|
10
|
+
"modelValue"?: boolean | "indeterminate";
|
|
11
|
+
};
|
|
12
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
13
|
+
declare var __VLS_1: {}, __VLS_26: {};
|
|
14
|
+
type __VLS_Slots = {} & {
|
|
15
|
+
left?: (props: typeof __VLS_1) => any;
|
|
16
|
+
} & {
|
|
17
|
+
default?: (props: typeof __VLS_26) => any;
|
|
18
|
+
};
|
|
19
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
+
"update:modelValue": (value: boolean | "indeterminate") => any;
|
|
21
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
22
|
+
"onUpdate:modelValue"?: ((value: boolean | "indeterminate") => any) | undefined;
|
|
23
|
+
}>, {
|
|
24
|
+
border: boolean;
|
|
25
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|