@byyuurin/ui 0.2.0 → 0.4.0

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 (137) hide show
  1. package/README.md +5 -3
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +2 -2
  4. package/dist/runtime/components/Accordion.vue +2 -2
  5. package/dist/runtime/components/Accordion.vue.d.ts +11 -7
  6. package/dist/runtime/components/Alert.vue +2 -1
  7. package/dist/runtime/components/Alert.vue.d.ts +4 -4
  8. package/dist/runtime/components/App.vue +2 -1
  9. package/dist/runtime/components/App.vue.d.ts +11 -7
  10. package/dist/runtime/components/Avatar.vue +2 -1
  11. package/dist/runtime/components/Avatar.vue.d.ts +4 -3
  12. package/dist/runtime/components/AvatarGroup.vue +2 -1
  13. package/dist/runtime/components/AvatarGroup.vue.d.ts +1 -1
  14. package/dist/runtime/components/Badge.vue +4 -3
  15. package/dist/runtime/components/Badge.vue.d.ts +2 -2
  16. package/dist/runtime/components/Breadcrumb.vue +2 -2
  17. package/dist/runtime/components/Breadcrumb.vue.d.ts +10 -6
  18. package/dist/runtime/components/Button.vue +8 -8
  19. package/dist/runtime/components/Button.vue.d.ts +1 -1
  20. package/dist/runtime/components/Calendar.vue +2 -1
  21. package/dist/runtime/components/Calendar.vue.d.ts +16 -12
  22. package/dist/runtime/components/Card.vue +2 -1
  23. package/dist/runtime/components/Card.vue.d.ts +1 -1
  24. package/dist/runtime/components/Carousel.vue +2 -1
  25. package/dist/runtime/components/Carousel.vue.d.ts +14 -10
  26. package/dist/runtime/components/Checkbox.vue +4 -2
  27. package/dist/runtime/components/Checkbox.vue.d.ts +4 -3
  28. package/dist/runtime/components/CheckboxGroup.vue +4 -3
  29. package/dist/runtime/components/CheckboxGroup.vue.d.ts +11 -7
  30. package/dist/runtime/components/Chip.vue +5 -1
  31. package/dist/runtime/components/Chip.vue.d.ts +2 -2
  32. package/dist/runtime/components/Collapsible.vue +2 -1
  33. package/dist/runtime/components/Collapsible.vue.d.ts +2 -2
  34. package/dist/runtime/components/Drawer.vue +2 -1
  35. package/dist/runtime/components/Drawer.vue.d.ts +6 -6
  36. package/dist/runtime/components/DropdownMenu.vue +3 -3
  37. package/dist/runtime/components/DropdownMenu.vue.d.ts +17 -9
  38. package/dist/runtime/components/DropdownMenuContent.vue +11 -12
  39. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +11 -7
  40. package/dist/runtime/components/FieldGroup.vue +2 -1
  41. package/dist/runtime/components/FieldGroup.vue.d.ts +2 -2
  42. package/dist/runtime/components/FileUpload.vue +267 -0
  43. package/dist/runtime/components/FileUpload.vue.d.ts +178 -0
  44. package/dist/runtime/components/Form.vue +2 -1
  45. package/dist/runtime/components/Form.vue.d.ts +13 -8
  46. package/dist/runtime/components/FormField.vue +6 -4
  47. package/dist/runtime/components/FormField.vue.d.ts +7 -2
  48. package/dist/runtime/components/Icon.vue.d.ts +1 -1
  49. package/dist/runtime/components/Input.vue +4 -4
  50. package/dist/runtime/components/Input.vue.d.ts +16 -12
  51. package/dist/runtime/components/InputNumber.vue +3 -2
  52. package/dist/runtime/components/InputNumber.vue.d.ts +128 -124
  53. package/dist/runtime/components/InputTags.vue +2 -1
  54. package/dist/runtime/components/InputTags.vue.d.ts +16 -11
  55. package/dist/runtime/components/Kbd.vue +2 -1
  56. package/dist/runtime/components/Kbd.vue.d.ts +2 -2
  57. package/dist/runtime/components/Link.vue +5 -3
  58. package/dist/runtime/components/Link.vue.d.ts +16 -6
  59. package/dist/runtime/components/LinkBase.vue.d.ts +2 -2
  60. package/dist/runtime/components/Marquee.vue +2 -1
  61. package/dist/runtime/components/Marquee.vue.d.ts +3 -3
  62. package/dist/runtime/components/Modal.vue +3 -2
  63. package/dist/runtime/components/Modal.vue.d.ts +6 -6
  64. package/dist/runtime/components/NavigationMenu.vue +2 -2
  65. package/dist/runtime/components/NavigationMenu.vue.d.ts +11 -7
  66. package/dist/runtime/components/Pagination.vue +2 -1
  67. package/dist/runtime/components/Pagination.vue.d.ts +4 -4
  68. package/dist/runtime/components/PinInput.vue +4 -4
  69. package/dist/runtime/components/PinInput.vue.d.ts +14 -10
  70. package/dist/runtime/components/Popover.vue +1 -1
  71. package/dist/runtime/components/Popover.vue.d.ts +11 -7
  72. package/dist/runtime/components/Progress.vue +2 -1
  73. package/dist/runtime/components/Progress.vue.d.ts +2 -2
  74. package/dist/runtime/components/RadioGroup.vue +3 -3
  75. package/dist/runtime/components/RadioGroup.vue.d.ts +11 -7
  76. package/dist/runtime/components/ScrollArea.vue +2 -1
  77. package/dist/runtime/components/ScrollArea.vue.d.ts +2 -2
  78. package/dist/runtime/components/Select.vue +282 -131
  79. package/dist/runtime/components/Select.vue.d.ts +103 -123
  80. package/dist/runtime/components/Separator.vue +2 -1
  81. package/dist/runtime/components/Separator.vue.d.ts +2 -2
  82. package/dist/runtime/components/Skeleton.vue +2 -1
  83. package/dist/runtime/components/Skeleton.vue.d.ts +2 -2
  84. package/dist/runtime/components/Slider.vue +2 -1
  85. package/dist/runtime/components/Slider.vue.d.ts +11 -7
  86. package/dist/runtime/components/Stepper.vue +117 -0
  87. package/dist/runtime/components/Stepper.vue.d.ts +83 -0
  88. package/dist/runtime/components/Switch.vue +3 -4
  89. package/dist/runtime/components/Switch.vue.d.ts +4 -3
  90. package/dist/runtime/components/Table.vue +2 -1
  91. package/dist/runtime/components/Table.vue.d.ts +13 -8
  92. package/dist/runtime/components/Tabs.vue +2 -2
  93. package/dist/runtime/components/Tabs.vue.d.ts +12 -8
  94. package/dist/runtime/components/Textarea.vue +3 -3
  95. package/dist/runtime/components/Textarea.vue.d.ts +16 -11
  96. package/dist/runtime/components/Timeline.vue +2 -1
  97. package/dist/runtime/components/Timeline.vue.d.ts +11 -7
  98. package/dist/runtime/components/Toast.vue +2 -1
  99. package/dist/runtime/components/Toast.vue.d.ts +5 -5
  100. package/dist/runtime/components/ToastProvider.vue +2 -2
  101. package/dist/runtime/components/ToastProvider.vue.d.ts +3 -3
  102. package/dist/runtime/components/Tooltip.vue +4 -4
  103. package/dist/runtime/components/Tooltip.vue.d.ts +2 -2
  104. package/dist/runtime/components/Tree.vue +241 -0
  105. package/dist/runtime/components/Tree.vue.d.ts +121 -0
  106. package/dist/runtime/composables/defineShortcuts.d.ts +1 -0
  107. package/dist/runtime/composables/defineShortcuts.js +44 -8
  108. package/dist/runtime/composables/useFileUpload.d.ts +19 -0
  109. package/dist/runtime/composables/useFileUpload.js +79 -0
  110. package/dist/runtime/composables/useLocale.d.ts +18 -0
  111. package/dist/runtime/locale/en.d.ts +9 -0
  112. package/dist/runtime/locale/en.js +9 -0
  113. package/dist/runtime/locale/zh_tw.d.ts +9 -0
  114. package/dist/runtime/locale/zh_tw.js +9 -0
  115. package/dist/runtime/types/html.d.ts +8 -0
  116. package/dist/runtime/types/html.js +0 -0
  117. package/dist/runtime/types/index.d.ts +3 -0
  118. package/dist/runtime/types/index.js +3 -0
  119. package/dist/runtime/types/input.d.ts +5 -5
  120. package/dist/runtime/types/locale.d.ts +9 -0
  121. package/dist/runtime/types/utils.d.ts +4 -4
  122. package/dist/runtime/utils/index.d.ts +3 -3
  123. package/dist/runtime/utils/link.d.ts +2 -1
  124. package/dist/runtime/utils/link.js +40 -29
  125. package/dist/runtime/vue/components/Icon.vue.d.ts +1 -1
  126. package/dist/runtime/vue/components/Link.vue +7 -12
  127. package/dist/runtime/vue/components/Link.vue.d.ts +11 -40
  128. package/dist/setup.d.mts +1 -1
  129. package/dist/shared/{ui.DpbffTXs.d.mts → ui.CGCKYv7g.d.mts} +6 -2
  130. package/dist/shared/{ui.CzIlLITK.mjs → ui.DYMXCXO6.mjs} +9 -5
  131. package/dist/shared/{ui.DLOxhmP0.mjs → ui.DcEKQd0n.mjs} +490 -20
  132. package/dist/unocss.mjs +1 -1
  133. package/dist/unplugin.d.mts +1 -1
  134. package/dist/unplugin.mjs +2 -2
  135. package/dist/vite.d.mts +1 -1
  136. package/dist/vite.mjs +2 -2
  137. package/package.json +31 -31
@@ -18,6 +18,9 @@ export default defineLocale({
18
18
  next: "\u4E0B\u4E00\u9801",
19
19
  goto: "\u8DF3\u8F49\u5230\u7B2C {page} \u9801"
20
20
  },
21
+ fileUpload: {
22
+ removeFile: "\u79FB\u9664 {filename}"
23
+ },
21
24
  inputNumber: {
22
25
  increment: "\u589E\u52A0",
23
26
  decrement: "\u6E1B\u5C11"
@@ -25,6 +28,12 @@ export default defineLocale({
25
28
  modal: {
26
29
  close: "\u95DC\u9589"
27
30
  },
31
+ select: {
32
+ create: "\u5EFA\u7ACB\u300C{label}\u300D",
33
+ noData: "\u6C92\u6709\u8CC7\u6599",
34
+ noMatch: "\u6C92\u6709\u76F8\u7B26\u7684\u8CC7\u6599",
35
+ search: "\u641C\u5C0B\u2026"
36
+ },
28
37
  table: {
29
38
  noData: "\u6C92\u6709\u8CC7\u6599"
30
39
  },
@@ -0,0 +1,8 @@
1
+ import type { AnchorHTMLAttributes as VueAnchorHTMLAttributes, ButtonHTMLAttributes as VueButtonHTMLAttributes, FormHTMLAttributes as VueFormHTMLAttributes, ImgHTMLAttributes as VueImgHTMLAttributes, InputHTMLAttributes as VueInputHTMLAttributes, TableHTMLAttributes as VueTableHTMLAttributes, TextareaHTMLAttributes as VueTextareaHTMLAttributes } from 'vue';
2
+ export type AnchorHTMLAttributes = Pick<VueAnchorHTMLAttributes, 'download' | 'href' | 'hreflang' | 'media' | 'ping' | 'rel' | 'target' | 'type' | 'referrerpolicy'>;
3
+ export type ButtonHTMLAttributes = Pick<VueButtonHTMLAttributes, 'autofocus' | 'disabled' | 'form' | 'formaction' | 'formenctype' | 'formmethod' | 'formnovalidate' | 'formtarget' | 'name' | 'type' | 'value'>;
4
+ export type FormHTMLAttributes = Pick<VueFormHTMLAttributes, 'acceptcharset' | 'action' | 'autocomplete' | 'enctype' | 'method' | 'name' | 'novalidate' | 'target'>;
5
+ export type ImgHTMLAttributes = Pick<VueImgHTMLAttributes, 'alt' | 'crossorigin' | 'decoding' | 'height' | 'loading' | 'referrerpolicy' | 'sizes' | 'src' | 'srcset' | 'usemap' | 'width'>;
6
+ export type InputHTMLAttributes = Pick<VueInputHTMLAttributes, 'accept' | 'alt' | 'autocomplete' | 'autofocus' | 'capture' | 'checked' | 'crossorigin' | 'disabled' | 'enterKeyHint' | 'form' | 'formaction' | 'formenctype' | 'formmethod' | 'formnovalidate' | 'formtarget' | 'height' | 'indeterminate' | 'list' | 'max' | 'maxlength' | 'min' | 'minlength' | 'multiple' | 'name' | 'pattern' | 'placeholder' | 'readonly' | 'required' | 'size' | 'src' | 'step' | 'type' | 'value' | 'width'>;
7
+ export type TableHTMLAttributes = Pick<VueTableHTMLAttributes, 'cellpadding' | 'cellspacing' | 'summary' | 'width'>;
8
+ export type TextareaHTMLAttributes = Pick<VueTextareaHTMLAttributes, 'autocomplete' | 'autofocus' | 'cols' | 'dirname' | 'disabled' | 'form' | 'maxlength' | 'minlength' | 'name' | 'placeholder' | 'readonly' | 'required' | 'rows' | 'value' | 'wrap'>;
File without changes
@@ -18,6 +18,7 @@ export * from '../components/Collapsible.vue';
18
18
  export * from '../components/Drawer.vue';
19
19
  export * from '../components/DropdownMenu.vue';
20
20
  export * from '../components/FieldGroup.vue';
21
+ export * from '../components/FileUpload.vue';
21
22
  export * from '../components/Form.vue';
22
23
  export * from '../components/FormField.vue';
23
24
  export * from '../components/Icon.vue';
@@ -40,6 +41,7 @@ export * from '../components/Select.vue';
40
41
  export * from '../components/Separator.vue';
41
42
  export * from '../components/Skeleton.vue';
42
43
  export * from '../components/Slider.vue';
44
+ export * from '../components/Stepper.vue';
43
45
  export * from '../components/Switch.vue';
44
46
  export * from '../components/Table.vue';
45
47
  export * from '../components/Tabs.vue';
@@ -48,6 +50,7 @@ export * from '../components/Timeline.vue';
48
50
  export * from '../components/Toast.vue';
49
51
  export * from '../components/ToastProvider.vue';
50
52
  export * from '../components/Tooltip.vue';
53
+ export * from '../components/Tree.vue';
51
54
  export * from './form';
52
55
  export * from './locale';
53
56
  export * from './style';
@@ -16,6 +16,7 @@ export * from "../components/Collapsible.vue";
16
16
  export * from "../components/Drawer.vue";
17
17
  export * from "../components/DropdownMenu.vue";
18
18
  export * from "../components/FieldGroup.vue";
19
+ export * from "../components/FileUpload.vue";
19
20
  export * from "../components/Form.vue";
20
21
  export * from "../components/FormField.vue";
21
22
  export * from "../components/Icon.vue";
@@ -38,6 +39,7 @@ export * from "../components/Select.vue";
38
39
  export * from "../components/Separator.vue";
39
40
  export * from "../components/Skeleton.vue";
40
41
  export * from "../components/Slider.vue";
42
+ export * from "../components/Stepper.vue";
41
43
  export * from "../components/Switch.vue";
42
44
  export * from "../components/Table.vue";
43
45
  export * from "../components/Tabs.vue";
@@ -46,6 +48,7 @@ export * from "../components/Timeline.vue";
46
48
  export * from "../components/Toast.vue";
47
49
  export * from "../components/ToastProvider.vue";
48
50
  export * from "../components/Tooltip.vue";
51
+ export * from "../components/Tree.vue";
49
52
  export * from "./form.js";
50
53
  export * from "./locale.js";
51
54
  export * from "./style.js";
@@ -1,8 +1,8 @@
1
- export interface ModelModifiers {
2
- string?: boolean;
3
- number?: boolean;
4
- trim?: boolean;
1
+ export interface ModelModifiers<T = any> {
2
+ string?: string extends T ? boolean : never;
3
+ number?: number extends T ? boolean : never;
4
+ trim?: string extends T ? boolean : never;
5
5
  lazy?: boolean;
6
- nullable?: boolean;
6
+ nullable?: null extends T ? boolean : never;
7
7
  optional?: boolean;
8
8
  }
@@ -18,6 +18,9 @@ export interface Messages {
18
18
  next: string;
19
19
  goto: string;
20
20
  };
21
+ fileUpload: {
22
+ removeFile: string;
23
+ };
21
24
  inputNumber: {
22
25
  increment: string;
23
26
  decrement: string;
@@ -25,6 +28,12 @@ export interface Messages {
25
28
  modal: {
26
29
  close: string;
27
30
  };
31
+ select: {
32
+ create: string;
33
+ noData: string;
34
+ noMatch: string;
35
+ search: string;
36
+ };
28
37
  table: {
29
38
  noData: string;
30
39
  };
@@ -8,7 +8,7 @@ export type DeepPartial<T> = {
8
8
  [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P] | undefined;
9
9
  };
10
10
  type SlotProps<T> = T extends Record<string, any> ? {
11
- [P in keyof T & string]: T[P] extends undefined ? T[P] | undefined : T[P];
11
+ [P in keyof T]: T[P];
12
12
  } : Record<string, never>;
13
13
  export type StaticSlot<P extends Record<string, any> | undefined = undefined> = P extends Record<string, any> ? (props: SlotProps<P>) => any : (props?: SlotProps<undefined>) => any;
14
14
  export type DynamicSlotsKeys<Name extends string | undefined, Suffix extends string | undefined = undefined, Base extends boolean = true> = (Name extends string ? Suffix extends string ? Base extends true ? Name | `${Name}-${Suffix}` : `${Name}-${Suffix}` : Name : never);
@@ -43,9 +43,9 @@ export type ExtractItem<I, S extends string = 'slot'> = Extract<NestedItem<I>, {
43
43
  [Slot in S]: string;
44
44
  }>;
45
45
  export type GetItemKeys<I> = keyof Extract<NestedItem<I>, object> | DotPathKeys<Extract<NestedItem<I>, object>>;
46
- export type GetItemValue<I, VK extends GetItemKeys<I> | undefined, T extends NestedItem<I> = NestedItem<I>> = T extends object ? VK extends undefined ? T : VK extends DotPathKeys<T> ? DotPathValue<T, VK> : never : T;
47
- export type GetModelValue<T, VK extends GetItemKeys<T> | undefined, M extends boolean> = M extends true ? GetItemValue<T, VK>[] : GetItemValue<T, VK>;
48
- export interface GetModelValueEmits<T, VK extends GetItemKeys<T> | undefined, M extends boolean> {
46
+ export type GetItemValue<I, VK extends Nullable<GetItemKeys<I>>, T extends NestedItem<I> = NestedItem<I>> = T extends object ? VK extends undefined | null ? T : VK extends DotPathKeys<T> ? DotPathValue<T, VK> : never : T;
47
+ export type GetModelValue<T, VK extends Nullable<GetItemKeys<T>>, M extends boolean> = M extends true ? GetItemValue<T, VK>[] : GetItemValue<T, VK>;
48
+ export interface GetModelValueEmits<T, VK extends Nullable<GetItemKeys<T>>, M extends boolean> {
49
49
  /** Event handler called when the value changes. */
50
50
  'update:modelValue': [value: GetModelValue<T, VK, M>];
51
51
  }
@@ -1,4 +1,4 @@
1
- import type { GetItemKeys, Nullable } from '../types/utils';
1
+ import type { GetItemKeys, MaybeNull, Nullable } from '../types/utils';
2
2
  export * from './form';
3
3
  export * from './link';
4
4
  export * from './vue';
@@ -7,7 +7,7 @@ export { looseToNumber } from '@vue/shared';
7
7
  export declare function compare<T>(value?: T, currentValue?: T, comparator?: string | ((a: T, b: T) => boolean)): boolean;
8
8
  export declare function isEmpty(value: unknown): boolean;
9
9
  export declare function getDisplayValue<T extends Array<any>, V>(items: T, value: Nullable<V>, options?: {
10
- valueKey?: GetItemKeys<T>;
11
- labelKey?: GetItemKeys<T>;
10
+ valueKey?: MaybeNull<GetItemKeys<T>>;
11
+ labelKey?: MaybeNull<GetItemKeys<T>>;
12
12
  }): string | undefined;
13
13
  export declare function isArrayOfArray<T>(item: T[] | T[][]): item is T[][];
@@ -1,7 +1,8 @@
1
1
  import type { LinkProps } from '../types';
2
+ export declare const linkKeys: readonly ["active", "activeClass", "ariaCurrentValue", "as", "disabled", "download", "exact", "exactActiveClass", "exactHash", "exactQuery", "external", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "href", "hreflang", "inactiveClass", "media", "noPrefetch", "noRel", "onClick", "ping", "prefetch", "prefetchOn", "prefetchedClass", "referrerpolicy", "rel", "replace", "target", "title", "to", "trailingSlash", "type", "viewTransition"];
2
3
  export declare function pickLinkProps(link: LinkProps & {
3
4
  [key: string]: any;
4
5
  }): import("@vueuse/core").ReactivePickReturn<LinkProps & {
5
6
  [key: string]: any;
6
- }, "label" | "raw" | "replace" | "disabled" | "title" | "class" | "active" | "to" | "type" | "custom" | "activeClass" | "exactActiveClass" | "ariaCurrentValue" | "viewTransition" | `aria-${string}` | `data-${string}` | "as" | "exact" | "exactQuery" | "exactHash" | "inactiveClass" | "href" | "external" | "target" | "rel" | "noRel" | "prefetchedClass" | "prefetch" | "prefetchOn" | "noPrefetch" | "download" | "onClick">;
7
+ }, "replace" | "disabled" | "title" | "active" | "to" | "type" | "activeClass" | "ariaCurrentValue" | "as" | "download" | "exact" | "exactActiveClass" | "exactHash" | "exactQuery" | "external" | "form" | "formaction" | "formenctype" | "formmethod" | "formnovalidate" | "formtarget" | "href" | "hreflang" | "inactiveClass" | "media" | "noPrefetch" | "noRel" | "onClick" | "ping" | "prefetch" | "prefetchOn" | "prefetchedClass" | "referrerpolicy" | "rel" | "target" | "trailingSlash" | "viewTransition" | `aria-${string}` | `data-${string}`>;
7
8
  export declare function isPartiallyEqual(item1: any, item2: any): boolean;
@@ -1,40 +1,51 @@
1
1
  import { reactivePick } from "@vueuse/core";
2
2
  import { diff, isEqual } from "ohash/utils";
3
+ export const linkKeys = [
4
+ "active",
5
+ "activeClass",
6
+ "ariaCurrentValue",
7
+ "as",
8
+ "disabled",
9
+ "download",
10
+ "exact",
11
+ "exactActiveClass",
12
+ "exactHash",
13
+ "exactQuery",
14
+ "external",
15
+ "form",
16
+ "formaction",
17
+ "formenctype",
18
+ "formmethod",
19
+ "formnovalidate",
20
+ "formtarget",
21
+ "href",
22
+ "hreflang",
23
+ "inactiveClass",
24
+ "media",
25
+ "noPrefetch",
26
+ "noRel",
27
+ "onClick",
28
+ "ping",
29
+ "prefetch",
30
+ "prefetchOn",
31
+ "prefetchedClass",
32
+ "referrerpolicy",
33
+ "rel",
34
+ "replace",
35
+ "target",
36
+ "title",
37
+ "to",
38
+ "trailingSlash",
39
+ "type",
40
+ "viewTransition"
41
+ ];
3
42
  export function pickLinkProps(link) {
4
43
  const keys = Object.keys(link);
5
44
  const ariaKeys = keys.filter((key) => key.startsWith("aria-"));
6
45
  const dataKeys = keys.filter((key) => key.startsWith("data-"));
7
- const pickProps = [
8
- "active",
9
- "activeClass",
10
- "ariaCurrentValue",
11
- "as",
12
- "disabled",
13
- "exact",
14
- "exactActiveClass",
15
- "exactHash",
16
- "exactQuery",
17
- "external",
18
- "href",
19
- "download",
20
- "inactiveClass",
21
- "noPrefetch",
22
- "noRel",
23
- "prefetch",
24
- "prefetchedClass",
25
- "rel",
26
- "replace",
27
- "target",
28
- "to",
29
- "type",
30
- "title",
31
- "onClick",
32
- "title",
33
- "onClick"
34
- ];
35
46
  return reactivePick(
36
47
  link,
37
- ...pickProps,
48
+ ...linkKeys,
38
49
  ...ariaKeys,
39
50
  ...dataKeys
40
51
  );
@@ -2,6 +2,6 @@ import type { IconProps as NuxtIconProps } from '../../types';
2
2
  export interface IconProps {
3
3
  name: NuxtIconProps['name'];
4
4
  }
5
- declare const __VLS_export: import("vue").DefineComponent<IconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
5
  declare const _default: typeof __VLS_export;
7
6
  export default _default;
7
+ declare const __VLS_export: import("vue").DefineComponent<IconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -16,6 +16,10 @@ import { cv, merge } from "../../utils/style";
16
16
  defineOptions({ inheritAttrs: false });
17
17
  const props = defineProps({
18
18
  as: { type: null, required: false, default: "button" },
19
+ href: { type: null, required: false },
20
+ external: { type: Boolean, required: false },
21
+ target: { type: [String, Object, null], required: false },
22
+ rel: { type: [String, Object, null], required: false },
19
23
  type: { type: null, required: false, default: "button" },
20
24
  label: { type: String, required: false },
21
25
  disabled: { type: Boolean, required: false },
@@ -27,20 +31,11 @@ const props = defineProps({
27
31
  custom: { type: Boolean, required: false },
28
32
  raw: { type: Boolean, required: false },
29
33
  class: { type: [Object, String, Number, Boolean, null, Array], required: false, skipCheck: true },
30
- to: { type: null, required: false },
31
- href: { type: null, required: false },
32
- external: { type: Boolean, required: false },
33
- target: { type: [String, Object], required: false },
34
- rel: { type: [String, Object], required: false },
35
- noRel: { type: Boolean, required: false },
36
- prefetchedClass: { type: String, required: false },
37
- prefetch: { type: Boolean, required: false },
38
- prefetchOn: { type: [String, Object], required: false },
39
- noPrefetch: { type: Boolean, required: false },
40
34
  activeClass: { type: String, required: false },
41
35
  exactActiveClass: { type: String, required: false },
42
36
  ariaCurrentValue: { type: String, required: false, default: "page" },
43
37
  viewTransition: { type: Boolean, required: false },
38
+ to: { type: null, required: true },
44
39
  replace: { type: Boolean, required: false }
45
40
  });
46
41
  defineSlots();
@@ -137,7 +132,7 @@ function resolveLinkClass({ route: route2, isActive, isExactActive } = {}) {
137
132
  ...inheritProps,
138
133
  href: to,
139
134
  target: isExternal ? '_blank' : void 0,
140
- active,
135
+ active: active ?? false,
141
136
  isExternal
142
137
  }"
143
138
  >
@@ -155,7 +150,7 @@ function resolveLinkClass({ route: route2, isActive, isExactActive } = {}) {
155
150
  }"
156
151
  :class="resolveLinkClass()"
157
152
  >
158
- <slot :active="active">
153
+ <slot :active="active ?? false">
159
154
  {{ props.label }}
160
155
  </slot>
161
156
  </LinkBase>
@@ -1,22 +1,23 @@
1
1
  import type { PrimitiveProps } from 'reka-ui';
2
- import type { ButtonHTMLAttributes } from 'vue';
3
- import type { RouteLocationRaw, RouterLinkProps } from 'vue-router';
2
+ import type { RouterLinkProps } from 'vue-router';
4
3
  import type { ComponentBaseProps } from '../../types';
4
+ import type { AnchorHTMLAttributes, ButtonHTMLAttributes } from '../../types/html';
5
5
  import type { StaticSlot } from '../../types/utils';
6
6
  export interface LinkSlots {
7
7
  default: StaticSlot<{
8
8
  active: boolean;
9
9
  }>;
10
10
  }
11
- interface NuxtLinkProps extends Omit<RouterLinkProps, 'to'> {
11
+ export interface LinkProps extends ComponentBaseProps, Omit<RouterLinkProps, 'custom'>, /** @vue-ignore */ Omit<ButtonHTMLAttributes, 'type' | 'disabled'>, /** @vue-ignore */ Omit<AnchorHTMLAttributes, 'href' | 'target' | 'rel' | 'type'> {
12
12
  /**
13
- * Route Location the link should navigate to when clicked on.
13
+ * The element or component this component should render as when not a link.
14
+ * @default "button"
14
15
  */
15
- to?: RouteLocationRaw;
16
+ as?: PrimitiveProps['as'];
16
17
  /**
17
18
  * An alias for `to`. If used with `to`, `href` will be ignored
18
19
  */
19
- href?: NuxtLinkProps['to'];
20
+ href?: LinkProps['to'];
20
21
  /**
21
22
  * Forces the link to be considered as external (true) or internal (false). This is helpful to handle edge-cases
22
23
  */
@@ -24,41 +25,11 @@ interface NuxtLinkProps extends Omit<RouterLinkProps, 'to'> {
24
25
  /**
25
26
  * Where to display the linked URL, as the name for a browsing context.
26
27
  */
27
- target?: '_blank' | '_parent' | '_self' | '_top' | (string & {});
28
+ target?: '_blank' | '_parent' | '_self' | '_top' | (string & {}) | null;
28
29
  /**
29
30
  * A rel attribute value to apply on the link. Defaults to "noopener noreferrer" for external links.
30
31
  */
31
- rel?: 'noopener' | 'noreferrer' | 'nofollow' | 'sponsored' | 'ugc' | (string & {});
32
- /**
33
- * If set to true, no rel attribute will be added to the link
34
- */
35
- noRel?: boolean;
36
- /**
37
- * A class to apply to links that have been prefetched.
38
- */
39
- prefetchedClass?: string;
40
- /**
41
- * When enabled will prefetch middleware, layouts and payloads of links in the viewport.
42
- */
43
- prefetch?: boolean;
44
- /**
45
- * Allows controlling when to prefetch links. By default, prefetch is triggered only on visibility.
46
- */
47
- prefetchOn?: 'visibility' | 'interaction' | Partial<{
48
- visibility: boolean;
49
- interaction: boolean;
50
- }>;
51
- /**
52
- * Escape hatch to disable `prefetch` attribute.
53
- */
54
- noPrefetch?: boolean;
55
- }
56
- export interface LinkProps extends ComponentBaseProps, NuxtLinkProps {
57
- /**
58
- * The element or component this component should render as when not a link.
59
- * @default "button"
60
- */
61
- as?: PrimitiveProps['as'];
32
+ rel?: 'noopener' | 'noreferrer' | 'nofollow' | 'sponsored' | 'ugc' | (string & {}) | null;
62
33
  /**
63
34
  * The type of the button when not a link.
64
35
  * @default "button"
@@ -80,14 +51,14 @@ export interface LinkProps extends ComponentBaseProps, NuxtLinkProps {
80
51
  /** When `true`, only styles from `class`, `activeClass`, and `inactiveClass` will be applied. */
81
52
  raw?: boolean;
82
53
  }
54
+ declare const _default: typeof __VLS_export;
55
+ export default _default;
83
56
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LinkProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkProps> & Readonly<{}>, {
84
57
  active: boolean;
85
58
  type: "reset" | "submit" | "button";
86
59
  ariaCurrentValue: "page" | "step" | "location" | "date" | "time" | "true" | "false";
87
60
  as: import("reka-ui").AsTag | import("vue").Component;
88
61
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, LinkSlots>;
89
- declare const _default: typeof __VLS_export;
90
- export default _default;
91
62
  type __VLS_WithSlots<T, S> = T & {
92
63
  new (): {
93
64
  $slots: S;
package/dist/setup.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import '#build/ui';
2
2
  import './shared/ui.IulR-OYx.mjs';
3
3
  import '../dist/runtime/types/style.js';
4
- export { A as AppConfigIcons, a as AppConfigUI, s as setup } from './shared/ui.DpbffTXs.mjs';
4
+ export { A as AppConfigIcons, a as AppConfigUI, s as setup } from './shared/ui.CGCKYv7g.mjs';
5
5
  import './unocss.mjs';
6
6
  import '@nuxt/schema';
7
7
  import '@unocss/preset-wind4/colors';
@@ -17,9 +17,13 @@ declare const icons: {
17
17
  chevronDoubleLeft: string;
18
18
  chevronDoubleRight: string;
19
19
  ellipsis: string;
20
- plus: string;
21
- minus: string;
22
20
  external: string;
21
+ file: string;
22
+ folder: string;
23
+ folderOpen: string;
24
+ minus: string;
25
+ plus: string;
26
+ upload: string;
23
27
  };
24
28
 
25
29
  type AppConfigIcons = Record<keyof typeof icons | (string & {}), string>;
@@ -11,21 +11,25 @@ const icons = {
11
11
  chevronDoubleLeft: "i-lucide-chevrons-left",
12
12
  chevronDoubleRight: "i-lucide-chevrons-right",
13
13
  ellipsis: "i-lucide-ellipsis",
14
- plus: "i-lucide-plus",
14
+ external: "i-lucide-arrow-up-right",
15
+ file: "i-lucide-file",
16
+ folder: "i-lucide-folder",
17
+ folderOpen: "i-lucide-folder-open",
15
18
  minus: "i-lucide-minus",
16
- external: "i-lucide-arrow-up-right"
19
+ plus: "i-lucide-plus",
20
+ upload: "i-lucide-upload"
17
21
  };
18
22
 
19
23
  function getDefaultUIConfig(colors) {
20
24
  return {
21
25
  colors: pick({
22
- primary: "green",
23
- secondary: "blue",
26
+ primary: "orange",
27
+ secondary: "teal",
24
28
  success: "green",
25
29
  info: "blue",
26
30
  warning: "yellow",
27
31
  error: "red",
28
- neutral: "slate"
32
+ neutral: "stone"
29
33
  }, [...colors || [], "neutral"]),
30
34
  icons
31
35
  };