@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
@@ -9,14 +9,18 @@
9
9
  text-neutral-400
10
10
  dark:text-neutral-600
11
11
  `,
12
- ($.wrapperAttrs as any)?.class,
12
+ ($.wrapperAttrs as any)?.class
13
13
  )"
14
14
  tabindex="-1"
15
- v-bind="{...$.wrapperAttrs, class:undefined}"
15
+ v-bind="{ ...$.wrapperAttrs, class: undefined }"
16
16
  ref="inputWrapperEl"
17
17
  >
18
- <slot name="label" v-bind="{ ...slotProps, label }">
19
- <lib-label v-if="label || $slots.default"
18
+ <slot
19
+ name="label"
20
+ v-bind="{ ...slotProps, label }"
21
+ >
22
+ <lib-label
23
+ v-if="label || $slots.default"
20
24
  :id="id ?? fallbackId"
21
25
  :disabled="disabled"
22
26
  :readonly="readonly"
@@ -37,7 +41,7 @@
37
41
  :data-disabled="disabled"
38
42
  :data-read-only="readonly"
39
43
  :data-is-open="isOpen"
40
- v-bind="{...$['inner-wrapperAttrs'], class:undefined}"
44
+ v-bind="{ ...$['inner-wrapperAttrs'], class: undefined }"
41
45
  :class="twMerge(`input--inner-wrapper
42
46
  relative
43
47
  flex
@@ -74,22 +78,31 @@
74
78
  dark:border-neutral-600
75
79
  border-neutral-400
76
80
  `,
77
- ($['inner-wrapperAttrs'] as any)?.class,
81
+ ($['inner-wrapperAttrs'] as any)?.class
78
82
  )"
79
83
  >
80
- <slot name="left" v-bind="slotProps"/>
81
- <slot name="input" v-bind="{ ...inputProps, ...slotProps, suggestionsIndicatorClickHandler }">
84
+ <slot
85
+ name="left"
86
+ v-bind="slotProps"
87
+ />
88
+ <slot
89
+ name="input"
90
+ v-bind="{ ...inputProps, ...slotProps, suggestionsIndicatorClickHandler }"
91
+ >
82
92
  <lib-simple-input
83
93
  :class="twMerge(
84
94
  `input--input p-0`,
85
95
  !$slots.left && `-ml-2 pl-2`,
86
96
  !$slots.right && (!$values || $values.length === 0) && !suggestions && `-mr-2 -pr-2`,
87
- ($.attrs as any)?.class,
97
+ ($.attrs as any)?.class
88
98
  )"
89
99
  v-bind="inputProps"
90
100
  />
91
101
  </slot>
92
- <slot name="indicator" v-bind="{isOpen, suggestionsIndicatorClickHandler }">
102
+ <slot
103
+ name="indicator"
104
+ v-bind="{ isOpen, suggestionsIndicatorClickHandler }"
105
+ >
93
106
  <!-- todo, convert to button for accessibility ? -->
94
107
  <div
95
108
  v-if="suggestions"
@@ -97,12 +110,14 @@
97
110
  :class="twMerge(`input--indicator flex flex-col justify-center`)"
98
111
  @click="suggestionsIndicatorClickHandler"
99
112
  >
100
- <icon :class="isOpen && `rotate-180`"> <i-fa6-solid-chevron-up/> </icon>
113
+ <icon :class="isOpen && `rotate-180`">
114
+ <i-fa6-solid-chevron-up/>
115
+ </icon>
101
116
  </div>
102
117
  </slot>
103
118
  <slot
104
119
  name="values"
105
- v-bind="{...multivaluesProps, ...slotProps}"
120
+ v-bind="{ ...multivaluesProps, ...slotProps }"
106
121
  >
107
122
  <template v-if="$values && $values.length > 0">
108
123
  <lib-multi-values
@@ -113,15 +128,22 @@
113
128
  py-1
114
129
  `,
115
130
  !$slots.right && `-mr-1`,
116
- ($.multivaluesAttrs as any)?.class,
131
+ ($.multivaluesAttrs as any)?.class
117
132
  )"
118
133
  v-bind="multivaluesProps"
119
134
  />
120
135
  </template>
121
136
  </slot>
122
- <slot name="right" v-bind="slotProps"/>
137
+ <slot
138
+ name="right"
139
+ v-bind="slotProps"
140
+ />
123
141
 
124
- <slot v-if="suggestions" name="suggestions" v-bind="{...suggestionProps, ...slotProps}">
142
+ <slot
143
+ v-if="suggestions"
144
+ name="suggestions"
145
+ v-bind="{ ...suggestionProps, ...slotProps }"
146
+ >
125
147
  <!-- todo 1px needs to be abstracted to var -->
126
148
  <lib-suggestions
127
149
  :class="twMerge(`
@@ -137,24 +159,27 @@
137
159
  !border && `
138
160
  rounded-sm
139
161
  `,
140
- ($.suggestionsAttrs as any)?.class,
162
+ ($.suggestionsAttrs as any)?.class
141
163
  )"
142
164
  ref="suggestionsComponent"
143
165
  v-bind="suggestionProps"
144
166
  >
145
167
  <template #item="itemSlotProps">
146
- <slot name="suggestion-item" v-bind="itemSlotProps"/>
168
+ <slot
169
+ name="suggestion-item"
170
+ v-bind="itemSlotProps"
171
+ />
147
172
  </template>
148
173
  </lib-suggestions>
149
174
  </slot>
150
175
  </div>
151
176
  </div>
152
177
  </template>
178
+
153
179
  <script setup lang="ts">
154
180
  import { isBlank } from "@alanscodelog/utils/isBlank"
155
- import { isObject } from "@alanscodelog/utils/isObject"
156
181
  import { pushIfNotIn } from "@alanscodelog/utils/pushIfNotIn"
157
- import { computed,type HTMLAttributes,type InputHTMLAttributes, nextTick, onBeforeMount, ref, toRef, useSlots, watch } from "vue"
182
+ import { computed, type HTMLAttributes, type InputHTMLAttributes, nextTick, ref, toRef, useSlots, watch } from "vue"
158
183
  import type { ComponentExposed } from "vue-component-type-helpers"
159
184
 
160
185
  import IFa6SolidChevronUp from "~icons/fa6-solid/chevron-up"
@@ -169,11 +194,10 @@ import LibSimpleInput from "../LibSimpleInput/LibSimpleInput.vue"
169
194
  import LibSuggestions from "../LibSuggestions/LibSuggestions.vue"
170
195
  import { type BaseInteractiveProps, getFallbackId, type LabelProps, type LinkableByIdProps, type SuggestionsProps, type TailwindClassProp, type WrapperProps } from "../shared/props.js"
171
196
 
172
-
173
197
  /* #region base */
174
198
  defineOptions({
175
- name: "lib-simple-input-deprecated",
176
- inheritAttrs: false,
199
+ name: "LibSimpleInputDeprecated",
200
+ inheritAttrs: false
177
201
  })
178
202
  const $slots = useSlots()
179
203
  const emit = defineEmits<{
@@ -191,7 +215,7 @@ const props = withDefaults(defineProps<Props>(), {
191
215
  valid: true,
192
216
  suggestions: undefined,
193
217
  updateOnlyOnSubmit: false,
194
- unstyle: false, disabled: false, readonly: false, border: true,
218
+ unstyle: false, disabled: false, readonly: false, border: true
195
219
  })
196
220
 
197
221
  const $ = useDivideAttrs(["wrapper", "inner-wrapper", "suggestions", "multivalues"] as const)
@@ -222,7 +246,6 @@ const suggestionsIndicatorClickHandler = (e: MouseEvent) => {
222
246
  emit("indicatorClick", e)
223
247
  }
224
248
 
225
-
226
249
  const handleKeydown = (e: KeyboardEvent) => {
227
250
  if (props.suggestions) {
228
251
  if (e.key === "Enter" && activeSuggestion.value === -1 && $values.value) {
@@ -263,7 +286,7 @@ const inputAriaProps = useSuggestionsInputAria(
263
286
  fullId,
264
287
  isOpen,
265
288
  activeSuggestion,
266
- suggestions,
289
+ suggestions
267
290
  )
268
291
  const inputProps = computed(() => ({
269
292
  id: fullId.value,
@@ -275,6 +298,7 @@ const inputProps = computed(() => ({
275
298
  onBlur: handleBlur,
276
299
  onFocus: handleFocus,
277
300
  modelValue: $inputValue.value,
301
+ // eslint-disable-next-line @typescript-eslint/naming-convention
278
302
  "onUpdate:modelValue": (e: string) => {
279
303
  $inputValue.value = e
280
304
  if (!props.suggestions && !props.updateOnlyOnSubmit && !props.restrictToSuggestions) {
@@ -293,7 +317,7 @@ const inputProps = computed(() => ({
293
317
  ...inputAriaProps.value,
294
318
  canEdit: canEdit.value,
295
319
  ...$.value.attrs,
296
- class: undefined,
320
+ class: undefined
297
321
  }))
298
322
 
299
323
  function slotSubmit(val: any, _wasRemoved: boolean): void {
@@ -308,7 +332,6 @@ const slotProps = computed(() => ({
308
332
  emitSubmit: slotSubmit
309
333
  }))
310
334
 
311
-
312
335
  const suggestionProps = computed(() => ({
313
336
  id: fullId.value,
314
337
  suggestions: props.suggestions,
@@ -319,18 +342,22 @@ const suggestionProps = computed(() => ({
319
342
  modelValue: $values.value ?? $modelValue.value.toString(),
320
343
  inputValue: $inputValue.value,
321
344
  isValid: props.isValid,
345
+ // eslint-disable-next-line @typescript-eslint/naming-convention
322
346
  "onUpdate:inputValue": (e: string) => $inputValue.value = e,
323
347
  onSubmit: (e: string, suggestion?: any, wasRemoved?: boolean) => {
324
348
  $modelValue.value = wasRemoved ? "" : e
325
349
  emit("submit", e, suggestion)
326
350
  },
351
+ // eslint-disable-next-line @typescript-eslint/naming-convention
327
352
  "onUpdate:modelValue": (e: string | string[]) => {
328
353
  $values.value &&= e as string[]
329
354
  },
355
+ // eslint-disable-next-line @typescript-eslint/naming-convention
330
356
  "onUpdate:isOpen": (e: boolean) => { isOpen.value = e },
357
+ // eslint-disable-next-line @typescript-eslint/naming-convention
331
358
  "onUpdate:activeSuggestion": (e: number) => activeSuggestion.value = e,
332
359
  ...$.value.suggestionsAttrs,
333
- class: undefined,
360
+ class: undefined
334
361
  }))
335
362
 
336
363
  const multivaluesProps = computed(() => ({
@@ -340,41 +367,39 @@ const multivaluesProps = computed(() => ({
340
367
  disabled: props.disabled,
341
368
  readonly: props.readonly,
342
369
  modelValue: $values.value,
370
+ // eslint-disable-next-line @typescript-eslint/naming-convention
343
371
  "onUpdate:modelValue": (e: string[]) => $values.value = e,
344
372
  ...$.value.multivaluesAttrs,
345
- class: undefined,
373
+ class: undefined
346
374
  }))
347
375
 
348
-
349
376
  defineExpose({
350
377
  suggestionsComponent,
351
- el: inputWrapperEl,
378
+ el: inputWrapperEl
352
379
  })
353
-
354
380
  </script>
355
- <script lang="ts">
356
381
 
357
- type WrapperTypes =
358
- & WrapperProps<"suggestions",HTMLAttributes >
359
- & WrapperProps<"wrapper", HTMLAttributes >
360
- & WrapperProps<"inner-wrapper",HTMLAttributes>
382
+ <script lang="ts">
383
+ type WrapperTypes
384
+ = & WrapperProps<"suggestions", HTMLAttributes>
385
+ & WrapperProps<"wrapper", HTMLAttributes>
386
+ & WrapperProps<"inner-wrapper", HTMLAttributes>
361
387
 
362
- type RealProps =
363
- SuggestionsProps
364
- & LinkableByIdProps
365
- & LabelProps
366
- & BaseInteractiveProps
367
- & {
368
- suggestions?: SuggestionsProps["suggestions"]
369
- valid?: boolean
370
- }
388
+ type RealProps
389
+ = SuggestionsProps
390
+ & LinkableByIdProps
391
+ & LabelProps
392
+ & BaseInteractiveProps
393
+ & {
394
+ suggestions?: SuggestionsProps["suggestions"]
395
+ valid?: boolean
396
+ }
371
397
 
372
398
  interface Props
373
399
  extends
374
400
  /** @vue-ignore */
375
- Partial<Omit<InputHTMLAttributes,"class" | "readonly" | "disabled" | "onSubmit"> & TailwindClassProp>,
401
+ Partial<Omit<InputHTMLAttributes, "class" | "readonly" | "disabled" | "onSubmit"> & TailwindClassProp>,
376
402
  /** @vue-ignore */
377
403
  Partial<WrapperTypes>,
378
404
  RealProps { }
379
405
  </script>
380
-
@@ -3,22 +3,19 @@ import type { Meta, StoryObj } from "@storybook/vue3"
3
3
 
4
4
  import Label from "./LibLabel.vue"
5
5
 
6
- // eslint-disable-next-line @typescript-eslint/no-restricted-imports
7
6
  import * as components from "../index.js"
8
7
 
9
-
10
8
  const meta: Meta<typeof Label> = {
11
9
  component: Label,
12
10
  title: "Components/Label",
13
11
  args: {
14
- slot: "label",
15
- },
12
+ slot: "label"
13
+ }
16
14
  }
17
15
 
18
16
  export default meta
19
17
  type Story = StoryObj<typeof Label>
20
18
 
21
-
22
19
  export const Primary: Story = {
23
20
  render: args => ({
24
21
  components,
@@ -31,7 +28,6 @@ export const Primary: Story = {
31
28
  <lib-label v-bind="args">{{args.slot}}</lib-label>
32
29
  <lib-simple-input modelValue="some input"></lib-simple-input>
33
30
  </div>
34
- `,
35
- }),
31
+ `
32
+ })
36
33
  }
37
-
@@ -12,37 +12,37 @@
12
12
  :data-disabled="disabled"
13
13
  :data-invalid="!valid"
14
14
  :for="id"
15
- v-bind="{...$attrs, class:undefined}"
15
+ v-bind="{ ...$attrs, class: undefined }"
16
16
  >
17
17
  <slot/>
18
18
  </label>
19
19
  </template>
20
20
 
21
21
  <script setup lang="ts">
22
- import type { MakeRequired } from "@alanscodelog/utils/types"
23
- import { type LabelHTMLAttributes,toRef,useAttrs } from "vue"
22
+ import { useAttrs } from "vue"
24
23
 
25
24
  import { twMerge } from "../../utils/twMerge.js"
26
- import { type BaseInteractiveProps, getFallbackId, type LabelProps, type LinkableByIdProps, type TailwindClassProp } from "../shared/props.js"
27
-
25
+ import { getFallbackId } from "../shared/props.js"
28
26
 
29
27
  defineOptions({
30
- name: "lib-label",
28
+ name: "LibLabel"
31
29
  })
32
30
 
33
31
  const fallbackId = getFallbackId()
34
32
 
35
- // eslint-disable-next-line no-undef
36
33
  withDefaults(defineProps<Props>(), {
37
34
  id: "",
38
35
  valid: true,
39
- unstyle: false, disabled: false, readonly: false, border: true,
36
+ unstyle: false, disabled: false, readonly: false, border: true
40
37
  })
41
38
 
42
39
  const $attrs = useAttrs()
43
40
  </script>
44
41
 
45
42
  <script lang="ts">
43
+ import type { LabelHTMLAttributes } from "vue"
44
+ import type { BaseInteractiveProps, LabelProps, LinkableByIdProps, TailwindClassProp } from "../shared/props.js"
45
+
46
46
  type RealProps =
47
47
  & LinkableByIdProps
48
48
  & LabelProps
@@ -4,24 +4,21 @@ import { ref } from "vue"
4
4
 
5
5
  import LibMultiValues from "./LibMultiValues.vue"
6
6
 
7
- // eslint-disable-next-line @typescript-eslint/no-restricted-imports
8
7
  import * as components from "../index.js"
9
8
 
10
-
11
9
  const meta = {
12
10
  component: LibMultiValues as any,
13
11
  title: "Components/MultiValues",
14
12
  args: {
15
13
  modelValue: ["A", "B", "C"],
16
- border: true,
14
+ border: true
17
15
  },
18
- tags: ["!test"],
16
+ tags: ["!test"]
19
17
  } satisfies Meta<typeof LibMultiValues> & Meta<{ custom: string }>
20
18
 
21
19
  export default meta
22
20
  type Story = StoryObj<typeof LibMultiValues> // & StoryObj<typeof extraArgs>
23
21
 
24
-
25
22
  /**
26
23
  * The multi-value component is just the values part beneath the input.
27
24
  *
@@ -42,10 +39,9 @@ export const Primary: Story = {
42
39
  args,
43
40
  inputValue,
44
41
  multiValueEl,
45
- onKeydownEnter,
42
+ onKeydownEnter
46
43
  })
47
- }
48
- ,
44
+ },
49
45
 
50
46
  template: `
51
47
  <p>Simple Input connected to multi-value.</p>
@@ -64,21 +60,20 @@ export const Primary: Story = {
64
60
  v-model="args.modelValue"
65
61
  />
66
62
  </div>
67
- `,
68
- }),
63
+ `
64
+ })
69
65
  }
70
66
 
71
-
72
67
  export const Disabled = {
73
68
  ...Primary,
74
69
  args: {
75
- disabled: true,
76
- },
70
+ disabled: true
71
+ }
77
72
  }
78
73
 
79
74
  export const Readonly = {
80
75
  ...Primary,
81
76
  args: {
82
- readonly: true,
83
- },
77
+ readonly: true
78
+ }
84
79
  }
@@ -18,7 +18,7 @@
18
18
  :data-read-only="readonly"
19
19
  :aria-label="`Values for ${label}`"
20
20
  :tabindex="disabled ? -1 : 0"
21
- v-bind="{...$.attrs, class:undefined}"
21
+ v-bind="{ ...$.attrs, class: undefined }"
22
22
  >
23
23
  <div
24
24
  :data-border="border"
@@ -82,22 +82,20 @@ import { copy } from "../../helpers/copy.js"
82
82
  import { twMerge } from "../../utils/twMerge.js"
83
83
  import Icon from "../Icon/Icon.vue"
84
84
  import LibButton from "../LibButton/LibButton.vue"
85
- import { type BaseInteractiveProps,type LabelProps, type TailwindClassProp, type WrapperProps } from "../shared/props.js"
86
-
85
+ import type { BaseInteractiveProps, LabelProps, TailwindClassProp, WrapperProps } from "../shared/props.js"
87
86
 
88
87
  defineOptions({
89
- name: "lib-multi-values",
90
- inheritAttrs: false,
88
+ name: "LibMultiValues",
89
+ inheritAttrs: false
91
90
  })
92
91
 
93
92
  const $ = useDivideAttrs(["item"] as const)
94
93
  const props = withDefaults(defineProps<Props>(), {
95
- unstyle: false, disabled: false, readonly: false, border: true,
94
+ unstyle: false, disabled: false, readonly: false, border: true
96
95
  })
97
96
 
98
-
99
97
  const canEdit = computed(() => !props.disabled && !props.readonly)
100
- const $modelValue = defineModel<T[]>({ default: () => []})
98
+ const $modelValue = defineModel<T[]>({ default: () => [] })
101
99
 
102
100
  const removeVal = (value: T) => {
103
101
  if (!canEdit.value) return
@@ -106,22 +104,20 @@ const removeVal = (value: T) => {
106
104
  </script>
107
105
 
108
106
  <script lang="ts">
109
- type WrapperTypes = Partial<WrapperProps<"item",HTMLAttributes>>
107
+ type WrapperTypes = Partial<WrapperProps<"item", HTMLAttributes>>
110
108
 
111
- type RealProps =
112
- & LabelProps
113
- & BaseInteractiveProps
114
- & {
115
- border?: boolean
116
- }
109
+ type RealProps
110
+ = & LabelProps
111
+ & BaseInteractiveProps
112
+ & {
113
+ border?: boolean
114
+ }
117
115
  interface Props
118
116
  extends
119
117
  /** @vue-ignore */
120
- Partial<Omit<HTMLAttributes,"class"> & TailwindClassProp>,
118
+ Partial<Omit<HTMLAttributes, "class"> & TailwindClassProp>,
121
119
  /** @vue-ignore */
122
120
  WrapperTypes,
123
121
  RealProps
124
122
  {}
125
-
126
123
  </script>
127
-
@@ -4,10 +4,8 @@ import type { Meta, StoryObj } from "@storybook/vue3"
4
4
  import LibNotification from "./LibNotification.vue"
5
5
 
6
6
  import { NotificationHandler } from "../../helpers/NotificationHandler.js"
7
- // eslint-disable-next-line @typescript-eslint/no-restricted-imports
8
7
  import * as components from "../index.js"
9
8
 
10
-
11
9
  const handler = new NotificationHandler()
12
10
 
13
11
  const meta: Meta<typeof LibNotification> = {
@@ -15,13 +13,12 @@ const meta: Meta<typeof LibNotification> = {
15
13
  title: "Components/Notification",
16
14
  args: {
17
15
 
18
- },
16
+ }
19
17
  }
20
18
 
21
19
  export default meta
22
20
  type Story = StoryObj<typeof LibNotification>
23
21
 
24
-
25
22
  export const Primary: Story = {
26
23
  render: args => ({
27
24
  components: { ...components, LibNotification },
@@ -31,17 +28,17 @@ export const Primary: Story = {
31
28
  backgrounds: { disable: true },
32
29
  template: `
33
30
  <lib-notification v-bind="args"/>
34
- `,
31
+ `
35
32
  }),
36
33
  args: {
37
34
  // @ts-expect-error calling protected method
38
35
  notification: { ...handler._createEntry({
39
36
  title: `Notification`,
40
- message: `This is a notification. Pick an option:`,
37
+ message: `This is a notification. Pick an option:`
41
38
  }),
42
- // eslint-disable-next-line @typescript-eslint/no-empty-function
43
- resolve: () => { } },
44
- },
39
+
40
+ resolve: () => { } }
41
+ }
45
42
  }
46
43
  export const WithoutTitle: Story = {
47
44
  ...Primary,
@@ -50,9 +47,9 @@ export const WithoutTitle: Story = {
50
47
  // @ts-expect-error calling protected method
51
48
  notification: handler._createEntry({
52
49
  ...Primary.args!.notification,
53
- title: undefined,
54
- }),
55
- },
50
+ title: undefined
51
+ })
52
+ }
56
53
  }
57
54
  export const WithCode: Story = {
58
55
  ...Primary,
@@ -61,9 +58,9 @@ export const WithCode: Story = {
61
58
  // @ts-expect-error calling protected method
62
59
  notification: handler._createEntry({
63
60
  ...Primary.args!.notification,
64
- code: "0001",
65
- }),
66
- },
61
+ code: "0001"
62
+ })
63
+ }
67
64
  }
68
65
  export const RequiresAction: Story = {
69
66
  ...Primary,
@@ -72,9 +69,9 @@ export const RequiresAction: Story = {
72
69
  // @ts-expect-error calling protected method
73
70
  notification: handler._createEntry({
74
71
  ...Primary.args!.notification,
75
- requiresAction: true,
76
- }),
77
- },
72
+ requiresAction: true
73
+ })
74
+ }
78
75
  }
79
76
 
80
77
  /** Should not have cancel cross in top corner. */
@@ -87,9 +84,9 @@ export const Uncancellable: Story = {
87
84
  notification: handler._createEntry({
88
85
  ...Primary.args!.notification,
89
86
  options: ["Ok"],
90
- cancellable: false,
91
- }),
92
- },
87
+ cancellable: false
88
+ })
89
+ }
93
90
  }
94
91
 
95
92
  export const CustomOptions: Story = {
@@ -99,9 +96,9 @@ export const CustomOptions: Story = {
99
96
  // @ts-expect-error calling protected method
100
97
  notification: handler._createEntry({
101
98
  ...Primary.args!.notification,
102
- options: ["Ok", "Default Answer", "Cancel"],
103
- }),
104
- },
99
+ options: ["Ok", "Default Answer", "Cancel"]
100
+ })
101
+ }
105
102
  }
106
103
  export const CustomDefaultOption: Story = {
107
104
  ...Primary,
@@ -110,9 +107,9 @@ export const CustomDefaultOption: Story = {
110
107
  // @ts-expect-error calling protected method
111
108
  notification: handler._createEntry({
112
109
  ...CustomOptions.args!.notification,
113
- default: "Default Answer",
114
- }),
115
- },
110
+ default: "Default Answer"
111
+ })
112
+ }
116
113
  }
117
114
  export const CustomDangerousOption: Story = {
118
115
  ...Primary,
@@ -122,9 +119,9 @@ export const CustomDangerousOption: Story = {
122
119
  notification: handler._createEntry({
123
120
  ...CustomOptions.args!.notification,
124
121
  options: ["Ok", "Dangerous Option", "Cancel"],
125
- dangerous: ["Dangerous Option"],
126
- }),
127
- },
122
+ dangerous: ["Dangerous Option"]
123
+ })
124
+ }
128
125
  }
129
126
  export const CustomDefaultAndDangerousOption: Story = {
130
127
  ...Primary,
@@ -135,8 +132,7 @@ export const CustomDefaultAndDangerousOption: Story = {
135
132
  ...CustomOptions.args!.notification,
136
133
  options: ["Ok", "Default Answer", "Dangerous Option", "Cancel"],
137
134
  default: "Default Answer",
138
- dangerous: ["Dangerous Option"],
139
- }),
140
- },
135
+ dangerous: ["Dangerous Option"]
136
+ })
137
+ }
141
138
  }
142
-