@urbicon-ui/table 6.1.4
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 +153 -0
- package/dist/cells/ActionButtons.svelte +224 -0
- package/dist/cells/ActionButtons.svelte.d.ts +74 -0
- package/dist/cells/CopyButton.svelte +89 -0
- package/dist/cells/CopyButton.svelte.d.ts +33 -0
- package/dist/cells/CustomCell.svelte +136 -0
- package/dist/cells/CustomCell.svelte.d.ts +44 -0
- package/dist/cells/DateCell.svelte +194 -0
- package/dist/cells/DateCell.svelte.d.ts +39 -0
- package/dist/cells/LinkCell.svelte +240 -0
- package/dist/cells/LinkCell.svelte.d.ts +42 -0
- package/dist/cells/NumberCell.svelte +225 -0
- package/dist/cells/NumberCell.svelte.d.ts +47 -0
- package/dist/cells/StatusBadge.svelte +121 -0
- package/dist/cells/StatusBadge.svelte.d.ts +44 -0
- package/dist/cells/UserAvatar.svelte +71 -0
- package/dist/cells/UserAvatar.svelte.d.ts +37 -0
- package/dist/cells/index.d.ts +8 -0
- package/dist/cells/index.js +9 -0
- package/dist/core/EmptyState.svelte +161 -0
- package/dist/core/EmptyState.svelte.d.ts +16 -0
- package/dist/core/ErrorState.svelte +158 -0
- package/dist/core/ErrorState.svelte.d.ts +15 -0
- package/dist/core/GroupedRow.svelte +239 -0
- package/dist/core/GroupedRow.svelte.d.ts +18 -0
- package/dist/core/LoadingState.svelte +75 -0
- package/dist/core/LoadingState.svelte.d.ts +14 -0
- package/dist/core/MobileCard.svelte +151 -0
- package/dist/core/MobileCard.svelte.d.ts +15 -0
- package/dist/core/TableCell.svelte +105 -0
- package/dist/core/TableCell.svelte.d.ts +14 -0
- package/dist/core/TableDesktop.svelte +480 -0
- package/dist/core/TableDesktop.svelte.d.ts +26 -0
- package/dist/core/TableHead.svelte +314 -0
- package/dist/core/TableHead.svelte.d.ts +7 -0
- package/dist/core/TableMobile.svelte +112 -0
- package/dist/core/TableMobile.svelte.d.ts +13 -0
- package/dist/core/TableProvider.svelte +271 -0
- package/dist/core/TableProvider.svelte.d.ts +40 -0
- package/dist/core/TableRow.svelte +171 -0
- package/dist/core/TableRow.svelte.d.ts +16 -0
- package/dist/core/index.d.ts +17 -0
- package/dist/core/index.js +14 -0
- package/dist/core/sticky-context.svelte.d.ts +48 -0
- package/dist/core/sticky-context.svelte.js +88 -0
- package/dist/core/table/Table.svelte +304 -0
- package/dist/core/table/Table.svelte.d.ts +26 -0
- package/dist/core/table/index.d.ts +448 -0
- package/dist/core/table/index.js +1 -0
- package/dist/core/table-style-context.d.ts +66 -0
- package/dist/core/table-style-context.js +26 -0
- package/dist/factories/ColumnValidation.d.ts +49 -0
- package/dist/factories/ColumnValidation.js +188 -0
- package/dist/factories/TableColumns.d.ts +97 -0
- package/dist/factories/TableColumns.js +262 -0
- package/dist/factories/TypedColumnBuilder.d.ts +41 -0
- package/dist/factories/TypedColumnBuilder.js +72 -0
- package/dist/factories/index.d.ts +12 -0
- package/dist/factories/index.js +13 -0
- package/dist/features/HeaderMenu.svelte +236 -0
- package/dist/features/HeaderMenu.svelte.d.ts +8 -0
- package/dist/features/LiveUpdateBanner.svelte +66 -0
- package/dist/features/LiveUpdateBanner.svelte.d.ts +6 -0
- package/dist/features/SearchHighlight.svelte +21 -0
- package/dist/features/SearchHighlight.svelte.d.ts +8 -0
- package/dist/features/SmartFilterBar/ChipsField.svelte +104 -0
- package/dist/features/SmartFilterBar/ChipsField.svelte.d.ts +5 -0
- package/dist/features/SmartFilterBar/ColumnVisibilityMenu.svelte +84 -0
- package/dist/features/SmartFilterBar/ColumnVisibilityMenu.svelte.d.ts +3 -0
- package/dist/features/SmartFilterBar/FilterMenu.svelte +367 -0
- package/dist/features/SmartFilterBar/FilterMenu.svelte.d.ts +3 -0
- package/dist/features/SmartFilterBar/GroupingMenu.svelte +82 -0
- package/dist/features/SmartFilterBar/GroupingMenu.svelte.d.ts +3 -0
- package/dist/features/SmartFilterBar/SmartFilterBar.svelte +109 -0
- package/dist/features/SmartFilterBar/SmartFilterBar.svelte.d.ts +11 -0
- package/dist/features/SmartFilterBar/SummaryMenu.svelte +118 -0
- package/dist/features/SmartFilterBar/SummaryMenu.svelte.d.ts +3 -0
- package/dist/features/SummaryRow.svelte +97 -0
- package/dist/features/SummaryRow.svelte.d.ts +8 -0
- package/dist/features/index.d.ts +4 -0
- package/dist/features/index.js +4 -0
- package/dist/i18n/index.d.ts +366 -0
- package/dist/i18n/index.js +21 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +41 -0
- package/dist/stores/TableStore.svelte.d.ts +192 -0
- package/dist/stores/TableStore.svelte.js +362 -0
- package/dist/stores/concerns/index.d.ts +15 -0
- package/dist/stores/concerns/index.js +14 -0
- package/dist/stores/concerns/types.d.ts +31 -0
- package/dist/stores/concerns/types.js +1 -0
- package/dist/stores/concerns/useColumnOrder.svelte.d.ts +16 -0
- package/dist/stores/concerns/useColumnOrder.svelte.js +81 -0
- package/dist/stores/concerns/useColumnVisibility.svelte.d.ts +16 -0
- package/dist/stores/concerns/useColumnVisibility.svelte.js +58 -0
- package/dist/stores/concerns/useExpansion.svelte.d.ts +9 -0
- package/dist/stores/concerns/useExpansion.svelte.js +32 -0
- package/dist/stores/concerns/useFiltering.svelte.d.ts +20 -0
- package/dist/stores/concerns/useFiltering.svelte.js +109 -0
- package/dist/stores/concerns/useFocusManagement.svelte.d.ts +15 -0
- package/dist/stores/concerns/useFocusManagement.svelte.js +52 -0
- package/dist/stores/concerns/useGrouping.svelte.d.ts +15 -0
- package/dist/stores/concerns/useGrouping.svelte.js +86 -0
- package/dist/stores/concerns/useLiveUpdates.svelte.d.ts +45 -0
- package/dist/stores/concerns/useLiveUpdates.svelte.js +175 -0
- package/dist/stores/concerns/usePagination.svelte.d.ts +18 -0
- package/dist/stores/concerns/usePagination.svelte.js +54 -0
- package/dist/stores/concerns/usePersistence.svelte.d.ts +36 -0
- package/dist/stores/concerns/usePersistence.svelte.js +167 -0
- package/dist/stores/concerns/useRemoteData.svelte.d.ts +21 -0
- package/dist/stores/concerns/useRemoteData.svelte.js +64 -0
- package/dist/stores/concerns/useSearch.svelte.d.ts +8 -0
- package/dist/stores/concerns/useSearch.svelte.js +16 -0
- package/dist/stores/concerns/useSelection.svelte.d.ts +21 -0
- package/dist/stores/concerns/useSelection.svelte.js +110 -0
- package/dist/stores/concerns/useSorting.svelte.d.ts +11 -0
- package/dist/stores/concerns/useSorting.svelte.js +70 -0
- package/dist/stores/concerns/useSummary.svelte.d.ts +18 -0
- package/dist/stores/concerns/useSummary.svelte.js +96 -0
- package/dist/stores/index.d.ts +1 -0
- package/dist/stores/index.js +1 -0
- package/dist/style/index.css +137 -0
- package/dist/style/index.d.ts +2 -0
- package/dist/style/index.js +2 -0
- package/dist/style/table-theme.css +131 -0
- package/dist/style/themes/comfortable.css +20 -0
- package/dist/style/themes/compact.css +20 -0
- package/dist/translations/de.d.ts +177 -0
- package/dist/translations/de.js +176 -0
- package/dist/translations/en.d.ts +177 -0
- package/dist/translations/en.js +176 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/tableTypes.d.ts +262 -0
- package/dist/types/tableTypes.js +1 -0
- package/dist/utils/index.d.ts +165 -0
- package/dist/utils/index.js +330 -0
- package/dist/utils/sticky-measure.d.ts +54 -0
- package/dist/utils/sticky-measure.js +107 -0
- package/dist/utils/virtualizer.d.ts +43 -0
- package/dist/utils/virtualizer.js +43 -0
- package/dist/variants/index.d.ts +11 -0
- package/dist/variants/index.js +15 -0
- package/dist/variants/table-cells.variants.d.ts +827 -0
- package/dist/variants/table-cells.variants.js +627 -0
- package/dist/variants/table-features.variants.d.ts +547 -0
- package/dist/variants/table-features.variants.js +412 -0
- package/dist/variants/table-states.variants.d.ts +594 -0
- package/dist/variants/table-states.variants.js +394 -0
- package/dist/variants/table.system.d.ts +301 -0
- package/dist/variants/table.system.js +314 -0
- package/dist/variants/table.variants.d.ts +428 -0
- package/dist/variants/table.variants.js +360 -0
- package/package.json +93 -0
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TABLE VARIANTS
|
|
3
|
+
* Variant definitions for the table component (see docs/MIGRATION-v5.md §3
|
|
4
|
+
* for the v4 → v5 appearance API).
|
|
5
|
+
*/
|
|
6
|
+
import { tv } from '@urbicon-ui/blocks';
|
|
7
|
+
import { TABLE_DIMENSIONS, TABLE_INDICATORS, TABLE_STATES } from './table.system';
|
|
8
|
+
/**
|
|
9
|
+
* TABLE HEADER VARIANTS
|
|
10
|
+
*/
|
|
11
|
+
export const tableHeaderVariants = tv({
|
|
12
|
+
slots: {
|
|
13
|
+
// No bg in base — the header reads via font-weight
|
|
14
|
+
// + bottom-hairline on the parent table; sticky mode below adds a bg
|
|
15
|
+
// so the header opaquely overlays scrolling rows.
|
|
16
|
+
// compatibility: old code used `header` instead of `row`
|
|
17
|
+
header: ['border-b border-border-hairline'],
|
|
18
|
+
row: [],
|
|
19
|
+
cell: [
|
|
20
|
+
'font-semibold text-text-secondary uppercase ',
|
|
21
|
+
'relative group',
|
|
22
|
+
'transition-[color,background-color,border-color,box-shadow,opacity] duration-[var(--blocks-duration-fast)]'
|
|
23
|
+
],
|
|
24
|
+
// compatibility: old code used `cellContent`
|
|
25
|
+
cellContent: ['flex items-center justify-between gap-2'],
|
|
26
|
+
content: ['flex items-center justify-between gap-2'],
|
|
27
|
+
// compatibility: old code used `titleContainer` and `titleContent`
|
|
28
|
+
titleContainer: ['flex items-center flex-1'],
|
|
29
|
+
titleContent: ['flex items-center space-x-2'],
|
|
30
|
+
title: ['flex items-center gap-2 flex-1'],
|
|
31
|
+
sortIcon: ['text-text-tertiary', 'transition-transform duration-[var(--blocks-duration-fast)]'],
|
|
32
|
+
indicators: ['flex items-center gap-1'],
|
|
33
|
+
// compatibility: additional action indicators under header
|
|
34
|
+
actionIndicators: [
|
|
35
|
+
'absolute bottom-0 left-0 right-0 h-0.5 flex',
|
|
36
|
+
'opacity-80 transition-opacity duration-[var(--blocks-duration-normal)] group-hover:opacity-100'
|
|
37
|
+
],
|
|
38
|
+
actionIndicatorBar: [
|
|
39
|
+
'flex-1 transition-[background-color,opacity] duration-[var(--blocks-duration-normal)]'
|
|
40
|
+
],
|
|
41
|
+
menu: [
|
|
42
|
+
'opacity-0 group-hover:opacity-100',
|
|
43
|
+
'transition-opacity duration-[var(--blocks-duration-fast)]'
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
variants: {
|
|
47
|
+
size: {
|
|
48
|
+
sm: {
|
|
49
|
+
cell: [TABLE_DIMENSIONS.padding.headerCell.sm, TABLE_DIMENSIONS.height.header.sm],
|
|
50
|
+
title: 'text-xs'
|
|
51
|
+
},
|
|
52
|
+
md: {
|
|
53
|
+
cell: [TABLE_DIMENSIONS.padding.headerCell.md, TABLE_DIMENSIONS.height.header.md],
|
|
54
|
+
title: 'text-sm'
|
|
55
|
+
},
|
|
56
|
+
lg: {
|
|
57
|
+
cell: [TABLE_DIMENSIONS.padding.headerCell.lg, TABLE_DIMENSIONS.height.header.lg],
|
|
58
|
+
title: 'text-base'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
align: {
|
|
62
|
+
left: {
|
|
63
|
+
content: 'justify-start',
|
|
64
|
+
title: 'justify-start'
|
|
65
|
+
},
|
|
66
|
+
center: {
|
|
67
|
+
content: 'justify-center',
|
|
68
|
+
title: 'justify-center'
|
|
69
|
+
},
|
|
70
|
+
right: {
|
|
71
|
+
content: 'justify-end',
|
|
72
|
+
title: 'justify-end flex-row-reverse'
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
sortable: {
|
|
76
|
+
true: {
|
|
77
|
+
cell: 'cursor-pointer hover:bg-surface-hover',
|
|
78
|
+
sortIcon: 'opacity-60'
|
|
79
|
+
},
|
|
80
|
+
false: {
|
|
81
|
+
sortIcon: 'hidden'
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
sorted: {
|
|
85
|
+
none: {
|
|
86
|
+
sortIcon: 'opacity-0'
|
|
87
|
+
},
|
|
88
|
+
asc: {
|
|
89
|
+
cell: TABLE_STATES.cell.sorted,
|
|
90
|
+
sortIcon: 'text-primary'
|
|
91
|
+
},
|
|
92
|
+
desc: {
|
|
93
|
+
cell: TABLE_STATES.cell.sorted,
|
|
94
|
+
sortIcon: 'text-primary'
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
// Sticky thead — pins the entire `<thead>` against the page scroll
|
|
98
|
+
// ancestor, offset by the toolbar height (if present).
|
|
99
|
+
sticky: {
|
|
100
|
+
true: {
|
|
101
|
+
header: [
|
|
102
|
+
'sticky z-20 bg-surface-elevated',
|
|
103
|
+
'top-[calc(var(--blocks-table-sticky-top,0px)+var(--blocks-table-toolbar-h,0px))]',
|
|
104
|
+
'data-[stuck=true]:shadow-[var(--blocks-shadow-md)]',
|
|
105
|
+
'transition-shadow duration-[var(--blocks-duration-fast)]'
|
|
106
|
+
],
|
|
107
|
+
row: 'bg-surface-elevated'
|
|
108
|
+
},
|
|
109
|
+
false: {}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
defaultVariants: {
|
|
113
|
+
size: 'md',
|
|
114
|
+
align: 'left',
|
|
115
|
+
sortable: false,
|
|
116
|
+
sorted: 'none',
|
|
117
|
+
sticky: false
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
/**
|
|
121
|
+
* HEADER INDICATOR VARIANTS
|
|
122
|
+
* Small dot indicators for filter/group/summary in header.
|
|
123
|
+
*/
|
|
124
|
+
export const headerIndicatorVariants = tv({
|
|
125
|
+
base: [
|
|
126
|
+
TABLE_INDICATORS.dot.base,
|
|
127
|
+
'transition-transform duration-[var(--blocks-duration-fast)] ease-out'
|
|
128
|
+
],
|
|
129
|
+
variants: {
|
|
130
|
+
type: {
|
|
131
|
+
filter: TABLE_INDICATORS.dot.intent.filter,
|
|
132
|
+
group: TABLE_INDICATORS.dot.intent.group,
|
|
133
|
+
summary: TABLE_INDICATORS.dot.intent.summary,
|
|
134
|
+
primary: TABLE_INDICATORS.dot.intent.primary,
|
|
135
|
+
success: TABLE_INDICATORS.dot.intent.success,
|
|
136
|
+
warning: TABLE_INDICATORS.dot.intent.warning,
|
|
137
|
+
danger: TABLE_INDICATORS.dot.intent.danger
|
|
138
|
+
},
|
|
139
|
+
size: {
|
|
140
|
+
xs: TABLE_INDICATORS.dot.size.xs,
|
|
141
|
+
sm: TABLE_INDICATORS.dot.size.sm,
|
|
142
|
+
md: TABLE_INDICATORS.dot.size.md,
|
|
143
|
+
lg: TABLE_INDICATORS.dot.size.lg
|
|
144
|
+
},
|
|
145
|
+
state: {
|
|
146
|
+
default: 'opacity-80',
|
|
147
|
+
hover: 'opacity-100 scale-110',
|
|
148
|
+
active: 'opacity-100 scale-125'
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
defaultVariants: {
|
|
152
|
+
type: 'filter',
|
|
153
|
+
size: 'sm',
|
|
154
|
+
state: 'default'
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
/**
|
|
158
|
+
* TABLE ROW VARIANTS
|
|
159
|
+
*/
|
|
160
|
+
export const tableRowVariants = tv({
|
|
161
|
+
slots: {
|
|
162
|
+
// Row dividers use a hairline (~8% alpha) instead of border-subtle.
|
|
163
|
+
// No explicit row bg — the surface tint is inherited from the
|
|
164
|
+
// scrollArea, depending on the appearance (see below).
|
|
165
|
+
row: [
|
|
166
|
+
'border-b border-border-hairline',
|
|
167
|
+
'last:border-b-0',
|
|
168
|
+
'transition-colors duration-[var(--blocks-duration-fast)]'
|
|
169
|
+
],
|
|
170
|
+
cell: ['text-text-primary', 'transition-colors duration-[var(--blocks-duration-fast)]']
|
|
171
|
+
},
|
|
172
|
+
variants: {
|
|
173
|
+
size: {
|
|
174
|
+
sm: {
|
|
175
|
+
row: TABLE_DIMENSIONS.height.row.sm,
|
|
176
|
+
cell: TABLE_DIMENSIONS.padding.cell.sm
|
|
177
|
+
},
|
|
178
|
+
md: {
|
|
179
|
+
row: TABLE_DIMENSIONS.height.row.md,
|
|
180
|
+
cell: TABLE_DIMENSIONS.padding.cell.md
|
|
181
|
+
},
|
|
182
|
+
lg: {
|
|
183
|
+
row: TABLE_DIMENSIONS.height.row.lg,
|
|
184
|
+
cell: TABLE_DIMENSIONS.padding.cell.lg
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
state: {
|
|
188
|
+
default: {
|
|
189
|
+
row: TABLE_STATES.row.hover
|
|
190
|
+
},
|
|
191
|
+
selected: {
|
|
192
|
+
row: TABLE_STATES.row.selected
|
|
193
|
+
},
|
|
194
|
+
expanded: {
|
|
195
|
+
row: TABLE_STATES.row.expanded
|
|
196
|
+
},
|
|
197
|
+
disabled: {
|
|
198
|
+
row: TABLE_STATES.row.disabled
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
interactive: {
|
|
202
|
+
true: {
|
|
203
|
+
row: 'cursor-pointer'
|
|
204
|
+
},
|
|
205
|
+
false: {}
|
|
206
|
+
},
|
|
207
|
+
striped: {
|
|
208
|
+
// The striped alternating color is `surface-quiet` (the quietest
|
|
209
|
+
// in-page tint), not `surface-subtle` (raised).
|
|
210
|
+
even: {
|
|
211
|
+
row: 'bg-surface-quiet'
|
|
212
|
+
},
|
|
213
|
+
odd: {}
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
compoundVariants: [
|
|
217
|
+
// Interactive + State combinations
|
|
218
|
+
{
|
|
219
|
+
interactive: true,
|
|
220
|
+
state: 'default',
|
|
221
|
+
class: {
|
|
222
|
+
row: 'hover:shadow-[var(--blocks-shadow-sm)] active:scale-[0.995]'
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
],
|
|
226
|
+
defaultVariants: {
|
|
227
|
+
size: 'md',
|
|
228
|
+
state: 'default',
|
|
229
|
+
interactive: false
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
/**
|
|
233
|
+
* TABLE CELL VARIANTS
|
|
234
|
+
*/
|
|
235
|
+
export const tableCellVariants = tv({
|
|
236
|
+
base: ['transition-colors duration-[var(--blocks-duration-fast)]'],
|
|
237
|
+
variants: {
|
|
238
|
+
align: {
|
|
239
|
+
left: 'text-left',
|
|
240
|
+
center: 'text-center',
|
|
241
|
+
right: 'text-right'
|
|
242
|
+
},
|
|
243
|
+
truncate: {
|
|
244
|
+
true: 'truncate max-w-xs',
|
|
245
|
+
false: ''
|
|
246
|
+
},
|
|
247
|
+
nowrap: {
|
|
248
|
+
true: 'whitespace-nowrap',
|
|
249
|
+
false: ''
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
defaultVariants: {
|
|
253
|
+
align: 'left',
|
|
254
|
+
truncate: false,
|
|
255
|
+
nowrap: false
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
/**
|
|
259
|
+
* TABLE CONTAINER VARIANTS
|
|
260
|
+
*
|
|
261
|
+
* Slot model (post-Sticky refactor):
|
|
262
|
+
* - `container`: outer flex-column wrapper, holds toolbar + scrollArea
|
|
263
|
+
* - `toolbar`: optional sticky toolbar layer (L1)
|
|
264
|
+
* - `scrollArea`: visible frame (border, radius, shadow, bg). NEVER sets `overflow`,
|
|
265
|
+
* so `position: sticky` children pin against the page scroll ancestor instead
|
|
266
|
+
* of being trapped by an `overflow` clip
|
|
267
|
+
* - `table`, `body`: rendered inside scrollArea
|
|
268
|
+
*
|
|
269
|
+
* Sticky-related properties consumed downstream:
|
|
270
|
+
* --blocks-table-sticky-top (consumer, default 0)
|
|
271
|
+
* --blocks-table-toolbar-h (set internally via ResizeObserver)
|
|
272
|
+
* --blocks-table-thead-h (set internally via ResizeObserver)
|
|
273
|
+
* --blocks-table-avail-top (set internally; container's document-top offset,
|
|
274
|
+
* consumed by the `contained` height cap)
|
|
275
|
+
*/
|
|
276
|
+
export const tableContainerVariants = tv({
|
|
277
|
+
slots: {
|
|
278
|
+
container: ['flex flex-col gap-2 w-full'],
|
|
279
|
+
// The toolbar inherits the scrollArea bg instead of setting its own
|
|
280
|
+
// surface-elevated — otherwise a flush table would show a visibly
|
|
281
|
+
// separated toolbar strip.
|
|
282
|
+
toolbar: ['transition-shadow duration-[var(--blocks-duration-fast)]'],
|
|
283
|
+
scrollArea: [],
|
|
284
|
+
table: ['w-full border-collapse'],
|
|
285
|
+
body: []
|
|
286
|
+
},
|
|
287
|
+
// Variant contract (see docs/MIGRATION-v5.md §3):
|
|
288
|
+
// flush → no frame, sits inline in the reading flow (Docs, Inline)
|
|
289
|
+
// surface → bg-surface-quiet, gentle in-page tinted zone
|
|
290
|
+
// framed → border + rounded-contain + shadow, standalone block
|
|
291
|
+
variants: {
|
|
292
|
+
appearance: {
|
|
293
|
+
flush: {
|
|
294
|
+
scrollArea: []
|
|
295
|
+
},
|
|
296
|
+
surface: {
|
|
297
|
+
scrollArea: ['bg-surface-quiet']
|
|
298
|
+
},
|
|
299
|
+
framed: {
|
|
300
|
+
scrollArea: [
|
|
301
|
+
'bg-surface-elevated border border-border-default',
|
|
302
|
+
'rounded-contain shadow-[var(--blocks-shadow-sm)]'
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
size: {
|
|
307
|
+
sm: {
|
|
308
|
+
container: 'gap-1',
|
|
309
|
+
table: 'text-xs'
|
|
310
|
+
},
|
|
311
|
+
md: {
|
|
312
|
+
container: 'gap-2',
|
|
313
|
+
table: 'text-sm'
|
|
314
|
+
},
|
|
315
|
+
lg: {
|
|
316
|
+
container: 'gap-3',
|
|
317
|
+
table: 'text-base'
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
responsive: {
|
|
321
|
+
true: {
|
|
322
|
+
table: 'min-w-[600px]'
|
|
323
|
+
},
|
|
324
|
+
false: {}
|
|
325
|
+
},
|
|
326
|
+
stickyToolbar: {
|
|
327
|
+
true: {
|
|
328
|
+
toolbar: [
|
|
329
|
+
'sticky z-30 bg-surface-elevated',
|
|
330
|
+
'top-[var(--blocks-table-sticky-top,0px)]',
|
|
331
|
+
'data-[stuck=true]:shadow-[var(--blocks-shadow-md)]'
|
|
332
|
+
]
|
|
333
|
+
},
|
|
334
|
+
false: {}
|
|
335
|
+
},
|
|
336
|
+
// `fit="viewport"` — the table becomes its own scroll container so wide/long
|
|
337
|
+
// lists scroll *within* the box (both axes) instead of pushing horizontal
|
|
338
|
+
// overflow onto the page. The container is height-capped to the viewport
|
|
339
|
+
// (minus its measured document-top offset in --blocks-table-avail-top), and
|
|
340
|
+
// flexbox keeps the toolbar + pagination (shrink-0) outside the scrolling
|
|
341
|
+
// `scrollArea`. The scrollArea is `flex-auto` (NOT `flex-1`/basis-0, which
|
|
342
|
+
// would collapse the box for short tables) + `min-h-0` so only the rows
|
|
343
|
+
// scroll. Desktop-only (md+); mobile keeps document-level scroll.
|
|
344
|
+
contained: {
|
|
345
|
+
true: {
|
|
346
|
+
container: ['md:max-h-[calc(100dvh-var(--blocks-table-avail-top,0px))]'],
|
|
347
|
+
scrollArea: ['md:min-h-0 md:flex-auto md:overflow-auto'],
|
|
348
|
+
toolbar: ['md:shrink-0']
|
|
349
|
+
},
|
|
350
|
+
false: {}
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
defaultVariants: {
|
|
354
|
+
appearance: 'flush',
|
|
355
|
+
size: 'md',
|
|
356
|
+
responsive: true,
|
|
357
|
+
stickyToolbar: false,
|
|
358
|
+
contained: false
|
|
359
|
+
}
|
|
360
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@urbicon-ui/table",
|
|
3
|
+
"version": "6.1.4",
|
|
4
|
+
"description": "Data table for Svelte 5 — sorting, filtering, grouping, selection, keyboard navigation, virtualization and live updates",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://codeberg.org/urbicon/ui.git",
|
|
9
|
+
"directory": "packages/table"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://ui.urbicon.de",
|
|
12
|
+
"bugs": "https://codeberg.org/urbicon/ui/issues",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"svelte",
|
|
15
|
+
"table",
|
|
16
|
+
"data-table",
|
|
17
|
+
"datagrid",
|
|
18
|
+
"virtualization"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "svelte-kit sync && svelte-package",
|
|
22
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
23
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
24
|
+
"clean": "rm -rf dist .svelte-kit",
|
|
25
|
+
"clean-all": "bun --bun run clean && rm -rf node_modules",
|
|
26
|
+
"dev": "svelte-package --watch",
|
|
27
|
+
"format": "biome format --write . && prettier --write \"**/*.svelte\"",
|
|
28
|
+
"lint": "biome check . && svelte-check --tsconfig ./tsconfig.json",
|
|
29
|
+
"package": "svelte-kit sync && svelte-package",
|
|
30
|
+
"preview": "vite preview",
|
|
31
|
+
"test": "vitest run",
|
|
32
|
+
"test:watch": "vitest"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"!dist/**/*.test.*",
|
|
37
|
+
"!dist/**/*.spec.*"
|
|
38
|
+
],
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"type": "module",
|
|
41
|
+
"main": "./dist/index.js",
|
|
42
|
+
"exports": {
|
|
43
|
+
".": {
|
|
44
|
+
"types": "./dist/index.d.ts",
|
|
45
|
+
"svelte": "./dist/index.js",
|
|
46
|
+
"default": "./dist/index.js"
|
|
47
|
+
},
|
|
48
|
+
"./style/index.css": "./dist/style/index.css",
|
|
49
|
+
"./style/table-theme.css": "./dist/style/table-theme.css",
|
|
50
|
+
"./style/themes/*": "./dist/style/themes/*",
|
|
51
|
+
"./i18n/en": {
|
|
52
|
+
"types": "./dist/translations/en.d.ts",
|
|
53
|
+
"import": "./dist/translations/en.js",
|
|
54
|
+
"default": "./dist/translations/en.js"
|
|
55
|
+
},
|
|
56
|
+
"./i18n/de": {
|
|
57
|
+
"types": "./dist/translations/de.d.ts",
|
|
58
|
+
"import": "./dist/translations/de.js",
|
|
59
|
+
"default": "./dist/translations/de.js"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"sideEffects": [
|
|
63
|
+
"./src/lib/style/**",
|
|
64
|
+
"./dist/style/**",
|
|
65
|
+
"./dist/i18n/index.js",
|
|
66
|
+
"./dist/i18n/index.d.ts"
|
|
67
|
+
],
|
|
68
|
+
"peerDependencies": {
|
|
69
|
+
"svelte": "^5.56.3",
|
|
70
|
+
"@sveltejs/kit": "^2.65.2",
|
|
71
|
+
"@urbicon-ui/blocks": "^6.0.0",
|
|
72
|
+
"@urbicon-ui/i18n": "^6.0.0",
|
|
73
|
+
"@urbicon-ui/shared-types": "^6.0.0"
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@sveltejs/kit": "^2.65.2",
|
|
77
|
+
"@sveltejs/package": "^2.5.8",
|
|
78
|
+
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
79
|
+
"@tailwindcss/vite": "^4.3.1",
|
|
80
|
+
"@urbicon-ui/blocks": "6.1.4",
|
|
81
|
+
"@urbicon-ui/i18n": "6.1.4",
|
|
82
|
+
"@urbicon-ui/shared-types": "6.1.4",
|
|
83
|
+
"prettier": "^3.8.4",
|
|
84
|
+
"prettier-plugin-svelte": "^4.1.1",
|
|
85
|
+
"prettier-plugin-tailwindcss": "^0.8.0",
|
|
86
|
+
"svelte": "^5.56.3",
|
|
87
|
+
"svelte-check": "^4.6.0",
|
|
88
|
+
"tailwindcss": "^4.3.1",
|
|
89
|
+
"typescript": "^6.0.3",
|
|
90
|
+
"vite": "^8.0.16",
|
|
91
|
+
"vitest": "^4.1.9"
|
|
92
|
+
}
|
|
93
|
+
}
|