vueless 0.0.584 → 0.0.586

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.
@@ -1,10 +1,10 @@
1
1
  import { computed, onBeforeUnmount, onMounted, toValue, watch } from "vue";
2
2
  import { isSSR } from "../utils/helper.ts";
3
3
 
4
- import type { TemplateRefElement } from "../types.ts";
4
+ import type { MaybeRef } from "vue";
5
5
 
6
6
  export function useMutationObserver(
7
- target: TemplateRefElement,
7
+ target: MaybeRef<Element | Element[] | null>,
8
8
  callback: MutationCallback,
9
9
  config = { childList: true, attributes: true, characterData: true },
10
10
  ) {
@@ -1,12 +1,11 @@
1
- import type { DirectiveBinding } from "vue";
2
- import type { TemplateRefElement } from "../../types.ts";
1
+ import type { DirectiveBinding, MaybeRef } from "vue";
3
2
 
4
3
  export type RemoveEvents = () => void;
5
4
  export type ClickCallback = (event: MouseEvent) => void;
6
5
 
7
6
  export interface ClickOutsideOptions {
8
7
  capture?: boolean;
9
- ignore?: TemplateRefElement[];
8
+ ignore?: MaybeRef<Element | Element[] | null>[];
10
9
  }
11
10
 
12
11
  export interface DirectiveBindingCallback extends DirectiveBinding {
@@ -10,6 +10,10 @@ import type {
10
10
  DirectiveBindingOptions,
11
11
  } from "./types.ts";
12
12
 
13
+ function isElement(element: EventTarget | null) {
14
+ return element instanceof HTMLElement || element instanceof SVGElement;
15
+ }
16
+
13
17
  function clickOutside(
14
18
  target: MaybeRef<HTMLElement | null>,
15
19
  handler: ClickCallback,
@@ -21,9 +25,9 @@ function clickOutside(
21
25
  const el = unref(target);
22
26
 
23
27
  function onClick(event: MouseEvent) {
24
- if (!(event.target instanceof HTMLElement)) return;
28
+ if (!isElement(event.target)) return;
25
29
 
26
- const targetElements = event.composedPath().filter((element) => element instanceof HTMLElement);
30
+ const targetElements = event.composedPath().filter((element) => isElement(element));
27
31
 
28
32
  if (
29
33
  !el ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.584",
3
+ "version": "0.0.586",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
package/types.ts CHANGED
@@ -55,12 +55,10 @@ import UInputFileConfig from "./ui.form-input-file/config.ts";
55
55
  import UInputMoneyConfig from "./ui.form-input-money/config.ts";
56
56
  import UDataListConfig from "./ui.data-list/config.ts";
57
57
 
58
- import type { ComputedRef, MaybeRef, Ref, ComponentInternalInstance } from "vue";
58
+ import type { ComputedRef, Ref, ComponentInternalInstance } from "vue";
59
59
  import type { Props } from "tippy.js";
60
60
  import type { LocaleOptions } from "./adatper.locale/vueless.ts";
61
61
 
62
- export type TemplateRefElement = MaybeRef<HTMLElement | HTMLElement[] | null>;
63
-
64
62
  export enum ColorMode {
65
63
  Dark = "dark",
66
64
  Light = "light",
@@ -228,20 +226,17 @@ export interface Components {
228
226
  UDataList: Partial<typeof UDataListConfig>;
229
227
  }
230
228
 
231
- export type Component = {
232
- i18n?: UnknownObject;
233
- defaults?: Defaults;
234
- safelist?: (string: string) => TailwindSafelist[];
235
- strategy?: Strategies;
236
- transition?: Transition;
237
- safelistColors?: BrandColors[];
238
- } & (CVA & NestedComponent);
239
-
240
229
  /* Make all config keys optional and allow to have string and object values. */
241
230
  export type ComponentConfig<T> = Partial<{
242
- [K in keyof T]: T[K] | string | UnknownObject;
231
+ [K in keyof T]: K extends string
232
+ ? K extends `${string}transition${string}` | `${string}Transition${string}`
233
+ ? Transition
234
+ : K extends "i18n"
235
+ ? T[K]
236
+ : T[K] | string | UnknownObject
237
+ : never;
243
238
  }> &
244
- Component;
239
+ NestedComponent;
245
240
 
246
241
  export interface NestedComponent {
247
242
  [key: string]: Record<string, string | UnknownObject> | string;
@@ -307,11 +302,6 @@ export interface CreateVuelessOptions {
307
302
  i18n?: LocaleOptions;
308
303
  }
309
304
 
310
- export interface TailwindSafelist {
311
- pattern: string;
312
- variants?: string[];
313
- }
314
-
315
305
  export interface TailwindColorShades {
316
306
  50: string;
317
307
  100: string;
@@ -75,7 +75,7 @@ const EnumVariantTemplate: StoryFn<UButtonArgs> = (args: UButtonArgs, { argTypes
75
75
  `,
76
76
  });
77
77
 
78
- const ColorTemplate: StoryFn<UButtonArgs> = (args, { argTypes }) => ({
78
+ const ColorTemplate: StoryFn<UButtonArgs> = (args: UButtonArgs, { argTypes }) => ({
79
79
  components: { UButton, URow, UCol },
80
80
  setup() {
81
81
  const variantOptions = (argTypes.variant as StoryArgType)?.options ?? [];
@@ -63,7 +63,7 @@ const {
63
63
  bodyAttrs,
64
64
  titleAttrs,
65
65
  toggleIconAttrs,
66
- dividerAttrs,
66
+ accordionDividerAttrs,
67
67
  } = useUI<Config>(defaultConfig, mutatedProps);
68
68
  </script>
69
69
 
@@ -86,6 +86,6 @@ const {
86
86
  <div :id="`description-${elementId}`" v-bind="descriptionAttrs" v-text="description" />
87
87
  </div>
88
88
 
89
- <UDivider :size="dividerSize" v-bind="dividerAttrs" />
89
+ <UDivider :size="dividerSize" v-bind="accordionDividerAttrs" />
90
90
  </div>
91
91
  </template>
@@ -25,7 +25,7 @@ export default /*tw*/ {
25
25
  },
26
26
  },
27
27
  toggleIcon: "{UIcon}",
28
- divider: "{UDivider} group-last:hidden",
28
+ accordionDivider: "{UDivider} group-last:hidden",
29
29
  defaults: {
30
30
  size: "md",
31
31
  /* icons */
@@ -39,7 +39,7 @@ const isShownFooter = computed(() => {
39
39
  const {
40
40
  wrapperAttrs,
41
41
  titleAttrs,
42
- dividerAttrs,
42
+ cardDividerAttrs,
43
43
  headerAttrs,
44
44
  headerLeftAttrs,
45
45
  headerLeftFallbackAttrs,
@@ -77,7 +77,7 @@ const {
77
77
  <slot />
78
78
  </div>
79
79
 
80
- <UDivider v-if="isShownFooter" padding="none" v-bind="dividerAttrs" />
80
+ <UDivider v-if="isShownFooter" padding="none" v-bind="cardDividerAttrs" />
81
81
 
82
82
  <div v-if="isShownFooter" v-bind="footerAttrs">
83
83
  <!-- @slot Use it to add something to the left side of the footer. -->
@@ -6,7 +6,7 @@ export default /*tw*/ {
6
6
  title: "{UHeader}",
7
7
  description: "mt-1 text-sm font-normal text-gray-500",
8
8
  content: "text-sm",
9
- divider: "{UDivider}",
9
+ cardDivider: "{UDivider}",
10
10
  footer: "flex justify-between",
11
11
  defaults: {
12
12
  //
@@ -14,7 +14,6 @@ import defaultConfig from "./config.ts";
14
14
  import { UModal } from "./constants.ts";
15
15
 
16
16
  import type { Props, Config } from "./types.ts";
17
- import type { Transition } from "../types.ts";
18
17
 
19
18
  defineOptions({ inheritAttrs: false });
20
19
 
@@ -117,7 +116,7 @@ const {
117
116
  backLinkAttrs,
118
117
  backLinkIconAttrs,
119
118
  closeIconAttrs,
120
- dividerAttrs,
119
+ modalDividerAttrs,
121
120
  dividerSpacingAttrs,
122
121
  overlayAttrs,
123
122
  wrapperAttrs,
@@ -135,11 +134,11 @@ const {
135
134
  </script>
136
135
 
137
136
  <template>
138
- <Transition v-bind="config.overlayTransition as Transition">
137
+ <Transition v-bind="config.overlayTransition">
139
138
  <div v-if="isShownModal" v-bind="overlayAttrs" />
140
139
  </Transition>
141
140
 
142
- <Transition v-bind="config.wrapperTransition as Transition">
141
+ <Transition v-bind="config.wrapperTransition">
143
142
  <div
144
143
  v-if="isShownModal"
145
144
  :id="elementId"
@@ -220,7 +219,7 @@ const {
220
219
  <UDivider v-if="!isExistFooter || !noDivider" no-border v-bind="dividerSpacingAttrs" />
221
220
 
222
221
  <template v-if="isExistFooter">
223
- <UDivider v-if="!noDivider" variant="dark" padding="none" v-bind="dividerAttrs" />
222
+ <UDivider v-if="!noDivider" variant="dark" padding="none" v-bind="modalDividerAttrs" />
224
223
 
225
224
  <div v-bind="footerAttrs">
226
225
  <div v-if="hasSlotContent($slots['footer-left'])" v-bind="footerLeftAttrs">
@@ -28,7 +28,7 @@ export default /*tw*/ {
28
28
  headerRight: "",
29
29
  closeIcon: "{UIcon}",
30
30
  body: "space-y-4 px-4 md:px-8 text-sm",
31
- divider: "{UDivider}",
31
+ modalDivider: "{UDivider}",
32
32
  dividerSpacing: "{UDivider}",
33
33
  footer: "flex justify-between px-4 md:px-8 py-8 max-md:flex-col max-md:gap-4",
34
34
  footerLeft: "flex flex-col md:flex-row space-y-4 md:space-x-4 md:space-y-0 w-full",
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts" generic="TModelValue extends DateValue">
2
- import { computed, ref, watch, useTemplateRef } from "vue";
2
+ import { computed, ref, watch, useTemplateRef, nextTick } from "vue";
3
3
  import { merge } from "lodash-es";
4
4
 
5
5
  import useUI from "../composables/useUI.ts";
@@ -47,7 +47,6 @@ import type { ComponentExposed } from "../types.ts";
47
47
  import DayView from "./UCalendarDayView.vue";
48
48
  import MonthView from "./UCalendarMonthView.vue";
49
49
  import YearView from "./UCalendarYearView.vue";
50
- import { nextTick } from "process";
51
50
 
52
51
  type DefaultLocale = typeof defaultConfig.i18n;
53
52
 
@@ -13,6 +13,7 @@ export interface UCheckboxOption {
13
13
  label?: string;
14
14
  icon?: string;
15
15
  description?: string;
16
+ [key: string]: string | number | boolean | UnknownObject | UnknownArray | undefined;
16
17
  }
17
18
 
18
19
  export interface Props {
@@ -12,7 +12,7 @@ import { UCheckboxMultiState } from "./constants.ts";
12
12
 
13
13
  import type { Props, Config } from "./types.ts";
14
14
  import type { UCheckboxOption, Config as UCheckboxConfig } from "../ui.form-checkbox/types.ts";
15
- import type { ComponentConfig } from "../types.ts";
15
+ import type { KeyAttrsWithConfig, UnknownObject } from "../types.ts";
16
16
 
17
17
  defineOptions({ inheritAttrs: false });
18
18
 
@@ -34,7 +34,7 @@ const index = ref(0);
34
34
  const isChecked = ref(false);
35
35
 
36
36
  const selected = computed<UCheckboxOption>(() => {
37
- return props.options[index.value] || { icon: undefined };
37
+ return props.options[index.value];
38
38
  });
39
39
 
40
40
  watchEffect(setIndex);
@@ -69,14 +69,13 @@ function onClickCheckbox() {
69
69
  const { multiStateCheckboxAttrs: checkboxAttrs } = useUI<Config>(defaultConfig);
70
70
 
71
71
  const multiStateCheckboxAttrs = computed(() => {
72
- const clonedCheckboxAttrs = cloneDeep(checkboxAttrs.value) as {
73
- config: ComponentConfig<UCheckboxConfig>;
74
- };
72
+ const clonedCheckboxAttrs = cloneDeep(checkboxAttrs.value) as KeyAttrsWithConfig<UCheckboxConfig>;
75
73
 
76
- if (selected.value.icon) {
77
- clonedCheckboxAttrs.config.defaults = clonedCheckboxAttrs.config.defaults || {};
78
-
79
- clonedCheckboxAttrs.config.defaults.checkedIcon = selected.value.icon;
74
+ if (selected.value.icon && clonedCheckboxAttrs.config) {
75
+ clonedCheckboxAttrs.config.defaults = {
76
+ ...((clonedCheckboxAttrs.config.defaults || {}) as UnknownObject),
77
+ checkedIcon: selected.value.icon,
78
+ };
80
79
  }
81
80
 
82
81
  return clonedCheckboxAttrs;
@@ -1,6 +1,7 @@
1
1
  import defaultConfig from "./config.ts";
2
2
 
3
- import type { UnknownObject, ComponentConfig } from "../types.ts";
3
+ import type { ComponentConfig } from "../types.ts";
4
+ import type { UCheckboxOption } from "../ui.form-checkbox/types.ts";
4
5
 
5
6
  export type Config = typeof defaultConfig;
6
7
 
@@ -13,7 +14,7 @@ export interface Props {
13
14
  /**
14
15
  * Checkbox state options.
15
16
  */
16
- options?: UnknownObject[];
17
+ options?: UCheckboxOption[];
17
18
 
18
19
  /**
19
20
  * Checkbox name.
@@ -24,7 +24,7 @@ import { vClickOutside } from "../directives";
24
24
 
25
25
  import type { ComputedRef } from "vue";
26
26
  import type { UDatePickerProps, Config, Locale } from "./types.ts";
27
- import type { ComponentExposed, Transition } from "../types.ts";
27
+ import type { ComponentExposed } from "../types.ts";
28
28
  import type { Config as UCalendarConfig } from "../ui.form-calendar/types.ts";
29
29
  import type { DateLocale } from "../ui.form-calendar/utilFormatting.ts";
30
30
 
@@ -255,12 +255,17 @@ const mutatedProps = computed(() => ({
255
255
  description: Boolean(props.description),
256
256
  }));
257
257
 
258
- const { config, datepickerInputAttrs, datepickerInputActiveAttrs, calendarAttrs, wrapperAttrs } =
259
- useUI<Config>(defaultConfig, mutatedProps);
258
+ const {
259
+ config,
260
+ datepickerInputAttrs,
261
+ datepickerInputActiveAttrs,
262
+ datepickerCalendarAttrs,
263
+ wrapperAttrs,
264
+ } = useUI<Config>(defaultConfig, mutatedProps);
260
265
 
261
266
  /* Merging DatePicker's i18n translations into Calendar's i18n translations. */
262
267
  watchEffect(() => {
263
- const calendarConfig = calendarAttrs.value.config as unknown as UCalendarConfig;
268
+ const calendarConfig = datepickerCalendarAttrs.value.config as unknown as UCalendarConfig;
264
269
 
265
270
  if (!calendarConfig?.i18n || props.config?.i18n) {
266
271
  calendarConfig.i18n = merge(calendarConfig.i18n, config.value.i18n);
@@ -323,7 +328,7 @@ watchEffect(() => {
323
328
  </template>
324
329
  </UInput>
325
330
 
326
- <Transition v-bind="config.calendarTransition as Transition">
331
+ <Transition v-bind="config.datepickerCalendarTransition">
327
332
  <UCalendar
328
333
  v-show="isShownCalendar"
329
334
  ref="calendar"
@@ -338,7 +343,7 @@ watchEffect(() => {
338
343
  :user-date-time-format="userDateTimeFormat"
339
344
  :max-date="maxDate"
340
345
  :min-date="minDate"
341
- v-bind="calendarAttrs"
346
+ v-bind="datepickerCalendarAttrs"
342
347
  @keydown.esc="deactivate"
343
348
  @user-date-change="onUserFormatDateChange"
344
349
  @input="onInput"
@@ -12,7 +12,7 @@ export default /*tw*/ {
12
12
  },
13
13
  },
14
14
  },
15
- calendar: {
15
+ datepickerCalendarCalendar: {
16
16
  base: "{UCalendar} absolute mb-3 z-40",
17
17
  variants: {
18
18
  openDirectionX: {
@@ -28,7 +28,7 @@ export default /*tw*/ {
28
28
  },
29
29
  compoundVariants: [{ description: false, error: false, class: "mt-2" }],
30
30
  },
31
- calendarTransition: {
31
+ datepickerCalendarTransition: {
32
32
  enterFromClass: "opacity-0 scale-95",
33
33
  enterActiveClass: "transition transform ease-out duration-100",
34
34
  enterToClass: "opacity-100 scale-100",
@@ -543,7 +543,7 @@ const mutatedProps = computed(() => ({
543
543
  const {
544
544
  config,
545
545
  wrapperAttrs,
546
- calendarAttrs,
546
+ datepickerCalendarAttrs,
547
547
  datepickerInputAttrs,
548
548
  menuAttrs,
549
549
  buttonWrapperAttrs,
@@ -570,7 +570,7 @@ const {
570
570
 
571
571
  /* Merging DatePickerRange's i18n translations into Calendar's i18n translations. */
572
572
  watchEffect(() => {
573
- const calendarConfig = calendarAttrs.value.config as unknown as UCalendarConfig;
573
+ const calendarConfig = datepickerCalendarAttrs.value.config as unknown as UCalendarConfig;
574
574
 
575
575
  if (!calendarConfig.i18n || props.config?.i18n) {
576
576
  calendarConfig.i18n = merge(calendarConfig.i18n, config.value.i18n);
@@ -722,7 +722,7 @@ watchEffect(() => {
722
722
  v-model="calendarValue"
723
723
  :min-date="minDate"
724
724
  :max-date="maxDate"
725
- v-bind="calendarAttrs"
725
+ v-bind="datepickerCalendarAttrs"
726
726
  :date-format="dateFormat"
727
727
  range
728
728
  @mouseenter="onMouseoverCalendar"
@@ -110,7 +110,7 @@ export default /*tw*/ {
110
110
  `,
111
111
  },
112
112
  rangeInputError: "text-xs font-normal leading-none mt-2 text-center text-red-500",
113
- calendar: {
113
+ datepickerCalendar: {
114
114
  base: "{UCalendar}",
115
115
  wrapper: "p-0 pt-2 w-full border-none shadow-none rounded-none",
116
116
  navigation: "pb-0 mb-0 border-none",
@@ -127,6 +127,9 @@ export default /*tw*/ {
127
127
  notCorrectDayNumber: "Wrong day in month.",
128
128
  fromDateGraterThanSecond: "The 'from' date should be less than the 'to' date.",
129
129
  toDateSmallerThanFirst: "The 'to' date should be greater than the 'from' date.",
130
+ today: "Today,",
131
+ yesterday: "Yesterday,",
132
+ tomorrow: "Tomorrow,",
130
133
  weekdays: {
131
134
  shorthand: {
132
135
  sunday: "Sun",
@@ -12,7 +12,7 @@ export function useUserFormat(
12
12
  userFormatLocale: Ref<SortedLocale>,
13
13
  dateFormat: string,
14
14
  isPeriod: Ref<IsPeriod>,
15
- locale: Ref<SortedLocale | undefined>,
15
+ locale: Ref<SortedLocale>,
16
16
  userDateFormat: string,
17
17
  ) {
18
18
  const userFormatDate = computed(() => {
@@ -17,11 +17,11 @@ withDefaults(defineProps<Props>(), {
17
17
  * Get element / nested component attributes for each config token ✨
18
18
  * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
19
19
  */
20
- const { loaderAttrs, ellipseAttrs, config } = useUI<Config>(defaultConfig);
20
+ const { config, loaderAttrs, ellipseAttrs } = useUI<Config>(defaultConfig);
21
21
  </script>
22
22
 
23
23
  <template>
24
- <Transition v-bind="config?.transition">
24
+ <Transition v-bind="config.transition">
25
25
  <div v-if="loading" v-bind="loaderAttrs" :data-test="dataTest">
26
26
  <!-- @slot Use it to add something instead of the default loader. -->
27
27
  <slot>
@@ -47,11 +47,11 @@ const showLoader = computed(() => {
47
47
  * Get element / nested component attributes for each config token ✨
48
48
  * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
49
49
  */
50
- const { overlayAttrs, nestedLoaderAttrs, config } = useUI<Config>(defaultConfig);
50
+ const { config, overlayAttrs, nestedLoaderAttrs } = useUI<Config>(defaultConfig);
51
51
  </script>
52
52
 
53
53
  <template>
54
- <Transition v-bind="config?.transition">
54
+ <Transition v-bind="config.transition">
55
55
  <div v-if="showLoader" v-bind="overlayAttrs">
56
56
  <!-- @slot Use it to add something instead of the default loader. -->
57
57
  <slot>
@@ -12,7 +12,6 @@ import { UNotify, NotificationType, NotificationPosition } from "./constants.ts"
12
12
  import UIcon from "../ui.image-icon/UIcon.vue";
13
13
 
14
14
  import type { Props, Config, NotifyEvent, Notification, NotificationsWrapperRef } from "./types.ts";
15
- import type { Transition } from "../types.ts";
16
15
 
17
16
  defineOptions({ inheritAttrs: false });
18
17
 
@@ -145,7 +144,7 @@ const {
145
144
  ref="notificationsWrapperRef"
146
145
  :style="notifyPositionStyles"
147
146
  tag="div"
148
- v-bind="{ ...(config?.transitionGroup as Transition), ...wrapperAttrs }"
147
+ v-bind="{ ...config.transitionGroup, ...wrapperAttrs }"
149
148
  :data-test="dataTest"
150
149
  >
151
150
  <div
@@ -6,6 +6,7 @@ import {
6
6
  } from "../../utils/storybook.ts";
7
7
 
8
8
  import { notify } from "../utilNotify.js";
9
+ import { NotificationType } from "../constants.ts";
9
10
 
10
11
  import UNotify from "../../ui.text-notify/UNotify.vue";
11
12
  import UButton from "../../ui.button/UButton.vue";
@@ -40,7 +41,7 @@ const DefaultTemplate: StoryFn<UNotifyArgs> = (args: UNotifyArgs) => ({
40
41
  setup() {
41
42
  function onClick() {
42
43
  notify({
43
- type: "success",
44
+ type: NotificationType.Success,
44
45
  label: "Hurray!",
45
46
  description: "The file successfully downloaded.",
46
47
  });
@@ -62,7 +63,7 @@ const TypesTemplate: StoryFn<UNotifyArgs> = (args: UNotifyArgs) => ({
62
63
  components: { UNotify, UButton, UCol },
63
64
  setup() {
64
65
  function onClick(type: string) {
65
- if (type === "success") {
66
+ if (type === NotificationType.Success) {
66
67
  notify({
67
68
  type,
68
69
  label: "Hurray!",
@@ -70,7 +71,7 @@ const TypesTemplate: StoryFn<UNotifyArgs> = (args: UNotifyArgs) => ({
70
71
  });
71
72
  }
72
73
 
73
- if (type === "warning") {
74
+ if (type === NotificationType.Warning) {
74
75
  notify({
75
76
  type,
76
77
  label: "Be aware!",
@@ -78,7 +79,7 @@ const TypesTemplate: StoryFn<UNotifyArgs> = (args: UNotifyArgs) => ({
78
79
  });
79
80
  }
80
81
 
81
- if (type === "error") {
82
+ if (type === NotificationType.Error) {
82
83
  notify({
83
84
  type,
84
85
  label: "Ooops!",
package/utils/ui.ts CHANGED
@@ -13,12 +13,12 @@ import {
13
13
  } from "../constants.js";
14
14
 
15
15
  import type {
16
- BrandColors,
17
16
  Config,
18
- ComponentNames,
19
- Component,
20
17
  Defaults,
21
18
  Strategies,
19
+ BrandColors,
20
+ UnknownObject,
21
+ ComponentNames,
22
22
  } from "../types.ts";
23
23
 
24
24
  interface MergedConfigOptions {
@@ -94,33 +94,11 @@ export const cva = ({ base = "", variants = {}, compoundVariants = [], defaultVa
94
94
  defaultVariants,
95
95
  });
96
96
 
97
- /**
98
- * @deprecated
99
- * TODO: remove if after all components migration into getDefaults()
100
- * Return default values for component props, icons, etc..
101
- */
102
- export function getDefault<T>(defaultConfig: Component, name: ComponentNames) {
103
- const componentDefaults = cloneDeep(defaultConfig.defaults) || {};
104
- const globalDefaults = cloneDeep(vuelessConfig.component?.[name]?.defaults) || {};
105
-
106
- const defaults = merge(componentDefaults, globalDefaults) as T & Defaults;
107
-
108
- if (defaults.color) {
109
- defaults.color = getColor(defaults.color as BrandColors);
110
- }
111
-
112
- return {
113
- ...defaults,
114
- dataTest: "",
115
- config: () => ({}),
116
- };
117
- }
118
-
119
97
  /**
120
98
  * Return default values for component props, icons, etc..
121
99
  */
122
100
  export function getDefaults<Props, Config>(defaultConfig: Config, name: ComponentNames) {
123
- const componentDefaults = cloneDeep((defaultConfig as Component).defaults) || {};
101
+ const componentDefaults = cloneDeep((defaultConfig as UnknownObject).defaults) || {};
124
102
  const globalDefaults = cloneDeep(vuelessConfig.component?.[name]?.defaults) || {};
125
103
 
126
104
  const defaults = merge(componentDefaults, globalDefaults) as Props & Defaults;
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.584",
4
+ "version": "0.0.586",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -2182,7 +2182,7 @@
2182
2182
  "required": false,
2183
2183
  "description": "Checkbox state options.",
2184
2184
  "enum": [
2185
- "UnknownObject"
2185
+ "UCheckboxOption"
2186
2186
  ],
2187
2187
  "value": {
2188
2188
  "kind": "expression",