@uni-design-system/uni-core 10.3.0 → 11.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/dist/esm/index.js CHANGED
@@ -740,6 +740,10 @@ var BaseIcons = {
740
740
  chevronRight: "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3e%3cpath d='m517.85-480-184-184L376-706.15 602.15-480 376-253.85 333.85-296l184-184Z'/%3e%3c/svg%3e",
741
741
  arrowLeft: "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3e%3cpath d='m294.92-450 227.85 227.85L480-180 180-480l300-300 42.77 42.15L294.92-510H780v60H294.92Z'/%3e%3c/svg%3e",
742
742
  arrowRight: "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3e%3cpath d='M665.08-450H180v-60h485.08L437.23-737.85 480-780l300 300-300 300-42.77-42.15L665.08-450Z'/%3e%3c/svg%3e",
743
+ arrowUp: "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3e%3cpath d='M450-180v-485.08L222.15-437.23 180-480l300-300 300 300-42.15 42.77L510-665.08V-180h-60Z'/%3e%3c/svg%3e",
744
+ arrowDown: "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3e%3cpath d='M450-780v485.08L222.15-522.77 180-480l300 300 300-300-42.15-42.77L510-294.92V-780h-60Z'/%3e%3c/svg%3e",
745
+ chevronsLeft: "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3e%3cpath d='M445-253.85 218.85-480 445-706.15 487.15-664 303.77-480l183.38 184L445-253.85Zm254 0L472.85-480 699-706.15 741.15-664 557.77-480l183.38 184L699-253.85Z'/%3e%3c/svg%3e",
746
+ chevronsRight: "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3e%3cpath d='M402.23-480 218.85-664 261-706.15 487.15-480 261-253.85 218.85-296l183.38-184Zm254 0L472.85-664 515-706.15 741.15-480 515-253.85 472.85-296l183.38-184Z'/%3e%3c/svg%3e",
743
747
  home: "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3e%3cpath d='M240-200h133.85v-237.69h212.3V-200H720v-360L480-740.77 240-560v360Zm-60 60v-450l300-225.77L780-590v450H526.15v-237.69h-92.3V-140H180Zm300-330.38Z'/%3e%3c/svg%3e",
744
748
  building: "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3e%3cpath d='M130-136.92v-540h160v-160h380v320h160v380H530v-160H430v160H130Zm60-60h100v-100H190v100Zm0-160h100v-100H190v100Zm0-160h100v-100H190v100Zm160 160h100v-100H350v100Zm0-160h100v-100H350v100Zm0-160h100v-100H350v100Zm160 320h100v-100H510v100Zm0-160h100v-100H510v100Zm0-160h100v-100H510v100Zm160 480h100v-100H670v100Zm0-160h100v-100H670v100Z'/%3e%3c/svg%3e",
745
749
  externalLink: "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-21h252.3v60h-252.3q-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.85h535.38q4.62 0 8.46-3.85 3.85-3.84 3.85-8.46v-252.3h60v252.3Q820-182 799-161q-21 21-51.31 21H212.31Zm176.46-206.62-42.15-42.15L717.85-760H560v-60h260v260h-60v-157.85L388.77-346.62Z'/%3e%3c/svg%3e",
@@ -1028,8 +1032,22 @@ var BaseMotion = {
1028
1032
  control: {
1029
1033
  duration: 300,
1030
1034
  easing: "ease"
1035
+ },
1036
+ snap: {
1037
+ duration: 120,
1038
+ easing: "ease"
1031
1039
  }
1032
1040
  };
1041
+ /**
1042
+ * The one wash every modal surface lays over the page it covers. Dialog and
1043
+ * drawer both point at `scrim` by name, so a theme redresses them together —
1044
+ * before this they owned a `backdrop` blob each and had drifted apart, the
1045
+ * dialog washing the page white and blurred while the drawer dimmed it dark.
1046
+ */
1047
+ var BaseBackdrops = { scrim: {
1048
+ background: "rgba(255, 255, 255, 0.6)",
1049
+ backdropFilter: "blur(2px)"
1050
+ } };
1033
1051
  var BaseRadii = {
1034
1052
  none: "none",
1035
1053
  xxs: "4px",
@@ -1104,7 +1122,7 @@ var buildComponents = (c) => ({
1104
1122
  typeface: "label",
1105
1123
  color: "on-background-variant",
1106
1124
  currentColor: "on-background",
1107
- separatorSymbol: "chevron_right",
1125
+ separatorIcon: "chevronRight",
1108
1126
  gap: "xs"
1109
1127
  } },
1110
1128
  appBar: { options: {
@@ -1122,9 +1140,10 @@ var buildComponents = (c) => ({
1122
1140
  divider: "light",
1123
1141
  elevation: "menu",
1124
1142
  padding: "md",
1125
- backdrop: { background: "rgba(0, 0, 0, 0.4)" },
1143
+ backdrop: "scrim",
1126
1144
  scrim: true,
1127
- background: "solid"
1145
+ background: "solid",
1146
+ motion: "panel"
1128
1147
  } },
1129
1148
  drawerHeader: { options: {
1130
1149
  color: void 0,
@@ -1151,7 +1170,7 @@ var buildComponents = (c) => ({
1151
1170
  options: {
1152
1171
  borderRadius: "max",
1153
1172
  typeface: "subtitle-2",
1154
- fallbackSymbol: "person"
1173
+ fallbackIcon: "profile"
1155
1174
  },
1156
1175
  variants: {
1157
1176
  primary: {
@@ -1208,8 +1227,8 @@ var buildComponents = (c) => ({
1208
1227
  ringWidth: 2
1209
1228
  } },
1210
1229
  searchInput: { options: {
1211
- searchSymbol: "search",
1212
- clearSymbol: "close",
1230
+ searchIcon: "search",
1231
+ clearIcon: "close",
1213
1232
  listColor: "primary-surface",
1214
1233
  listShadow: "menu",
1215
1234
  listBorderRadius: "xs",
@@ -1218,6 +1237,7 @@ var buildComponents = (c) => ({
1218
1237
  } },
1219
1238
  checkbox: {
1220
1239
  options: {
1240
+ motion: "control",
1221
1241
  size: 20,
1222
1242
  boxColor: "surface",
1223
1243
  borderRadius: 2,
@@ -1239,17 +1259,18 @@ var buildComponents = (c) => ({
1239
1259
  color: "primary-surface",
1240
1260
  border: "quaternary",
1241
1261
  padding: "sm",
1262
+ bodyPadding: void 0,
1263
+ inset: "lg",
1242
1264
  elevation: "dialog",
1243
- backdrop: {
1244
- background: "rgba(255, 255, 255, 0.6)",
1245
- backdropFilter: "blur(2px)"
1246
- }
1265
+ backdrop: "scrim",
1266
+ motion: "panel"
1247
1267
  } },
1248
1268
  dialogButtons: { options: {
1249
1269
  gap: "md",
1250
1270
  padding: "md",
1251
1271
  paddingBottom: "lg",
1252
1272
  justifyContent: "center",
1273
+ divider: void 0,
1253
1274
  confirmButtonVariant: "primary",
1254
1275
  cancelButtonVariant: "warn",
1255
1276
  buttonSize: "lg",
@@ -1262,9 +1283,26 @@ var buildComponents = (c) => ({
1262
1283
  height: 48,
1263
1284
  textRole: "title-large",
1264
1285
  textAlign: "center",
1286
+ divider: void 0,
1265
1287
  closeButtonIcon: "close",
1266
1288
  closeButtonSize: "md"
1267
1289
  } },
1290
+ select: { options: {
1291
+ toggleIcon: "chevronDown",
1292
+ toggleColor: "on-background-variant",
1293
+ toggleSize: 20
1294
+ } },
1295
+ buttonGroup: { options: {
1296
+ border: "quaternary",
1297
+ borderRadius: 4
1298
+ } },
1299
+ progressBar: { options: {
1300
+ trackColor: "primary-surface",
1301
+ fillColor: "secondary-surface",
1302
+ completeColor: "secondary",
1303
+ borderColor: "on-background-variant",
1304
+ strokeWidth: 1
1305
+ } },
1268
1306
  dropdown: { options: {
1269
1307
  border: "none",
1270
1308
  borderRadius: "xxs",
@@ -1292,7 +1330,7 @@ var buildComponents = (c) => ({
1292
1330
  typeface: "label",
1293
1331
  textColor: void 0,
1294
1332
  hoverColor: "primary-container",
1295
- activeSymbol: "check",
1333
+ activeIcon: "check",
1296
1334
  motion: "control"
1297
1335
  },
1298
1336
  variants: {
@@ -1316,7 +1354,7 @@ var buildComponents = (c) => ({
1316
1354
  maxWidth: "38ch",
1317
1355
  offset: 7,
1318
1356
  arrowSize: 8,
1319
- closeSymbol: "close",
1357
+ closeIcon: "close",
1320
1358
  headerTypeface: "title-small",
1321
1359
  tooltipPadding: "4px 8px",
1322
1360
  tooltipOpenDelay: 500,
@@ -1324,12 +1362,6 @@ var buildComponents = (c) => ({
1324
1362
  motion: "panel"
1325
1363
  } },
1326
1364
  expand: { options: { motion: "reveal" } },
1327
- footer: { options: {
1328
- height: 52,
1329
- color: "primary",
1330
- logoHeight: 18.6,
1331
- logoPadding: "md"
1332
- } },
1333
1365
  input: { options: {
1334
1366
  typeface: "input",
1335
1367
  color: "primary-surface",
@@ -1388,6 +1420,7 @@ var buildComponents = (c) => ({
1388
1420
  }
1389
1421
  },
1390
1422
  tabs: { options: {
1423
+ motion: "snap",
1391
1424
  typeface: "title-small",
1392
1425
  textColor: "on-surface-variant",
1393
1426
  activeTextColor: "primary",
@@ -1415,14 +1448,14 @@ var buildComponents = (c) => ({
1415
1448
  typeface: "tag",
1416
1449
  gap: "xs",
1417
1450
  removeIcon: "close",
1418
- selectedIcon: "check"
1451
+ selectedIcon: "check",
1452
+ motion: "control"
1419
1453
  },
1420
1454
  fixed: {
1421
1455
  display: "inline-flex",
1422
1456
  alignItems: "center",
1423
1457
  maxWidth: "100%",
1424
- border: "1px solid transparent",
1425
- transition: "background-color .2s ease, color .2s ease"
1458
+ border: "1px solid transparent"
1426
1459
  },
1427
1460
  variants: {
1428
1461
  ...tagVariant(c, "primary"),
@@ -1488,8 +1521,8 @@ var buildComponents = (c) => ({
1488
1521
  dayBorderRadius: "max",
1489
1522
  typeface: "label",
1490
1523
  gap: "xxs",
1491
- navPrevSymbol: "chevron_left",
1492
- navNextSymbol: "chevron_right",
1524
+ navPrevIcon: "chevronLeft",
1525
+ navNextIcon: "chevronRight",
1493
1526
  weekdayFormat: "short",
1494
1527
  showOutsideDays: false,
1495
1528
  todayStyle: "outline"
@@ -1528,13 +1561,13 @@ var buildComponents = (c) => ({
1528
1561
  descriptionColor: "on-primary-surface-variant"
1529
1562
  } },
1530
1563
  dateInput: { options: {
1531
- toggleSymbol: "calendar_month",
1564
+ toggleIcon: "calendar",
1532
1565
  popupShadow: "menu",
1533
1566
  popupBorderRadius: "xs",
1534
1567
  popupColor: "primary-surface"
1535
1568
  } },
1536
1569
  timeInput: { options: {
1537
- toggleSymbol: "schedule",
1570
+ toggleIcon: "clock",
1538
1571
  listColor: "primary-surface",
1539
1572
  listShadow: "menu",
1540
1573
  listBorderRadius: "xs",
@@ -1548,15 +1581,15 @@ var buildComponents = (c) => ({
1548
1581
  button: {
1549
1582
  options: {
1550
1583
  borderRadius: "max",
1551
- typeface: "button"
1584
+ typeface: "button",
1585
+ motion: "control"
1552
1586
  },
1553
1587
  fixed: {
1554
1588
  position: "relative",
1555
1589
  overflow: "hidden",
1556
1590
  outline: "0",
1557
1591
  border: "0",
1558
- cursor: "pointer",
1559
- transition: "all 0.28s ease"
1592
+ cursor: "pointer"
1560
1593
  },
1561
1594
  variantOptions: {
1562
1595
  primary: { focusColor: "primary" },
@@ -1637,7 +1670,10 @@ var buildComponents = (c) => ({
1637
1670
  }
1638
1671
  },
1639
1672
  iconButton: {
1640
- options: { borderRadius: "max" },
1673
+ options: {
1674
+ borderRadius: "max",
1675
+ motion: "control"
1676
+ },
1641
1677
  variantOptions: {
1642
1678
  primary: { focusColor: "primary" },
1643
1679
  secondary: { focusColor: "secondary" },
@@ -1714,6 +1750,13 @@ var buildComponents = (c) => ({
1714
1750
  }
1715
1751
  }
1716
1752
  },
1753
+ inlineButton: { options: {
1754
+ linkColor: "primary",
1755
+ underline: false,
1756
+ underlineOnHover: true,
1757
+ underlineOffset: "0.15em",
1758
+ gap: "xxs"
1759
+ } },
1717
1760
  progressGauge: {
1718
1761
  fixed: { textFill: c["on-background"] },
1719
1762
  variants: {
@@ -1749,7 +1792,8 @@ var buildComponents = (c) => ({
1749
1792
  options: { borderRadius: "xs" },
1750
1793
  fixed: {
1751
1794
  overflow: "hidden",
1752
- backgroundColor: c.background
1795
+ backgroundColor: c.background,
1796
+ color: c["on-background"]
1753
1797
  }
1754
1798
  },
1755
1799
  cardHeader: {
@@ -1785,6 +1829,7 @@ var buildComponents = (c) => ({
1785
1829
  placeholderColor: "disabled"
1786
1830
  } },
1787
1831
  dataTable: { options: {
1832
+ motion: "control",
1788
1833
  color: "primary-surface",
1789
1834
  border: "light",
1790
1835
  borderRadius: "sm",
@@ -1848,7 +1893,7 @@ var buildComponents = (c) => ({
1848
1893
  tooltipTextColor: "on-inverse-surface",
1849
1894
  tooltipShadow: "menu",
1850
1895
  tooltipBorderRadius: "xs",
1851
- transitionMs: 120
1896
+ motion: "snap"
1852
1897
  } },
1853
1898
  skeleton: { options: {
1854
1899
  color: "surface-variant",
@@ -1897,6 +1942,7 @@ var buildComponents = (c) => ({
1897
1942
  }
1898
1943
  },
1899
1944
  tooltip: { options: {
1945
+ motion: "notification",
1900
1946
  border: void 0,
1901
1947
  borderRadius: "xs",
1902
1948
  shadow: "raised",
@@ -1911,7 +1957,7 @@ var buildComponents = (c) => ({
1911
1957
  padding: "16px",
1912
1958
  headerTypeface: "title-small",
1913
1959
  typeface: "label",
1914
- closeSymbol: "close",
1960
+ closeIcon: "close",
1915
1961
  arrowSize: 8,
1916
1962
  offset: 12,
1917
1963
  scrimColor: "rgba(0, 0, 0, 0.45)",
@@ -1932,7 +1978,7 @@ var deepMerge = (base, override) => {
1932
1978
  for (const [key, value] of Object.entries(override)) out[key] = isRecord$1(value) && isRecord$1(out[key]) ? deepMerge(out[key], value) : value;
1933
1979
  return out;
1934
1980
  };
1935
- var createTheme = ({ id, name, colors, icons = {}, radii = BaseRadii, shadows = BaseShadows, motion, typography, borders, thicknesses, spacing, components }) => ({
1981
+ var createTheme = ({ id, name, colors, icons = {}, radii = BaseRadii, shadows = BaseShadows, motion, backdrops, typography, borders, thicknesses, spacing, components }) => ({
1936
1982
  id,
1937
1983
  name,
1938
1984
  colors,
@@ -1948,6 +1994,10 @@ var createTheme = ({ id, name, colors, icons = {}, radii = BaseRadii, shadows =
1948
1994
  ...BaseMotion,
1949
1995
  ...motion
1950
1996
  },
1997
+ backdrops: {
1998
+ ...BaseBackdrops,
1999
+ ...backdrops
2000
+ },
1951
2001
  thicknesses: {
1952
2002
  ...BaseThicknesses,
1953
2003
  ...thicknesses