@witchcraft/ui 0.3.26 → 0.4.0-beta.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 +54 -61
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/assets/animations.css +1 -1
- package/dist/runtime/assets/locales/en.json +2 -0
- package/dist/runtime/build/WitchcraftUiResolver.js +1 -1
- package/dist/runtime/components/TestControls/TestControls.vue +3 -3
- 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 +109 -0
- package/dist/runtime/components/WCheckbox/WCheckbox.vue.d.ts +33 -0
- package/dist/runtime/components/WColorInput/WColorInput.d.vue.ts +45 -0
- package/dist/runtime/components/WColorInput/WColorInput.vue +85 -0
- package/dist/runtime/components/WColorInput/WColorInput.vue.d.ts +45 -0
- 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} +7 -6
- package/dist/runtime/components/{LibColorPicker/LibColorPicker.vue → WColorPicker/WColorPicker.vue} +40 -29
- package/dist/runtime/components/{LibColorPicker/LibColorPicker.vue.d.ts → WColorPicker/WColorPicker.vue.d.ts} +7 -6
- package/dist/runtime/components/WCombobox/WCombobox.d.vue.ts +109 -0
- package/dist/runtime/components/WCombobox/WCombobox.vue +402 -0
- package/dist/runtime/components/WCombobox/WCombobox.vue.d.ts +109 -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} +8 -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} +8 -13
- package/dist/runtime/components/WDatePicker/WDatePicker.d.vue.ts +40 -0
- package/dist/runtime/components/{LibDatePicker/LibDatePicker.vue → WDatePicker/WDatePicker.vue} +3 -7
- package/dist/runtime/components/WDatePicker/WDatePicker.vue.d.ts +40 -0
- package/dist/runtime/components/{LibDatePicker/LibRangeDatePicker.vue → WDatePicker/WRangeDatePicker.vue} +16 -21
- package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.vue → WDatePicker/WSingleDatePicker.vue} +16 -21
- package/dist/runtime/components/{LibDatePicker/LibTimeZonePicker.d.vue.ts → WDatePicker/WTimeZonePicker.d.vue.ts} +1 -11
- package/dist/runtime/components/{LibDatePicker/LibTimeZonePicker.vue → WDatePicker/WTimeZonePicker.vue} +5 -12
- package/dist/runtime/components/{LibDatePicker/LibTimeZonePicker.vue.d.ts → WDatePicker/WTimeZonePicker.vue.d.ts} +1 -11
- package/dist/runtime/components/{LibDebug/LibDebug.vue → WDebug/WDebug.vue} +9 -12
- package/dist/runtime/components/{LibDevOnly/LibDevOnly.d.vue.ts → WDevOnly/WDevOnly.d.vue.ts} +0 -3
- package/dist/runtime/components/{LibDevOnly/LibDevOnly.vue.d.ts → WDevOnly/WDevOnly.vue.d.ts} +0 -3
- package/dist/runtime/components/WFileInput/WFileInput.d.vue.ts +58 -0
- package/dist/runtime/components/{LibFileInput/LibFileInput.vue → WFileInput/WFileInput.vue} +71 -57
- package/dist/runtime/components/WFileInput/WFileInput.vue.d.ts +58 -0
- package/dist/runtime/components/{Icon/Icon.vue.d.ts → WIcon/WIcon.d.vue.ts} +2 -6
- package/dist/runtime/components/{Icon/Icon.vue → WIcon/WIcon.vue} +1 -1
- package/dist/runtime/components/{Icon/Icon.d.vue.ts → WIcon/WIcon.vue.d.ts} +2 -6
- package/dist/runtime/components/{LibMultiValues/LibMultiValues.d.vue.ts → WMultiValues/WMultiValues.d.vue.ts} +8 -14
- package/dist/runtime/components/WMultiValues/WMultiValues.vue +149 -0
- package/dist/runtime/components/{LibMultiValues/LibMultiValues.vue.d.ts → WMultiValues/WMultiValues.vue.d.ts} +8 -14
- package/dist/runtime/components/WNotifications/WNotification.d.vue.ts +37 -0
- package/dist/runtime/components/{LibNotifications/LibNotification.vue → WNotifications/WNotification.vue} +32 -47
- package/dist/runtime/components/WNotifications/WNotification.vue.d.ts +37 -0
- package/dist/runtime/components/WNotifications/WNotifications.d.vue.ts +11 -0
- package/dist/runtime/components/{LibNotifications/LibNotifications.vue → WNotifications/WNotifications.vue} +35 -17
- package/dist/runtime/components/WNotifications/WNotifications.vue.d.ts +11 -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 +43 -0
- package/dist/runtime/components/WPopover/WPopover.vue +138 -0
- package/dist/runtime/components/WPopover/WPopover.vue.d.ts +43 -0
- package/dist/runtime/components/WPopup/WPopup.d.vue.ts +41 -0
- package/dist/runtime/components/WPopup/WPopup.vue +74 -0
- package/dist/runtime/components/WPopup/WPopup.vue.d.ts +41 -0
- package/dist/runtime/components/{LibProgressBar/LibProgressBar.d.vue.ts → WProgressBar/WProgressBar.d.vue.ts} +14 -18
- package/dist/runtime/components/WProgressBar/WProgressBar.vue +150 -0
- package/dist/runtime/components/{LibProgressBar/LibProgressBar.vue.d.ts → WProgressBar/WProgressBar.vue.d.ts} +14 -18
- package/dist/runtime/components/{LibRecorder/LibRecorder.d.vue.ts → WRecorder/WRecorder.d.vue.ts} +14 -29
- 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} +14 -29
- package/dist/runtime/components/{LibRoot/LibRoot.d.vue.ts → WRoot/WRoot.d.vue.ts} +6 -5
- 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} +6 -5
- package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.d.vue.ts → WSimpleInput/WSimpleInput.d.vue.ts} +9 -16
- package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.vue → WSimpleInput/WSimpleInput.vue} +12 -23
- package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.vue.d.ts → WSimpleInput/WSimpleInput.vue.d.ts} +9 -16
- package/dist/runtime/components/WTable/WTable.d.vue.ts +102 -0
- package/dist/runtime/components/{LibTable/LibTable.vue → WTable/WTable.vue} +13 -14
- 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 +111 -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/helpers/NotificationHandler.d.ts +2 -2
- package/dist/runtime/injectionKeys.d.ts +1 -5
- package/dist/runtime/injectionKeys.js +0 -2
- package/dist/runtime/types/index.d.ts +85 -27
- package/dist/runtime/types/index.js +1 -0
- package/package.json +1 -1
- package/src/module.ts +1 -1
- package/src/runtime/assets/animations.css +3 -3
- package/src/runtime/assets/locales/en.json +2 -0
- package/src/runtime/build/WitchcraftUiResolver.ts +1 -1
- 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 +123 -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} +43 -32
- package/src/runtime/components/WCombobox/WCombobox.stories.ts +209 -0
- package/src/runtime/components/WCombobox/WCombobox.vue +446 -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} +16 -22
- package/src/runtime/components/{LibDatePicker/LibSingleDatePicker.vue → WDatePicker/WSingleDatePicker.vue} +16 -22
- 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} +8 -11
- package/src/runtime/components/{LibDevOnly/LibDevOnly.vue → WDevOnly/WDevOnly.vue} +0 -4
- package/src/runtime/components/{LibFileInput/LibFileInput.stories.ts → WFileInput/WFileInput.stories.ts} +7 -7
- package/src/runtime/components/{LibFileInput/LibFileInput.vue → WFileInput/WFileInput.vue} +95 -98
- 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 +161 -0
- package/src/runtime/components/{LibNotifications/LibNotification.stories.ts → WNotifications/WNotification.stories.ts} +9 -9
- package/src/runtime/components/{LibNotifications/LibNotification.vue → WNotifications/WNotification.vue} +43 -66
- package/src/runtime/components/WNotifications/WNotifications.stories.ts +139 -0
- package/src/runtime/components/{LibNotifications/LibNotifications.vue → WNotifications/WNotifications.vue} +51 -29
- 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 +161 -0
- package/src/runtime/components/WPopup/WPopup.stories.ts +60 -0
- package/src/runtime/components/WPopup/WPopup.vue +93 -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} +27 -44
- package/src/runtime/components/{LibTable/LibTable.stories.ts → WTable/WTable.stories.ts} +60 -52
- package/src/runtime/components/{LibTable/LibTable.vue → WTable/WTable.vue} +85 -87
- package/src/runtime/components/WTooltip/WTooltip.stories.ts +82 -0
- package/src/runtime/components/WTooltip/WTooltip.vue +126 -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/helpers/NotificationHandler.ts +2 -2
- package/src/runtime/injectionKeys.ts +1 -7
- package/src/runtime/types/index.ts +105 -32
- package/types/components.d.ts +13 -15
- package/dist/runtime/components/Aria/Aria.d.vue.ts +0 -6
- package/dist/runtime/components/Aria/Aria.vue +0 -16
- package/dist/runtime/components/Aria/Aria.vue.d.ts +0 -6
- package/dist/runtime/components/LibButton/LibButton.d.vue.ts +0 -37
- package/dist/runtime/components/LibButton/LibButton.vue.d.ts +0 -37
- package/dist/runtime/components/LibCheckbox/LibCheckbox.d.vue.ts +0 -41
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +0 -103
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +0 -41
- package/dist/runtime/components/LibColorInput/LibColorInput.d.vue.ts +0 -64
- package/dist/runtime/components/LibColorInput/LibColorInput.vue +0 -162
- package/dist/runtime/components/LibColorInput/LibColorInput.vue.d.ts +0 -64
- package/dist/runtime/components/LibDatePicker/LibDatePicker.d.vue.ts +0 -191
- package/dist/runtime/components/LibDatePicker/LibDatePicker.vue.d.ts +0 -191
- package/dist/runtime/components/LibFileInput/LibFileInput.d.vue.ts +0 -46
- package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +0 -46
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.d.vue.ts +0 -256
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -387
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue.d.ts +0 -256
- package/dist/runtime/components/LibLabel/LibLabel.d.vue.ts +0 -27
- package/dist/runtime/components/LibLabel/LibLabel.vue +0 -45
- package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +0 -27
- package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +0 -109
- package/dist/runtime/components/LibNotifications/LibNotification.d.vue.ts +0 -45
- package/dist/runtime/components/LibNotifications/LibNotification.vue.d.ts +0 -45
- package/dist/runtime/components/LibNotifications/LibNotifications.d.vue.ts +0 -15
- package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +0 -15
- package/dist/runtime/components/LibPagination/LibPagination.d.vue.ts +0 -105
- package/dist/runtime/components/LibPagination/LibPagination.vue +0 -229
- package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +0 -105
- package/dist/runtime/components/LibPalette/LibPalette.d.vue.ts +0 -15
- package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +0 -15
- package/dist/runtime/components/LibPopup/LibPopup.d.vue.ts +0 -52
- package/dist/runtime/components/LibPopup/LibPopup.vue +0 -365
- package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +0 -52
- package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +0 -169
- package/dist/runtime/components/LibSuggestions/LibSuggestions.d.vue.ts +0 -99
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +0 -178
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +0 -99
- package/dist/runtime/components/LibTable/LibTable.d.vue.ts +0 -125
- package/dist/runtime/components/LibTable/LibTable.vue.d.ts +0 -125
- package/dist/runtime/components/Template/NAME.d.vue.ts +0 -18
- package/dist/runtime/components/Template/NAME.vue +0 -27
- package/dist/runtime/components/Template/NAME.vue.d.ts +0 -18
- 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 -131
- package/src/runtime/components/LibColorInput/LibColorInput.vue +0 -203
- package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.ts +0 -405
- package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -419
- 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 -131
- 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/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/LibRangeDatePicker.d.vue.ts → WDatePicker/WRangeDatePicker.d.vue.ts} +0 -0
- /package/dist/runtime/components/{LibDatePicker/LibRangeDatePicker.vue.d.ts → WDatePicker/WRangeDatePicker.vue.d.ts} +0 -0
- /package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.d.vue.ts → WDatePicker/WSingleDatePicker.d.vue.ts} +0 -0
- /package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.vue.d.ts → WDatePicker/WSingleDatePicker.vue.d.ts} +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/{LibDebug/LibDebug.d.vue.ts → WDebug/WDebug.d.vue.ts} +0 -0
- /package/dist/runtime/components/{LibDebug/LibDebug.vue.d.ts → WDebug/WDebug.vue.d.ts} +0 -0
- /package/dist/runtime/components/{LibDevOnly/LibDevOnly.vue → WDevOnly/WDevOnly.vue} +0 -0
- /package/dist/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.d.vue.ts → WNotifications/WNotificationTestMessageComponent.d.vue.ts} +0 -0
- /package/dist/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.vue → WNotifications/WNotificationTestMessageComponent.vue} +0 -0
- /package/dist/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.vue.d.ts → WNotifications/WNotificationTestMessageComponent.vue.d.ts} +0 -0
- /package/dist/runtime/components/{LibNotifications → WNotifications}/calculateNotificationProgress.d.ts +0 -0
- /package/dist/runtime/components/{LibNotifications → WNotifications}/calculateNotificationProgress.js +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/src/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.vue → WNotifications/WNotificationTestMessageComponent.vue} +0 -0
- /package/src/runtime/components/{LibNotifications → WNotifications}/calculateNotificationProgress.ts +0 -0
package/README.md
CHANGED
|
@@ -55,23 +55,6 @@ To make it easier to style parts of components or override behavior, some compon
|
|
|
55
55
|
|
|
56
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`.
|
|
57
57
|
|
|
58
|
-
# Slots
|
|
59
|
-
|
|
60
|
-
Usually it is possible to do most modifications through props, but slots to replace parts of components are available.
|
|
61
|
-
|
|
62
|
-
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.
|
|
63
|
-
|
|
64
|
-
```vue
|
|
65
|
-
<lib-simple-input-deprecated>
|
|
66
|
-
<template #input="slotProps">
|
|
67
|
-
<lib-simple-input
|
|
68
|
-
:class="'completely custom styles'"
|
|
69
|
-
v-bind="slotProps"
|
|
70
|
-
></lib-simple-input>
|
|
71
|
-
</template>
|
|
72
|
-
</lib-simple-input>
|
|
73
|
-
|
|
74
|
-
```
|
|
75
58
|
|
|
76
59
|
# Other
|
|
77
60
|
|
|
@@ -167,56 +150,66 @@ Note that using the strictTemplates compiler option can cause weird issues with
|
|
|
167
150
|
|
|
168
151
|
## Props
|
|
169
152
|
|
|
170
|
-
|
|
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:
|
|
171
154
|
|
|
172
|
-
Here is an example of the needed code for props to work correctly:
|
|
173
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>
|
|
174
166
|
<script lang="ts">
|
|
175
|
-
|
|
176
|
-
// and we can have interface merging, a setup script cannot interface merge
|
|
177
|
-
|
|
178
|
-
import type { BaseInteractiveProps } from "../shared/props.js"
|
|
179
|
-
|
|
180
|
-
// real props vue can understand, they will show up under props.*
|
|
181
|
-
type RealProps =
|
|
182
|
-
// simple types are okay
|
|
183
|
-
& BaseInteractiveProps
|
|
184
|
-
& {
|
|
185
|
-
// any ignored props that we need to use in the component template
|
|
186
|
-
// will need to be re-defined so vue can see them
|
|
187
|
-
// in a way vue can see them if it's one of the problem properties
|
|
188
|
-
id?: InputHTMLAttributes["id"]
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
interface Props
|
|
192
|
-
extends
|
|
193
|
-
// we need to ignore the complex InputHTMLAttributes type
|
|
194
|
-
// otherwise vue compilation fails
|
|
195
|
-
// if we ignore it, all it's properties are passed as fallback attrs
|
|
196
|
-
// NOT to props as normal
|
|
197
|
-
// we also need to omit properties or events that the component overrides with a different type
|
|
198
|
-
/** @vue-ignore */
|
|
199
|
-
Partial<Omit<InputHTMLAttributes,"class" | "onSubmit"> & {
|
|
200
|
-
// overrides for the components
|
|
201
|
-
// usually, for example, class can only be a string (because of tailwind)
|
|
202
|
-
// this will be passed as an attr
|
|
203
|
-
class?:string
|
|
204
|
-
}>,
|
|
205
|
-
/** @vue-ignore */
|
|
206
|
-
RealProps
|
|
207
|
-
{ }
|
|
208
|
-
</script>
|
|
167
|
+
import type { BaseInteractiveProps } from "../../types/index.js"
|
|
209
168
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
id: "",
|
|
213
|
-
unstyle: false, disabled:false, readonly:false, border:true,
|
|
214
|
-
})
|
|
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)
|
|
215
171
|
const $attrs = useAttrs()
|
|
216
|
-
|
|
217
|
-
|
|
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)
|
|
218
202
|
|
|
219
|
-
|
|
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: "LibComponentName"
|
|
210
|
+
// https://v3.vuejs.org/guide/typescript-support.html#annotating-props
|
|
211
|
+
}
|
|
212
|
+
</script>```
|
|
220
213
|
|
|
221
214
|
Related Links:
|
|
222
215
|
- https://github.com/vuejs/rfcs/discussions/397
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -19,7 +19,7 @@ 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
25
|
const module$1 = defineNuxtModule({
|
|
@@ -1 +1 @@
|
|
|
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:
|
|
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,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 }
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="twMerge(
|
|
4
|
+
`
|
|
5
|
+
checkbox--wrapper
|
|
6
|
+
flex
|
|
7
|
+
items-center
|
|
8
|
+
gap-1
|
|
9
|
+
`,
|
|
10
|
+
(disabled || readonly) && `
|
|
11
|
+
cursor-not-allowed
|
|
12
|
+
text-neutral-500
|
|
13
|
+
`,
|
|
14
|
+
wrapperAttrs?.class
|
|
15
|
+
)"
|
|
16
|
+
v-bind="{ ...wrapperAttrs, class: void 0 }"
|
|
17
|
+
ref="el"
|
|
18
|
+
>
|
|
19
|
+
<slot name="left"/>
|
|
20
|
+
<label
|
|
21
|
+
:class="twMerge(
|
|
22
|
+
`
|
|
23
|
+
checkbox--label
|
|
24
|
+
flex
|
|
25
|
+
items-center
|
|
26
|
+
gap-1
|
|
27
|
+
`,
|
|
28
|
+
labelAttrs?.class
|
|
29
|
+
)"
|
|
30
|
+
v-bind="{ ...labelAttrs, class: void 0 }"
|
|
31
|
+
>
|
|
32
|
+
<CheckboxRoot
|
|
33
|
+
:id="finalId"
|
|
34
|
+
:disabled="disabled || readonly"
|
|
35
|
+
:class="!unstyle && twMerge(
|
|
36
|
+
`
|
|
37
|
+
checkbox
|
|
38
|
+
flex
|
|
39
|
+
items-center
|
|
40
|
+
justify-center
|
|
41
|
+
focus-outline-no-offset
|
|
42
|
+
m-0
|
|
43
|
+
h-[1.2em]
|
|
44
|
+
w-[1.2em]
|
|
45
|
+
aspect-square
|
|
46
|
+
bg-neutral-500/10
|
|
47
|
+
text-white
|
|
48
|
+
dark:text-white
|
|
49
|
+
border
|
|
50
|
+
border-neutral-500
|
|
51
|
+
data-[state=checked]:border-accent-800/50
|
|
52
|
+
data-[state=checked]:bg-accent-500
|
|
53
|
+
data-[state=checked]:shadow-2xs
|
|
54
|
+
data-[state=checked]:shadow-black/20
|
|
55
|
+
data-[state=unchecked]:inset-shadow-2xs
|
|
56
|
+
data-[state=unchecked]:inset-shadow-black/20
|
|
57
|
+
focus:border-accent-600
|
|
58
|
+
rounded-sm
|
|
59
|
+
relative
|
|
60
|
+
transition-colors
|
|
61
|
+
dark:disabled:bg-neutral-800
|
|
62
|
+
cursor-pointer
|
|
63
|
+
disabled:text-neutral-500
|
|
64
|
+
disabled:bg-neutral-500/50
|
|
65
|
+
disabled:cursor-not-allowed
|
|
66
|
+
disabled:data-[state=checked]:border-neutral-500
|
|
67
|
+
`,
|
|
68
|
+
$attrs?.class
|
|
69
|
+
)"
|
|
70
|
+
v-bind="{ ...$attrs, class: void 0 }"
|
|
71
|
+
|
|
72
|
+
v-model="modelValue"
|
|
73
|
+
>
|
|
74
|
+
<CheckboxIndicator class="checkbox--indicator">
|
|
75
|
+
<WIcon class="scale-110 mt-[2px] ml-[0.5px] [&_path]:stroke-3"><i-lucide-check/></WIcon>
|
|
76
|
+
</CheckboxIndicator>
|
|
77
|
+
</CheckboxRoot>
|
|
78
|
+
|
|
79
|
+
<slot/> {{ label }}
|
|
80
|
+
</label>
|
|
81
|
+
</div>
|
|
82
|
+
</template>
|
|
83
|
+
|
|
84
|
+
<script setup>
|
|
85
|
+
import { CheckboxIndicator, CheckboxRoot } from "reka-ui";
|
|
86
|
+
import { useAttrs } from "vue";
|
|
87
|
+
import { useFallbackId } from "../../composables/useFallbackId.js";
|
|
88
|
+
import { usePreHydrationValue } from "../../composables/usePreHydrationValue.js";
|
|
89
|
+
import { twMerge } from "../../utils/twMerge.js";
|
|
90
|
+
import WIcon from "../WIcon/WIcon.vue";
|
|
91
|
+
const $attrs = useAttrs();
|
|
92
|
+
defineOptions({
|
|
93
|
+
name: "WCheckbox",
|
|
94
|
+
inheritAttrs: false
|
|
95
|
+
});
|
|
96
|
+
const props = defineProps({
|
|
97
|
+
disabled: { type: Boolean, required: false },
|
|
98
|
+
readonly: { type: Boolean, required: false },
|
|
99
|
+
border: { type: Boolean, required: false, default: true },
|
|
100
|
+
unstyle: { type: Boolean, required: false },
|
|
101
|
+
id: { type: String, required: false },
|
|
102
|
+
label: { type: String, required: false },
|
|
103
|
+
labelAttrs: { type: Object, required: false },
|
|
104
|
+
wrapperAttrs: { type: Object, required: false }
|
|
105
|
+
});
|
|
106
|
+
const modelValue = defineModel("modelValue", { type: [Boolean, String], ...{ default: false } });
|
|
107
|
+
const finalId = useFallbackId(props);
|
|
108
|
+
usePreHydrationValue(finalId, modelValue);
|
|
109
|
+
</script>
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { DialogRootEmits, PopoverRootProps } from "reka-ui";
|
|
2
|
+
import { type ButtonHTMLAttributes, type EmitsToProps, type HTMLAttributes } from "vue";
|
|
3
|
+
import type { HsvaColor, RgbaColor, TailwindClassProp } from "../../types/index.js";
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
id?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
allowAlpha?: boolean;
|
|
8
|
+
border?: boolean;
|
|
9
|
+
/** See ColorPicker.copyTransform */
|
|
10
|
+
copyTransform?: (val: HsvaColor, stringVal: string) => any;
|
|
11
|
+
/** See ColorPicker.allowAlpha */
|
|
12
|
+
stringPrecision?: number;
|
|
13
|
+
/** See ColorPicker.customRepresentation */
|
|
14
|
+
customRepresentation?: {
|
|
15
|
+
fromHsvaToString: (hsva: HsvaColor, includeAlpha: boolean) => string;
|
|
16
|
+
};
|
|
17
|
+
rootProps?: PopoverRootProps & EmitsToProps<DialogRootEmits> & Omit<HTMLAttributes, "class"> & TailwindClassProp;
|
|
18
|
+
} & /** @vue-ignore */ Omit<ButtonHTMLAttributes, "class"> & /** @vue-ignore */ TailwindClassProp;
|
|
19
|
+
type __VLS_ModelProps = {
|
|
20
|
+
modelValue?: RgbaColor;
|
|
21
|
+
"tempValue"?: RgbaColor | undefined;
|
|
22
|
+
};
|
|
23
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
24
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
|
+
"update:modelValue": (value: RgbaColor) => any;
|
|
26
|
+
"update:tempValue": (value: RgbaColor | undefined) => any;
|
|
27
|
+
} & {
|
|
28
|
+
save: () => any;
|
|
29
|
+
cancel: () => any;
|
|
30
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
31
|
+
"onUpdate:modelValue"?: ((value: RgbaColor) => any) | undefined;
|
|
32
|
+
onSave?: (() => any) | undefined;
|
|
33
|
+
onCancel?: (() => any) | undefined;
|
|
34
|
+
"onUpdate:tempValue"?: ((value: RgbaColor | undefined) => any) | undefined;
|
|
35
|
+
}>, {
|
|
36
|
+
border: boolean;
|
|
37
|
+
allowAlpha: boolean;
|
|
38
|
+
copyTransform: (val: HsvaColor, stringVal: string) => any;
|
|
39
|
+
stringPrecision: number;
|
|
40
|
+
customRepresentation: {
|
|
41
|
+
fromHsvaToString: (hsva: HsvaColor, includeAlpha: boolean) => string;
|
|
42
|
+
};
|
|
43
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
44
|
+
declare const _default: typeof __VLS_export;
|
|
45
|
+
export default _default;
|