@uni-design-system/uni-core 11.0.0 → 11.1.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @uni-design-system/uni-core
2
2
 
3
+ ## 11.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`d00b2fe`](https://github.com/uni-design-system/uni/commit/d00b2fee1ef456c546f4d2b0a479cb695962d7c9) Thanks [@gaenglish](https://github.com/gaenglish)! - Selection, hover and density become theme decisions on `uni-tag`, and add `uni-tag-group`.
8
+
9
+ `uni-tag` had the right axes but made the app do the work. `selected` painted nothing — it set `aria-pressed` and swapped the lead glyph — so every toggle chip in app markup carried a `[tone]="on() ? 'solid' : 'soft'"` of its own. Interactive chips had no hover state at all. The selected check was added rather than reserved, so picking a chip reflowed the whole row.
10
+
11
+ **Selection paints itself.** A selected chip adds a `tag-selected` class and an interactive one adds `tag-interactive`, both as much public theme contract as `&.tone-*` already was. The base theme's `tag` variants use them: selection promotes a chip to its role's solid pair at every tone (`solid` deepens instead of refilling), and `&.tag-interactive:hover` is a `brightness(0.95)` wash that darkens fill, ink and edge together. A theme restyling either writes the rules per variant, beside the colours they belong to.
12
+
13
+ **A toggle chip holds the check's place.** Bind `selected` and the chip reserves the glyph's footprint while unselected, so picking one never resizes it. A chip that already has a lead needs no slot — the check replaces the avatar or icon at identical width.
14
+
15
+ **`uni-tag-group`** is a row of chips the user picks from. It renders its own chips from `items` and owns the two things an app was otherwise wiring per chip: which one is selected (`value`, plus `multiple`) and which one holds the tab stop. Keyboard model is the toolbar pattern — one tab stop for the whole row, arrow keys within it, on both axes because the row wraps. `layout="justify"` stretches each filled row flush to both edges and leaves the last row at its natural widths, the way justified text leaves its last line alone. It is themed as **`tagGroup`** (`gap`, `rowGap`, `chipSize`, `chipTone`, `chipVariant`), layout only — every colour decision stays on the chips, so a group restyles with them.
16
+
17
+ **Visual changes to every existing chip**, including the chips inside `uni-tag-input`:
18
+ - A lead element and the remove control now **tuck into the rounded end** instead of starting where the radius ends — each sits concentric with the curve it is in, so a small status dot sits further in than a full lead box. A lead is balanced against, so the **label sits centred**; the tuck costs less than the old gutter did, so that balance is largely paid for rather than added. A remove control is not balanced against on its own, since it reads as an affordance rather than as content — a chip with nothing but a remove button keeps its gutter and simply tucks the glyph. A chip whose ends are too square to flow into (`borderRadius: 'xs'`) keeps the size token's gutter at both ends.
19
+ - The `tag` typeface drops from **weight 600 to 500**. Geometry is unchanged; what made these chips read louder than the ones they replaced was the weight, not the size.
20
+ - `border-color` and `filter` join the transition list, so an outline↔solid change fades its edge instead of snapping while the fill animates, and the hover wash fades in.
21
+
22
+ New `tag` theme option **`endInset`** (`number | 'auto'`) sets how far that tuck goes; `auto` derives it from the chip so the lead sits concentric with the cap. The `tag` size tokens now state `paddingInline` rather than a `padding` shorthand, since the chip reads that number back to balance the label — a theme still stating the shorthand is parsed as before.
23
+
24
+ `UniTagComponent` is now generic in its value (`UniTagComponent<T extends UniTagValue = UniTagValue>`), so `value`, `removed` and `activated` carry an app's own type and `$event` flows without a closure. The default type parameter leaves every existing use compiling unchanged.
25
+
3
26
  ## 11.0.0
4
27
 
5
28
  ### Major Changes
@@ -969,7 +969,7 @@ var BaseTypography = {
969
969
  fontFamily: "Red Hat Display",
970
970
  fontSize: 15,
971
971
  lineHeight: 20,
972
- fontWeight: 600
972
+ fontWeight: 500
973
973
  },
974
974
  input: {
975
975
  fontFamily: "Red Hat Display",
@@ -1102,14 +1102,26 @@ var SELECTION_ACCENTS = {
1102
1102
  var tagVariant = (c, role) => ({ [role]: {
1103
1103
  backgroundColor: c[`${role}-container`],
1104
1104
  color: c[`on-${role}-container`],
1105
- "&.tone-solid": {
1105
+ "&.tag-selected": {
1106
1106
  backgroundColor: c[role],
1107
1107
  color: c[`on-${role}`]
1108
1108
  },
1109
+ "&.tag-interactive:hover": { filter: "brightness(0.95)" },
1110
+ "&.tone-solid": {
1111
+ backgroundColor: c[role],
1112
+ color: c[`on-${role}`],
1113
+ "&.tag-selected": { filter: "brightness(0.9)" },
1114
+ "&.tag-selected.tag-interactive:hover": { filter: "brightness(0.85)" }
1115
+ },
1109
1116
  "&.tone-outline": {
1110
1117
  backgroundColor: "transparent",
1111
1118
  color: c[role],
1112
- borderColor: c[`on-${role}-container-border`] ?? c[role]
1119
+ borderColor: c[`on-${role}-container-border`] ?? c[role],
1120
+ "&.tag-selected": {
1121
+ backgroundColor: c[role],
1122
+ color: c[`on-${role}`],
1123
+ borderColor: c[role]
1124
+ }
1113
1125
  }
1114
1126
  } });
1115
1127
  var buildComponents = (c) => ({
@@ -1450,7 +1462,8 @@ var buildComponents = (c) => ({
1450
1462
  gap: "xs",
1451
1463
  removeIcon: "close",
1452
1464
  selectedIcon: "check",
1453
- motion: "control"
1465
+ motion: "control",
1466
+ endInset: "auto"
1454
1467
  },
1455
1468
  fixed: {
1456
1469
  display: "inline-flex",
@@ -1467,13 +1480,25 @@ var buildComponents = (c) => ({
1467
1480
  ghost: {
1468
1481
  backgroundColor: "transparent",
1469
1482
  color: c["on-background"],
1470
- "&.tone-solid": {
1483
+ "&.tag-selected": {
1471
1484
  backgroundColor: c["surface-variant"],
1472
1485
  color: c["on-surface-variant"]
1473
1486
  },
1487
+ "&.tag-interactive:hover": { filter: "brightness(0.95)" },
1488
+ "&.tone-solid": {
1489
+ backgroundColor: c["surface-variant"],
1490
+ color: c["on-surface-variant"],
1491
+ "&.tag-selected": { filter: "brightness(0.9)" },
1492
+ "&.tag-selected.tag-interactive:hover": { filter: "brightness(0.85)" }
1493
+ },
1474
1494
  "&.tone-outline": {
1475
1495
  backgroundColor: "transparent",
1476
- borderColor: c.outline
1496
+ borderColor: c.outline,
1497
+ "&.tag-selected": {
1498
+ backgroundColor: c["surface-variant"],
1499
+ color: c["on-surface-variant"],
1500
+ borderColor: c.outline
1501
+ }
1477
1502
  }
1478
1503
  },
1479
1504
  disabled: {
@@ -1493,20 +1518,31 @@ var buildComponents = (c) => ({
1493
1518
  sm: {
1494
1519
  height: 20,
1495
1520
  fontSize: 12,
1496
- padding: "0 8px"
1521
+ paddingInline: 8
1497
1522
  },
1498
1523
  md: {
1499
1524
  height: 24,
1500
1525
  fontSize: 13,
1501
- padding: "0 10px"
1526
+ paddingInline: 10
1502
1527
  },
1503
1528
  lg: {
1504
1529
  height: 32,
1505
1530
  fontSize: 15,
1506
- padding: "0 12px"
1531
+ paddingInline: 12
1507
1532
  }
1508
1533
  }
1509
1534
  },
1535
+ tagGroup: {
1536
+ options: {
1537
+ gap: "xs",
1538
+ rowGap: "xs"
1539
+ },
1540
+ fixed: {
1541
+ display: "flex",
1542
+ flexWrap: "wrap",
1543
+ alignItems: "center"
1544
+ }
1545
+ },
1510
1546
  tagInput: { options: {
1511
1547
  chipGap: "xs",
1512
1548
  chipSize: "md",