@astryxdesign/core 0.7.1-canary.ff40b78 → 0.7.1
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 +116 -0
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +5 -2
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +191 -32
- package/dist/Chat/ChatComposerInput.d.ts +9 -0
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +5 -0
- package/dist/Chat/ChatMessage.d.ts +11 -0
- package/dist/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/Chat/ChatMessage.js +18 -9
- package/dist/Chat/useTriggerMenu.d.ts +9 -2
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.js +222 -50
- package/dist/CodeBlock/CodeBlock.d.ts +10 -1
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +158 -38
- package/dist/CodeBlock/tokenizer.d.ts +39 -0
- package/dist/CodeBlock/tokenizer.d.ts.map +1 -1
- package/dist/CodeBlock/tokenizer.js +108 -0
- package/dist/CommandPalette/CommandPalette.d.ts +9 -5
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +38 -20
- package/dist/CommandPalette/CommandPaletteEmpty.d.ts +4 -3
- package/dist/CommandPalette/CommandPaletteEmpty.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteEmpty.js +4 -3
- package/dist/CommandPalette/CommandPaletteInput.d.ts +5 -4
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +35 -18
- package/dist/CommandPalette/CommandPaletteItem.d.ts +11 -6
- package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteItem.js +8 -9
- package/dist/CommandPalette/CommandPaletteList.d.ts +4 -2
- package/dist/CommandPalette/CommandPaletteList.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteList.js +10 -5
- package/dist/ComplexSelector/ComplexSelector.d.ts +8 -5
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +12 -3
- package/dist/ContextMenu/ContextMenu.d.ts +3 -3
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +62 -48
- package/dist/DateInput/DateInput.js +1 -1
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +12 -4
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +12 -2
- package/dist/Dialog/Dialog.d.ts +1 -1
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +16 -5
- package/dist/Dialog/DialogHeader.d.ts +1 -1
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +7 -7
- package/dist/Divider/Divider.d.ts +1 -0
- package/dist/Divider/Divider.d.ts.map +1 -1
- package/dist/Divider/Divider.js +5 -4
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +161 -65
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +7 -5
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +12 -5
- package/dist/Field/InputClearButton.d.ts +8 -4
- package/dist/Field/InputClearButton.d.ts.map +1 -1
- package/dist/Field/InputClearButton.js +23 -7
- package/dist/FormLayout/FormLayout.d.ts.map +1 -1
- package/dist/FormLayout/FormLayout.js +1 -0
- package/dist/Grid/Grid.d.ts +13 -4
- package/dist/Grid/Grid.d.ts.map +1 -1
- package/dist/Grid/Grid.js +7 -1
- package/dist/HoverCard/useHoverCard.d.ts +1 -1
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +67 -49
- package/dist/InputGroup/InputGroup.d.ts +2 -4
- package/dist/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/InputGroup/InputGroup.js +2 -4
- package/dist/InputGroup/groupStyles.d.ts +10 -2
- package/dist/InputGroup/groupStyles.d.ts.map +1 -1
- package/dist/InputGroup/groupStyles.js +19 -2
- package/dist/Layer/useLayerDismissal.d.ts +9 -9
- package/dist/Layer/useLayerDismissal.js +9 -9
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +25 -4
- package/dist/MobileNav/MobileNav.d.ts +7 -0
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +45 -2
- package/dist/MultiSelector/MultiSelector.d.ts +7 -4
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +24 -3
- package/dist/NumberInput/NumberInput.js +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +6 -0
- package/dist/Resizable/ResizeHandle.d.ts +1 -1
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +83 -15
- package/dist/Resizable/useResizable.d.ts +23 -0
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +78 -0
- package/dist/Selector/Selector.d.ts +6 -3
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +28 -6
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +10 -2
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +18 -7
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +16 -4
- package/dist/Toolbar/Toolbar.d.ts +2 -1
- package/dist/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar/Toolbar.js +3 -1
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +6 -3
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +7 -1
- package/dist/astryx.css +22 -0
- package/dist/hooks/useScrollOverflow.d.ts.map +1 -1
- package/dist/hooks/useScrollOverflow.js +55 -12
- package/dist/hooks/useTreeFocus.d.ts +21 -0
- package/dist/hooks/useTreeFocus.d.ts.map +1 -1
- package/dist/hooks/useTreeFocus.js +40 -2
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +3 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +3 -0
- package/dist/reset.a11y.chromium.spec.js +6 -1
- package/dist/reset.until-found.a11y.browser.spec.d.ts +2 -0
- package/dist/reset.until-found.a11y.browser.spec.d.ts.map +1 -0
- package/dist/reset.until-found.a11y.browser.spec.js +71 -0
- package/dist/theme/syntax/SyntaxTheme.d.ts.map +1 -1
- package/dist/theme/syntax/SyntaxTheme.js +43 -2
- package/dist/theme/syntax/defineSyntaxTheme.d.ts +18 -5
- package/dist/theme/syntax/defineSyntaxTheme.d.ts.map +1 -1
- package/dist/theme/syntax/defineSyntaxTheme.js +38 -9
- package/dist/theme/syntax/index.d.ts +1 -1
- package/dist/theme/syntax/index.d.ts.map +1 -1
- package/dist/theme/syntax/tokens.d.ts +12 -2
- package/dist/theme/syntax/tokens.d.ts.map +1 -1
- package/dist/theme/syntax/tokens.js +25 -4
- package/dist/utils/plainDate.d.ts +12 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +63 -10
- package/locales/en.json +13 -1
- package/locales/pseudo.json +9 -0
- package/package.json +4 -4
- package/src/AlertDialog/AlertDialog.doc.mjs +6 -0
- package/src/AlertDialog/AlertDialog.spec.md +205 -0
- package/src/AlertDialog/AlertDialog.test.tsx +3 -14
- package/src/AlertDialog/__tests__/AlertDialog.a11y.chromium.spec.ts +115 -0
- package/src/AlertDialog/__tests__/AlertDialog.a11y.renders.tsx +52 -0
- package/src/AlertDialog/__tests__/AlertDialog.a11y.states.ts +68 -0
- package/src/AlertDialog/__tests__/AlertDialog.a11y.test.tsx +144 -0
- package/src/Button/Button.test.tsx +37 -0
- package/src/Button/Button.tsx +5 -1
- package/src/Calendar/Calendar.doc.mjs +234 -60
- package/src/Calendar/Calendar.spec.md +209 -0
- package/src/Calendar/Calendar.test.tsx +559 -20
- package/src/Calendar/Calendar.tsx +258 -41
- package/src/Calendar/__tests__/Calendar.a11y.chromium.spec.ts +126 -0
- package/src/Calendar/__tests__/Calendar.a11y.known-failures.ts +12 -0
- package/src/Calendar/__tests__/Calendar.a11y.renders.tsx +57 -0
- package/src/Calendar/__tests__/Calendar.a11y.states.ts +139 -0
- package/src/Calendar/__tests__/Calendar.a11y.test.tsx +137 -0
- package/src/Carousel/Carousel.test.tsx +54 -71
- package/src/Carousel/__tests__/Carousel.a11y.chromium.spec.ts +192 -0
- package/src/Carousel/__tests__/Carousel.a11y.known-failures.ts +27 -0
- package/src/Carousel/__tests__/Carousel.a11y.renders.tsx +39 -0
- package/src/Carousel/__tests__/Carousel.a11y.states.ts +139 -0
- package/src/Carousel/__tests__/Carousel.a11y.test.tsx +127 -0
- package/src/Chat/ChatComposerInput.doc.mjs +1 -1
- package/src/Chat/ChatComposerInput.spec.md +94 -55
- package/src/Chat/ChatComposerInput.test.tsx +202 -1
- package/src/Chat/ChatComposerInput.tsx +13 -0
- package/src/Chat/ChatMessage.doc.mjs +31 -16
- package/src/Chat/ChatMessage.spec.md +265 -0
- package/src/Chat/ChatMessage.test.tsx +246 -0
- package/src/Chat/ChatMessage.tsx +30 -7
- package/src/Chat/ChatSystemMessage.spec.md +36 -37
- package/src/Chat/ChatSystemMessage.test.tsx +4 -4
- package/src/Chat/useTriggerMenu.test.tsx +994 -0
- package/src/Chat/useTriggerMenu.tsx +278 -46
- package/src/CodeBlock/CodeBlock.doc.mjs +7 -0
- package/src/CodeBlock/CodeBlock.spec.md +40 -41
- package/src/CodeBlock/CodeBlock.test.tsx +89 -9
- package/src/CodeBlock/CodeBlock.tsx +205 -25
- package/src/CodeBlock/__tests__/CodeBlockOverflowStop.a11y.chromium.spec.ts +125 -0
- package/src/CodeBlock/__tests__/DiffRowPaint.a11y.chromium.spec.ts +93 -0
- package/src/CodeBlock/tokenizer.test.ts +112 -0
- package/src/CodeBlock/tokenizer.ts +106 -0
- package/src/Collapsible/CollapsibleGroup.spec.md +17 -8
- package/src/Collapsible/__tests__/CollapsibleGroup.a11y.renders.tsx +45 -0
- package/src/Collapsible/__tests__/CollapsibleGroup.a11y.states.ts +139 -0
- package/src/Collapsible/__tests__/CollapsibleGroup.a11y.test.tsx +135 -0
- package/src/Collapsible/__tests__/CollapsibleGroupAccordion.a11y.chromium.spec.ts +128 -0
- package/src/CommandPalette/CommandPalette.doc.mjs +126 -23
- package/src/CommandPalette/CommandPalette.spec.md +100 -49
- package/src/CommandPalette/CommandPalette.test.tsx +241 -2
- package/src/CommandPalette/CommandPalette.tsx +47 -21
- package/src/CommandPalette/CommandPaletteEmpty.tsx +4 -3
- package/src/CommandPalette/CommandPaletteInput.doc.mjs +61 -4
- package/src/CommandPalette/CommandPaletteInput.spec.md +215 -0
- package/src/CommandPalette/CommandPaletteInput.test.tsx +375 -51
- package/src/CommandPalette/CommandPaletteInput.tsx +74 -21
- package/src/CommandPalette/CommandPaletteItem.doc.mjs +73 -22
- package/src/CommandPalette/CommandPaletteItem.spec.md +223 -0
- package/src/CommandPalette/CommandPaletteItem.test.tsx +200 -5
- package/src/CommandPalette/CommandPaletteItem.tsx +16 -11
- package/src/CommandPalette/CommandPaletteList.doc.mjs +3 -3
- package/src/CommandPalette/CommandPaletteList.spec.md +41 -36
- package/src/CommandPalette/CommandPaletteList.test.tsx +80 -0
- package/src/CommandPalette/CommandPaletteList.tsx +10 -5
- package/src/CommandPalette/__tests__/CommandPalette.a11y.chromium.spec.ts +599 -0
- package/src/ComplexSelector/ComplexSelector.doc.mjs +10 -8
- package/src/ComplexSelector/ComplexSelector.spec.md +14 -9
- package/src/ComplexSelector/ComplexSelector.test.tsx +64 -16
- package/src/ComplexSelector/ComplexSelector.tsx +37 -8
- package/src/ContextMenu/ContextMenu.doc.mjs +6 -0
- package/src/ContextMenu/ContextMenu.spec.md +51 -53
- package/src/ContextMenu/ContextMenu.test.tsx +132 -1
- package/src/ContextMenu/ContextMenu.tsx +78 -48
- package/src/DateInput/DateInput.doc.mjs +52 -0
- package/src/DateInput/DateInput.spec.md +27 -15
- package/src/DateInput/DateInput.test.tsx +38 -0
- package/src/DateInput/DateInput.tsx +1 -1
- package/src/DateInput/DateInputTouch.test.tsx +22 -0
- package/src/DateInput/MonthScroller.tsx +12 -4
- package/src/DateRangeInput/DateRangeInput.test.tsx +49 -0
- package/src/DateRangeInput/DateRangeInput.tsx +20 -2
- package/src/Dialog/Dialog.test.tsx +27 -1
- package/src/Dialog/Dialog.tsx +16 -5
- package/src/Dialog/DialogHeader.test.tsx +27 -2
- package/src/Dialog/DialogHeader.tsx +7 -8
- package/src/Dialog/__tests__/Dialog.a11y.chromium.spec.ts +21 -14
- package/src/Divider/Divider.doc.mjs +5 -3
- package/src/Divider/Divider.spec.md +140 -54
- package/src/Divider/Divider.test.tsx +15 -0
- package/src/Divider/Divider.tsx +6 -4
- package/src/DropdownMenu/DropdownMenu.doc.mjs +2 -2
- package/src/DropdownMenu/DropdownMenu.spec.md +121 -45
- package/src/DropdownMenu/DropdownMenu.test.tsx +288 -23
- package/src/DropdownMenu/DropdownMenu.tsx +212 -81
- package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +38 -2
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +32 -18
- package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +146 -1
- package/src/DropdownMenu/__tests__/MenuButton.a11y.chromium.spec.ts +136 -0
- package/src/DropdownMenu/__tests__/MenuButton.a11y.known-failures.ts +12 -0
- package/src/DropdownMenu/__tests__/MenuButton.a11y.renders.tsx +67 -0
- package/src/DropdownMenu/__tests__/MenuButton.a11y.states.ts +141 -0
- package/src/DropdownMenu/__tests__/MenuButton.a11y.test.tsx +138 -0
- package/src/DropdownMenu/__tests__/MenuHeaderFooter.a11y.chromium.spec.ts +40 -5
- package/src/Field/InputClearButton.test.tsx +29 -4
- package/src/Field/InputClearButton.tsx +26 -8
- package/src/FieldStatus/__tests__/StatusMessage.a11y.chromium.spec.ts +21 -14
- package/src/FormLayout/FormLayout.tsx +1 -0
- package/src/FormLayout/__snapshots__/FormLayout.test.tsx.snap +1 -1
- package/src/Grid/Grid.doc.mjs +14 -11
- package/src/Grid/Grid.spec.md +50 -32
- package/src/Grid/Grid.tsx +13 -4
- package/src/HoverCard/HoverCard.test.tsx +46 -1
- package/src/HoverCard/useHoverCard.tsx +68 -48
- package/src/InputGroup/InputGroup.doc.mjs +11 -1
- package/src/InputGroup/InputGroup.tsx +2 -4
- package/src/InputGroup/groupStyles.ts +40 -2
- package/src/Layer/useLayerDismissal.ts +9 -9
- package/src/Link/__tests__/Link.a11y.chromium.spec.ts +142 -0
- package/src/Link/__tests__/Link.a11y.renders.tsx +97 -0
- package/src/Link/__tests__/Link.a11y.states.ts +104 -0
- package/src/Link/__tests__/Link.a11y.test.tsx +127 -0
- package/src/Markdown/Markdown.doc.mjs +1 -1
- package/src/Markdown/Markdown.fr23.perf.test.ts +161 -40
- package/src/Markdown/Markdown.spec.md +45 -23
- package/src/Markdown/Markdown.test.tsx +38 -0
- package/src/Markdown/Markdown.tsx +24 -2
- package/src/Markdown/plugins/semanticFence.test.tsx +3 -2
- package/src/MobileNav/MobileNav.tsx +50 -2
- package/src/MobileNav/MobileNavFocus.test.tsx +553 -0
- package/src/MoreMenu/MoreMenu.spec.md +18 -7
- package/src/MoreMenu/MoreMenu.test.tsx +38 -0
- package/src/MultiSelector/MultiSelector.doc.mjs +8 -8
- package/src/MultiSelector/MultiSelector.spec.md +1 -1
- package/src/MultiSelector/MultiSelector.test.tsx +188 -21
- package/src/MultiSelector/MultiSelector.tsx +50 -11
- package/src/NumberInput/NumberInput.test.tsx +24 -0
- package/src/NumberInput/NumberInput.tsx +1 -1
- package/src/NumberInput/__tests__/NumberInput.a11y.chromium.spec.ts +22 -15
- package/src/PowerSearch/PowerSearchEditPopover.test.tsx +78 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +6 -0
- package/src/Resizable/Resizable.spec.md +41 -9
- package/src/Resizable/ResizeHandle.test.tsx +565 -2
- package/src/Resizable/ResizeHandle.tsx +126 -21
- package/src/Resizable/__tests__/ResizeHandle.a11y.chromium.spec.ts +119 -0
- package/src/Resizable/__tests__/ResizeHandle.a11y.known-failures.ts +39 -0
- package/src/Resizable/__tests__/ResizeHandle.a11y.renders.tsx +80 -0
- package/src/Resizable/__tests__/ResizeHandle.a11y.states.ts +197 -0
- package/src/Resizable/__tests__/ResizeHandle.a11y.test.tsx +123 -0
- package/src/Resizable/useResizable.ts +95 -0
- package/src/Selector/Selector.doc.mjs +7 -6
- package/src/Selector/Selector.spec.md +37 -24
- package/src/Selector/Selector.test.tsx +176 -10
- package/src/Selector/Selector.tsx +59 -14
- package/src/Selector/__tests__/Combobox.a11y.known-failures.ts +27 -0
- package/src/Selector/__tests__/Combobox.a11y.states.ts +145 -0
- package/src/Selector/__tests__/Selector.combobox.a11y.chromium.spec.ts +108 -0
- package/src/Selector/__tests__/Selector.combobox.a11y.test.tsx +126 -0
- package/src/SideNav/SideNav.test.tsx +35 -0
- package/src/SideNav/SideNav.tsx +16 -2
- package/src/Slider/Slider.spec.md +43 -17
- package/src/Slider/Slider.test.tsx +134 -0
- package/src/Slider/Slider.tsx +29 -6
- package/src/Slider/__tests__/Slider.a11y.chromium.spec.ts +112 -0
- package/src/Slider/__tests__/Slider.a11y.known-failures.ts +12 -0
- package/src/Slider/__tests__/Slider.a11y.renders.tsx +42 -0
- package/src/Slider/__tests__/Slider.a11y.states.ts +106 -0
- package/src/Slider/__tests__/Slider.a11y.test.tsx +105 -0
- package/src/Switch/__tests__/Switch.a11y.chromium.spec.ts +25 -18
- package/src/TabList/__tests__/Tabs.a11y.chromium.spec.ts +19 -12
- package/src/TextInput/__tests__/TextInput.a11y.chromium.spec.ts +21 -14
- package/src/ToggleButton/__tests__/ToggleButton.a11y.chromium.spec.ts +18 -11
- package/src/Tokenizer/Tokenizer.test.tsx +87 -0
- package/src/Tokenizer/Tokenizer.tsx +31 -3
- package/src/Toolbar/Toolbar.test.tsx +131 -4
- package/src/Toolbar/Toolbar.tsx +3 -1
- package/src/TreeList/TreeList.spec.md +33 -8
- package/src/TreeList/TreeList.test.tsx +72 -0
- package/src/TreeList/TreeList.tsx +10 -6
- package/src/TreeList/TreeListItem.tsx +5 -0
- package/src/TreeList/__tests__/TreeList.a11y.chromium.spec.ts +125 -0
- package/src/TreeList/__tests__/TreeList.a11y.renders.tsx +44 -0
- package/src/TreeList/__tests__/TreeList.a11y.states.ts +164 -0
- package/src/TreeList/__tests__/TreeList.a11y.test.tsx +138 -0
- package/src/TreeList/__tests__/TreeListRowNames.a11y.chromium.spec.ts +82 -0
- package/src/hooks/useScrollOverflow.test.tsx +222 -0
- package/src/hooks/useScrollOverflow.ts +55 -13
- package/src/hooks/useTreeFocus.test.tsx +37 -0
- package/src/hooks/useTreeFocus.ts +55 -2
- package/src/i18n/generated-locales/en.generated.ts +3 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +3 -0
- package/src/reset.a11y.chromium.spec.ts +9 -1
- package/src/reset.css +8 -3
- package/src/reset.until-found.a11y.browser.spec.ts +75 -0
- package/src/reset.until-found.test.ts +32 -0
- package/src/stylexValidation.source-build.test.mjs +42 -0
- package/src/theme/syntax/SyntaxTheme.tsx +46 -5
- package/src/theme/syntax/defineSyntaxTheme.diff.test.ts +91 -0
- package/src/theme/syntax/defineSyntaxTheme.ts +75 -15
- package/src/theme/syntax/index.ts +5 -1
- package/src/theme/syntax/tokens.ts +32 -2
- package/src/theme/syntax/useSyntaxTheme.diff.test.tsx +40 -0
- package/src/utils/plainDate.test.ts +147 -0
- package/src/utils/plainDate.ts +75 -10
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file CollapsibleGroup.a11y.states.ts
|
|
5
|
+
* @input CollapsibleGroup's representative accordion states and the facts the ACCORDION_PATTERN contract reads
|
|
6
|
+
* @output COLLAPSIBLE_GROUP_ACCORDION_STATES and the explicit ownership exclusions for this binding
|
|
7
|
+
* @position Binding inventory shared by the jsdom test and the Chromium spec (component:CollapsibleGroup AR4)
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type {AccordionStateFacts} from '@astryxdesign/a11y-spec';
|
|
11
|
+
|
|
12
|
+
export interface CollapsibleGroupAccordionState {
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly summary: string;
|
|
15
|
+
readonly storyId: string;
|
|
16
|
+
/** The subject header's visible label. */
|
|
17
|
+
readonly label: string;
|
|
18
|
+
/** The header that follows the subject in the page Tab order, when one exists. */
|
|
19
|
+
readonly nextLabel?: string;
|
|
20
|
+
/** The other header that starts expanded in a single-expansion group, when one exists. */
|
|
21
|
+
readonly openSiblingLabel?: string;
|
|
22
|
+
readonly facts: AccordionStateFacts;
|
|
23
|
+
readonly type: 'single' | 'multiple';
|
|
24
|
+
/** Values open at mount. */
|
|
25
|
+
readonly defaultValue: ReadonlyArray<string>;
|
|
26
|
+
/** Items that are disabled at mount. */
|
|
27
|
+
readonly disabled?: ReadonlyArray<string>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const ITEMS = [
|
|
31
|
+
{value: 'profile', label: 'Profile settings'},
|
|
32
|
+
{value: 'privacy', label: 'Privacy settings'},
|
|
33
|
+
{value: 'notifications', label: 'Notification settings'},
|
|
34
|
+
] as const;
|
|
35
|
+
|
|
36
|
+
export const COLLAPSIBLE_GROUP_ITEMS = ITEMS;
|
|
37
|
+
|
|
38
|
+
function facts(
|
|
39
|
+
overrides: Partial<AccordionStateFacts> = {},
|
|
40
|
+
): AccordionStateFacts {
|
|
41
|
+
return {
|
|
42
|
+
expanded: false,
|
|
43
|
+
operable: true,
|
|
44
|
+
focusable: true,
|
|
45
|
+
single: true,
|
|
46
|
+
hasNextHeader: true,
|
|
47
|
+
hasOpenSibling: true,
|
|
48
|
+
...overrides,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const story = (id: string) => `a11y-collapsiblegroup-accordion--${id}`;
|
|
53
|
+
|
|
54
|
+
export const COLLAPSIBLE_GROUP_ACCORDION_STATES = [
|
|
55
|
+
{
|
|
56
|
+
id: 'single-collapsed-middle',
|
|
57
|
+
summary:
|
|
58
|
+
'the collapsed middle header of a single-expansion group whose first header is open',
|
|
59
|
+
storyId: story('single-collapsed-middle'),
|
|
60
|
+
label: 'Privacy settings',
|
|
61
|
+
nextLabel: 'Notification settings',
|
|
62
|
+
openSiblingLabel: 'Profile settings',
|
|
63
|
+
facts: facts(),
|
|
64
|
+
type: 'single',
|
|
65
|
+
defaultValue: ['profile'],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: 'single-expanded-first',
|
|
69
|
+
summary: 'the expanded first header of a single-expansion group',
|
|
70
|
+
storyId: story('single-expanded-first'),
|
|
71
|
+
label: 'Profile settings',
|
|
72
|
+
nextLabel: 'Privacy settings',
|
|
73
|
+
facts: facts({expanded: true, hasOpenSibling: false}),
|
|
74
|
+
type: 'single',
|
|
75
|
+
defaultValue: ['profile'],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: 'multiple-collapsed-last',
|
|
79
|
+
summary:
|
|
80
|
+
'the collapsed last header of a group that allows several open panels',
|
|
81
|
+
storyId: story('multiple-collapsed-last'),
|
|
82
|
+
label: 'Notification settings',
|
|
83
|
+
facts: facts({
|
|
84
|
+
single: false,
|
|
85
|
+
hasNextHeader: false,
|
|
86
|
+
hasOpenSibling: false,
|
|
87
|
+
}),
|
|
88
|
+
type: 'multiple',
|
|
89
|
+
defaultValue: ['profile', 'privacy'],
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: 'single-disabled-collapsed',
|
|
93
|
+
summary:
|
|
94
|
+
'a disabled collapsed header that stays named and exposed but leaves the Tab order and cannot be toggled',
|
|
95
|
+
storyId: story('single-disabled-collapsed'),
|
|
96
|
+
label: 'Privacy settings',
|
|
97
|
+
facts: facts({
|
|
98
|
+
operable: false,
|
|
99
|
+
focusable: false,
|
|
100
|
+
hasNextHeader: false,
|
|
101
|
+
hasOpenSibling: false,
|
|
102
|
+
}),
|
|
103
|
+
type: 'single',
|
|
104
|
+
defaultValue: ['profile'],
|
|
105
|
+
disabled: ['privacy'],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
id: 'single-disabled-expanded',
|
|
109
|
+
summary:
|
|
110
|
+
'a disabled header whose panel stays open: it says aria-disabled, leaves the Tab order, and cannot be collapsed',
|
|
111
|
+
storyId: story('single-disabled-expanded'),
|
|
112
|
+
label: 'Profile settings',
|
|
113
|
+
facts: facts({
|
|
114
|
+
expanded: true,
|
|
115
|
+
operable: false,
|
|
116
|
+
focusable: false,
|
|
117
|
+
hasNextHeader: false,
|
|
118
|
+
hasOpenSibling: false,
|
|
119
|
+
}),
|
|
120
|
+
type: 'single',
|
|
121
|
+
defaultValue: ['profile'],
|
|
122
|
+
disabled: ['profile'],
|
|
123
|
+
},
|
|
124
|
+
] as const satisfies ReadonlyArray<CollapsibleGroupAccordionState>;
|
|
125
|
+
|
|
126
|
+
export const COLLAPSIBLE_GROUP_ACCORDION_EXCLUSIONS = [
|
|
127
|
+
{
|
|
128
|
+
id: 'collapsible-disclosure-semantics',
|
|
129
|
+
owner: 'DISCLOSURE_PATTERN and Collapsible.a11y.test.tsx',
|
|
130
|
+
reason:
|
|
131
|
+
'Each header is a Collapsible trigger. Its standalone disclosure state, pointer round trip, and aborted-press behavior are already bound to the disclosure contract; this binding proves the Accordion parts across the group — header role and name, aria-controls, aria-disabled on a fixed panel, Enter and Space — and, advisory until the record is current, what the group adds: single-expansion sibling collapse, the page Tab step between headers, and the absence of arrow-key focus movement.',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
id: 'heading-wrapper-and-region-panels',
|
|
135
|
+
owner: 'component:CollapsibleGroup AR4 and the composing page',
|
|
136
|
+
reason:
|
|
137
|
+
'The record adopts the Accordion pattern without a heading element around each header and without the optional region role on panels; the caller places the group in its own heading structure. Neither is asserted here because neither is a component promise.',
|
|
138
|
+
},
|
|
139
|
+
] as const;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
/** @vitest-environment jsdom */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @file CollapsibleGroup.a11y.test.tsx
|
|
6
|
+
* @input ACCORDION_PATTERN bound to CollapsibleGroup's representative states
|
|
7
|
+
* @output jsdom-lane proof of the DOM expectations and an honest "unrun" report for the browser layers
|
|
8
|
+
* @position Binding test for component:CollapsibleGroup AR4 (the Chromium spec covers the rest)
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import {cleanup, render, screen} from '@testing-library/react';
|
|
12
|
+
import {describe, expect, it} from 'vitest';
|
|
13
|
+
import {
|
|
14
|
+
ACCORDION_PATTERN,
|
|
15
|
+
checkAccessibilitySpec,
|
|
16
|
+
createJsdomHarness,
|
|
17
|
+
expectAccessibilitySpec,
|
|
18
|
+
summarize,
|
|
19
|
+
type BindingResult,
|
|
20
|
+
} from '@astryxdesign/a11y-spec';
|
|
21
|
+
import {renderAccordionState} from './CollapsibleGroup.a11y.renders';
|
|
22
|
+
import {
|
|
23
|
+
COLLAPSIBLE_GROUP_ACCORDION_EXCLUSIONS,
|
|
24
|
+
COLLAPSIBLE_GROUP_ACCORDION_STATES,
|
|
25
|
+
type CollapsibleGroupAccordionState,
|
|
26
|
+
} from './CollapsibleGroup.a11y.states';
|
|
27
|
+
|
|
28
|
+
function header(label: string): HTMLElement {
|
|
29
|
+
return screen.getByRole('button', {name: label});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function panelFor(subject: HTMLElement, id: string): HTMLElement {
|
|
33
|
+
const controls = subject.getAttribute('aria-controls');
|
|
34
|
+
const panel = controls == null ? null : document.getElementById(controls);
|
|
35
|
+
if (panel == null) {
|
|
36
|
+
throw new Error(`CollapsibleGroup state "${id}" has no controlled panel`);
|
|
37
|
+
}
|
|
38
|
+
return panel;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function relatedFor(
|
|
42
|
+
state: CollapsibleGroupAccordionState,
|
|
43
|
+
): Readonly<Record<string, Element>> {
|
|
44
|
+
const subject = header(state.label);
|
|
45
|
+
const related: Record<string, Element> = {
|
|
46
|
+
panel: panelFor(subject, state.id),
|
|
47
|
+
};
|
|
48
|
+
if (state.nextLabel != null) {
|
|
49
|
+
related['next-header'] = header(state.nextLabel);
|
|
50
|
+
}
|
|
51
|
+
if (state.openSiblingLabel != null) {
|
|
52
|
+
related['open-sibling'] = header(state.openSiblingLabel);
|
|
53
|
+
}
|
|
54
|
+
return related;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function checkState(
|
|
58
|
+
state: CollapsibleGroupAccordionState,
|
|
59
|
+
): Promise<BindingResult> {
|
|
60
|
+
return checkAccessibilitySpec({
|
|
61
|
+
spec: ACCORDION_PATTERN,
|
|
62
|
+
binding: 'CollapsibleGroup.header',
|
|
63
|
+
state: state.id,
|
|
64
|
+
facts: state.facts,
|
|
65
|
+
mount: async () => {
|
|
66
|
+
render(renderAccordionState(state));
|
|
67
|
+
return createJsdomHarness({
|
|
68
|
+
subject: header(state.label),
|
|
69
|
+
related: relatedFor(state),
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
unmount: cleanup,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
describe('CollapsibleGroup.header — accordion pattern, jsdom lane', () => {
|
|
77
|
+
it.each(
|
|
78
|
+
COLLAPSIBLE_GROUP_ACCORDION_STATES.map(
|
|
79
|
+
state => [state.id, state.summary, state] as const,
|
|
80
|
+
),
|
|
81
|
+
)('%s — %s', async (_id, _summary, state) => {
|
|
82
|
+
await expectAccessibilitySpec({
|
|
83
|
+
spec: ACCORDION_PATTERN,
|
|
84
|
+
binding: 'CollapsibleGroup.header',
|
|
85
|
+
state: state.id,
|
|
86
|
+
facts: state.facts,
|
|
87
|
+
render: () => {
|
|
88
|
+
render(renderAccordionState(state));
|
|
89
|
+
},
|
|
90
|
+
subject: () => header(state.label),
|
|
91
|
+
related: () => relatedFor(state),
|
|
92
|
+
cleanup,
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it('runs the DOM layer and reports the browser-owned outcomes as unrun', async () => {
|
|
97
|
+
const results: BindingResult[] = [];
|
|
98
|
+
for (const state of COLLAPSIBLE_GROUP_ACCORDION_STATES) {
|
|
99
|
+
results.push(await checkState(state));
|
|
100
|
+
}
|
|
101
|
+
const report = summarize(ACCORDION_PATTERN, results);
|
|
102
|
+
expect(report.counts.pass).toBeGreaterThan(0);
|
|
103
|
+
expect(report.unrunLayers).toEqual(['accessibility-tree', 'real-browser']);
|
|
104
|
+
expect(report.counts.unexpectedPass).toBe(0);
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
describe('CollapsibleGroup accordion binding inventory', () => {
|
|
109
|
+
it('gives every representative state a distinct checked-in story', () => {
|
|
110
|
+
const stories = COLLAPSIBLE_GROUP_ACCORDION_STATES.map(
|
|
111
|
+
state => state.storyId,
|
|
112
|
+
);
|
|
113
|
+
expect(new Set(stories).size).toBe(stories.length);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('keeps disclosure and page ownership explicit', () => {
|
|
117
|
+
expect(COLLAPSIBLE_GROUP_ACCORDION_EXCLUSIONS.map(row => row.id)).toEqual([
|
|
118
|
+
'collapsible-disclosure-semantics',
|
|
119
|
+
'heading-wrapper-and-region-panels',
|
|
120
|
+
]);
|
|
121
|
+
for (const exclusion of COLLAPSIBLE_GROUP_ACCORDION_EXCLUSIONS) {
|
|
122
|
+
expect(exclusion.owner.length, exclusion.id).toBeGreaterThan(20);
|
|
123
|
+
expect(exclusion.reason.length, exclusion.id).toBeGreaterThan(80);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it('renders exactly one subject header and its relations for every state', () => {
|
|
128
|
+
for (const state of COLLAPSIBLE_GROUP_ACCORDION_STATES) {
|
|
129
|
+
render(renderAccordionState(state));
|
|
130
|
+
expect(header(state.label), state.id).toBeTruthy();
|
|
131
|
+
expect(Object.keys(relatedFor(state)), state.id).toContain('panel');
|
|
132
|
+
cleanup();
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
});
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file CollapsibleGroupAccordion.a11y.chromium.spec.ts
|
|
5
|
+
* @input Built CollapsibleGroup accordion stories and ACCORDION_PATTERN in real Chromium
|
|
6
|
+
* @output Browser evidence for every accordion expectation across the binding's states
|
|
7
|
+
* @position Chromium lane of the CollapsibleGroup accordion binding (component:CollapsibleGroup AR4)
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
expect,
|
|
12
|
+
test,
|
|
13
|
+
type CDPSession,
|
|
14
|
+
type Locator,
|
|
15
|
+
type Page,
|
|
16
|
+
} from '@playwright/test';
|
|
17
|
+
import {
|
|
18
|
+
ACCORDION_PATTERN,
|
|
19
|
+
blockingResults,
|
|
20
|
+
checkAccessibilitySpec,
|
|
21
|
+
formatFailures,
|
|
22
|
+
neverExercised,
|
|
23
|
+
summarize,
|
|
24
|
+
type BindingResult,
|
|
25
|
+
} from '@astryxdesign/a11y-spec';
|
|
26
|
+
import {
|
|
27
|
+
createChromiumHarness,
|
|
28
|
+
holdMotionStill,
|
|
29
|
+
} from '@astryxdesign/a11y-spec/chromium';
|
|
30
|
+
import {
|
|
31
|
+
DEFAULT_STORYBOOK_DIR,
|
|
32
|
+
serveStorybook,
|
|
33
|
+
type StaticServer,
|
|
34
|
+
} from '@astryxdesign/a11y-spec/storybook';
|
|
35
|
+
import {
|
|
36
|
+
COLLAPSIBLE_GROUP_ACCORDION_STATES,
|
|
37
|
+
type CollapsibleGroupAccordionState,
|
|
38
|
+
} from './CollapsibleGroup.a11y.states';
|
|
39
|
+
|
|
40
|
+
let storybook: StaticServer;
|
|
41
|
+
|
|
42
|
+
test.beforeAll(async () => {
|
|
43
|
+
storybook = await serveStorybook(
|
|
44
|
+
process.env.ASTRYX_STORYBOOK_DIR ?? DEFAULT_STORYBOOK_DIR,
|
|
45
|
+
);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test.afterAll(async () => {
|
|
49
|
+
await storybook?.close();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
function storyUrl(storyId: string): string {
|
|
53
|
+
return `${storybook.origin}/iframe.html?id=${storyId}&viewMode=story`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function header(page: Page, label: string): Locator {
|
|
57
|
+
return page
|
|
58
|
+
.locator('#storybook-root')
|
|
59
|
+
.getByRole('button', {name: label, includeHidden: true});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function mountState(
|
|
63
|
+
page: Page,
|
|
64
|
+
state: CollapsibleGroupAccordionState,
|
|
65
|
+
): Promise<{subject: Locator; related: Record<string, Locator>}> {
|
|
66
|
+
await page.goto(storyUrl(state.storyId), {waitUntil: 'load'});
|
|
67
|
+
await holdMotionStill(page);
|
|
68
|
+
const subject = header(page, state.label);
|
|
69
|
+
await subject.waitFor({state: 'attached'});
|
|
70
|
+
const id = await subject.getAttribute('aria-controls');
|
|
71
|
+
if (id == null) {
|
|
72
|
+
throw new Error(
|
|
73
|
+
`CollapsibleGroup state "${state.id}" has no aria-controls`,
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
const related: Record<string, Locator> = {
|
|
77
|
+
panel: page.locator(`#storybook-root [id="${id}"]`),
|
|
78
|
+
};
|
|
79
|
+
if (state.nextLabel != null) {
|
|
80
|
+
related['next-header'] = header(page, state.nextLabel);
|
|
81
|
+
}
|
|
82
|
+
if (state.openSiblingLabel != null) {
|
|
83
|
+
related['open-sibling'] = header(page, state.openSiblingLabel);
|
|
84
|
+
}
|
|
85
|
+
return {subject, related};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async function runState(
|
|
89
|
+
page: Page,
|
|
90
|
+
cdp: CDPSession,
|
|
91
|
+
state: CollapsibleGroupAccordionState,
|
|
92
|
+
): Promise<BindingResult> {
|
|
93
|
+
return checkAccessibilitySpec({
|
|
94
|
+
spec: ACCORDION_PATTERN,
|
|
95
|
+
binding: 'CollapsibleGroup.header',
|
|
96
|
+
state: state.id,
|
|
97
|
+
facts: state.facts,
|
|
98
|
+
mount: async () => {
|
|
99
|
+
const {subject, related} = await mountState(page, state);
|
|
100
|
+
return createChromiumHarness({page, cdp, subject, related});
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
test('every accordion expectation is exercised by a CollapsibleGroup state', async ({
|
|
106
|
+
page,
|
|
107
|
+
}) => {
|
|
108
|
+
const cdp = await page.context().newCDPSession(page);
|
|
109
|
+
const results: BindingResult[] = [];
|
|
110
|
+
for (const state of COLLAPSIBLE_GROUP_ACCORDION_STATES) {
|
|
111
|
+
results.push(await runState(page, cdp, state));
|
|
112
|
+
}
|
|
113
|
+
expect(neverExercised(results)).toEqual([]);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
for (const state of COLLAPSIBLE_GROUP_ACCORDION_STATES) {
|
|
117
|
+
test(`CollapsibleGroup.header [${state.id}] — ${state.summary}`, async ({
|
|
118
|
+
page,
|
|
119
|
+
}) => {
|
|
120
|
+
const cdp = await page.context().newCDPSession(page);
|
|
121
|
+
const result = await runState(page, cdp, state);
|
|
122
|
+
const report = summarize(ACCORDION_PATTERN, [result]);
|
|
123
|
+
// Only required rows block (AST-020 FR9); advisory rows report.
|
|
124
|
+
expect(formatFailures(blockingResults([result]))).toBe('');
|
|
125
|
+
expect(report.unrunLayers).toEqual([]);
|
|
126
|
+
expect(report.counts.unexpectedPass).toBe(0);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
@@ -33,7 +33,7 @@ const anatomy = [
|
|
|
33
33
|
name: 'List',
|
|
34
34
|
required: true,
|
|
35
35
|
description:
|
|
36
|
-
'Scrollable listbox
|
|
36
|
+
'Scrollable results container: a listbox while selectable results exist, otherwise the Empty state as plain content.',
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
name: 'Item',
|
|
@@ -88,7 +88,8 @@ export const docs = {
|
|
|
88
88
|
'dialog',
|
|
89
89
|
'navigation',
|
|
90
90
|
],
|
|
91
|
-
description:
|
|
91
|
+
description:
|
|
92
|
+
'Root component. Manages open state, search, keyboard navigation, and composition slots.',
|
|
92
93
|
// Intentionally a contained isInline preview, not playground.overlay: the
|
|
93
94
|
// component stays visible on load and knobs stay live, whereas a real
|
|
94
95
|
// showModal() overlay makes the page inert — see ComponentPlaygroundConfig.overlay
|
|
@@ -116,13 +117,15 @@ export const docs = {
|
|
|
116
117
|
{
|
|
117
118
|
name: 'searchSource',
|
|
118
119
|
type: 'SearchSource<T>',
|
|
119
|
-
description:
|
|
120
|
+
description:
|
|
121
|
+
'Search source providing items via search(query) and bootstrap(). Use createStaticSource for static lists.',
|
|
120
122
|
required: true,
|
|
121
123
|
},
|
|
122
124
|
{
|
|
123
125
|
name: 'input',
|
|
124
126
|
type: 'ReactNode',
|
|
125
|
-
description:
|
|
127
|
+
description:
|
|
128
|
+
'Input slot. Defaults to CommandPaletteInput with standard behavior.',
|
|
126
129
|
default: '<CommandPaletteInput />',
|
|
127
130
|
slotElements: [
|
|
128
131
|
{
|
|
@@ -137,7 +140,8 @@ export const docs = {
|
|
|
137
140
|
{
|
|
138
141
|
name: 'footer',
|
|
139
142
|
type: 'ReactNode',
|
|
140
|
-
description:
|
|
143
|
+
description:
|
|
144
|
+
'Footer slot. Defaults to CommandPaletteFooter showing keyboard hints.',
|
|
141
145
|
default: '<CommandPaletteFooter />',
|
|
142
146
|
slotElements: [
|
|
143
147
|
{
|
|
@@ -152,7 +156,8 @@ export const docs = {
|
|
|
152
156
|
{
|
|
153
157
|
name: 'renderItem',
|
|
154
158
|
type: '(item: T, isSelected: boolean) => ReactNode',
|
|
155
|
-
description:
|
|
159
|
+
description:
|
|
160
|
+
'Per-item render function for non-interactive presentation content such as labels, icons, descriptions, and shortcut hints. Do not return buttons or links inside the option. Auto-grouping by auxiliaryData.group is preserved. When omitted, renders label text.',
|
|
156
161
|
},
|
|
157
162
|
{
|
|
158
163
|
name: 'emptySearchText',
|
|
@@ -163,7 +168,8 @@ export const docs = {
|
|
|
163
168
|
{
|
|
164
169
|
name: 'emptyBootstrapText',
|
|
165
170
|
type: 'ReactNode',
|
|
166
|
-
description:
|
|
171
|
+
description:
|
|
172
|
+
'Content shown when there is no search query and bootstrap() returns nothing.',
|
|
167
173
|
default: "'Type to search'",
|
|
168
174
|
},
|
|
169
175
|
{
|
|
@@ -197,7 +203,8 @@ export const docs = {
|
|
|
197
203
|
{
|
|
198
204
|
name: 'isInline',
|
|
199
205
|
type: 'boolean',
|
|
200
|
-
description:
|
|
206
|
+
description:
|
|
207
|
+
'Renders command palette content inline without modal behavior. Automatically disables input auto-focus and initial highlighted-item auto-scroll. For documentation previews and showcases only.',
|
|
201
208
|
default: 'false',
|
|
202
209
|
},
|
|
203
210
|
],
|
|
@@ -222,12 +229,44 @@ export const docs = {
|
|
|
222
229
|
},
|
|
223
230
|
usage: {
|
|
224
231
|
anatomy,
|
|
225
|
-
description:
|
|
232
|
+
description:
|
|
233
|
+
'CommandPalette is a searchable dialog for quick access to commands, navigation, and actions. Use it as a keyboard-driven launcher powered by SearchSource for filtering and selection.',
|
|
226
234
|
bestPractices: [
|
|
227
|
-
{
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
235
|
+
{
|
|
236
|
+
guidance: true,
|
|
237
|
+
description:
|
|
238
|
+
'Provide a searchSource with bootstrap results so users see useful options before typing.',
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
guidance: true,
|
|
242
|
+
description:
|
|
243
|
+
'Use auxiliaryData.group on items to automatically organize results into labeled sections.',
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
guidance: true,
|
|
247
|
+
description:
|
|
248
|
+
'Provide a specific label when more than one command palette can appear in the same product surface.',
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
guidance: true,
|
|
252
|
+
description:
|
|
253
|
+
'Keep renderItem content non-interactive; each rendered row is one option, so buttons and links cannot be nested inside it.',
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
guidance: false,
|
|
257
|
+
description:
|
|
258
|
+
'Intercept query-field keyboard events without preserving active IME composition and native Home/End caret movement.',
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
guidance: false,
|
|
262
|
+
description:
|
|
263
|
+
'Use CommandPalette for simple dropdowns or menus; use Menu or Selector for inline selections.',
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
guidance: false,
|
|
267
|
+
description:
|
|
268
|
+
'Add too many groups or items; curate results to keep the palette fast and scannable.',
|
|
269
|
+
},
|
|
231
270
|
],
|
|
232
271
|
},
|
|
233
272
|
};
|
|
@@ -236,12 +275,44 @@ export const docs = {
|
|
|
236
275
|
export const docsZh = {
|
|
237
276
|
usage: {
|
|
238
277
|
anatomy,
|
|
239
|
-
description:
|
|
278
|
+
description:
|
|
279
|
+
'CommandPalette is a searchable dialog for quick access to commands, navigation, and actions. Use it as a keyboard-driven launcher powered by SearchSource for filtering and selection.',
|
|
240
280
|
bestPractices: [
|
|
241
|
-
{
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
281
|
+
{
|
|
282
|
+
guidance: true,
|
|
283
|
+
description:
|
|
284
|
+
'Provide a searchSource with bootstrap results so users see useful options before typing.',
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
guidance: true,
|
|
288
|
+
description:
|
|
289
|
+
'Use auxiliaryData.group on items to automatically organize results into labeled sections.',
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
guidance: true,
|
|
293
|
+
description:
|
|
294
|
+
'Provide a specific label when more than one command palette can appear in the same product surface.',
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
guidance: true,
|
|
298
|
+
description:
|
|
299
|
+
'Keep renderItem content non-interactive; each rendered row is one option, so buttons and links cannot be nested inside it.',
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
guidance: false,
|
|
303
|
+
description:
|
|
304
|
+
'Intercept query-field keyboard events without preserving active IME composition and native Home/End caret movement.',
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
guidance: false,
|
|
308
|
+
description:
|
|
309
|
+
'Use CommandPalette for simple dropdowns or menus; use Menu or Selector for inline selections.',
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
guidance: false,
|
|
313
|
+
description:
|
|
314
|
+
'Add too many groups or items; curate results to keep the palette fast and scannable.',
|
|
315
|
+
},
|
|
245
316
|
],
|
|
246
317
|
},
|
|
247
318
|
};
|
|
@@ -252,12 +323,44 @@ export const docsDense = {
|
|
|
252
323
|
'searchSource-driven command palette dialog; filtering, keyboard nav, grouping, selection; same SearchSource interface as Typeahead',
|
|
253
324
|
usage: {
|
|
254
325
|
anatomy,
|
|
255
|
-
description:
|
|
326
|
+
description:
|
|
327
|
+
'CommandPalette is a searchable dialog for quick access to commands, navigation, and actions. Use it as a keyboard-driven launcher powered by SearchSource for filtering and selection.',
|
|
256
328
|
bestPractices: [
|
|
257
|
-
{
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
329
|
+
{
|
|
330
|
+
guidance: true,
|
|
331
|
+
description:
|
|
332
|
+
'Provide a searchSource with bootstrap results so users see useful options before typing.',
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
guidance: true,
|
|
336
|
+
description:
|
|
337
|
+
'Use auxiliaryData.group on items to automatically organize results into labeled sections.',
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
guidance: true,
|
|
341
|
+
description:
|
|
342
|
+
'Provide a specific label when more than one command palette can appear in the same product surface.',
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
guidance: true,
|
|
346
|
+
description:
|
|
347
|
+
'Keep renderItem content non-interactive; each rendered row is one option, so buttons and links cannot be nested inside it.',
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
guidance: false,
|
|
351
|
+
description:
|
|
352
|
+
'Intercept query-field keyboard events without preserving active IME composition and native Home/End caret movement.',
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
guidance: false,
|
|
356
|
+
description:
|
|
357
|
+
'Use CommandPalette for simple dropdowns or menus; use Menu or Selector for inline selections.',
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
guidance: false,
|
|
361
|
+
description:
|
|
362
|
+
'Add too many groups or items; curate results to keep the palette fast and scannable.',
|
|
363
|
+
},
|
|
261
364
|
],
|
|
262
365
|
},
|
|
263
366
|
};
|