@byyuurin/ui 0.1.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 +75 -77
  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 +85 -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 +131 -0
  30. package/dist/runtime/components/CheckboxGroup.vue.d.ts +93 -0
  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 +48 -50
  52. package/dist/runtime/components/InputNumber.vue.d.ts +128 -129
  53. package/dist/runtime/components/InputTags.vue +156 -0
  54. package/dist/runtime/components/InputTags.vue.d.ts +90 -0
  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 +38 -0
  62. package/dist/runtime/components/Marquee.vue.d.ts +54 -0
  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 +243 -234
  66. package/dist/runtime/components/NavigationMenu.vue.d.ts +53 -14
  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 +13 -9
  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 +188 -166
  93. package/dist/runtime/components/Table.vue.d.ts +27 -22
  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 +102 -0
  99. package/dist/runtime/components/Timeline.vue.d.ts +78 -0
  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 +7 -0
  118. package/dist/runtime/types/index.js +7 -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 +9 -6
  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.DSyJHSTk.mjs → ui.DpkP12cX.mjs} +784 -84
  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
@@ -1,5 +1,5 @@
1
- import type { VariantProps } from '@byyuurin/ui-kit';
2
- import type { AccordionRootProps, NavigationMenuContentEmits, NavigationMenuContentProps, NavigationMenuRootEmits, NavigationMenuRootProps } from 'reka-ui';
1
+ import type { MaybeArray, VariantProps } from '@byyuurin/ui-kit';
2
+ import type { AccordionRootProps, NavigationMenuContentEmits, NavigationMenuContentProps, NavigationMenuRootProps } from 'reka-ui';
3
3
  import theme from '#build/ui/navigation-menu';
4
4
  import type { AvatarProps, BadgeProps, ComponentBaseProps, ComponentStyler, ComponentUIProps, IconProps, LinkProps, PopoverProps, TooltipProps } from '../types';
5
5
  import type { ArrayOrNested, DynamicSlots, EmitsToProps, GetItemKeys, MergeTypes, NestedItem, StaticSlot } from '../types/utils';
@@ -53,12 +53,40 @@ export interface NavigationMenuItem extends ComponentBaseProps, Omit<LinkProps,
53
53
  [key: string]: any;
54
54
  }
55
55
  type ThemeVariants = VariantProps<typeof theme>;
56
- export interface NavigationMenuProps<T extends ArrayOrNested<NavigationMenuItem> = ArrayOrNested<NavigationMenuItem>> extends ComponentBaseProps, Pick<NavigationMenuRootProps, 'modelValue' | 'defaultValue' | 'delayDuration' | 'disableClickTrigger' | 'disableHoverTrigger' | 'skipDelayDuration' | 'disablePointerLeaveClose' | 'unmountOnHide'>, Pick<AccordionRootProps, 'disabled' | 'type' | 'collapsible'> {
56
+ type SingleOrMultipleType = 'single' | 'multiple';
57
+ type Orientation = ThemeVariants['orientation'];
58
+ type NavigationMenuModelValue<K extends SingleOrMultipleType = SingleOrMultipleType, O extends Orientation = Orientation> = O extends 'horizontal' ? string : K extends 'single' ? string : K extends 'multiple' ? string[] : MaybeArray<string>;
59
+ export interface NavigationMenuProps<T extends ArrayOrNested<NavigationMenuItem> = ArrayOrNested<NavigationMenuItem>, K extends SingleOrMultipleType = SingleOrMultipleType, O extends Orientation = Orientation> extends ComponentBaseProps, Pick<NavigationMenuRootProps, 'delayDuration' | 'disableClickTrigger' | 'disableHoverTrigger' | 'skipDelayDuration' | 'disablePointerLeaveClose' | 'unmountOnHide'>, Pick<AccordionRootProps, 'disabled' | 'type' | 'collapsible'> {
57
60
  /**
58
61
  * The element or component this component should render as.
59
62
  * @default "div"
60
63
  */
61
64
  as?: NavigationMenuRootProps['as'];
65
+ /**
66
+ * Determines whether a "single" or "multiple" items can be selected at a time.
67
+ *
68
+ * Only works when `orientation` is `vertical`.
69
+ * @default "multiple"
70
+ */
71
+ type?: K;
72
+ /**
73
+ * The controlled value of the active item(s).
74
+ * - In horizontal orientation: always `string`
75
+ * - In vertical orientation with `type="single"`: `string`
76
+ * - In vertical orientation with `type="multiple"`: `string[]`
77
+ *
78
+ * Use this when you need to control the state of the items. Can be binded with `v-model`
79
+ */
80
+ modelValue?: NavigationMenuModelValue<K, O>;
81
+ /**
82
+ * The default active value of the item(s).
83
+ * - In horizontal orientation: always `string`
84
+ * - In vertical orientation with `type="single"`: `string`
85
+ * - In vertical orientation with `type="multiple"`: `string[]`
86
+ *
87
+ * Use when you do not need to control the state of the item(s).
88
+ */
89
+ defaultValue?: NavigationMenuModelValue<K, O>;
62
90
  /**
63
91
  * The icon displayed to open the menu.
64
92
  * @default app.icons.chevronDown
@@ -79,7 +107,7 @@ export interface NavigationMenuProps<T extends ArrayOrNested<NavigationMenuItem>
79
107
  * The orientation of the menu.
80
108
  * @default "horizontal"
81
109
  */
82
- orientation?: NavigationMenuRootProps['orientation'];
110
+ orientation?: O;
83
111
  /**
84
112
  * Collapse the navigation menu to only show icons.
85
113
  * Only works when `orientation` is `vertical`.
@@ -120,7 +148,14 @@ export interface NavigationMenuProps<T extends ArrayOrNested<NavigationMenuItem>
120
148
  labelKey?: GetItemKeys<T>;
121
149
  ui?: ComponentUIProps<typeof theme>;
122
150
  }
123
- export interface NavigationMenuEmits extends NavigationMenuRootEmits {
151
+ export interface NavigationMenuEmits<K extends SingleOrMultipleType = SingleOrMultipleType, O extends Orientation = Orientation> {
152
+ /**
153
+ * Event handler called when the value changes.
154
+ * - In horizontal orientation: emits `string`
155
+ * - In vertical orientation with `type="single"`: emits `string | undefined`
156
+ * - In vertical orientation with `type="multiple"`: emits `string[] | undefined`
157
+ */
158
+ 'update:modelValue': [value: NavigationMenuModelValue<K, O> | undefined];
124
159
  }
125
160
  export type NavigationMenuSlots<A extends ArrayOrNested<NavigationMenuItem> = ArrayOrNested<NavigationMenuItem>, T extends NestedItem<A> = NestedItem<A>> = {
126
161
  'item': StaticSlot<{
@@ -163,19 +198,23 @@ export type NavigationMenuSlots<A extends ArrayOrNested<NavigationMenuItem> = Ar
163
198
  active: boolean;
164
199
  ui: ComponentStyler<typeof theme>;
165
200
  }>;
166
- declare const __VLS_export: <T extends ArrayOrNested<NavigationMenuItem>>(__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<{
167
- props: __VLS_PrettifyLocal<NavigationMenuProps<T> & {
168
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
169
- }> & import("vue").PublicProps;
201
+ declare const _default: typeof __VLS_export;
202
+ export default _default;
203
+ declare const __VLS_export: <T extends ArrayOrNested<NavigationMenuItem>, K extends SingleOrMultipleType = SingleOrMultipleType, O extends Orientation = Orientation>(__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<{
204
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<NavigationMenuProps<T, K, O> & {
205
+ "onUpdate:modelValue"?: ((value: NavigationMenuModelValue<K, O> | undefined) => any) | undefined;
206
+ }> & (typeof globalThis extends {
207
+ __VLS_PROPS_FALLBACK: infer P;
208
+ } ? P : {});
170
209
  expose: (exposed: {}) => void;
171
210
  attrs: any;
172
211
  slots: NavigationMenuSlots<T, NestedItem<T>>;
173
- emit: (evt: "update:modelValue", value: string) => void;
212
+ emit: (evt: "update:modelValue", value: NavigationMenuModelValue<K, O> | undefined) => void;
174
213
  }>) => import("vue").VNode & {
175
214
  __ctx?: Awaited<typeof __VLS_setup>;
176
215
  };
177
- declare const _default: typeof __VLS_export;
178
- export default _default;
179
- type __VLS_PrettifyLocal<T> = {
216
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
217
+ [K in keyof T]: T[K];
218
+ } : {
180
219
  [K in keyof T as K]: T[K];
181
- } & {};
220
+ }) & {};
@@ -13,13 +13,13 @@ function onClose(id, value) {
13
13
  </script>
14
14
 
15
15
  <template>
16
- <component
17
- :is="overlay.component"
18
- v-for="overlay in mountedOverlays"
19
- :key="overlay.id"
20
- v-bind="overlay.props"
21
- v-model:open="overlay.isOpen"
22
- @close="onClose(overlay.id, $event)"
23
- @after-leave="onAfterLeave(overlay.id)"
24
- />
16
+ <component
17
+ :is="overlay.component"
18
+ v-for="overlay in mountedOverlays"
19
+ :key="overlay.id"
20
+ v-bind="overlay.props"
21
+ v-model:open="overlay.isOpen"
22
+ @close="onClose(overlay.id, $event)"
23
+ @after-leave="onAfterLeave(overlay.id)"
24
+ />
25
25
  </template>
@@ -50,51 +50,51 @@ const lastIcon = computed(() => props.lastIcon || (dir.value === "rtl" ? appConf
50
50
  </script>
51
51
 
52
52
  <template>
53
- <PaginationRoot v-slot="{ page, pageCount }" v-bind="rootProps" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
54
- <PaginationList v-slot="{ items }" :class="ui.list({ class: props.ui?.list })" data-part="list">
55
- <PaginationFirst v-if="props.showControls || !!slots.first" :class="ui.first({ class: props.ui?.first })" as-child data-part="first">
56
- <slot name="first">
57
- <Button :color="props.color" :variant="props.variant" :size="props.size" :icon="firstIcon" :to="props.to?.(1)" />
58
- </slot>
59
- </PaginationFirst>
60
- <PaginationPrev v-if="props.showControls || !!slots.prev" :class="ui.prev({ class: props.ui?.prev })" as-child data-part="perv">
61
- <slot name="prev">
62
- <Button :color="props.color" :variant="props.variant" :size="props.size" :icon="prevIcon" :to="page > 1 ? props.to?.(page - 1) : void 0" />
63
- </slot>
64
- </PaginationPrev>
65
-
66
- <template v-for="(item, index) in items" :key="index">
67
- <PaginationListItem v-if="item.type === 'page'" :value="item.value" :class="ui.item({ class: props.ui?.item })" as-child data-part="item">
68
- <slot name="item" v-bind="{ item, index, page, pageCount }">
69
- <Button
70
- :color="props.page === item.value ? props.activeColor : props.color"
71
- :variant="props.page === item.value ? props.activeVariant : props.variant"
72
- :size="props.size"
73
- :label="String(item.value)"
74
- :to="props.to?.(item.value)"
75
- :ui="{ label: ui.label({ class: props.ui?.label }) }"
76
- square
77
- />
78
- </slot>
79
- </PaginationListItem>
80
-
81
- <PaginationEllipsis v-else :class="ui.ellipsis({ class: props.ui?.ellipsis })" as-child data-part="ellipsis">
82
- <slot name="ellipsis" :ui="ui">
83
- <Button as="div" :color="props.color" :variant="props.variant" :size="props.size" :icon="ellipsisIcon || appConfig.ui.icons.ellipsis" />
84
- </slot>
85
- </PaginationEllipsis>
86
- </template>
87
-
88
- <PaginationNext v-if="props.showControls || !!slots.next" :class="ui.next({ class: props.ui?.next })" as-child data-part="next">
89
- <slot name="next">
90
- <Button :color="props.color" :variant="props.variant" :size="props.size" :icon="nextIcon" :to="page < pageCount ? props.to?.(page + 1) : void 0" />
91
- </slot>
92
- </PaginationNext>
93
- <PaginationLast v-if="props.showControls || !!slots.last" :class="ui.last({ class: props.ui?.last })" as-child data-part="last">
94
- <slot name="last">
95
- <Button :color="props.color" :variant="props.variant" :size="props.size" :icon="lastIcon" :to="props.to?.(pageCount)" />
96
- </slot>
97
- </PaginationLast>
98
- </PaginationList>
99
- </PaginationRoot>
53
+ <PaginationRoot v-slot="{ page, pageCount }" v-bind="rootProps" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
54
+ <PaginationList v-slot="{ items }" :class="ui.list({ class: props.ui?.list })" data-part="list">
55
+ <PaginationFirst v-if="props.showControls || !!slots.first" :class="ui.first({ class: props.ui?.first })" as-child data-part="first">
56
+ <slot name="first">
57
+ <Button :color="props.color" :variant="props.variant" :size="props.size" :icon="firstIcon" :to="props.to?.(1)" />
58
+ </slot>
59
+ </PaginationFirst>
60
+ <PaginationPrev v-if="props.showControls || !!slots.prev" :class="ui.prev({ class: props.ui?.prev })" as-child data-part="perv">
61
+ <slot name="prev">
62
+ <Button :color="props.color" :variant="props.variant" :size="props.size" :icon="prevIcon" :to="page > 1 ? props.to?.(page - 1) : void 0" />
63
+ </slot>
64
+ </PaginationPrev>
65
+
66
+ <template v-for="(item, index) in items" :key="index">
67
+ <PaginationListItem v-if="item.type === 'page'" :value="item.value" :class="ui.item({ class: props.ui?.item })" as-child data-part="item">
68
+ <slot name="item" v-bind="{ item, index, page, pageCount }">
69
+ <Button
70
+ :color="props.page === item.value ? props.activeColor : props.color"
71
+ :variant="props.page === item.value ? props.activeVariant : props.variant"
72
+ :size="props.size"
73
+ :label="String(item.value)"
74
+ :to="props.to?.(item.value)"
75
+ :ui="{ label: ui.label({ class: props.ui?.label }) }"
76
+ square
77
+ />
78
+ </slot>
79
+ </PaginationListItem>
80
+
81
+ <PaginationEllipsis v-else :class="ui.ellipsis({ class: props.ui?.ellipsis })" as-child data-part="ellipsis">
82
+ <slot name="ellipsis" :ui="ui">
83
+ <Button as="div" :color="props.color" :variant="props.variant" :size="props.size" :icon="ellipsisIcon || appConfig.ui.icons.ellipsis" />
84
+ </slot>
85
+ </PaginationEllipsis>
86
+ </template>
87
+
88
+ <PaginationNext v-if="props.showControls || !!slots.next" :class="ui.next({ class: props.ui?.next })" as-child data-part="next">
89
+ <slot name="next">
90
+ <Button :color="props.color" :variant="props.variant" :size="props.size" :icon="nextIcon" :to="page < pageCount ? props.to?.(page + 1) : void 0" />
91
+ </slot>
92
+ </PaginationNext>
93
+ <PaginationLast v-if="props.showControls || !!slots.last" :class="ui.last({ class: props.ui?.last })" as-child data-part="last">
94
+ <slot name="last">
95
+ <Button :color="props.color" :variant="props.variant" :size="props.size" :icon="lastIcon" :to="props.to?.(pageCount)" />
96
+ </slot>
97
+ </PaginationLast>
98
+ </PaginationList>
99
+ </PaginationRoot>
100
100
  </template>
@@ -92,23 +92,23 @@ export interface PaginationSlots {
92
92
  index: number;
93
93
  }>;
94
94
  }
95
+ declare const _default: typeof __VLS_export;
96
+ export default _default;
95
97
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<PaginationProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
96
98
  "update:page": (value: number) => any;
97
99
  }, string, import("vue").PublicProps, Readonly<PaginationProps> & Readonly<{
98
100
  "onUpdate:page"?: ((value: number) => any) | undefined;
99
101
  }>, {
100
- color: "error" | "info" | "primary" | "secondary" | "success" | "warning" | "neutral";
102
+ color: "error" | "primary" | "secondary" | "success" | "info" | "warning" | "neutral";
101
103
  variant: "link" | "solid" | "outline" | "soft" | "subtle" | "ghost";
102
104
  activeVariant: "link" | "solid" | "outline" | "soft" | "subtle" | "ghost";
103
- activeColor: "error" | "info" | "primary" | "secondary" | "success" | "warning" | "neutral";
105
+ activeColor: "error" | "primary" | "secondary" | "success" | "info" | "warning" | "neutral";
104
106
  itemsPerPage: number;
105
107
  showEdges: boolean;
106
108
  siblingCount: number;
107
109
  total: number;
108
110
  showControls: boolean;
109
111
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, PaginationSlots>;
110
- declare const _default: typeof __VLS_export;
111
- export default _default;
112
112
  type __VLS_WithSlots<T, S> = T & {
113
113
  new (): {
114
114
  $slots: S;
@@ -21,7 +21,7 @@ const props = defineProps({
21
21
  highlight: { type: Boolean, required: false },
22
22
  ui: { type: null, required: false },
23
23
  class: { type: [Object, String, Number, Boolean, null, Array], required: false, skipCheck: true },
24
- defaultValue: { type: Array, required: false },
24
+ defaultValue: { type: null, required: false },
25
25
  disabled: { type: Boolean, required: false },
26
26
  id: { type: String, required: false },
27
27
  mask: { type: Boolean, required: false },
@@ -71,26 +71,26 @@ defineExpose({
71
71
  </script>
72
72
 
73
73
  <template>
74
- <PinInputRoot
75
- v-bind="{ ...rootProps, ...ariaAttrs, id, name }"
76
- :placeholder="props.placeholder"
77
- :model-value="modelValue"
78
- :default-value="props.defaultValue"
79
- :class="ui.root({ class: [props.ui?.root, props.class] })"
80
- data-part="root"
81
- @update:model-value="emitFormInput"
82
- @complete="onComplete"
83
- >
84
- <PinInputInput
85
- v-for="(ids, index) in looseToNumber(props.length)"
86
- :key="ids"
87
- :ref="(el) => inputsRef[index] = el"
88
- :index="index"
89
- :disabled="disabled"
90
- :class="ui.base({ class: props.ui?.base })"
91
- data-part="base"
92
- @blur="onBlur"
93
- @focus="emitFormFocus"
94
- />
95
- </PinInputRoot>
74
+ <PinInputRoot
75
+ v-bind="{ ...rootProps, ...ariaAttrs, id, name }"
76
+ :placeholder="props.placeholder"
77
+ :model-value="modelValue"
78
+ :default-value="props.defaultValue"
79
+ :class="ui.root({ class: [props.ui?.root, props.class] })"
80
+ data-part="root"
81
+ @update:model-value="emitFormInput"
82
+ @complete="onComplete"
83
+ >
84
+ <PinInputInput
85
+ v-for="(ids, index) in looseToNumber(props.length)"
86
+ :key="ids"
87
+ :ref="(el) => inputsRef[index] = el"
88
+ :index="index"
89
+ :disabled="disabled"
90
+ :class="ui.base({ class: props.ui?.base })"
91
+ data-part="base"
92
+ @blur="onBlur"
93
+ @focus="emitFormFocus"
94
+ />
95
+ </PinInputRoot>
96
96
  </template>
@@ -1,6 +1,6 @@
1
- import type { ComponentPublicInstance } from 'vue';
2
1
  import type { VariantProps } from '@byyuurin/ui-kit';
3
2
  import type { PinInputRootEmits, PinInputRootProps } from 'reka-ui';
3
+ import type { ComponentPublicInstance } from 'vue';
4
4
  import theme from '#build/ui/pin-input';
5
5
  import type { ComponentBaseProps, ComponentUIProps } from '../types';
6
6
  type PinInputType = 'text' | 'number';
@@ -31,24 +31,28 @@ export type PinInputEmits<T extends PinInputType = 'text'> = PinInputRootEmits<T
31
31
  change: [event: Event];
32
32
  blur: [event: Event];
33
33
  };
34
- declare const __VLS_export: <T extends PinInputType = "text" | "number">(__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<{
35
- props: __VLS_PrettifyLocal<PinInputProps<T> & {
36
- onChange?: ((event: Event) => any) | undefined;
34
+ declare const _default: typeof __VLS_export;
35
+ export default _default;
36
+ declare const __VLS_export: <T extends PinInputType = "text" | "number">(__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<{
37
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<PinInputProps<T> & {
37
38
  onBlur?: ((event: Event) => any) | undefined;
39
+ onChange?: ((event: Event) => any) | undefined;
38
40
  "onUpdate:modelValue"?: ((value: [T] extends ["number"] ? number[] : string[]) => any) | undefined;
39
41
  onComplete?: ((value: [T] extends ["number"] ? number[] : string[]) => any) | undefined;
40
- }> & import("vue").PublicProps;
42
+ }> & (typeof globalThis extends {
43
+ __VLS_PROPS_FALLBACK: infer P;
44
+ } ? P : {});
41
45
  expose: (exposed: import("vue").ShallowUnwrapRef<{
42
46
  inputsRef: import("vue").Ref<ComponentPublicInstance[], ComponentPublicInstance[]>;
43
47
  }>) => void;
44
48
  attrs: any;
45
49
  slots: {};
46
- emit: ((evt: "change", event: Event) => void) & ((evt: "blur", event: Event) => void) & ((evt: "update:modelValue", value: [T] extends ["number"] ? number[] : string[]) => void) & ((evt: "complete", value: [T] extends ["number"] ? number[] : string[]) => void);
50
+ emit: ((evt: "blur", event: Event) => void) & ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", value: [T] extends ["number"] ? number[] : string[]) => void) & ((evt: "complete", value: [T] extends ["number"] ? number[] : string[]) => void);
47
51
  }>) => import("vue").VNode & {
48
52
  __ctx?: Awaited<typeof __VLS_setup>;
49
53
  };
50
- declare const _default: typeof __VLS_export;
51
- export default _default;
52
- type __VLS_PrettifyLocal<T> = {
54
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
55
+ [K in keyof T]: T[K];
56
+ } : {
53
57
  [K in keyof T as K]: T[K];
54
- } & {};
58
+ }) & {};
@@ -54,26 +54,26 @@ const ui = computed(() => {
54
54
  </script>
55
55
 
56
56
  <template>
57
- <Component.Root v-slot="{ open, close }" v-bind="rootProps">
58
- <Component.Trigger v-if="!!slots.default || !!props.reference" :reference="props.reference" as-child :class="props.class">
59
- <slot :open="open"></slot>
60
- </Component.Trigger>
61
-
62
- <Component.Anchor v-if="'Anchor' in Component && !!slots.anchor" as-child>
63
- <slot name="anchor" v-bind="close ? { close } : {}"></slot>
64
- </Component.Anchor>
65
-
66
- <Component.Portal v-bind="portalProps">
67
- <Component.Content
68
- v-bind="contentProps"
69
- :class="ui.content({ class: [props.ui?.content, !slots.default && props.class] })"
70
- data-part="content"
71
- v-on="contentEvents"
72
- >
73
- <slot name="content" v-bind="close ? { close } : {}"></slot>
74
-
75
- <Component.Arrow v-if="!!props.arrow" v-bind="arrowProps" :class="ui.arrow({ class: props.ui?.arrow })" data-part="arrow" />
76
- </Component.Content>
77
- </Component.Portal>
78
- </Component.Root>
57
+ <Component.Root v-slot="{ open, close }" v-bind="rootProps">
58
+ <Component.Trigger v-if="!!slots.default || !!props.reference" :reference="props.reference" as-child :class="props.class">
59
+ <slot :open="open"></slot>
60
+ </Component.Trigger>
61
+
62
+ <Component.Anchor v-if="'Anchor' in Component && !!slots.anchor" as-child>
63
+ <slot name="anchor" v-bind="close ? { close } : {}"></slot>
64
+ </Component.Anchor>
65
+
66
+ <Component.Portal v-bind="portalProps">
67
+ <Component.Content
68
+ v-bind="contentProps"
69
+ :class="ui.content({ class: [props.ui?.content, !slots.default && props.class] })"
70
+ data-part="content"
71
+ v-on="contentEvents"
72
+ >
73
+ <slot name="content" v-bind="close ? { close } : {}"></slot>
74
+
75
+ <Component.Arrow v-if="!!props.arrow" v-bind="arrowProps" :class="ui.arrow({ class: props.ui?.arrow })" data-part="arrow" />
76
+ </Component.Content>
77
+ </Component.Portal>
78
+ </Component.Root>
79
79
  </template>
@@ -51,11 +51,15 @@ export interface PopoverSlots<M extends PopoverMode = PopoverMode> {
51
51
  close: () => void;
52
52
  }>;
53
53
  }
54
- declare const __VLS_export: <M extends PopoverMode>(__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<{
55
- props: __VLS_PrettifyLocal<PopoverProps<M> & {
54
+ declare const _default: typeof __VLS_export;
55
+ export default _default;
56
+ declare const __VLS_export: <M extends PopoverMode>(__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<{
57
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<PopoverProps<M> & {
56
58
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
57
59
  "onClose-prevent"?: (() => any) | undefined;
58
- }> & import("vue").PublicProps;
60
+ }> & (typeof globalThis extends {
61
+ __VLS_PROPS_FALLBACK: infer P;
62
+ } ? P : {});
59
63
  expose: (exposed: {}) => void;
60
64
  attrs: any;
61
65
  slots: PopoverSlots<M>;
@@ -63,8 +67,8 @@ declare const __VLS_export: <M extends PopoverMode>(__VLS_props: NonNullable<Awa
63
67
  }>) => import("vue").VNode & {
64
68
  __ctx?: Awaited<typeof __VLS_setup>;
65
69
  };
66
- declare const _default: typeof __VLS_export;
67
- export default _default;
68
- type __VLS_PrettifyLocal<T> = {
70
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
71
+ [K in keyof T]: T[K];
72
+ } : {
69
73
  [K in keyof T as K]: T[K];
70
- } & {};
74
+ }) & {};
@@ -87,29 +87,29 @@ const ui = computed(() => {
87
87
  </script>
88
88
 
89
89
  <template>
90
- <Primitive :as="props.as" :class="ui.root({ class: [props.ui?.root, props.class] })" :data-orientation="orientation" data-part="root">
91
- <div v-if="!isIndeterminate && (props.status || !!slots.status)" :class="ui.status({ class: props.ui?.status })" data-part="status" :style="statusStyle">
92
- <slot name="status" :percent="percent">
93
- {{ percent }}%
94
- </slot>
95
- </div>
96
-
97
- <ProgressRoot
98
- v-bind="rootProps"
99
- :max="realMax"
100
- :class="ui.base({ class: props.ui?.base })"
101
- data-part="base"
102
- style="transform: translateZ(0)"
103
- >
104
- <ProgressIndicator :class="ui.indicator({ class: props.ui?.indicator })" data-part="indicator" :style="indicatorStyle" />
105
- </ProgressRoot>
106
-
107
- <div v-if="hasSteps" :class="ui.steps({ class: props.ui?.steps })" data-part="steps">
108
- <div v-for="(step, index) in props.max" :key="index" :class="ui.step({ class: props.ui?.step, step: stepVariant(index) })" data-part="step">
109
- <slot :name="`step-${index}`" :step="step">
110
- {{ step }}
111
- </slot>
112
- </div>
113
- </div>
114
- </Primitive>
90
+ <Primitive :as="props.as" :class="ui.root({ class: [props.ui?.root, props.class] })" :data-orientation="orientation" data-part="root">
91
+ <div v-if="!isIndeterminate && (props.status || !!slots.status)" :class="ui.status({ class: props.ui?.status })" data-part="status" :style="statusStyle">
92
+ <slot name="status" :percent="percent">
93
+ {{ percent }}%
94
+ </slot>
95
+ </div>
96
+
97
+ <ProgressRoot
98
+ v-bind="rootProps"
99
+ :max="realMax"
100
+ :class="ui.base({ class: props.ui?.base })"
101
+ data-part="base"
102
+ style="transform: translateZ(0)"
103
+ >
104
+ <ProgressIndicator :class="ui.indicator({ class: props.ui?.indicator })" data-part="indicator" :style="indicatorStyle" />
105
+ </ProgressRoot>
106
+
107
+ <div v-if="hasSteps" :class="ui.steps({ class: props.ui?.steps })" data-part="steps">
108
+ <div v-for="(step, index) in props.max" :key="index" :class="ui.step({ class: props.ui?.step, step: stepVariant(index) })" data-part="step">
109
+ <slot :name="`step-${index}`" :step="step">
110
+ {{ step }}
111
+ </slot>
112
+ </div>
113
+ </div>
114
+ </Primitive>
115
115
  </template>
@@ -43,6 +43,8 @@ export type ProgressSlots = {
43
43
  step: string | number;
44
44
  }>;
45
45
  };
46
+ declare const _default: typeof __VLS_export;
47
+ export default _default;
46
48
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ProgressProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
47
49
  "update:modelValue": (value: string[] | undefined) => any;
48
50
  "update:max": (value: number) => any;
@@ -54,8 +56,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Progre
54
56
  inverted: boolean;
55
57
  modelValue: number | null;
56
58
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ProgressSlots>;
57
- declare const _default: typeof __VLS_export;
58
- export default _default;
59
59
  type __VLS_WithSlots<T, S> = T & {
60
60
  new (): {
61
61
  $slots: S;