@duro-app/ui 0.34.0 → 0.34.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Table/Table.d.ts.map +1 -1
- package/dist/components/Table/styles.css.d.ts +3 -1
- package/dist/components/Table/styles.css.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +563 -547
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Table/Table.tsx +19 -2
- package/src/components/Table/styles.css.ts +20 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duro-app/ui",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@duro-app/tokens": "^0.34.
|
|
56
|
+
"@duro-app/tokens": "^0.34.2"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@babel/preset-typescript": "^7.28.0",
|
|
@@ -121,7 +121,14 @@ function extractColumnMeta(children: ReactNode): {template: string; labels: stri
|
|
|
121
121
|
(unwrappedType as {name?: string} | null)?.name ||
|
|
122
122
|
''
|
|
123
123
|
if (unwrappedType === HeaderCell || displayName === 'HeaderCell') {
|
|
124
|
-
|
|
124
|
+
// Default to minmax(0, 1fr) instead of plain '1fr' so each column
|
|
125
|
+
// can shrink below its content's min-content size. A plain '1fr'
|
|
126
|
+
// track has an implicit min of `auto` (= min-content), which makes
|
|
127
|
+
// the column refuse to shrink and the whole table overflow when a
|
|
128
|
+
// cell's text is wider than 1/N of the container. With minmax(0,
|
|
129
|
+
// 1fr), the cell's compact-mode `min-width: 0` + `overflow:
|
|
130
|
+
// hidden` + `text-overflow: ellipsis` can actually truncate.
|
|
131
|
+
widths.push(props.width || 'minmax(0, 1fr)')
|
|
125
132
|
const explicit = typeof props.label === 'string' ? props.label : undefined
|
|
126
133
|
const fallback = extractText(props.children).trim()
|
|
127
134
|
const label = explicit ?? fallback
|
|
@@ -184,7 +191,17 @@ export function Root({
|
|
|
184
191
|
role="table"
|
|
185
192
|
style={[
|
|
186
193
|
styles.root,
|
|
187
|
-
|
|
194
|
+
// When responsive, use gridColumnsResponsive so the explicit column
|
|
195
|
+
// template and the stack-mode @container override live in one StyleX
|
|
196
|
+
// style object. Splitting them across two styles (gridColumns +
|
|
197
|
+
// rootResponsive) causes StyleX conflict resolution to drop the
|
|
198
|
+
// column template because rootResponsive's gridTemplateColumns key
|
|
199
|
+
// always wins as the later entry in the array.
|
|
200
|
+
template
|
|
201
|
+
? responsive
|
|
202
|
+
? styles.gridColumnsResponsive(template)
|
|
203
|
+
: styles.gridColumns(template)
|
|
204
|
+
: undefined,
|
|
188
205
|
responsive && styles.rootResponsive,
|
|
189
206
|
]}
|
|
190
207
|
>
|
|
@@ -60,13 +60,13 @@ export const styles = css.create({
|
|
|
60
60
|
},
|
|
61
61
|
|
|
62
62
|
// Stack-mode override: the Root's grid collapses to a single column so
|
|
63
|
-
// each Row spans full width and stacks vertically.
|
|
64
|
-
//
|
|
63
|
+
// each Row spans full width and stacks vertically.
|
|
64
|
+
// NOTE: gridTemplateColumns is intentionally absent here. It is handled by
|
|
65
|
+
// gridColumnsResponsive() so that StyleX conflict resolution does not remove
|
|
66
|
+
// the explicit column template (a later style with the same property key
|
|
67
|
+
// always wins, so combining gridColumns + rootResponsive in one array would
|
|
68
|
+
// silently drop the column template).
|
|
65
69
|
rootResponsive: {
|
|
66
|
-
gridTemplateColumns: {
|
|
67
|
-
default: null,
|
|
68
|
-
[`@container (max-width: ${STACK_BP})`]: '1fr',
|
|
69
|
-
},
|
|
70
70
|
// The card-list look needs the outer border to disappear in stack
|
|
71
71
|
// mode — each row paints its own border.
|
|
72
72
|
borderWidth: {
|
|
@@ -298,8 +298,21 @@ export const styles = css.create({
|
|
|
298
298
|
alignSelf: 'flex-start',
|
|
299
299
|
},
|
|
300
300
|
|
|
301
|
-
// Dynamic: grid columns applied on Root
|
|
301
|
+
// Dynamic: grid columns applied on Root (non-responsive path only).
|
|
302
302
|
gridColumns: (template: string) => ({
|
|
303
303
|
gridTemplateColumns: template,
|
|
304
304
|
}),
|
|
305
|
+
|
|
306
|
+
// Dynamic: grid columns + stack-mode collapse in one style.
|
|
307
|
+
// Used instead of gridColumns() when responsive=true so that both the
|
|
308
|
+
// explicit column template and the @container override live in the same
|
|
309
|
+
// StyleX style object. If they were in separate styles (gridColumns +
|
|
310
|
+
// rootResponsive), StyleX conflict resolution would keep only the LAST
|
|
311
|
+
// style's gridTemplateColumns class and silently discard the earlier one.
|
|
312
|
+
gridColumnsResponsive: (template: string) => ({
|
|
313
|
+
gridTemplateColumns: {
|
|
314
|
+
default: template,
|
|
315
|
+
[`@container (max-width: ${STACK_BP})`]: '1fr',
|
|
316
|
+
},
|
|
317
|
+
}),
|
|
305
318
|
})
|