File tree Expand file tree Collapse file tree 4 files changed +13
-16
lines changed
apps/website/src/routes/docs/headless/checkbox/examples
packages/kit-headless/src Expand file tree Collapse file tree 4 files changed +13
-16
lines changed Original file line number Diff line number Diff line change 1
1
import { component$ , useSignal , useStyles$ } from '@builder.io/qwik' ;
2
- import { Checkbox } from '@qwik-ui/headless' ;
2
+ import { Checkbox , Checklist } from '@qwik-ui/headless' ;
3
3
const toppingNames = [ 'hot peppers' , 'ham' , 'pineaple' , 'mushroom' ] ;
4
4
const toppingImages = [ '🌶️' , '🍗' , '🍍' , '🍄' ] ;
5
5
export default component$ ( ( ) => {
6
6
return (
7
7
< >
8
8
< h3 id = "pizza-toppings" > Pizza toppings</ h3 >
9
- < CheckList ariaLabeledBy = "pizza-toppings" class = "flex flex-col gap-4" >
9
+ < Checklist . Root ariaLabeledBy = "pizza-toppings" class = "flex flex-col gap-4" >
10
10
< Checkbox . Root
11
11
class = "flex items-center gap-3 border-2 border-black p-2"
12
12
checkList = { true }
@@ -26,14 +26,14 @@ export default component$(() => {
26
26
{ toppingNames . map ( ( name , i ) => {
27
27
return (
28
28
< Checkbox . Root class = "ml-8 flex items-center gap-3 border-2 border-black p-2" >
29
- < CheckboxIndicator class = "flex h-[25px] w-[25px] items-center justify-center bg-slate-600" >
29
+ < Checkbox . Indicator class = "flex h-[25px] w-[25px] items-center justify-center bg-slate-600" >
30
30
{ toppingImages [ i ] }
31
- </ CheckboxIndicator >
31
+ </ Checkbox . Indicator >
32
32
{ name }
33
33
</ Checkbox . Root >
34
34
) ;
35
35
} ) }
36
- </ CheckList >
36
+ </ Checklist . Root >
37
37
</ >
38
38
) ;
39
39
} ) ;
Original file line number Diff line number Diff line change 1
1
import { component$ , useSignal , useStyles$ } from '@builder.io/qwik' ;
2
- import { CheckboxIndicator } from 'packages/kit-headless/src/components/checkbox/checkbox-indicator' ;
3
- import { Checkbox } from 'packages/kit-headless/src/components/checkbox/checkbox' ;
4
- import { CheckList } from 'packages/kit-headless/src/components/checkbox/checklist' ;
5
- import { Checkbox } from '@qwik-ui/headless' ;
2
+ import { Checkbox , Checklist } from '@qwik-ui/headless' ;
6
3
export default component$ ( ( ) => {
7
4
return (
8
5
< >
9
6
< h3 id = "test123" > Pick a cat</ h3 >
10
7
11
- < CheckList class = "flex flex-col gap-3" ariaLabeledBy = "test123" >
8
+ < Checklist . Root class = "flex flex-col gap-3" ariaLabeledBy = "test123" >
12
9
< Checkbox . Root
13
10
class = "flex items-center gap-3 bg-slate-900 p-2 text-white"
14
11
checkList = { true }
@@ -27,17 +24,17 @@ export default component$(() => {
27
24
</ Checkbox . Root >
28
25
29
26
< Checkbox . Root class = "flex items-center gap-3 bg-slate-900 pr-2 text-white" >
30
- < CheckboxIndicator class = "w-fit bg-slate-600" > ✅</ CheckboxIndicator >
27
+ < Checkbox . Indicator class = "w-fit bg-slate-600" > ✅</ Checkbox . Indicator >
31
28
< p > Cat One</ p >
32
29
</ Checkbox . Root >
33
30
34
31
< Checkbox . Root class = "bg-slate-900 text-white" >
35
32
< div class = "flex items-center gap-3" >
36
- < CheckboxIndicator class = "w-fit bg-slate-600" > ✅</ CheckboxIndicator >
33
+ < Checkbox . Indicator class = "w-fit bg-slate-600" > ✅</ Checkbox . Indicator >
37
34
< p > Cat Two</ p >
38
35
</ div >
39
36
</ Checkbox . Root >
40
- </ CheckList >
37
+ </ Checklist . Root >
41
38
</ >
42
39
) ;
43
40
} ) ;
Original file line number Diff line number Diff line change 1
1
import { type JSXNode , Component , PropsOf } from '@builder.io/qwik' ;
2
- import { Checkbox , type MixedStateCheckboxProps } from '../checkbox/checkbox' ;
2
+ import { CheckboxRoot , type MixedStateCheckboxProps } from '../checkbox/checkbox' ;
3
3
import { ChecklistContextWrapper , getTriBool } from './checklist-context-wrapper' ;
4
4
5
5
type CheckListProps = PropsOf < 'ul' > & { ariaLabeledBy : string } ;
@@ -34,7 +34,7 @@ export const Checklist: Component<CheckListProps> = (props: CheckListProps) => {
34
34
}
35
35
36
36
switch ( child . type ) {
37
- case Checkbox : {
37
+ case CheckboxRoot : {
38
38
const typedProps = child . props as MixedStateCheckboxProps ;
39
39
// FYI: Obj.assign mutates
40
40
Object . assign ( typedProps , { _useCheckListContext : true } ) ;
Original file line number Diff line number Diff line change 1
1
export * as Checkbox from './components/checkbox' ;
2
- export * as Checklist from './components/checklist/checklist ' ;
2
+ export * as Checklist from './components/checklist' ;
3
3
export * as Accordion from './components/accordion/' ;
4
4
export * as Carousel from './components/carousel' ;
5
5
export * as Collapsible from './components/collapsible' ;
You can’t perform that action at this time.
0 commit comments