From 0f53c525ee466c1fd7c37805b097a2fd17eb878d Mon Sep 17 00:00:00 2001 From: Jeton Korenica Date: Mon, 13 Jul 2026 18:42:21 +0200 Subject: [PATCH] feat(table): port full COSS table set (variants + data tables) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Match the COSS UI table docs (coss.com/ui/docs/components/table): Core Table component: - Add variant prop ('default' | 'card') with data-slot/data-variant attribute targeting, porting COSS's exact card-variant styling (border-separate rounded surfaces, translucent hover/selected states) New Frame component (Frame/FramePanel/FrameFooter) — muted app-surface framing used by the data-table examples. Demos (all 5 COSS examples): - Table01: basic default table (badges, footer, caption) - Table02: card variant, standalone - Table03: card table wrapped in a Frame - Table04: data table with row selection (Vue-reactive port of the TanStack example, using our Checkbox with indeterminate select-all) - Table05: full data table with column sorting + pagination + range select (flight board; Vue-reactive, no TanStack dependency) type-check, lint and build pass; verified in-browser (card surfaces, row selection, sorting, pagination all functional). --- src/components/tables/Table01.vue | 65 +++-- src/components/tables/Table02.vue | 73 +++--- src/components/tables/Table03.vue | 56 +++++ src/components/tables/Table04.vue | 117 +++++++++ src/components/tables/Table05.vue | 292 +++++++++++++++++++++++ src/components/ui/Frame/Frame.vue | 21 ++ src/components/ui/Frame/FrameFooter.vue | 12 + src/components/ui/Frame/FramePanel.vue | 20 ++ src/components/ui/Frame/index.ts | 3 + src/components/ui/Table/Table.vue | 23 +- src/components/ui/Table/TableBody.vue | 10 +- src/components/ui/Table/TableCaption.vue | 5 +- src/components/ui/Table/TableCell.vue | 8 +- src/components/ui/Table/TableFooter.vue | 8 +- src/components/ui/Table/TableHead.vue | 3 +- src/components/ui/Table/TableHeader.vue | 2 +- src/components/ui/Table/TableRow.vue | 3 +- src/views/Tables.vue | 2 +- 18 files changed, 652 insertions(+), 71 deletions(-) create mode 100644 src/components/tables/Table03.vue create mode 100644 src/components/tables/Table04.vue create mode 100644 src/components/tables/Table05.vue create mode 100644 src/components/ui/Frame/Frame.vue create mode 100644 src/components/ui/Frame/FrameFooter.vue create mode 100644 src/components/ui/Frame/FramePanel.vue create mode 100644 src/components/ui/Frame/index.ts diff --git a/src/components/tables/Table01.vue b/src/components/tables/Table01.vue index 0c6f327..1fe4f90 100644 --- a/src/components/tables/Table01.vue +++ b/src/components/tables/Table01.vue @@ -1,40 +1,55 @@ diff --git a/src/components/tables/Table02.vue b/src/components/tables/Table02.vue index 6586300..e7cf46d 100644 --- a/src/components/tables/Table02.vue +++ b/src/components/tables/Table02.vue @@ -1,50 +1,53 @@ diff --git a/src/components/tables/Table03.vue b/src/components/tables/Table03.vue new file mode 100644 index 0000000..2978711 --- /dev/null +++ b/src/components/tables/Table03.vue @@ -0,0 +1,56 @@ + + + diff --git a/src/components/tables/Table04.vue b/src/components/tables/Table04.vue new file mode 100644 index 0000000..8276eac --- /dev/null +++ b/src/components/tables/Table04.vue @@ -0,0 +1,117 @@ + + + diff --git a/src/components/tables/Table05.vue b/src/components/tables/Table05.vue new file mode 100644 index 0000000..e23804f --- /dev/null +++ b/src/components/tables/Table05.vue @@ -0,0 +1,292 @@ + + + diff --git a/src/components/ui/Frame/Frame.vue b/src/components/ui/Frame/Frame.vue new file mode 100644 index 0000000..128d334 --- /dev/null +++ b/src/components/ui/Frame/Frame.vue @@ -0,0 +1,21 @@ + + + diff --git a/src/components/ui/Frame/FrameFooter.vue b/src/components/ui/Frame/FrameFooter.vue new file mode 100644 index 0000000..59d9268 --- /dev/null +++ b/src/components/ui/Frame/FrameFooter.vue @@ -0,0 +1,12 @@ + + + diff --git a/src/components/ui/Frame/FramePanel.vue b/src/components/ui/Frame/FramePanel.vue new file mode 100644 index 0000000..de635e4 --- /dev/null +++ b/src/components/ui/Frame/FramePanel.vue @@ -0,0 +1,20 @@ + + + diff --git a/src/components/ui/Frame/index.ts b/src/components/ui/Frame/index.ts new file mode 100644 index 0000000..336d038 --- /dev/null +++ b/src/components/ui/Frame/index.ts @@ -0,0 +1,3 @@ +export { default as Frame } from './Frame.vue' +export { default as FramePanel } from './FramePanel.vue' +export { default as FrameFooter } from './FrameFooter.vue' diff --git a/src/components/ui/Table/Table.vue b/src/components/ui/Table/Table.vue index f579d5f..55f59e9 100644 --- a/src/components/ui/Table/Table.vue +++ b/src/components/ui/Table/Table.vue @@ -2,12 +2,29 @@ import { cn } from '@/lib/utils' import type { HTMLAttributes } from 'vue' -const props = defineProps<{ class?: HTMLAttributes['class'] }>() +type TableVariant = 'default' | 'card' + +const props = withDefaults( + defineProps<{ class?: HTMLAttributes['class']; variant?: TableVariant }>(), + { variant: 'default' } +)