@uni-design-system/uni-core 5.1.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/dist/cjs/index.cjs +152 -37
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +152 -38
- package/dist/esm/index.js.map +1 -1
- package/dist/types/concepts/component/component.types.d.ts +1 -1
- package/dist/types/concepts/component/component.types.d.ts.map +1 -1
- package/dist/types/concepts/generation/dtcg.emitter.d.ts +26 -0
- package/dist/types/concepts/generation/dtcg.emitter.d.ts.map +1 -0
- package/dist/types/concepts/generation/index.d.ts +1 -0
- package/dist/types/concepts/generation/index.d.ts.map +1 -1
- package/dist/types/concepts/theme/themes/base.theme.d.ts +1 -0
- package/dist/types/concepts/theme/themes/base.theme.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -762,6 +762,28 @@ var Z_INDEX = {
|
|
|
762
762
|
overlay: 1080
|
|
763
763
|
};
|
|
764
764
|
//#endregion
|
|
765
|
+
//#region src/concepts/generation/dtcg.emitter.ts
|
|
766
|
+
var dimensionEntries = (record) => Object.fromEntries(Object.entries(record ?? {}).filter(([, value]) => value !== void 0 && value !== "none").map(([key, value]) => [key, {
|
|
767
|
+
$value: String(value),
|
|
768
|
+
$type: "dimension"
|
|
769
|
+
}]));
|
|
770
|
+
/**
|
|
771
|
+
* Render one theme mode's tokens as W3C DTCG JSON for external pipelines
|
|
772
|
+
* (Style Dictionary etc.). Token names are exactly Uni's `ColorToken` strings —
|
|
773
|
+
* one vocabulary everywhere. The native `UniTheme` object remains the primary,
|
|
774
|
+
* lossless output; this is the interop layer.
|
|
775
|
+
*/
|
|
776
|
+
var emitDtcgTokens = (input) => ({
|
|
777
|
+
color: Object.fromEntries(Object.entries(input.colors).filter(([, value]) => value !== void 0).map(([key, value]) => [key, {
|
|
778
|
+
$value: value,
|
|
779
|
+
$type: "color"
|
|
780
|
+
}])),
|
|
781
|
+
size: {
|
|
782
|
+
radius: dimensionEntries(input.radii),
|
|
783
|
+
spacing: dimensionEntries(input.spacing)
|
|
784
|
+
}
|
|
785
|
+
});
|
|
786
|
+
//#endregion
|
|
765
787
|
//#region src/concepts/generation/shadow.generator.ts
|
|
766
788
|
var rgba = (hex, alpha) => {
|
|
767
789
|
const { red, green, blue } = hexToRgb(hex);
|
|
@@ -996,6 +1018,90 @@ var buildComponents = (c) => ({
|
|
|
996
1018
|
transitionSpeed: .35,
|
|
997
1019
|
elevation: "md"
|
|
998
1020
|
} },
|
|
1021
|
+
breadcrumb: { options: {
|
|
1022
|
+
typeface: "label",
|
|
1023
|
+
color: "on-background-variant",
|
|
1024
|
+
currentColor: "on-background",
|
|
1025
|
+
separatorSymbol: "chevron_right",
|
|
1026
|
+
gap: "xs"
|
|
1027
|
+
} },
|
|
1028
|
+
appBar: { options: {
|
|
1029
|
+
color: "surface",
|
|
1030
|
+
height: 56,
|
|
1031
|
+
divider: "light",
|
|
1032
|
+
typeface: "title-large",
|
|
1033
|
+
padding: "md",
|
|
1034
|
+
gap: "md",
|
|
1035
|
+
elevation: void 0
|
|
1036
|
+
} },
|
|
1037
|
+
drawer: { options: {
|
|
1038
|
+
color: "surface",
|
|
1039
|
+
width: 280,
|
|
1040
|
+
divider: "light",
|
|
1041
|
+
elevation: "menu",
|
|
1042
|
+
padding: "md",
|
|
1043
|
+
backdrop: { background: "rgba(0, 0, 0, 0.4)" }
|
|
1044
|
+
} },
|
|
1045
|
+
avatar: {
|
|
1046
|
+
options: {
|
|
1047
|
+
borderRadius: "max",
|
|
1048
|
+
typeface: "subtitle-2",
|
|
1049
|
+
fallbackSymbol: "person"
|
|
1050
|
+
},
|
|
1051
|
+
variants: {
|
|
1052
|
+
primary: {
|
|
1053
|
+
backgroundColor: c["primary-container"],
|
|
1054
|
+
color: c["on-primary-container"]
|
|
1055
|
+
},
|
|
1056
|
+
secondary: {
|
|
1057
|
+
backgroundColor: c["secondary-container"],
|
|
1058
|
+
color: c["on-secondary-container"]
|
|
1059
|
+
},
|
|
1060
|
+
tertiary: {
|
|
1061
|
+
backgroundColor: c["tertiary-container"],
|
|
1062
|
+
color: c["on-tertiary-container"]
|
|
1063
|
+
},
|
|
1064
|
+
quaternary: {
|
|
1065
|
+
backgroundColor: c["surface-variant"],
|
|
1066
|
+
color: c["on-surface-variant"]
|
|
1067
|
+
},
|
|
1068
|
+
warn: {
|
|
1069
|
+
backgroundColor: c["warn-container"],
|
|
1070
|
+
color: c["on-warn-container"]
|
|
1071
|
+
},
|
|
1072
|
+
success: {
|
|
1073
|
+
backgroundColor: c["success-container"],
|
|
1074
|
+
color: c["on-success-container"]
|
|
1075
|
+
}
|
|
1076
|
+
},
|
|
1077
|
+
sizes: {
|
|
1078
|
+
sm: {
|
|
1079
|
+
height: 24,
|
|
1080
|
+
width: 24,
|
|
1081
|
+
fontSize: 10
|
|
1082
|
+
},
|
|
1083
|
+
md: {
|
|
1084
|
+
height: 32,
|
|
1085
|
+
width: 32,
|
|
1086
|
+
fontSize: 13
|
|
1087
|
+
},
|
|
1088
|
+
lg: {
|
|
1089
|
+
height: 40,
|
|
1090
|
+
width: 40,
|
|
1091
|
+
fontSize: 16
|
|
1092
|
+
},
|
|
1093
|
+
xl: {
|
|
1094
|
+
height: 56,
|
|
1095
|
+
width: 56,
|
|
1096
|
+
fontSize: 22
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
},
|
|
1100
|
+
avatarGroup: { options: {
|
|
1101
|
+
overlap: "sm",
|
|
1102
|
+
ringColor: "surface",
|
|
1103
|
+
ringWidth: 2
|
|
1104
|
+
} },
|
|
999
1105
|
checkbox: { options: { size: 20 } },
|
|
1000
1106
|
dialog: { options: {
|
|
1001
1107
|
borderRadius: "lg",
|
|
@@ -1044,6 +1150,22 @@ var buildComponents = (c) => ({
|
|
|
1044
1150
|
focusOutline: `2px solid ${c.primary}`,
|
|
1045
1151
|
focusOutlineOffset: 2
|
|
1046
1152
|
} },
|
|
1153
|
+
textarea: { options: {
|
|
1154
|
+
rows: 3,
|
|
1155
|
+
resize: "vertical"
|
|
1156
|
+
} },
|
|
1157
|
+
tabs: { options: {
|
|
1158
|
+
typeface: "title-small",
|
|
1159
|
+
textColor: "on-surface-variant",
|
|
1160
|
+
activeTextColor: "primary",
|
|
1161
|
+
indicatorColor: "primary",
|
|
1162
|
+
indicatorThickness: "standard",
|
|
1163
|
+
divider: "light",
|
|
1164
|
+
gap: "sm",
|
|
1165
|
+
borderRadius: "none",
|
|
1166
|
+
padding: "md",
|
|
1167
|
+
activeColor: void 0
|
|
1168
|
+
} },
|
|
1047
1169
|
multiSelectDropdown: { options: {
|
|
1048
1170
|
textRole: "input",
|
|
1049
1171
|
textColor: "on-primary-surface",
|
|
@@ -1055,13 +1177,16 @@ var buildComponents = (c) => ({
|
|
|
1055
1177
|
} },
|
|
1056
1178
|
badge: { options: { borderRadius: "xxs" } },
|
|
1057
1179
|
button: {
|
|
1180
|
+
options: {
|
|
1181
|
+
borderRadius: "max",
|
|
1182
|
+
typeface: "button"
|
|
1183
|
+
},
|
|
1058
1184
|
fixed: {
|
|
1059
1185
|
position: "relative",
|
|
1060
1186
|
overflow: "hidden",
|
|
1061
1187
|
outline: "0",
|
|
1062
1188
|
border: "0",
|
|
1063
1189
|
cursor: "pointer",
|
|
1064
|
-
fontFamily: "Euphemia, sans-serif",
|
|
1065
1190
|
transition: "all 0.28s ease"
|
|
1066
1191
|
},
|
|
1067
1192
|
variants: {
|
|
@@ -1112,33 +1237,29 @@ var buildComponents = (c) => ({
|
|
|
1112
1237
|
sizes: {
|
|
1113
1238
|
sm: {
|
|
1114
1239
|
height: 22,
|
|
1115
|
-
borderRadius: 11,
|
|
1116
1240
|
fontSize: 12,
|
|
1117
1241
|
padding: "0 12px",
|
|
1118
|
-
fontFamily: "Euphemia Bold, sans-serif",
|
|
1119
1242
|
fontWeight: 600
|
|
1120
1243
|
},
|
|
1121
1244
|
md: {
|
|
1122
1245
|
height: 26,
|
|
1123
|
-
borderRadius: 13,
|
|
1124
1246
|
fontSize: 16,
|
|
1125
1247
|
padding: "0 16px"
|
|
1126
1248
|
},
|
|
1127
1249
|
lg: {
|
|
1128
1250
|
height: 36,
|
|
1129
|
-
borderRadius: 18,
|
|
1130
1251
|
fontSize: 18,
|
|
1131
1252
|
padding: "0 18px"
|
|
1132
1253
|
},
|
|
1133
1254
|
xl: {
|
|
1134
1255
|
height: 48,
|
|
1135
|
-
borderRadius: 24,
|
|
1136
1256
|
fontSize: 24,
|
|
1137
1257
|
padding: "0 22px"
|
|
1138
1258
|
}
|
|
1139
1259
|
}
|
|
1140
1260
|
},
|
|
1141
1261
|
iconButton: {
|
|
1262
|
+
options: { borderRadius: "max" },
|
|
1142
1263
|
variants: {
|
|
1143
1264
|
ghost: {
|
|
1144
1265
|
backgroundColor: "transparent",
|
|
@@ -1204,23 +1325,23 @@ var buildComponents = (c) => ({
|
|
|
1204
1325
|
fixed: { textFill: c["on-background"] },
|
|
1205
1326
|
variants: {
|
|
1206
1327
|
primary: {
|
|
1207
|
-
backgroundColor: "
|
|
1328
|
+
backgroundColor: c["primary-container"],
|
|
1208
1329
|
color: c.primary
|
|
1209
1330
|
},
|
|
1210
1331
|
secondary: {
|
|
1211
|
-
backgroundColor: "
|
|
1332
|
+
backgroundColor: c["secondary-container"],
|
|
1212
1333
|
color: c.secondary
|
|
1213
1334
|
},
|
|
1214
1335
|
tertiary: {
|
|
1215
|
-
backgroundColor: "
|
|
1336
|
+
backgroundColor: c["tertiary-container"],
|
|
1216
1337
|
color: c.tertiary
|
|
1217
1338
|
},
|
|
1218
1339
|
warn: {
|
|
1219
|
-
backgroundColor: "
|
|
1340
|
+
backgroundColor: c["warn-container"],
|
|
1220
1341
|
color: c.warn
|
|
1221
1342
|
},
|
|
1222
1343
|
success: {
|
|
1223
|
-
backgroundColor: "
|
|
1344
|
+
backgroundColor: c["success-container"],
|
|
1224
1345
|
color: c.success
|
|
1225
1346
|
}
|
|
1226
1347
|
},
|
|
@@ -1232,33 +1353,10 @@ var buildComponents = (c) => ({
|
|
|
1232
1353
|
}
|
|
1233
1354
|
},
|
|
1234
1355
|
card: {
|
|
1356
|
+
options: { borderRadius: "xs" },
|
|
1235
1357
|
fixed: {
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
borderRadius: "8px",
|
|
1239
|
-
overflow: "hidden"
|
|
1240
|
-
},
|
|
1241
|
-
variants: {
|
|
1242
|
-
primary: {
|
|
1243
|
-
borderColor: c.primary,
|
|
1244
|
-
backgroundColor: c.background
|
|
1245
|
-
},
|
|
1246
|
-
secondary: {
|
|
1247
|
-
borderColor: c.secondary,
|
|
1248
|
-
backgroundColor: c.background
|
|
1249
|
-
},
|
|
1250
|
-
tertiary: {
|
|
1251
|
-
borderColor: c.tertiary,
|
|
1252
|
-
backgroundColor: c.background
|
|
1253
|
-
},
|
|
1254
|
-
warn: {
|
|
1255
|
-
borderColor: c.warn,
|
|
1256
|
-
backgroundColor: c.background
|
|
1257
|
-
},
|
|
1258
|
-
success: {
|
|
1259
|
-
borderColor: c.success,
|
|
1260
|
-
backgroundColor: c.background
|
|
1261
|
-
}
|
|
1358
|
+
overflow: "hidden",
|
|
1359
|
+
backgroundColor: c.background
|
|
1262
1360
|
}
|
|
1263
1361
|
},
|
|
1264
1362
|
cardHeader: {
|
|
@@ -1329,6 +1427,21 @@ var buildComponents = (c) => ({
|
|
|
1329
1427
|
currentPageBorder: "light",
|
|
1330
1428
|
currentPageBorderRadius: "xs"
|
|
1331
1429
|
} },
|
|
1430
|
+
slider: { options: {
|
|
1431
|
+
color: "primary",
|
|
1432
|
+
trackColor: "surface-variant",
|
|
1433
|
+
borderRadius: "max",
|
|
1434
|
+
trackHeight: 4,
|
|
1435
|
+
thumbSize: 16
|
|
1436
|
+
} },
|
|
1437
|
+
skeleton: { options: {
|
|
1438
|
+
color: "surface-variant",
|
|
1439
|
+
highlightColor: "surface",
|
|
1440
|
+
borderRadius: "xs",
|
|
1441
|
+
animation: "shimmer",
|
|
1442
|
+
duration: 1.4,
|
|
1443
|
+
gap: "sm"
|
|
1444
|
+
} },
|
|
1332
1445
|
snackbar: { options: {
|
|
1333
1446
|
bottomPosition: 40,
|
|
1334
1447
|
transitionDelay: "0.35s",
|
|
@@ -1380,6 +1493,7 @@ var createThemeFromPalette = (config) => {
|
|
|
1380
1493
|
id: config.id ?? "CustomTheme",
|
|
1381
1494
|
name: config.name ?? "Custom Theme",
|
|
1382
1495
|
colors,
|
|
1496
|
+
radii: config.radii,
|
|
1383
1497
|
shadows: generateShadows(colors, config.mode ?? "light"),
|
|
1384
1498
|
icons: config.icons
|
|
1385
1499
|
});
|
|
@@ -1879,6 +1993,7 @@ exports.createThemeFromPalette = createThemeFromPalette;
|
|
|
1879
1993
|
exports.cycle = cycle;
|
|
1880
1994
|
exports.darkColors = darkColors;
|
|
1881
1995
|
exports.debounce = debounce;
|
|
1996
|
+
exports.emitDtcgTokens = emitDtcgTokens;
|
|
1882
1997
|
exports.emitThemeFile = emitThemeFile;
|
|
1883
1998
|
exports.expandFadeIn = expandFadeIn;
|
|
1884
1999
|
exports.fadeIn = fadeIn;
|