Skip to content

Commit f761369

Browse files
chore(deps): update dependency reka-ui to ^2.3.0 (v3) (#4234)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Benjamin Canac <[email protected]>
1 parent 7df7ee3 commit f761369

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+4185
-4176
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
"mlly": "^1.7.4",
145145
"ohash": "^2.0.11",
146146
"pathe": "^2.0.3",
147-
"reka-ui": "^2.2.1",
147+
"reka-ui": "^2.3.0",
148148
"scule": "^1.3.0",
149149
"tailwind-variants": "^1.0.0",
150150
"tailwindcss": "^4.1.7",

playground/app/pages/components/calendar.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,23 @@
22
import { CalendarDate } from '@internationalized/date'
33
44
const singleValue = shallowRef(new CalendarDate(2022, 1, 10))
5-
const multipleValue = shallowRef({
5+
const multipleValue = shallowRef([new CalendarDate(2022, 1, 10), new CalendarDate(2022, 1, 20)])
6+
const rangeValue = shallowRef({
67
start: new CalendarDate(2022, 1, 10),
78
end: new CalendarDate(2022, 1, 20)
89
})
910
</script>
1011

1112
<template>
12-
<div class="flex flex-col gap-4">
13+
<div class="flex gap-4">
1314
<div class="flex justify-center gap-2">
1415
<UCalendar v-model="singleValue" />
1516
</div>
1617
<div class="flex justify-center gap-2">
17-
<UCalendar v-model="multipleValue" range />
18+
<UCalendar v-model="multipleValue" multiple />
19+
</div>
20+
<div class="flex justify-center gap-2">
21+
<UCalendar v-model="rangeValue" range />
1822
</div>
1923
</div>
2024
</template>

playground/app/pages/components/pin-input.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const sizes = Object.keys(theme.variants.size) as Array<keyof typeof theme.varia
55
const variants = Object.keys(theme.variants.variant) as Array<keyof typeof theme.variants.variant>
66
77
const onComplete = (e: string[]) => {
8-
alert(e.join(''))
8+
console.log(e)
99
}
1010
</script>
1111

pnpm-lock.yaml

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/runtime/components/Calendar.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ const Calendar = computed(() => props.range ? RangeCalendar : SingleCalendar)
153153
<Calendar.Root
154154
v-slot="{ weekDays, grid }"
155155
v-bind="rootProps"
156-
:model-value="modelValue"
157-
:default-value="defaultValue"
156+
:model-value="(modelValue as DateValue | DateValue[])"
157+
:default-value="(defaultValue as DateValue)"
158158
:locale="locale"
159159
:dir="dir"
160160
:class="ui.root({ class: [props.ui?.root, props.class] })"

src/runtime/components/InputNumber.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { ComponentConfig } from '../types/utils'
77
88
type InputNumber = ComponentConfig<typeof theme, AppConfig, 'inputNumber'>
99
10-
export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue' | 'defaultValue' | 'min' | 'max' | 'step' | 'stepSnapping' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions' | 'disableWheelChange'> {
10+
export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue' | 'defaultValue' | 'min' | 'max' | 'step' | 'stepSnapping' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions' | 'disableWheelChange' | 'invertWheelChange'> {
1111
/**
1212
* The element or component this component should render as.
1313
* @defaultValue 'div'
@@ -98,7 +98,7 @@ defineSlots<InputNumberSlots>()
9898
const { t, code: codeLocale } = useLocale()
9999
const appConfig = useAppConfig() as InputNumber['AppConfig']
100100
101-
const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'min', 'max', 'step', 'stepSnapping', 'formatOptions', 'disableWheelChange'), emits)
101+
const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'min', 'max', 'step', 'stepSnapping', 'formatOptions', 'disableWheelChange', 'invertWheelChange'), emits)
102102
103103
const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, id, color, size: formGroupSize, name, highlight, disabled, ariaAttrs } = useFormField<InputNumberProps>(props)
104104
const { orientation, size: buttonGroupSize } = useButtonGroup<InputNumberProps>(props)

src/runtime/components/PinInput.vue

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import type { ComponentConfig } from '../types/utils'
77

88
type PinInput = ComponentConfig<typeof theme, AppConfig, 'pinInput'>
99

10-
export interface PinInputProps extends Pick<PinInputRootProps, 'defaultValue' | 'disabled' | 'id' | 'mask' | 'modelValue' | 'name' | 'otp' | 'placeholder' | 'required' | 'type'> {
10+
type PinInputType = 'text' | 'number'
11+
12+
export interface PinInputProps<T extends PinInputType = 'text'> extends Pick<PinInputRootProps<T>, 'defaultValue' | 'disabled' | 'id' | 'mask' | 'modelValue' | 'name' | 'otp' | 'placeholder' | 'required' | 'type'> {
1113
/**
1214
* The element or component this component should render as.
1315
* @defaultValue 'div'
@@ -37,14 +39,14 @@ export interface PinInputProps extends Pick<PinInputRootProps, 'defaultValue' |
3739
ui?: PinInput['slots']
3840
}
3941

40-
export type PinInputEmits = PinInputRootEmits & {
42+
export type PinInputEmits<T extends PinInputType = 'text'> = PinInputRootEmits<T> & {
4143
change: [payload: Event]
4244
blur: [payload: Event]
4345
}
4446

4547
</script>
4648

47-
<script setup lang="ts">
49+
<script setup lang="ts" generic="T extends PinInputType = 'text'">
4850
import type { ComponentPublicInstance } from 'vue'
4951
import { ref, computed, onMounted } from 'vue'
5052
import { PinInputInput, PinInputRoot, useForwardPropsEmits } from 'reka-ui'
@@ -54,16 +56,16 @@ import { useFormField } from '../composables/useFormField'
5456
import { looseToNumber } from '../utils'
5557
import { tv } from '../utils/tv'
5658

57-
const props = withDefaults(defineProps<PinInputProps>(), {
58-
type: 'text',
59+
const props = withDefaults(defineProps<PinInputProps<T>>(), {
60+
type: 'text' as never,
5961
length: 5,
6062
autofocusDelay: 0
6163
})
62-
const emits = defineEmits<PinInputEmits>()
64+
const emits = defineEmits<PinInputEmits<T>>()
6365

6466
const appConfig = useAppConfig() as PinInput['AppConfig']
6567

66-
const rootProps = useForwardPropsEmits(reactivePick(props, 'defaultValue', 'disabled', 'id', 'mask', 'modelValue', 'name', 'otp', 'placeholder', 'required', 'type'), emits)
68+
const rootProps = useForwardPropsEmits(reactivePick(props, 'defaultValue', 'disabled', 'id', 'mask', 'modelValue', 'name', 'otp', 'required', 'type'), emits)
6769

6870
const { emitFormInput, emitFormFocus, emitFormChange, emitFormBlur, size, color, id, name, highlight, disabled, ariaAttrs } = useFormField<PinInputProps>(props)
6971

@@ -77,7 +79,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.pinInput ||
7779
const inputsRef = ref<ComponentPublicInstance[]>([])
7880

7981
const completed = ref(false)
80-
function onComplete(value: string[]) {
82+
function onComplete(value: string[] | number[]) {
8183
// @ts-expect-error - 'target' does not exist in type 'EventInit'
8284
const event = new Event('change', { target: { value } })
8385
emits('change', event)
@@ -113,6 +115,7 @@ defineExpose({
113115
v-bind="{ ...rootProps, ...ariaAttrs }"
114116
:id="id"
115117
:name="name"
118+
:placeholder="placeholder"
116119
:class="ui.root({ class: [props.ui?.root, props.class] })"
117120
@update:model-value="emitFormInput()"
118121
@complete="onComplete"

src/runtime/components/Progress.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { ComponentConfig } from '../types/utils'
77

88
type Progress = ComponentConfig<typeof theme, AppConfig, 'progress'>
99

10-
export interface ProgressProps extends Pick<ProgressRootProps, 'getValueLabel' | 'modelValue'> {
10+
export interface ProgressProps extends Pick<ProgressRootProps, 'getValueLabel' | 'getValueText' | 'modelValue'> {
1111
/**
1212
* The element or component this component should render as.
1313
* @defaultValue 'div'
@@ -70,7 +70,7 @@ const slots = defineSlots<ProgressSlots>()
7070
const { dir } = useLocale()
7171
const appConfig = useAppConfig() as Progress['AppConfig']
7272

73-
const rootProps = useForwardPropsEmits(reactivePick(props, 'getValueLabel', 'modelValue'), emits)
73+
const rootProps = useForwardPropsEmits(reactivePick(props, 'getValueLabel', 'getValueText', 'modelValue'), emits)
7474

7575
const isIndeterminate = computed(() => rootProps.value.modelValue === null)
7676
const hasSteps = computed(() => Array.isArray(props.max))

src/runtime/components/Textarea.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import type { AppConfig } from '@nuxt/schema'
33
import theme from '#build/ui/textarea'
44
import type { UseComponentIconsProps } from '../composables/useComponentIcons'
55
import type { AvatarProps } from '../types'
6-
import type { AcceptableValue, ComponentConfig } from '../types/utils'
6+
import type { ComponentConfig } from '../types/utils'
77
88
type Textarea = ComponentConfig<typeof theme, AppConfig, 'textarea'>
99
10+
type TextareaValue = string | number | null
11+
1012
export interface TextareaProps extends UseComponentIconsProps {
1113
/**
1214
* The element or component this component should render as.
@@ -49,7 +51,7 @@ export interface TextareaProps extends UseComponentIconsProps {
4951
ui?: Textarea['slots']
5052
}
5153
52-
export interface TextareaEmits<T extends AcceptableValue = AcceptableValue> {
54+
export interface TextareaEmits<T extends TextareaValue = TextareaValue> {
5355
(e: 'update:modelValue', payload: T): void
5456
(e: 'blur', event: FocusEvent): void
5557
(e: 'change', event: Event): void
@@ -62,7 +64,7 @@ export interface TextareaSlots {
6264
}
6365
</script>
6466

65-
<script setup lang="ts" generic="T extends AcceptableValue">
67+
<script setup lang="ts" generic="T extends TextareaValue">
6668
import { ref, computed, onMounted, nextTick, watch } from 'vue'
6769
import { Primitive } from 'reka-ui'
6870
import { useAppConfig } from '#imports'

src/runtime/components/Tree.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export type TreeItem = {
2929
[key: string]: any
3030
}
3131

32-
export interface TreeProps<T extends TreeItem[] = TreeItem[], VK extends GetItemKeys<T> = 'value', M extends boolean = false> extends Pick<TreeRootProps<T>, 'expanded' | 'defaultExpanded' | 'selectionBehavior' | 'propagateSelect' | 'disabled'> {
32+
export interface TreeProps<T extends TreeItem[] = TreeItem[], VK extends GetItemKeys<T> = 'value', M extends boolean = false> extends Pick<TreeRootProps<T>, 'expanded' | 'defaultExpanded' | 'selectionBehavior' | 'propagateSelect' | 'disabled' | 'bubbleSelect'> {
3333
/**
3434
* The element or component this component should render as.
3535
* @defaultValue 'ul'
@@ -116,7 +116,7 @@ const slots = defineSlots<TreeSlots<T>>()
116116

117117
const appConfig = useAppConfig() as Tree['AppConfig']
118118

119-
const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'items', 'multiple', 'expanded', 'disabled', 'propagateSelect'), emits)
119+
const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'items', 'multiple', 'expanded', 'disabled', 'propagateSelect', 'bubbleSelect'), emits)
120120

121121
const [DefineTreeTemplate, ReuseTreeTemplate] = createReusableTemplate<{ items?: TreeItem[], level: number }, TreeSlots<T>>()
122122

0 commit comments

Comments
 (0)