Skip to content

Commit 09e2e9b

Browse files
committed
fix: api changes
1 parent 8e31c2c commit 09e2e9b

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

apps/website/src/routes/docs/headless/checkbox/examples/test-hero.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Checkbox } from '@qwik-ui/headless';
33

44
export default component$(() => {
55
const userSig = useSignal(true);
6-
import { Checkbox, Checklist } from '@qwik-ui/headless';
76
return (
87
<>
98
<Checkbox.Root class="bg-slate-900 text-white" checkBoxSig={userSig}>

packages/kit-headless/src/components/checkbox/checkbox.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { CheckListContext, CheckboxContext } from './context-id';
1414
import { TriBool, getTriBool } from '../checklist/checklist-context-wrapper';
1515
export type MixedStateCheckboxProps = {
1616
checkBoxSig?: Signal<boolean>;
17-
checkList?: boolean;
17+
checklist?: boolean;
1818
_useCheckListContext?: boolean;
1919
_overWriteCheckbox?: boolean;
2020
} & PropsOf<'div'>;
@@ -34,9 +34,9 @@ export type ChecklistTwoStateCheckboxProps = {
3434
} & PropsOf<'div'>;
3535
export const CheckboxRoot = component$<MixedStateCheckboxProps>((props) => {
3636
// this is done to avoid consumers dealing with two types checkboxes, could go in different files
37-
if (props._useCheckListContext && !props.checkList) {
37+
if (props._useCheckListContext && !props.checklist) {
3838
}
39-
if (props.checkList) {
39+
if (props.checklist) {
4040
return (
4141
<MixedStateCheckbox {...props}>
4242
<Slot />
@@ -141,6 +141,8 @@ export const ChecklistTwoStateCheckbox = component$<ChecklistTwoStateCheckboxPro
141141
);
142142

143143
export const MixedStateCheckbox = component$<MixedStateCheckboxProps>((props) => {
144+
console.log('mixed');
145+
144146
// all the sig stuff should be refactored into a fancy hook
145147
const checklistContext = useContext(CheckListContext);
146148
const childCheckboxes = checklistContext.checkboxes;

packages/kit-headless/src/components/checklist/checklist-indicator.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { component$, useContext, PropsOf, Slot, useTask$ } from '@builder.io/qwik';
22
import { CheckListContext } from './context-id';
3-
import { props } from 'cypress/types/bluebird';
43

54
export type ChecklistIndicatorProps = PropsOf<'div'>;
65

@@ -9,19 +8,19 @@ export const ChecklistIndicator = component$<ChecklistIndicatorProps>((props) =>
98

109
useTask$(({ track }) => {
1110
track(() => checklistSig.value);
12-
console.log('here running hlol');
1311
});
1412

1513
// weird comparions, but it gets the right behavior
1614
return (
1715
<div {...props}>
16+
<p>Here lol: {JSON.stringify(checklistSig.value)}</p>
1817
{checklistSig.value === true && (
19-
<div class={checklistSig.value === true ? 'visible' : 'invisible'}>
18+
<div>
2019
<Slot name="true" />
2120
</div>
2221
)}
2322
{checklistSig.value === 'indeterminate' && (
24-
<div class={checklistSig.value === 'indeterminate' ? 'visible' : 'invisible'}>
23+
<div>
2524
<Slot name="mixed" />
2625
</div>
2726
)}

0 commit comments

Comments
 (0)