@k2b/ui 0.58.0 → 0.60.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/base.css +1 -0
- package/dist/browser/actions/CommandList.js +67 -74
- package/dist/browser/actions/CommandList.js.map +1 -1
- package/dist/browser/actions/ContextMenu.js +16 -4
- package/dist/browser/actions/ContextMenu.js.map +1 -1
- package/dist/browser/actions/Dropdown.js +187 -169
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/GestureMenu.js +18 -7
- package/dist/browser/actions/GestureMenu.js.map +1 -1
- package/dist/browser/actions/SelectionAction.js +232 -0
- package/dist/browser/actions/SelectionAction.js.map +1 -0
- package/dist/browser/actions/Tabs.js +58 -19
- package/dist/browser/actions/Tabs.js.map +1 -1
- package/dist/browser/actions/Toolbar.js +66 -60
- package/dist/browser/actions/Toolbar.js.map +1 -1
- package/dist/browser/actions/ViewTabs.js +89 -73
- package/dist/browser/actions/ViewTabs.js.map +1 -1
- package/dist/browser/actions/command-items.js.map +1 -1
- package/dist/browser/actions/drag-and-drop.js +2 -1
- package/dist/browser/actions/drag-and-drop.js.map +1 -1
- package/dist/browser/actions/index.js +1 -0
- package/dist/browser/actions/index.js.map +1 -1
- package/dist/browser/actions/menu-sheet-open.js +19 -0
- package/dist/browser/actions/menu-sheet-open.js.map +1 -0
- package/dist/browser/charts/core/line-details.js +2 -2
- package/dist/browser/charts/core/line-details.js.map +1 -1
- package/dist/browser/charts/core/render.js +2 -1
- package/dist/browser/charts/core/render.js.map +1 -1
- package/dist/browser/charts/core/snapshot.js +3 -1
- package/dist/browser/charts/core/snapshot.js.map +1 -1
- package/dist/browser/chat/ChatActivityWords.js +142 -0
- package/dist/browser/chat/ChatActivityWords.js.map +1 -0
- package/dist/browser/chat/ChatComposer.js +857 -679
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/chat/ChatComposerQuotes.js +56 -0
- package/dist/browser/chat/ChatComposerQuotes.js.map +1 -0
- package/dist/browser/chat/ChatContextPopup.js +34 -4
- package/dist/browser/chat/ChatContextPopup.js.map +1 -1
- package/dist/browser/chat/ChatPrimitives.js +559 -336
- package/dist/browser/chat/ChatPrimitives.js.map +1 -1
- package/dist/browser/chat/ChatTasks.js +218 -80
- package/dist/browser/chat/ChatTasks.js.map +1 -1
- package/dist/browser/chat/ChatTimeline.js +5 -3
- package/dist/browser/chat/ChatTimeline.js.map +1 -1
- package/dist/browser/chat/chat-behavior.js +12 -0
- package/dist/browser/chat/chat-behavior.js.map +1 -1
- package/dist/browser/chat/chat-messages.js +50 -2
- package/dist/browser/chat/chat-messages.js.map +1 -1
- package/dist/browser/chat/index.js +6 -2
- package/dist/browser/chat/index.js.map +1 -1
- package/dist/browser/chat/types.js.map +1 -1
- package/dist/browser/content/ActivityList.js +789 -0
- package/dist/browser/content/ActivityList.js.map +1 -0
- package/dist/browser/content/Calendar.js +2 -2
- package/dist/browser/content/Calendar.js.map +1 -1
- package/dist/browser/content/CalendarWeekView.js +9 -2
- package/dist/browser/content/CalendarWeekView.js.map +1 -1
- package/dist/browser/content/ChartRoot.js +4 -1
- package/dist/browser/content/ChartRoot.js.map +1 -1
- package/dist/browser/content/DataTable.js +9 -0
- package/dist/browser/content/DataTable.js.map +1 -1
- package/dist/browser/content/DataTableTools.js +3 -0
- package/dist/browser/content/DataTableTools.js.map +1 -1
- package/dist/browser/content/Lightbox.js +4 -2
- package/dist/browser/content/Lightbox.js.map +1 -1
- package/dist/browser/content/MessageQuote.js +57 -0
- package/dist/browser/content/MessageQuote.js.map +1 -0
- package/dist/browser/content/MessageRow.js +413 -391
- package/dist/browser/content/MessageRow.js.map +1 -1
- package/dist/browser/content/PdfPages.js +1 -0
- package/dist/browser/content/PdfPages.js.map +1 -1
- package/dist/browser/content/ProgressPath.js +101 -0
- package/dist/browser/content/ProgressPath.js.map +1 -0
- package/dist/browser/content/Timeline.js +1 -1
- package/dist/browser/content/Timeline.js.map +1 -1
- package/dist/browser/content/VirtualFeed.js +29 -2
- package/dist/browser/content/VirtualFeed.js.map +1 -1
- package/dist/browser/content/activity-messages.js +47 -0
- package/dist/browser/content/activity-messages.js.map +1 -0
- package/dist/browser/content/activity-timeline.js +144 -0
- package/dist/browser/content/activity-timeline.js.map +1 -0
- package/dist/browser/content/chart-tick-room.js +59 -0
- package/dist/browser/content/chart-tick-room.js.map +1 -0
- package/dist/browser/content/chart-time-calendar.js +12 -18
- package/dist/browser/content/chart-time-calendar.js.map +1 -1
- package/dist/browser/content/find-text.js +47 -0
- package/dist/browser/content/find-text.js.map +1 -0
- package/dist/browser/content/index.js +2 -0
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/content/quote-messages.js +25 -0
- package/dist/browser/content/quote-messages.js.map +1 -0
- package/dist/browser/feedback/HoverCard.js +535 -0
- package/dist/browser/feedback/HoverCard.js.map +1 -0
- package/dist/browser/feedback/Tooltip.js +5 -2
- package/dist/browser/feedback/Tooltip.js.map +1 -1
- package/dist/browser/feedback/dialog-core.js +129 -21
- package/dist/browser/feedback/dialog-core.js.map +1 -1
- package/dist/browser/feedback/dialog-frame-motion.js +274 -0
- package/dist/browser/feedback/dialog-frame-motion.js.map +1 -0
- package/dist/browser/feedback/index.js +1 -0
- package/dist/browser/feedback/index.js.map +1 -1
- package/dist/browser/feedback/prompt-confirm.js +3 -17
- package/dist/browser/feedback/prompt-confirm.js.map +1 -1
- package/dist/browser/feedback/prompt-sheet-view.js +96 -0
- package/dist/browser/feedback/prompt-sheet-view.js.map +1 -0
- package/dist/browser/feedback/prompt-sheet.js +36 -0
- package/dist/browser/feedback/prompt-sheet.js.map +1 -0
- package/dist/browser/feedback/prompts.js +63 -91
- package/dist/browser/feedback/prompts.js.map +1 -1
- package/dist/browser/feedback/toast.js +17 -12
- package/dist/browser/feedback/toast.js.map +1 -1
- package/dist/browser/hover-card.js +6 -0
- package/dist/browser/hover-card.js.map +1 -0
- package/dist/browser/inputs/AutocompleteEditor.js +2 -1
- package/dist/browser/inputs/AutocompleteEditor.js.map +1 -1
- package/dist/browser/inputs/AutocompleteSelect.js +3 -12
- package/dist/browser/inputs/AutocompleteSelect.js.map +1 -1
- package/dist/browser/inputs/ChoiceList.js +131 -127
- package/dist/browser/inputs/ChoiceList.js.map +1 -1
- package/dist/browser/inputs/Combobox.js +6 -15
- package/dist/browser/inputs/Combobox.js.map +1 -1
- package/dist/browser/inputs/MultiSelectInput.js +7 -16
- package/dist/browser/inputs/MultiSelectInput.js.map +1 -1
- package/dist/browser/inputs/PeriodPicker.js +475 -252
- package/dist/browser/inputs/PeriodPicker.js.map +1 -1
- package/dist/browser/inputs/RichSelect.js +431 -431
- package/dist/browser/inputs/RichSelect.js.map +1 -1
- package/dist/browser/inputs/Select.js +3 -12
- package/dist/browser/inputs/Select.js.map +1 -1
- package/dist/browser/inputs/SelectChip.js +1 -0
- package/dist/browser/inputs/SelectChip.js.map +1 -1
- package/dist/browser/inputs/TimeInput.js +181 -0
- package/dist/browser/inputs/TimeInput.js.map +1 -0
- package/dist/browser/inputs/choice.js.map +1 -1
- package/dist/browser/inputs/date-picker.js +2 -1
- package/dist/browser/inputs/date-picker.js.map +1 -1
- package/dist/browser/inputs/file-drop.js +2 -0
- package/dist/browser/inputs/file-drop.js.map +1 -1
- package/dist/browser/inputs/index.js +1 -0
- package/dist/browser/inputs/index.js.map +1 -1
- package/dist/browser/inputs/input-messages.js +20 -2
- package/dist/browser/inputs/input-messages.js.map +1 -1
- package/dist/browser/inputs/period-picker-messages.js +20 -2
- package/dist/browser/inputs/period-picker-messages.js.map +1 -1
- package/dist/browser/inputs/period.js +83 -0
- package/dist/browser/inputs/period.js.map +1 -1
- package/dist/browser/inputs/time-input.js +93 -0
- package/dist/browser/inputs/time-input.js.map +1 -0
- package/dist/browser/internal/anchor-placement.js +38 -0
- package/dist/browser/internal/anchor-placement.js.map +1 -0
- package/dist/browser/internal/exit-motion.js +23 -0
- package/dist/browser/internal/exit-motion.js.map +1 -0
- package/dist/browser/internal/option-description.js +47 -0
- package/dist/browser/internal/option-description.js.map +1 -0
- package/dist/browser/internal/portal-scope.js +36 -0
- package/dist/browser/internal/portal-scope.js.map +1 -0
- package/dist/browser/internal/portal.js +13 -10
- package/dist/browser/internal/portal.js.map +1 -1
- package/dist/browser/internal/scroll-places.js +15 -0
- package/dist/browser/internal/scroll-places.js.map +1 -0
- package/dist/browser/intl/messages.js +10 -0
- package/dist/browser/intl/messages.js.map +1 -1
- package/dist/browser/layout/AnchoredPopover.js +10 -25
- package/dist/browser/layout/AnchoredPopover.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +572 -495
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/BottomSheet.js +1 -24
- package/dist/browser/layout/BottomSheet.js.map +1 -1
- package/dist/browser/layout/Discussion.js +298 -3
- package/dist/browser/layout/Discussion.js.map +1 -1
- package/dist/browser/layout/FloatingWindow.js +2 -0
- package/dist/browser/layout/FloatingWindow.js.map +1 -1
- package/dist/browser/layout/Navigation.js +7 -2
- package/dist/browser/layout/Navigation.js.map +1 -1
- package/dist/browser/layout/Panes.js +3 -0
- package/dist/browser/layout/Panes.js.map +1 -1
- package/dist/browser/layout/SidebarSwitcher.js +28 -37
- package/dist/browser/layout/SidebarSwitcher.js.map +1 -1
- package/dist/browser/layout/app-workspace-controller.js +5 -1
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/layout/bottom-sheet-load.js +17 -0
- package/dist/browser/layout/bottom-sheet-load.js.map +1 -0
- package/dist/browser/layout/bottom-sheet-options.js +27 -0
- package/dist/browser/layout/bottom-sheet-options.js.map +1 -0
- package/dist/browser/layout/index.js +2 -1
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/layout/panes-preview-scope.js +9 -0
- package/dist/browser/layout/panes-preview-scope.js.map +1 -0
- package/dist/browser/layout/sheet-handle.js +173 -37
- package/dist/browser/layout/sheet-handle.js.map +1 -1
- package/dist/browser/layout/sheet-motion.js +37 -5
- package/dist/browser/layout/sheet-motion.js.map +1 -1
- package/dist/browser/layout/sidebar-scroll-memory.js +30 -0
- package/dist/browser/layout/sidebar-scroll-memory.js.map +1 -1
- package/dist/browser/panes.js +3 -0
- package/dist/browser/panes.js.map +1 -0
- package/dist/browser/surfaces/AvatarStack.js +59 -43
- package/dist/browser/surfaces/AvatarStack.js.map +1 -1
- package/dist/browser/surfaces/ChangeList.js +78 -16
- package/dist/browser/surfaces/ChangeList.js.map +1 -1
- package/dist/browser/surfaces/DotStrip.js +126 -41
- package/dist/browser/surfaces/DotStrip.js.map +1 -1
- package/dist/browser/surfaces/LinkCard.js +69 -16
- package/dist/browser/surfaces/LinkCard.js.map +1 -1
- package/dist/browser/surfaces/Section.js +4 -2
- package/dist/browser/surfaces/Section.js.map +1 -1
- package/dist/browser/surfaces/StatCell.js +56 -28
- package/dist/browser/surfaces/StatCell.js.map +1 -1
- package/dist/browser/surfaces/StatGrid.js +17 -8
- package/dist/browser/surfaces/StatGrid.js.map +1 -1
- package/dist/browser/surfaces/index.js.map +1 -1
- package/dist/ssr/actions/CommandList.js +23 -26
- package/dist/ssr/actions/CommandList.js.map +1 -1
- package/dist/ssr/actions/ContextMenu.js +9 -2
- package/dist/ssr/actions/ContextMenu.js.map +1 -1
- package/dist/ssr/actions/Dropdown.js +79 -55
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/GestureMenu.js +18 -7
- package/dist/ssr/actions/GestureMenu.js.map +1 -1
- package/dist/ssr/actions/SelectionAction.js +212 -0
- package/dist/ssr/actions/SelectionAction.js.map +1 -0
- package/dist/ssr/actions/Tabs.js +21 -6
- package/dist/ssr/actions/Tabs.js.map +1 -1
- package/dist/ssr/actions/Toolbar.js +24 -18
- package/dist/ssr/actions/Toolbar.js.map +1 -1
- package/dist/ssr/actions/ViewTabs.js +27 -20
- package/dist/ssr/actions/ViewTabs.js.map +1 -1
- package/dist/ssr/actions/command-items.js.map +1 -1
- package/dist/ssr/actions/drag-and-drop.js +2 -1
- package/dist/ssr/actions/drag-and-drop.js.map +1 -1
- package/dist/ssr/actions/index.js +1 -0
- package/dist/ssr/actions/index.js.map +1 -1
- package/dist/ssr/actions/menu-sheet-open.js +19 -0
- package/dist/ssr/actions/menu-sheet-open.js.map +1 -0
- package/dist/ssr/charts/core/line-details.js +2 -2
- package/dist/ssr/charts/core/line-details.js.map +1 -1
- package/dist/ssr/charts/core/render.js +2 -1
- package/dist/ssr/charts/core/render.js.map +1 -1
- package/dist/ssr/charts/core/snapshot.js +3 -1
- package/dist/ssr/charts/core/snapshot.js.map +1 -1
- package/dist/ssr/chat/ChatActivityWords.js +126 -0
- package/dist/ssr/chat/ChatActivityWords.js.map +1 -0
- package/dist/ssr/chat/ChatComposer.js +271 -142
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/chat/ChatComposerQuotes.js +26 -0
- package/dist/ssr/chat/ChatComposerQuotes.js.map +1 -0
- package/dist/ssr/chat/ChatContextPopup.js +17 -1
- package/dist/ssr/chat/ChatContextPopup.js.map +1 -1
- package/dist/ssr/chat/ChatPrimitives.js +213 -79
- package/dist/ssr/chat/ChatPrimitives.js.map +1 -1
- package/dist/ssr/chat/ChatTasks.js +117 -27
- package/dist/ssr/chat/ChatTasks.js.map +1 -1
- package/dist/ssr/chat/ChatTimeline.js +5 -3
- package/dist/ssr/chat/ChatTimeline.js.map +1 -1
- package/dist/ssr/chat/chat-behavior.js +12 -0
- package/dist/ssr/chat/chat-behavior.js.map +1 -1
- package/dist/ssr/chat/chat-messages.js +50 -2
- package/dist/ssr/chat/chat-messages.js.map +1 -1
- package/dist/ssr/chat/index.js +6 -2
- package/dist/ssr/chat/index.js.map +1 -1
- package/dist/ssr/chat/types.js.map +1 -1
- package/dist/ssr/content/ActivityList.js +553 -0
- package/dist/ssr/content/ActivityList.js.map +1 -0
- package/dist/ssr/content/Calendar.js +2 -2
- package/dist/ssr/content/Calendar.js.map +1 -1
- package/dist/ssr/content/CalendarWeekView.js +9 -2
- package/dist/ssr/content/CalendarWeekView.js.map +1 -1
- package/dist/ssr/content/ChartRoot.js +4 -1
- package/dist/ssr/content/ChartRoot.js.map +1 -1
- package/dist/ssr/content/DataTable.js +9 -0
- package/dist/ssr/content/DataTable.js.map +1 -1
- package/dist/ssr/content/DataTableTools.js +3 -0
- package/dist/ssr/content/DataTableTools.js.map +1 -1
- package/dist/ssr/content/Lightbox.js +4 -2
- package/dist/ssr/content/Lightbox.js.map +1 -1
- package/dist/ssr/content/MessageQuote.js +36 -0
- package/dist/ssr/content/MessageQuote.js.map +1 -0
- package/dist/ssr/content/MessageRow.js +112 -95
- package/dist/ssr/content/MessageRow.js.map +1 -1
- package/dist/ssr/content/PdfPages.js +1 -0
- package/dist/ssr/content/PdfPages.js.map +1 -1
- package/dist/ssr/content/ProgressPath.js +51 -0
- package/dist/ssr/content/ProgressPath.js.map +1 -0
- package/dist/ssr/content/Timeline.js +1 -1
- package/dist/ssr/content/Timeline.js.map +1 -1
- package/dist/ssr/content/VirtualFeed.js +29 -2
- package/dist/ssr/content/VirtualFeed.js.map +1 -1
- package/dist/ssr/content/activity-messages.js +47 -0
- package/dist/ssr/content/activity-messages.js.map +1 -0
- package/dist/ssr/content/activity-timeline.js +144 -0
- package/dist/ssr/content/activity-timeline.js.map +1 -0
- package/dist/ssr/content/chart-tick-room.js +59 -0
- package/dist/ssr/content/chart-tick-room.js.map +1 -0
- package/dist/ssr/content/chart-time-calendar.js +12 -18
- package/dist/ssr/content/chart-time-calendar.js.map +1 -1
- package/dist/ssr/content/find-text.js +47 -0
- package/dist/ssr/content/find-text.js.map +1 -0
- package/dist/ssr/content/index.js +2 -0
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/content/quote-messages.js +25 -0
- package/dist/ssr/content/quote-messages.js.map +1 -0
- package/dist/ssr/feedback/HoverCard.js +473 -0
- package/dist/ssr/feedback/HoverCard.js.map +1 -0
- package/dist/ssr/feedback/Tooltip.js +5 -2
- package/dist/ssr/feedback/Tooltip.js.map +1 -1
- package/dist/ssr/feedback/dialog-core.js +129 -21
- package/dist/ssr/feedback/dialog-core.js.map +1 -1
- package/dist/ssr/feedback/dialog-frame-motion.js +274 -0
- package/dist/ssr/feedback/dialog-frame-motion.js.map +1 -0
- package/dist/ssr/feedback/index.js +1 -0
- package/dist/ssr/feedback/index.js.map +1 -1
- package/dist/ssr/feedback/prompt-confirm.js +3 -17
- package/dist/ssr/feedback/prompt-confirm.js.map +1 -1
- package/dist/ssr/feedback/prompt-sheet-view.js +62 -0
- package/dist/ssr/feedback/prompt-sheet-view.js.map +1 -0
- package/dist/ssr/feedback/prompt-sheet.js +36 -0
- package/dist/ssr/feedback/prompt-sheet.js.map +1 -0
- package/dist/ssr/feedback/prompts.js +28 -52
- package/dist/ssr/feedback/prompts.js.map +1 -1
- package/dist/ssr/feedback/toast.js +17 -12
- package/dist/ssr/feedback/toast.js.map +1 -1
- package/dist/ssr/hover-card.js +6 -0
- package/dist/ssr/hover-card.js.map +1 -0
- package/dist/ssr/inputs/AutocompleteEditor.js +2 -1
- package/dist/ssr/inputs/AutocompleteEditor.js.map +1 -1
- package/dist/ssr/inputs/AutocompleteSelect.js +3 -8
- package/dist/ssr/inputs/AutocompleteSelect.js.map +1 -1
- package/dist/ssr/inputs/ChoiceList.js +25 -25
- package/dist/ssr/inputs/ChoiceList.js.map +1 -1
- package/dist/ssr/inputs/Combobox.js +4 -9
- package/dist/ssr/inputs/Combobox.js.map +1 -1
- package/dist/ssr/inputs/MultiSelectInput.js +4 -9
- package/dist/ssr/inputs/MultiSelectInput.js.map +1 -1
- package/dist/ssr/inputs/PeriodPicker.js +241 -46
- package/dist/ssr/inputs/PeriodPicker.js.map +1 -1
- package/dist/ssr/inputs/RichSelect.js +135 -121
- package/dist/ssr/inputs/RichSelect.js.map +1 -1
- package/dist/ssr/inputs/Select.js +3 -8
- package/dist/ssr/inputs/Select.js.map +1 -1
- package/dist/ssr/inputs/SelectChip.js +1 -0
- package/dist/ssr/inputs/SelectChip.js.map +1 -1
- package/dist/ssr/inputs/TimeInput.js +145 -0
- package/dist/ssr/inputs/TimeInput.js.map +1 -0
- package/dist/ssr/inputs/choice.js.map +1 -1
- package/dist/ssr/inputs/date-picker.js +2 -1
- package/dist/ssr/inputs/date-picker.js.map +1 -1
- package/dist/ssr/inputs/file-drop.js +2 -0
- package/dist/ssr/inputs/file-drop.js.map +1 -1
- package/dist/ssr/inputs/index.js +1 -0
- package/dist/ssr/inputs/index.js.map +1 -1
- package/dist/ssr/inputs/input-messages.js +20 -2
- package/dist/ssr/inputs/input-messages.js.map +1 -1
- package/dist/ssr/inputs/period-picker-messages.js +20 -2
- package/dist/ssr/inputs/period-picker-messages.js.map +1 -1
- package/dist/ssr/inputs/period.js +83 -0
- package/dist/ssr/inputs/period.js.map +1 -1
- package/dist/ssr/inputs/time-input.js +93 -0
- package/dist/ssr/inputs/time-input.js.map +1 -0
- package/dist/ssr/internal/anchor-placement.js +38 -0
- package/dist/ssr/internal/anchor-placement.js.map +1 -0
- package/dist/ssr/internal/exit-motion.js +23 -0
- package/dist/ssr/internal/exit-motion.js.map +1 -0
- package/dist/ssr/internal/option-description.js +27 -0
- package/dist/ssr/internal/option-description.js.map +1 -0
- package/dist/ssr/internal/portal-scope.js +36 -0
- package/dist/ssr/internal/portal-scope.js.map +1 -0
- package/dist/ssr/internal/portal.js +13 -10
- package/dist/ssr/internal/portal.js.map +1 -1
- package/dist/ssr/internal/scroll-places.js +15 -0
- package/dist/ssr/internal/scroll-places.js.map +1 -0
- package/dist/ssr/intl/messages.js +10 -0
- package/dist/ssr/intl/messages.js.map +1 -1
- package/dist/ssr/layout/AnchoredPopover.js +10 -25
- package/dist/ssr/layout/AnchoredPopover.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +191 -121
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/BottomSheet.js +1 -24
- package/dist/ssr/layout/BottomSheet.js.map +1 -1
- package/dist/ssr/layout/Discussion.js +168 -2
- package/dist/ssr/layout/Discussion.js.map +1 -1
- package/dist/ssr/layout/FloatingWindow.js +2 -0
- package/dist/ssr/layout/FloatingWindow.js.map +1 -1
- package/dist/ssr/layout/Navigation.js +7 -2
- package/dist/ssr/layout/Navigation.js.map +1 -1
- package/dist/ssr/layout/Panes.js +3 -0
- package/dist/ssr/layout/Panes.js.map +1 -1
- package/dist/ssr/layout/SidebarSwitcher.js +8 -13
- package/dist/ssr/layout/SidebarSwitcher.js.map +1 -1
- package/dist/ssr/layout/app-workspace-controller.js +5 -1
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/layout/bottom-sheet-load.js +17 -0
- package/dist/ssr/layout/bottom-sheet-load.js.map +1 -0
- package/dist/ssr/layout/bottom-sheet-options.js +27 -0
- package/dist/ssr/layout/bottom-sheet-options.js.map +1 -0
- package/dist/ssr/layout/index.js +2 -1
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/layout/panes-preview-scope.js +9 -0
- package/dist/ssr/layout/panes-preview-scope.js.map +1 -0
- package/dist/ssr/layout/sheet-handle.js +173 -37
- package/dist/ssr/layout/sheet-handle.js.map +1 -1
- package/dist/ssr/layout/sheet-motion.js +37 -5
- package/dist/ssr/layout/sheet-motion.js.map +1 -1
- package/dist/ssr/layout/sidebar-scroll-memory.js +30 -0
- package/dist/ssr/layout/sidebar-scroll-memory.js.map +1 -1
- package/dist/ssr/panes.js +3 -0
- package/dist/ssr/panes.js.map +1 -0
- package/dist/ssr/surfaces/AvatarStack.js +56 -40
- package/dist/ssr/surfaces/AvatarStack.js.map +1 -1
- package/dist/ssr/surfaces/ChangeList.js +37 -5
- package/dist/ssr/surfaces/ChangeList.js.map +1 -1
- package/dist/ssr/surfaces/DotStrip.js +75 -12
- package/dist/ssr/surfaces/DotStrip.js.map +1 -1
- package/dist/ssr/surfaces/LinkCard.js +46 -7
- package/dist/ssr/surfaces/LinkCard.js.map +1 -1
- package/dist/ssr/surfaces/Section.js +4 -2
- package/dist/ssr/surfaces/Section.js.map +1 -1
- package/dist/ssr/surfaces/StatCell.js +24 -12
- package/dist/ssr/surfaces/StatCell.js.map +1 -1
- package/dist/ssr/surfaces/StatGrid.js +12 -6
- package/dist/ssr/surfaces/StatGrid.js.map +1 -1
- package/dist/ssr/surfaces/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/actions/Dropdown.d.ts +10 -0
- package/dist/types/actions/SelectionAction.d.ts +34 -0
- package/dist/types/actions/Tabs.d.ts +9 -0
- package/dist/types/actions/ViewTabs.d.ts +2 -0
- package/dist/types/actions/command-items.d.ts +5 -0
- package/dist/types/actions/index.d.ts +2 -0
- package/dist/types/actions/menu-sheet-open.d.ts +13 -0
- package/dist/types/charts/core/line-details.d.ts +1 -1
- package/dist/types/chat/ChatActivityWords.d.ts +31 -0
- package/dist/types/chat/ChatComposer.d.ts +41 -3
- package/dist/types/chat/ChatComposerQuotes.d.ts +10 -0
- package/dist/types/chat/ChatPrimitives.d.ts +23 -2
- package/dist/types/chat/ChatTasks.d.ts +14 -1
- package/dist/types/chat/chat-behavior.d.ts +14 -0
- package/dist/types/chat/chat-messages.d.ts +24 -0
- package/dist/types/chat/index.d.ts +10 -5
- package/dist/types/chat/types.d.ts +27 -0
- package/dist/types/content/ActivityList.d.ts +166 -0
- package/dist/types/content/DataTableTools.d.ts +2 -0
- package/dist/types/content/MessageQuote.d.ts +9 -0
- package/dist/types/content/MessageRow.d.ts +5 -0
- package/dist/types/content/ProgressPath.d.ts +25 -0
- package/dist/types/content/VirtualFeed.d.ts +6 -0
- package/dist/types/content/activity-messages.d.ts +22 -0
- package/dist/types/content/activity-timeline.d.ts +52 -0
- package/dist/types/content/chart-tick-room.d.ts +15 -0
- package/dist/types/content/chart-time-calendar.d.ts +6 -0
- package/dist/types/content/find-text.d.ts +10 -0
- package/dist/types/content/index.d.ts +2 -0
- package/dist/types/content/quote-messages.d.ts +6 -0
- package/dist/types/feedback/HoverCard.d.ts +44 -0
- package/dist/types/feedback/Tooltip.d.ts +5 -0
- package/dist/types/feedback/dialog-core.d.ts +2 -0
- package/dist/types/feedback/dialog-frame-motion.d.ts +37 -0
- package/dist/types/feedback/index.d.ts +2 -0
- package/dist/types/feedback/prompt-confirm.d.ts +0 -2
- package/dist/types/feedback/prompt-sheet-view.d.ts +3 -0
- package/dist/types/feedback/prompt-sheet.d.ts +20 -0
- package/dist/types/feedback/prompts.d.ts +5 -0
- package/dist/types/feedback/toast.d.ts +5 -1
- package/dist/types/hover-card.d.ts +5 -0
- package/dist/types/inputs/ChoiceList.d.ts +12 -5
- package/dist/types/inputs/Combobox.d.ts +5 -0
- package/dist/types/inputs/MultiSelectInput.d.ts +1 -0
- package/dist/types/inputs/PeriodPicker.d.ts +10 -0
- package/dist/types/inputs/RichSelect.d.ts +5 -0
- package/dist/types/inputs/Select.d.ts +1 -0
- package/dist/types/inputs/SelectChip.d.ts +5 -0
- package/dist/types/inputs/TimeInput.d.ts +16 -0
- package/dist/types/inputs/choice.d.ts +6 -1
- package/dist/types/inputs/index.d.ts +2 -0
- package/dist/types/inputs/input-messages.d.ts +9 -0
- package/dist/types/inputs/period-picker-messages.d.ts +9 -0
- package/dist/types/inputs/period.d.ts +41 -0
- package/dist/types/inputs/time-input.d.ts +43 -0
- package/dist/types/internal/anchor-placement.d.ts +23 -0
- package/dist/types/internal/exit-motion.d.ts +10 -0
- package/dist/types/internal/option-description.d.ts +20 -0
- package/dist/types/internal/portal-scope.d.ts +11 -0
- package/dist/types/internal/portal.d.ts +1 -1
- package/dist/types/internal/scroll-places.d.ts +2 -0
- package/dist/types/intl/messages.d.ts +5 -0
- package/dist/types/layout/AppWorkspace.d.ts +10 -0
- package/dist/types/layout/BottomSheet.d.ts +1 -18
- package/dist/types/layout/Discussion.d.ts +25 -0
- package/dist/types/layout/Panes.d.ts +6 -0
- package/dist/types/layout/SidebarSwitcher.d.ts +5 -0
- package/dist/types/layout/bottom-sheet-load.d.ts +9 -0
- package/dist/types/layout/bottom-sheet-options.d.ts +18 -0
- package/dist/types/layout/index.d.ts +4 -3
- package/dist/types/layout/panes-preview-scope.d.ts +2 -0
- package/dist/types/layout/sheet-handle.d.ts +17 -8
- package/dist/types/layout/sidebar-scroll-memory.d.ts +6 -0
- package/dist/types/panes.d.ts +2 -0
- package/dist/types/surfaces/ChangeList.d.ts +23 -4
- package/dist/types/surfaces/DotStrip.d.ts +25 -5
- package/dist/types/surfaces/LinkCard.d.ts +14 -0
- package/dist/types/surfaces/StatCell.d.ts +7 -2
- package/dist/types/surfaces/StatGrid.d.ts +15 -3
- package/dist/types/surfaces/index.d.ts +1 -1
- package/package.json +18 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["surfaces/Section.tsx"],"sourcesContent":["import { children, createContext, createEffect, createSignal, createUniqueId, For, type JSX, Show, splitProps, useContext } from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport { Button } from \"../actions/Button\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { useDetailPanelMessages } from \"../layout/detail-panel-messages\";\n\n/** Named after the status tokens; a tone colours the frame, the title, and the icon, never the fill. */\nexport type SectionTone = \"neutral\" | \"success\" | \"warning\" | \"danger\" | \"info\" | \"ai\";\n/** `sm` for detail panels and other narrow columns, `md` for topics on a full page. */\nexport type SectionSize = \"sm\" | \"md\";\n/** `line` draws the light 1 px frame; inside another frame a section always stands flat. */\nexport type SectionFrame = \"line\" | \"none\";\nexport type SectionState = \"ready\" | \"loading\" | \"error\";\n\ntype SectionBaseProps = Omit<JSX.HTMLAttributes<HTMLElement>, \"title\" | \"children\" | \"class\"> & {\n title: JSX.Element;\n icon?: string;\n size?: SectionSize;\n frame?: SectionFrame;\n tone?: SectionTone;\n /**\n * Marks a section that only some people see, such as \"Only with permission\": a lock and these words after the\n * title. It is part of the section's accessible name and combines with any tone.\n */\n restricted?: string;\n description?: JSX.Element;\n /** How many things the section lists, as a chip after the title; `0` reads \"None yet\". */\n count?: number;\n /** Short state after the title, such as \"2 of 4 done\". */\n meta?: JSX.Element;\n /** Commands for the whole topic, as a row of buttons at the end of the body. */\n footer?: JSX.Element;\n /** `loading` and `error` take the body's place; the heading stays where it is. */\n state?: SectionState;\n /** Says what did not load; defaults to a generic sentence. */\n errorMessage?: JSX.Element;\n /** Shows \"Try again\" in the error state. */\n onRetry?: () => void;\n /** Placeholder rows while loading, the number the loaded body usually shows. Defaults to 3. */\n loadingRows?: number;\n /** Heading level; defaults to 3, or 2 for `size=\"md\"`. */\n level?: 2 | 3;\n class?: string;\n};\n\nexport type SectionProps = SectionBaseProps &\n (\n | {\n children?: JSX.Element;\n /** Exactly one control at the end of the heading, such as \"+\" or one text button. */\n actions?: JSX.Element;\n collapsible?: false;\n summary?: never;\n defaultOpen?: never;\n open?: never;\n onOpenChange?: never;\n disabled?: never;\n }\n | {\n children: JSX.Element;\n actions?: never;\n collapsible: true;\n /** One line that says what the closed section holds, such as its newest entry; hidden while open. */\n summary?: JSX.Element;\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n disabled?: boolean;\n }\n );\n\nexport type SectionPartProps = {\n title: JSX.Element;\n children: JSX.Element;\n class?: string;\n};\n\ntype SectionComponent = ((props: SectionProps) => JSX.Element) & {\n Part: (props: SectionPartProps) => JSX.Element;\n};\n\nconst SectionLevel = createContext<number>(2);\n\n/**\n * The frame a section draws when it passes none. A host that frames its topics itself, such as a detail panel, sets\n * `none`; everywhere else a section is a card.\n */\nexport const SectionFrameDefault = createContext<SectionFrame>(\"line\");\n\nconst Heading = (props: { level: number; id?: string; class: string; children: JSX.Element }): JSX.Element => (\n <Dynamic component={`h${props.level}`} id={props.id} class={props.class}>\n {props.children}\n </Dynamic>\n);\n\nconst SectionRoot = (props: SectionProps): JSX.Element => {\n const [local, rest] = splitProps(props, [\n \"title\",\n \"icon\",\n \"size\",\n \"frame\",\n \"tone\",\n \"restricted\",\n \"description\",\n \"count\",\n \"meta\",\n \"footer\",\n \"state\",\n \"errorMessage\",\n \"onRetry\",\n \"loadingRows\",\n \"level\",\n \"class\",\n \"children\",\n \"actions\",\n \"collapsible\",\n \"summary\",\n \"defaultOpen\",\n \"open\",\n \"onOpenChange\",\n \"disabled\",\n ]);\n const ui = useUiMessages();\n const counts = useDetailPanelMessages();\n const frameDefault = useContext(SectionFrameDefault);\n const id = `k2b-section-${createUniqueId()}`;\n const titleId = `${id}-title`;\n const restrictedId = `${id}-restricted`;\n const bodyId = `${id}-body`;\n const level = () => local.level ?? (local.size === \"md\" ? 2 : 3);\n const state = () => local.state ?? \"ready\";\n const [internalOpen, setInternalOpen] = createSignal(local.defaultOpen ?? false);\n const open = () => !local.collapsible || (local.open ?? internalOpen());\n let toggleButton: HTMLButtonElement | undefined;\n let body: HTMLDivElement | undefined;\n\n const toggle = () => {\n if (local.disabled) return;\n const next = !open();\n if (local.open === undefined) setInternalOpen(next);\n local.onOpenChange?.(next);\n };\n // A parent may close the section while focus is inside it; focus then returns to the toggle instead of the page.\n createEffect(() => {\n if (open()) return;\n queueMicrotask(() => {\n const active = body?.ownerDocument.activeElement;\n if (!open() && active && body?.contains(active)) toggleButton?.focus();\n });\n });\n\n // Resolve once and only while ready: reading `children` twice would build the body twice.\n const resolved = children(() => (state() === \"ready\" ? local.children : undefined));\n const hasBody = () => local.collapsible || state() !== \"ready\" || Boolean(resolved.toArray().length) || Boolean(local.footer);\n\n /** Icon, then the title with its count, state, and restricted marker in one row, then the description. */\n const headingRow = (title: JSX.Element, summary?: JSX.Element) => (\n <>\n <Show when={local.icon}>\n {(name) => (\n <span class=\"k2b-section__icon\" aria-hidden=\"true\">\n <i class={name()} />\n </span>\n )}\n </Show>\n <span class=\"k2b-section__copy\">\n <span class=\"k2b-section__heading\">\n {title}\n <Show when={local.count !== undefined}>\n <Show when={local.count! > 0} fallback={<span class=\"k2b-section__none\">{counts().noneYet}</span>}>\n <span class=\"k2b-count-chip\">{local.count}</span>\n </Show>\n </Show>\n <Show when={local.meta}>\n <span class=\"k2b-section__meta\">{local.meta}</span>\n </Show>\n <Show when={local.restricted}>\n <span class=\"k2b-section__restricted\" id={restrictedId}>\n <i class=\"ti ti-lock\" aria-hidden=\"true\" />\n {local.restricted}\n </span>\n </Show>\n {summary}\n </span>\n <Show when={local.description}>\n <span class=\"k2b-section__description\">{local.description}</span>\n </Show>\n </span>\n </>\n );\n\n return (\n <section\n {...rest}\n class={local.class ? `k2b-section ${local.class}` : \"k2b-section\"}\n data-size={local.size ?? \"sm\"}\n data-frame={local.frame ?? frameDefault}\n data-tone={local.tone && local.tone !== \"neutral\" ? local.tone : undefined}\n data-icon={local.icon ? \"true\" : undefined}\n data-collapsible={local.collapsible ? \"true\" : undefined}\n data-open={local.collapsible ? String(open()) : undefined}\n data-summary={local.collapsible && local.summary ? \"true\" : undefined}\n aria-labelledby={local.restricted ? `${titleId} ${restrictedId}` : titleId}\n aria-busy={state() === \"loading\" ? \"true\" : undefined}\n >\n <Show\n when={local.collapsible}\n fallback={\n <header class=\"k2b-section__header\">\n {headingRow(\n <Heading level={level()} id={titleId} class=\"k2b-section__title\">\n {local.title}\n </Heading>,\n )}\n <Show when={local.actions}>\n <div class=\"k2b-section__actions\">{local.actions}</div>\n </Show>\n </header>\n }\n >\n {/* The whole heading row is one disclosure button inside the heading, so the region keeps its name. */}\n <Heading level={level()} class=\"k2b-section__header\">\n <button\n ref={toggleButton}\n type=\"button\"\n class=\"k2b-section__toggle\"\n aria-expanded={open()}\n aria-controls={bodyId}\n disabled={local.disabled}\n // A native listener, not Solid's delegated `onClick`: delegation is registered once per document when\n // this module loads, so a section rendered into a later document (a test harness, an iframe) would\n // never toggle. The shared Button registers its delegation at render time and has no such gap.\n on:click={toggle}\n >\n {headingRow(\n <span id={titleId} class=\"k2b-section__title\">\n {local.title}\n </span>,\n <Show when={local.summary}>\n <span class=\"k2b-section__summary k2b-truncate-fade\">{local.summary}</span>\n </Show>,\n )}\n <span class=\"k2b-section__chevron\" aria-hidden=\"true\">\n <i class=\"ti ti-chevron-down\" />\n </span>\n </button>\n </Heading>\n </Show>\n <Show when={hasBody()}>\n <div ref={body} id={bodyId} class=\"k2b-section__body\" hidden={!open()}>\n <Show when={state() === \"loading\"}>\n {/* Placeholder rows at the height of loaded rows; their widths vary in CSS. */}\n <div role=\"status\">\n <span class=\"k2b-sr-only\">{ui().loading}</span>\n <For each={Array.from({ length: Math.max(1, local.loadingRows ?? 3) })}>\n {() => (\n <div class=\"k2b-section__skeleton-row\" aria-hidden=\"true\">\n <span />\n <span />\n </div>\n )}\n </For>\n </div>\n </Show>\n <Show when={state() === \"error\"}>\n <div class=\"k2b-section__error\" role=\"alert\">\n <i class=\"ti ti-alert-circle\" aria-hidden=\"true\" />\n <span>{local.errorMessage ?? ui().couldNotLoadData}</span>\n </div>\n <Show when={local.onRetry}>\n {(retry) => (\n <div class=\"k2b-section__footer\">\n <Button type=\"button\" size=\"sm\" variant=\"secondary\" onClick={() => retry()()}>\n <i class=\"ti ti-refresh\" aria-hidden=\"true\" />\n {ui().retry}\n </Button>\n </div>\n )}\n </Show>\n </Show>\n {resolved()}\n <Show when={state() === \"ready\" && local.footer}>\n <div class=\"k2b-section__footer\">{local.footer}</div>\n </Show>\n </div>\n </Show>\n </section>\n );\n};\n\n/** A sub-topic inside a section, such as \"Contact\" or \"Address\": a small heading, no frame of its own. */\nconst SectionPart = (props: SectionPartProps): JSX.Element => {\n const level = useContext(SectionLevel);\n const id = `k2b-section-part-${createUniqueId()}`;\n return (\n <div class={props.class ? `k2b-section__part ${props.class}` : \"k2b-section__part\"} role=\"group\" aria-labelledby={id}>\n <Heading level={Math.min(level + 1, 6)} id={id} class=\"k2b-section__part-title\">\n {props.title}\n </Heading>\n {props.children}\n </div>\n );\n};\n\n/**\n * One topic, in a detail panel or on a page: an icon, a title with its count, at most one control, and its\n * content. On a page a section is a card with the light 1 px frame; inside another frame, and in a detail panel, it\n * stands flat, so cards never nest.\n */\nconst SectionWithLevel = (props: SectionProps): JSX.Element => (\n // The level is provided before the body is built, so a part's heading sits one level below this section's.\n <SectionLevel.Provider value={props.level ?? (props.size === \"md\" ? 2 : 3)}>\n <SectionRoot {...props} />\n </SectionLevel.Provider>\n);\n\nexport const Section = SectionWithLevel as SectionComponent;\nSection.Part = SectionPart;\n\nexport default Section;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,EAAY,IAAI,EAAE,UAAU,EAAE,UAAU,QAAQ,UAAU;AAC3I,SAAS,OAAO,QAAQ,cAAc;AACtC,SAAS,MAAM,QAAQ,mBAAmB;AAC1C,SAAS,aAAa,QAAQ,kBAAkB;AAChD,SAAS,sBAAsB,QAAQ,iCAAiC;;AAExE;;AAEA;;AAEA;;AAuEA,MAAM,YAAY,GAAG,aAAa,CAAS,CAAC,CAAC;;AAE7C;AACA;AACA;AACA;AACA,OAAO,MAAM,mBAAmB,GAAG,aAAa,CAAe,MAAM,CAAC;AAEtE,MAAM,OAAO,GAAI,KAA2E,sBACzF,OAAO;EAAA,IAAC,SAAS;IAAA,OAAE,IAAI,KAAK,CAAC,KAAK,EAAE;EAAA;EAAA,IAAE,EAAE;IAAA,OAAE,KAAK,CAAC,EAAE;EAAA;EAAA;IAAA,OAAS,KAAK,CAAC,KAAK;EAAA;EAAA;IAAA,OACpE,KAAK,CAAC,QAAQ;EAAA;AAAA,EAElB;AAED,MAAM,WAAW,GAAI,KAAmB,IAAkB;EACxD,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE,CACtC,OAAO,EACP,MAAM,EACN,MAAM,EACN,OAAO,EACP,MAAM,EACN,YAAY,EACZ,aAAa,EACb,OAAO,EACP,MAAM,EACN,QAAQ,EACR,OAAO,EACP,cAAc,EACd,SAAS,EACT,aAAa,EACb,OAAO,EACP,OAAO,EACP,UAAU,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,aAAa,EAC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oBAAoB,cAAc,CAAC,CAAC,EAAE;EACjD;IAAA;MAAA;MAAA;MAAA;MAAA;IAAA,0CACoH,EAAE;IAAA,mCACjH,OAAO;MAAA,IAAC,KAAK;QAAA,OAAE,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC;MAAA;MAAE,EAAE,EAAE,EAAE;MAAA;MAAA;QAAA,OAC3C,KAAK,CAAC,KAAK;MAAA;IAAA;IAAA,uBAEb,KAAK,CAAC,QAAQ;IAAA,mCAJL,KAAK,CAAC,KAAK,GAAG,qBAAqB,KAAK,CAAC,KAAK,EAAE,GAAG,mBAAmB;IAAA;EAAA;AAOtF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAM,gBAAgB,GAAI,KAAmB,IAC3C;AAAA,kBACC,YAAY,CAAC,QAAQ;EAAA,IAAC,KAAK;IAAA,OAAE,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,KAAK,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;EAAA;EAAA;IAAA,yBACvE,WAAW,EAAK,KAAK;EAAA;AAAA,EAEzB;AAED,OAAO,MAAM,OAAO,GAAG,gBAAoC;AAC3D,OAAO,CAAC,IAAI,GAAG,WAAW;AAE1B,eAAe,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["surfaces/Section.tsx"],"sourcesContent":["import { children, createContext, createEffect, createSignal, createUniqueId, For, type JSX, Show, splitProps, useContext } from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport { Button } from \"../actions/Button\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { useDetailPanelMessages } from \"../layout/detail-panel-messages\";\n\n/** Named after the status tokens; a tone colours the frame, the title, and the icon, never the fill. */\nexport type SectionTone = \"neutral\" | \"success\" | \"warning\" | \"danger\" | \"info\" | \"ai\";\n/** `sm` for detail panels and other narrow columns, `md` for topics on a full page. */\nexport type SectionSize = \"sm\" | \"md\";\n/** `line` draws the light 1 px frame; inside another frame a section always stands flat. */\nexport type SectionFrame = \"line\" | \"none\";\nexport type SectionState = \"ready\" | \"loading\" | \"error\";\n\ntype SectionBaseProps = Omit<JSX.HTMLAttributes<HTMLElement>, \"title\" | \"children\" | \"class\"> & {\n title: JSX.Element;\n icon?: string;\n size?: SectionSize;\n frame?: SectionFrame;\n tone?: SectionTone;\n /**\n * Marks a section that only some people see, such as \"Only with permission\": a lock and these words after the\n * title. It is part of the section's accessible name and combines with any tone.\n */\n restricted?: string;\n description?: JSX.Element;\n /** How many things the section lists, as a chip after the title; `0` reads \"None yet\". */\n count?: number;\n /** Short state after the title, such as \"2 of 4 done\". */\n meta?: JSX.Element;\n /** Commands for the whole topic, as a row of buttons at the end of the body. */\n footer?: JSX.Element;\n /** `loading` and `error` take the body's place; the heading stays where it is. */\n state?: SectionState;\n /** Says what did not load; defaults to a generic sentence. */\n errorMessage?: JSX.Element;\n /** Shows \"Try again\" in the error state. */\n onRetry?: () => void;\n /** Placeholder rows while loading, the number the loaded body usually shows. Defaults to 3. */\n loadingRows?: number;\n /** Heading level; defaults to 3, or 2 for `size=\"md\"`. */\n level?: 2 | 3;\n class?: string;\n};\n\nexport type SectionProps = SectionBaseProps &\n (\n | {\n children?: JSX.Element;\n /** Exactly one control at the end of the heading, such as \"+\" or one text button. */\n actions?: JSX.Element;\n collapsible?: false;\n summary?: never;\n defaultOpen?: never;\n open?: never;\n onOpenChange?: never;\n disabled?: never;\n }\n | {\n children: JSX.Element;\n actions?: never;\n collapsible: true;\n /** One line that says what the closed section holds, such as its newest entry; hidden while open. */\n summary?: JSX.Element;\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n disabled?: boolean;\n }\n );\n\nexport type SectionPartProps = {\n title: JSX.Element;\n children: JSX.Element;\n class?: string;\n};\n\ntype SectionComponent = ((props: SectionProps) => JSX.Element) & {\n Part: (props: SectionPartProps) => JSX.Element;\n};\n\nconst SectionLevel = createContext<number>(2);\n\n/**\n * The frame a section draws when it passes none. A host that frames its topics itself, such as a detail panel, sets\n * `none`; everywhere else a section is a card.\n */\nexport const SectionFrameDefault = createContext<SectionFrame>(\"line\");\n\nconst Heading = (props: { level: number; id?: string; class: string; children: JSX.Element }): JSX.Element => (\n <Dynamic component={`h${props.level}`} id={props.id} class={props.class}>\n {props.children}\n </Dynamic>\n);\n\nconst SectionRoot = (props: SectionProps): JSX.Element => {\n const [local, rest] = splitProps(props, [\n \"title\",\n \"icon\",\n \"size\",\n \"frame\",\n \"tone\",\n \"restricted\",\n \"description\",\n \"count\",\n \"meta\",\n \"footer\",\n \"state\",\n \"errorMessage\",\n \"onRetry\",\n \"loadingRows\",\n \"level\",\n \"class\",\n \"children\",\n \"actions\",\n \"collapsible\",\n \"summary\",\n \"defaultOpen\",\n \"open\",\n \"onOpenChange\",\n \"disabled\",\n ]);\n const ui = useUiMessages();\n const counts = useDetailPanelMessages();\n const frameDefault = useContext(SectionFrameDefault);\n const id = `k2b-section-${createUniqueId()}`;\n const titleId = `${id}-title`;\n const restrictedId = `${id}-restricted`;\n const bodyId = `${id}-body`;\n const level = () => local.level ?? (local.size === \"md\" ? 2 : 3);\n const state = () => local.state ?? \"ready\";\n const [internalOpen, setInternalOpen] = createSignal(local.defaultOpen ?? false);\n const open = () => !local.collapsible || (local.open ?? internalOpen());\n let toggleButton: HTMLButtonElement | undefined;\n let body: HTMLDivElement | undefined;\n\n const toggle = () => {\n if (local.disabled) return;\n const next = !open();\n if (local.open === undefined) setInternalOpen(next);\n local.onOpenChange?.(next);\n };\n // A parent may close the section while focus is inside it; focus then returns to the toggle instead of the page.\n createEffect(() => {\n if (open()) return;\n queueMicrotask(() => {\n const active = body?.ownerDocument.activeElement;\n if (!open() && active && body?.contains(active)) toggleButton?.focus();\n });\n });\n\n // Resolve once and only while ready: reading `children` twice would build the body twice.\n const resolved = children(() => (state() === \"ready\" ? local.children : undefined));\n // A JSX action must also be built once: checking the slot and then reading it again creates different hydration keys.\n const resolvedActions = children(() => local.actions);\n const hasBody = () => local.collapsible || state() !== \"ready\" || Boolean(resolved.toArray().length) || Boolean(local.footer);\n\n /** Icon, then the title with its count, state, and restricted marker in one row, then the description. */\n const headingRow = (title: JSX.Element, summary?: JSX.Element) => (\n <>\n <Show when={local.icon}>\n {(name) => (\n <span class=\"k2b-section__icon\" aria-hidden=\"true\">\n <i class={name()} />\n </span>\n )}\n </Show>\n <span class=\"k2b-section__copy\">\n <span class=\"k2b-section__heading\">\n {title}\n <Show when={local.count !== undefined}>\n <Show when={local.count! > 0} fallback={<span class=\"k2b-section__none\">{counts().noneYet}</span>}>\n <span class=\"k2b-count-chip\">{local.count}</span>\n </Show>\n </Show>\n <Show when={local.meta}>\n <span class=\"k2b-section__meta\">{local.meta}</span>\n </Show>\n <Show when={local.restricted}>\n <span class=\"k2b-section__restricted\" id={restrictedId}>\n <i class=\"ti ti-lock\" aria-hidden=\"true\" />\n {local.restricted}\n </span>\n </Show>\n {summary}\n </span>\n <Show when={local.description}>\n <span class=\"k2b-section__description\">{local.description}</span>\n </Show>\n </span>\n </>\n );\n\n return (\n <section\n {...rest}\n class={local.class ? `k2b-section ${local.class}` : \"k2b-section\"}\n data-size={local.size ?? \"sm\"}\n data-frame={local.frame ?? frameDefault}\n data-tone={local.tone && local.tone !== \"neutral\" ? local.tone : undefined}\n data-icon={local.icon ? \"true\" : undefined}\n data-collapsible={local.collapsible ? \"true\" : undefined}\n data-open={local.collapsible ? String(open()) : undefined}\n data-summary={local.collapsible && local.summary ? \"true\" : undefined}\n aria-labelledby={local.restricted ? `${titleId} ${restrictedId}` : titleId}\n aria-busy={state() === \"loading\" ? \"true\" : undefined}\n >\n <Show\n when={local.collapsible}\n fallback={\n <header class=\"k2b-section__header\">\n {headingRow(\n <Heading level={level()} id={titleId} class=\"k2b-section__title\">\n {local.title}\n </Heading>,\n )}\n <Show when={resolvedActions()}>\n <div class=\"k2b-section__actions\">{resolvedActions()}</div>\n </Show>\n </header>\n }\n >\n {/* The whole heading row is one disclosure button inside the heading, so the region keeps its name. */}\n <Heading level={level()} class=\"k2b-section__header\">\n <button\n ref={toggleButton}\n type=\"button\"\n class=\"k2b-section__toggle\"\n aria-expanded={open()}\n aria-controls={bodyId}\n disabled={local.disabled}\n // A native listener, not Solid's delegated `onClick`: delegation is registered once per document when\n // this module loads, so a section rendered into a later document (a test harness, an iframe) would\n // never toggle. The shared Button registers its delegation at render time and has no such gap.\n on:click={toggle}\n >\n {headingRow(\n <span id={titleId} class=\"k2b-section__title\">\n {local.title}\n </span>,\n <Show when={local.summary}>\n <span class=\"k2b-section__summary k2b-truncate-fade\">{local.summary}</span>\n </Show>,\n )}\n <span class=\"k2b-section__chevron\" aria-hidden=\"true\">\n <i class=\"ti ti-chevron-down\" />\n </span>\n </button>\n </Heading>\n </Show>\n <Show when={hasBody()}>\n <div ref={body} id={bodyId} class=\"k2b-section__body\" hidden={!open()}>\n <Show when={state() === \"loading\"}>\n {/* Placeholder rows at the height of loaded rows; their widths vary in CSS. */}\n <div role=\"status\">\n <span class=\"k2b-sr-only\">{ui().loading}</span>\n <For each={Array.from({ length: Math.max(1, local.loadingRows ?? 3) })}>\n {() => (\n <div class=\"k2b-section__skeleton-row\" aria-hidden=\"true\">\n <span />\n <span />\n </div>\n )}\n </For>\n </div>\n </Show>\n <Show when={state() === \"error\"}>\n <div class=\"k2b-section__error\" role=\"alert\">\n <i class=\"ti ti-alert-circle\" aria-hidden=\"true\" />\n <span>{local.errorMessage ?? ui().couldNotLoadData}</span>\n </div>\n <Show when={local.onRetry}>\n {(retry) => (\n <div class=\"k2b-section__footer\">\n <Button type=\"button\" size=\"sm\" variant=\"secondary\" onClick={() => retry()()}>\n <i class=\"ti ti-refresh\" aria-hidden=\"true\" />\n {ui().retry}\n </Button>\n </div>\n )}\n </Show>\n </Show>\n {resolved()}\n <Show when={state() === \"ready\" && local.footer}>\n <div class=\"k2b-section__footer\">{local.footer}</div>\n </Show>\n </div>\n </Show>\n </section>\n );\n};\n\n/** A sub-topic inside a section, such as \"Contact\" or \"Address\": a small heading, no frame of its own. */\nconst SectionPart = (props: SectionPartProps): JSX.Element => {\n const level = useContext(SectionLevel);\n const id = `k2b-section-part-${createUniqueId()}`;\n return (\n <div class={props.class ? `k2b-section__part ${props.class}` : \"k2b-section__part\"} role=\"group\" aria-labelledby={id}>\n <Heading level={Math.min(level + 1, 6)} id={id} class=\"k2b-section__part-title\">\n {props.title}\n </Heading>\n {props.children}\n </div>\n );\n};\n\n/**\n * One topic, in a detail panel or on a page: an icon, a title with its count, at most one control, and its\n * content. On a page a section is a card with the light 1 px frame; inside another frame, and in a detail panel, it\n * stands flat, so cards never nest.\n */\nconst SectionWithLevel = (props: SectionProps): JSX.Element => (\n // The level is provided before the body is built, so a part's heading sits one level below this section's.\n <SectionLevel.Provider value={props.level ?? (props.size === \"md\" ? 2 : 3)}>\n <SectionRoot {...props} />\n </SectionLevel.Provider>\n);\n\nexport const Section = SectionWithLevel as SectionComponent;\nSection.Part = SectionPart;\n\nexport default Section;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,EAAY,IAAI,EAAE,UAAU,EAAE,UAAU,QAAQ,UAAU;AAC3I,SAAS,OAAO,QAAQ,cAAc;AACtC,SAAS,MAAM,QAAQ,mBAAmB;AAC1C,SAAS,aAAa,QAAQ,kBAAkB;AAChD,SAAS,sBAAsB,QAAQ,iCAAiC;;AAExE;;AAEA;;AAEA;;AAuEA,MAAM,YAAY,GAAG,aAAa,CAAS,CAAC,CAAC;;AAE7C;AACA;AACA;AACA;AACA,OAAO,MAAM,mBAAmB,GAAG,aAAa,CAAe,MAAM,CAAC;AAEtE,MAAM,OAAO,GAAI,KAA2E,sBACzF,OAAO;EAAA,IAAC,SAAS;IAAA,OAAE,IAAI,KAAK,CAAC,KAAK,EAAE;EAAA;EAAA,IAAE,EAAE;IAAA,OAAE,KAAK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AM,OAAO,GAAG,gBAAoC;AAC3D,OAAO,CAAC,IAAI,GAAG,WAAW;AAE1B,eAAe,OAAO","ignoreList":[]}
|
|
@@ -44,6 +44,15 @@ import { useStatCellMessages } from "./stat-cell-messages";
|
|
|
44
44
|
|
|
45
45
|
function Body(props) {
|
|
46
46
|
const gridSize = useStatGridSize();
|
|
47
|
+
// A plain figure keeps its change off the figure's line: the third line holds it with the comparison.
|
|
48
|
+
const surface = useStatGridSurface();
|
|
49
|
+
const plain = () => surface() === "plain";
|
|
50
|
+
const badge = delta => _$createComponent(DeltaBadge, {
|
|
51
|
+
delta: delta,
|
|
52
|
+
get compare() {
|
|
53
|
+
return props.compare;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
47
56
|
const size = () => props.size ?? gridSize;
|
|
48
57
|
const accent = () => props.accent;
|
|
49
58
|
const locale = useLocale();
|
|
@@ -134,16 +143,9 @@ function Body(props) {
|
|
|
134
143
|
return _el$14;
|
|
135
144
|
})(), _$createComponent(Show, {
|
|
136
145
|
get when() {
|
|
137
|
-
return _$memo(() =>
|
|
146
|
+
return _$memo(() => !!(!plain() && !empty()))() && props.delta;
|
|
138
147
|
},
|
|
139
|
-
children: delta =>
|
|
140
|
-
get delta() {
|
|
141
|
-
return delta();
|
|
142
|
-
},
|
|
143
|
-
get compare() {
|
|
144
|
-
return props.compare;
|
|
145
|
-
}
|
|
146
|
-
})
|
|
148
|
+
children: delta => badge(delta())
|
|
147
149
|
})];
|
|
148
150
|
},
|
|
149
151
|
get children() {
|
|
@@ -184,6 +186,11 @@ function Body(props) {
|
|
|
184
186
|
},
|
|
185
187
|
get fallback() {
|
|
186
188
|
return [_$createComponent(Show, {
|
|
189
|
+
get when() {
|
|
190
|
+
return _$memo(() => !!(plain() && !empty()))() && props.delta;
|
|
191
|
+
},
|
|
192
|
+
children: delta => badge(delta())
|
|
193
|
+
}), _$createComponent(Show, {
|
|
187
194
|
get when() {
|
|
188
195
|
return props.compare;
|
|
189
196
|
},
|
|
@@ -329,12 +336,17 @@ function Body(props) {
|
|
|
329
336
|
|
|
330
337
|
/**
|
|
331
338
|
* One key figure as a framed tile: icon and label, the figure with its change, and a support line with the comparison
|
|
332
|
-
* and the trend. Each state (loading, error, stale, empty)
|
|
339
|
+
* and the trend. In a `plain` grid the same three rows stand without a frame. Each state (loading, error, stale, empty)
|
|
340
|
+
* keeps the tile's place and size.
|
|
333
341
|
*/
|
|
334
342
|
export function StatCell(props) {
|
|
335
343
|
const gridSize = useStatGridSize();
|
|
336
344
|
const size = () => props.size ?? gridSize;
|
|
345
|
+
// A plain figure has no surface; its tone colours the figure instead of only the icon chip.
|
|
337
346
|
const surface = useStatGridSurface();
|
|
347
|
+
const plain = () => surface() === "plain";
|
|
348
|
+
const variant = () => plain() ? "plain" : undefined;
|
|
349
|
+
const tone = () => plain() ? props.tone : undefined;
|
|
338
350
|
return _$createComponent(Show
|
|
339
351
|
// A tile that offers a retry is no link: the button must not sit inside it.
|
|
340
352
|
, {
|
|
@@ -344,26 +356,34 @@ export function StatCell(props) {
|
|
|
344
356
|
get fallback() {
|
|
345
357
|
return (() => {
|
|
346
358
|
var _el$38 = _$getNextElement(_tmpl$16);
|
|
347
|
-
_$setAttribute(_el$38, "data-surface", surface);
|
|
348
359
|
_$insert(_el$38, _$createComponent(Body, props));
|
|
349
360
|
_$effect(_p$ => {
|
|
350
|
-
var _v$
|
|
351
|
-
_v$
|
|
352
|
-
_v$
|
|
353
|
-
_v$
|
|
354
|
-
_v$
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
_v$16 !== _p$.
|
|
359
|
-
_v$17 !== _p$.
|
|
361
|
+
var _v$16 = size(),
|
|
362
|
+
_v$17 = plain() ? undefined : surface(),
|
|
363
|
+
_v$18 = variant(),
|
|
364
|
+
_v$19 = tone(),
|
|
365
|
+
_v$20 = props.wrap || undefined,
|
|
366
|
+
_v$21 = props.deltaPlacement,
|
|
367
|
+
_v$22 = props.status,
|
|
368
|
+
_v$23 = props.status === "loading" || undefined;
|
|
369
|
+
_v$16 !== _p$.e && _$setAttribute(_el$38, "data-size", _p$.e = _v$16);
|
|
370
|
+
_v$17 !== _p$.t && _$setAttribute(_el$38, "data-surface", _p$.t = _v$17);
|
|
371
|
+
_v$18 !== _p$.a && _$setAttribute(_el$38, "data-variant", _p$.a = _v$18);
|
|
372
|
+
_v$19 !== _p$.o && _$setAttribute(_el$38, "data-tone", _p$.o = _v$19);
|
|
373
|
+
_v$20 !== _p$.i && _$setAttribute(_el$38, "data-wrap", _p$.i = _v$20);
|
|
374
|
+
_v$21 !== _p$.n && _$setAttribute(_el$38, "data-delta-placement", _p$.n = _v$21);
|
|
375
|
+
_v$22 !== _p$.s && _$setAttribute(_el$38, "data-status", _p$.s = _v$22);
|
|
376
|
+
_v$23 !== _p$.h && _$setAttribute(_el$38, "aria-busy", _p$.h = _v$23);
|
|
360
377
|
return _p$;
|
|
361
378
|
}, {
|
|
362
379
|
e: undefined,
|
|
363
380
|
t: undefined,
|
|
364
381
|
a: undefined,
|
|
365
382
|
o: undefined,
|
|
366
|
-
i: undefined
|
|
383
|
+
i: undefined,
|
|
384
|
+
n: undefined,
|
|
385
|
+
s: undefined,
|
|
386
|
+
h: undefined
|
|
367
387
|
});
|
|
368
388
|
return _el$38;
|
|
369
389
|
})();
|
|
@@ -373,23 +393,31 @@ export function StatCell(props) {
|
|
|
373
393
|
_el$35 = _el$34.firstChild,
|
|
374
394
|
_el$36 = _el$35.nextSibling,
|
|
375
395
|
[_el$37, _co$7] = _$getNextMarker(_el$36.nextSibling);
|
|
376
|
-
_$setAttribute(_el$34, "data-surface", surface);
|
|
377
396
|
_$insert(_el$34, _$createComponent(Body, props), _el$37, _co$7);
|
|
378
397
|
_$effect(_p$ => {
|
|
379
398
|
var _v$1 = props.href,
|
|
380
399
|
_v$10 = size(),
|
|
381
|
-
_v$11 =
|
|
382
|
-
_v$12 =
|
|
400
|
+
_v$11 = plain() ? undefined : surface(),
|
|
401
|
+
_v$12 = variant(),
|
|
402
|
+
_v$13 = tone(),
|
|
403
|
+
_v$14 = props.wrap || undefined,
|
|
404
|
+
_v$15 = props.deltaPlacement;
|
|
383
405
|
_v$1 !== _p$.e && _$setAttribute(_el$34, "href", _p$.e = _v$1);
|
|
384
406
|
_v$10 !== _p$.t && _$setAttribute(_el$34, "data-size", _p$.t = _v$10);
|
|
385
|
-
_v$11 !== _p$.a && _$setAttribute(_el$34, "data-
|
|
386
|
-
_v$12 !== _p$.o && _$setAttribute(_el$34, "data-
|
|
407
|
+
_v$11 !== _p$.a && _$setAttribute(_el$34, "data-surface", _p$.a = _v$11);
|
|
408
|
+
_v$12 !== _p$.o && _$setAttribute(_el$34, "data-variant", _p$.o = _v$12);
|
|
409
|
+
_v$13 !== _p$.i && _$setAttribute(_el$34, "data-tone", _p$.i = _v$13);
|
|
410
|
+
_v$14 !== _p$.n && _$setAttribute(_el$34, "data-wrap", _p$.n = _v$14);
|
|
411
|
+
_v$15 !== _p$.s && _$setAttribute(_el$34, "data-delta-placement", _p$.s = _v$15);
|
|
387
412
|
return _p$;
|
|
388
413
|
}, {
|
|
389
414
|
e: undefined,
|
|
390
415
|
t: undefined,
|
|
391
416
|
a: undefined,
|
|
392
|
-
o: undefined
|
|
417
|
+
o: undefined,
|
|
418
|
+
i: undefined,
|
|
419
|
+
n: undefined,
|
|
420
|
+
s: undefined
|
|
393
421
|
});
|
|
394
422
|
return _el$34;
|
|
395
423
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["surfaces/StatCell.tsx"],"sourcesContent":["import { type JSX, Match, Show, Switch } from \"solid-js\";\nimport type { ChartNumberFormat } from \"../charts/description\";\nimport { ChartSparkline } from \"../content/ChartSparkline\";\nimport type { ChartTooltipFormatter } from \"../content/chart-inspection-core\";\nimport { useLocale } from \"../intl/locale\";\nimport type { AccentColor } from \"../semantics\";\nimport { DeltaBadge } from \"./delta-badge\";\nimport { type StatGridSize, useStatGridSize, useStatGridSurface } from \"./StatGrid\";\nimport { useStatCellMessages } from \"./stat-cell-messages\";\n\nexport type StatCellTone = AccentColor;\n\nexport type StatCellAccent = {\n tone: StatCellTone;\n icon: string;\n text?: string;\n};\n\n/**\n * The change against a comparison period. `unit: \"ratio\"` (default) reads `0.082` as `+8.2 %`; `\"points\"` is the\n * difference of two shares in ratio units, so `0.031` reads `+3.1 pts`. Only with `better` does the badge carry a tone\n * and say \"better\" or \"worse\"; without it the change stays unrated.\n */\nexport type StatCellDelta = {\n value: number;\n unit?: \"ratio\" | \"points\" | \"absolute\";\n /** Existing measures can express a change in their own unit instead of a ratio. */\n format?: ChartNumberFormat;\n better?: \"up\" | \"down\";\n};\n\n/** The value the change compares against, shown under the figure, such as \"Last month 44,560\". */\nexport type StatCellCompare = {\n label: string;\n value: string | number;\n};\n\nexport type StatCellSize = StatGridSize;\n\nexport type StatCellProps = {\n label: string;\n /** The figure. `null` shows the empty dash; `sub` then says why. */\n value: string | number | JSX.Element | null;\n sub?: string;\n valueClass?: string;\n /** An icon in a chip before the label, in `tone`. `\"in\"` and `\"out\"` are the money colours of `FlowAmount`. */\n icon?: string;\n /** The chip colour of `icon`. Defaults to zinc. */\n tone?: StatCellTone | \"in\" | \"out\";\n accent?: StatCellAccent;\n delta?: StatCellDelta;\n /** Keep the figure and change on separate rows, including while loading. Defaults to beside the figure. */\n deltaPlacement?: \"below\";\n compare?: StatCellCompare;\n href?: string;\n title?: string;\n trend?: readonly number[];\n /**\n * Replaces the default trend tooltip in browser code, for example with a period title or a unit.\n * `selection.datum.index` is the source index into `trend`.\n */\n trendTooltip?: ChartTooltipFormatter;\n size?: StatCellSize;\n /**\n * Wraps the label, value and support line instead of truncating them. Use it for a cell whose height nothing\n * reserves, such as one figure on its own; cells compared in a row keep one line each.\n */\n wrap?: boolean;\n /** `\"loading\"` keeps the tile's size with placeholders; `\"error\"` says the figure did not load. */\n status?: \"loading\" | \"error\";\n /** Offers \"Try again\" after an error and \"Reload\" beside `stale`. */\n onRetry?: () => void;\n /** The figure is not current: a short note such as \"As of 09:12 · not current\" replaces the support line. */\n stale?: string;\n};\n\nfunction Body(props: StatCellProps): JSX.Element {\n const gridSize = useStatGridSize();\n const size = () => props.size ?? gridSize;\n const accent = () => props.accent;\n const locale = useLocale();\n const t = useStatCellMessages();\n const defaultTrendTooltip: ChartTooltipFormatter = ({ datum }) => {\n const y = datum.values.find((field) => field.key === \"y\")?.value ?? \"\";\n return {\n rows: [\n { label: props.label, value: typeof y === \"number\" ? new Intl.NumberFormat(locale(), { maximumFractionDigits: 6 }).format(y) : y },\n ],\n };\n };\n const compareValue = () => {\n const value = props.compare?.value;\n return typeof value === \"number\" ? new Intl.NumberFormat(locale()).format(value) : value;\n };\n const empty = () => props.value === null || props.value === undefined || props.value === \"\";\n return (\n <>\n <div class=\"k2b-stat-cell__head\">\n <Show when={props.icon}>\n {(icon) => (\n <span class=\"k2b-stat-cell__icon k2b-icon-tile\" data-tone={props.tone ?? \"zinc\"} aria-hidden=\"true\">\n <i class={icon()} />\n </span>\n )}\n </Show>\n <span class=\"k2b-stat-cell__label\" data-size={size()}>\n {props.label}\n </span>\n </div>\n <div class=\"k2b-stat-cell__main\">\n <Switch\n fallback={\n <>\n <span\n class={`k2b-stat-cell__value ${props.valueClass ?? \"\"}`}\n data-size={size()}\n data-empty={empty() || undefined}\n title={props.title}\n >\n {/* A missing figure is the shared empty dash, named for screen readers instead of read as a dash. */}\n <Show\n when={!empty()}\n fallback={\n <span role=\"img\" aria-label={t().noValue}>\n —\n </span>\n }\n >\n {props.value}\n </Show>\n </span>\n <Show when={!empty() && props.delta}>{(delta) => <DeltaBadge delta={delta()} compare={props.compare} />}</Show>\n </>\n }\n >\n <Match when={props.status === \"loading\"}>\n <span class=\"k2b-stat-cell__skeleton k2b-skeleton\" data-part=\"value\" aria-hidden=\"true\" />\n <span class=\"k2b-sr-only\">{t().loading}</span>\n </Match>\n <Match when={props.status === \"error\"}>\n <span class=\"k2b-stat-cell__error\">\n <i class=\"ti ti-alert-circle\" aria-hidden=\"true\" />\n {t().notLoaded}\n </span>\n </Match>\n </Switch>\n </div>\n <div class=\"k2b-stat-cell__support\">\n <Switch\n fallback={\n <Show\n when={props.stale}\n fallback={\n <>\n <Show when={props.compare}>\n {(compare) => (\n <span class=\"k2b-stat-cell__sub\">\n {compare().label} {compareValue()}\n </span>\n )}\n </Show>\n <Show when={props.sub}>{(sub) => <span class=\"k2b-stat-cell__sub\">{sub()}</span>}</Show>\n <Show when={accent()}>\n {(value) => (\n <Show\n when={value().text}\n fallback={<i class={`${value().icon} k2b-stat-cell__accent-icon`} data-tone={value().tone} aria-hidden=\"true\" />}\n >\n {(text) => (\n <span class=\"k2b-stat-cell__accent\" data-tone={value().tone}>\n <i class={value().icon} aria-hidden=\"true\" />\n {text()}\n </span>\n )}\n </Show>\n )}\n </Show>\n {/* No figure, no trend: an empty tile says why in `sub` and keeps the size of its other states. */}\n <Show when={!empty() && props.trend && props.trend.length > 1}>\n <ChartSparkline\n labels={{ interactiveChart: props.label }}\n tooltip={props.trendTooltip ?? defaultTrendTooltip}\n class=\"k2b-stat-cell__trend\"\n data={Array.from(props.trend ?? [])}\n showLast\n />\n </Show>\n </>\n }\n >\n {(stale) => (\n <>\n <span class=\"k2b-stat-cell__stale\">\n <i class=\"ti ti-clock-exclamation\" aria-hidden=\"true\" />\n {stale()}\n </span>\n <Show when={props.onRetry}>\n {(retry) => (\n <button type=\"button\" class=\"k2b-stat-cell__retry\" onClick={() => retry()()}>\n {t().reload}\n </button>\n )}\n </Show>\n </>\n )}\n </Show>\n }\n >\n <Match when={props.status === \"loading\"}>\n <span class=\"k2b-stat-cell__skeleton k2b-skeleton\" data-part=\"support\" aria-hidden=\"true\" />\n </Match>\n <Match when={props.status === \"error\"}>\n <Show when={props.onRetry}>\n {(retry) => (\n <button type=\"button\" class=\"k2b-stat-cell__retry\" onClick={() => retry()()}>\n {t().retry}\n </button>\n )}\n </Show>\n </Match>\n </Switch>\n </div>\n </>\n );\n}\n\n/**\n * One key figure as a framed tile: icon and label, the figure with its change, and a support line with the comparison\n * and the trend. Each state (loading, error, stale, empty) keeps the tile's place and size.\n */\nexport function StatCell(props: StatCellProps): JSX.Element {\n const gridSize = useStatGridSize();\n const size = () => props.size ?? gridSize;\n const surface = useStatGridSurface();\n return (\n <Show\n // A tile that offers a retry is no link: the button must not sit inside it.\n when={props.href && !props.status && !(props.stale && props.onRetry)}\n fallback={\n <div\n class=\"k2b-stat-cell\"\n data-size={size()}\n data-surface={surface}\n data-wrap={props.wrap || undefined}\n data-delta-placement={props.deltaPlacement}\n data-status={props.status}\n aria-busy={props.status === \"loading\" || undefined}\n >\n <Body {...props} />\n </div>\n }\n >\n <a\n href={props.href}\n class=\"k2b-stat-cell k2b-stat-cell--link\"\n data-size={size()}\n data-surface={surface}\n data-wrap={props.wrap || undefined}\n data-delta-placement={props.deltaPlacement}\n >\n <i class=\"ti ti-external-link k2b-stat-cell__link-icon\" aria-hidden=\"true\" />\n <Body {...props} />\n </a>\n </Show>\n );\n}\n\nexport default StatCell;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAmB,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,UAAU;AAExD,SAAS,cAAc,QAAQ,2BAA2B;AAE1D,SAAS,SAAS,QAAQ,gBAAgB;AAE1C,SAAS,UAAU,QAAQ,eAAe;AAC1C,SAA4B,eAAe,EAAE,kBAAkB,QAAQ,YAAY;AACnF,SAAS,mBAAmB,QAAQ,sBAAsB;;AAU1D;AACA;AACA;AACA;AACA;;AASA;;AA6CA,SAAS,IAAI,CAAC,KAAoB,EAAe;EAC/C,MAAM,QAAQ,GAAG,eAAe,CAAC,CAAC;EAClC,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,IAAI,IAAI,QAAQ;EACzC,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,MAAM;EACjC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;EAC1B,MAAM,CAAC,GAAG,mBAAmB,CAAC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;EACpC,yBACG;EACC;EAAA;IAAA,IACA,IAAI;MAAA,OAAE,qBAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,QAAI,EAAE,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC;IAAA;IAAA,IACpE,QAAQ;MAAA;QAAA;QAAA,uCAIU,OAAO;QAAA,mCAMpB,IAAI,EAAK,KAAK;QAAA;UAAA,YAPJ,IAAI,CAAC,CAAC;YAAA,QAEN,KAAK,CAAC,IAAI,IAAI,SAAS;YAAA,QACZ,KAAK,CAAC,cAAc;YAAA,QAC7B,KAAK,CAAC,MAAM;YAAA,QACd,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,SAAS;UAAA;UAAA;UAAA;UAAA;UAAA;UAAA;QAAA;UAAA;UAAA;UAAA;UAAA;UAAA;QAAA;QAAA;MAAA;IAAA;IAAA;MAAA;QAAA;QAAA;QAAA;MAAA,uCAUtC,OAAO;MAAA,mCAKpB,IAAI,EAAK,KAAK;MAAA;QAAA,WART,KAAK,CAAC,IAAI;UAAA,QAEL,IAAI,CAAC,CAAC;UAAA,QAEN,KAAK,CAAC,IAAI,IAAI,SAAS;UAAA,QACZ,KAAK,CAAC,cAAc;QAAA;QAAA;QAAA;QAAA;QAAA;MAAA;QAAA;QAAA;QAAA;QAAA;MAAA;MAAA;IAAA;EAAA;AAOlD;AAEA,eAAe,QAAQ;AAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["surfaces/StatCell.tsx"],"sourcesContent":["import { type JSX, Match, Show, Switch } from \"solid-js\";\nimport type { ChartNumberFormat } from \"../charts/description\";\nimport { ChartSparkline } from \"../content/ChartSparkline\";\nimport type { ChartTooltipFormatter } from \"../content/chart-inspection-core\";\nimport { useLocale } from \"../intl/locale\";\nimport type { AccentColor } from \"../semantics\";\nimport { DeltaBadge } from \"./delta-badge\";\nimport { type StatGridSize, useStatGridSize, useStatGridSurface } from \"./StatGrid\";\nimport { useStatCellMessages } from \"./stat-cell-messages\";\n\nexport type StatCellTone = AccentColor;\n\nexport type StatCellAccent = {\n tone: StatCellTone;\n icon: string;\n text?: string;\n};\n\n/**\n * The change against a comparison period. `unit: \"ratio\"` (default) reads `0.082` as `+8.2 %`; `\"points\"` is the\n * difference of two shares in ratio units, so `0.031` reads `+3.1 pts`. Only with `better` does the badge carry a tone\n * and say \"better\" or \"worse\"; without it the change stays unrated.\n */\nexport type StatCellDelta = {\n value: number;\n unit?: \"ratio\" | \"points\" | \"absolute\";\n /** Existing measures can express a change in their own unit instead of a ratio. */\n format?: ChartNumberFormat;\n better?: \"up\" | \"down\";\n};\n\n/** The value the change compares against, shown under the figure, such as \"Last month 44,560\". */\nexport type StatCellCompare = {\n label: string;\n value: string | number;\n};\n\nexport type StatCellSize = StatGridSize;\n\nexport type StatCellProps = {\n label: string;\n /** The figure. `null` shows the empty dash; `sub` then says why. */\n value: string | number | JSX.Element | null;\n sub?: string;\n valueClass?: string;\n /** An icon in a chip before the label, in `tone`. `\"in\"` and `\"out\"` are the money colours of `FlowAmount`. */\n icon?: string;\n /**\n * The chip colour of `icon`. Defaults to zinc. In a `plain` grid, `amber` (a warning) and `red` (a problem) also\n * colour the figure and its third line; say what is wrong there with `accent` (icon and word).\n */\n tone?: StatCellTone | \"in\" | \"out\";\n accent?: StatCellAccent;\n /** The change against `compare`; beside the figure, and always on the third line in a `plain` grid. */\n delta?: StatCellDelta;\n /** Keep the figure and change on separate rows, including while loading. Defaults to beside the figure. */\n deltaPlacement?: \"below\";\n compare?: StatCellCompare;\n href?: string;\n title?: string;\n trend?: readonly number[];\n /**\n * Replaces the default trend tooltip in browser code, for example with a period title or a unit.\n * `selection.datum.index` is the source index into `trend`.\n */\n trendTooltip?: ChartTooltipFormatter;\n size?: StatCellSize;\n /**\n * Wraps the label, value and support line instead of truncating them. Use it for a cell whose height nothing\n * reserves, such as one figure on its own; cells compared in a row keep one line each.\n */\n wrap?: boolean;\n /** `\"loading\"` keeps the tile's size with placeholders; `\"error\"` says the figure did not load. */\n status?: \"loading\" | \"error\";\n /** Offers \"Try again\" after an error and \"Reload\" beside `stale`. */\n onRetry?: () => void;\n /** The figure is not current: a short note such as \"As of 09:12 · not current\" replaces the support line. */\n stale?: string;\n};\n\nfunction Body(props: StatCellProps): JSX.Element {\n const gridSize = useStatGridSize();\n // A plain figure keeps its change off the figure's line: the third line holds it with the comparison.\n const surface = useStatGridSurface();\n const plain = () => surface() === \"plain\";\n const badge = (delta: StatCellDelta) => <DeltaBadge delta={delta} compare={props.compare} />;\n const size = () => props.size ?? gridSize;\n const accent = () => props.accent;\n const locale = useLocale();\n const t = useStatCellMessages();\n const defaultTrendTooltip: ChartTooltipFormatter = ({ datum }) => {\n const y = datum.values.find((field) => field.key === \"y\")?.value ?? \"\";\n return {\n rows: [\n { label: props.label, value: typeof y === \"number\" ? new Intl.NumberFormat(locale(), { maximumFractionDigits: 6 }).format(y) : y },\n ],\n };\n };\n const compareValue = () => {\n const value = props.compare?.value;\n return typeof value === \"number\" ? new Intl.NumberFormat(locale()).format(value) : value;\n };\n const empty = () => props.value === null || props.value === undefined || props.value === \"\";\n return (\n <>\n <div class=\"k2b-stat-cell__head\">\n <Show when={props.icon}>\n {(icon) => (\n <span class=\"k2b-stat-cell__icon k2b-icon-tile\" data-tone={props.tone ?? \"zinc\"} aria-hidden=\"true\">\n <i class={icon()} />\n </span>\n )}\n </Show>\n <span class=\"k2b-stat-cell__label\" data-size={size()}>\n {props.label}\n </span>\n </div>\n <div class=\"k2b-stat-cell__main\">\n <Switch\n fallback={\n <>\n <span\n class={`k2b-stat-cell__value ${props.valueClass ?? \"\"}`}\n data-size={size()}\n data-empty={empty() || undefined}\n title={props.title}\n >\n {/* A missing figure is the shared empty dash, named for screen readers instead of read as a dash. */}\n <Show\n when={!empty()}\n fallback={\n <span role=\"img\" aria-label={t().noValue}>\n —\n </span>\n }\n >\n {props.value}\n </Show>\n </span>\n <Show when={!plain() && !empty() && props.delta}>{(delta) => badge(delta())}</Show>\n </>\n }\n >\n <Match when={props.status === \"loading\"}>\n <span class=\"k2b-stat-cell__skeleton k2b-skeleton\" data-part=\"value\" aria-hidden=\"true\" />\n <span class=\"k2b-sr-only\">{t().loading}</span>\n </Match>\n <Match when={props.status === \"error\"}>\n <span class=\"k2b-stat-cell__error\">\n <i class=\"ti ti-alert-circle\" aria-hidden=\"true\" />\n {t().notLoaded}\n </span>\n </Match>\n </Switch>\n </div>\n <div class=\"k2b-stat-cell__support\">\n <Switch\n fallback={\n <Show\n when={props.stale}\n fallback={\n <>\n <Show when={plain() && !empty() && props.delta}>{(delta) => badge(delta())}</Show>\n <Show when={props.compare}>\n {(compare) => (\n <span class=\"k2b-stat-cell__sub\">\n {compare().label} {compareValue()}\n </span>\n )}\n </Show>\n <Show when={props.sub}>{(sub) => <span class=\"k2b-stat-cell__sub\">{sub()}</span>}</Show>\n <Show when={accent()}>\n {(value) => (\n <Show\n when={value().text}\n fallback={<i class={`${value().icon} k2b-stat-cell__accent-icon`} data-tone={value().tone} aria-hidden=\"true\" />}\n >\n {(text) => (\n <span class=\"k2b-stat-cell__accent\" data-tone={value().tone}>\n <i class={value().icon} aria-hidden=\"true\" />\n {text()}\n </span>\n )}\n </Show>\n )}\n </Show>\n {/* No figure, no trend: an empty tile says why in `sub` and keeps the size of its other states. */}\n <Show when={!empty() && props.trend && props.trend.length > 1}>\n <ChartSparkline\n labels={{ interactiveChart: props.label }}\n tooltip={props.trendTooltip ?? defaultTrendTooltip}\n class=\"k2b-stat-cell__trend\"\n data={Array.from(props.trend ?? [])}\n showLast\n />\n </Show>\n </>\n }\n >\n {(stale) => (\n <>\n <span class=\"k2b-stat-cell__stale\">\n <i class=\"ti ti-clock-exclamation\" aria-hidden=\"true\" />\n {stale()}\n </span>\n <Show when={props.onRetry}>\n {(retry) => (\n <button type=\"button\" class=\"k2b-stat-cell__retry\" onClick={() => retry()()}>\n {t().reload}\n </button>\n )}\n </Show>\n </>\n )}\n </Show>\n }\n >\n <Match when={props.status === \"loading\"}>\n <span class=\"k2b-stat-cell__skeleton k2b-skeleton\" data-part=\"support\" aria-hidden=\"true\" />\n </Match>\n <Match when={props.status === \"error\"}>\n <Show when={props.onRetry}>\n {(retry) => (\n <button type=\"button\" class=\"k2b-stat-cell__retry\" onClick={() => retry()()}>\n {t().retry}\n </button>\n )}\n </Show>\n </Match>\n </Switch>\n </div>\n </>\n );\n}\n\n/**\n * One key figure as a framed tile: icon and label, the figure with its change, and a support line with the comparison\n * and the trend. In a `plain` grid the same three rows stand without a frame. Each state (loading, error, stale, empty)\n * keeps the tile's place and size.\n */\nexport function StatCell(props: StatCellProps): JSX.Element {\n const gridSize = useStatGridSize();\n const size = () => props.size ?? gridSize;\n // A plain figure has no surface; its tone colours the figure instead of only the icon chip.\n const surface = useStatGridSurface();\n const plain = () => surface() === \"plain\";\n const variant = () => (plain() ? \"plain\" : undefined);\n const tone = () => (plain() ? props.tone : undefined);\n return (\n <Show\n // A tile that offers a retry is no link: the button must not sit inside it.\n when={props.href && !props.status && !(props.stale && props.onRetry)}\n fallback={\n <div\n class=\"k2b-stat-cell\"\n data-size={size()}\n data-surface={plain() ? undefined : surface()}\n data-variant={variant()}\n data-tone={tone()}\n data-wrap={props.wrap || undefined}\n data-delta-placement={props.deltaPlacement}\n data-status={props.status}\n aria-busy={props.status === \"loading\" || undefined}\n >\n <Body {...props} />\n </div>\n }\n >\n <a\n href={props.href}\n class=\"k2b-stat-cell k2b-stat-cell--link\"\n data-size={size()}\n data-surface={plain() ? undefined : surface()}\n data-variant={variant()}\n data-tone={tone()}\n data-wrap={props.wrap || undefined}\n data-delta-placement={props.deltaPlacement}\n >\n <i class=\"ti ti-external-link k2b-stat-cell__link-icon\" aria-hidden=\"true\" />\n <Body {...props} />\n </a>\n </Show>\n );\n}\n\nexport default StatCell;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAmB,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,UAAU;AAExD,SAAS,cA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AC;IAAA;IAAA,IACpE,QAAQ;MAAA;QAAA;QAAA,mCAYH,IAAI,EAAK,KAAK;QAAA;UAAA,YATJ,IAAI,CAAC,CAAC;YAAA,QACH,KAAK,CAAC,CAAC,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;YAAA,QAC/B,OAAO,CAAC,CAAC;YAAA,QACZ,IAAI,CAAC,CAAC;YAAA,QACN,KAAK,CAAC,IAAI,IAAI,SAAS;YAAA,QACZ,KAAK,CAAC,cAAc;YAAA,QAC7B,KAAK,CAAC,MAAM;YAAA,QACd,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,SAAS;UAAA;UAAA;UAAA;UAAA;UAAA;UAAA;UAAA;UAAA;UAAA;QAAA;UAAA;UAAA;UAAA;UAAA;UAAA;UAAA;UAAA;UAAA;QAAA;QAAA;MAAA;IAAA;IAAA;MAAA;QAAA;QAAA;QAAA;MAAA,mCAiBnD,IAAI,EAAK,KAAK;MAAA;QAAA,WAVT,KAAK,CAAC,IAAI;UAAA,QAEL,IAAI,CAAC,CAAC;UAAA,QACH,KAAK,CAAC,CAAC,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;UAAA,QAC/B,OAAO,CAAC,CAAC;UAAA,QACZ,IAAI,CAAC,CAAC;UAAA,QACN,KAAK,CAAC,IAAI,IAAI,SAAS;UAAA,QACZ,KAAK,CAAC,cAAc;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;MAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;MAAA;MAAA;IAAA;EAAA;AAOlD;AAEA,eAAe,QAAQ;AAAC","ignoreList":[]}
|
|
@@ -12,8 +12,12 @@ var _tmpl$ = /*#__PURE__*/_$template(`<header class=k2b-stat-grid__header><span
|
|
|
12
12
|
_tmpl$3 = /*#__PURE__*/_$template(`<section><!$><!/><!$><!/>`),
|
|
13
13
|
_tmpl$4 = /*#__PURE__*/_$template(`<a class=k2b-stat-grid__action><span></span><i class="ti ti-arrow-up-right"aria-hidden=true>`);
|
|
14
14
|
import { createContext, Show, useContext } from "solid-js";
|
|
15
|
+
|
|
16
|
+
/** `tiles` frames each figure; `plain` sets the figures in equal columns with a thin line between, for a page head. */
|
|
17
|
+
|
|
15
18
|
const StatGridSizeContext = createContext("md");
|
|
16
|
-
|
|
19
|
+
// A plain grid has no surface, so the surface context carries "plain" to its cells; a cell outside a grid stays a tile.
|
|
20
|
+
const StatGridSurfaceContext = createContext(() => "white");
|
|
17
21
|
export const useStatGridSize = () => useContext(StatGridSizeContext);
|
|
18
22
|
export const useStatGridSurface = () => useContext(StatGridSurfaceContext);
|
|
19
23
|
const columnValue = columns => {
|
|
@@ -21,9 +25,13 @@ const columnValue = columns => {
|
|
|
21
25
|
return 4;
|
|
22
26
|
};
|
|
23
27
|
|
|
24
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* A row of key figures, each a framed tile of its own or, with `variant="plain"`, flat figures in equal columns; the
|
|
30
|
+
* optional title and action sit above the row.
|
|
31
|
+
*/
|
|
25
32
|
export function StatGrid(props) {
|
|
26
33
|
const surface = () => props.surface ?? "white";
|
|
34
|
+
const plain = () => props.variant === "plain";
|
|
27
35
|
return (() => {
|
|
28
36
|
var _el$ = _$getNextElement(_tmpl$3),
|
|
29
37
|
_el$7 = _el$.firstChild,
|
|
@@ -61,9 +69,7 @@ export function StatGrid(props) {
|
|
|
61
69
|
},
|
|
62
70
|
get children() {
|
|
63
71
|
return _$createComponent(StatGridSurfaceContext.Provider, {
|
|
64
|
-
|
|
65
|
-
return surface();
|
|
66
|
-
},
|
|
72
|
+
value: () => plain() ? "plain" : surface(),
|
|
67
73
|
get children() {
|
|
68
74
|
var _el$6 = _$getNextElement(_tmpl$2);
|
|
69
75
|
_$insert(_el$6, () => props.children);
|
|
@@ -77,19 +83,22 @@ export function StatGrid(props) {
|
|
|
77
83
|
_v$2 = columnValue(props.columns),
|
|
78
84
|
_v$3 = props.size ?? "md",
|
|
79
85
|
_v$4 = surface(),
|
|
80
|
-
_v$5 =
|
|
86
|
+
_v$5 = plain() ? "plain" : "tiles",
|
|
87
|
+
_v$6 = props.title;
|
|
81
88
|
_v$ !== _p$.e && _$className(_el$, _p$.e = _v$);
|
|
82
89
|
_v$2 !== _p$.t && _$setAttribute(_el$, "data-columns", _p$.t = _v$2);
|
|
83
90
|
_v$3 !== _p$.a && _$setAttribute(_el$, "data-size", _p$.a = _v$3);
|
|
84
91
|
_v$4 !== _p$.o && _$setAttribute(_el$, "data-surface", _p$.o = _v$4);
|
|
85
|
-
_v$5 !== _p$.i && _$setAttribute(_el$, "
|
|
92
|
+
_v$5 !== _p$.i && _$setAttribute(_el$, "data-variant", _p$.i = _v$5);
|
|
93
|
+
_v$6 !== _p$.n && _$setAttribute(_el$, "aria-label", _p$.n = _v$6);
|
|
86
94
|
return _p$;
|
|
87
95
|
}, {
|
|
88
96
|
e: undefined,
|
|
89
97
|
t: undefined,
|
|
90
98
|
a: undefined,
|
|
91
99
|
o: undefined,
|
|
92
|
-
i: undefined
|
|
100
|
+
i: undefined,
|
|
101
|
+
n: undefined
|
|
93
102
|
});
|
|
94
103
|
return _el$;
|
|
95
104
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["surfaces/StatGrid.tsx"],"sourcesContent":["import { createContext, type JSX, Show, useContext } from \"solid-js\";\n\nexport type StatGridSize = \"lg\" | \"md\" | \"sm\";\nexport type StatGridSurface = \"white\" | \"muted\";\nexport type StatGridColumns = 1 | 2 | 3 | 4 | 5 | 6;\nexport type StatGridAction = { label: string; href: string };\n\nexport type StatGridProps = {\n children: JSX.Element;\n title?: string;\n action?: StatGridAction;\n /** Tiles per row on a wide container. Defaults to 4; at 600 px or less two share a row, and five or six take three up to 900 px. */\n columns?: StatGridColumns;\n size?: StatGridSize;\n surface?: StatGridSurface;\n class?: string;\n};\n\nconst StatGridSizeContext = createContext<StatGridSize>(\"md\");\nconst StatGridSurfaceContext = createContext<StatGridSurface
|
|
1
|
+
{"version":3,"names":[],"sources":["surfaces/StatGrid.tsx"],"sourcesContent":["import { type Accessor, createContext, type JSX, Show, useContext } from \"solid-js\";\n\nexport type StatGridSize = \"lg\" | \"md\" | \"sm\";\nexport type StatGridSurface = \"white\" | \"muted\";\nexport type StatGridColumns = 1 | 2 | 3 | 4 | 5 | 6;\nexport type StatGridAction = { label: string; href: string };\n/** `tiles` frames each figure; `plain` sets the figures in equal columns with a thin line between, for a page head. */\nexport type StatGridVariant = \"tiles\" | \"plain\";\n\nexport type StatGridProps = {\n children: JSX.Element;\n title?: string;\n action?: StatGridAction;\n /** Tiles per row on a wide container. Defaults to 4; at 600 px or less two share a row, and five or six take three up to 900 px. */\n columns?: StatGridColumns;\n size?: StatGridSize;\n /** Applies to `tiles` only: a `plain` row has no surface. */\n surface?: StatGridSurface;\n /**\n * `tiles` (default) frames each figure. `plain` drops frame, surface and shadow: equal columns with a 1 px line\n * between them, two columns below a 34rem container. Every figure keeps three rows (label, figure, a reserved third\n * line for `sub`, the change or the comparison), so all figures stand on one line.\n */\n variant?: StatGridVariant;\n class?: string;\n};\n\nconst StatGridSizeContext = createContext<StatGridSize>(\"md\");\n// A plain grid has no surface, so the surface context carries \"plain\" to its cells; a cell outside a grid stays a tile.\nconst StatGridSurfaceContext = createContext<Accessor<StatGridSurface | \"plain\">>((): StatGridSurface | \"plain\" => \"white\");\n\nexport const useStatGridSize = (): StatGridSize => useContext(StatGridSizeContext);\nexport const useStatGridSurface = (): Accessor<StatGridSurface | \"plain\"> => useContext(StatGridSurfaceContext);\n\nconst columnValue = (columns?: StatGridColumns): StatGridColumns => {\n if (columns && Number.isInteger(columns) && columns >= 1 && columns <= 6) return columns;\n return 4;\n};\n\n/**\n * A row of key figures, each a framed tile of its own or, with `variant=\"plain\"`, flat figures in equal columns; the\n * optional title and action sit above the row.\n */\nexport function StatGrid(props: StatGridProps): JSX.Element {\n const surface = () => props.surface ?? \"white\";\n const plain = () => props.variant === \"plain\";\n return (\n <section\n class={`k2b-stat-grid ${props.class ?? \"\"}`}\n data-columns={columnValue(props.columns)}\n data-size={props.size ?? \"md\"}\n data-surface={surface()}\n data-variant={plain() ? \"plain\" : \"tiles\"}\n aria-label={props.title}\n >\n <Show when={props.title}>\n <header class=\"k2b-stat-grid__header\">\n <span class=\"k2b-stat-grid__title\">{props.title}</span>\n <Show when={props.action}>\n {(action) => (\n <a href={action().href} class=\"k2b-stat-grid__action\">\n <span>{action().label}</span>\n <i class=\"ti ti-arrow-up-right\" aria-hidden=\"true\" />\n </a>\n )}\n </Show>\n </header>\n </Show>\n <StatGridSizeContext.Provider value={props.size ?? \"md\"}>\n <StatGridSurfaceContext.Provider value={() => (plain() ? \"plain\" : surface())}>\n <div class=\"k2b-stat-grid__body\">{props.children}</div>\n </StatGridSurfaceContext.Provider>\n </StatGridSizeContext.Provider>\n </section>\n );\n}\n\nexport default StatGrid;\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAwB,aAAa,EAAY,IAAI,EAAE,UAAU,QAAQ,UAAU;;AAMnF;;AAqBA,MAAM,mBAAmB,GAAG,aAAa,CAAe,IAAI,CAAC;AAC7D;AACA,MAAM,sBAAsB,GAAG,aAAa,CAAsC,MAAiC,OAAO,CAAC;AAE3H,OAAO,MAAM,eAAe,GAAG,MAAoB,UAAU,CAAC,mBAAmB,CAAC;AAClF,OAAO,MAAM,kBAAkB,GAAG,MAA2C,UAAU,CAAC,sBAAsB,CAAC;AAE/G,MAAM,WAAW,GAAI,OAAyB,IAAsB;EAClE,IAAI,OAAO,IAAI,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,OAAO,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,EAAE,OAAO,OAAO;EACxF,OAAO,CAAC;AACV,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,SAAS,QAAQ,CAAC,KAAoB,EAAe;EAC1D,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,OAAO,IAAI,OAAO;EAC9C,MAAM,KAAK,GAAG,MAAM,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ing, AvatarShape, AvatarSize, AvatarTone } from \"./Avatar\";\nexport { Avatar } from \"./Avatar\";\nexport type { AvatarFacesPerson, AvatarFacesProps, AvatarStackPerson, AvatarStackProps } from \"./AvatarStack\";\nexport { AvatarFaces, AvatarStack } from \"./AvatarStack\";\nexport { type BudgetItem, type BudgetLevel, BudgetList, type BudgetListProps, budgetState } from \"./BudgetList\";\nexport type { ChangeListItem, ChangeListProps, ChangeTone } from \"./ChangeList\";\nexport { ChangeList } from \"./ChangeList\";\nexport type { DescriptionListItem, DescriptionListProps } from \"./DescriptionList\";\nexport { DescriptionList } from \"./DescriptionList\";\nexport type { DotStripProps, DotStripTone } from \"./DotStrip\";\nexport { DotStrip } from \"./DotStrip\";\nexport type { FieldRowProps } from \"./Field\";\nexport { Field } from \"./Field\";\nexport type { LinkCardColor, LinkCardProps } from \"./LinkCard\";\nexport { LinkCard } from \"./LinkCard\";\nexport type { NotFoundStateAction, NotFoundStateProps } from \"./NotFoundState\";\nexport { NotFoundState } from \"./NotFoundState\";\nexport type { NoticeCardProps, NoticeGridProps, NoticeTone } from \"./NoticeCard\";\nexport { NOTICE_CARD_CLASSES, NoticeCard } from \"./NoticeCard\";\nexport type { NoticeRowProps } from \"./NoticeRow\";\nexport { NoticeRow } from \"./NoticeRow\";\nexport type { PaperProps, PaperTag } from \"./Paper\";\nexport { Paper } from \"./Paper\";\nexport type {\n PlaceholderAlign,\n PlaceholderProps,\n PlaceholderState,\n PlaceholderSurface,\n PlaceholderVariant,\n} from \"./Placeholder\";\nexport { default as Placeholder } from \"./Placeholder\";\nexport type { ProgressBarPart, ProgressBarProps, ProgressBarSegment, ProgressBarTone } from \"./ProgressBar\";\nexport { ProgressBar, progressBarParts } from \"./ProgressBar\";\nexport type { ProgressRingProps, ProgressRingTone } from \"./ProgressRing\";\nexport { ProgressRing } from \"./ProgressRing\";\nexport { PERSON_COLORS, personColor } from \"./person-color\";\nexport type { ResourceCardColor, ResourceCardProps, ResourceCardState } from \"./ResourceCard\";\nexport { ResourceCard } from \"./ResourceCard\";\nexport type { SectionFrame, SectionPartProps, SectionProps, SectionSize, SectionState, SectionTone } from \"./Section\";\nexport { Section } from \"./Section\";\nexport { createDelayedLoading, type DelayedLoadingOptions, Skeleton, type SkeletonProps } from \"./Skeleton\";\nexport type { StatCellAccent, StatCellCompare, StatCellDelta, StatCellProps, StatCellSize, StatCellTone } from \"./StatCell\";\nexport { StatCell } from \"./StatCell\";\nexport type {\n StatGridAction,\n StatGridColumns,\n StatGridProps,\n StatGridSize,\n StatGridSurface,\n} from \"./StatGrid\";\nexport { StatGrid } from \"./StatGrid\";\nexport type { StatusBadgeProps, StatusTone } from \"./StatusBadge\";\nexport { StatusBadge } from \"./StatusBadge\";\nexport type { TagProps, TagSize } from \"./Tag\";\nexport { Tag } from \"./Tag\";\n"],"mappings":"AACA,SAAS,MAAM,QAAQ,UAAU;AAEjC,SAAS,WAAW,EAAE,WAAW,QAAQ,eAAe;AACxD,SAA4C,UAAU,EAAwB,WAAW,QAAQ,cAAc;AAE/G,SAAS,UAAU,QAAQ,cAAc;AAEzC,SAAS,eAAe,QAAQ,mBAAmB;AAEnD,SAAS,QAAQ,QAAQ,YAAY;AAErC,SAAS,KAAK,QAAQ,SAAS;AAE/B,SAAS,QAAQ,QAAQ,YAAY;AAErC,SAAS,aAAa,QAAQ,iBAAiB;AAE/C,SAAS,mBAAmB,EAAE,UAAU,QAAQ,cAAc;AAE9D,SAAS,SAAS,QAAQ,aAAa;AAEvC,SAAS,KAAK,QAAQ,SAAS;AAQ/B,SAAS,OAAO,IAAI,WAAW,QAAQ,eAAe;AAEtD,SAAS,WAAW,EAAE,gBAAgB,QAAQ,eAAe;AAE7D,SAAS,YAAY,QAAQ,gBAAgB;AAC7C,SAAS,aAAa,EAAE,WAAW,QAAQ,gBAAgB;AAE3D,SAAS,YAAY,QAAQ,gBAAgB;AAE7C,SAAS,OAAO,QAAQ,WAAW;AACnC,SAAS,oBAAoB,EAA8B,QAAQ,QAA4B,YAAY;AAE3G,SAAS,QAAQ,QAAQ,YAAY;
|
|
1
|
+
{"version":3,"names":[],"sources":["surfaces/index.ts"],"sourcesContent":["export type { AvatarProps, AvatarRing, AvatarShape, AvatarSize, AvatarTone } from \"./Avatar\";\nexport { Avatar } from \"./Avatar\";\nexport type { AvatarFacesPerson, AvatarFacesProps, AvatarStackPerson, AvatarStackProps } from \"./AvatarStack\";\nexport { AvatarFaces, AvatarStack } from \"./AvatarStack\";\nexport { type BudgetItem, type BudgetLevel, BudgetList, type BudgetListProps, budgetState } from \"./BudgetList\";\nexport type { ChangeListItem, ChangeListProps, ChangeTone } from \"./ChangeList\";\nexport { ChangeList } from \"./ChangeList\";\nexport type { DescriptionListItem, DescriptionListProps } from \"./DescriptionList\";\nexport { DescriptionList } from \"./DescriptionList\";\nexport type { DotStripProps, DotStripTone } from \"./DotStrip\";\nexport { DotStrip } from \"./DotStrip\";\nexport type { FieldRowProps } from \"./Field\";\nexport { Field } from \"./Field\";\nexport type { LinkCardColor, LinkCardProps } from \"./LinkCard\";\nexport { LinkCard } from \"./LinkCard\";\nexport type { NotFoundStateAction, NotFoundStateProps } from \"./NotFoundState\";\nexport { NotFoundState } from \"./NotFoundState\";\nexport type { NoticeCardProps, NoticeGridProps, NoticeTone } from \"./NoticeCard\";\nexport { NOTICE_CARD_CLASSES, NoticeCard } from \"./NoticeCard\";\nexport type { NoticeRowProps } from \"./NoticeRow\";\nexport { NoticeRow } from \"./NoticeRow\";\nexport type { PaperProps, PaperTag } from \"./Paper\";\nexport { Paper } from \"./Paper\";\nexport type {\n PlaceholderAlign,\n PlaceholderProps,\n PlaceholderState,\n PlaceholderSurface,\n PlaceholderVariant,\n} from \"./Placeholder\";\nexport { default as Placeholder } from \"./Placeholder\";\nexport type { ProgressBarPart, ProgressBarProps, ProgressBarSegment, ProgressBarTone } from \"./ProgressBar\";\nexport { ProgressBar, progressBarParts } from \"./ProgressBar\";\nexport type { ProgressRingProps, ProgressRingTone } from \"./ProgressRing\";\nexport { ProgressRing } from \"./ProgressRing\";\nexport { PERSON_COLORS, personColor } from \"./person-color\";\nexport type { ResourceCardColor, ResourceCardProps, ResourceCardState } from \"./ResourceCard\";\nexport { ResourceCard } from \"./ResourceCard\";\nexport type { SectionFrame, SectionPartProps, SectionProps, SectionSize, SectionState, SectionTone } from \"./Section\";\nexport { Section } from \"./Section\";\nexport { createDelayedLoading, type DelayedLoadingOptions, Skeleton, type SkeletonProps } from \"./Skeleton\";\nexport type { StatCellAccent, StatCellCompare, StatCellDelta, StatCellProps, StatCellSize, StatCellTone } from \"./StatCell\";\nexport { StatCell } from \"./StatCell\";\nexport type {\n StatGridAction,\n StatGridColumns,\n StatGridProps,\n StatGridSize,\n StatGridSurface,\n StatGridVariant,\n} from \"./StatGrid\";\nexport { StatGrid } from \"./StatGrid\";\nexport type { StatusBadgeProps, StatusTone } from \"./StatusBadge\";\nexport { StatusBadge } from \"./StatusBadge\";\nexport type { TagProps, TagSize } from \"./Tag\";\nexport { Tag } from \"./Tag\";\n"],"mappings":"AACA,SAAS,MAAM,QAAQ,UAAU;AAEjC,SAAS,WAAW,EAAE,WAAW,QAAQ,eAAe;AACxD,SAA4C,UAAU,EAAwB,WAAW,QAAQ,cAAc;AAE/G,SAAS,UAAU,QAAQ,cAAc;AAEzC,SAAS,eAAe,QAAQ,mBAAmB;AAEnD,SAAS,QAAQ,QAAQ,YAAY;AAErC,SAAS,KAAK,QAAQ,SAAS;AAE/B,SAAS,QAAQ,QAAQ,YAAY;AAErC,SAAS,aAAa,QAAQ,iBAAiB;AAE/C,SAAS,mBAAmB,EAAE,UAAU,QAAQ,cAAc;AAE9D,SAAS,SAAS,QAAQ,aAAa;AAEvC,SAAS,KAAK,QAAQ,SAAS;AAQ/B,SAAS,OAAO,IAAI,WAAW,QAAQ,eAAe;AAEtD,SAAS,WAAW,EAAE,gBAAgB,QAAQ,eAAe;AAE7D,SAAS,YAAY,QAAQ,gBAAgB;AAC7C,SAAS,aAAa,EAAE,WAAW,QAAQ,gBAAgB;AAE3D,SAAS,YAAY,QAAQ,gBAAgB;AAE7C,SAAS,OAAO,QAAQ,WAAW;AACnC,SAAS,oBAAoB,EAA8B,QAAQ,QAA4B,YAAY;AAE3G,SAAS,QAAQ,QAAQ,YAAY;AASrC,SAAS,QAAQ,QAAQ,YAAY;AAErC,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,GAAG,QAAQ,OAAO","ignoreList":[]}
|
|
@@ -16,18 +16,18 @@ var _tmpl$ = ["<p class=\"k2b-dropdown__empty\">", "</p>"],
|
|
|
16
16
|
_tmpl$1 = ["<div", " role=\"option\" class=\"k2b-dropdown__item\"", ">", "<span class=\"k2b-dropdown__copy k2b-command-list__text\"><span>", "</span>", "</span>", "", "</div>"],
|
|
17
17
|
_tmpl$10 = "<i class=\"ti ti-loader-2 k2b-spin k2b-command-list__busy\" aria-hidden=\"true\"></i>",
|
|
18
18
|
_tmpl$11 = ["<span class=\"k2b-command-list__leading\" aria-hidden=\"true\">", "</span>"],
|
|
19
|
-
_tmpl$12 = ["<
|
|
20
|
-
_tmpl$13 = ["<
|
|
21
|
-
_tmpl$14 = ["<
|
|
22
|
-
_tmpl$15 = ["<
|
|
23
|
-
_tmpl$16 = ["<
|
|
24
|
-
_tmpl$17 = ["<
|
|
25
|
-
_tmpl$18 = ["<
|
|
26
|
-
_tmpl$19 = ["<
|
|
27
|
-
_tmpl$20 = ["<img", " alt width=\"16\" height=\"16\" decoding=\"async\">"],
|
|
28
|
-
_tmpl$21 = ["<img class=\"k2b-command-list__image-
|
|
29
|
-
_tmpl$22 = ["<img class=\"k2b-command-list__image-dark\"", " alt width=\"16\" height=\"16\" decoding=\"async\">"];
|
|
19
|
+
_tmpl$12 = ["<span class=\"k2b-command-list__hint\" aria-hidden=\"true\">", "</span>"],
|
|
20
|
+
_tmpl$13 = ["<p class=\"k2b-command-list__state\" data-error><i class=\"ti ti-alert-circle\" aria-hidden=\"true\"></i><span>", "</span><button type=\"button\" tabindex=\"-1\">", "</button></p>"],
|
|
21
|
+
_tmpl$14 = ["<button type=\"button\" class=\"k2b-command-outcome__close\"", "><i class=\"ti ti-x\" aria-hidden=\"true\"></i></button>"],
|
|
22
|
+
_tmpl$15 = ["<div class=\"k2b-command-outcome\"", " tabindex=\"-1\"><i aria-hidden=\"true\"", "></i><span class=\"k2b-command-outcome__text\"", " aria-hidden=\"true\">", "</span>", "", "</div>"],
|
|
23
|
+
_tmpl$16 = ["<button type=\"button\">", "</button>"],
|
|
24
|
+
_tmpl$17 = ["<i", " aria-hidden=\"true\"></i>"],
|
|
25
|
+
_tmpl$18 = ["<span class=\"k2b-command-list__image\" aria-hidden=\"true\">", "</span>"],
|
|
26
|
+
_tmpl$19 = ["<img", " alt width=\"16\" height=\"16\" decoding=\"async\">"],
|
|
27
|
+
_tmpl$20 = ["<img class=\"k2b-command-list__image-light\"", " alt width=\"16\" height=\"16\" decoding=\"async\">"],
|
|
28
|
+
_tmpl$21 = ["<img class=\"k2b-command-list__image-dark\"", " alt width=\"16\" height=\"16\" decoding=\"async\">"];
|
|
30
29
|
import { createEffect, createMemo, createSignal, For, onCleanup, Show, untrack } from "solid-js";
|
|
30
|
+
import { optionDescription } from "../internal/option-description";
|
|
31
31
|
import { useUiMessages } from "../intl/messages";
|
|
32
32
|
import { commandKey, filterCommandItems, groupCommandItems } from "./command-items";
|
|
33
33
|
import { useCommandMessages } from "./command-messages";
|
|
@@ -492,16 +492,13 @@ export function CommandList(props) {
|
|
|
492
492
|
children: leading => _$ssr(_tmpl$11, _$escape(leading()()))
|
|
493
493
|
});
|
|
494
494
|
}
|
|
495
|
-
})), _$escape(entry.item.label), _$escape(
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
},
|
|
499
|
-
children: text => _$ssr(_tmpl$12, _$escape(text()))
|
|
500
|
-
})), _$escape(_$createComponent(Show, {
|
|
495
|
+
})), _$escape(entry.item.label), _$escape(optionDescription(entry.item.disabled ? {
|
|
496
|
+
description: entry.item.disabled
|
|
497
|
+
} : entry.item, "k2b-command-list__description")), _$escape(_$createComponent(Show, {
|
|
501
498
|
get when() {
|
|
502
499
|
return entry.item.hint;
|
|
503
500
|
},
|
|
504
|
-
children: hint => _$ssr(_tmpl$
|
|
501
|
+
children: hint => _$ssr(_tmpl$12, _$escape(hint()))
|
|
505
502
|
})), _$escape(_$createComponent(Show, {
|
|
506
503
|
get when() {
|
|
507
504
|
return entry.item.next;
|
|
@@ -530,7 +527,7 @@ export function CommandList(props) {
|
|
|
530
527
|
get when() {
|
|
531
528
|
return _$memo(() => nav.load().state === "failed")() ? nav.load() : undefined;
|
|
532
529
|
},
|
|
533
|
-
children: failed => _$ssr(_tmpl$
|
|
530
|
+
children: failed => _$ssr(_tmpl$13, _$escape(failed().message ?? commandMessages().loadFailed), _$escape(messages().retry))
|
|
534
531
|
})))];
|
|
535
532
|
}
|
|
536
533
|
}), _$ssr(_tmpl$4, _$escape(status())), _$ssr(_tmpl$5, _$escape(outcomeError() || loadFailure()))];
|
|
@@ -549,17 +546,17 @@ function CommandOutcomeLine(props) {
|
|
|
549
546
|
return outcome();
|
|
550
547
|
},
|
|
551
548
|
children: current => // biome-ignore lint/a11y/noStaticElementInteractions: it holds the focus only when a menu without a target has nowhere else to keep it.
|
|
552
|
-
_$ssr(_tmpl$
|
|
549
|
+
_$ssr(_tmpl$15, _$ssrAttribute("data-state", _$escape(current().state, true), false), _$ssrAttribute("class", current().state === "success" ? "ti ti-circle-check" : current().state === "error" ? "ti ti-alert-circle" : "ti ti-loader-2 k2b-spin", false), _$ssrAttribute("title", _$escape(props.text(current()), true), false), _$escape(props.text(current())), _$escape(_$createComponent(Show, {
|
|
553
550
|
get when() {
|
|
554
551
|
return _$memo(() => current().state === "error")() ? current().retry : undefined;
|
|
555
552
|
},
|
|
556
|
-
children: retry => _$ssr(_tmpl$
|
|
553
|
+
children: retry => _$ssr(_tmpl$16, _$escape(messages().retry))
|
|
557
554
|
})), _$escape(_$createComponent(Show, {
|
|
558
555
|
get when() {
|
|
559
556
|
return current().state === "error";
|
|
560
557
|
},
|
|
561
558
|
get children() {
|
|
562
|
-
return _$ssr(_tmpl$
|
|
559
|
+
return _$ssr(_tmpl$14, _$ssrAttribute("aria-label", _$escape(messages().close, true), false));
|
|
563
560
|
}
|
|
564
561
|
})))
|
|
565
562
|
});
|
|
@@ -577,17 +574,17 @@ function CommandVisual(props) {
|
|
|
577
574
|
get when() {
|
|
578
575
|
return props.item.icon;
|
|
579
576
|
},
|
|
580
|
-
children: icon => _$ssr(_tmpl$
|
|
577
|
+
children: icon => _$ssr(_tmpl$17, _$ssrAttribute("class", _$escape(icon(), true), false))
|
|
581
578
|
});
|
|
582
579
|
},
|
|
583
|
-
children: source => _$ssr(_tmpl$
|
|
580
|
+
children: source => _$ssr(_tmpl$18, _$escape(_$createComponent(Show, {
|
|
584
581
|
get when() {
|
|
585
582
|
return _$memo(() => typeof source() === "object")() ? source() : undefined;
|
|
586
583
|
},
|
|
587
584
|
get fallback() {
|
|
588
|
-
return _$ssr(_tmpl$
|
|
585
|
+
return _$ssr(_tmpl$19, _$ssrAttribute("src", _$escape(source(), true), false));
|
|
589
586
|
},
|
|
590
|
-
children: pair => [_$ssr(_tmpl$
|
|
587
|
+
children: pair => [_$ssr(_tmpl$20, _$ssrAttribute("src", _$escape(pair().light, true), false)), _$ssr(_tmpl$21, _$ssrAttribute("src", _$escape(pair().dark, true), false))]
|
|
591
588
|
})))
|
|
592
589
|
});
|
|
593
590
|
}
|