@duro-app/ui 0.34.2 → 0.34.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duro-app/ui",
3
- "version": "0.34.2",
3
+ "version": "0.34.4",
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.2"
56
+ "@duro-app/tokens": "^0.34.4"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@babel/preset-typescript": "^7.28.0",
@@ -159,8 +159,15 @@ export const styles = css.create({
159
159
  },
160
160
  },
161
161
 
162
- // Body cell. In compact mode: nowrap + truncate. In stack mode:
163
- // becomes a 2-column grid for label / value.
162
+ // Body cell. Text wraps by default — preferring "wrap to a 2nd line" over
163
+ // "truncate with ellipsis" matches BI/data-reporting conventions where
164
+ // hiding content (even with a visual hint) is treated as data loss.
165
+ // Consumers that explicitly want single-line truncation use Text's
166
+ // `truncate` prop, which sets its own nowrap + overflow + ellipsis chain
167
+ // on the Text element itself. Buttons and badges already enforce
168
+ // `white-space: nowrap` internally, so they're unaffected by this
169
+ // default. In stack mode the cell becomes a 2-column grid for
170
+ // label / value.
164
171
  cell: {
165
172
  color: colors.text,
166
173
  display: {
@@ -169,22 +176,20 @@ export const styles = css.create({
169
176
  },
170
177
  alignItems: 'center',
171
178
  minWidth: {
179
+ // Allow the cell to shrink inside its grid track. In default (wide)
180
+ // mode there's enough room so `auto` is fine; in compact and stack
181
+ // we explicitly drop to 0 so wrappable content can size to the
182
+ // track instead of forcing the track to grow.
172
183
  default: 'auto',
173
184
  [`@container (max-width: ${COMPACT_BP})`]: 0,
174
185
  },
175
186
  overflow: {
187
+ // Safety against pathological unbreakable content (long URLs,
188
+ // dataless ids) at narrow widths.
176
189
  default: 'visible',
177
190
  [`@container (max-width: ${COMPACT_BP})`]: 'hidden',
178
191
  },
179
- textOverflow: {
180
- default: 'clip',
181
- [`@container (max-width: ${COMPACT_BP})`]: 'ellipsis',
182
- },
183
- whiteSpace: {
184
- default: 'normal',
185
- [`@container (max-width: ${COMPACT_BP})`]: 'nowrap',
186
- [`@container (max-width: ${STACK_BP})`]: 'normal',
187
- },
192
+ whiteSpace: 'normal',
188
193
  gridTemplateColumns: {
189
194
  default: null,
190
195
  [`@container (max-width: ${STACK_BP})`]: '1fr 2fr',
@@ -48,10 +48,14 @@ export const styles = css.create({
48
48
  textAlign: 'end',
49
49
  },
50
50
 
51
- // Truncate
51
+ // Truncate. minWidth: 0 lets a truncating Text actually shrink inside a
52
+ // flex/grid container — without it, the default `min-width: auto` would
53
+ // keep the element at its content width, so text-overflow: ellipsis would
54
+ // never trigger and the text would just overflow the parent instead.
52
55
  truncate: {
53
56
  overflow: 'hidden',
54
57
  textOverflow: 'ellipsis',
55
58
  whiteSpace: 'nowrap',
59
+ minWidth: 0,
56
60
  },
57
61
  })