Skip to content

Commit 36d1364

Browse files
fix: build and checkbox docs
1 parent 23ebd32 commit 36d1364

File tree

4 files changed

+11
-34
lines changed

4 files changed

+11
-34
lines changed

apps/website/src/_state/component-statuses.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const statusByComponent: ComponentKitsStatuses = {
3838
Carousel: ComponentStatus.Draft,
3939
Collapsible: ComponentStatus.Beta,
4040
Combobox: ComponentStatus.Beta,
41-
Checkbox: ComponentStatus.Beta,
41+
Checkbox: ComponentStatus.Draft,
4242
Label: ComponentStatus.Draft,
4343
Modal: ComponentStatus.Beta,
4444
Pagination: ComponentStatus.Draft,

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { component$, useSignal, useStyles$ } from '@builder.io/qwik';
1+
import { component$ } from '@builder.io/qwik';
22
import { Checkbox, Checklist } from '@qwik-ui/headless';
33
export default component$(() => {
44
return (
55
<>
66
<h3 id="test123">Pick a cat</h3>
7-
import {(Checkbox, Checklist)} from '@qwik-ui/headless';
87
<Checklist.Root class="flex flex-col gap-3" ariaLabeledBy="test123">
98
<Checkbox.Root
109
class="flex items-center gap-3 bg-slate-900 p-2 text-white"

apps/website/src/routes/docs/headless/checkbox/index.mdx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,25 @@ Allows users to visually select an option by checking it.
3434

3535
### Controlled Checkbox
3636

37-
You can bind the internal value of a checkbox to a user-defined signal:
37+
To add reactive state, use the `bind:checked` prop on the `<Checkbox.Root />` component.
3838

3939
<Showcase name="controlled" />
4040

41-
Do keep in mind that the inital value of the signal WILL affect the initial value of the checkbox.
41+
> Note that the initial value of the signal will affect the initial value of the checkbox.
4242
43-
In the example below, the left checkbox was bindided to a signal with an inital value of false while the right checkbox was bindded to a signal with an inital falue of true.
43+
In the example below, the left checkbox starts as **false**, while the right checkbox starts as **true**.
4444

4545
<Showcase name="controlled-values" />
4646

4747
## Customization & Caveats
4848

49-
The Checkbox is made from the ground up to be as customizable as possible.
50-
51-
You can define your own CSS classes on every part of the component as if it were a normal div element. You can even define any valid HTML as your icon, but keep in mind that any child of the Checkbox Indicator is removed from the accesibilyti tree. This is done to prevent text, or emojis, that are meant to be used as icons from being added to the label of the Checkbox (see [automatic labeling](#automatic-labeling) for more info).
49+
You can apply CSS classes to any part of the component. Any valid HTML can be used as an icon, but children of the Checkbox Indicator are removed from the accessibility tree to prevent them from being added to the Checkbox Label.
5250

5351
### Automatic Labeling
5452

55-
Due to the implementation of the Checkbox element being a div with the role of checkbox, any text present inside the Checkbox Root is interpreted as the checkbox label.
53+
The Checkbox element is a div with the role of checkbox, so any text inside the Checkbox Root is interpreted as the checkbox label.
5654

57-
This also means that any text tag is stripped from its semantic meaning. In other words, passing an h1 tag is treated the same as passing a p tag: they are both treated as if you passed no tag at all. See [this](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/checkbox_role#all_descendants_are_presentational) section of MDN for a more detailed explenation.
55+
Text tags lose their semantic meaning. For example, an h1 tag is treated the same as a p tag. See [this MDN section](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/checkbox_role#all_descendants_are_presentational) for more details.
5856

5957
## API
6058

@@ -64,13 +62,12 @@ This also means that any text tag is stripped from its semantic meaning. In othe
6462
propDescriptors={[
6563
{
6664
name: 'bind:checked',
67-
description:
68-
'two-way data bind of the value of the checkbox to a user-defined signal',
65+
description: 'Two-way data binding of the checkbox value to a user-defined signal',
6966
},
7067
{
7168
name: 'checklist',
7269
description:
73-
"when true makes the checkbox be treated as a tri-state checkbox AND binds it's value over all other checkboxes inside the checklist",
70+
'When true, treats the checkbox as a tri-state and binds its value to all other checkboxes in the checklist',
7471
},
7572
]}
7673
/>
Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,3 @@
11
import { component$ } from '@builder.io/qwik';
2-
import { Checkbox } from '@qwik-ui/headless';
32

4-
export default component$(() => (
5-
<Select>
6-
<SelectTrigger>
7-
<SelectValue>selected value</SelectValue>
8-
</SelectTrigger>
9-
10-
<SelectPopover>
11-
<SelectListbox>
12-
<SelectOption>regular option</SelectOption>
13-
14-
{/* optional */}
15-
<SelectGroup>
16-
<SelectLabel>group label</SelectLabel>
17-
<SelectOption>group option</SelectOption>
18-
</SelectGroup>
19-
</SelectListbox>
20-
</SelectPopover>
21-
</Select>
22-
));
3+
export default component$(() => <></>);

0 commit comments

Comments
 (0)