@nocoo/basalt 2.1.8 → 3.0.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/README.md +2 -0
- package/ai/COMPATIBILITY.md +11 -1
- package/ai/DESIGN.md +342 -0
- package/ai/INTEGRATION.md +239 -152
- package/ai/RECIPES.md +96 -26
- package/ai/USAGE.md +5 -5
- package/ai/registry.json +2883 -275
- package/dist/assets/brand-mark.js.map +1 -1
- package/dist/charts/area.js.map +1 -1
- package/dist/charts/bar.js.map +1 -1
- package/dist/charts/bullet.js.map +1 -1
- package/dist/charts/charts.js.map +1 -1
- package/dist/charts/config.d.ts +11 -11
- package/dist/charts/config.js +4 -4
- package/dist/charts/config.js.map +1 -1
- package/dist/charts/custom-chart.js.map +1 -1
- package/dist/charts/date-navigation.js +10 -10
- package/dist/charts/date-navigation.js.map +1 -1
- package/dist/charts/donut.js +1 -1
- package/dist/charts/donut.js.map +1 -1
- package/dist/charts/frame.d.ts +1 -1
- package/dist/charts/frame.js +4 -4
- package/dist/charts/frame.js.map +1 -1
- package/dist/charts/funnel.js.map +1 -1
- package/dist/charts/gauge.js +5 -5
- package/dist/charts/gauge.js.map +1 -1
- package/dist/charts/grouped-bar.js.map +1 -1
- package/dist/charts/heatmap-calendar.js +11 -11
- package/dist/charts/heatmap-calendar.js.map +1 -1
- package/dist/charts/heatmap-matrix.js +8 -8
- package/dist/charts/heatmap-matrix.js.map +1 -1
- package/dist/charts/item-list.js +1 -1
- package/dist/charts/item-list.js.map +1 -1
- package/dist/charts/legend.js +19 -19
- package/dist/charts/legend.js.map +1 -1
- package/dist/charts/line.js.map +1 -1
- package/dist/charts/palette.js +2 -2
- package/dist/charts/palette.js.map +1 -1
- package/dist/charts/radar.js.map +1 -1
- package/dist/charts/sample.js.map +1 -1
- package/dist/charts/sankey.js.map +1 -1
- package/dist/charts/series.js.map +1 -1
- package/dist/charts/slot-bar.js +2 -2
- package/dist/charts/slot-bar.js.map +1 -1
- package/dist/charts/sparkline.js +38 -23
- package/dist/charts/sparkline.js.map +1 -1
- package/dist/charts/stacked-bar.js.map +1 -1
- package/dist/charts/stat-card.d.ts +2 -2
- package/dist/charts/stat-card.js +61 -58
- package/dist/charts/stat-card.js.map +1 -1
- package/dist/charts/timeline.js +18 -9
- package/dist/charts/timeline.js.map +1 -1
- package/dist/charts/timeseries.js.map +1 -1
- package/dist/charts/tooltip.js +16 -16
- package/dist/charts/tooltip.js.map +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/alert-dialog.js +4 -4
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/app-header.d.ts +5 -1
- package/dist/components/app-header.js +19 -11
- package/dist/components/app-header.js.map +1 -1
- package/dist/components/app-shell.d.ts +4 -1
- package/dist/components/app-shell.js +8 -5
- package/dist/components/app-shell.js.map +1 -1
- package/dist/components/approval-card.d.ts +13 -0
- package/dist/components/approval-card.js +161 -0
- package/dist/components/approval-card.js.map +1 -0
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/avatar.d.ts +12 -0
- package/dist/components/avatar.js +39 -18
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.js +8 -8
- package/dist/components/badge.js.map +1 -1
- package/dist/components/banner.d.ts +2 -2
- package/dist/components/banner.js +9 -8
- package/dist/components/banner.js.map +1 -1
- package/dist/components/basalt-mark.js +1 -1
- package/dist/components/basalt-mark.js.map +1 -1
- package/dist/components/battery-meter.js +5 -5
- package/dist/components/battery-meter.js.map +1 -1
- package/dist/components/breadcrumbs.js +6 -6
- package/dist/components/breadcrumbs.js.map +1 -1
- package/dist/components/button.js +10 -10
- package/dist/components/button.js.map +1 -1
- package/dist/components/chat-bubble.js +4 -3
- package/dist/components/chat-bubble.js.map +1 -1
- package/dist/components/chat-composer.d.ts +21 -3
- package/dist/components/chat-composer.js +126 -60
- package/dist/components/chat-composer.js.map +1 -1
- package/dist/components/chat-header.js +6 -6
- package/dist/components/chat-header.js.map +1 -1
- package/dist/components/chat-inbox.js +34 -30
- package/dist/components/chat-inbox.js.map +1 -1
- package/dist/components/chat-markdown.d.ts +8 -0
- package/dist/components/chat-markdown.js +122 -0
- package/dist/components/chat-markdown.js.map +1 -0
- package/dist/components/chat-message.d.ts +26 -0
- package/dist/components/chat-message.js +145 -0
- package/dist/components/chat-message.js.map +1 -0
- package/dist/components/checkbox.js +11 -11
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/clipboard-text.js +3 -3
- package/dist/components/clipboard-text.js.map +1 -1
- package/dist/components/code.d.ts +22 -20
- package/dist/components/code.js +94 -32
- package/dist/components/code.js.map +1 -1
- package/dist/components/collapsible.js +8 -4
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command-palette.js +73 -47
- package/dist/components/command-palette.js.map +1 -1
- package/dist/components/confirm-dialog.d.ts +4 -1
- package/dist/components/confirm-dialog.js +20 -18
- package/dist/components/confirm-dialog.js.map +1 -1
- package/dist/components/context-cards.d.ts +15 -0
- package/dist/components/context-cards.js +148 -0
- package/dist/components/context-cards.js.map +1 -0
- package/dist/components/context-menu.d.ts +1 -1
- package/dist/components/context-menu.js +18 -14
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/data-table.d.ts +8 -2
- package/dist/components/data-table.js +161 -106
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-picker.js +13 -13
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/delete-resource.js +1 -1
- package/dist/components/delete-resource.js.map +1 -1
- package/dist/components/description-list.js +3 -3
- package/dist/components/description-list.js.map +1 -1
- package/dist/components/dialog.d.ts +2 -2
- package/dist/components/dialog.js +8 -8
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/diff-table.d.ts +15 -0
- package/dist/components/diff-table.js +146 -0
- package/dist/components/diff-table.js.map +1 -0
- package/dist/components/dock.js +2 -2
- package/dist/components/dock.js.map +1 -1
- package/dist/components/dropdown-menu.js +23 -18
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/editable-nav-item.js +63 -58
- package/dist/components/editable-nav-item.js.map +1 -1
- package/dist/components/empty.js +6 -6
- package/dist/components/empty.js.map +1 -1
- package/dist/components/fab.js +1 -1
- package/dist/components/fab.js.map +1 -1
- package/dist/components/field.js +3 -3
- package/dist/components/field.js.map +1 -1
- package/dist/components/file-dropzone.js +7 -7
- package/dist/components/file-dropzone.js.map +1 -1
- package/dist/components/filter-bar.js +6 -6
- package/dist/components/filter-bar.js.map +1 -1
- package/dist/components/flow.js +4 -3
- package/dist/components/flow.js.map +1 -1
- package/dist/components/grid.d.ts +3 -1
- package/dist/components/grid.js +15 -8
- package/dist/components/grid.js.map +1 -1
- package/dist/components/hover-card.js +1 -1
- package/dist/components/hover-card.js.map +1 -1
- package/dist/components/icon-picker.d.ts +8 -2
- package/dist/components/icon-picker.js +75 -47
- package/dist/components/icon-picker.js.map +1 -1
- package/dist/components/inline-editable.js +6 -6
- package/dist/components/inline-editable.js.map +1 -1
- package/dist/components/input-area.js +3 -3
- package/dist/components/input-area.js.map +1 -1
- package/dist/components/input-group.js +5 -5
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input.js +4 -4
- package/dist/components/input.js.map +1 -1
- package/dist/components/label.js +3 -3
- package/dist/components/label.js.map +1 -1
- package/dist/components/layer-card.d.ts +9 -4
- package/dist/components/layer-card.js +72 -67
- package/dist/components/layer-card.js.map +1 -1
- package/dist/components/link.js.map +1 -1
- package/dist/components/loader.d.ts +16 -10
- package/dist/components/loader.js +46 -53
- package/dist/components/loader.js.map +1 -1
- package/dist/components/loading-screen.js +3 -3
- package/dist/components/loading-screen.js.map +1 -1
- package/dist/components/menu-bar.js +32 -27
- package/dist/components/menu-bar.js.map +1 -1
- package/dist/components/meter.d.ts +5 -5
- package/dist/components/meter.js +25 -12
- package/dist/components/meter.js.map +1 -1
- package/dist/components/multi-select.js +66 -62
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu.js +22 -8
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/overlay.js +2 -2
- package/dist/components/overlay.js.map +1 -1
- package/dist/components/page-header.d.ts +3 -1
- package/dist/components/page-header.js +12 -12
- package/dist/components/page-header.js.map +1 -1
- package/dist/components/pagination.js +3 -3
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.js +18 -23
- package/dist/components/popover.js.map +1 -1
- package/dist/components/prompt-bar.d.ts +16 -0
- package/dist/components/prompt-bar.js +49 -0
- package/dist/components/prompt-bar.js.map +1 -0
- package/dist/components/radio.js +9 -9
- package/dist/components/radio.js.map +1 -1
- package/dist/components/recommendation-card.d.ts +13 -0
- package/dist/components/recommendation-card.js +123 -0
- package/dist/components/recommendation-card.js.map +1 -0
- package/dist/components/resource-list.js +1 -1
- package/dist/components/resource-list.js.map +1 -1
- package/dist/components/responsive-master-detail.js +7 -7
- package/dist/components/responsive-master-detail.js.map +1 -1
- package/dist/components/scroll-area.js +3 -3
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/section-rule.d.ts +5 -3
- package/dist/components/section-rule.js +12 -12
- package/dist/components/section-rule.js.map +1 -1
- package/dist/components/segment-control.js +3 -3
- package/dist/components/segment-control.js.map +1 -1
- package/dist/components/select.js +47 -32
- package/dist/components/select.js.map +1 -1
- package/dist/components/sensitive-input.js +17 -19
- package/dist/components/sensitive-input.js.map +1 -1
- package/dist/components/separator.js.map +1 -1
- package/dist/components/sheet.d.ts +4 -4
- package/dist/components/sheet.js +12 -10
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sidebar.d.ts +3 -1
- package/dist/components/sidebar.js +150 -138
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/skeleton-line.d.ts +1 -1
- package/dist/components/skeleton-line.js +2 -2
- package/dist/components/skeleton-line.js.map +1 -1
- package/dist/components/slider.js +2 -2
- package/dist/components/slider.js.map +1 -1
- package/dist/components/stat-strip.js +5 -4
- package/dist/components/stat-strip.js.map +1 -1
- package/dist/components/switch.js +6 -6
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table-of-contents.js +5 -5
- package/dist/components/table-of-contents.js.map +1 -1
- package/dist/components/table-pager.js +2 -2
- package/dist/components/table-pager.js.map +1 -1
- package/dist/components/table.js +4 -4
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.js +7 -6
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tag-badge.d.ts +10 -10
- package/dist/components/tag-badge.js +11 -11
- package/dist/components/tag-badge.js.map +1 -1
- package/dist/components/tag-color-picker.d.ts +8 -1
- package/dist/components/tag-color-picker.js +33 -25
- package/dist/components/tag-color-picker.js.map +1 -1
- package/dist/components/text.js +5 -5
- package/dist/components/text.js.map +1 -1
- package/dist/components/theme-toggle.js +1 -1
- package/dist/components/theme-toggle.js.map +1 -1
- package/dist/components/thinking.d.ts +16 -0
- package/dist/components/thinking.js +85 -0
- package/dist/components/thinking.js.map +1 -0
- package/dist/components/toast.js +25 -20
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toggle-group.js +6 -5
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle.js +6 -6
- package/dist/components/toggle.js.map +1 -1
- package/dist/components/tool-chips.d.ts +12 -0
- package/dist/components/tool-chips.js +138 -0
- package/dist/components/tool-chips.js.map +1 -0
- package/dist/components/toolbar.js +3 -3
- package/dist/components/toolbar.js.map +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/typeahead-field.js +59 -56
- package/dist/components/typeahead-field.js.map +1 -1
- package/dist/components/upload-queue.js +15 -14
- package/dist/components/upload-queue.js.map +1 -1
- package/dist/models/agent-feedback.d.ts +44 -0
- package/dist/models/agent-feedback.js +28 -0
- package/dist/models/agent-feedback.js.map +1 -0
- package/dist/models/avatar.d.ts +2 -0
- package/dist/models/avatar.js +15 -0
- package/dist/models/avatar.js.map +1 -0
- package/dist/models/code.d.ts +6 -0
- package/dist/models/code.js +24 -0
- package/dist/models/code.js.map +1 -0
- package/dist/models/context-cards.d.ts +13 -0
- package/dist/models/context-cards.js +17 -0
- package/dist/models/context-cards.js.map +1 -0
- package/dist/models/diff-table.d.ts +12 -0
- package/dist/models/diff-table.js +9 -0
- package/dist/models/diff-table.js.map +1 -0
- package/dist/models/recommendation.d.ts +26 -0
- package/dist/models/recommendation.js +23 -0
- package/dist/models/recommendation.js.map +1 -0
- package/dist/providers/accent.js +1 -1
- package/dist/providers/accent.js.map +1 -1
- package/dist/providers/link.js.map +1 -1
- package/dist/providers/theme.js +1 -1
- package/dist/providers/theme.js.map +1 -1
- package/dist/styles/base.css +128 -0
- package/dist/styles/standalone.css +1994 -937
- package/dist/styles/tailwind.css +179 -13
- package/dist/styles/tokens.css +679 -20
- package/dist/utils/cn.js +25 -4
- package/dist/utils/cn.js.map +1 -1
- package/dist/utils/control-surface.d.ts +1 -1
- package/dist/utils/control-surface.js +1 -1
- package/dist/utils/control-surface.js.map +1 -1
- package/dist/utils/navigation.d.ts +3 -0
- package/dist/utils/navigation.js +8 -0
- package/dist/utils/navigation.js.map +1 -0
- package/dist/utils/preference-store.js +1 -1
- package/dist/utils/preference-store.js.map +1 -1
- package/dist/utils/selection-indicator.d.ts +1 -1
- package/dist/utils/selection-indicator.js +49 -72
- package/dist/utils/selection-indicator.js.map +1 -1
- package/dist/utils/use-checkable-group.js.map +1 -1
- package/dist/utils/use-hover-highlight.d.ts +4 -0
- package/dist/utils/use-hover-highlight.js +80 -0
- package/dist/utils/use-hover-highlight.js.map +1 -0
- package/dist/viewmodels/use-approval-card.d.ts +20 -0
- package/dist/viewmodels/use-approval-card.js +83 -0
- package/dist/viewmodels/use-approval-card.js.map +1 -0
- package/dist/viewmodels/use-chat-composer.d.ts +16 -0
- package/dist/viewmodels/use-chat-composer.js +34 -0
- package/dist/viewmodels/use-chat-composer.js.map +1 -0
- package/dist/viewmodels/use-chat-message.d.ts +16 -0
- package/dist/viewmodels/use-chat-message.js +26 -0
- package/dist/viewmodels/use-chat-message.js.map +1 -0
- package/dist/viewmodels/use-code-block.d.ts +8 -0
- package/dist/viewmodels/use-code-block.js +38 -0
- package/dist/viewmodels/use-code-block.js.map +1 -0
- package/dist/viewmodels/use-context-cards.d.ts +17 -0
- package/dist/viewmodels/use-context-cards.js +18 -0
- package/dist/viewmodels/use-context-cards.js.map +1 -0
- package/dist/viewmodels/use-diff-table.d.ts +16 -0
- package/dist/viewmodels/use-diff-table.js +42 -0
- package/dist/viewmodels/use-diff-table.js.map +1 -0
- package/dist/viewmodels/use-loader.d.ts +4 -0
- package/dist/viewmodels/use-loader.js +22 -0
- package/dist/viewmodels/use-loader.js.map +1 -0
- package/dist/viewmodels/use-recommendation-card.d.ts +17 -0
- package/dist/viewmodels/use-recommendation-card.js +41 -0
- package/dist/viewmodels/use-recommendation-card.js.map +1 -0
- package/dist/viewmodels/use-thinking.d.ts +13 -0
- package/dist/viewmodels/use-thinking.js +18 -0
- package/dist/viewmodels/use-thinking.js.map +1 -0
- package/dist/viewmodels/use-tool-chips.d.ts +10 -0
- package/dist/viewmodels/use-tool-chips.js +20 -0
- package/dist/viewmodels/use-tool-chips.js.map +1 -0
- package/package.json +3 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-cards.js","names":["ContextCards","vm","useContextCardsViewModel","chunks","totalCount","id","useId","loading","cn","className","title","Badge","LayerCard","SkeletonLine","error","onRetry","Button","chunk","TextAlignStart","FileText","ExternalLink"],"sources":["../../src/components/context-cards.tsx"],"sourcesContent":["import { ExternalLink, FileText, TextAlignStart } from \"lucide-react\";\nimport { useId } from \"react\";\nimport type { ContextChunk } from \"../models/context-cards\";\nimport { cn } from \"../utils/cn\";\nimport { useContextCardsViewModel } from \"../viewmodels/use-context-cards\";\nimport { Badge } from \"./badge\";\nimport { Button } from \"./button\";\nimport { LayerCard } from \"./layer-card\";\nimport { SkeletonLine } from \"./skeleton-line\";\n\nexport type { ContextChunk } from \"../models/context-cards\";\n\nexport interface ContextCardsProps {\n\t/** Retrieved chunks with stable IDs and caller-owned source metadata. */\n\tchunks: readonly ContextChunk[];\n\t/** Heading for the chunk list. @default \"All chunks\" */\n\ttitle?: string;\n\t/** Total available chunks, when displaying a subset. Never smaller than the visible count. */\n\ttotalCount?: number;\n\tloading?: boolean;\n\terror?: string;\n\tonRetry?: () => void;\n\tclassName?: string;\n}\n\nexport function ContextCards({\n\tchunks,\n\ttitle = \"All chunks\",\n\ttotalCount,\n\tloading = false,\n\terror,\n\tonRetry,\n\tclassName,\n}: ContextCardsProps) {\n\tconst vm = useContextCardsViewModel(chunks, totalCount);\n\tconst id = useId();\n\treturn (\n\t\t<section\n\t\t\taria-labelledby={id}\n\t\t\taria-busy={loading || undefined}\n\t\t\tclassName={cn(\n\t\t\t\t\"basalt-ui min-w-0 space-y-basalt-content-gap leading-[var(--basalt-line-body)]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<header className=\"flex items-center gap-basalt-content-gap\">\n\t\t\t\t<h3 id={id} className=\"text-basalt-code font-medium\">\n\t\t\t\t\t{title}\n\t\t\t\t</h3>\n\t\t\t\t<Badge variant=\"secondary\" className=\"tabular-nums leading-[var(--basalt-line-compact)]\">\n\t\t\t\t\t{vm.count}\n\t\t\t\t</Badge>\n\t\t\t</header>\n\t\t\t{loading ? (\n\t\t\t\t<LayerCard padding=\"sm\">\n\t\t\t\t\t<div role=\"status\" aria-label=\"Loading context\" className=\"space-y-basalt-space-lg\">\n\t\t\t\t\t\t<SkeletonLine />\n\t\t\t\t\t\t<SkeletonLine />\n\t\t\t\t\t\t<SkeletonLine />\n\t\t\t\t\t</div>\n\t\t\t\t</LayerCard>\n\t\t\t) : error ? (\n\t\t\t\t<LayerCard padding=\"sm\">\n\t\t\t\t\t<p role=\"alert\" className=\"text-basalt-base text-basalt-danger\">\n\t\t\t\t\t\t{error}\n\t\t\t\t\t</p>\n\t\t\t\t\t{onRetry && (\n\t\t\t\t\t\t<Button size=\"sm\" variant=\"outline\" className=\"mt-basalt-space-lg\" onClick={onRetry}>\n\t\t\t\t\t\t\tTry again\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t</LayerCard>\n\t\t\t) : vm.chunks.length === 0 ? (\n\t\t\t\t<p\n\t\t\t\t\trole=\"status\"\n\t\t\t\t\tclassName=\"py-basalt-space-lg text-basalt-base text-basalt-muted-foreground\"\n\t\t\t\t>\n\t\t\t\t\tNo context retrieved\n\t\t\t\t</p>\n\t\t\t) : (\n\t\t\t\t<ul className=\"space-y-basalt-content-gap\">\n\t\t\t\t\t{vm.chunks.map((chunk) => (\n\t\t\t\t\t\t<li\n\t\t\t\t\t\t\tkey={chunk.id}\n\t\t\t\t\t\t\tclassName=\"basalt-agent-reveal\"\n\t\t\t\t\t\t\tstyle={{ animationDelay: `${chunk.delay}ms`, animationFillMode: \"both\" }}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<LayerCard padding=\"none\" className=\"min-w-0 overflow-hidden\">\n\t\t\t\t\t\t\t\t<div className=\"flex flex-wrap items-center justify-between gap-basalt-control-gap border-b border-basalt-border px-basalt-panel-x py-basalt-panel-y\">\n\t\t\t\t\t\t\t\t\t<h4 className=\"inline-flex min-w-0 items-center gap-basalt-row-gap text-basalt-code leading-[var(--basalt-line-body)] font-medium\">\n\t\t\t\t\t\t\t\t\t\t<TextAlignStart\n\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"size-basalt-icon shrink-0\"\n\t\t\t\t\t\t\t\t\t\t\tstrokeWidth={1.5}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<span className=\"break-words\">{chunk.title}</span>\n\t\t\t\t\t\t\t\t\t</h4>\n\t\t\t\t\t\t\t\t\t<span className=\"shrink-0 text-basalt-sm tabular-nums text-basalt-muted-foreground\">\n\t\t\t\t\t\t\t\t\t\t{chunk.characters.toLocaleString(\"en-US\")} characters\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<p className=\"whitespace-pre-wrap break-words px-basalt-panel-x py-basalt-panel-y text-basalt-code leading-[var(--basalt-line-body)] text-basalt-muted-foreground\">\n\t\t\t\t\t\t\t\t\t{chunk.body}\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t<div className=\"flex min-w-0 px-basalt-panel-x pb-basalt-panel-y\">\n\t\t\t\t\t\t\t\t\t{chunk.href ? (\n\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\thref={chunk.href}\n\t\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"inline-flex max-w-full items-center gap-basalt-control-gap py-basalt-space-xs text-basalt-sm text-basalt-foreground outline-hidden hover:bg-basalt-hover focus-visible:ring-2 focus-visible:ring-basalt-ring\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<FileText\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"size-basalt-icon shrink-0\"\n\t\t\t\t\t\t\t\t\t\t\t\tstrokeWidth={1.5}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"shrink-0 font-mono text-basalt-xs text-basalt-muted-foreground\">\n\t\t\t\t\t\t\t\t\t\t\t\t{chunk.source.type}\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"truncate\" title={chunk.source.name}>\n\t\t\t\t\t\t\t\t\t\t\t\t{chunk.source.name}\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"size-basalt-icon shrink-0\"\n\t\t\t\t\t\t\t\t\t\t\t\tstrokeWidth={1.5}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<span className=\"inline-flex max-w-full items-center gap-basalt-control-gap py-basalt-space-xs text-basalt-sm\">\n\t\t\t\t\t\t\t\t\t\t\t<FileText\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"size-basalt-icon shrink-0\"\n\t\t\t\t\t\t\t\t\t\t\t\tstrokeWidth={1.5}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"shrink-0 font-mono text-basalt-xs text-basalt-muted-foreground\">\n\t\t\t\t\t\t\t\t\t\t\t\t{chunk.source.type}\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"truncate\" title={chunk.source.name}>\n\t\t\t\t\t\t\t\t\t\t\t\t{chunk.source.name}\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</LayerCard>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t))}\n\t\t\t\t</ul>\n\t\t\t)}\n\t\t</section>\n\t);\n}\n"],"mappings":";;;;;;;;;;;AAyBA,SAAgBA,EAAa,EAC5B,WACA,WAAQ,cACR,eACA,aAAU,IACV,UACA,YACA,gBACqB;CACrB,IAAMC,IAAKC,EAAyBC,GAAQC,CAAU,GAChDC,IAAKC,EAAM;CACjB,OACC,kBAAC,WAAD;EACC,mBAAiBD;EACjB,aAAWE,KAAW,KAAA;EACtB,WAAWC,EACV,kFACAC,CACD;EAND,UAAA,CAQC,kBAAC,UAAD;GAAQ,WAAU;GAAlB,UAAA,CACC,kBAAC,MAAD;IAAQ;IAAI,WAAU;IACpB,UAAAC;GACE,CAAA,GACJ,kBAACC,GAAD;IAAO,SAAQ;IAAY,WAAU;IACnC,UAAAV,EAAG;GACE,CAAA,CACA;EACP,CAAA,GAAAM,IACA,kBAACK,GAAD;GAAW,SAAQ;GAClB,UAAA,kBAAC,OAAD;IAAK,MAAK;IAAS,cAAW;IAAkB,WAAU;IAA1D,UAAA;KACC,kBAACC,GAAD,CAAe,CAAA;KACf,kBAACA,GAAD,CAAe,CAAA;KACf,kBAACA,GAAD,CAAe,CAAA;IACX;;EACK,CAAA,IACRC,IACH,kBAACF,GAAD;GAAW,SAAQ;GAAnB,UAAA,CACC,kBAAC,KAAD;IAAG,MAAK;IAAQ,WAAU;IACxB,UAAAE;GACC,CAAA,GACFC,KACA,kBAACC,GAAD;IAAQ,MAAK;IAAK,SAAQ;IAAU,WAAU;IAAqB,SAASD;IAAS,UAAA;GAE7E,CAAA,CAEC;EACR,CAAA,IAAAd,EAAG,OAAO,WAAW,IACxB,kBAAC,KAAD;GACC,MAAK;GACL,WAAU;GACV,UAAA;EAEE,CAAA,IAEH,kBAAC,MAAD;GAAI,WAAU;GACZ,UAAAA,EAAG,OAAO,KAAK,MACf,kBAAC,MAAD;IAEC,WAAU;IACV,OAAO;KAAE,gBAAgB,GAAGgB,EAAM,MAAM;KAAK,mBAAmB;IAAO;IAEvE,UAAA,kBAACL,GAAD;KAAW,SAAQ;KAAO,WAAU;KAApC,UAAA;MACC,kBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACC,kBAAC,MAAD;QAAI,WAAU;QAAd,UAAA,CACC,kBAACM,GAAD;SACC,eAAY;SACZ,WAAU;SACV,aAAa;QACb,CAAA,GACD,kBAAC,QAAD;SAAM,WAAU;SAAe,UAAAD,EAAM;QAAY,CAAA,CAC9C;OACJ,CAAA,GAAA,kBAAC,QAAD;QAAM,WAAU;QAAhB,UAAA,CACEA,EAAM,WAAW,eAAe,OAAO,GAAE,aACrC;OACF,CAAA,CAAA;;MACL,kBAAC,KAAD;OAAG,WAAU;OACX,UAAAA,EAAM;MACL,CAAA;MACH,kBAAC,OAAD;OAAK,WAAU;OACb,UAAAA,EAAM,OACN,kBAAC,KAAD;QACC,MAAMA,EAAM;QACZ,QAAO;QACP,KAAI;QACJ,WAAU;QAJX,UAAA;SAMC,kBAACE,GAAD;UACC,eAAY;UACZ,WAAU;UACV,aAAa;SACb,CAAA;SACD,kBAAC,QAAD;UAAM,WAAU;UACd,UAAAF,EAAM,OAAO;SACT,CAAA;SACN,kBAAC,QAAD;UAAM,WAAU;UAAW,OAAOA,EAAM,OAAO;UAC7C,UAAAA,EAAM,OAAO;SACT,CAAA;SACN,kBAACG,GAAD;UACC,eAAY;UACZ,WAAU;UACV,aAAa;SACb,CAAA;QACC;OAEH,CAAA,IAAA,kBAAC,QAAD;QAAM,WAAU;QAAhB,UAAA;SACC,kBAACD,GAAD;UACC,eAAY;UACZ,WAAU;UACV,aAAa;SACb,CAAA;SACD,kBAAC,QAAD;UAAM,WAAU;UACd,UAAAF,EAAM,OAAO;SACT,CAAA;SACN,kBAAC,QAAD;UAAM,WAAU;UAAW,OAAOA,EAAM,OAAO;UAC7C,UAAAA,EAAM,OAAO;SACT,CAAA;QACD;;MAEH,CAAA;KACK;;GACR,GA/DEA,EAAM,EA+DR,CACJ;EACE,CAAA,CAEG;;AAEX"}
|
|
@@ -145,5 +145,5 @@ export interface ContextMenuPanelProps extends Omit<ContextMenuContentProps, "fo
|
|
|
145
145
|
*/
|
|
146
146
|
forceMount?: true;
|
|
147
147
|
}
|
|
148
|
-
export declare function ContextMenuPanel({ className, ...props }: ContextMenuPanelProps): React.JSX.Element;
|
|
148
|
+
export declare function ContextMenuPanel({ className, ref, ...props }: ContextMenuPanelProps): React.JSX.Element;
|
|
149
149
|
export {};
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../utils/cn.js";
|
|
3
3
|
import { overlayItemClass as t, overlayPanelClass as n } from "./overlay.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import { useHoverHighlight as r } from "../utils/use-hover-highlight.js";
|
|
5
|
+
import * as i from "react";
|
|
6
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
7
|
+
import * as o from "@radix-ui/react-context-menu";
|
|
7
8
|
//#region src/components/context-menu.tsx
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
var s = o.Root, c = o.Trigger, l = o.Content, u = i.forwardRef(({ className: n, ...r }, i) => /* @__PURE__ */ a(o.Item, {
|
|
10
|
+
"data-basalt-hover-item": "",
|
|
11
|
+
ref: i,
|
|
12
|
+
className: t(e("relative outline-hidden focus:bg-basalt-hover [.basalt-hover-list_&]:focus:bg-transparent data-disabled:pointer-events-none data-disabled:opacity-50", n)),
|
|
11
13
|
...r
|
|
12
14
|
}));
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
u.displayName = o.Item.displayName;
|
|
16
|
+
function d({ className: t, ref: i, ...s }) {
|
|
17
|
+
let c = r(i);
|
|
18
|
+
return /* @__PURE__ */ a(o.Portal, {
|
|
19
|
+
forceMount: s.forceMount,
|
|
20
|
+
children: /* @__PURE__ */ a(o.Content, {
|
|
21
|
+
ref: c,
|
|
22
|
+
className: n(e("basalt-hover-list min-w-basalt-40", t)),
|
|
23
|
+
...s
|
|
20
24
|
})
|
|
21
25
|
});
|
|
22
26
|
}
|
|
23
27
|
//#endregion
|
|
24
|
-
export {
|
|
28
|
+
export { s as ContextMenu, l as ContextMenuContent, u as ContextMenuItem, d as ContextMenuPanel, c as ContextMenuTrigger };
|
|
25
29
|
|
|
26
30
|
//# sourceMappingURL=context-menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.js","names":[],"sources":["../../src/components/context-menu.tsx"],"sourcesContent":["import * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { overlayItemClass, overlayPanelClass } from \"./overlay\";\n\ntype RadixContextMenuProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Root>;\ntype RadixContextMenuTriggerProps = React.ComponentPropsWithoutRef<\n\ttypeof ContextMenuPrimitive.Trigger\n>;\ntype RadixContextMenuContentProps = React.ComponentPropsWithoutRef<\n\ttypeof ContextMenuPrimitive.Content\n>;\ntype RadixContextMenuItemProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item>;\n\nexport interface ContextMenuProps\n\textends Omit<RadixContextMenuProps, \"open\" | \"onOpenChange\" | \"dir\" | \"modal\"> {\n\t/**\n\t * Controlled open state of the context menu.\n\t * When set to true before pointer trigger interaction, positions at the top-left of the viewport.\n\t */\n\topen?: RadixContextMenuProps[\"open\"];\n\t/**\n\t * Callback invoked when open state changes.\n\t */\n\tonOpenChange?: RadixContextMenuProps[\"onOpenChange\"];\n\t/**\n\t * The reading direction of the context menu.\n\t * @default \"ltr\"\n\t */\n\tdir?: RadixContextMenuProps[\"dir\"];\n\t/**\n\t * Whether the context menu is modal, preventing outside interactions.\n\t * @default true\n\t */\n\tmodal?: RadixContextMenuProps[\"modal\"];\n}\n\nexport const ContextMenu = ContextMenuPrimitive.Root;\n\nexport interface ContextMenuTriggerProps\n\textends Omit<RadixContextMenuTriggerProps, \"disabled\" | \"asChild\"> {\n\t/**\n\t * Disable the context menu trigger from opening on right-click.\n\t * @default false\n\t */\n\tdisabled?: RadixContextMenuTriggerProps[\"disabled\"];\n\t/**\n\t * Change the default rendered span element to the child element, merging props and behavior.\n\t * Trigger forwards ref to HTMLSpanElement and inherits native span attributes.\n\t * @default false\n\t */\n\tasChild?: RadixContextMenuTriggerProps[\"asChild\"];\n}\n\nexport const ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\nexport interface ContextMenuContentProps\n\textends Omit<\n\t\tRadixContextMenuContentProps,\n\t\t| \"loop\"\n\t\t| \"alignOffset\"\n\t\t| \"avoidCollisions\"\n\t\t| \"collisionBoundary\"\n\t\t| \"collisionPadding\"\n\t\t| \"arrowPadding\"\n\t\t| \"sticky\"\n\t\t| \"hideWhenDetached\"\n\t\t| \"forceMount\"\n\t\t| \"asChild\"\n\t\t| \"onCloseAutoFocus\"\n\t\t| \"onEscapeKeyDown\"\n\t\t| \"onPointerDownOutside\"\n\t\t| \"onFocusOutside\"\n\t\t| \"onInteractOutside\"\n\t> {\n\t/**\n\t * Whether keyboard navigation should loop around item boundaries.\n\t * @default false\n\t */\n\tloop?: RadixContextMenuContentProps[\"loop\"];\n\t/**\n\t * Offset in pixels from the start or end alignment position.\n\t * @default 0\n\t */\n\talignOffset?: RadixContextMenuContentProps[\"alignOffset\"];\n\t/**\n\t * Whether to reposition content to avoid viewport boundary collisions.\n\t * @default true\n\t */\n\tavoidCollisions?: RadixContextMenuContentProps[\"avoidCollisions\"];\n\t/**\n\t * Element or elements bounding boundary collision calculations.\n\t * @default []\n\t */\n\tcollisionBoundary?: RadixContextMenuContentProps[\"collisionBoundary\"];\n\t/**\n\t * Virtual padding from collision boundaries in pixels.\n\t * @default 0\n\t */\n\tcollisionPadding?: RadixContextMenuContentProps[\"collisionPadding\"];\n\t/**\n\t * Padding in pixels between popper arrow and floating panel edge.\n\t * @default 0\n\t */\n\tarrowPadding?: RadixContextMenuContentProps[\"arrowPadding\"];\n\t/**\n\t * Sticky positioning behavior along the align axis when overflowing.\n\t * @default \"partial\"\n\t */\n\tsticky?: RadixContextMenuContentProps[\"sticky\"];\n\t/**\n\t * Whether to hide content completely when trigger is fully occluded.\n\t * @default false\n\t */\n\thideWhenDetached?: RadixContextMenuContentProps[\"hideWhenDetached\"];\n\t/**\n\t * Force mounting content in DOM for external animation controls.\n\t * Note: Bare ContextMenuContent mounts directly without a built-in Portal wrapper.\n\t */\n\tforceMount?: true;\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * Content forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixContextMenuContentProps[\"asChild\"];\n\t/**\n\t * Callback fired when auto-focusing on close. Can be prevented.\n\t */\n\tonCloseAutoFocus?: RadixContextMenuContentProps[\"onCloseAutoFocus\"];\n\t/**\n\t * Callback fired when the Escape key is down on the dismissable layer. Can be prevented.\n\t */\n\tonEscapeKeyDown?: RadixContextMenuContentProps[\"onEscapeKeyDown\"];\n\t/**\n\t * Callback fired when a pointerdown event happens outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonPointerDownOutside?: RadixContextMenuContentProps[\"onPointerDownOutside\"];\n\t/**\n\t * Callback fired when focus moves outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonFocusOutside?: RadixContextMenuContentProps[\"onFocusOutside\"];\n\t/**\n\t * Callback fired when an interaction (pointerdown or focus) happens outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonInteractOutside?: RadixContextMenuContentProps[\"onInteractOutside\"];\n}\n\nexport const ContextMenuContent = ContextMenuPrimitive.Content;\n\nexport interface ContextMenuItemProps\n\textends Omit<RadixContextMenuItemProps, \"disabled\" | \"onSelect\" | \"textValue\" | \"asChild\"> {\n\t/**\n\t * Disable the context menu item.\n\t * @default false\n\t */\n\tdisabled?: RadixContextMenuItemProps[\"disabled\"];\n\t/**\n\t * Event handler called when the context menu item is selected (via click or keyboard).\n\t */\n\tonSelect?: RadixContextMenuItemProps[\"onSelect\"];\n\t/**\n\t * Optional text used for typeahead navigation. By default typeahead uses item text content.\n\t */\n\ttextValue?: RadixContextMenuItemProps[\"textValue\"];\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * Item forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixContextMenuItemProps[\"asChild\"];\n}\n\nexport const ContextMenuItem = React.forwardRef<\n\tReact.ElementRef<typeof ContextMenuPrimitive.Item>,\n\tContextMenuItemProps\n>(({ className, ...props }, ref) => (\n\t<ContextMenuPrimitive.Item\n\t\tref={ref}\n\t\tclassName={overlayItemClass(\n\t\t\tcn(\n\t\t\t\t\"relative outline-hidden focus:bg-basalt-
|
|
1
|
+
{"version":3,"file":"context-menu.js","names":["React","ContextMenuPrimitive","ContextMenu","ContextMenuTrigger","ContextMenuContent","ContextMenuItem","props","overlayItemClass","cn","className","ContextMenuPanel","highlightRef","useHoverHighlight","ref","overlayPanelClass"],"sources":["../../src/components/context-menu.tsx"],"sourcesContent":["import * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { useHoverHighlight } from \"../utils/use-hover-highlight\";\nimport { overlayItemClass, overlayPanelClass } from \"./overlay\";\n\ntype RadixContextMenuProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Root>;\ntype RadixContextMenuTriggerProps = React.ComponentPropsWithoutRef<\n\ttypeof ContextMenuPrimitive.Trigger\n>;\ntype RadixContextMenuContentProps = React.ComponentPropsWithoutRef<\n\ttypeof ContextMenuPrimitive.Content\n>;\ntype RadixContextMenuItemProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item>;\n\nexport interface ContextMenuProps\n\textends Omit<RadixContextMenuProps, \"open\" | \"onOpenChange\" | \"dir\" | \"modal\"> {\n\t/**\n\t * Controlled open state of the context menu.\n\t * When set to true before pointer trigger interaction, positions at the top-left of the viewport.\n\t */\n\topen?: RadixContextMenuProps[\"open\"];\n\t/**\n\t * Callback invoked when open state changes.\n\t */\n\tonOpenChange?: RadixContextMenuProps[\"onOpenChange\"];\n\t/**\n\t * The reading direction of the context menu.\n\t * @default \"ltr\"\n\t */\n\tdir?: RadixContextMenuProps[\"dir\"];\n\t/**\n\t * Whether the context menu is modal, preventing outside interactions.\n\t * @default true\n\t */\n\tmodal?: RadixContextMenuProps[\"modal\"];\n}\n\nexport const ContextMenu = ContextMenuPrimitive.Root;\n\nexport interface ContextMenuTriggerProps\n\textends Omit<RadixContextMenuTriggerProps, \"disabled\" | \"asChild\"> {\n\t/**\n\t * Disable the context menu trigger from opening on right-click.\n\t * @default false\n\t */\n\tdisabled?: RadixContextMenuTriggerProps[\"disabled\"];\n\t/**\n\t * Change the default rendered span element to the child element, merging props and behavior.\n\t * Trigger forwards ref to HTMLSpanElement and inherits native span attributes.\n\t * @default false\n\t */\n\tasChild?: RadixContextMenuTriggerProps[\"asChild\"];\n}\n\nexport const ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\nexport interface ContextMenuContentProps\n\textends Omit<\n\t\tRadixContextMenuContentProps,\n\t\t| \"loop\"\n\t\t| \"alignOffset\"\n\t\t| \"avoidCollisions\"\n\t\t| \"collisionBoundary\"\n\t\t| \"collisionPadding\"\n\t\t| \"arrowPadding\"\n\t\t| \"sticky\"\n\t\t| \"hideWhenDetached\"\n\t\t| \"forceMount\"\n\t\t| \"asChild\"\n\t\t| \"onCloseAutoFocus\"\n\t\t| \"onEscapeKeyDown\"\n\t\t| \"onPointerDownOutside\"\n\t\t| \"onFocusOutside\"\n\t\t| \"onInteractOutside\"\n\t> {\n\t/**\n\t * Whether keyboard navigation should loop around item boundaries.\n\t * @default false\n\t */\n\tloop?: RadixContextMenuContentProps[\"loop\"];\n\t/**\n\t * Offset in pixels from the start or end alignment position.\n\t * @default 0\n\t */\n\talignOffset?: RadixContextMenuContentProps[\"alignOffset\"];\n\t/**\n\t * Whether to reposition content to avoid viewport boundary collisions.\n\t * @default true\n\t */\n\tavoidCollisions?: RadixContextMenuContentProps[\"avoidCollisions\"];\n\t/**\n\t * Element or elements bounding boundary collision calculations.\n\t * @default []\n\t */\n\tcollisionBoundary?: RadixContextMenuContentProps[\"collisionBoundary\"];\n\t/**\n\t * Virtual padding from collision boundaries in pixels.\n\t * @default 0\n\t */\n\tcollisionPadding?: RadixContextMenuContentProps[\"collisionPadding\"];\n\t/**\n\t * Padding in pixels between popper arrow and floating panel edge.\n\t * @default 0\n\t */\n\tarrowPadding?: RadixContextMenuContentProps[\"arrowPadding\"];\n\t/**\n\t * Sticky positioning behavior along the align axis when overflowing.\n\t * @default \"partial\"\n\t */\n\tsticky?: RadixContextMenuContentProps[\"sticky\"];\n\t/**\n\t * Whether to hide content completely when trigger is fully occluded.\n\t * @default false\n\t */\n\thideWhenDetached?: RadixContextMenuContentProps[\"hideWhenDetached\"];\n\t/**\n\t * Force mounting content in DOM for external animation controls.\n\t * Note: Bare ContextMenuContent mounts directly without a built-in Portal wrapper.\n\t */\n\tforceMount?: true;\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * Content forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixContextMenuContentProps[\"asChild\"];\n\t/**\n\t * Callback fired when auto-focusing on close. Can be prevented.\n\t */\n\tonCloseAutoFocus?: RadixContextMenuContentProps[\"onCloseAutoFocus\"];\n\t/**\n\t * Callback fired when the Escape key is down on the dismissable layer. Can be prevented.\n\t */\n\tonEscapeKeyDown?: RadixContextMenuContentProps[\"onEscapeKeyDown\"];\n\t/**\n\t * Callback fired when a pointerdown event happens outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonPointerDownOutside?: RadixContextMenuContentProps[\"onPointerDownOutside\"];\n\t/**\n\t * Callback fired when focus moves outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonFocusOutside?: RadixContextMenuContentProps[\"onFocusOutside\"];\n\t/**\n\t * Callback fired when an interaction (pointerdown or focus) happens outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonInteractOutside?: RadixContextMenuContentProps[\"onInteractOutside\"];\n}\n\nexport const ContextMenuContent = ContextMenuPrimitive.Content;\n\nexport interface ContextMenuItemProps\n\textends Omit<RadixContextMenuItemProps, \"disabled\" | \"onSelect\" | \"textValue\" | \"asChild\"> {\n\t/**\n\t * Disable the context menu item.\n\t * @default false\n\t */\n\tdisabled?: RadixContextMenuItemProps[\"disabled\"];\n\t/**\n\t * Event handler called when the context menu item is selected (via click or keyboard).\n\t */\n\tonSelect?: RadixContextMenuItemProps[\"onSelect\"];\n\t/**\n\t * Optional text used for typeahead navigation. By default typeahead uses item text content.\n\t */\n\ttextValue?: RadixContextMenuItemProps[\"textValue\"];\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * Item forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixContextMenuItemProps[\"asChild\"];\n}\n\nexport const ContextMenuItem = React.forwardRef<\n\tReact.ElementRef<typeof ContextMenuPrimitive.Item>,\n\tContextMenuItemProps\n>(({ className, ...props }, ref) => (\n\t<ContextMenuPrimitive.Item\n\t\tdata-basalt-hover-item=\"\"\n\t\tref={ref}\n\t\tclassName={overlayItemClass(\n\t\t\tcn(\n\t\t\t\t\"relative outline-hidden focus:bg-basalt-hover [.basalt-hover-list_&]:focus:bg-transparent data-disabled:pointer-events-none data-disabled:opacity-50\",\n\t\t\t\tclassName,\n\t\t\t),\n\t\t)}\n\t\t{...props}\n\t/>\n));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\nexport interface ContextMenuPanelProps\n\textends Omit<ContextMenuContentProps, \"forceMount\">,\n\t\tPick<React.ComponentProps<typeof ContextMenuPrimitive.Content>, \"ref\"> {\n\t/**\n\t * Force mounting content in DOM for external animation controls.\n\t * When forceMount is true, the content remains mounted even when closed.\n\t * The caller is responsible for visibility transitions and unmounting after animation completes.\n\t * Note: Keeping modal content forceMounted may isolate background interactions until unmounted.\n\t */\n\tforceMount?: true;\n}\n\nexport function ContextMenuPanel({ className, ref, ...props }: ContextMenuPanelProps) {\n\tconst highlightRef = useHoverHighlight(ref);\n\treturn (\n\t\t<ContextMenuPrimitive.Portal forceMount={props.forceMount}>\n\t\t\t<ContextMenuPrimitive.Content\n\t\t\t\tref={highlightRef}\n\t\t\t\tclassName={overlayPanelClass(cn(\"basalt-hover-list min-w-basalt-40\", className))}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</ContextMenuPrimitive.Portal>\n\t);\n}\n"],"mappings":";;;;;;;;AAsCA,IAAaE,IAAcD,EAAqB,MAiBnCE,IAAqBF,EAAqB,SA8F1CG,IAAqBH,EAAqB,SAyB1CI,IAAkBL,EAAM,YAGlC,EAAE,cAAW,GAAGM,KAAS,MAC3B,kBAACL,EAAqB,MAAtB;CACC,0BAAuB;CAClB;CACL,WAAWM,EACVC,EACC,wJACAC,CACD,CACD;CACA,GAAIH;AACJ,CAAA,CACD;AACD,EAAgB,cAAcL,EAAqB,KAAK;AAcxD,SAAgBS,EAAiB,EAAE,cAAW,QAAK,GAAGJ,KAAgC;CACrF,IAAMK,IAAeC,EAAkBC,CAAG;CAC1C,OACC,kBAACZ,EAAqB,QAAtB;EAA6B,YAAYK,EAAM;EAC9C,UAAA,kBAACL,EAAqB,SAAtB;GACC,KAAKU;GACL,WAAWG,EAAkBN,EAAG,qCAAqCC,CAAS,CAAC;GAC/E,GAAIH;EACJ,CAAA;CAC2B,CAAA;AAE/B"}
|
|
@@ -9,8 +9,10 @@ export type DataTableColumn<T> = {
|
|
|
9
9
|
headerContent?: ReactNode;
|
|
10
10
|
/** Whether the header changes sorting. @default true */
|
|
11
11
|
sortable?: boolean;
|
|
12
|
-
/**
|
|
12
|
+
/** Preferred and minimum column width; narrow viewports scroll instead of squeezing it. */
|
|
13
13
|
width?: CSSProperties["width"];
|
|
14
|
+
/** Allow multiline cell content. Default false keeps dense records on one line. */
|
|
15
|
+
wrap?: boolean;
|
|
14
16
|
/** Classes applied to the header cell. */
|
|
15
17
|
headerClassName?: string;
|
|
16
18
|
/** Classes applied to each data cell. */
|
|
@@ -86,6 +88,10 @@ export type DataTableProps<T = unknown> = {
|
|
|
86
88
|
* Additional classes for the table.
|
|
87
89
|
*/
|
|
88
90
|
className?: string;
|
|
91
|
+
/** Bound the local scroll region; column headers stay visible while scrolling. */
|
|
92
|
+
maxHeight?: CSSProperties["maxHeight"];
|
|
93
|
+
/** Show display-order row numbers, continuous across pages. @default false */
|
|
94
|
+
rowNumbers?: boolean;
|
|
89
95
|
/** Controlled sorting. null explicitly disables sorting. */
|
|
90
96
|
sort?: DataTableSort | null;
|
|
91
97
|
/** Initial sorting for uncontrolled usage. @default null */
|
|
@@ -111,4 +117,4 @@ export type DataTableProps<T = unknown> = {
|
|
|
111
117
|
/** ID of additional table instructions or summary. */
|
|
112
118
|
"aria-describedby"?: string;
|
|
113
119
|
};
|
|
114
|
-
export declare function DataTable<T>({ data, columns, filter, loading, empty, selected, defaultSelected, onSelectedChange, multiple, page, defaultPage, pageSize, onPageChange, getRowId, className, sort: controlledSort, defaultSort, onSortChange, manualSorting, manualPagination, manualFiltering, total, error, onRetry, retryLabel, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, }: DataTableProps<T>): import("react").JSX.Element;
|
|
120
|
+
export declare function DataTable<T>({ data, columns, filter, loading, empty, selected, defaultSelected, onSelectedChange, multiple, page, defaultPage, pageSize, onPageChange, getRowId, className, maxHeight, rowNumbers, sort: controlledSort, defaultSort, onSortChange, manualSorting, manualPagination, manualFiltering, total, error, onRetry, retryLabel, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, }: DataTableProps<T>): import("react").JSX.Element;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../utils/cn.js";
|
|
3
3
|
import { Button as t } from "./button.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { Checkbox as n } from "./checkbox.js";
|
|
5
|
+
import { SkeletonLine as r } from "./skeleton-line.js";
|
|
6
|
+
import { Pagination as i } from "./pagination.js";
|
|
7
|
+
import { Table as a, TableBody as o, TableCell as s, TableHead as c, TableHeader as l, TableRow as u } from "./table.js";
|
|
8
|
+
import { useCallback as d, useEffect as ee, useLayoutEffect as te, useMemo as ne, useRef as f, useState as p } from "react";
|
|
9
|
+
import { ArrowDown as re, ArrowUp as ie, ArrowUpDown as ae } from "lucide-react";
|
|
8
10
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
9
11
|
//#region src/components/data-table.tsx
|
|
10
12
|
function g(e) {
|
|
11
13
|
return e === -Infinity ? 0 : typeof e == "bigint" || typeof e == "number" && Number.isFinite(e) ? 1 : e === Infinity ? 2 : typeof e == "number" ? 3 : typeof e == "string" ? 4 : 5;
|
|
12
14
|
}
|
|
13
|
-
function
|
|
15
|
+
function oe(e, t) {
|
|
14
16
|
let n = g(e), r = g(t);
|
|
15
17
|
if (n !== r) return n - r;
|
|
16
18
|
if (n === 1) {
|
|
@@ -20,7 +22,7 @@ function ne(e, t) {
|
|
|
20
22
|
let i = String(e), a = String(t);
|
|
21
23
|
return i < a ? -1 : +(i > a);
|
|
22
24
|
}
|
|
23
|
-
function
|
|
25
|
+
function se(e, t, n, r) {
|
|
24
26
|
if (e === null) return "prim:null";
|
|
25
27
|
if (e === void 0) return "prim:undefined";
|
|
26
28
|
if (typeof e == "symbol") {
|
|
@@ -36,7 +38,7 @@ function _(e) {
|
|
|
36
38
|
function v(e) {
|
|
37
39
|
return typeof e == "function" || typeof e == "object" && !!e;
|
|
38
40
|
}
|
|
39
|
-
function
|
|
41
|
+
function ce(e, t) {
|
|
40
42
|
if (e.filterValue) return String(e.filterValue(t));
|
|
41
43
|
if (e.sortValue) return String(e.sortValue(t));
|
|
42
44
|
let n = e.accessor(t);
|
|
@@ -46,15 +48,15 @@ function y(e, t, n, r) {
|
|
|
46
48
|
let i = r?.(e, t);
|
|
47
49
|
return i === void 0 ? v(e) && "id" in e && e.id != null ? String(e.id) : n : i;
|
|
48
50
|
}
|
|
49
|
-
function b({ data: g, columns: b, filter:
|
|
50
|
-
let [
|
|
51
|
-
|
|
52
|
-
}, [
|
|
51
|
+
function b({ data: g, columns: b, filter: le = "", loading: x = !1, empty: ue = "No results", selected: S, defaultSelected: C, onSelectedChange: w, multiple: de = !1, page: T, defaultPage: fe = 1, pageSize: E, onPageChange: D, getRowId: O, className: pe, maxHeight: me, rowNumbers: k = !1, sort: A, defaultSort: he = null, onSortChange: ge, manualSorting: j = !1, manualPagination: M = !1, manualFiltering: N = !1, total: P, error: F, onRetry: I, retryLabel: _e = "Try again", "aria-label": L = "Data table", "aria-describedby": ve }) {
|
|
52
|
+
let [ye, be] = p(he), R = A === void 0 ? ye : A, xe = (e) => {
|
|
53
|
+
A === void 0 && be(e), ge?.(e);
|
|
54
|
+
}, [Se, Ce] = p(C ?? []), [z, we] = p(fe), B = f(/* @__PURE__ */ new WeakMap()), V = f(0), H = f(/* @__PURE__ */ new WeakMap()), U = f(/* @__PURE__ */ new Map()), W = f(/* @__PURE__ */ new Map()), G = f(/* @__PURE__ */ new Map()), Te = f(/* @__PURE__ */ new Map()), K = le.trim().toLowerCase(), q = ne(() => {
|
|
53
55
|
let e = (e) => {
|
|
54
|
-
let t =
|
|
55
|
-
return t || (t = `basalt-row-${
|
|
56
|
+
let t = B.current.get(e);
|
|
57
|
+
return t || (t = `basalt-row-${V.current++}`, B.current.set(e, t)), t;
|
|
56
58
|
}, t = (e, t) => {
|
|
57
|
-
let n =
|
|
59
|
+
let n = O?.(e, t);
|
|
58
60
|
if (n !== void 0) return `get:${n}`;
|
|
59
61
|
if (v(e) && "id" in e) {
|
|
60
62
|
let t = e.id;
|
|
@@ -81,27 +83,27 @@ function b({ data: g, columns: b, filter: ae = "", loading: x = !1, empty: oe =
|
|
|
81
83
|
for (let e of l) {
|
|
82
84
|
let t = v(e.row) ? e.row : null;
|
|
83
85
|
if (!t) continue;
|
|
84
|
-
let r =
|
|
85
|
-
r && !n.has(r) &&
|
|
86
|
+
let r = H.current.get(t)?.[e.occurrence];
|
|
87
|
+
r && !n.has(r) && U.current.get(r) === t && (e.key = r, n.add(r));
|
|
86
88
|
}
|
|
87
89
|
let u = l.map(({ row: r, index: i, occurrence: a, key: o }) => {
|
|
88
90
|
let c = v(r) ? r : null;
|
|
89
91
|
if (o) return s(r, i, o, c), {
|
|
90
92
|
row: r,
|
|
91
93
|
key: o,
|
|
92
|
-
selectId: y(r, i, o,
|
|
94
|
+
selectId: y(r, i, o, O)
|
|
93
95
|
};
|
|
94
96
|
let l = a > 0, u, d = t(r, i);
|
|
95
97
|
if (d && (u = d), c) {
|
|
96
98
|
let t = e(c);
|
|
97
99
|
if (!u) u = l ? `gen:${t}#${a}` : `gen:${t}`;
|
|
98
|
-
else if (n.has(u) || l) u = (
|
|
100
|
+
else if (n.has(u) || l) u = (G.current.get(u) ?? []).find((e) => !n.has(e)) ?? (l ? `dup:${t}#${a}` : `dup:${t}`);
|
|
99
101
|
else {
|
|
100
|
-
let e =
|
|
102
|
+
let e = W.current.get(u);
|
|
101
103
|
e && !n.has(e) && _(e) && (u = e);
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
|
-
if (u ??=
|
|
106
|
+
if (u ??= se(r, i, Te.current, V), n.has(u)) {
|
|
105
107
|
let e = 0, t = `occ:${u}#${e}`;
|
|
106
108
|
for (; n.has(t);) e += 1, t = `occ:${u}#${e}`;
|
|
107
109
|
u = t;
|
|
@@ -109,16 +111,16 @@ function b({ data: g, columns: b, filter: ae = "", loading: x = !1, empty: oe =
|
|
|
109
111
|
return n.add(u), s(r, i, u, c), {
|
|
110
112
|
row: r,
|
|
111
113
|
key: u,
|
|
112
|
-
selectId: y(r, i, u,
|
|
114
|
+
selectId: y(r, i, u, O)
|
|
113
115
|
};
|
|
114
|
-
}), d =
|
|
116
|
+
}), d = K && !N ? u.filter(({ row: e }) => b.some((t) => ce(t, e).toLowerCase().includes(K))) : u;
|
|
115
117
|
return {
|
|
116
118
|
rows: (() => {
|
|
117
|
-
if (!
|
|
118
|
-
let e = b.find((e) => e.id ===
|
|
119
|
+
if (!R || j) return d;
|
|
120
|
+
let e = b.find((e) => e.id === R.id);
|
|
119
121
|
return e ? [...d].sort((t, n) => {
|
|
120
|
-
let r =
|
|
121
|
-
return
|
|
122
|
+
let r = oe(e.sortValue?.(t.row) ?? e.accessor(t.row), e.sortValue?.(n.row) ?? e.accessor(n.row));
|
|
123
|
+
return R.dir === "asc" ? r : -r;
|
|
122
124
|
}) : d;
|
|
123
125
|
})(),
|
|
124
126
|
assigned: a,
|
|
@@ -129,23 +131,23 @@ function b({ data: g, columns: b, filter: ae = "", loading: x = !1, empty: oe =
|
|
|
129
131
|
}, [
|
|
130
132
|
b,
|
|
131
133
|
g,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
O,
|
|
135
|
+
K,
|
|
136
|
+
R,
|
|
137
|
+
N,
|
|
138
|
+
j
|
|
137
139
|
]);
|
|
140
|
+
te(() => {
|
|
141
|
+
for (let [e, t] of q.assigned) H.current.set(e, t);
|
|
142
|
+
U.current = q.owner, W.current = q.lastKey, G.current = q.dups;
|
|
143
|
+
}, [q]);
|
|
144
|
+
let J = S !== void 0 || C !== void 0 || w !== void 0, Y = S ?? Se, Ee = d((e) => {
|
|
145
|
+
S === void 0 && Ce(e), w?.(e);
|
|
146
|
+
}, [w, S]), De = M && P !== void 0 ? Math.max(0, P) : q.rows.length, Oe = E && E > 0 ? Math.max(1, Math.ceil(De / E)) : 1, X = Math.min(Oe, Math.max(1, T ?? z)), Z = d((e) => {
|
|
147
|
+
T === void 0 && we(e), D?.(e);
|
|
148
|
+
}, [D, T]), Q = f(null);
|
|
138
149
|
ee(() => {
|
|
139
|
-
|
|
140
|
-
V.current = G.owner, H.current = G.lastKey, U.current = G.dups;
|
|
141
|
-
}, [G]);
|
|
142
|
-
let K = S !== void 0 || C !== void 0 || w !== void 0, q = S ?? ve, J = u((e) => {
|
|
143
|
-
S === void 0 && ye(e), w?.(e);
|
|
144
|
-
}, [w, S]), Se = A && M !== void 0 ? Math.max(0, M) : G.rows.length, Y = E && E > 0 ? Math.max(1, Math.ceil(Se / E)) : 1, X = Math.min(Y, Math.max(1, T ?? L)), Z = u((e) => {
|
|
145
|
-
T === void 0 && be(e), le?.(e);
|
|
146
|
-
}, [le, T]), Q = f(null);
|
|
147
|
-
d(() => {
|
|
148
|
-
let e = T ?? L;
|
|
150
|
+
let e = T ?? z;
|
|
149
151
|
if (e === X || x) {
|
|
150
152
|
Q.current = null;
|
|
151
153
|
return;
|
|
@@ -154,107 +156,160 @@ function b({ data: g, columns: b, filter: ae = "", loading: x = !1, empty: oe =
|
|
|
154
156
|
Q.current !== t && (Q.current = t, Z(X));
|
|
155
157
|
}, [
|
|
156
158
|
T,
|
|
157
|
-
|
|
159
|
+
z,
|
|
158
160
|
X,
|
|
159
161
|
x,
|
|
160
162
|
Z
|
|
161
163
|
]);
|
|
162
|
-
let
|
|
163
|
-
if (
|
|
164
|
-
|
|
164
|
+
let ke = !M && E && E > 0 ? q.rows.slice((X - 1) * E, X * E) : q.rows, $ = b.length + +!!J + +!!k, Ae = (e) => {
|
|
165
|
+
if (de) {
|
|
166
|
+
Ee(Y.includes(e) ? Y.filter((t) => t !== e) : [...Y, e]);
|
|
165
167
|
return;
|
|
166
168
|
}
|
|
167
|
-
|
|
169
|
+
Ee(Y.includes(e) ? [] : [e]);
|
|
168
170
|
};
|
|
169
171
|
return /* @__PURE__ */ h("div", {
|
|
170
|
-
className: "flex min-w-0 flex-col gap-
|
|
172
|
+
className: "flex min-w-0 flex-col gap-basalt-space-lg",
|
|
171
173
|
children: [/* @__PURE__ */ m("div", {
|
|
172
174
|
role: "region",
|
|
173
|
-
"aria-label": `${
|
|
175
|
+
"aria-label": `${L} scroll area`,
|
|
174
176
|
tabIndex: 0,
|
|
175
|
-
className: "min-w-0 overflow-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
"
|
|
179
|
-
"aria-
|
|
177
|
+
className: "relative min-w-0 overflow-auto rounded-basalt-md focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-basalt-primary",
|
|
178
|
+
style: { maxHeight: me },
|
|
179
|
+
children: /* @__PURE__ */ h(a, {
|
|
180
|
+
className: e("w-full", pe),
|
|
181
|
+
"aria-label": L,
|
|
182
|
+
"aria-describedby": ve,
|
|
180
183
|
"aria-busy": x || void 0,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
})
|
|
202
|
-
|
|
184
|
+
"data-basalt-data-table": "",
|
|
185
|
+
children: [/* @__PURE__ */ m(l, { children: /* @__PURE__ */ h(u, { children: [
|
|
186
|
+
k && /* @__PURE__ */ h(c, {
|
|
187
|
+
scope: "col",
|
|
188
|
+
className: "sticky top-0 z-10 w-basalt-10 min-w-basalt-10 bg-basalt-control text-right",
|
|
189
|
+
children: [/* @__PURE__ */ m("span", {
|
|
190
|
+
"aria-hidden": "true",
|
|
191
|
+
children: "#"
|
|
192
|
+
}), /* @__PURE__ */ m("span", {
|
|
193
|
+
className: "sr-only",
|
|
194
|
+
children: "Row number"
|
|
195
|
+
})]
|
|
196
|
+
}),
|
|
197
|
+
J ? /* @__PURE__ */ m(c, {
|
|
198
|
+
scope: "col",
|
|
199
|
+
className: "sticky top-0 z-10 w-basalt-10 min-w-basalt-10 bg-basalt-control text-center",
|
|
200
|
+
children: /* @__PURE__ */ m("span", {
|
|
201
|
+
className: "sr-only",
|
|
202
|
+
children: "Select"
|
|
203
|
+
})
|
|
204
|
+
}) : null,
|
|
205
|
+
b.map((t) => /* @__PURE__ */ m(c, {
|
|
206
|
+
className: e("sticky top-0 z-10 bg-basalt-control", t.headerClassName),
|
|
207
|
+
style: {
|
|
208
|
+
width: t.width,
|
|
209
|
+
minWidth: t.width
|
|
210
|
+
},
|
|
211
|
+
scope: "col",
|
|
212
|
+
"aria-sort": t.sortable === !1 ? void 0 : R?.id === t.id ? R.dir === "asc" ? "ascending" : "descending" : "none",
|
|
213
|
+
children: t.sortable === !1 ? /* @__PURE__ */ m("span", {
|
|
214
|
+
className: "flex items-center gap-basalt-control-gap",
|
|
215
|
+
children: t.headerContent ?? t.header
|
|
216
|
+
}) : /* @__PURE__ */ h("button", {
|
|
217
|
+
type: "button",
|
|
218
|
+
"aria-label": t.header,
|
|
219
|
+
className: "group flex w-full cursor-pointer items-center gap-basalt-control-gap rounded-basalt-sm border-0 bg-transparent p-0 text-left font-inherit text-inherit font-medium focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-basalt-primary",
|
|
220
|
+
onClick: () => xe(R?.id === t.id && R.dir === "asc" ? {
|
|
221
|
+
id: t.id,
|
|
222
|
+
dir: "desc"
|
|
223
|
+
} : {
|
|
224
|
+
id: t.id,
|
|
225
|
+
dir: "asc"
|
|
226
|
+
}),
|
|
227
|
+
children: [/* @__PURE__ */ m("span", {
|
|
228
|
+
className: "flex min-w-0 items-center gap-basalt-control-gap truncate",
|
|
229
|
+
children: t.headerContent ?? t.header
|
|
230
|
+
}), R?.id === t.id ? R.dir === "asc" ? /* @__PURE__ */ m(ie, {
|
|
231
|
+
"aria-hidden": "true",
|
|
232
|
+
className: "ml-auto size-basalt-icon-sm shrink-0",
|
|
233
|
+
strokeWidth: 1.5
|
|
234
|
+
}) : /* @__PURE__ */ m(re, {
|
|
235
|
+
"aria-hidden": "true",
|
|
236
|
+
className: "ml-auto size-basalt-icon-sm shrink-0",
|
|
237
|
+
strokeWidth: 1.5
|
|
238
|
+
}) : /* @__PURE__ */ m(ae, {
|
|
239
|
+
"aria-hidden": "true",
|
|
240
|
+
className: "ml-auto size-basalt-icon-sm shrink-0 opacity-0 transition-opacity basalt-motion group-hover:opacity-60 group-focus-visible:opacity-60 motion-reduce:transition-none",
|
|
241
|
+
strokeWidth: 1.5
|
|
242
|
+
})]
|
|
243
|
+
})
|
|
244
|
+
}, t.id))
|
|
245
|
+
] }) }), /* @__PURE__ */ m(o, { children: x ? /* @__PURE__ */ m(u, { children: /* @__PURE__ */ m(s, {
|
|
203
246
|
colSpan: $,
|
|
204
247
|
children: /* @__PURE__ */ h("div", {
|
|
205
248
|
role: "status",
|
|
206
|
-
className: "flex flex-col gap-
|
|
249
|
+
className: "flex flex-col gap-basalt-space-lg py-basalt-space-lg",
|
|
207
250
|
children: [
|
|
208
251
|
/* @__PURE__ */ m("span", {
|
|
209
252
|
className: "sr-only",
|
|
210
253
|
children: "Loading"
|
|
211
254
|
}),
|
|
212
|
-
/* @__PURE__ */ m(
|
|
213
|
-
/* @__PURE__ */ m(
|
|
214
|
-
/* @__PURE__ */ m(
|
|
255
|
+
/* @__PURE__ */ m(r, {}),
|
|
256
|
+
/* @__PURE__ */ m(r, {}),
|
|
257
|
+
/* @__PURE__ */ m(r, {})
|
|
215
258
|
]
|
|
216
259
|
})
|
|
217
|
-
}) }) :
|
|
260
|
+
}) }) : F != null && F !== !1 ? /* @__PURE__ */ m(u, { children: /* @__PURE__ */ m(s, {
|
|
218
261
|
colSpan: $,
|
|
219
262
|
children: /* @__PURE__ */ h("div", {
|
|
220
263
|
role: "alert",
|
|
221
|
-
className: "flex flex-wrap items-center justify-between gap-
|
|
222
|
-
children: [/* @__PURE__ */ m("div", { children:
|
|
264
|
+
className: "flex flex-wrap items-center justify-between gap-basalt-space-lg py-basalt-space-lg",
|
|
265
|
+
children: [/* @__PURE__ */ m("div", { children: F }), I ? /* @__PURE__ */ m(t, {
|
|
223
266
|
variant: "outline",
|
|
224
267
|
size: "sm",
|
|
225
|
-
onClick:
|
|
226
|
-
children:
|
|
268
|
+
onClick: I,
|
|
269
|
+
children: _e
|
|
227
270
|
}) : null]
|
|
228
271
|
})
|
|
229
|
-
}) }) :
|
|
272
|
+
}) }) : ke.length === 0 ? /* @__PURE__ */ m(u, { children: /* @__PURE__ */ m(s, {
|
|
230
273
|
colSpan: $,
|
|
231
274
|
children: /* @__PURE__ */ m("div", {
|
|
232
275
|
role: "status",
|
|
233
|
-
children:
|
|
276
|
+
children: ue
|
|
234
277
|
})
|
|
235
|
-
}) }) :
|
|
236
|
-
let
|
|
237
|
-
return /* @__PURE__ */ h(
|
|
238
|
-
variant:
|
|
239
|
-
"aria-selected":
|
|
240
|
-
children: [
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
278
|
+
}) }) : ke.map(({ row: t, key: r, selectId: i }, a) => {
|
|
279
|
+
let o = Y.includes(i);
|
|
280
|
+
return /* @__PURE__ */ h(u, {
|
|
281
|
+
variant: o ? "selected" : "default",
|
|
282
|
+
"aria-selected": J ? o : void 0,
|
|
283
|
+
children: [
|
|
284
|
+
k && /* @__PURE__ */ m(s, {
|
|
285
|
+
"data-row-number": "",
|
|
286
|
+
className: "text-right text-basalt-sm tabular-nums text-basalt-muted-foreground",
|
|
287
|
+
children: (E && E > 0 ? (X - 1) * E : 0) + a + 1
|
|
288
|
+
}),
|
|
289
|
+
J ? /* @__PURE__ */ m(s, {
|
|
290
|
+
className: "text-center",
|
|
291
|
+
children: /* @__PURE__ */ m(n, {
|
|
292
|
+
checked: o,
|
|
293
|
+
"aria-label": `Select ${i}`,
|
|
294
|
+
onCheckedChange: () => Ae(i),
|
|
295
|
+
className: "align-middle"
|
|
296
|
+
})
|
|
297
|
+
}) : null,
|
|
298
|
+
b.map((n) => {
|
|
299
|
+
let r = n.accessor(t);
|
|
300
|
+
return /* @__PURE__ */ m(s, {
|
|
301
|
+
className: e(n.wrap ? "whitespace-normal break-words" : "whitespace-nowrap", n.cellClassName),
|
|
302
|
+
style: { minWidth: n.width },
|
|
303
|
+
children: typeof r == "bigint" ? String(r) : r
|
|
304
|
+
}, n.id);
|
|
305
|
+
})
|
|
306
|
+
]
|
|
307
|
+
}, r);
|
|
253
308
|
}) })]
|
|
254
309
|
})
|
|
255
|
-
}), E && E > 0 ? /* @__PURE__ */ m(
|
|
310
|
+
}), E && E > 0 ? /* @__PURE__ */ m(i, {
|
|
256
311
|
page: X,
|
|
257
|
-
pageCount:
|
|
312
|
+
pageCount: Oe,
|
|
258
313
|
disabled: x,
|
|
259
314
|
onPageChange: Z
|
|
260
315
|
}) : null]
|