@uni-design-system/uni-angular 5.1.0 → 6.0.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.1.0",
3
+ "version": "6.0.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.1.0"
25
+ "@uni-design-system/uni-core": "^6.0.0"
26
26
  },
27
27
  "module": "fesm2022/uni-design-system-uni-angular.mjs",
28
28
  "typings": "types/uni-design-system-uni-angular.d.ts",
@@ -555,6 +555,26 @@ var generateShadows = (colors, mode = "light") => {
555
555
  warn: `0 0 5px ${rgba(error, .5)}, inset 0 0 5px ${rgba(error, .3)}`
556
556
  };
557
557
  };
558
+ /**
559
+ * Default icon primitives shipped with every theme. Each icon is an inline
560
+ * SVG data URI rendered as a CSS mask over `currentColor`, so icons recolor
561
+ * with the theme automatically. `createTheme` merges a theme's own `icons`
562
+ * over this set — add or override under any name; components render them by
563
+ * token via `uni-icon`, never by inlining SVG.
564
+ */
565
+ var BaseIcons = {
566
+ alertCircle: "data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e%3cpath d='M0 0h24v24H0V0z' fill='none'/%3e%3cpath d='M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z'/%3e%3c/svg%3e",
567
+ calendar: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z'%3E%3C/path%3E%3C/svg%3E",
568
+ checkCircle: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg%3E%3Cpath d='M32,0A32,32,0,1,0,64,32,32,32,0,0,0,32,0Zm2.0873,41.5-5.4107,5.4106-.02.02L14.1751,32.4492l5.4306-5.4306,9.051,9.0509L46.2861,18.44l5.4305,5.4306Z'/%3E%3C/g%3E%3C/svg%3E",
569
+ chevronUp: "data:image/svg+xml,%0A%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='m296-345-56-56 240-240 240 240-56 56-184-184-184 184Z'/%3E%3C/svg%3E",
570
+ chevronDown: "data:image/svg+xml,%0A%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z'/%3E%3C/svg%3E",
571
+ chevronLeft: "data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z'/%3E%3C/svg%3E",
572
+ chevronRight: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z'/%3E%3C/svg%3E",
573
+ xCircle: "data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3e%3cg%3e%3cpath d='M32,0A32,32,0,1,0,64,32,32,32,0,0,0,32,0ZM47.4649,42.3543l-5.4306,5.43L31.68,37.4305,21.3257,47.7848l-5.4306-5.43L26.25,32,15.8951,21.6456l5.4306-5.4305L31.68,26.5694,42.0343,16.2151l5.4306,5.4305L37.1106,32Z'/%3e%3c/g%3e%3c/svg%3e",
574
+ search: "data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3e%3cg%3e%3cpath d='M 21 3 C 11.601563 3 4 10.601563 4 20 C 4 29.398438 11.601563 37 21 37 C 24.355469 37 27.460938 36.015625 30.09375 34.34375 L 42.375 46.625 L 46.625 42.375 L 34.5 30.28125 C 36.679688 27.421875 38 23.878906 38 20 C 38 10.601563 30.398438 3 21 3 Z M 21 7 C 28.199219 7 34 12.800781 34 20 C 34 27.199219 28.199219 33 21 33 C 13.800781 33 8 27.199219 8 20 C 8 12.800781 13.800781 7 21 7 Z'%3e%3c/path%3e%3c/g%3e%3c/svg%3e",
575
+ close: "data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e%3cg%3e%3cpath fill='currentColor' d='M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z'%3e%3c/path%3e%3c/g%3e%3c/svg%3e",
576
+ 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 "
577
+ };
558
578
  var BaseTypography = {
559
579
  "display-large": {
560
580
  fontFamily: "Red Hat Display",
@@ -692,6 +712,13 @@ var BaseTypography = {
692
712
  fontSize: 16,
693
713
  lineHeight: 24
694
714
  },
715
+ stat: {
716
+ fontFamily: "Red Hat Display",
717
+ fontSize: 32,
718
+ lineHeight: 38,
719
+ fontWeight: 600,
720
+ letterSpacing: -.32
721
+ },
695
722
  tag: {
696
723
  fontFamily: "Red Hat Display",
697
724
  fontSize: 15,
@@ -751,7 +778,107 @@ var buildComponents = (c) => ({
751
778
  transitionSpeed: .35,
752
779
  elevation: "md"
753
780
  } },
754
- checkbox: { options: { size: 20 } },
781
+ breadcrumb: { options: {
782
+ typeface: "label",
783
+ color: "on-background-variant",
784
+ currentColor: "on-background",
785
+ separatorSymbol: "chevron_right",
786
+ gap: "xs"
787
+ } },
788
+ appBar: { options: {
789
+ color: "surface",
790
+ height: 56,
791
+ divider: "light",
792
+ typeface: "title-large",
793
+ padding: "md",
794
+ gap: "md",
795
+ elevation: void 0
796
+ } },
797
+ drawer: { options: {
798
+ color: "surface",
799
+ width: 280,
800
+ divider: "light",
801
+ elevation: "menu",
802
+ padding: "md",
803
+ backdrop: { background: "rgba(0, 0, 0, 0.4)" }
804
+ } },
805
+ avatar: {
806
+ options: {
807
+ borderRadius: "max",
808
+ typeface: "subtitle-2",
809
+ fallbackSymbol: "person"
810
+ },
811
+ variants: {
812
+ primary: {
813
+ backgroundColor: c["primary-container"],
814
+ color: c["on-primary-container"]
815
+ },
816
+ secondary: {
817
+ backgroundColor: c["secondary-container"],
818
+ color: c["on-secondary-container"]
819
+ },
820
+ tertiary: {
821
+ backgroundColor: c["tertiary-container"],
822
+ color: c["on-tertiary-container"]
823
+ },
824
+ quaternary: {
825
+ backgroundColor: c["surface-variant"],
826
+ color: c["on-surface-variant"]
827
+ },
828
+ warn: {
829
+ backgroundColor: c["warn-container"],
830
+ color: c["on-warn-container"]
831
+ },
832
+ success: {
833
+ backgroundColor: c["success-container"],
834
+ color: c["on-success-container"]
835
+ }
836
+ },
837
+ sizes: {
838
+ sm: {
839
+ height: 24,
840
+ width: 24,
841
+ fontSize: 10
842
+ },
843
+ md: {
844
+ height: 32,
845
+ width: 32,
846
+ fontSize: 13
847
+ },
848
+ lg: {
849
+ height: 40,
850
+ width: 40,
851
+ fontSize: 16
852
+ },
853
+ xl: {
854
+ height: 56,
855
+ width: 56,
856
+ fontSize: 22
857
+ }
858
+ }
859
+ },
860
+ avatarGroup: { options: {
861
+ overlap: "sm",
862
+ ringColor: "surface",
863
+ ringWidth: 2
864
+ } },
865
+ searchInput: { options: {
866
+ searchSymbol: "search",
867
+ clearSymbol: "close",
868
+ listColor: "primary-surface",
869
+ listShadow: "menu",
870
+ listBorderRadius: "xs",
871
+ maxSuggestions: 8
872
+ } },
873
+ checkbox: { options: {
874
+ size: 20,
875
+ boxColor: "surface"
876
+ } },
877
+ radio: { options: {
878
+ size: 20,
879
+ ringColor: "outline",
880
+ fillColor: "surface"
881
+ } },
755
882
  dialog: { options: {
756
883
  borderRadius: "lg",
757
884
  color: "primary-surface",
@@ -799,6 +926,22 @@ var buildComponents = (c) => ({
799
926
  focusOutline: `2px solid ${c.primary}`,
800
927
  focusOutlineOffset: 2
801
928
  } },
929
+ textarea: { options: {
930
+ rows: 3,
931
+ resize: "vertical"
932
+ } },
933
+ tabs: { options: {
934
+ typeface: "title-small",
935
+ textColor: "on-surface-variant",
936
+ activeTextColor: "primary",
937
+ indicatorColor: "primary",
938
+ indicatorThickness: "standard",
939
+ divider: "light",
940
+ gap: "sm",
941
+ borderRadius: "none",
942
+ padding: "md",
943
+ activeColor: void 0
944
+ } },
802
945
  multiSelectDropdown: { options: {
803
946
  textRole: "input",
804
947
  textColor: "on-primary-surface",
@@ -810,13 +953,16 @@ var buildComponents = (c) => ({
810
953
  } },
811
954
  badge: { options: { borderRadius: "xxs" } },
812
955
  button: {
956
+ options: {
957
+ borderRadius: "max",
958
+ typeface: "button"
959
+ },
813
960
  fixed: {
814
961
  position: "relative",
815
962
  overflow: "hidden",
816
963
  outline: "0",
817
964
  border: "0",
818
965
  cursor: "pointer",
819
- fontFamily: "Euphemia, sans-serif",
820
966
  transition: "all 0.28s ease"
821
967
  },
822
968
  variants: {
@@ -867,33 +1013,29 @@ var buildComponents = (c) => ({
867
1013
  sizes: {
868
1014
  sm: {
869
1015
  height: 22,
870
- borderRadius: 11,
871
1016
  fontSize: 12,
872
1017
  padding: "0 12px",
873
- fontFamily: "Euphemia Bold, sans-serif",
874
1018
  fontWeight: 600
875
1019
  },
876
1020
  md: {
877
1021
  height: 26,
878
- borderRadius: 13,
879
1022
  fontSize: 16,
880
1023
  padding: "0 16px"
881
1024
  },
882
1025
  lg: {
883
1026
  height: 36,
884
- borderRadius: 18,
885
1027
  fontSize: 18,
886
1028
  padding: "0 18px"
887
1029
  },
888
1030
  xl: {
889
1031
  height: 48,
890
- borderRadius: 24,
891
1032
  fontSize: 24,
892
1033
  padding: "0 22px"
893
1034
  }
894
1035
  }
895
1036
  },
896
1037
  iconButton: {
1038
+ options: { borderRadius: "max" },
897
1039
  variants: {
898
1040
  ghost: {
899
1041
  backgroundColor: "transparent",
@@ -959,23 +1101,23 @@ var buildComponents = (c) => ({
959
1101
  fixed: { textFill: c["on-background"] },
960
1102
  variants: {
961
1103
  primary: {
962
- backgroundColor: "#b3d4ea",
1104
+ backgroundColor: c["primary-container"],
963
1105
  color: c.primary
964
1106
  },
965
1107
  secondary: {
966
- backgroundColor: "#b3e7c2",
1108
+ backgroundColor: c["secondary-container"],
967
1109
  color: c.secondary
968
1110
  },
969
1111
  tertiary: {
970
- backgroundColor: "#ffe2b3",
1112
+ backgroundColor: c["tertiary-container"],
971
1113
  color: c.tertiary
972
1114
  },
973
1115
  warn: {
974
- backgroundColor: "#ffc2b3",
1116
+ backgroundColor: c["warn-container"],
975
1117
  color: c.warn
976
1118
  },
977
1119
  success: {
978
- backgroundColor: "#b3e7c2",
1120
+ backgroundColor: c["success-container"],
979
1121
  color: c.success
980
1122
  }
981
1123
  },
@@ -987,33 +1129,10 @@ var buildComponents = (c) => ({
987
1129
  }
988
1130
  },
989
1131
  card: {
1132
+ options: { borderRadius: "xs" },
990
1133
  fixed: {
991
- borderStyle: "solid",
992
- borderWidth: "1px",
993
- borderRadius: "8px",
994
- overflow: "hidden"
995
- },
996
- variants: {
997
- primary: {
998
- borderColor: c.primary,
999
- backgroundColor: c.background
1000
- },
1001
- secondary: {
1002
- borderColor: c.secondary,
1003
- backgroundColor: c.background
1004
- },
1005
- tertiary: {
1006
- borderColor: c.tertiary,
1007
- backgroundColor: c.background
1008
- },
1009
- warn: {
1010
- borderColor: c.warn,
1011
- backgroundColor: c.background
1012
- },
1013
- success: {
1014
- borderColor: c.success,
1015
- backgroundColor: c.background
1016
- }
1134
+ overflow: "hidden",
1135
+ backgroundColor: c.background
1017
1136
  }
1018
1137
  },
1019
1138
  cardHeader: {
@@ -1084,6 +1203,34 @@ var buildComponents = (c) => ({
1084
1203
  currentPageBorder: "light",
1085
1204
  currentPageBorderRadius: "xs"
1086
1205
  } },
1206
+ stat: { options: {
1207
+ labelTypeface: "label",
1208
+ valueTypeface: "stat",
1209
+ color: "surface",
1210
+ border: "light",
1211
+ borderRadius: "xs",
1212
+ positiveColor: "success",
1213
+ negativeColor: "error",
1214
+ trendColor: "outline",
1215
+ trendAccent: "primary",
1216
+ padding: "md",
1217
+ gap: "xxs"
1218
+ } },
1219
+ slider: { options: {
1220
+ color: "primary",
1221
+ trackColor: "surface-variant",
1222
+ borderRadius: "max",
1223
+ trackHeight: 4,
1224
+ thumbSize: 16
1225
+ } },
1226
+ skeleton: { options: {
1227
+ color: "surface-variant",
1228
+ highlightColor: "surface",
1229
+ borderRadius: "xs",
1230
+ animation: "shimmer",
1231
+ duration: 1.4,
1232
+ gap: "sm"
1233
+ } },
1087
1234
  snackbar: { options: {
1088
1235
  bottomPosition: 40,
1089
1236
  transitionDelay: "0.35s",
@@ -1095,7 +1242,11 @@ var buildComponents = (c) => ({
1095
1242
  grade: 0,
1096
1243
  opticalSize: 24
1097
1244
  } },
1098
- toggle: { options: { size: 20 } },
1245
+ toggle: { options: {
1246
+ size: 20,
1247
+ trackColor: "surface-variant",
1248
+ knobColor: "surface"
1249
+ } },
1099
1250
  tooltip: { options: {
1100
1251
  border: void 0,
1101
1252
  borderRadius: "xs",
@@ -1121,7 +1272,10 @@ var createTheme = ({ id, name, colors, icons = {}, radii = BaseRadii, shadows =
1121
1272
  shadows,
1122
1273
  spacing: BaseSpacing,
1123
1274
  thicknesses: BaseThicknesses,
1124
- icons,
1275
+ icons: {
1276
+ ...BaseIcons,
1277
+ ...icons
1278
+ },
1125
1279
  components: deepMerge(buildComponents(colors), components)
1126
1280
  });
1127
1281
  /**
@@ -1283,6 +1437,7 @@ var themeExport = (exportName, displayName, colorsConst, shadowsConst, radii) =>
1283
1437
  ` borders: borders(${colorsConst}),`,
1284
1438
  ` components: components(${colorsConst}),`,
1285
1439
  ` shadows: ${shadowsConst},`,
1440
+ " icons,",
1286
1441
  ...radii ? [" radii,"] : [],
1287
1442
  "});"
1288
1443
  ].join("\n");
@@ -1337,6 +1492,7 @@ var emitThemeFile = (input) => {
1337
1492
  " type Borders,",
1338
1493
  " type Colors,",
1339
1494
  " type ComponentThemes,",
1495
+ " type Icons,",
1340
1496
  " type Shadows,",
1341
1497
  " type UniTheme,",
1342
1498
  "} from '@uni-design-system/uni-core';",
@@ -1354,6 +1510,15 @@ var emitThemeFile = (input) => {
1354
1510
  " */",
1355
1511
  "const components = (colors: Colors): ComponentThemes => ({});",
1356
1512
  "",
1513
+ "/**",
1514
+ " * Icon primitives, merged over the built-in set (close, search, spinner,",
1515
+ " * chevrons, …). Define an icon ONCE here as an inline SVG data URI — it is",
1516
+ " * masked with currentColor, so it recolors with the theme — and render it",
1517
+ " * anywhere via `<uni-icon name='…'/>`. Never inline SVG in components.",
1518
+ " * Example: logo: \"data:image/svg+xml,%3Csvg xmlns='…' viewBox='0 0 24 24'%3E…%3C/svg%3E\",",
1519
+ " */",
1520
+ "const icons: Icons = {};",
1521
+ "",
1357
1522
  ...radii ? [
1358
1523
  `/** Shape language: '${input.shape}'. */`,
1359
1524
  `const radii = {\n${recordLiteral(radii, " ")}\n};`,
@@ -1466,7 +1631,7 @@ var UniThemes = {
1466
1631
  Object.keys(UniThemes)[0];
1467
1632
  //#endregion
1468
1633
  //#region package.json
1469
- var version = "5.1.0";
1634
+ var version = "6.0.0";
1470
1635
  //#endregion
1471
1636
  //#region schematics-src/ng-add/transforms.ts
1472
1637
  var addDependencies = (packageJsonText, deps) => {