torch-glare 2.5.5 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/dist/bin/index.js +9 -24
- package/dist/bin/index.js.map +1 -1
- package/dist/src/commands/add.d.ts +2 -2
- package/dist/src/commands/add.d.ts.map +1 -1
- package/dist/src/commands/add.js +4 -70
- package/dist/src/commands/add.js.map +1 -1
- package/dist/src/commands/hook.d.ts +5 -4
- package/dist/src/commands/hook.d.ts.map +1 -1
- package/dist/src/commands/hook.js +7 -75
- package/dist/src/commands/hook.js.map +1 -1
- package/dist/src/commands/init.js +1 -1
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/layout.d.ts +5 -4
- package/dist/src/commands/layout.d.ts.map +1 -1
- package/dist/src/commands/layout.js +7 -75
- package/dist/src/commands/layout.js.map +1 -1
- package/dist/src/commands/provider.d.ts +5 -4
- package/dist/src/commands/provider.d.ts.map +1 -1
- package/dist/src/commands/provider.js +7 -75
- package/dist/src/commands/provider.js.map +1 -1
- package/dist/src/commands/update.d.ts.map +1 -1
- package/dist/src/commands/update.js +78 -43
- package/dist/src/commands/update.js.map +1 -1
- package/dist/src/commands/utils.d.ts +5 -4
- package/dist/src/commands/utils.d.ts.map +1 -1
- package/dist/src/commands/utils.js +7 -80
- package/dist/src/commands/utils.js.map +1 -1
- package/dist/src/shared/addFromRegistry.d.ts +16 -0
- package/dist/src/shared/addFromRegistry.d.ts.map +1 -0
- package/dist/src/shared/addFromRegistry.js +88 -0
- package/dist/src/shared/addFromRegistry.js.map +1 -0
- package/dist/src/shared/getInstallCommand.d.ts.map +1 -1
- package/dist/src/shared/getInstallCommand.js +5 -0
- package/dist/src/shared/getInstallCommand.js.map +1 -1
- package/dist/src/shared/installDependencies.d.ts +0 -10
- package/dist/src/shared/installDependencies.d.ts.map +1 -1
- package/dist/src/shared/installDependencies.js +0 -17
- package/dist/src/shared/installDependencies.js.map +1 -1
- package/dist/src/shared/installFromPlan.d.ts +7 -5
- package/dist/src/shared/installFromPlan.d.ts.map +1 -1
- package/dist/src/shared/installFromPlan.js +103 -36
- package/dist/src/shared/installFromPlan.js.map +1 -1
- package/dist/src/shared/loadRegistry.d.ts +12 -3
- package/dist/src/shared/loadRegistry.d.ts.map +1 -1
- package/dist/src/shared/loadRegistry.js +19 -20
- package/dist/src/shared/loadRegistry.js.map +1 -1
- package/dist/src/shared/registryClient.d.ts +19 -0
- package/dist/src/shared/registryClient.d.ts.map +1 -0
- package/dist/src/shared/registryClient.js +128 -0
- package/dist/src/shared/registryClient.js.map +1 -0
- package/dist/src/shared/resolveEntry.d.ts +10 -7
- package/dist/src/shared/resolveEntry.d.ts.map +1 -1
- package/dist/src/shared/resolveEntry.js +18 -13
- package/dist/src/shared/resolveEntry.js.map +1 -1
- package/dist/src/shared/suggestOtherCommand.d.ts +7 -1
- package/dist/src/shared/suggestOtherCommand.d.ts.map +1 -1
- package/dist/src/shared/suggestOtherCommand.js +29 -23
- package/dist/src/shared/suggestOtherCommand.js.map +1 -1
- package/dist/src/types/main.d.ts +31 -2
- package/dist/src/types/main.d.ts.map +1 -1
- package/package.json +6 -11
- package/apps/lib/components/ActionButton.tsx +0 -93
- package/apps/lib/components/ActionsGroup.tsx +0 -27
- package/apps/lib/components/AlertDialog.tsx +0 -204
- package/apps/lib/components/Avatar.tsx +0 -46
- package/apps/lib/components/Badge.tsx +0 -250
- package/apps/lib/components/BadgeField.tsx +0 -338
- package/apps/lib/components/Breadcrumb.tsx +0 -280
- package/apps/lib/components/Button.tsx +0 -317
- package/apps/lib/components/ButtonGroup.tsx +0 -190
- package/apps/lib/components/Calendar.tsx +0 -115
- package/apps/lib/components/Card.tsx +0 -95
- package/apps/lib/components/Checkbox.tsx +0 -42
- package/apps/lib/components/ColorPicker.tsx +0 -441
- package/apps/lib/components/ConclusionHeader.tsx +0 -148
- package/apps/lib/components/ContextMenu.tsx +0 -571
- package/apps/lib/components/CountBadge.tsx +0 -52
- package/apps/lib/components/DataTable.tsx +0 -213
- package/apps/lib/components/DataViews/badge.ts +0 -49
- package/apps/lib/components/DataViews/cell.tsx +0 -324
- package/apps/lib/components/DataViews/context.ts +0 -144
- package/apps/lib/components/DataViews/data-views.tsx +0 -383
- package/apps/lib/components/DataViews/filters/children.tsx +0 -98
- package/apps/lib/components/DataViews/filters/custom.tsx +0 -34
- package/apps/lib/components/DataViews/filters/filters.tsx +0 -157
- package/apps/lib/components/DataViews/filters/index.ts +0 -4
- package/apps/lib/components/DataViews/filters/labelled.tsx +0 -20
- package/apps/lib/components/DataViews/filters/presets.tsx +0 -65
- package/apps/lib/components/DataViews/filters/sync.tsx +0 -35
- package/apps/lib/components/DataViews/filters/values.ts +0 -173
- package/apps/lib/components/DataViews/header.tsx +0 -220
- package/apps/lib/components/DataViews/hooks/index.ts +0 -5
- package/apps/lib/components/DataViews/hooks/useActiveRow.ts +0 -22
- package/apps/lib/components/DataViews/hooks/useControllable.ts +0 -52
- package/apps/lib/components/DataViews/index.ts +0 -84
- package/apps/lib/components/DataViews/panel/columns.tsx +0 -153
- package/apps/lib/components/DataViews/panel/controls.tsx +0 -106
- package/apps/lib/components/DataViews/panel/index.ts +0 -3
- package/apps/lib/components/DataViews/panel/panel.tsx +0 -164
- package/apps/lib/components/DataViews/panel/saved-views.tsx +0 -67
- package/apps/lib/components/DataViews/panel/section.tsx +0 -81
- package/apps/lib/components/DataViews/panel/sort.tsx +0 -42
- package/apps/lib/components/DataViews/panel/tab.tsx +0 -31
- package/apps/lib/components/DataViews/slots.ts +0 -63
- package/apps/lib/components/DataViews/states.tsx +0 -38
- package/apps/lib/components/DataViews/types.ts +0 -510
- package/apps/lib/components/DataViews/views/board-view.tsx +0 -381
- package/apps/lib/components/DataViews/views/card-rows.tsx +0 -36
- package/apps/lib/components/DataViews/views/inbox-view.tsx +0 -260
- package/apps/lib/components/DataViews/views/pane-views.tsx +0 -196
- package/apps/lib/components/DataViews/views/table-view.tsx +0 -493
- package/apps/lib/components/DataViews/views/tree-view.tsx +0 -367
- package/apps/lib/components/DatePicker.tsx +0 -232
- package/apps/lib/components/Dialog.tsx +0 -116
- package/apps/lib/components/Divider.tsx +0 -28
- package/apps/lib/components/Drawer.tsx +0 -420
- package/apps/lib/components/DropdownMenu.tsx +0 -540
- package/apps/lib/components/FieldHint.tsx +0 -69
- package/apps/lib/components/Form.tsx +0 -182
- package/apps/lib/components/FormBuilder/context.ts +0 -73
- package/apps/lib/components/FormBuilder/field-kind.ts +0 -28
- package/apps/lib/components/FormBuilder/fields/ChoiceFields.tsx +0 -60
- package/apps/lib/components/FormBuilder/fields/ColorField.tsx +0 -59
- package/apps/lib/components/FormBuilder/fields/CustomField.tsx +0 -11
- package/apps/lib/components/FormBuilder/fields/DateField.tsx +0 -32
- package/apps/lib/components/FormBuilder/fields/FieldArray.tsx +0 -74
- package/apps/lib/components/FormBuilder/fields/FieldShell.tsx +0 -163
- package/apps/lib/components/FormBuilder/fields/FileField.tsx +0 -39
- package/apps/lib/components/FormBuilder/fields/OptionListFields.tsx +0 -132
- package/apps/lib/components/FormBuilder/fields/OtpField.tsx +0 -31
- package/apps/lib/components/FormBuilder/fields/PhoneField.tsx +0 -109
- package/apps/lib/components/FormBuilder/fields/RichTextEditorField.tsx +0 -31
- package/apps/lib/components/FormBuilder/fields/SelectField.tsx +0 -91
- package/apps/lib/components/FormBuilder/fields/SignatureField.tsx +0 -157
- package/apps/lib/components/FormBuilder/fields/SliderField.tsx +0 -67
- package/apps/lib/components/FormBuilder/fields/SwitchBoxField.tsx +0 -41
- package/apps/lib/components/FormBuilder/fields/TableField.tsx +0 -336
- package/apps/lib/components/FormBuilder/fields/TextField.tsx +0 -213
- package/apps/lib/components/FormBuilder/fields/TreeSelectField.tsx +0 -43
- package/apps/lib/components/FormBuilder/fields/countries.ts +0 -303
- package/apps/lib/components/FormBuilder/fields/index.ts +0 -25
- package/apps/lib/components/FormBuilder/form-builder.tsx +0 -198
- package/apps/lib/components/FormBuilder/index.ts +0 -31
- package/apps/lib/components/FormBuilder/numberFormat.ts +0 -16
- package/apps/lib/components/FormBuilder/submit.tsx +0 -47
- package/apps/lib/components/FormBuilder/types.ts +0 -311
- package/apps/lib/components/FormRenderer/FormDrawer.tsx +0 -128
- package/apps/lib/components/FormRenderer/detail.tsx +0 -207
- package/apps/lib/components/FormRenderer/form-renderer.tsx +0 -297
- package/apps/lib/components/FormRenderer/header.tsx +0 -88
- package/apps/lib/components/FormRenderer/index.ts +0 -15
- package/apps/lib/components/FormRenderer/section.tsx +0 -39
- package/apps/lib/components/FormRenderer/stepper.tsx +0 -339
- package/apps/lib/components/FormRenderer/types.ts +0 -78
- package/apps/lib/components/FormSummary.tsx +0 -282
- package/apps/lib/components/HeaderBar.tsx +0 -117
- package/apps/lib/components/ImageAttachment.tsx +0 -209
- package/apps/lib/components/InnerLabelField.tsx +0 -154
- package/apps/lib/components/Input.tsx +0 -224
- package/apps/lib/components/InputField.tsx +0 -147
- package/apps/lib/components/InputOTP.tsx +0 -84
- package/apps/lib/components/Label.tsx +0 -129
- package/apps/lib/components/LabelField.tsx +0 -76
- package/apps/lib/components/LabeledCheckBox.tsx +0 -51
- package/apps/lib/components/LabeledRadio.tsx +0 -51
- package/apps/lib/components/LinkButton.tsx +0 -94
- package/apps/lib/components/LoginButton.tsx +0 -51
- package/apps/lib/components/PasswordLevel.tsx +0 -58
- package/apps/lib/components/Popover.tsx +0 -312
- package/apps/lib/components/ProfileMenu.tsx +0 -85
- package/apps/lib/components/Radio.tsx +0 -59
- package/apps/lib/components/RadioCard.tsx +0 -50
- package/apps/lib/components/ScrollArea.tsx +0 -54
- package/apps/lib/components/SearchField.tsx +0 -62
- package/apps/lib/components/SearchableSelect.tsx +0 -318
- package/apps/lib/components/SearchableTable.tsx +0 -344
- package/apps/lib/components/SearchableTree.tsx +0 -485
- package/apps/lib/components/SearchableTreeDialog.tsx +0 -502
- package/apps/lib/components/SectionBlock.tsx +0 -147
- package/apps/lib/components/Select.tsx +0 -347
- package/apps/lib/components/SimpleSelect.tsx +0 -225
- package/apps/lib/components/Skeleton.tsx +0 -12
- package/apps/lib/components/SlideDatePicker.tsx +0 -253
- package/apps/lib/components/SpinLoading.tsx +0 -174
- package/apps/lib/components/Stepper.tsx +0 -480
- package/apps/lib/components/Switch.tsx +0 -82
- package/apps/lib/components/TabFormItem.tsx +0 -153
- package/apps/lib/components/TabSwitch.tsx +0 -172
- package/apps/lib/components/Table.tsx +0 -610
- package/apps/lib/components/TextEditor/ChartBlockTool.ts +0 -676
- package/apps/lib/components/TextEditor/RichTextField.tsx +0 -46
- package/apps/lib/components/TextEditor/TableDnDWrapper.ts +0 -462
- package/apps/lib/components/TextEditor/TextEditor.tsx +0 -1164
- package/apps/lib/components/TextEditor/TextEditorToolbar.tsx +0 -429
- package/apps/lib/components/TextEditor/editor-tools/AlignmentTune.ts +0 -70
- package/apps/lib/components/TextEditor/editor-tools/ColorInlineTool.ts +0 -50
- package/apps/lib/components/TextEditor/editor-tools/StrikethroughInlineTool.ts +0 -48
- package/apps/lib/components/TextEditor/editor-tools/inlineFormat.ts +0 -98
- package/apps/lib/components/TextEditor/editorjs.d.ts +0 -60
- package/apps/lib/components/TextEditor/index.ts +0 -7
- package/apps/lib/components/TextEditor/markdownParser.ts +0 -346
- package/apps/lib/components/Textarea.tsx +0 -117
- package/apps/lib/components/Timeline.tsx +0 -263
- package/apps/lib/components/Toast.tsx +0 -87
- package/apps/lib/components/Toggle.tsx +0 -125
- package/apps/lib/components/ToggleButton.tsx +0 -140
- package/apps/lib/components/Tooltip.tsx +0 -116
- package/apps/lib/components/TransparentLabel.tsx +0 -71
- package/apps/lib/components/TreeDropDown.tsx +0 -115
- package/apps/lib/components/TreeFolder/TreeFolder.tsx +0 -380
- package/apps/lib/components/TreeFolder/TreeFolderBreadcrumb.tsx +0 -75
- package/apps/lib/components/TreeFolder/TreeFolderRow.tsx +0 -354
- package/apps/lib/components/TreeFolder/TreeFolderStyles.tsx +0 -60
- package/apps/lib/components/TreeFolder/icons.tsx +0 -60
- package/apps/lib/components/TreeFolder/index.ts +0 -24
- package/apps/lib/components/TreeFolder/treeFolderUtils.ts +0 -109
- package/apps/lib/components/TreeFolder/types.ts +0 -77
- package/apps/lib/components/TreeFolder/useTreeFolderDnD.ts +0 -118
- package/apps/lib/hooks/useActiveTreeItem.ts +0 -58
- package/apps/lib/hooks/useClickOutside.ts +0 -27
- package/apps/lib/hooks/useDragDrop.tsx +0 -365
- package/apps/lib/hooks/useInfiniteScroll.ts +0 -108
- package/apps/lib/hooks/useIsMobile.ts +0 -21
- package/apps/lib/hooks/useResize.ts +0 -67
- package/apps/lib/hooks/useTagSelection.ts +0 -214
- package/apps/lib/layouts/CNLayout.tsx +0 -372
- package/apps/lib/layouts/DataViewCard.tsx +0 -62
- package/apps/lib/layouts/FieldSection.tsx +0 -91
- package/apps/lib/layouts/TreeSubLayout.tsx +0 -173
- package/apps/lib/providers/ThemeProvider.tsx +0 -84
- package/apps/lib/registry.json +0 -1201
- package/apps/lib/tsconfig.json +0 -9
- package/apps/lib/tsconfig.tsbuildinfo +0 -1
- package/apps/lib/utils/cn.ts +0 -6
- package/apps/lib/utils/color.ts +0 -175
- package/apps/lib/utils/dataViews/path.ts +0 -67
- package/apps/lib/utils/dataViews/query.ts +0 -73
- package/apps/lib/utils/dataViews/types.ts +0 -187
- package/apps/lib/utils/dateFormat.ts +0 -108
- package/apps/lib/utils/resize.ts +0 -31
- package/apps/lib/utils/types.ts +0 -16
- package/docs/BLOCKS.md +0 -129
- package/docs/CHANGELOG-1.1.16.md +0 -108
- package/docs/Cover.png +0 -0
- package/docs/README.md +0 -215
- package/docs/components/action-button.md +0 -638
- package/docs/components/actions-group.md +0 -708
- package/docs/components/alert-dialog.md +0 -920
- package/docs/components/avatar.md +0 -709
- package/docs/components/badge-field.md +0 -712
- package/docs/components/badge.md +0 -301
- package/docs/components/breadcrumb.md +0 -930
- package/docs/components/button-group.md +0 -650
- package/docs/components/button.md +0 -639
- package/docs/components/calendar.md +0 -555
- package/docs/components/card.md +0 -622
- package/docs/components/chart-block-tool.md +0 -129
- package/docs/components/checkbox.md +0 -699
- package/docs/components/cn-layout.md +0 -854
- package/docs/components/color-picker.md +0 -101
- package/docs/components/conclusion-header.md +0 -80
- package/docs/components/context-menu.md +0 -483
- package/docs/components/count-badge.md +0 -560
- package/docs/components/data-table.md +0 -854
- package/docs/components/data-views/backend-response.md +0 -324
- package/docs/components/data-views/examples/a11y-rtl.md +0 -250
- package/docs/components/data-views/examples/api-orders-route.md +0 -130
- package/docs/components/data-views/examples/fields.md +0 -362
- package/docs/components/data-views/examples/filters.md +0 -307
- package/docs/components/data-views/examples/inbox-routing.md +0 -218
- package/docs/components/data-views/examples/index.md +0 -29
- package/docs/components/data-views/examples/overview.md +0 -244
- package/docs/components/data-views/examples/panel.md +0 -212
- package/docs/components/data-views/examples/scale.md +0 -231
- package/docs/components/data-views/examples/server-side.md +0 -210
- package/docs/components/data-views/examples/state.md +0 -250
- package/docs/components/data-views/examples/tree-custom.md +0 -388
- package/docs/components/data-views/examples/view-registry.md +0 -313
- package/docs/components/data-views/examples/views.md +0 -534
- package/docs/components/data-views/guide.md +0 -405
- package/docs/components/data-views/index.md +0 -1495
- package/docs/components/data-views/migration.md +0 -79
- package/docs/components/date-picker.md +0 -857
- package/docs/components/dialog.md +0 -929
- package/docs/components/divider.md +0 -766
- package/docs/components/drawer.md +0 -654
- package/docs/components/dropdown-menu.md +0 -668
- package/docs/components/field-hint.md +0 -898
- package/docs/components/field-section.md +0 -781
- package/docs/components/form-builder.md +0 -276
- package/docs/components/form-renderer.md +0 -326
- package/docs/components/form-summary.md +0 -138
- package/docs/components/form.md +0 -785
- package/docs/components/header-bar.md +0 -188
- package/docs/components/image-attachment.md +0 -906
- package/docs/components/inner-label-field.md +0 -819
- package/docs/components/input-field.md +0 -623
- package/docs/components/input-otp.md +0 -756
- package/docs/components/input.md +0 -634
- package/docs/components/label-field.md +0 -770
- package/docs/components/label.md +0 -761
- package/docs/components/labeled-check-box.md +0 -642
- package/docs/components/labeled-radio.md +0 -796
- package/docs/components/link-button.md +0 -685
- package/docs/components/login-button.md +0 -872
- package/docs/components/password-level.md +0 -803
- package/docs/components/popover.md +0 -649
- package/docs/components/profile-menu.md +0 -656
- package/docs/components/radio-card.md +0 -801
- package/docs/components/radio.md +0 -735
- package/docs/components/scroll-area.md +0 -691
- package/docs/components/search-field.md +0 -702
- package/docs/components/searchable-select.md +0 -368
- package/docs/components/searchable-table.md +0 -438
- package/docs/components/searchable-tree-dialog.md +0 -190
- package/docs/components/searchable-tree.md +0 -200
- package/docs/components/section-block.md +0 -477
- package/docs/components/select.md +0 -709
- package/docs/components/simple-select.md +0 -741
- package/docs/components/skeleton.md +0 -706
- package/docs/components/slide-date-picker.md +0 -837
- package/docs/components/spin-loading.md +0 -696
- package/docs/components/stepper.md +0 -316
- package/docs/components/switch.md +0 -770
- package/docs/components/tab-form-item.md +0 -773
- package/docs/components/tab-switch.md +0 -170
- package/docs/components/table-dnd-wrapper.md +0 -107
- package/docs/components/table.md +0 -1088
- package/docs/components/text-editor.md +0 -735
- package/docs/components/textarea.md +0 -681
- package/docs/components/timeline.md +0 -254
- package/docs/components/toast.md +0 -773
- package/docs/components/toggle-button.md +0 -643
- package/docs/components/toggle.md +0 -882
- package/docs/components/tooltip.md +0 -513
- package/docs/components/transparent-label.md +0 -721
- package/docs/components/tree-drop-down.md +0 -740
- package/docs/components/tree-folder.md +0 -110
- package/docs/components/tree-sub-layout.md +0 -707
- package/docs/explanation/architecture.md +0 -54
- package/docs/explanation/design-system.md +0 -52
- package/docs/how-to/form-and-list-recipes.md +0 -386
- package/docs/how-to/forms-with-form-builder.md +0 -472
- package/docs/how-to/guides.md +0 -1027
- package/docs/migration/changelog.md +0 -54
- package/docs/migration/form-builder-2.5.2.md +0 -113
- package/docs/reference/cli.md +0 -112
- package/docs/reference/components.md +0 -572
- package/docs/reference/hooks.md +0 -1500
- package/docs/reference/providers.md +0 -866
- package/docs/reference/tailwind-plugins.md +0 -942
- package/docs/reference/theme.md +0 -85
- package/docs/reference/types.md +0 -1016
- package/docs/reference/utilities.md +0 -704
- package/docs/tutorials/building-first-form.md +0 -846
- package/docs/tutorials/component-composition.md +0 -882
- package/docs/tutorials/getting-started.md +0 -302
- package/docs/tutorials/theming-basics.md +0 -785
|
@@ -1,642 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: LabeledCheckBox
|
|
3
|
-
version: 2.4.5
|
|
4
|
-
status: stable
|
|
5
|
-
category: components/forms
|
|
6
|
-
tags: [form, checkbox, label, selection, accessible, compound]
|
|
7
|
-
last-reviewed: 2024-11-05
|
|
8
|
-
bundle-size: 2.1kb
|
|
9
|
-
dependencies:
|
|
10
|
-
- "@/components/Checkbox": "internal"
|
|
11
|
-
- "@/components/Label": "internal"
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
# LabeledCheckBox
|
|
15
|
-
|
|
16
|
-
> A checkbox component with integrated label, supporting required indicators and secondary labels. Combines Checkbox and Label components for a complete form field solution with automatic accessibility handling.
|
|
17
|
-
|
|
18
|
-
## Installation
|
|
19
|
-
|
|
20
|
-
TORCH Glare is a copy-in library: the CLI copies this component's source into your project
|
|
21
|
-
(you do **not** install it from the npm package). Run `init` once, then `add`:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
npx torch-glare@latest init
|
|
25
|
-
npx torch-glare@latest add LabeledCheckBox
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
`add` also copies any components, hooks, and utilities that `LabeledCheckBox` depends on.
|
|
29
|
-
|
|
30
|
-
## Import
|
|
31
|
-
|
|
32
|
-
Import from your project's local path — the alias configured in `glare.json` (e.g. `@/*`):
|
|
33
|
-
|
|
34
|
-
```tsx
|
|
35
|
-
import { LabeledCheckBox } from "@/components/LabeledCheckBox";
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## Quick Examples
|
|
39
|
-
|
|
40
|
-
### Basic Usage
|
|
41
|
-
|
|
42
|
-
```typescript
|
|
43
|
-
import { LabeledCheckBox } from '@/components/LabeledCheckBox'
|
|
44
|
-
|
|
45
|
-
function Example() {
|
|
46
|
-
const [checked, setChecked] = useState(false)
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<LabeledCheckBox
|
|
50
|
-
id="terms"
|
|
51
|
-
label="I agree to the terms and conditions"
|
|
52
|
-
checked={checked}
|
|
53
|
-
onCheckedChange={setChecked}
|
|
54
|
-
/>
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Required Field
|
|
60
|
-
|
|
61
|
-
```typescript
|
|
62
|
-
function RequiredCheckbox() {
|
|
63
|
-
const [agreed, setAgreed] = useState(false)
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<LabeledCheckBox
|
|
67
|
-
id="consent"
|
|
68
|
-
label="Privacy Policy"
|
|
69
|
-
requiredLabel="*"
|
|
70
|
-
secondaryLabel="(required)"
|
|
71
|
-
checked={agreed}
|
|
72
|
-
onCheckedChange={setAgreed}
|
|
73
|
-
required
|
|
74
|
-
/>
|
|
75
|
-
)
|
|
76
|
-
}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### Different Sizes
|
|
80
|
-
|
|
81
|
-
```typescript
|
|
82
|
-
function SizeVariants() {
|
|
83
|
-
return (
|
|
84
|
-
<div className="space-y-4">
|
|
85
|
-
<LabeledCheckBox
|
|
86
|
-
id="small"
|
|
87
|
-
label="Small checkbox"
|
|
88
|
-
size="S"
|
|
89
|
-
/>
|
|
90
|
-
|
|
91
|
-
<LabeledCheckBox
|
|
92
|
-
id="medium"
|
|
93
|
-
label="Medium checkbox (default)"
|
|
94
|
-
size="M"
|
|
95
|
-
/>
|
|
96
|
-
|
|
97
|
-
<LabeledCheckBox
|
|
98
|
-
id="large"
|
|
99
|
-
label="Large checkbox"
|
|
100
|
-
size="L"
|
|
101
|
-
/>
|
|
102
|
-
</div>
|
|
103
|
-
)
|
|
104
|
-
}
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
### With Secondary Label
|
|
108
|
-
|
|
109
|
-
```typescript
|
|
110
|
-
function DetailedCheckbox() {
|
|
111
|
-
return (
|
|
112
|
-
<LabeledCheckBox
|
|
113
|
-
id="notifications"
|
|
114
|
-
label="Email notifications"
|
|
115
|
-
secondaryLabel="Receive updates about your account"
|
|
116
|
-
defaultChecked
|
|
117
|
-
/>
|
|
118
|
-
)
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Themed Checkbox
|
|
123
|
-
|
|
124
|
-
```typescript
|
|
125
|
-
function ThemedCheckboxes() {
|
|
126
|
-
return (
|
|
127
|
-
<>
|
|
128
|
-
<LabeledCheckBox
|
|
129
|
-
id="light"
|
|
130
|
-
label="Light theme checkbox"
|
|
131
|
-
theme="light"
|
|
132
|
-
/>
|
|
133
|
-
|
|
134
|
-
<LabeledCheckBox
|
|
135
|
-
id="dark"
|
|
136
|
-
label="Dark theme checkbox"
|
|
137
|
-
theme="dark"
|
|
138
|
-
/>
|
|
139
|
-
</>
|
|
140
|
-
)
|
|
141
|
-
}
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
### Form Integration
|
|
145
|
-
|
|
146
|
-
```typescript
|
|
147
|
-
function PreferencesForm() {
|
|
148
|
-
const [preferences, setPreferences] = useState({
|
|
149
|
-
marketing: false,
|
|
150
|
-
analytics: false,
|
|
151
|
-
necessary: true
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
const updatePreference = (key: string, value: boolean) => {
|
|
155
|
-
setPreferences(prev => ({ ...prev, [key]: value }))
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
return (
|
|
159
|
-
<form className="space-y-3">
|
|
160
|
-
<h3>Cookie Preferences</h3>
|
|
161
|
-
|
|
162
|
-
<LabeledCheckBox
|
|
163
|
-
id="necessary"
|
|
164
|
-
label="Necessary Cookies"
|
|
165
|
-
secondaryLabel="Required for site functionality"
|
|
166
|
-
checked={preferences.necessary}
|
|
167
|
-
disabled
|
|
168
|
-
/>
|
|
169
|
-
|
|
170
|
-
<LabeledCheckBox
|
|
171
|
-
id="analytics"
|
|
172
|
-
label="Analytics Cookies"
|
|
173
|
-
secondaryLabel="Help us improve our service"
|
|
174
|
-
checked={preferences.analytics}
|
|
175
|
-
onCheckedChange={(checked) =>
|
|
176
|
-
updatePreference('analytics', checked === true)
|
|
177
|
-
}
|
|
178
|
-
/>
|
|
179
|
-
|
|
180
|
-
<LabeledCheckBox
|
|
181
|
-
id="marketing"
|
|
182
|
-
label="Marketing Cookies"
|
|
183
|
-
secondaryLabel="Personalized advertisements"
|
|
184
|
-
checked={preferences.marketing}
|
|
185
|
-
onCheckedChange={(checked) =>
|
|
186
|
-
updatePreference('marketing', checked === true)
|
|
187
|
-
}
|
|
188
|
-
/>
|
|
189
|
-
|
|
190
|
-
<button type="submit">Save Preferences</button>
|
|
191
|
-
</form>
|
|
192
|
-
)
|
|
193
|
-
}
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
## API Reference
|
|
197
|
-
|
|
198
|
-
### LabeledCheckBox Props
|
|
199
|
-
|
|
200
|
-
| Prop | Type | Default | Description |
|
|
201
|
-
|------|------|---------|-------------|
|
|
202
|
-
| `id` | `string` | - | Required unique identifier |
|
|
203
|
-
| `label` | `string` | - | Primary label text |
|
|
204
|
-
| `secondaryLabel` | `string` | - | Additional descriptive text |
|
|
205
|
-
| `requiredLabel` | `string` | - | Required field indicator |
|
|
206
|
-
| `size` | `'S' \| 'M' \| 'L'` | `'M'` | Size variant |
|
|
207
|
-
| `theme` | `'dark' \| 'light' \| 'default'` | - | Theme variant |
|
|
208
|
-
| `checked` | `boolean \| 'indeterminate'` | - | Controlled checked state |
|
|
209
|
-
| `defaultChecked` | `boolean` | - | Uncontrolled default state |
|
|
210
|
-
| `onCheckedChange` | `(checked: boolean \| 'indeterminate') => void` | - | Change handler |
|
|
211
|
-
| `disabled` | `boolean` | `false` | Disables the checkbox |
|
|
212
|
-
| `required` | `boolean` | `false` | Makes field required |
|
|
213
|
-
| `className` | `string` | - | Additional CSS classes |
|
|
214
|
-
|
|
215
|
-
Plus all props from the underlying Checkbox component except `size`.
|
|
216
|
-
|
|
217
|
-
### TypeScript
|
|
218
|
-
|
|
219
|
-
```typescript
|
|
220
|
-
import { ComponentProps } from 'react'
|
|
221
|
-
import { Checkbox } from '@/components/Checkbox'
|
|
222
|
-
|
|
223
|
-
interface LabeledCheckBoxProps extends Omit<ComponentProps<typeof Checkbox>, 'size'> {
|
|
224
|
-
label: string
|
|
225
|
-
id: string
|
|
226
|
-
secondaryLabel?: string
|
|
227
|
-
requiredLabel?: string
|
|
228
|
-
size?: 'S' | 'M' | 'L'
|
|
229
|
-
theme?: 'dark' | 'light' | 'default'
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export const LabeledCheckBox: React.ForwardRefExoticComponent<LabeledCheckBoxProps>
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
## Common Patterns
|
|
236
|
-
|
|
237
|
-
### Terms and Conditions
|
|
238
|
-
|
|
239
|
-
```typescript
|
|
240
|
-
function TermsAcceptance() {
|
|
241
|
-
const [accepted, setAccepted] = useState(false)
|
|
242
|
-
const [error, setError] = useState<string>()
|
|
243
|
-
|
|
244
|
-
const handleSubmit = (e: FormEvent) => {
|
|
245
|
-
e.preventDefault()
|
|
246
|
-
if (!accepted) {
|
|
247
|
-
setError('You must accept the terms to continue')
|
|
248
|
-
return
|
|
249
|
-
}
|
|
250
|
-
// Process form
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
return (
|
|
254
|
-
<form onSubmit={handleSubmit}>
|
|
255
|
-
<div className="space-y-4">
|
|
256
|
-
<LabeledCheckBox
|
|
257
|
-
id="terms"
|
|
258
|
-
label="I accept the terms and conditions"
|
|
259
|
-
requiredLabel="*"
|
|
260
|
-
secondaryLabel="Please read our terms before proceeding"
|
|
261
|
-
checked={accepted}
|
|
262
|
-
onCheckedChange={(checked) => {
|
|
263
|
-
setAccepted(checked === true)
|
|
264
|
-
setError(undefined)
|
|
265
|
-
}}
|
|
266
|
-
className={error ? 'text-red-500' : ''}
|
|
267
|
-
/>
|
|
268
|
-
{error && <p className="text-red-500 text-sm">{error}</p>}
|
|
269
|
-
</div>
|
|
270
|
-
|
|
271
|
-
<button type="submit" disabled={!accepted}>
|
|
272
|
-
Continue
|
|
273
|
-
</button>
|
|
274
|
-
</form>
|
|
275
|
-
)
|
|
276
|
-
}
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
### Feature Toggles
|
|
280
|
-
|
|
281
|
-
```typescript
|
|
282
|
-
function FeatureSettings() {
|
|
283
|
-
const [features, setFeatures] = useState({
|
|
284
|
-
darkMode: false,
|
|
285
|
-
notifications: true,
|
|
286
|
-
autoSave: true,
|
|
287
|
-
betaFeatures: false
|
|
288
|
-
})
|
|
289
|
-
|
|
290
|
-
const toggleFeature = (feature: string) => {
|
|
291
|
-
setFeatures(prev => ({
|
|
292
|
-
...prev,
|
|
293
|
-
[feature]: !prev[feature as keyof typeof features]
|
|
294
|
-
}))
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
return (
|
|
298
|
-
<div className="space-y-4">
|
|
299
|
-
<h3>Feature Settings</h3>
|
|
300
|
-
|
|
301
|
-
<LabeledCheckBox
|
|
302
|
-
id="dark-mode"
|
|
303
|
-
label="Dark Mode"
|
|
304
|
-
secondaryLabel="Use dark theme across the application"
|
|
305
|
-
checked={features.darkMode}
|
|
306
|
-
onCheckedChange={() => toggleFeature('darkMode')}
|
|
307
|
-
size="M"
|
|
308
|
-
/>
|
|
309
|
-
|
|
310
|
-
<LabeledCheckBox
|
|
311
|
-
id="notifications"
|
|
312
|
-
label="Push Notifications"
|
|
313
|
-
secondaryLabel="Receive real-time updates"
|
|
314
|
-
checked={features.notifications}
|
|
315
|
-
onCheckedChange={() => toggleFeature('notifications')}
|
|
316
|
-
size="M"
|
|
317
|
-
/>
|
|
318
|
-
|
|
319
|
-
<LabeledCheckBox
|
|
320
|
-
id="auto-save"
|
|
321
|
-
label="Auto-Save"
|
|
322
|
-
secondaryLabel="Automatically save your work"
|
|
323
|
-
checked={features.autoSave}
|
|
324
|
-
onCheckedChange={() => toggleFeature('autoSave')}
|
|
325
|
-
size="M"
|
|
326
|
-
/>
|
|
327
|
-
|
|
328
|
-
<LabeledCheckBox
|
|
329
|
-
id="beta"
|
|
330
|
-
label="Beta Features"
|
|
331
|
-
secondaryLabel="Try experimental features"
|
|
332
|
-
checked={features.betaFeatures}
|
|
333
|
-
onCheckedChange={() => toggleFeature('betaFeatures')}
|
|
334
|
-
size="M"
|
|
335
|
-
/>
|
|
336
|
-
</div>
|
|
337
|
-
)
|
|
338
|
-
}
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
### Subscription Options
|
|
342
|
-
|
|
343
|
-
```typescript
|
|
344
|
-
function EmailSubscriptions() {
|
|
345
|
-
const [subscriptions, setSubscriptions] = useState<string[]>([])
|
|
346
|
-
|
|
347
|
-
const options = [
|
|
348
|
-
{
|
|
349
|
-
id: 'newsletter',
|
|
350
|
-
label: 'Weekly Newsletter',
|
|
351
|
-
description: 'Product updates and tips'
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
id: 'promotions',
|
|
355
|
-
label: 'Promotional Emails',
|
|
356
|
-
description: 'Special offers and discounts'
|
|
357
|
-
},
|
|
358
|
-
{
|
|
359
|
-
id: 'digest',
|
|
360
|
-
label: 'Daily Digest',
|
|
361
|
-
description: 'Summary of daily activity'
|
|
362
|
-
}
|
|
363
|
-
]
|
|
364
|
-
|
|
365
|
-
const toggleSubscription = (id: string) => {
|
|
366
|
-
setSubscriptions(prev =>
|
|
367
|
-
prev.includes(id)
|
|
368
|
-
? prev.filter(s => s !== id)
|
|
369
|
-
: [...prev, id]
|
|
370
|
-
)
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
return (
|
|
374
|
-
<div className="space-y-3">
|
|
375
|
-
<h3>Email Subscriptions</h3>
|
|
376
|
-
{options.map(option => (
|
|
377
|
-
<LabeledCheckBox
|
|
378
|
-
key={option.id}
|
|
379
|
-
id={option.id}
|
|
380
|
-
label={option.label}
|
|
381
|
-
secondaryLabel={option.description}
|
|
382
|
-
checked={subscriptions.includes(option.id)}
|
|
383
|
-
onCheckedChange={() => toggleSubscription(option.id)}
|
|
384
|
-
/>
|
|
385
|
-
))}
|
|
386
|
-
<p className="text-sm text-gray-600">
|
|
387
|
-
Subscribed to: {subscriptions.length} list(s)
|
|
388
|
-
</p>
|
|
389
|
-
</div>
|
|
390
|
-
)
|
|
391
|
-
}
|
|
392
|
-
```
|
|
393
|
-
|
|
394
|
-
## Testing
|
|
395
|
-
|
|
396
|
-
### Unit Test Example
|
|
397
|
-
|
|
398
|
-
```typescript
|
|
399
|
-
import { render, screen, fireEvent } from '@testing-library/react'
|
|
400
|
-
import { LabeledCheckBox } from '@/components/LabeledCheckBox'
|
|
401
|
-
|
|
402
|
-
describe('LabeledCheckBox', () => {
|
|
403
|
-
it('renders label and checkbox together', () => {
|
|
404
|
-
render(
|
|
405
|
-
<LabeledCheckBox
|
|
406
|
-
id="test"
|
|
407
|
-
label="Test Label"
|
|
408
|
-
secondaryLabel="Secondary text"
|
|
409
|
-
/>
|
|
410
|
-
)
|
|
411
|
-
|
|
412
|
-
expect(screen.getByText('Test Label')).toBeInTheDocument()
|
|
413
|
-
expect(screen.getByText('Secondary text')).toBeInTheDocument()
|
|
414
|
-
expect(screen.getByRole('checkbox')).toBeInTheDocument()
|
|
415
|
-
})
|
|
416
|
-
|
|
417
|
-
it('handles checked state changes', () => {
|
|
418
|
-
const handleChange = jest.fn()
|
|
419
|
-
render(
|
|
420
|
-
<LabeledCheckBox
|
|
421
|
-
id="test"
|
|
422
|
-
label="Click me"
|
|
423
|
-
onCheckedChange={handleChange}
|
|
424
|
-
/>
|
|
425
|
-
)
|
|
426
|
-
|
|
427
|
-
const checkbox = screen.getByRole('checkbox')
|
|
428
|
-
fireEvent.click(checkbox)
|
|
429
|
-
|
|
430
|
-
expect(handleChange).toHaveBeenCalledWith(true)
|
|
431
|
-
})
|
|
432
|
-
|
|
433
|
-
it('shows required indicator', () => {
|
|
434
|
-
render(
|
|
435
|
-
<LabeledCheckBox
|
|
436
|
-
id="test"
|
|
437
|
-
label="Required field"
|
|
438
|
-
requiredLabel="*"
|
|
439
|
-
required
|
|
440
|
-
/>
|
|
441
|
-
)
|
|
442
|
-
|
|
443
|
-
expect(screen.getByText('*')).toBeInTheDocument()
|
|
444
|
-
})
|
|
445
|
-
|
|
446
|
-
it('respects disabled state', () => {
|
|
447
|
-
render(
|
|
448
|
-
<LabeledCheckBox
|
|
449
|
-
id="test"
|
|
450
|
-
label="Disabled"
|
|
451
|
-
disabled
|
|
452
|
-
/>
|
|
453
|
-
)
|
|
454
|
-
|
|
455
|
-
const checkbox = screen.getByRole('checkbox')
|
|
456
|
-
expect(checkbox).toBeDisabled()
|
|
457
|
-
})
|
|
458
|
-
})
|
|
459
|
-
```
|
|
460
|
-
|
|
461
|
-
### Accessibility Test
|
|
462
|
-
|
|
463
|
-
```typescript
|
|
464
|
-
import { axe } from '@axe-core/react'
|
|
465
|
-
|
|
466
|
-
test('LabeledCheckBox meets WCAG standards', async () => {
|
|
467
|
-
const { container } = render(
|
|
468
|
-
<LabeledCheckBox
|
|
469
|
-
id="accessible"
|
|
470
|
-
label="Accessible checkbox"
|
|
471
|
-
secondaryLabel="With description"
|
|
472
|
-
requiredLabel="*"
|
|
473
|
-
required
|
|
474
|
-
/>
|
|
475
|
-
)
|
|
476
|
-
|
|
477
|
-
const results = await axe(container)
|
|
478
|
-
expect(results).toHaveNoViolations()
|
|
479
|
-
})
|
|
480
|
-
```
|
|
481
|
-
|
|
482
|
-
## Accessibility
|
|
483
|
-
|
|
484
|
-
### Automatic Features
|
|
485
|
-
|
|
486
|
-
- Label automatically associated with checkbox via `id`
|
|
487
|
-
- Proper ARIA attributes inherited from Checkbox component
|
|
488
|
-
- Required state communicated to screen readers
|
|
489
|
-
- Secondary label provides additional context
|
|
490
|
-
|
|
491
|
-
### Keyboard Support
|
|
492
|
-
|
|
493
|
-
- **Space**: Toggle checkbox when focused
|
|
494
|
-
- **Tab**: Move focus to/from checkbox
|
|
495
|
-
- **Shift + Tab**: Move focus backwards
|
|
496
|
-
|
|
497
|
-
### Screen Reader Support
|
|
498
|
-
|
|
499
|
-
```html
|
|
500
|
-
<!-- Rendered HTML structure -->
|
|
501
|
-
<label for="checkbox-id">
|
|
502
|
-
<span>Primary Label</span>
|
|
503
|
-
<span>*</span>
|
|
504
|
-
<span>Secondary Label</span>
|
|
505
|
-
<button
|
|
506
|
-
role="checkbox"
|
|
507
|
-
aria-checked="false"
|
|
508
|
-
aria-required="true"
|
|
509
|
-
id="checkbox-id"
|
|
510
|
-
/>
|
|
511
|
-
</label>
|
|
512
|
-
```
|
|
513
|
-
|
|
514
|
-
### Focus Management
|
|
515
|
-
|
|
516
|
-
- Visual focus ring on checkbox
|
|
517
|
-
- Label click triggers checkbox toggle
|
|
518
|
-
- Maintains focus during state changes
|
|
519
|
-
|
|
520
|
-
## Styling
|
|
521
|
-
|
|
522
|
-
### Custom Styles
|
|
523
|
-
|
|
524
|
-
```typescript
|
|
525
|
-
<LabeledCheckBox
|
|
526
|
-
id="custom"
|
|
527
|
-
label="Custom styled"
|
|
528
|
-
className="text-blue-600 hover:text-blue-700"
|
|
529
|
-
size="L"
|
|
530
|
-
/>
|
|
531
|
-
```
|
|
532
|
-
|
|
533
|
-
### Size Variants Mapping
|
|
534
|
-
|
|
535
|
-
| LabeledCheckBox Size | Checkbox Size | Label Size |
|
|
536
|
-
|---------------------|---------------|------------|
|
|
537
|
-
| S | S | S |
|
|
538
|
-
| M | M | M |
|
|
539
|
-
| L | M | M |
|
|
540
|
-
|
|
541
|
-
Note: Large size uses medium checkbox for visual balance.
|
|
542
|
-
|
|
543
|
-
## Performance
|
|
544
|
-
|
|
545
|
-
| Metric | Value |
|
|
546
|
-
|--------|-------|
|
|
547
|
-
| Bundle size (gzip) | 2.1kb |
|
|
548
|
-
| First render | <6ms |
|
|
549
|
-
| Re-render | <3ms |
|
|
550
|
-
| Tree-shakeable | ✅ |
|
|
551
|
-
|
|
552
|
-
### Optimization Tips
|
|
553
|
-
|
|
554
|
-
1. Use uncontrolled mode with `defaultChecked` when possible
|
|
555
|
-
2. Memoize change handlers with `useCallback`
|
|
556
|
-
3. Group multiple checkboxes in a single parent component
|
|
557
|
-
4. Use React.memo for lists of checkboxes
|
|
558
|
-
|
|
559
|
-
## Migration
|
|
560
|
-
|
|
561
|
-
### From Separate Checkbox and Label
|
|
562
|
-
|
|
563
|
-
```diff
|
|
564
|
-
// Old approach
|
|
565
|
-
- <div>
|
|
566
|
-
- <label htmlFor="cb">Label</label>
|
|
567
|
-
- <Checkbox id="cb" />
|
|
568
|
-
- </div>
|
|
569
|
-
|
|
570
|
-
// New approach
|
|
571
|
-
+ <LabeledCheckBox
|
|
572
|
-
+ id="cb"
|
|
573
|
-
+ label="Label"
|
|
574
|
-
+ />
|
|
575
|
-
```
|
|
576
|
-
|
|
577
|
-
### From v1.0.x
|
|
578
|
-
|
|
579
|
-
```diff
|
|
580
|
-
// Import path
|
|
581
|
-
- import LabeledCheckBox from 'torch-glare/LabeledCheckBox'
|
|
582
|
-
+ import { LabeledCheckBox } from '@/components/LabeledCheckBox'
|
|
583
|
-
|
|
584
|
-
// Size prop values
|
|
585
|
-
- <LabeledCheckBox size="M" />
|
|
586
|
-
+ <LabeledCheckBox size="S" />
|
|
587
|
-
```
|
|
588
|
-
|
|
589
|
-
## Troubleshooting
|
|
590
|
-
|
|
591
|
-
### Label not clickable
|
|
592
|
-
|
|
593
|
-
**Solution:** Ensure `id` prop is provided and unique
|
|
594
|
-
|
|
595
|
-
```typescript
|
|
596
|
-
// ❌ Wrong - missing id
|
|
597
|
-
<LabeledCheckBox label="Click me" />
|
|
598
|
-
|
|
599
|
-
// ✅ Correct - with unique id
|
|
600
|
-
<LabeledCheckBox id="unique-id" label="Click me" />
|
|
601
|
-
```
|
|
602
|
-
|
|
603
|
-
### Styles not applying
|
|
604
|
-
|
|
605
|
-
**Solution:** Use className for custom styles
|
|
606
|
-
|
|
607
|
-
```typescript
|
|
608
|
-
<LabeledCheckBox
|
|
609
|
-
id="styled"
|
|
610
|
-
label="Custom"
|
|
611
|
-
className="custom-class"
|
|
612
|
-
/>
|
|
613
|
-
```
|
|
614
|
-
|
|
615
|
-
## Related Components
|
|
616
|
-
|
|
617
|
-
- [Checkbox](/docs/components/checkbox.md) - Base checkbox component
|
|
618
|
-
- [Label](/docs/components/label.md) - Label component
|
|
619
|
-
- [LabeledRadio](/docs/components/labeled-radio.md) - Radio with label
|
|
620
|
-
- [Switch](/docs/components/switch.md) - Toggle switch alternative
|
|
621
|
-
|
|
622
|
-
## Browser Support
|
|
623
|
-
|
|
624
|
-
- Chrome 90+ ✅
|
|
625
|
-
- Firefox 88+ ✅
|
|
626
|
-
- Safari 14+ ✅
|
|
627
|
-
- Edge 90+ ✅
|
|
628
|
-
- Mobile browsers ✅
|
|
629
|
-
|
|
630
|
-
## Changelog
|
|
631
|
-
|
|
632
|
-
### v1.1.15
|
|
633
|
-
- Integrated Label component
|
|
634
|
-
- Added size variants
|
|
635
|
-
- Improved accessibility
|
|
636
|
-
|
|
637
|
-
### v1.1.14
|
|
638
|
-
- Added theme support
|
|
639
|
-
- Fixed label association
|
|
640
|
-
|
|
641
|
-
### v1.1.0
|
|
642
|
-
- Initial stable release
|