@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
|
@@ -1,11 +1,30 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').ComponentAnatomyElement[]} */
|
|
4
|
+
const anatomy = [
|
|
5
|
+
{
|
|
6
|
+
name: 'Message box',
|
|
7
|
+
required: true,
|
|
8
|
+
description: 'Painted container for the validation feedback.',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'Detached icon',
|
|
12
|
+
required: false,
|
|
13
|
+
description: 'Leading status glyph shown only by the detached variant.',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'Message text',
|
|
17
|
+
required: true,
|
|
18
|
+
description: 'Text describing the validation status.',
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
|
|
3
22
|
/** @type {import('@astryxdesign/cli/authoring').ComponentDoc} */
|
|
4
23
|
export const docs = {
|
|
5
24
|
name: 'FieldStatus',
|
|
6
25
|
displayName: 'Field Status',
|
|
7
26
|
group: 'Field',
|
|
8
|
-
category: '
|
|
27
|
+
category: 'Form Controls',
|
|
9
28
|
isHiddenFromOverview: true,
|
|
10
29
|
description:
|
|
11
30
|
'Status message component for form field validation feedback. Messages are announced to screen readers through persistent live regions (assertive for errors, polite otherwise), so conditional mounting is safe.',
|
|
@@ -61,6 +80,7 @@ export const docs = {
|
|
|
61
80
|
'Use FieldStatus for general alerts or page-level notices; use Banner or Toast instead.',
|
|
62
81
|
},
|
|
63
82
|
],
|
|
83
|
+
anatomy,
|
|
64
84
|
},
|
|
65
85
|
};
|
|
66
86
|
|
|
@@ -86,6 +106,7 @@ export const docsDense = {
|
|
|
86
106
|
'Use FieldStatus for general alerts or page-level notices; use Banner or Toast instead.',
|
|
87
107
|
},
|
|
88
108
|
],
|
|
109
|
+
anatomy,
|
|
89
110
|
},
|
|
90
111
|
propDescriptions: {
|
|
91
112
|
type: 'error/warning/success status tone',
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 1
|
|
3
|
+
template_version: 1
|
|
4
|
+
kind: component
|
|
5
|
+
id: component:FieldStatus
|
|
6
|
+
authority: current
|
|
7
|
+
archive_reason: null
|
|
8
|
+
superseded_by: null
|
|
9
|
+
approved_by: cixzhang
|
|
10
|
+
approved_at: 2026-08-30
|
|
11
|
+
owners: [cixzhang, imdreamrunner]
|
|
12
|
+
review_triggers: [public-api, behavior, theming, accessibility]
|
|
13
|
+
verified_by:
|
|
14
|
+
[
|
|
15
|
+
packages/core/src/FieldStatus/FieldStatus.test.tsx,
|
|
16
|
+
scripts/check-knowledge.mjs,
|
|
17
|
+
]
|
|
18
|
+
families: []
|
|
19
|
+
design_specs: []
|
|
20
|
+
architecture: [architecture:component-theming-surface]
|
|
21
|
+
contributing: []
|
|
22
|
+
system_specs: []
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# FieldStatus component contract
|
|
26
|
+
|
|
27
|
+
## Intent
|
|
28
|
+
|
|
29
|
+
FieldStatus presents one validation message for a field or field-like control. It
|
|
30
|
+
owns the visible message treatment and announcement behavior for attached and
|
|
31
|
+
detached presentations; consumer usage remains documented in
|
|
32
|
+
`FieldStatus.doc.mjs`.
|
|
33
|
+
|
|
34
|
+
## Compatibility and migration
|
|
35
|
+
|
|
36
|
+
- Released default preserved: `yes`
|
|
37
|
+
- Compatibility class: additive documentation only; runtime, DOM, styling, and
|
|
38
|
+
public API remain unchanged
|
|
39
|
+
- Controlled/uncontrolled behavior: not applicable
|
|
40
|
+
- Migration decision: direct `FieldStatus variant="tooltip"` support is rejected.
|
|
41
|
+
`tooltip` remains a field-family sentinel that MUST be handled before rendering
|
|
42
|
+
FieldStatus. Narrowing the currently permissive type/runtime path requires a
|
|
43
|
+
separate compatibility-aware implementation change.
|
|
44
|
+
|
|
45
|
+
Consumer migration instructions belong in consumer docs and release notes.
|
|
46
|
+
|
|
47
|
+
## Ownership boundary
|
|
48
|
+
|
|
49
|
+
**Owns**
|
|
50
|
+
|
|
51
|
+
- The attached and detached validation-message presentations.
|
|
52
|
+
- Routing visible messages through the persistent announcement channels.
|
|
53
|
+
- The detached presentation's redundant visual status glyph.
|
|
54
|
+
|
|
55
|
+
**Does not own / non-goals**
|
|
56
|
+
|
|
57
|
+
- Whether a caller renders a status message, or which control it describes —
|
|
58
|
+
owned by the composing field component or product callsite.
|
|
59
|
+
- The bordered control's status treatment and on-field tooltip presentation —
|
|
60
|
+
owned by the composing field component.
|
|
61
|
+
- General alerts and page-level notices — owned by the corresponding feedback
|
|
62
|
+
components.
|
|
63
|
+
|
|
64
|
+
## Public concepts
|
|
65
|
+
|
|
66
|
+
| Concept | Closed values or states | Meaning | Availability by variant/orientation/state | Default | Owner | Stability | Invalid-value behavior |
|
|
67
|
+
| ------------ | ----------------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------- | ----------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
68
|
+
| Status type | `error`, `warning`, `success` | Selects the message tone and announcement channel. | All rendered presentations. | Required | `component:FieldStatus` | Stable | TypeScript rejects unsupported values. |
|
|
69
|
+
| Presentation | `attached`, `detached` | Selects the message presentation. | All direct FieldStatus usage. The field family's `tooltip` sentinel is handled before FieldStatus renders. | `attached` | `component:FieldStatus` | Stable. | TypeScript rejects values absent from the extensible variant map; its current acceptance of `tooltip` is an implementation gap. |
|
|
70
|
+
|
|
71
|
+
The field family's `tooltip` status presentation suppresses FieldStatus and
|
|
72
|
+
surfaces the message from the control's on-field icon. `tooltip` is not a
|
|
73
|
+
FieldStatus presentation. The public extensible variant map currently permits a
|
|
74
|
+
direct `tooltip` value; that is an implementation gap, not supported behavior.
|
|
75
|
+
|
|
76
|
+
## Behavioral and layout contract
|
|
77
|
+
|
|
78
|
+
Draft requirements identify their basis so observed code is not mistaken for an
|
|
79
|
+
intentional decision.
|
|
80
|
+
|
|
81
|
+
| ID | Candidate invariant | Basis | Draft review state |
|
|
82
|
+
| --- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | ------------------------------------------------------- |
|
|
83
|
+
| FR1 | FieldStatus MUST render the provided message in one visible message box when mounted. | Documented promise and current tests. | Settled intent. |
|
|
84
|
+
| FR2 | The attached presentation MUST render the message without a leading glyph; the detached presentation MUST render its status glyph before the message text. | Documented promise, current DOM, and current tests. | Settled intent. |
|
|
85
|
+
| FR3 | Status type MUST select distinct error, warning, or success treatment and MUST be reflected on the message-box target. | Current behavior and theming tests. | Settled intent. |
|
|
86
|
+
| FR4 | The detached glyph MUST reflect status type on its own target; the target MUST be absent from attached presentation. | Current behavior and target tests. | Settled intent. |
|
|
87
|
+
| FR5 | The root MUST continue to forward its ref, ID, supported DOM props, and consumer styling escape hatches. | Current behavior and tests. | Current compatibility behavior; verify before changing. |
|
|
88
|
+
| FR6 | Message and status-type updates MUST update the visible output without replacing the component contract. | Current behavior and tests. | Current compatibility behavior; verify before changing. |
|
|
89
|
+
| FR7 | Direct FieldStatus usage MUST support only `attached` and `detached`; the Field family MUST consume its `tooltip` sentinel before rendering FieldStatus. | Approved component boundary. | Settled intent; current type acceptance is a gap. |
|
|
90
|
+
|
|
91
|
+
### Allowed variation
|
|
92
|
+
|
|
93
|
+
- **AV1 — Theme styling.** Theme and consumer overrides may change visual CSS
|
|
94
|
+
properties through the existing targets and styling escape hatches without
|
|
95
|
+
changing anatomy, ownership, or presentation behavior.
|
|
96
|
+
- **AV2 — Message length.** The message may wrap; the detached glyph remains
|
|
97
|
+
aligned with the first text line.
|
|
98
|
+
|
|
99
|
+
### Representative states
|
|
100
|
+
|
|
101
|
+
| State | Required invariant | Allowed variation |
|
|
102
|
+
| ---------------- | -------------------------------------------------------------- | ----------------------------------------------------------- |
|
|
103
|
+
| Attached error | Message box and text render; no detached glyph renders. | Theme-controlled visual properties on `field-status`. |
|
|
104
|
+
| Detached warning | Message box, leading warning glyph, then message text render. | Theme-controlled visual properties on both current targets. |
|
|
105
|
+
| Detached success | Message box, leading success glyph, then message text render. | Message length and theme-controlled visual properties. |
|
|
106
|
+
| Empty message | The root remains mounted and renders the provided empty value. | No announcement channel is created. |
|
|
107
|
+
|
|
108
|
+
### Transformation and precedence order
|
|
109
|
+
|
|
110
|
+
- **ORD1 — Presentation styling.** Resolve the default presentation, reflect
|
|
111
|
+
status and presentation through `themeProps`, apply component styles, then
|
|
112
|
+
merge `xstyle`, `className`, and inline `style` in their established order.
|
|
113
|
+
- **ORD2 — Detached content.** Render the decorative status glyph before the
|
|
114
|
+
message text, using the same status-to-glyph mapping as field controls.
|
|
115
|
+
|
|
116
|
+
### Performance and resources
|
|
117
|
+
|
|
118
|
+
- **PR1 — Announcement work.** A message change schedules only the persistent
|
|
119
|
+
live-region announcement; FieldStatus owns no global event listeners,
|
|
120
|
+
observers, or measurements.
|
|
121
|
+
|
|
122
|
+
## Accessibility contract
|
|
123
|
+
|
|
124
|
+
- **AR1 — Announcement channel.** Errors MUST announce through the persistent
|
|
125
|
+
assertive region; warnings and successes MUST announce through the persistent
|
|
126
|
+
polite region, including on first mount and when message or type changes.
|
|
127
|
+
- **AR2 — Visible description.** The rendered message box MUST remain available
|
|
128
|
+
to assistive technology for `aria-describedby` association and MUST NOT become
|
|
129
|
+
its own newly mounted live region.
|
|
130
|
+
- **AR3 — Non-color cue.** Detached status MUST include a leading status glyph so
|
|
131
|
+
status is not conveyed only by color or position.
|
|
132
|
+
- **AR4 — Redundant glyph.** The detached glyph MUST remain hidden from assistive
|
|
133
|
+
technology because the visible message already conveys and announces the
|
|
134
|
+
status.
|
|
135
|
+
|
|
136
|
+
## Design relationships
|
|
137
|
+
|
|
138
|
+
| Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
|
|
139
|
+
| ---------------- | ---------------------------------------------------------- | ----------------------------------------------- | -------------- | ------------------ |
|
|
140
|
+
| Message box | Carries the visible validation treatment. | Current behavior and approved component intent. | Supporting | FR1, FR3 |
|
|
141
|
+
| Detached icon | Adds a non-color status cue only in detached presentation. | Current behavior and approved component intent. | Supporting | FR2, FR4, AR3 |
|
|
142
|
+
| Message text | Communicates the validation result in words. | Current behavior and approved component intent. | Prominent | FR1, AR1, AR2 |
|
|
143
|
+
|
|
144
|
+
Current behavior renders the detached icon before message text. The intended
|
|
145
|
+
public theming ownership is the exact map below; it does not add a target or
|
|
146
|
+
change either presentation.
|
|
147
|
+
|
|
148
|
+
### Theming anatomy
|
|
149
|
+
|
|
150
|
+
<!-- anatomy-theming:v1 -->
|
|
151
|
+
|
|
152
|
+
```json
|
|
153
|
+
{
|
|
154
|
+
"Message box": {"target": "field-status"},
|
|
155
|
+
"Detached icon": {"target": "field-status-icon"},
|
|
156
|
+
"Message text": {"inherits": "field-status"}
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Family and system relationships
|
|
161
|
+
|
|
162
|
+
- `architecture:component-theming-surface` owns the qualification and validation
|
|
163
|
+
rules for the two targets and inherited message text.
|
|
164
|
+
- Field-like controls compose FieldStatus but continue to own control rendering,
|
|
165
|
+
status placement decisions, and association with the control.
|
|
166
|
+
|
|
167
|
+
## Verification map
|
|
168
|
+
|
|
169
|
+
| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
|
|
170
|
+
| ------------------- | --------------------------------------------------------- | ------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------- |
|
|
171
|
+
| FR1, FR2, AR3, AR4 | `FieldStatus.test.tsx` rendering and detached-icon suites | Attached and detached; all status types | Removing or reordering presentation parts fails DOM and accessibility assertions. | `audit:FieldStatus/anatomy` |
|
|
172
|
+
| FR3, FR4 | `FieldStatus.test.tsx` theme target suites | Attached/detached; error/warning/success | Removing a target or status reflection fails class/data-attribute assertions. | `audit:FieldStatus/theming` |
|
|
173
|
+
| FR5, FR6 | `FieldStatus.test.tsx` forwarding and update suites | Initial render and rerender | Breaking the released root or update behavior fails compatibility assertions. | `audit:FieldStatus/behavior` |
|
|
174
|
+
| AR1, AR2 | `FieldStatus.test.tsx` announcement suites | Mount, message update, type update, empty message | Reintroducing a local live region or misrouting severity fails announcement assertions. | `audit:FieldStatus/accessibility` |
|
|
175
|
+
| Theming anatomy map | `scripts/check-knowledge.mjs` | Consumer anatomy and current targets | Missing, extra, duplicated, prefixed, or stale mappings fail repository validation. | `audit:FieldStatus/theming` |
|
|
176
|
+
|
|
177
|
+
## Decision log
|
|
178
|
+
|
|
179
|
+
### DEC-1 — Presentation-specific anatomy remains explicit
|
|
180
|
+
|
|
181
|
+
**Reference:** `component:FieldStatus/DEC-1`
|
|
182
|
+
**Decider:** cixzhang, 2026-08-30
|
|
183
|
+
|
|
184
|
+
The detached icon is a separate anatomy part because only detached presentation
|
|
185
|
+
renders it and it owns a target distinct from the message box. Message text
|
|
186
|
+
inherits the message-box target rather than creating a redundant child target.
|
|
187
|
+
|
|
188
|
+
Rejected: collapsing the glyph into a generic message row, which would hide its
|
|
189
|
+
presentation condition and distinct theming owner.
|
|
190
|
+
|
|
191
|
+
### DEC-2 — `tooltip` is not a FieldStatus presentation
|
|
192
|
+
|
|
193
|
+
**Reference:** `component:FieldStatus/DEC-2`
|
|
194
|
+
**Decider:** cixzhang, 2026-08-30
|
|
195
|
+
|
|
196
|
+
Direct FieldStatus usage supports only `attached` and `detached`. The Field
|
|
197
|
+
family may use `tooltip` as an internal presentation sentinel, but it MUST
|
|
198
|
+
consume that value before rendering FieldStatus and surface the message through
|
|
199
|
+
the control's on-field status treatment instead.
|
|
200
|
+
|
|
201
|
+
Rejected: defining direct `FieldStatus variant="tooltip"` rendering semantics.
|
|
202
|
+
That would expose a field-composition mechanism as a third FieldStatus
|
|
203
|
+
presentation and preserve currently unintentional output.
|
|
204
|
+
|
|
205
|
+
## Open questions
|
|
206
|
+
|
|
207
|
+
None.
|
|
208
|
+
|
|
209
|
+
## Content boundary
|
|
210
|
+
|
|
211
|
+
This file does not duplicate consumer prop examples, current audit results,
|
|
212
|
+
implementation steps, or family/system rules. It links to their owners.
|
package/src/Grid/Grid.doc.mjs
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').ComponentAnatomyElement[]} */
|
|
4
|
+
const anatomy = [
|
|
5
|
+
{
|
|
6
|
+
name: 'Grid container',
|
|
7
|
+
required: true,
|
|
8
|
+
description:
|
|
9
|
+
'Two-dimensional layout container that arranges caller-supplied items in rows and columns.',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'Spanning item',
|
|
13
|
+
required: false,
|
|
14
|
+
description:
|
|
15
|
+
"Optional GridSpan wrapper that changes one item's column or row participation.",
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
|
|
3
19
|
/** @type {import('@astryxdesign/cli/authoring').ComponentDoc} */
|
|
4
20
|
|
|
5
21
|
export const docs = {
|
|
@@ -9,6 +25,7 @@ export const docs = {
|
|
|
9
25
|
category: 'Layout',
|
|
10
26
|
keywords: ["grid","columns","responsive","auto-fill","auto-fit","masonry","tiles","row","col","simplegrid","responsive grid","card grid"],
|
|
11
27
|
usage: {
|
|
28
|
+
anatomy,
|
|
12
29
|
description:
|
|
13
30
|
'A CSS grid layout container for arranging children in rows and columns. Use Grid for card galleries, dashboards, and any multi-column layout. Supports fixed column counts and responsive columns that reflow based on available width.',
|
|
14
31
|
bestPractices: [
|
|
@@ -99,6 +116,7 @@ export const docs = {
|
|
|
99
116
|
/** @type {import('@astryxdesign/cli/authoring').ComponentTranslationDoc} */
|
|
100
117
|
export const docsZh = {
|
|
101
118
|
usage: {
|
|
119
|
+
anatomy,
|
|
102
120
|
description:
|
|
103
121
|
'A CSS grid layout container for arranging children in rows and columns. Use Grid for card galleries, dashboards, and any multi-column layout. Supports fixed column counts and responsive columns that reflow based on available width.',
|
|
104
122
|
bestPractices: [
|
|
@@ -116,6 +134,7 @@ export const docsZh = {
|
|
|
116
134
|
export const docsDense = {
|
|
117
135
|
description: 'CSS Grid-based layout w/ responsive column support.',
|
|
118
136
|
usage: {
|
|
137
|
+
anatomy,
|
|
119
138
|
description: 'A CSS grid layout container for arranging children in rows and columns. Use Grid for card galleries, dashboards, and any multi-column layout. Supports fixed column counts and responsive columns that reflow based on available width.',
|
|
120
139
|
bestPractices: [
|
|
121
140
|
{ guidance: true, description: 'Use responsive columns for layouts that should adapt to screen size: columns={{minWidth: 280}}.' },
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 1
|
|
3
|
+
template_version: 3
|
|
4
|
+
kind: component
|
|
5
|
+
id: component:Grid
|
|
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: [layout, theming]
|
|
13
|
+
verified_by:
|
|
14
|
+
[
|
|
15
|
+
packages/core/src/Grid/Grid.test.tsx,
|
|
16
|
+
packages/core/src/theme/themingTargets.test.ts,
|
|
17
|
+
scripts/check-knowledge.mjs,
|
|
18
|
+
]
|
|
19
|
+
families: [family:layout-primitives]
|
|
20
|
+
design_specs: []
|
|
21
|
+
architecture:
|
|
22
|
+
[architecture:component-theming-surface, architecture:public-component-api]
|
|
23
|
+
contributing: []
|
|
24
|
+
system_specs: []
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# Grid component contract
|
|
28
|
+
|
|
29
|
+
## Intent
|
|
30
|
+
|
|
31
|
+
Grid arranges caller-supplied items in two-dimensional tracks. GridSpan
|
|
32
|
+
optionally wraps one item to control its row or column participation. This draft
|
|
33
|
+
records the current consumer anatomy and theming ownership without changing
|
|
34
|
+
layout, targets, or public API.
|
|
35
|
+
|
|
36
|
+
## Compatibility and migration
|
|
37
|
+
|
|
38
|
+
- Released default preserved: `yes`
|
|
39
|
+
- Compatibility class: additive documentation only; runtime, DOM, styling,
|
|
40
|
+
targets, and public API remain unchanged
|
|
41
|
+
- Controlled/uncontrolled behavior: not applicable
|
|
42
|
+
- Migration decision: none
|
|
43
|
+
|
|
44
|
+
Consumer migration instructions belong in consumer docs and release notes.
|
|
45
|
+
|
|
46
|
+
## Ownership boundary
|
|
47
|
+
|
|
48
|
+
**Owns**
|
|
49
|
+
|
|
50
|
+
- The Grid container and its current `grid` theming target.
|
|
51
|
+
- The optional GridSpan wrapper and its current `grid-span` theming target.
|
|
52
|
+
- Grid track construction and GridSpan row/column participation.
|
|
53
|
+
|
|
54
|
+
**Does not own / non-goals**
|
|
55
|
+
|
|
56
|
+
- Content supplied to Grid or GridSpan — owned by the caller.
|
|
57
|
+
- Structural page-region or surface semantics.
|
|
58
|
+
- New responsive behavior, layout props, targets, or target placement.
|
|
59
|
+
|
|
60
|
+
## Public concepts
|
|
61
|
+
|
|
62
|
+
No new public concept is introduced. Consumer props and usage remain documented
|
|
63
|
+
in the canonical `Grid.doc.mjs` and the subordinate `GridSpan.doc.mjs`;
|
|
64
|
+
`family:layout-primitives` owns the shared composition vocabulary.
|
|
65
|
+
|
|
66
|
+
## Behavioral and layout contract
|
|
67
|
+
|
|
68
|
+
| ID | Candidate invariant | Basis | Draft review state |
|
|
69
|
+
| --- | ----------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | -------------------------------------------------- |
|
|
70
|
+
| FR1 | Grid renders one Grid container carrying the current `grid` target and arranges caller content using the current track model. | Current source, docs, tests, and family | Verified current behavior; no new behavior decided |
|
|
71
|
+
| FR2 | GridSpan renders one optional Spanning item wrapper carrying the current `grid-span` target. | Current source, docs, and tests | Verified current behavior; no target change |
|
|
72
|
+
| FR3 | GridSpan's current `columns` and `rows` inputs affect only the wrapped item's participation in its parent grid. | Current source, tests, and family | Verified current behavior; no layout change |
|
|
73
|
+
|
|
74
|
+
### Allowed variation
|
|
75
|
+
|
|
76
|
+
- Grid may use fixed or intrinsic responsive tracks without changing Grid
|
|
77
|
+
container ownership.
|
|
78
|
+
- Caller content may render directly in Grid or inside optional GridSpan wrappers.
|
|
79
|
+
- A Spanning item may span columns, rows, both, or neither while retaining the
|
|
80
|
+
same target.
|
|
81
|
+
|
|
82
|
+
### Representative states
|
|
83
|
+
|
|
84
|
+
| State | Required invariant | Allowed variation |
|
|
85
|
+
| -------------- | --------------------------------------------------------- | ----------------------------------------------------- |
|
|
86
|
+
| Fixed Grid | Grid container owns the current `grid` target. | Positive fixed column count and spacing may vary. |
|
|
87
|
+
| Intrinsic Grid | The same container owns responsive track construction. | Fill/fit mode, minimum width, and count cap may vary. |
|
|
88
|
+
| Direct item | Caller content participates without a Grid-owned wrapper. | Caller owns its element and styling. |
|
|
89
|
+
| Spanning item | GridSpan owns one wrapper and the `grid-span` target. | Column and row span values may vary. |
|
|
90
|
+
|
|
91
|
+
### Transformation and precedence order
|
|
92
|
+
|
|
93
|
+
- No new track construction, gap, alignment, sizing, or span precedence rule is
|
|
94
|
+
introduced.
|
|
95
|
+
|
|
96
|
+
### Performance and resources
|
|
97
|
+
|
|
98
|
+
- No new performance or resource rule is introduced.
|
|
99
|
+
|
|
100
|
+
## Accessibility contract
|
|
101
|
+
|
|
102
|
+
This draft does not add semantic roles to Grid or GridSpan or change their
|
|
103
|
+
current DOM forwarding and caller-owned content semantics.
|
|
104
|
+
|
|
105
|
+
## Design relationships
|
|
106
|
+
|
|
107
|
+
| Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
|
|
108
|
+
| ---------------- | ------------------------------------------------------------------ | ----------------------------------------- | -------------- | ------------------ |
|
|
109
|
+
| Grid container | Presents the current two-dimensional layout container. | Current source, docs, and family contract | Supporting | FR1 |
|
|
110
|
+
| Spanning item | Optionally changes one item's row or column participation in Grid. | Current source, docs, and family contract | Supporting | FR2, FR3 |
|
|
111
|
+
|
|
112
|
+
Direct caller content is not an additional Grid-owned anatomy part.
|
|
113
|
+
|
|
114
|
+
### Theming anatomy
|
|
115
|
+
|
|
116
|
+
<!-- anatomy-theming:v1 -->
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"Grid container": {"target": "grid"},
|
|
121
|
+
"Spanning item": {"target": "grid-span"}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Family and system relationships
|
|
126
|
+
|
|
127
|
+
- `family:layout-primitives` owns the shared spacing, sizing, alignment, and item
|
|
128
|
+
participation vocabulary for Grid and GridSpan.
|
|
129
|
+
- `architecture:component-theming-surface` owns anatomy qualification and the
|
|
130
|
+
two current local target mappings.
|
|
131
|
+
- `architecture:public-component-api` owns the stable prop surface; this
|
|
132
|
+
documentation adds no API.
|
|
133
|
+
|
|
134
|
+
## Verification map
|
|
135
|
+
|
|
136
|
+
| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
|
|
137
|
+
| ------------------- | ------------------------------------------------------------ | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
|
|
138
|
+
| FR1 | `Grid.test.tsx` track, sizing, alignment, and content suites | Fixed, default, fill, fit, capped, and sized | Changing current track output or removing the container/content fails exact style-variable, inline-style, or content checks. | `audit:Grid/anatomy` |
|
|
139
|
+
| FR2, FR3 | `Grid.test.tsx` GridSpan suites | Column, full-row, row, combined, and no span | Changing wrapper rendering or span values fails exact inline-style and content assertions. | `audit:GridSpan/anatomy` |
|
|
140
|
+
| Target inventory | Source inspection and `themingTargets.test.ts` | Grid and GridSpan targets | Runtime and documented target metadata drift fails target validation. | `audit:Grid/theming` |
|
|
141
|
+
| Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and both current targets | Missing, extra, prefixed, or stale mappings fail repository validation. | `audit:Grid/theming` |
|
|
142
|
+
|
|
143
|
+
Grid tests pin track and span output, content rendering, and prop forwarding.
|
|
144
|
+
They do not assert both target classes in focused component tests; target
|
|
145
|
+
placement is source-inspected and the global inventory checks the runtime/docs
|
|
146
|
+
relationship.
|
|
147
|
+
|
|
148
|
+
## Decision log
|
|
149
|
+
|
|
150
|
+
None. This draft records current facts and introduces no component-local design,
|
|
151
|
+
layout, accessibility, or API decision.
|
|
152
|
+
|
|
153
|
+
## Open questions
|
|
154
|
+
|
|
155
|
+
None.
|
|
156
|
+
|
|
157
|
+
## Content boundary
|
|
158
|
+
|
|
159
|
+
This file does not duplicate consumer prop tables, examples, family layout
|
|
160
|
+
rules, track algorithms, implementation steps, or system rules. It links to
|
|
161
|
+
their owners.
|