@trinityui/design-system 2.11.0 → 2.13.0
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 +2209 -0
- package/CONTRIBUTING.md +180 -69
- package/LICENSE +21 -0
- package/MIGRATION.md +523 -21
- 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 +17230 -9097
- 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 +192 -72
- package/dist/components/AI/AIChainOfThought.d.ts.map +1 -1
- package/dist/components/AI/AIChainOfThought.types.d.ts +296 -34
- 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 +91 -13
- 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 +107 -17
- 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 +52 -5
- 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 +135 -7
- 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 +32 -2
- 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/SandboxedIframeRenderer/SandboxedIframeRenderer.d.ts +48 -4
- package/dist/components/SandboxedIframeRenderer/SandboxedIframeRenderer.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 +6 -0
- package/dist/components/TopNavHeader.d.ts.map +1 -1
- package/dist/components/TopNavWithSidebar.d.ts +49 -1
- 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 +136 -0
- package/dist/components/shared/safeContent.d.ts.map +1 -0
- 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 +13923 -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 +792 -0
- 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/forms.js
CHANGED
|
@@ -1,22 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { jsx as t, jsxs as E } from "react/jsx-runtime";
|
|
2
|
+
import * as A from "react";
|
|
3
|
+
import br, { createElement as yr, useState as Ge, useRef as h, useCallback as re, useEffect as Ve } from "react";
|
|
4
|
+
import { Autocomplete as wr, Paper as nr, ListItem as we, ListItemIcon as de, ListItemText as xe, Popper as xr, Chip as or, TextField as Sr, ListSubheader as Rr, autocompleteClasses as De, Box as T, ButtonBase as Ir, Typography as ue, Alert as Ke, Button as He, Stack as Cr, List as kr, LinearProgress as Er, ListItemSecondaryAction as Or, Tooltip as Lr, IconButton as Pr } from "@mui/material";
|
|
5
|
+
import sr from "@mui/utils/useControlled";
|
|
6
|
+
import { I as pe } from "./app-shell.js";
|
|
7
|
+
import { t as _r, s as ir } from "./foundation.js";
|
|
8
|
+
import $ from "@mui/utils/useEventCallback";
|
|
9
|
+
import Dr from "@mui/utils/useEnhancedEffect";
|
|
10
|
+
import Fr from "@mui/utils/getActiveElement";
|
|
11
|
+
import Mr from "@mui/utils/ownerDocument";
|
|
12
|
+
import Fe from "@mui/icons-material/CloudUpload";
|
|
13
|
+
import Ur from "@mui/icons-material/InsertDriveFile";
|
|
14
|
+
import Ar from "@mui/icons-material/Delete";
|
|
15
|
+
import cr from "@mui/icons-material/CheckCircle";
|
|
16
|
+
import Tr from "@mui/icons-material/Error";
|
|
17
|
+
import zr from "@mui/icons-material/PictureAsPdf";
|
|
18
|
+
import Br from "@mui/icons-material/Image";
|
|
19
|
+
import Wr from "@mui/icons-material/VideoLibrary";
|
|
20
|
+
import $r from "@mui/icons-material/Description";
|
|
21
|
+
import { u as jr } from "./focus-on-replace.js";
|
|
22
|
+
const Je = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, Se = "__trinity_combobox_select_all__", Ae = "__trinity_combobox_create__", Nr = (o) => o.group === "" ? /* @__PURE__ */ t(A.Fragment, { children: o.children }, o.key) : /* @__PURE__ */ E("li", { children: [
|
|
23
|
+
/* @__PURE__ */ t(
|
|
24
|
+
Rr,
|
|
25
|
+
{
|
|
26
|
+
component: "div",
|
|
27
|
+
className: De.groupLabel,
|
|
28
|
+
sx: { backgroundColor: "background.paper", top: -8 },
|
|
29
|
+
children: o.group
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
/* @__PURE__ */ t(
|
|
33
|
+
T,
|
|
34
|
+
{
|
|
35
|
+
component: "ul",
|
|
36
|
+
className: De.groupUl,
|
|
37
|
+
sx: { p: 0, [`& .${De.option}`]: { paddingInlineStart: 3 } },
|
|
38
|
+
children: o.children
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
] }, o.key), Qe = (o) => typeof o == "object" && o !== null && (o.id === Se || o.id === Ae);
|
|
42
|
+
function Xe({ checked: o }) {
|
|
43
|
+
return /* @__PURE__ */ t(T, { component: "span", "aria-hidden": !0, sx: { display: "inline-flex", p: 1.125 }, children: o ? /* @__PURE__ */ t(T, { component: "span", sx: { width: 18, height: 18, border: "2px solid", borderColor: "primary.main", borderRadius: 0.5, backgroundColor: "primary.main", display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ t(pe, { name: "check", size: "xs", color: "primary.contrastText", sx: { width: 14, height: 14 } }) }) : /* @__PURE__ */ t(T, { component: "span", sx: { width: 18, height: 18, border: "2px solid", borderColor: "action.active", borderRadius: 0.5, backgroundColor: "transparent" } }) });
|
|
44
|
+
}
|
|
45
|
+
const qr = (o) => /* @__PURE__ */ t(
|
|
46
|
+
xr,
|
|
18
47
|
{
|
|
19
|
-
...
|
|
48
|
+
...o,
|
|
20
49
|
placement: "bottom-start",
|
|
21
50
|
modifiers: [
|
|
22
51
|
{
|
|
@@ -27,111 +56,119 @@ const xe = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
|
27
56
|
}
|
|
28
57
|
]
|
|
29
58
|
}
|
|
30
|
-
),
|
|
31
|
-
options:
|
|
32
|
-
value:
|
|
33
|
-
defaultValue:
|
|
34
|
-
onChange:
|
|
35
|
-
creatable:
|
|
36
|
-
onCreate:
|
|
37
|
-
createText:
|
|
38
|
-
multiple:
|
|
39
|
-
placeholder:
|
|
40
|
-
label:
|
|
41
|
-
helperText:
|
|
42
|
-
error:
|
|
43
|
-
errorMessage:
|
|
44
|
-
disabled:
|
|
45
|
-
fullWidth:
|
|
46
|
-
size:
|
|
47
|
-
limitTags:
|
|
48
|
-
showCheckbox:
|
|
49
|
-
groupBy:
|
|
50
|
-
loading:
|
|
51
|
-
noOptionsText:
|
|
52
|
-
filterOptions:
|
|
53
|
-
renderOption:
|
|
54
|
-
renderTag:
|
|
55
|
-
freeSolo:
|
|
56
|
-
autoHighlight:
|
|
57
|
-
clearOnEscape:
|
|
58
|
-
showSelectAll:
|
|
59
|
-
selectAllText:
|
|
59
|
+
), Gr = [], gt = /* @__PURE__ */ A.forwardRef(function({
|
|
60
|
+
options: d,
|
|
61
|
+
value: w,
|
|
62
|
+
defaultValue: O,
|
|
63
|
+
onChange: a,
|
|
64
|
+
creatable: x = !1,
|
|
65
|
+
onCreate: D,
|
|
66
|
+
createText: fe = 'Create "{value}"',
|
|
67
|
+
multiple: I = !1,
|
|
68
|
+
placeholder: Re = "Select...",
|
|
69
|
+
label: me,
|
|
70
|
+
helperText: R,
|
|
71
|
+
error: te = !1,
|
|
72
|
+
errorMessage: Ie,
|
|
73
|
+
disabled: he = !1,
|
|
74
|
+
fullWidth: K = !1,
|
|
75
|
+
size: H = "medium",
|
|
76
|
+
limitTags: ne = 3,
|
|
77
|
+
showCheckbox: J = !0,
|
|
78
|
+
groupBy: oe = !1,
|
|
79
|
+
loading: Ce = !1,
|
|
80
|
+
noOptionsText: ke = "No options",
|
|
81
|
+
filterOptions: v,
|
|
82
|
+
renderOption: j,
|
|
83
|
+
renderTag: Q,
|
|
84
|
+
freeSolo: Ee = !1,
|
|
85
|
+
autoHighlight: ge = !0,
|
|
86
|
+
clearOnEscape: X = !0,
|
|
87
|
+
showSelectAll: z = !1,
|
|
88
|
+
selectAllText: N = "Select All",
|
|
60
89
|
className: se,
|
|
61
|
-
sx:
|
|
62
|
-
},
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
90
|
+
sx: B
|
|
91
|
+
}, F) {
|
|
92
|
+
const [L, ie] = A.useState(""), [y, _] = sr({
|
|
93
|
+
controlled: w,
|
|
94
|
+
default: O || Gr,
|
|
95
|
+
name: "Combobox",
|
|
96
|
+
state: "value"
|
|
97
|
+
}), ce = A.useCallback(
|
|
98
|
+
(s, c) => {
|
|
99
|
+
if (v)
|
|
100
|
+
return v(s, c);
|
|
101
|
+
const g = c.inputValue.toLowerCase();
|
|
102
|
+
return s.filter(
|
|
103
|
+
(m) => m.label.toLowerCase().includes(g) || m.secondary?.toLowerCase().includes(g)
|
|
72
104
|
);
|
|
73
105
|
},
|
|
74
|
-
[
|
|
75
|
-
),
|
|
76
|
-
if (!
|
|
77
|
-
const
|
|
78
|
-
(
|
|
79
|
-
),
|
|
80
|
-
(
|
|
106
|
+
[v]
|
|
107
|
+
), q = A.useMemo(() => {
|
|
108
|
+
if (!x || !L.trim()) return !1;
|
|
109
|
+
const s = L.trim().toLowerCase(), c = d.some(
|
|
110
|
+
(m) => m.label.toLowerCase() === s
|
|
111
|
+
), g = y.some(
|
|
112
|
+
(m) => m.label.toLowerCase() === s
|
|
81
113
|
);
|
|
82
|
-
return !
|
|
83
|
-
}, [
|
|
84
|
-
|
|
85
|
-
if (
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
114
|
+
return !c && !g;
|
|
115
|
+
}, [x, L, d, y]), ve = async (s, c, g, m) => {
|
|
116
|
+
const p = m?.option;
|
|
117
|
+
if (Qe(p)) {
|
|
118
|
+
p.id === Se ? W() : ae();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
let u;
|
|
122
|
+
if (I) {
|
|
123
|
+
const U = c || [];
|
|
124
|
+
u = await Promise.all(
|
|
125
|
+
U.map(async (P) => typeof P == "string" ? x && D ? await D(P) : { id: Je(), label: P } : P)
|
|
89
126
|
);
|
|
90
127
|
} else
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
const P =
|
|
95
|
-
return
|
|
96
|
-
}),
|
|
97
|
-
},
|
|
98
|
-
const
|
|
99
|
-
return
|
|
100
|
-
(
|
|
128
|
+
c === null ? u = [] : typeof c == "string" ? x && D ? u = [await D(c)] : u = [{ id: Je(), label: c }] : u = [c];
|
|
129
|
+
const M = /* @__PURE__ */ new Set(), Z = /* @__PURE__ */ new Set();
|
|
130
|
+
u = u.filter((U) => {
|
|
131
|
+
const P = U.label.toLowerCase();
|
|
132
|
+
return M.has(U.id) || Z.has(P) ? !1 : (M.add(U.id), Z.add(P), !0);
|
|
133
|
+
}), _(u), a?.(u);
|
|
134
|
+
}, C = A.useMemo(() => {
|
|
135
|
+
const s = d.filter((c) => !c.disabled);
|
|
136
|
+
return s.length > 0 && s.every(
|
|
137
|
+
(c) => y.some((g) => g.id === c.id)
|
|
101
138
|
);
|
|
102
|
-
}, [
|
|
103
|
-
if (
|
|
104
|
-
|
|
139
|
+
}, [d, y]), W = A.useCallback(() => {
|
|
140
|
+
if (C)
|
|
141
|
+
_([]), a?.([]);
|
|
105
142
|
else {
|
|
106
|
-
const
|
|
107
|
-
|
|
143
|
+
const s = d.filter((c) => !c.disabled);
|
|
144
|
+
_(s), a?.(s);
|
|
108
145
|
}
|
|
109
|
-
}, [
|
|
110
|
-
if (!
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
}, [
|
|
114
|
-
|
|
146
|
+
}, [C, d, a, _]), ae = A.useCallback(async () => {
|
|
147
|
+
if (!q || !D) return;
|
|
148
|
+
const s = await D(L), c = I ? [...y, s] : [s];
|
|
149
|
+
_(c), a?.(c), ie("");
|
|
150
|
+
}, [q, D, L, I, y, a, _]), G = (s) => /* @__PURE__ */ t(
|
|
151
|
+
Sr,
|
|
115
152
|
{
|
|
116
|
-
...
|
|
117
|
-
label:
|
|
118
|
-
placeholder:
|
|
119
|
-
error:
|
|
120
|
-
helperText:
|
|
121
|
-
size:
|
|
153
|
+
...s,
|
|
154
|
+
label: me,
|
|
155
|
+
placeholder: y.length === 0 ? Re : void 0,
|
|
156
|
+
error: te,
|
|
157
|
+
helperText: te ? Ie : R,
|
|
158
|
+
size: H
|
|
122
159
|
}
|
|
123
|
-
),
|
|
124
|
-
const
|
|
125
|
-
return (Array.isArray(
|
|
126
|
-
const
|
|
127
|
-
return
|
|
128
|
-
|
|
160
|
+
), be = (s, c) => {
|
|
161
|
+
const g = c;
|
|
162
|
+
return (Array.isArray(s) ? s : []).map((p, u) => {
|
|
163
|
+
const M = g({ index: u });
|
|
164
|
+
return Q ? Q(p, M.onDelete) : /* @__PURE__ */ yr(
|
|
165
|
+
or,
|
|
129
166
|
{
|
|
130
|
-
...
|
|
131
|
-
key: typeof
|
|
132
|
-
label: typeof
|
|
133
|
-
size:
|
|
134
|
-
deleteIcon: /* @__PURE__ */
|
|
167
|
+
...M,
|
|
168
|
+
key: typeof p == "object" ? p.id : u,
|
|
169
|
+
label: typeof p == "object" ? p.label : String(p),
|
|
170
|
+
size: H,
|
|
171
|
+
deleteIcon: /* @__PURE__ */ t(pe, { name: "close", size: "small" }),
|
|
135
172
|
sx: {
|
|
136
173
|
maxWidth: 150,
|
|
137
174
|
"& .MuiChip-label": {
|
|
@@ -142,398 +179,433 @@ const xe = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
|
142
179
|
}
|
|
143
180
|
);
|
|
144
181
|
});
|
|
145
|
-
},
|
|
146
|
-
(
|
|
147
|
-
const
|
|
148
|
-
return
|
|
149
|
-
u && E && /* @__PURE__ */ f(
|
|
150
|
-
L,
|
|
151
|
-
{
|
|
152
|
-
onMouseDown: (a) => {
|
|
153
|
-
a.preventDefault(), a.stopPropagation();
|
|
154
|
-
},
|
|
155
|
-
onClick: (a) => {
|
|
156
|
-
a.preventDefault(), a.stopPropagation(), v();
|
|
157
|
-
},
|
|
158
|
-
children: [
|
|
159
|
-
/* @__PURE__ */ f(
|
|
160
|
-
ue,
|
|
161
|
-
{
|
|
162
|
-
dense: !0,
|
|
163
|
-
sx: {
|
|
164
|
-
cursor: "pointer",
|
|
165
|
-
"&:hover": {
|
|
166
|
-
backgroundColor: he(X.palette.primary.main, 0.08)
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
children: [
|
|
170
|
-
T && /* @__PURE__ */ e(te, { sx: { minWidth: 36, pointerEvents: "none" }, children: /* @__PURE__ */ e(
|
|
171
|
-
ge,
|
|
172
|
-
{
|
|
173
|
-
icon: /* @__PURE__ */ e(
|
|
174
|
-
L,
|
|
175
|
-
{
|
|
176
|
-
sx: {
|
|
177
|
-
width: 18,
|
|
178
|
-
height: 18,
|
|
179
|
-
border: "2px solid",
|
|
180
|
-
borderColor: "action.active",
|
|
181
|
-
borderRadius: 0.5,
|
|
182
|
-
backgroundColor: "transparent"
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
),
|
|
186
|
-
checkedIcon: /* @__PURE__ */ e(
|
|
187
|
-
L,
|
|
188
|
-
{
|
|
189
|
-
sx: {
|
|
190
|
-
width: 18,
|
|
191
|
-
height: 18,
|
|
192
|
-
border: "2px solid",
|
|
193
|
-
borderColor: "primary.main",
|
|
194
|
-
borderRadius: 0.5,
|
|
195
|
-
backgroundColor: "primary.main",
|
|
196
|
-
display: "flex",
|
|
197
|
-
alignItems: "center",
|
|
198
|
-
justifyContent: "center"
|
|
199
|
-
},
|
|
200
|
-
children: /* @__PURE__ */ e(
|
|
201
|
-
ce,
|
|
202
|
-
{
|
|
203
|
-
sx: {
|
|
204
|
-
width: 14,
|
|
205
|
-
height: 14,
|
|
206
|
-
color: "primary.contrastText"
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
)
|
|
210
|
-
}
|
|
211
|
-
),
|
|
212
|
-
checked: R,
|
|
213
|
-
size: "small",
|
|
214
|
-
disableRipple: !0,
|
|
215
|
-
tabIndex: -1
|
|
216
|
-
}
|
|
217
|
-
) }),
|
|
218
|
-
/* @__PURE__ */ e(
|
|
219
|
-
me,
|
|
220
|
-
{
|
|
221
|
-
primary: R ? "Deselect All" : re,
|
|
222
|
-
slotProps: { primary: {
|
|
223
|
-
variant: "body2",
|
|
224
|
-
sx: { fontWeight: 500 }
|
|
225
|
-
} }
|
|
226
|
-
}
|
|
227
|
-
)
|
|
228
|
-
]
|
|
229
|
-
}
|
|
230
|
-
),
|
|
231
|
-
/* @__PURE__ */ e(ye, {})
|
|
232
|
-
]
|
|
233
|
-
}
|
|
234
|
-
),
|
|
235
|
-
o,
|
|
236
|
-
c && /* @__PURE__ */ f(Se, { children: [
|
|
237
|
-
/* @__PURE__ */ e(ye, {}),
|
|
238
|
-
/* @__PURE__ */ e(
|
|
239
|
-
fe,
|
|
240
|
-
{
|
|
241
|
-
fullWidth: !0,
|
|
242
|
-
startIcon: /* @__PURE__ */ e(Ue, {}),
|
|
243
|
-
onMouseDown: (a) => {
|
|
244
|
-
a.preventDefault();
|
|
245
|
-
},
|
|
246
|
-
onClick: h,
|
|
247
|
-
sx: {
|
|
248
|
-
justifyContent: "flex-start",
|
|
249
|
-
py: 1.5,
|
|
250
|
-
px: 2,
|
|
251
|
-
textTransform: "none",
|
|
252
|
-
color: "primary.main",
|
|
253
|
-
borderRadius: 0,
|
|
254
|
-
"&:hover": {
|
|
255
|
-
backgroundColor: he(X.palette.primary.main, 0.08)
|
|
256
|
-
}
|
|
257
|
-
},
|
|
258
|
-
children: B.replace("{value}", y)
|
|
259
|
-
}
|
|
260
|
-
)
|
|
261
|
-
] })
|
|
262
|
-
] });
|
|
182
|
+
}, le = A.useCallback(
|
|
183
|
+
(s, c) => {
|
|
184
|
+
const g = ce(s, c), m = [];
|
|
185
|
+
return I && z && !c.inputValue && d.some((p) => !p.disabled) && m.push({ id: Se, label: C ? "Deselect All" : N }), m.push(...g), q && m.push({ id: Ae, label: fe.replace("{value}", L) }), m;
|
|
263
186
|
},
|
|
264
|
-
[
|
|
265
|
-
),
|
|
266
|
-
return /* @__PURE__ */
|
|
267
|
-
|
|
187
|
+
[ce, I, z, d, C, N, q, fe, L]
|
|
188
|
+
), Y = d;
|
|
189
|
+
return /* @__PURE__ */ t(
|
|
190
|
+
wr,
|
|
268
191
|
{
|
|
269
|
-
ref:
|
|
192
|
+
ref: F,
|
|
270
193
|
className: se,
|
|
271
|
-
sx: { width:
|
|
272
|
-
multiple:
|
|
273
|
-
options:
|
|
274
|
-
value:
|
|
275
|
-
onChange:
|
|
276
|
-
inputValue:
|
|
277
|
-
onInputChange: (
|
|
278
|
-
getOptionLabel: (
|
|
279
|
-
isOptionEqualToValue: (
|
|
280
|
-
getOptionDisabled: (
|
|
281
|
-
groupBy:
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
194
|
+
sx: _r({ width: K ? "100%" : 300 }, B),
|
|
195
|
+
multiple: I,
|
|
196
|
+
options: Y,
|
|
197
|
+
value: I ? y : y[0] || null,
|
|
198
|
+
onChange: ve,
|
|
199
|
+
inputValue: L,
|
|
200
|
+
onInputChange: (s, c) => ie(c),
|
|
201
|
+
getOptionLabel: (s) => typeof s == "string" ? s : s.label,
|
|
202
|
+
isOptionEqualToValue: (s, c) => s.id === c.id,
|
|
203
|
+
getOptionDisabled: (s) => typeof s == "object" && s.disabled === !0,
|
|
204
|
+
groupBy: oe ? (s) => Qe(s) ? "" : s.group || "" : void 0,
|
|
205
|
+
renderGroup: oe && I && z ? Nr : void 0,
|
|
206
|
+
filterOptions: le,
|
|
207
|
+
renderInput: G,
|
|
208
|
+
renderValue: I ? be : void 0,
|
|
209
|
+
renderOption: (s, c, { selected: g }) => {
|
|
210
|
+
const { key: m, ...p } = s, u = c;
|
|
211
|
+
return u.id === Se ? /* @__PURE__ */ E(we, { ...p, "aria-selected": C, dense: !0, divider: !0, children: [
|
|
212
|
+
J && /* @__PURE__ */ t(de, { sx: { minWidth: 36 }, children: /* @__PURE__ */ t(Xe, { checked: C }) }),
|
|
213
|
+
/* @__PURE__ */ t(
|
|
214
|
+
xe,
|
|
290
215
|
{
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
checked: n,
|
|
294
|
-
size: "small"
|
|
216
|
+
primary: u.label,
|
|
217
|
+
slotProps: { primary: { variant: "body2", sx: { fontWeight: 500 } } }
|
|
295
218
|
}
|
|
296
|
-
)
|
|
297
|
-
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
|
|
219
|
+
)
|
|
220
|
+
] }, m) : u.id === Ae ? /* @__PURE__ */ E(we, { ...p, "aria-selected": !1, dense: !0, sx: { color: "primary.main" }, children: [
|
|
221
|
+
/* @__PURE__ */ t(de, { sx: { minWidth: 36, color: "inherit" }, children: /* @__PURE__ */ t(pe, { name: "add", size: "small" }) }),
|
|
222
|
+
/* @__PURE__ */ t(xe, { primary: u.label, slotProps: { primary: { variant: "body2" } } })
|
|
223
|
+
] }, m) : j ? /* @__PURE__ */ t("li", { ...p, children: j(u, { selected: g }) }, m) : /* @__PURE__ */ E(we, { ...p, dense: !0, children: [
|
|
224
|
+
I && J && /* @__PURE__ */ t(de, { sx: { minWidth: 36 }, children: /* @__PURE__ */ t(Xe, { checked: g }) }),
|
|
225
|
+
u.icon && /* @__PURE__ */ t(de, { sx: { minWidth: 36 }, children: u.icon }),
|
|
226
|
+
/* @__PURE__ */ t(
|
|
227
|
+
xe,
|
|
300
228
|
{
|
|
301
|
-
primary:
|
|
302
|
-
secondary:
|
|
229
|
+
primary: u.label,
|
|
230
|
+
secondary: u.secondary,
|
|
303
231
|
slotProps: { primary: { variant: "body2" }, secondary: { variant: "caption" } }
|
|
304
232
|
}
|
|
305
233
|
),
|
|
306
|
-
!
|
|
307
|
-
] },
|
|
234
|
+
!I && g && /* @__PURE__ */ t(pe, { name: "check", size: "small", color: "primary.main", sx: { marginInlineStart: 1 } })
|
|
235
|
+
] }, m);
|
|
308
236
|
},
|
|
309
237
|
slots: {
|
|
310
|
-
paper:
|
|
311
|
-
popper:
|
|
238
|
+
paper: nr,
|
|
239
|
+
popper: qr
|
|
312
240
|
},
|
|
313
|
-
limitTags:
|
|
314
|
-
disabled:
|
|
315
|
-
loading:
|
|
316
|
-
noOptionsText:
|
|
317
|
-
freeSolo:
|
|
318
|
-
autoHighlight:
|
|
319
|
-
clearOnEscape:
|
|
320
|
-
disableCloseOnSelect:
|
|
321
|
-
slotProps: { chip: { size:
|
|
241
|
+
limitTags: ne,
|
|
242
|
+
disabled: he,
|
|
243
|
+
loading: Ce,
|
|
244
|
+
noOptionsText: ke,
|
|
245
|
+
freeSolo: Ee || x,
|
|
246
|
+
autoHighlight: ge,
|
|
247
|
+
clearOnEscape: X,
|
|
248
|
+
disableCloseOnSelect: I,
|
|
249
|
+
slotProps: { chip: { size: H, deleteIcon: /* @__PURE__ */ t(pe, { name: "close", size: "small" }) } }
|
|
322
250
|
}
|
|
323
251
|
);
|
|
324
|
-
}),
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
252
|
+
}), Ye = {
|
|
253
|
+
uploading: ({ name: o }) => `Uploading ${o}`,
|
|
254
|
+
remove: ({ name: o }) => `Remove ${o}`
|
|
255
|
+
}, ar = (o) => {
|
|
256
|
+
if (o === 0) return "0 Bytes";
|
|
257
|
+
const d = 1024, w = ["Bytes", "KB", "MB", "GB"], O = Math.floor(Math.log(o) / Math.log(d));
|
|
258
|
+
return parseFloat((o / Math.pow(d, O)).toFixed(2)) + " " + w[O];
|
|
259
|
+
}, lr = (o) => o.startsWith("image/") ? /* @__PURE__ */ t(Br, {}) : o.startsWith("video/") ? /* @__PURE__ */ t(Wr, {}) : o === "application/pdf" ? /* @__PURE__ */ t(zr, {}) : o.includes("document") || o.includes("text") ? /* @__PURE__ */ t($r, {}) : /* @__PURE__ */ t(Ur, {}), Vr = () => `file-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, Ze = 200, Kr = 10, Hr = 90, er = [], Te = (o, d) => Object.keys(d).every((w) => o[w] === d[w]), Me = (o) => JSON.stringify([o.status, o.progress, o.error ?? null, o.preview ?? null]), rr = (o) => JSON.stringify(o.map((d) => d.id)), Ue = (o, d) => {
|
|
260
|
+
if (d.size === 0) return o;
|
|
261
|
+
let w = !1;
|
|
262
|
+
const O = o.map((a) => {
|
|
263
|
+
const x = d.get(a.id);
|
|
264
|
+
return x === void 0 || Te(a, x) ? a : (w = !0, { ...a, ...x });
|
|
265
|
+
});
|
|
266
|
+
return w ? O : o;
|
|
267
|
+
}, vt = /* @__PURE__ */ br.forwardRef(function({
|
|
268
|
+
variant: d = "dropzone",
|
|
269
|
+
accept: w,
|
|
270
|
+
multiple: O = !1,
|
|
271
|
+
maxSize: a,
|
|
272
|
+
maxFiles: x,
|
|
273
|
+
files: D,
|
|
274
|
+
onFilesChange: fe,
|
|
275
|
+
onFileSelect: I,
|
|
276
|
+
onFileRemove: Re,
|
|
277
|
+
onUpload: me,
|
|
278
|
+
disabled: R = !1,
|
|
279
|
+
helperText: te,
|
|
280
|
+
error: Ie,
|
|
281
|
+
showFileList: he = !0,
|
|
282
|
+
size: K = "medium",
|
|
283
|
+
labels: H,
|
|
284
|
+
sx: ne
|
|
285
|
+
}, J) {
|
|
286
|
+
const oe = {
|
|
287
|
+
uploading: H?.uploading ?? Ye.uploading,
|
|
288
|
+
remove: H?.remove ?? Ye.remove
|
|
289
|
+
}, [Ce, ke] = sr({
|
|
290
|
+
controlled: D,
|
|
291
|
+
default: er,
|
|
292
|
+
name: "FileUpload",
|
|
293
|
+
state: "files"
|
|
294
|
+
}), v = Ce ?? er, [j, Q] = Ge(!1), [Ee, ge] = Ge(null), X = h(null), z = h(v), N = h(null), se = h(!1), B = h(/* @__PURE__ */ new Map()), F = h(/* @__PURE__ */ new Set()), L = h(/* @__PURE__ */ new Map()), ie = h(v), y = h(null), _ = h(0), ce = h(/* @__PURE__ */ new WeakMap()), q = h(0), ve = h(""), C = h(!1), W = h(/* @__PURE__ */ new Map()), ae = h(/* @__PURE__ */ new Set()), G = h(/* @__PURE__ */ new Set()), be = h(/* @__PURE__ */ new Set()), le = h(/* @__PURE__ */ new Set()), Y = h(/* @__PURE__ */ new Map()), s = h(null), c = re((e) => {
|
|
295
|
+
s.current = e;
|
|
296
|
+
}, []), g = (e) => (r) => {
|
|
297
|
+
r ? Y.current.set(e, r) : Y.current.delete(e);
|
|
298
|
+
}, { focusAfterCommit: m } = jr(), p = () => N.current ?? z.current, u = () => y.current !== null && N.current === null, M = () => {
|
|
299
|
+
y.current !== null && (clearTimeout(y.current), y.current = null);
|
|
300
|
+
}, Z = $((e) => {
|
|
301
|
+
N.current = e, se.current || (se.current = !0, queueMicrotask(() => {
|
|
302
|
+
se.current = !1, N.current = null;
|
|
303
|
+
}));
|
|
304
|
+
const r = L.current;
|
|
305
|
+
e.forEach((n) => {
|
|
306
|
+
F.current.delete(n.id);
|
|
307
|
+
const i = r.get(n.id);
|
|
308
|
+
i === void 0 ? r.set(n.id, /* @__PURE__ */ new Set([Me(n)])) : i.add(Me(n));
|
|
309
|
+
}), ie.current = e, _.current += 1, ce.current.set(e, _.current), ke(e), fe?.(e);
|
|
310
|
+
}), U = (e) => {
|
|
311
|
+
if (!C.current) return;
|
|
312
|
+
const r = p(), n = e(r);
|
|
313
|
+
n !== r && (M(), q.current = _.current + 1, ve.current = rr(z.current), y.current = setTimeout(() => {
|
|
314
|
+
y.current = null, Oe();
|
|
315
|
+
}, Ze), Z(Ue(n, B.current)));
|
|
316
|
+
}, P = (e, r) => {
|
|
317
|
+
const n = p(), i = n.find((k) => k.id === e), l = B.current, S = l.get(e), f = i && S ? { ...i, ...S } : i;
|
|
318
|
+
let b;
|
|
319
|
+
if (typeof r == "function") {
|
|
320
|
+
if (f === void 0) return !1;
|
|
321
|
+
b = r(f);
|
|
322
|
+
} else
|
|
323
|
+
b = r;
|
|
324
|
+
if (b === null || f !== void 0 && Te(f, b))
|
|
325
|
+
return i !== void 0;
|
|
326
|
+
if (l.set(e, { ...S, ...b }), F.current.add(e), C.current && i !== void 0 && !u()) {
|
|
327
|
+
const k = Ue(n, l);
|
|
328
|
+
k !== n ? Z(k) : F.current.delete(e);
|
|
329
|
+
}
|
|
330
|
+
return i !== void 0;
|
|
331
|
+
}, ze = (e) => {
|
|
332
|
+
const r = W.current.get(e);
|
|
333
|
+
r !== void 0 && (clearInterval(r), W.current.delete(e));
|
|
334
|
+
}, Be = (e) => {
|
|
335
|
+
const r = W.current;
|
|
336
|
+
if (!C.current || r.has(e)) return;
|
|
337
|
+
const n = setInterval(() => {
|
|
338
|
+
P(
|
|
339
|
+
e,
|
|
340
|
+
(l) => l.progress < Hr ? { progress: l.progress + Kr } : null
|
|
341
|
+
) || ze(e);
|
|
342
|
+
}, Ze);
|
|
343
|
+
r.set(e, n);
|
|
344
|
+
}, We = (e) => {
|
|
345
|
+
const r = URL.createObjectURL(e);
|
|
346
|
+
return G.current.add(r), r;
|
|
347
|
+
}, $e = $(() => {
|
|
348
|
+
if (!C.current) return;
|
|
349
|
+
const e = p();
|
|
350
|
+
ae.current.forEach((r) => {
|
|
351
|
+
if (W.current.has(r)) return;
|
|
352
|
+
const n = e.find((l) => l.id === r);
|
|
353
|
+
if (n === void 0) return;
|
|
354
|
+
(B.current.get(r)?.status ?? n.status) === "uploading" && Be(r);
|
|
355
|
+
});
|
|
356
|
+
}), Oe = $(() => {
|
|
357
|
+
const e = F.current;
|
|
358
|
+
if (!C.current || e.size === 0 || u()) return;
|
|
359
|
+
const r = p();
|
|
360
|
+
if (!r.some((i) => e.has(i.id))) return;
|
|
361
|
+
const n = Ue(r, B.current);
|
|
362
|
+
n !== r ? Z(n) : r.forEach((i) => e.delete(i.id));
|
|
363
|
+
}), je = $((e) => {
|
|
364
|
+
const r = z.current;
|
|
365
|
+
if (z.current = e, y.current !== null) {
|
|
366
|
+
const f = ce.current.get(e);
|
|
367
|
+
(f === void 0 ? rr(e) !== ve.current : f >= q.current) && M();
|
|
368
|
+
}
|
|
369
|
+
const n = B.current, i = L.current, l = new Map(e.map((f) => [f.id, f])), S = new Set(ie.current.map((f) => f.id));
|
|
370
|
+
if (n.size > 0) {
|
|
371
|
+
const f = new Map(r.map((b) => [b.id, b]));
|
|
372
|
+
n.forEach((b, k) => {
|
|
373
|
+
const ee = l.get(k), vr = ee !== void 0 && f.has(k) && f.get(k) !== ee && !F.current.has(k) && !i.get(k)?.has(Me(ee));
|
|
374
|
+
(ee === void 0 && !S.has(k) || vr || ee !== void 0 && Te(ee, b)) && (n.delete(k), F.current.delete(k));
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
i.size > 0 && i.forEach((f, b) => {
|
|
378
|
+
!l.has(b) && !S.has(b) && i.delete(b);
|
|
379
|
+
}), $e(), Oe();
|
|
380
|
+
});
|
|
381
|
+
Dr(() => {
|
|
382
|
+
je(v);
|
|
383
|
+
}, [v, je]);
|
|
384
|
+
const Ne = $(() => {
|
|
385
|
+
C.current = !0;
|
|
386
|
+
const e = be.current;
|
|
387
|
+
if (e.size > 0) {
|
|
388
|
+
const r = B.current;
|
|
389
|
+
p().forEach((n) => {
|
|
390
|
+
const i = r.get(n.id)?.preview ?? n.preview;
|
|
391
|
+
i === void 0 || !e.has(i) || (r.set(n.id, { ...r.get(n.id), preview: We(n.file) }), F.current.add(n.id));
|
|
392
|
+
}), e.clear();
|
|
393
|
+
}
|
|
394
|
+
$e(), Oe();
|
|
395
|
+
}), qe = $(() => {
|
|
396
|
+
C.current = !1, M(), W.current.forEach((e) => clearInterval(e)), W.current.clear(), G.current.forEach((e) => {
|
|
397
|
+
URL.revokeObjectURL(e), be.current.add(e);
|
|
398
|
+
}), G.current.clear(), le.current = /* @__PURE__ */ new Set();
|
|
399
|
+
});
|
|
400
|
+
Ve(() => (Ne(), qe), [Ne, qe]), Ve(() => {
|
|
401
|
+
const e = G.current, r = /* @__PURE__ */ new Set();
|
|
402
|
+
v.forEach((n) => {
|
|
403
|
+
n.preview !== void 0 && e.has(n.preview) && r.add(n.preview);
|
|
404
|
+
}), le.current.forEach((n) => {
|
|
405
|
+
r.has(n) || (URL.revokeObjectURL(n), e.delete(n));
|
|
406
|
+
}), le.current = r;
|
|
407
|
+
}, [v]);
|
|
408
|
+
const dr = (e) => a && e.size > a ? `File "${e.name}" exceeds maximum size of ${ar(a)}` : x && p().length >= x ? `Maximum ${x} files allowed` : null, ye = $(
|
|
409
|
+
async (e) => {
|
|
410
|
+
const r = Array.from(e), n = [], i = [];
|
|
411
|
+
for (const l of r) {
|
|
412
|
+
const S = dr(l);
|
|
413
|
+
if (S) {
|
|
414
|
+
i.push(S);
|
|
355
415
|
continue;
|
|
356
416
|
}
|
|
357
|
-
const
|
|
358
|
-
id:
|
|
359
|
-
file:
|
|
360
|
-
name:
|
|
361
|
-
size:
|
|
362
|
-
type:
|
|
417
|
+
const f = {
|
|
418
|
+
id: Vr(),
|
|
419
|
+
file: l,
|
|
420
|
+
name: l.name,
|
|
421
|
+
size: l.size,
|
|
422
|
+
type: l.type,
|
|
363
423
|
progress: 0,
|
|
364
424
|
status: "pending",
|
|
365
|
-
preview:
|
|
425
|
+
preview: l.type.startsWith("image/") ? We(l) : void 0
|
|
366
426
|
};
|
|
367
|
-
|
|
368
|
-
}
|
|
369
|
-
if (R.length > 0 ? Q(R[0]) : Q(null), D.length > 0) {
|
|
370
|
-
const v = S ? [...g, ...D] : D;
|
|
371
|
-
if (C(v), u?.(D.map((h) => h.file)), q)
|
|
372
|
-
for (const h of D)
|
|
373
|
-
try {
|
|
374
|
-
C(
|
|
375
|
-
(F) => F.map(
|
|
376
|
-
(i) => i.id === h.id ? { ...i, status: "uploading" } : i
|
|
377
|
-
)
|
|
378
|
-
);
|
|
379
|
-
const W = setInterval(() => {
|
|
380
|
-
C(
|
|
381
|
-
(F) => F.map(
|
|
382
|
-
(i) => i.id === h.id && i.progress < 90 ? { ...i, progress: i.progress + 10 } : i
|
|
383
|
-
)
|
|
384
|
-
);
|
|
385
|
-
}, 200);
|
|
386
|
-
await q(h.file), clearInterval(W), C(
|
|
387
|
-
(F) => F.map(
|
|
388
|
-
(i) => i.id === h.id ? { ...i, status: "complete", progress: 100 } : i
|
|
389
|
-
)
|
|
390
|
-
);
|
|
391
|
-
} catch (W) {
|
|
392
|
-
C(
|
|
393
|
-
(F) => F.map(
|
|
394
|
-
(i) => i.id === h.id ? {
|
|
395
|
-
...i,
|
|
396
|
-
status: "error",
|
|
397
|
-
error: W instanceof Error ? W.message : "Upload failed"
|
|
398
|
-
} : i
|
|
399
|
-
)
|
|
400
|
-
);
|
|
401
|
-
}
|
|
427
|
+
n.push(f);
|
|
402
428
|
}
|
|
429
|
+
if (i.length > 0 ? ge(i[0]) : ge(null), n.length > 0 && (U((l) => O ? [...l, ...n] : n), I?.(n.map((l) => l.file)), me))
|
|
430
|
+
for (const l of n) {
|
|
431
|
+
const { id: S } = l;
|
|
432
|
+
ae.current.add(S), P(S, { status: "uploading" }), Be(S);
|
|
433
|
+
let f;
|
|
434
|
+
try {
|
|
435
|
+
await me(l.file), f = { status: "complete", progress: 100 };
|
|
436
|
+
} catch (b) {
|
|
437
|
+
f = {
|
|
438
|
+
status: "error",
|
|
439
|
+
error: b instanceof Error ? b.message : "Upload failed"
|
|
440
|
+
};
|
|
441
|
+
} finally {
|
|
442
|
+
ae.current.delete(S), ze(S);
|
|
443
|
+
}
|
|
444
|
+
P(S, f);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
), ur = re((e) => {
|
|
448
|
+
e.preventDefault(), e.stopPropagation(), R || Q(!0);
|
|
449
|
+
}, [R]), pr = re((e) => {
|
|
450
|
+
e.preventDefault(), e.stopPropagation(), Q(!1);
|
|
451
|
+
}, []), fr = re((e) => {
|
|
452
|
+
e.preventDefault(), e.stopPropagation();
|
|
453
|
+
}, []), mr = re(
|
|
454
|
+
(e) => {
|
|
455
|
+
if (e.preventDefault(), e.stopPropagation(), Q(!1), R) return;
|
|
456
|
+
const r = e.dataTransfer.files;
|
|
457
|
+
r.length > 0 && ye(r);
|
|
403
458
|
},
|
|
404
|
-
[
|
|
405
|
-
),
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
}, []), ae = A((r) => {
|
|
410
|
-
r.preventDefault(), r.stopPropagation();
|
|
411
|
-
}, []), ie = A(
|
|
412
|
-
(r) => {
|
|
413
|
-
if (r.preventDefault(), r.stopPropagation(), H(!1), l) return;
|
|
414
|
-
const c = r.dataTransfer.files;
|
|
415
|
-
c.length > 0 && E(c);
|
|
416
|
-
},
|
|
417
|
-
[l, E]
|
|
418
|
-
), X = A(
|
|
419
|
-
(r) => {
|
|
420
|
-
const c = r.target.files;
|
|
421
|
-
c && c.length > 0 && E(c), $.current && ($.current.value = "");
|
|
422
|
-
},
|
|
423
|
-
[E]
|
|
424
|
-
), y = A(
|
|
425
|
-
(r) => {
|
|
426
|
-
r.preview && URL.revokeObjectURL(r.preview);
|
|
427
|
-
const c = g.filter((D) => D.id !== r.id);
|
|
428
|
-
C(c), Y?.(r);
|
|
459
|
+
[R, ye]
|
|
460
|
+
), hr = re(
|
|
461
|
+
(e) => {
|
|
462
|
+
const r = e.target.files;
|
|
463
|
+
r && r.length > 0 && ye(r), X.current && (X.current.value = "");
|
|
429
464
|
},
|
|
430
|
-
[
|
|
431
|
-
),
|
|
432
|
-
|
|
433
|
-
|
|
465
|
+
[ye]
|
|
466
|
+
), gr = (e) => {
|
|
467
|
+
const r = v.findIndex((i) => i.id === e);
|
|
468
|
+
if (r === -1) return;
|
|
469
|
+
const n = [...v.slice(r + 1), ...v.slice(0, r).reverse()].map(
|
|
470
|
+
(i) => i.id
|
|
471
|
+
);
|
|
472
|
+
n.length === 0 && R && d !== "dropzone" || m(() => {
|
|
473
|
+
for (const i of n) {
|
|
474
|
+
const l = Y.current.get(i);
|
|
475
|
+
if (l?.isConnected) return l;
|
|
476
|
+
}
|
|
477
|
+
return s.current;
|
|
478
|
+
});
|
|
479
|
+
}, Le = $((e) => {
|
|
480
|
+
const r = Y.current.get(e.id);
|
|
481
|
+
r?.contains(Fr(Mr(r))) && gr(e.id), e.preview && !G.current.has(e.preview) && URL.revokeObjectURL(e.preview), U(
|
|
482
|
+
(n) => n.some((i) => i.id === e.id) ? n.filter((i) => i.id !== e.id) : n
|
|
483
|
+
), Re?.(e);
|
|
484
|
+
}), Pe = () => {
|
|
485
|
+
X.current?.click();
|
|
486
|
+
}, V = Ie || Ee, _e = /* @__PURE__ */ t(
|
|
434
487
|
"input",
|
|
435
488
|
{
|
|
436
|
-
ref:
|
|
489
|
+
ref: X,
|
|
437
490
|
type: "file",
|
|
438
|
-
accept:
|
|
439
|
-
multiple:
|
|
440
|
-
onChange:
|
|
491
|
+
accept: w,
|
|
492
|
+
multiple: O,
|
|
493
|
+
onChange: hr,
|
|
441
494
|
style: { display: "none" },
|
|
442
|
-
disabled:
|
|
495
|
+
disabled: R
|
|
443
496
|
}
|
|
444
|
-
), k = A(
|
|
445
|
-
(r) => {
|
|
446
|
-
(r.key === "Enter" || r.key === " ") && !l && (r.preventDefault(), U());
|
|
447
|
-
},
|
|
448
|
-
[l]
|
|
449
497
|
);
|
|
450
|
-
return
|
|
451
|
-
|
|
452
|
-
/* @__PURE__ */
|
|
453
|
-
|
|
498
|
+
return d === "dropzone" ? /* @__PURE__ */ E(T, { ref: J, sx: ne, children: [
|
|
499
|
+
_e,
|
|
500
|
+
/* @__PURE__ */ E(
|
|
501
|
+
Ir,
|
|
454
502
|
{
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
503
|
+
component: nr,
|
|
504
|
+
disableRipple: !0,
|
|
505
|
+
ref: c,
|
|
506
|
+
disabled: R,
|
|
507
|
+
"aria-label": `Upload files${w ? `. Accepted formats: ${w}` : ""}. Drag and drop or press Enter to browse`,
|
|
508
|
+
onDragEnter: ur,
|
|
509
|
+
onDragLeave: pr,
|
|
510
|
+
onDragOver: fr,
|
|
511
|
+
onDrop: mr,
|
|
512
|
+
onClick: Pe,
|
|
465
513
|
sx: {
|
|
466
|
-
|
|
514
|
+
// ButtonBase lays out inline-flex; the zone stacks its content as before.
|
|
515
|
+
display: "flex",
|
|
516
|
+
flexDirection: "column",
|
|
517
|
+
alignItems: "center",
|
|
518
|
+
width: "100%",
|
|
519
|
+
p: K === "small" ? 3 : 4,
|
|
467
520
|
border: "2px dashed",
|
|
468
|
-
borderColor:
|
|
469
|
-
borderRadius:
|
|
470
|
-
bgcolor:
|
|
521
|
+
borderColor: V ? "error.main" : j ? "primary.main" : "divider",
|
|
522
|
+
borderRadius: ir.borders.radiusPx.lg,
|
|
523
|
+
bgcolor: j ? "action.hover" : R ? "action.disabledBackground" : "background.paper",
|
|
471
524
|
textAlign: "center",
|
|
472
|
-
cursor:
|
|
525
|
+
cursor: R ? "not-allowed" : "pointer",
|
|
473
526
|
transition: "all 0.2s ease",
|
|
474
527
|
"&:hover": {
|
|
475
|
-
bgcolor:
|
|
476
|
-
borderColor:
|
|
528
|
+
bgcolor: R ? void 0 : "action.hover",
|
|
529
|
+
borderColor: R ? void 0 : "primary.main"
|
|
477
530
|
}
|
|
478
531
|
},
|
|
479
532
|
children: [
|
|
480
|
-
/* @__PURE__ */
|
|
481
|
-
|
|
533
|
+
/* @__PURE__ */ t(
|
|
534
|
+
Fe,
|
|
482
535
|
{
|
|
483
536
|
sx: {
|
|
484
|
-
fontSize:
|
|
485
|
-
color:
|
|
537
|
+
fontSize: K === "small" ? 40 : 56,
|
|
538
|
+
color: j ? "primary.main" : "action.active",
|
|
486
539
|
mb: 2
|
|
487
540
|
}
|
|
488
541
|
}
|
|
489
542
|
),
|
|
490
|
-
/* @__PURE__ */
|
|
491
|
-
/* @__PURE__ */
|
|
492
|
-
|
|
543
|
+
/* @__PURE__ */ t(ue, { variant: K === "small" ? "body1" : "h6", gutterBottom: !0, children: j ? "Drop files here" : "Drag & drop files here" }),
|
|
544
|
+
/* @__PURE__ */ t(ue, { variant: "body2", color: "textSecondary", gutterBottom: !0, children: "or click to browse" }),
|
|
545
|
+
te && /* @__PURE__ */ t(ue, { variant: "caption", color: "textSecondary", children: te })
|
|
493
546
|
]
|
|
494
547
|
}
|
|
495
548
|
),
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
z,
|
|
500
|
-
/* @__PURE__ */ f(
|
|
501
|
-
fe,
|
|
549
|
+
V && /* @__PURE__ */ t(Ke, { severity: "error", sx: { mt: 2 }, children: V }),
|
|
550
|
+
he && v.length > 0 && /* @__PURE__ */ t(
|
|
551
|
+
tr,
|
|
502
552
|
{
|
|
553
|
+
files: v,
|
|
554
|
+
onRemove: Le,
|
|
555
|
+
labels: oe,
|
|
556
|
+
removeButtonRef: g
|
|
557
|
+
}
|
|
558
|
+
)
|
|
559
|
+
] }) : d === "button" ? /* @__PURE__ */ E(T, { ref: J, sx: ne, children: [
|
|
560
|
+
_e,
|
|
561
|
+
/* @__PURE__ */ E(
|
|
562
|
+
He,
|
|
563
|
+
{
|
|
564
|
+
ref: c,
|
|
503
565
|
variant: "contained",
|
|
504
|
-
startIcon: /* @__PURE__ */
|
|
505
|
-
onClick:
|
|
506
|
-
disabled:
|
|
507
|
-
size:
|
|
566
|
+
startIcon: /* @__PURE__ */ t(Fe, {}),
|
|
567
|
+
onClick: Pe,
|
|
568
|
+
disabled: R,
|
|
569
|
+
size: K,
|
|
508
570
|
children: [
|
|
509
571
|
"Upload ",
|
|
510
|
-
|
|
572
|
+
O ? "Files" : "File"
|
|
511
573
|
]
|
|
512
574
|
}
|
|
513
575
|
),
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
576
|
+
V && /* @__PURE__ */ t(Ke, { severity: "error", sx: { mt: 2 }, children: V }),
|
|
577
|
+
he && v.length > 0 && /* @__PURE__ */ t(
|
|
578
|
+
tr,
|
|
579
|
+
{
|
|
580
|
+
files: v,
|
|
581
|
+
onRemove: Le,
|
|
582
|
+
labels: oe,
|
|
583
|
+
removeButtonRef: g
|
|
584
|
+
}
|
|
585
|
+
)
|
|
586
|
+
] }) : /* @__PURE__ */ E(T, { ref: J, sx: ne, children: [
|
|
587
|
+
_e,
|
|
588
|
+
/* @__PURE__ */ E(Cr, { direction: "row", spacing: 1, useFlexGap: !0, sx: { alignItems: "center", flexWrap: "wrap" }, children: [
|
|
589
|
+
/* @__PURE__ */ t(
|
|
590
|
+
He,
|
|
521
591
|
{
|
|
592
|
+
ref: c,
|
|
522
593
|
variant: "outlined",
|
|
523
594
|
size: "small",
|
|
524
|
-
startIcon: /* @__PURE__ */
|
|
525
|
-
onClick:
|
|
526
|
-
disabled:
|
|
595
|
+
startIcon: /* @__PURE__ */ t(Fe, {}),
|
|
596
|
+
onClick: Pe,
|
|
597
|
+
disabled: R,
|
|
527
598
|
children: "Browse"
|
|
528
599
|
}
|
|
529
600
|
),
|
|
530
|
-
|
|
531
|
-
|
|
601
|
+
v.map((e) => /* @__PURE__ */ t(
|
|
602
|
+
or,
|
|
532
603
|
{
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
604
|
+
ref: g(e.id),
|
|
605
|
+
icon: e.status === "complete" ? /* @__PURE__ */ t(cr, {}) : lr(e.type),
|
|
606
|
+
label: e.name,
|
|
607
|
+
onDelete: () => Le(e),
|
|
608
|
+
color: e.status === "error" ? "error" : e.status === "complete" ? "success" : "default",
|
|
537
609
|
size: "small",
|
|
538
610
|
sx: {
|
|
539
611
|
maxWidth: 200,
|
|
@@ -543,50 +615,70 @@ const xe = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
|
543
615
|
}
|
|
544
616
|
}
|
|
545
617
|
},
|
|
546
|
-
|
|
618
|
+
e.id
|
|
547
619
|
))
|
|
548
620
|
] }),
|
|
549
|
-
|
|
621
|
+
V && /* @__PURE__ */ t(ue, { variant: "caption", color: "error", sx: { mt: 0.5, display: "block" }, children: V })
|
|
550
622
|
] });
|
|
551
|
-
}),
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
623
|
+
}), tr = ({ files: o, onRemove: d, labels: w, removeButtonRef: O }) => /* @__PURE__ */ t(kr, { dense: !0, sx: { mt: 2 }, children: o.map((a) => {
|
|
624
|
+
const x = w.remove({ name: a.name });
|
|
625
|
+
return /* @__PURE__ */ E(
|
|
626
|
+
we,
|
|
627
|
+
{
|
|
628
|
+
sx: {
|
|
629
|
+
bgcolor: "background.paper",
|
|
630
|
+
borderRadius: ir.borders.radiusPx.md,
|
|
631
|
+
mb: 1,
|
|
632
|
+
border: "1px solid",
|
|
633
|
+
borderColor: a.status === "error" ? "error.light" : "divider"
|
|
634
|
+
},
|
|
635
|
+
children: [
|
|
636
|
+
/* @__PURE__ */ t(de, { children: a.status === "complete" ? /* @__PURE__ */ t(cr, { color: "success" }) : a.status === "error" ? /* @__PURE__ */ t(Tr, { color: "error" }) : lr(a.type) }),
|
|
637
|
+
/* @__PURE__ */ t(
|
|
638
|
+
xe,
|
|
639
|
+
{
|
|
640
|
+
primary: a.name,
|
|
641
|
+
secondary: /* @__PURE__ */ E(T, { component: "span", children: [
|
|
642
|
+
ar(a.size),
|
|
643
|
+
a.error && /* @__PURE__ */ E(ue, { component: "span", color: "error", sx: { ml: 1 }, children: [
|
|
644
|
+
"• ",
|
|
645
|
+
a.error
|
|
646
|
+
] })
|
|
647
|
+
] }),
|
|
648
|
+
sx: {
|
|
649
|
+
"& .MuiListItemText-primary": {
|
|
650
|
+
overflow: "hidden",
|
|
651
|
+
textOverflow: "ellipsis",
|
|
652
|
+
whiteSpace: "nowrap"
|
|
653
|
+
}
|
|
579
654
|
}
|
|
580
655
|
}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
656
|
+
),
|
|
657
|
+
a.status === "uploading" && /* @__PURE__ */ t(T, { sx: { width: 100, mr: 2 }, children: /* @__PURE__ */ t(
|
|
658
|
+
Er,
|
|
659
|
+
{
|
|
660
|
+
variant: "determinate",
|
|
661
|
+
value: a.progress,
|
|
662
|
+
"aria-label": w.uploading({ name: a.name })
|
|
663
|
+
}
|
|
664
|
+
) }),
|
|
665
|
+
/* @__PURE__ */ t(Or, { children: /* @__PURE__ */ t(Lr, { title: x, children: /* @__PURE__ */ t(
|
|
666
|
+
Pr,
|
|
667
|
+
{
|
|
668
|
+
ref: O(a.id),
|
|
669
|
+
edge: "end",
|
|
670
|
+
"aria-label": x,
|
|
671
|
+
onClick: () => d(a),
|
|
672
|
+
size: "small",
|
|
673
|
+
children: /* @__PURE__ */ t(Ar, { fontSize: "small" })
|
|
674
|
+
}
|
|
675
|
+
) }) })
|
|
676
|
+
]
|
|
677
|
+
},
|
|
678
|
+
a.id
|
|
679
|
+
);
|
|
680
|
+
}) });
|
|
589
681
|
export {
|
|
590
|
-
|
|
591
|
-
|
|
682
|
+
gt as C,
|
|
683
|
+
vt as F
|
|
592
684
|
};
|