@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
@@ -24,45 +24,45 @@ const ui = computed(() => {
24
24
  </script>
25
25
 
26
26
  <template>
27
- <Primitive :as="props.as" :class="ui.root({ class: [props.class, props.ui?.root] })" data-part="root">
28
- <slot name="content">
29
- <div
30
- v-if="slots.header || props.title || slots.title || props.description || slots.description"
31
- :class="ui.header({ class: props.ui?.header })"
32
- data-part="header"
33
- >
34
- <slot name="header">
35
- <Primitive
36
- v-if="props.title || slots.title"
37
- :as="!!slots.title ? void 0 : 'h2'"
38
- :class="ui.title({ class: props.ui?.title })"
39
- data-part="title"
40
- >
41
- <slot name="title">
42
- {{ props.title }}
43
- </slot>
44
- </Primitive>
45
- <Primitive
46
- v-if="props.description || slots.description"
47
- :as="!!slots.description ? void 0 : 'p'"
48
- :as-child="!!slots.description"
49
- :class="ui.description({ class: props.ui?.description })"
50
- data-part="description"
51
- >
52
- <slot name="description">
53
- {{ props.description }}
54
- </slot>
55
- </Primitive>
56
- </slot>
57
- </div>
58
-
59
- <div v-if="!!slots.default" :class="ui.body({ class: props.ui?.body })" data-part="body">
60
- <slot></slot>
61
- </div>
62
-
63
- <div v-if="!!slots.footer" :class="ui.footer({ class: props.ui?.footer })" data-part="footer">
64
- <slot name="footer"></slot>
65
- </div>
66
- </slot>
67
- </Primitive>
27
+ <Primitive :as="props.as" :class="ui.root({ class: [props.class, props.ui?.root] })" data-part="root">
28
+ <slot name="content">
29
+ <div
30
+ v-if="slots.header || props.title || slots.title || props.description || slots.description"
31
+ :class="ui.header({ class: props.ui?.header })"
32
+ data-part="header"
33
+ >
34
+ <slot name="header">
35
+ <Primitive
36
+ v-if="props.title || slots.title"
37
+ :as="!!slots.title ? void 0 : 'h2'"
38
+ :class="ui.title({ class: props.ui?.title })"
39
+ data-part="title"
40
+ >
41
+ <slot name="title">
42
+ {{ props.title }}
43
+ </slot>
44
+ </Primitive>
45
+ <Primitive
46
+ v-if="props.description || slots.description"
47
+ :as="!!slots.description ? void 0 : 'p'"
48
+ :as-child="!!slots.description"
49
+ :class="ui.description({ class: props.ui?.description })"
50
+ data-part="description"
51
+ >
52
+ <slot name="description">
53
+ {{ props.description }}
54
+ </slot>
55
+ </Primitive>
56
+ </slot>
57
+ </div>
58
+
59
+ <div v-if="!!slots.default" :class="ui.body({ class: props.ui?.body })" data-part="body">
60
+ <slot></slot>
61
+ </div>
62
+
63
+ <div v-if="!!slots.footer" :class="ui.footer({ class: props.ui?.footer })" data-part="footer">
64
+ <slot name="footer"></slot>
65
+ </div>
66
+ </slot>
67
+ </Primitive>
68
68
  </template>
@@ -24,9 +24,9 @@ export interface CardSlots {
24
24
  description: StaticSlot;
25
25
  footer: StaticSlot;
26
26
  }
27
- declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CardProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CardProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, CardSlots>;
28
27
  declare const _default: typeof __VLS_export;
29
28
  export default _default;
29
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CardProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CardProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, CardSlots>;
30
30
  type __VLS_WithSlots<T, S> = T & {
31
31
  new (): {
32
32
  $slots: S;
@@ -189,70 +189,70 @@ defineExpose({
189
189
  </script>
190
190
 
191
191
  <template>
192
- <Primitive
193
- :as="props.as"
194
- role="region"
195
- tabindex="0"
196
- :class="ui.root({ class: [props.class, props.ui?.root] })"
197
- aria-roledescription="carousel"
198
- :data-orientation="props.orientation"
199
- data-part="root"
200
- @keydown="onKeyDown"
201
- >
202
- <div ref="emblaRef" :class="ui.viewport({ class: props.ui?.viewport })" data-part="viewport">
203
- <div :class="ui.container({ class: props.ui?.container })" data-part="container">
204
- <div
205
- v-for="(item, index) in props.items"
206
- :key="index"
207
- v-bind="props.dots ? { role: 'tabpanel' } : { 'role': 'group', 'aria-roledescription': 'slide' }"
208
- :class="ui.item({ class: [props.ui?.item, ...isCarouselItem(item) ? [item.ui?.item, item.class] : []] })"
209
- data-part="item"
210
- >
211
- <slot :item="item" :index="index"></slot>
212
- </div>
213
- </div>
214
- </div>
215
-
216
- <div v-if="props.arrows || props.dots" :class="ui.controls({ class: props.ui?.controls })" data-part="controls">
217
- <div v-if="props.arrows" :class="ui.arrows({ class: props.ui?.arrows })" data-part="arrows">
218
- <Button
219
- :disabled="!canScrollPrev"
220
- :icon="prevIcon"
221
- color="neutral"
222
- variant="outline"
223
- :aria-label="t('carousel.prev')"
224
- v-bind="typeof props.prev === 'object' ? props.prev : void 0"
225
- :class="ui.prev({ class: props.ui?.prev })"
226
- data-part="prev"
227
- @click="scrollPrev"
228
- />
229
- <Button
230
- :disabled="!canScrollNext"
231
- :icon="nextIcon"
232
- color="neutral"
233
- variant="outline"
234
- :aria-label="t('carousel.next')"
235
- v-bind="typeof props.next === 'object' ? props.next : void 0"
236
- :class="ui.next({ class: props.ui?.next })"
237
- data-part="next"
238
- @click="scrollNext"
239
- />
240
- </div>
241
-
242
- <div v-if="props.dots" role="tablist" :aria-label="t('carousel.dots')" :class="ui.dots({ class: props.ui?.dots })" data-part="dots">
243
- <template v-for="(_, index) in scrollSnaps" :key="index">
244
- <button
245
- type="button"
246
- role="tab"
247
- :aria-label="t('carousel.goto', { page: index + 1 })"
248
- :aria-selected="selectedIndex === index"
249
- :class="ui.dot({ class: props.ui?.dot, active: selectedIndex === index })"
250
- data-part="dot"
251
- :data-state="selectedIndex === index ? 'active' : void 0"
252
- @click="scrollTo(index)"
253
- ></button>
254
- </template>
255
- </div>
256
- </div>
257
- </Primitive>
192
+ <Primitive
193
+ :as="props.as"
194
+ role="region"
195
+ tabindex="0"
196
+ :class="ui.root({ class: [props.class, props.ui?.root] })"
197
+ aria-roledescription="carousel"
198
+ :data-orientation="props.orientation"
199
+ data-part="root"
200
+ @keydown="onKeyDown"
201
+ >
202
+ <div ref="emblaRef" :class="ui.viewport({ class: props.ui?.viewport })" data-part="viewport">
203
+ <div :class="ui.container({ class: props.ui?.container })" data-part="container">
204
+ <div
205
+ v-for="(item, index) in props.items"
206
+ :key="index"
207
+ v-bind="props.dots ? { role: 'tabpanel' } : { 'role': 'group', 'aria-roledescription': 'slide' }"
208
+ :class="ui.item({ class: [props.ui?.item, ...isCarouselItem(item) ? [item.ui?.item, item.class] : []] })"
209
+ data-part="item"
210
+ >
211
+ <slot :item="item" :index="index"></slot>
212
+ </div>
213
+ </div>
214
+ </div>
215
+
216
+ <div v-if="props.arrows || props.dots" :class="ui.controls({ class: props.ui?.controls })" data-part="controls">
217
+ <div v-if="props.arrows" :class="ui.arrows({ class: props.ui?.arrows })" data-part="arrows">
218
+ <Button
219
+ :disabled="!canScrollPrev"
220
+ :icon="prevIcon"
221
+ color="neutral"
222
+ variant="outline"
223
+ :aria-label="t('carousel.prev')"
224
+ v-bind="typeof props.prev === 'object' ? props.prev : void 0"
225
+ :class="ui.prev({ class: props.ui?.prev })"
226
+ data-part="prev"
227
+ @click="scrollPrev"
228
+ />
229
+ <Button
230
+ :disabled="!canScrollNext"
231
+ :icon="nextIcon"
232
+ color="neutral"
233
+ variant="outline"
234
+ :aria-label="t('carousel.next')"
235
+ v-bind="typeof props.next === 'object' ? props.next : void 0"
236
+ :class="ui.next({ class: props.ui?.next })"
237
+ data-part="next"
238
+ @click="scrollNext"
239
+ />
240
+ </div>
241
+
242
+ <div v-if="props.dots" role="tablist" :aria-label="t('carousel.dots')" :class="ui.dots({ class: props.ui?.dots })" data-part="dots">
243
+ <template v-for="(_, index) in scrollSnaps" :key="index">
244
+ <button
245
+ type="button"
246
+ role="tab"
247
+ :aria-label="t('carousel.goto', { page: index + 1 })"
248
+ :aria-selected="selectedIndex === index"
249
+ :class="ui.dot({ class: props.ui?.dot, active: selectedIndex === index })"
250
+ data-part="dot"
251
+ :data-state="selectedIndex === index ? 'active' : void 0"
252
+ @click="scrollTo(index)"
253
+ ></button>
254
+ </template>
255
+ </div>
256
+ </div>
257
+ </Primitive>
258
258
  </template>
@@ -8,7 +8,7 @@ import type { FadeOptionsType } from 'embla-carousel-fade';
8
8
  import type { WheelGesturesPluginOptions } from 'embla-carousel-wheel-gestures';
9
9
  import type { PrimitiveProps } from 'reka-ui';
10
10
  import theme from '#build/ui/carousel';
11
- import type { ButtonProps, ComponentBaseProps, ComponentUIProps } from '../types';
11
+ import type { ButtonProps, ComponentBaseProps, ComponentUIProps, LinkPropsKeys } from '../types';
12
12
  import type { AcceptableValue, StaticSlot } from '../types/utils';
13
13
  export type CarouselValue = AcceptableValue;
14
14
  export type CarouselItem = AcceptableValue | {
@@ -27,7 +27,7 @@ export interface CarouselProps<T extends CarouselItem = CarouselItem> extends Co
27
27
  * Configure the prev button when arrows are enabled.
28
28
  * @default { size: 'md', variant: 'link' }
29
29
  */
30
- prev?: ButtonProps;
30
+ prev?: Omit<ButtonProps, LinkPropsKeys>;
31
31
  /**
32
32
  * The icon displayed in the prev button.
33
33
  * @default app.icons.chevronLeft
@@ -37,7 +37,7 @@ export interface CarouselProps<T extends CarouselItem = CarouselItem> extends Co
37
37
  * Configure the next button when arrows are enabled.
38
38
  * @default { size: 'md', variant: 'link' }
39
39
  */
40
- next?: ButtonProps;
40
+ next?: Omit<ButtonProps, LinkPropsKeys>;
41
41
  /**
42
42
  * The icon displayed in the next button.
43
43
  * @default app.icons.chevronRight
@@ -104,10 +104,14 @@ export interface CarouselSlots<T extends CarouselItem = CarouselItem> {
104
104
  index: number;
105
105
  }>;
106
106
  }
107
- declare const __VLS_export: <T extends CarouselItem>(__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<{
108
- props: __VLS_PrettifyLocal<CarouselProps<T> & {
107
+ declare const _default: typeof __VLS_export;
108
+ export default _default;
109
+ declare const __VLS_export: <T extends CarouselItem>(__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<{
110
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<CarouselProps<T> & {
109
111
  onSelect?: ((selectedIndex: number) => any) | undefined;
110
- }> & import("vue").PublicProps;
112
+ }> & (typeof globalThis extends {
113
+ __VLS_PROPS_FALLBACK: infer P;
114
+ } ? P : {});
111
115
  expose: (exposed: import("vue").ShallowUnwrapRef<{
112
116
  emblaRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
113
117
  emblaApi: import("vue").Ref<EmblaCarouselType | undefined, EmblaCarouselType | undefined>;
@@ -118,8 +122,8 @@ declare const __VLS_export: <T extends CarouselItem>(__VLS_props: NonNullable<Aw
118
122
  }>) => import("vue").VNode & {
119
123
  __ctx?: Awaited<typeof __VLS_setup>;
120
124
  };
121
- declare const _default: typeof __VLS_export;
122
- export default _default;
123
- type __VLS_PrettifyLocal<T> = {
125
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
126
+ [K in keyof T]: T[K];
127
+ } : {
124
128
  [K in keyof T as K]: T[K];
125
- } & {};
129
+ }) & {};
@@ -55,50 +55,50 @@ function onUpdate(value) {
55
55
  </script>
56
56
 
57
57
  <template>
58
- <Primitive :as="props.variant && props.variant !== 'list' ? Label : props.as" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
59
- <div :class="ui.container({ class: props.ui?.container })" data-part="container">
60
- <CheckboxRoot
61
- v-bind="{ id, ...rootProps, ...$attrs, ...ariaAttrs, name, disabled }"
62
- v-model="modelValue"
63
- :class="ui.base({ class: props.ui?.base })"
64
- data-part="base"
65
- @update:model-value="onUpdate"
66
- >
67
- <template #default="{ modelValue }">
68
- <CheckboxIndicator :class="ui.indicator({ class: props.ui?.indicator })" data-part="indicator">
69
- <Icon
70
- v-if="modelValue === 'indeterminate'"
71
- :name="props.indeterminateIcon || appConfig.ui.icons.minus"
72
- :class="ui.icon({ class: props.ui?.icon })"
73
- data-part="icon"
74
- />
75
- <Icon
76
- v-else
77
- :name="props.icon || appConfig.ui.icons.check"
78
- :class="ui.icon({ class: props.ui?.icon })"
79
- data-part="icon"
80
- />
81
- </CheckboxIndicator>
82
- </template>
83
- </CheckboxRoot>
84
- </div>
85
- <div v-if="props.label || !!slots.label || props.description || !!slots.description" :class="ui.wrapper({ class: props.ui?.wrapper })" data-part="wrapper">
86
- <component
87
- :is="!props.variant || props.variant === 'list' ? Label : 'p'"
88
- v-if="props.label || !!slots.label"
89
- :for="id"
90
- :class="ui.label({ class: props.ui?.label })"
91
- data-part="label"
92
- >
93
- <slot name="label" :label="props.label">
94
- {{ props.label }}
95
- </slot>
96
- </component>
97
- <p v-if="props.description || !!slots.description" :class="ui.description({ class: props.ui?.description })" data-part="description">
98
- <slot name="description" :description="props.description">
99
- {{ props.description }}
100
- </slot>
101
- </p>
102
- </div>
103
- </Primitive>
58
+ <Primitive :as="props.variant && props.variant !== 'list' ? Label : props.as" :class="ui.root({ class: [props.ui?.root, props.class] })" data-part="root">
59
+ <div :class="ui.container({ class: props.ui?.container })" data-part="container">
60
+ <CheckboxRoot
61
+ v-bind="{ id, ...rootProps, ...$attrs, ...ariaAttrs, name, disabled }"
62
+ v-model="modelValue"
63
+ :class="ui.base({ class: props.ui?.base })"
64
+ data-part="base"
65
+ @update:model-value="onUpdate"
66
+ >
67
+ <template #default="{ modelValue }">
68
+ <CheckboxIndicator :class="ui.indicator({ class: props.ui?.indicator })" data-part="indicator">
69
+ <Icon
70
+ v-if="modelValue === 'indeterminate'"
71
+ :name="props.indeterminateIcon || appConfig.ui.icons.minus"
72
+ :class="ui.icon({ class: props.ui?.icon })"
73
+ data-part="icon"
74
+ />
75
+ <Icon
76
+ v-else
77
+ :name="props.icon || appConfig.ui.icons.check"
78
+ :class="ui.icon({ class: props.ui?.icon })"
79
+ data-part="icon"
80
+ />
81
+ </CheckboxIndicator>
82
+ </template>
83
+ </CheckboxRoot>
84
+ </div>
85
+ <div v-if="props.label || !!slots.label || props.description || !!slots.description" :class="ui.wrapper({ class: props.ui?.wrapper })" data-part="wrapper">
86
+ <component
87
+ :is="!props.variant || props.variant === 'list' ? Label : 'p'"
88
+ v-if="props.label || !!slots.label"
89
+ :for="id"
90
+ :class="ui.label({ class: props.ui?.label })"
91
+ data-part="label"
92
+ >
93
+ <slot name="label" :label="props.label">
94
+ {{ props.label }}
95
+ </slot>
96
+ </component>
97
+ <p v-if="props.description || !!slots.description" :class="ui.description({ class: props.ui?.description })" data-part="description">
98
+ <slot name="description" :description="props.description">
99
+ {{ props.description }}
100
+ </slot>
101
+ </p>
102
+ </div>
103
+ </Primitive>
104
104
  </template>
@@ -2,9 +2,10 @@ import type { VariantProps } from '@byyuurin/ui-kit';
2
2
  import type { CheckboxRootEmits, CheckboxRootProps, PrimitiveProps } from 'reka-ui';
3
3
  import theme from '#build/ui/checkbox';
4
4
  import type { ComponentBaseProps, ComponentUIProps, IconProps } from '../types';
5
+ import type { ButtonHTMLAttributes } from '../types/html';
5
6
  import type { StaticSlot } from '../types/utils';
6
7
  type ThemeVariants = VariantProps<typeof theme>;
7
- export interface CheckboxProps extends ComponentBaseProps, Pick<CheckboxRootProps, 'disabled' | 'required' | 'name' | 'value' | 'id' | 'defaultValue'> {
8
+ export interface CheckboxProps extends ComponentBaseProps, Pick<CheckboxRootProps, 'disabled' | 'required' | 'name' | 'value' | 'id' | 'defaultValue'>, /** @vue-ignore */ Omit<ButtonHTMLAttributes, 'type' | 'disabled' | 'value' | 'name'> {
8
9
  /**
9
10
  * The element or component this component should render as.
10
11
  * @default "div"
@@ -44,6 +45,8 @@ export interface CheckboxSlots {
44
45
  description?: string;
45
46
  }>;
46
47
  }
48
+ declare const _default: typeof __VLS_export;
49
+ export default _default;
47
50
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CheckboxProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
48
51
  change: (event: Event) => any;
49
52
  "update:modelValue": (value: boolean | "indeterminate") => any;
@@ -54,8 +57,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Checkb
54
57
  disabled: boolean;
55
58
  required: boolean;
56
59
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, CheckboxSlots>;
57
- declare const _default: typeof __VLS_export;
58
- export default _default;
59
60
  type __VLS_WithSlots<T, S> = T & {
60
61
  new (): {
61
62
  $slots: S;
@@ -99,33 +99,33 @@ const ui = computed(() => {
99
99
  </script>
100
100
 
101
101
  <template>
102
- <CheckboxGroupRoot
103
- v-bind="{ ...rootProps, id, name, disabled }"
104
- :class="ui.root({ class: [props.ui?.root, props.class] })"
105
- data-part="root"
106
- @update:model-value="onUpdate"
107
- >
108
- <fieldset v-bind="ariaAttrs" :class="ui.fieldset({ class: props.ui?.fieldset })" data-part="fieldset">
109
- <legend v-if="props.legend || !!slots.legend" :class="ui.legend({ class: props.ui?.legend })" data-part="legend">
110
- <slot name="legend">
111
- {{ props.legend }}
112
- </slot>
113
- </legend>
114
-
115
- <Checkbox
116
- v-for="item in normalizedItems"
117
- :key="item.id"
118
- v-bind="{ ...item, ...checkboxProps, color, size, name }"
119
- :variant="props.variant"
120
- :disabled="item.disabled || disabled"
121
- :ui="{ ...props.ui ? omit(props.ui, ['root']) : void 0, ...item.ui || {} }"
122
- :class="ui.item({ disabled: item.disabled || disabled, class: [props.ui?.item, item.ui?.item, item.class] })"
123
- data-part="item"
124
- >
125
- <template v-for="(_, name) in getProxySlots()" #[name]>
126
- <slot :name="name" :item="item"></slot>
127
- </template>
128
- </Checkbox>
129
- </fieldset>
130
- </CheckboxGroupRoot>
102
+ <CheckboxGroupRoot
103
+ v-bind="{ ...rootProps, id, name, disabled }"
104
+ :class="ui.root({ class: [props.ui?.root, props.class] })"
105
+ data-part="root"
106
+ @update:model-value="onUpdate"
107
+ >
108
+ <fieldset v-bind="ariaAttrs" :class="ui.fieldset({ class: props.ui?.fieldset })" data-part="fieldset">
109
+ <legend v-if="props.legend || !!slots.legend" :class="ui.legend({ class: props.ui?.legend })" data-part="legend">
110
+ <slot name="legend">
111
+ {{ props.legend }}
112
+ </slot>
113
+ </legend>
114
+
115
+ <Checkbox
116
+ v-for="item in normalizedItems"
117
+ :key="item.id"
118
+ v-bind="{ ...item, ...checkboxProps, color, size, name }"
119
+ :variant="props.variant"
120
+ :disabled="item.disabled || disabled"
121
+ :ui="{ ...props.ui ? omit(props.ui, ['root']) : void 0, ...item.ui || {} }"
122
+ :class="ui.item({ disabled: item.disabled || disabled, class: [props.ui?.item, item.ui?.item, item.class] })"
123
+ data-part="item"
124
+ >
125
+ <template v-for="(_, name) in getProxySlots()" #[name]>
126
+ <slot :name="name" :item="item"></slot>
127
+ </template>
128
+ </Checkbox>
129
+ </fieldset>
130
+ </CheckboxGroupRoot>
131
131
  </template>
@@ -70,11 +70,15 @@ export interface CheckboxGroupSlots<T extends CheckboxGroupItem[] = CheckboxGrou
70
70
  };
71
71
  }>;
72
72
  }
73
- declare const __VLS_export: <T extends CheckboxGroupItem[], VK extends GetItemKeys<T> = "value">(__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<{
74
- props: __VLS_PrettifyLocal<CheckboxGroupProps<T, VK> & {
73
+ declare const _default: typeof __VLS_export;
74
+ export default _default;
75
+ declare const __VLS_export: <T extends CheckboxGroupItem[], VK extends GetItemKeys<T> = "value">(__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<{
76
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<CheckboxGroupProps<T, VK> & {
75
77
  onChange?: ((event: Event) => any) | undefined;
76
78
  "onUpdate:modelValue"?: ((value: T[number][]) => any) | undefined;
77
- }> & import("vue").PublicProps;
79
+ }> & (typeof globalThis extends {
80
+ __VLS_PROPS_FALLBACK: infer P;
81
+ } ? P : {});
78
82
  expose: (exposed: {}) => void;
79
83
  attrs: any;
80
84
  slots: CheckboxGroupSlots<CheckboxGroupItem[]>;
@@ -82,8 +86,8 @@ declare const __VLS_export: <T extends CheckboxGroupItem[], VK extends GetItemKe
82
86
  }>) => import("vue").VNode & {
83
87
  __ctx?: Awaited<typeof __VLS_setup>;
84
88
  };
85
- declare const _default: typeof __VLS_export;
86
- export default _default;
87
- type __VLS_PrettifyLocal<T> = {
89
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
90
+ [K in keyof T]: T[K];
91
+ } : {
88
92
  [K in keyof T as K]: T[K];
89
- } & {};
93
+ }) & {};
@@ -34,19 +34,19 @@ const ui = computed(() => {
34
34
  </script>
35
35
 
36
36
  <template>
37
- <Primitive
38
- :as="props.as"
39
- :class="ui.root({ class: [props.ui?.root, props.class] })"
40
- data-part="root"
41
- >
42
- <Slot v-bind="$attrs">
43
- <slot></slot>
44
- </Slot>
45
-
46
- <span v-if="show" :class="ui.base({ class: props.ui?.base })" data-part="base">
47
- <slot name="content">
48
- {{ props.text }}
49
- </slot>
50
- </span>
51
- </Primitive>
37
+ <Primitive
38
+ :as="props.as"
39
+ :class="ui.root({ class: [props.ui?.root, props.class] })"
40
+ data-part="root"
41
+ >
42
+ <Slot v-bind="$attrs">
43
+ <slot></slot>
44
+ </Slot>
45
+
46
+ <span v-if="show" :class="ui.base({ class: props.ui?.base })" data-part="base">
47
+ <slot name="content">
48
+ {{ props.text }}
49
+ </slot>
50
+ </span>
51
+ </Primitive>
52
52
  </template>
@@ -32,6 +32,8 @@ export interface ChipSlots {
32
32
  default: StaticSlot;
33
33
  content: StaticSlot;
34
34
  }
35
+ declare const _default: typeof __VLS_export;
36
+ export default _default;
35
37
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ChipProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
36
38
  "update:show": (show: boolean) => any;
37
39
  }, string, import("vue").PublicProps, Readonly<ChipProps> & Readonly<{
@@ -39,8 +41,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ChipPr
39
41
  }>, {
40
42
  show: boolean;
41
43
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ChipSlots>;
42
- declare const _default: typeof __VLS_export;
43
- export default _default;
44
44
  type __VLS_WithSlots<T, S> = T & {
45
45
  new (): {
46
46
  $slots: S;
@@ -28,20 +28,20 @@ const ui = computed(() => {
28
28
  </script>
29
29
 
30
30
  <template>
31
- <CollapsibleRoot
32
- v-slot="{ open }"
33
- v-bind="rootProps"
34
- :class="ui.root({ class: [props.ui?.root, props.class] })"
35
- data-part="root"
36
- >
37
- <CollapsibleTrigger v-if="!!slots.default" as-child>
38
- <slot :open="open"></slot>
39
- </CollapsibleTrigger>
40
-
41
- <CollapsibleContent :class="ui.content({ class: props.ui?.content })" data-part="content">
42
- <slot name="content"></slot>
43
- </CollapsibleContent>
44
- </CollapsibleRoot>
31
+ <CollapsibleRoot
32
+ v-slot="{ open }"
33
+ v-bind="rootProps"
34
+ :class="ui.root({ class: [props.ui?.root, props.class] })"
35
+ data-part="root"
36
+ >
37
+ <CollapsibleTrigger v-if="!!slots.default" as-child>
38
+ <slot :open="open"></slot>
39
+ </CollapsibleTrigger>
40
+
41
+ <CollapsibleContent :class="ui.content({ class: props.ui?.content })" data-part="content">
42
+ <slot name="content"></slot>
43
+ </CollapsibleContent>
44
+ </CollapsibleRoot>
45
45
  </template>
46
46
 
47
47
  <style>
@@ -18,6 +18,8 @@ export interface CollapsibleSlots {
18
18
  }>;
19
19
  content: StaticSlot;
20
20
  }
21
+ declare const _default: typeof __VLS_export;
22
+ export default _default;
21
23
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CollapsibleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
22
24
  "update:open": (value: boolean) => any;
23
25
  }, string, import("vue").PublicProps, Readonly<CollapsibleProps> & Readonly<{
@@ -25,8 +27,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Collap
25
27
  }>, {
26
28
  unmountOnHide: boolean;
27
29
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, CollapsibleSlots>;
28
- declare const _default: typeof __VLS_export;
29
- export default _default;
30
30
  type __VLS_WithSlots<T, S> = T & {
31
31
  new (): {
32
32
  $slots: S;