@byyuurin/ui 0.2.0 → 0.3.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 (140) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +5 -3
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +2 -2
  5. package/dist/runtime/components/Accordion.vue +41 -41
  6. package/dist/runtime/components/Accordion.vue.d.ts +11 -7
  7. package/dist/runtime/components/Alert.vue +63 -63
  8. package/dist/runtime/components/Alert.vue.d.ts +4 -4
  9. package/dist/runtime/components/App.vue +11 -10
  10. package/dist/runtime/components/App.vue.d.ts +11 -7
  11. package/dist/runtime/components/Avatar.vue +29 -29
  12. package/dist/runtime/components/Avatar.vue.d.ts +4 -3
  13. package/dist/runtime/components/AvatarGroup.vue +4 -4
  14. package/dist/runtime/components/AvatarGroup.vue.d.ts +1 -1
  15. package/dist/runtime/components/Badge.vue +32 -32
  16. package/dist/runtime/components/Badge.vue.d.ts +2 -2
  17. package/dist/runtime/components/Breadcrumb.vue +49 -49
  18. package/dist/runtime/components/Breadcrumb.vue.d.ts +10 -6
  19. package/dist/runtime/components/Button.vue +52 -51
  20. package/dist/runtime/components/Button.vue.d.ts +1 -1
  21. package/dist/runtime/components/Calendar.vue +74 -74
  22. package/dist/runtime/components/Calendar.vue.d.ts +16 -12
  23. package/dist/runtime/components/Card.vue +41 -41
  24. package/dist/runtime/components/Card.vue.d.ts +1 -1
  25. package/dist/runtime/components/Carousel.vue +66 -66
  26. package/dist/runtime/components/Carousel.vue.d.ts +14 -10
  27. package/dist/runtime/components/Checkbox.vue +46 -46
  28. package/dist/runtime/components/Checkbox.vue.d.ts +4 -3
  29. package/dist/runtime/components/CheckboxGroup.vue +29 -29
  30. package/dist/runtime/components/CheckboxGroup.vue.d.ts +11 -7
  31. package/dist/runtime/components/Chip.vue +15 -15
  32. package/dist/runtime/components/Chip.vue.d.ts +2 -2
  33. package/dist/runtime/components/Collapsible.vue +14 -14
  34. package/dist/runtime/components/Collapsible.vue.d.ts +2 -2
  35. package/dist/runtime/components/Drawer.vue +76 -76
  36. package/dist/runtime/components/Drawer.vue.d.ts +6 -6
  37. package/dist/runtime/components/DropdownMenu.vue +28 -28
  38. package/dist/runtime/components/DropdownMenu.vue.d.ts +17 -9
  39. package/dist/runtime/components/DropdownMenuContent.vue +152 -153
  40. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +11 -7
  41. package/dist/runtime/components/FieldGroup.vue +3 -3
  42. package/dist/runtime/components/FieldGroup.vue.d.ts +2 -2
  43. package/dist/runtime/components/Form.vue +9 -9
  44. package/dist/runtime/components/Form.vue.d.ts +13 -8
  45. package/dist/runtime/components/FormField.vue +39 -38
  46. package/dist/runtime/components/FormField.vue.d.ts +7 -2
  47. package/dist/runtime/components/Icon.vue +2 -2
  48. package/dist/runtime/components/Icon.vue.d.ts +1 -1
  49. package/dist/runtime/components/Input.vue +48 -48
  50. package/dist/runtime/components/Input.vue.d.ts +16 -12
  51. package/dist/runtime/components/InputNumber.vue +47 -47
  52. package/dist/runtime/components/InputNumber.vue.d.ts +128 -124
  53. package/dist/runtime/components/InputTags.vue +54 -53
  54. package/dist/runtime/components/InputTags.vue.d.ts +16 -11
  55. package/dist/runtime/components/Kbd.vue +3 -3
  56. package/dist/runtime/components/Kbd.vue.d.ts +2 -2
  57. package/dist/runtime/components/Link.vue +26 -25
  58. package/dist/runtime/components/Link.vue.d.ts +16 -6
  59. package/dist/runtime/components/LinkBase.vue +3 -3
  60. package/dist/runtime/components/LinkBase.vue.d.ts +2 -2
  61. package/dist/runtime/components/Marquee.vue +5 -5
  62. package/dist/runtime/components/Marquee.vue.d.ts +3 -3
  63. package/dist/runtime/components/Modal.vue +74 -74
  64. package/dist/runtime/components/Modal.vue.d.ts +6 -6
  65. package/dist/runtime/components/NavigationMenu.vue +228 -228
  66. package/dist/runtime/components/NavigationMenu.vue.d.ts +11 -7
  67. package/dist/runtime/components/OverlayProvider.vue +9 -9
  68. package/dist/runtime/components/Pagination.vue +47 -47
  69. package/dist/runtime/components/Pagination.vue.d.ts +4 -4
  70. package/dist/runtime/components/PinInput.vue +23 -23
  71. package/dist/runtime/components/PinInput.vue.d.ts +14 -10
  72. package/dist/runtime/components/Popover.vue +22 -22
  73. package/dist/runtime/components/Popover.vue.d.ts +11 -7
  74. package/dist/runtime/components/Progress.vue +25 -25
  75. package/dist/runtime/components/Progress.vue.d.ts +2 -2
  76. package/dist/runtime/components/RadioGroup.vue +50 -50
  77. package/dist/runtime/components/RadioGroup.vue.d.ts +11 -7
  78. package/dist/runtime/components/ScrollArea.vue +32 -32
  79. package/dist/runtime/components/ScrollArea.vue.d.ts +2 -2
  80. package/dist/runtime/components/Select.vue +299 -148
  81. package/dist/runtime/components/Select.vue.d.ts +103 -123
  82. package/dist/runtime/components/Separator.vue +30 -30
  83. package/dist/runtime/components/Separator.vue.d.ts +2 -2
  84. package/dist/runtime/components/Skeleton.vue +11 -11
  85. package/dist/runtime/components/Skeleton.vue.d.ts +2 -2
  86. package/dist/runtime/components/Slider.vue +25 -25
  87. package/dist/runtime/components/Slider.vue.d.ts +11 -7
  88. package/dist/runtime/components/Stepper.vue +116 -0
  89. package/dist/runtime/components/Stepper.vue.d.ts +83 -0
  90. package/dist/runtime/components/Switch.vue +30 -30
  91. package/dist/runtime/components/Switch.vue.d.ts +4 -3
  92. package/dist/runtime/components/Table.vue +137 -137
  93. package/dist/runtime/components/Table.vue.d.ts +13 -8
  94. package/dist/runtime/components/Tabs.vue +74 -74
  95. package/dist/runtime/components/Tabs.vue.d.ts +12 -8
  96. package/dist/runtime/components/Textarea.vue +47 -47
  97. package/dist/runtime/components/Textarea.vue.d.ts +16 -11
  98. package/dist/runtime/components/Timeline.vue +47 -47
  99. package/dist/runtime/components/Timeline.vue.d.ts +11 -7
  100. package/dist/runtime/components/Toast.vue +93 -93
  101. package/dist/runtime/components/Toast.vue.d.ts +5 -5
  102. package/dist/runtime/components/ToastProvider.vue +29 -29
  103. package/dist/runtime/components/ToastProvider.vue.d.ts +3 -3
  104. package/dist/runtime/components/Tooltip.vue +24 -25
  105. package/dist/runtime/components/Tooltip.vue.d.ts +2 -2
  106. package/dist/runtime/components/Tree.vue +241 -0
  107. package/dist/runtime/components/Tree.vue.d.ts +121 -0
  108. package/dist/runtime/composables/defineShortcuts.d.ts +1 -0
  109. package/dist/runtime/composables/defineShortcuts.js +44 -8
  110. package/dist/runtime/composables/useLocale.d.ts +12 -0
  111. package/dist/runtime/locale/en.d.ts +6 -0
  112. package/dist/runtime/locale/en.js +6 -0
  113. package/dist/runtime/locale/zh_tw.d.ts +6 -0
  114. package/dist/runtime/locale/zh_tw.js +6 -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 +2 -0
  118. package/dist/runtime/types/index.js +2 -0
  119. package/dist/runtime/types/input.d.ts +5 -5
  120. package/dist/runtime/types/locale.d.ts +6 -0
  121. package/dist/runtime/types/unocss.d.ts +4 -4
  122. package/dist/runtime/types/utils.d.ts +3 -3
  123. package/dist/runtime/utils/index.d.ts +3 -3
  124. package/dist/runtime/utils/link.d.ts +2 -1
  125. package/dist/runtime/utils/link.js +40 -29
  126. package/dist/runtime/vue/components/Icon.vue +2 -2
  127. package/dist/runtime/vue/components/Icon.vue.d.ts +1 -1
  128. package/dist/runtime/vue/components/Link.vue +7 -12
  129. package/dist/runtime/vue/components/Link.vue.d.ts +11 -40
  130. package/dist/setup.d.mts +1 -1
  131. package/dist/shared/{ui.CzIlLITK.mjs → ui.9kQouwss.mjs} +5 -3
  132. package/dist/shared/{ui.DpbffTXs.d.mts → ui.D8Bg1HWt.d.mts} +2 -0
  133. package/dist/shared/{ui.DLOxhmP0.mjs → ui.DpkP12cX.mjs} +262 -17
  134. package/dist/unocss.mjs +1 -1
  135. package/dist/unplugin.d.mts +1 -1
  136. package/dist/unplugin.mjs +2 -2
  137. package/dist/vite.d.mts +1 -1
  138. package/dist/vite.mjs +2 -2
  139. package/package.json +29 -29
  140. package/vue-plugin.d.ts +5 -5
@@ -43,36 +43,36 @@ const ui = computed(() => {
43
43
  </script>
44
44
 
45
45
  <template>
46
- <Primitive :as="props.as" :class="ui.base({ class: [props.ui?.base, props.class] })" data-part="base">
47
- <slot name="leading" :ui="ui">
48
- <Icon
49
- v-if="isLeading && leadingIconName"
50
- :name="leadingIconName"
51
- :class="ui.leadingIcon({ class: props.ui?.leadingIcon })"
52
- data-part="leadingIcon"
53
- />
54
- <Avatar
55
- v-else-if="props.avatar"
56
- :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()"
57
- v-bind="props.avatar"
58
- :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })"
59
- data-part="leadingAvatar"
60
- />
61
- </slot>
62
-
63
- <slot :ui="ui">
64
- <span v-if="props.label" :class="ui.label({ class: props.ui?.label })" data-part="label">
65
- {{ props.label }}
66
- </span>
67
- </slot>
68
-
69
- <slot name="trailing" :ui="ui">
70
- <Icon
71
- v-if="isTrailing && trailingIconName"
72
- :name="trailingIconName"
73
- :class="ui.trailingIcon({ class: props.ui?.trailingIcon })"
74
- data-part="trailingIcon"
75
- />
76
- </slot>
77
- </Primitive>
46
+ <Primitive :as="props.as" :class="ui.base({ class: [props.ui?.base, props.class] })" data-part="base">
47
+ <slot name="leading" :ui="ui">
48
+ <Icon
49
+ v-if="isLeading && leadingIconName"
50
+ :name="leadingIconName"
51
+ :class="ui.leadingIcon({ class: props.ui?.leadingIcon })"
52
+ data-part="leadingIcon"
53
+ />
54
+ <Avatar
55
+ v-else-if="props.avatar"
56
+ :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()"
57
+ v-bind="props.avatar"
58
+ :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })"
59
+ data-part="leadingAvatar"
60
+ />
61
+ </slot>
62
+
63
+ <slot :ui="ui">
64
+ <span v-if="props.label" :class="ui.label({ class: props.ui?.label })" data-part="label">
65
+ {{ props.label }}
66
+ </span>
67
+ </slot>
68
+
69
+ <slot name="trailing" :ui="ui">
70
+ <Icon
71
+ v-if="isTrailing && trailingIconName"
72
+ :name="trailingIconName"
73
+ :class="ui.trailingIcon({ class: props.ui?.trailingIcon })"
74
+ data-part="trailingIcon"
75
+ />
76
+ </slot>
77
+ </Primitive>
78
78
  </template>
@@ -33,11 +33,11 @@ export interface BadgeSlots {
33
33
  ui: ComponentStyler<typeof theme>;
34
34
  }>;
35
35
  }
36
+ declare const _default: typeof __VLS_export;
37
+ export default _default;
36
38
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<BadgeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BadgeProps> & Readonly<{}>, {
37
39
  as: import("reka-ui").AsTag | import("vue").Component;
38
40
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, BadgeSlots>;
39
- declare const _default: typeof __VLS_export;
40
- export default _default;
41
41
  type __VLS_WithSlots<T, S> = T & {
42
42
  new (): {
43
43
  $slots: S;
@@ -32,53 +32,53 @@ const ui = computed(() => {
32
32
  </script>
33
33
 
34
34
  <template>
35
- <Primitive :as="props.as" aria-label="breadcrumb" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
36
- <ol :class="ui.list({ class: props.ui?.list })" data-part="list">
37
- <template v-for="(item, index) in props.items" :key="index">
38
- <li :class="ui.item({ class: [props.ui?.item, item.ui?.item] })" data-part="item">
39
- <Link v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
40
- <LinkBase
41
- v-bind="slotProps"
42
- as="span"
43
- :aria-current="(item.active ?? active) && index === items.length - 1 ? 'page' : void 0"
44
- :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], active: item.active ?? index === items.length - 1, disabled: item.disabled, to: !!item.to })"
45
- data-part="link"
46
- >
47
- <slot :name="item.slot || 'item'" :item="item" :index="index" :active="item.active ?? index === items.length - 1" :ui="ui">
48
- <slot :name="`${item.slot || 'item'}-leading`" :item="item" :active="item.active ?? index === items.length - 1" :index="index" :ui="ui">
49
- <Icon
50
- v-if="item.icon"
51
- :name="item.icon"
52
- :class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon], active: item.active ?? index === items.length - 1 })"
53
- data-part="linkLeadingIcon"
54
- />
55
- <Avatar
56
- v-else-if="item.avatar"
57
- :size="props.ui?.linkLeadingAvatarSize || ui.linkLeadingAvatarSize()"
58
- v-bind="item.avatar"
59
- :class="ui.linkLeadingAvatar({ class: [props.ui?.linkLeadingAvatar, item.ui?.linkLeadingAvatar], active: item.active ?? index === items.length - 1 })"
60
- data-part="linkLeadingAvatar"
61
- />
62
- </slot>
63
-
64
- <span v-if="get(item, props.labelKey) || slots[`${item.slot || 'item'}-label`]" :class="ui.linkLabel({ class: [props.ui?.linkLabel, item.ui?.linkLabel] })" data-part="linkLabel">
65
- <slot :name="`${item.slot || 'item'}-label`" :item="item" :active="item.active ?? index === items.length - 1" :index="index">
66
- {{ get(item, props.labelKey) }}
67
- </slot>
68
- </span>
69
-
70
- <slot :name="`${item.slot || 'item'}-trailing`" :item="item" :active="item.active ?? index === items.length - 1" :index="index"></slot>
71
- </slot>
72
- </LinkBase>
73
- </Link>
74
- </li>
75
-
76
- <li v-if="index < items.length - 1" role="presentation" aria-hidden="true" :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator] })" data-part="separator">
77
- <slot name="separator" :ui="ui">
78
- <Icon :name="separatorIcon" :class="ui.separatorIcon({ class: [props.ui?.separatorIcon, item.ui?.separatorIcon] })" data-part="separatorIcon" />
79
- </slot>
80
- </li>
81
- </template>
82
- </ol>
83
- </Primitive>
35
+ <Primitive :as="props.as" aria-label="breadcrumb" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
36
+ <ol :class="ui.list({ class: props.ui?.list })" data-part="list">
37
+ <template v-for="(item, index) in props.items" :key="index">
38
+ <li :class="ui.item({ class: [props.ui?.item, item.ui?.item] })" data-part="item">
39
+ <Link v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
40
+ <LinkBase
41
+ v-bind="slotProps"
42
+ as="span"
43
+ :aria-current="(item.active ?? active) && index === items.length - 1 ? 'page' : void 0"
44
+ :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], active: item.active ?? index === items.length - 1, disabled: item.disabled, to: !!item.to })"
45
+ data-part="link"
46
+ >
47
+ <slot :name="item.slot || 'item'" :item="item" :index="index" :active="item.active ?? index === items.length - 1" :ui="ui">
48
+ <slot :name="`${item.slot || 'item'}-leading`" :item="item" :active="item.active ?? index === items.length - 1" :index="index" :ui="ui">
49
+ <Icon
50
+ v-if="item.icon"
51
+ :name="item.icon"
52
+ :class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon], active: item.active ?? index === items.length - 1 })"
53
+ data-part="linkLeadingIcon"
54
+ />
55
+ <Avatar
56
+ v-else-if="item.avatar"
57
+ :size="props.ui?.linkLeadingAvatarSize || ui.linkLeadingAvatarSize()"
58
+ v-bind="item.avatar"
59
+ :class="ui.linkLeadingAvatar({ class: [props.ui?.linkLeadingAvatar, item.ui?.linkLeadingAvatar], active: item.active ?? index === items.length - 1 })"
60
+ data-part="linkLeadingAvatar"
61
+ />
62
+ </slot>
63
+
64
+ <span v-if="get(item, props.labelKey) || slots[`${item.slot || 'item'}-label`]" :class="ui.linkLabel({ class: [props.ui?.linkLabel, item.ui?.linkLabel] })" data-part="linkLabel">
65
+ <slot :name="`${item.slot || 'item'}-label`" :item="item" :active="item.active ?? index === items.length - 1" :index="index">
66
+ {{ get(item, props.labelKey) }}
67
+ </slot>
68
+ </span>
69
+
70
+ <slot :name="`${item.slot || 'item'}-trailing`" :item="item" :active="item.active ?? index === items.length - 1" :index="index"></slot>
71
+ </slot>
72
+ </LinkBase>
73
+ </Link>
74
+ </li>
75
+
76
+ <li v-if="index < items.length - 1" role="presentation" aria-hidden="true" :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator] })" data-part="separator">
77
+ <slot name="separator" :ui="ui">
78
+ <Icon :name="separatorIcon" :class="ui.separatorIcon({ class: [props.ui?.separatorIcon, item.ui?.separatorIcon] })" data-part="separatorIcon" />
79
+ </slot>
80
+ </li>
81
+ </template>
82
+ </ol>
83
+ </Primitive>
84
84
  </template>
@@ -63,8 +63,12 @@ export type BreadcrumbSlots<T extends BreadcrumbItem = BreadcrumbItem> = {
63
63
  active?: boolean;
64
64
  ui: ComponentStyler<typeof theme>;
65
65
  }>;
66
- declare const __VLS_export: <T extends BreadcrumbItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
67
- props: __VLS_PrettifyLocal<BreadcrumbProps<T>> & import("vue").PublicProps;
66
+ declare const _default: typeof __VLS_export;
67
+ export default _default;
68
+ declare const __VLS_export: <T extends BreadcrumbItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
69
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<BreadcrumbProps<T>> & (typeof globalThis extends {
70
+ __VLS_PROPS_FALLBACK: infer P;
71
+ } ? P : {});
68
72
  expose: (exposed: {}) => void;
69
73
  attrs: any;
70
74
  slots: BreadcrumbSlots<T>;
@@ -72,8 +76,8 @@ declare const __VLS_export: <T extends BreadcrumbItem>(__VLS_props: NonNullable<
72
76
  }>) => import("vue").VNode & {
73
77
  __ctx?: Awaited<typeof __VLS_setup>;
74
78
  };
75
- declare const _default: typeof __VLS_export;
76
- export default _default;
77
- type __VLS_PrettifyLocal<T> = {
79
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
80
+ [K in keyof T]: T[K];
81
+ } : {
78
82
  [K in keyof T as K]: T[K];
79
- } & {};
83
+ }) & {};
@@ -47,13 +47,14 @@ const props = defineProps({
47
47
  to: { type: null, required: false },
48
48
  href: { type: null, required: false },
49
49
  external: { type: Boolean, required: false },
50
- target: { type: [String, Object], required: false },
51
- rel: { type: [String, Object], required: false },
50
+ target: { type: [String, Object, null], required: false },
51
+ rel: { type: [String, Object, null], required: false },
52
52
  noRel: { type: Boolean, required: false },
53
53
  prefetchedClass: { type: String, required: false },
54
54
  prefetch: { type: Boolean, required: false },
55
55
  prefetchOn: { type: [String, Object], required: false },
56
56
  noPrefetch: { type: Boolean, required: false },
57
+ trailingSlash: { type: String, required: false },
57
58
  activeClass: { type: String, required: false },
58
59
  exactActiveClass: { type: String, required: false },
59
60
  ariaCurrentValue: { type: String, required: false },
@@ -109,58 +110,58 @@ const ui = computed(() => {
109
110
  </script>
110
111
 
111
112
  <template>
112
- <Link
113
- v-slot="{ active, ...slotProps }"
114
- :type="props.type"
115
- :disabled="props.disabled || props.loading"
116
- v-bind="omit(linkProps, ['type', 'disabled', 'onClick'])"
117
- data-part="base"
118
- custom
119
- >
120
- <LinkBase
121
- v-bind="slotProps"
113
+ <Link
114
+ v-slot="{ active, ...slotProps }"
115
+ :type="props.type"
116
+ :disabled="props.disabled || props.loading"
117
+ v-bind="omit(linkProps, ['type', 'disabled', 'onClick'])"
118
+ data-part="base"
119
+ custom
120
+ >
121
+ <LinkBase
122
+ v-bind="slotProps"
122
123
  :class="ui.base({
123
124
  class: [props.ui?.base, props.class],
124
125
  active,
125
126
  ...props.active && props.activeVariant ? { variant: props.activeVariant } : {},
126
127
  ...props.active && props.activeColor ? { color: props.activeColor } : {}
127
- })"
128
- @click="onClickWrapper"
129
- >
130
- <slot name="leading" :ui="ui">
131
- <Icon
132
- v-if="isLeading && leadingIconName"
133
- :name="leadingIconName"
134
- :class="ui.leadingIcon({ class: props.ui?.leadingIcon, active })"
135
- data-part="leadingIcon"
136
- />
137
- <Avatar
138
- v-else-if="props.avatar"
139
- :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()"
140
- v-bind="props.avatar"
141
- :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar, active })"
142
- data-part="leadingAvatar"
143
- />
144
- </slot>
145
-
146
- <slot :ui="ui">
147
- <span
148
- v-if="props.label"
149
- :class="ui.label({ class: props.ui?.label, active })"
150
- data-part="label"
151
- >
152
- {{ label }}
153
- </span>
154
- </slot>
155
-
156
- <slot name="trailing" :ui="ui">
157
- <Icon
158
- v-if="isTrailing && trailingIconName"
159
- :name="trailingIconName"
160
- :class="ui.trailingIcon({ class: props.ui?.trailingIcon, active })"
161
- data-part="trailingIcon"
162
- />
163
- </slot>
164
- </LinkBase>
165
- </Link>
128
+ })"
129
+ @click="onClickWrapper"
130
+ >
131
+ <slot name="leading" :ui="ui">
132
+ <Icon
133
+ v-if="isLeading && leadingIconName"
134
+ :name="leadingIconName"
135
+ :class="ui.leadingIcon({ class: props.ui?.leadingIcon, active })"
136
+ data-part="leadingIcon"
137
+ />
138
+ <Avatar
139
+ v-else-if="props.avatar"
140
+ :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()"
141
+ v-bind="props.avatar"
142
+ :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar, active })"
143
+ data-part="leadingAvatar"
144
+ />
145
+ </slot>
146
+
147
+ <slot :ui="ui">
148
+ <span
149
+ v-if="props.label"
150
+ :class="ui.label({ class: props.ui?.label, active })"
151
+ data-part="label"
152
+ >
153
+ {{ label }}
154
+ </span>
155
+ </slot>
156
+
157
+ <slot name="trailing" :ui="ui">
158
+ <Icon
159
+ v-if="isTrailing && trailingIconName"
160
+ :name="trailingIconName"
161
+ :class="ui.trailingIcon({ class: props.ui?.trailingIcon, active })"
162
+ data-part="trailingIcon"
163
+ />
164
+ </slot>
165
+ </LinkBase>
166
+ </Link>
166
167
  </template>
@@ -35,9 +35,9 @@ export interface ButtonSlots {
35
35
  ui: ComponentStyler<typeof theme>;
36
36
  }>;
37
37
  }
38
- declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ButtonSlots>;
39
38
  declare const _default: typeof __VLS_export;
40
39
  export default _default;
40
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ButtonSlots>;
41
41
  type __VLS_WithSlots<T, S> = T & {
42
42
  new (): {
43
43
  $slots: S;
@@ -80,78 +80,78 @@ const Calendar = computed(() => props.range ? RangeCalendar : BaseCalendar);
80
80
  </script>
81
81
 
82
82
  <template>
83
- <Calendar.Root
84
- v-slot="{ weekDays, grid }"
85
- v-bind="rootProps"
86
- :model-value="props.modelValue"
87
- :default-value="props.defaultValue"
88
- :class="ui.root({ class: [props.class, props.ui?.root] })"
89
- data-part="root"
90
- >
91
- <Calendar.Header :class="ui.header({ class: props.ui?.header })" data-part="header">
92
- <Calendar.Prev v-if="props.yearControls" :prev-page="(date) => paginateYear(date, -1)" :aria-label="t('calendar.prevYear')" as-child>
93
- <Button :icon="prevYearIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.prevYear" />
94
- </Calendar.Prev>
95
- <Calendar.Prev v-if="props.monthControls" :aria-label="t('calendar.prevMonth')" as-child>
96
- <Button :icon="prevMonthIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.prevMonth" />
97
- </Calendar.Prev>
98
-
99
- <Calendar.Heading v-slot="{ headingValue }" :class="ui.heading({ class: props.ui?.heading })" data-part="heading">
100
- <slot name="heading" :value="headingValue">
101
- {{ headingValue }}
102
- </slot>
103
- </Calendar.Heading>
104
- <Calendar.Next v-if="props.monthControls" :aria-label="t('calendar.nextMonth')" as-child>
105
- <Button :icon="nextMonthIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.nextMonth" />
106
- </Calendar.Next>
107
- <Calendar.Next v-if="props.yearControls" :next-page="(date) => paginateYear(date, 1)" :aria-label="t('calendar.nextYear')" as-child>
108
- <Button :icon="nextYearIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.nextYear" />
109
- </Calendar.Next>
110
- </Calendar.Header>
111
- <div :class="ui.body({ class: props.ui?.body })" data-part="body">
112
- <Calendar.Grid
113
- v-for="month in grid"
114
- :key="month.value.toString()"
115
- :class="ui.grid({ class: props.ui?.grid })"
116
- data-part="grid"
117
- >
118
- <Calendar.GridHead>
119
- <Calendar.GridRow :class="ui.gridWeekDaysRow({ class: props.ui?.gridWeekDaysRow })" data-part="gridWeekDaysRow">
120
- <Calendar.HeadCell v-for="day in weekDays" :key="day" :class="ui.headCell({ class: props.ui?.headCell })" data-part="headCell">
121
- <slot name="week-day" :day="day">
122
- {{ day }}
123
- </slot>
124
- </Calendar.HeadCell>
125
- </Calendar.GridRow>
126
- </Calendar.GridHead>
127
- <Calendar.GridBody :class="ui.gridBody({ class: props.ui?.gridBody })" data-part="gridBody">
128
- <Calendar.GridRow
129
- v-for="(weekDates, index) in month.rows"
130
- :key="`weekDates-${index}`"
131
- :class="ui.gridRow({ class: props.ui?.gridRow })"
132
- data-part="gridRow"
133
- >
134
- <Calendar.Cell
135
- v-for="weekDate in weekDates"
136
- :key="weekDate.toString()"
137
- :date="weekDate"
138
- :class="ui.cell({ class: props.ui?.cell })"
139
- data-part="cell"
140
- >
141
- <Calendar.CellTrigger
142
- :day="weekDate"
143
- :month="month.value"
144
- :class="ui.cellTrigger({ class: props.ui?.cellTrigger })"
145
- data-part="cellTrigger"
146
- >
147
- <slot name="day" :day="weekDate">
148
- {{ weekDate.day }}
149
- </slot>
150
- </Calendar.CellTrigger>
151
- </Calendar.Cell>
152
- </Calendar.GridRow>
153
- </Calendar.GridBody>
154
- </Calendar.Grid>
155
- </div>
156
- </Calendar.Root>
83
+ <Calendar.Root
84
+ v-slot="{ weekDays, grid }"
85
+ v-bind="rootProps"
86
+ :model-value="props.modelValue"
87
+ :default-value="props.defaultValue"
88
+ :class="ui.root({ class: [props.class, props.ui?.root] })"
89
+ data-part="root"
90
+ >
91
+ <Calendar.Header :class="ui.header({ class: props.ui?.header })" data-part="header">
92
+ <Calendar.Prev v-if="props.yearControls" :prev-page="(date) => paginateYear(date, -1)" :aria-label="t('calendar.prevYear')" as-child>
93
+ <Button :icon="prevYearIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.prevYear" />
94
+ </Calendar.Prev>
95
+ <Calendar.Prev v-if="props.monthControls" :aria-label="t('calendar.prevMonth')" as-child>
96
+ <Button :icon="prevMonthIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.prevMonth" />
97
+ </Calendar.Prev>
98
+
99
+ <Calendar.Heading v-slot="{ headingValue }" :class="ui.heading({ class: props.ui?.heading })" data-part="heading">
100
+ <slot name="heading" :value="headingValue">
101
+ {{ headingValue }}
102
+ </slot>
103
+ </Calendar.Heading>
104
+ <Calendar.Next v-if="props.monthControls" :aria-label="t('calendar.nextMonth')" as-child>
105
+ <Button :icon="nextMonthIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.nextMonth" />
106
+ </Calendar.Next>
107
+ <Calendar.Next v-if="props.yearControls" :next-page="(date) => paginateYear(date, 1)" :aria-label="t('calendar.nextYear')" as-child>
108
+ <Button :icon="nextYearIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.nextYear" />
109
+ </Calendar.Next>
110
+ </Calendar.Header>
111
+ <div :class="ui.body({ class: props.ui?.body })" data-part="body">
112
+ <Calendar.Grid
113
+ v-for="month in grid"
114
+ :key="month.value.toString()"
115
+ :class="ui.grid({ class: props.ui?.grid })"
116
+ data-part="grid"
117
+ >
118
+ <Calendar.GridHead>
119
+ <Calendar.GridRow :class="ui.gridWeekDaysRow({ class: props.ui?.gridWeekDaysRow })" data-part="gridWeekDaysRow">
120
+ <Calendar.HeadCell v-for="day in weekDays" :key="day" :class="ui.headCell({ class: props.ui?.headCell })" data-part="headCell">
121
+ <slot name="week-day" :day="day">
122
+ {{ day }}
123
+ </slot>
124
+ </Calendar.HeadCell>
125
+ </Calendar.GridRow>
126
+ </Calendar.GridHead>
127
+ <Calendar.GridBody :class="ui.gridBody({ class: props.ui?.gridBody })" data-part="gridBody">
128
+ <Calendar.GridRow
129
+ v-for="(weekDates, index) in month.rows"
130
+ :key="`weekDates-${index}`"
131
+ :class="ui.gridRow({ class: props.ui?.gridRow })"
132
+ data-part="gridRow"
133
+ >
134
+ <Calendar.Cell
135
+ v-for="weekDate in weekDates"
136
+ :key="weekDate.toString()"
137
+ :date="weekDate"
138
+ :class="ui.cell({ class: props.ui?.cell })"
139
+ data-part="cell"
140
+ >
141
+ <Calendar.CellTrigger
142
+ :day="weekDate"
143
+ :month="month.value"
144
+ :class="ui.cellTrigger({ class: props.ui?.cellTrigger })"
145
+ data-part="cellTrigger"
146
+ >
147
+ <slot name="day" :day="weekDate">
148
+ {{ weekDate.day }}
149
+ </slot>
150
+ </Calendar.CellTrigger>
151
+ </Calendar.Cell>
152
+ </Calendar.GridRow>
153
+ </Calendar.GridBody>
154
+ </Calendar.Grid>
155
+ </div>
156
+ </Calendar.Root>
157
157
  </template>
@@ -2,7 +2,7 @@ import type { VariantProps } from '@byyuurin/ui-kit';
2
2
  import type { DateValue } from '@internationalized/date';
3
3
  import type { CalendarCellTriggerProps, CalendarRootEmits, CalendarRootProps, DateRange, RangeCalendarRootEmits, RangeCalendarRootProps } from 'reka-ui';
4
4
  import theme from '#build/ui/calendar';
5
- import type { ButtonProps, ComponentBaseProps, ComponentUIProps, IconProps } from '../types';
5
+ import type { ButtonProps, ComponentBaseProps, ComponentUIProps, IconProps, LinkPropsKeys } from '../types';
6
6
  import type { MaybeNull, StaticSlot } from '../types/utils';
7
7
  type CalendarDefaultValue<R extends boolean = false, M extends boolean = false> = R extends true ? DateRange : M extends true ? DateValue[] : DateValue;
8
8
  type CalendarModelValue<R extends boolean = false, M extends boolean = false> = R extends true ? MaybeNull<DateRange> : M extends true ? (DateValue[] | undefined) : (DateValue | undefined);
@@ -23,7 +23,7 @@ export interface CalendarProps<R extends boolean = false, M extends boolean = fa
23
23
  /**
24
24
  * Configure the next year button.
25
25
  */
26
- nextYear?: ButtonProps;
26
+ nextYear?: Omit<ButtonProps, LinkPropsKeys>;
27
27
  /**
28
28
  * The icon to use for the next month control.
29
29
  * @default app.icons.chevronRight
@@ -32,7 +32,7 @@ export interface CalendarProps<R extends boolean = false, M extends boolean = fa
32
32
  /**
33
33
  * Configure the next month button.
34
34
  */
35
- nextMonth?: ButtonProps;
35
+ nextMonth?: Omit<ButtonProps, LinkPropsKeys>;
36
36
  /**
37
37
  * The icon to use for the previous year control.
38
38
  * @default app.icons.chevronDoubleLeft
@@ -41,7 +41,7 @@ export interface CalendarProps<R extends boolean = false, M extends boolean = fa
41
41
  /**
42
42
  * Configure the prev year button.
43
43
  */
44
- prevYear?: ButtonProps;
44
+ prevYear?: Omit<ButtonProps, LinkPropsKeys>;
45
45
  /**
46
46
  * The icon to use for the previous month control.
47
47
  * @default app.icons.chevronLeft
@@ -50,7 +50,7 @@ export interface CalendarProps<R extends boolean = false, M extends boolean = fa
50
50
  /**
51
51
  * Configure the prev month button.
52
52
  */
53
- prevMonth?: ButtonProps;
53
+ prevMonth?: Omit<ButtonProps, LinkPropsKeys>;
54
54
  /**
55
55
  * @default "md"
56
56
  */
@@ -81,13 +81,17 @@ export interface CalendarSlots {
81
81
  day: string;
82
82
  }>;
83
83
  }
84
- declare const __VLS_export: <R extends boolean, M extends boolean>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
85
- props: __VLS_PrettifyLocal<CalendarProps<R, M> & {
84
+ declare const _default: typeof __VLS_export;
85
+ export default _default;
86
+ declare const __VLS_export: <R extends boolean, M extends boolean>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
87
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<CalendarProps<R, M> & {
86
88
  "onUpdate:modelValue"?: ((date: CalendarModelValue<R, M>) => any) | undefined;
87
89
  "onUpdate:placeholder"?: ((...args: DateValue[]) => any) | undefined;
88
90
  "onUpdate:validModelValue"?: ((date: DateRange) => any) | undefined;
89
91
  "onUpdate:startValue"?: ((date: DateValue | undefined) => any) | undefined;
90
- }> & import("vue").PublicProps;
92
+ }> & (typeof globalThis extends {
93
+ __VLS_PROPS_FALLBACK: infer P;
94
+ } ? P : {});
91
95
  expose: (exposed: {}) => void;
92
96
  attrs: any;
93
97
  slots: CalendarSlots;
@@ -95,8 +99,8 @@ declare const __VLS_export: <R extends boolean, M extends boolean>(__VLS_props:
95
99
  }>) => import("vue").VNode & {
96
100
  __ctx?: Awaited<typeof __VLS_setup>;
97
101
  };
98
- declare const _default: typeof __VLS_export;
99
- export default _default;
100
- type __VLS_PrettifyLocal<T> = {
102
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
103
+ [K in keyof T]: T[K];
104
+ } : {
101
105
  [K in keyof T as K]: T[K];
102
- } & {};
106
+ }) & {};