@uni-design-system/uni-core 8.3.1 → 8.4.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/CHANGELOG.md +119 -0
- package/dist/cjs/index.cjs +54 -9
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +54 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/types/concepts/theme/theme.model.d.ts +22 -0
- package/dist/types/concepts/theme/theme.model.d.ts.map +1 -1
- package/dist/types/concepts/theme/themes/base.theme.d.ts +8 -2
- package/dist/types/concepts/theme/themes/base.theme.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1125,6 +1125,43 @@ var BaseThicknesses = {
|
|
|
1125
1125
|
standard: 2,
|
|
1126
1126
|
thick: 4
|
|
1127
1127
|
};
|
|
1128
|
+
/**
|
|
1129
|
+
* Shared motion timing, named by what moves rather than by how fast:
|
|
1130
|
+
* a small panel attached to a control snaps (`popup`), a larger free-floating
|
|
1131
|
+
* surface settles (`panel`), content growing in place eases at both ends
|
|
1132
|
+
* (`reveal`), a transient message arrives and leaves under its own steam
|
|
1133
|
+
* (`notification`), and a control answering a pointer should feel immediate
|
|
1134
|
+
* (`control`).
|
|
1135
|
+
*
|
|
1136
|
+
* Fast and linear is deliberate for `popup`. It is the timing every
|
|
1137
|
+
* trigger-anchored panel in the library uses — dropdown, menu, multi-select
|
|
1138
|
+
* and the combobox-style listboxes — so a form full of them opens uniformly;
|
|
1139
|
+
* at 100ms an easing curve is imperceptible anyway, and linear avoids the
|
|
1140
|
+
* lag a slow-in curve adds to something the user is waiting on.
|
|
1141
|
+
*/
|
|
1142
|
+
var BaseMotion = {
|
|
1143
|
+
popup: {
|
|
1144
|
+
duration: 100,
|
|
1145
|
+
easing: "linear",
|
|
1146
|
+
scale: .8
|
|
1147
|
+
},
|
|
1148
|
+
panel: {
|
|
1149
|
+
duration: 250,
|
|
1150
|
+
easing: "ease"
|
|
1151
|
+
},
|
|
1152
|
+
reveal: {
|
|
1153
|
+
duration: 350,
|
|
1154
|
+
easing: "ease-in-out"
|
|
1155
|
+
},
|
|
1156
|
+
notification: {
|
|
1157
|
+
duration: 350,
|
|
1158
|
+
easing: "ease-in-out"
|
|
1159
|
+
},
|
|
1160
|
+
control: {
|
|
1161
|
+
duration: 300,
|
|
1162
|
+
easing: "ease"
|
|
1163
|
+
}
|
|
1164
|
+
};
|
|
1128
1165
|
var BaseRadii = {
|
|
1129
1166
|
none: "none",
|
|
1130
1167
|
xxs: "4px",
|
|
@@ -1168,7 +1205,7 @@ var buildComponents = (c) => ({
|
|
|
1168
1205
|
alert: { options: {
|
|
1169
1206
|
topPosition: 40,
|
|
1170
1207
|
borderRadius: "sm",
|
|
1171
|
-
|
|
1208
|
+
motion: "notification",
|
|
1172
1209
|
elevation: "md"
|
|
1173
1210
|
} },
|
|
1174
1211
|
breadcrumb: { options: {
|
|
@@ -1274,7 +1311,7 @@ var buildComponents = (c) => ({
|
|
|
1274
1311
|
size: 20,
|
|
1275
1312
|
ringColor: "outline",
|
|
1276
1313
|
fillColor: "surface",
|
|
1277
|
-
|
|
1314
|
+
motion: "control"
|
|
1278
1315
|
} },
|
|
1279
1316
|
dialog: { options: {
|
|
1280
1317
|
borderRadius: "lg",
|
|
@@ -1311,7 +1348,8 @@ var buildComponents = (c) => ({
|
|
|
1311
1348
|
border: "none",
|
|
1312
1349
|
borderRadius: "xxs",
|
|
1313
1350
|
color: "primary-surface",
|
|
1314
|
-
shadow: "menu"
|
|
1351
|
+
shadow: "menu",
|
|
1352
|
+
motion: "popup"
|
|
1315
1353
|
} },
|
|
1316
1354
|
menu: { options: {
|
|
1317
1355
|
minWidth: 184,
|
|
@@ -1334,7 +1372,7 @@ var buildComponents = (c) => ({
|
|
|
1334
1372
|
textColor: void 0,
|
|
1335
1373
|
hoverColor: "primary-container",
|
|
1336
1374
|
activeSymbol: "check",
|
|
1337
|
-
|
|
1375
|
+
motion: "control"
|
|
1338
1376
|
},
|
|
1339
1377
|
variants: { warn: {
|
|
1340
1378
|
color: c.warn,
|
|
@@ -1358,9 +1396,10 @@ var buildComponents = (c) => ({
|
|
|
1358
1396
|
headerTypeface: "title-small",
|
|
1359
1397
|
tooltipPadding: "4px 8px",
|
|
1360
1398
|
tooltipOpenDelay: 500,
|
|
1361
|
-
tooltipCloseDelay: 150
|
|
1399
|
+
tooltipCloseDelay: 150,
|
|
1400
|
+
motion: "panel"
|
|
1362
1401
|
} },
|
|
1363
|
-
expand: { options: {
|
|
1402
|
+
expand: { options: { motion: "reveal" } },
|
|
1364
1403
|
footer: { options: {
|
|
1365
1404
|
height: 52,
|
|
1366
1405
|
color: "primary",
|
|
@@ -1821,11 +1860,13 @@ var buildComponents = (c) => ({
|
|
|
1821
1860
|
borderRadius: "xs",
|
|
1822
1861
|
animation: "shimmer",
|
|
1823
1862
|
duration: 1.4,
|
|
1863
|
+
direction: "ltr",
|
|
1864
|
+
highlightWidth: 40,
|
|
1824
1865
|
gap: "sm"
|
|
1825
1866
|
} },
|
|
1826
1867
|
snackbar: { options: {
|
|
1827
1868
|
bottomPosition: 40,
|
|
1828
|
-
|
|
1869
|
+
motion: "notification",
|
|
1829
1870
|
autoCloseDelay: 35e3
|
|
1830
1871
|
} },
|
|
1831
1872
|
symbol: { options: {
|
|
@@ -1861,7 +1902,7 @@ var buildComponents = (c) => ({
|
|
|
1861
1902
|
spotlightPadding: 6,
|
|
1862
1903
|
spotlightRadius: "xs",
|
|
1863
1904
|
ringWidth: 2,
|
|
1864
|
-
|
|
1905
|
+
motion: "panel"
|
|
1865
1906
|
} },
|
|
1866
1907
|
tour: { options: {
|
|
1867
1908
|
progressStyle: "dots",
|
|
@@ -1875,7 +1916,7 @@ var deepMerge = (base, override) => {
|
|
|
1875
1916
|
for (const [key, value] of Object.entries(override)) out[key] = isRecord$1(value) && isRecord$1(out[key]) ? deepMerge(out[key], value) : value;
|
|
1876
1917
|
return out;
|
|
1877
1918
|
};
|
|
1878
|
-
var createTheme = ({ id, name, colors, icons = {}, radii = BaseRadii, shadows = BaseShadows, typography, borders, thicknesses, components }) => ({
|
|
1919
|
+
var createTheme = ({ id, name, colors, icons = {}, radii = BaseRadii, shadows = BaseShadows, motion, typography, borders, thicknesses, components }) => ({
|
|
1879
1920
|
id,
|
|
1880
1921
|
name,
|
|
1881
1922
|
colors,
|
|
@@ -1884,6 +1925,10 @@ var createTheme = ({ id, name, colors, icons = {}, radii = BaseRadii, shadows =
|
|
|
1884
1925
|
radii,
|
|
1885
1926
|
shadows,
|
|
1886
1927
|
spacing: BaseSpacing,
|
|
1928
|
+
motion: {
|
|
1929
|
+
...BaseMotion,
|
|
1930
|
+
...motion
|
|
1931
|
+
},
|
|
1887
1932
|
thicknesses: {
|
|
1888
1933
|
...BaseThicknesses,
|
|
1889
1934
|
...thicknesses
|