@astryxdesign/core 0.5.2-canary.457de8d → 0.5.2-canary.51c960c
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/package.json +2 -2
- package/src/BottomSheet/BottomSheet.doc.mjs +31 -0
- package/src/BottomSheet/BottomSheet.spec.md +177 -0
- package/src/CheckboxList/CheckboxList.doc.mjs +172 -31
- package/src/CheckboxList/CheckboxList.spec.md +214 -0
- package/src/CommandPalette/CommandPalette.doc.mjs +72 -0
- package/src/CommandPalette/CommandPalette.spec.md +223 -0
- package/src/ComplexSelector/ComplexSelector.doc.mjs +42 -0
- package/src/ComplexSelector/ComplexSelector.spec.md +189 -0
- package/src/ContextMenu/ContextMenu.doc.mjs +48 -0
- package/src/ContextMenu/ContextMenu.spec.md +206 -0
- package/src/Divider/Divider.doc.mjs +24 -0
- package/src/Divider/Divider.spec.md +150 -0
- package/src/DropdownMenu/DropdownMenu.doc.mjs +104 -0
- package/src/DropdownMenu/DropdownMenu.spec.md +245 -0
- package/src/FieldStatus/FieldStatus.doc.mjs +21 -0
- package/src/FieldStatus/FieldStatus.spec.md +212 -0
- package/src/Grid/Grid.doc.mjs +19 -0
- package/src/Grid/Grid.spec.md +161 -0
- package/src/Icon/Icon.doc.mjs +196 -48
- package/src/Icon/Icon.spec.md +191 -0
- package/src/Kbd/Kbd.doc.mjs +18 -0
- package/src/Kbd/Kbd.spec.md +141 -0
- package/src/Layout/Layout.doc.mjs +32 -0
- package/src/Layout/Layout.spec.md +199 -0
- package/src/Lightbox/Lightbox.doc.mjs +149 -33
- package/src/Lightbox/Lightbox.spec.md +197 -0
- package/src/Markdown/Markdown.doc.mjs +60 -0
- package/src/Markdown/Markdown.spec.md +200 -0
- package/src/MobileNav/MobileNav.doc.mjs +140 -32
- package/src/MobileNav/MobileNav.spec.md +208 -0
- package/src/MoreMenu/MoreMenu.doc.mjs +42 -0
- package/src/MoreMenu/MoreMenu.spec.md +221 -0
- package/src/MultiSelector/MultiSelector.doc.mjs +112 -0
- package/src/MultiSelector/MultiSelector.spec.md +266 -0
- package/src/NavIcon/NavIcon.doc.mjs +17 -0
- package/src/NavIcon/NavIcon.spec.md +133 -0
- package/src/NavMenu/NavHeadingMenu.spec.md +205 -0
- package/src/NavMenu/NavMenu.doc.mjs +37 -0
- package/src/Outline/Outline.doc.mjs +35 -0
- package/src/Outline/Outline.spec.md +161 -0
- package/src/OverflowList/OverflowList.doc.mjs +24 -0
- package/src/OverflowList/OverflowList.spec.md +156 -0
- package/src/Pagination/Pagination.doc.mjs +74 -0
- package/src/Pagination/Pagination.spec.md +225 -0
- package/src/ProgressBar/ProgressBar.doc.mjs +198 -38
- package/src/ProgressBar/ProgressBar.spec.md +77 -25
- package/src/Resizable/Resizable.doc.mjs +59 -16
- package/src/Resizable/Resizable.spec.md +194 -0
- package/src/Section/Section.doc.mjs +17 -0
- package/src/Section/Section.spec.md +138 -0
- package/src/SegmentedControl/SegmentedControl.doc.mjs +27 -0
- package/src/SegmentedControl/SegmentedControl.spec.md +151 -0
- package/src/Selector/Selector.spec.md +202 -0
- package/src/Skeleton/Skeleton.doc.mjs +12 -0
- package/src/Skeleton/Skeleton.spec.md +126 -0
- package/src/Slider/Slider.doc.mjs +184 -30
- package/src/Slider/Slider.spec.md +223 -0
- package/src/Stack/Stack.doc.mjs +22 -0
- package/src/Stack/Stack.spec.md +154 -0
- package/src/StatusDot/StatusDot.doc.mjs +17 -0
- package/src/StatusDot/StatusDot.spec.md +137 -0
- package/src/Switch/Switch.doc.mjs +40 -0
- package/src/Switch/Switch.spec.md +174 -0
- package/src/Table/Table.doc.mjs +102 -24
- package/src/Table/Table.spec.md +283 -0
- package/src/Text/Text.doc.mjs +190 -43
- package/src/Text/Text.spec.md +205 -0
- package/src/TextArea/TextArea.doc.mjs +255 -45
- package/src/TextArea/TextArea.spec.md +204 -0
- package/src/Toolbar/Toolbar.doc.mjs +19 -0
- package/src/Toolbar/Toolbar.spec.md +173 -0
- package/src/Tooltip/Tooltip.doc.mjs +17 -0
- package/src/Tooltip/Tooltip.spec.md +141 -0
- package/src/TreeList/TreeList.doc.mjs +58 -0
- package/src/TreeList/TreeList.spec.md +220 -0
- package/src/Typeahead/Typeahead.doc.mjs +83 -1
- package/src/Typeahead/Typeahead.spec.md +250 -0
- package/src/theme/themingTargets.test.ts +91 -25
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/core",
|
|
3
|
-
"version": "0.5.2-canary.
|
|
3
|
+
"version": "0.5.2-canary.51c960c",
|
|
4
4
|
"displayName": "Astryx Core",
|
|
5
5
|
"description": "The component library. Accessible, themeable React components with built-in spacing, dark mode, and StyleX styling.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -661,7 +661,7 @@
|
|
|
661
661
|
"react-dom": ">=19.0.0"
|
|
662
662
|
},
|
|
663
663
|
"devDependencies": {
|
|
664
|
-
"@astryxdesign/cli": "0.5.2-canary.
|
|
664
|
+
"@astryxdesign/cli": "0.5.2-canary.51c960c",
|
|
665
665
|
"@babel/cli": "^8.0.4",
|
|
666
666
|
"@babel/core": "^7.29.7",
|
|
667
667
|
"@babel/preset-react": "^8.0.1",
|
|
@@ -1,4 +1,33 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').ComponentAnatomyElement[]} */
|
|
4
|
+
const anatomy = [
|
|
5
|
+
{
|
|
6
|
+
name: 'Sheet panel',
|
|
7
|
+
required: true,
|
|
8
|
+
description:
|
|
9
|
+
'Painted surface that rises from the bottom edge and contains the sheet.',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'Content area',
|
|
13
|
+
required: true,
|
|
14
|
+
description:
|
|
15
|
+
'Scrollable area that presents the caller-provided sheet content.',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'Handle',
|
|
19
|
+
required: true,
|
|
20
|
+
description:
|
|
21
|
+
'Decorative grab affordance and drag region at the top of the panel.',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'Scrim',
|
|
25
|
+
required: false,
|
|
26
|
+
description:
|
|
27
|
+
'Backdrop that dims and blocks the page in a scrim-backed presentation.',
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
|
|
2
31
|
/** @type {import('@astryxdesign/cli/authoring').ComponentDoc} */
|
|
3
32
|
|
|
4
33
|
export const docs = {
|
|
@@ -126,6 +155,7 @@ export const docs = {
|
|
|
126
155
|
},
|
|
127
156
|
],
|
|
128
157
|
usage: {
|
|
158
|
+
anatomy,
|
|
129
159
|
description:
|
|
130
160
|
'A mobile touch surface for filters, actions, forms, and detail views that should rise from the bottom of the viewport; use BottomSheetSwitcher for multi-step flows.',
|
|
131
161
|
bestPractices: [
|
|
@@ -277,6 +307,7 @@ export const docsDense = {
|
|
|
277
307
|
description:
|
|
278
308
|
'mobile touch sheet rising from the bottom edge (native <dialog>): grab handle, opt-in transform-based drag-to-resize snap points (snapPoints: viewport fraction, percent or px length), scrolling area resizes to the snapped visible height on release (a peek stop, a quarter of the sheet or less, keeps the full height and slides instead), Dialog-aligned dismissal purpose (info/form/required), purpose-gated swipe-to-dismiss, fully-expanded Tall visual-viewport mobile-keyboard handling, named height scale, modal (default) or non-modal (hasScrim={false}) presentation',
|
|
279
309
|
usage: {
|
|
310
|
+
anatomy,
|
|
280
311
|
description:
|
|
281
312
|
'Mobile touch surface for filters, actions, forms, and detail views that should rise from the bottom of the viewport; use BottomSheetSwitcher for multi-step flows.',
|
|
282
313
|
bestPractices: [
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 1
|
|
3
|
+
template_version: 3
|
|
4
|
+
kind: component
|
|
5
|
+
id: component:BottomSheet
|
|
6
|
+
authority: draft
|
|
7
|
+
archive_reason: null
|
|
8
|
+
superseded_by: null
|
|
9
|
+
approved_by: null
|
|
10
|
+
approved_at: null
|
|
11
|
+
owners: [cixzhang]
|
|
12
|
+
review_triggers: [theming]
|
|
13
|
+
verified_by:
|
|
14
|
+
[
|
|
15
|
+
packages/core/src/BottomSheet/BottomSheet.test.tsx,
|
|
16
|
+
packages/core/src/BottomSheet/BottomSheetPanel.test.tsx,
|
|
17
|
+
scripts/check-knowledge.mjs,
|
|
18
|
+
]
|
|
19
|
+
families: [family:overlay-dismissal]
|
|
20
|
+
design_specs: []
|
|
21
|
+
architecture:
|
|
22
|
+
[architecture:component-theming-surface, architecture:layer-runtime]
|
|
23
|
+
contributing: []
|
|
24
|
+
system_specs: []
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# BottomSheet component contract
|
|
28
|
+
|
|
29
|
+
## Intent
|
|
30
|
+
|
|
31
|
+
BottomSheet presents caller-provided content in a panel that rises from the
|
|
32
|
+
bottom edge. This draft records current consumer anatomy and theming reachability
|
|
33
|
+
without changing runtime behavior, styling, targets, or public API.
|
|
34
|
+
|
|
35
|
+
## Compatibility and migration
|
|
36
|
+
|
|
37
|
+
- Released default preserved: `yes`
|
|
38
|
+
- Compatibility class: additive documentation only; runtime, DOM, styling,
|
|
39
|
+
targets, and public API remain unchanged
|
|
40
|
+
- Controlled/uncontrolled behavior: unchanged
|
|
41
|
+
- Migration decision: none
|
|
42
|
+
|
|
43
|
+
Consumer migration instructions belong in consumer docs and release notes.
|
|
44
|
+
|
|
45
|
+
## Ownership boundary
|
|
46
|
+
|
|
47
|
+
**Owns**
|
|
48
|
+
|
|
49
|
+
- The visual Sheet panel and its current `bottom-sheet` target.
|
|
50
|
+
- The scrolling Content area and decorative Handle inside the panel.
|
|
51
|
+
- Standalone sheet presentation, including its optional native-dialog Scrim.
|
|
52
|
+
|
|
53
|
+
**Does not own / non-goals**
|
|
54
|
+
|
|
55
|
+
- Caller-provided content rendered inside the Content area.
|
|
56
|
+
- A separate target for Content area, Handle, or Scrim; none exists on current
|
|
57
|
+
`main`.
|
|
58
|
+
- A shared switcher dialog or scrim — owned by BottomSheetSwitcher when the sheet
|
|
59
|
+
participates in that host.
|
|
60
|
+
- Shared layer hosting or dismissal policy.
|
|
61
|
+
|
|
62
|
+
## Public concepts
|
|
63
|
+
|
|
64
|
+
No new public concept is introduced. Consumer props and usage remain documented
|
|
65
|
+
in `BottomSheet.doc.mjs`.
|
|
66
|
+
|
|
67
|
+
## Behavioral and layout contract
|
|
68
|
+
|
|
69
|
+
| ID | Candidate invariant | Basis | Draft review state |
|
|
70
|
+
| --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------- | -------------------------------------------------- |
|
|
71
|
+
| FR1 | The current presented sheet contains one Sheet panel, one scrolling Content area, and one decorative Handle; a Scrim is present only in scrim-backed presentation. | Current source, docs, and tests | Verified current behavior; no new behavior decided |
|
|
72
|
+
| FR2 | The Sheet panel carries `bottom-sheet`; Content area, Handle, and Scrim carry no BottomSheet public target. | Current source, docs, and tests | Verified current behavior; no target change |
|
|
73
|
+
|
|
74
|
+
### Allowed variation
|
|
75
|
+
|
|
76
|
+
- Caller-provided children may vary without becoming BottomSheet-owned anatomy.
|
|
77
|
+
- Height, snap points, motion phase, and standalone versus switcher hosting may
|
|
78
|
+
vary without changing the four-part anatomy recorded here.
|
|
79
|
+
|
|
80
|
+
### Representative states
|
|
81
|
+
|
|
82
|
+
- A standalone modal sheet renders Sheet panel, Content area, Handle, and Scrim.
|
|
83
|
+
- A standalone non-modal sheet renders Sheet panel, Content area, and Handle
|
|
84
|
+
without a Scrim.
|
|
85
|
+
- A switcher-managed sheet renders the same panel anatomy while
|
|
86
|
+
BottomSheetSwitcher owns the shared dialog and optional Scrim.
|
|
87
|
+
|
|
88
|
+
### Transformation and precedence order
|
|
89
|
+
|
|
90
|
+
- No new height, gesture, motion, or styling precedence rule is introduced.
|
|
91
|
+
|
|
92
|
+
### Performance and resources
|
|
93
|
+
|
|
94
|
+
- No new performance or resource rule is introduced.
|
|
95
|
+
|
|
96
|
+
## Accessibility contract
|
|
97
|
+
|
|
98
|
+
This draft does not change or extend BottomSheet's existing dialog naming,
|
|
99
|
+
focus, Handle, keyboard, or dismissal behavior.
|
|
100
|
+
|
|
101
|
+
## Design relationships
|
|
102
|
+
|
|
103
|
+
| Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
|
|
104
|
+
| ---------------- | ------------------------------------------------------------------------------------- | ------------------------------ | -------------- | ------------------ |
|
|
105
|
+
| Sheet panel | Presents the painted bottom-edge surface and owns panel geometry and motion. | Current source and public docs | Prominent | FR1, FR2 |
|
|
106
|
+
| Content area | Provides the scrolling area for caller-provided sheet content. | Current source and tests | Prominent | FR1, FR2 |
|
|
107
|
+
| Handle | Presents the decorative grab affordance and owns the panel's drag interaction region. | Current source and tests | Supporting | FR1, FR2 |
|
|
108
|
+
| Scrim | Dims and blocks the page in a scrim-backed host. | Current source and public docs | Supporting | FR1, FR2 |
|
|
109
|
+
|
|
110
|
+
Content area, Handle, and Scrim are stable visible parts, but no current public
|
|
111
|
+
target reaches them. Their `none` dispositions record factual reachability, not
|
|
112
|
+
a decision that they must remain unthemeable.
|
|
113
|
+
|
|
114
|
+
### Theming anatomy
|
|
115
|
+
|
|
116
|
+
<!-- anatomy-theming:v1 -->
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"Sheet panel": {"target": "bottom-sheet"},
|
|
121
|
+
"Content area": {
|
|
122
|
+
"none": {
|
|
123
|
+
"reason": "reachability-gap: No current public target reaches the scrolling content area."
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"Handle": {
|
|
127
|
+
"none": {
|
|
128
|
+
"reason": "reachability-gap: No current public target reaches the handle bar or pill."
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"Scrim": {
|
|
132
|
+
"none": {
|
|
133
|
+
"reason": "reachability-gap: No BottomSheet public target reaches the native dialog backdrop or switcher-owned scrim."
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Family and system relationships
|
|
140
|
+
|
|
141
|
+
- `architecture:component-theming-surface` owns anatomy qualification, target
|
|
142
|
+
mapping, and factual `none` dispositions.
|
|
143
|
+
- `architecture:layer-runtime` owns the current native-dialog host distinction
|
|
144
|
+
and records that sheets retain local scrim and swipe behavior.
|
|
145
|
+
- `family:overlay-dismissal` owns shared Escape and platform-close ordering and
|
|
146
|
+
records BottomSheet's current local-only adoption gap. This anatomy backfill
|
|
147
|
+
does not migrate that runtime behavior.
|
|
148
|
+
|
|
149
|
+
## Verification map
|
|
150
|
+
|
|
151
|
+
| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
|
|
152
|
+
| ------------------- | ------------------------------------------------------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------- | --------------------------- |
|
|
153
|
+
| FR1 | `BottomSheet.test.tsx` render, content, Handle, and scrim behavior suites | Modal, non-modal, and switcher presentations | Removing a documented part fails existing content, structure, or dismissal assertions. | `audit:BottomSheet/anatomy` |
|
|
154
|
+
| FR2 | Panel target assertion, source inspection, and theming target inventories | Sheet panel, Content area, Handle, and Scrim | Removing the panel target or documenting an unshipped child target fails evidence or inventory. | `audit:BottomSheet/theming` |
|
|
155
|
+
| Layout evidence | `BottomSheetPanel.test.tsx` | Floating Handle and scrolling Content area | Reordering or merging the stable parts fails existing panel structure and style assertions. | `audit:BottomSheet/anatomy` |
|
|
156
|
+
| Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and current target inventory | Missing, extra, prefixed, stale, or multiply assigned mappings fail repository validation. | `audit:BottomSheet/theming` |
|
|
157
|
+
|
|
158
|
+
Existing tests directly assert the Sheet panel target, Content area placement,
|
|
159
|
+
Handle structure, and scrim behavior. Source and public target metadata confirm
|
|
160
|
+
that the other three parts have no public target.
|
|
161
|
+
|
|
162
|
+
## Decision log
|
|
163
|
+
|
|
164
|
+
None. This draft records current facts and introduces no component-local design,
|
|
165
|
+
API, theming, or layer-system decision.
|
|
166
|
+
|
|
167
|
+
## Open questions
|
|
168
|
+
|
|
169
|
+
- **OQ1 — Should Content area, Handle, or Scrim gain a stable public theming
|
|
170
|
+
target?** (`human-api`) Their current lack of reachability is an audit gap, not
|
|
171
|
+
settled intent.
|
|
172
|
+
|
|
173
|
+
## Content boundary
|
|
174
|
+
|
|
175
|
+
This file does not duplicate consumer prop tables, examples, gesture algorithms,
|
|
176
|
+
implementation steps, or shared layer and theming rules. It links to their
|
|
177
|
+
owners.
|
|
@@ -1,5 +1,64 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').ComponentAnatomyElement[]} */
|
|
4
|
+
const anatomy = [
|
|
5
|
+
{
|
|
6
|
+
name: 'Group',
|
|
7
|
+
required: true,
|
|
8
|
+
description: 'Container for the labeled checkbox group.',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'Group label',
|
|
12
|
+
required: true,
|
|
13
|
+
description: 'Text identifying what the checkbox options represent.',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'Description',
|
|
17
|
+
required: false,
|
|
18
|
+
description: 'Helper text below the group label.',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Options list',
|
|
22
|
+
required: true,
|
|
23
|
+
description: 'List containing the available checkbox options.',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'Option row',
|
|
27
|
+
required: true,
|
|
28
|
+
description: 'Selectable row containing one option.',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'Checkbox',
|
|
32
|
+
required: true,
|
|
33
|
+
description: 'Selection indicator for an option.',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'Option label',
|
|
37
|
+
required: true,
|
|
38
|
+
description: 'Primary content identifying an option.',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'Option description',
|
|
42
|
+
required: false,
|
|
43
|
+
description: 'Secondary text below an option label.',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'End content',
|
|
47
|
+
required: false,
|
|
48
|
+
description: 'Caller-provided content at the end of an option row.',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'Spinner',
|
|
52
|
+
required: false,
|
|
53
|
+
description: 'Loading indicator shown inside the pending checkbox.',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'Status message',
|
|
57
|
+
required: false,
|
|
58
|
+
description: 'Error, warning, or success message below the group.',
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
|
|
3
62
|
/** @type {import('@astryxdesign/cli/authoring').ComponentDoc} */
|
|
4
63
|
|
|
5
64
|
export const docs = {
|
|
@@ -8,13 +67,22 @@ export const docs = {
|
|
|
8
67
|
group: 'Checkbox',
|
|
9
68
|
category: 'Form Controls',
|
|
10
69
|
isHiddenFromOverview: true,
|
|
11
|
-
keywords: [
|
|
12
|
-
|
|
70
|
+
keywords: [
|
|
71
|
+
'checkboxlist',
|
|
72
|
+
'checkbox',
|
|
73
|
+
'checkboxgroup',
|
|
74
|
+
'multichoice',
|
|
75
|
+
'multiselect',
|
|
76
|
+
'checklist',
|
|
77
|
+
],
|
|
78
|
+
description:
|
|
79
|
+
'Checkbox group container with field integration for label, description, and status.',
|
|
13
80
|
props: [
|
|
14
81
|
{
|
|
15
82
|
name: 'label',
|
|
16
83
|
type: 'string',
|
|
17
|
-
description:
|
|
84
|
+
description:
|
|
85
|
+
'Label text for the checkbox group (always rendered for accessibility).',
|
|
18
86
|
required: true,
|
|
19
87
|
},
|
|
20
88
|
{
|
|
@@ -97,41 +165,89 @@ export const docs = {
|
|
|
97
165
|
{
|
|
98
166
|
name: 'xstyle',
|
|
99
167
|
type: 'StyleXStyles',
|
|
100
|
-
description:
|
|
168
|
+
description:
|
|
169
|
+
'StyleX styles for layout customization. Must be a stylex.create() value.',
|
|
101
170
|
},
|
|
102
171
|
],
|
|
103
|
-
components: [
|
|
104
|
-
{name: 'CheckboxListItem'},
|
|
105
|
-
],
|
|
172
|
+
components: [{name: 'CheckboxListItem'}],
|
|
106
173
|
usage: {
|
|
107
|
-
|
|
174
|
+
anatomy,
|
|
175
|
+
description:
|
|
176
|
+
'CheckboxList shows a small group of checkboxes so users can turn several options on or off at once. Place it in settings pages, filter panels, or forms where every choice should be visible without scrolling. For a single standalone checkbox (like "I agree to the terms"), use CheckboxInput instead. If only one option can be picked, use RadioList. If the list is long enough to need searching or scrolling, use MultiSelector instead.',
|
|
108
177
|
bestPractices: [
|
|
109
|
-
{
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
{
|
|
178
|
+
{
|
|
179
|
+
guidance: true,
|
|
180
|
+
description:
|
|
181
|
+
'Keep the list short: three to seven options is the sweet spot. Beyond that, switch to MultiSelector which adds search and scrolling.',
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
guidance: true,
|
|
185
|
+
description:
|
|
186
|
+
'Turn on dividers (hasDividers) when items have helper text underneath; without them the labels and descriptions blur together.',
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
guidance: true,
|
|
190
|
+
description:
|
|
191
|
+
'Write a group label that says what the choices represent: "Export formats" tells users more than "Options".',
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
guidance: false,
|
|
195
|
+
description:
|
|
196
|
+
'Show a CheckboxList when the user can only pick one thing; that is what RadioList is for.',
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
guidance: false,
|
|
200
|
+
description:
|
|
201
|
+
'Put buttons or links inside the trailing slot (endContent); the whole row is already tappable, so a nested button creates two competing click targets.',
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
guidance: false,
|
|
205
|
+
description:
|
|
206
|
+
'Wrap a disabled CheckboxList in Tooltip to explain why it is disabled; disabled controls swallow the hover events the wrapper needs. Use the disabledMessage prop instead.',
|
|
207
|
+
},
|
|
115
208
|
],
|
|
116
209
|
},
|
|
117
210
|
theming: {
|
|
118
|
-
targets: [
|
|
119
|
-
{className: 'astryx-checkbox-list'},
|
|
120
|
-
],
|
|
211
|
+
targets: [{className: 'astryx-checkbox-list'}],
|
|
121
212
|
},
|
|
122
213
|
};
|
|
123
214
|
|
|
124
215
|
/** @type {import('@astryxdesign/cli/authoring').ComponentTranslationDoc} */
|
|
125
216
|
export const docsZh = {
|
|
126
217
|
usage: {
|
|
127
|
-
description:
|
|
218
|
+
description:
|
|
219
|
+
'CheckboxList shows a small group of checkboxes so users can turn several options on or off at once. Place it in settings pages, filter panels, or forms where every choice should be visible without scrolling. For a single standalone checkbox (like "I agree to the terms"), use CheckboxInput instead. If only one option can be picked, use RadioList. If the list is long enough to need searching or scrolling, use MultiSelector instead.',
|
|
128
220
|
bestPractices: [
|
|
129
|
-
{
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
{
|
|
221
|
+
{
|
|
222
|
+
guidance: true,
|
|
223
|
+
description:
|
|
224
|
+
'Keep the list short: three to seven options is the sweet spot. Beyond that, switch to MultiSelector which adds search and scrolling.',
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
guidance: true,
|
|
228
|
+
description:
|
|
229
|
+
'Turn on dividers (hasDividers) when items have helper text underneath; without them the labels and descriptions blur together.',
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
guidance: true,
|
|
233
|
+
description:
|
|
234
|
+
'Write a group label that says what the choices represent: "Export formats" tells users more than "Options".',
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
guidance: false,
|
|
238
|
+
description:
|
|
239
|
+
'Show a CheckboxList when the user can only pick one thing; that is what RadioList is for.',
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
guidance: false,
|
|
243
|
+
description:
|
|
244
|
+
'Put buttons or links inside the trailing slot (endContent); the whole row is already tappable, so a nested button creates two competing click targets.',
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
guidance: false,
|
|
248
|
+
description:
|
|
249
|
+
'Wrap a disabled CheckboxList in Tooltip to explain why it is disabled; disabled controls swallow the hover events the wrapper needs. Use the disabledMessage prop instead.',
|
|
250
|
+
},
|
|
135
251
|
],
|
|
136
252
|
},
|
|
137
253
|
};
|
|
@@ -141,14 +257,39 @@ export const docsDense = {
|
|
|
141
257
|
description:
|
|
142
258
|
'Checkbox group component for multi-value selection. Collection mode (parent state) + standalone mode (per-item state).',
|
|
143
259
|
usage: {
|
|
144
|
-
description:
|
|
260
|
+
description:
|
|
261
|
+
'CheckboxList shows a small group of checkboxes so users can turn several options on or off at once. Place it in settings pages, filter panels, or forms where every choice should be visible without scrolling. For a single standalone checkbox (like "I agree to the terms"), use CheckboxInput instead. If only one option can be picked, use RadioList. If the list is long enough to need searching or scrolling, use MultiSelector instead.',
|
|
145
262
|
bestPractices: [
|
|
146
|
-
{
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
{
|
|
263
|
+
{
|
|
264
|
+
guidance: true,
|
|
265
|
+
description:
|
|
266
|
+
'Keep the list short: three to seven options is the sweet spot. Beyond that, switch to MultiSelector which adds search and scrolling.',
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
guidance: true,
|
|
270
|
+
description:
|
|
271
|
+
'Turn on dividers (hasDividers) when items have helper text underneath; without them the labels and descriptions blur together.',
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
guidance: true,
|
|
275
|
+
description:
|
|
276
|
+
'Write a group label that says what the choices represent: "Export formats" tells users more than "Options".',
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
guidance: false,
|
|
280
|
+
description:
|
|
281
|
+
'Show a CheckboxList when the user can only pick one thing; that is what RadioList is for.',
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
guidance: false,
|
|
285
|
+
description:
|
|
286
|
+
'Put buttons or links inside the trailing slot (endContent); the whole row is already tappable, so a nested button creates two competing click targets.',
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
guidance: false,
|
|
290
|
+
description:
|
|
291
|
+
'Wrap a disabled CheckboxList in Tooltip to explain why it is disabled; disabled controls swallow the hover events the wrapper needs. Use the disabledMessage prop instead.',
|
|
292
|
+
},
|
|
152
293
|
],
|
|
153
294
|
},
|
|
154
295
|
};
|