@trinityui/design-system 2.11.1 → 2.13.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 +2171 -0
- package/CONTRIBUTING.md +180 -69
- package/LICENSE +21 -0
- package/MIGRATION.md +508 -28
- package/README.md +281 -120
- package/dist/IllustratedMessage.js +546 -1341
- package/dist/accessibility.d.ts +596 -18
- package/dist/accessibility.d.ts.map +1 -1
- package/dist/accessibility.js +458 -0
- package/dist/app-shell.js +17219 -9131
- package/dist/assets/index.d.ts +1 -1
- package/dist/charts.js +8507 -6059
- package/dist/color-contrast.d.ts +35 -0
- package/dist/color-contrast.d.ts.map +1 -0
- package/dist/commonjs-helpers.js +8 -0
- package/dist/component-color-references.d.ts +175 -0
- package/dist/component-color-references.d.ts.map +1 -0
- package/dist/components/AI/AIActions.d.ts +72 -12
- package/dist/components/AI/AIActions.d.ts.map +1 -1
- package/dist/components/AI/AIAvatar.d.ts +31 -3
- package/dist/components/AI/AIAvatar.d.ts.map +1 -1
- package/dist/components/AI/AIChainOfThought.d.ts +159 -77
- package/dist/components/AI/AIChainOfThought.d.ts.map +1 -1
- package/dist/components/AI/AIChainOfThought.types.d.ts +292 -40
- package/dist/components/AI/AIChainOfThought.types.d.ts.map +1 -1
- package/dist/components/AI/AIChainOfThought.utils.d.ts +25 -7
- package/dist/components/AI/AIChainOfThought.utils.d.ts.map +1 -1
- package/dist/components/AI/AIChat.d.ts +12 -0
- package/dist/components/AI/AIChat.d.ts.map +1 -1
- package/dist/components/AI/AIChatWelcome.d.ts +254 -0
- package/dist/components/AI/AIChatWelcome.d.ts.map +1 -0
- package/dist/components/AI/AIClarificationPrompt.d.ts +134 -0
- package/dist/components/AI/AIClarificationPrompt.d.ts.map +1 -0
- package/dist/components/AI/AIConfidenceBadge.d.ts +117 -0
- package/dist/components/AI/AIConfidenceBadge.d.ts.map +1 -0
- package/dist/components/AI/AIConfigContext.d.ts +100 -0
- package/dist/components/AI/AIConfigContext.d.ts.map +1 -0
- package/dist/components/AI/AIConfigProvider.d.ts +66 -0
- package/dist/components/AI/AIConfigProvider.d.ts.map +1 -0
- package/dist/components/AI/AIContainer.d.ts +80 -11
- package/dist/components/AI/AIContainer.d.ts.map +1 -1
- package/dist/components/AI/AIExplainability.d.ts +39 -5
- package/dist/components/AI/AIExplainability.d.ts.map +1 -1
- package/dist/components/AI/AIFeedbackControl.d.ts +113 -0
- package/dist/components/AI/AIFeedbackControl.d.ts.map +1 -0
- package/dist/components/AI/AIFeedbackForm.d.ts +117 -0
- package/dist/components/AI/AIFeedbackForm.d.ts.map +1 -0
- package/dist/components/AI/AIFeedbackHostContext.d.ts +16 -0
- package/dist/components/AI/AIFeedbackHostContext.d.ts.map +1 -0
- package/dist/components/AI/AILabel.d.ts +39 -6
- package/dist/components/AI/AILabel.d.ts.map +1 -1
- package/dist/components/AI/AIMessage.d.ts +337 -42
- package/dist/components/AI/AIMessage.d.ts.map +1 -1
- package/dist/components/AI/AIPlanReview.d.ts +194 -0
- package/dist/components/AI/AIPlanReview.d.ts.map +1 -0
- package/dist/components/AI/AIQueryDisclosure.d.ts +119 -0
- package/dist/components/AI/AIQueryDisclosure.d.ts.map +1 -0
- package/dist/components/AI/AIRelatedQuestions.d.ts +50 -11
- package/dist/components/AI/AIRelatedQuestions.d.ts.map +1 -1
- package/dist/components/AI/AIResponseRenderer.d.ts +133 -21
- package/dist/components/AI/AIResponseRenderer.d.ts.map +1 -1
- package/dist/components/AI/AIResponseSourcesContext.d.ts +83 -0
- package/dist/components/AI/AIResponseSourcesContext.d.ts.map +1 -0
- package/dist/components/AI/AIReviewItem.d.ts +142 -0
- package/dist/components/AI/AIReviewItem.d.ts.map +1 -0
- package/dist/components/AI/AISourceChip.d.ts +135 -0
- package/dist/components/AI/AISourceChip.d.ts.map +1 -0
- package/dist/components/AI/AISources.d.ts +81 -11
- package/dist/components/AI/AISources.d.ts.map +1 -1
- package/dist/components/AI/AISourcesPanel.d.ts +43 -7
- package/dist/components/AI/AISourcesPanel.d.ts.map +1 -1
- package/dist/components/AI/AITextBlock.d.ts +104 -16
- package/dist/components/AI/AITextBlock.d.ts.map +1 -1
- package/dist/components/AI/AITextBlock.parser.d.ts +153 -0
- package/dist/components/AI/AITextBlock.parser.d.ts.map +1 -0
- package/dist/components/AI/AIVerificationBadge.d.ts +94 -0
- package/dist/components/AI/AIVerificationBadge.d.ts.map +1 -0
- package/dist/components/AI/AIVisuals.d.ts +92 -23
- package/dist/components/AI/AIVisuals.d.ts.map +1 -1
- package/dist/components/AI/AIVoiceInput.d.ts +42 -11
- package/dist/components/AI/AIVoiceInput.d.ts.map +1 -1
- package/dist/components/AI/AIVoiceMode.d.ts +16 -2
- package/dist/components/AI/AIVoiceMode.d.ts.map +1 -1
- package/dist/components/AI/BlockErrorBoundary.d.ts +77 -0
- package/dist/components/AI/BlockErrorBoundary.d.ts.map +1 -0
- package/dist/components/AI/ChatHeader.d.ts +41 -4
- package/dist/components/AI/ChatHeader.d.ts.map +1 -1
- package/dist/components/AI/ChatHistoryList.d.ts +25 -12
- package/dist/components/AI/ChatHistoryList.d.ts.map +1 -1
- package/dist/components/AI/ChatThread.d.ts +263 -13
- package/dist/components/AI/ChatThread.d.ts.map +1 -1
- package/dist/components/AI/InThreadContext.d.ts +14 -0
- package/dist/components/AI/InThreadContext.d.ts.map +1 -0
- package/dist/components/AI/InsightEngine.d.ts +270 -46
- package/dist/components/AI/InsightEngine.d.ts.map +1 -1
- package/dist/components/AI/InsightEngineInput.d.ts +47 -4
- package/dist/components/AI/InsightEngineInput.d.ts.map +1 -1
- package/dist/components/AI/MessageActionButton.d.ts +72 -0
- package/dist/components/AI/MessageActionButton.d.ts.map +1 -0
- package/dist/components/AI/QueryInput.d.ts.map +1 -1
- package/dist/components/AI/UserAvatar.d.ts +50 -4
- package/dist/components/AI/UserAvatar.d.ts.map +1 -1
- package/dist/components/AI/UserMessage.d.ts +32 -3
- package/dist/components/AI/UserMessage.d.ts.map +1 -1
- package/dist/components/AI/blockRendererContext.d.ts +64 -0
- package/dist/components/AI/blockRendererContext.d.ts.map +1 -0
- package/dist/components/AI/hitlBlockRenderers.d.ts +48 -0
- package/dist/components/AI/hitlBlockRenderers.d.ts.map +1 -0
- package/dist/components/AI/index.d.ts +23 -6
- package/dist/components/AI/index.d.ts.map +1 -1
- package/dist/components/AI/moleculeBlockRenderers.d.ts +15 -0
- package/dist/components/AI/moleculeBlockRenderers.d.ts.map +1 -0
- package/dist/components/AI/planReviewBlockRenderer.d.ts +8 -0
- package/dist/components/AI/planReviewBlockRenderer.d.ts.map +1 -0
- package/dist/components/AI/strings/defaults.d.ts +31 -0
- package/dist/components/AI/strings/defaults.d.ts.map +1 -0
- package/dist/components/AI/tokens.d.ts +185 -20
- package/dist/components/AI/tokens.d.ts.map +1 -1
- package/dist/components/AI/types/hitl.d.ts +2294 -0
- package/dist/components/AI/types/hitl.d.ts.map +1 -0
- package/dist/components/AI/types/index.d.ts +2 -1
- package/dist/components/AI/types/index.d.ts.map +1 -1
- package/dist/components/AI/types/response.d.ts +428 -40
- package/dist/components/AI/types/response.d.ts.map +1 -1
- package/dist/components/AI/useBlockSources.d.ts +67 -0
- package/dist/components/AI/useBlockSources.d.ts.map +1 -0
- package/dist/components/AI/useBrowserVoiceMode.d.ts +31 -2
- package/dist/components/AI/useBrowserVoiceMode.d.ts.map +1 -1
- package/dist/components/AI/useWelcomeComposerHandoff.d.ts +30 -0
- package/dist/components/AI/useWelcomeComposerHandoff.d.ts.map +1 -0
- package/dist/components/AI/utils/alphaIndex.d.ts +19 -0
- package/dist/components/AI/utils/alphaIndex.d.ts.map +1 -0
- package/dist/components/AI/utils/blockReady.d.ts +54 -0
- package/dist/components/AI/utils/blockReady.d.ts.map +1 -0
- package/dist/components/AI/utils/blocks.d.ts +28 -0
- package/dist/components/AI/utils/blocks.d.ts.map +1 -0
- package/dist/components/AI/utils/confidence.d.ts +182 -0
- package/dist/components/AI/utils/confidence.d.ts.map +1 -0
- package/dist/components/AI/utils/filters.d.ts +31 -0
- package/dist/components/AI/utils/filters.d.ts.map +1 -0
- package/dist/components/AI/utils/responseText.d.ts +8 -0
- package/dist/components/AI/utils/responseText.d.ts.map +1 -0
- package/dist/components/AI/utils/sources.d.ts +110 -0
- package/dist/components/AI/utils/sources.d.ts.map +1 -0
- package/dist/components/AIDigestCard/AIDigestCard.d.ts.map +1 -1
- package/dist/components/AIDigestCard/types.d.ts +42 -5
- package/dist/components/AIDigestCard/types.d.ts.map +1 -1
- package/dist/components/AppLayout/AIFab.d.ts +33 -6
- package/dist/components/AppLayout/AIFab.d.ts.map +1 -1
- package/dist/components/AppLayout/AIFabLayout.deprecated.d.ts.map +1 -1
- package/dist/components/AppLayout/AppLayout.d.ts +143 -8
- package/dist/components/AppLayout/AppLayout.d.ts.map +1 -1
- package/dist/components/AppLayout/InsightEnginePanel.d.ts +315 -21
- package/dist/components/AppLayout/InsightEnginePanel.d.ts.map +1 -1
- package/dist/components/AppLayout/ResizablePanel.d.ts +145 -8
- package/dist/components/AppLayout/ResizablePanel.d.ts.map +1 -1
- package/dist/components/AppLayout/ThreadHistorySidebar.d.ts +6 -0
- package/dist/components/AppLayout/ThreadHistorySidebar.d.ts.map +1 -1
- package/dist/components/AppLayout/index.d.ts +3 -3
- package/dist/components/AppLayout/index.d.ts.map +1 -1
- package/dist/components/AppLayout/insightEnginePanel.demo.d.ts +32 -0
- package/dist/components/AppLayout/insightEnginePanel.demo.d.ts.map +1 -0
- package/dist/components/AppLayout/panelPropsPath.d.ts +26 -0
- package/dist/components/AppLayout/panelPropsPath.d.ts.map +1 -0
- package/dist/components/AppLayout/panelResizeTransition.d.ts +49 -0
- package/dist/components/AppLayout/panelResizeTransition.d.ts.map +1 -0
- package/dist/components/AppLayout/toChatThreadMessage.d.ts +40 -0
- package/dist/components/AppLayout/toChatThreadMessage.d.ts.map +1 -0
- package/dist/components/AssessmentDrawer/AssessmentDrawer.d.ts +5 -1
- package/dist/components/AssessmentDrawer/AssessmentDrawer.d.ts.map +1 -1
- package/dist/components/AuditDrawer/AuditDrawer.d.ts +4 -3
- package/dist/components/AuditDrawer/AuditDrawer.d.ts.map +1 -1
- package/dist/components/AuditDrawer/index.d.ts +1 -1
- package/dist/components/AuditDrawer/index.d.ts.map +1 -1
- package/dist/components/AuditDrawer/types.d.ts +39 -5
- package/dist/components/AuditDrawer/types.d.ts.map +1 -1
- package/dist/components/Autocomplete/Autocomplete.d.ts +6 -1
- package/dist/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/BulkActionDock/BulkActionDock.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.d.ts +10 -2
- package/dist/components/Carousel/Carousel.d.ts.map +1 -1
- package/dist/components/Charts/AreaChart.d.ts.map +1 -1
- package/dist/components/Charts/BarChart.d.ts.map +1 -1
- package/dist/components/Charts/ChartWrapper.d.ts.map +1 -1
- package/dist/components/Charts/ComposedChart.d.ts.map +1 -1
- package/dist/components/Charts/CustomLegend.d.ts +11 -2
- package/dist/components/Charts/CustomLegend.d.ts.map +1 -1
- package/dist/components/Charts/LineChart.d.ts.map +1 -1
- package/dist/components/Charts/PieChart.d.ts.map +1 -1
- package/dist/components/Charts/RadialChart.d.ts.map +1 -1
- package/dist/components/Charts/ScatterChart.d.ts.map +1 -1
- package/dist/components/Charts/Sparkline.d.ts.map +1 -1
- package/dist/components/Charts/gaugeGeometry.d.ts +35 -0
- package/dist/components/Charts/gaugeGeometry.d.ts.map +1 -0
- package/dist/components/Charts/highcharts.d.ts +23 -0
- package/dist/components/Charts/highcharts.d.ts.map +1 -0
- package/dist/components/Charts/highchartsUtils.d.ts +101 -6
- package/dist/components/Charts/highchartsUtils.d.ts.map +1 -1
- package/dist/components/Charts/index.d.ts +1 -1
- package/dist/components/Charts/index.d.ts.map +1 -1
- package/dist/components/Charts/tokens.d.ts +21 -0
- package/dist/components/Charts/tokens.d.ts.map +1 -1
- package/dist/components/Charts/types.d.ts +7 -7
- package/dist/components/Charts/types.d.ts.map +1 -1
- package/dist/components/ChipsInput/ChipsInput.d.ts.map +1 -1
- package/dist/components/ChoiceChips/ChoiceChips.d.ts +106 -0
- package/dist/components/ChoiceChips/ChoiceChips.d.ts.map +1 -0
- package/dist/components/ClearableTextField/ClearableTextField.d.ts +23 -2
- package/dist/components/ClearableTextField/ClearableTextField.d.ts.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.d.ts +80 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts.map +1 -0
- package/dist/components/Combobox/Combobox.d.ts +3 -2
- package/dist/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPalette.d.ts +54 -3
- package/dist/components/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/components/CommandPalette/index.d.ts +1 -1
- package/dist/components/CommandPalette/index.d.ts.map +1 -1
- package/dist/components/CopyButton/CopyButton.d.ts +80 -0
- package/dist/components/CopyButton/CopyButton.d.ts.map +1 -0
- package/dist/components/DataCard/DataCard.d.ts +11 -1
- package/dist/components/DataCard/DataCard.d.ts.map +1 -1
- package/dist/components/DataTable/CellRenderers.d.ts +8 -11
- package/dist/components/DataTable/CellRenderers.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.d.ts +1 -1
- package/dist/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/DataTable/InlineAddRow.d.ts.map +1 -1
- package/dist/components/DataTable/columnContext.d.ts +8 -0
- package/dist/components/DataTable/columnContext.d.ts.map +1 -0
- package/dist/components/DataTable/index.d.ts +2 -2
- package/dist/components/DataTable/index.d.ts.map +1 -1
- package/dist/components/DataTable/labels.d.ts +13 -0
- package/dist/components/DataTable/labels.d.ts.map +1 -0
- package/dist/components/DataTable/types.d.ts +34 -0
- package/dist/components/DataTable/types.d.ts.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/components/DetailsPopover/DetailsPopover.d.ts +185 -0
- package/dist/components/DetailsPopover/DetailsPopover.d.ts.map +1 -0
- package/dist/components/DiffViewer/DiffViewer.d.ts +3 -2
- package/dist/components/DiffViewer/DiffViewer.d.ts.map +1 -1
- package/dist/components/Disclosure/Disclosure.d.ts +83 -0
- package/dist/components/Disclosure/Disclosure.d.ts.map +1 -0
- package/dist/components/DockLayout/DockLayout.d.ts +58 -0
- package/dist/components/DockLayout/DockLayout.d.ts.map +1 -1
- package/dist/components/DockLayout/index.d.ts +1 -1
- package/dist/components/DockLayout/index.d.ts.map +1 -1
- package/dist/components/DocumentCard/DocumentCard.d.ts +5 -1
- package/dist/components/DocumentCard/DocumentCard.d.ts.map +1 -1
- package/dist/components/EntityDetailPanel/EntityDetailPanel.d.ts +6 -2
- package/dist/components/EntityDetailPanel/EntityDetailPanel.d.ts.map +1 -1
- package/dist/components/FileUpload/FileUpload.d.ts +141 -6
- package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/components/FileUpload/index.d.ts +1 -1
- package/dist/components/FileUpload/index.d.ts.map +1 -1
- package/dist/components/FilterBar/FilterBar.d.ts +27 -1
- package/dist/components/FilterBar/FilterBar.d.ts.map +1 -1
- package/dist/components/FilterBar/index.d.ts +1 -1
- package/dist/components/FilterBar/index.d.ts.map +1 -1
- package/dist/components/FlowAutoLayout/useFlowAutoLayout.d.ts.map +1 -1
- package/dist/components/GanttView/GanttView.d.ts +24 -0
- package/dist/components/GanttView/GanttView.d.ts.map +1 -1
- package/dist/components/GanttView/types.d.ts +33 -7
- package/dist/components/GanttView/types.d.ts.map +1 -1
- package/dist/components/GaugeCard/GaugeCard.d.ts +4 -3
- package/dist/components/GaugeCard/GaugeCard.d.ts.map +1 -1
- package/dist/components/GaugeCard/geometry.d.ts +59 -0
- package/dist/components/GaugeCard/geometry.d.ts.map +1 -0
- package/dist/components/GeoStatusMap/GeoStatusMap.d.ts.map +1 -1
- package/dist/components/GeoStatusMap/types.d.ts +8 -5
- package/dist/components/GeoStatusMap/types.d.ts.map +1 -1
- package/dist/components/GoToTop/GoToTop.d.ts +1 -1
- package/dist/components/GoToTop/GoToTop.d.ts.map +1 -1
- package/dist/components/HierarchicalDrillDown/HierarchicalDrillDown.d.ts.map +1 -1
- package/dist/components/HistoricalDataIndicator/HistoricalDataIndicator.d.ts.map +1 -1
- package/dist/components/HtmlToMui/HtmlToMui.d.ts.map +1 -1
- package/dist/components/Icon.d.ts +567 -10
- package/dist/components/Icon.d.ts.map +1 -1
- package/dist/components/IllustratedMessage.d.ts +52 -3
- package/dist/components/IllustratedMessage.d.ts.map +1 -1
- package/dist/components/InlineEditableText/InlineEditableText.d.ts +117 -0
- package/dist/components/InlineEditableText/InlineEditableText.d.ts.map +1 -0
- package/dist/components/InsightCard/InsightCard.d.ts.map +1 -1
- package/dist/components/InsightCard/types.d.ts +10 -3
- package/dist/components/InsightCard/types.d.ts.map +1 -1
- package/dist/components/KeyValueList/KeyValueList.d.ts +94 -0
- package/dist/components/KeyValueList/KeyValueList.d.ts.map +1 -0
- package/dist/components/LandingPage/FeatureCard.d.ts +4 -0
- package/dist/components/LandingPage/FeatureCard.d.ts.map +1 -1
- package/dist/components/LandingPage/LandingPage.d.ts +43 -4
- package/dist/components/LandingPage/LandingPage.d.ts.map +1 -1
- package/dist/components/LandingPage/heroTone.d.ts +54 -0
- package/dist/components/LandingPage/heroTone.d.ts.map +1 -0
- package/dist/components/MentionsInput/MentionsInput.d.ts.map +1 -1
- package/dist/components/MetaChip/MetaChip.d.ts +113 -0
- package/dist/components/MetaChip/MetaChip.d.ts.map +1 -0
- package/dist/components/Modal/Modal.d.ts +222 -20
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.d.ts.map +1 -1
- package/dist/components/OrgChart/OrgChart.d.ts +5 -0
- package/dist/components/OrgChart/OrgChart.d.ts.map +1 -1
- package/dist/components/OrgChart/types.d.ts +31 -7
- package/dist/components/OrgChart/types.d.ts.map +1 -1
- package/dist/components/OverflowTooltip/OverflowTooltip.d.ts +1 -1
- package/dist/components/OverflowTooltip/OverflowTooltip.d.ts.map +1 -1
- package/dist/components/PageHeader/PageHeader.d.ts.map +1 -1
- package/dist/components/PageTOC/PageTOC.d.ts +2 -1
- package/dist/components/PageTOC/PageTOC.d.ts.map +1 -1
- package/dist/components/Popper/Popper.d.ts +80 -9
- package/dist/components/Popper/Popper.d.ts.map +1 -1
- package/dist/components/Popper/index.d.ts +1 -1
- package/dist/components/Popper/index.d.ts.map +1 -1
- package/dist/components/PredictiveTextInput/PredictiveTextInput.d.ts +5 -1
- package/dist/components/PredictiveTextInput/PredictiveTextInput.d.ts.map +1 -1
- package/dist/components/SearchInput/SearchInput.d.ts +49 -0
- package/dist/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/components/SearchInput/index.d.ts +1 -1
- package/dist/components/SearchInput/index.d.ts.map +1 -1
- package/dist/components/SimpleTable/SimpleTable.d.ts +11 -2
- package/dist/components/SimpleTable/SimpleTable.d.ts.map +1 -1
- package/dist/components/SplitPane/SplitPane.d.ts +2 -1
- package/dist/components/SplitPane/SplitPane.d.ts.map +1 -1
- package/dist/components/StatusHero/StatusHero.d.ts.map +1 -1
- package/dist/components/StatusIndicator/Badge.d.ts +6 -1
- package/dist/components/StatusIndicator/Badge.d.ts.map +1 -1
- package/dist/components/StatusIndicator/Chip.d.ts +3 -1
- package/dist/components/StatusIndicator/Chip.d.ts.map +1 -1
- package/dist/components/StatusIndicator/Indicators.d.ts +5 -1
- package/dist/components/StatusIndicator/Indicators.d.ts.map +1 -1
- package/dist/components/StatusIndicator/Legend.d.ts.map +1 -1
- package/dist/components/StatusIndicator/StatusIndicator.d.ts +98 -4
- package/dist/components/StatusIndicator/StatusIndicator.d.ts.map +1 -1
- package/dist/components/StatusIndicator/index.d.ts +2 -2
- package/dist/components/StatusIndicator/index.d.ts.map +1 -1
- package/dist/components/StatusIndicator/types.d.ts +48 -1
- package/dist/components/StatusIndicator/types.d.ts.map +1 -1
- package/dist/components/StepList/StepList.d.ts +80 -0
- package/dist/components/StepList/StepList.d.ts.map +1 -0
- package/dist/components/StepList/StepStatusMarker.d.ts +39 -0
- package/dist/components/StepList/StepStatusMarker.d.ts.map +1 -0
- package/dist/components/StepList/stepStatus.d.ts +30 -0
- package/dist/components/StepList/stepStatus.d.ts.map +1 -0
- package/dist/components/SystemBanner/SystemBanner.d.ts.map +1 -1
- package/dist/components/Timeline/Timeline.d.ts +57 -3
- package/dist/components/Timeline/Timeline.d.ts.map +1 -1
- package/dist/components/Timeline/index.d.ts +1 -1
- package/dist/components/Timeline/index.d.ts.map +1 -1
- package/dist/components/Timeline/timelineLabels.d.ts +70 -0
- package/dist/components/Timeline/timelineLabels.d.ts.map +1 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -1
- package/dist/components/TopNavHeader.d.ts +18 -1
- package/dist/components/TopNavHeader.d.ts.map +1 -1
- package/dist/components/TopNavWithSidebar.d.ts +61 -2
- package/dist/components/TopNavWithSidebar.d.ts.map +1 -1
- package/dist/components/Tour/Tour.d.ts +18 -1
- package/dist/components/Tour/Tour.d.ts.map +1 -1
- package/dist/components/TransferList/TransferList.d.ts +123 -4
- package/dist/components/TransferList/TransferList.d.ts.map +1 -1
- package/dist/components/TransferList/index.d.ts +1 -1
- package/dist/components/TransferList/index.d.ts.map +1 -1
- package/dist/components/TreeView/TreeView.d.ts +97 -8
- package/dist/components/TreeView/TreeView.d.ts.map +1 -1
- package/dist/components/TreeView/index.d.ts +1 -1
- package/dist/components/TreeView/index.d.ts.map +1 -1
- package/dist/components/TrinityLoader.d.ts.map +1 -1
- package/dist/components/icons/featherExtensions.d.ts +55 -0
- package/dist/components/icons/featherExtensions.d.ts.map +1 -0
- package/dist/components/icons/materialExtensions.d.ts +20 -0
- package/dist/components/icons/materialExtensions.d.ts.map +1 -0
- package/dist/components/internal/index.d.ts +87 -0
- package/dist/components/internal/index.d.ts.map +1 -1
- package/dist/components/navigation/MenuListWithHeading.d.ts +33 -0
- package/dist/components/navigation/MenuListWithHeading.d.ts.map +1 -0
- package/dist/components/navigation/clientSelectorLabels.d.ts +13 -0
- package/dist/components/navigation/clientSelectorLabels.d.ts.map +1 -0
- package/dist/components/navigation/components.d.ts +6 -0
- package/dist/components/navigation/components.d.ts.map +1 -1
- package/dist/components/shared/AsyncOutcomeAlert.d.ts +91 -0
- package/dist/components/shared/AsyncOutcomeAlert.d.ts.map +1 -0
- package/dist/components/shared/TrinityIconSvg.d.ts.map +1 -1
- package/dist/components/shared/TrinityLogoSvg.d.ts.map +1 -1
- package/dist/components/shared/bidi.d.ts +44 -0
- package/dist/components/shared/bidi.d.ts.map +1 -0
- package/dist/components/shared/bidiText.d.ts +25 -0
- package/dist/components/shared/bidiText.d.ts.map +1 -0
- package/dist/components/shared/containerQueries.d.ts +73 -0
- package/dist/components/shared/containerQueries.d.ts.map +1 -0
- package/dist/components/shared/createStringsContext.d.ts +69 -0
- package/dist/components/shared/createStringsContext.d.ts.map +1 -0
- package/dist/components/shared/direction.d.ts +46 -0
- package/dist/components/shared/direction.d.ts.map +1 -0
- package/dist/components/shared/focusTrap.d.ts +36 -0
- package/dist/components/shared/focusTrap.d.ts.map +1 -0
- package/dist/components/shared/getInitials.d.ts +29 -0
- package/dist/components/shared/getInitials.d.ts.map +1 -0
- package/dist/components/shared/headingLevel.d.ts +69 -0
- package/dist/components/shared/headingLevel.d.ts.map +1 -0
- package/dist/components/shared/mergeSlotProps.d.ts +50 -0
- package/dist/components/shared/mergeSlotProps.d.ts.map +1 -0
- package/dist/components/shared/mergeSx.d.ts +26 -0
- package/dist/components/shared/mergeSx.d.ts.map +1 -0
- package/dist/components/shared/motion.d.ts +110 -0
- package/dist/components/shared/motion.d.ts.map +1 -0
- package/dist/components/shared/occurrenceKeys.d.ts +23 -0
- package/dist/components/shared/occurrenceKeys.d.ts.map +1 -0
- package/dist/components/shared/primaryAction.d.ts +89 -0
- package/dist/components/shared/primaryAction.d.ts.map +1 -0
- package/dist/components/shared/resizeKeyboard.d.ts +68 -0
- package/dist/components/shared/resizeKeyboard.d.ts.map +1 -0
- package/dist/components/shared/rootProps.d.ts +117 -0
- package/dist/components/shared/rootProps.d.ts.map +1 -0
- package/dist/components/shared/safeContent.d.ts +9 -2
- package/dist/components/shared/safeContent.d.ts.map +1 -1
- package/dist/components/shared/targetSize.d.ts +64 -0
- package/dist/components/shared/targetSize.d.ts.map +1 -0
- package/dist/components/shared/useContainerInlineSize.d.ts +43 -0
- package/dist/components/shared/useContainerInlineSize.d.ts.map +1 -0
- package/dist/components/shared/useCopyAction.d.ts +35 -0
- package/dist/components/shared/useCopyAction.d.ts.map +1 -0
- package/dist/components/shared/useOverflow.d.ts +44 -0
- package/dist/components/shared/useOverflow.d.ts.map +1 -0
- package/dist/components/shared/useResizable.d.ts +106 -7
- package/dist/components/shared/useResizable.d.ts.map +1 -1
- package/dist/components/shared/warnDeprecated.d.ts +89 -15
- package/dist/components/shared/warnDeprecated.d.ts.map +1 -1
- package/dist/components/shared/zIndexRoles.d.ts +62 -0
- package/dist/components/shared/zIndexRoles.d.ts.map +1 -0
- package/dist/components/templates/AIReviewQueue/AIReviewQueueTemplate.d.ts +213 -0
- package/dist/components/templates/AIReviewQueue/AIReviewQueueTemplate.d.ts.map +1 -0
- package/dist/components/templates/AIReviewQueue/index.d.ts +2 -0
- package/dist/components/templates/AIReviewQueue/index.d.ts.map +1 -0
- package/dist/components/templates/Auth/AuthTemplate.d.ts.map +1 -1
- package/dist/components/templates/Auth/types.d.ts +4 -1
- package/dist/components/templates/Auth/types.d.ts.map +1 -1
- package/dist/components/templates/Catalog/CatalogTemplate.d.ts.map +1 -1
- package/dist/components/templates/ConnectorWizard/ConnectorWizardTemplate.d.ts.map +1 -1
- package/dist/components/templates/InsightsCenter/InsightsCenterTemplate.d.ts.map +1 -1
- package/dist/components/templates/IntegrationDetail/IntegrationDetailTemplate.d.ts.map +1 -1
- package/dist/components/templates/ListDetail/ListDetailTemplate.d.ts +168 -10
- package/dist/components/templates/ListDetail/ListDetailTemplate.d.ts.map +1 -1
- package/dist/components/templates/ListDetail/index.d.ts +1 -1
- package/dist/components/templates/ListDetail/index.d.ts.map +1 -1
- package/dist/components/templates/ListDetail/listDetailLabels.d.ts +106 -0
- package/dist/components/templates/ListDetail/listDetailLabels.d.ts.map +1 -0
- package/dist/components/templates/Onboarding/OnboardingTemplate.d.ts.map +1 -1
- package/dist/components/templates/Settings/SettingsTemplate.d.ts +0 -3
- package/dist/components/templates/Settings/SettingsTemplate.d.ts.map +1 -1
- package/dist/components/templates/Wizard/WizardTemplate.d.ts +4 -1
- package/dist/components/templates/Wizard/WizardTemplate.d.ts.map +1 -1
- package/dist/components/templates/index.d.ts +2 -1
- package/dist/components/templates/index.d.ts.map +1 -1
- package/dist/data-table.d.ts +1 -1
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +1 -0
- package/dist/data-table2.js +13522 -13465
- package/dist/data.js +213 -194
- package/dist/elk.bundled.js +47371 -0
- package/dist/essentials.d.ts +3 -3
- package/dist/essentials.d.ts.map +1 -1
- package/dist/essentials.js +179 -147
- package/dist/focus-on-replace.js +49 -0
- package/dist/form.d.ts +26 -4
- package/dist/form.d.ts.map +1 -1
- package/dist/forms.js +575 -483
- package/dist/foundation.js +3704 -0
- package/dist/hooks/storageStore.d.ts +51 -0
- package/dist/hooks/storageStore.d.ts.map +1 -0
- package/dist/hooks/useAsyncAction.d.ts +65 -0
- package/dist/hooks/useAsyncAction.d.ts.map +1 -0
- package/dist/hooks/useDisclosure.d.ts +190 -0
- package/dist/hooks/useDisclosure.d.ts.map +1 -0
- package/dist/hooks/useFocusOnReplace.d.ts +95 -0
- package/dist/hooks/useFocusOnReplace.d.ts.map +1 -0
- package/dist/hooks/useTrinityPalette.d.ts +38 -40
- package/dist/hooks/useTrinityPalette.d.ts.map +1 -1
- package/dist/hooks.d.ts +44 -6
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +301 -0
- package/dist/index.d.ts +71 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13925 -60619
- package/dist/patterns/AICopilotPattern/AICopilotPattern.d.ts +203 -0
- package/dist/patterns/AICopilotPattern/AICopilotPattern.d.ts.map +1 -0
- package/dist/patterns/AICopilotPattern/index.d.ts +3 -0
- package/dist/patterns/AICopilotPattern/index.d.ts.map +1 -0
- package/dist/patterns/index.d.ts +15 -0
- package/dist/patterns/index.d.ts.map +1 -0
- package/dist/presets/analytics.d.ts +8 -1
- package/dist/presets/analytics.d.ts.map +1 -1
- package/dist/presets/crm.d.ts +8 -1
- package/dist/presets/crm.d.ts.map +1 -1
- package/dist/presets/index.d.ts +1 -1
- package/dist/presets/portal.d.ts +8 -1
- package/dist/presets/portal.d.ts.map +1 -1
- package/dist/safe-content.js +69 -69
- package/dist/theme-augmentation.d.ts +388 -0
- package/dist/theme-augmentation.d.ts.map +1 -0
- package/dist/theme.d.ts +116 -30
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +891 -436
- package/dist/token-color.d.ts +14 -0
- package/dist/token-color.d.ts.map +1 -0
- package/dist/token-merge.d.ts +56 -0
- package/dist/token-merge.d.ts.map +1 -0
- package/dist/token-serialization.d.ts +65 -0
- package/dist/token-serialization.d.ts.map +1 -0
- package/dist/tokens.d.ts +882 -13
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +21 -19
- package/dist/trinity.css +1077 -414
- package/package.json +111 -90
- package/dist/components/index.d.ts +0 -145
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/shared.d.ts +0 -92
- package/dist/components/shared.d.ts.map +0 -1
package/dist/accessibility.d.ts
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @module accessibility
|
|
6
6
|
*/
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated since 2.13.0; removed in v3.0 with `useFocusTrap`. See MIGRATION.md.
|
|
9
|
+
*/
|
|
7
10
|
export interface UseFocusTrapOptions {
|
|
8
11
|
/** Whether the focus trap is active */
|
|
9
12
|
enabled?: boolean;
|
|
@@ -14,6 +17,9 @@ export interface UseFocusTrapOptions {
|
|
|
14
17
|
/** Whether to include tab navigation wrapping */
|
|
15
18
|
wrapFocus?: boolean;
|
|
16
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated since 2.13.0; removed in v3.0 with `useFocusTrap`. See MIGRATION.md.
|
|
22
|
+
*/
|
|
17
23
|
export interface UseFocusTrapReturn {
|
|
18
24
|
/** Ref to attach to the container element */
|
|
19
25
|
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
@@ -27,11 +33,51 @@ export interface UseFocusTrapReturn {
|
|
|
27
33
|
/**
|
|
28
34
|
* Hook to trap focus within a container element.
|
|
29
35
|
* Useful for modals, dialogs, and dropdown menus.
|
|
36
|
+
*
|
|
37
|
+
* @deprecated since 2.13.0; removed in v3.0. MUI's focus trap is the one to
|
|
38
|
+
* use: `Dialog`, `Popover`, `Menu` and a temporary `Drawer` trap focus
|
|
39
|
+
* themselves, and `FocusTrap` from `@mui/material/Unstable_TrapFocus` covers
|
|
40
|
+
* a custom surface. This hook only traps after an imperative `activate()`,
|
|
41
|
+
* and it skips `position: fixed` elements. In development it warns once per
|
|
42
|
+
* session, from a mount effect. See MIGRATION.md.
|
|
30
43
|
*/
|
|
31
44
|
export declare const useFocusTrap: ({ enabled, initialFocus, returnFocus, wrapFocus, }?: UseFocusTrapOptions) => UseFocusTrapReturn;
|
|
45
|
+
/**
|
|
46
|
+
* The CSS media query for users who prefer reduced motion. Use it as a key in
|
|
47
|
+
* `sx` or `styled` styles to stop an animation or transition:
|
|
48
|
+
*
|
|
49
|
+
* ```tsx
|
|
50
|
+
* import { REDUCED_MOTION_QUERY } from '@trinityui/design-system';
|
|
51
|
+
*
|
|
52
|
+
* <Box
|
|
53
|
+
* sx={(theme) => ({
|
|
54
|
+
* animation: `${pulse} ${theme.transitions.duration.complex}ms infinite alternate`,
|
|
55
|
+
* [REDUCED_MOTION_QUERY]: { animation: 'none' },
|
|
56
|
+
* })}
|
|
57
|
+
* />
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* It tests the same media feature as `useReducedMotion`. Prefer it for CSS
|
|
61
|
+
* motion: the browser applies it from the first paint, also in
|
|
62
|
+
* server-rendered markup, while the hook returns `false` until hydration has
|
|
63
|
+
* finished.
|
|
64
|
+
*
|
|
65
|
+
* @since 2.13.0
|
|
66
|
+
*/
|
|
67
|
+
export declare const REDUCED_MOTION_QUERY: "@media (prefers-reduced-motion: reduce)";
|
|
32
68
|
/**
|
|
33
69
|
* Hook to detect user's reduced motion preference.
|
|
34
70
|
* Use this to disable animations for users who have requested reduced motion.
|
|
71
|
+
* For CSS animations and transitions, prefer `REDUCED_MOTION_QUERY` in `sx`.
|
|
72
|
+
*
|
|
73
|
+
* Safe for server rendering and hydration (ADR-27). The server render and the
|
|
74
|
+
* hydration render return `false`, so the hydrated markup matches the server's;
|
|
75
|
+
* React then re-renders straight after hydration with the user's preference.
|
|
76
|
+
* A render on the client without server markup returns the preference on its
|
|
77
|
+
* first render. Later changes of the preference re-render the component.
|
|
78
|
+
*
|
|
79
|
+
* @returns `true` when the user prefers reduced motion
|
|
80
|
+
* (`prefers-reduced-motion: reduce`), otherwise `false`.
|
|
35
81
|
*/
|
|
36
82
|
export declare const useReducedMotion: () => boolean;
|
|
37
83
|
import React from 'react';
|
|
@@ -41,14 +87,171 @@ export interface SkipLinkProps {
|
|
|
41
87
|
targetId: string;
|
|
42
88
|
/** Link text */
|
|
43
89
|
label?: string;
|
|
44
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Custom styles, merged after the skip link's own. The object, array and
|
|
92
|
+
* function forms all work (array and function since 2.13.0).
|
|
93
|
+
*/
|
|
45
94
|
sx?: SxProps<Theme>;
|
|
46
95
|
}
|
|
47
96
|
/**
|
|
48
97
|
* Skip Link - Provides keyboard users a way to skip navigation.
|
|
49
98
|
* Should be the first focusable element on the page.
|
|
99
|
+
*
|
|
100
|
+
* Hidden until it receives focus; then it shows at the inline start of the
|
|
101
|
+
* viewport (the left in LTR, the right in RTL), above app chrome and every
|
|
102
|
+
* overlay on the theme's `skipLink` layer role (`zIndex.tooltip + 1`, ADR-03-R12). Activating it (click, Enter or Space) moves
|
|
103
|
+
* focus to the element with `targetId`.
|
|
50
104
|
*/
|
|
51
105
|
export declare const SkipLink: React.FC<SkipLinkProps>;
|
|
106
|
+
/**
|
|
107
|
+
* How urgently a screen reader reads an announcement: `'polite'` waits until
|
|
108
|
+
* the user is idle, `'assertive'` interrupts.
|
|
109
|
+
*
|
|
110
|
+
* @since 2.13.0
|
|
111
|
+
*/
|
|
112
|
+
export type AnnouncePoliteness = 'polite' | 'assertive';
|
|
113
|
+
/**
|
|
114
|
+
* Announces a short message to screen readers, for example "Saved" or
|
|
115
|
+
* "3 results". `politeness` defaults to `'polite'`. An empty message clears
|
|
116
|
+
* the region and cancels a pending message of that politeness.
|
|
117
|
+
*
|
|
118
|
+
* @since 2.13.0
|
|
119
|
+
*/
|
|
120
|
+
export type AnnounceFn = (message: string, politeness?: AnnouncePoliteness) => void;
|
|
121
|
+
/**
|
|
122
|
+
* Props for `LiveRegionProvider`.
|
|
123
|
+
*
|
|
124
|
+
* @since 2.13.0
|
|
125
|
+
*/
|
|
126
|
+
export interface LiveRegionProviderProps {
|
|
127
|
+
/** The content whose announcements this provider reads out. */
|
|
128
|
+
children?: React.ReactNode;
|
|
129
|
+
/**
|
|
130
|
+
* Milliseconds after which an announced message is removed from its
|
|
131
|
+
* region, so a screen reader that revisits the page does not find stale
|
|
132
|
+
* text. Pass `Infinity` to keep each message until the next one.
|
|
133
|
+
* @default 7000
|
|
134
|
+
*/
|
|
135
|
+
clearAfterMs?: number;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Mounts one polite and one assertive live region, visually hidden, after its
|
|
139
|
+
* children. `useAnnounce` inside it announces through these regions; nested
|
|
140
|
+
* providers work, and the nearest one wins.
|
|
141
|
+
*
|
|
142
|
+
* The regions are siblings after the children, never inside them, so the
|
|
143
|
+
* provider can wrap a live container (a `role="log"` chat thread) without
|
|
144
|
+
* nesting live regions. Wrap overlay content in its own provider: MUI hides
|
|
145
|
+
* everything outside an open modal with `aria-hidden`, including the
|
|
146
|
+
* document-level regions `useAnnounce` falls back to, and screen readers may
|
|
147
|
+
* ignore content outside an `aria-modal` dialog.
|
|
148
|
+
*
|
|
149
|
+
* A message is written 50 ms after the call (the region is emptied first, so
|
|
150
|
+
* a repeated message is read again), the latest message per politeness wins,
|
|
151
|
+
* and it is cleared after `clearAfterMs`. Every timer is cleared on unmount.
|
|
152
|
+
* The provider renders no text of its own.
|
|
153
|
+
*
|
|
154
|
+
* ```tsx
|
|
155
|
+
* <LiveRegionProvider>
|
|
156
|
+
* <SaveButton />
|
|
157
|
+
* </LiveRegionProvider>
|
|
158
|
+
*
|
|
159
|
+
* function SaveButton() {
|
|
160
|
+
* const announce = useAnnounce();
|
|
161
|
+
* return <Button onClick={() => save().then(() => announce('Saved'))}>Save</Button>;
|
|
162
|
+
* }
|
|
163
|
+
* ```
|
|
164
|
+
*
|
|
165
|
+
* @since 2.13.0
|
|
166
|
+
*/
|
|
167
|
+
export declare function LiveRegionProvider({ children, clearAfterMs, }: LiveRegionProviderProps): React.JSX.Element;
|
|
168
|
+
/**
|
|
169
|
+
* @internal Test-only: cancels the document-level timers and removes the
|
|
170
|
+
* document-level regions, so the next announcement starts fresh (mirrors
|
|
171
|
+
* `__resetDevWarnings` in warnDeprecated.ts). Not exported from any package entry.
|
|
172
|
+
*/
|
|
173
|
+
export declare function __resetDocumentLiveRegion(): void;
|
|
174
|
+
/**
|
|
175
|
+
* Returns a stable function that announces a message to screen readers
|
|
176
|
+
* through the nearest `LiveRegionProvider`.
|
|
177
|
+
*
|
|
178
|
+
* Without a provider it uses a pair of document-level regions, created at
|
|
179
|
+
* the end of `document.body` on the first call (never during render, and
|
|
180
|
+
* never on a server). Their timers belong to the page, not to the calling
|
|
181
|
+
* component, so a message announced just before the component unmounts (a
|
|
182
|
+
* deleted row announcing "Deleted") is still read. Inside an open MUI modal
|
|
183
|
+
* these regions are hidden by `aria-hidden`, so overlay content needs its own
|
|
184
|
+
* `LiveRegionProvider`.
|
|
185
|
+
*
|
|
186
|
+
* ```tsx
|
|
187
|
+
* const announce = useAnnounce();
|
|
188
|
+
* announce('Copied');
|
|
189
|
+
* announce('Upload failed', 'assertive');
|
|
190
|
+
* ```
|
|
191
|
+
*
|
|
192
|
+
* The toolkit has no built-in strings: pass text from your own strings or
|
|
193
|
+
* `labels` prop.
|
|
194
|
+
*
|
|
195
|
+
* @since 2.13.0
|
|
196
|
+
*/
|
|
197
|
+
export declare function useAnnounce(): AnnounceFn;
|
|
198
|
+
/**
|
|
199
|
+
* Options for `liveRegionProps`.
|
|
200
|
+
*
|
|
201
|
+
* @since 2.13.0
|
|
202
|
+
*/
|
|
203
|
+
export interface LiveRegionPropsOptions {
|
|
204
|
+
/**
|
|
205
|
+
* The container's role. `'log'` for a chat thread or activity feed,
|
|
206
|
+
* `'status'` for a status message, `'alert'` for an urgent message.
|
|
207
|
+
* `'alert'` implies `politeness: 'assertive'` (ADR-32 (3)).
|
|
208
|
+
*/
|
|
209
|
+
role?: 'log' | 'status' | 'alert';
|
|
210
|
+
/**
|
|
211
|
+
* `aria-live`. Defaults to `'assertive'` with `role: 'alert'`, else
|
|
212
|
+
* `'polite'`. With `role: 'alert'` it is always `'assertive'`.
|
|
213
|
+
*/
|
|
214
|
+
politeness?: AnnouncePoliteness;
|
|
215
|
+
/** `aria-relevant`: which changes are read, for example `'additions'` for a log. */
|
|
216
|
+
relevant?: React.AriaAttributes['aria-relevant'];
|
|
217
|
+
/** `aria-atomic`: read the whole container on a change (`true`) or only the change (`false`). */
|
|
218
|
+
atomic?: boolean;
|
|
219
|
+
/** `aria-busy`: `true` while the content is still arriving (streaming); emitted only when `true`. */
|
|
220
|
+
busy?: boolean;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* The attributes `liveRegionProps` returns, ready to spread on an element.
|
|
224
|
+
*
|
|
225
|
+
* @since 2.13.0
|
|
226
|
+
*/
|
|
227
|
+
export interface LiveRegionAttributes {
|
|
228
|
+
role?: 'log' | 'status' | 'alert';
|
|
229
|
+
'aria-live': AnnouncePoliteness;
|
|
230
|
+
'aria-relevant'?: React.AriaAttributes['aria-relevant'];
|
|
231
|
+
'aria-atomic'?: boolean;
|
|
232
|
+
'aria-busy'?: true;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Attributes for a live *container*: an element whose own content changes
|
|
236
|
+
* and should be read, such as a chat log or a streaming answer. For a short
|
|
237
|
+
* transient message ("Saved"), use `useAnnounce` instead.
|
|
238
|
+
*
|
|
239
|
+
* `aria-live` is always set. Every other attribute appears only when its
|
|
240
|
+
* option is passed, so replacing hand-written attributes keeps the DOM
|
|
241
|
+
* identical:
|
|
242
|
+
*
|
|
243
|
+
* ```tsx
|
|
244
|
+
* <Box {...liveRegionProps({ role: 'log', politeness: 'polite', relevant: 'additions' })}>
|
|
245
|
+
* {messages.map((message) => <Message key={message.id} {...message} />)}
|
|
246
|
+
* </Box>
|
|
247
|
+
* ```
|
|
248
|
+
*
|
|
249
|
+
* Do not nest live containers, and do not put a `LiveRegionProvider` inside
|
|
250
|
+
* one: wrap the container with the provider instead.
|
|
251
|
+
*
|
|
252
|
+
* @since 2.13.0
|
|
253
|
+
*/
|
|
254
|
+
export declare function liveRegionProps(options?: LiveRegionPropsOptions): LiveRegionAttributes;
|
|
52
255
|
export interface UseAriaLiveOptions {
|
|
53
256
|
/** Politeness level */
|
|
54
257
|
politeness?: 'polite' | 'assertive' | 'off';
|
|
@@ -57,44 +260,182 @@ export interface UseAriaLiveOptions {
|
|
|
57
260
|
/** Relevance filter */
|
|
58
261
|
relevant?: 'additions' | 'removals' | 'text' | 'all';
|
|
59
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* Options for one `useAriaLive` announcement.
|
|
265
|
+
*
|
|
266
|
+
* @since 2.13.0
|
|
267
|
+
*/
|
|
268
|
+
export interface UseAriaLiveAnnounceOptions {
|
|
269
|
+
/** Read this message with this politeness instead of the hook's. */
|
|
270
|
+
politeness?: AnnouncePoliteness;
|
|
271
|
+
}
|
|
60
272
|
export interface UseAriaLiveReturn {
|
|
61
|
-
/**
|
|
62
|
-
|
|
63
|
-
|
|
273
|
+
/**
|
|
274
|
+
* Announce a message.
|
|
275
|
+
*
|
|
276
|
+
* When `ariaProps` is spread on a mounted element (your own region), the
|
|
277
|
+
* message is written there: `message` empties at once and takes the new
|
|
278
|
+
* text 50 ms later, so a repeated message is read again. Otherwise the
|
|
279
|
+
* message goes through `useAnnounce` (the nearest `LiveRegionProvider`, or
|
|
280
|
+
* the document-level regions), and `message` still follows it.
|
|
281
|
+
*
|
|
282
|
+
* Only one announcement is pending at a time: a newer call replaces a
|
|
283
|
+
* pending one (the last call wins), and a pending update of `message` is
|
|
284
|
+
* dropped when the component unmounts. With `politeness: 'off'` nothing is
|
|
285
|
+
* announced.
|
|
286
|
+
*
|
|
287
|
+
* `options.politeness` (since 2.13.0) reads this message with another
|
|
288
|
+
* politeness. When it differs from your region's, the message goes through
|
|
289
|
+
* `useAnnounce` and your region is left as it is.
|
|
290
|
+
*/
|
|
291
|
+
announce: (message: string, options?: UseAriaLiveAnnounceOptions) => void;
|
|
292
|
+
/**
|
|
293
|
+
* Clear the current announcement and cancel a pending one. When the hook
|
|
294
|
+
* announces through `useAnnounce`, the region it uses is emptied too.
|
|
295
|
+
*/
|
|
64
296
|
clear: () => void;
|
|
65
297
|
/** Current message */
|
|
66
298
|
message: string;
|
|
67
|
-
/**
|
|
299
|
+
/**
|
|
300
|
+
* ARIA attributes to spread on the element that renders `message`. The
|
|
301
|
+
* `ref` (since 2.13.0) tells the hook that you render the region; keep it
|
|
302
|
+
* (merge your own ref with `useForkRef` from `@mui/utils`), or messages
|
|
303
|
+
* are announced twice. `role` is omitted when `politeness` is `'off'`.
|
|
304
|
+
*/
|
|
68
305
|
ariaProps: {
|
|
69
|
-
role
|
|
306
|
+
role?: 'status' | 'alert';
|
|
70
307
|
'aria-live': 'polite' | 'assertive' | 'off';
|
|
71
308
|
'aria-atomic': boolean;
|
|
72
309
|
'aria-relevant'?: 'additions' | 'removals' | 'text' | 'all';
|
|
310
|
+
ref: React.RefCallback<HTMLElement>;
|
|
73
311
|
};
|
|
74
312
|
}
|
|
75
313
|
/**
|
|
76
314
|
* Hook for managing ARIA live regions.
|
|
77
315
|
* Useful for announcing dynamic content changes to screen readers.
|
|
316
|
+
*
|
|
317
|
+
* Two ways to use it:
|
|
318
|
+
*
|
|
319
|
+
* - Call `announce` and render nothing: the message is read through the
|
|
320
|
+
* nearest `LiveRegionProvider`, or the document-level regions
|
|
321
|
+
* (`useAnnounce`). For new code, prefer `useAnnounce` itself.
|
|
322
|
+
* - Render `message` inside an element that spreads `ariaProps` and stays
|
|
323
|
+
* mounted: that element is the live region, and nothing else announces the
|
|
324
|
+
* message.
|
|
325
|
+
*
|
|
326
|
+
* At most one update of `message` is pending at a time: `announce` and
|
|
327
|
+
* `clear` cancel the pending one, and unmounting cancels it, so no state
|
|
328
|
+
* update runs after unmount.
|
|
78
329
|
*/
|
|
79
330
|
export declare const useAriaLive: ({ politeness, atomic, relevant, }?: UseAriaLiveOptions) => UseAriaLiveReturn;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
331
|
+
/**
|
|
332
|
+
* The visually-hidden styles: the content stays in the accessibility tree and
|
|
333
|
+
* in the tab order, but takes no space and paints nothing. This object is the
|
|
334
|
+
* single source of these styles. `VisuallyHidden` renders them, and you can
|
|
335
|
+
* apply them to an element that cannot be a `VisuallyHidden`, for example a
|
|
336
|
+
* native radio input inside a styled label:
|
|
337
|
+
*
|
|
338
|
+
* ```tsx
|
|
339
|
+
* import { visuallyHiddenSx } from '@trinityui/design-system';
|
|
340
|
+
*
|
|
341
|
+
* <Box
|
|
342
|
+
* component="label"
|
|
343
|
+
* sx={{ '&:has(input:focus-visible)': { outline: '2px solid', outlineColor: 'primary.main', outlineOffset: 2 } }}
|
|
344
|
+
* >
|
|
345
|
+
* <Box component="input" type="radio" name="size" value="m" sx={visuallyHiddenSx} />
|
|
346
|
+
* Medium
|
|
347
|
+
* </Box>
|
|
348
|
+
* ```
|
|
349
|
+
*
|
|
350
|
+
* The object is frozen. Spread it, or pass it first in an `sx` array, to add
|
|
351
|
+
* styles: `sx={[visuallyHiddenSx, { zIndex: 1 }]}`. Overriding a hiding
|
|
352
|
+
* property (`position`, `width`, `height`, `margin`, `overflow`, `clip`,
|
|
353
|
+
* `whiteSpace`) can make the content visible.
|
|
354
|
+
*
|
|
355
|
+
* The values are byte-identical to the inline `sx` `VisuallyHidden` used
|
|
356
|
+
* before 2.13.0, so its generated class has not changed.
|
|
357
|
+
*
|
|
358
|
+
* @since 2.13.0
|
|
359
|
+
*/
|
|
360
|
+
export declare const visuallyHiddenSx: Readonly<React.CSSProperties>;
|
|
361
|
+
/**
|
|
362
|
+
* Props for `VisuallyHidden`. Every standard HTML attribute (`className`,
|
|
363
|
+
* `style`, `role`, `aria-*`, `data-*`, event handlers, …) is forwarded to the
|
|
364
|
+
* rendered element. Attribute forwarding, the optional `children`, `id` and
|
|
365
|
+
* `sx` are available since 2.13.0.
|
|
366
|
+
*/
|
|
367
|
+
export interface VisuallyHiddenProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
368
|
+
/**
|
|
369
|
+
* Content to hide visually but keep accessible. Optional, so a void
|
|
370
|
+
* element such as `as="input"` can be rendered.
|
|
371
|
+
*/
|
|
372
|
+
children?: React.ReactNode;
|
|
373
|
+
/**
|
|
374
|
+
* HTML element to render as.
|
|
375
|
+
* @default 'span'
|
|
376
|
+
*/
|
|
84
377
|
as?: React.ElementType;
|
|
378
|
+
/**
|
|
379
|
+
* Id of the rendered element. Set it to make the hidden text the target of
|
|
380
|
+
* `aria-describedby` or `aria-labelledby` on another element.
|
|
381
|
+
* @since 2.13.0
|
|
382
|
+
*/
|
|
383
|
+
id?: string;
|
|
384
|
+
/**
|
|
385
|
+
* Extra styles, merged after the visually-hidden styles. The object, array
|
|
386
|
+
* and function forms all work. Overriding a hiding property (`position`,
|
|
387
|
+
* `width`, `height`, `margin`, `overflow`, `clip`, `whiteSpace`) can make
|
|
388
|
+
* the content visible.
|
|
389
|
+
* @since 2.13.0
|
|
390
|
+
*/
|
|
391
|
+
sx?: SxProps<Theme>;
|
|
85
392
|
}
|
|
86
393
|
/**
|
|
87
394
|
* Visually Hidden - Hides content visually while keeping it accessible.
|
|
88
|
-
* Useful for providing additional context to screen readers.
|
|
395
|
+
* Useful for providing additional context to screen readers. Its styles are
|
|
396
|
+
* `visuallyHiddenSx`.
|
|
397
|
+
*
|
|
398
|
+
* The ref and all other props are forwarded to the rendered element, so it
|
|
399
|
+
* can be the target of an ARIA relationship:
|
|
400
|
+
*
|
|
401
|
+
* ```tsx
|
|
402
|
+
* const hintId = React.useId();
|
|
403
|
+
* <Button aria-describedby={hintId}>Delete</Button>
|
|
404
|
+
* <VisuallyHidden id={hintId}>Deletes the file permanently</VisuallyHidden>
|
|
405
|
+
* ```
|
|
406
|
+
*
|
|
407
|
+
* The ref is typed `HTMLSpanElement`, the default element. With `as` set to
|
|
408
|
+
* another element, the ref receives that element, so cast it as needed. Ref
|
|
409
|
+
* forwarding is available since 2.13.0.
|
|
89
410
|
*/
|
|
90
|
-
export declare const VisuallyHidden: React.
|
|
411
|
+
export declare const VisuallyHidden: React.ForwardRefExoticComponent<VisuallyHiddenProps & React.RefAttributes<HTMLSpanElement>>;
|
|
91
412
|
export type NavigationDirection = 'horizontal' | 'vertical' | 'both';
|
|
92
413
|
export interface UseRovingTabIndexOptions {
|
|
93
|
-
/**
|
|
414
|
+
/**
|
|
415
|
+
* List of item refs, in order. An item whose element is `disabled` or
|
|
416
|
+
* `aria-disabled="true"` is skipped by the arrow keys, Home and End, and
|
|
417
|
+
* never keeps the tab stop: right after each commit of the component that
|
|
418
|
+
* calls the hook, a tab stop on a disabled item passes to the nearest
|
|
419
|
+
* enabled one (forward first), before the browser paints. The server render
|
|
420
|
+
* and the first client render cannot see the elements, so they use
|
|
421
|
+
* `currentIndex` as given.
|
|
422
|
+
*/
|
|
94
423
|
items: React.RefObject<HTMLElement | null>[];
|
|
95
|
-
/**
|
|
424
|
+
/**
|
|
425
|
+
* Index of the item that owns the tab stop. Whenever this value changes,
|
|
426
|
+
* the tab stop moves to that item (focus does not move). It is clamped to
|
|
427
|
+
* the list. The arrow keys also move the tab stop; to control it, pass
|
|
428
|
+
* `onIndexChange` and feed the reported index back, otherwise setting the
|
|
429
|
+
* value it already had (after the arrow keys moved away) changes nothing.
|
|
430
|
+
* @default 0
|
|
431
|
+
*/
|
|
96
432
|
currentIndex?: number;
|
|
97
|
-
/**
|
|
433
|
+
/**
|
|
434
|
+
* Navigation axis: `'vertical'` uses ArrowUp and ArrowDown, `'horizontal'`
|
|
435
|
+
* ArrowLeft and ArrowRight (swapped when the theme direction is `'rtl'`),
|
|
436
|
+
* `'both'` uses all four.
|
|
437
|
+
* @default 'vertical'
|
|
438
|
+
*/
|
|
98
439
|
direction?: NavigationDirection;
|
|
99
440
|
/** Whether navigation wraps */
|
|
100
441
|
wrap?: boolean;
|
|
@@ -112,8 +453,245 @@ export interface UseRovingTabIndexReturn {
|
|
|
112
453
|
getTabIndex: (index: number) => 0 | -1;
|
|
113
454
|
}
|
|
114
455
|
/**
|
|
115
|
-
*
|
|
116
|
-
*
|
|
456
|
+
* Options for the registry form of {@link useRovingTabIndex}: the form you get
|
|
457
|
+
* when you pass no `items` array. Items register themselves through
|
|
458
|
+
* `getItemProps(id)`, so the hook tracks them by id rather than by index.
|
|
459
|
+
*
|
|
460
|
+
* @typeParam Id - The type of the item ids, `string` by default.
|
|
461
|
+
* @since 2.13.0
|
|
462
|
+
*/
|
|
463
|
+
export interface UseRovingTabIndexRegistryOptions<Id extends string | number = string> {
|
|
464
|
+
/**
|
|
465
|
+
* Not part of the registry form. An options object with a defined `items`
|
|
466
|
+
* selects the legacy refs-array form, at runtime and in the types, so the
|
|
467
|
+
* registry options never carry one. An explicit `items: undefined` is the
|
|
468
|
+
* registry form.
|
|
469
|
+
*/
|
|
470
|
+
items?: never;
|
|
471
|
+
/**
|
|
472
|
+
* The axis the arrow keys move along. `'vertical'` uses ArrowUp and
|
|
473
|
+
* ArrowDown, `'horizontal'` uses ArrowLeft and ArrowRight. Home and End
|
|
474
|
+
* always move to the first and last enabled item. The other arrow pair is
|
|
475
|
+
* left to the consumer (a tree uses it to expand and collapse).
|
|
476
|
+
*/
|
|
477
|
+
orientation: 'horizontal' | 'vertical';
|
|
478
|
+
/**
|
|
479
|
+
* The id that should own the tab stop. Whenever this value changes, the tab
|
|
480
|
+
* stop moves to that item. Focus does not move; call `focusItem` for that.
|
|
481
|
+
* Keyboard and pointer focus still move the tab stop, and every such move is
|
|
482
|
+
* reported through `onActiveIdChange`, a move back onto this item included;
|
|
483
|
+
* pass the reported id back to keep the two in sync.
|
|
484
|
+
* Once items have registered, an id that is not registered falls back to the
|
|
485
|
+
* first enabled item, and a disabled one to the next enabled item after it;
|
|
486
|
+
* `defaultActiveId` and the selected item are not consulted. If the item
|
|
487
|
+
* this id names registers or becomes enabled later, and the user has not
|
|
488
|
+
* moved the tab stop in the meantime, the tab stop moves to it then.
|
|
489
|
+
* Before any item has registered (the server render and the first client
|
|
490
|
+
* render), this id owns the tab stop only if it names an enabled item that
|
|
491
|
+
* is rendered; otherwise the markup has no tab stop until the items
|
|
492
|
+
* register. A disabled or unrendered id does not fall back to
|
|
493
|
+
* `defaultActiveId` there.
|
|
494
|
+
* Omit it, or pass `null`, to let the hook choose (see `defaultActiveId`).
|
|
495
|
+
*/
|
|
496
|
+
activeId?: Id | null;
|
|
497
|
+
/**
|
|
498
|
+
* The item that owns the tab stop until the user or `activeId` moves it. It
|
|
499
|
+
* applies only while `activeId` is omitted or `null`. When it is omitted, or
|
|
500
|
+
* names an item that is missing or disabled, the first enabled item
|
|
501
|
+
* registered with `selected: true` owns the tab stop, otherwise the first
|
|
502
|
+
* enabled item.
|
|
503
|
+
* Before any item has registered (the server render and the first client
|
|
504
|
+
* render) there is no such fallback: `activeId`, else this id, owns the tab
|
|
505
|
+
* stop only if it names an enabled item that is rendered, and otherwise the
|
|
506
|
+
* markup has no tab stop until the items register (a disabled `activeId`
|
|
507
|
+
* does not fall back to this id). For exactly one tab stop in the server
|
|
508
|
+
* markup, pass an id that names an enabled, rendered item.
|
|
509
|
+
*/
|
|
510
|
+
defaultActiveId?: Id | null;
|
|
511
|
+
/**
|
|
512
|
+
* Called after the tab stop moves from one item to another: through the
|
|
513
|
+
* arrow keys, Home or End, focus (click or Tab), `setActiveId`, `focusItem`,
|
|
514
|
+
* because the active item was removed or disabled, or because the item that
|
|
515
|
+
* `activeId` names registered or became enabled after the option changed.
|
|
516
|
+
* A move onto the item `activeId` names is reported too when the user made
|
|
517
|
+
* it. It is not called for the first tab stop after the items register, or
|
|
518
|
+
* for a move in the same render as a change of the `activeId` option (you
|
|
519
|
+
* made that change, so you already know the id).
|
|
520
|
+
*/
|
|
521
|
+
onActiveIdChange?: (id: Id) => void;
|
|
522
|
+
/**
|
|
523
|
+
* Whether the arrow keys wrap from the last item to the first and back.
|
|
524
|
+
* @default true
|
|
525
|
+
*/
|
|
526
|
+
wrap?: boolean;
|
|
527
|
+
/**
|
|
528
|
+
* Text direction. With `'rtl'` and `orientation: 'horizontal'`, ArrowLeft
|
|
529
|
+
* moves to the next item and ArrowRight to the previous one. Defaults to
|
|
530
|
+
* the theme's `direction`, so a theme created with `'rtl'` needs nothing
|
|
531
|
+
* more.
|
|
532
|
+
* @default theme.direction
|
|
533
|
+
*/
|
|
534
|
+
direction?: 'ltr' | 'rtl';
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* Options for one item in the registry form of {@link useRovingTabIndex},
|
|
538
|
+
* passed as the second argument of `getItemProps`.
|
|
539
|
+
*
|
|
540
|
+
* @since 2.13.0
|
|
541
|
+
*/
|
|
542
|
+
export interface UseRovingTabIndexItemOptions {
|
|
543
|
+
/**
|
|
544
|
+
* The item is skipped by the arrow keys, Home and End, and never owns the
|
|
545
|
+
* tab stop. A `disabled` attribute or `aria-disabled="true"` on the item
|
|
546
|
+
* element counts as well once the item has registered; before that (the
|
|
547
|
+
* server render and the first client render) only this option is seen.
|
|
548
|
+
* @default false
|
|
549
|
+
*/
|
|
550
|
+
disabled?: boolean;
|
|
551
|
+
/**
|
|
552
|
+
* The item is selected in your own state. When `defaultActiveId` is not
|
|
553
|
+
* given, the first enabled selected item is the default tab stop (the APG
|
|
554
|
+
* rule for listboxes, trees and tabs).
|
|
555
|
+
* @default false
|
|
556
|
+
*/
|
|
557
|
+
selected?: boolean;
|
|
558
|
+
/**
|
|
559
|
+
* Your own ref to the item element. It is merged into the returned `ref`,
|
|
560
|
+
* so do not also pass it to the element.
|
|
561
|
+
*/
|
|
562
|
+
ref?: React.Ref<HTMLElement>;
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* What the registry form of {@link useRovingTabIndex} returns.
|
|
566
|
+
*
|
|
567
|
+
* @typeParam Id - The type of the item ids, `string` by default.
|
|
568
|
+
* @since 2.13.0
|
|
569
|
+
*/
|
|
570
|
+
export interface UseRovingTabIndexRegistryReturn<Id extends string | number = string> {
|
|
571
|
+
/**
|
|
572
|
+
* The id of the item that owns the tab stop (`tabIndex` 0) in this render,
|
|
573
|
+
* or `null` when no enabled item is registered and no fallback applies.
|
|
574
|
+
*/
|
|
575
|
+
activeId: Id | null;
|
|
576
|
+
/**
|
|
577
|
+
* Moves the tab stop to `id` without moving focus. With `{ focus: true }`
|
|
578
|
+
* it behaves like `focusItem`.
|
|
579
|
+
*/
|
|
580
|
+
setActiveId: (id: Id, options?: {
|
|
581
|
+
focus?: boolean;
|
|
582
|
+
}) => void;
|
|
583
|
+
/**
|
|
584
|
+
* Props for the container element (the `toolbar`, `listbox`, `tree`, ...).
|
|
585
|
+
* They handle the arrow keys, Home and End for this container's items, and
|
|
586
|
+
* keep the tab stop on the item that receives focus. Pass your own
|
|
587
|
+
* `onKeyDown`, `onFocus` and `ref` through here rather than on the element:
|
|
588
|
+
* your handlers run first, and calling `event.preventDefault()` in your
|
|
589
|
+
* `onKeyDown` stops the hook from handling that key. Inline handlers get
|
|
590
|
+
* their parameter types from here (`onKeyDown: (event) => ...`). Every other
|
|
591
|
+
* prop you pass is returned unchanged.
|
|
592
|
+
*/
|
|
593
|
+
getContainerProps: <P extends object = Record<never, never>>(userProps?: P & {
|
|
594
|
+
/** Runs before the hook's own focus handling. */
|
|
595
|
+
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
596
|
+
/** Runs before the hook's own key handling; `event.preventDefault()` opts the key out. */
|
|
597
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
|
|
598
|
+
/** Your container ref, merged with the hook's own. */
|
|
599
|
+
ref?: React.Ref<HTMLElement>;
|
|
600
|
+
}) => Omit<P, 'onFocus' | 'onKeyDown' | 'ref'> & {
|
|
601
|
+
/** Moves the tab stop to the registered item that receives focus. */
|
|
602
|
+
onFocus: React.FocusEventHandler<HTMLElement>;
|
|
603
|
+
/** Handles the arrow keys of `orientation`, Home and End. Keys pressed with Alt, Ctrl, Meta or Shift are ignored. */
|
|
604
|
+
onKeyDown: React.KeyboardEventHandler<HTMLElement>;
|
|
605
|
+
/** Merges your container ref with the hook's own. */
|
|
606
|
+
ref: React.RefCallback<HTMLElement>;
|
|
607
|
+
};
|
|
608
|
+
/**
|
|
609
|
+
* Props for one item. Spread both on the item element: the `ref` registers
|
|
610
|
+
* it, and `tabIndex` is 0 for the tab stop and -1 for every other item.
|
|
611
|
+
* Calling it for each item while rendering is safe; no hook runs per item.
|
|
612
|
+
* Each `id` must be unique within this hook and render on one element.
|
|
613
|
+
* Items are ordered by their position in the document, and must not contain
|
|
614
|
+
* one another (render a nested group next to its parent item, not inside
|
|
615
|
+
* it).
|
|
616
|
+
*/
|
|
617
|
+
getItemProps: (id: Id, options?: UseRovingTabIndexItemOptions) => {
|
|
618
|
+
/** Registers the element under `id` while it is mounted. */
|
|
619
|
+
ref: React.RefCallback<HTMLElement>;
|
|
620
|
+
/** 0 for the item that owns the tab stop, -1 for the others. */
|
|
621
|
+
tabIndex: 0 | -1;
|
|
622
|
+
};
|
|
623
|
+
/**
|
|
624
|
+
* Moves focus to the item `id` and makes it the tab stop. Does nothing when
|
|
625
|
+
* the item is not mounted or is disabled.
|
|
626
|
+
*/
|
|
627
|
+
focusItem: (id: Id) => void;
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Roving tabindex for composite widgets (toolbar, listbox, tree, grid, radio
|
|
631
|
+
* group): the group is one Tab stop, and the arrow keys move focus inside it
|
|
632
|
+
* (WAI-ARIA APG, "Keyboard Navigation Inside Components"). Prefer a native or
|
|
633
|
+
* MUI widget that already does this (`RadioGroup`, `MenuList`, `Tabs`).
|
|
634
|
+
*
|
|
635
|
+
* **Registry form** (since 2.13.0; no `items`, or `items: undefined`): spread
|
|
636
|
+
* `getContainerProps()` on the container and
|
|
637
|
+
* `getItemProps(id, { disabled, selected })` on each item.
|
|
638
|
+
* Arrow keys along `orientation`, Home and End move focus between the enabled
|
|
639
|
+
* items in document order; disabled items are skipped. The tab stop follows
|
|
640
|
+
* focus. Before the user moves it, it is the item `activeId` names (an id
|
|
641
|
+
* that is not registered falls back to the first enabled item, a disabled one
|
|
642
|
+
* to the next enabled item after it); without `activeId`, it is
|
|
643
|
+
* `defaultActiveId`, otherwise the first enabled selected item, otherwise the
|
|
644
|
+
* first enabled item. Before any item has registered (the server render and
|
|
645
|
+
* the first client render), `activeId`, else `defaultActiveId`, is the tab
|
|
646
|
+
* stop only if it names an enabled, rendered item; otherwise the markup has
|
|
647
|
+
* no tab stop until the items register. Built on `useRovingTabIndexRoot` from
|
|
648
|
+
* `@mui/utils`.
|
|
649
|
+
*
|
|
650
|
+
* ```tsx
|
|
651
|
+
* const roving = useRovingTabIndex({ orientation: 'horizontal' });
|
|
652
|
+
* <div role="toolbar" aria-label="Formatting" {...roving.getContainerProps()}>
|
|
653
|
+
* {tools.map((tool) => (
|
|
654
|
+
* <button key={tool.id} type="button" disabled={tool.disabled}
|
|
655
|
+
* {...roving.getItemProps(tool.id, { disabled: tool.disabled })}>
|
|
656
|
+
* {tool.label}
|
|
657
|
+
* </button>
|
|
658
|
+
* ))}
|
|
659
|
+
* </div>
|
|
660
|
+
* ```
|
|
661
|
+
*
|
|
662
|
+
* Horizontal arrows follow the text direction: `direction` (registry form),
|
|
663
|
+
* else the theme's `direction`.
|
|
664
|
+
*
|
|
665
|
+
* **Legacy form** (`items`, an array of refs): the same signature as earlier
|
|
666
|
+
* releases. You attach `handleKeyDown` and read `getTabIndex(index)`. Since
|
|
667
|
+
* 2.13.0 it skips disabled items (also at Home and End), moves the tab stop
|
|
668
|
+
* when `currentIndex` changes, clamps it when the list shrinks, and swaps
|
|
669
|
+
* ArrowLeft and ArrowRight in an RTL theme. Prefer the registry form for new
|
|
670
|
+
* code.
|
|
671
|
+
*
|
|
672
|
+
* The form is fixed on the first render. Switching between them on a mounted
|
|
673
|
+
* component throws; remount it (change its `key`) instead.
|
|
674
|
+
*
|
|
675
|
+
* Types: the id type comes from the options only. It is `string` unless they
|
|
676
|
+
* say otherwise: a number in `activeId` or `defaultActiveId` gives `number`,
|
|
677
|
+
* string and number ids together give `string | number`, and an
|
|
678
|
+
* `onActiveIdChange` that accepts only a narrower type (a `number` handler,
|
|
679
|
+
* an `(id: TabId) => void` handler, or the setter of `useState<TabId>` passed
|
|
680
|
+
* with `activeId: tab`) gives that type. A value alone does not narrow them:
|
|
681
|
+
* a literal such as `defaultActiveId: 'apple'`, or `activeId: tab` typed
|
|
682
|
+
* `TabId` with no callback, gives `string`. Ids passed only to
|
|
683
|
+
* `getItemProps`, `focusItem` or `setActiveId` do not count, so pass the
|
|
684
|
+
* type: `useRovingTabIndex<number>({ orientation: 'horizontal' })`. A type
|
|
685
|
+
* argument also narrows, for example `useRovingTabIndex<TabId>(...)`; pass
|
|
686
|
+
* one when a literal default meets a narrower handler, which otherwise types
|
|
687
|
+
* the ids as that literal. The legacy signature is declared last, so
|
|
688
|
+
* `ReturnType<typeof useRovingTabIndex>` and
|
|
689
|
+
* `Parameters<typeof useRovingTabIndex>` still describe the legacy form; name
|
|
690
|
+
* the registry types (`UseRovingTabIndexRegistryReturn`, ...) directly.
|
|
117
691
|
*/
|
|
118
|
-
export declare
|
|
692
|
+
export declare function useRovingTabIndex(options: UseRovingTabIndexRegistryOptions<string>): UseRovingTabIndexRegistryReturn<string>;
|
|
693
|
+
export declare function useRovingTabIndex(options: UseRovingTabIndexRegistryOptions<number>): UseRovingTabIndexRegistryReturn<number>;
|
|
694
|
+
export declare function useRovingTabIndex<Id extends string | number>(options: UseRovingTabIndexRegistryOptions<Id>): UseRovingTabIndexRegistryReturn<Id>;
|
|
695
|
+
export declare function useRovingTabIndex<Id extends string | number>(options: UseRovingTabIndexRegistryOptions<NoInfer<Id>>): UseRovingTabIndexRegistryReturn<Id>;
|
|
696
|
+
export declare function useRovingTabIndex(options: UseRovingTabIndexOptions): UseRovingTabIndexReturn;
|
|
119
697
|
//# sourceMappingURL=accessibility.d.ts.map
|