@witchcraft/ui 0.2.1-beta.3 → 0.2.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.
Files changed (203) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +20 -4
  3. package/dist/runtime/build/WitchcraftUiResolver.d.ts +2 -2
  4. package/dist/runtime/build/generateTheme.js +2 -2
  5. package/dist/runtime/components/Aria/Aria.d.vue.ts +5 -0
  6. package/dist/runtime/components/Aria/Aria.vue +4 -2
  7. package/dist/runtime/components/Aria/Aria.vue.d.ts +1 -1
  8. package/dist/runtime/components/Icon/Icon.d.vue.ts +21 -0
  9. package/dist/runtime/components/Icon/Icon.vue +3 -3
  10. package/dist/runtime/components/Icon/Icon.vue.d.ts +1 -1
  11. package/dist/runtime/components/LibButton/LibButton.d.vue.ts +36 -0
  12. package/dist/runtime/components/LibButton/LibButton.vue +9 -4
  13. package/dist/runtime/components/LibButton/LibButton.vue.d.ts +1 -1
  14. package/dist/runtime/components/LibCheckbox/LibCheckbox.d.vue.ts +42 -0
  15. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +3 -4
  16. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +1 -1
  17. package/dist/runtime/components/LibColorInput/LibColorInput.d.vue.ts +63 -0
  18. package/dist/runtime/components/LibColorInput/LibColorInput.vue +15 -8
  19. package/dist/runtime/components/LibColorInput/LibColorInput.vue.d.ts +1 -1
  20. package/dist/runtime/components/LibColorPicker/LibColorPicker.d.vue.ts +61 -0
  21. package/dist/runtime/components/LibColorPicker/LibColorPicker.vue +10 -6
  22. package/dist/runtime/components/LibColorPicker/LibColorPicker.vue.d.ts +1 -1
  23. package/dist/runtime/components/LibColorPicker/utils/truncate.js +1 -1
  24. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.d.vue.ts +22 -0
  25. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +5 -2
  26. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue.d.ts +1 -1
  27. package/dist/runtime/components/LibDatePicker/LibDatePicker.d.vue.ts +40 -0
  28. package/dist/runtime/components/LibDatePicker/LibDatePicker.vue.d.ts +1 -1
  29. package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.d.vue.ts +34 -0
  30. package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue +8 -6
  31. package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue.d.ts +1 -1
  32. package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.d.vue.ts +34 -0
  33. package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue +7 -5
  34. package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue.d.ts +1 -1
  35. package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.d.vue.ts +22 -0
  36. package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue.d.ts +1 -1
  37. package/dist/runtime/components/LibDebug/LibDebug.d.vue.ts +32 -0
  38. package/dist/runtime/components/LibDebug/LibDebug.vue +9 -4
  39. package/dist/runtime/components/LibDebug/LibDebug.vue.d.ts +1 -1
  40. package/dist/runtime/components/LibDevOnly/LibDevOnly.d.vue.ts +25 -0
  41. package/dist/runtime/components/LibDevOnly/LibDevOnly.vue +2 -1
  42. package/dist/runtime/components/LibDevOnly/LibDevOnly.vue.d.ts +4 -1
  43. package/dist/runtime/components/LibFileInput/LibFileInput.d.vue.ts +43 -0
  44. package/dist/runtime/components/LibFileInput/LibFileInput.vue +29 -13
  45. package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +2 -2
  46. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.d.vue.ts +165 -0
  47. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +42 -12
  48. package/dist/runtime/components/LibLabel/LibLabel.d.vue.ts +26 -0
  49. package/dist/runtime/components/LibLabel/LibLabel.vue +2 -2
  50. package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +3 -3
  51. package/dist/runtime/components/LibMultiValues/LibMultiValues.d.vue.ts +29 -0
  52. package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +1 -2
  53. package/dist/runtime/components/LibMultiValues/LibMultiValues.vue.d.ts +2 -2
  54. package/dist/runtime/components/LibNotifications/LibNotification.d.vue.ts +17 -0
  55. package/dist/runtime/components/LibNotifications/LibNotification.vue +19 -8
  56. package/dist/runtime/components/LibNotifications/LibNotifications.d.vue.ts +13 -0
  57. package/dist/runtime/components/LibNotifications/LibNotifications.vue +10 -6
  58. package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +2 -2
  59. package/dist/runtime/components/LibPagination/LibPagination.d.vue.ts +104 -0
  60. package/dist/runtime/components/LibPagination/LibPagination.vue +25 -12
  61. package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +2 -2
  62. package/dist/runtime/components/LibPalette/LibPalette.d.vue.ts +14 -0
  63. package/dist/runtime/components/LibPalette/LibPalette.vue +6 -5
  64. package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +5 -5
  65. package/dist/runtime/components/LibPopup/LibPopup.d.vue.ts +46 -0
  66. package/dist/runtime/components/LibPopup/LibPopup.vue +6 -4
  67. package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +3 -3
  68. package/dist/runtime/components/LibProgressBar/LibProgressBar.d.vue.ts +41 -0
  69. package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +5 -3
  70. package/dist/runtime/components/LibProgressBar/LibProgressBar.vue.d.ts +9 -9
  71. package/dist/runtime/components/LibRecorder/LibRecorder.d.vue.ts +77 -0
  72. package/dist/runtime/components/LibRecorder/LibRecorder.vue +1 -1
  73. package/dist/runtime/components/LibRecorder/LibRecorder.vue.d.ts +2 -2
  74. package/dist/runtime/components/LibRoot/LibRoot.d.vue.ts +41 -0
  75. package/dist/runtime/components/LibRoot/LibRoot.vue +11 -6
  76. package/dist/runtime/components/LibRoot/LibRoot.vue.d.ts +1 -1
  77. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.d.vue.ts +35 -0
  78. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue +1 -1
  79. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue.d.ts +1 -1
  80. package/dist/runtime/components/LibSuggestions/LibSuggestions.d.vue.ts +94 -0
  81. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +6 -4
  82. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +1 -1
  83. package/dist/runtime/components/LibTable/LibTable.d.vue.ts +45 -0
  84. package/dist/runtime/components/LibTable/LibTable.vue +23 -8
  85. package/dist/runtime/components/LibTable/LibTable.vue.d.ts +1 -1
  86. package/dist/runtime/components/Template/NAME.d.vue.ts +17 -0
  87. package/dist/runtime/components/Template/NAME.vue +2 -3
  88. package/dist/runtime/components/Template/NAME.vue.d.ts +1 -1
  89. package/dist/runtime/components/TestControls/TestControls.d.vue.ts +5 -0
  90. package/dist/runtime/components/TestControls/TestControls.vue +4 -2
  91. package/dist/runtime/components/TestControls/TestControls.vue.d.ts +1 -1
  92. package/dist/runtime/composables/useDragWithThreshold.d.ts +1 -1
  93. package/dist/runtime/composables/useInjectedI18n.d.ts +1 -1
  94. package/dist/runtime/composables/useScrollNearContainerEdges.d.ts +1 -1
  95. package/dist/runtime/composables/useSetupI18n.d.ts +1 -1
  96. package/dist/runtime/composables/useSuggestions.d.ts +2 -2
  97. package/dist/runtime/helpers/NotificationHandler.d.ts +1 -1
  98. package/dist/runtime/helpers/base64ToImg.js +2 -2
  99. package/dist/runtime/tailwind/themeConvertionOpts.d.ts +1 -1
  100. package/dist/runtime/types/index.d.ts +1 -1
  101. package/dist/runtime/utils/notifyIfError.d.ts +1 -1
  102. package/package.json +9 -10
  103. package/src/module.ts +41 -33
  104. package/src/runtime/build/WitchcraftUiResolver.ts +3 -3
  105. package/src/runtime/build/generateTheme.ts +3 -2
  106. package/src/runtime/build/unpluginIconViteOptions.ts +1 -1
  107. package/src/runtime/components/Aria/Aria.vue +5 -6
  108. package/src/runtime/components/Focus.stories.ts +11 -12
  109. package/src/runtime/components/Icon/Icon.vue +5 -9
  110. package/src/runtime/components/LibButton/LibButton.stories.ts +21 -22
  111. package/src/runtime/components/LibButton/LibButton.vue +23 -21
  112. package/src/runtime/components/LibCheckbox/LibCheckbox.stories.ts +6 -10
  113. package/src/runtime/components/LibCheckbox/LibCheckbox.vue +17 -19
  114. package/src/runtime/components/LibColorInput/LibColorInput.stories.ts +8 -13
  115. package/src/runtime/components/LibColorInput/LibColorInput.vue +49 -45
  116. package/src/runtime/components/LibColorPicker/LibColorPicker.stories.ts +14 -18
  117. package/src/runtime/components/LibColorPicker/LibColorPicker.vue +50 -52
  118. package/src/runtime/components/LibColorPicker/utils/safeConvertToHsva.ts +1 -2
  119. package/src/runtime/components/LibColorPicker/utils/safeConvertToRgba.ts +1 -2
  120. package/src/runtime/components/LibColorPicker/utils/truncate.ts +1 -2
  121. package/src/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.ts +5 -8
  122. package/src/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +11 -9
  123. package/src/runtime/components/LibDatePicker/LibDatePicker.stories.ts +14 -15
  124. package/src/runtime/components/LibDatePicker/LibDatePicker.vue +1 -2
  125. package/src/runtime/components/LibDatePicker/LibRangeDatePicker.vue +13 -13
  126. package/src/runtime/components/LibDatePicker/LibSingleDatePicker.vue +9 -8
  127. package/src/runtime/components/LibDatePicker/LibTimeZonePicker.vue +2 -1
  128. package/src/runtime/components/LibDatePicker/helpers.ts +0 -2
  129. package/src/runtime/components/LibDebug/LibDebug.stories.ts +11 -15
  130. package/src/runtime/components/LibDebug/LibDebug.vue +14 -11
  131. package/src/runtime/components/LibDevOnly/LibDevOnly.vue +8 -4
  132. package/src/runtime/components/LibFileInput/LibFileInput.stories.ts +12 -15
  133. package/src/runtime/components/LibFileInput/LibFileInput.vue +65 -47
  134. package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.ts +77 -84
  135. package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +73 -48
  136. package/src/runtime/components/LibLabel/LibLabel.stories.ts +4 -8
  137. package/src/runtime/components/LibLabel/LibLabel.vue +8 -8
  138. package/src/runtime/components/LibMultiValues/LibMultiValues.stories.ts +10 -15
  139. package/src/runtime/components/LibMultiValues/LibMultiValues.vue +14 -18
  140. package/src/runtime/components/LibNotifications/LibNotification.stories.ts +30 -34
  141. package/src/runtime/components/LibNotifications/LibNotification.vue +27 -17
  142. package/src/runtime/components/LibNotifications/LibNotifications.stories.ts +11 -15
  143. package/src/runtime/components/LibNotifications/LibNotifications.vue +21 -16
  144. package/src/runtime/components/LibPagination/LibPagination.stories.ts +5 -9
  145. package/src/runtime/components/LibPagination/LibPagination.vue +46 -32
  146. package/src/runtime/components/LibPalette/LibPalette.stories.ts +3 -7
  147. package/src/runtime/components/LibPalette/LibPalette.vue +13 -12
  148. package/src/runtime/components/LibPopup/LibPopup.stories.ts +19 -23
  149. package/src/runtime/components/LibPopup/LibPopup.vue +31 -35
  150. package/src/runtime/components/LibProgressBar/LibProgressBar.stories.ts +13 -17
  151. package/src/runtime/components/LibProgressBar/LibProgressBar.vue +36 -33
  152. package/src/runtime/components/LibRecorder/LibRecorder.stories.ts +11 -12
  153. package/src/runtime/components/LibRecorder/LibRecorder.vue +34 -34
  154. package/src/runtime/components/LibRoot/LibRoot.vue +16 -12
  155. package/src/runtime/components/LibSimpleInput/LibSimpleInput.stories.ts +20 -24
  156. package/src/runtime/components/LibSimpleInput/LibSimpleInput.vue +17 -21
  157. package/src/runtime/components/LibSuggestions/LibSuggestions.stories.ts +16 -19
  158. package/src/runtime/components/LibSuggestions/LibSuggestions.vue +28 -30
  159. package/src/runtime/components/LibTable/LibTable.stories.ts +30 -33
  160. package/src/runtime/components/LibTable/LibTable.vue +38 -24
  161. package/src/runtime/components/Reset.stories.ts +3 -6
  162. package/src/runtime/components/Scrolling.stories.ts +5 -8
  163. package/src/runtime/components/Template/NAME.vue +11 -11
  164. package/src/runtime/components/Template/TemplateStory.ts +9 -10
  165. package/src/runtime/components/TestControls/TestControls.vue +5 -5
  166. package/src/runtime/components/shared/props.ts +4 -6
  167. package/src/runtime/components/shared/storyHelpers/playInput.ts +2 -3
  168. package/src/runtime/components/shared/storyHelpers/playSuggestions.ts +5 -9
  169. package/src/runtime/composables/useAccesibilityOutline.ts +1 -1
  170. package/src/runtime/composables/useAriaLabel.ts +1 -1
  171. package/src/runtime/composables/useDarkMode.ts +15 -19
  172. package/src/runtime/composables/useDragWithThreshold.ts +6 -8
  173. package/src/runtime/composables/useGlobalResizeObserver.ts +0 -1
  174. package/src/runtime/composables/useInjectedDarkMode.ts +2 -2
  175. package/src/runtime/composables/useInjectedI18n.ts +1 -1
  176. package/src/runtime/composables/useInjectedLocale.ts +3 -4
  177. package/src/runtime/composables/useScrollNearContainerEdges.stories.ts +4 -4
  178. package/src/runtime/composables/useScrollNearContainerEdges.ts +12 -13
  179. package/src/runtime/composables/useSetupI18n.ts +4 -7
  180. package/src/runtime/composables/useSetupLocale.ts +3 -5
  181. package/src/runtime/composables/useSuggestions.ts +25 -30
  182. package/src/runtime/directives/vDetectFlex.ts +5 -8
  183. package/src/runtime/directives/vExtractRootEl.ts +1 -1
  184. package/src/runtime/directives/vResizableCols.ts +3 -7
  185. package/src/runtime/directives/vResizeObserver.ts +1 -2
  186. package/src/runtime/globalResizeObserver.ts +0 -1
  187. package/src/runtime/helpers/NotificationHandler.ts +8 -12
  188. package/src/runtime/helpers/base64ToImg.ts +2 -3
  189. package/src/runtime/helpers/createNoonUtcDate.ts +0 -1
  190. package/src/runtime/helpers/defaultTranslationFunction.ts +0 -1
  191. package/src/runtime/helpers/getTimeZoneList.ts +0 -1
  192. package/src/runtime/helpers/readFile.ts +2 -2
  193. package/src/runtime/helpers/resizeObserverWrapper.ts +0 -1
  194. package/src/runtime/helpers/storybook.ts +2 -3
  195. package/src/runtime/main.lib.ts +0 -2
  196. package/src/runtime/nuxt/plugins/vue-plugin.ts +4 -5
  197. package/src/runtime/tailwind/themeConvertionOpts.ts +3 -4
  198. package/src/runtime/theme.ts +0 -1
  199. package/src/runtime/types/index.ts +3 -4
  200. package/src/runtime/utils/notifyIfError.ts +2 -2
  201. package/src/runtime/utils/twMerge.ts +2 -2
  202. package/src/runtime/vue/VueComponentsPlugin.ts +1 -2
  203. package/src/runtime/vue/registerComponents.ts +0 -1
@@ -20,7 +20,10 @@
20
20
  <component :is="darkModeState === 'dark' ? IFaSolidMoon : darkModeState === 'light' ? IPhSunBold : IFa6SolidCircleHalfStroke"/>
21
21
  </icon>
22
22
  </template>
23
- <template #default v-if="showLabel">
23
+ <template
24
+ #default
25
+ v-if="showLabel"
26
+ >
24
27
  <div class="dark-mode-switcher--label pr-[2px]">
25
28
  {{ t(`dark-mode-switcher.${darkModeState}`) }}
26
29
  </div>
@@ -58,6 +61,6 @@ onMounted(() => {
58
61
 
59
62
  <script>
60
63
  export default {
61
- name: "lib-dark-mode-switcher"
64
+ name: "LibDarkModeSwitcher"
62
65
  };
63
66
  </script>
@@ -1,6 +1,6 @@
1
1
  import { type ButtonHTMLAttributes } from "vue";
2
2
  import type { TailwindClassProp } from "../shared/props.js.js";
3
- declare const _default: import("vue").DefineComponent<Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
3
+ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
4
  "update:darkMode": (value: boolean) => any;
5
5
  "update:darkModeState": (value: "system" | "dark" | "light") => any;
6
6
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
@@ -0,0 +1,40 @@
1
+ import type { RangeDate, SingleDate } from "../../types/index.js.js";
2
+ type __VLS_Props = {
3
+ showTime?: boolean;
4
+ id?: string;
5
+ /** The fallback suggested date when the modelValue is undefined (it will not update modelValue, it only serves as a suggestions and is used internally in the temporary value). If ignoring the time element, you should probably use the {@link createNoonTodayUtc} function (`createNonTodayUtc().toDate(())`) in the helpers, otherwise `new Date()` (the default) will do. */
6
+ fallbackDate?: Date;
7
+ /** The local user's timezone, defaults to @internationalized/date's getLocalTimeZone(). */
8
+ timeZone?: string;
9
+ };
10
+ type __VLS_PublicProps = __VLS_Props & {
11
+ /**
12
+ * modelValue can be undefined or an object with start/end undefined, but it must be passed, otherwise we can't tell the difference between a single date and a range date.
13
+ *
14
+ * In the case of an undefined date, the current date at NOON UTC will be used to avoid the date changing.
15
+ *
16
+ * The @internationalized/date library's fromDate function is used internally to convert the date given (should be UTC) to the local time zone. It's converted back via it's toDate function.
17
+ */
18
+ modelValue: SingleDate | RangeDate;
19
+ };
20
+ declare var __VLS_8: any;
21
+ type __VLS_Slots = {} & {
22
+ default?: (props: typeof __VLS_8) => any;
23
+ };
24
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
25
+ "update:modelValue": (value: SingleDate | RangeDate) => any;
26
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
27
+ "onUpdate:modelValue"?: ((value: SingleDate | RangeDate) => any) | undefined;
28
+ }>, {
29
+ id: string;
30
+ fallbackDate: Date;
31
+ timeZone: string;
32
+ showTime: boolean;
33
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
34
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
35
+ export default _default;
36
+ type __VLS_WithSlots<T, S> = T & {
37
+ new (): {
38
+ $slots: S;
39
+ };
40
+ };
@@ -21,7 +21,7 @@ declare var __VLS_8: any;
21
21
  type __VLS_Slots = {} & {
22
22
  default?: (props: typeof __VLS_8) => any;
23
23
  };
24
- declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
25
25
  "update:modelValue": (value: SingleDate | RangeDate) => any;
26
26
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
27
27
  "onUpdate:modelValue"?: ((value: SingleDate | RangeDate) => any) | undefined;
@@ -0,0 +1,34 @@
1
+ import type { RangeDate } from "../../types/index.js.js";
2
+ type __VLS_Props = {
3
+ useTime?: boolean;
4
+ id: string;
5
+ fallbackDate?: Date;
6
+ timeZone?: string;
7
+ updateInterval?: number;
8
+ };
9
+ type __VLS_PublicProps = __VLS_Props & {
10
+ modelValue: RangeDate;
11
+ };
12
+ declare var __VLS_167: {
13
+ tempValue: any;
14
+ };
15
+ type __VLS_Slots = {} & {
16
+ default?: (props: typeof __VLS_167) => any;
17
+ };
18
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
19
+ "update:modelValue": (value: RangeDate) => any;
20
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
21
+ "onUpdate:modelValue"?: ((value: RangeDate) => any) | undefined;
22
+ }>, {
23
+ fallbackDate: Date;
24
+ timeZone: string;
25
+ useTime: boolean;
26
+ updateInterval: number;
27
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
29
+ export default _default;
30
+ type __VLS_WithSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { CalendarDate, getLocalTimeZone, ZonedDateTime } from "@internationalized/date";
2
+ import { getLocalTimeZone } from "@internationalized/date";
3
3
  import { DateRangePickerArrow, DateRangePickerCalendar, DateRangePickerCell, DateRangePickerCellTrigger, DateRangePickerContent, DateRangePickerField, DateRangePickerGrid, DateRangePickerGridBody, DateRangePickerGridHead, DateRangePickerGridRow, DateRangePickerHeadCell, DateRangePickerHeader, DateRangePickerHeading, DateRangePickerInput, DateRangePickerNext, DateRangePickerPrev, DateRangePickerRoot, DateRangePickerTrigger } from "reka-ui";
4
4
  import { onBeforeUnmount, ref, toRaw, useAttrs, watch } from "vue";
5
5
  import { convertDateWithFallback, getNow, toEmittableDate } from "./helpers.js";
@@ -76,7 +76,8 @@ const locale = useInjectedLocale().timeLocale;
76
76
  `, attrs.class)"
77
77
  >
78
78
  <div class="date-range-picker--segments-input flex items-center flex-1 overflow-scroll scrollbar-hidden whitespace-nowrap">
79
- <div :class="twMerge(`
79
+ <div
80
+ :class="twMerge(`
80
81
  date-range-picker--start-segment
81
82
  flex
82
83
  items-center
@@ -123,7 +124,8 @@ const locale = useInjectedLocale().timeLocale;
123
124
  <div class="date-range-picker--range-separator text-center px-1">
124
125
 
125
126
  </div>
126
- <div :class="twMerge(`
127
+ <div
128
+ :class="twMerge(`
127
129
  date-range-picker--end-segment
128
130
  flex
129
131
  items-center
@@ -189,13 +191,12 @@ const locale = useInjectedLocale().timeLocale;
189
191
  </DateRangePickerField>
190
192
 
191
193
  <!-- side=bottom makes months easier to click through -->
192
- <!-- @vue-expect-error to exists-->
193
194
  <DateRangePickerContent
194
195
  :side-offset="4"
195
196
  :avoid-collisions="true"
196
197
  :prioritize-position="true"
197
198
  side="bottom"
198
- to="#root"
199
+ :portal="{ to: '#root' }"
199
200
  class="
200
201
  date-range-picker--content
201
202
  z-100
@@ -313,7 +314,8 @@ const locale = useInjectedLocale().timeLocale;
313
314
  :key="month.value.toString()"
314
315
  >
315
316
  <DateRangePickerGridHead class="date-range-picker--grid-head">
316
- <DateRangePickerGridRow class="
317
+ <DateRangePickerGridRow
318
+ class="
317
319
  date-range-picker--grid-row
318
320
  mb-1
319
321
  flex
@@ -15,7 +15,7 @@ declare var __VLS_167: {
15
15
  type __VLS_Slots = {} & {
16
16
  default?: (props: typeof __VLS_167) => any;
17
17
  };
18
- declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
19
19
  "update:modelValue": (value: RangeDate) => any;
20
20
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
21
21
  "onUpdate:modelValue"?: ((value: RangeDate) => any) | undefined;
@@ -0,0 +1,34 @@
1
+ import type { SingleDate } from "../../types/index.js.js";
2
+ type __VLS_Props = {
3
+ useTime?: boolean;
4
+ id: string;
5
+ fallbackDate?: Date;
6
+ timeZone?: string;
7
+ updateInterval?: number;
8
+ };
9
+ type __VLS_PublicProps = __VLS_Props & {
10
+ modelValue: SingleDate;
11
+ };
12
+ declare var __VLS_157: {
13
+ tempValue: any;
14
+ };
15
+ type __VLS_Slots = {} & {
16
+ default?: (props: typeof __VLS_157) => any;
17
+ };
18
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
19
+ "update:modelValue": (value: SingleDate) => any;
20
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
21
+ "onUpdate:modelValue"?: ((value: SingleDate) => any) | undefined;
22
+ }>, {
23
+ fallbackDate: Date;
24
+ timeZone: string;
25
+ useTime: boolean;
26
+ updateInterval: number;
27
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
29
+ export default _default;
30
+ type __VLS_WithSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
@@ -74,7 +74,8 @@ onBeforeUnmount(() => {
74
74
  )
75
75
  "
76
76
  >
77
- <div :class="twMerge(`
77
+ <div
78
+ :class="twMerge(`
78
79
  date-picker--segment
79
80
  flex
80
81
  items-center
@@ -139,13 +140,12 @@ onBeforeUnmount(() => {
139
140
  </Icon>
140
141
  </DatePickerTrigger>
141
142
  </DatePickerField>
142
- <!-- @vue-expect-error to exists-->
143
143
  <DatePickerContent
144
144
  :side-offset="4"
145
145
  :avoid-collisions="true"
146
146
  :prioritize-position="true"
147
147
  side="bottom"
148
- to="#root"
148
+ :portal="{ to: '#root' }"
149
149
  class="
150
150
  date-picker--content
151
151
  z-100
@@ -178,7 +178,8 @@ onBeforeUnmount(() => {
178
178
  max-w-[calc(1.2em*4+var(--spacing)*8+14ch)]
179
179
  "
180
180
  >
181
- <DatePickerHeader class="
181
+ <DatePickerHeader
182
+ class="
182
183
  date-picker--header
183
184
  flex
184
185
  items-center
@@ -276,7 +277,8 @@ onBeforeUnmount(() => {
276
277
  :key="month.value.toString()"
277
278
  >
278
279
  <DatePickerGridHead class="date-picker--grid-head">
279
- <DatePickerGridRow class="
280
+ <DatePickerGridRow
281
+ class="
280
282
  date-picker--grid-row
281
283
  mb-1
282
284
  flex
@@ -15,7 +15,7 @@ declare var __VLS_157: {
15
15
  type __VLS_Slots = {} & {
16
16
  default?: (props: typeof __VLS_157) => any;
17
17
  };
18
- declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
19
19
  "update:modelValue": (value: SingleDate) => any;
20
20
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
21
21
  "onUpdate:modelValue"?: ((value: SingleDate) => any) | undefined;
@@ -0,0 +1,22 @@
1
+ type __VLS_PublicProps = {
2
+ modelValue?: string;
3
+ "label"?: string;
4
+ };
5
+ declare var __VLS_7: {};
6
+ type __VLS_Slots = {} & {
7
+ default?: (props: typeof __VLS_7) => any;
8
+ };
9
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ "update:modelValue": (value: string) => any;
11
+ "update:label": (value: string) => any;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
13
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
14
+ "onUpdate:label"?: ((value: string) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -6,7 +6,7 @@ declare var __VLS_7: {};
6
6
  type __VLS_Slots = {} & {
7
7
  default?: (props: typeof __VLS_7) => any;
8
8
  };
9
- declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
10
  "update:modelValue": (value: string) => any;
11
11
  "update:label": (value: string) => any;
12
12
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Simple debug component for displaying objects and strings with whitespace.
3
+ *
4
+ * In the case of objects, it JSON.stringifies them with a tab character. The tab width can be controlled with the `tab` prop, which will set the `tab-size` css property on the element.
5
+ *
6
+ * The value can be undefined, it will just display undefined.
7
+ */
8
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
9
+ /** The value to debug, can be anything. */
10
+ value?: any;
11
+ /** Sets the tab size in css. Defaults to 3. */
12
+ tab?: number;
13
+ title?: string;
14
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
15
+ /** The value to debug, can be anything. */
16
+ value?: any;
17
+ /** Sets the tab size in css. Defaults to 3. */
18
+ tab?: number;
19
+ title?: string;
20
+ }> & Readonly<{}>, {
21
+ value: any;
22
+ title: string;
23
+ tab: number;
24
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
25
+ default?: (props: {}) => any;
26
+ }>;
27
+ export default _default;
28
+ type __VLS_WithSlots<T, S> = T & {
29
+ new (): {
30
+ $slots: S;
31
+ };
32
+ };
@@ -1,5 +1,6 @@
1
1
  <template>
2
- <div class="debug--wrapper
2
+ <div
3
+ class="debug--wrapper
3
4
  text-fg
4
5
  dark:text-bg
5
6
  flex
@@ -13,11 +14,15 @@
13
14
  >
14
15
  <div class="debug--header flex justify-between">
15
16
  <span class="debug--title font-bold">{{ title }}</span>
16
- <LibButton class="debug--copy-button w-min-content" @click="copy()">
17
+ <LibButton
18
+ class="debug--copy-button w-min-content"
19
+ @click="copy()"
20
+ >
17
21
  <icon><i-fa6-regular-copy/></icon>
18
22
  </LibButton>
19
23
  </div>
20
- <pre v-if="value"
24
+ <pre
25
+ v-if="value"
21
26
  :class="
22
27
  `
23
28
  debug--value
@@ -68,7 +73,7 @@ const copy = () => {
68
73
 
69
74
  <script>
70
75
  export default {
71
- name: "lib-debug"
76
+ name: "LibDebug"
72
77
  // https://v3.vuejs.org/guide/typescript-support.html#annotating-props
73
78
  };
74
79
  </script>
@@ -11,7 +11,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
11
11
  /** Sets the tab size in css. Defaults to 3. */
12
12
  tab?: number;
13
13
  title?: string;
14
- }, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
14
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
15
15
  /** The value to debug, can be anything. */
16
16
  value?: any;
17
17
  /** Sets the tab size in css. Defaults to 3. */
@@ -0,0 +1,25 @@
1
+ export interface Props {
2
+ show?: boolean;
3
+ }
4
+ declare module "vue" {
5
+ interface GlobalComponents {
6
+ DevOnly: any;
7
+ }
8
+ }
9
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
10
+ show?: boolean;
11
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
12
+ show?: boolean;
13
+ }> & Readonly<{}>, {
14
+ show: boolean;
15
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
16
+ default?: (props: {}) => any;
17
+ } & {
18
+ default?: (props: {}) => any;
19
+ }>;
20
+ export default _default;
21
+ type __VLS_WithSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -1,7 +1,8 @@
1
1
  <template>
2
2
  <DevOnly>
3
3
  <slot v-if="doShow && $attrs?.['as-child'] !== void 0"/>
4
- <div v-else-if="doShow"
4
+ <div
5
+ v-else-if="doShow"
5
6
  :class="twMerge(
6
7
  `
7
8
  dev-only
@@ -1,3 +1,6 @@
1
+ export interface Props {
2
+ show?: boolean;
3
+ }
1
4
  declare module "vue" {
2
5
  interface GlobalComponents {
3
6
  DevOnly: any;
@@ -5,7 +8,7 @@ declare module "vue" {
5
8
  }
6
9
  declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
7
10
  show?: boolean;
8
- }, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
11
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
9
12
  show?: boolean;
10
13
  }> & Readonly<{}>, {
11
14
  show: boolean;
@@ -0,0 +1,43 @@
1
+ import { type HTMLAttributes, type InputHTMLAttributes } from "vue";
2
+ import type { FileInputError } from "../../types/index.js.js";
3
+ import { type LinkableByIdProps, type TailwindClassProp, type WrapperProps } from "../shared/props.js.js";
4
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
5
+ input: (val: File[]) => any;
6
+ errors: (val: FileInputError[]) => any;
7
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
8
+ onInput?: ((val: File[]) => any) | undefined;
9
+ onErrors?: ((val: FileInputError[]) => any) | undefined;
10
+ }>, {
11
+ multiple: boolean;
12
+ formats: string[];
13
+ compact: boolean;
14
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
15
+ icon?: (props: {}) => any;
16
+ } & {
17
+ label?: (props: {}) => any;
18
+ } & {
19
+ formats?: (props: {}) => any;
20
+ }>;
21
+ export default _default;
22
+ type WrapperTypes = WrapperProps<"input", InputHTMLAttributes> & WrapperProps<"wrapper", HTMLAttributes> & WrapperProps<"previews", HTMLAttributes>;
23
+ type RealProps = LinkableByIdProps & {
24
+ multiple?: boolean;
25
+ /**
26
+ * A list of extensions or mime types to add to the input's accept. Basic validations are done so that files match an extension and mimeType, but note that a file could still be lying, all files should be validated server side.
27
+ *
28
+ * Pass an empty array to allow any filetype.
29
+ */
30
+ formats?: string[];
31
+ compact?: boolean;
32
+ };
33
+ interface Props extends
34
+ /** @vue-ignore */
35
+ Partial<Omit<InputHTMLAttributes, "class" | "multiple" | "formats" | "compact"> & TailwindClassProp>,
36
+ /** @vue-ignore */
37
+ Partial<WrapperTypes>, RealProps {
38
+ }
39
+ type __VLS_WithSlots<T, S> = T & {
40
+ new (): {
41
+ $slots: S;
42
+ };
43
+ };
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <!-- todo aria errors -->
3
- <div :class="twMerge(
3
+ <div
4
+ :class="twMerge(
4
5
  `file-input
5
6
  justify-center
6
7
  border-2
@@ -16,7 +17,8 @@
16
17
  )"
17
18
  v-bind="{ ...$.wrapperAttrs, class: void 0 }"
18
19
  >
19
- <div :class="twMerge(
20
+ <div
21
+ :class="twMerge(
20
22
  `
21
23
  file-input--wrapper
22
24
  relative justify-center`,
@@ -37,7 +39,10 @@
37
39
  whitespace-nowrap
38
40
  `)"
39
41
  >
40
- <slot v-if="compact || multiple || files.length === 0" name="icon">
42
+ <slot
43
+ v-if="compact || multiple || files.length === 0"
44
+ name="icon"
45
+ >
41
46
  <icon><i-fa6-solid-arrow-up-from-bracket/></icon>
42
47
  </slot>
43
48
  <slot name="label">
@@ -52,7 +57,10 @@
52
57
  {{ ` (${files.length})` }}
53
58
  </span>
54
59
  </label>
55
- <label v-if="!compact && formats?.length > 0" class="file-input--formats-label flex flex-col items-center text-sm">
60
+ <label
61
+ v-if="!compact && formats?.length > 0"
62
+ class="file-input--formats-label flex flex-col items-center text-sm"
63
+ >
56
64
  <slot name="formats">{{ t("file-input.accepted-formats") }}: </slot>
57
65
  <div class="file-input--formats-list">
58
66
  {{ extensions.join(", ") }}
@@ -82,7 +90,8 @@
82
90
  >
83
91
  <!-- click event allows event to fire even if the user picks the same file -->
84
92
  </div>
85
- <div v-if="!compact && files.length > 0"
93
+ <div
94
+ v-if="!compact && files.length > 0"
86
95
  :class="twMerge(
87
96
  `file-input--previews
88
97
  flex items-stretch justify-center gap-2 flex-wrap
@@ -94,7 +103,8 @@
94
103
  )"
95
104
  >
96
105
  <div class="file-input--preview-spacer flex-1"/>
97
- <div class="file-input--preview-wrapper
106
+ <div
107
+ class="file-input--preview-wrapper
98
108
  z-1
99
109
  relative
100
110
  flex
@@ -121,16 +131,21 @@
121
131
  </div>
122
132
 
123
133
  <div class="file-input--preview flex flex-initial basis-full justify-center">
124
- <div v-if="entry.isImg"
134
+ <div
135
+ v-if="entry.isImg"
125
136
  class="file-input--preview-image
126
137
  bg-transparency-squares flex
127
138
  h-[80px] flex-wrap items-center
128
139
  justify-center
129
140
  "
130
141
  >
131
- <img class="max-h-full w-auto" :src="getSrc(entry.file)">
142
+ <img
143
+ class="max-h-full w-auto"
144
+ :src="getSrc(entry.file)"
145
+ >
132
146
  </div>
133
- <div v-if="!entry.isImg"
147
+ <div
148
+ v-if="!entry.isImg"
134
149
  class="file-input--preview-no-image
135
150
  flex h-[80px]
136
151
  flex-1 basis-full flex-wrap items-center justify-center
@@ -139,7 +154,8 @@
139
154
  <icon><i-fa6-regular-file class="text-4xl opacity-50"/></icon>
140
155
  </div>
141
156
  </div>
142
- <div class="
157
+ <div
158
+ class="
143
159
  file-input--preview-filename
144
160
  min-w-0
145
161
  flex-1
@@ -168,7 +184,6 @@ import IFa6SolidArrowUpFromBracket from "~icons/fa6-solid/arrow-up-from-bracket"
168
184
  import IFa6SolidXmark from "~icons/fa6-solid/xmark";
169
185
  import { useDivideAttrs } from "../../composables/useDivideAttrs.js";
170
186
  import { useInjectedI18n } from "../../composables/useInjectedI18n.js";
171
- import {} from "../../types/index.js";
172
187
  import { twMerge } from "../../utils/twMerge.js";
173
188
  import Icon from "../Icon/Icon.vue";
174
189
  import LibButton from "../LibButton/LibButton.vue";
@@ -191,7 +206,7 @@ watch(errors, () => {
191
206
  }
192
207
  });
193
208
  defineOptions({
194
- name: "lib-file-input",
209
+ name: "LibFileInput",
195
210
  inheritAttrs: false
196
211
  });
197
212
  const $ = useDivideAttrs(["wrapper", "input", "previews"]);
@@ -250,9 +265,10 @@ const inputFile = async (e) => {
250
265
  errors.splice(0, errors.length);
251
266
  }
252
267
  }
268
+ return void 0;
253
269
  };
254
270
  </script>
255
271
 
256
272
  <script>
257
- export default { name: "lib-file-input" };
273
+ export default { name: "LibFileInput" };
258
274
  </script>
@@ -1,7 +1,7 @@
1
1
  import { type HTMLAttributes, type InputHTMLAttributes } from "vue";
2
- import { type FileInputError } from "../../types/index.js.js";
2
+ import type { FileInputError } from "../../types/index.js.js";
3
3
  import { type LinkableByIdProps, type TailwindClassProp, type WrapperProps } from "../shared/props.js.js";
4
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
5
5
  input: (val: File[]) => any;
6
6
  errors: (val: FileInputError[]) => any;
7
7
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{