@astryxdesign/core 0.5.2-canary.c9c8564 → 0.5.2-canary.e03511b
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/dist/BottomSheet/BottomSheet.d.ts +3 -1
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +4 -3
- package/dist/BottomSheet/BottomSheetEdgeTint.d.ts +2 -2
- package/dist/BottomSheet/BottomSheetEdgeTint.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetEdgeTint.js +7 -10
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +1 -1
- package/dist/Button/Button.d.ts +2 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +11 -4
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +2 -2
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +34 -17
- package/dist/ContextMenu/ContextMenu.d.ts +14 -3
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +149 -26
- package/dist/ContextMenu/index.d.ts +1 -0
- package/dist/ContextMenu/index.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts +24 -5
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +340 -26
- package/dist/DropdownMenu/DropdownMenuContext.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts +6 -2
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +43 -14
- package/dist/DropdownMenu/MenuBottomSheet.d.ts +20 -0
- package/dist/DropdownMenu/MenuBottomSheet.d.ts.map +1 -0
- package/dist/DropdownMenu/MenuBottomSheet.js +36 -0
- package/dist/DropdownMenu/MenuBottomSheetActionList.d.ts +10 -0
- package/dist/DropdownMenu/MenuBottomSheetActionList.d.ts.map +1 -0
- package/dist/DropdownMenu/MenuBottomSheetActionList.js +111 -0
- package/dist/DropdownMenu/index.d.ts +2 -1
- package/dist/DropdownMenu/index.d.ts.map +1 -1
- package/dist/DropdownMenu/menuWidth.d.ts +14 -0
- package/dist/DropdownMenu/menuWidth.d.ts.map +1 -0
- package/dist/DropdownMenu/menuWidth.js +35 -0
- package/dist/DropdownMenu/useMenuOverflow.d.ts +10 -0
- package/dist/DropdownMenu/useMenuOverflow.d.ts.map +1 -0
- package/dist/DropdownMenu/useMenuOverflow.js +60 -0
- package/dist/MoreMenu/MoreMenu.d.ts +8 -2
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MoreMenu/MoreMenu.js +2 -0
- package/dist/MultiSelector/MultiSelector.d.ts +11 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +97 -68
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.d.ts.map +1 -1
- package/dist/Popover/Popover.d.ts +10 -6
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +141 -16
- package/dist/Popover/usePopover.d.ts +4 -0
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +52 -5
- package/dist/Selector/Selector.d.ts +10 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +106 -80
- package/dist/Selector/SelectorBottomSheet.d.ts +21 -0
- package/dist/Selector/SelectorBottomSheet.d.ts.map +1 -0
- package/dist/Selector/SelectorBottomSheet.js +83 -0
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.d.ts.map +1 -1
- package/dist/Selector/selectorPresentation.stylex.d.ts +16 -0
- package/dist/Selector/selectorPresentation.stylex.d.ts.map +1 -0
- package/dist/Selector/selectorPresentation.stylex.js +21 -0
- package/dist/Selector/useSelectorPresentation.d.ts +32 -0
- package/dist/Selector/useSelectorPresentation.d.ts.map +1 -0
- package/dist/Selector/useSelectorPresentation.js +90 -0
- package/dist/Toast/useToastGesture.d.ts.map +1 -1
- package/dist/Toast/useToastGesture.js +46 -9
- package/dist/astryx.css +19 -1
- package/dist/hooks/useAdaptivePresentation.d.ts +5 -0
- package/dist/hooks/useAdaptivePresentation.d.ts.map +1 -0
- package/dist/hooks/useAdaptivePresentation.js +19 -0
- package/dist/hooks/useFocusReturnVisibility.d.ts +7 -0
- package/dist/hooks/useFocusReturnVisibility.d.ts.map +1 -0
- package/dist/hooks/useFocusReturnVisibility.js +35 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +12 -0
- package/locales/en.json +20 -0
- package/locales/pseudo.json +15 -0
- package/package.json +2 -2
- package/src/BottomSheet/BottomSheet.doc.mjs +37 -0
- package/src/BottomSheet/BottomSheet.spec.md +177 -0
- package/src/BottomSheet/BottomSheet.test.tsx +29 -0
- package/src/BottomSheet/BottomSheet.tsx +7 -4
- package/src/BottomSheet/BottomSheetEdgeTint.test.tsx +4 -6
- package/src/BottomSheet/BottomSheetEdgeTint.tsx +7 -10
- package/src/BottomSheet/BottomSheetSwitcher.tsx +1 -2
- package/src/Button/Button.doc.mjs +56 -0
- package/src/Button/Button.test.tsx +10 -0
- package/src/Button/Button.tsx +13 -5
- package/src/ButtonGroup/ButtonGroup.doc.mjs +47 -0
- package/src/Carousel/Carousel.test.tsx +83 -0
- package/src/Carousel/Carousel.tsx +8 -2
- package/src/Chat/ChatToolCalls.test.tsx +44 -0
- package/src/Chat/ChatToolCalls.tsx +36 -15
- 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 +61 -1
- package/src/ContextMenu/ContextMenu.spec.md +206 -0
- package/src/ContextMenu/ContextMenu.test.tsx +131 -1
- package/src/ContextMenu/ContextMenu.tsx +199 -32
- package/src/ContextMenu/index.ts +1 -0
- package/src/Divider/Divider.doc.mjs +24 -0
- package/src/Divider/Divider.spec.md +150 -0
- package/src/DropdownMenu/DropdownMenu.doc.mjs +305 -40
- package/src/DropdownMenu/DropdownMenu.spec.md +245 -0
- package/src/DropdownMenu/DropdownMenu.test.tsx +518 -7
- package/src/DropdownMenu/DropdownMenu.tsx +459 -28
- package/src/DropdownMenu/DropdownMenuContext.tsx +1 -1
- package/src/DropdownMenu/DropdownMenuItem.tsx +2 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.doc.mjs +4 -2
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +124 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +72 -17
- package/src/DropdownMenu/MenuBottomSheet.tsx +46 -0
- package/src/DropdownMenu/MenuBottomSheetActionList.tsx +141 -0
- package/src/DropdownMenu/index.ts +2 -0
- package/src/DropdownMenu/menuWidth.ts +51 -0
- package/src/DropdownMenu/useMenuOverflow.ts +77 -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/IconButton/IconButton.doc.mjs +38 -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 +59 -0
- package/src/MoreMenu/MoreMenu.spec.md +221 -0
- package/src/MoreMenu/MoreMenu.test.tsx +47 -0
- package/src/MoreMenu/MoreMenu.tsx +13 -1
- package/src/MultiSelector/MultiSelector.doc.mjs +128 -0
- package/src/MultiSelector/MultiSelector.spec.md +266 -0
- package/src/MultiSelector/MultiSelector.test.tsx +127 -0
- package/src/MultiSelector/MultiSelector.tsx +121 -73
- package/src/MultiSelector/index.ts +1 -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/Popover/Popover.doc.mjs +11 -11
- package/src/Popover/Popover.test.tsx +397 -2
- package/src/Popover/Popover.tsx +228 -21
- package/src/Popover/usePopover.tsx +92 -15
- package/src/ProgressBar/ProgressBar.doc.mjs +198 -38
- package/src/ProgressBar/ProgressBar.spec.md +260 -0
- 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 +83 -0
- package/src/SegmentedControl/SegmentedControl.spec.md +151 -0
- package/src/Selector/Selector.doc.mjs +12 -0
- package/src/Selector/Selector.spec.md +202 -0
- package/src/Selector/Selector.test.tsx +135 -0
- package/src/Selector/Selector.tsx +141 -82
- package/src/Selector/SelectorBottomSheet.tsx +97 -0
- package/src/Selector/index.ts +1 -0
- package/src/Selector/selectorPresentation.stylex.ts +20 -0
- package/src/Selector/useSelectorPresentation.ts +147 -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/Toast/ToastViewport.test.tsx +118 -4
- package/src/Toast/useToastGesture.ts +61 -8
- package/src/ToggleButton/ToggleButton.doc.mjs +56 -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/hooks/useAdaptivePresentation.ts +35 -0
- package/src/hooks/useFocusReturnVisibility.ts +45 -0
- package/src/hooks/useFocusTrap.test.tsx +40 -0
- package/src/hooks/useFocusTrap.ts +13 -0
- package/src/theme/themingTargets.test.ts +91 -25
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 1
|
|
3
|
+
template_version: 3
|
|
4
|
+
kind: component
|
|
5
|
+
id: component:Tooltip
|
|
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
|
+
[packages/core/src/Tooltip/Tooltip.test.tsx, scripts/check-knowledge.mjs]
|
|
15
|
+
families: [family:overlay-dismissal]
|
|
16
|
+
design_specs: []
|
|
17
|
+
architecture:
|
|
18
|
+
[
|
|
19
|
+
architecture:component-theming-surface,
|
|
20
|
+
architecture:interaction-modality,
|
|
21
|
+
architecture:layer-runtime,
|
|
22
|
+
architecture:public-component-api,
|
|
23
|
+
]
|
|
24
|
+
contributing: []
|
|
25
|
+
system_specs: []
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
# Tooltip component contract
|
|
29
|
+
|
|
30
|
+
## Intent
|
|
31
|
+
|
|
32
|
+
Tooltip renders supplied tooltip content on an owned overlay surface associated
|
|
33
|
+
with a caller-owned trigger. This draft records current consumer anatomy and
|
|
34
|
+
theming ownership without deciding layer behavior, positioning, or new visual
|
|
35
|
+
parts.
|
|
36
|
+
|
|
37
|
+
## Compatibility and migration
|
|
38
|
+
|
|
39
|
+
- Released default preserved: `yes`
|
|
40
|
+
- Compatibility class: additive documentation only; runtime, DOM, styling,
|
|
41
|
+
targets, and public API remain unchanged
|
|
42
|
+
- Controlled/uncontrolled behavior: unchanged
|
|
43
|
+
- Migration decision: none
|
|
44
|
+
|
|
45
|
+
Consumer migration instructions belong in consumer docs and release notes.
|
|
46
|
+
|
|
47
|
+
## Ownership boundary
|
|
48
|
+
|
|
49
|
+
**Owns**
|
|
50
|
+
|
|
51
|
+
- The rendered tooltip surface and content inside that surface.
|
|
52
|
+
|
|
53
|
+
**Does not own / non-goals**
|
|
54
|
+
|
|
55
|
+
- The trigger element — supplied by the caller or referenced externally and
|
|
56
|
+
outside Tooltip's owned anatomy.
|
|
57
|
+
- An arrow element — the current implementation renders none.
|
|
58
|
+
- Layer lifecycle, light dismissal, and anchor-positioning policy — outside this
|
|
59
|
+
factual anatomy backfill.
|
|
60
|
+
|
|
61
|
+
## Public concepts
|
|
62
|
+
|
|
63
|
+
No new public concept is introduced. Consumer props and usage remain documented
|
|
64
|
+
in `Tooltip.doc.mjs` and `useTooltip.doc.mjs`.
|
|
65
|
+
|
|
66
|
+
## Behavioral and layout contract
|
|
67
|
+
|
|
68
|
+
| ID | Candidate invariant | Basis | Draft review state |
|
|
69
|
+
| --- | ---------------------------------------------------------------------------------------------------- | ------------------------------- | -------------------------------------------------- |
|
|
70
|
+
| FR1 | The current rendered tooltip contains one owned surface with the supplied tooltip content inside it. | Current source, docs, and tests | Verified current behavior; no new behavior decided |
|
|
71
|
+
| FR2 | The surface carries the current `tooltip` target; its content has no separate target. | Current source and public docs | Verified current behavior; no target change |
|
|
72
|
+
|
|
73
|
+
### Allowed variation
|
|
74
|
+
|
|
75
|
+
- Supplied content may vary without adding a Tooltip-owned child target.
|
|
76
|
+
|
|
77
|
+
### Representative states
|
|
78
|
+
|
|
79
|
+
- The owned anatomy is unchanged across wrapped-trigger and external-anchor
|
|
80
|
+
modes; the trigger remains outside it.
|
|
81
|
+
|
|
82
|
+
### Transformation and precedence order
|
|
83
|
+
|
|
84
|
+
- No new ordering or positioning rule is introduced.
|
|
85
|
+
|
|
86
|
+
### Performance and resources
|
|
87
|
+
|
|
88
|
+
- No new performance or resource rule is introduced.
|
|
89
|
+
|
|
90
|
+
## Accessibility contract
|
|
91
|
+
|
|
92
|
+
This draft does not change or extend Tooltip's existing accessibility behavior.
|
|
93
|
+
|
|
94
|
+
## Design relationships
|
|
95
|
+
|
|
96
|
+
| Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
|
|
97
|
+
| ---------------- | --------------------------------------------------- | ------------------------------ | -------------- | ------------------ |
|
|
98
|
+
| Tooltip surface | Presents the current painted overlay surface. | Current source and public docs | Supporting | FR1, FR2 |
|
|
99
|
+
| Tooltip text | Presents supplied content within the owned surface. | Current source and public docs | Prominent | FR1, FR2 |
|
|
100
|
+
|
|
101
|
+
The trigger is caller-owned and outside this anatomy. The current implementation
|
|
102
|
+
has no arrow element.
|
|
103
|
+
|
|
104
|
+
### Theming anatomy
|
|
105
|
+
|
|
106
|
+
<!-- anatomy-theming:v1 -->
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"Tooltip surface": {"target": "tooltip"},
|
|
111
|
+
"Tooltip text": {"inherits": "tooltip"}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Family and system relationships
|
|
116
|
+
|
|
117
|
+
This draft references the current shared owners without restating their rules:
|
|
118
|
+
`architecture:component-theming-surface`, `family:overlay-dismissal`,
|
|
119
|
+
`architecture:interaction-modality`, `architecture:layer-runtime`, and
|
|
120
|
+
`architecture:public-component-api`.
|
|
121
|
+
|
|
122
|
+
## Verification map
|
|
123
|
+
|
|
124
|
+
| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
|
|
125
|
+
| ------------------- | ------------------------------------- | ------------------------------------- | -------------------------------------------------------------------------------- | ----------------------- |
|
|
126
|
+
| FR1 | `Tooltip.test.tsx` role/content suite | Rendered surface and supplied content | Removing the surface or content fails existing tooltip role and text assertions. | `audit:Tooltip/anatomy` |
|
|
127
|
+
| Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and current target | Missing, extra, prefixed, or stale mappings fail repository validation. | `audit:Tooltip/theming` |
|
|
128
|
+
|
|
129
|
+
## Decision log
|
|
130
|
+
|
|
131
|
+
None. This draft records current facts and introduces no component-local design
|
|
132
|
+
or layer-system decision.
|
|
133
|
+
|
|
134
|
+
## Open questions
|
|
135
|
+
|
|
136
|
+
None.
|
|
137
|
+
|
|
138
|
+
## Content boundary
|
|
139
|
+
|
|
140
|
+
This file does not duplicate consumer prop tables, examples, layer-system rules,
|
|
141
|
+
implementation steps, or system rules. It links to their owners.
|
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').ComponentAnatomyElement[]} */
|
|
4
|
+
const anatomy = [
|
|
5
|
+
{
|
|
6
|
+
name: 'Tree list',
|
|
7
|
+
required: true,
|
|
8
|
+
description: 'Container that presents the hierarchical tree.',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'Header',
|
|
12
|
+
required: false,
|
|
13
|
+
description: 'Caller-provided content that visibly names the tree.',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'Item',
|
|
17
|
+
required: true,
|
|
18
|
+
description: 'Painted row for one node in the hierarchy.',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Chevron',
|
|
22
|
+
required: false,
|
|
23
|
+
description:
|
|
24
|
+
'Expand and collapse control rendered for an Item with children.',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Chevron glyph',
|
|
28
|
+
required: false,
|
|
29
|
+
description: 'Directional symbol rendered by Icon inside a Chevron.',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'Item label',
|
|
33
|
+
required: true,
|
|
34
|
+
description: 'Primary content that identifies an Item.',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'Item description',
|
|
38
|
+
required: false,
|
|
39
|
+
description: 'Secondary text rendered below an Item label.',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'Start content',
|
|
43
|
+
required: false,
|
|
44
|
+
description: 'Caller-provided content rendered before an Item label.',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'End content',
|
|
48
|
+
required: false,
|
|
49
|
+
description: 'Caller-provided content rendered after an Item label.',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'Guide',
|
|
53
|
+
required: false,
|
|
54
|
+
description: 'Connector line that shows parent-child relationships.',
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
|
|
3
58
|
/** @type {import('@astryxdesign/cli/authoring').ComponentDoc} */
|
|
4
59
|
|
|
5
60
|
export const docs = {
|
|
@@ -79,6 +134,7 @@ export const docs = {
|
|
|
79
134
|
},
|
|
80
135
|
],
|
|
81
136
|
usage: {
|
|
137
|
+
anatomy,
|
|
82
138
|
description:
|
|
83
139
|
'An expandable tree structure for displaying hierarchical data with branch connector lines. Use it for file explorers, nested category browsers, or any interface that visualizes parent-child relationships.',
|
|
84
140
|
bestPractices: [
|
|
@@ -158,6 +214,7 @@ export const docsZh = {
|
|
|
158
214
|
},
|
|
159
215
|
],
|
|
160
216
|
usage: {
|
|
217
|
+
anatomy,
|
|
161
218
|
description:
|
|
162
219
|
'An expandable tree structure for displaying hierarchical data with branch connector lines. Use it for file explorers, nested category browsers, or any interface that visualizes parent-child relationships.',
|
|
163
220
|
bestPractices: [
|
|
@@ -175,6 +232,7 @@ export const docsDense = {
|
|
|
175
232
|
description:
|
|
176
233
|
'Data-driven tree list for hierarchical data w/ expand/collapse, branch lines, interactive items. Flat items array w/ recursive children, no composition, no cloneElement.',
|
|
177
234
|
usage: {
|
|
235
|
+
anatomy,
|
|
178
236
|
description:
|
|
179
237
|
'An expandable tree structure for displaying hierarchical data with branch connector lines. Use it for file explorers, nested category browsers, or any interface that visualizes parent-child relationships.',
|
|
180
238
|
bestPractices: [
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 1
|
|
3
|
+
template_version: 3
|
|
4
|
+
kind: component
|
|
5
|
+
id: component:TreeList
|
|
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: [behavior, theming, accessibility]
|
|
13
|
+
verified_by:
|
|
14
|
+
[
|
|
15
|
+
packages/core/src/TreeList/TreeList.test.tsx,
|
|
16
|
+
packages/core/src/theme/themingTargets.test.ts,
|
|
17
|
+
scripts/check-knowledge.mjs,
|
|
18
|
+
]
|
|
19
|
+
families: []
|
|
20
|
+
design_specs: []
|
|
21
|
+
architecture:
|
|
22
|
+
[
|
|
23
|
+
architecture:component-theming-surface,
|
|
24
|
+
architecture:interaction-modality,
|
|
25
|
+
architecture:public-component-api,
|
|
26
|
+
]
|
|
27
|
+
contributing: []
|
|
28
|
+
system_specs: []
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
# TreeList component contract
|
|
32
|
+
|
|
33
|
+
## Intent
|
|
34
|
+
|
|
35
|
+
TreeList presents hierarchical data as expandable tree rows. This draft records
|
|
36
|
+
its current consumer anatomy, target ownership, delegated Icon glyph, and
|
|
37
|
+
unreached stable parts without changing runtime behavior, styling, targets, or
|
|
38
|
+
public API.
|
|
39
|
+
|
|
40
|
+
## Compatibility and migration
|
|
41
|
+
|
|
42
|
+
- Released default preserved: `yes`
|
|
43
|
+
- Compatibility class: additive documentation only; runtime, DOM, styling,
|
|
44
|
+
targets, aliases, and public API remain unchanged
|
|
45
|
+
- Controlled/uncontrolled behavior: unchanged
|
|
46
|
+
- Migration decision: none
|
|
47
|
+
|
|
48
|
+
Consumer migration instructions belong in consumer docs and release notes.
|
|
49
|
+
|
|
50
|
+
## Ownership boundary
|
|
51
|
+
|
|
52
|
+
**Owns**
|
|
53
|
+
|
|
54
|
+
- The Tree list, Item, Chevron, Item label, and Guide parts and their five current
|
|
55
|
+
targets.
|
|
56
|
+
- The stable Item description rendered below an Item label.
|
|
57
|
+
- Hierarchical placement, indentation, expansion, selection, and tree semantics.
|
|
58
|
+
|
|
59
|
+
**Does not own / non-goals**
|
|
60
|
+
|
|
61
|
+
- The Chevron glyph artwork and Icon target — owned by `component:Icon`.
|
|
62
|
+
- Header, Start content, and End content supplied through consumer slots — owned
|
|
63
|
+
by the product callsite.
|
|
64
|
+
- New targets for Item description or caller-provided slots — unresolved by this
|
|
65
|
+
factual backfill.
|
|
66
|
+
|
|
67
|
+
## Public concepts
|
|
68
|
+
|
|
69
|
+
No new public concept is introduced. Consumer data, props, slots, and usage
|
|
70
|
+
remain documented in `TreeList.doc.mjs`.
|
|
71
|
+
|
|
72
|
+
## Behavioral and layout contract
|
|
73
|
+
|
|
74
|
+
| ID | Candidate invariant | Basis | Draft review state |
|
|
75
|
+
| --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------- | ------------------------------------------------------------------------- |
|
|
76
|
+
| FR1 | The current render contains one Tree list, one Item and Item label per rendered node, optional Header, Chevron, Item description, Start content, End content, and Guide parts, and delegated Chevron glyphs. | Current source, docs, and tests | Verified current behavior; no new behavior decided |
|
|
77
|
+
| FR2 | Tree list, Item, Chevron, Item label, and Guide carry the five current `tree-list*` targets documented below. | Current source and target docs | Verified current inventory; focused placement coverage is partial |
|
|
78
|
+
| FR3 | Chevron glyph delegates to Icon's `icon` target. Header, Start content, and End content are consumer-owned and have no TreeList target. | Current source and component docs | Verified current ownership; no target change |
|
|
79
|
+
| FR4 | Item description is a stable library-rendered part below Item label and currently has no public target. It does not inherit through `tree-list-item-label`; both spans are siblings inside the row content. | Current source and target docs | Verified current reachability; long-term theming intent remains unsettled |
|
|
80
|
+
|
|
81
|
+
### Allowed variation
|
|
82
|
+
|
|
83
|
+
- **AV1 — Hierarchy.** Item count, depth, expansion, selection, density, and guide
|
|
84
|
+
visibility may vary without changing the anatomy ownership recorded here.
|
|
85
|
+
- **AV2 — Consumer content.** Header, Start content, End content, Item label
|
|
86
|
+
values, and descriptions may vary without making caller-owned slot content a
|
|
87
|
+
TreeList target.
|
|
88
|
+
- **AV3 — Delegated glyph.** Icon may change the Chevron glyph's internal element
|
|
89
|
+
shape while preserving its own public contract.
|
|
90
|
+
|
|
91
|
+
### Representative states
|
|
92
|
+
|
|
93
|
+
| State | Required invariant | Allowed variation |
|
|
94
|
+
| ------------------------ | ----------------------------------------------------- | --------------------------------------------- |
|
|
95
|
+
| Empty tree | Tree list remains; no Item instances render. | Optional Header content. |
|
|
96
|
+
| Flat items | Each Item contains an Item label. | Description and consumer slots may be absent. |
|
|
97
|
+
| Expandable item | Item may contain Chevron and delegated Chevron glyph. | Expanded or collapsed state. |
|
|
98
|
+
| Nested `lineGuides` tree | Guide instances show parent-child relationships. | Count and position follow hierarchy. |
|
|
99
|
+
| `noGuides` tree | Guide instances are absent; indentation remains. | All other anatomy remains unchanged. |
|
|
100
|
+
| Described item | Item description renders below Item label. | Caller-provided description text. |
|
|
101
|
+
|
|
102
|
+
### Transformation and precedence order
|
|
103
|
+
|
|
104
|
+
- No new hierarchy, focus, expansion, layout, or styling precedence rule is
|
|
105
|
+
introduced.
|
|
106
|
+
|
|
107
|
+
### Performance and resources
|
|
108
|
+
|
|
109
|
+
- No new performance or resource rule is introduced.
|
|
110
|
+
|
|
111
|
+
## Accessibility contract
|
|
112
|
+
|
|
113
|
+
This draft does not change or extend TreeList's current tree, treeitem, group,
|
|
114
|
+
roving-focus, expansion, selection, disabled, or activation behavior.
|
|
115
|
+
|
|
116
|
+
## Design relationships
|
|
117
|
+
|
|
118
|
+
| Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
|
|
119
|
+
| ---------------- | -------------------------------------------------------------------- | ------------------------------ | ----------------- | ------------------ |
|
|
120
|
+
| Tree list | Groups the hierarchical tree and owns its density and guide variant. | Current source and public docs | Supporting | FR1, FR2 |
|
|
121
|
+
| Header | Visibly names the tree with caller-provided content. | Caller-supplied content | Prominent | FR1, FR3 |
|
|
122
|
+
| Item | Paints one row and reflects density, selection, and disabled state. | Current source and public docs | Prominent | FR1, FR2 |
|
|
123
|
+
| Chevron | Provides the expand and collapse control for an Item with children. | Current source and public docs | Supporting | FR1, FR2 |
|
|
124
|
+
| Chevron glyph | Presents the current directional symbol inside Chevron. | `component:Icon` | Supporting | FR1, FR3 |
|
|
125
|
+
| Item label | Presents the primary content that identifies an Item. | Current source and public docs | Prominent | FR1, FR2 |
|
|
126
|
+
| Item description | Presents stable secondary text below Item label. | Current source and public docs | Supporting | FR1, FR4 |
|
|
127
|
+
| Start content | Presents caller-provided content before Item label. | Caller-supplied content | Context-dependent | FR1, FR3 |
|
|
128
|
+
| End content | Presents caller-provided content after Item label. | Caller-supplied content | Context-dependent | FR1, FR3 |
|
|
129
|
+
| Guide | Paints a connector between related hierarchy levels. | Current source and public docs | Supporting | FR1, FR2 |
|
|
130
|
+
|
|
131
|
+
Item description is stable TreeList-rendered anatomy, not consumer-owned slot
|
|
132
|
+
structure. Its current lack of a target is observed reachability, not a decision
|
|
133
|
+
that it must remain unthemeable. Header, Start content, and End content remain
|
|
134
|
+
caller-owned even though TreeList positions their slot wrappers.
|
|
135
|
+
|
|
136
|
+
### Theming anatomy
|
|
137
|
+
|
|
138
|
+
<!-- anatomy-theming:v1 -->
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"Tree list": {"target": "tree-list"},
|
|
143
|
+
"Header": {
|
|
144
|
+
"none": {
|
|
145
|
+
"reason": "intentional: Header is caller-provided content outside TreeList's public theming ownership"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"Item": {"target": "tree-list-item"},
|
|
149
|
+
"Chevron": {"target": "tree-list-chevron"},
|
|
150
|
+
"Chevron glyph": {
|
|
151
|
+
"delegatesTo": {"owner": "component:Icon", "target": "icon"}
|
|
152
|
+
},
|
|
153
|
+
"Item label": {"target": "tree-list-item-label"},
|
|
154
|
+
"Item description": {
|
|
155
|
+
"none": {
|
|
156
|
+
"reason": "unsettled: No current public target reaches the stable Item description; future exposure still needs an owner decision"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"Start content": {
|
|
160
|
+
"none": {
|
|
161
|
+
"reason": "intentional: Start content is caller-provided content outside TreeList's public theming ownership"
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"End content": {
|
|
165
|
+
"none": {
|
|
166
|
+
"reason": "intentional: End content is caller-provided content outside TreeList's public theming ownership"
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"Guide": {"target": "tree-list-guide"}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
The five local targets are current public seams. The Chevron glyph retains Icon
|
|
174
|
+
ownership. Consumer-slot `none` dispositions are ownership boundaries; Item
|
|
175
|
+
description's `none` disposition records a current audit gap and does not
|
|
176
|
+
authorize a new target.
|
|
177
|
+
|
|
178
|
+
## Family and system relationships
|
|
179
|
+
|
|
180
|
+
- `architecture:component-theming-surface` owns anatomy qualification, target
|
|
181
|
+
mapping, delegation, and factual `none` dispositions.
|
|
182
|
+
- `architecture:public-component-api` owns the stable data, props, and slot
|
|
183
|
+
surface; this documentation adds no API.
|
|
184
|
+
- `architecture:interaction-modality` owns shared keyboard and pointer modality;
|
|
185
|
+
TreeList continues to own its existing tree focus and activation behavior.
|
|
186
|
+
- TreeList has no current family contract, and no unresolved family or runtime
|
|
187
|
+
record identifier is included.
|
|
188
|
+
|
|
189
|
+
## Verification map
|
|
190
|
+
|
|
191
|
+
| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
|
|
192
|
+
| ------------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
|
|
193
|
+
| FR1 | `TreeList.test.tsx` rendering, hierarchy, slot, and accessibility suites plus source inspection | Flat, nested, described, headed, and slotted items | Removing asserted Tree list, Header, Item, Chevron, Item label, Item description, Start content, End content, or Guide behavior fails existing role, content, hierarchy, or state assertions; Chevron glyph presence remains source-inspected only. | `audit:TreeList/anatomy` |
|
|
194
|
+
| FR2 | `TreeList.test.tsx` and `themingTargets.test.ts` | Five local targets and their documented states | Removing or moving any current local target fails focused class assertions or the global inventory. | `audit:TreeList/theming` |
|
|
195
|
+
| FR3 | Source inspection plus Icon public target metadata | Expandable rows and caller-provided slots | Existing focused tests do not assert the composed Icon instance; changing glyph or slot ownership requires this map and the relevant owner metadata to change. | `audit:TreeList/theming` |
|
|
196
|
+
| FR4 | `TreeList.test.tsx` description rendering test and source inspection | Item with description | Removing description fails content coverage; adding a target requires an explicit map update. | `audit:TreeList/anatomy` |
|
|
197
|
+
| Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and five current local targets | Missing, extra, prefixed, stale, or alias-backed mappings fail repository validation. | `audit:TreeList/theming` |
|
|
198
|
+
|
|
199
|
+
Focused target-placement assertions cover all five local targets: Tree list,
|
|
200
|
+
Item, Chevron, Item label, and Guide. Existing tests do not assert the Icon
|
|
201
|
+
instance that renders Chevron glyph.
|
|
202
|
+
|
|
203
|
+
## Decision log
|
|
204
|
+
|
|
205
|
+
None. This draft records current facts and introduces no component-local design,
|
|
206
|
+
API, behavior, or theming decision.
|
|
207
|
+
|
|
208
|
+
## Open questions
|
|
209
|
+
|
|
210
|
+
- **OQ1 — Should Item description gain a stable public theming target?**
|
|
211
|
+
(`human-api`) Its current lack of reachability is an audit gap, not settled
|
|
212
|
+
intent.
|
|
213
|
+
- **OQ2 — Should a focused test pin the delegated Chevron glyph's Icon
|
|
214
|
+
instance?** (`checkable`) Its presence is currently source-inspected rather
|
|
215
|
+
than asserted.
|
|
216
|
+
|
|
217
|
+
## Content boundary
|
|
218
|
+
|
|
219
|
+
This file does not duplicate consumer prop tables/examples, shared modality
|
|
220
|
+
rules, current audit results, or implementation steps. It links to their owners.
|
|
@@ -1,5 +1,85 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').ComponentAnatomyElement[]} */
|
|
4
|
+
const anatomy = [
|
|
5
|
+
{
|
|
6
|
+
name: 'Field',
|
|
7
|
+
required: false,
|
|
8
|
+
description:
|
|
9
|
+
'Standalone Field shell that provides the label and optional supporting content; omitted inside InputGroup.',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'Input surface',
|
|
13
|
+
required: true,
|
|
14
|
+
description:
|
|
15
|
+
'Painted control surface containing the editable input or the selected token.',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'Icon-rendered start icon',
|
|
19
|
+
required: false,
|
|
20
|
+
description:
|
|
21
|
+
'Optional leading semantic icon or icon component rendered through Icon.',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'Caller-rendered start content',
|
|
25
|
+
required: false,
|
|
26
|
+
description:
|
|
27
|
+
'Optional arbitrary React content rendered directly at the start of the input surface.',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'Selected token',
|
|
31
|
+
required: false,
|
|
32
|
+
description:
|
|
33
|
+
'Token that presents the selected item while the control is not in edit mode.',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'Clear button',
|
|
37
|
+
required: false,
|
|
38
|
+
description:
|
|
39
|
+
'Shared clear action that removes the selected item when hasClear is enabled.',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'Dropdown',
|
|
43
|
+
required: false,
|
|
44
|
+
description:
|
|
45
|
+
'Anchored listbox surface containing the current search results.',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'Empty state',
|
|
49
|
+
required: false,
|
|
50
|
+
description: 'Message shown after a completed search returns no results.',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'Result row',
|
|
54
|
+
required: false,
|
|
55
|
+
description:
|
|
56
|
+
'Stable option wrapper that owns highlight, selection, pointer, and keyboard behavior.',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'Default item content',
|
|
60
|
+
required: false,
|
|
61
|
+
description:
|
|
62
|
+
'Standard TypeaheadItem label and supporting content rendered inside a result row when renderItem and item.element are absent.',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'Caller-rendered item content',
|
|
66
|
+
required: false,
|
|
67
|
+
description:
|
|
68
|
+
'Caller-owned result content supplied through renderItem or item.element inside the stable result row.',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'Result group heading',
|
|
72
|
+
required: false,
|
|
73
|
+
description: 'Visible heading for a labeled group of result rows.',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'Selected result state',
|
|
77
|
+
required: false,
|
|
78
|
+
description:
|
|
79
|
+
'Selected styling and trailing check presented on the current result row.',
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
|
|
3
83
|
/** @type {import('@astryxdesign/cli/authoring').ComponentDoc} */
|
|
4
84
|
|
|
5
85
|
export const docs = {
|
|
@@ -86,7 +166,8 @@ export const docs = {
|
|
|
86
166
|
{
|
|
87
167
|
name: 'minQueryLength',
|
|
88
168
|
type: 'number',
|
|
89
|
-
description:
|
|
169
|
+
description:
|
|
170
|
+
'Minimum query length before the search source is queried. Below it no search runs and the menu stays closed.',
|
|
90
171
|
default: '1',
|
|
91
172
|
},
|
|
92
173
|
{
|
|
@@ -199,6 +280,7 @@ export const docs = {
|
|
|
199
280
|
],
|
|
200
281
|
},
|
|
201
282
|
usage: {
|
|
283
|
+
anatomy,
|
|
202
284
|
description:
|
|
203
285
|
'A searchable input for selecting a single item from a large or dynamic dataset. Results appear as the user types, with support for async data sources, debounced search, and custom item rendering. Use it when the option list is too large for a Selector dropdown.',
|
|
204
286
|
bestPractices: [
|