11import type { PropsOf , QRL , Signal } from '@builder.io/qwik' ;
2- import { component$ , useContextProvider , Slot , useTask$ , $ } from '@builder.io/qwik' ;
2+ import {
3+ component$ ,
4+ useContextProvider ,
5+ Slot ,
6+ useTask$ ,
7+ $ ,
8+ useStyles$ ,
9+ } from '@builder.io/qwik' ;
310import {
411 toggleGroupRootApiContextId ,
512 type Direction ,
@@ -8,6 +15,7 @@ import {
815} from './toggle-group-context' ;
916import { useToggleGroup } from './use-toggle' ;
1017import { isBrowser , isServer } from '@builder.io/qwik/build' ;
18+ import styles from './toggle-group.css?inline' ;
1119
1220export type ToggleGroupBaseProps = {
1321 /**
@@ -87,6 +95,7 @@ export type ToggleGroupApiProps = (ToggleGroupSingleProps | ToggleGroupMultipleP
8795export type ToggleGroupRootProps = PropsOf < 'div' > & ToggleGroupApiProps ;
8896
8997export const HToggleGroupRoot = component$ < ToggleGroupRootProps > ( ( props ) => {
98+ useStyles$ ( styles ) ;
9099 const {
91100 onChange$ : _ ,
92101 disabled = false ,
@@ -97,7 +106,6 @@ export const HToggleGroupRoot = component$<ToggleGroupRootProps>((props) => {
97106 } = props ;
98107
99108 const commonProps = { role : 'group' , 'aria-orientation' : orientation , dir : direction } ;
100- const orientationClass = orientation === 'vertical' ? 'flex-col' : 'flex-row' ;
101109
102110 const api = useToggleGroup ( props ) ;
103111
@@ -275,8 +283,8 @@ export const HToggleGroupRoot = component$<ToggleGroupRootProps>((props) => {
275283 < div
276284 { ...divProps }
277285 { ...commonProps }
278- class = { `flex ${ orientationClass } items-center gap-1` }
279286 data-qui-togglegroup-root
287+ data-orientation = { orientation }
280288 >
281289 < Slot />
282290 </ div >
0 commit comments