@witchcraft/ui 0.2.1-beta.3 → 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 +1 -1
  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 +25 -28
  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
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <!-- todo aria errors -->
3
- <div :class="twMerge(`file-input
3
+ <div
4
+ :class="twMerge(`file-input
4
5
  justify-center
5
6
  border-2
6
7
  border-dashed
@@ -8,25 +9,26 @@
8
9
  focus-outline-within
9
10
  transition-[border-color,box-shadow]
10
11
  ease-out`,
11
- compact && `rounded-sm`,
12
- !compact && `flex w-full flex-col items-center gap-2 rounded-xl p-2 `,
13
- errors.length > 0 && errorFlashing && `border-danger-400`,
14
- ( $.wrapperAttrs as any ).class
12
+ compact && `rounded-sm`,
13
+ !compact && `flex w-full flex-col items-center gap-2 rounded-xl p-2 `,
14
+ errors.length > 0 && errorFlashing && `border-danger-400`,
15
+ ($.wrapperAttrs as any).class
15
16
  )"
16
- v-bind="{...$.wrapperAttrs, class:undefined}"
17
+ v-bind="{ ...$.wrapperAttrs, class: undefined }"
17
18
  >
18
- <div :class="twMerge( `
19
+ <div
20
+ :class="twMerge(`
19
21
  file-input--wrapper
20
22
  relative justify-center`,
21
- compact && `flex gap-2`,
22
- !compact && `input-wrapper
23
+ compact && `flex gap-2`,
24
+ !compact && `input-wrapper
23
25
  flex flex-col items-center
24
26
  `
25
- )"
27
+ )"
26
28
  >
27
29
  <label
28
30
  :for="id ?? fallbackId"
29
- :class="twMerge( `
31
+ :class="twMerge(`
30
32
  file-input--label
31
33
  pointer-events-none
32
34
  flex
@@ -35,7 +37,10 @@
35
37
  whitespace-nowrap
36
38
  `)"
37
39
  >
38
- <slot v-if="compact || multiple || files.length === 0" name="icon">
40
+ <slot
41
+ v-if="compact || multiple || files.length === 0"
42
+ name="icon"
43
+ >
39
44
  <icon><i-fa6-solid-arrow-up-from-bracket/></icon>
40
45
  </slot>
41
46
  <slot name="label">
@@ -57,7 +62,10 @@
57
62
  {{ ` (${files.length})` }}
58
63
  </span>
59
64
  </label>
60
- <label v-if="!compact && formats?.length > 0" class="file-input--formats-label flex flex-col items-center text-sm">
65
+ <label
66
+ v-if="!compact && formats?.length > 0"
67
+ class="file-input--formats-label flex flex-col items-center text-sm"
68
+ >
61
69
  <slot name="formats">{{ t("file-input.accepted-formats") }}: </slot>
62
70
  <div class="file-input--formats-list">
63
71
  {{ extensions.join(", ") }}
@@ -80,13 +88,14 @@
80
88
  :accept="formats.join(', ')"
81
89
  :multiple="multiple"
82
90
  ref="el"
83
- v-bind="{...$.inputAttrs, class:undefined}"
91
+ v-bind="{ ...$.inputAttrs, class: undefined }"
84
92
  @input="(inputFile as any)"
85
93
  @click="($event.target! as any).value = null"
86
94
  >
87
95
  <!-- click event allows event to fire even if the user picks the same file -->
88
96
  </div>
89
- <div v-if="!compact && files.length > 0"
97
+ <div
98
+ v-if="!compact && files.length > 0"
90
99
  :class="twMerge(`file-input--previews
91
100
  flex items-stretch justify-center gap-2 flex-wrap
92
101
  `,
@@ -97,7 +106,8 @@
97
106
  )"
98
107
  >
99
108
  <div class="file-input--preview-spacer flex-1"/>
100
- <div class="file-input--preview-wrapper
109
+ <div
110
+ class="file-input--preview-wrapper
101
111
  z-1
102
112
  relative
103
113
  flex
@@ -124,16 +134,21 @@
124
134
  </div>
125
135
 
126
136
  <div class="file-input--preview flex flex-initial basis-full justify-center">
127
- <div v-if="entry.isImg"
137
+ <div
138
+ v-if="entry.isImg"
128
139
  class="file-input--preview-image
129
140
  bg-transparency-squares flex
130
141
  h-[80px] flex-wrap items-center
131
142
  justify-center
132
143
  "
133
144
  >
134
- <img class="max-h-full w-auto" :src="getSrc(entry.file)">
145
+ <img
146
+ class="max-h-full w-auto"
147
+ :src="getSrc(entry.file)"
148
+ >
135
149
  </div>
136
- <div v-if="!entry.isImg"
150
+ <div
151
+ v-if="!entry.isImg"
137
152
  class="file-input--preview-no-image
138
153
  flex h-[80px]
139
154
  flex-1 basis-full flex-wrap items-center justify-center
@@ -142,7 +157,8 @@
142
157
  <icon><i-fa6-regular-file class="text-4xl opacity-50"/></icon>
143
158
  </div>
144
159
  </div>
145
- <div class="
160
+ <div
161
+ class="
146
162
  file-input--preview-filename
147
163
  min-w-0
148
164
  flex-1
@@ -163,8 +179,9 @@
163
179
  </div>
164
180
  </div>
165
181
  </template>
182
+
166
183
  <script setup lang="ts">
167
- import { computed, type HTMLAttributes, type InputHTMLAttributes,ref, shallowReactive, watch } from "vue"
184
+ import { computed, type HTMLAttributes, type InputHTMLAttributes, ref, shallowReactive, watch } from "vue"
168
185
 
169
186
  import IFa6RegularFile from "~icons/fa6-regular/file"
170
187
  import IFa6SolidArrowUpFromBracket from "~icons/fa6-solid/arrow-up-from-bracket"
@@ -172,11 +189,11 @@ import IFa6SolidXmark from "~icons/fa6-solid/xmark"
172
189
 
173
190
  import { useDivideAttrs } from "../../composables/useDivideAttrs.js"
174
191
  import { useInjectedI18n } from "../../composables/useInjectedI18n.js"
175
- import { type FileInputError } from "../../types/index.js"
192
+ import type { FileInputError } from "../../types/index.js"
176
193
  import { twMerge } from "../../utils/twMerge.js"
177
194
  import Icon from "../Icon/Icon.vue"
178
195
  import LibButton from "../LibButton/LibButton.vue"
179
- import { getFallbackId,type LinkableByIdProps, type TailwindClassProp, type WrapperProps } from "../shared/props.js"
196
+ import { getFallbackId, type LinkableByIdProps, type TailwindClassProp, type WrapperProps } from "../shared/props.js"
180
197
 
181
198
  const t = useInjectedI18n()
182
199
  const el = ref<null | HTMLInputElement>(null)
@@ -200,11 +217,11 @@ watch(errors, () => {
200
217
  })
201
218
 
202
219
  defineOptions({
203
- name: "lib-file-input",
204
- inheritAttrs: false,
220
+ name: "LibFileInput",
221
+ inheritAttrs: false
205
222
  })
206
223
  const $ = useDivideAttrs(["wrapper", "input", "previews"] as const)
207
-
224
+
208
225
  const emits = defineEmits<{
209
226
  (e: "input", val: File[]): void
210
227
  (e: "errors", val: FileInputError[]): void
@@ -214,7 +231,7 @@ const fallbackId = getFallbackId()
214
231
  const props = withDefaults(defineProps<Props>(), {
215
232
  multiple: false,
216
233
  formats: () => ["image/*", ".jpeg", ".jpg", ".png"],
217
- compact: false,
234
+ compact: false
218
235
  })
219
236
 
220
237
  const mimeTypes = computed(() => props.formats?.filter(_ => !_.startsWith(".")) ?? [])
@@ -230,7 +247,7 @@ const removeFile = (entry: Entry) => {
230
247
  files.splice(index, 1)
231
248
  }
232
249
  const extensionsList = computed(() => extensions.value.join(", "))
233
- const inputFile = async (e: InputEvent): Promise<void | boolean> => {
250
+ const inputFile = async (e: InputEvent): Promise<undefined | boolean> => {
234
251
  e.preventDefault()
235
252
  if (el.value!.files) {
236
253
  const errs = []
@@ -268,34 +285,35 @@ const inputFile = async (e: InputEvent): Promise<void | boolean> => {
268
285
  errors.splice(0, errors.length)
269
286
  }
270
287
  }
288
+ return undefined
271
289
  }
272
-
273
290
  </script>
291
+
274
292
  <script lang="ts">
275
- export default { name: "lib-file-input" }
293
+ export default { name: "LibFileInput" }
276
294
 
277
- type WrapperTypes =
278
- & WrapperProps<"input", InputHTMLAttributes >
279
- & WrapperProps<"wrapper", HTMLAttributes >
280
- & WrapperProps<"previews",HTMLAttributes >
295
+ type WrapperTypes
296
+ = & WrapperProps<"input", InputHTMLAttributes>
297
+ & WrapperProps<"wrapper", HTMLAttributes>
298
+ & WrapperProps<"previews", HTMLAttributes>
281
299
 
282
- type RealProps =
283
- & LinkableByIdProps
284
- & {
285
- multiple?: boolean
286
- /**
287
- * 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.
288
- *
289
- * Pass an empty array to allow any filetype.
290
- */
291
- formats?: string[]
292
- compact?: boolean
293
- }
300
+ type RealProps
301
+ = & LinkableByIdProps
302
+ & {
303
+ multiple?: boolean
304
+ /**
305
+ * 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.
306
+ *
307
+ * Pass an empty array to allow any filetype.
308
+ */
309
+ formats?: string[]
310
+ compact?: boolean
311
+ }
294
312
 
295
313
  interface Props
296
314
  extends
297
315
  /** @vue-ignore */
298
- Partial<Omit<InputHTMLAttributes,"class" | "multiple" | "formats" | "compact"> & TailwindClassProp>,
316
+ Partial<Omit<InputHTMLAttributes, "class" | "multiple" | "formats" | "compact"> & TailwindClassProp>,
299
317
  /** @vue-ignore */
300
318
  Partial<WrapperTypes>,
301
319
  RealProps { }
@@ -12,7 +12,6 @@ import IconFaSolidTags from "~icons/fa6-solid/tags"
12
12
  import { vExtractRootEl } from "../../directives/vExtractRootEl.js"
13
13
  import { createRecorderHandler, createRecorderWatchEffect } from "../../helpers/storybook.js"
14
14
  import Icon from "../Icon/Icon.vue"
15
- // eslint-disable-next-line @typescript-eslint/no-restricted-imports
16
15
  import * as components from "../index.js"
17
16
  import {
18
17
  playBasicVModel,
@@ -21,7 +20,7 @@ import {
21
20
  import {
22
21
  playBasicClickSelect,
23
22
  playBasicKeyboardSelect,
24
- playBasicSelect,
23
+ playBasicSelect
25
24
  } from "../shared/storyHelpers/playSuggestions.js"
26
25
 
27
26
  const meta = {
@@ -31,9 +30,9 @@ const meta = {
31
30
  border: true,
32
31
  label: "Some Label",
33
32
  ...{
34
- _template: undefined,
33
+ _template: undefined
35
34
  } as any
36
- },
35
+ }
37
36
  } satisfies Meta<typeof LibInputDeprecated> & Meta<{ custom: string }>
38
37
 
39
38
  export default meta
@@ -45,10 +44,9 @@ const allComponents = {
45
44
  IconFaChevronRight,
46
45
  IconFaChevronLeft,
47
46
  IconFaSolidKeyboard,
48
- IconFaSolidTags,
47
+ IconFaSolidTags
49
48
  }
50
49
 
51
-
52
50
  const playAutosuggestSelectLike = async (context: { canvasElement: HTMLElement, args: any }) => {
53
51
  await playBasicSelect(context)
54
52
  await playBasicKeyboardSelect(context)
@@ -57,24 +55,24 @@ const playAutosuggestSelectLike = async (context: { canvasElement: HTMLElement,
57
55
 
58
56
  const setupModelValue = (args: any) => ({
59
57
  modelValue: ref(args.modelValue ?? ""),
60
- inputValue: ref(args.inputValue ?? ""),
58
+ inputValue: ref(args.inputValue ?? "")
61
59
  })
62
60
 
63
61
  const setupModelValues = (args: any) => ({
64
- values: ref(args.values ?? undefined),
62
+ values: ref(args.values ?? undefined)
65
63
  })
66
64
 
67
65
  const Base: Story = {
68
66
  render: args => ({
69
67
  components: allComponents,
70
68
  setup: () => ({
71
-
69
+
72
70
  ...setupModelValue(args),
73
71
  ...setupModelValues(args),
74
72
  args: {
75
73
  ...args,
76
- updateOnlyOnSubmit: args.suggestions !== undefined,
77
- },
74
+ updateOnlyOnSubmit: args.suggestions !== undefined
75
+ }
78
76
  }),
79
77
 
80
78
  template: (args as any)._template ?? `
@@ -87,8 +85,8 @@ const Base: Story = {
87
85
  @submit="modelValue = $event"
88
86
  >
89
87
  </lib-simple-input-deprecated>
90
- `,
91
- }),
88
+ `
89
+ })
92
90
  }
93
91
 
94
92
  export const Primary: Story = {
@@ -99,54 +97,53 @@ export const Primary: Story = {
99
97
  export const Disabled: Story = {
100
98
  ...Base,
101
99
  args: {
102
- disabled: true,
103
- },
100
+ disabled: true
101
+ }
104
102
  }
105
103
  export const Readonly: Story = {
106
104
  ...Base,
107
105
  args: {
108
- readonly: true,
109
- },
106
+ readonly: true
107
+ }
110
108
  }
111
109
  export const Invalid: Story = {
112
110
  ...Base,
113
111
  args: {
114
- valid: false,
115
- },
112
+ valid: false
113
+ }
116
114
  }
117
115
 
118
116
  export const AttrsPassword: Story = {
119
117
  ...Base,
120
118
  args: {
121
- type: "password",
122
- } as any,
119
+ type: "password"
120
+ } as any
123
121
  }
124
122
  export const AttrsDate: Story = {
125
123
  ...Base,
126
124
  args: {
127
- type: "date",
128
- } as any,
125
+ type: "date"
126
+ } as any
129
127
  }
130
128
  export const AttrsNumber: Story = {
131
129
  ...Base,
132
130
  args: {
133
- type: "number",
134
- } as any,
131
+ type: "number"
132
+ } as any
135
133
  }
136
134
 
137
135
  export const Borderless = {
138
136
  ...Base,
139
137
  args: {
140
138
  border: false,
141
- suggestions: ["A", "AB", "ABC", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"],
142
- },
139
+ suggestions: ["A", "AB", "ABC", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
140
+ }
143
141
  }
144
142
 
145
-
146
143
  export const WithAutosuggest = {
147
144
  ...Base,
148
145
  args: {
149
- suggestions: ["A", "AB", "ABC", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"],
146
+ suggestions: ["A", "AB", "ABC", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
150
147
  },
151
148
  play: playAutosuggestSelectLike
152
149
  }
@@ -155,21 +152,21 @@ export const WithAutosuggestNoLabel = {
155
152
  ...Base,
156
153
  args: {
157
154
  label: undefined,
158
- suggestions: ["A", "AB", "ABC", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"],
155
+ suggestions: ["A", "AB", "ABC", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
159
156
  },
160
157
  play: playAutosuggestSelectLike
161
158
  }
162
159
  export const WithInstantAutosuggest = {
163
160
  ...Base,
164
161
  args: {
165
- suggestions: ["A", "AB", "ABC", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"],
166
- },
162
+ suggestions: ["A", "AB", "ABC", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
163
+ }
167
164
  }
168
165
  export const AutosuggestRestricted = {
169
166
  ...WithAutosuggest,
170
167
  args: {
171
168
  ...WithAutosuggest.args,
172
- restrictToSuggestions: true,
169
+ restrictToSuggestions: true
173
170
  },
174
171
  play: playAutosuggestSelectLike
175
172
  }
@@ -192,14 +189,14 @@ export const AutosuggestRestrictedWithClearOnClick = {
192
189
  </lib-simple-input-deprecated>
193
190
  `
194
191
  },
195
- play: null,
192
+ play: null
196
193
  }
197
194
  export const AutosuggestSelectLikeShowAllUnrestricted = {
198
195
  ...WithAutosuggest,
199
196
  args: {
200
197
  ...WithAutosuggest.args,
201
198
  restrictToSuggestions: false,
202
- suggestionsFilter: (_input: string, items: string[]) => items,
199
+ suggestionsFilter: (_input: string, items: string[]) => items
203
200
  },
204
201
  play: playAutosuggestSelectLike
205
202
  }
@@ -212,9 +209,9 @@ export const AutosuggestObjectOptions = {
212
209
  { label: "A", other: "some data A" },
213
210
  { label: "AB", other: "some data AB" },
214
211
  { label: "ABC", other: "some data ABC" },
215
- { label: "ABCDEFGHIJKLMNOPQRSTUVWXYZ", other: "some data ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
212
+ { label: "ABCDEFGHIJKLMNOPQRSTUVWXYZ", other: "some data ABCDEFGHIJKLMNOPQRSTUVWXYZ" }
216
213
  ],
217
- suggestionLabel: (item: any) => item.label,
214
+ suggestionLabel: (item: any) => item.label
218
215
  },
219
216
  play: playAutosuggestSelectLike
220
217
  }
@@ -227,10 +224,9 @@ export const Slots: Story = {
227
224
  ...setupModelValues(args),
228
225
  args: {
229
226
  ...args,
230
- updateOnlyOnSubmit: args.suggestions !== undefined,
231
- },
232
- })
233
- ,
227
+ updateOnlyOnSubmit: args.suggestions !== undefined
228
+ }
229
+ }),
234
230
  template: `
235
231
  Model Value: <span class="inline-block" data-testid="model-value">{{modelValue}}</span>\n
236
232
 
@@ -253,8 +249,8 @@ export const Slots: Story = {
253
249
  </lib-button>
254
250
  </template>
255
251
  </lib-simple-input-deprecated>
256
- `,
257
- }),
252
+ `
253
+ })
258
254
  }
259
255
  const MultipleValuesBase: Story = {
260
256
  render: args => ({
@@ -262,9 +258,8 @@ const MultipleValuesBase: Story = {
262
258
  setup: () => ({
263
259
  ...setupModelValue(args),
264
260
  ...setupModelValues(args),
265
- args,
266
- })
267
- ,
261
+ args
262
+ }),
268
263
 
269
264
  template: `
270
265
  Model Value: <span class="inline-block" data-testid="model-value">{{modelValue}}</span>\n
@@ -281,12 +276,12 @@ const MultipleValuesBase: Story = {
281
276
  </lib-button>
282
277
  </template>
283
278
  </lib-simple-input-deprecated>
284
- `,
279
+ `
285
280
  }),
286
281
  args: {
287
- values: ["A", "B", "C"],
288
- },
289
-
282
+ values: ["A", "B", "C"]
283
+ }
284
+
290
285
  }
291
286
  /** Press enter to add a value. */
292
287
  export const WithMultipleValues: Story = {
@@ -298,7 +293,7 @@ export const WithMultipleValuesWithSuggestions = {
298
293
  ...MultipleValuesBase,
299
294
  args: {
300
295
  ...MultipleValuesBase.args,
301
- suggestions: ["A", "AB", "ABC", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"],
296
+ suggestions: ["A", "AB", "ABC", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
302
297
  },
303
298
  play: playAutosuggestSelectLike
304
299
  }
@@ -307,7 +302,7 @@ export const WithMultipleValuesWithSuggestionsNoSelected = {
307
302
  args: {
308
303
  ...MultipleValuesBase.args,
309
304
  suggestions: ["A", "AB", "ABC", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"],
310
- showSelectedValues: false,
305
+ showSelectedValues: false
311
306
  },
312
307
  play: playAutosuggestSelectLike
313
308
  }
@@ -315,15 +310,15 @@ export const WithMultipleValuesDisabled = {
315
310
  ...MultipleValuesBase,
316
311
  args: {
317
312
  ...MultipleValuesBase.args,
318
- disabled: true,
319
- },
313
+ disabled: true
314
+ }
320
315
  }
321
316
  export const WithMultipleValuesReadonly = {
322
317
  ...MultipleValuesBase,
323
318
  args: {
324
319
  ...MultipleValuesBase.args,
325
- readonly: true,
326
- },
320
+ readonly: true
321
+ }
327
322
  }
328
323
 
329
324
  export const InputSlotReplacement: Story = {
@@ -345,10 +340,9 @@ export const InputSlotReplacement: Story = {
345
340
  recorderEl,
346
341
  modelValue,
347
342
  values,
348
- args,
343
+ args
349
344
  }
350
- }
351
- ,
345
+ },
352
346
 
353
347
  template: `
354
348
  Model Value: <span class="inline-block" data-testid="model-value">{{modelValue}}</span>\n
@@ -378,21 +372,20 @@ export const InputSlotReplacement: Story = {
378
372
  <icon><icon-fa-solid-keyboard/></icon>
379
373
  </template>
380
374
  </lib-simple-input-deprecated>
381
- `,
375
+ `
382
376
  }),
383
377
  args: {
384
- values: ["A", "B", "C"],
385
- },
378
+ values: ["A", "B", "C"]
379
+ }
386
380
  }
387
381
 
388
-
389
382
  export const NextToButton: Story = {
390
383
  render: args => ({
391
384
  components: allComponents,
392
385
  setup: () => ({
393
386
  ...setupModelValue(args),
394
387
  ...setupModelValues(args),
395
- args,
388
+ args
396
389
  }),
397
390
 
398
391
  template: `
@@ -406,7 +399,6 @@ export const NextToButton: Story = {
406
399
  </lib-simple-input-deprecated>
407
400
  <lib-button>Button</lib-button>
408
401
  </div>
409
- `,
410
- }),
402
+ `
403
+ })
411
404
  }
412
-