11<script lang="ts">
2- import type { ComboboxContentProps as _ComboboxContentProps , ComboboxContentEmits } from ' reka-ui'
2+ import type {
3+ ComboboxContentProps as RekaComboboxContentProps ,
4+ ComboboxContentEmits ,
5+ } from ' reka-ui'
36import ThemeWrapper from ' ../provider/ThemeWrapper.vue'
47
5- export interface ComboboxContentProps extends _ComboboxContentProps {
6- to? : string | HTMLElement
8+ export interface ComboboxContentProps extends RekaComboboxContentProps {
79 variant? : ' solid' | ' soft'
810}
911 </script >
@@ -31,6 +33,7 @@ const { forwardRef } = useForwardExpose()
3133const props = withDefaults (defineProps <ComboboxContentProps >(), {
3234 variant: ' solid' ,
3335 position: ' popper' ,
36+ sideOffset: 5 ,
3437})
3538const emits = defineEmits <ComboboxContentEmits >()
3639const forwarded = useForwardPropsEmits (props , emits )
@@ -46,7 +49,7 @@ const contentClass = computed(() => {
4649 </script >
4750
4851<template >
49- <ComboboxPortal :to = " props.to " >
52+ <ComboboxPortal >
5053 <ThemeWrapper :accent-color =" context.color.value" >
5154 <ComboboxContent
5255 :ref =" forwardRef"
@@ -111,23 +114,73 @@ const contentClass = computed(() => {
111114 padding : var (--combobox-content-padding );
112115}
113116
114- .ui-ComboboxContent :has (.ui-ScrollAreaScrollbar [data-orientation = ' vertical' ]) .ui-ComboboxViewport {
117+ .ui-ComboboxContent :where( : has (.ui-ScrollAreaScrollbar [data-orientation = ' vertical' ])) :where( .ui-ComboboxViewport ) {
115118 padding-right : var (--space-3 );
116119}
117120
118121.ui-ComboboxContent :where(.r-size-1 ) {
119122 --combobox-content-padding : var (--space-1 );
123+
120124 --combobox-item-height : var (--space-5 );
121- --combobox-item-indicator-width : calc (var (--space-5 ) / 1.2 );
125+ --combobox-item-font-size : var (--font-size-1 );
126+ --combobox-item-line-height : var (--line-height-1 );
127+ --combobox-item-letter-spacing : var (--letter-spacing-1 );
128+ --combobox-item-radius : var (--radius-1 );
129+
130+ --combobox-indicator-width : calc (var (--space-5 ) / 1.2 );
131+ --combobox-indicator-icon-width : calc (8px * var (--scaling ));
132+ --combobox-indicator-icon-height : calc (8px * var (--scaling ));
133+
122134 --combobox-separator-margin-right : var (--space-2 );
135+
136+ --combobox-label-font-size : var (--font-size-1 );
137+ --combobox-label-letter-spacing : var (--letter-spacing-1 );
138+ --combobox-label-line-height : var (--line-height-1 );
139+
123140 border-radius : var (--radius-3 );
124141}
142+
143+ .ui-ComboboxContent :where(.r-size-2 ) {
144+ --combobox-item-font-size : var (--font-size-2 );
145+ --combobox-item-letter-spacing : var (--letter-spacing-2 );
146+ }
147+
148+ .ui-ComboboxContent :where(.r-size-3 ) {
149+ --combobox-item-font-size : var (--font-size-3 );
150+ --combobox-item-letter-spacing : var (--letter-spacing-3 );
151+ }
152+
125153.ui-ComboboxContent :where(.r-size-2 ),
126154.ui-ComboboxContent :where(.r-size-3 ) {
127155 --combobox-content-padding : var (--space-2 );
156+ --combobox-item-radius : var (--radius-2 );
128157 --combobox-item-height : var (--space-6 );
129- --combobox-item-indicator-width : var (--space-5 );
158+ --combobox-item-line-height : var (--line-height-2 );
159+ --combobox-indicator-width : var (--space-5 );
160+ --combobox-indicator-icon-width : calc (10px * var (--scaling ));
161+ --combobox-indicator-icon-height : calc (10px * var (--scaling ));
130162 --combobox-separator-margin-right : var (--space-3 );
163+
164+ --combobox-label-font-size : var (--font-size-2 );
165+ --combobox-label-letter-spacing : var (--letter-spacing-2 );
166+ --combobox-label-line-height : var (--line-height-2 );
167+
131168 border-radius : var (--radius-4 );
132169}
170+
171+ .ui-ComboboxContent :where(.r-variant-solid ) {
172+ --combobox-highlighted-background-color : var (--accent-9 );
173+ --combobox-highlighted-text-color : var (--accent-contrast );
174+ }
175+ .ui-ComboboxContent :where(.r-variant-solid.r-high-contrast ) {
176+ --combobox-highlighted-background-color : var (--accent-12 );
177+ --combobox-highlighted-text-color : var (--accent-1 );
178+ }
179+ .ui-ComboboxContent :where(.r-variant-soft ) {
180+ --combobox-highlighted-background-color : var (--accent-a3 );
181+ --combobox-highlighted-text-color : var (--accent-a11 );
182+ }
183+ .ui-ComboboxContent :where(.r-variant-soft.r-high-contrast ) {
184+ --combobox-highlighted-text-color : var (--accent-12 );
185+ }
133186 </style >
0 commit comments