@hero-design/rn 8.36.0 → 8.36.2
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/.turbo/turbo-build.log +1 -1
- package/es/index.js +21 -7
- package/lib/index.js +21 -7
- package/package.json +7 -7
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +12 -0
- package/src/theme/components/list.ts +3 -3
- package/src/theme/global/index.ts +3 -0
- package/src/theme/global/shadows.ts +19 -0
- package/types/theme/global/index.d.ts +12 -0
- package/types/theme/global/shadows.d.ts +16 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -4,5 +4,5 @@ $ rollup -c
|
|
|
4
4
|
[1msrc/index.ts[22m → [1mlib/index.js, es/index.js[22m...[39m
|
|
5
5
|
[1m[33m(!) Plugin replace: @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.[39m[22m
|
|
6
6
|
[1m[33m(!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/root/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning[39m[22m
|
|
7
|
-
[32mcreated [1mlib/index.js, es/index.js[22m in [
|
|
7
|
+
[32mcreated [1mlib/index.js, es/index.js[22m in [1m26.5s[22m[39m
|
|
8
8
|
$ tsc --noEmit false --emitDeclarationOnly --project tsconfig.prod.json
|
package/es/index.js
CHANGED
|
@@ -1662,6 +1662,21 @@ var getRadii = function getRadii(baseRadius) {
|
|
|
1662
1662
|
};
|
|
1663
1663
|
};
|
|
1664
1664
|
|
|
1665
|
+
var getShadows = function getShadows(systemPalette) {
|
|
1666
|
+
return {
|
|
1667
|
+
"default": {
|
|
1668
|
+
shadowOffset: {
|
|
1669
|
+
width: 0,
|
|
1670
|
+
height: 2
|
|
1671
|
+
},
|
|
1672
|
+
shadowColor: systemPalette.secondaryOutline,
|
|
1673
|
+
shadowOpacity: 1,
|
|
1674
|
+
shadowRadius: 4,
|
|
1675
|
+
elevation: 10
|
|
1676
|
+
}
|
|
1677
|
+
};
|
|
1678
|
+
};
|
|
1679
|
+
|
|
1665
1680
|
var getGlobalTheme = function getGlobalTheme(scale, systemPalette) {
|
|
1666
1681
|
var fonts = getFonts(scale.font);
|
|
1667
1682
|
var fontSizes = getFontSizes(scale.fontSize);
|
|
@@ -1670,6 +1685,7 @@ var getGlobalTheme = function getGlobalTheme(scale, systemPalette) {
|
|
|
1670
1685
|
var space = getSpace(scale.space);
|
|
1671
1686
|
var sizes = getSizes(scale.size);
|
|
1672
1687
|
var radii = getRadii(scale.radius);
|
|
1688
|
+
var shadows = getShadows(systemPalette);
|
|
1673
1689
|
return {
|
|
1674
1690
|
colors: _objectSpread2({}, systemPalette),
|
|
1675
1691
|
fonts: fonts,
|
|
@@ -1678,7 +1694,8 @@ var getGlobalTheme = function getGlobalTheme(scale, systemPalette) {
|
|
|
1678
1694
|
borderWidths: borderWidths,
|
|
1679
1695
|
space: space,
|
|
1680
1696
|
sizes: sizes,
|
|
1681
|
-
radii: radii
|
|
1697
|
+
radii: radii,
|
|
1698
|
+
shadows: shadows
|
|
1682
1699
|
};
|
|
1683
1700
|
};
|
|
1684
1701
|
|
|
@@ -2416,11 +2433,8 @@ var getListTheme = function getListTheme(theme) {
|
|
|
2416
2433
|
leadingStatus: theme.radii.rounded
|
|
2417
2434
|
};
|
|
2418
2435
|
var shadows = {
|
|
2419
|
-
cardOffset:
|
|
2420
|
-
|
|
2421
|
-
height: 2
|
|
2422
|
-
},
|
|
2423
|
-
cardElevation: 10
|
|
2436
|
+
cardOffset: theme.shadows["default"].shadowOffset,
|
|
2437
|
+
cardElevation: theme.shadows["default"].elevation
|
|
2424
2438
|
};
|
|
2425
2439
|
var widths = {
|
|
2426
2440
|
leadingStatus: 8
|
|
@@ -2428,7 +2442,7 @@ var getListTheme = function getListTheme(theme) {
|
|
|
2428
2442
|
var opacity = {
|
|
2429
2443
|
disabled: 0.38,
|
|
2430
2444
|
enabled: 1,
|
|
2431
|
-
cardShadow:
|
|
2445
|
+
cardShadow: theme.shadows["default"].shadowOpacity
|
|
2432
2446
|
};
|
|
2433
2447
|
return {
|
|
2434
2448
|
colors: colors,
|
package/lib/index.js
CHANGED
|
@@ -1693,6 +1693,21 @@ var getRadii = function getRadii(baseRadius) {
|
|
|
1693
1693
|
};
|
|
1694
1694
|
};
|
|
1695
1695
|
|
|
1696
|
+
var getShadows = function getShadows(systemPalette) {
|
|
1697
|
+
return {
|
|
1698
|
+
"default": {
|
|
1699
|
+
shadowOffset: {
|
|
1700
|
+
width: 0,
|
|
1701
|
+
height: 2
|
|
1702
|
+
},
|
|
1703
|
+
shadowColor: systemPalette.secondaryOutline,
|
|
1704
|
+
shadowOpacity: 1,
|
|
1705
|
+
shadowRadius: 4,
|
|
1706
|
+
elevation: 10
|
|
1707
|
+
}
|
|
1708
|
+
};
|
|
1709
|
+
};
|
|
1710
|
+
|
|
1696
1711
|
var getGlobalTheme = function getGlobalTheme(scale, systemPalette) {
|
|
1697
1712
|
var fonts = getFonts(scale.font);
|
|
1698
1713
|
var fontSizes = getFontSizes(scale.fontSize);
|
|
@@ -1701,6 +1716,7 @@ var getGlobalTheme = function getGlobalTheme(scale, systemPalette) {
|
|
|
1701
1716
|
var space = getSpace(scale.space);
|
|
1702
1717
|
var sizes = getSizes(scale.size);
|
|
1703
1718
|
var radii = getRadii(scale.radius);
|
|
1719
|
+
var shadows = getShadows(systemPalette);
|
|
1704
1720
|
return {
|
|
1705
1721
|
colors: _objectSpread2({}, systemPalette),
|
|
1706
1722
|
fonts: fonts,
|
|
@@ -1709,7 +1725,8 @@ var getGlobalTheme = function getGlobalTheme(scale, systemPalette) {
|
|
|
1709
1725
|
borderWidths: borderWidths,
|
|
1710
1726
|
space: space,
|
|
1711
1727
|
sizes: sizes,
|
|
1712
|
-
radii: radii
|
|
1728
|
+
radii: radii,
|
|
1729
|
+
shadows: shadows
|
|
1713
1730
|
};
|
|
1714
1731
|
};
|
|
1715
1732
|
|
|
@@ -2447,11 +2464,8 @@ var getListTheme = function getListTheme(theme) {
|
|
|
2447
2464
|
leadingStatus: theme.radii.rounded
|
|
2448
2465
|
};
|
|
2449
2466
|
var shadows = {
|
|
2450
|
-
cardOffset:
|
|
2451
|
-
|
|
2452
|
-
height: 2
|
|
2453
|
-
},
|
|
2454
|
-
cardElevation: 10
|
|
2467
|
+
cardOffset: theme.shadows["default"].shadowOffset,
|
|
2468
|
+
cardElevation: theme.shadows["default"].elevation
|
|
2455
2469
|
};
|
|
2456
2470
|
var widths = {
|
|
2457
2471
|
leadingStatus: 8
|
|
@@ -2459,7 +2473,7 @@ var getListTheme = function getListTheme(theme) {
|
|
|
2459
2473
|
var opacity = {
|
|
2460
2474
|
disabled: 0.38,
|
|
2461
2475
|
enabled: 1,
|
|
2462
|
-
cardShadow:
|
|
2476
|
+
cardShadow: theme.shadows["default"].shadowOpacity
|
|
2463
2477
|
};
|
|
2464
2478
|
return {
|
|
2465
2479
|
colors: colors,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn",
|
|
3
|
-
"version": "8.36.
|
|
3
|
+
"version": "8.36.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@emotion/native": "^11.9.3",
|
|
23
23
|
"@emotion/react": "^11.9.3",
|
|
24
|
-
"@hero-design/colors": "8.36.
|
|
24
|
+
"@hero-design/colors": "8.36.2",
|
|
25
25
|
"date-fns": "^2.16.1",
|
|
26
26
|
"events": "^3.2.0",
|
|
27
27
|
"hero-editor": "^1.9.21",
|
|
28
28
|
"nanoid": "^4.0.2"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@hero-design/react-native-month-year-picker": "^8.36.
|
|
31
|
+
"@hero-design/react-native-month-year-picker": "^8.36.2",
|
|
32
32
|
"@react-native-community/datetimepicker": "^3.5.2",
|
|
33
33
|
"@react-native-community/slider": "4.1.12",
|
|
34
34
|
"react": "18.0.0",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"@babel/preset-typescript": "^7.17.12",
|
|
49
49
|
"@babel/runtime": "^7.18.9",
|
|
50
50
|
"@emotion/jest": "^11.9.3",
|
|
51
|
-
"@hero-design/eslint-plugin": "8.36.
|
|
52
|
-
"@hero-design/react-native-month-year-picker": "^8.36.
|
|
51
|
+
"@hero-design/eslint-plugin": "8.36.2",
|
|
52
|
+
"@hero-design/react-native-month-year-picker": "^8.36.2",
|
|
53
53
|
"@react-native-community/datetimepicker": "^3.5.2",
|
|
54
54
|
"@react-native-community/slider": "4.1.12",
|
|
55
55
|
"@rollup/plugin-babel": "^5.3.1",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"@types/react-native": "^0.67.7",
|
|
66
66
|
"@types/react-native-vector-icons": "^6.4.10",
|
|
67
67
|
"babel-plugin-inline-import": "^3.0.0",
|
|
68
|
-
"eslint-config-hd": "8.36.
|
|
68
|
+
"eslint-config-hd": "8.36.2",
|
|
69
69
|
"eslint-plugin-import": "^2.27.5",
|
|
70
70
|
"jest": "^27.3.1",
|
|
71
|
-
"prettier-config-hd": "8.36.
|
|
71
|
+
"prettier-config-hd": "8.36.2",
|
|
72
72
|
"react": "18.0.0",
|
|
73
73
|
"react-native": "0.69.7",
|
|
74
74
|
"react-native-gesture-handler": "~2.5.0",
|
|
@@ -1381,6 +1381,18 @@ Object {
|
|
|
1381
1381
|
"xxlarge": 20,
|
|
1382
1382
|
"xxxlarge": 24,
|
|
1383
1383
|
},
|
|
1384
|
+
"shadows": Object {
|
|
1385
|
+
"default": Object {
|
|
1386
|
+
"elevation": 10,
|
|
1387
|
+
"shadowColor": "#e8e9ea",
|
|
1388
|
+
"shadowOffset": Object {
|
|
1389
|
+
"height": 2,
|
|
1390
|
+
"width": 0,
|
|
1391
|
+
},
|
|
1392
|
+
"shadowOpacity": 1,
|
|
1393
|
+
"shadowRadius": 4,
|
|
1394
|
+
},
|
|
1395
|
+
},
|
|
1384
1396
|
"sizes": Object {
|
|
1385
1397
|
"14xlarge": 136,
|
|
1386
1398
|
"15xlarge": 144,
|
|
@@ -28,8 +28,8 @@ const getListTheme = (theme: GlobalTheme) => {
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const shadows = {
|
|
31
|
-
cardOffset:
|
|
32
|
-
cardElevation:
|
|
31
|
+
cardOffset: theme.shadows.default.shadowOffset,
|
|
32
|
+
cardElevation: theme.shadows.default.elevation,
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
const widths = {
|
|
@@ -39,7 +39,7 @@ const getListTheme = (theme: GlobalTheme) => {
|
|
|
39
39
|
const opacity = {
|
|
40
40
|
disabled: 0.38,
|
|
41
41
|
enabled: 1,
|
|
42
|
-
cardShadow:
|
|
42
|
+
cardShadow: theme.shadows.default.shadowOpacity,
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
return { colors, space, radii, widths, opacity, shadows };
|
|
@@ -12,6 +12,7 @@ import { getSizes } from './sizes';
|
|
|
12
12
|
import { getBorderWidths, getRadii } from './borders';
|
|
13
13
|
import type { Scale } from './scale';
|
|
14
14
|
import type { SystemPalette } from './colors/types';
|
|
15
|
+
import { getShadows } from './shadows';
|
|
15
16
|
|
|
16
17
|
const getGlobalTheme = (scale: Scale, systemPalette: SystemPalette) => {
|
|
17
18
|
const fonts = getFonts(scale.font);
|
|
@@ -21,6 +22,7 @@ const getGlobalTheme = (scale: Scale, systemPalette: SystemPalette) => {
|
|
|
21
22
|
const space = getSpace(scale.space);
|
|
22
23
|
const sizes = getSizes(scale.size);
|
|
23
24
|
const radii = getRadii(scale.radius);
|
|
25
|
+
const shadows = getShadows(systemPalette);
|
|
24
26
|
|
|
25
27
|
return {
|
|
26
28
|
colors: {
|
|
@@ -33,6 +35,7 @@ const getGlobalTheme = (scale: Scale, systemPalette: SystemPalette) => {
|
|
|
33
35
|
space,
|
|
34
36
|
sizes,
|
|
35
37
|
radii,
|
|
38
|
+
shadows,
|
|
36
39
|
};
|
|
37
40
|
};
|
|
38
41
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SystemPalette } from '.';
|
|
2
|
+
|
|
3
|
+
const getShadows = (systemPalette: SystemPalette) => ({
|
|
4
|
+
default: {
|
|
5
|
+
shadowOffset: {
|
|
6
|
+
width: 0,
|
|
7
|
+
height: 2,
|
|
8
|
+
},
|
|
9
|
+
shadowColor: systemPalette.secondaryOutline,
|
|
10
|
+
shadowOpacity: 1,
|
|
11
|
+
shadowRadius: 4,
|
|
12
|
+
elevation: 10,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
type Shadows = ReturnType<typeof getShadows>;
|
|
17
|
+
|
|
18
|
+
export { getShadows };
|
|
19
|
+
export type { Shadows };
|
|
@@ -59,6 +59,18 @@ declare const getGlobalTheme: (scale: Scale, systemPalette: SystemPalette) => {
|
|
|
59
59
|
space: import("./space").Space;
|
|
60
60
|
sizes: import("./sizes").Sizes;
|
|
61
61
|
radii: import("./borders").Radii;
|
|
62
|
+
shadows: {
|
|
63
|
+
default: {
|
|
64
|
+
shadowOffset: {
|
|
65
|
+
width: number;
|
|
66
|
+
height: number;
|
|
67
|
+
};
|
|
68
|
+
shadowColor: string;
|
|
69
|
+
shadowOpacity: number;
|
|
70
|
+
shadowRadius: number;
|
|
71
|
+
elevation: number;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
62
74
|
};
|
|
63
75
|
type GlobalTheme = ReturnType<typeof getGlobalTheme>;
|
|
64
76
|
export type { GlobalTheme, Scale, SystemPalette };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SystemPalette } from '.';
|
|
2
|
+
declare const getShadows: (systemPalette: SystemPalette) => {
|
|
3
|
+
default: {
|
|
4
|
+
shadowOffset: {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
};
|
|
8
|
+
shadowColor: string;
|
|
9
|
+
shadowOpacity: number;
|
|
10
|
+
shadowRadius: number;
|
|
11
|
+
elevation: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
type Shadows = ReturnType<typeof getShadows>;
|
|
15
|
+
export { getShadows };
|
|
16
|
+
export type { Shadows };
|