@byyuurin/ui 0.0.10 → 0.0.11

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 (194) hide show
  1. package/README.md +2 -2
  2. package/dist/module.json +3 -3
  3. package/dist/module.mjs +1 -1
  4. package/dist/module.mjs.map +1 -1
  5. package/dist/runtime/app/injections.d.ts +388 -364
  6. package/dist/runtime/components/Accordion.vue +38 -67
  7. package/dist/runtime/components/Accordion.vue.d.ts +52 -0
  8. package/dist/runtime/components/Alert.vue +37 -75
  9. package/dist/runtime/components/Alert.vue.d.ts +59 -0
  10. package/dist/runtime/components/App.vue +25 -40
  11. package/dist/runtime/components/App.vue.d.ts +24 -0
  12. package/dist/runtime/components/Avatar.vue +31 -51
  13. package/dist/runtime/components/Avatar.vue.d.ts +25 -0
  14. package/dist/runtime/components/AvatarGroup.vue +38 -69
  15. package/dist/runtime/components/AvatarGroup.vue.d.ts +27 -0
  16. package/dist/runtime/components/Badge.vue +25 -51
  17. package/dist/runtime/components/Badge.vue.d.ts +44 -0
  18. package/dist/runtime/components/Breadcrumb.vue +36 -74
  19. package/dist/runtime/components/Breadcrumb.vue.d.ts +52 -0
  20. package/dist/runtime/components/Button.vue +62 -51
  21. package/dist/runtime/components/Button.vue.d.ts +29 -0
  22. package/dist/runtime/components/ButtonGroup.vue +17 -37
  23. package/dist/runtime/components/ButtonGroup.vue.d.ts +26 -0
  24. package/dist/runtime/components/Calendar.vue +75 -110
  25. package/dist/runtime/components/Calendar.vue.d.ts +75 -0
  26. package/dist/runtime/components/Card.vue +25 -42
  27. package/dist/runtime/components/Card.vue.d.ts +30 -0
  28. package/dist/runtime/components/Carousel.vue +118 -225
  29. package/dist/runtime/components/Carousel.vue.d.ts +104 -0
  30. package/dist/runtime/components/Checkbox.vue +46 -73
  31. package/dist/runtime/components/Checkbox.vue.d.ts +56 -0
  32. package/dist/runtime/components/Chip.vue +31 -48
  33. package/dist/runtime/components/Chip.vue.d.ts +30 -0
  34. package/dist/runtime/components/Collapsible.vue +22 -30
  35. package/dist/runtime/components/Collapsible.vue.d.ts +26 -0
  36. package/dist/runtime/components/Drawer.vue +51 -101
  37. package/dist/runtime/components/Drawer.vue.d.ts +80 -0
  38. package/dist/runtime/components/DropdownMenu.vue +37 -115
  39. package/dist/runtime/components/DropdownMenu.vue.d.ts +99 -0
  40. package/dist/runtime/components/DropdownMenuContent.vue +81 -77
  41. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +39 -0
  42. package/dist/runtime/components/Form.vue +140 -254
  43. package/dist/runtime/components/Form.vue.d.ts +78 -0
  44. package/dist/runtime/components/FormItem.vue +50 -89
  45. package/dist/runtime/components/FormItem.vue.d.ts +60 -0
  46. package/dist/runtime/components/Input.vue +79 -115
  47. package/dist/runtime/components/Input.vue.d.ts +64 -0
  48. package/dist/runtime/components/InputNumber.vue +74 -117
  49. package/dist/runtime/components/InputNumber.vue.d.ts +245 -0
  50. package/dist/runtime/components/Kbd.vue +18 -39
  51. package/dist/runtime/components/Kbd.vue.d.ts +28 -0
  52. package/dist/runtime/components/Link.vue +168 -257
  53. package/dist/runtime/components/Link.vue.d.ts +95 -0
  54. package/dist/runtime/components/LinkBase.vue +36 -54
  55. package/dist/runtime/components/LinkBase.vue.d.ts +28 -0
  56. package/dist/runtime/components/Modal.vue +49 -84
  57. package/dist/runtime/components/Modal.vue.d.ts +66 -0
  58. package/dist/runtime/components/OverlayProvider.vue +10 -14
  59. package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -0
  60. package/dist/runtime/components/Pagination.vue +55 -121
  61. package/dist/runtime/components/Pagination.vue.d.ts +93 -0
  62. package/dist/runtime/components/PinInput.vue +49 -58
  63. package/dist/runtime/components/PinInput.vue.d.ts +35 -0
  64. package/dist/runtime/components/Popover.vue +39 -68
  65. package/dist/runtime/components/Popover.vue.d.ts +45 -0
  66. package/dist/runtime/components/Progress.vue +68 -120
  67. package/dist/runtime/components/Progress.vue.d.ts +54 -0
  68. package/dist/runtime/components/RadioGroup.vue +67 -125
  69. package/dist/runtime/components/RadioGroup.vue.d.ts +74 -0
  70. package/dist/runtime/components/ScrollArea.vue +31 -31
  71. package/dist/runtime/components/ScrollArea.vue.d.ts +17 -0
  72. package/dist/runtime/components/Select.vue +114 -204
  73. package/dist/runtime/components/Select.vue.d.ts +119 -0
  74. package/dist/runtime/components/Separator.vue +26 -44
  75. package/dist/runtime/components/Separator.vue.d.ts +27 -0
  76. package/dist/runtime/components/Skeleton.vue +12 -21
  77. package/dist/runtime/components/Skeleton.vue.d.ts +19 -0
  78. package/dist/runtime/components/Slider.vue +52 -74
  79. package/dist/runtime/components/Slider.vue.d.ts +36 -0
  80. package/dist/runtime/components/Switch.vue +51 -71
  81. package/dist/runtime/components/Switch.vue.d.ts +49 -0
  82. package/dist/runtime/components/Table.vue +108 -194
  83. package/dist/runtime/components/Table.vue.d.ts +148 -0
  84. package/dist/runtime/components/Tabs.vue +36 -81
  85. package/dist/runtime/components/Tabs.vue.d.ts +65 -0
  86. package/dist/runtime/components/Textarea.vue +77 -124
  87. package/dist/runtime/components/Textarea.vue.d.ts +60 -0
  88. package/dist/runtime/components/Toast.vue +47 -75
  89. package/dist/runtime/components/Toast.vue.d.ts +131 -0
  90. package/dist/runtime/components/ToastProvider.vue +65 -101
  91. package/dist/runtime/components/ToastProvider.vue.d.ts +38 -0
  92. package/dist/runtime/components/Tooltip.vue +36 -47
  93. package/dist/runtime/components/Tooltip.vue.d.ts +31 -0
  94. package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
  95. package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
  96. package/dist/runtime/composables/useFormItem.d.ts +2 -2
  97. package/dist/runtime/composables/useKbd.d.ts +1 -1
  98. package/dist/runtime/composables/useLocale.d.ts +3 -3
  99. package/dist/runtime/composables/useTheme.d.ts +1 -1
  100. package/dist/runtime/composables/useToast.d.ts +1 -1
  101. package/dist/runtime/locale/en.d.ts +1 -1
  102. package/dist/runtime/locale/zh-tw.d.ts +1 -1
  103. package/dist/runtime/theme/accordion.d.ts +45 -51
  104. package/dist/runtime/theme/accordion.js +1 -1
  105. package/dist/runtime/theme/alert.d.ts +115 -121
  106. package/dist/runtime/theme/alert.js +1 -1
  107. package/dist/runtime/theme/avatar-group.d.ts +42 -48
  108. package/dist/runtime/theme/avatar-group.js +1 -1
  109. package/dist/runtime/theme/avatar.d.ts +46 -52
  110. package/dist/runtime/theme/avatar.js +1 -1
  111. package/dist/runtime/theme/badge.d.ts +60 -66
  112. package/dist/runtime/theme/badge.js +1 -1
  113. package/dist/runtime/theme/breadcrumb.d.ts +52 -58
  114. package/dist/runtime/theme/breadcrumb.js +1 -1
  115. package/dist/runtime/theme/button-group.d.ts +36 -42
  116. package/dist/runtime/theme/button.d.ts +162 -168
  117. package/dist/runtime/theme/button.js +1 -1
  118. package/dist/runtime/theme/calendar.d.ts +52 -50
  119. package/dist/runtime/theme/calendar.js +20 -3
  120. package/dist/runtime/theme/card.d.ts +52 -58
  121. package/dist/runtime/theme/card.js +1 -1
  122. package/dist/runtime/theme/carousel.d.ts +98 -104
  123. package/dist/runtime/theme/carousel.js +1 -1
  124. package/dist/runtime/theme/checkbox.d.ts +77 -83
  125. package/dist/runtime/theme/checkbox.js +1 -1
  126. package/dist/runtime/theme/chip.d.ts +50 -56
  127. package/dist/runtime/theme/chip.js +1 -1
  128. package/dist/runtime/theme/collapsible.d.ts +29 -35
  129. package/dist/runtime/theme/collapsible.js +1 -1
  130. package/dist/runtime/theme/drawer.d.ts +120 -126
  131. package/dist/runtime/theme/drawer.js +1 -1
  132. package/dist/runtime/theme/dropdown-menu.d.ts +55 -61
  133. package/dist/runtime/theme/dropdown-menu.js +1 -1
  134. package/dist/runtime/theme/form-item.d.ts +63 -69
  135. package/dist/runtime/theme/form-item.js +1 -1
  136. package/dist/runtime/theme/form.d.ts +1 -7
  137. package/dist/runtime/theme/input-number.d.ts +98 -104
  138. package/dist/runtime/theme/input-number.js +1 -1
  139. package/dist/runtime/theme/input.d.ts +153 -159
  140. package/dist/runtime/theme/input.js +1 -1
  141. package/dist/runtime/theme/kbd.d.ts +30 -36
  142. package/dist/runtime/theme/link.d.ts +37 -43
  143. package/dist/runtime/theme/modal.d.ts +36 -42
  144. package/dist/runtime/theme/modal.js +1 -1
  145. package/dist/runtime/theme/pagination.d.ts +71 -77
  146. package/dist/runtime/theme/pagination.js +1 -1
  147. package/dist/runtime/theme/pinInput.d.ts +80 -86
  148. package/dist/runtime/theme/pinInput.js +1 -1
  149. package/dist/runtime/theme/popover.d.ts +29 -35
  150. package/dist/runtime/theme/popover.js +1 -1
  151. package/dist/runtime/theme/progress.d.ts +163 -169
  152. package/dist/runtime/theme/progress.js +1 -1
  153. package/dist/runtime/theme/radio-group.d.ts +99 -105
  154. package/dist/runtime/theme/radio-group.js +1 -1
  155. package/dist/runtime/theme/scroll-area.d.ts +62 -68
  156. package/dist/runtime/theme/scroll-area.js +1 -1
  157. package/dist/runtime/theme/select.d.ts +165 -171
  158. package/dist/runtime/theme/select.js +1 -1
  159. package/dist/runtime/theme/separator.d.ts +62 -68
  160. package/dist/runtime/theme/separator.js +1 -1
  161. package/dist/runtime/theme/skeleton.d.ts +1 -7
  162. package/dist/runtime/theme/slider.d.ts +62 -68
  163. package/dist/runtime/theme/slider.js +1 -1
  164. package/dist/runtime/theme/switch.d.ts +111 -117
  165. package/dist/runtime/theme/switch.js +1 -1
  166. package/dist/runtime/theme/table.d.ts +75 -81
  167. package/dist/runtime/theme/table.js +1 -1
  168. package/dist/runtime/theme/tabs.d.ts +114 -120
  169. package/dist/runtime/theme/tabs.js +1 -1
  170. package/dist/runtime/theme/textarea.d.ts +76 -82
  171. package/dist/runtime/theme/textarea.js +1 -1
  172. package/dist/runtime/theme/toast-provider.d.ts +106 -112
  173. package/dist/runtime/theme/toast-provider.js +1 -1
  174. package/dist/runtime/theme/toast.d.ts +74 -80
  175. package/dist/runtime/theme/toast.js +1 -1
  176. package/dist/runtime/theme/tooltip.d.ts +35 -41
  177. package/dist/runtime/theme/tooltip.js +1 -1
  178. package/dist/runtime/types/utils.d.ts +5 -5
  179. package/dist/runtime/utils/link.d.ts +3 -5
  180. package/dist/runtime/utils/styler.d.ts +2 -2
  181. package/dist/runtime/utils/styler.js +2 -2
  182. package/dist/shared/ui.D1BTWZFB.mjs +5 -0
  183. package/dist/shared/ui.D1BTWZFB.mjs.map +1 -0
  184. package/dist/types.d.mts +1 -1
  185. package/dist/unocss.mjs +5 -4
  186. package/dist/unocss.mjs.map +1 -1
  187. package/dist/unplugin.mjs +1 -1
  188. package/dist/unplugin.mjs.map +1 -1
  189. package/dist/vite.mjs +1 -1
  190. package/package.json +77 -75
  191. package/dist/module.cjs +0 -5
  192. package/dist/shared/ui.3e7fad19.mjs +0 -5
  193. package/dist/shared/ui.3e7fad19.mjs.map +0 -1
  194. package/dist/types.d.ts +0 -1
@@ -1,136 +1,92 @@
1
- <script lang="ts">
2
- import type { VariantProps } from '@byyuurin/ui-kit'
3
- import type { NumberFieldRootProps } from 'reka-ui'
4
- import type { inputNumber } from '../theme'
5
- import type { ButtonProps, ComponentAttrs } from '../types'
1
+ <script>
6
2
 
7
- export interface InputNumberEmits {
8
- 'update:modelValue': [payload: number]
9
- 'blur': [event: FocusEvent]
10
- 'change': [payload: Event]
11
- }
12
-
13
- export interface InputNumberSlots {
14
- increment?: (props?: {}) => any
15
- decrement?: (props?: {}) => any
16
- }
17
-
18
- type InputNumberVariants = VariantProps<typeof inputNumber>
19
-
20
- export interface InputNumberProps extends ComponentAttrs<typeof inputNumber>, Pick<NumberFieldRootProps, 'as' | 'modelValue' | 'defaultValue' | 'min' | 'max' | 'step' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions'> {
21
- /** The placeholder text when the input is empty. */
22
- placeholder?: string
23
- variant?: InputNumberVariants['variant']
24
- size?: InputNumberVariants['size']
25
- underline?: boolean
26
- /** Highlight the ring color like a focus state. */
27
- highlight?: boolean
28
- /**
29
- * The orientation of the input menu.
30
- * @default "horizontal"
31
- */
32
- orientation?: InputNumberVariants['orientation']
33
- /**
34
- * Configure the increment button. The `color` and `size` are inherited.
35
- * @default { variant: 'link' }
36
- */
37
- increment?: ButtonProps
38
- /**
39
- * The icon displayed to increment the value.
40
- * @default app.icons.plus
41
- */
42
- incrementIcon?: string
43
- /**
44
- * Configure the decrement button. The `color` and `size` are inherited.
45
- * @default { variant: 'link' }
46
- */
47
- decrement?: ButtonProps
48
- /**
49
- * The icon displayed to decrement the value.
50
- * @default app.icons.minus
51
- */
52
- decrementIcon?: string
53
- autofocus?: boolean
54
- autofocusDelay?: number
55
- /**
56
- * The locale to use for formatting and parsing numbers.
57
- */
58
- locale?: string
59
- }
60
3
  </script>
61
4
 
62
- <script setup lang="ts">
63
- import { reactivePick } from '@vueuse/core'
64
- import { NumberFieldDecrement, NumberFieldIncrement, NumberFieldInput, NumberFieldRoot, useForwardPropsEmits } from 'reka-ui'
65
- import { computed, onMounted, ref } from 'vue'
66
- import { useFormItem } from '../composables/useFormItem'
67
- import { useLocale } from '../composables/useLocale'
68
- import { useTheme } from '../composables/useTheme'
69
- import Button from './Button.vue'
70
-
5
+ <script setup>
6
+ import { reactivePick } from "@vueuse/core";
7
+ import { NumberFieldDecrement, NumberFieldIncrement, NumberFieldInput, NumberFieldRoot, useForwardPropsEmits } from "reka-ui";
8
+ import { computed, onMounted, ref } from "vue";
9
+ import { useFormItem } from "../composables/useFormItem";
10
+ import { useLocale } from "../composables/useLocale";
11
+ import { useTheme } from "../composables/useTheme";
12
+ import Button from "./Button.vue";
71
13
  defineOptions({
72
- inheritAttrs: false,
73
- })
74
-
75
- const props = withDefaults(defineProps<InputNumberProps>(), {
76
- orientation: 'horizontal',
77
- })
78
-
79
- const emit = defineEmits<InputNumberEmits>()
80
- defineSlots<InputNumberSlots>()
81
-
82
- const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'min', 'max', 'step', 'formatOptions'), emit)
83
-
84
- const inputRef = ref<InstanceType<typeof NumberFieldInput> | null>(null)
85
-
86
- const { t, code: codeLocale } = useLocale()
87
- const locale = computed(() => props.locale || codeLocale.value)
88
- const { id, name, size, highlight, disabled, ariaAttrs, emitFormBlur, emitFormFocus, emitFormInput, emitFormChange } = useFormItem<InputNumberProps>(props)
89
- const { theme, generateStyle } = useTheme()
90
- const incrementIcon = computed(() => props.incrementIcon || (props.orientation === 'horizontal' ? theme.value.app.icons.plus : theme.value.app.icons.chevronUp))
91
- const decrementIcon = computed(() => props.decrementIcon || (props.orientation === 'horizontal' ? theme.value.app.icons.minus : theme.value.app.icons.chevronDown))
92
-
93
- const style = computed(() => generateStyle('inputNumber', {
14
+ inheritAttrs: false
15
+ });
16
+ const props = defineProps({
17
+ placeholder: { type: String, required: false },
18
+ variant: { type: null, required: false },
19
+ size: { type: null, required: false },
20
+ underline: { type: Boolean, required: false },
21
+ highlight: { type: Boolean, required: false },
22
+ orientation: { type: null, required: false, default: "horizontal" },
23
+ increment: { type: Object, required: false },
24
+ incrementIcon: { type: String, required: false },
25
+ decrement: { type: Object, required: false },
26
+ decrementIcon: { type: String, required: false },
27
+ autofocus: { type: Boolean, required: false },
28
+ autofocusDelay: { type: Number, required: false },
29
+ locale: { type: String, required: false },
30
+ class: { type: null, required: false },
31
+ ui: { type: null, required: false },
32
+ as: { type: null, required: false },
33
+ modelValue: { type: [Number, null], required: false },
34
+ defaultValue: { type: Number, required: false },
35
+ min: { type: Number, required: false },
36
+ max: { type: Number, required: false },
37
+ step: { type: Number, required: false },
38
+ disabled: { type: Boolean, required: false },
39
+ required: { type: Boolean, required: false },
40
+ id: { type: String, required: false },
41
+ name: { type: String, required: false },
42
+ formatOptions: { type: null, required: false }
43
+ });
44
+ const emit = defineEmits(["update:modelValue", "blur", "change"]);
45
+ defineSlots();
46
+ const rootProps = useForwardPropsEmits(reactivePick(props, "as", "modelValue", "defaultValue", "min", "max", "step", "formatOptions"), emit);
47
+ const inputRef = ref(null);
48
+ const { t, code: codeLocale } = useLocale();
49
+ const locale = computed(() => props.locale || codeLocale.value);
50
+ const { id, name, size, highlight, disabled, ariaAttrs, emitFormBlur, emitFormFocus, emitFormInput, emitFormChange } = useFormItem(props);
51
+ const { theme, generateStyle } = useTheme();
52
+ const incrementIcon = computed(() => props.incrementIcon || (props.orientation === "horizontal" ? theme.value.app.icons.plus : theme.value.app.icons.chevronUp));
53
+ const decrementIcon = computed(() => props.decrementIcon || (props.orientation === "horizontal" ? theme.value.app.icons.minus : theme.value.app.icons.chevronDown));
54
+ const style = computed(() => generateStyle("inputNumber", {
94
55
  ...props,
95
56
  size: size.value,
96
- highlight: highlight.value,
97
- }))
98
-
57
+ highlight: highlight.value
58
+ }));
99
59
  onMounted(() => {
100
60
  setTimeout(() => {
101
- autoFocus()
102
- }, props.autofocusDelay)
103
- })
104
-
61
+ autoFocus();
62
+ }, props.autofocusDelay);
63
+ });
105
64
  defineExpose({
106
- inputRef,
107
- })
108
-
65
+ inputRef
66
+ });
109
67
  function autoFocus() {
110
68
  if (props.autofocus)
111
- inputRef.value?.$el?.focus()
69
+ inputRef.value?.$el?.focus();
112
70
  }
113
-
114
- function onUpdate(value: number) {
115
- // @ts-expect-error - 'target' does not exist in type 'EventInit'
116
- const event = new Event('change', { target: { value } })
117
- emit('change', event)
118
- emitFormChange()
119
- emitFormInput()
71
+ function onUpdate(value) {
72
+ const event = new Event("change", { target: { value } });
73
+ emit("change", event);
74
+ emitFormChange();
75
+ emitFormInput();
120
76
  }
121
-
122
- function onBlur(event: FocusEvent) {
123
- emit('blur', event)
124
- emitFormBlur()
77
+ function onBlur(event) {
78
+ emit("blur", event);
79
+ emitFormBlur();
125
80
  }
126
81
  </script>
127
82
 
128
83
  <template>
129
84
  <NumberFieldRoot
130
85
  v-bind="{ ...rootProps, id, name, disabled }"
131
- :class="style.base({ class: [props.class, props.ui?.base] })"
132
86
  :locale="locale"
133
- :aria-disabled="disabled ? true : undefined"
87
+ :aria-disabled="disabled ? true : void 0"
88
+ :class="style.base({ class: [props.class, props.ui?.base] })"
89
+ :data-part="$attrs['data-part'] ?? 'base'"
134
90
  @update:model-value="onUpdate"
135
91
  >
136
92
  <NumberFieldInput
@@ -139,11 +95,12 @@ function onBlur(event: FocusEvent) {
139
95
  :placeholder="props.placeholder"
140
96
  :required="props.required"
141
97
  :class="style.input({ class: props.ui?.input })"
98
+ data-part="input"
142
99
  @blur="onBlur"
143
100
  @focus="emitFormFocus"
144
101
  />
145
102
 
146
- <div :class="style.increment({ class: props.ui?.increment })">
103
+ <div :class="style.increment({ class: props.ui?.increment })" data-part="increment">
147
104
  <NumberFieldIncrement as-child :disabled="disabled">
148
105
  <slot name="increment">
149
106
  <Button
@@ -151,13 +108,13 @@ function onBlur(event: FocusEvent) {
151
108
  :size="props.size"
152
109
  variant="link"
153
110
  :aria-label="t('inputNumber.increment')"
154
- v-bind="typeof props.increment === 'object' ? props.increment : undefined"
111
+ v-bind="typeof props.increment === 'object' ? props.increment : void 0"
155
112
  />
156
113
  </slot>
157
114
  </NumberFieldIncrement>
158
115
  </div>
159
116
 
160
- <div :class="style.decrement({ class: props.ui?.decrement })">
117
+ <div :class="style.decrement({ class: props.ui?.decrement })" data-part="decrement">
161
118
  <NumberFieldDecrement as-child :disabled="disabled">
162
119
  <slot name="decrement">
163
120
  <Button
@@ -165,7 +122,7 @@ function onBlur(event: FocusEvent) {
165
122
  :size="props.size"
166
123
  variant="link"
167
124
  :aria-label="t('inputNumber.decrement')"
168
- v-bind="typeof props.decrement === 'object' ? props.decrement : undefined"
125
+ v-bind="typeof props.decrement === 'object' ? props.decrement : void 0"
169
126
  />
170
127
  </slot>
171
128
  </NumberFieldDecrement>
@@ -0,0 +1,245 @@
1
+ import type { VariantProps } from '@byyuurin/ui-kit';
2
+ import type { NumberFieldRootProps } from 'reka-ui';
3
+ import type { inputNumber } from '../theme/index.js';
4
+ import type { ButtonProps, ComponentAttrs } from '../types/index.js';
5
+ export interface InputNumberEmits {
6
+ 'update:modelValue': [payload: number];
7
+ 'blur': [event: FocusEvent];
8
+ 'change': [payload: Event];
9
+ }
10
+ export interface InputNumberSlots {
11
+ increment?: (props?: {}) => any;
12
+ decrement?: (props?: {}) => any;
13
+ }
14
+ type InputNumberVariants = VariantProps<typeof inputNumber>;
15
+ export interface InputNumberProps extends ComponentAttrs<typeof inputNumber>, Pick<NumberFieldRootProps, 'as' | 'modelValue' | 'defaultValue' | 'min' | 'max' | 'step' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions'> {
16
+ /** The placeholder text when the input is empty. */
17
+ placeholder?: string;
18
+ variant?: InputNumberVariants['variant'];
19
+ size?: InputNumberVariants['size'];
20
+ underline?: boolean;
21
+ /** Highlight the ring color like a focus state. */
22
+ highlight?: boolean;
23
+ /**
24
+ * The orientation of the input menu.
25
+ * @default "horizontal"
26
+ */
27
+ orientation?: InputNumberVariants['orientation'];
28
+ /**
29
+ * Configure the increment button. The `color` and `size` are inherited.
30
+ * @default { variant: 'link' }
31
+ */
32
+ increment?: ButtonProps;
33
+ /**
34
+ * The icon displayed to increment the value.
35
+ * @default app.icons.plus
36
+ */
37
+ incrementIcon?: string;
38
+ /**
39
+ * Configure the decrement button. The `color` and `size` are inherited.
40
+ * @default { variant: 'link' }
41
+ */
42
+ decrement?: ButtonProps;
43
+ /**
44
+ * The icon displayed to decrement the value.
45
+ * @default app.icons.minus
46
+ */
47
+ decrementIcon?: string;
48
+ autofocus?: boolean;
49
+ autofocusDelay?: number;
50
+ /**
51
+ * The locale to use for formatting and parsing numbers.
52
+ */
53
+ locale?: string;
54
+ }
55
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<InputNumberProps, {
56
+ inputRef: import("vue").Ref<({
57
+ $: import("vue").ComponentInternalInstance;
58
+ $data: {};
59
+ $props: {
60
+ readonly asChild?: boolean | undefined;
61
+ readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
62
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
63
+ $attrs: {
64
+ [x: string]: unknown;
65
+ };
66
+ $refs: {
67
+ [x: string]: unknown;
68
+ } & {
69
+ primitiveElement: import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
70
+ asChild: {
71
+ type: BooleanConstructor;
72
+ default: boolean;
73
+ };
74
+ as: {
75
+ type: import("vue").PropType<import("reka-ui").AsTag | import("vue").Component>;
76
+ default: string;
77
+ };
78
+ }>> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
79
+ [key: string]: any;
80
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
81
+ asChild: boolean;
82
+ as: import("reka-ui").AsTag | import("vue").Component;
83
+ }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
84
+ P: {};
85
+ B: {};
86
+ D: {};
87
+ C: {};
88
+ M: {};
89
+ Defaults: {};
90
+ }, Readonly<import("vue").ExtractPropTypes<{
91
+ asChild: {
92
+ type: BooleanConstructor;
93
+ default: boolean;
94
+ };
95
+ as: {
96
+ type: import("vue").PropType<import("reka-ui").AsTag | import("vue").Component>;
97
+ default: string;
98
+ };
99
+ }>> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
100
+ [key: string]: any;
101
+ }>, {}, {}, {}, {
102
+ asChild: boolean;
103
+ as: import("reka-ui").AsTag | import("vue").Component;
104
+ }> | null;
105
+ };
106
+ $slots: Readonly<{
107
+ [name: string]: import("vue").Slot<any> | undefined;
108
+ }>;
109
+ $root: import("vue").ComponentPublicInstance | null;
110
+ $parent: import("vue").ComponentPublicInstance | null;
111
+ $host: Element | null;
112
+ $emit: (event: string, ...args: any[]) => void;
113
+ $el: any;
114
+ $options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").NumberFieldInputProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
115
+ as: import("reka-ui").AsTag | import("vue").Component;
116
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
117
+ beforeCreate?: (() => void) | (() => void)[];
118
+ created?: (() => void) | (() => void)[];
119
+ beforeMount?: (() => void) | (() => void)[];
120
+ mounted?: (() => void) | (() => void)[];
121
+ beforeUpdate?: (() => void) | (() => void)[];
122
+ updated?: (() => void) | (() => void)[];
123
+ activated?: (() => void) | (() => void)[];
124
+ deactivated?: (() => void) | (() => void)[];
125
+ beforeDestroy?: (() => void) | (() => void)[];
126
+ beforeUnmount?: (() => void) | (() => void)[];
127
+ destroyed?: (() => void) | (() => void)[];
128
+ unmounted?: (() => void) | (() => void)[];
129
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
130
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
131
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
132
+ };
133
+ $forceUpdate: () => void;
134
+ $nextTick: typeof import("vue").nextTick;
135
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
136
+ } & Readonly<{
137
+ as: import("reka-ui").AsTag | import("vue").Component;
138
+ }> & Omit<Readonly<import("reka-ui").NumberFieldInputProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
139
+ $slots: {
140
+ default?(_: {}): any;
141
+ };
142
+ }) | null, ({
143
+ $: import("vue").ComponentInternalInstance;
144
+ $data: {};
145
+ $props: {
146
+ readonly asChild?: boolean | undefined;
147
+ readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
148
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
149
+ $attrs: {
150
+ [x: string]: unknown;
151
+ };
152
+ $refs: {
153
+ [x: string]: unknown;
154
+ } & {
155
+ primitiveElement: import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
156
+ asChild: {
157
+ type: BooleanConstructor;
158
+ default: boolean;
159
+ };
160
+ as: {
161
+ type: import("vue").PropType<import("reka-ui").AsTag | import("vue").Component>;
162
+ default: string;
163
+ };
164
+ }>> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
165
+ [key: string]: any;
166
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
167
+ asChild: boolean;
168
+ as: import("reka-ui").AsTag | import("vue").Component;
169
+ }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
170
+ P: {};
171
+ B: {};
172
+ D: {};
173
+ C: {};
174
+ M: {};
175
+ Defaults: {};
176
+ }, Readonly<import("vue").ExtractPropTypes<{
177
+ asChild: {
178
+ type: BooleanConstructor;
179
+ default: boolean;
180
+ };
181
+ as: {
182
+ type: import("vue").PropType<import("reka-ui").AsTag | import("vue").Component>;
183
+ default: string;
184
+ };
185
+ }>> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
186
+ [key: string]: any;
187
+ }>, {}, {}, {}, {
188
+ asChild: boolean;
189
+ as: import("reka-ui").AsTag | import("vue").Component;
190
+ }> | null;
191
+ };
192
+ $slots: Readonly<{
193
+ [name: string]: import("vue").Slot<any> | undefined;
194
+ }>;
195
+ $root: import("vue").ComponentPublicInstance | null;
196
+ $parent: import("vue").ComponentPublicInstance | null;
197
+ $host: Element | null;
198
+ $emit: (event: string, ...args: any[]) => void;
199
+ $el: any;
200
+ $options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").NumberFieldInputProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
201
+ as: import("reka-ui").AsTag | import("vue").Component;
202
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
203
+ beforeCreate?: (() => void) | (() => void)[];
204
+ created?: (() => void) | (() => void)[];
205
+ beforeMount?: (() => void) | (() => void)[];
206
+ mounted?: (() => void) | (() => void)[];
207
+ beforeUpdate?: (() => void) | (() => void)[];
208
+ updated?: (() => void) | (() => void)[];
209
+ activated?: (() => void) | (() => void)[];
210
+ deactivated?: (() => void) | (() => void)[];
211
+ beforeDestroy?: (() => void) | (() => void)[];
212
+ beforeUnmount?: (() => void) | (() => void)[];
213
+ destroyed?: (() => void) | (() => void)[];
214
+ unmounted?: (() => void) | (() => void)[];
215
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
216
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
217
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
218
+ };
219
+ $forceUpdate: () => void;
220
+ $nextTick: typeof import("vue").nextTick;
221
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
222
+ } & Readonly<{
223
+ as: import("reka-ui").AsTag | import("vue").Component;
224
+ }> & Omit<Readonly<import("reka-ui").NumberFieldInputProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
225
+ $slots: {
226
+ default?(_: {}): any;
227
+ };
228
+ }) | null>;
229
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
230
+ blur: (event: FocusEvent) => any;
231
+ change: (payload: Event) => any;
232
+ "update:modelValue": (payload: number) => any;
233
+ }, string, import("vue").PublicProps, Readonly<InputNumberProps> & Readonly<{
234
+ onBlur?: ((event: FocusEvent) => any) | undefined;
235
+ onChange?: ((payload: Event) => any) | undefined;
236
+ "onUpdate:modelValue"?: ((payload: number) => any) | undefined;
237
+ }>, {
238
+ orientation: "horizontal" | "vertical";
239
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, InputNumberSlots>;
240
+ export default _default;
241
+ type __VLS_WithSlots<T, S> = T & {
242
+ new (): {
243
+ $slots: S;
244
+ };
245
+ };
@@ -1,47 +1,26 @@
1
- <script lang="ts">
2
- import type { VariantProps } from '@byyuurin/ui-kit'
3
- import type { PrimitiveProps } from 'reka-ui'
4
- import { computed } from 'vue'
5
- import type { KbdKey } from '../composables/useKbd'
6
- import type { kbd } from '../theme'
7
- import type { ComponentAttrs } from '../types'
8
-
9
- export interface KbdSlots {
10
- default?: (props?: {}) => any
11
- }
12
-
13
- type KbdVariants = VariantProps<typeof kbd>
14
-
15
- export interface KbdProps extends Omit<ComponentAttrs<typeof kbd>, 'ui'> {
16
- /**
17
- * The element or component this component should render as.
18
- * @default "kbd"
19
- */
20
- as?: PrimitiveProps['as']
21
- variant?: KbdVariants['variant']
22
- size?: KbdVariants['size']
23
- value?: KbdKey | (string & {})
24
- }
1
+ <script>
2
+ import { computed } from "vue";
25
3
  </script>
26
4
 
27
- <script setup lang="ts">
28
- import { Primitive } from 'reka-ui'
29
- import { useKbd } from '../composables/useKbd'
30
- import { useTheme } from '../composables/useTheme'
31
-
32
- const props = withDefaults(defineProps<KbdProps>(), {
33
- as: 'kbd',
34
- })
35
-
36
- defineSlots<KbdSlots>()
37
-
38
- const { getKbdKey } = useKbd()
39
- const { generateStyle } = useTheme()
40
- const style = computed(() => generateStyle('kbd', props))
5
+ <script setup>
6
+ import { Primitive } from "reka-ui";
7
+ import { useKbd } from "../composables/useKbd";
8
+ import { useTheme } from "../composables/useTheme";
9
+ const props = defineProps({
10
+ as: { type: null, required: false, default: "kbd" },
11
+ variant: { type: null, required: false },
12
+ size: { type: null, required: false },
13
+ value: { type: null, required: false },
14
+ class: { type: null, required: false }
15
+ });
16
+ defineSlots();
17
+ const { getKbdKey } = useKbd();
18
+ const { generateStyle } = useTheme();
19
+ const style = computed(() => generateStyle("kbd", props));
41
20
  </script>
42
21
 
43
22
  <template>
44
- <Primitive :as="props.as" :class="style">
23
+ <Primitive :as="props.as" :class="style.base()" data-part="base">
45
24
  <slot>{{ getKbdKey(props.value) }}</slot>
46
25
  </Primitive>
47
26
  </template>
@@ -0,0 +1,28 @@
1
+ import type { VariantProps } from '@byyuurin/ui-kit';
2
+ import type { PrimitiveProps } from 'reka-ui';
3
+ import type { KbdKey } from '../composables/useKbd.js';
4
+ import type { kbd } from '../theme/index.js';
5
+ import type { ComponentAttrs } from '../types/index.js';
6
+ export interface KbdSlots {
7
+ default?: (props?: {}) => any;
8
+ }
9
+ type KbdVariants = VariantProps<typeof kbd>;
10
+ export interface KbdProps extends Omit<ComponentAttrs<typeof kbd>, 'ui'> {
11
+ /**
12
+ * The element or component this component should render as.
13
+ * @default "kbd"
14
+ */
15
+ as?: PrimitiveProps['as'];
16
+ variant?: KbdVariants['variant'];
17
+ size?: KbdVariants['size'];
18
+ value?: KbdKey | (string & {});
19
+ }
20
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<KbdProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KbdProps> & Readonly<{}>, {
21
+ as: import("reka-ui").AsTag | import("vue").Component;
22
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, KbdSlots>;
23
+ export default _default;
24
+ type __VLS_WithSlots<T, S> = T & {
25
+ new (): {
26
+ $slots: S;
27
+ };
28
+ };