@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
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
v-if="notification"
|
|
4
|
+
:role="notification.requiresAction ? 'alertdialog' : 'status'"
|
|
5
|
+
:aria-labelledby="notification.title ? `title-${notification.id}` : void 0"
|
|
6
|
+
:aria-describedby="notification.message ? `msg-${notification.id}` : void 0"
|
|
4
7
|
:class="
|
|
5
8
|
twMerge(
|
|
6
9
|
`
|
|
@@ -23,41 +26,41 @@
|
|
|
23
26
|
focus-within:border-accent-500
|
|
24
27
|
`,
|
|
25
28
|
$attrs.class,
|
|
26
|
-
notification.
|
|
29
|
+
notification.notificationAttrs?.class
|
|
27
30
|
)
|
|
28
31
|
"
|
|
29
|
-
v-bind="{ ...$attrs, ...notification?.
|
|
32
|
+
v-bind="{ ...$attrs, ...notification?.notificationAttrs ?? {}, class: void 0 }"
|
|
30
33
|
tabindex="0"
|
|
31
34
|
:data-id="notification.id"
|
|
32
35
|
ref="notificationEl"
|
|
33
36
|
@keydown.enter.self="NotificationHandler.resolveToDefault(notification)"
|
|
34
|
-
@pointerenter="notification.timeout && !notification.isPaused && emit('pause', notification)"
|
|
35
37
|
>
|
|
36
38
|
<slot
|
|
37
39
|
name="top"
|
|
38
40
|
:notification="notification"
|
|
39
41
|
/>
|
|
42
|
+
|
|
40
43
|
<div
|
|
41
44
|
class="
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
notification--header
|
|
46
|
+
flex-reverse
|
|
47
|
+
flex
|
|
48
|
+
justify-between
|
|
49
|
+
items-center
|
|
50
|
+
"
|
|
48
51
|
>
|
|
49
52
|
<slot
|
|
50
53
|
v-if="notification.title"
|
|
51
54
|
name="title"
|
|
52
55
|
v-bind="setSlotVar('title', {
|
|
56
|
+
id: `title-${notification.id}`,
|
|
53
57
|
title: notification.title,
|
|
54
58
|
class: `
|
|
55
59
|
notification--title
|
|
56
60
|
focus-outline
|
|
57
61
|
rounded-sm
|
|
58
62
|
font-bold
|
|
59
|
-
|
|
60
|
-
tabindex: 0
|
|
63
|
+
`
|
|
61
64
|
})"
|
|
62
65
|
>
|
|
63
66
|
<div
|
|
@@ -68,8 +71,9 @@
|
|
|
68
71
|
</slot>
|
|
69
72
|
<div class="notification--spacer flex-1"/>
|
|
70
73
|
<div class="notification--actions flex">
|
|
71
|
-
<
|
|
74
|
+
<WButton
|
|
72
75
|
:border="false"
|
|
76
|
+
aria-label="Copy notification content"
|
|
73
77
|
class="
|
|
74
78
|
notification--title-button
|
|
75
79
|
notification--copy-button
|
|
@@ -78,10 +82,11 @@
|
|
|
78
82
|
"
|
|
79
83
|
@click="copy(handler ? handler.stringify(notification) : JSON.stringify(notification))"
|
|
80
84
|
>
|
|
81
|
-
<
|
|
82
|
-
</
|
|
83
|
-
<
|
|
85
|
+
<WIcon><i-lucide-copy/></WIcon>
|
|
86
|
+
</WButton>
|
|
87
|
+
<WButton
|
|
84
88
|
v-if="notification.cancellable"
|
|
89
|
+
aria-label="Dismiss notification"
|
|
85
90
|
class="
|
|
86
91
|
notification--title-button
|
|
87
92
|
notification--cancel-button
|
|
@@ -89,8 +94,8 @@
|
|
|
89
94
|
:border="false"
|
|
90
95
|
@click="NotificationHandler.dismiss(notification)"
|
|
91
96
|
>
|
|
92
|
-
<
|
|
93
|
-
</
|
|
97
|
+
<WIcon><i-lucide-x/></WIcon>
|
|
98
|
+
</Wbutton>
|
|
94
99
|
</div>
|
|
95
100
|
</div>
|
|
96
101
|
<slot
|
|
@@ -106,12 +111,12 @@
|
|
|
106
111
|
dark:text-neutral-200
|
|
107
112
|
mb-1
|
|
108
113
|
`,
|
|
109
|
-
message: notification.message
|
|
110
|
-
tabindex: 0
|
|
114
|
+
message: notification.message
|
|
111
115
|
})"
|
|
112
116
|
>
|
|
113
117
|
<div
|
|
114
118
|
v-bind="slotVars.message"
|
|
119
|
+
:id="`msg-${notification.id}`"
|
|
115
120
|
>
|
|
116
121
|
{{ notification.message }}
|
|
117
122
|
</div>
|
|
@@ -120,6 +125,7 @@
|
|
|
120
125
|
v-if="notification.component"
|
|
121
126
|
:is="notification.component"
|
|
122
127
|
v-bind="{
|
|
128
|
+
notification,
|
|
123
129
|
message: notification.message,
|
|
124
130
|
messageClasses: `
|
|
125
131
|
notification--message
|
|
@@ -149,7 +155,7 @@
|
|
|
149
155
|
gap-2
|
|
150
156
|
"
|
|
151
157
|
>
|
|
152
|
-
<
|
|
158
|
+
<WButton
|
|
153
159
|
:label="option"
|
|
154
160
|
:class="twMerge(
|
|
155
161
|
`
|
|
@@ -170,17 +176,15 @@
|
|
|
170
176
|
</template>
|
|
171
177
|
|
|
172
178
|
<script setup>
|
|
173
|
-
import { computed,
|
|
174
|
-
import IFa6RegularCopy from "~icons/fa6-regular/copy";
|
|
175
|
-
import IFa6SolidXmark from "~icons/fa6-solid/xmark";
|
|
179
|
+
import { computed, onMounted, ref, useAttrs } from "vue";
|
|
176
180
|
import { useSlotVars } from "../../composables/useSlotVars.js";
|
|
177
181
|
import { copy } from "../../helpers/copy.js";
|
|
178
182
|
import { NotificationHandler } from "../../helpers/NotificationHandler.js";
|
|
179
183
|
import { twMerge } from "../../utils/twMerge.js";
|
|
180
|
-
import
|
|
181
|
-
import
|
|
184
|
+
import WButton from "../WButton/WButton.vue";
|
|
185
|
+
import WIcon from "../WIcon/WIcon.vue";
|
|
182
186
|
defineOptions({
|
|
183
|
-
name: "
|
|
187
|
+
name: "WNotification",
|
|
184
188
|
inheritAttrs: false
|
|
185
189
|
});
|
|
186
190
|
const $attrs = useAttrs();
|
|
@@ -189,38 +193,19 @@ const props = defineProps({
|
|
|
189
193
|
notification: { type: null, required: true },
|
|
190
194
|
handler: { type: Object, required: false, default: void 0 }
|
|
191
195
|
});
|
|
192
|
-
const emit = defineEmits(["pause", "resume"]);
|
|
193
196
|
const getColor = (notification, option) => {
|
|
194
197
|
return notification.dangerous.includes(option) ? "danger" : notification.default === option ? "primary" : "secondary";
|
|
195
198
|
};
|
|
196
199
|
const buttonColors = computed(() => props.notification.options.map((option) => getColor(props.notification, option)));
|
|
197
200
|
const notificationEl = ref(null);
|
|
198
|
-
const mousedownAbortController = new AbortController();
|
|
199
201
|
onMounted(() => {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
window.addEventListener("pointerdown", (e) => {
|
|
203
|
-
if (!e.target || !(e.target instanceof HTMLElement)) return;
|
|
204
|
-
if (e.target === notificationEl.value || notificationEl.value?.contains(e.target)) {
|
|
205
|
-
if (props.notification.isPaused) return;
|
|
206
|
-
emit("pause", props.notification);
|
|
207
|
-
} else {
|
|
208
|
-
if (!props.notification.isPaused) return;
|
|
209
|
-
emit("resume", props.notification);
|
|
210
|
-
}
|
|
211
|
-
}, { signal: mousedownAbortController.signal });
|
|
202
|
+
if (props.notification.requiresAction) {
|
|
203
|
+
notificationEl.value?.focus();
|
|
212
204
|
}
|
|
213
205
|
});
|
|
214
|
-
onBeforeUnmount(() => {
|
|
215
|
-
mousedownAbortController.abort();
|
|
216
|
-
});
|
|
217
206
|
defineExpose({
|
|
218
207
|
focus: () => {
|
|
219
208
|
notificationEl.value?.focus();
|
|
220
209
|
}
|
|
221
210
|
});
|
|
222
211
|
</script>
|
|
223
|
-
|
|
224
|
-
<script>
|
|
225
|
-
|
|
226
|
-
</script>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "vue";
|
|
2
|
+
import { type NotificationEntry, NotificationHandler } from "../../helpers/NotificationHandler.js";
|
|
3
|
+
import type { TailwindClassProp } from "../../types/index.js";
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
notification: NotificationEntry;
|
|
6
|
+
handler?: NotificationHandler;
|
|
7
|
+
} & /** @vue-ignore */ Omit<HTMLAttributes, "class"> & /** @vue-ignore */ TailwindClassProp;
|
|
8
|
+
declare var __VLS_1: {
|
|
9
|
+
notification: NotificationEntry;
|
|
10
|
+
}, __VLS_3: {
|
|
11
|
+
id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
class: string;
|
|
14
|
+
}, __VLS_43: {
|
|
15
|
+
class: string;
|
|
16
|
+
message: string;
|
|
17
|
+
};
|
|
18
|
+
type __VLS_Slots = {} & {
|
|
19
|
+
top?: (props: typeof __VLS_1) => any;
|
|
20
|
+
} & {
|
|
21
|
+
title?: (props: typeof __VLS_3) => any;
|
|
22
|
+
} & {
|
|
23
|
+
message?: (props: typeof __VLS_43) => any;
|
|
24
|
+
};
|
|
25
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
26
|
+
focus: () => void;
|
|
27
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
28
|
+
handler: NotificationHandler;
|
|
29
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
31
|
+
declare const _default: typeof __VLS_export;
|
|
32
|
+
export default _default;
|
|
33
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
34
|
+
new (): {
|
|
35
|
+
$slots: S;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "vue";
|
|
2
|
+
import { NotificationHandler } from "../../helpers/NotificationHandler.js";
|
|
3
|
+
import type { TailwindClassProp } from "../../types/index.js";
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
/** If not provided, uses the global handler (this requires useNotificationHandler be called and configured). */
|
|
6
|
+
handler?: NotificationHandler;
|
|
7
|
+
progressUpdateInterval?: number;
|
|
8
|
+
} & /** @vue-ignore */ Omit<HTMLAttributes, "class"> & /** @vue-ignore */ TailwindClassProp;
|
|
9
|
+
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>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
`, $attrs.class)"
|
|
25
25
|
v-bind="{ ...$attrs, class: void 0 }"
|
|
26
26
|
>
|
|
27
|
-
<
|
|
27
|
+
<WNotification
|
|
28
28
|
:handler="handler"
|
|
29
29
|
tabindex="0"
|
|
30
30
|
:notification="notification"
|
|
@@ -40,11 +40,9 @@
|
|
|
40
40
|
"
|
|
41
41
|
v-for="notification of notifications"
|
|
42
42
|
:key="notification.id"
|
|
43
|
-
@pause="handler.pause(notification)"
|
|
44
|
-
@resume="handler.resume(notification)"
|
|
45
43
|
>
|
|
46
44
|
<template #top>
|
|
47
|
-
<
|
|
45
|
+
<WProgressBar
|
|
48
46
|
v-if="notification.timeout !== void 0"
|
|
49
47
|
class="
|
|
50
48
|
w-full
|
|
@@ -57,7 +55,7 @@
|
|
|
57
55
|
:progress="calculateNotificationProgress(notification, time)"
|
|
58
56
|
/>
|
|
59
57
|
</template>
|
|
60
|
-
</
|
|
58
|
+
</Wnotification>
|
|
61
59
|
</TransitionGroup>
|
|
62
60
|
<!-- we don't need to worry about the user accidentally closing a non-closable dialog as keeping open=true (which the handler handles when the component tries to close) is enough to keep it open without issues -->
|
|
63
61
|
<AlertDialogRoot
|
|
@@ -67,7 +65,7 @@
|
|
|
67
65
|
<AlertDialogPortal :to="'#root'">
|
|
68
66
|
<AlertDialogOverlay
|
|
69
67
|
class="
|
|
70
|
-
fixed inset-0 z-
|
|
68
|
+
fixed inset-0 z-90
|
|
71
69
|
bg-neutral-950/20
|
|
72
70
|
data-[state=open]:animate-overlayShow
|
|
73
71
|
"
|
|
@@ -91,7 +89,7 @@
|
|
|
91
89
|
"
|
|
92
90
|
@interact-outside="topNotifications[0] && NotificationHandler.dismiss(topNotifications[0])"
|
|
93
91
|
>
|
|
94
|
-
<
|
|
92
|
+
<WNotification
|
|
95
93
|
class="
|
|
96
94
|
w-full
|
|
97
95
|
sm:max-w-[700px]
|
|
@@ -119,7 +117,7 @@
|
|
|
119
117
|
{{ slotProps.message }}
|
|
120
118
|
</AlertDialogDescription>
|
|
121
119
|
</template>
|
|
122
|
-
</
|
|
120
|
+
</Wnotification>
|
|
123
121
|
</AlertDialogContent>
|
|
124
122
|
</AlertDialogPortal>
|
|
125
123
|
</AlertDialogRoot>
|
|
@@ -134,20 +132,20 @@ import {
|
|
|
134
132
|
AlertDialogRoot,
|
|
135
133
|
AlertDialogTitle
|
|
136
134
|
} from "reka-ui";
|
|
137
|
-
import { computed } from "vue";
|
|
135
|
+
import { computed, onBeforeUnmount, onMounted, useAttrs } from "vue";
|
|
138
136
|
import { calculateNotificationProgress } from "./calculateNotificationProgress.js";
|
|
139
|
-
import
|
|
137
|
+
import WNotification from "./WNotification.vue";
|
|
140
138
|
import { useNotificationHandler } from "../../composables/useNotificationHandler.js";
|
|
141
139
|
import { useTimeConditionally } from "../../composables/useTimeConditionally.js";
|
|
142
140
|
import { NotificationHandler } from "../../helpers/NotificationHandler.js";
|
|
143
141
|
import { twMerge } from "../../utils/twMerge.js";
|
|
144
|
-
import
|
|
142
|
+
import WProgressBar from "../WProgressBar/WProgressBar.vue";
|
|
145
143
|
defineOptions({
|
|
146
|
-
name: "
|
|
144
|
+
name: "WNotifications",
|
|
147
145
|
inheritAttrs: false
|
|
148
146
|
});
|
|
147
|
+
const $attrs = useAttrs();
|
|
149
148
|
const props = defineProps({
|
|
150
|
-
id: { type: String, required: false },
|
|
151
149
|
handler: { type: Object, required: false },
|
|
152
150
|
progressUpdateInterval: { type: Number, required: false }
|
|
153
151
|
});
|
|
@@ -158,8 +156,28 @@ const fetchTime = computed(() => {
|
|
|
158
156
|
return notifications.value.filter((entry) => entry.timeout !== void 0 && !entry.isPaused).length > 0;
|
|
159
157
|
});
|
|
160
158
|
const { time } = useTimeConditionally(fetchTime, { refreshInterval: props.progressUpdateInterval });
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
159
|
+
function handleGlobalPointerDown(e) {
|
|
160
|
+
const target = e.target;
|
|
161
|
+
const notificationEl = target.closest(".notification");
|
|
162
|
+
const rawId = notificationEl?.dataset.id;
|
|
163
|
+
const clickedId = rawId ? Number.parseInt(rawId, 10) : null;
|
|
164
|
+
if (clickedId !== null) {
|
|
165
|
+
const entry = handler.queue.find((n) => n.id === clickedId);
|
|
166
|
+
if (entry && entry.timeout && !entry.isPaused) {
|
|
167
|
+
handler.pause(entry);
|
|
168
|
+
}
|
|
169
|
+
} else {
|
|
170
|
+
handler.queue.forEach((entry) => {
|
|
171
|
+
if (entry.timeout && entry.isPaused) {
|
|
172
|
+
handler.resume(entry);
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
onMounted(() => {
|
|
178
|
+
window.addEventListener("pointerdown", handleGlobalPointerDown);
|
|
179
|
+
});
|
|
180
|
+
onBeforeUnmount(() => {
|
|
181
|
+
window.removeEventListener("pointerdown", handleGlobalPointerDown);
|
|
182
|
+
});
|
|
165
183
|
</script>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "vue";
|
|
2
|
+
import { NotificationHandler } from "../../helpers/NotificationHandler.js";
|
|
3
|
+
import type { TailwindClassProp } from "../../types/index.js";
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
/** If not provided, uses the global handler (this requires useNotificationHandler be called and configured). */
|
|
6
|
+
handler?: NotificationHandler;
|
|
7
|
+
progressUpdateInterval?: number;
|
|
8
|
+
} & /** @vue-ignore */ Omit<HTMLAttributes, "class"> & /** @vue-ignore */ TailwindClassProp;
|
|
9
|
+
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>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { NumberFieldInputProps, NumberFieldRootEmits, NumberFieldRootProps } from "reka-ui";
|
|
2
|
+
import type { HTMLAttributes, InputHTMLAttributes } from "vue";
|
|
3
|
+
import type { EmitsToProps, TailwindClassProp } from "../../types/index.js";
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
id?: string;
|
|
6
|
+
max?: NumberFieldRootProps["max"];
|
|
7
|
+
min?: NumberFieldRootProps["min"];
|
|
8
|
+
step?: NumberFieldRootProps["step"];
|
|
9
|
+
isValid?: (value: any) => boolean;
|
|
10
|
+
inputProps?: NumberFieldInputProps & Omit<InputHTMLAttributes, "class"> & TailwindClassProp;
|
|
11
|
+
rootProps?: NumberFieldRootProps & EmitsToProps<NumberFieldRootEmits> & Omit<HTMLAttributes, "class"> & TailwindClassProp;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_ModelProps = {
|
|
14
|
+
modelValue: number;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
17
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
"update:modelValue": (value: number) => any;
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
20
|
+
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
21
|
+
}>, {
|
|
22
|
+
max: number;
|
|
23
|
+
min: number;
|
|
24
|
+
isValid: (value: any) => boolean;
|
|
25
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<NumberFieldRoot
|
|
3
|
+
:min="props.min"
|
|
4
|
+
:max="props.max"
|
|
5
|
+
:step="props.step"
|
|
6
|
+
:format-options="{
|
|
7
|
+
signDisplay: 'exceptZero',
|
|
8
|
+
...rootProps?.formatOptions
|
|
9
|
+
}"
|
|
10
|
+
:class="twMerge(
|
|
11
|
+
`
|
|
12
|
+
flex
|
|
13
|
+
items-center
|
|
14
|
+
justify-center
|
|
15
|
+
metadata-input-border
|
|
16
|
+
rounded-sm
|
|
17
|
+
focus-outline-within
|
|
18
|
+
gap-2
|
|
19
|
+
`,
|
|
20
|
+
!isValid && 'text-danger-500',
|
|
21
|
+
rootProps?.class
|
|
22
|
+
)"
|
|
23
|
+
v-bind="{ ...rootProps, class: void 0 }"
|
|
24
|
+
v-model="modelValue"
|
|
25
|
+
>
|
|
26
|
+
<NumberFieldDecrement
|
|
27
|
+
class="
|
|
28
|
+
px-1
|
|
29
|
+
flex-1
|
|
30
|
+
hover:bg-neutral-200
|
|
31
|
+
dark:hover:bg-neutral-800
|
|
32
|
+
[&_.button--label]:justify-start
|
|
33
|
+
rounded-bl-sm
|
|
34
|
+
rounded-tl-sm
|
|
35
|
+
cursor-pointer
|
|
36
|
+
disabled:cursor-not-allowed
|
|
37
|
+
"
|
|
38
|
+
>
|
|
39
|
+
<WIcon><i-radix-icons-minus/></WIcon>
|
|
40
|
+
</NumberFieldDecrement>
|
|
41
|
+
|
|
42
|
+
<NumberFieldInput
|
|
43
|
+
:class="twMerge(
|
|
44
|
+
`
|
|
45
|
+
bg-transparent
|
|
46
|
+
tabular-nums
|
|
47
|
+
text-center
|
|
48
|
+
focus-outline-none
|
|
49
|
+
px-1
|
|
50
|
+
shrink-1
|
|
51
|
+
basis-[20ch]
|
|
52
|
+
grow-0
|
|
53
|
+
min-w-0
|
|
54
|
+
[&::-webkit-outer-spin-button]:appearance-none
|
|
55
|
+
[&::-webkit-inner-spin-button]:appearance-none
|
|
56
|
+
[-moz-appearance:textfield]
|
|
57
|
+
`,
|
|
58
|
+
!isValid && 'text-danger-500',
|
|
59
|
+
inputProps?.class
|
|
60
|
+
)"
|
|
61
|
+
v-bind="{ ...inputProps, class: void 0 }"
|
|
62
|
+
/>
|
|
63
|
+
|
|
64
|
+
<NumberFieldIncrement
|
|
65
|
+
class="
|
|
66
|
+
px-1
|
|
67
|
+
flex-1
|
|
68
|
+
hover:bg-neutral-200
|
|
69
|
+
dark:hover:bg-neutral-800
|
|
70
|
+
[&_.button--label]:justify-end
|
|
71
|
+
rounded-br-sm
|
|
72
|
+
rounded-tr-sm
|
|
73
|
+
cursor-pointer
|
|
74
|
+
disabled:cursor-not-allowed
|
|
75
|
+
"
|
|
76
|
+
>
|
|
77
|
+
<WIcon><i-radix-icons-plus/></WIcon>
|
|
78
|
+
</NumberFieldIncrement>
|
|
79
|
+
</NumberFieldRoot>
|
|
80
|
+
</template>
|
|
81
|
+
|
|
82
|
+
<script setup>
|
|
83
|
+
import { twMerge } from "../../utils/twMerge.js";
|
|
84
|
+
const props = defineProps({
|
|
85
|
+
id: { type: String, required: false },
|
|
86
|
+
max: { type: Number, required: false, default: Number.MAX_SAFE_INTEGER },
|
|
87
|
+
min: { type: Number, required: false, default: Number.MIN_SAFE_INTEGER },
|
|
88
|
+
step: { type: Number, required: false },
|
|
89
|
+
isValid: { type: Function, required: false, default: (value) => {
|
|
90
|
+
return typeof value === "number" && !Number.isNaN(value);
|
|
91
|
+
} },
|
|
92
|
+
inputProps: { type: Object, required: false },
|
|
93
|
+
rootProps: { type: Object, required: false }
|
|
94
|
+
});
|
|
95
|
+
const modelValue = defineModel({ type: Number, ...{ required: true } });
|
|
96
|
+
</script>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { NumberFieldInputProps, NumberFieldRootEmits, NumberFieldRootProps } from "reka-ui";
|
|
2
|
+
import type { HTMLAttributes, InputHTMLAttributes } from "vue";
|
|
3
|
+
import type { EmitsToProps, TailwindClassProp } from "../../types/index.js";
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
id?: string;
|
|
6
|
+
max?: NumberFieldRootProps["max"];
|
|
7
|
+
min?: NumberFieldRootProps["min"];
|
|
8
|
+
step?: NumberFieldRootProps["step"];
|
|
9
|
+
isValid?: (value: any) => boolean;
|
|
10
|
+
inputProps?: NumberFieldInputProps & Omit<InputHTMLAttributes, "class"> & TailwindClassProp;
|
|
11
|
+
rootProps?: NumberFieldRootProps & EmitsToProps<NumberFieldRootEmits> & Omit<HTMLAttributes, "class"> & TailwindClassProp;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_ModelProps = {
|
|
14
|
+
modelValue: number;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
17
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
"update:modelValue": (value: number) => any;
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
20
|
+
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
21
|
+
}>, {
|
|
22
|
+
max: number;
|
|
23
|
+
min: number;
|
|
24
|
+
isValid: (value: any) => boolean;
|
|
25
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type PaginationRootProps } from "reka-ui";
|
|
2
|
+
import { type HTMLAttributes } from "vue";
|
|
3
|
+
import type { TailwindClassProp } from "../../types/index.js";
|
|
4
|
+
type __VLS_Props = /** @vue-ignore */ Omit<HTMLAttributes, "class"> & /** @vue-ignore */ TailwindClassProp & Pick<PaginationRootProps, "defaultPage" | "siblingCount" | "itemsPerPage"> & {
|
|
5
|
+
route: string;
|
|
6
|
+
customRoute?: (route: string, i: number) => {
|
|
7
|
+
i: number;
|
|
8
|
+
href: string;
|
|
9
|
+
};
|
|
10
|
+
total: number;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_ModelProps = {
|
|
13
|
+
"current": number;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
16
|
+
declare var __VLS_20: {}, __VLS_33: {}, __VLS_46: {
|
|
17
|
+
value: number;
|
|
18
|
+
}, __VLS_60: {}, __VLS_73: {};
|
|
19
|
+
type __VLS_Slots = {} & {
|
|
20
|
+
first?: (props: typeof __VLS_20) => any;
|
|
21
|
+
} & {
|
|
22
|
+
prev?: (props: typeof __VLS_33) => any;
|
|
23
|
+
} & {
|
|
24
|
+
page?: (props: typeof __VLS_46) => any;
|
|
25
|
+
} & {
|
|
26
|
+
next?: (props: typeof __VLS_60) => any;
|
|
27
|
+
} & {
|
|
28
|
+
last?: (props: typeof __VLS_73) => any;
|
|
29
|
+
};
|
|
30
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
|
+
"update:current": (value: number) => any;
|
|
32
|
+
} & {
|
|
33
|
+
"link-click": (event: MouseEvent, payload: {
|
|
34
|
+
i: number;
|
|
35
|
+
href: string;
|
|
36
|
+
}) => any;
|
|
37
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
38
|
+
"onLink-click"?: ((event: MouseEvent, payload: {
|
|
39
|
+
i: number;
|
|
40
|
+
href: string;
|
|
41
|
+
}) => any) | undefined;
|
|
42
|
+
"onUpdate:current"?: ((value: number) => any) | undefined;
|
|
43
|
+
}>, {
|
|
44
|
+
defaultPage: number;
|
|
45
|
+
siblingCount: number;
|
|
46
|
+
itemsPerPage: number;
|
|
47
|
+
customRoute: (route: string, i: number) => {
|
|
48
|
+
i: number;
|
|
49
|
+
href: string;
|
|
50
|
+
};
|
|
51
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
52
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
53
|
+
declare const _default: typeof __VLS_export;
|
|
54
|
+
export default _default;
|
|
55
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
56
|
+
new (): {
|
|
57
|
+
$slots: S;
|
|
58
|
+
};
|
|
59
|
+
};
|