@uni-design-system/uni-angular 5.0.0 → 5.2.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": "5.0.0",
3
+ "version": "5.2.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": "5.0.0"
25
+ "@uni-design-system/uni-core": "^5.2.0"
26
26
  },
27
27
  "module": "fesm2022/uni-design-system-uni-angular.mjs",
28
28
  "typings": "types/uni-design-system-uni-angular.d.ts",
@@ -520,6 +520,41 @@ var generateColors = (config) => {
520
520
  * `generateThemes()` for the light+dark pair plus a {@link ContrastReport}.
521
521
  */
522
522
  var generatePalette = (config) => generateColors(config);
523
+ var rgba = (hex, alpha) => {
524
+ const { red, green, blue } = hexToRgb(hex);
525
+ return `rgba(${red}, ${green}, ${blue}, ${alpha})`;
526
+ };
527
+ /**
528
+ * Brand-tinted, theme-scoped elevation shadows (PRD §3.5.C).
529
+ *
530
+ * Light mode replaces the dead-neutral black stacks with a shadow ink pulled
531
+ * toward the brand hue — dark and low-chroma enough to read as shadow, tinted
532
+ * enough to kill the grey "mud" where shadows meet brand surfaces. Dark mode
533
+ * goes near-zero: elevation is carried by the surface lightness steps, with
534
+ * only a faint veil kept on floating overlays (menus/dialogs genuinely need
535
+ * separation) and the `warn` glow tinted by the theme's own error color.
536
+ */
537
+ var generateShadows = (colors, mode = "light") => {
538
+ const error = colors["error"] ?? "#CC2827";
539
+ if (mode === "dark") return {
540
+ raised: "none",
541
+ menu: `0px 4px 12px ${rgba("#000000", .45)}`,
542
+ dialog: `0px 8px 28px ${rgba("#000000", .55)}`,
543
+ warn: `0 0 5px ${rgba(error, .55)}, inset 0 0 5px ${rgba(error, .35)}`
544
+ };
545
+ const { h } = hexToOklch(colors["primary"] ?? "#000000");
546
+ const ink = oklchToHex({
547
+ l: .22,
548
+ c: .035,
549
+ h
550
+ });
551
+ return {
552
+ raised: `${rgba(ink, .2)} 0px 2px 1px -1px, ${rgba(ink, .14)} 0px 1px 1px 0px, ${rgba(ink, .12)} 0px 1px 3px 0px`,
553
+ menu: `${rgba(ink, .2)} 0px 3px 3px -2px, ${rgba(ink, .14)} 0px 3px 4px 0px, ${rgba(ink, .12)} 0px 1px 8px 0px`,
554
+ dialog: `${rgba(ink, .2)} 0px 3px 5px -1px, ${rgba(ink, .14)} 0px 6px 10px 0px, ${rgba(ink, .12)} 0px 1px 18px 0px`,
555
+ warn: `0 0 5px ${rgba(error, .5)}, inset 0 0 5px ${rgba(error, .3)}`
556
+ };
557
+ };
523
558
  var BaseTypography = {
524
559
  "display-large": {
525
560
  fontFamily: "Red Hat Display",
@@ -716,6 +751,90 @@ var buildComponents = (c) => ({
716
751
  transitionSpeed: .35,
717
752
  elevation: "md"
718
753
  } },
754
+ breadcrumb: { options: {
755
+ typeface: "label",
756
+ color: "on-background-variant",
757
+ currentColor: "on-background",
758
+ separatorSymbol: "chevron_right",
759
+ gap: "xs"
760
+ } },
761
+ appBar: { options: {
762
+ color: "surface",
763
+ height: 56,
764
+ divider: "light",
765
+ typeface: "title-large",
766
+ padding: "md",
767
+ gap: "md",
768
+ elevation: void 0
769
+ } },
770
+ drawer: { options: {
771
+ color: "surface",
772
+ width: 280,
773
+ divider: "light",
774
+ elevation: "menu",
775
+ padding: "md",
776
+ backdrop: { background: "rgba(0, 0, 0, 0.4)" }
777
+ } },
778
+ avatar: {
779
+ options: {
780
+ borderRadius: "max",
781
+ typeface: "subtitle-2",
782
+ fallbackSymbol: "person"
783
+ },
784
+ variants: {
785
+ primary: {
786
+ backgroundColor: c["primary-container"],
787
+ color: c["on-primary-container"]
788
+ },
789
+ secondary: {
790
+ backgroundColor: c["secondary-container"],
791
+ color: c["on-secondary-container"]
792
+ },
793
+ tertiary: {
794
+ backgroundColor: c["tertiary-container"],
795
+ color: c["on-tertiary-container"]
796
+ },
797
+ quaternary: {
798
+ backgroundColor: c["surface-variant"],
799
+ color: c["on-surface-variant"]
800
+ },
801
+ warn: {
802
+ backgroundColor: c["warn-container"],
803
+ color: c["on-warn-container"]
804
+ },
805
+ success: {
806
+ backgroundColor: c["success-container"],
807
+ color: c["on-success-container"]
808
+ }
809
+ },
810
+ sizes: {
811
+ sm: {
812
+ height: 24,
813
+ width: 24,
814
+ fontSize: 10
815
+ },
816
+ md: {
817
+ height: 32,
818
+ width: 32,
819
+ fontSize: 13
820
+ },
821
+ lg: {
822
+ height: 40,
823
+ width: 40,
824
+ fontSize: 16
825
+ },
826
+ xl: {
827
+ height: 56,
828
+ width: 56,
829
+ fontSize: 22
830
+ }
831
+ }
832
+ },
833
+ avatarGroup: { options: {
834
+ overlap: "sm",
835
+ ringColor: "surface",
836
+ ringWidth: 2
837
+ } },
719
838
  checkbox: { options: { size: 20 } },
720
839
  dialog: { options: {
721
840
  borderRadius: "lg",
@@ -764,6 +883,22 @@ var buildComponents = (c) => ({
764
883
  focusOutline: `2px solid ${c.primary}`,
765
884
  focusOutlineOffset: 2
766
885
  } },
886
+ textarea: { options: {
887
+ rows: 3,
888
+ resize: "vertical"
889
+ } },
890
+ tabs: { options: {
891
+ typeface: "title-small",
892
+ textColor: "on-surface-variant",
893
+ activeTextColor: "primary",
894
+ indicatorColor: "primary",
895
+ indicatorThickness: "standard",
896
+ divider: "light",
897
+ gap: "sm",
898
+ borderRadius: "none",
899
+ padding: "md",
900
+ activeColor: void 0
901
+ } },
767
902
  multiSelectDropdown: { options: {
768
903
  textRole: "input",
769
904
  textColor: "on-primary-surface",
@@ -775,13 +910,16 @@ var buildComponents = (c) => ({
775
910
  } },
776
911
  badge: { options: { borderRadius: "xxs" } },
777
912
  button: {
913
+ options: {
914
+ borderRadius: "max",
915
+ typeface: "button"
916
+ },
778
917
  fixed: {
779
918
  position: "relative",
780
919
  overflow: "hidden",
781
920
  outline: "0",
782
921
  border: "0",
783
922
  cursor: "pointer",
784
- fontFamily: "Euphemia, sans-serif",
785
923
  transition: "all 0.28s ease"
786
924
  },
787
925
  variants: {
@@ -832,33 +970,29 @@ var buildComponents = (c) => ({
832
970
  sizes: {
833
971
  sm: {
834
972
  height: 22,
835
- borderRadius: 11,
836
973
  fontSize: 12,
837
974
  padding: "0 12px",
838
- fontFamily: "Euphemia Bold, sans-serif",
839
975
  fontWeight: 600
840
976
  },
841
977
  md: {
842
978
  height: 26,
843
- borderRadius: 13,
844
979
  fontSize: 16,
845
980
  padding: "0 16px"
846
981
  },
847
982
  lg: {
848
983
  height: 36,
849
- borderRadius: 18,
850
984
  fontSize: 18,
851
985
  padding: "0 18px"
852
986
  },
853
987
  xl: {
854
988
  height: 48,
855
- borderRadius: 24,
856
989
  fontSize: 24,
857
990
  padding: "0 22px"
858
991
  }
859
992
  }
860
993
  },
861
994
  iconButton: {
995
+ options: { borderRadius: "max" },
862
996
  variants: {
863
997
  ghost: {
864
998
  backgroundColor: "transparent",
@@ -924,23 +1058,23 @@ var buildComponents = (c) => ({
924
1058
  fixed: { textFill: c["on-background"] },
925
1059
  variants: {
926
1060
  primary: {
927
- backgroundColor: "#b3d4ea",
1061
+ backgroundColor: c["primary-container"],
928
1062
  color: c.primary
929
1063
  },
930
1064
  secondary: {
931
- backgroundColor: "#b3e7c2",
1065
+ backgroundColor: c["secondary-container"],
932
1066
  color: c.secondary
933
1067
  },
934
1068
  tertiary: {
935
- backgroundColor: "#ffe2b3",
1069
+ backgroundColor: c["tertiary-container"],
936
1070
  color: c.tertiary
937
1071
  },
938
1072
  warn: {
939
- backgroundColor: "#ffc2b3",
1073
+ backgroundColor: c["warn-container"],
940
1074
  color: c.warn
941
1075
  },
942
1076
  success: {
943
- backgroundColor: "#b3e7c2",
1077
+ backgroundColor: c["success-container"],
944
1078
  color: c.success
945
1079
  }
946
1080
  },
@@ -952,33 +1086,10 @@ var buildComponents = (c) => ({
952
1086
  }
953
1087
  },
954
1088
  card: {
1089
+ options: { borderRadius: "xs" },
955
1090
  fixed: {
956
- borderStyle: "solid",
957
- borderWidth: "1px",
958
- borderRadius: "8px",
959
- overflow: "hidden"
960
- },
961
- variants: {
962
- primary: {
963
- borderColor: c.primary,
964
- backgroundColor: c.background
965
- },
966
- secondary: {
967
- borderColor: c.secondary,
968
- backgroundColor: c.background
969
- },
970
- tertiary: {
971
- borderColor: c.tertiary,
972
- backgroundColor: c.background
973
- },
974
- warn: {
975
- borderColor: c.warn,
976
- backgroundColor: c.background
977
- },
978
- success: {
979
- borderColor: c.success,
980
- backgroundColor: c.background
981
- }
1091
+ overflow: "hidden",
1092
+ backgroundColor: c.background
982
1093
  }
983
1094
  },
984
1095
  cardHeader: {
@@ -1049,6 +1160,21 @@ var buildComponents = (c) => ({
1049
1160
  currentPageBorder: "light",
1050
1161
  currentPageBorderRadius: "xs"
1051
1162
  } },
1163
+ slider: { options: {
1164
+ color: "primary",
1165
+ trackColor: "surface-variant",
1166
+ borderRadius: "max",
1167
+ trackHeight: 4,
1168
+ thumbSize: 16
1169
+ } },
1170
+ skeleton: { options: {
1171
+ color: "surface-variant",
1172
+ highlightColor: "surface",
1173
+ borderRadius: "xs",
1174
+ animation: "shimmer",
1175
+ duration: 1.4,
1176
+ gap: "sm"
1177
+ } },
1052
1178
  snackbar: { options: {
1053
1179
  bottomPosition: 40,
1054
1180
  transitionDelay: "0.35s",
@@ -1209,6 +1335,8 @@ var generateThemes = (input) => {
1209
1335
  lightColors,
1210
1336
  darkColors,
1211
1337
  radii: input.shape ? ShapeRadii[input.shape] : void 0,
1338
+ lightShadows: generateShadows(lightColors, "light"),
1339
+ darkShadows: generateShadows(darkColors, "dark"),
1212
1340
  report: {
1213
1341
  checks,
1214
1342
  worstRatio,
@@ -1227,24 +1355,25 @@ var bordersLiteral = () => [
1227
1355
  " * shared token picks up the change.",
1228
1356
  " */",
1229
1357
  "const borders = (colors: Colors): Borders => ({",
1230
- " primary: `1px solid ${colors.primary}`,",
1231
- " secondary: `1px solid ${colors.secondary}`,",
1232
- " tertiary: `1px solid ${colors.tertiary}`,",
1233
- " quaternary: `1px solid ${colors.quaternary}`,",
1234
- " warn: `1px solid ${colors.warn}`,",
1235
- " success: `1px solid ${colors.success}`,",
1236
- " light: `1px solid ${colors.outline}`,",
1358
+ " primary: `1px solid ${colors['primary']}`,",
1359
+ " secondary: `1px solid ${colors['secondary']}`,",
1360
+ " tertiary: `1px solid ${colors['tertiary']}`,",
1361
+ " quaternary: `1px solid ${colors['quaternary']}`,",
1362
+ " warn: `1px solid ${colors['warn']}`,",
1363
+ " success: `1px solid ${colors['success']}`,",
1364
+ " light: `1px solid ${colors['outline']}`,",
1237
1365
  " dark: `1px solid ${colors['on-background']}`,",
1238
1366
  " dotted: `1px dotted ${colors['on-background']}`,",
1239
1367
  "});"
1240
1368
  ].join("\n");
1241
- var themeExport = (exportName, displayName, colorsConst, radii) => [
1369
+ var themeExport = (exportName, displayName, colorsConst, shadowsConst, radii) => [
1242
1370
  `export const ${exportName}: UniTheme = createTheme({`,
1243
1371
  ` id: '${exportName}',`,
1244
1372
  ` name: '${displayName}',`,
1245
1373
  ` colors: ${colorsConst},`,
1246
1374
  ` borders: borders(${colorsConst}),`,
1247
1375
  ` components: components(${colorsConst}),`,
1376
+ ` shadows: ${shadowsConst},`,
1248
1377
  ...radii ? [" radii,"] : [],
1249
1378
  "});"
1250
1379
  ].join("\n");
@@ -1259,7 +1388,7 @@ var themeExport = (exportName, displayName, colorsConst, radii) => [
1259
1388
  */
1260
1389
  var emitThemeFile = (input) => {
1261
1390
  const { darkMode = true, name = "Brand" } = input;
1262
- const { lightColors, darkColors, radii, report } = generateThemes(input);
1391
+ const { lightColors, darkColors, radii, lightShadows, darkShadows, report } = generateThemes(input);
1263
1392
  const id = name.replace(/\W+/g, "") || "Brand";
1264
1393
  const regenerate = [
1265
1394
  `--brand=${(Array.isArray(input.seed) ? input.seed : [input.seed]).join(",")}`,
@@ -1273,12 +1402,16 @@ var emitThemeFile = (input) => {
1273
1402
  exportName: `${id}Light`,
1274
1403
  displayName: `${name} Light`,
1275
1404
  colorsConst: "lightColors",
1276
- colors: lightColors
1405
+ colors: lightColors,
1406
+ shadowsConst: "lightShadows",
1407
+ shadows: lightShadows
1277
1408
  }, ...darkMode ? [{
1278
1409
  exportName: `${id}Dark`,
1279
1410
  displayName: `${name} Dark`,
1280
1411
  colorsConst: "darkColors",
1281
- colors: darkColors
1412
+ colors: darkColors,
1413
+ shadowsConst: "darkShadows",
1414
+ shadows: darkShadows
1282
1415
  }] : []];
1283
1416
  return {
1284
1417
  content: [
@@ -1295,16 +1428,19 @@ var emitThemeFile = (input) => {
1295
1428
  " type Borders,",
1296
1429
  " type Colors,",
1297
1430
  " type ComponentThemes,",
1431
+ " type Shadows,",
1298
1432
  " type UniTheme,",
1299
1433
  "} from '@uni-design-system/uni-core';",
1300
1434
  "",
1301
1435
  ...modes.map(({ colorsConst, colors }) => `const ${colorsConst}: Colors = {\n${recordLiteral(colors, " ")}\n};\n`),
1436
+ "/** Brand-tinted elevation shadows — theme-scoped, edit freely. */",
1437
+ ...modes.map(({ shadowsConst, shadows }) => `const ${shadowsConst}: Shadows = {\n${recordLiteral(shadows, " ")}\n};\n`),
1302
1438
  bordersLiteral(),
1303
1439
  "",
1304
1440
  "/**",
1305
1441
  " * Sparse component overrides, deep-merged over Uni component defaults: only",
1306
1442
  " * what you write here changes. Point components at your own primitives, e.g.:",
1307
- " * button: { variants: { secondary: { border: `2px dashed ${colors.tertiary}` } } },",
1443
+ " * button: { variants: { secondary: { border: `2px dashed ${colors['tertiary']}` } } },",
1308
1444
  " * input: { options: { borderRadius: 'max' } },",
1309
1445
  " */",
1310
1446
  "const components = (colors: Colors): ComponentThemes => ({});",
@@ -1314,7 +1450,7 @@ var emitThemeFile = (input) => {
1314
1450
  `const radii = {\n${recordLiteral(radii, " ")}\n};`,
1315
1451
  ""
1316
1452
  ] : [],
1317
- ...modes.map(({ exportName, displayName, colorsConst }) => `${themeExport(exportName, displayName, colorsConst, !!radii)}\n`),
1453
+ ...modes.map(({ exportName, displayName, colorsConst, shadowsConst }) => `${themeExport(exportName, displayName, colorsConst, shadowsConst, !!radii)}\n`),
1318
1454
  "/** First key wins as the default theme when registered via UNI_THEMES. */",
1319
1455
  `export const ${id}Themes = { ${modes.map((m) => m.exportName).join(", ")} };`,
1320
1456
  ""
@@ -1399,26 +1535,29 @@ var ShadowMap = {
1399
1535
  }
1400
1536
  };
1401
1537
  GetBoxShadows(ShadowMap["pressed"]), GetBoxShadows(ShadowMap["raised"]), GetBoxShadows(ShadowMap["focussed"]), GetBoxShadows(ShadowMap["navigation"]), GetBoxShadows(ShadowMap["modal"]);
1538
+ var darkColors = generatePalette({
1539
+ ...BASE_PALETTE_CONFIG,
1540
+ mode: "dark"
1541
+ });
1402
1542
  var DarkTheme = createTheme({
1403
1543
  id: "DarkTheme",
1404
1544
  name: "Dark Theme",
1405
- colors: generatePalette({
1406
- ...BASE_PALETTE_CONFIG,
1407
- mode: "dark"
1408
- })
1545
+ colors: darkColors,
1546
+ shadows: generateShadows(darkColors, "dark")
1409
1547
  });
1410
1548
  var UniThemes = {
1411
1549
  LightTheme: createTheme({
1412
1550
  id: "LightTheme",
1413
1551
  name: "Light Theme",
1414
- colors: lightColors
1552
+ colors: lightColors,
1553
+ shadows: generateShadows(lightColors, "light")
1415
1554
  }),
1416
1555
  DarkTheme
1417
1556
  };
1418
1557
  Object.keys(UniThemes)[0];
1419
1558
  //#endregion
1420
1559
  //#region package.json
1421
- var version = "5.0.0";
1560
+ var version = "5.2.0";
1422
1561
  //#endregion
1423
1562
  //#region schematics-src/ng-add/transforms.ts
1424
1563
  var addDependencies = (packageJsonText, deps) => {