@uni-design-system/uni-angular 7.3.0 → 8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uni-design-system/uni-angular",
3
- "version": "7.3.0",
3
+ "version": "8.1.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,7 +22,7 @@
22
22
  "@angular/core": "^21.2.0",
23
23
  "@angular/forms": "^21.2.0",
24
24
  "@emotion/css": "^11.0.0",
25
- "@uni-design-system/uni-core": "^7.3.0"
25
+ "@uni-design-system/uni-core": "^8.1.0"
26
26
  },
27
27
  "module": "fesm2022/uni-design-system-uni-angular.mjs",
28
28
  "typings": "types/uni-design-system-uni-angular.d.ts",
@@ -644,6 +644,23 @@ var BaseIcons = {
644
644
  logout: "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3e%3cpath d='M212.31-140Q182-140 161-161q-21-21-21-51.31v-535.38Q140-778 161-799q21-21 51.31-21h268.07v60H212.31q-4.62 0-8.46 3.85-3.85 3.84-3.85 8.46v535.38q0 4.62 3.85 8.46 3.84 3.85 8.46 3.85h268.07v60H212.31Zm436.92-169.23-41.54-43.39L705.08-450H363.85v-60h341.23l-97.39-97.38 41.54-43.39L820-480 649.23-309.23Z'/%3e%3c/svg%3e",
645
645
  spinner: "data:image/svg+xml;charset=UTF-8,%3csvg stroke='%23000' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' %3e%3cstyle%3e .oui_spinner %7b transform-origin: center; animation: rotate_360 2s linear infinite;%7d .oui_spinner circle %7b stroke-linecap: round; animation: dash 1.5s ease-in-out infinite;%7d %40keyframes rotate_360 %7b 100%25 %7b transform: rotate(360deg);%7d %7d %40keyframes dash %7b 0%25 %7b stroke-dasharray: 0 150; stroke-dashoffset: 0;%7d 47.5%25 %7b stroke-dasharray: 42 150; stroke-dashoffset: -16;%7d 95%25, 100%25 %7b stroke-dasharray: 42 150; stroke-dashoffset: -59;%7d %7d %3c/style%3e%3cg class='oui_spinner'%3e%3ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3'%3e%3c/circle%3e%3c/g%3e%3c/svg%3e "
646
646
  };
647
+ /**
648
+ * The highlight state for roving-focus composites (menus, and any other widget
649
+ * that moves focus programmatically): pointer hover, or focus the user drove
650
+ * from the keyboard.
651
+ *
652
+ * Why not plain `:focus` — a roving-focus composite calls `.focus()` on an item
653
+ * every time it opens, including pointer opens, and `:focus` would paint that
654
+ * as a highlight the mouse user never asked for, reading as a preselected
655
+ * item. `:focus-visible` excludes programmatic focus that follows a click while
656
+ * still matching keyboard navigation.
657
+ *
658
+ * Shared as a constant because Emotion merges styles by **exact selector
659
+ * text**: a component's base rule and any theme variant restyling that rule
660
+ * must key both with this value, or the variant silently fails to override and
661
+ * reintroduces the phantom highlight.
662
+ */
663
+ var HOVER_OR_KEYBOARD_FOCUS = "&:hover, &:focus-visible";
647
664
  var BaseTypography = {
648
665
  "display-large": {
649
666
  fontFamily: "Red Hat Display",
@@ -840,6 +857,25 @@ var buildBorders = (c) => ({
840
857
  dark: `1px solid ${c["on-background"]}`,
841
858
  dotted: `1px dotted ${c["on-background"]}`
842
859
  });
860
+ /**
861
+ * One tag colour role across all three tones. `soft` is the resting look (the
862
+ * container pair), `solid` fills with the role itself, `outline` keeps the
863
+ * surface and draws the edge — so every role stays consistent and a theme can
864
+ * still override any single cell.
865
+ */
866
+ var tagVariant = (c, role) => ({ [role]: {
867
+ backgroundColor: c[`${role}-container`],
868
+ color: c[`on-${role}-container`],
869
+ "&.tone-solid": {
870
+ backgroundColor: c[role],
871
+ color: c[`on-${role}`]
872
+ },
873
+ "&.tone-outline": {
874
+ backgroundColor: "transparent",
875
+ color: c[role],
876
+ borderColor: c[`on-${role}-container-border`] ?? c[role]
877
+ }
878
+ } });
843
879
  var buildComponents = (c) => ({
844
880
  alert: { options: {
845
881
  topPosition: 40,
@@ -941,12 +977,15 @@ var buildComponents = (c) => ({
941
977
  } },
942
978
  checkbox: { options: {
943
979
  size: 20,
944
- boxColor: "surface"
980
+ boxColor: "surface",
981
+ borderRadius: 2,
982
+ focusRingGap: 2
945
983
  } },
946
984
  radio: { options: {
947
985
  size: 20,
948
986
  ringColor: "outline",
949
- fillColor: "surface"
987
+ fillColor: "surface",
988
+ transitionSpeed: .3
950
989
  } },
951
990
  dialog: { options: {
952
991
  borderRadius: "lg",
@@ -1010,7 +1049,7 @@ var buildComponents = (c) => ({
1010
1049
  },
1011
1050
  variants: { warn: {
1012
1051
  color: c.warn,
1013
- "&:hover, &:focus": {
1052
+ [HOVER_OR_KEYBOARD_FOCUS]: {
1014
1053
  backgroundColor: c["warn-container"],
1015
1054
  color: c["on-warn-container"]
1016
1055
  }
@@ -1064,6 +1103,129 @@ var buildComponents = (c) => ({
1064
1103
  focusOutlineOffset: 2
1065
1104
  } },
1066
1105
  badge: { options: { borderRadius: "xxs" } },
1106
+ tag: {
1107
+ options: {
1108
+ borderRadius: "max",
1109
+ typeface: "tag",
1110
+ gap: "xs",
1111
+ removeIcon: "close",
1112
+ selectedIcon: "check"
1113
+ },
1114
+ fixed: {
1115
+ display: "inline-flex",
1116
+ alignItems: "center",
1117
+ maxWidth: "100%",
1118
+ border: "1px solid transparent",
1119
+ transition: "background-color .2s ease, color .2s ease"
1120
+ },
1121
+ variants: {
1122
+ ...tagVariant(c, "primary"),
1123
+ ...tagVariant(c, "secondary"),
1124
+ ...tagVariant(c, "tertiary"),
1125
+ ...tagVariant(c, "warn"),
1126
+ ...tagVariant(c, "success"),
1127
+ ghost: {
1128
+ backgroundColor: "transparent",
1129
+ color: c["on-background"],
1130
+ "&.tone-solid": {
1131
+ backgroundColor: c["surface-variant"],
1132
+ color: c["on-surface-variant"]
1133
+ },
1134
+ "&.tone-outline": {
1135
+ backgroundColor: "transparent",
1136
+ borderColor: c.outline
1137
+ }
1138
+ },
1139
+ disabled: {
1140
+ backgroundColor: c["disabled-container"],
1141
+ color: c["on-disabled"],
1142
+ "&.tone-solid": {
1143
+ backgroundColor: c.disabled,
1144
+ color: c["on-disabled"]
1145
+ },
1146
+ "&.tone-outline": {
1147
+ backgroundColor: "transparent",
1148
+ borderColor: c.disabled
1149
+ }
1150
+ }
1151
+ },
1152
+ sizes: {
1153
+ sm: {
1154
+ height: 20,
1155
+ fontSize: 12,
1156
+ padding: "0 8px"
1157
+ },
1158
+ md: {
1159
+ height: 24,
1160
+ fontSize: 13,
1161
+ padding: "0 10px"
1162
+ },
1163
+ lg: {
1164
+ height: 32,
1165
+ fontSize: 15,
1166
+ padding: "0 12px"
1167
+ }
1168
+ }
1169
+ },
1170
+ tagInput: { options: {
1171
+ chipGap: "xs",
1172
+ chipSize: "md",
1173
+ minInputWidth: "12ch",
1174
+ listColor: "primary-surface",
1175
+ listShadow: "menu",
1176
+ listBorderRadius: "xs",
1177
+ maxSuggestions: 8
1178
+ } },
1179
+ calendar: {
1180
+ options: {
1181
+ dayBorderRadius: "max",
1182
+ typeface: "label",
1183
+ gap: "xxs",
1184
+ navPrevSymbol: "chevron_left",
1185
+ navNextSymbol: "chevron_right",
1186
+ weekdayFormat: "short",
1187
+ showOutsideDays: false,
1188
+ todayStyle: "outline"
1189
+ },
1190
+ fixed: {
1191
+ display: "inline-block",
1192
+ userSelect: "none"
1193
+ },
1194
+ sizes: {
1195
+ sm: {
1196
+ width: 28,
1197
+ height: 28,
1198
+ fontSize: 12
1199
+ },
1200
+ md: {
1201
+ width: 34,
1202
+ height: 34,
1203
+ fontSize: 13
1204
+ },
1205
+ lg: {
1206
+ width: 40,
1207
+ height: 40,
1208
+ fontSize: 15
1209
+ }
1210
+ }
1211
+ },
1212
+ dateInput: { options: {
1213
+ toggleSymbol: "calendar_month",
1214
+ popupShadow: "menu",
1215
+ popupBorderRadius: "xs",
1216
+ popupColor: "primary-surface"
1217
+ } },
1218
+ timeInput: { options: {
1219
+ toggleSymbol: "schedule",
1220
+ listColor: "primary-surface",
1221
+ listShadow: "menu",
1222
+ listBorderRadius: "xs",
1223
+ maxVisibleOptions: 7
1224
+ } },
1225
+ dateTimeInput: { options: {
1226
+ partGap: "sm",
1227
+ dividerColor: "outline"
1228
+ } },
1067
1229
  button: {
1068
1230
  options: {
1069
1231
  borderRadius: "max",
@@ -1367,14 +1529,14 @@ var buildComponents = (c) => ({
1367
1529
  typeface: "label"
1368
1530
  } }
1369
1531
  });
1370
- var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
1532
+ var isRecord$1 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
1371
1533
  var deepMerge = (base, override) => {
1372
1534
  if (!override) return base;
1373
1535
  const out = { ...base };
1374
- for (const [key, value] of Object.entries(override)) out[key] = isRecord(value) && isRecord(out[key]) ? deepMerge(out[key], value) : value;
1536
+ for (const [key, value] of Object.entries(override)) out[key] = isRecord$1(value) && isRecord$1(out[key]) ? deepMerge(out[key], value) : value;
1375
1537
  return out;
1376
1538
  };
1377
- var createTheme = ({ id, name, colors, icons = {}, radii = BaseRadii, shadows = BaseShadows, borders, components }) => ({
1539
+ var createTheme = ({ id, name, colors, icons = {}, radii = BaseRadii, shadows = BaseShadows, borders, thicknesses, components }) => ({
1378
1540
  id,
1379
1541
  name,
1380
1542
  colors,
@@ -1383,7 +1545,10 @@ var createTheme = ({ id, name, colors, icons = {}, radii = BaseRadii, shadows =
1383
1545
  radii,
1384
1546
  shadows,
1385
1547
  spacing: BaseSpacing,
1386
- thicknesses: BaseThicknesses,
1548
+ thicknesses: {
1549
+ ...BaseThicknesses,
1550
+ ...thicknesses
1551
+ },
1387
1552
  icons: {
1388
1553
  ...BaseIcons,
1389
1554
  ...icons
@@ -1519,6 +1684,11 @@ var generateThemes = (input) => {
1519
1684
  }
1520
1685
  };
1521
1686
  };
1687
+ /**
1688
+ * One-line human summary of a {@link ContrastReport}. Shared so the generated
1689
+ * theme file's header and the MCP's theme tools report identical wording.
1690
+ */
1691
+ var summarizeContrast = (report) => `${report.checks.length} contrast pairs checked · worst ${report.worstRatio}:1 · ${report.pass ? "all AA" : `${report.checks.filter((check) => !check.pass).length} failing`}`;
1522
1692
  var IDENT = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
1523
1693
  var asKey = (k) => IDENT.test(k) ? k : `'${k}'`;
1524
1694
  var recordLiteral = (record, indent) => Object.entries(record).map(([k, v]) => `${indent}${asKey(k)}: '${v}',`).join("\n");
@@ -1573,7 +1743,7 @@ var emitThemeFile = (input) => {
1573
1743
  input.shape && `--shape=${input.shape}`,
1574
1744
  !darkMode && "--dark-mode=false"
1575
1745
  ].filter(Boolean).join(" ");
1576
- const reportSummary = `${report.checks.length} contrast pairs checked · worst ${report.worstRatio}:1 · ${report.pass ? "all AA" : `${report.checks.filter((c) => !c.pass).length} failing`}`;
1746
+ const reportSummary = summarizeContrast(report);
1577
1747
  const modes = [{
1578
1748
  exportName: `${id}Light`,
1579
1749
  displayName: `${name} Light`,
@@ -1754,7 +1924,7 @@ var UniThemes = {
1754
1924
  Object.keys(UniThemes)[0];
1755
1925
  //#endregion
1756
1926
  //#region package.json
1757
- var version = "7.3.0";
1927
+ var version = "8.1.0";
1758
1928
  //#endregion
1759
1929
  //#region schematics-src/ng-add/transforms.ts
1760
1930
  var addDependencies = (packageJsonText, deps) => {