@keyfunc/keybricks-ds 1.0.4 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DEPLOY.md +14 -5
- package/DESIGN.md +245 -59
- package/INTEGRATION.md +243 -49
- package/SKILL.md +13 -11
- package/_adherence.oxlintrc.json +183 -70
- package/_scripts/build-index.mjs +24 -4
- package/_scripts/build-tokens.mjs +5 -2
- package/assets/icons/icon-index.js +1 -1
- package/assets/icons/icon-index.json +1 -1
- package/components/_cards/accordion.card.html +2 -2
- package/components/_cards/action-chip.card.html +11 -9
- package/components/_cards/activity.card.html +3 -3
- package/components/_cards/alert.card.html +3 -3
- package/components/_cards/app-chrome.card.html +4 -4
- package/components/_cards/banner.card.html +1 -1
- package/components/_cards/breadcrumb.card.html +5 -5
- package/components/_cards/button-1-base.card.html +23 -26
- package/components/_cards/button-2-states.card.html +27 -25
- package/components/_cards/button-3-sizes-icons.card.html +20 -19
- package/components/_cards/button-4-group.card.html +14 -31
- package/components/_cards/canvas-zoom-controls.card.html +1 -1
- package/components/_cards/cards-indicators.card.html +2 -2
- package/components/_cards/charts-1-sparkline.card.html +5 -5
- package/components/_cards/charts-10-gauge.card.html +5 -5
- package/components/_cards/charts-11-funnel.card.html +3 -3
- package/components/_cards/charts-12-treemap.card.html +3 -3
- package/components/_cards/charts-14-radar.card.html +3 -3
- package/components/_cards/charts-15-distribution.card.html +2 -2
- package/components/_cards/charts-16-pareto.card.html +3 -3
- package/components/_cards/charts-17-candlestick.card.html +3 -3
- package/components/_cards/charts-18-sankey.card.html +3 -3
- package/components/_cards/charts-19-chord.card.html +3 -3
- package/components/_cards/charts-2-line.card.html +4 -4
- package/components/_cards/charts-20-sunburst.card.html +3 -3
- package/components/_cards/charts-21-worldmap.card.html +4 -4
- package/components/_cards/charts-22-gantt.card.html +3 -3
- package/components/_cards/charts-23-bar3d.card.html +3 -3
- package/components/_cards/charts-24-pie3d.card.html +3 -3
- package/components/_cards/charts-25-surface3d.card.html +3 -3
- package/components/_cards/charts-26-scatter3d.card.html +3 -3
- package/components/_cards/charts-27-ribbon3d.card.html +3 -3
- package/components/_cards/charts-3-bar.card.html +7 -7
- package/components/_cards/charts-4-barlist.card.html +3 -3
- package/components/_cards/charts-5-donut.card.html +4 -4
- package/components/_cards/charts-6-scatter.card.html +3 -3
- package/components/_cards/charts-7-heatmap.card.html +3 -3
- package/components/_cards/charts-8-waterfall.card.html +3 -3
- package/components/_cards/charts-9-bullet.card.html +3 -3
- package/components/_cards/charts-99-fullpage.card.html +5 -5
- package/components/_cards/checkbox.card.html +9 -6
- package/components/_cards/codeblock.card.html +2 -2
- package/components/_cards/combobox.card.html +6 -3
- package/components/_cards/context-menu.card.html +6 -3
- package/components/_cards/date-picker.card.html +10 -4
- package/components/_cards/diffvalue.card.html +3 -3
- package/components/_cards/divider.card.html +4 -4
- package/components/_cards/drawer.card.html +4 -4
- package/components/_cards/dropdown-menu.card.html +7 -7
- package/components/_cards/dropzone.card.html +5 -3
- package/components/_cards/empty-state.card.html +6 -6
- package/components/_cards/filter-bar.card.html +5 -5
- package/components/_cards/icon-button.card.html +14 -14
- package/components/_cards/icons-1-core.card.html +4 -4
- package/components/_cards/icons-2-feather.card.html +4 -4
- package/components/_cards/icons-3-unicons.card.html +4 -4
- package/components/_cards/input.card.html +5 -2
- package/components/_cards/kbd.card.html +2 -2
- package/components/_cards/keyvalue.card.html +2 -2
- package/components/_cards/listrow.card.html +2 -2
- package/components/_cards/loading.card.html +3 -3
- package/components/_cards/log-viewer.card.html +3 -3
- package/components/_cards/modal.card.html +9 -9
- package/components/_cards/multi-select.card.html +6 -3
- package/components/_cards/number-stepper.card.html +9 -5
- package/components/_cards/pagination.card.html +6 -3
- package/components/_cards/people.card.html +4 -4
- package/components/_cards/pipeline-node.card.html +8 -8
- package/components/_cards/pipeline-palette.card.html +5 -5
- package/components/_cards/radio.card.html +12 -7
- package/components/_cards/search.card.html +6 -3
- package/components/_cards/segmented-control.card.html +11 -10
- package/components/_cards/select.card.html +8 -4
- package/components/_cards/slider.card.html +2 -2
- package/components/_cards/smart-table.card.html +3 -3
- package/components/_cards/spreadsheet.card.html +3 -3
- package/components/_cards/stepper.card.html +3 -3
- package/components/_cards/table.card.html +165 -0
- package/components/_cards/tabs.card.html +6 -3
- package/components/_cards/tag.card.html +6 -3
- package/components/_cards/textarea.card.html +2 -2
- package/components/_cards/timeline.card.html +3 -3
- package/components/_cards/toast.card.html +10 -8
- package/components/_cards/toggles.card.html +15 -10
- package/components/_cards/tooltip.card.html +7 -7
- package/components/_cards/tree.card.html +3 -3
- package/components/_shared/card-kit.css +25 -0
- package/components/_shared/card-kit.js +50 -0
- package/components/_shared/src-buttons.js +1 -1
- package/components/_shared/src-charts.js +1 -1
- package/components/_shared/src-data.js +1 -1
- package/components/_shared/src-display.js +1 -1
- package/components/_shared/src-feedback.js +1 -1
- package/components/_shared/src-forms.js +1 -1
- package/components/_shared/src-icons.js +1 -1
- package/components/_shared/src-navigation.js +1 -1
- package/components/_shared/src-pipeline.js +1 -1
- package/components/_shared/src-tabs.js +1 -1
- package/components/_shared/view-source.js +3 -3
- package/components/_vue/index.mjs +16 -5
- package/components/buttons/ActionChip.d.ts +3 -1
- package/components/buttons/ActionChip.jsx +4 -4
- package/components/buttons/ActionChip.vue +4 -4
- package/components/buttons/Button.d.ts +5 -2
- package/components/buttons/Button.jsx +15 -18
- package/components/buttons/Button.vue +17 -18
- package/components/buttons/ButtonGroup.vue +1 -1
- package/components/buttons/IconButton.d.ts +2 -1
- package/components/buttons/IconButton.jsx +13 -9
- package/components/buttons/IconButton.vue +12 -9
- package/components/buttons/buttons.prompt.md +6 -5
- package/components/charts/Bar3D.jsx +2 -2
- package/components/charts/Bar3D.vue +3 -3
- package/components/charts/BarChart.jsx +4 -4
- package/components/charts/BarChart.vue +6 -6
- package/components/charts/BarList.jsx +4 -4
- package/components/charts/BarList.vue +4 -4
- package/components/charts/BoxPlot.jsx +1 -1
- package/components/charts/BoxPlot.vue +3 -3
- package/components/charts/BulletChart.jsx +6 -6
- package/components/charts/BulletChart.vue +6 -6
- package/components/charts/CandlestickChart.jsx +2 -2
- package/components/charts/CandlestickChart.vue +5 -5
- package/components/charts/ChartKit.jsx +8 -7
- package/components/charts/ChartLegend.vue +16 -0
- package/components/charts/ChartTooltip.vue +16 -0
- package/components/charts/ChordChart.jsx +2 -2
- package/components/charts/ChordChart.vue +3 -3
- package/components/charts/DonutChart.jsx +1 -1
- package/components/charts/DonutChart.vue +2 -2
- package/components/charts/FunnelChart.jsx +3 -3
- package/components/charts/FunnelChart.vue +4 -4
- package/components/charts/GanttChart.jsx +2 -2
- package/components/charts/GanttChart.vue +3 -3
- package/components/charts/GaugeChart.jsx +2 -2
- package/components/charts/GaugeChart.vue +2 -2
- package/components/charts/HeatmapChart.jsx +2 -2
- package/components/charts/HeatmapChart.vue +2 -2
- package/components/charts/Histogram.jsx +2 -2
- package/components/charts/Histogram.vue +4 -4
- package/components/charts/LineChart.jsx +1 -1
- package/components/charts/LineChart.vue +4 -4
- package/components/charts/ParetoChart.jsx +3 -3
- package/components/charts/ParetoChart.vue +5 -5
- package/components/charts/Pie3D.jsx +1 -1
- package/components/charts/Pie3D.vue +2 -2
- package/components/charts/PlotGrid.vue +18 -0
- package/components/charts/RadarChart.jsx +1 -1
- package/components/charts/RadarChart.vue +2 -2
- package/components/charts/Ribbon3D.jsx +2 -2
- package/components/charts/Ribbon3D.vue +3 -3
- package/components/charts/SankeyChart.jsx +2 -2
- package/components/charts/SankeyChart.vue +3 -3
- package/components/charts/Scatter3D.jsx +1 -1
- package/components/charts/Scatter3D.vue +2 -2
- package/components/charts/ScatterChart.jsx +3 -3
- package/components/charts/ScatterChart.vue +5 -5
- package/components/charts/Sparkline.jsx +1 -1
- package/components/charts/Sparkline.vue +1 -1
- package/components/charts/SunburstChart.jsx +1 -1
- package/components/charts/SunburstChart.vue +2 -2
- package/components/charts/Surface3D.jsx +2 -2
- package/components/charts/Surface3D.vue +3 -3
- package/components/charts/TreemapChart.jsx +2 -2
- package/components/charts/TreemapChart.vue +3 -3
- package/components/charts/WaterfallChart.jsx +2 -2
- package/components/charts/WaterfallChart.vue +6 -5
- package/components/charts/WorldMap.jsx +4 -4
- package/components/charts/WorldMap.vue +5 -5
- package/components/charts/XLabels.vue +11 -0
- package/components/data/CodeBlock.jsx +1 -1
- package/components/data/CodeBlock.vue +1 -1
- package/components/data/DiffValue.d.ts +1 -0
- package/components/data/DiffValue.jsx +1 -1
- package/components/data/DiffValue.vue +1 -1
- package/components/data/FilterBar.d.ts +2 -0
- package/components/data/FilterBar.jsx +10 -9
- package/components/data/FilterBar.vue +9 -8
- package/components/data/KeyValue.d.ts +1 -1
- package/components/data/KeyValue.jsx +4 -4
- package/components/data/KeyValue.vue +4 -4
- package/components/data/ListRow.jsx +2 -2
- package/components/data/ListRow.vue +2 -2
- package/components/data/Pagination.d.ts +5 -1
- package/components/data/Pagination.jsx +16 -12
- package/components/data/Pagination.vue +14 -9
- package/components/data/SmartTable.d.ts +4 -1
- package/components/data/SmartTable.jsx +16 -14
- package/components/data/SmartTable.vue +26 -23
- package/components/data/Spreadsheet.d.ts +2 -0
- package/components/data/Spreadsheet.jsx +16 -15
- package/components/data/Spreadsheet.vue +19 -18
- package/components/data/Table.d.ts +101 -0
- package/components/data/Table.jsx +223 -0
- package/components/data/Table.vue +153 -0
- package/components/data/data.prompt.md +3 -3
- package/components/display/Avatar.jsx +2 -2
- package/components/display/Avatar.vue +3 -2
- package/components/display/AvatarGroup.vue +3 -2
- package/components/display/Badge.d.ts +4 -1
- package/components/display/Badge.jsx +10 -5
- package/components/display/Badge.vue +1 -1
- package/components/display/Divider.vue +3 -3
- package/components/display/Donut.vue +3 -2
- package/components/display/IconTile.vue +10 -4
- package/components/display/Kbd.d.ts +1 -1
- package/components/display/Kbd.jsx +1 -1
- package/components/display/Kbd.vue +2 -2
- package/components/display/ProgressBar.jsx +1 -1
- package/components/display/ProgressBar.vue +1 -1
- package/components/display/StatCard.vue +1 -1
- package/components/display/Tag.d.ts +3 -1
- package/components/display/Tag.jsx +4 -4
- package/components/display/Tag.vue +4 -4
- package/components/feedback/Accordion.jsx +2 -2
- package/components/feedback/Accordion.vue +2 -2
- package/components/feedback/ActivityItem.d.ts +3 -1
- package/components/feedback/ActivityItem.jsx +6 -6
- package/components/feedback/ActivityItem.vue +5 -4
- package/components/feedback/Alert.jsx +4 -4
- package/components/feedback/Alert.vue +3 -3
- package/components/feedback/Banner.jsx +5 -5
- package/components/feedback/Banner.vue +5 -5
- package/components/feedback/ContextMenu.d.ts +3 -1
- package/components/feedback/ContextMenu.jsx +5 -5
- package/components/feedback/ContextMenu.vue +5 -5
- package/components/feedback/DotActivity.vue +3 -3
- package/components/feedback/Drawer.d.ts +2 -0
- package/components/feedback/Drawer.jsx +6 -6
- package/components/feedback/Drawer.vue +22 -15
- package/components/feedback/EmptyState.vue +2 -2
- package/components/feedback/LogViewer.vue +1 -1
- package/components/feedback/Modal.d.ts +2 -0
- package/components/feedback/Modal.jsx +12 -11
- package/components/feedback/Modal.vue +10 -8
- package/components/feedback/Skeleton.vue +2 -1
- package/components/feedback/Spinner.vue +2 -1
- package/components/feedback/Stepper.vue +1 -1
- package/components/feedback/Timeline.jsx +1 -1
- package/components/feedback/Timeline.vue +3 -3
- package/components/feedback/Toast.vue +4 -4
- package/components/feedback/ToastStack.vue +11 -0
- package/components/feedback/Tooltip.vue +19 -0
- package/components/feedback/feedback.prompt.md +4 -4
- package/components/forms/Checkbox.d.ts +3 -2
- package/components/forms/Checkbox.jsx +7 -7
- package/components/forms/Checkbox.vue +8 -8
- package/components/forms/Combobox.d.ts +2 -0
- package/components/forms/Combobox.jsx +12 -10
- package/components/forms/Combobox.vue +11 -10
- package/components/forms/DatePicker.d.ts +4 -0
- package/components/forms/DatePicker.jsx +16 -12
- package/components/forms/DatePicker.vue +15 -11
- package/components/forms/Dropzone.jsx +2 -2
- package/components/forms/Dropzone.vue +5 -5
- package/components/forms/Field.d.ts +5 -1
- package/components/forms/Field.jsx +4 -4
- package/components/forms/Field.vue +4 -4
- package/components/forms/Input.d.ts +5 -1
- package/components/forms/Input.jsx +8 -8
- package/components/forms/Input.vue +3 -3
- package/components/forms/MultiSelect.d.ts +2 -0
- package/components/forms/MultiSelect.jsx +13 -11
- package/components/forms/MultiSelect.vue +12 -11
- package/components/forms/NumberStepper.d.ts +3 -1
- package/components/forms/NumberStepper.jsx +7 -7
- package/components/forms/NumberStepper.vue +8 -7
- package/components/forms/Radio.d.ts +5 -3
- package/components/forms/Radio.jsx +13 -15
- package/components/forms/Radio.vue +9 -10
- package/components/forms/RadioGroup.vue +5 -5
- package/components/forms/SearchInput.d.ts +3 -1
- package/components/forms/SearchInput.jsx +6 -6
- package/components/forms/SearchInput.vue +7 -6
- package/components/forms/Select.d.ts +3 -2
- package/components/forms/Select.jsx +6 -7
- package/components/forms/Select.vue +6 -6
- package/components/forms/Slider.jsx +3 -3
- package/components/forms/Slider.vue +3 -3
- package/components/forms/Switch.d.ts +2 -2
- package/components/forms/Switch.jsx +20 -22
- package/components/forms/Switch.vue +22 -18
- package/components/forms/Textarea.vue +5 -5
- package/components/forms/forms.prompt.md +1 -1
- package/components/forms/input-base.js +2 -1
- package/components/icons/Icon.jsx +17 -1
- package/components/icons/Icon.prompt.md +2 -0
- package/components/icons/Icon.vue +1 -1
- package/components/icons/icon-paths.js +15 -0
- package/components/index.d.ts +1 -2
- package/components/index.js +4 -5
- package/components/navigation/Breadcrumb.jsx +6 -10
- package/components/navigation/Breadcrumb.vue +6 -12
- package/components/navigation/DocTree.jsx +3 -3
- package/components/navigation/DocTree.vue +3 -3
- package/components/navigation/PageHeading.vue +1 -1
- package/components/navigation/PageToolbar.vue +7 -6
- package/components/navigation/Sidebar.jsx +4 -23
- package/components/navigation/Sidebar.vue +5 -10
- package/components/navigation/ThemeToggle.vue +2 -1
- package/components/navigation/TopBar.d.ts +3 -1
- package/components/navigation/TopBar.jsx +6 -6
- package/components/navigation/Tree.jsx +5 -5
- package/components/navigation/Tree.vue +13 -8
- package/components/navigation/nav-model.js +23 -0
- package/components/navigation/theme-store.js +9 -0
- package/components/pipeline/ConfigPanel.d.ts +2 -0
- package/components/pipeline/ConfigPanel.jsx +9 -9
- package/components/pipeline/ConfigPanel.vue +9 -9
- package/components/pipeline/DataPreview.d.ts +3 -1
- package/components/pipeline/DataPreview.jsx +7 -7
- package/components/pipeline/DataPreview.vue +7 -7
- package/components/pipeline/NodeCard.jsx +3 -3
- package/components/pipeline/NodeCard.vue +3 -3
- package/components/pipeline/PaletteItem.vue +2 -2
- package/components/pipeline/PaletteListItem.vue +1 -1
- package/components/pipeline/PalettePanel.jsx +2 -2
- package/components/pipeline/PalettePanel.vue +1 -1
- package/components/pipeline/Port.vue +15 -0
- package/components/pipeline/PortLabel.vue +15 -0
- package/components/pipeline/ZoomControls.vue +1 -1
- package/components/pipeline/port-skin.js +13 -0
- package/components/px.js +4 -0
- package/components/tabs/PanelTabs.vue +5 -4
- package/components/tabs/PillTabs.vue +5 -4
- package/components/tabs/SegmentedControl.d.ts +2 -2
- package/components/tabs/SegmentedControl.jsx +7 -7
- package/components/tabs/SegmentedControl.vue +7 -7
- package/components/tabs/Tabs.d.ts +5 -3
- package/components/tabs/Tabs.jsx +15 -15
- package/components/tabs/Tabs.vue +5 -5
- package/components/tabs/ViewToggle.d.ts +3 -1
- package/components/tabs/ViewToggle.jsx +5 -5
- package/components/tabs/ViewToggle.vue +5 -5
- package/components/tabs/tabs.prompt.md +1 -1
- package/keybricks.css +4 -0
- package/package.json +6 -3
- package/readme.md +91 -122
- package/readme.zh-CN.md +121 -0
- package/tokens/alpha.css +3 -1
- package/tokens/charts.css +20 -17
- package/tokens/colors.css +3 -3
- package/tokens/dark.css +3 -3
- package/tokens/hover.css +32 -0
- package/tokens/interaction.css +3 -1
- package/tokens/layout.css +31 -7
- package/tokens/tokens.d.ts +58 -0
- package/tokens/tokens.js +179 -92
- package/tokens/tokens.json +327 -114
- package/tokens/typography.css +45 -15
- package/components/_cards/brand-visual.card.html +0 -43
- package/components/_cards/datatable.card.html +0 -48
- package/components/_shared/src-brand.js +0 -1
- package/components/brand/BrandVisual.d.ts +0 -17
- package/components/brand/BrandVisual.jsx +0 -29
- package/components/brand/BrandVisual.vue +0 -34
- package/components/brand/_dir.card.html +0 -13
- package/components/brand/brandMotifs.js +0 -210
- package/components/buttons/_dir.card.html +0 -13
- package/components/charts/ChartKit.vue +0 -47
- package/components/charts/_dir.card.html +0 -7
- package/components/data/DataTable.d.ts +0 -28
- package/components/data/DataTable.jsx +0 -32
- package/components/data/DataTable.vue +0 -25
- package/components/data/_dir.card.html +0 -13
- package/components/display/_dir.card.html +0 -13
- package/components/feedback/_dir.card.html +0 -13
- package/components/forms/_dir.card.html +0 -13
- package/components/icons/_dir.card.html +0 -13
- package/components/navigation/_dir.card.html +0 -13
- package/components/pipeline/_dir.card.html +0 -13
- package/components/tabs/_dir.card.html +0 -13
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { px } from '../px.js'
|
|
3
|
+
import { ref, computed, reactive, getCurrentInstance } from 'vue'
|
|
4
|
+
import Checkbox from '../forms/Checkbox.vue'
|
|
5
|
+
import IconTile from '../display/IconTile.vue'
|
|
6
|
+
import IconButton from '../buttons/IconButton.vue'
|
|
7
|
+
import Icon from '../icons/Icon.vue'
|
|
8
|
+
// Keybricks table. columns: [{key,label,width,minWidth,mono,code,twoLine,align,render}].
|
|
9
|
+
// twoLine — the name column of a document list: icon tile, title over a description, optional mark ("favorite" = filled star), trailing ⋯
|
|
10
|
+
// (@row-more(row, index, event)); @row-open(row, index, event) makes the tile and the title open the row (hand cursor, Enter / Space on the title).
|
|
11
|
+
// tree — rows nest through `children` (or `hasChildren` for rows you load on demand); the twoLine column indents 24px per level with an
|
|
12
|
+
// expand arrow; v-model:expandedKeys / defaultExpandedKeys / @expand-change(row, expanded, keys); rowKey names the key field (default "id").
|
|
13
|
+
// labels — { sortAsc, sortDesc, sortClear, more, expand, collapse } for every word the table draws (English by default).
|
|
14
|
+
// Give it a width; it shrinks to minWidth (default 180) before the other columns give way, and title and description truncate to whatever it gets. Row grows to 58px in md (50 sm · 68 lg).
|
|
15
|
+
// sortable — hover the header for a muted sm sort button at the cell's right end (in line with a two-line row's ⋯; arrow-up); click: ascending → descending → none. While sorted the
|
|
16
|
+
// button stays and the label turns --text-heading. One column at a time. v-model:sort / @sort-change (defaultSort seeds it
|
|
17
|
+
// uncontrolled); compare(a, b, rowA, rowB) overrides the default comparison; manualSort keeps rows as given (server-side).
|
|
18
|
+
// The table is a size region: `size` ("sm" | "md" | "lg", default inherit → md) sets its rows, header, cell padding and every control
|
|
19
|
+
// inside the cells from the tier tokens — rows are the tier's bar height (sm 36 · md 40 · lg 48), cells read the tier's control text,
|
|
20
|
+
// header cells are the same size in weight 600 / text-secondary, sentence case, no letter-spacing. `dense` is an alias of size="sm".
|
|
21
|
+
// Every rule in the table is one weight (--border-subtle); the header is set apart by its --bg-table-header tint, never by a heavier line.
|
|
22
|
+
// bordered — the table draws its own rounded card frame (border-card, radius-lg) and drops the edge rules that would double it.
|
|
23
|
+
// framed — the table sits flush inside a container that already has a border (Card :pad="false"); drops only the header's top rule.
|
|
24
|
+
// resizable — a short divider between header cells (hover darkens it, cursor col-resize); drag to set that column's width.
|
|
25
|
+
// Widths live in local state unless you pass columnWidths + listen to @column-resize(key, px). Min width = column.minWidth ?? 48.
|
|
26
|
+
// #empty slot renders inside the table when rows is empty.
|
|
27
|
+
const props = defineProps({ columns: { type: Array, default: () => [] }, rows: { type: Array, default: () => [] }, size: String, dense: Boolean, selectable: Boolean, selected: { type: Array, default: () => [] }, headerBorder: { type: Boolean, default: true }, bordered: Boolean, framed: Boolean, resizable: Boolean, columnWidths: Object, sort: { type: Object, default: undefined }, defaultSort: { type: Object, default: null }, manualSort: Boolean, tree: Boolean, rowKey: { type: String, default: 'id' }, expandedKeys: { type: Array, default: undefined }, defaultExpandedKeys: { type: Array, default: () => [] }, labels: Object, style: Object })
|
|
28
|
+
const emit = defineEmits(['toggle', 'columnResize', 'rowMore', 'rowOpen', 'sortChange', 'update:sort', 'expandChange', 'update:expandedKeys'])
|
|
29
|
+
// Every word the table draws itself; `labels` translates them. The sort tooltip names the NEXT step: unsorted → sortAsc, ascending → sortDesc, descending → sortClear.
|
|
30
|
+
const DEFAULT_LABELS = { sortAsc: 'Sort ascending', sortDesc: 'Sort descending', sortClear: 'Clear sorting', more: 'More actions', expand: 'Expand', collapse: 'Collapse' }
|
|
31
|
+
const L = computed(() => ({ ...DEFAULT_LABELS, ...(props.labels || {}) }))
|
|
32
|
+
const sortLabel = (sorted) => sorted === 'asc' ? L.value.sortDesc : sorted === 'desc' ? L.value.sortClear : L.value.sortAsc
|
|
33
|
+
// the tile and title open the row only when a @row-open listener is attached
|
|
34
|
+
const inst = getCurrentInstance()
|
|
35
|
+
const canOpen = computed(() => !!(inst && inst.vnode.props && (inst.vnode.props.onRowOpen || inst.vnode.props['onRow-open'])))
|
|
36
|
+
function openRow(r, ri, e) { emit('rowOpen', r, ri, e) }
|
|
37
|
+
function openKey(r, ri, e) { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); openRow(r, ri, e) } }
|
|
38
|
+
// Tree: 24px per level; a 20px arrow slot + 4px, so a child's arrow sits under its parent's tile.
|
|
39
|
+
const TREE_INDENT = 24, TREE_TOGGLE = 20
|
|
40
|
+
const localExp = ref([...props.defaultExpandedKeys])
|
|
41
|
+
const expKeys = computed(() => props.expandedKeys !== undefined ? props.expandedKeys : localExp.value)
|
|
42
|
+
const hotToggle = ref(null)
|
|
43
|
+
function toggleRow(item) {
|
|
44
|
+
const next = item.open ? expKeys.value.filter(k => k !== item.key) : [...expKeys.value, item.key]
|
|
45
|
+
if (props.expandedKeys === undefined) localExp.value = next
|
|
46
|
+
emit('update:expandedKeys', next); emit('expandChange', item.r, !item.open, next)
|
|
47
|
+
}
|
|
48
|
+
const treeCol = computed(() => props.tree ? props.columns.find(x => x.twoLine) : null)
|
|
49
|
+
const localSort = ref(props.defaultSort)
|
|
50
|
+
const sortState = computed(() => props.sort !== undefined ? props.sort : localSort.value)
|
|
51
|
+
const hotTh = ref(null)
|
|
52
|
+
const nextSort = (cur, key) => !cur || cur.key !== key ? { key, direction: 'asc' } : cur.direction === 'asc' ? { key, direction: 'desc' } : null
|
|
53
|
+
function cycleSort(key) { const n = nextSort(sortState.value, key); if (props.sort === undefined) localSort.value = n; emit('update:sort', n); emit('sortChange', n) }
|
|
54
|
+
const num = (v) => typeof v === 'number' ? v : typeof v === 'string' && /^\s*-?[\d,]+(\.\d+)?\s*$/.test(v) ? parseFloat(v.replace(/,/g, '')) : NaN
|
|
55
|
+
function compareValues(a, b) {
|
|
56
|
+
const ea = a == null || a === '' || a === '–', eb = b == null || b === '' || b === '–'
|
|
57
|
+
if (ea || eb) return ea && eb ? 0 : ea ? 1 : -1
|
|
58
|
+
const na = num(a), nb = num(b)
|
|
59
|
+
if (!isNaN(na) && !isNaN(nb)) return na - nb
|
|
60
|
+
return String(a).localeCompare(String(b), undefined, { numeric: true, sensitivity: 'base' })
|
|
61
|
+
}
|
|
62
|
+
// Visible rows. index = depth-first position over EVERY row (expanded or not) — for a flat table the position in `rows` — assigned
|
|
63
|
+
// before sorting, so selection and event indices never move. Sorting reorders siblings only; children stay under their parent.
|
|
64
|
+
const built = computed(() => {
|
|
65
|
+
const idx = new Map(); let n = 0
|
|
66
|
+
const number = (list) => list.forEach(r => { idx.set(r, n++); if (props.tree && Array.isArray(r.children)) number(r.children) })
|
|
67
|
+
number(props.rows)
|
|
68
|
+
const s = sortState.value, col = s && props.columns.find(x => x.key === s.key), dir = s && s.direction === 'desc' ? -1 : 1
|
|
69
|
+
const isEmpty = (x) => x == null || x === '' || x === '–'
|
|
70
|
+
const cmp = col && !props.manualSort ? (a, b) => { const va = a[col.key], vb = b[col.key], ea = isEmpty(va), eb = isEmpty(vb); if (ea || eb) return ea && eb ? idx.get(a) - idx.get(b) : ea ? 1 : -1; return (col.compare ? col.compare(va, vb, a, b) : compareValues(va, vb)) * dir || idx.get(a) - idx.get(b) } : null
|
|
71
|
+
const exp = new Set(expKeys.value), out = []
|
|
72
|
+
const walk = (list, level) => (cmp ? list.slice().sort(cmp) : list).forEach(r => {
|
|
73
|
+
const ri = idx.get(r), key = r[props.rowKey] != null ? r[props.rowKey] : String(ri)
|
|
74
|
+
const kids = props.tree && ((Array.isArray(r.children) && r.children.length > 0) || !!r.hasChildren)
|
|
75
|
+
const open = kids && exp.has(key)
|
|
76
|
+
out.push({ r, ri, key, level, kids, open })
|
|
77
|
+
if (open && Array.isArray(r.children)) walk(r.children, level + 1)
|
|
78
|
+
})
|
|
79
|
+
walk(props.rows, 0)
|
|
80
|
+
return { list: out, total: n }
|
|
81
|
+
})
|
|
82
|
+
const view = computed(() => built.value.list)
|
|
83
|
+
const total = computed(() => built.value.total)
|
|
84
|
+
const sortedDir = (c) => sortState.value && sortState.value.key === c.key ? sortState.value.direction : null
|
|
85
|
+
// Two-line title cell — every measure is a --title-cell-* tier token (md: 32px tile r8 · 12px to text · 14/12px · 2px gap · 10px padding → 58px).
|
|
86
|
+
const T_TILE = { width: 'var(--title-cell-tile)', height: 'var(--title-cell-tile)', borderRadius: 'var(--title-cell-tile-r)' }
|
|
87
|
+
const T_ICON = { width: 'var(--title-cell-icon)', height: 'var(--title-cell-icon)' }
|
|
88
|
+
const T_ONE = { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', minWidth: 0 }
|
|
89
|
+
const T_TITLE = { ...T_ONE, fontFamily: 'var(--font-sans)', fontWeight: 'var(--weight-regular)', fontSize: 'var(--control-text)', lineHeight: 'var(--control-leading)', letterSpacing: 'var(--control-tracking)', color: 'var(--text-heading)' }
|
|
90
|
+
const T_DESC = { ...T_ONE, fontFamily: 'var(--font-sans)', fontSize: 'var(--text-xs)', lineHeight: 'var(--leading-xs)', letterSpacing: 'var(--tracking-xs)', color: 'var(--text-secondary)' }
|
|
91
|
+
const STAR_FILLED = 'M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z'
|
|
92
|
+
const pick = (a, r, ri) => typeof a === 'function' ? a(r, ri) : a != null ? r[a] : undefined
|
|
93
|
+
function tl(c, r, ri) {
|
|
94
|
+
const o = c.twoLine === true ? {} : c.twoLine
|
|
95
|
+
return { icon: pick(o.icon ?? 'icon', r, ri), hue: pick(o.hue ?? 'hue', r, ri), desc: pick(o.description ?? 'description', r, ri), mark: pick(o.mark ?? 'mark', r, ri), more: o.more !== false }
|
|
96
|
+
}
|
|
97
|
+
function more(r, ri, e) { if (e && e.stopPropagation) e.stopPropagation(); emit('rowMore', r, ri, e) }
|
|
98
|
+
const tier = computed(() => props.size || (props.dense ? 'sm' : undefined))
|
|
99
|
+
const flushTop = computed(() => props.bordered || props.framed)
|
|
100
|
+
const colCount = computed(() => props.columns.length || 1)
|
|
101
|
+
// Selection checkbox sits in the first column's leading padding (no column of its own): the gap to the text equals the edge padding.
|
|
102
|
+
const CHECK_PAD = 'calc(var(--edge-pad) * 2 + var(--check-size))'
|
|
103
|
+
// Config-code chip (`code: true` columns): Menlo at --text-code on the inset fill.
|
|
104
|
+
const codeChip = { fontFamily: 'var(--font-mono)', fontSize: 'var(--text-code)', lineHeight: 'var(--leading-code)', letterSpacing: 0, background: 'var(--bg-inset)', border: '1px solid var(--border-subtle)', borderRadius: '4px', padding: '1px 6px', color: 'var(--text-primary)', whiteSpace: 'nowrap' }
|
|
105
|
+
const checkSlot = { position: 'absolute', left: 'var(--edge-pad)', top: 0, bottom: 0, display: 'flex', alignItems: 'center' }
|
|
106
|
+
const frame = computed(() => props.bordered ? { background: 'var(--bg-surface)', border: '1px solid var(--border-card)', borderRadius: 'var(--radius-lg)', overflow: 'hidden', ...props.style } : { display: 'contents' })
|
|
107
|
+
const localW = reactive({})
|
|
108
|
+
const drag = ref(null), hot = ref(null)
|
|
109
|
+
const thEls = {}
|
|
110
|
+
const widthOf = (c) => px((props.columnWidths || localW)[c.key] ?? c.width)
|
|
111
|
+
function startDrag(e, c) {
|
|
112
|
+
e.preventDefault()
|
|
113
|
+
const th = thEls[c.key]
|
|
114
|
+
const startX = e.clientX, startW = th ? th.getBoundingClientRect().width : (parseFloat(widthOf(c)) || 120), min = c.minWidth ?? 48
|
|
115
|
+
drag.value = c.key
|
|
116
|
+
const move = (ev) => { const w = Math.max(min, Math.round(startW + ev.clientX - startX)); if (props.columnWidths) emit('columnResize', c.key, w); else localW[c.key] = w }
|
|
117
|
+
const up = () => { drag.value = null; window.removeEventListener('mousemove', move); window.removeEventListener('mouseup', up); document.body.style.cursor = ''; document.body.style.userSelect = '' }
|
|
118
|
+
document.body.style.cursor = 'col-resize'; document.body.style.userSelect = 'none'
|
|
119
|
+
window.addEventListener('mousemove', move); window.addEventListener('mouseup', up)
|
|
120
|
+
}
|
|
121
|
+
function cellFont(c) { return c.mono ? { fontFamily: 'var(--font-sans)', fontSize: 'var(--control-text)', lineHeight: 'var(--control-leading)', letterSpacing: 'var(--control-tracking)', fontVariantNumeric: 'tabular-nums', color: 'var(--text-primary)' } : { fontFamily: 'var(--font-sans)', fontSize: 'var(--control-text)', lineHeight: 'var(--control-leading)', letterSpacing: 'var(--control-tracking)', color: 'var(--text-primary)' } }
|
|
122
|
+
// first and last cells keep the card's edge padding; every other cell the tier's cell padding
|
|
123
|
+
function cellPad(i) { return { ...(i === 0 && props.selectable ? { position: 'relative' } : null), paddingTop: 0, paddingBottom: 0, paddingLeft: i === 0 ? (props.selectable ? CHECK_PAD : 'var(--edge-pad)') : 'var(--cell-px)', paddingRight: i === props.columns.length - 1 ? 'var(--edge-pad)' : 'var(--cell-px)' } }
|
|
124
|
+
</script>
|
|
125
|
+
<template>
|
|
126
|
+
<div :style="frame" :data-size="bordered ? tier : undefined">
|
|
127
|
+
<table :data-size="tier" :style="{ width: '100%', borderCollapse: 'collapse', tableLayout: resizable ? 'fixed' : 'auto', ...(bordered ? null : style) }">
|
|
128
|
+
<thead>
|
|
129
|
+
<tr :style="{ background: 'var(--bg-table-header)', borderTop: (headerBorder && !flushTop) ? '1px solid var(--border-subtle)' : 'none', borderBottom: headerBorder ? '1px solid var(--border-subtle)' : 'none', height: 'var(--bar-h)' }">
|
|
130
|
+
<th v-for="(c, i) in columns" :key="c.key" :ref="el => { thEls[c.key] = el }" :aria-sort="c.sortable ? (sortedDir(c) === 'asc' ? 'ascending' : sortedDir(c) === 'desc' ? 'descending' : 'none') : undefined"
|
|
131
|
+
@mouseenter="c.sortable && (hotTh = c.key)" @mouseleave="c.sortable && (hotTh = null)" @focusin="c.sortable && (hotTh = c.key)" @focusout="c.sortable && (hotTh = null)"
|
|
132
|
+
:style="{ position: 'relative', textAlign: c.align || 'left', ...cellPad(i), width: widthOf(c), fontFamily: 'var(--font-sans)', fontWeight: 'var(--weight-semibold)', fontSize: 'var(--control-text)', lineHeight: 'var(--control-leading)', letterSpacing: 'var(--control-tracking)', color: sortedDir(c) ? 'var(--text-heading)' : 'var(--text-secondary)', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }">
|
|
133
|
+
<span v-if="selectable && i === 0" :style="checkSlot"><Checkbox :checked="total > 0 && selected.length === total" :indeterminate="selected.length > 0 && selected.length < total" @change="v => emit('toggle', 'all', v)" /></span>
|
|
134
|
+
<span v-if="c.sortable" :style="{ display: 'flex', alignItems: 'center', gap: '4px' }"><span :style="{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', minWidth: 0, ...(c.align === 'right' ? { marginLeft: 'auto' } : c.align === 'center' ? { margin: '0 auto' } : null), ...(typeof ((columnWidths || localW)[c.key] ?? c.width) === 'number' ? { maxWidth: (((columnWidths || localW)[c.key] ?? c.width) - 32) + 'px' } : null) }">{{ c.label }}</span><IconButton :icon="sortedDir(c) === 'desc' ? 'arrow-down' : 'arrow-up'" size="sm" muted :label="sortLabel(sortedDir(c))" :title="sortLabel(sortedDir(c))" :style="{ opacity: (sortedDir(c) || hotTh === c.key) ? 1 : 0, ...(c.align === 'right' ? null : { marginLeft: 'auto' }) }" @click="cycleSort(c.key)" /></span>
|
|
135
|
+
<template v-else>{{ c.label }}</template>
|
|
136
|
+
<span v-if="resizable && i < columns.length - 1" aria-hidden="true" @mousedown="e => startDrag(e, c)" @mouseenter="hot = c.key" @mouseleave="hot = null"
|
|
137
|
+
style="position:absolute;top:0;right:-5px;width:11px;height:100%;cursor:col-resize;display:flex;align-items:center;justify-content:center;z-index:1">
|
|
138
|
+
<span :style="{ width: drag === c.key ? '2px' : '1px', height: '50%', background: (drag === c.key || hot === c.key) ? 'var(--action-primary)' : 'var(--border-split)', borderRadius: '1px', transition: 'var(--t-hover)' }"></span>
|
|
139
|
+
</span>
|
|
140
|
+
</th>
|
|
141
|
+
</tr>
|
|
142
|
+
</thead>
|
|
143
|
+
<tbody>
|
|
144
|
+
<tr v-for="(item, pos) in view" :key="item.key" data-row="" :aria-level="tree ? item.level + 1 : undefined" :aria-expanded="item.kids ? item.open : undefined" :style="{ height: 'var(--bar-h)', background: 'var(--row-wash, transparent)', transition: 'var(--t-hover)', borderBottom: bordered && pos === view.length - 1 ? 'none' : '1px solid var(--border-subtle)' }">
|
|
145
|
+
<template v-for="{ r, ri } in [item]" :key="'r'">
|
|
146
|
+
<td v-for="(c, i) in columns" :key="c.key" :style="{ ...cellPad(i), ...(c.twoLine ? { paddingTop: 'var(--title-cell-py)', paddingBottom: 'var(--title-cell-py)', maxWidth: 0 } : null), textAlign: c.align || 'left', whiteSpace: 'nowrap', ...(resizable ? { overflow: 'hidden', textOverflow: 'ellipsis' } : null), ...cellFont(c) }"><span v-if="selectable && i === 0" :style="checkSlot"><Checkbox :checked="selected.includes(ri)" @change="v => emit('toggle', ri, v)" /></span><div v-if="c.twoLine" :style="{ display: 'flex', alignItems: 'center', minWidth: px(c.minWidth ?? 180), ...(treeCol === c ? { paddingLeft: (item.level * TREE_INDENT) + 'px' } : null) }"><span v-if="treeCol === c" :style="{ width: TREE_TOGGLE + 'px', flexShrink: 0, marginRight: (TREE_INDENT - TREE_TOGGLE) + 'px', display: 'inline-flex' }"><button v-if="item.kids" type="button" :aria-expanded="item.open" :aria-label="item.open ? L.collapse : L.expand" :title="item.open ? L.collapse : L.expand" @click.stop="toggleRow(item)" @mouseenter="hotToggle = item.key" @mouseleave="hotToggle = null" :style="{ width: TREE_TOGGLE + 'px', height: TREE_TOGGLE + 'px', padding: 0, border: 'none', borderRadius: 'var(--radius-sm)', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', cursor: 'pointer', background: hotToggle === item.key ? 'var(--overlay-hover)' : 'transparent', color: hotToggle === item.key ? 'var(--text-body)' : 'var(--text-muted)', transition: 'var(--t-hover)' }"><Icon name="chevron-right" :size="16" :style="{ width: 'var(--control-icon)', height: 'var(--control-icon)', transform: item.open ? 'rotate(90deg)' : 'none', transition: 'transform .15s ease' }" /></button></span><div style="display:flex;align-items:center;gap:var(--title-cell-tile-gap);flex:1;min-width:0"><template v-for="t in [tl(c, r, ri)]" :key="0"><span v-if="t.icon" :style="{ display: 'inline-flex', flexShrink: 0, cursor: canOpen ? 'pointer' : undefined }" @click="e => canOpen && openRow(r, ri, e)"><IconTile :icon="t.icon" :hue="t.hue || 'neutral'" kind="row" :style="T_TILE" :icon-style="T_ICON" /></span><div style="display:flex;flex-direction:column;gap:var(--title-cell-gap);flex:1;min-width:0"><div style="display:flex;align-items:center;gap:4px;min-width:0"><span v-if="canOpen" role="button" tabindex="0" :style="{ ...T_TITLE, cursor: 'pointer' }" @click="e => openRow(r, ri, e)" @keydown="e => openKey(r, ri, e)">{{ c.render ? c.render(r[c.key], r, ri) : r[c.key] }}</span><span v-else :style="T_TITLE">{{ c.render ? c.render(r[c.key], r, ri) : r[c.key] }}</span><svg v-if="t.mark === 'favorite'" width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linejoin="round" role="img" aria-label="Favorite" style="display:block;flex-shrink:0;color:var(--warning)"><path :d="STAR_FILLED" /></svg><span v-else-if="t.mark" role="img" :aria-label="t.mark.label" :style="{ display: 'inline-flex', flexShrink: 0, color: t.mark.color || 'var(--text-muted)' }"><Icon :name="t.mark.icon" :size="14" /></span></div><span v-if="t.desc" :style="T_DESC">{{ t.desc }}</span></div><IconButton v-if="t.more" icon="ellipsis" size="sm" muted :label="L.more" :title="L.more" @click="e => more(r, ri, e)" /></template></div></div><code v-else-if="c.code && (typeof r[c.key] === 'string' || typeof r[c.key] === 'number') && r[c.key] !== ''" :style="codeChip">{{ c.render ? c.render(r[c.key], r, ri) : r[c.key] }}</code><template v-else>{{ c.render ? c.render(r[c.key], r, ri) : r[c.key] }}</template></td>
|
|
147
|
+
</template>
|
|
148
|
+
</tr>
|
|
149
|
+
<tr v-if="rows.length === 0 && $slots.empty"><td :colspan="colCount" style="padding:0"><slot name="empty" /></td></tr>
|
|
150
|
+
</tbody>
|
|
151
|
+
</table>
|
|
152
|
+
</div>
|
|
153
|
+
</template>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
Data lists: `
|
|
1
|
+
Data lists: `Table` (hairline table, mono cells, selectable; a size region — `size="sm"` for preview grids; `twoLine` name column with `onRowOpen`, `sortable` headers, `tree` rows with expand arrows, `labels` to translate its tooltips) and `ListRow` (expandable workflow rows in a `Card pad={false}`).
|
|
2
2
|
|
|
3
3
|
```jsx
|
|
4
|
-
<
|
|
4
|
+
<Table selectable columns={[
|
|
5
5
|
{key:"module",label:"Module"},
|
|
6
6
|
{key:"code",label:"Code",mono:true},
|
|
7
7
|
{key:"cur",label:"Current Value"},
|
|
@@ -10,7 +10,7 @@ Data lists: `DataTable` (hairline table, mono cells, selectable, dense preview m
|
|
|
10
10
|
<ListRow icon="chart-line" title="Business Analysis" meta="1 document" trailing="1 item"/>
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
dense
|
|
13
|
+
`size="sm"` (the 1.x `dense`) = 32px rows / 12px text for the pipeline data-preview drawer; md = 40px rows / 14px text; lg = 44 / 14. Header cells are the same size as body cells in weight 600, sentence case, no letter-spacing; mono cells keep the row's size with tabular figures.
|
|
14
14
|
|
|
15
15
|
`Pagination` (addition) sits under a table:
|
|
16
16
|
|
|
@@ -13,7 +13,7 @@ export function Avatar({ name = "", src, size = 28, style }) {
|
|
|
13
13
|
const hue = palette[[...name].reduce((a, c) => a + c.charCodeAt(0), 0) % palette.length];
|
|
14
14
|
if (src) return <img src={src} alt={name} style={{ width: size, height: size, borderRadius: "var(--radius-full)", objectFit: "cover", flexShrink: 0, ...style }} />;
|
|
15
15
|
return (
|
|
16
|
-
<span title={name} style={{ width: size, height: size, borderRadius: "var(--radius-full)", background: "var(--bg-hover)", color: hue, display: "inline-flex", alignItems: "center", justifyContent: "center", fontFamily: "var(--font-sans)", fontWeight: "var(--weight-medium)", fontSize:
|
|
16
|
+
<span title={name} style={{ width: size, height: size, borderRadius: "var(--radius-full)", background: "var(--bg-hover)", color: hue, display: "inline-flex", alignItems: "center", justifyContent: "center", fontFamily: "var(--font-sans)", fontWeight: "var(--weight-medium)", fontSize: `max(${Math.round(size * .4)}px, var(--text-glyph-min))`, letterSpacing: 0, flexShrink: 0, boxSizing: "border-box", border: "1px solid var(--border-card)", ...style }}>
|
|
17
17
|
{initials(name)}
|
|
18
18
|
</span>
|
|
19
19
|
);
|
|
@@ -25,7 +25,7 @@ export function AvatarGroup({ names = [], size = 24, max = 4, style }) {
|
|
|
25
25
|
return (
|
|
26
26
|
<div style={{ display: "flex", alignItems: "center", ...style }}>
|
|
27
27
|
{shown.map((n, i) => <Avatar key={n + i} name={n} size={size} style={{ marginLeft: i ? -8 : 0, boxShadow: "var(--ring-surface)" }} />)}
|
|
28
|
-
{rest > 0 ? <span style={{ marginLeft: -8, width: size, height: size, borderRadius: "var(--radius-full)", background: "var(--bg-active)", color: "var(--text-secondary)", boxShadow: "var(--ring-surface)", display: "inline-flex", alignItems: "center", justifyContent: "center", fontFamily: "var(--font-sans)", fontSize:
|
|
28
|
+
{rest > 0 ? <span style={{ marginLeft: -8, width: size, height: size, borderRadius: "var(--radius-full)", background: "var(--bg-active)", color: "var(--text-secondary)", boxShadow: "var(--ring-surface)", display: "inline-flex", alignItems: "center", justifyContent: "center", fontFamily: "var(--font-sans)", fontSize: `max(${Math.round(size * .38)}px, var(--text-glyph-min))` }}>+{rest}</span> : null}
|
|
29
29
|
</div>
|
|
30
30
|
);
|
|
31
31
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { px } from '../px.js'
|
|
2
3
|
import { computed } from 'vue'
|
|
3
4
|
const palette = ['var(--cat-join)', 'var(--cat-source)', 'var(--cat-transform)', 'var(--cat-merge)', 'var(--cat-output)']
|
|
4
5
|
function initials(name = '') {
|
|
@@ -12,6 +13,6 @@ const props = defineProps({ name: { type: String, default: '' }, src: String, si
|
|
|
12
13
|
const hue = computed(() => palette[[...props.name].reduce((a, c) => a + c.charCodeAt(0), 0) % palette.length])
|
|
13
14
|
</script>
|
|
14
15
|
<template>
|
|
15
|
-
<img v-if="src" :src="src" :alt="name" :style="{ width: size, height: size, borderRadius: 'var(--radius-full)', objectFit: 'cover', flexShrink: 0, ...style }" />
|
|
16
|
-
<span v-else :title="name" :style="{ width: size, height: size, borderRadius: 'var(--radius-full)', background: 'var(--bg-hover)', color: hue, display: 'inline-flex', alignItems: 'center', justifyContent: 'center', fontFamily: 'var(--font-sans)', fontWeight: 'var(--weight-medium)', fontSize:
|
|
16
|
+
<img v-if="src" :src="src" :alt="name" :style="{ width: px(size), height: px(size), borderRadius: 'var(--radius-full)', objectFit: 'cover', flexShrink: 0, ...style }" />
|
|
17
|
+
<span v-else :title="name" :style="{ width: px(size), height: px(size), borderRadius: 'var(--radius-full)', background: 'var(--bg-hover)', color: hue, display: 'inline-flex', alignItems: 'center', justifyContent: 'center', fontFamily: 'var(--font-sans)', fontWeight: 'var(--weight-medium)', fontSize: `max(${Math.round(size * .4)}px, var(--text-glyph-min))`, letterSpacing: 0, flexShrink: 0, boxSizing: 'border-box', border: '1px solid var(--border-card)', ...style }">{{ initials(name) }}</span>
|
|
17
18
|
</template>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { px } from '../px.js'
|
|
2
3
|
import { computed } from 'vue'
|
|
3
4
|
import Avatar from './Avatar.vue'
|
|
4
5
|
const props = defineProps({ names: { type: Array, default: () => [] }, size: { type: Number, default: 24 }, max: { type: Number, default: 4 }, style: Object })
|
|
@@ -7,7 +8,7 @@ const rest = computed(() => props.names.length - shown.value.length)
|
|
|
7
8
|
</script>
|
|
8
9
|
<template>
|
|
9
10
|
<div :style="{ display: 'flex', alignItems: 'center', ...style }">
|
|
10
|
-
<Avatar v-for="(n, i) in shown" :key="n + i" :name="n" :size="size" :style="{ marginLeft: i ? -
|
|
11
|
-
<span v-if="rest > 0" :style="{ marginLeft: -
|
|
11
|
+
<Avatar v-for="(n, i) in shown" :key="n + i" :name="n" :size="size" :style="{ marginLeft: i ? '-8px' : 0, boxShadow: 'var(--ring-surface)' }" />
|
|
12
|
+
<span v-if="rest > 0" :style="{ marginLeft: '-8px', width: px(size), height: px(size), borderRadius: 'var(--radius-full)', background: 'var(--bg-active)', color: 'var(--text-secondary)', boxShadow: 'var(--ring-surface)', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', fontFamily: 'var(--font-sans)', fontSize: `max(${Math.round(size * .38)}px, var(--text-glyph-min))` }">+{{ rest }}</span>
|
|
12
13
|
</div>
|
|
13
14
|
</template>
|
|
@@ -20,8 +20,11 @@ export declare function Badge(props: BadgeProps): JSX.Element;
|
|
|
20
20
|
/** Tinted category icon tile. hue: source|join|transform|merge|output; kind: palette 40/r14 · node 48/r16 · row 32/r8. */
|
|
21
21
|
export interface IconTileProps {
|
|
22
22
|
icon: string;
|
|
23
|
-
hue
|
|
23
|
+
/** Category hue. On kind="row" the tile is a hairline square unless hue is set. "neutral" = grey tile (folders, containers). */
|
|
24
|
+
hue?: "source" | "join" | "transform" | "merge" | "output" | "neutral";
|
|
24
25
|
kind?: "palette" | "node" | "row";
|
|
25
26
|
style?: React.CSSProperties;
|
|
27
|
+
/** Forwarded to the inner Icon (e.g. width/height from a token). */
|
|
28
|
+
iconStyle?: React.CSSProperties;
|
|
26
29
|
}
|
|
27
30
|
export declare function IconTile(props: IconTileProps): JSX.Element;
|
|
@@ -27,14 +27,19 @@ export function Badge({ tone = "neutral", children, style }) {
|
|
|
27
27
|
return <span style={{ display: "inline-flex", alignItems: "center", height: 20, padding: "0 8px", borderRadius: "var(--radius-full)", fontFamily: "var(--font-sans)", fontWeight: "var(--weight-medium)", fontSize: "var(--text-xs)", lineHeight: 1, letterSpacing: "var(--tracking-xs)", ...tones[tone], ...style }}>{children}</span>;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
/** Category icon tile — the signature tinted square. kind: palette 40/r14 · node 48/r16 · row 32/r8
|
|
31
|
-
|
|
30
|
+
/** Category icon tile — the signature tinted square. kind: palette 40/r14 · node 48/r16 · row 32/r8.
|
|
31
|
+
* A row tile is a hairline square unless you pass `hue`, then it is tinted like the others. hue "neutral" is the grey tile (folders, containers).
|
|
32
|
+
* iconStyle is forwarded to the Icon (Table's two-line cell sizes it from the tier tokens). */
|
|
33
|
+
export function IconTile({ icon, hue, kind = "palette", style, iconStyle }) {
|
|
32
34
|
const dims = { palette: { box: 40, r: "var(--radius-tile)", icon: 18 }, node: { box: 48, r: "var(--radius-node)", icon: 22 }, row: { box: 32, r: "var(--radius-md)", icon: 16 } };
|
|
33
35
|
const t = dims[kind];
|
|
34
|
-
const
|
|
36
|
+
const h = hue || "source";
|
|
37
|
+
const tinted = kind !== "row" || !!hue;
|
|
38
|
+
const bg = !tinted ? "var(--bg-surface)" : h === "neutral" ? "var(--bg-hover)" : `var(--cat-${h}-bg)`;
|
|
39
|
+
const fg = !tinted ? "var(--text-body)" : h === "neutral" ? "var(--text-secondary)" : `var(--cat-${h})`;
|
|
35
40
|
return (
|
|
36
|
-
<span style={{ width: t.box, height: t.box, borderRadius: t.r, background:
|
|
37
|
-
<Icon name={icon} size={t.icon} strokeWidth={2} />
|
|
41
|
+
<span style={{ width: t.box, height: t.box, borderRadius: t.r, background: bg, border: tinted ? "none" : "1px solid var(--border-control)", display: "inline-flex", alignItems: "center", justifyContent: "center", color: fg, flexShrink: 0, boxSizing: "border-box", ...style }}>
|
|
42
|
+
<Icon name={icon} size={t.icon} strokeWidth={2} style={iconStyle} />
|
|
38
43
|
</span>
|
|
39
44
|
);
|
|
40
45
|
}
|
|
@@ -9,5 +9,5 @@ const tones = {
|
|
|
9
9
|
defineProps({ tone: { type: String, default: 'neutral' }, style: Object })
|
|
10
10
|
</script>
|
|
11
11
|
<template>
|
|
12
|
-
<span :style="{ display: 'inline-flex', alignItems: 'center', height:
|
|
12
|
+
<span :style="{ display: 'inline-flex', alignItems: 'center', height: '20px', padding: '0 8px', borderRadius: 'var(--radius-full)', fontFamily: 'var(--font-sans)', fontWeight: 'var(--weight-medium)', fontSize: 'var(--text-xs)', lineHeight: 1, letterSpacing: 'var(--tracking-xs)', ...tones[tone], ...style }"><slot /></span>
|
|
13
13
|
</template>
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
defineProps({ label: String, vertical: Boolean, style: Object })
|
|
4
4
|
</script>
|
|
5
5
|
<template>
|
|
6
|
-
<span v-if="vertical" :style="{ width:
|
|
7
|
-
<div v-else-if="!label" :style="{ height:
|
|
8
|
-
<div v-else :style="{ display: 'flex', alignItems: 'center', gap:
|
|
6
|
+
<span v-if="vertical" :style="{ width: '1px', alignSelf: 'stretch', background: 'var(--border-subtle)', ...style }" />
|
|
7
|
+
<div v-else-if="!label" :style="{ height: '1px', background: 'var(--border-subtle)', ...style }" />
|
|
8
|
+
<div v-else :style="{ display: 'flex', alignItems: 'center', gap: '12px', ...style }">
|
|
9
9
|
<div style="flex:1;height:1px;background:var(--border-subtle)" />
|
|
10
10
|
<span style="font-family:var(--font-sans);font-size:var(--text-xs);letter-spacing:var(--tracking-xs);color:var(--text-muted);white-space:nowrap">{{ label }}</span>
|
|
11
11
|
<div style="flex:1;height:1px;background:var(--border-subtle)" />
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { px } from '../px.js'
|
|
2
3
|
import { computed } from 'vue'
|
|
3
4
|
const props = defineProps({ size: { type: Number, default: 128 }, thickness: { type: Number, default: 7.68 }, segments: Array, value: { type: Number, default: 75 }, label: [String, Number], style: Object })
|
|
4
5
|
const R = computed(() => props.size / 2 - props.thickness / 2 - props.size * .02)
|
|
@@ -7,11 +8,11 @@ const segs = computed(() => props.segments || [{ value: props.value, color: 'var
|
|
|
7
8
|
const arcs = computed(() => { let offset = 0; return segs.value.map(s => { const len = (s.value / 100) * C.value; const a = { ...s, len, offset }; offset += len; return a }) })
|
|
8
9
|
</script>
|
|
9
10
|
<template>
|
|
10
|
-
<div :style="{ position: 'relative', width: size, height: size, ...style }">
|
|
11
|
+
<div :style="{ position: 'relative', width: px(size), height: px(size), ...style }">
|
|
11
12
|
<svg :width="size" :height="size" style="transform:rotate(-90deg)">
|
|
12
13
|
<circle :cx="size / 2" :cy="size / 2" :r="R" fill="none" stroke="var(--track)" :stroke-width="thickness" />
|
|
13
14
|
<circle v-for="(s, i) in arcs" :key="i" :cx="size / 2" :cy="size / 2" :r="R" fill="none" :stroke="s.color" :stroke-width="thickness" :stroke-dasharray="`${s.len} ${C - s.len}`" :stroke-dashoffset="-s.offset" stroke-linecap="butt" />
|
|
14
15
|
</svg>
|
|
15
|
-
<div style="position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-family:var(--font-sans);font-weight:var(--weight-light);font-size:
|
|
16
|
+
<div style="position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-family:var(--font-sans);font-weight:var(--weight-light);font-size:var(--text-lg);letter-spacing:var(--tracking-lg);color:var(--text-primary)">{{ label != null ? label : `${value}%` }}</div>
|
|
16
17
|
</div>
|
|
17
18
|
</template>
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { px } from '../px.js'
|
|
2
3
|
import { computed } from 'vue'
|
|
3
4
|
import Icon from '../icons/Icon.vue'
|
|
5
|
+
// Category icon tile. kind: palette 40/r14 · node 48/r16 · row 32/r8. A row tile is a hairline square unless `hue` is set, then it is tinted.
|
|
6
|
+
// hue "neutral" is the grey tile (folders, containers). iconStyle is forwarded to the Icon (Table's two-line cell sizes it from the tier tokens).
|
|
4
7
|
const dims = { palette: { box: 40, r: 'var(--radius-tile)', icon: 18 }, node: { box: 48, r: 'var(--radius-node)', icon: 22 }, row: { box: 32, r: 'var(--radius-md)', icon: 16 } }
|
|
5
|
-
const props = defineProps({ icon: String, hue:
|
|
8
|
+
const props = defineProps({ icon: String, hue: String, kind: { type: String, default: 'palette' }, style: Object, iconStyle: Object })
|
|
6
9
|
const t = computed(() => dims[props.kind])
|
|
7
|
-
const
|
|
10
|
+
const h = computed(() => props.hue || 'source')
|
|
11
|
+
const tinted = computed(() => props.kind !== 'row' || !!props.hue)
|
|
12
|
+
const bg = computed(() => !tinted.value ? 'var(--bg-surface)' : h.value === 'neutral' ? 'var(--bg-hover)' : `var(--cat-${h.value}-bg)`)
|
|
13
|
+
const fg = computed(() => !tinted.value ? 'var(--text-body)' : h.value === 'neutral' ? 'var(--text-secondary)' : `var(--cat-${h.value})`)
|
|
8
14
|
</script>
|
|
9
15
|
<template>
|
|
10
|
-
<span :style="{ width: t.box, height: t.box, borderRadius: t.r, background:
|
|
11
|
-
<Icon :name="icon" :size="t.icon" :stroke-width="2" />
|
|
16
|
+
<span :style="{ width: px(t.box), height: px(t.box), borderRadius: px(t.r), background: bg, border: tinted ? 'none' : '1px solid var(--border-control)', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', color: fg, flexShrink: 0, boxSizing: 'border-box', ...style }">
|
|
17
|
+
<Icon :name="icon" :size="t.icon" :stroke-width="2" :style="iconStyle" />
|
|
12
18
|
</span>
|
|
13
19
|
</template>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
/** Keyboard shortcut keycap row (20px
|
|
2
|
+
/** Keyboard shortcut keycap row (20px). Addition — for a power-user data tool's shortcut hints. */
|
|
3
3
|
export interface KbdProps {
|
|
4
4
|
keys?: string[];
|
|
5
5
|
style?: React.CSSProperties;
|
|
@@ -5,7 +5,7 @@ export function Kbd({ keys = [], style }) {
|
|
|
5
5
|
return (
|
|
6
6
|
<span style={{ display: "inline-flex", gap: 3, ...style }}>
|
|
7
7
|
{keys.map((k, i) => (
|
|
8
|
-
<span key={i} style={{ display: "inline-flex", alignItems: "center", justifyContent: "center", minWidth: 20, height: 20, padding: "0 5px", borderRadius: "var(--radius-sm)", background: "var(--bg-inset)", border: "1px solid var(--border-control)", boxSizing: "border-box", fontFamily: "var(--font-
|
|
8
|
+
<span key={i} style={{ display: "inline-flex", alignItems: "center", justifyContent: "center", minWidth: 20, height: 20, padding: "0 5px", borderRadius: "var(--radius-sm)", background: "var(--bg-inset)", border: "1px solid var(--border-control)", boxSizing: "border-box", fontFamily: "var(--font-sans)", fontVariantNumeric: "tabular-nums", fontSize: "var(--text-xs)", color: "var(--text-secondary)" }}>{k}</span>
|
|
9
9
|
))}
|
|
10
10
|
</span>
|
|
11
11
|
);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
defineProps({ keys: { type: Array, default: () => [] }, style: Object })
|
|
4
4
|
</script>
|
|
5
5
|
<template>
|
|
6
|
-
<span :style="{ display: 'inline-flex', gap:
|
|
7
|
-
<span v-for="(k, i) in keys" :key="i" style="display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 5px;border-radius:var(--radius-sm);background:var(--bg-inset);border:1px solid var(--border-control);box-sizing:border-box;font-family:var(--font-
|
|
6
|
+
<span :style="{ display: 'inline-flex', gap: '3px', ...style }">
|
|
7
|
+
<span v-for="(k, i) in keys" :key="i" style="display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 5px;border-radius:var(--radius-sm);background:var(--bg-inset);border:1px solid var(--border-control);box-sizing:border-box;font-family:var(--font-sans);font-variant-numeric:tabular-nums;font-size:var(--text-xs);color:var(--text-secondary)">{{ k }}</span>
|
|
8
8
|
</span>
|
|
9
9
|
</template>
|
|
@@ -35,7 +35,7 @@ export function Donut({ size = 128, thickness = 7.68, segments, value = 75, labe
|
|
|
35
35
|
return el;
|
|
36
36
|
})}
|
|
37
37
|
</svg>
|
|
38
|
-
<div style={{ position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", fontFamily: "var(--font-sans)", fontWeight: "var(--weight-light)", fontSize:
|
|
38
|
+
<div style={{ position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", fontFamily: "var(--font-sans)", fontWeight: "var(--weight-light)", fontSize: "var(--text-lg)", letterSpacing: "var(--tracking-lg)", color: "var(--text-primary)" }}>{label != null ? label : `${value}%`}</div>
|
|
39
39
|
</div>
|
|
40
40
|
);
|
|
41
41
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
defineProps({ label: String, value: { type: Number, default: 50 }, color: { type: String, default: 'var(--chart-blue)' }, showValue: { type: Boolean, default: true }, style: Object })
|
|
4
4
|
</script>
|
|
5
5
|
<template>
|
|
6
|
-
<div :style="{ display: 'flex', flexDirection: 'column', gap:
|
|
6
|
+
<div :style="{ display: 'flex', flexDirection: 'column', gap: '4px', ...style }">
|
|
7
7
|
<div v-if="label != null" style="display:flex;justify-content:space-between;font-family:var(--font-sans);font-size:var(--text-base);line-height:var(--leading-base);letter-spacing:var(--tracking-base)">
|
|
8
8
|
<span style="color:var(--text-body)">{{ label }}</span>
|
|
9
9
|
<span v-if="showValue" style="color:var(--text-heading)">{{ value }}%</span>
|
|
@@ -3,7 +3,7 @@ import Card from './Card.vue'
|
|
|
3
3
|
defineProps({ label: String, value: [String, Number], dense: Boolean, style: Object })
|
|
4
4
|
</script>
|
|
5
5
|
<template>
|
|
6
|
-
<Card :dense="dense" :style="{ display: 'flex', flexDirection: 'column', gap:
|
|
6
|
+
<Card :dense="dense" :style="{ display: 'flex', flexDirection: 'column', gap: '12px', ...style }">
|
|
7
7
|
<span style="font-family:var(--font-sans);font-size:var(--text-base);line-height:var(--leading-base);letter-spacing:var(--tracking-base);color:var(--text-secondary)">{{ label }}</span>
|
|
8
8
|
<slot />
|
|
9
9
|
<span v-if="value != null" style="font-family:var(--font-sans);font-weight:var(--weight-light);font-size:var(--text-num);line-height:var(--leading-num);letter-spacing:var(--tracking-num);color:var(--text-primary)">{{ value }}</span>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
/** Small removable filter tag (
|
|
2
|
+
/** Small removable filter tag (full radius; sm 20 · md 24 · lg 28 tall, 12px text). Addition — distinct from Badge/ActionChip. */
|
|
3
3
|
export interface TagProps {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
+
/** Size tier. Omit to inherit the enclosing region's tier (the default). */
|
|
6
|
+
size?: "sm" | "md" | "lg";
|
|
5
7
|
onRemove?: () => void;
|
|
6
8
|
tone?: "neutral" | "info";
|
|
7
9
|
style?: React.CSSProperties;
|
|
@@ -3,13 +3,13 @@ import { Icon } from "../icons/Icon.jsx";
|
|
|
3
3
|
|
|
4
4
|
const tones = { neutral: { bg: "var(--bg-hover)", fg: "var(--text-body)" }, info: { bg: "var(--info-bg)", fg: "var(--info-fg)" } };
|
|
5
5
|
|
|
6
|
-
/** Small removable filter tag — distinct from Badge (status) and ActionChip (bulk action). */
|
|
7
|
-
export function Tag({ children, onRemove, tone = "neutral", style }) {
|
|
6
|
+
/** Small removable filter tag — distinct from Badge (status) and ActionChip (bulk action). Height follows the region's tier (sm 20 · md 24 · lg 28, --tag-h); text stays 12px. */
|
|
7
|
+
export function Tag({ children, onRemove, tone = "neutral", size, style }) {
|
|
8
8
|
const t = tones[tone] || tones.neutral;
|
|
9
9
|
return (
|
|
10
|
-
<span style={{ display: "inline-flex", alignItems: "center", gap: 4, height:
|
|
10
|
+
<span data-size={size} style={{ display: "inline-flex", alignItems: "center", gap: 4, height: "var(--tag-h)", padding: onRemove ? "0 6px 0 10px" : "0 10px", borderRadius: "var(--radius-full)", background: t.bg, color: t.fg, fontFamily: "var(--font-sans)", fontSize: "var(--text-xs)", lineHeight: "var(--leading-xs)", fontWeight: "var(--weight-medium)", letterSpacing: "var(--tracking-xs)", whiteSpace: "nowrap", ...style }}>
|
|
11
11
|
{children}
|
|
12
|
-
{onRemove ? <button type="button" onClick={onRemove} style={{ border: "none", background: "transparent", cursor: "pointer", color: "inherit", opacity: .7, display: "flex", padding: 0 }}><Icon name="x" size={
|
|
12
|
+
{onRemove ? <button type="button" onClick={onRemove} aria-label="Remove" data-ink="" style={{ border: "none", background: "transparent", cursor: "pointer", color: "inherit", opacity: "var(--ink-op, .7)", display: "flex", padding: 0 }}><Icon name="x" size={12} /></button> : null}
|
|
13
13
|
</span>
|
|
14
14
|
);
|
|
15
15
|
}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
import Icon from '../icons/Icon.vue'
|
|
4
4
|
const tones = { neutral: { bg: 'var(--bg-hover)', fg: 'var(--text-body)' }, info: { bg: 'var(--info-bg)', fg: 'var(--info-fg)' } }
|
|
5
|
-
// Small removable filter tag — distinct from Badge (status) and ActionChip (bulk action).
|
|
6
|
-
const props = defineProps({ tone: { type: String, default: 'neutral' }, removable: Boolean, style: Object })
|
|
5
|
+
// Small removable filter tag — distinct from Badge (status) and ActionChip (bulk action). Height follows the region's tier (sm 20 · md 24 · lg 28, --tag-h); text stays 12px.
|
|
6
|
+
const props = defineProps({ tone: { type: String, default: 'neutral' }, removable: Boolean, size: String, style: Object })
|
|
7
7
|
defineEmits(['remove'])
|
|
8
8
|
const t = computed(() => tones[props.tone] || tones.neutral)
|
|
9
9
|
</script>
|
|
10
10
|
<template>
|
|
11
|
-
<span :style="{ display: 'inline-flex', alignItems: 'center', gap:
|
|
11
|
+
<span :data-size="size" :style="{ display: 'inline-flex', alignItems: 'center', gap: '4px', height: 'var(--tag-h)', padding: removable ? '0 6px 0 10px' : '0 10px', borderRadius: 'var(--radius-full)', background: t.bg, color: t.fg, fontFamily: 'var(--font-sans)', fontSize: 'var(--text-xs)', lineHeight: 'var(--leading-xs)', fontWeight: 'var(--weight-medium)', letterSpacing: 'var(--tracking-xs)', whiteSpace: 'nowrap', ...style }">
|
|
12
12
|
<slot />
|
|
13
|
-
<button v-if="removable" type="button" @click="$emit('remove')" style="border:none;background:transparent;cursor:pointer;color:inherit;opacity
|
|
13
|
+
<button v-if="removable" type="button" aria-label="Remove" data-ink="" @click="$emit('remove')" style="border:none;background:transparent;cursor:pointer;color:inherit;opacity:var(--ink-op, .7);display:flex;padding:0"><Icon name="x" :size="12" /></button>
|
|
14
14
|
</span>
|
|
15
15
|
</template>
|
|
@@ -8,11 +8,11 @@ export function Accordion({ title, subtitle, defaultOpen, open: openProp, onTogg
|
|
|
8
8
|
const toggle = () => (onToggle ? onToggle(!open) : setOpenState(!open));
|
|
9
9
|
return (
|
|
10
10
|
<div style={{ borderBottom: "1px solid var(--border-card)", ...style }}>
|
|
11
|
-
<div onClick={toggle} style={{ display: "flex", alignItems: "center", gap: 10, padding: "14px 4px", cursor: "pointer" }}>
|
|
11
|
+
<div onClick={toggle} data-wash="" style={{ display: "flex", alignItems: "center", gap: 10, padding: "14px 8px", margin: "0 -4px", borderRadius: "var(--radius-md)", background: "var(--wash, transparent)", transition: "var(--t-hover)", cursor: "pointer" }}>
|
|
12
12
|
<span style={{ color: "var(--text-muted)", display: "inline-flex", transform: open ? "rotate(90deg)" : "none", transition: "transform var(--dur-fast) var(--ease-out)" }}><Icon name="chevron-right" size={14} /></span>
|
|
13
13
|
<div style={{ display: "flex", flexDirection: "column", flex: 1 }}>
|
|
14
14
|
<span style={{ fontFamily: "var(--font-sans)", fontWeight: "var(--weight-medium)", fontSize: "var(--text-base)", letterSpacing: "var(--tracking-base)", color: "var(--text-heading)" }}>{title}</span>
|
|
15
|
-
{subtitle ? <span style={{ fontFamily: "var(--font-sans)", fontSize: "var(--text-
|
|
15
|
+
{subtitle ? <span style={{ fontFamily: "var(--font-sans)", fontSize: "var(--text-xs)", color: "var(--text-secondary)" }}>{subtitle}</span> : null}
|
|
16
16
|
</div>
|
|
17
17
|
</div>
|
|
18
18
|
{open ? <div style={{ padding: "0 4px 16px 28px" }}>{children}</div> : null}
|
|
@@ -10,11 +10,11 @@ function toggle() { if (props.open != null) emit('toggle', !open.value); else op
|
|
|
10
10
|
</script>
|
|
11
11
|
<template>
|
|
12
12
|
<div :style="{ borderBottom: '1px solid var(--border-card)', ...style }">
|
|
13
|
-
<div @click="toggle" style="display:flex;align-items:center;gap:10px;padding:14px 4px;cursor:pointer">
|
|
13
|
+
<div @click="toggle" data-wash="" style="display:flex;align-items:center;gap:10px;padding:14px 8px;margin:0 -4px;border-radius:var(--radius-md);background:var(--wash, transparent);transition:var(--t-hover);cursor:pointer">
|
|
14
14
|
<span :style="{ color: 'var(--text-muted)', display: 'inline-flex', transform: open ? 'rotate(90deg)' : 'none', transition: 'transform var(--dur-fast) var(--ease-out)' }"><Icon name="chevron-right" :size="14" /></span>
|
|
15
15
|
<div style="display:flex;flex-direction:column;flex:1">
|
|
16
16
|
<span style="font-family:var(--font-sans);font-weight:var(--weight-medium);font-size:var(--text-base);letter-spacing:var(--tracking-base);color:var(--text-heading)">{{ title }}</span>
|
|
17
|
-
<span v-if="subtitle" style="font-family:var(--font-sans);font-size:var(--text-
|
|
17
|
+
<span v-if="subtitle" style="font-family:var(--font-sans);font-size:var(--text-xs);color:var(--text-secondary)">{{ subtitle }}</span>
|
|
18
18
|
</div>
|
|
19
19
|
</div>
|
|
20
20
|
<div v-if="open" style="padding:0 4px 16px 28px"><slot /></div>
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
/** Feed row: 32px blue-tint icon tile,
|
|
2
|
+
/** Feed row: 32px blue-tint icon tile, 14px/500 title, 12px meta, right action text ("Open"). */
|
|
3
3
|
export interface ActivityItemProps {
|
|
4
4
|
icon?: string;
|
|
5
5
|
title?: string;
|
|
6
6
|
meta?: string;
|
|
7
7
|
action?: React.ReactNode;
|
|
8
|
+
/** Fires when the action text is clicked. Vue: `@action`. */
|
|
9
|
+
onAction?: () => void;
|
|
8
10
|
style?: React.CSSProperties;
|
|
9
11
|
}
|
|
10
12
|
export declare function ActivityItem(props: ActivityItemProps): JSX.Element;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { IconTile } from "../display/Badge.jsx";
|
|
3
3
|
|
|
4
|
-
/** Activity feed row: 32px icon tile +
|
|
5
|
-
export function ActivityItem({ icon = "file-text", title, meta, action, style }) {
|
|
4
|
+
/** Activity feed row: 32px icon tile + 14px/500 title + 12px meta + optional right text action (a text link: ink darkens on hover). */
|
|
5
|
+
export function ActivityItem({ icon = "file-text", title, meta, action, onAction, style }) {
|
|
6
6
|
return (
|
|
7
7
|
<div style={{ display: "flex", alignItems: "center", gap: 12, padding: "12px 16px", ...style }}>
|
|
8
8
|
<IconTile icon={icon} kind="row" style={{ background: "var(--info-bg)", border: "none", color: "var(--info-fg)" }} />
|
|
9
9
|
<div style={{ display: "flex", flexDirection: "column", flex: 1, minWidth: 0 }}>
|
|
10
10
|
<span style={{ fontFamily: "var(--font-sans)", fontWeight: "var(--weight-medium)", fontSize: "var(--text-base)", lineHeight: "var(--leading-base)", letterSpacing: "var(--tracking-base)", color: "var(--text-heading)" }}>{title}</span>
|
|
11
|
-
{meta ? <span style={{ fontFamily: "var(--font-sans)", fontSize: "var(--text-
|
|
11
|
+
{meta ? <span style={{ fontFamily: "var(--font-sans)", fontSize: "var(--text-xs)", lineHeight: "var(--leading-xs)", color: "var(--text-secondary)" }}>{meta}</span> : null}
|
|
12
12
|
</div>
|
|
13
|
-
{action ? <
|
|
13
|
+
{action ? <button type="button" onClick={onAction} data-ink="" style={{ border: "none", background: "transparent", padding: 0, fontFamily: "var(--font-sans)", fontWeight: "var(--weight-medium)", fontSize: "var(--text-base)", lineHeight: "var(--leading-base)", letterSpacing: "var(--tracking-base)", color: "var(--ink, var(--text-secondary))", cursor: "pointer", whiteSpace: "nowrap" }}>{action}</button> : null}
|
|
14
14
|
</div>
|
|
15
15
|
);
|
|
16
16
|
}
|
|
@@ -22,7 +22,7 @@ export function DotActivity({ tone = "success", text, time, style }) {
|
|
|
22
22
|
<div style={{ display: "flex", gap: 8, alignItems: "flex-start", ...style }}>
|
|
23
23
|
<span style={{ width: 8, height: 8, borderRadius: "var(--radius-full)", background: tones[tone], marginTop: 5, flexShrink: 0 }} />
|
|
24
24
|
<div style={{ display: "flex", flexDirection: "column", minWidth: 0 }}>
|
|
25
|
-
<span style={{ fontFamily: "var(--font-sans)", fontSize: "var(--text-
|
|
25
|
+
<span style={{ fontFamily: "var(--font-sans)", fontSize: "var(--text-base)", lineHeight: "var(--leading-base)", color: "var(--text-heading)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{text}</span>
|
|
26
26
|
<span style={{ fontFamily: "var(--font-sans)", fontSize: "var(--text-xs)", lineHeight: "var(--leading-xs)", letterSpacing: "var(--tracking-xs)", color: "var(--text-muted)" }}>{time}</span>
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
@@ -33,7 +33,7 @@ export function DotActivity({ tone = "success", text, time, style }) {
|
|
|
33
33
|
export function LogViewer({ lines = [], height, style }) {
|
|
34
34
|
return (
|
|
35
35
|
<div style={{ background: "var(--bg-inset)", borderRadius: "var(--radius-md)", border: "1px solid var(--border-subtle)", padding: "10px 12px", display: "flex", flexDirection: "column", gap: 6, overflowY: "auto", height, boxSizing: "border-box", ...style }}>
|
|
36
|
-
{lines.map((l, i) => <span key={i} style={{ fontFamily: "var(--font-
|
|
36
|
+
{lines.map((l, i) => <span key={i} style={{ fontFamily: "var(--font-sans)", fontVariantNumeric: "tabular-nums", fontSize: "var(--text-xs)", lineHeight: "var(--leading-xs)", color: typeof l === "object" ? l.color || "var(--text-body)" : "var(--text-body)", whiteSpace: "pre" }}>{typeof l === "object" ? l.text : l}</span>)}
|
|
37
37
|
</div>
|
|
38
38
|
);
|
|
39
39
|
}
|