File tree Expand file tree Collapse file tree 8 files changed +122
-98
lines changed
test/components/__snapshots__ Expand file tree Collapse file tree 8 files changed +122
-98
lines changed Original file line number Diff line number Diff line change @@ -415,7 +415,6 @@ defineExpose({
415
415
</DefineCreateItemTemplate >
416
416
417
417
<ComboboxRoot
418
- :id =" id"
419
418
v-slot =" { modelValue, open }"
420
419
v-bind =" rootProps"
421
420
:name =" name"
@@ -456,6 +455,7 @@ defineExpose({
456
455
457
456
<ComboboxInput v-model =" searchTerm" as-child >
458
457
<TagsInputInput
458
+ :id =" id"
459
459
ref =" inputRef"
460
460
v-bind =" { ...$attrs, ...ariaAttrs }"
461
461
:placeholder =" placeholder"
@@ -467,6 +467,7 @@ defineExpose({
467
467
468
468
<ComboboxInput
469
469
v-else
470
+ :id =" id"
470
471
ref =" inputRef"
471
472
:display-value =" displayValue"
472
473
v-bind =" { ...$attrs, ...ariaAttrs }"
Original file line number Diff line number Diff line change @@ -272,7 +272,12 @@ defineExpose({
272
272
@update:model-value =" onUpdate"
273
273
@update:open =" onUpdateOpen"
274
274
>
275
- <SelectTrigger :id =" id" ref =" triggerRef" :class =" ui.base({ class: [props.ui?.base, props.class] })" v-bind =" { ...$attrs, ...ariaAttrs }" >
275
+ <SelectTrigger
276
+ :id =" id"
277
+ ref =" triggerRef"
278
+ :class =" ui.base({ class: [props.ui?.base, props.class] })"
279
+ v-bind =" { ...$attrs, ...ariaAttrs }"
280
+ >
276
281
<span v-if =" isLeading || !!avatar || !!slots.leading" :class =" ui.leading({ class: props.ui?.leading })" >
277
282
<slot name =" leading" :model-value =" (modelValue as GetModelValue<T, VK, M>)" :open =" open" :ui =" ui" >
278
283
<UIcon v-if =" isLeading && leadingIconName" :name =" leadingIconName" :class =" ui.leadingIcon({ class: props.ui?.leadingIcon })" />
Original file line number Diff line number Diff line change @@ -8,6 +8,15 @@ export default (options: Required<ModuleOptions>) => {
8
8
input : 'border-b border-default' ,
9
9
focusScope : 'flex flex-col min-h-0' ,
10
10
content : ( content : string ) => [ content , 'origin-(--reka-combobox-content-transform-origin) w-(--reka-combobox-trigger-width)' ]
11
- }
11
+ } ,
12
+ compoundVariants : ( prev : Record < string , any > [ ] ) => prev . map ( item => ( {
13
+ ...item ,
14
+ class : typeof item . class === 'string' ? replaceFocus ( item . class ) : item . class
15
+ } ) )
12
16
} , select ( options ) )
13
17
}
18
+
19
+ function replaceFocus ( str : string ) : string {
20
+ return str
21
+ . replace ( / f o c u s : / g, 'focus-visible:' )
22
+ }
Original file line number Diff line number Diff line change @@ -81,6 +81,15 @@ export default (options: Required<ModuleOptions>) => {
81
81
empty : 'p-2 text-base'
82
82
}
83
83
}
84
- }
84
+ } ,
85
+ compoundVariants : ( prev : Record < string , any > [ ] ) => prev . map ( item => ( {
86
+ ...item ,
87
+ class : typeof item . class === 'string' ? replaceFocus ( item . class ) : item . class
88
+ } ) )
85
89
} , input ( options ) )
86
90
}
91
+
92
+ function replaceFocus ( str : string ) : string {
93
+ return str
94
+ . replace ( / f o c u s - v i s i b l e : / g, 'focus:' )
95
+ }
Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ exports[`InputMenu > renders with icon correctly 1`] = `
219
219
` ;
220
220
221
221
exports [` InputMenu > renders with id correctly 1` ] = `
222
- "<div dir = " ltr" id = " id " class = " relative inline-flex items-center" style = " pointer-events: auto;" ><input aria-disabled = " false" type = " text" aria-expanded = " true" aria-controls = " " aria-autocomplete = " list" role = " combobox" autocomplete = " off" class = " rounded-md transition-colors px-2.5 py-1.5 text-sm gap-1.5 text-highlighted bg-default ring ring-inset ring-accented w-full border-0 placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary pe-9" value = " " >
222
+ "<div dir = " ltr" class = " relative inline-flex items-center" style = " pointer-events: auto;" ><input aria-disabled = " false" type = " text" aria-expanded = " true" aria-controls = " " aria-autocomplete = " list" role = " combobox" autocomplete = " off" class = " rounded-md transition-colors px-2.5 py-1.5 text-sm gap-1.5 text-highlighted bg-default ring ring-inset ring-accented w-full border-0 placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary pe-9" id = " id " value = " " >
223
223
<!--v-if--><button type = " button" tabindex = " -1" aria-label = " Show popup" aria-haspopup = " listbox" aria-expanded = " true" aria-controls = " " data-state = " open" aria-disabled = " false" class = " group absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75 pe-2.5" ><svg xmlns = " http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden = " true" role = " img" width = " 1em" height = " 1em" viewBox = " 0 0 16 16" class = " shrink-0 text-dimmed size-5" ></svg ></button >
224
224
<!--teleport start-->
225
225
<div data-reka-popper-content-wrapper = " " style = " position: fixed; left: 0px; top: 0px; transform: translate(0, -200%); min-width: max-content;" >
Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ exports[`InputMenu > renders with icon correctly 1`] = `
223
223
` ;
224
224
225
225
exports [` InputMenu > renders with id correctly 1` ] = `
226
- "<div dir = " ltr" id = " id " class = " relative inline-flex items-center" style = " pointer-events: auto;" ><input aria-disabled = " false" type = " text" aria-expanded = " true" aria-controls = " " aria-autocomplete = " list" role = " combobox" autocomplete = " off" class = " rounded-md transition-colors px-2.5 py-1.5 text-sm gap-1.5 text-highlighted bg-default ring ring-inset ring-accented w-full border-0 placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary pe-9" value = " " aria-activedescendant = " reka-combobox-item-v-0-0-3" >
226
+ "<div dir = " ltr" class = " relative inline-flex items-center" style = " pointer-events: auto;" ><input aria-disabled = " false" type = " text" aria-expanded = " true" aria-controls = " " aria-autocomplete = " list" role = " combobox" autocomplete = " off" class = " rounded-md transition-colors px-2.5 py-1.5 text-sm gap-1.5 text-highlighted bg-default ring ring-inset ring-accented w-full border-0 placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary pe-9" id = " id " value = " " aria-activedescendant = " reka-combobox-item-v-0-0-3" >
227
227
<!--v-if--><button type = " button" tabindex = " -1" aria-label = " Show popup" aria-haspopup = " listbox" aria-expanded = " true" aria-controls = " " data-state = " open" aria-disabled = " false" class = " group absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75 pe-2.5" ><span class = " iconify i-lucide:chevron-down shrink-0 text-dimmed size-5" aria-hidden = " true" ></span ></button >
228
228
<!--teleport start-->
229
229
<div data-reka-popper-content-wrapper = " " style = " position: fixed; left: 0px; top: 0px; transform: translate(0, -200%); min-width: max-content;" >
You can’t perform that action at this time.
0 commit comments