@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,22 +1,22 @@
|
|
|
1
1
|
/* Manually Generated Index */
|
|
2
2
|
|
|
3
|
-
export { default as
|
|
4
|
-
export { default as
|
|
5
|
-
export { default as
|
|
6
|
-
export { default as
|
|
7
|
-
export { default as
|
|
8
|
-
export { default as
|
|
9
|
-
export { default as
|
|
10
|
-
export { default as
|
|
11
|
-
export { default as
|
|
12
|
-
export { default as
|
|
13
|
-
export { default as
|
|
14
|
-
export { default as
|
|
15
|
-
export { default as
|
|
16
|
-
export { default as
|
|
17
|
-
export { default as
|
|
18
|
-
export { default as
|
|
19
|
-
export { default as
|
|
20
|
-
export { default as
|
|
21
|
-
export { default as
|
|
22
|
-
export { default as
|
|
3
|
+
export { default as WButton } from "./WButton/WButton.vue"
|
|
4
|
+
export { default as WCheckbox } from "./WCheckbox/WCheckbox.vue"
|
|
5
|
+
export { default as WColorInput } from "./WColorInput/WColorInput.vue"
|
|
6
|
+
export { default as WColorPicker } from "./WColorPicker/WColorPicker.vue"
|
|
7
|
+
export { default as WCombobox } from "./WCombobox/WCombobox.vue"
|
|
8
|
+
export { default as WDarkModeSwitcher } from "./WDarkModeSwitcher/WDarkModeSwitcher.vue"
|
|
9
|
+
export { default as WDatePicker } from "./WDatePicker/WDatePicker.vue"
|
|
10
|
+
export { default as WDebug } from "./WDebug/WDebug.vue"
|
|
11
|
+
export { default as WFileInput } from "./WFileInput/WFileInput.vue"
|
|
12
|
+
export { default as WNotifications } from "./WNotifications/WNotifications.vue"
|
|
13
|
+
export { default as WPagination } from "./WPagination/WPagination.vue"
|
|
14
|
+
export { default as WPopup } from "./WPopup/WPopup.vue"
|
|
15
|
+
export { default as WPopover } from "./WPopover/WPopover.vue"
|
|
16
|
+
export { default as WProgressBar } from "./WProgressBar/WProgressBar.vue"
|
|
17
|
+
export { default as WRecorder } from "./WRecorder/WRecorder.vue"
|
|
18
|
+
export { default as WRoot } from "./WRoot/WRoot.vue"
|
|
19
|
+
export { default as WSimpleInput } from "./WSimpleInput/WSimpleInput.vue"
|
|
20
|
+
export { default as WTable } from "./WTable/WTable.vue"
|
|
21
|
+
export { default as WTimeZonePicker } from "./WDatePicker/WTimeZonePicker.vue"
|
|
22
|
+
export { default as WTooltip } from "./WTooltip/WTooltip.vue"
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/* Autogenerated Index */
|
|
2
2
|
|
|
3
3
|
export { useAccesibilityOutline } from "./useAccesibilityOutline.js"
|
|
4
|
-
export {
|
|
5
|
-
export { useDarkMode } from "./useDarkMode.js"
|
|
6
|
-
export { useDivideAttrs } from "./useDivideAttrs.js"
|
|
4
|
+
export { useDelayedLoadingIndicator } from "./useDelayedLoadingIndicator.js"
|
|
7
5
|
export { useDragWithThreshold } from "./useDragWithThreshold.js"
|
|
6
|
+
export { useFallbackId } from "./useFallbackId.js"
|
|
8
7
|
export { useGlobalResizeObserver } from "./useGlobalResizeObserver.js"
|
|
9
8
|
export { useInjectedDarkMode } from "./useInjectedDarkMode.js"
|
|
10
9
|
export { useInjectedI18n } from "./useInjectedI18n.js"
|
|
11
10
|
export { useInjectedLocale } from "./useInjectedLocale.js"
|
|
12
11
|
export { useNotificationHandler } from "./useNotificationHandler.js"
|
|
12
|
+
export { usePopupConstrainToStyle } from "./usePopupConstrainToStyle.js"
|
|
13
13
|
export { usePreHydrationValue } from "./usePreHydrationValue.js"
|
|
14
14
|
export { useScrollNearContainerEdges } from "./useScrollNearContainerEdges.js"
|
|
15
15
|
export { useSetupDarkMode } from "./useSetupDarkMode.js"
|
|
16
16
|
export { useSetupLocale } from "./useSetupLocale.js"
|
|
17
17
|
export { useShowDevOnlyKey } from "./useShowDevOnlyKey.js"
|
|
18
18
|
export { useSlotVars } from "./useSlotVars.js"
|
|
19
|
-
export {
|
|
19
|
+
export { useTimeConditionally } from "./useTimeConditionally.js"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Ref } from "vue"
|
|
2
|
+
import { ref, watch } from "vue"
|
|
3
|
+
/**
|
|
4
|
+
* For async operations sometimes it actually loads so fast the loading indicator is not visible but we still want it to be briefly visible. This delays the setting of the returned ref to false by the given timeout so it at least flashes onscreen.
|
|
5
|
+
*
|
|
6
|
+
* Setting to true is not delayed.
|
|
7
|
+
*
|
|
8
|
+
* If the indicator is set to true while the timeout is still running, it's canceled.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export function useDelayedLoadingIndicator(
|
|
12
|
+
loading: Ref<boolean>,
|
|
13
|
+
timeout: number = 200
|
|
14
|
+
) {
|
|
15
|
+
const showLoadingIndicator = ref(false)
|
|
16
|
+
let loadingTimeout: number | NodeJS.Timeout | undefined
|
|
17
|
+
watch(loading, newVal => {
|
|
18
|
+
clearTimeout(loadingTimeout)
|
|
19
|
+
if (newVal === true) {
|
|
20
|
+
showLoadingIndicator.value = true
|
|
21
|
+
} else {
|
|
22
|
+
loadingTimeout = setTimeout(() => {
|
|
23
|
+
if (loading.value === false) {
|
|
24
|
+
showLoadingIndicator.value = false
|
|
25
|
+
}
|
|
26
|
+
}, timeout)
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
return showLoadingIndicator
|
|
30
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { AcceptableValue, ComboboxRootProps } from "reka-ui"
|
|
2
|
+
|
|
3
|
+
export type SuggestionsDisplayProps<T extends NonNullable<AcceptableValue>> = {
|
|
4
|
+
displayKey?: string
|
|
5
|
+
/**
|
|
6
|
+
* Override's reka-ui's displayValue.
|
|
7
|
+
*
|
|
8
|
+
* Prefer displayKey or displayEntry if possible as it's easier to type and requires less code.
|
|
9
|
+
*
|
|
10
|
+
* It's passed a special options object with a `isForEmit` boolean that tells you whether the value will be used for emits or just visually/search. This is useful to v-model an id when suggestions are objects.
|
|
11
|
+
*/
|
|
12
|
+
displayValue?: (value: T | T[], options?: { isForEmit?: boolean }) => string
|
|
13
|
+
/**
|
|
14
|
+
* When displayKey is not enough, prefer this over displayValue as it takes care of extracting the entry (from the array/object/value).
|
|
15
|
+
*
|
|
16
|
+
* The component uses this to filter out the suggestions. In some rare cases you might want to display a different label than the one filtered on (e.g. for example, to indicate some suggestion is active), in these cases, the function will be called with the visualOnly option set to true. This applies only to the visual suggestion in the suggestion list.
|
|
17
|
+
*/
|
|
18
|
+
displayEntry?: (value: T, options: { isForEmit?: boolean }) => string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function useDisplayForReka<T extends NonNullable<ComboboxRootProps["modelValue"]>>(props: SuggestionsDisplayProps<T>) {
|
|
22
|
+
const display = props.displayValue ?? function (value: T, options: { isForEmit?: boolean } = {}): string {
|
|
23
|
+
if (Array.isArray(value)) {
|
|
24
|
+
return value.map(v => {
|
|
25
|
+
const val = v[props.displayKey as keyof typeof v]
|
|
26
|
+
return props.displayEntry?.(val, options) ?? val
|
|
27
|
+
}).filter(v => v !== "").join(", ")
|
|
28
|
+
} else if (typeof value === "object") {
|
|
29
|
+
return props.displayEntry?.(value as any, options) ?? value[props.displayKey as keyof typeof value] as any
|
|
30
|
+
} else {
|
|
31
|
+
// special case when reka resets
|
|
32
|
+
if (value === "" && !options.isForEmit) return ""
|
|
33
|
+
return props.displayEntry?.(value as any, options) ?? value as any
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return display
|
|
37
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { inject } from "vue"
|
|
2
2
|
|
|
3
|
-
import type { DarkModeCommands, DarkModeState } from "./useDarkMode.js"
|
|
4
|
-
|
|
5
3
|
import { darkModeCommandsInjectionKey, darkModeStateInjectionKey } from "../injectionKeys.js"
|
|
4
|
+
import type { DarkModeCommands, DarkModeState } from "../types/index.js"
|
|
6
5
|
|
|
7
6
|
export function useInjectedDarkMode(): DarkModeState & DarkModeCommands {
|
|
8
7
|
const darkModeState = inject(darkModeStateInjectionKey)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ComputedRef, StyleValue } from "vue"
|
|
2
|
+
import { computed } from "vue"
|
|
3
|
+
|
|
4
|
+
import type { PopupConstrainToProps } from "../types/index.js"
|
|
5
|
+
/**
|
|
6
|
+
* Mostly internal, create the computed style with maxWidth/Height based on the constrain*To props.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export function usePopupConstrainToStyle(rekaName: string, props: PopupConstrainToProps, attrsStyle?: StyleValue[]): ComputedRef<StyleValue[]> {
|
|
11
|
+
const contentStyle = computed(() => ([{
|
|
12
|
+
maxWidth: props.constrainWidthTo === "trigger"
|
|
13
|
+
? `var(--reka-${rekaName}-trigger-width)`
|
|
14
|
+
: props.constrainWidthTo === "available"
|
|
15
|
+
? `var(--reka-${rekaName}-content-available-width)`
|
|
16
|
+
: typeof props.constrainWidthTo === "number"
|
|
17
|
+
? `${props.constrainWidthTo}px`
|
|
18
|
+
: props.constrainWidthTo ?? undefined,
|
|
19
|
+
maxHeight: props.constrainHeightTo === "trigger"
|
|
20
|
+
? `var(--reka-${rekaName}-trigger-height)`
|
|
21
|
+
: props.constrainHeightTo === "available"
|
|
22
|
+
? `var(--reka-${rekaName}-content-available-height)`
|
|
23
|
+
: typeof props.constrainHeightTo === "number"
|
|
24
|
+
? `${props.constrainHeightTo}px`
|
|
25
|
+
: props.constrainHeightTo ?? undefined
|
|
26
|
+
}, ...(attrsStyle ?? [])] satisfies StyleValue[]))
|
|
27
|
+
return contentStyle
|
|
28
|
+
}
|
|
29
|
+
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { InjectionKey, Ref } from "vue"
|
|
2
|
+
import { computed, nextTick, onMounted, provide, ref, watch } from "vue"
|
|
3
|
+
|
|
4
|
+
import { darkModeCommandsInjectionKey, darkModeStateInjectionKey } from "../injectionKeys.js"
|
|
5
|
+
import type { DarkModeCommands, DarkModeOptions, DarkModeState } from "../types/index.js"
|
|
6
|
+
import { defaultDarkModeOrder } from "../types/index.js"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
const isDarkModeInjectionKey = Symbol("isDarkMode") as InjectionKey<Ref<boolean>>
|
|
10
|
+
const manualDarkModeInjectionKey = Symbol("manualDarkMode") as InjectionKey<Ref<boolean | undefined>>
|
|
11
|
+
const defaultLocalStorageKey = "prefersColorSchemeDark"
|
|
12
|
+
|
|
2
13
|
/**
|
|
3
14
|
* A composable for setting up dark mode that automatically takes care of saving the user's preference.
|
|
4
15
|
*
|
|
@@ -7,8 +18,115 @@ import { useDarkMode } from "./useDarkMode.js"
|
|
|
7
18
|
* Use it's twin, `useInjectedDarkMode` for accessing the injected state and commands in components
|
|
8
19
|
*
|
|
9
20
|
* Note that this should only be called once at the root of the app.
|
|
10
|
-
*
|
|
11
21
|
*/
|
|
12
|
-
export
|
|
13
|
-
|
|
22
|
+
export const useSetupDarkMode = ({
|
|
23
|
+
useLocalStorage = true,
|
|
24
|
+
darkModeOrder = defaultDarkModeOrder,
|
|
25
|
+
|
|
26
|
+
isClientSide = true,
|
|
27
|
+
useViewTransition = true
|
|
28
|
+
}: DarkModeOptions = {}): DarkModeState & DarkModeCommands => {
|
|
29
|
+
const systemDarkMode = ref(false)
|
|
30
|
+
const manualDarkMode = ref<boolean | undefined>(undefined)
|
|
31
|
+
|
|
32
|
+
if (useLocalStorage && isClientSide) {
|
|
33
|
+
watch(manualDarkMode, () => {
|
|
34
|
+
localStorage.setItem(defaultLocalStorageKey, manualDarkMode.value ? "true" : "false")
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const darkMode = computed(() => manualDarkMode.value ?? systemDarkMode.value)
|
|
39
|
+
const darkModeState = computed(() =>
|
|
40
|
+
manualDarkMode.value === undefined
|
|
41
|
+
? "system"
|
|
42
|
+
: manualDarkMode.value
|
|
43
|
+
? "dark"
|
|
44
|
+
: "light"
|
|
45
|
+
)
|
|
46
|
+
// todo move to useinjected
|
|
47
|
+
function setDarkMode(value: "dark" | "light" | "system"): void {
|
|
48
|
+
manualDarkMode.value
|
|
49
|
+
= value === "dark"
|
|
50
|
+
? true
|
|
51
|
+
: value === "light"
|
|
52
|
+
? false
|
|
53
|
+
: undefined
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function getNextValue(): "dark" | "light" | "system" {
|
|
57
|
+
const index = darkModeOrder.indexOf(darkModeState.value)
|
|
58
|
+
|
|
59
|
+
return index === 2
|
|
60
|
+
? darkModeOrder[0]!
|
|
61
|
+
: darkModeOrder[index + 1]!
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function _cycleDarkMode(): void {
|
|
65
|
+
setDarkMode(getNextValue())
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function cycleDarkMode(): void {
|
|
69
|
+
if (!useViewTransition) {
|
|
70
|
+
_cycleDarkMode()
|
|
71
|
+
return
|
|
72
|
+
}
|
|
73
|
+
const nextValue = getNextValue()
|
|
74
|
+
const index = darkModeOrder.indexOf(darkModeState.value)
|
|
75
|
+
const systemDarkModeName = systemDarkMode.value ? "dark" : "light"
|
|
76
|
+
|
|
77
|
+
if (nextValue === "system" && systemDarkModeName === darkModeOrder[index]) {
|
|
78
|
+
// don't do view transitions if we're not really transitioning
|
|
79
|
+
_cycleDarkMode()
|
|
80
|
+
return
|
|
81
|
+
}
|
|
82
|
+
if (!document.startViewTransition) _cycleDarkMode()
|
|
83
|
+
document.startViewTransition(async () => {
|
|
84
|
+
_cycleDarkMode()
|
|
85
|
+
await nextTick()
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
onMounted(() => {
|
|
90
|
+
window.matchMedia("(prefers-color-scheme: dark)")
|
|
91
|
+
.addEventListener("change", ({ matches }) => {
|
|
92
|
+
if (matches) {
|
|
93
|
+
systemDarkMode.value = true
|
|
94
|
+
} else {
|
|
95
|
+
systemDarkMode.value = false
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
if (useLocalStorage !== false) {
|
|
99
|
+
const key = typeof useLocalStorage === "string" ? useLocalStorage : defaultLocalStorageKey
|
|
100
|
+
const value = localStorage.getItem(key)
|
|
101
|
+
|
|
102
|
+
if (value === "true") {
|
|
103
|
+
manualDarkMode.value = true
|
|
104
|
+
} else if (value === "false") {
|
|
105
|
+
manualDarkMode.value = false
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
provide(isDarkModeInjectionKey, darkMode)
|
|
110
|
+
provide(manualDarkModeInjectionKey, manualDarkMode)
|
|
111
|
+
|
|
112
|
+
provide(darkModeStateInjectionKey, {
|
|
113
|
+
darkMode,
|
|
114
|
+
darkModeState,
|
|
115
|
+
manualDarkMode,
|
|
116
|
+
systemDarkMode
|
|
117
|
+
})
|
|
118
|
+
provide(darkModeCommandsInjectionKey, {
|
|
119
|
+
setDarkMode,
|
|
120
|
+
cycleDarkMode
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
darkMode,
|
|
125
|
+
darkModeState,
|
|
126
|
+
setDarkMode,
|
|
127
|
+
cycleDarkMode,
|
|
128
|
+
manualDarkMode,
|
|
129
|
+
systemDarkMode
|
|
130
|
+
}
|
|
14
131
|
}
|
|
132
|
+
|
|
@@ -239,12 +239,12 @@ export type RawNotificationEntry<
|
|
|
239
239
|
/** Props for the custom component. By default the component is passed the message, the messageClasses, and the full notification. Both will be overriden if you set them on componentProps. */
|
|
240
240
|
componentProps?: Record<string, any> & { notification: NotificationEntry, message: string, messageClasses: string }
|
|
241
241
|
/**
|
|
242
|
-
*
|
|
242
|
+
* Attributes for the notification component itself. They are bound to the root of the element and the class property is merged with twMerge.
|
|
243
243
|
*
|
|
244
244
|
* The most likely use is needing to adjust the width of fullscreen notifications, but fullscreen notifications have two widths (one for big screens and one for small ones (sm). You will usually want to do something like `{notificationProps: {class: 'sm:max-w-[90dvw]'}}` to change only the large one.
|
|
245
245
|
*
|
|
246
246
|
*/
|
|
247
|
-
|
|
247
|
+
notificationAttrs?: Record<string, any>
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
export type NotificationEntry<
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import type { InjectionKey, Ref } from "vue"
|
|
2
2
|
|
|
3
|
-
import type { DarkModeCommands, DarkModeState } from "./composables/useDarkMode.js"
|
|
4
3
|
import type { TranslationFunction } from "./composables/useSetupI18n.js"
|
|
5
|
-
|
|
6
|
-
/** @deprecated */
|
|
7
|
-
export const isDarkModeInjectionKey = Symbol("isDarkMode") as InjectionKey<Ref<boolean>>
|
|
8
|
-
|
|
9
|
-
/** @deprecated */
|
|
10
|
-
export const manualDarkModeInjectionKey = Symbol("manualDarkMode") as InjectionKey<Ref<boolean | undefined>>
|
|
4
|
+
import type { DarkModeCommands, DarkModeState } from "./types/index.js"
|
|
11
5
|
|
|
12
6
|
export const darkModeCommandsInjectionKey = Symbol("darkModeCommands") as InjectionKey<DarkModeCommands>
|
|
13
7
|
|
|
@@ -84,38 +84,6 @@ export type ScrollNearContainerEdgesOptions = {
|
|
|
84
84
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
85
85
|
export type SimpleDOMRect = Omit<DOMRect, "toJSON">
|
|
86
86
|
|
|
87
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
88
|
-
export interface IPopupReference { getBoundingClientRect: () => SimpleDOMRect }
|
|
89
|
-
export type PopupPosition = { x: number, y: number, maxWidth?: number, maxHeight?: number }
|
|
90
|
-
export type PopupSpaceInfo = {
|
|
91
|
-
left: number
|
|
92
|
-
right: number
|
|
93
|
-
leftLeft: number
|
|
94
|
-
rightRight: number
|
|
95
|
-
leftFromCenter: number
|
|
96
|
-
rightFromCenter: number
|
|
97
|
-
topFromCenter: number
|
|
98
|
-
bottomFromCenter: number
|
|
99
|
-
top: number
|
|
100
|
-
bottom: number
|
|
101
|
-
}
|
|
102
|
-
export type PopupPositioner = (
|
|
103
|
-
/** Reference is only undefined, if you did not specify a button element or use the exposed setReference. The function is still called, because there are other ways you might want to still position the popup (e.g. center-screen or some similar variation). */
|
|
104
|
-
reference: SimpleDOMRect | undefined,
|
|
105
|
-
popup: SimpleDOMRect | DOMRect,
|
|
106
|
-
bg: SimpleDOMRect | DOMRect,
|
|
107
|
-
space: PopupSpaceInfo
|
|
108
|
-
) => number
|
|
109
|
-
|
|
110
|
-
export type PopupPositionModifier = (
|
|
111
|
-
pos: PopupPosition,
|
|
112
|
-
/** This will only be called with the reference element as undefined when one of the preferred positions is center-screen or it's a function. */
|
|
113
|
-
reference: SimpleDOMRect | undefined,
|
|
114
|
-
popup: SimpleDOMRect | DOMRect,
|
|
115
|
-
bg: SimpleDOMRect | DOMRect,
|
|
116
|
-
space: PopupSpaceInfo
|
|
117
|
-
) => PopupPosition
|
|
118
|
-
|
|
119
87
|
export type SingleDate = Date | undefined
|
|
120
88
|
|
|
121
89
|
export type RangeDate = {
|
|
@@ -127,3 +95,108 @@ export type CustomNotificationComponentProps = {
|
|
|
127
95
|
message: string
|
|
128
96
|
messageClasses?: string
|
|
129
97
|
}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
export type BaseInteractiveProps = {
|
|
101
|
+
/** Default is false. */
|
|
102
|
+
disabled?: boolean
|
|
103
|
+
/** Default is false. */
|
|
104
|
+
readonly?: boolean
|
|
105
|
+
/** Default is true. */
|
|
106
|
+
border?: boolean
|
|
107
|
+
/** Removes styles from the component. Default is false. */
|
|
108
|
+
unstyle?: boolean
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
export type TailwindClassProp = {
|
|
113
|
+
/** Tailwind classes. */
|
|
114
|
+
class?: string | false
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
export const defaultDarkModeOrder = ["system", "dark", "light"] as const
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
export type DarkModeOptions = {
|
|
122
|
+
/* Whether to save the manual dark mode to local storage. Uses the key "prefersColorSchemeDark" by default. You can pass a key instead of true to use that as the key instead. */
|
|
123
|
+
useLocalStorage?: boolean | string
|
|
124
|
+
/* The order of the string dark modes when using `cycleDarkMode`. Defaults to `["system", "dark", "light"]` */
|
|
125
|
+
darkModeOrder?: readonly ("system" | "dark" | "light")[]
|
|
126
|
+
/** True by default, should be passed import.meta.client if using nuxt, or false when running server side. */
|
|
127
|
+
isClientSide?: boolean
|
|
128
|
+
/**
|
|
129
|
+
* Whether to use the view transition to animate the dark mode switch (you just need to add the css).
|
|
130
|
+
*
|
|
131
|
+
* Note that the transitition is NOT triggered if visually the mode does not change (e.g. system mode is dark and the user switches from system to dark, visually nothing changes so transitioning is skipped).
|
|
132
|
+
*
|
|
133
|
+
* There is an example in storybook. But basically:
|
|
134
|
+
*
|
|
135
|
+
* ```css
|
|
136
|
+
*
|
|
137
|
+
* #root { // the dark mode switcher works on the WRoot component not the html root
|
|
138
|
+
* view-transition-name: wroot;
|
|
139
|
+
* height: 100dvh;
|
|
140
|
+
* padding: 0;
|
|
141
|
+
* }
|
|
142
|
+
*
|
|
143
|
+
* ::view-transition-new(wroot) {
|
|
144
|
+
* animation: grow var(--story-anim-length) ease-in-out;
|
|
145
|
+
* animation-fill-mode: both;
|
|
146
|
+
* z-index: 2;
|
|
147
|
+
* mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><circle cx="20" cy="20" r="20" fill="white"/></svg>') center / 0 no-repeat;
|
|
148
|
+
* }
|
|
149
|
+
*
|
|
150
|
+
* ::view-transition-old(wroot) {
|
|
151
|
+
* animation: none;
|
|
152
|
+
* animation-fill-mode: both;
|
|
153
|
+
* z-index: 1;
|
|
154
|
+
* }
|
|
155
|
+
*
|
|
156
|
+
* @keyframes grow {
|
|
157
|
+
* from {
|
|
158
|
+
* mask-size: 0dvw;
|
|
159
|
+
* }
|
|
160
|
+
* to {
|
|
161
|
+
* mask-size: 300dvw;
|
|
162
|
+
* }
|
|
163
|
+
* }
|
|
164
|
+
* ```
|
|
165
|
+
*
|
|
166
|
+
* See https://theme-toggle.rdsx.dev/ for more ideas.
|
|
167
|
+
*
|
|
168
|
+
* @default true
|
|
169
|
+
*/
|
|
170
|
+
useViewTransition?: boolean
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export interface DarkModeCommands {
|
|
174
|
+
setDarkMode: (value: "dark" | "light" | "system") => void
|
|
175
|
+
cycleDarkMode: () => void
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface DarkModeState {
|
|
179
|
+
/** Whether the dark mode should be enabled or not */
|
|
180
|
+
darkMode: Ref<boolean>
|
|
181
|
+
/** The current state of the darkMode but as a string (dark, light, system) */
|
|
182
|
+
darkModeState: Ref<"dark" | "light" | "system">
|
|
183
|
+
/** The value of the manuably controllable dark mode. You can set this to true/false or undefined to allow the systemDarkMode to take priority. Alternatively use setDarkMode instead. */
|
|
184
|
+
manualDarkMode: Ref<boolean | undefined>
|
|
185
|
+
/** The value of the system dark mode. This is automatically set depending on the user's `prefer-color-scheme` and should not be set directly. */
|
|
186
|
+
systemDarkMode: Ref<boolean>
|
|
187
|
+
|
|
188
|
+
}
|
|
189
|
+
export type PopupConstrainToProps = {
|
|
190
|
+
constrainWidthTo?: number | "trigger" | "available" | string | null
|
|
191
|
+
constrainHeightTo?: number | "trigger" | "available" | string | null
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
export type EmitsToProps<T> = {
|
|
196
|
+
[K in keyof T as K extends string ? `on${Capitalize<K>}` : never]?:
|
|
197
|
+
T[K] extends (...args: infer Args) => any
|
|
198
|
+
? (...args: Args) => void
|
|
199
|
+
: T[K] extends any[]
|
|
200
|
+
? (...args: T[K]) => void
|
|
201
|
+
: T[K]
|
|
202
|
+
}
|
package/types/components.d.ts
CHANGED
|
@@ -8,20 +8,18 @@ export {}
|
|
|
8
8
|
/* prettier-ignore */
|
|
9
9
|
declare module 'vue' {
|
|
10
10
|
export interface GlobalComponents {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
RouterLink: typeof import('vue-router')['RouterLink']
|
|
25
|
-
RouterView: typeof import('vue-router')['RouterView']
|
|
11
|
+
ILucideCalendarDays: typeof import('~icons/lucide/calendar-days')['default']
|
|
12
|
+
ILucideCalendarRange: typeof import('~icons/lucide/calendar-range')['default']
|
|
13
|
+
ILucideCheck: typeof import('~icons/lucide/check')['default']
|
|
14
|
+
ILucideChevronLeft: typeof import('~icons/lucide/chevron-left')['default']
|
|
15
|
+
ILucideChevronRight: typeof import('~icons/lucide/chevron-right')['default']
|
|
16
|
+
ILucideChevronsLeft: typeof import('~icons/lucide/chevrons-left')['default']
|
|
17
|
+
ILucideChevronsRight: typeof import('~icons/lucide/chevrons-right')['default']
|
|
18
|
+
ILucideCopy: typeof import('~icons/lucide/copy')['default']
|
|
19
|
+
ILucideFile: typeof import('~icons/lucide/file')['default']
|
|
20
|
+
ILucideInfo: typeof import('~icons/lucide/info')['default']
|
|
21
|
+
ILucideLoaderCircle: typeof import('~icons/lucide/loader-circle')['default']
|
|
22
|
+
ILucideUpload: typeof import('~icons/lucide/upload')['default']
|
|
23
|
+
ILucideX: typeof import('~icons/lucide/x')['default']
|
|
26
24
|
}
|
|
27
25
|
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
value: string;
|
|
3
|
-
};
|
|
4
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
-
declare const _default: typeof __VLS_export;
|
|
6
|
-
export default _default;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div tabindex="0">
|
|
3
|
-
{{ value }}
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup>
|
|
8
|
-
defineOptions({ name: "Aria" });
|
|
9
|
-
defineProps({
|
|
10
|
-
value: { type: String, required: true }
|
|
11
|
-
});
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<style scoped>
|
|
15
|
-
div{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);white-space:nowrap}
|
|
16
|
-
</style>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
value: string;
|
|
3
|
-
};
|
|
4
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
-
declare const _default: typeof __VLS_export;
|
|
6
|
-
export default _default;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { type ButtonHTMLAttributes } from "vue";
|
|
2
|
-
import { type BaseInteractiveProps, type ButtonProps, type LabelProps, type LinkableByIdProps, type TailwindClassProp } from "../shared/props.js";
|
|
3
|
-
type RealProps = LinkableByIdProps & LabelProps & BaseInteractiveProps & ButtonProps;
|
|
4
|
-
interface Props extends
|
|
5
|
-
/** @vue-ignore */
|
|
6
|
-
Partial<Omit<ButtonHTMLAttributes, "class" | "color" | "disabled"> & TailwindClassProp & {
|
|
7
|
-
"aria-label": string;
|
|
8
|
-
}>, RealProps {
|
|
9
|
-
}
|
|
10
|
-
declare const _default: typeof __VLS_export;
|
|
11
|
-
export default _default;
|
|
12
|
-
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
13
|
-
label: string;
|
|
14
|
-
color: "warning" | "ok" | "danger" | "primary" | "secondary" | false;
|
|
15
|
-
disabled: boolean;
|
|
16
|
-
readonly: boolean;
|
|
17
|
-
border: boolean;
|
|
18
|
-
unstyle: boolean;
|
|
19
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
20
|
-
label?: (props: {
|
|
21
|
-
id: string;
|
|
22
|
-
classes: string;
|
|
23
|
-
}) => any;
|
|
24
|
-
} & {
|
|
25
|
-
icon?: (props: {}) => any;
|
|
26
|
-
} & {
|
|
27
|
-
default?: (props: {
|
|
28
|
-
label: string;
|
|
29
|
-
}) => any;
|
|
30
|
-
} & {
|
|
31
|
-
'icon-after'?: (props: {}) => any;
|
|
32
|
-
}>;
|
|
33
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
34
|
-
new (): {
|
|
35
|
-
$slots: S;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { type ButtonHTMLAttributes } from "vue";
|
|
2
|
-
import { type BaseInteractiveProps, type ButtonProps, type LabelProps, type LinkableByIdProps, type TailwindClassProp } from "../shared/props.js";
|
|
3
|
-
type RealProps = LinkableByIdProps & LabelProps & BaseInteractiveProps & ButtonProps;
|
|
4
|
-
interface Props extends
|
|
5
|
-
/** @vue-ignore */
|
|
6
|
-
Partial<Omit<ButtonHTMLAttributes, "class" | "color" | "disabled"> & TailwindClassProp & {
|
|
7
|
-
"aria-label": string;
|
|
8
|
-
}>, RealProps {
|
|
9
|
-
}
|
|
10
|
-
declare const _default: typeof __VLS_export;
|
|
11
|
-
export default _default;
|
|
12
|
-
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
13
|
-
label: string;
|
|
14
|
-
color: "warning" | "ok" | "danger" | "primary" | "secondary" | false;
|
|
15
|
-
disabled: boolean;
|
|
16
|
-
readonly: boolean;
|
|
17
|
-
border: boolean;
|
|
18
|
-
unstyle: boolean;
|
|
19
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
20
|
-
label?: (props: {
|
|
21
|
-
id: string;
|
|
22
|
-
classes: string;
|
|
23
|
-
}) => any;
|
|
24
|
-
} & {
|
|
25
|
-
icon?: (props: {}) => any;
|
|
26
|
-
} & {
|
|
27
|
-
default?: (props: {
|
|
28
|
-
label: string;
|
|
29
|
-
}) => any;
|
|
30
|
-
} & {
|
|
31
|
-
'icon-after'?: (props: {}) => any;
|
|
32
|
-
}>;
|
|
33
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
34
|
-
new (): {
|
|
35
|
-
$slots: S;
|
|
36
|
-
};
|
|
37
|
-
};
|