@lincyaw/aegis-ui 0.10.0 → 0.12.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/dist/agent/ask/AskPanel.cjs +1 -1
- package/dist/agent/ask/AskPanel.cjs.map +1 -1
- package/dist/agent/ask/AskPanel.d.ts +5 -0
- package/dist/agent/ask/AskPanel.js +105 -98
- package/dist/agent/ask/AskPanel.js.map +1 -1
- package/dist/commands/commandContext.cjs.map +1 -1
- package/dist/commands/commandContext.d.ts +4 -1
- package/dist/commands/commandContext.js.map +1 -1
- package/dist/components/ui/AgentPanel.cjs +1 -1
- package/dist/components/ui/AgentPanel.cjs.map +1 -1
- package/dist/components/ui/AgentPanel.js +15 -14
- package/dist/components/ui/AgentPanel.js.map +1 -1
- package/dist/components/ui/Avatar.cjs +1 -1
- package/dist/components/ui/Avatar.cjs.map +1 -1
- package/dist/components/ui/Avatar.js +21 -19
- package/dist/components/ui/Avatar.js.map +1 -1
- package/dist/components/ui/BlastRadiusBar.cjs +1 -1
- package/dist/components/ui/BlastRadiusBar.cjs.map +1 -1
- package/dist/components/ui/BlastRadiusBar.d.ts +16 -4
- package/dist/components/ui/BlastRadiusBar.js +27 -23
- package/dist/components/ui/BlastRadiusBar.js.map +1 -1
- package/dist/components/ui/Button.cjs.map +1 -1
- package/dist/components/ui/Button.d.ts +4 -2
- package/dist/components/ui/Button.js.map +1 -1
- package/dist/components/ui/ChatComposer.cjs +1 -1
- package/dist/components/ui/ChatComposer.cjs.map +1 -1
- package/dist/components/ui/ChatComposer.js +32 -31
- package/dist/components/ui/ChatComposer.js.map +1 -1
- package/dist/components/ui/ChatSessionList.cjs +1 -1
- package/dist/components/ui/ChatSessionList.cjs.map +1 -1
- package/dist/components/ui/ChatSessionList.js +68 -66
- package/dist/components/ui/ChatSessionList.js.map +1 -1
- package/dist/components/ui/CheckGrid.cjs +1 -1
- package/dist/components/ui/CheckGrid.cjs.map +1 -1
- package/dist/components/ui/CheckGrid.js +18 -17
- package/dist/components/ui/CheckGrid.js.map +1 -1
- package/dist/components/ui/Checkbox.cjs +1 -1
- package/dist/components/ui/Checkbox.cjs.map +1 -1
- package/dist/components/ui/Checkbox.d.ts +6 -2
- package/dist/components/ui/Checkbox.js +21 -17
- package/dist/components/ui/Checkbox.js.map +1 -1
- package/dist/components/ui/ChoiceCardGroup.cjs +1 -1
- package/dist/components/ui/ChoiceCardGroup.cjs.map +1 -1
- package/dist/components/ui/ChoiceCardGroup.d.ts +13 -4
- package/dist/components/ui/ChoiceCardGroup.js +47 -35
- package/dist/components/ui/ChoiceCardGroup.js.map +1 -1
- package/dist/components/ui/CodeEditor.cjs +1 -1
- package/dist/components/ui/CodeEditor.cjs.map +1 -1
- package/dist/components/ui/CodeEditor.d.ts +11 -1
- package/dist/components/ui/CodeEditor.js +108 -74
- package/dist/components/ui/CodeEditor.js.map +1 -1
- package/dist/components/ui/CommandInvocationCard.cjs +1 -1
- package/dist/components/ui/CommandInvocationCard.cjs.map +1 -1
- package/dist/components/ui/CommandInvocationCard.js +23 -26
- package/dist/components/ui/CommandInvocationCard.js.map +1 -1
- package/dist/components/ui/CommandPalette.cjs +1 -1
- package/dist/components/ui/CommandPalette.cjs.map +1 -1
- package/dist/components/ui/CommandPalette.d.ts +3 -3
- package/dist/components/ui/CommandPalette.js +75 -75
- package/dist/components/ui/CommandPalette.js.map +1 -1
- package/dist/components/ui/CommitGraph.cjs +1 -1
- package/dist/components/ui/CommitGraph.cjs.map +1 -1
- package/dist/components/ui/CommitGraph.d.ts +3 -1
- package/dist/components/ui/CommitGraph.js +77 -74
- package/dist/components/ui/CommitGraph.js.map +1 -1
- package/dist/components/ui/ContentInspectorDialog.cjs +1 -1
- package/dist/components/ui/ContentInspectorDialog.cjs.map +1 -1
- package/dist/components/ui/ContentInspectorDialog.js +25 -31
- package/dist/components/ui/ContentInspectorDialog.js.map +1 -1
- package/dist/components/ui/ContentPreview.cjs +2 -2
- package/dist/components/ui/ContentPreview.cjs.map +1 -1
- package/dist/components/ui/ContentPreview.js +55 -56
- package/dist/components/ui/ContentPreview.js.map +1 -1
- package/dist/components/ui/DangerZone.cjs +1 -1
- package/dist/components/ui/DangerZone.cjs.map +1 -1
- package/dist/components/ui/DangerZone.js +9 -8
- package/dist/components/ui/DangerZone.js.map +1 -1
- package/dist/components/ui/DataList.cjs +1 -1
- package/dist/components/ui/DataList.cjs.map +1 -1
- package/dist/components/ui/DataList.js +27 -25
- package/dist/components/ui/DataList.js.map +1 -1
- package/dist/components/ui/DataTable.cjs +1 -1
- package/dist/components/ui/DataTable.cjs.map +1 -1
- package/dist/components/ui/DataTable.d.ts +2 -1
- package/dist/components/ui/DataTable.js +141 -124
- package/dist/components/ui/DataTable.js.map +1 -1
- package/dist/components/ui/DiffViewer.cjs +1 -1
- package/dist/components/ui/DiffViewer.cjs.map +1 -1
- package/dist/components/ui/DiffViewer.js +29 -25
- package/dist/components/ui/DiffViewer.js.map +1 -1
- package/dist/components/ui/DropdownMenu.cjs +1 -1
- package/dist/components/ui/DropdownMenu.cjs.map +1 -1
- package/dist/components/ui/DropdownMenu.d.ts +1 -0
- package/dist/components/ui/DropdownMenu.js +41 -40
- package/dist/components/ui/DropdownMenu.js.map +1 -1
- package/dist/components/ui/EnvironmentSwitcher.cjs +1 -1
- package/dist/components/ui/EnvironmentSwitcher.cjs.map +1 -1
- package/dist/components/ui/EnvironmentSwitcher.js +26 -24
- package/dist/components/ui/EnvironmentSwitcher.js.map +1 -1
- package/dist/components/ui/EventTable.cjs +1 -1
- package/dist/components/ui/EventTable.cjs.map +1 -1
- package/dist/components/ui/EventTable.js +60 -53
- package/dist/components/ui/EventTable.js.map +1 -1
- package/dist/components/ui/FileDropzone.cjs +1 -1
- package/dist/components/ui/FileDropzone.cjs.map +1 -1
- package/dist/components/ui/FileDropzone.js +40 -42
- package/dist/components/ui/FileDropzone.js.map +1 -1
- package/dist/components/ui/FilePreview.cjs +1 -1
- package/dist/components/ui/FilePreview.cjs.map +1 -1
- package/dist/components/ui/FilePreview.js +63 -61
- package/dist/components/ui/FilePreview.js.map +1 -1
- package/dist/components/ui/FolderDropzone.cjs +1 -1
- package/dist/components/ui/FolderDropzone.cjs.map +1 -1
- package/dist/components/ui/FolderDropzone.js +114 -84
- package/dist/components/ui/FolderDropzone.js.map +1 -1
- package/dist/components/ui/ForgotPasswordForm.cjs +1 -1
- package/dist/components/ui/ForgotPasswordForm.cjs.map +1 -1
- package/dist/components/ui/ForgotPasswordForm.js +22 -21
- package/dist/components/ui/ForgotPasswordForm.js.map +1 -1
- package/dist/components/ui/FormRow.cjs +1 -1
- package/dist/components/ui/FormRow.cjs.map +1 -1
- package/dist/components/ui/FormRow.d.ts +32 -11
- package/dist/components/ui/FormRow.js +24 -15
- package/dist/components/ui/FormRow.js.map +1 -1
- package/dist/components/ui/InboxPage.cjs +1 -1
- package/dist/components/ui/InboxPage.cjs.map +1 -1
- package/dist/components/ui/InboxPage.d.ts +12 -3
- package/dist/components/ui/InboxPage.js +91 -77
- package/dist/components/ui/InboxPage.js.map +1 -1
- package/dist/components/ui/LoginForm.cjs +1 -1
- package/dist/components/ui/LoginForm.cjs.map +1 -1
- package/dist/components/ui/LoginForm.js +43 -43
- package/dist/components/ui/LoginForm.js.map +1 -1
- package/dist/components/ui/MonoValue.cjs +1 -1
- package/dist/components/ui/MonoValue.cjs.map +1 -1
- package/dist/components/ui/MonoValue.d.ts +5 -1
- package/dist/components/ui/MonoValue.js +17 -17
- package/dist/components/ui/MonoValue.js.map +1 -1
- package/dist/components/ui/NotificationBell.cjs +1 -1
- package/dist/components/ui/NotificationBell.cjs.map +1 -1
- package/dist/components/ui/NotificationBell.d.ts +17 -1
- package/dist/components/ui/NotificationBell.js +129 -75
- package/dist/components/ui/NotificationBell.js.map +1 -1
- package/dist/components/ui/NumberField.cjs +1 -1
- package/dist/components/ui/NumberField.cjs.map +1 -1
- package/dist/components/ui/NumberField.d.ts +3 -1
- package/dist/components/ui/NumberField.js +52 -49
- package/dist/components/ui/NumberField.js.map +1 -1
- package/dist/components/ui/ObjectBrowser.cjs +1 -1
- package/dist/components/ui/ObjectBrowser.cjs.map +1 -1
- package/dist/components/ui/ObjectBrowser.js +83 -78
- package/dist/components/ui/ObjectBrowser.js.map +1 -1
- package/dist/components/ui/PageSizeSelect.cjs +1 -1
- package/dist/components/ui/PageSizeSelect.cjs.map +1 -1
- package/dist/components/ui/PageSizeSelect.js +30 -29
- package/dist/components/ui/PageSizeSelect.js.map +1 -1
- package/dist/components/ui/Panel.cjs.map +1 -1
- package/dist/components/ui/Panel.d.ts +5 -2
- package/dist/components/ui/Panel.js.map +1 -1
- package/dist/components/ui/ParetoChart.cjs +1 -1
- package/dist/components/ui/ParetoChart.cjs.map +1 -1
- package/dist/components/ui/ParetoChart.js +247 -212
- package/dist/components/ui/ParetoChart.js.map +1 -1
- package/dist/components/ui/ParquetViewer.cjs +1 -1
- package/dist/components/ui/ParquetViewer.cjs.map +1 -1
- package/dist/components/ui/ParquetViewer.js +69 -74
- package/dist/components/ui/ParquetViewer.js.map +1 -1
- package/dist/components/ui/PasswordField.cjs +1 -1
- package/dist/components/ui/PasswordField.cjs.map +1 -1
- package/dist/components/ui/PasswordField.js +28 -27
- package/dist/components/ui/PasswordField.js.map +1 -1
- package/dist/components/ui/PickerField.cjs +1 -1
- package/dist/components/ui/PickerField.cjs.map +1 -1
- package/dist/components/ui/PickerField.d.ts +25 -6
- package/dist/components/ui/PickerField.js +20 -17
- package/dist/components/ui/PickerField.js.map +1 -1
- package/dist/components/ui/ProjectSelector.cjs +1 -1
- package/dist/components/ui/ProjectSelector.cjs.map +1 -1
- package/dist/components/ui/ProjectSelector.js +40 -37
- package/dist/components/ui/ProjectSelector.js.map +1 -1
- package/dist/components/ui/QueryAutocomplete.cjs +1 -1
- package/dist/components/ui/QueryAutocomplete.cjs.map +1 -1
- package/dist/components/ui/QueryAutocomplete.d.ts +11 -2
- package/dist/components/ui/QueryAutocomplete.js +146 -126
- package/dist/components/ui/QueryAutocomplete.js.map +1 -1
- package/dist/components/ui/RankBar.cjs +1 -1
- package/dist/components/ui/RankBar.cjs.map +1 -1
- package/dist/components/ui/RankBar.js +9 -9
- package/dist/components/ui/RankBar.js.map +1 -1
- package/dist/components/ui/RegisterForm.cjs +1 -1
- package/dist/components/ui/RegisterForm.cjs.map +1 -1
- package/dist/components/ui/RegisterForm.js +41 -40
- package/dist/components/ui/RegisterForm.js.map +1 -1
- package/dist/components/ui/ReplayStepStrip.cjs +1 -1
- package/dist/components/ui/ReplayStepStrip.cjs.map +1 -1
- package/dist/components/ui/ReplayStepStrip.d.ts +6 -3
- package/dist/components/ui/ReplayStepStrip.js +71 -61
- package/dist/components/ui/ReplayStepStrip.js.map +1 -1
- package/dist/components/ui/ResizableSidePanel.cjs +1 -1
- package/dist/components/ui/ResizableSidePanel.cjs.map +1 -1
- package/dist/components/ui/ResizableSidePanel.js +41 -40
- package/dist/components/ui/ResizableSidePanel.js.map +1 -1
- package/dist/components/ui/SavedQueryBar.cjs +1 -1
- package/dist/components/ui/SavedQueryBar.cjs.map +1 -1
- package/dist/components/ui/SavedQueryBar.d.ts +1 -1
- package/dist/components/ui/SavedQueryBar.js +375 -277
- package/dist/components/ui/SavedQueryBar.js.map +1 -1
- package/dist/components/ui/SearchInput.cjs +1 -1
- package/dist/components/ui/SearchInput.cjs.map +1 -1
- package/dist/components/ui/SearchInput.d.ts +5 -1
- package/dist/components/ui/SearchInput.js +28 -24
- package/dist/components/ui/SearchInput.js.map +1 -1
- package/dist/components/ui/Select.cjs +1 -1
- package/dist/components/ui/Select.cjs.map +1 -1
- package/dist/components/ui/Select.d.ts +3 -1
- package/dist/components/ui/Select.js +21 -19
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/components/ui/ServiceMap.cjs +1 -1
- package/dist/components/ui/ServiceMap.cjs.map +1 -1
- package/dist/components/ui/ServiceMap.d.ts +18 -4
- package/dist/components/ui/ServiceMap.js +353 -228
- package/dist/components/ui/ServiceMap.js.map +1 -1
- package/dist/components/ui/Slider.cjs +1 -1
- package/dist/components/ui/Slider.cjs.map +1 -1
- package/dist/components/ui/Slider.d.ts +3 -1
- package/dist/components/ui/Slider.js +11 -9
- package/dist/components/ui/Slider.js.map +1 -1
- package/dist/components/ui/SparkLine.cjs +1 -1
- package/dist/components/ui/SparkLine.cjs.map +1 -1
- package/dist/components/ui/SparkLine.d.ts +5 -2
- package/dist/components/ui/SparkLine.js +36 -31
- package/dist/components/ui/SparkLine.js.map +1 -1
- package/dist/components/ui/Steps.cjs +1 -1
- package/dist/components/ui/Steps.cjs.map +1 -1
- package/dist/components/ui/Steps.js +25 -29
- package/dist/components/ui/Steps.js.map +1 -1
- package/dist/components/ui/TableOfContents.cjs +1 -1
- package/dist/components/ui/TableOfContents.cjs.map +1 -1
- package/dist/components/ui/TableOfContents.js +16 -19
- package/dist/components/ui/TableOfContents.js.map +1 -1
- package/dist/components/ui/Tabs.cjs +2 -2
- package/dist/components/ui/Tabs.cjs.map +1 -1
- package/dist/components/ui/Tabs.js +107 -87
- package/dist/components/ui/Tabs.js.map +1 -1
- package/dist/components/ui/Terminal.cjs +1 -1
- package/dist/components/ui/Terminal.cjs.map +1 -1
- package/dist/components/ui/Terminal.js +18 -17
- package/dist/components/ui/Terminal.js.map +1 -1
- package/dist/components/ui/TextField.cjs +1 -1
- package/dist/components/ui/TextField.cjs.map +1 -1
- package/dist/components/ui/TextField.js +6 -6
- package/dist/components/ui/TextField.js.map +1 -1
- package/dist/components/ui/ThemeToggle.cjs +1 -1
- package/dist/components/ui/ThemeToggle.cjs.map +1 -1
- package/dist/components/ui/ThemeToggle.js +15 -18
- package/dist/components/ui/ThemeToggle.js.map +1 -1
- package/dist/components/ui/TimeDisplay.cjs +1 -1
- package/dist/components/ui/TimeDisplay.cjs.map +1 -1
- package/dist/components/ui/TimeDisplay.js +12 -12
- package/dist/components/ui/TimeDisplay.js.map +1 -1
- package/dist/components/ui/TimeRangePicker.cjs +1 -1
- package/dist/components/ui/TimeRangePicker.cjs.map +1 -1
- package/dist/components/ui/TimeRangePicker.d.ts +12 -1
- package/dist/components/ui/TimeRangePicker.js +136 -113
- package/dist/components/ui/TimeRangePicker.js.map +1 -1
- package/dist/components/ui/Timeline.cjs.map +1 -1
- package/dist/components/ui/Timeline.d.ts +4 -4
- package/dist/components/ui/Timeline.js.map +1 -1
- package/dist/components/ui/TimelineChart.cjs +2 -2
- package/dist/components/ui/TimelineChart.cjs.map +1 -1
- package/dist/components/ui/TimelineChart.d.ts +1 -0
- package/dist/components/ui/TimelineChart.js +131 -137
- package/dist/components/ui/TimelineChart.js.map +1 -1
- package/dist/components/ui/TraceSpanInspector.cjs +1 -1
- package/dist/components/ui/TraceSpanInspector.cjs.map +1 -1
- package/dist/components/ui/TraceSpanInspector.js +43 -46
- package/dist/components/ui/TraceSpanInspector.js.map +1 -1
- package/dist/components/ui/TraceTree.cjs +1 -1
- package/dist/components/ui/TraceTree.cjs.map +1 -1
- package/dist/components/ui/TraceTree.d.ts +5 -1
- package/dist/components/ui/TraceTree.js +98 -97
- package/dist/components/ui/TraceTree.js.map +1 -1
- package/dist/components/ui/TrajectoryStep.cjs +2 -1
- package/dist/components/ui/TrajectoryStep.cjs.map +1 -1
- package/dist/components/ui/TrajectoryStep.js +64 -43
- package/dist/components/ui/TrajectoryStep.js.map +1 -1
- package/dist/components/ui/UploadQueue.cjs +1 -1
- package/dist/components/ui/UploadQueue.cjs.map +1 -1
- package/dist/components/ui/UploadQueue.js +59 -70
- package/dist/components/ui/UploadQueue.js.map +1 -1
- package/dist/components/ui/authValidation.cjs +1 -1
- package/dist/components/ui/authValidation.cjs.map +1 -1
- package/dist/components/ui/authValidation.d.ts +2 -2
- package/dist/components/ui/authValidation.js +4 -5
- package/dist/components/ui/authValidation.js.map +1 -1
- package/dist/components/ui/classifyContent.cjs +3 -3
- package/dist/components/ui/classifyContent.cjs.map +1 -1
- package/dist/components/ui/classifyContent.d.ts +2 -1
- package/dist/components/ui/classifyContent.js +52 -54
- package/dist/components/ui/classifyContent.js.map +1 -1
- package/dist/components/ui/relativeTime.cjs +1 -1
- package/dist/components/ui/relativeTime.cjs.map +1 -1
- package/dist/components/ui/relativeTime.d.ts +5 -3
- package/dist/components/ui/relativeTime.js +15 -6
- package/dist/components/ui/relativeTime.js.map +1 -1
- package/dist/components/ui/useColumnWidths.cjs +1 -1
- package/dist/components/ui/useColumnWidths.cjs.map +1 -1
- package/dist/components/ui/useColumnWidths.d.ts +6 -1
- package/dist/components/ui/useColumnWidths.js +139 -123
- package/dist/components/ui/useColumnWidths.js.map +1 -1
- package/dist/hooks/popoverOverflow.cjs +2 -0
- package/dist/hooks/popoverOverflow.cjs.map +1 -0
- package/dist/hooks/popoverOverflow.d.ts +8 -0
- package/dist/hooks/popoverOverflow.js +9 -0
- package/dist/hooks/popoverOverflow.js.map +1 -0
- package/dist/hooks/useDialogPopover.cjs +2 -0
- package/dist/hooks/useDialogPopover.cjs.map +1 -0
- package/dist/hooks/useDialogPopover.d.ts +23 -0
- package/dist/hooks/useDialogPopover.js +48 -0
- package/dist/hooks/useDialogPopover.js.map +1 -0
- package/dist/hooks/useMenuPopover.cjs +1 -1
- package/dist/hooks/useMenuPopover.cjs.map +1 -1
- package/dist/hooks/useMenuPopover.d.ts +0 -8
- package/dist/hooks/useMenuPopover.js +17 -22
- package/dist/hooks/useMenuPopover.js.map +1 -1
- package/dist/hooks/useSavedQueries.cjs +1 -1
- package/dist/hooks/useSavedQueries.cjs.map +1 -1
- package/dist/hooks/useSavedQueries.js +29 -28
- package/dist/hooks/useSavedQueries.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/layouts/shell/AegisShell.cjs +1 -1
- package/dist/layouts/shell/AegisShell.cjs.map +1 -1
- package/dist/layouts/shell/AegisShell.js +58 -59
- package/dist/layouts/shell/AegisShell.js.map +1 -1
- package/dist/layouts/shell/AppSwitcher.cjs +1 -1
- package/dist/layouts/shell/AppSwitcher.cjs.map +1 -1
- package/dist/layouts/shell/AppSwitcher.js +53 -36
- package/dist/layouts/shell/AppSwitcher.js.map +1 -1
- package/dist/layouts/shell/AuthRequiredCard.cjs +1 -1
- package/dist/layouts/shell/AuthRequiredCard.cjs.map +1 -1
- package/dist/layouts/shell/AuthRequiredCard.js +24 -22
- package/dist/layouts/shell/AuthRequiredCard.js.map +1 -1
- package/dist/layouts/shell/RouteErrorBoundary.cjs +1 -1
- package/dist/layouts/shell/RouteErrorBoundary.cjs.map +1 -1
- package/dist/layouts/shell/RouteErrorBoundary.d.ts +4 -1
- package/dist/layouts/shell/RouteErrorBoundary.js +15 -10
- package/dist/layouts/shell/RouteErrorBoundary.js.map +1 -1
- package/dist/layouts/shell/ShellInboxPage.cjs +1 -1
- package/dist/layouts/shell/ShellInboxPage.cjs.map +1 -1
- package/dist/layouts/shell/ShellInboxPage.js +17 -16
- package/dist/layouts/shell/ShellInboxPage.js.map +1 -1
- package/dist/layouts/shell/ShellNotificationBell.cjs +1 -1
- package/dist/layouts/shell/ShellNotificationBell.cjs.map +1 -1
- package/dist/layouts/shell/ShellNotificationBell.js +20 -14
- package/dist/layouts/shell/ShellNotificationBell.js.map +1 -1
- package/dist/layouts/shell/TopHeader.cjs +1 -1
- package/dist/layouts/shell/TopHeader.cjs.map +1 -1
- package/dist/layouts/shell/TopHeader.js +74 -74
- package/dist/layouts/shell/TopHeader.js.map +1 -1
- package/dist/layouts/shell/useShellUser.cjs +1 -1
- package/dist/layouts/shell/useShellUser.cjs.map +1 -1
- package/dist/layouts/shell/useShellUser.js +15 -13
- package/dist/layouts/shell/useShellUser.js.map +1 -1
- package/dist/lib/breakAtSeparators.cjs +2 -0
- package/dist/lib/breakAtSeparators.cjs.map +1 -0
- package/dist/lib/breakAtSeparators.d.ts +6 -0
- package/dist/lib/breakAtSeparators.js +10 -0
- package/dist/lib/breakAtSeparators.js.map +1 -0
- package/dist/lib/chart.cjs +1 -1
- package/dist/lib/chart.cjs.map +1 -1
- package/dist/lib/chart.d.ts +5 -7
- package/dist/lib/chart.js +49 -34
- package/dist/lib/chart.js.map +1 -1
- package/dist/lib/timeRange.cjs +1 -1
- package/dist/lib/timeRange.cjs.map +1 -1
- package/dist/lib/timeRange.d.ts +14 -4
- package/dist/lib/timeRange.js +41 -40
- package/dist/lib/timeRange.js.map +1 -1
- package/dist/locale/strings.cjs +1 -1
- package/dist/locale/strings.cjs.map +1 -1
- package/dist/locale/strings.d.ts +247 -2
- package/dist/locale/strings.js +562 -37
- package/dist/locale/strings.js.map +1 -1
- package/dist/notifications/notificationContext.cjs.map +1 -1
- package/dist/notifications/notificationContext.d.ts +12 -2
- package/dist/notifications/notificationContext.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/theme/antdTheme.cjs +1 -1
- package/dist/theme/antdTheme.cjs.map +1 -1
- package/dist/theme/antdTheme.js +52 -29
- package/dist/theme/antdTheme.js.map +1 -1
- package/dist/transports/agentm/AgentmChannelProvider.cjs +1 -1
- package/dist/transports/agentm/AgentmChannelProvider.cjs.map +1 -1
- package/dist/transports/agentm/AgentmChannelProvider.js +66 -61
- package/dist/transports/agentm/AgentmChannelProvider.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { usePrimitiveSurface as
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as p } from "react";
|
|
3
|
+
import { usePrimitiveSurface as d } from "../../agent/core/usePrimitiveSurface.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
|
|
5
|
+
import { useStrings as f } from "../../locale/useStrings.js";
|
|
6
|
+
function j({
|
|
6
7
|
title: n,
|
|
7
8
|
headerActions: a,
|
|
8
9
|
children: r,
|
|
9
|
-
footer:
|
|
10
|
+
footer: s,
|
|
10
11
|
className: t,
|
|
11
|
-
surface:
|
|
12
|
+
surface: o
|
|
12
13
|
}) {
|
|
13
|
-
const
|
|
14
|
-
return /* @__PURE__ */
|
|
14
|
+
const c = f(), i = p(null), g = d(o, null, "panel", i), m = ["aegis-agent-panel", t ?? ""].filter(Boolean).join(" ");
|
|
15
|
+
return /* @__PURE__ */ l(
|
|
15
16
|
"aside",
|
|
16
17
|
{
|
|
17
|
-
ref:
|
|
18
|
-
className:
|
|
19
|
-
"aria-label":
|
|
18
|
+
ref: i,
|
|
19
|
+
className: m,
|
|
20
|
+
"aria-label": c.agentPanel,
|
|
20
21
|
...g,
|
|
21
22
|
children: [
|
|
22
|
-
(n ?? a) && /* @__PURE__ */
|
|
23
|
+
(n ?? a) && /* @__PURE__ */ l("header", { className: "aegis-agent-panel__header", children: [
|
|
23
24
|
/* @__PURE__ */ e("div", { className: "aegis-agent-panel__title", children: n }),
|
|
24
25
|
a && /* @__PURE__ */ e("div", { className: "aegis-agent-panel__actions", children: a })
|
|
25
26
|
] }),
|
|
26
27
|
/* @__PURE__ */ e("div", { className: "aegis-agent-panel__body", children: r }),
|
|
27
|
-
|
|
28
|
+
s && /* @__PURE__ */ e("div", { className: "aegis-agent-panel__footer", children: s })
|
|
28
29
|
]
|
|
29
30
|
}
|
|
30
31
|
);
|
|
31
32
|
}
|
|
32
33
|
export {
|
|
33
|
-
|
|
34
|
+
j as AgentPanel
|
|
34
35
|
};
|
|
35
36
|
//# sourceMappingURL=AgentPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentPanel.js","sources":["../../../src/components/ui/AgentPanel.tsx"],"sourcesContent":["import { type ReactNode, useRef } from 'react';\n\nimport {\n type ContainerSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport './AgentPanel.css';\n\nexport type AgentPanelSurface = ContainerSurface;\n\ninterface AgentPanelProps {\n title?: ReactNode;\n /** Header right-side slot (e.g. close button). */\n headerActions?: ReactNode;\n /** The conversation area — typically ChatMessageList. */\n children: ReactNode;\n /** Sticky footer — typically ChatComposer. */\n footer?: ReactNode;\n className?: string;\n surface?: AgentPanelSurface;\n}\n\nexport function AgentPanel({\n title,\n headerActions,\n children,\n footer,\n className,\n surface,\n}: AgentPanelProps) {\n const wrapRef = useRef<HTMLElement>(null);\n const agentAttrs = usePrimitiveSurface(surface, null, 'panel', wrapRef);\n const cls = ['aegis-agent-panel', className ?? ''].filter(Boolean).join(' ');\n\n return (\n <aside\n ref={wrapRef}\n className={cls}\n aria-label
|
|
1
|
+
{"version":3,"file":"AgentPanel.js","sources":["../../../src/components/ui/AgentPanel.tsx"],"sourcesContent":["import { type ReactNode, useRef } from 'react';\n\nimport {\n type ContainerSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport { useStrings } from '../../locale';\nimport './AgentPanel.css';\n\nexport type AgentPanelSurface = ContainerSurface;\n\ninterface AgentPanelProps {\n title?: ReactNode;\n /** Header right-side slot (e.g. close button). */\n headerActions?: ReactNode;\n /** The conversation area — typically ChatMessageList. */\n children: ReactNode;\n /** Sticky footer — typically ChatComposer. */\n footer?: ReactNode;\n className?: string;\n surface?: AgentPanelSurface;\n}\n\nexport function AgentPanel({\n title,\n headerActions,\n children,\n footer,\n className,\n surface,\n}: AgentPanelProps) {\n const strings = useStrings();\n const wrapRef = useRef<HTMLElement>(null);\n const agentAttrs = usePrimitiveSurface(surface, null, 'panel', wrapRef);\n const cls = ['aegis-agent-panel', className ?? ''].filter(Boolean).join(' ');\n\n return (\n <aside\n ref={wrapRef}\n className={cls}\n aria-label={strings.agentPanel}\n {...agentAttrs}\n >\n {(title ?? headerActions) && (\n <header className=\"aegis-agent-panel__header\">\n <div className=\"aegis-agent-panel__title\">{title}</div>\n {headerActions && (\n <div className=\"aegis-agent-panel__actions\">{headerActions}</div>\n )}\n </header>\n )}\n <div className=\"aegis-agent-panel__body\">{children}</div>\n {footer && <div className=\"aegis-agent-panel__footer\">{footer}</div>}\n </aside>\n );\n}\n"],"names":["AgentPanel","title","headerActions","children","footer","className","surface","strings","useStrings","wrapRef","useRef","agentAttrs","usePrimitiveSurface","cls","jsxs","jsx"],"mappings":";;;;;AAuBO,SAASA,EAAW;AAAA,EACzB,OAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AACF,GAAoB;AAClB,QAAMC,IAAUC,EAAA,GACVC,IAAUC,EAAoB,IAAI,GAClCC,IAAaC,EAAoBN,GAAS,MAAM,SAASG,CAAO,GAChEI,IAAM,CAAC,qBAAqBR,KAAa,EAAE,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE3E,SACE,gBAAAS;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAKL;AAAA,MACL,WAAWI;AAAA,MACX,cAAYN,EAAQ;AAAA,MACnB,GAAGI;AAAA,MAEF,UAAA;AAAA,SAAAV,KAASC,MACT,gBAAAY,EAAC,UAAA,EAAO,WAAU,6BAChB,UAAA;AAAA,UAAA,gBAAAC,EAAC,OAAA,EAAI,WAAU,4BAA4B,UAAAd,GAAM;AAAA,UAChDC,KACC,gBAAAa,EAAC,OAAA,EAAI,WAAU,8BAA8B,UAAAb,EAAA,CAAc;AAAA,QAAA,GAE/D;AAAA,QAEF,gBAAAa,EAAC,OAAA,EAAI,WAAU,2BAA2B,UAAAZ,EAAA,CAAS;AAAA,QAClDC,KAAU,gBAAAW,EAAC,OAAA,EAAI,WAAU,6BAA6B,UAAAX,EAAA,CAAO;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpE;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),f=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),f=require("react"),h=require("../../agent/core/usePrimitiveSurface.cjs");;/* empty css */const j=require("../../locale/useStrings.cjs");function d(a){return a.trim().split(/\s+/).slice(0,2).map(e=>e.charAt(0)).join("").toUpperCase()}const N=5;function $(a){let e=0;for(let r=0;r<a.length;r++)e=e*31+a.charCodeAt(r)>>>0;return e%N+1}function x({name:a,src:e,size:r="md",status:s,icon:v,colorSlot:o,className:m,surface:c}){const p=j.useStrings(),i=f.useRef(null),l=h.usePrimitiveSurface(c,{name:a,status:s},"entity",i),u=["aegis-avatar",`aegis-avatar--${r}`,m].filter(Boolean).join(" "),g=["aegis-avatar-wrap",`aegis-avatar-wrap--${r}`].join(" "),n=e?t.jsx("img",{src:e,alt:a,className:u}):t.jsx("span",{className:`${u} ${o===void 0?`aegis-avatar--hue-${$(a)}`:`aegis-avatar--slot-${o}`}`,"aria-label":a,role:"img",children:v??d(a)});return s?t.jsxs("span",{ref:i,className:g,...l,children:[n,t.jsx("span",{className:`aegis-avatar__status aegis-avatar__status--${s}`,role:"img","aria-label":p.avatarStatus(s)})]}):c?t.jsx("span",{ref:i,className:g,...l,children:n}):n}exports.Avatar=x;
|
|
2
2
|
//# sourceMappingURL=Avatar.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.cjs","sources":["../../../src/components/ui/Avatar.tsx"],"sourcesContent":["import { type ReactNode, useRef } from 'react';\n\nimport {\n type PrimitiveSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport './Avatar.css';\n\ntype AvatarSize = 'sm' | 'md' | 'lg';\ntype AvatarStatus = 'online' | 'offline' | 'busy' | 'away';\n/** Index into `--data-cat-1` … `--data-cat-6`, the chart series colours. */\nexport type AvatarColorSlot = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport type AvatarSurface = PrimitiveSurface<{\n name: string;\n status?: AvatarStatus;\n}>;\n\ninterface AvatarProps {\n name: string;\n src?: string;\n size?: AvatarSize;\n status?: AvatarStatus;\n icon?: ReactNode;\n /**\n * Colours the initials fallback with `--data-cat-<n>` instead of the\n * name-hashed hue, so it matches that series in charts.\n */\n colorSlot?: AvatarColorSlot;\n className?: string;\n surface?: AvatarSurface;\n}\n\nfunction initialsFromName(name: string): string {\n return name\n .trim()\n .split(/\\s+/)\n .slice(0, 2)\n .map((w) => w.charAt(0))\n .join('')\n .toUpperCase();\n}\n\nconst HUE_COUNT = 5;\n\nfunction hueFromName(name: string): number {\n let hash = 0;\n for (let i = 0; i < name.length; i++) {\n hash = (hash * 31 + name.charCodeAt(i)) >>> 0;\n }\n return (hash % HUE_COUNT) + 1;\n}\n\nexport function Avatar({\n name,\n src,\n size = 'md',\n status,\n icon,\n colorSlot,\n className,\n surface,\n}: AvatarProps) {\n const wrapRef = useRef<HTMLSpanElement>(null);\n const agentAttrs = usePrimitiveSurface(\n surface,\n { name, status },\n 'entity',\n wrapRef,\n );\n\n const cls = ['aegis-avatar', `aegis-avatar--${size}`, className]\n .filter(Boolean)\n .join(' ');\n\n const wrapperCls = ['aegis-avatar-wrap', `aegis-avatar-wrap--${size}`].join(\n ' ',\n );\n\n const content = src ? (\n <img src={src} alt={name} className={cls} />\n ) : (\n <span\n className={`${cls} ${\n colorSlot === undefined\n ? `aegis-avatar--hue-${hueFromName(name)}`\n : `aegis-avatar--slot-${colorSlot}`\n }`}\n aria-label={name}\n role=\"img\"\n >\n {icon ?? initialsFromName(name)}\n </span>\n );\n\n if (!status) {\n if (!surface) {\n return content;\n }\n return (\n <span ref={wrapRef} className={wrapperCls} {...agentAttrs}>\n {content}\n </span>\n );\n }\n\n return (\n <span ref={wrapRef} className={wrapperCls} {...agentAttrs}>\n {content}\n <span\n className={`aegis-avatar__status aegis-avatar__status--${status}`}\n aria-label={status}\n />\n </span>\n );\n}\n"],"names":["initialsFromName","name","w","HUE_COUNT","hueFromName","hash","i","Avatar","src","size","status","icon","colorSlot","className","surface","wrapRef","useRef","agentAttrs","usePrimitiveSurface","cls","wrapperCls","content","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Avatar.cjs","sources":["../../../src/components/ui/Avatar.tsx"],"sourcesContent":["import { type ReactNode, useRef } from 'react';\n\nimport {\n type PrimitiveSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport { useStrings } from '../../locale';\nimport './Avatar.css';\n\ntype AvatarSize = 'sm' | 'md' | 'lg';\ntype AvatarStatus = 'online' | 'offline' | 'busy' | 'away';\n/** Index into `--data-cat-1` … `--data-cat-6`, the chart series colours. */\nexport type AvatarColorSlot = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport type AvatarSurface = PrimitiveSurface<{\n name: string;\n status?: AvatarStatus;\n}>;\n\ninterface AvatarProps {\n name: string;\n src?: string;\n size?: AvatarSize;\n status?: AvatarStatus;\n icon?: ReactNode;\n /**\n * Colours the initials fallback with `--data-cat-<n>` instead of the\n * name-hashed hue, so it matches that series in charts.\n */\n colorSlot?: AvatarColorSlot;\n className?: string;\n surface?: AvatarSurface;\n}\n\nfunction initialsFromName(name: string): string {\n return name\n .trim()\n .split(/\\s+/)\n .slice(0, 2)\n .map((w) => w.charAt(0))\n .join('')\n .toUpperCase();\n}\n\nconst HUE_COUNT = 5;\n\nfunction hueFromName(name: string): number {\n let hash = 0;\n for (let i = 0; i < name.length; i++) {\n hash = (hash * 31 + name.charCodeAt(i)) >>> 0;\n }\n return (hash % HUE_COUNT) + 1;\n}\n\nexport function Avatar({\n name,\n src,\n size = 'md',\n status,\n icon,\n colorSlot,\n className,\n surface,\n}: AvatarProps) {\n const strings = useStrings();\n const wrapRef = useRef<HTMLSpanElement>(null);\n const agentAttrs = usePrimitiveSurface(\n surface,\n { name, status },\n 'entity',\n wrapRef,\n );\n\n const cls = ['aegis-avatar', `aegis-avatar--${size}`, className]\n .filter(Boolean)\n .join(' ');\n\n const wrapperCls = ['aegis-avatar-wrap', `aegis-avatar-wrap--${size}`].join(\n ' ',\n );\n\n const content = src ? (\n <img src={src} alt={name} className={cls} />\n ) : (\n <span\n className={`${cls} ${\n colorSlot === undefined\n ? `aegis-avatar--hue-${hueFromName(name)}`\n : `aegis-avatar--slot-${colorSlot}`\n }`}\n aria-label={name}\n role=\"img\"\n >\n {icon ?? initialsFromName(name)}\n </span>\n );\n\n if (!status) {\n if (!surface) {\n return content;\n }\n return (\n <span ref={wrapRef} className={wrapperCls} {...agentAttrs}>\n {content}\n </span>\n );\n }\n\n return (\n <span ref={wrapRef} className={wrapperCls} {...agentAttrs}>\n {content}\n <span\n className={`aegis-avatar__status aegis-avatar__status--${status}`}\n role=\"img\"\n aria-label={strings.avatarStatus(status)}\n />\n </span>\n );\n}\n"],"names":["initialsFromName","name","w","HUE_COUNT","hueFromName","hash","i","Avatar","src","size","status","icon","colorSlot","className","surface","strings","useStrings","wrapRef","useRef","agentAttrs","usePrimitiveSurface","cls","wrapperCls","content","jsx"],"mappings":"yQAkCA,SAASA,EAAiBC,EAAsB,CAC9C,OAAOA,EACJ,OACA,MAAM,KAAK,EACX,MAAM,EAAG,CAAC,EACV,IAAKC,GAAMA,EAAE,OAAO,CAAC,CAAC,EACtB,KAAK,EAAE,EACP,YAAA,CACL,CAEA,MAAMC,EAAY,EAElB,SAASC,EAAYH,EAAsB,CACzC,IAAII,EAAO,EACX,QAASC,EAAI,EAAGA,EAAIL,EAAK,OAAQK,IAC/BD,EAAQA,EAAO,GAAKJ,EAAK,WAAWK,CAAC,IAAO,EAE9C,OAAQD,EAAOF,EAAa,CAC9B,CAEO,SAASI,EAAO,CACrB,KAAAN,EACA,IAAAO,EACA,KAAAC,EAAO,KACP,OAAAC,EACA,KAAAC,EACA,UAAAC,EACA,UAAAC,EACA,QAAAC,CACF,EAAgB,CACd,MAAMC,EAAUC,EAAAA,WAAA,EACVC,EAAUC,EAAAA,OAAwB,IAAI,EACtCC,EAAaC,EAAAA,oBACjBN,EACA,CAAE,KAAAb,EAAM,OAAAS,CAAA,EACR,SACAO,CAAA,EAGII,EAAM,CAAC,eAAgB,iBAAiBZ,CAAI,GAAII,CAAS,EAC5D,OAAO,OAAO,EACd,KAAK,GAAG,EAELS,EAAa,CAAC,oBAAqB,sBAAsBb,CAAI,EAAE,EAAE,KACrE,GAAA,EAGIc,EAAUf,EACdgB,EAAAA,IAAC,MAAA,CAAI,IAAAhB,EAAU,IAAKP,EAAM,UAAWoB,CAAA,CAAK,EAE1CG,EAAAA,IAAC,OAAA,CACC,UAAW,GAAGH,CAAG,IACfT,IAAc,OACV,qBAAqBR,EAAYH,CAAI,CAAC,GACtC,sBAAsBW,CAAS,EACrC,GACA,aAAYX,EACZ,KAAK,MAEJ,SAAAU,GAAQX,EAAiBC,CAAI,CAAA,CAAA,EAIlC,OAAKS,SAYF,OAAA,CAAK,IAAKO,EAAS,UAAWK,EAAa,GAAGH,EAC5C,SAAA,CAAAI,EACDC,EAAAA,IAAC,OAAA,CACC,UAAW,8CAA8Cd,CAAM,GAC/D,KAAK,MACL,aAAYK,EAAQ,aAAaL,CAAM,CAAA,CAAA,CACzC,EACF,EAlBKI,EAIHU,MAAC,QAAK,IAAKP,EAAS,UAAWK,EAAa,GAAGH,EAC5C,SAAAI,CAAA,CACH,EALOA,CAmBb"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { usePrimitiveSurface as
|
|
1
|
+
import { jsx as s, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as h } from "react";
|
|
3
|
+
import { usePrimitiveSurface as N } from "../../agent/core/usePrimitiveSurface.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
|
|
5
|
+
import { useStrings as $ } from "../../locale/useStrings.js";
|
|
6
|
+
function d(a) {
|
|
6
7
|
return a.trim().split(/\s+/).slice(0, 2).map((r) => r.charAt(0)).join("").toUpperCase();
|
|
7
8
|
}
|
|
8
|
-
const
|
|
9
|
-
function
|
|
9
|
+
const j = 5;
|
|
10
|
+
function _(a) {
|
|
10
11
|
let r = 0;
|
|
11
12
|
for (let t = 0; t < a.length; t++)
|
|
12
13
|
r = r * 31 + a.charCodeAt(t) >>> 0;
|
|
13
|
-
return r %
|
|
14
|
+
return r % j + 1;
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function b({
|
|
16
17
|
name: a,
|
|
17
18
|
src: r,
|
|
18
19
|
size: t = "md",
|
|
@@ -22,34 +23,35 @@ function C({
|
|
|
22
23
|
className: g,
|
|
23
24
|
surface: l
|
|
24
25
|
}) {
|
|
25
|
-
const
|
|
26
|
+
const u = $(), i = h(null), c = N(
|
|
26
27
|
l,
|
|
27
28
|
{ name: a, status: e },
|
|
28
29
|
"entity",
|
|
29
|
-
|
|
30
|
-
),
|
|
30
|
+
i
|
|
31
|
+
), m = ["aegis-avatar", `aegis-avatar--${t}`, g].filter(Boolean).join(" "), p = ["aegis-avatar-wrap", `aegis-avatar-wrap--${t}`].join(
|
|
31
32
|
" "
|
|
32
|
-
), n = r ? /* @__PURE__ */
|
|
33
|
+
), n = r ? /* @__PURE__ */ s("img", { src: r, alt: a, className: m }) : /* @__PURE__ */ s(
|
|
33
34
|
"span",
|
|
34
35
|
{
|
|
35
|
-
className: `${
|
|
36
|
+
className: `${m} ${o === void 0 ? `aegis-avatar--hue-${_(a)}` : `aegis-avatar--slot-${o}`}`,
|
|
36
37
|
"aria-label": a,
|
|
37
38
|
role: "img",
|
|
38
|
-
children: f ??
|
|
39
|
+
children: f ?? d(a)
|
|
39
40
|
}
|
|
40
41
|
);
|
|
41
|
-
return e ? /* @__PURE__ */
|
|
42
|
+
return e ? /* @__PURE__ */ v("span", { ref: i, className: p, ...c, children: [
|
|
42
43
|
n,
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ s(
|
|
44
45
|
"span",
|
|
45
46
|
{
|
|
46
47
|
className: `aegis-avatar__status aegis-avatar__status--${e}`,
|
|
47
|
-
"
|
|
48
|
+
role: "img",
|
|
49
|
+
"aria-label": u.avatarStatus(e)
|
|
48
50
|
}
|
|
49
51
|
)
|
|
50
|
-
] }) : l ? /* @__PURE__ */
|
|
52
|
+
] }) : l ? /* @__PURE__ */ s("span", { ref: i, className: p, ...c, children: n }) : n;
|
|
51
53
|
}
|
|
52
54
|
export {
|
|
53
|
-
|
|
55
|
+
b as Avatar
|
|
54
56
|
};
|
|
55
57
|
//# sourceMappingURL=Avatar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sources":["../../../src/components/ui/Avatar.tsx"],"sourcesContent":["import { type ReactNode, useRef } from 'react';\n\nimport {\n type PrimitiveSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport './Avatar.css';\n\ntype AvatarSize = 'sm' | 'md' | 'lg';\ntype AvatarStatus = 'online' | 'offline' | 'busy' | 'away';\n/** Index into `--data-cat-1` … `--data-cat-6`, the chart series colours. */\nexport type AvatarColorSlot = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport type AvatarSurface = PrimitiveSurface<{\n name: string;\n status?: AvatarStatus;\n}>;\n\ninterface AvatarProps {\n name: string;\n src?: string;\n size?: AvatarSize;\n status?: AvatarStatus;\n icon?: ReactNode;\n /**\n * Colours the initials fallback with `--data-cat-<n>` instead of the\n * name-hashed hue, so it matches that series in charts.\n */\n colorSlot?: AvatarColorSlot;\n className?: string;\n surface?: AvatarSurface;\n}\n\nfunction initialsFromName(name: string): string {\n return name\n .trim()\n .split(/\\s+/)\n .slice(0, 2)\n .map((w) => w.charAt(0))\n .join('')\n .toUpperCase();\n}\n\nconst HUE_COUNT = 5;\n\nfunction hueFromName(name: string): number {\n let hash = 0;\n for (let i = 0; i < name.length; i++) {\n hash = (hash * 31 + name.charCodeAt(i)) >>> 0;\n }\n return (hash % HUE_COUNT) + 1;\n}\n\nexport function Avatar({\n name,\n src,\n size = 'md',\n status,\n icon,\n colorSlot,\n className,\n surface,\n}: AvatarProps) {\n const wrapRef = useRef<HTMLSpanElement>(null);\n const agentAttrs = usePrimitiveSurface(\n surface,\n { name, status },\n 'entity',\n wrapRef,\n );\n\n const cls = ['aegis-avatar', `aegis-avatar--${size}`, className]\n .filter(Boolean)\n .join(' ');\n\n const wrapperCls = ['aegis-avatar-wrap', `aegis-avatar-wrap--${size}`].join(\n ' ',\n );\n\n const content = src ? (\n <img src={src} alt={name} className={cls} />\n ) : (\n <span\n className={`${cls} ${\n colorSlot === undefined\n ? `aegis-avatar--hue-${hueFromName(name)}`\n : `aegis-avatar--slot-${colorSlot}`\n }`}\n aria-label={name}\n role=\"img\"\n >\n {icon ?? initialsFromName(name)}\n </span>\n );\n\n if (!status) {\n if (!surface) {\n return content;\n }\n return (\n <span ref={wrapRef} className={wrapperCls} {...agentAttrs}>\n {content}\n </span>\n );\n }\n\n return (\n <span ref={wrapRef} className={wrapperCls} {...agentAttrs}>\n {content}\n <span\n className={`aegis-avatar__status aegis-avatar__status--${status}`}\n aria-label={status}\n />\n </span>\n );\n}\n"],"names":["initialsFromName","name","w","HUE_COUNT","hueFromName","hash","i","Avatar","src","size","status","icon","colorSlot","className","surface","wrapRef","useRef","agentAttrs","usePrimitiveSurface","cls","wrapperCls","content","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Avatar.js","sources":["../../../src/components/ui/Avatar.tsx"],"sourcesContent":["import { type ReactNode, useRef } from 'react';\n\nimport {\n type PrimitiveSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport { useStrings } from '../../locale';\nimport './Avatar.css';\n\ntype AvatarSize = 'sm' | 'md' | 'lg';\ntype AvatarStatus = 'online' | 'offline' | 'busy' | 'away';\n/** Index into `--data-cat-1` … `--data-cat-6`, the chart series colours. */\nexport type AvatarColorSlot = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport type AvatarSurface = PrimitiveSurface<{\n name: string;\n status?: AvatarStatus;\n}>;\n\ninterface AvatarProps {\n name: string;\n src?: string;\n size?: AvatarSize;\n status?: AvatarStatus;\n icon?: ReactNode;\n /**\n * Colours the initials fallback with `--data-cat-<n>` instead of the\n * name-hashed hue, so it matches that series in charts.\n */\n colorSlot?: AvatarColorSlot;\n className?: string;\n surface?: AvatarSurface;\n}\n\nfunction initialsFromName(name: string): string {\n return name\n .trim()\n .split(/\\s+/)\n .slice(0, 2)\n .map((w) => w.charAt(0))\n .join('')\n .toUpperCase();\n}\n\nconst HUE_COUNT = 5;\n\nfunction hueFromName(name: string): number {\n let hash = 0;\n for (let i = 0; i < name.length; i++) {\n hash = (hash * 31 + name.charCodeAt(i)) >>> 0;\n }\n return (hash % HUE_COUNT) + 1;\n}\n\nexport function Avatar({\n name,\n src,\n size = 'md',\n status,\n icon,\n colorSlot,\n className,\n surface,\n}: AvatarProps) {\n const strings = useStrings();\n const wrapRef = useRef<HTMLSpanElement>(null);\n const agentAttrs = usePrimitiveSurface(\n surface,\n { name, status },\n 'entity',\n wrapRef,\n );\n\n const cls = ['aegis-avatar', `aegis-avatar--${size}`, className]\n .filter(Boolean)\n .join(' ');\n\n const wrapperCls = ['aegis-avatar-wrap', `aegis-avatar-wrap--${size}`].join(\n ' ',\n );\n\n const content = src ? (\n <img src={src} alt={name} className={cls} />\n ) : (\n <span\n className={`${cls} ${\n colorSlot === undefined\n ? `aegis-avatar--hue-${hueFromName(name)}`\n : `aegis-avatar--slot-${colorSlot}`\n }`}\n aria-label={name}\n role=\"img\"\n >\n {icon ?? initialsFromName(name)}\n </span>\n );\n\n if (!status) {\n if (!surface) {\n return content;\n }\n return (\n <span ref={wrapRef} className={wrapperCls} {...agentAttrs}>\n {content}\n </span>\n );\n }\n\n return (\n <span ref={wrapRef} className={wrapperCls} {...agentAttrs}>\n {content}\n <span\n className={`aegis-avatar__status aegis-avatar__status--${status}`}\n role=\"img\"\n aria-label={strings.avatarStatus(status)}\n />\n </span>\n );\n}\n"],"names":["initialsFromName","name","w","HUE_COUNT","hueFromName","hash","i","Avatar","src","size","status","icon","colorSlot","className","surface","strings","useStrings","wrapRef","useRef","agentAttrs","usePrimitiveSurface","cls","wrapperCls","content","jsx"],"mappings":";;;;;AAkCA,SAASA,EAAiBC,GAAsB;AAC9C,SAAOA,EACJ,OACA,MAAM,KAAK,EACX,MAAM,GAAG,CAAC,EACV,IAAI,CAACC,MAAMA,EAAE,OAAO,CAAC,CAAC,EACtB,KAAK,EAAE,EACP,YAAA;AACL;AAEA,MAAMC,IAAY;AAElB,SAASC,EAAYH,GAAsB;AACzC,MAAII,IAAO;AACX,WAASC,IAAI,GAAGA,IAAIL,EAAK,QAAQK;AAC/B,IAAAD,IAAQA,IAAO,KAAKJ,EAAK,WAAWK,CAAC,MAAO;AAE9C,SAAQD,IAAOF,IAAa;AAC9B;AAEO,SAASI,EAAO;AAAA,EACrB,MAAAN;AAAA,EACA,KAAAO;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AACF,GAAgB;AACd,QAAMC,IAAUC,EAAA,GACVC,IAAUC,EAAwB,IAAI,GACtCC,IAAaC;AAAA,IACjBN;AAAA,IACA,EAAE,MAAAb,GAAM,QAAAS,EAAA;AAAA,IACR;AAAA,IACAO;AAAA,EAAA,GAGII,IAAM,CAAC,gBAAgB,iBAAiBZ,CAAI,IAAII,CAAS,EAC5D,OAAO,OAAO,EACd,KAAK,GAAG,GAELS,IAAa,CAAC,qBAAqB,sBAAsBb,CAAI,EAAE,EAAE;AAAA,IACrE;AAAA,EAAA,GAGIc,IAAUf,IACd,gBAAAgB,EAAC,OAAA,EAAI,KAAAhB,GAAU,KAAKP,GAAM,WAAWoB,EAAA,CAAK,IAE1C,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,GAAGH,CAAG,IACfT,MAAc,SACV,qBAAqBR,EAAYH,CAAI,CAAC,KACtC,sBAAsBW,CAAS,EACrC;AAAA,MACA,cAAYX;AAAA,MACZ,MAAK;AAAA,MAEJ,UAAAU,KAAQX,EAAiBC,CAAI;AAAA,IAAA;AAAA,EAAA;AAIlC,SAAKS,sBAYF,QAAA,EAAK,KAAKO,GAAS,WAAWK,GAAa,GAAGH,GAC5C,UAAA;AAAA,IAAAI;AAAA,IACD,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW,8CAA8Cd,CAAM;AAAA,QAC/D,MAAK;AAAA,QACL,cAAYK,EAAQ,aAAaL,CAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EACzC,GACF,IAlBKI,IAIH,gBAAAU,EAAC,UAAK,KAAKP,GAAS,WAAWK,GAAa,GAAGH,GAC5C,UAAAI,EAAA,CACH,IALOA;AAmBb;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),b=require("react"),_=require("../../agent/core/usePrimitiveSurface.cjs");;/* empty css */function g({value:e,ariaLabel:t,"aria-labelledby":l,centerLabel:s,hideTicks:c=!1,"aria-describedby":d,className:u,surface:n}){const r=b.useRef(null),m=_.usePrimitiveSurface(n,{value:e,centerLabel:s},"metric",r),i=Math.max(0,Math.min(100,e)),o=["aegis-blast-radius",u??""].filter(Boolean).join(" ");return a.jsxs("div",{ref:r,className:o,...m,children:[a.jsx("div",{className:"aegis-blast-radius__track",role:"meter","aria-label":t,"aria-labelledby":l,"aria-describedby":d,"aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,"aria-valuetext":s??`${i.toString()}%`,children:a.jsx("div",{className:"aegis-blast-radius__fill",style:{width:`${i}%`}})}),!c&&a.jsxs("div",{className:"aegis-blast-radius__ticks",children:[a.jsx("span",{className:"aegis-blast-radius__tick",children:"0%"}),s&&a.jsx("span",{className:"aegis-blast-radius__tick aegis-blast-radius__tick--center",children:s}),a.jsx("span",{className:"aegis-blast-radius__tick",children:"100%"})]})]})}exports.BlastRadiusBar=g;
|
|
2
2
|
//# sourceMappingURL=BlastRadiusBar.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlastRadiusBar.cjs","sources":["../../../src/components/ui/BlastRadiusBar.tsx"],"sourcesContent":["import { useRef } from 'react';\n\nimport {\n type PrimitiveSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport './BlastRadiusBar.css';\n\nexport type BlastRadiusBarSurface = PrimitiveSurface<{\n value: number;\n centerLabel?: string;\n}>;\n\ninterface
|
|
1
|
+
{"version":3,"file":"BlastRadiusBar.cjs","sources":["../../../src/components/ui/BlastRadiusBar.tsx"],"sourcesContent":["import { useRef } from 'react';\n\nimport {\n type PrimitiveSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport './BlastRadiusBar.css';\n\nexport type BlastRadiusBarSurface = PrimitiveSurface<{\n value: number;\n centerLabel?: string;\n}>;\n\ninterface BlastRadiusBarBaseProps {\n /** 0 – 100 */\n value: number;\n /** Optional descriptive label for the current value (right-aligned, mid). */\n centerLabel?: string;\n /** Hide the 0 / 100 endpoints. */\n hideTicks?: boolean;\n /** Ids of the text that describes the measure, such as a FormRow's description. */\n 'aria-describedby'?: string;\n className?: string;\n surface?: BlastRadiusBarSurface;\n}\n\ntype BlastRadiusBarProps = BlastRadiusBarBaseProps &\n (\n | {\n /** Accessible name of the measure, e.g. \"Estimated blast radius\". */\n ariaLabel: string;\n 'aria-labelledby'?: never;\n }\n | {\n /**\n * Id of visible text that names the measure, such as a FormRow's\n * label (`${controlId}-label` with `labelBy='aria-labelledby'`).\n */\n 'aria-labelledby': string;\n ariaLabel?: never;\n }\n );\n\nexport function BlastRadiusBar({\n value,\n ariaLabel,\n 'aria-labelledby': labelledBy,\n centerLabel,\n hideTicks = false,\n 'aria-describedby': describedBy,\n className,\n surface,\n}: BlastRadiusBarProps) {\n const wrapRef = useRef<HTMLDivElement>(null);\n const agentAttrs = usePrimitiveSurface(\n surface,\n { value, centerLabel },\n 'metric',\n wrapRef,\n );\n const clamped = Math.max(0, Math.min(100, value));\n const cls = ['aegis-blast-radius', className ?? ''].filter(Boolean).join(' ');\n\n return (\n <div ref={wrapRef} className={cls} {...agentAttrs}>\n <div\n className=\"aegis-blast-radius__track\"\n role=\"meter\"\n aria-label={ariaLabel}\n aria-labelledby={labelledBy}\n aria-describedby={describedBy}\n aria-valuenow={clamped}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuetext={centerLabel ?? `${clamped.toString()}%`}\n >\n <div\n className=\"aegis-blast-radius__fill\"\n style={{ width: `${clamped}%` }}\n />\n </div>\n {!hideTicks && (\n <div className=\"aegis-blast-radius__ticks\">\n <span className=\"aegis-blast-radius__tick\">0%</span>\n {centerLabel && (\n <span className=\"aegis-blast-radius__tick aegis-blast-radius__tick--center\">\n {centerLabel}\n </span>\n )}\n <span className=\"aegis-blast-radius__tick\">100%</span>\n </div>\n )}\n </div>\n );\n}\n"],"names":["BlastRadiusBar","value","ariaLabel","labelledBy","centerLabel","hideTicks","describedBy","className","surface","wrapRef","useRef","agentAttrs","usePrimitiveSurface","clamped","cls","jsx","jsxs"],"mappings":"kOA2CO,SAASA,EAAe,CAC7B,MAAAC,EACA,UAAAC,EACA,kBAAmBC,EACnB,YAAAC,EACA,UAAAC,EAAY,GACZ,mBAAoBC,EACpB,UAAAC,EACA,QAAAC,CACF,EAAwB,CACtB,MAAMC,EAAUC,EAAAA,OAAuB,IAAI,EACrCC,EAAaC,EAAAA,oBACjBJ,EACA,CAAE,MAAAP,EAAO,YAAAG,CAAA,EACT,SACAK,CAAA,EAEII,EAAU,KAAK,IAAI,EAAG,KAAK,IAAI,IAAKZ,CAAK,CAAC,EAC1Ca,EAAM,CAAC,qBAAsBP,GAAa,EAAE,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAE5E,cACG,MAAA,CAAI,IAAKE,EAAS,UAAWK,EAAM,GAAGH,EACrC,SAAA,CAAAI,EAAAA,IAAC,MAAA,CACC,UAAU,4BACV,KAAK,QACL,aAAYb,EACZ,kBAAiBC,EACjB,mBAAkBG,EAClB,gBAAeO,EACf,gBAAe,EACf,gBAAe,IACf,iBAAgBT,GAAe,GAAGS,EAAQ,UAAU,IAEpD,SAAAE,EAAAA,IAAC,MAAA,CACC,UAAU,2BACV,MAAO,CAAE,MAAO,GAAGF,CAAO,GAAA,CAAI,CAAA,CAChC,CAAA,EAED,CAACR,GACAW,EAAAA,KAAC,MAAA,CAAI,UAAU,4BACb,SAAA,CAAAD,EAAAA,IAAC,OAAA,CAAK,UAAU,2BAA2B,SAAA,KAAE,EAC5CX,GACCW,EAAAA,IAAC,OAAA,CAAK,UAAU,4DACb,SAAAX,EACH,EAEFW,EAAAA,IAAC,OAAA,CAAK,UAAU,2BAA2B,SAAA,MAAA,CAAI,CAAA,CAAA,CACjD,CAAA,EAEJ,CAEJ"}
|
|
@@ -3,17 +3,29 @@ export type BlastRadiusBarSurface = PrimitiveSurface<{
|
|
|
3
3
|
value: number;
|
|
4
4
|
centerLabel?: string;
|
|
5
5
|
}>;
|
|
6
|
-
interface
|
|
6
|
+
interface BlastRadiusBarBaseProps {
|
|
7
7
|
/** 0 – 100 */
|
|
8
8
|
value: number;
|
|
9
|
-
/** Names the measure for assistive technology, e.g. "Estimated blast radius". */
|
|
10
|
-
label: string;
|
|
11
9
|
/** Optional descriptive label for the current value (right-aligned, mid). */
|
|
12
10
|
centerLabel?: string;
|
|
13
11
|
/** Hide the 0 / 100 endpoints. */
|
|
14
12
|
hideTicks?: boolean;
|
|
13
|
+
/** Ids of the text that describes the measure, such as a FormRow's description. */
|
|
14
|
+
'aria-describedby'?: string;
|
|
15
15
|
className?: string;
|
|
16
16
|
surface?: BlastRadiusBarSurface;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
type BlastRadiusBarProps = BlastRadiusBarBaseProps & ({
|
|
19
|
+
/** Accessible name of the measure, e.g. "Estimated blast radius". */
|
|
20
|
+
ariaLabel: string;
|
|
21
|
+
'aria-labelledby'?: never;
|
|
22
|
+
} | {
|
|
23
|
+
/**
|
|
24
|
+
* Id of visible text that names the measure, such as a FormRow's
|
|
25
|
+
* label (`${controlId}-label` with `labelBy='aria-labelledby'`).
|
|
26
|
+
*/
|
|
27
|
+
'aria-labelledby': string;
|
|
28
|
+
ariaLabel?: never;
|
|
29
|
+
});
|
|
30
|
+
export declare function BlastRadiusBar({ value, ariaLabel, 'aria-labelledby': labelledBy, centerLabel, hideTicks, 'aria-describedby': describedBy, className, surface, }: BlastRadiusBarProps): import("react/jsx-runtime").JSX.Element;
|
|
19
31
|
export {};
|
|
@@ -1,49 +1,53 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { usePrimitiveSurface as
|
|
1
|
+
import { jsxs as l, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as _ } from "react";
|
|
3
|
+
import { usePrimitiveSurface as f } from "../../agent/core/usePrimitiveSurface.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
function
|
|
6
|
-
value:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
function N({
|
|
6
|
+
value: e,
|
|
7
|
+
ariaLabel: t,
|
|
8
|
+
"aria-labelledby": c,
|
|
9
|
+
centerLabel: i,
|
|
10
|
+
hideTicks: d = !1,
|
|
11
|
+
"aria-describedby": m,
|
|
12
|
+
className: n,
|
|
13
|
+
surface: o
|
|
12
14
|
}) {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
{ value:
|
|
15
|
+
const r = _(null), u = f(
|
|
16
|
+
o,
|
|
17
|
+
{ value: e, centerLabel: i },
|
|
16
18
|
"metric",
|
|
17
|
-
|
|
18
|
-
),
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
r
|
|
20
|
+
), s = Math.max(0, Math.min(100, e)), b = ["aegis-blast-radius", n ?? ""].filter(Boolean).join(" ");
|
|
21
|
+
return /* @__PURE__ */ l("div", { ref: r, className: b, ...u, children: [
|
|
20
22
|
/* @__PURE__ */ a(
|
|
21
23
|
"div",
|
|
22
24
|
{
|
|
23
25
|
className: "aegis-blast-radius__track",
|
|
24
26
|
role: "meter",
|
|
25
|
-
"aria-label":
|
|
26
|
-
"aria-
|
|
27
|
+
"aria-label": t,
|
|
28
|
+
"aria-labelledby": c,
|
|
29
|
+
"aria-describedby": m,
|
|
30
|
+
"aria-valuenow": s,
|
|
27
31
|
"aria-valuemin": 0,
|
|
28
32
|
"aria-valuemax": 100,
|
|
29
|
-
"aria-valuetext":
|
|
33
|
+
"aria-valuetext": i ?? `${s.toString()}%`,
|
|
30
34
|
children: /* @__PURE__ */ a(
|
|
31
35
|
"div",
|
|
32
36
|
{
|
|
33
37
|
className: "aegis-blast-radius__fill",
|
|
34
|
-
style: { width: `${
|
|
38
|
+
style: { width: `${s}%` }
|
|
35
39
|
}
|
|
36
40
|
)
|
|
37
41
|
}
|
|
38
42
|
),
|
|
39
|
-
!
|
|
43
|
+
!d && /* @__PURE__ */ l("div", { className: "aegis-blast-radius__ticks", children: [
|
|
40
44
|
/* @__PURE__ */ a("span", { className: "aegis-blast-radius__tick", children: "0%" }),
|
|
41
|
-
|
|
45
|
+
i && /* @__PURE__ */ a("span", { className: "aegis-blast-radius__tick aegis-blast-radius__tick--center", children: i }),
|
|
42
46
|
/* @__PURE__ */ a("span", { className: "aegis-blast-radius__tick", children: "100%" })
|
|
43
47
|
] })
|
|
44
48
|
] });
|
|
45
49
|
}
|
|
46
50
|
export {
|
|
47
|
-
|
|
51
|
+
N as BlastRadiusBar
|
|
48
52
|
};
|
|
49
53
|
//# sourceMappingURL=BlastRadiusBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlastRadiusBar.js","sources":["../../../src/components/ui/BlastRadiusBar.tsx"],"sourcesContent":["import { useRef } from 'react';\n\nimport {\n type PrimitiveSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport './BlastRadiusBar.css';\n\nexport type BlastRadiusBarSurface = PrimitiveSurface<{\n value: number;\n centerLabel?: string;\n}>;\n\ninterface
|
|
1
|
+
{"version":3,"file":"BlastRadiusBar.js","sources":["../../../src/components/ui/BlastRadiusBar.tsx"],"sourcesContent":["import { useRef } from 'react';\n\nimport {\n type PrimitiveSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport './BlastRadiusBar.css';\n\nexport type BlastRadiusBarSurface = PrimitiveSurface<{\n value: number;\n centerLabel?: string;\n}>;\n\ninterface BlastRadiusBarBaseProps {\n /** 0 – 100 */\n value: number;\n /** Optional descriptive label for the current value (right-aligned, mid). */\n centerLabel?: string;\n /** Hide the 0 / 100 endpoints. */\n hideTicks?: boolean;\n /** Ids of the text that describes the measure, such as a FormRow's description. */\n 'aria-describedby'?: string;\n className?: string;\n surface?: BlastRadiusBarSurface;\n}\n\ntype BlastRadiusBarProps = BlastRadiusBarBaseProps &\n (\n | {\n /** Accessible name of the measure, e.g. \"Estimated blast radius\". */\n ariaLabel: string;\n 'aria-labelledby'?: never;\n }\n | {\n /**\n * Id of visible text that names the measure, such as a FormRow's\n * label (`${controlId}-label` with `labelBy='aria-labelledby'`).\n */\n 'aria-labelledby': string;\n ariaLabel?: never;\n }\n );\n\nexport function BlastRadiusBar({\n value,\n ariaLabel,\n 'aria-labelledby': labelledBy,\n centerLabel,\n hideTicks = false,\n 'aria-describedby': describedBy,\n className,\n surface,\n}: BlastRadiusBarProps) {\n const wrapRef = useRef<HTMLDivElement>(null);\n const agentAttrs = usePrimitiveSurface(\n surface,\n { value, centerLabel },\n 'metric',\n wrapRef,\n );\n const clamped = Math.max(0, Math.min(100, value));\n const cls = ['aegis-blast-radius', className ?? ''].filter(Boolean).join(' ');\n\n return (\n <div ref={wrapRef} className={cls} {...agentAttrs}>\n <div\n className=\"aegis-blast-radius__track\"\n role=\"meter\"\n aria-label={ariaLabel}\n aria-labelledby={labelledBy}\n aria-describedby={describedBy}\n aria-valuenow={clamped}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuetext={centerLabel ?? `${clamped.toString()}%`}\n >\n <div\n className=\"aegis-blast-radius__fill\"\n style={{ width: `${clamped}%` }}\n />\n </div>\n {!hideTicks && (\n <div className=\"aegis-blast-radius__ticks\">\n <span className=\"aegis-blast-radius__tick\">0%</span>\n {centerLabel && (\n <span className=\"aegis-blast-radius__tick aegis-blast-radius__tick--center\">\n {centerLabel}\n </span>\n )}\n <span className=\"aegis-blast-radius__tick\">100%</span>\n </div>\n )}\n </div>\n );\n}\n"],"names":["BlastRadiusBar","value","ariaLabel","labelledBy","centerLabel","hideTicks","describedBy","className","surface","wrapRef","useRef","agentAttrs","usePrimitiveSurface","clamped","cls","jsx","jsxs"],"mappings":";;;;AA2CO,SAASA,EAAe;AAAA,EAC7B,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,mBAAmBC;AAAA,EACnB,aAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,oBAAoBC;AAAA,EACpB,WAAAC;AAAA,EACA,SAAAC;AACF,GAAwB;AACtB,QAAMC,IAAUC,EAAuB,IAAI,GACrCC,IAAaC;AAAA,IACjBJ;AAAA,IACA,EAAE,OAAAP,GAAO,aAAAG,EAAA;AAAA,IACT;AAAA,IACAK;AAAA,EAAA,GAEII,IAAU,KAAK,IAAI,GAAG,KAAK,IAAI,KAAKZ,CAAK,CAAC,GAC1Ca,IAAM,CAAC,sBAAsBP,KAAa,EAAE,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE5E,2BACG,OAAA,EAAI,KAAKE,GAAS,WAAWK,GAAM,GAAGH,GACrC,UAAA;AAAA,IAAA,gBAAAI;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,MAAK;AAAA,QACL,cAAYb;AAAA,QACZ,mBAAiBC;AAAA,QACjB,oBAAkBG;AAAA,QAClB,iBAAeO;AAAA,QACf,iBAAe;AAAA,QACf,iBAAe;AAAA,QACf,kBAAgBT,KAAe,GAAGS,EAAQ,UAAU;AAAA,QAEpD,UAAA,gBAAAE;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO,EAAE,OAAO,GAAGF,CAAO,IAAA;AAAA,UAAI;AAAA,QAAA;AAAA,MAChC;AAAA,IAAA;AAAA,IAED,CAACR,KACA,gBAAAW,EAAC,OAAA,EAAI,WAAU,6BACb,UAAA;AAAA,MAAA,gBAAAD,EAAC,QAAA,EAAK,WAAU,4BAA2B,UAAA,MAAE;AAAA,MAC5CX,KACC,gBAAAW,EAAC,QAAA,EAAK,WAAU,6DACb,UAAAX,GACH;AAAA,MAEF,gBAAAW,EAAC,QAAA,EAAK,WAAU,4BAA2B,UAAA,OAAA,CAAI;AAAA,IAAA,EAAA,CACjD;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.cjs","sources":["../../../src/components/ui/Button.tsx"],"sourcesContent":["import {\n type ButtonHTMLAttributes,\n type MouseEvent,\n type ReactNode,\n forwardRef,\n useCallback,\n} from 'react';\n\nimport { useAegisAction } from '../../agent/core/hooks';\nimport type { AegisAction } from '../../agent/core/types';\nimport './Button.css';\nimport { DefaultLink, type LinkComponent } from './linkComponent';\n\nexport type ButtonTone
|
|
1
|
+
{"version":3,"file":"Button.cjs","sources":["../../../src/components/ui/Button.tsx"],"sourcesContent":["import {\n type ButtonHTMLAttributes,\n type MouseEvent,\n type ReactNode,\n forwardRef,\n useCallback,\n} from 'react';\n\nimport { useAegisAction } from '../../agent/core/hooks';\nimport type { AegisAction } from '../../agent/core/types';\nimport './Button.css';\nimport { DefaultLink, type LinkComponent } from './linkComponent';\n\nexport type ButtonTone =\n | 'primary'\n | 'secondary'\n | 'ghost'\n | 'glass'\n | 'caution';\n\ntype ButtonIconPosition = 'start' | 'end';\n\ninterface ButtonLookProps {\n children: ReactNode;\n /**\n * Visual treatment. `glass` is the secondary button frosted for a tinted,\n * gradient or image background. `caution` is a destructive or\n * irreversible action, e.g. delete: the caution wash and border, never\n * the anomaly red, which marks failures.\n */\n tone?: ButtonTone;\n /** Icon beside the label, sized to the button's icon slot. */\n icon?: ReactNode;\n /** Side of the label the icon sits on. */\n iconPosition?: ButtonIconPosition;\n}\n\nfunction buttonClassName(\n tone: ButtonTone,\n className: string | undefined,\n): string {\n return ['aegis-button', `aegis-button--${tone}`, className ?? '']\n .filter(Boolean)\n .join(' ');\n}\n\nfunction ButtonContent({\n children,\n icon,\n iconPosition,\n}: Pick<ButtonLookProps, 'children' | 'icon'> & {\n iconPosition: ButtonIconPosition;\n}) {\n const iconSlot =\n icon === undefined ? null : (\n <span className=\"aegis-button__icon\" aria-hidden=\"true\">\n {icon}\n </span>\n );\n return (\n <>\n {iconPosition === 'start' && iconSlot}\n {children}\n {iconPosition === 'end' && iconSlot}\n </>\n );\n}\n\ntype NativeButtonProps = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'type' | 'children'\n>;\n\ninterface ButtonProps extends NativeButtonProps, ButtonLookProps {\n /** Optional aegis-ui agent action — also wires the agent runtime. */\n action?: AegisAction<void, unknown>;\n /** Native HTML button type. */\n type?: 'button' | 'submit' | 'reset';\n}\n\n/** A toggle button passes `aria-pressed`; the pressed state is the inverted fill. */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n children,\n tone = 'primary',\n icon,\n iconPosition = 'start',\n action,\n onClick,\n disabled,\n className,\n type = 'button',\n title,\n ...rest\n },\n ref,\n ) => {\n const bound = useAegisAction<void, unknown>(action);\n const isUnavailable = action ? !bound.available : false;\n\n const handleClick = useCallback(\n (event: MouseEvent<HTMLButtonElement>): void => {\n onClick?.(event);\n if (event.defaultPrevented) {\n return;\n }\n if (action) {\n void bound.invoke();\n }\n },\n [onClick, action, bound],\n );\n\n const resolvedTitle =\n title ?? (isUnavailable ? bound.unavailableReason : undefined);\n\n return (\n <button\n ref={ref}\n type={type}\n className={buttonClassName(tone, className)}\n disabled={disabled ?? isUnavailable}\n title={resolvedTitle}\n data-agent-action-id={action?.id}\n onClick={handleClick}\n {...rest}\n >\n <ButtonContent icon={icon} iconPosition={iconPosition}>\n {children}\n </ButtonContent>\n </button>\n );\n },\n);\nButton.displayName = 'Button';\n\ninterface ButtonLinkProps extends ButtonLookProps {\n /** Destination; the control navigates instead of firing a handler. */\n to: string;\n /** Renders the link. Defaults to an `<a href>`; routed apps pass their Link adapter. */\n linkComponent?: LinkComponent;\n className?: string;\n}\n\n/** A link that looks like a Button, for actions that open another page. */\nexport function ButtonLink({\n to,\n children,\n tone = 'primary',\n icon,\n iconPosition = 'start',\n linkComponent,\n className,\n}: ButtonLinkProps) {\n const LinkImpl = linkComponent ?? DefaultLink;\n return (\n <LinkImpl to={to} className={buttonClassName(tone, className)}>\n <ButtonContent icon={icon} iconPosition={iconPosition}>\n {children}\n </ButtonContent>\n </LinkImpl>\n );\n}\n"],"names":["buttonClassName","tone","className","ButtonContent","children","icon","iconPosition","iconSlot","jsx","jsxs","Fragment","Button","forwardRef","action","onClick","disabled","type","title","rest","ref","bound","useAegisAction","isUnavailable","handleClick","useCallback","event","resolvedTitle","ButtonLink","to","linkComponent","LinkImpl","DefaultLink"],"mappings":"mPAqCA,SAASA,EACPC,EACAC,EACQ,CACR,MAAO,CAAC,eAAgB,iBAAiBD,CAAI,GAAIC,GAAa,EAAE,EAC7D,OAAO,OAAO,EACd,KAAK,GAAG,CACb,CAEA,SAASC,EAAc,CACrB,SAAAC,EACA,KAAAC,EACA,aAAAC,CACF,EAEG,CACD,MAAMC,EACJF,IAAS,OAAY,KACnBG,EAAAA,IAAC,QAAK,UAAU,qBAAqB,cAAY,OAC9C,SAAAH,CAAA,CACH,EAEJ,OACEI,EAAAA,KAAAC,WAAA,CACG,SAAA,CAAAJ,IAAiB,SAAWC,EAC5BH,EACAE,IAAiB,OAASC,CAAA,EAC7B,CAEJ,CAeO,MAAMI,EAASC,EAAAA,WACpB,CACE,CACE,SAAAR,EACA,KAAAH,EAAO,UACP,KAAAI,EACA,aAAAC,EAAe,QACf,OAAAO,EACA,QAAAC,EACA,SAAAC,EACA,UAAAb,EACA,KAAAc,EAAO,SACP,MAAAC,EACA,GAAGC,CAAA,EAELC,IACG,CACH,MAAMC,EAAQC,EAAAA,eAA8BR,CAAM,EAC5CS,EAAgBT,EAAS,CAACO,EAAM,UAAY,GAE5CG,EAAcC,EAAAA,YACjBC,GAA+C,CAC9CX,IAAUW,CAAK,EACX,CAAAA,EAAM,kBAGNZ,GACGO,EAAM,OAAA,CAEf,EACA,CAACN,EAASD,EAAQO,CAAK,CAAA,EAGnBM,EACJT,IAAUK,EAAgBF,EAAM,kBAAoB,QAEtD,OACEZ,EAAAA,IAAC,SAAA,CACC,IAAAW,EACA,KAAAH,EACA,UAAWhB,EAAgBC,EAAMC,CAAS,EAC1C,SAAUa,GAAYO,EACtB,MAAOI,EACP,uBAAsBb,GAAQ,GAC9B,QAASU,EACR,GAAGL,EAEJ,SAAAV,EAAAA,IAACL,EAAA,CAAc,KAAAE,EAAY,aAAAC,EACxB,SAAAF,CAAA,CACH,CAAA,CAAA,CAGN,CACF,EACAO,EAAO,YAAc,SAWd,SAASgB,EAAW,CACzB,GAAAC,EACA,SAAAxB,EACA,KAAAH,EAAO,UACP,KAAAI,EACA,aAAAC,EAAe,QAAA,cACfuB,EACA,UAAA3B,CACF,EAAoB,CAClB,MAAM4B,EAAWD,GAAiBE,EAAAA,YAClC,OACEvB,EAAAA,IAACsB,EAAA,CAAS,GAAAF,EAAQ,UAAW5B,EAAgBC,EAAMC,CAAS,EAC1D,SAAAM,EAAAA,IAACL,EAAA,CAAc,KAAAE,EAAY,aAAAC,EACxB,SAAAF,EACH,EACF,CAEJ"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { AegisAction } from '../../agent/core/types';
|
|
3
3
|
import { LinkComponent } from './linkComponent';
|
|
4
|
-
export type ButtonTone = 'primary' | 'secondary' | 'ghost' | 'glass';
|
|
4
|
+
export type ButtonTone = 'primary' | 'secondary' | 'ghost' | 'glass' | 'caution';
|
|
5
5
|
type ButtonIconPosition = 'start' | 'end';
|
|
6
6
|
interface ButtonLookProps {
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
/**
|
|
9
9
|
* Visual treatment. `glass` is the secondary button frosted for a tinted,
|
|
10
|
-
* gradient or image background.
|
|
10
|
+
* gradient or image background. `caution` is a destructive or
|
|
11
|
+
* irreversible action, e.g. delete: the caution wash and border, never
|
|
12
|
+
* the anomaly red, which marks failures.
|
|
11
13
|
*/
|
|
12
14
|
tone?: ButtonTone;
|
|
13
15
|
/** Icon beside the label, sized to the button's icon slot. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../src/components/ui/Button.tsx"],"sourcesContent":["import {\n type ButtonHTMLAttributes,\n type MouseEvent,\n type ReactNode,\n forwardRef,\n useCallback,\n} from 'react';\n\nimport { useAegisAction } from '../../agent/core/hooks';\nimport type { AegisAction } from '../../agent/core/types';\nimport './Button.css';\nimport { DefaultLink, type LinkComponent } from './linkComponent';\n\nexport type ButtonTone
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../src/components/ui/Button.tsx"],"sourcesContent":["import {\n type ButtonHTMLAttributes,\n type MouseEvent,\n type ReactNode,\n forwardRef,\n useCallback,\n} from 'react';\n\nimport { useAegisAction } from '../../agent/core/hooks';\nimport type { AegisAction } from '../../agent/core/types';\nimport './Button.css';\nimport { DefaultLink, type LinkComponent } from './linkComponent';\n\nexport type ButtonTone =\n | 'primary'\n | 'secondary'\n | 'ghost'\n | 'glass'\n | 'caution';\n\ntype ButtonIconPosition = 'start' | 'end';\n\ninterface ButtonLookProps {\n children: ReactNode;\n /**\n * Visual treatment. `glass` is the secondary button frosted for a tinted,\n * gradient or image background. `caution` is a destructive or\n * irreversible action, e.g. delete: the caution wash and border, never\n * the anomaly red, which marks failures.\n */\n tone?: ButtonTone;\n /** Icon beside the label, sized to the button's icon slot. */\n icon?: ReactNode;\n /** Side of the label the icon sits on. */\n iconPosition?: ButtonIconPosition;\n}\n\nfunction buttonClassName(\n tone: ButtonTone,\n className: string | undefined,\n): string {\n return ['aegis-button', `aegis-button--${tone}`, className ?? '']\n .filter(Boolean)\n .join(' ');\n}\n\nfunction ButtonContent({\n children,\n icon,\n iconPosition,\n}: Pick<ButtonLookProps, 'children' | 'icon'> & {\n iconPosition: ButtonIconPosition;\n}) {\n const iconSlot =\n icon === undefined ? null : (\n <span className=\"aegis-button__icon\" aria-hidden=\"true\">\n {icon}\n </span>\n );\n return (\n <>\n {iconPosition === 'start' && iconSlot}\n {children}\n {iconPosition === 'end' && iconSlot}\n </>\n );\n}\n\ntype NativeButtonProps = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'type' | 'children'\n>;\n\ninterface ButtonProps extends NativeButtonProps, ButtonLookProps {\n /** Optional aegis-ui agent action — also wires the agent runtime. */\n action?: AegisAction<void, unknown>;\n /** Native HTML button type. */\n type?: 'button' | 'submit' | 'reset';\n}\n\n/** A toggle button passes `aria-pressed`; the pressed state is the inverted fill. */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n children,\n tone = 'primary',\n icon,\n iconPosition = 'start',\n action,\n onClick,\n disabled,\n className,\n type = 'button',\n title,\n ...rest\n },\n ref,\n ) => {\n const bound = useAegisAction<void, unknown>(action);\n const isUnavailable = action ? !bound.available : false;\n\n const handleClick = useCallback(\n (event: MouseEvent<HTMLButtonElement>): void => {\n onClick?.(event);\n if (event.defaultPrevented) {\n return;\n }\n if (action) {\n void bound.invoke();\n }\n },\n [onClick, action, bound],\n );\n\n const resolvedTitle =\n title ?? (isUnavailable ? bound.unavailableReason : undefined);\n\n return (\n <button\n ref={ref}\n type={type}\n className={buttonClassName(tone, className)}\n disabled={disabled ?? isUnavailable}\n title={resolvedTitle}\n data-agent-action-id={action?.id}\n onClick={handleClick}\n {...rest}\n >\n <ButtonContent icon={icon} iconPosition={iconPosition}>\n {children}\n </ButtonContent>\n </button>\n );\n },\n);\nButton.displayName = 'Button';\n\ninterface ButtonLinkProps extends ButtonLookProps {\n /** Destination; the control navigates instead of firing a handler. */\n to: string;\n /** Renders the link. Defaults to an `<a href>`; routed apps pass their Link adapter. */\n linkComponent?: LinkComponent;\n className?: string;\n}\n\n/** A link that looks like a Button, for actions that open another page. */\nexport function ButtonLink({\n to,\n children,\n tone = 'primary',\n icon,\n iconPosition = 'start',\n linkComponent,\n className,\n}: ButtonLinkProps) {\n const LinkImpl = linkComponent ?? DefaultLink;\n return (\n <LinkImpl to={to} className={buttonClassName(tone, className)}>\n <ButtonContent icon={icon} iconPosition={iconPosition}>\n {children}\n </ButtonContent>\n </LinkImpl>\n );\n}\n"],"names":["buttonClassName","tone","className","ButtonContent","children","icon","iconPosition","iconSlot","jsx","jsxs","Fragment","Button","forwardRef","action","onClick","disabled","type","title","rest","ref","bound","useAegisAction","isUnavailable","handleClick","useCallback","event","resolvedTitle","ButtonLink","to","linkComponent","DefaultLink"],"mappings":";;;;;AAqCA,SAASA,EACPC,GACAC,GACQ;AACR,SAAO,CAAC,gBAAgB,iBAAiBD,CAAI,IAAIC,KAAa,EAAE,EAC7D,OAAO,OAAO,EACd,KAAK,GAAG;AACb;AAEA,SAASC,EAAc;AAAA,EACrB,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AACF,GAEG;AACD,QAAMC,IACJF,MAAS,SAAY,OACnB,gBAAAG,EAAC,UAAK,WAAU,sBAAqB,eAAY,QAC9C,UAAAH,EAAA,CACH;AAEJ,SACE,gBAAAI,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAJ,MAAiB,WAAWC;AAAA,IAC5BH;AAAA,IACAE,MAAiB,SAASC;AAAA,EAAA,GAC7B;AAEJ;AAeO,MAAMI,IAASC;AAAA,EACpB,CACE;AAAA,IACE,UAAAR;AAAA,IACA,MAAAH,IAAO;AAAA,IACP,MAAAI;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,QAAAO;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAb;AAAA,IACA,MAAAc,IAAO;AAAA,IACP,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAAQC,EAA8BR,CAAM,GAC5CS,IAAgBT,IAAS,CAACO,EAAM,YAAY,IAE5CG,IAAcC;AAAA,MAClB,CAACC,MAA+C;AAE9C,QADAX,IAAUW,CAAK,GACX,CAAAA,EAAM,oBAGNZ,KACGO,EAAM,OAAA;AAAA,MAEf;AAAA,MACA,CAACN,GAASD,GAAQO,CAAK;AAAA,IAAA,GAGnBM,IACJT,MAAUK,IAAgBF,EAAM,oBAAoB;AAEtD,WACE,gBAAAZ;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAW;AAAA,QACA,MAAAH;AAAA,QACA,WAAWhB,EAAgBC,GAAMC,CAAS;AAAA,QAC1C,UAAUa,KAAYO;AAAA,QACtB,OAAOI;AAAA,QACP,wBAAsBb,GAAQ;AAAA,QAC9B,SAASU;AAAA,QACR,GAAGL;AAAA,QAEJ,UAAA,gBAAAV,EAACL,GAAA,EAAc,MAAAE,GAAY,cAAAC,GACxB,UAAAF,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACAO,EAAO,cAAc;AAWd,SAASgB,EAAW;AAAA,EACzB,IAAAC;AAAA,EACA,UAAAxB;AAAA,EACA,MAAAH,IAAO;AAAA,EACP,MAAAI;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,eAAAuB;AAAA,EACA,WAAA3B;AACF,GAAoB;AAElB,SACE,gBAAAM,EAFeqB,KAAiBC,GAE/B,EAAS,IAAAF,GAAQ,WAAW5B,EAAgBC,GAAMC,CAAS,GAC1D,UAAA,gBAAAM,EAACL,GAAA,EAAc,MAAAE,GAAY,cAAAC,GACxB,UAAAF,GACH,GACF;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),m=require("react");;/* empty css */
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),m=require("react");;/* empty css */const f=require("../../locale/useStrings.cjs");function b({onSend:n,sending:i=!1,placeholder:d,disabledReason:r,className:h}){const a=f.useStrings(),[t,c]=m.useState(""),l=!!r,o=!i&&!l&&t.trim().length>0,u=m.useCallback(()=>{if(!o)return;const e=t.trim();c(""),Promise.resolve(n(e))},[o,n,t]),g=e=>{c(e.target.value)},p=e=>{e.nativeEvent.isComposing||e.keyCode===229||e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),u())},_=["aegis-composer",h??""].filter(Boolean).join(" ");return s.jsxs("form",{className:_,onSubmit:e=>{e.preventDefault(),u()},children:[r&&s.jsx("div",{className:"aegis-composer__banner",role:"status",children:r}),s.jsxs("div",{className:"aegis-composer__row",children:[s.jsx("textarea",{className:"aegis-composer__input",value:t,onChange:g,onKeyDown:p,placeholder:d??a.chatPlaceholder,disabled:l,rows:2,"aria-label":a.chatMessage}),s.jsx("button",{type:"submit",className:"aegis-composer__send",disabled:!o,"aria-label":a.chatSendMessage,children:i?s.jsx("span",{className:"aegis-composer__sending","aria-hidden":"true"}):a.send})]}),s.jsx("div",{className:"aegis-composer__hint",children:a.chatHint})]})}exports.ChatComposer=b;
|
|
2
2
|
//# sourceMappingURL=ChatComposer.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatComposer.cjs","sources":["../../../src/components/ui/ChatComposer.tsx"],"sourcesContent":["import {\n type ChangeEvent,\n type KeyboardEvent,\n useCallback,\n useState,\n} from 'react';\n\nimport './ChatComposer.css';\n\ninterface ChatComposerProps {\n onSend: (content: string) => void | Promise<void>;\n sending?: boolean;\n placeholder?: string;\n /** Optional disabled state with a reason shown in a small banner. */\n disabledReason?: string;\n className?: string;\n}\n\nexport function ChatComposer({\n onSend,\n sending = false,\n placeholder
|
|
1
|
+
{"version":3,"file":"ChatComposer.cjs","sources":["../../../src/components/ui/ChatComposer.tsx"],"sourcesContent":["import {\n type ChangeEvent,\n type KeyboardEvent,\n useCallback,\n useState,\n} from 'react';\n\nimport { useStrings } from '../../locale';\nimport './ChatComposer.css';\n\ninterface ChatComposerProps {\n onSend: (content: string) => void | Promise<void>;\n sending?: boolean;\n placeholder?: string;\n /** Optional disabled state with a reason shown in a small banner. */\n disabledReason?: string;\n className?: string;\n}\n\nexport function ChatComposer({\n onSend,\n sending = false,\n placeholder,\n disabledReason,\n className,\n}: ChatComposerProps) {\n const strings = useStrings();\n const [value, setValue] = useState('');\n const disabled = Boolean(disabledReason);\n const canSend = !sending && !disabled && value.trim().length > 0;\n\n const submit = useCallback((): void => {\n if (!canSend) {\n return;\n }\n const text = value.trim();\n setValue('');\n void Promise.resolve(onSend(text));\n }, [canSend, onSend, value]);\n\n const handleChange = (event: ChangeEvent<HTMLTextAreaElement>): void => {\n setValue(event.target.value);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>): void => {\n // The Enter that confirms an IME candidate belongs to the composition.\n // Safari reports it after compositionend, so only its keyCode 229 tells.\n if (event.nativeEvent.isComposing || event.keyCode === 229) {\n return;\n }\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n submit();\n }\n };\n\n const cls = ['aegis-composer', className ?? ''].filter(Boolean).join(' ');\n\n return (\n <form\n className={cls}\n onSubmit={(event) => {\n event.preventDefault();\n submit();\n }}\n >\n {disabledReason && (\n <div className=\"aegis-composer__banner\" role=\"status\">\n {disabledReason}\n </div>\n )}\n <div className=\"aegis-composer__row\">\n <textarea\n className=\"aegis-composer__input\"\n value={value}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n placeholder={placeholder ?? strings.chatPlaceholder}\n disabled={disabled}\n rows={2}\n aria-label={strings.chatMessage}\n />\n <button\n type=\"submit\"\n className=\"aegis-composer__send\"\n disabled={!canSend}\n aria-label={strings.chatSendMessage}\n >\n {sending ? (\n <span className=\"aegis-composer__sending\" aria-hidden=\"true\" />\n ) : (\n strings.send\n )}\n </button>\n </div>\n <div className=\"aegis-composer__hint\">{strings.chatHint}</div>\n </form>\n );\n}\n"],"names":["ChatComposer","onSend","sending","placeholder","disabledReason","className","strings","useStrings","value","setValue","useState","disabled","canSend","submit","useCallback","text","handleChange","event","handleKeyDown","cls","jsxs","jsx"],"mappings":"yNAmBO,SAASA,EAAa,CAC3B,OAAAC,EACA,QAAAC,EAAU,GACV,YAAAC,EACA,eAAAC,EACA,UAAAC,CACF,EAAsB,CACpB,MAAMC,EAAUC,EAAAA,WAAA,EACV,CAACC,EAAOC,CAAQ,EAAIC,EAAAA,SAAS,EAAE,EAC/BC,EAAW,EAAQP,EACnBQ,EAAU,CAACV,GAAW,CAACS,GAAYH,EAAM,KAAA,EAAO,OAAS,EAEzDK,EAASC,EAAAA,YAAY,IAAY,CACrC,GAAI,CAACF,EACH,OAEF,MAAMG,EAAOP,EAAM,KAAA,EACnBC,EAAS,EAAE,EACN,QAAQ,QAAQR,EAAOc,CAAI,CAAC,CACnC,EAAG,CAACH,EAASX,EAAQO,CAAK,CAAC,EAErBQ,EAAgBC,GAAkD,CACtER,EAASQ,EAAM,OAAO,KAAK,CAC7B,EAEMC,EAAiBD,GAAoD,CAGrEA,EAAM,YAAY,aAAeA,EAAM,UAAY,KAGnDA,EAAM,MAAQ,SAAW,CAACA,EAAM,WAClCA,EAAM,eAAA,EACNJ,EAAA,EAEJ,EAEMM,EAAM,CAAC,iBAAkBd,GAAa,EAAE,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAExE,OACEe,EAAAA,KAAC,OAAA,CACC,UAAWD,EACX,SAAWF,GAAU,CACnBA,EAAM,eAAA,EACNJ,EAAA,CACF,EAEC,SAAA,CAAAT,SACE,MAAA,CAAI,UAAU,yBAAyB,KAAK,SAC1C,SAAAA,EACH,EAEFgB,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACb,SAAA,CAAAC,EAAAA,IAAC,WAAA,CACC,UAAU,wBACV,MAAAb,EACA,SAAUQ,EACV,UAAWE,EACX,YAAaf,GAAeG,EAAQ,gBACpC,SAAAK,EACA,KAAM,EACN,aAAYL,EAAQ,WAAA,CAAA,EAEtBe,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAU,uBACV,SAAU,CAACT,EACX,aAAYN,EAAQ,gBAEnB,SAAAJ,QACE,OAAA,CAAK,UAAU,0BAA0B,cAAY,OAAO,EAE7DI,EAAQ,IAAA,CAAA,CAEZ,EACF,EACAe,EAAAA,IAAC,MAAA,CAAI,UAAU,uBAAwB,WAAQ,QAAA,CAAS,CAAA,CAAA,CAAA,CAG9D"}
|