@astryxdesign/core 0.5.1 → 0.5.2-canary.00477a5
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/CHANGELOG.md +19 -0
- 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/dist/i18n/InternationalizationContext.d.ts +2 -0
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationContext.js +3 -1
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.js +3 -1
- package/dist/i18n/resolve.d.ts +1 -1
- package/dist/i18n/resolve.d.ts.map +1 -1
- package/dist/i18n/resolve.js +37 -38
- package/dist/i18n/useTranslator.d.ts.map +1 -1
- package/dist/i18n/useTranslator.js +2 -3
- package/locales/af-ZA.json +0 -4
- package/locales/ar-SA.json +0 -4
- package/locales/ca-ES.json +0 -4
- package/locales/cs-CZ.json +0 -4
- package/locales/da-DK.json +0 -4
- package/locales/de-DE.json +0 -4
- package/locales/el-GR.json +0 -4
- package/locales/en.json +20 -0
- package/locales/es-ES.json +0 -4
- package/locales/fi-FI.json +0 -4
- package/locales/fr-FR.json +0 -4
- package/locales/he-IL.json +0 -4
- package/locales/hu-HU.json +0 -4
- package/locales/it-IT.json +0 -4
- package/locales/ja-JP.json +0 -4
- package/locales/ko-KR.json +0 -4
- package/locales/nl-NL.json +0 -4
- package/locales/no-NO.json +0 -4
- package/locales/pl-PL.json +0 -4
- package/locales/pseudo.json +15 -0
- package/locales/pt-BR.json +0 -4
- package/locales/pt-PT.json +0 -4
- package/locales/ro-RO.json +0 -4
- package/locales/ru-RU.json +0 -4
- package/locales/sr-SP.json +0 -4
- package/locales/sv-SE.json +0 -4
- package/locales/tr-TR.json +0 -4
- package/locales/uk-UA.json +0 -4
- package/locales/vi-VN.json +0 -4
- package/locales/zh-CN.json +0 -4
- package/locales/zh-TW.json +0 -4
- package/package.json +3 -3
- 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/Calendar/Calendar.doc.mjs +1 -1
- 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/CheckboxInput/CheckboxInput.doc.mjs +1 -1
- package/src/CheckboxList/CheckboxList.doc.mjs +173 -32
- 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 +44 -2
- package/src/ComplexSelector/ComplexSelector.spec.md +189 -0
- package/src/ContextMenu/ContextMenu.doc.mjs +13 -1
- package/src/ContextMenu/ContextMenu.test.tsx +131 -1
- package/src/ContextMenu/ContextMenu.tsx +199 -32
- package/src/ContextMenu/index.ts +1 -0
- package/src/DateInput/DateInput.doc.mjs +1 -1
- package/src/DateRangeInput/DateRangeInput.doc.mjs +1 -1
- package/src/DateTimeInput/DateTimeInput.doc.mjs +1 -1
- package/src/Divider/Divider.doc.mjs +24 -0
- package/src/Divider/Divider.spec.md +150 -0
- package/src/DropdownMenu/DropdownMenu.doc.mjs +201 -40
- 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/Field/Field.doc.mjs +1 -1
- package/src/FieldStatus/FieldStatus.doc.mjs +22 -1
- package/src/FieldStatus/FieldStatus.spec.md +212 -0
- package/src/FileInput/FileInput.doc.mjs +1 -1
- 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/Indicator/Indicator.doc.mjs +1 -1
- package/src/InputGroup/InputGroup.doc.mjs +1 -1
- 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 +17 -0
- package/src/MoreMenu/MoreMenu.test.tsx +47 -0
- package/src/MoreMenu/MoreMenu.tsx +13 -1
- package/src/MultiSelector/MultiSelector.doc.mjs +129 -1
- 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/NumberInput/NumberInput.doc.mjs +1 -1
- 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/PowerSearch/PowerSearch.doc.mjs +1 -1
- package/src/ProgressBar/ProgressBar.doc.mjs +198 -38
- package/src/ProgressBar/ProgressBar.spec.md +260 -0
- package/src/RadioList/RadioList.doc.mjs +1 -1
- 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 +13 -1
- 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 +186 -32
- 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 +41 -1
- package/src/Switch/Switch.spec.md +174 -0
- package/src/Text/Text.doc.mjs +190 -43
- package/src/Text/Text.spec.md +205 -0
- package/src/TextArea/TextArea.doc.mjs +256 -46
- package/src/TextArea/TextArea.spec.md +204 -0
- package/src/TextInput/TextInput.doc.mjs +1 -1
- package/src/TimeInput/TimeInput.doc.mjs +1 -1
- 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/Tokenizer/Tokenizer.doc.mjs +1 -1
- 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 +84 -2
- 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/i18n/InternationalizationContext.ts +3 -0
- package/src/i18n/InternationalizationProvider.tsx +8 -1
- package/src/i18n/__tests__/resolve.test.ts +23 -1
- package/src/i18n/resolve.ts +46 -49
- package/src/i18n/useTranslator.ts +2 -7
- 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:Kbd
|
|
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: [packages/core/src/Kbd/Kbd.test.tsx, scripts/check-knowledge.mjs]
|
|
14
|
+
families: []
|
|
15
|
+
design_specs: []
|
|
16
|
+
architecture: [architecture:component-theming-surface]
|
|
17
|
+
contributing: []
|
|
18
|
+
system_specs: []
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Kbd component contract
|
|
22
|
+
|
|
23
|
+
## Intent
|
|
24
|
+
|
|
25
|
+
Kbd presents a keyboard shortcut as one or more painted key badges. This draft
|
|
26
|
+
records current consumer anatomy and theming reachability without changing
|
|
27
|
+
runtime behavior, styling, targets, or public API.
|
|
28
|
+
|
|
29
|
+
## Compatibility and migration
|
|
30
|
+
|
|
31
|
+
- Released default preserved: `yes`
|
|
32
|
+
- Compatibility class: additive documentation only; runtime, DOM, styling,
|
|
33
|
+
targets, aliases, and public API remain unchanged
|
|
34
|
+
- Controlled/uncontrolled behavior: not applicable
|
|
35
|
+
- Migration decision: none
|
|
36
|
+
|
|
37
|
+
Consumer migration instructions belong in consumer docs and release notes.
|
|
38
|
+
|
|
39
|
+
## Ownership boundary
|
|
40
|
+
|
|
41
|
+
**Owns**
|
|
42
|
+
|
|
43
|
+
- The shortcut group, its current `kbd` target, and the painted key badges it
|
|
44
|
+
renders from the supplied shortcut string.
|
|
45
|
+
|
|
46
|
+
**Does not own / non-goals**
|
|
47
|
+
|
|
48
|
+
- The action associated with the shortcut or how the shortcut is discovered —
|
|
49
|
+
owned by the product callsite.
|
|
50
|
+
- Whether an individual key badge should gain a public target — unresolved by
|
|
51
|
+
this factual backfill.
|
|
52
|
+
|
|
53
|
+
## Public concepts
|
|
54
|
+
|
|
55
|
+
No new public concept is introduced. Consumer props and usage remain documented
|
|
56
|
+
in `Kbd.doc.mjs`.
|
|
57
|
+
|
|
58
|
+
## Behavioral and layout contract
|
|
59
|
+
|
|
60
|
+
| ID | Candidate invariant | Basis | Draft review state |
|
|
61
|
+
| --- | ------------------------------------------------------------------------------------------------------------ | ------------------------------- | --------------------------------------------------- |
|
|
62
|
+
| FR1 | The current render contains one shortcut group and one painted key badge for every parsed key segment. | Current source, docs, and tests | Verified current behavior; no new behavior decided |
|
|
63
|
+
| FR2 | The shortcut group carries the current `kbd` target; individual key badges currently carry no public target. | Current source, docs, and tests | Verified current behavior; theming intent unsettled |
|
|
64
|
+
|
|
65
|
+
### Allowed variation
|
|
66
|
+
|
|
67
|
+
- Platform-specific key text and caller-supplied shortcut combinations may vary
|
|
68
|
+
without changing the two-part anatomy recorded here.
|
|
69
|
+
|
|
70
|
+
### Representative states
|
|
71
|
+
|
|
72
|
+
- The same anatomy applies to single-key, multi-key, modifier, and
|
|
73
|
+
platform-resolved shortcuts.
|
|
74
|
+
|
|
75
|
+
### Transformation and precedence order
|
|
76
|
+
|
|
77
|
+
- No new parsing, layout, or styling precedence rule is introduced.
|
|
78
|
+
|
|
79
|
+
### Performance and resources
|
|
80
|
+
|
|
81
|
+
- No new performance or resource rule is introduced.
|
|
82
|
+
|
|
83
|
+
## Accessibility contract
|
|
84
|
+
|
|
85
|
+
This draft does not change or extend Kbd's existing accessible-name behavior.
|
|
86
|
+
|
|
87
|
+
## Design relationships
|
|
88
|
+
|
|
89
|
+
| Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
|
|
90
|
+
| ---------------- | ------------------------------------------------------------------ | ------------------------------ | -------------- | ------------------ |
|
|
91
|
+
| Shortcut | Groups the complete shortcut and carries its accessible name. | Current source and public docs | Supporting | FR1, FR2 |
|
|
92
|
+
| Key badge | Paints one visible badge for each key in the supplied combination. | Current source and public docs | Prominent | FR1, FR2 |
|
|
93
|
+
|
|
94
|
+
### Theming anatomy
|
|
95
|
+
|
|
96
|
+
<!-- anatomy-theming:v1 -->
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"Shortcut": {"target": "kbd"},
|
|
101
|
+
"Key badge": {
|
|
102
|
+
"none": {
|
|
103
|
+
"reason": "unsettled: No current public target reaches this part"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The `none` disposition records current reachability while target exposure remains
|
|
110
|
+
unsettled. It does not decide that key badges should remain without a public
|
|
111
|
+
target.
|
|
112
|
+
|
|
113
|
+
## Family and system relationships
|
|
114
|
+
|
|
115
|
+
- `architecture:component-theming-surface` owns anatomy qualification, target
|
|
116
|
+
mapping, and the difference between factual reachability and intended public
|
|
117
|
+
theming API.
|
|
118
|
+
|
|
119
|
+
## Verification map
|
|
120
|
+
|
|
121
|
+
| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
|
|
122
|
+
| ------------------- | ------------------------------------------------ | ------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------- |
|
|
123
|
+
| FR1 | `Kbd.test.tsx` key rendering suites | Single-key and multi-key output | Removing the group or a parsed badge fails existing role, element, or text assertions. | `audit:Kbd/anatomy` |
|
|
124
|
+
| FR2 | Source inspection and current target inventories | Root target and child badges | Adding or documenting a current target without updating the anatomy map fails repository checks. | `audit:Kbd/theming` |
|
|
125
|
+
| Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and targets | Missing, extra, prefixed, stale, or alias-backed mappings fail repository validation. | `audit:Kbd/theming` |
|
|
126
|
+
|
|
127
|
+
## Decision log
|
|
128
|
+
|
|
129
|
+
None. This draft records current facts and introduces no component-local design
|
|
130
|
+
or theming decision.
|
|
131
|
+
|
|
132
|
+
## Open questions
|
|
133
|
+
|
|
134
|
+
- **OQ1 — Should each Key badge gain a stable public theming target?**
|
|
135
|
+
(`human-api`) Target exposure is unsettled; the current lack of reachability
|
|
136
|
+
does not decide the answer.
|
|
137
|
+
|
|
138
|
+
## Content boundary
|
|
139
|
+
|
|
140
|
+
This file does not duplicate consumer prop tables/examples, current audit
|
|
141
|
+
results, implementation steps, or system rules. It links to their owners.
|
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').ComponentAnatomyElement[]} */
|
|
4
|
+
const anatomy = [
|
|
5
|
+
{
|
|
6
|
+
name: 'Page shell',
|
|
7
|
+
required: true,
|
|
8
|
+
description: 'Outer Layout container that arranges the named page regions.',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'Header',
|
|
12
|
+
required: false,
|
|
13
|
+
description: 'Optional top region for page or application header content.',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'Panel',
|
|
17
|
+
required: false,
|
|
18
|
+
description:
|
|
19
|
+
'Optional start or end side region; both positions use the same LayoutPanel part.',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'Content area',
|
|
23
|
+
required: false,
|
|
24
|
+
description: 'Optional central region for the page content.',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Footer',
|
|
28
|
+
required: false,
|
|
29
|
+
description: 'Optional bottom region for page footer content.',
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
|
|
3
33
|
/** @type {import('@astryxdesign/cli/authoring').ComponentDoc} */
|
|
4
34
|
|
|
5
35
|
export const docs = {
|
|
@@ -129,6 +159,7 @@ export const docs = {
|
|
|
129
159
|
{ guidance: false, description: 'Use Layout for simple stacking layouts; use HStack or VStack instead.' },
|
|
130
160
|
{ guidance: false, description: 'Nest multiple Layout components; use one per page shell and compose content within its slots.' },
|
|
131
161
|
],
|
|
162
|
+
anatomy,
|
|
132
163
|
},
|
|
133
164
|
};
|
|
134
165
|
|
|
@@ -159,5 +190,6 @@ export const docsDense = {
|
|
|
159
190
|
{ guidance: false, description: 'Use Layout for simple stacking layouts; use HStack or VStack instead.' },
|
|
160
191
|
{ guidance: false, description: 'Nest multiple Layout components; use one per page shell and compose content within its slots.' },
|
|
161
192
|
],
|
|
193
|
+
anatomy,
|
|
162
194
|
},
|
|
163
195
|
};
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 1
|
|
3
|
+
template_version: 3
|
|
4
|
+
kind: component
|
|
5
|
+
id: component:Layout
|
|
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: [public-api, behavior, layout, theming, accessibility]
|
|
13
|
+
verified_by:
|
|
14
|
+
[
|
|
15
|
+
packages/core/src/Layout/Layout.test.tsx,
|
|
16
|
+
packages/core/src/Layout/LayoutSlots.test.tsx,
|
|
17
|
+
packages/core/src/Layout/__tests__/childrenAsContent.test.tsx,
|
|
18
|
+
packages/core/src/Layout/__tests__/contentWidth.test.tsx,
|
|
19
|
+
packages/core/src/theme/themingTargets.test.ts,
|
|
20
|
+
scripts/check-knowledge.mjs,
|
|
21
|
+
]
|
|
22
|
+
families: [family:layout-regions]
|
|
23
|
+
design_specs: []
|
|
24
|
+
architecture:
|
|
25
|
+
[
|
|
26
|
+
architecture:container-padding,
|
|
27
|
+
architecture:component-theming-surface,
|
|
28
|
+
architecture:public-component-api,
|
|
29
|
+
]
|
|
30
|
+
contributing: []
|
|
31
|
+
system_specs: []
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
# Layout component contract
|
|
35
|
+
|
|
36
|
+
## Intent
|
|
37
|
+
|
|
38
|
+
Layout provides the page shell that arranges optional Header, Panel, Content
|
|
39
|
+
area, and Footer regions. This draft records the current aggregate consumer
|
|
40
|
+
anatomy and theming ownership without changing runtime behavior, DOM, styling,
|
|
41
|
+
targets, or public API.
|
|
42
|
+
|
|
43
|
+
## Compatibility and migration
|
|
44
|
+
|
|
45
|
+
- Released default preserved: `yes`
|
|
46
|
+
- Compatibility class: additive documentation only; runtime, DOM, styling,
|
|
47
|
+
targets, aliases, and public API remain unchanged
|
|
48
|
+
- Controlled/uncontrolled behavior: not applicable
|
|
49
|
+
- Migration decision: none
|
|
50
|
+
|
|
51
|
+
Consumer migration instructions belong in consumer docs and release notes.
|
|
52
|
+
|
|
53
|
+
## Ownership boundary
|
|
54
|
+
|
|
55
|
+
**Owns**
|
|
56
|
+
|
|
57
|
+
- The Page shell and its current `layout` target.
|
|
58
|
+
- The aggregate Header, Panel, Content area, and Footer anatomy and their current
|
|
59
|
+
`layout-header`, `layout-panel`, `layout-content`, and `layout-footer` targets.
|
|
60
|
+
- One Panel concept for both logical start and end positions.
|
|
61
|
+
|
|
62
|
+
**Does not own / non-goals**
|
|
63
|
+
|
|
64
|
+
- Product meaning or content supplied to any region — owned by the caller.
|
|
65
|
+
- Automatic responsive substitution of regions — owned by the caller, AppShell,
|
|
66
|
+
or another higher-level composition.
|
|
67
|
+
- Resize interaction — owned by useResizable and ResizeHandle.
|
|
68
|
+
- Correcting current container-padding publication mismatches or preventing two
|
|
69
|
+
adjacent divider owners from both painting; those remain current gaps and
|
|
70
|
+
caller obligations recorded below.
|
|
71
|
+
- New runtime behavior, API, target, alias, or region wrapper.
|
|
72
|
+
|
|
73
|
+
## Public concepts
|
|
74
|
+
|
|
75
|
+
No new public concept is introduced. Consumer props, slots, defaults, and usage
|
|
76
|
+
remain documented in `Layout.doc.mjs` and the region subcomponent docs.
|
|
77
|
+
`family:layout-regions` owns the shared region vocabulary.
|
|
78
|
+
|
|
79
|
+
## Behavioral and layout contract
|
|
80
|
+
|
|
81
|
+
| ID | Candidate invariant | Basis | Draft review state |
|
|
82
|
+
| --- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- | -------------------------------------------------- |
|
|
83
|
+
| FR1 | Layout renders one Page shell carrying the current `layout` target and places each supplied named region according to the existing shell topology. | Current source, docs, tests, and family | Verified current behavior; no new behavior decided |
|
|
84
|
+
| FR2 | Header, Content area, and Footer use their current `layout-header`, `layout-content`, and `layout-footer` targets on the corresponding Layout region components. | Current source and target metadata | Verified current inventory; no target change |
|
|
85
|
+
| FR3 | A Panel in either logical start or end position is the same aggregate Panel part and uses the current `layout-panel` target; position does not create a second anatomy row or target. | Current source, docs, tests, and family | Verified current ownership; no API change |
|
|
86
|
+
| FR4 | `Layout.doc.mjs` is the canonical aggregate consumer document for all five current `layout*` targets; region subcomponent docs continue to document their own props and usage without duplicating the aggregate target inventory. | Current documentation organization | Verified current ownership |
|
|
87
|
+
| FR5 | LayoutContent and LayoutPanel retain their shipped automatic container-padding publication behavior, including the mismatches recorded by `architecture:container-padding`; this documentation does not claim exact parity. | Current source and architecture record | Current conformance gap; not fixed here |
|
|
88
|
+
| FR6 | When an adjacent ResizeHandle owns a panel divider, the caller must keep `LayoutPanel hasDivider={false}`; current composition does not prevent both components from painting the same boundary. | Current source, docs, and family contract | Current caller obligation; not fixed here |
|
|
89
|
+
|
|
90
|
+
### Current evidence and gaps
|
|
91
|
+
|
|
92
|
+
- LayoutContent does not republish a matching inline-end container-padding value
|
|
93
|
+
on its automatic no-end path, and its no-start path writes the outer inline
|
|
94
|
+
value to both inline geometry variables. LayoutPanel applies automatic outer
|
|
95
|
+
shell-edge padding while retaining baseline inner geometry variables. A
|
|
96
|
+
full-bleed descendant can therefore compensate against a published value that
|
|
97
|
+
differs from the region's applied padding. This is shipped evidence and a
|
|
98
|
+
runtime conformance gap, not behavior corrected or approved by this draft.
|
|
99
|
+
- LayoutPanel and an adjacent ResizeHandle can both draw the same content-facing
|
|
100
|
+
divider. The current caller obligation is to set
|
|
101
|
+
`LayoutPanel hasDivider={false}` when ResizeHandle owns that line. This draft
|
|
102
|
+
does not add coordination or duplicate-divider prevention.
|
|
103
|
+
|
|
104
|
+
### Allowed variation
|
|
105
|
+
|
|
106
|
+
- **AV1 — Slot presence.** Header, start Panel, Content area, end Panel, and Footer
|
|
107
|
+
may be independently present or absent within the existing shell topology.
|
|
108
|
+
- **AV2 — Panel position.** A Panel may occupy logical start or end, or Panels may
|
|
109
|
+
occupy both positions; all use the same conceptual part and target owner.
|
|
110
|
+
- **AV3 — Region content.** Caller-provided region content retains its own
|
|
111
|
+
semantics and theming ownership.
|
|
112
|
+
|
|
113
|
+
### Representative states
|
|
114
|
+
|
|
115
|
+
| State | Required invariant | Allowed variation |
|
|
116
|
+
| --------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------ |
|
|
117
|
+
| Content-only shell | Page shell and Content area use their current targets. | Caller content and current height/width configuration. |
|
|
118
|
+
| Header/content/footer | Each supplied region uses its corresponding aggregate part and target. | Divider selection, size, padding, and caller content. |
|
|
119
|
+
| Start or end Panel | Either logical position uses the one Panel part and `layout-panel` target. | Position, width, scrolling, padding, and caller role. |
|
|
120
|
+
| Two Panels | Both instances remain one repeated conceptual Panel part. | Independent content, width, and local configuration. |
|
|
121
|
+
| ResizeHandle-adjacent | Divider ownership follows the current caller obligation in FR6. | Resize state remains owned by the resize components. |
|
|
122
|
+
|
|
123
|
+
### Transformation and precedence order
|
|
124
|
+
|
|
125
|
+
- No new slot, padding, content-width, divider, scrolling, sizing, or styling
|
|
126
|
+
precedence rule is introduced.
|
|
127
|
+
|
|
128
|
+
### Performance and resources
|
|
129
|
+
|
|
130
|
+
- No new performance or resource rule is introduced.
|
|
131
|
+
|
|
132
|
+
## Accessibility contract
|
|
133
|
+
|
|
134
|
+
This draft does not add inferred landmark semantics. LayoutHeader,
|
|
135
|
+
LayoutContent, LayoutFooter, and LayoutPanel retain their current explicit
|
|
136
|
+
caller-supplied role and label behavior.
|
|
137
|
+
|
|
138
|
+
## Design relationships
|
|
139
|
+
|
|
140
|
+
| Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
|
|
141
|
+
| ---------------- | -------------------------------------------------------------- | ----------------------------------------- | -------------- | ------------------ |
|
|
142
|
+
| Page shell | Arranges the named page regions. | Current source, docs, and family contract | Supporting | FR1 |
|
|
143
|
+
| Header | Presents optional top-region content. | Current source, docs, and family contract | Supporting | FR1, FR2 |
|
|
144
|
+
| Panel | Presents optional side-region content at logical start or end. | Current source, docs, and family contract | Supporting | FR1, FR3, FR6 |
|
|
145
|
+
| Content area | Presents optional central page content. | Current source, docs, and family contract | Prominent | FR1, FR2, FR5 |
|
|
146
|
+
| Footer | Presents optional bottom-region content. | Current source, docs, and family contract | Supporting | FR1, FR2 |
|
|
147
|
+
|
|
148
|
+
### Theming anatomy
|
|
149
|
+
|
|
150
|
+
<!-- anatomy-theming:v1 -->
|
|
151
|
+
|
|
152
|
+
```json
|
|
153
|
+
{
|
|
154
|
+
"Page shell": {"target": "layout"},
|
|
155
|
+
"Header": {"target": "layout-header"},
|
|
156
|
+
"Panel": {"target": "layout-panel"},
|
|
157
|
+
"Content area": {"target": "layout-content"},
|
|
158
|
+
"Footer": {"target": "layout-footer"}
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
The exact map records the five current public targets. Start and end Panels are
|
|
163
|
+
instances of the same stable conceptual part and therefore share one map row.
|
|
164
|
+
|
|
165
|
+
## Family and system relationships
|
|
166
|
+
|
|
167
|
+
- `family:layout-regions` owns the shared shell-region topology, logical
|
|
168
|
+
direction, boundaries, scrolling, and component ownership.
|
|
169
|
+
- `architecture:container-padding` owns Layout inset publication and the current
|
|
170
|
+
LayoutContent/LayoutPanel conformance gap.
|
|
171
|
+
- `architecture:component-theming-surface` owns anatomy qualification and exact
|
|
172
|
+
target mapping rules.
|
|
173
|
+
- `architecture:public-component-api` owns the stable slots, props, exports, and
|
|
174
|
+
compatibility boundary; this documentation adds no API.
|
|
175
|
+
|
|
176
|
+
## Verification map
|
|
177
|
+
|
|
178
|
+
| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
|
|
179
|
+
| ------------- | ----------------------------------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------------------------------------------------------- | ---------------------------- |
|
|
180
|
+
| FR1–FR3 | Layout render, slot, children-as-content, and target inventory tests | Content-only, all regions, logical start/end Panels | Removing a region or target fails existing structure, context, or target inventory assertions. | `audit:Layout/anatomy` |
|
|
181
|
+
| FR4 | `scripts/check-knowledge.mjs` | Canonical aggregate doc and exact five-target map | Duplicated, missing, extra, prefixed, or stale target mappings fail repository validation. | `audit:Layout/theming` |
|
|
182
|
+
| FR5 | Source inspection plus `architecture:container-padding` verification evidence | Automatic outer-edge Content area and Panel paths | This draft adds no parity assertion; a runtime correction requires separate compatibility evidence. | `audit:Layout/layout` |
|
|
183
|
+
| FR6 | LayoutPanel source/docs plus `family:layout-regions` verification evidence | Panel beside a divider-owning ResizeHandle | This draft adds no prevention assertion; changing ownership requires separate runtime coverage. | `audit:Layout/layout` |
|
|
184
|
+
| Accessibility | `LayoutSlots.test.tsx` landmark assertions | Header, Content area, Footer, and Panel roles | Supplied role or label no longer reaches the region element. | `audit:Layout/accessibility` |
|
|
185
|
+
|
|
186
|
+
## Decision log
|
|
187
|
+
|
|
188
|
+
None. This draft records current facts and introduces no component-local design,
|
|
189
|
+
layout, API, target, or behavior decision.
|
|
190
|
+
|
|
191
|
+
## Open questions
|
|
192
|
+
|
|
193
|
+
None.
|
|
194
|
+
|
|
195
|
+
## Content boundary
|
|
196
|
+
|
|
197
|
+
This file does not duplicate consumer prop tables or examples, family region
|
|
198
|
+
rules, container-padding mechanics, resize interaction, implementation steps,
|
|
199
|
+
or system rules. It links to their owners.
|
|
@@ -1,12 +1,63 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').ComponentAnatomyElement[]} */
|
|
4
|
+
const anatomy = [
|
|
5
|
+
{
|
|
6
|
+
name: 'Viewer overlay',
|
|
7
|
+
required: true,
|
|
8
|
+
description:
|
|
9
|
+
'Full-viewport dialog overlay that contains the active media and controls.',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'Media',
|
|
13
|
+
required: true,
|
|
14
|
+
description: 'Active image or video presented inside the viewer.',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'Close button',
|
|
18
|
+
required: true,
|
|
19
|
+
description: 'Button that closes the viewer.',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'Previous button',
|
|
23
|
+
required: false,
|
|
24
|
+
description: 'Gallery button that moves to the previous media item.',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Next button',
|
|
28
|
+
required: false,
|
|
29
|
+
description: 'Gallery button that moves to the next media item.',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'Caption',
|
|
33
|
+
required: false,
|
|
34
|
+
description: 'Caller-provided caption displayed below the active media.',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'Counter',
|
|
38
|
+
required: false,
|
|
39
|
+
description: 'Current position and total shown in gallery mode.',
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
|
|
3
43
|
/** @type {import('@astryxdesign/cli/authoring').ComponentDoc} */
|
|
4
44
|
|
|
5
45
|
export const docs = {
|
|
6
46
|
name: 'Lightbox',
|
|
7
47
|
displayName: 'Lightbox',
|
|
8
48
|
category: 'Overlay',
|
|
9
|
-
keywords: [
|
|
49
|
+
keywords: [
|
|
50
|
+
'lightbox',
|
|
51
|
+
'image',
|
|
52
|
+
'video',
|
|
53
|
+
'viewer',
|
|
54
|
+
'gallery',
|
|
55
|
+
'zoom',
|
|
56
|
+
'fullscreen',
|
|
57
|
+
'media',
|
|
58
|
+
'photo',
|
|
59
|
+
'preview',
|
|
60
|
+
],
|
|
10
61
|
props: [
|
|
11
62
|
{
|
|
12
63
|
name: 'isOpen',
|
|
@@ -28,7 +79,8 @@ export const docs = {
|
|
|
28
79
|
// where a media object belongs. The shape and its legal values live in
|
|
29
80
|
// the description instead (#1645).
|
|
30
81
|
type: 'LightboxMedia | LightboxMedia[]',
|
|
31
|
-
description:
|
|
82
|
+
description:
|
|
83
|
+
"Media to display. Pass a single object for one item, or an array for gallery mode with prev/next navigation. Each item is {src: string, alt: string, caption?: ReactNode, type?: 'image' | 'video'}; type defaults to 'image', and zoom/pan is disabled for 'video'.",
|
|
32
84
|
required: true,
|
|
33
85
|
},
|
|
34
86
|
{
|
|
@@ -39,46 +91,70 @@ export const docs = {
|
|
|
39
91
|
{
|
|
40
92
|
name: 'onIndexChange',
|
|
41
93
|
type: '(index: number) => void',
|
|
42
|
-
description:
|
|
94
|
+
description:
|
|
95
|
+
'Callback when the gallery index changes via prev/next navigation.',
|
|
43
96
|
},
|
|
44
97
|
{
|
|
45
98
|
name: 'hasZoom',
|
|
46
99
|
type: 'boolean',
|
|
47
|
-
description:
|
|
100
|
+
description:
|
|
101
|
+
'Enable zoom on double-click, or Enter/Space/+/- via keyboard (images only). When zoomed, drag or use arrow keys to pan.',
|
|
48
102
|
default: 'false',
|
|
49
103
|
},
|
|
50
104
|
{
|
|
51
105
|
name: 'defaultIndex',
|
|
52
106
|
type: 'number',
|
|
53
|
-
description:
|
|
107
|
+
description:
|
|
108
|
+
'Initial image index in gallery mode for uncontrolled usage.',
|
|
54
109
|
default: '0',
|
|
55
110
|
},
|
|
56
111
|
{
|
|
57
112
|
name: 'hasAutoPlay',
|
|
58
113
|
type: 'boolean',
|
|
59
|
-
description:
|
|
114
|
+
description:
|
|
115
|
+
'Automatically start video playback when a video media item is shown.',
|
|
60
116
|
default: 'false',
|
|
61
117
|
},
|
|
62
118
|
{
|
|
63
119
|
name: 'xstyle',
|
|
64
120
|
type: 'StyleXStyles',
|
|
65
|
-
description:
|
|
121
|
+
description:
|
|
122
|
+
'StyleX styles for layout customization. Must be stylex.create() value.',
|
|
66
123
|
},
|
|
67
124
|
],
|
|
68
125
|
theming: {
|
|
69
|
-
targets: [
|
|
70
|
-
{className: 'astryx-lightbox', visualProps: []},
|
|
71
|
-
],
|
|
126
|
+
targets: [{className: 'astryx-lightbox', visualProps: []}],
|
|
72
127
|
},
|
|
73
128
|
usage: {
|
|
129
|
+
anatomy,
|
|
74
130
|
description:
|
|
75
131
|
'A fullscreen overlay for viewing images and videos at full resolution. Supports single-item and gallery modes with prev/next navigation, optional zoom and pan for images, and native video controls.',
|
|
76
132
|
bestPractices: [
|
|
77
|
-
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
133
|
+
{
|
|
134
|
+
guidance: true,
|
|
135
|
+
description:
|
|
136
|
+
'Always provide alt text for every image for screen reader accessibility.',
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
guidance: true,
|
|
140
|
+
description:
|
|
141
|
+
'Use gallery mode with onIndexChange for multi-image sets.',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
guidance: true,
|
|
145
|
+
description:
|
|
146
|
+
'Enable hasZoom only when viewing high-resolution images that benefit from close inspection.',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
guidance: false,
|
|
150
|
+
description:
|
|
151
|
+
'Use the lightbox for non-image content; it is specialized for images.',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
guidance: false,
|
|
155
|
+
description:
|
|
156
|
+
'Nest interactive content inside captions; keep them plain text.',
|
|
157
|
+
},
|
|
82
158
|
],
|
|
83
159
|
},
|
|
84
160
|
// The lightbox opens via showModal() and renders nothing while closed —
|
|
@@ -91,7 +167,8 @@ export const docs = {
|
|
|
91
167
|
media: {
|
|
92
168
|
src: '/template-assets/light-scene-horizontal-1.png',
|
|
93
169
|
alt: 'Coastal shoreline with ocean waves',
|
|
94
|
-
caption:
|
|
170
|
+
caption:
|
|
171
|
+
'A scenic coastline with waves rolling onto a sandy beach beneath a clear sky.',
|
|
95
172
|
},
|
|
96
173
|
},
|
|
97
174
|
},
|
|
@@ -117,7 +194,8 @@ export const docsZh = {
|
|
|
117
194
|
{
|
|
118
195
|
name: 'media',
|
|
119
196
|
type: 'LightboxMedia | LightboxMedia[]',
|
|
120
|
-
description:
|
|
197
|
+
description:
|
|
198
|
+
"要显示的媒体。传入单个对象或数组(用于画廊模式的上一张/下一张导航)。每项为 {src, alt, caption?, type?: 'image' | 'video'};type 默认为 'image','video' 禁用缩放/平移。",
|
|
121
199
|
required: true,
|
|
122
200
|
},
|
|
123
201
|
{
|
|
@@ -139,39 +217,76 @@ export const docsZh = {
|
|
|
139
217
|
{
|
|
140
218
|
name: 'xstyle',
|
|
141
219
|
type: 'StyleXStyles',
|
|
142
|
-
description:
|
|
220
|
+
description:
|
|
221
|
+
'用于布局自定义的 StyleX 样式。必须是 stylex.create() 的值。',
|
|
143
222
|
},
|
|
144
223
|
],
|
|
145
224
|
theming: {
|
|
146
|
-
targets: [
|
|
147
|
-
{className: 'astryx-lightbox', visualProps: []},
|
|
148
|
-
],
|
|
225
|
+
targets: [{className: 'astryx-lightbox', visualProps: []}],
|
|
149
226
|
},
|
|
150
227
|
usage: {
|
|
228
|
+
anatomy,
|
|
151
229
|
description:
|
|
152
230
|
'A fullscreen overlay for viewing images and videos at full resolution. Supports single-item and gallery modes with prev/next navigation, optional zoom and pan for images, and native video controls.',
|
|
153
231
|
bestPractices: [
|
|
154
|
-
{
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
232
|
+
{
|
|
233
|
+
guidance: true,
|
|
234
|
+
description:
|
|
235
|
+
'Always provide alt text for every image for screen reader accessibility.',
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
guidance: true,
|
|
239
|
+
description:
|
|
240
|
+
'Use gallery mode with onIndexChange for multi-image sets.',
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
guidance: true,
|
|
244
|
+
description:
|
|
245
|
+
'Enable hasZoom only when viewing high-resolution images that benefit from close inspection.',
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
guidance: false,
|
|
249
|
+
description:
|
|
250
|
+
'Use the lightbox for non-image content; it is specialized for images.',
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
guidance: false,
|
|
254
|
+
description:
|
|
255
|
+
'Nest interactive content inside captions; keep them plain text.',
|
|
256
|
+
},
|
|
159
257
|
],
|
|
160
258
|
},
|
|
161
259
|
};
|
|
162
260
|
|
|
163
261
|
/** @type {import('@astryxdesign/cli/authoring').ComponentTranslationDoc} */
|
|
164
262
|
export const docsDense = {
|
|
165
|
-
description:
|
|
263
|
+
description:
|
|
264
|
+
'Fullscreen overlay for viewing images and videos at full resolution with gallery navigation and zoom.',
|
|
166
265
|
usage: {
|
|
266
|
+
anatomy,
|
|
167
267
|
description:
|
|
168
268
|
'A fullscreen overlay for viewing images and videos at full resolution. Supports single-item and gallery modes with prev/next navigation, optional zoom and pan for images, and native video controls.',
|
|
169
269
|
bestPractices: [
|
|
170
|
-
{
|
|
171
|
-
{
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
270
|
+
{guidance: true, description: 'Always provide alt text for every image.'},
|
|
271
|
+
{
|
|
272
|
+
guidance: true,
|
|
273
|
+
description:
|
|
274
|
+
'Use gallery mode with onIndexChange for multi-image sets.',
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
guidance: true,
|
|
278
|
+
description:
|
|
279
|
+
'Enable hasZoom only when viewing high-resolution images that benefit from close inspection.',
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
guidance: false,
|
|
283
|
+
description: 'Use for non-image content; specialized for images.',
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
guidance: false,
|
|
287
|
+
description:
|
|
288
|
+
'Nest interactive content inside captions; keep them plain text.',
|
|
289
|
+
},
|
|
175
290
|
],
|
|
176
291
|
},
|
|
177
292
|
propDescriptions: {
|
|
@@ -180,7 +295,8 @@ export const docsDense = {
|
|
|
180
295
|
media: 'Single media object or array for gallery mode.',
|
|
181
296
|
index: 'Current index in gallery mode.',
|
|
182
297
|
onIndexChange: 'Callback when gallery index changes.',
|
|
183
|
-
hasZoom:
|
|
298
|
+
hasZoom:
|
|
299
|
+
'Enable zoom (double-click, Enter/Space, or +/-) and pan (drag or arrow keys) for images.',
|
|
184
300
|
xstyle: 'StyleX styles for layout customization.',
|
|
185
301
|
},
|
|
186
302
|
};
|