@witchcraft/ui 0.2.1-beta.2 → 0.2.1

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 (173) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +4 -5
  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.vue +4 -2
  6. package/dist/runtime/components/Aria/Aria.vue.d.ts +1 -1
  7. package/dist/runtime/components/Icon/Icon.vue +3 -3
  8. package/dist/runtime/components/Icon/Icon.vue.d.ts +1 -1
  9. package/dist/runtime/components/LibButton/LibButton.vue +9 -4
  10. package/dist/runtime/components/LibButton/LibButton.vue.d.ts +1 -1
  11. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +3 -4
  12. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +1 -1
  13. package/dist/runtime/components/LibColorInput/LibColorInput.vue +15 -8
  14. package/dist/runtime/components/LibColorInput/LibColorInput.vue.d.ts +1 -1
  15. package/dist/runtime/components/LibColorPicker/LibColorPicker.vue +10 -6
  16. package/dist/runtime/components/LibColorPicker/LibColorPicker.vue.d.ts +1 -1
  17. package/dist/runtime/components/LibColorPicker/utils/truncate.js +1 -1
  18. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +5 -2
  19. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue.d.ts +1 -1
  20. package/dist/runtime/components/LibDatePicker/LibDatePicker.vue.d.ts +1 -1
  21. package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue +8 -6
  22. package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue.d.ts +1 -1
  23. package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue +7 -5
  24. package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue.d.ts +1 -1
  25. package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue.d.ts +1 -1
  26. package/dist/runtime/components/LibDebug/LibDebug.vue +9 -4
  27. package/dist/runtime/components/LibDebug/LibDebug.vue.d.ts +1 -1
  28. package/dist/runtime/components/LibDevOnly/LibDevOnly.vue +2 -1
  29. package/dist/runtime/components/LibDevOnly/LibDevOnly.vue.d.ts +4 -1
  30. package/dist/runtime/components/LibFileInput/LibFileInput.vue +29 -13
  31. package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +2 -2
  32. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +42 -12
  33. package/dist/runtime/components/LibLabel/LibLabel.vue +2 -2
  34. package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +3 -3
  35. package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +1 -2
  36. package/dist/runtime/components/LibMultiValues/LibMultiValues.vue.d.ts +2 -2
  37. package/dist/runtime/components/LibNotifications/LibNotification.vue +19 -8
  38. package/dist/runtime/components/LibNotifications/LibNotifications.vue +10 -6
  39. package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +2 -2
  40. package/dist/runtime/components/LibPagination/LibPagination.vue +25 -12
  41. package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +2 -2
  42. package/dist/runtime/components/LibPalette/LibPalette.vue +6 -5
  43. package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +5 -5
  44. package/dist/runtime/components/LibPopup/LibPopup.vue +6 -4
  45. package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +3 -3
  46. package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +5 -3
  47. package/dist/runtime/components/LibProgressBar/LibProgressBar.vue.d.ts +9 -9
  48. package/dist/runtime/components/LibRecorder/LibRecorder.vue +1 -1
  49. package/dist/runtime/components/LibRecorder/LibRecorder.vue.d.ts +2 -2
  50. package/dist/runtime/components/LibRoot/LibRoot.vue +11 -6
  51. package/dist/runtime/components/LibRoot/LibRoot.vue.d.ts +1 -1
  52. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue +1 -1
  53. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue.d.ts +1 -1
  54. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +5 -3
  55. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +1 -1
  56. package/dist/runtime/components/LibTable/LibTable.vue +23 -8
  57. package/dist/runtime/components/LibTable/LibTable.vue.d.ts +1 -1
  58. package/dist/runtime/components/Template/NAME.vue +2 -3
  59. package/dist/runtime/components/Template/NAME.vue.d.ts +1 -1
  60. package/dist/runtime/components/TestControls/TestControls.vue +4 -2
  61. package/dist/runtime/components/TestControls/TestControls.vue.d.ts +1 -1
  62. package/dist/runtime/composables/useDragWithThreshold.d.ts +1 -1
  63. package/dist/runtime/composables/useInjectedI18n.d.ts +1 -1
  64. package/dist/runtime/composables/useScrollNearContainerEdges.d.ts +1 -1
  65. package/dist/runtime/composables/useSetupI18n.d.ts +1 -1
  66. package/dist/runtime/composables/useSuggestions.d.ts +2 -2
  67. package/dist/runtime/helpers/NotificationHandler.d.ts +1 -1
  68. package/dist/runtime/helpers/base64ToImg.js +2 -2
  69. package/dist/runtime/tailwind/themeConvertionOpts.d.ts +1 -1
  70. package/dist/runtime/types/index.d.ts +1 -1
  71. package/dist/runtime/utils/notifyIfError.d.ts +1 -1
  72. package/package.json +4 -6
  73. package/src/module.ts +28 -32
  74. package/src/runtime/build/WitchcraftUiResolver.ts +3 -3
  75. package/src/runtime/build/generateTheme.ts +3 -2
  76. package/src/runtime/build/unpluginIconViteOptions.ts +1 -1
  77. package/src/runtime/components/Aria/Aria.vue +5 -6
  78. package/src/runtime/components/Focus.stories.ts +11 -12
  79. package/src/runtime/components/Icon/Icon.vue +5 -9
  80. package/src/runtime/components/LibButton/LibButton.stories.ts +21 -22
  81. package/src/runtime/components/LibButton/LibButton.vue +23 -21
  82. package/src/runtime/components/LibCheckbox/LibCheckbox.stories.ts +6 -10
  83. package/src/runtime/components/LibCheckbox/LibCheckbox.vue +17 -19
  84. package/src/runtime/components/LibColorInput/LibColorInput.stories.ts +8 -13
  85. package/src/runtime/components/LibColorInput/LibColorInput.vue +49 -45
  86. package/src/runtime/components/LibColorPicker/LibColorPicker.stories.ts +14 -18
  87. package/src/runtime/components/LibColorPicker/LibColorPicker.vue +50 -52
  88. package/src/runtime/components/LibColorPicker/utils/safeConvertToHsva.ts +1 -2
  89. package/src/runtime/components/LibColorPicker/utils/safeConvertToRgba.ts +1 -2
  90. package/src/runtime/components/LibColorPicker/utils/truncate.ts +1 -2
  91. package/src/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.ts +5 -8
  92. package/src/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +11 -9
  93. package/src/runtime/components/LibDatePicker/LibDatePicker.stories.ts +14 -15
  94. package/src/runtime/components/LibDatePicker/LibDatePicker.vue +1 -2
  95. package/src/runtime/components/LibDatePicker/LibRangeDatePicker.vue +13 -13
  96. package/src/runtime/components/LibDatePicker/LibSingleDatePicker.vue +9 -8
  97. package/src/runtime/components/LibDatePicker/LibTimeZonePicker.vue +2 -1
  98. package/src/runtime/components/LibDatePicker/helpers.ts +0 -2
  99. package/src/runtime/components/LibDebug/LibDebug.stories.ts +11 -15
  100. package/src/runtime/components/LibDebug/LibDebug.vue +14 -11
  101. package/src/runtime/components/LibDevOnly/LibDevOnly.vue +8 -4
  102. package/src/runtime/components/LibFileInput/LibFileInput.stories.ts +12 -15
  103. package/src/runtime/components/LibFileInput/LibFileInput.vue +65 -47
  104. package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.ts +59 -67
  105. package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +73 -48
  106. package/src/runtime/components/LibLabel/LibLabel.stories.ts +4 -8
  107. package/src/runtime/components/LibLabel/LibLabel.vue +8 -8
  108. package/src/runtime/components/LibMultiValues/LibMultiValues.stories.ts +10 -15
  109. package/src/runtime/components/LibMultiValues/LibMultiValues.vue +14 -18
  110. package/src/runtime/components/LibNotifications/LibNotification.stories.ts +30 -34
  111. package/src/runtime/components/LibNotifications/LibNotification.vue +27 -17
  112. package/src/runtime/components/LibNotifications/LibNotifications.stories.ts +11 -15
  113. package/src/runtime/components/LibNotifications/LibNotifications.vue +21 -16
  114. package/src/runtime/components/LibPagination/LibPagination.stories.ts +5 -9
  115. package/src/runtime/components/LibPagination/LibPagination.vue +46 -32
  116. package/src/runtime/components/LibPalette/LibPalette.stories.ts +3 -7
  117. package/src/runtime/components/LibPalette/LibPalette.vue +13 -12
  118. package/src/runtime/components/LibPopup/LibPopup.stories.ts +19 -23
  119. package/src/runtime/components/LibPopup/LibPopup.vue +31 -35
  120. package/src/runtime/components/LibProgressBar/LibProgressBar.stories.ts +13 -17
  121. package/src/runtime/components/LibProgressBar/LibProgressBar.vue +36 -33
  122. package/src/runtime/components/LibRecorder/LibRecorder.stories.ts +11 -12
  123. package/src/runtime/components/LibRecorder/LibRecorder.vue +34 -34
  124. package/src/runtime/components/LibRoot/LibRoot.vue +16 -12
  125. package/src/runtime/components/LibSimpleInput/LibSimpleInput.stories.ts +20 -24
  126. package/src/runtime/components/LibSimpleInput/LibSimpleInput.vue +17 -21
  127. package/src/runtime/components/LibSuggestions/LibSuggestions.stories.ts +16 -19
  128. package/src/runtime/components/LibSuggestions/LibSuggestions.vue +27 -30
  129. package/src/runtime/components/LibTable/LibTable.stories.ts +30 -33
  130. package/src/runtime/components/LibTable/LibTable.vue +38 -24
  131. package/src/runtime/components/Reset.stories.ts +3 -6
  132. package/src/runtime/components/Scrolling.stories.ts +5 -8
  133. package/src/runtime/components/Template/NAME.vue +11 -11
  134. package/src/runtime/components/Template/TemplateStory.ts +9 -10
  135. package/src/runtime/components/TestControls/TestControls.vue +5 -5
  136. package/src/runtime/components/shared/props.ts +4 -6
  137. package/src/runtime/components/shared/storyHelpers/playInput.ts +2 -3
  138. package/src/runtime/components/shared/storyHelpers/playSuggestions.ts +5 -9
  139. package/src/runtime/composables/useAccesibilityOutline.ts +1 -1
  140. package/src/runtime/composables/useAriaLabel.ts +1 -1
  141. package/src/runtime/composables/useDarkMode.ts +15 -19
  142. package/src/runtime/composables/useDragWithThreshold.ts +6 -8
  143. package/src/runtime/composables/useGlobalResizeObserver.ts +0 -1
  144. package/src/runtime/composables/useInjectedDarkMode.ts +2 -2
  145. package/src/runtime/composables/useInjectedI18n.ts +1 -1
  146. package/src/runtime/composables/useInjectedLocale.ts +3 -4
  147. package/src/runtime/composables/useScrollNearContainerEdges.stories.ts +4 -4
  148. package/src/runtime/composables/useScrollNearContainerEdges.ts +12 -13
  149. package/src/runtime/composables/useSetupI18n.ts +4 -7
  150. package/src/runtime/composables/useSetupLocale.ts +3 -5
  151. package/src/runtime/composables/useSuggestions.ts +25 -30
  152. package/src/runtime/directives/vDetectFlex.ts +5 -8
  153. package/src/runtime/directives/vExtractRootEl.ts +1 -1
  154. package/src/runtime/directives/vResizableCols.ts +3 -7
  155. package/src/runtime/directives/vResizeObserver.ts +1 -2
  156. package/src/runtime/globalResizeObserver.ts +0 -1
  157. package/src/runtime/helpers/NotificationHandler.ts +8 -12
  158. package/src/runtime/helpers/base64ToImg.ts +2 -3
  159. package/src/runtime/helpers/createNoonUtcDate.ts +0 -1
  160. package/src/runtime/helpers/defaultTranslationFunction.ts +0 -1
  161. package/src/runtime/helpers/getTimeZoneList.ts +0 -1
  162. package/src/runtime/helpers/readFile.ts +2 -2
  163. package/src/runtime/helpers/resizeObserverWrapper.ts +0 -1
  164. package/src/runtime/helpers/storybook.ts +2 -3
  165. package/src/runtime/main.lib.ts +0 -2
  166. package/src/runtime/nuxt/plugins/vue-plugin.ts +4 -5
  167. package/src/runtime/tailwind/themeConvertionOpts.ts +3 -4
  168. package/src/runtime/theme.ts +0 -1
  169. package/src/runtime/types/index.ts +3 -4
  170. package/src/runtime/utils/notifyIfError.ts +2 -2
  171. package/src/runtime/utils/twMerge.ts +2 -2
  172. package/src/runtime/vue/VueComponentsPlugin.ts +1 -2
  173. package/src/runtime/vue/registerComponents.ts +0 -1
@@ -4,7 +4,6 @@
4
4
 
5
5
  import { ResizeObserverWrapper } from "./helpers/resizeObserverWrapper.js"
6
6
 
7
-
8
7
  if (typeof ResizeObserver === "undefined") {
9
8
  // eslint-disable-next-line no-console
10
9
  console.warn("You are using a directive that uses a ResizeObserver or are importing something that uses this resize observer in a context (e.g. the server) where ResizeObserver does not exist.")
@@ -6,10 +6,9 @@ import { isBlank } from "@alanscodelog/utils/isBlank"
6
6
  import { pretty } from "@alanscodelog/utils/pretty"
7
7
  import { setReadOnly } from "@alanscodelog/utils/setReadOnly"
8
8
 
9
-
10
9
  export class NotificationHandler<
11
10
  TRawEntry extends RawNotificationEntry<any, any> = RawNotificationEntry<any, any>,
12
- TEntry extends NotificationEntry<TRawEntry> = NotificationEntry<TRawEntry>,
11
+ TEntry extends NotificationEntry<TRawEntry> = NotificationEntry<TRawEntry>
13
12
  > {
14
13
  timeout: number = 5000
15
14
 
@@ -30,7 +29,7 @@ export class NotificationHandler<
30
29
  constructor({
31
30
  timeout,
32
31
  stringifier,
33
- maxHistory,
32
+ maxHistory
34
33
  }: {
35
34
  timeout?: NotificationHandler<TRawEntry>["timeout"]
36
35
  stringifier?: NotificationHandler<TRawEntry>["stringifier"]
@@ -101,11 +100,10 @@ export class NotificationHandler<
101
100
  timeout: rawEntry.timeout === true
102
101
  ? this.timeout
103
102
  : rawEntry.timeout !== undefined && rawEntry.timeout !== false
104
- ? rawEntry.timeout
105
- : undefined,
103
+ ? rawEntry.timeout
104
+ : undefined
106
105
  } as any as TEntry
107
106
 
108
-
109
107
  if (rawEntry.cancellable === true || (rawEntry.cancellable === undefined && entry.options?.includes("Cancel"))) {
110
108
  entry.cancellable = "Cancel" as any
111
109
  }
@@ -120,8 +118,8 @@ export class NotificationHandler<
120
118
 
121
119
  async notify<TNotifyEntry extends RawNotificationEntry<any, any>>(rawEntry: TNotifyEntry):
122
120
  NotificationPromise<TNotifyEntry["options"][number] extends string
123
- ? TNotifyEntry["options"][number]
124
- : "Ok" | "Cancel"> {
121
+ ? TNotifyEntry["options"][number]
122
+ : "Ok" | "Cancel"> {
125
123
  const entry = this._createEntry(rawEntry)
126
124
  entry.promise = new Promise(_resolve => {
127
125
  entry.resolve = _resolve
@@ -195,7 +193,7 @@ export type NotificationPromise<TOption extends string = string> = Promise<TOpti
195
193
 
196
194
  export type RawNotificationEntry<
197
195
  TOptions extends string[] = ["Ok", "Cancel"],
198
- TCancellable extends boolean | TOptions[number] = "Cancel",
196
+ TCancellable extends boolean | TOptions[number] = "Cancel"
199
197
  > = {
200
198
  message: string
201
199
  title?: string
@@ -215,7 +213,7 @@ export type RawNotificationEntry<
215
213
  }
216
214
 
217
215
  export type NotificationEntry<
218
- TRawEntry extends RawNotificationEntry<any, any> = RawNotificationEntry<any, any>,
216
+ TRawEntry extends RawNotificationEntry<any, any> = RawNotificationEntry<any, any>
219
217
  > = Omit<MakeRequired<TRawEntry, "options" | "requiresAction" | "default" | "dangerous">, "cancellable"> & {
220
218
  promise: NotificationPromise
221
219
  resolve: AnyFunction
@@ -227,6 +225,4 @@ export type NotificationEntry<
227
225
 
228
226
  export type NotificationListener<TEntry extends NotificationEntry<any>> = (notification: TEntry, type: "added" | "resolved" | "deleted") => void
229
227
 
230
-
231
228
  export type NotificationStringifier<T extends NotificationEntry<any>> = (notification: T) => string
232
-
@@ -1,14 +1,13 @@
1
1
  export const base64ToImg = async (imageSrc: string): Promise<HTMLImageElement> => {
2
2
  const img = new Image()
3
3
 
4
- const loaded = new Promise((resolve => {
4
+ const loaded = new Promise(resolve => {
5
5
  img.addEventListener("load", () => {
6
6
  resolve(img)
7
7
  })
8
- })) as any as Promise<HTMLImageElement>
8
+ }) as any as Promise<HTMLImageElement>
9
9
 
10
10
  img.src = imageSrc // must be set after
11
11
  await loaded
12
12
  return img
13
13
  }
14
-
@@ -18,4 +18,3 @@ export function createNoonUtcDate(date: CalendarDate): ZonedDateTime {
18
18
  )
19
19
  return d
20
20
  }
21
-
@@ -30,4 +30,3 @@ export function defaultTranslationFunction(key: string, replacements?: Record<st
30
30
  }
31
31
  return value
32
32
  }
33
-
@@ -1,4 +1,3 @@
1
1
  export function getTimeZoneList(): string[] {
2
2
  return Intl.supportedValuesOf("timeZone")
3
3
  }
4
-
@@ -5,8 +5,8 @@ export const readFile = async <TType extends "DataUrl" | "ArrayBuffer" | "Binary
5
5
  ):
6
6
  Promise<
7
7
  TType extends "ArrayBuffer"
8
- ? ArrayBuffer
9
- : string
8
+ ? ArrayBuffer
9
+ : string
10
10
  > => new Promise((resolve, reject) => {
11
11
  const reader = new FileReader()
12
12
  reader.addEventListener("load", () => {
@@ -1,6 +1,5 @@
1
1
  import type { ResizeCallback } from "../types/index.js"
2
2
 
3
-
4
3
  export class ResizeObserverWrapper {
5
4
  observers: WeakMap<Element, Set<ResizeCallback>> = new WeakMap()
6
5
 
@@ -2,7 +2,6 @@ import type { Ref } from "vue"
2
2
 
3
3
  import { hasModifiers } from "./hasModifiers.js"
4
4
 
5
-
6
5
  export const createRecorderHandler = (
7
6
  recordingValue: Ref<string>,
8
7
  recording: Ref<boolean>,
@@ -23,7 +22,7 @@ export const createRecorderHandler = (
23
22
  recordingValue.value += ` ${e.key}`
24
23
  },
25
24
  mousedown(e: MouseEvent) {
26
- const target = (e.target as any)
25
+ const target = e.target as any
27
26
  const el = recordingEl.value
28
27
  if (target === el || el?.contains(target)) {
29
28
  return
@@ -34,7 +33,7 @@ export const createRecorderHandler = (
34
33
  wheel(e: WheelEvent) {
35
34
  recordingValue.value += ` ${e.deltaY > 0 ? "↓" : "↑"}`
36
35
  e.preventDefault()
37
- },
36
+ }
38
37
  })
39
38
 
40
39
  export const createRecorderWatchEffect = (recordingValue: Ref<string>, recording: Ref<boolean>, modelValue: Ref<string>, values?: Ref<string[]>) => () => {
@@ -9,7 +9,6 @@ export { VueComponentsPlugin } from "./vue/VueComponentsPlugin.js"
9
9
 
10
10
  import type * as components from "./components/index.js"
11
11
 
12
-
13
12
  type Components = typeof components
14
13
 
15
14
  /**
@@ -28,4 +27,3 @@ type Components = typeof components
28
27
  export type GlobalComponentTypes = {
29
28
  [key in keyof Components]: Components[key]
30
29
  }
31
-
@@ -4,16 +4,15 @@ import { defineNuxtPlugin, useRuntimeConfig } from "#imports"
4
4
 
5
5
  import { registerDirectives } from "../../vue/registerDirectives.js"
6
6
 
7
-
8
7
  export default defineNuxtPlugin({
9
8
  name: "components-plugin",
10
- async setup(nuxtApp): Promise<void> {
9
+ async setup(nuxtApp: any): Promise<void> {
11
10
  const config = useRuntimeConfig().public.witchcraftUi
12
11
  const app = nuxtApp.vueApp
13
12
  const directives = (isArray(config?.directives)
14
- ? (await Promise.all(config.directives.map(async (name: string) => (import(`../../directives/${name}.ts`))))).map((_: any) => Object.values(_)[0])
13
+ ? (await Promise.all(config.directives.map(async (name: string) => (import(`../../directives/${name}.ts`))))).map((_: any) => Object.values(_)[0])
15
14
  // @ts-expect-error ts filetype needed for nuxt
16
- : await import(`../../directives/index.ts`))
15
+ : await import(`../../directives/index.ts`))
17
16
  registerDirectives(app as any, Object.values(directives))
18
- },
17
+ }
19
18
  })
@@ -1,5 +1,4 @@
1
- import { type themeAsTailwindCss } from "metamorphosis/tailwind"
2
-
1
+ import type { themeAsTailwindCss } from "metamorphosis/tailwind"
3
2
 
4
3
  export const themeConvertionOpts: Parameters<typeof themeAsTailwindCss>[1] = {
5
4
  topLevel: ["number-spacing"],
@@ -10,6 +9,6 @@ export const themeConvertionOpts: Parameters<typeof themeAsTailwindCss>[1] = {
10
9
  "color-warning": "500",
11
10
  "color-ok": "500",
12
11
  "color-error": "500",
13
- "color-accent": "500",
14
- },
12
+ "color-accent": "500"
13
+ }
15
14
  }
@@ -1,5 +1,4 @@
1
1
  import { baseTheme } from "metamorphosis/BaseTheme"
2
2
  import type { Theme } from "metamorphosis/Theme"
3
3
 
4
-
5
4
  export const theme = baseTheme as Theme
@@ -1,5 +1,5 @@
1
1
  import type { ErrorW } from "@alanscodelog/utils"
2
- import { type Ref } from "vue"
2
+ import type { Ref } from "vue"
3
3
 
4
4
  export type ResizableOptions = {
5
5
  /**
@@ -51,7 +51,6 @@ export type ResizeCallback = (_rect: DOMRectReadOnly, el: Element) => void
51
51
 
52
52
  export type FileInputError = ErrorW<{ file: File, isValidMimeType: boolean, isValidExtension: boolean }>
53
53
 
54
-
55
54
  /** h 0-360+ (deg), s 0-100%, v 0-100%, a 0-1 */
56
55
  export type HsvaColor = { h: number, s: number, v: number, a?: number }
57
56
  /** rgb 0-255, 0-1 for alpha */
@@ -60,7 +59,7 @@ export type RgbaColor = { r: number, g: number, b: number, a?: number }
60
59
  export type Point = { x: number, y: number }
61
60
 
62
61
  export type ScrollNearContainerEdgesOptions = {
63
- containerEl: Ref< HTMLElement | null>
62
+ containerEl: Ref<HTMLElement | null>
64
63
  /** Margin inside contianer that allows scrolling. 10 by default. */
65
64
  scrollMargin?: number
66
65
  /** Margin around container that still allows scrolling. 0 by defualt. */
@@ -80,7 +79,7 @@ export type ScrollNearContainerEdgesOptions = {
80
79
  }
81
80
  // eslint-disable-next-line @typescript-eslint/naming-convention
82
81
  export type SimpleDOMRect = Omit<DOMRect, "toJSON">
83
-
82
+
84
83
  // eslint-disable-next-line @typescript-eslint/naming-convention
85
84
  export interface IPopupReference { getBoundingClientRect: () => SimpleDOMRect }
86
85
  export type PopupPosition = { x: number, y: number, maxWidth?: number, maxHeight?: number }
@@ -13,7 +13,7 @@ export function notifyIfError<T>(
13
13
  err: T, {
14
14
  logger,
15
15
  ns,
16
- force = false,
16
+ force = false
17
17
  }: {
18
18
  logger?: { debug: (...args: any[]) => void }
19
19
  /* Logger namespace. */
@@ -24,7 +24,7 @@ export function notifyIfError<T>(
24
24
  if (force || err instanceof Error) {
25
25
  const errMessage = {
26
26
  message: err instanceof Error ? err.message : `Unknown error ${err as any}`,
27
- code: err instanceof TypedError ? err.code : undefined,
27
+ code: err instanceof TypedError ? err.code : undefined
28
28
  }
29
29
  if (logger) {
30
30
  logger.debug({
@@ -3,8 +3,8 @@ import { extendTailwindMerge } from "tailwind-merge"
3
3
  const _twMergeExtend = {
4
4
  extend: {
5
5
  classGroups: {
6
- "focus-outline": [{ "focus-outline": ["", "no-offset", "none"]}],
7
- },
6
+ "focus-outline": [{ "focus-outline": ["", "no-offset", "none"] }]
7
+ }
8
8
  }
9
9
  } satisfies Parameters<typeof extendTailwindMerge>[0]
10
10
 
@@ -11,6 +11,5 @@ export const VueComponentsPlugin: Plugin = {
11
11
  install(app: App) {
12
12
  registerComponents(app, components)
13
13
  registerDirectives(app, directives)
14
- },
14
+ }
15
15
  }
16
-
@@ -19,7 +19,6 @@ import type { App } from "vue"
19
19
  * ```
20
20
  */
21
21
 
22
-
23
22
  export const registerComponents = (app: App, components: Record<string, any>, prefix = ""): void => {
24
23
  for (const key of Object.keys(components)) {
25
24
  const component = (components as any)[key]