@tamagui/web 2.0.0-1768427228811 → 2.0.0-1768586279389
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/_withStableStyle.cjs +5 -2
- package/dist/cjs/_withStableStyle.js +3 -3
- package/dist/cjs/_withStableStyle.js.map +1 -1
- package/dist/cjs/_withStableStyle.native.js +10 -2
- package/dist/cjs/_withStableStyle.native.js.map +1 -1
- package/dist/cjs/helpers/expandStyle.js.map +1 -1
- package/dist/cjs/helpers/expandStyle.native.js +62 -13
- package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
- package/dist/cjs/helpers/getDynamicVal.cjs +22 -1
- package/dist/cjs/helpers/getDynamicVal.js +22 -1
- package/dist/cjs/helpers/getDynamicVal.js.map +1 -1
- package/dist/cjs/helpers/getDynamicVal.native.js +22 -1
- package/dist/cjs/helpers/getDynamicVal.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.cjs +1 -19
- package/dist/cjs/helpers/getSplitStyles.js +2 -25
- package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.native.js +8 -4
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/propMapper.cjs +34 -12
- package/dist/cjs/helpers/propMapper.js +28 -12
- package/dist/cjs/helpers/propMapper.js.map +1 -1
- package/dist/cjs/helpers/propMapper.native.js +60 -14
- package/dist/cjs/helpers/propMapper.native.js.map +1 -1
- package/dist/esm/_withStableStyle.js +3 -2
- package/dist/esm/_withStableStyle.js.map +1 -1
- package/dist/esm/_withStableStyle.mjs +5 -2
- package/dist/esm/_withStableStyle.mjs.map +1 -1
- package/dist/esm/_withStableStyle.native.js +10 -2
- package/dist/esm/_withStableStyle.native.js.map +1 -1
- package/dist/esm/helpers/expandStyle.js.map +1 -1
- package/dist/esm/helpers/expandStyle.mjs.map +1 -1
- package/dist/esm/helpers/expandStyle.native.js +67 -18
- package/dist/esm/helpers/expandStyle.native.js.map +1 -1
- package/dist/esm/helpers/getDynamicVal.js +22 -1
- package/dist/esm/helpers/getDynamicVal.js.map +1 -1
- package/dist/esm/helpers/getDynamicVal.mjs +21 -1
- package/dist/esm/helpers/getDynamicVal.mjs.map +1 -1
- package/dist/esm/helpers/getDynamicVal.native.js +21 -1
- package/dist/esm/helpers/getDynamicVal.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +4 -32
- package/dist/esm/helpers/getSplitStyles.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +4 -22
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +9 -5
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/propMapper.js +28 -12
- package/dist/esm/helpers/propMapper.js.map +1 -1
- package/dist/esm/helpers/propMapper.mjs +34 -12
- package/dist/esm/helpers/propMapper.mjs.map +1 -1
- package/dist/esm/helpers/propMapper.native.js +57 -11
- package/dist/esm/helpers/propMapper.native.js.map +1 -1
- package/package.json +12 -12
- package/src/_withStableStyle.tsx +14 -1
- package/src/helpers/expandStyle.native.ts +124 -0
- package/src/helpers/expandStyle.ts +1 -9
- package/src/helpers/getDynamicVal.ts +35 -0
- package/src/helpers/getSplitStyles.tsx +34 -13
- package/src/helpers/propMapper.native.ts +619 -0
- package/src/helpers/propMapper.ts +85 -20
- package/src/types.tsx +79 -15
- package/types/_withStableStyle.d.ts.map +1 -1
- package/types/helpers/expandStyle.d.ts.map +1 -1
- package/types/helpers/expandStyle.native.d.ts +7 -0
- package/types/helpers/expandStyle.native.d.ts.map +1 -0
- package/types/helpers/getDynamicVal.d.ts +4 -0
- package/types/helpers/getDynamicVal.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/propMapper.d.ts.map +1 -1
- package/types/helpers/propMapper.native.d.ts +5 -0
- package/types/helpers/propMapper.native.d.ts.map +1 -0
- package/types/helpers/webPropsToSkip.native.d.ts +0 -6
- package/types/helpers/webPropsToSkip.native.d.ts.map +1 -1
- package/types/types.d.ts +59 -15
- package/types/types.d.ts.map +1 -1
|
@@ -20,16 +20,70 @@ import { pseudoDescriptors } from './pseudoDescriptors'
|
|
|
20
20
|
import { isRemValue, resolveRem } from './resolveRem'
|
|
21
21
|
import { skipProps } from './skipProps'
|
|
22
22
|
|
|
23
|
-
//
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
// Web-only: convert boxShadow object/array to CSS string
|
|
24
|
+
const normLen = (v: any) => (typeof v === 'number' ? v + 'px' : String(v))
|
|
25
|
+
|
|
26
|
+
const boxShadowObjToStr = (
|
|
27
|
+
value: any,
|
|
28
|
+
styleProps: SplitStyleProps,
|
|
29
|
+
styleState: Partial<GetStyleState>
|
|
30
|
+
): string =>
|
|
31
|
+
(Array.isArray(value) ? value : [value])
|
|
32
|
+
.map((s) => {
|
|
33
|
+
const tok = (v: any, cat: string) =>
|
|
34
|
+
typeof v === 'string' && v[0] === '$'
|
|
35
|
+
? (getTokenForKey(cat, v, styleProps, styleState) ?? v)
|
|
36
|
+
: v
|
|
37
|
+
const x = normLen(tok(s.offsetX, 'size'))
|
|
38
|
+
const y = normLen(tok(s.offsetY, 'size'))
|
|
39
|
+
const blur = s.blurRadius != null ? ' ' + normLen(tok(s.blurRadius, 'size')) : ''
|
|
40
|
+
const spread =
|
|
41
|
+
s.spreadDistance != null
|
|
42
|
+
? (blur ? '' : ' 0') + ' ' + normLen(tok(s.spreadDistance, 'size'))
|
|
43
|
+
: ''
|
|
44
|
+
const color = s.color != null ? ' ' + tok(s.color, 'color') : ''
|
|
45
|
+
return (s.inset ? 'inset ' : '') + x + ' ' + y + blur + spread + color
|
|
46
|
+
})
|
|
47
|
+
.join(', ')
|
|
48
|
+
|
|
49
|
+
// Web-only: convert filter object/array to CSS string
|
|
50
|
+
const simpleFilters = [
|
|
51
|
+
'brightness',
|
|
52
|
+
'opacity',
|
|
53
|
+
'contrast',
|
|
54
|
+
'grayscale',
|
|
55
|
+
'invert',
|
|
56
|
+
'saturate',
|
|
57
|
+
'sepia',
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
const filterObjToStr = (
|
|
61
|
+
value: any,
|
|
62
|
+
styleProps: SplitStyleProps,
|
|
63
|
+
styleState: Partial<GetStyleState>
|
|
64
|
+
): string =>
|
|
65
|
+
(Array.isArray(value) ? value : [value])
|
|
66
|
+
.map((f) => {
|
|
67
|
+
const tok = (v: any, cat: string) =>
|
|
68
|
+
typeof v === 'string' && v[0] === '$'
|
|
69
|
+
? (getTokenForKey(cat, v, styleProps, styleState) ?? v)
|
|
70
|
+
: v
|
|
71
|
+
for (const fn of simpleFilters) if (fn in f) return `${fn}(${f[fn]})`
|
|
72
|
+
if ('blur' in f) return `blur(${normLen(tok(f.blur, 'size'))})`
|
|
73
|
+
if ('hueRotate' in f) return `hue-rotate(${f.hueRotate})`
|
|
74
|
+
if ('dropShadow' in f) {
|
|
75
|
+
const ds = f.dropShadow
|
|
76
|
+
const x = normLen(tok(ds.offsetX, 'size'))
|
|
77
|
+
const y = normLen(tok(ds.offsetY, 'size'))
|
|
78
|
+
const blur =
|
|
79
|
+
ds.blurRadius != null ? ` ${normLen(tok(ds.blurRadius, 'size'))}` : ''
|
|
80
|
+
const color = ds.color != null ? ` ${tok(ds.color, 'color')}` : ''
|
|
81
|
+
return `drop-shadow(${x} ${y}${blur}${color})`
|
|
82
|
+
}
|
|
83
|
+
return ''
|
|
84
|
+
})
|
|
85
|
+
.filter(Boolean)
|
|
86
|
+
.join(' ')
|
|
33
87
|
|
|
34
88
|
export const propMapper: PropMapper = (key, value, styleState, disabled, map) => {
|
|
35
89
|
if (disabled) {
|
|
@@ -78,17 +132,28 @@ export const propMapper: PropMapper = (key, value, styleState, disabled, map) =>
|
|
|
78
132
|
const originalValue = value
|
|
79
133
|
|
|
80
134
|
if (value != null) {
|
|
81
|
-
|
|
135
|
+
// boxShadow object/array -> string
|
|
136
|
+
if (key === 'boxShadow' && typeof value === 'object') {
|
|
137
|
+
value = boxShadowObjToStr(value, styleProps, styleState)
|
|
138
|
+
} else if (key === 'filter' && typeof value === 'object') {
|
|
139
|
+
// filter object/array -> string
|
|
140
|
+
value = filterObjToStr(value, styleProps, styleState)
|
|
141
|
+
} else if (typeof value === 'string' && value[0] === '$') {
|
|
82
142
|
value = getTokenForKey(key, value, styleProps, styleState)
|
|
83
|
-
} else if (
|
|
84
|
-
//
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
143
|
+
} else if (key === 'boxShadow' && typeof value === 'string' && value.includes('$')) {
|
|
144
|
+
// boxShadow with embedded $tokens - resolve each token
|
|
145
|
+
value = value.replace(/(\$[\w.-]+)/g, (t) => {
|
|
146
|
+
// $5, $-2 etc -> size token, otherwise -> color
|
|
147
|
+
const cat = /^\$-?\d/.test(t) ? 'size' : 'color'
|
|
148
|
+
const r = getTokenForKey(cat, t, styleProps, styleState)
|
|
149
|
+
return r != null ? String(r) : t
|
|
150
|
+
})
|
|
151
|
+
} else if (key === 'filter' && typeof value === 'string' && value.includes('$')) {
|
|
152
|
+
// filter with embedded $tokens - resolve each token
|
|
153
|
+
value = value.replace(/(\$[\w.-]+)/g, (t) => {
|
|
154
|
+
const cat = /^\$-?\d/.test(t) ? 'size' : 'color'
|
|
155
|
+
const r = getTokenForKey(cat, t, styleProps, styleState)
|
|
156
|
+
return r != null ? String(r) : t
|
|
92
157
|
})
|
|
93
158
|
} else if (isVariable(value)) {
|
|
94
159
|
value = resolveVariableValue(key, value, styleProps.resolveValues)
|
package/src/types.tsx
CHANGED
|
@@ -1756,29 +1756,92 @@ export interface TransformStyleProps {
|
|
|
1756
1756
|
rotateZ?: `${number}deg` | UnionableString
|
|
1757
1757
|
}
|
|
1758
1758
|
|
|
1759
|
+
// Box Shadow types (New Architecture)
|
|
1760
|
+
export interface BoxShadowObject {
|
|
1761
|
+
offsetX: SpaceTokens | number | (string & {})
|
|
1762
|
+
offsetY: SpaceTokens | number | (string & {})
|
|
1763
|
+
blurRadius?: SpaceTokens | number | (string & {})
|
|
1764
|
+
spreadDistance?: SpaceTokens | number | (string & {})
|
|
1765
|
+
color?: ColorStyleProp | (string & {})
|
|
1766
|
+
inset?: boolean
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
export type BoxShadowValue = BoxShadowObject | BoxShadowObject[] | (string & {})
|
|
1770
|
+
|
|
1771
|
+
// Filter types (New Architecture)
|
|
1772
|
+
export interface FilterBrightness {
|
|
1773
|
+
brightness: number | `${number}%`
|
|
1774
|
+
}
|
|
1775
|
+
export interface FilterOpacity {
|
|
1776
|
+
opacity: number | `${number}%`
|
|
1777
|
+
}
|
|
1778
|
+
export interface FilterBlur {
|
|
1779
|
+
blur: SpaceTokens | number | string
|
|
1780
|
+
}
|
|
1781
|
+
export interface FilterContrast {
|
|
1782
|
+
contrast: number | `${number}%`
|
|
1783
|
+
}
|
|
1784
|
+
export interface FilterGrayscale {
|
|
1785
|
+
grayscale: number | `${number}%`
|
|
1786
|
+
}
|
|
1787
|
+
export interface FilterHueRotate {
|
|
1788
|
+
hueRotate: `${number}deg` | `${number}rad`
|
|
1789
|
+
}
|
|
1790
|
+
export interface FilterInvert {
|
|
1791
|
+
invert: number | `${number}%`
|
|
1792
|
+
}
|
|
1793
|
+
export interface FilterSaturate {
|
|
1794
|
+
saturate: number | `${number}%`
|
|
1795
|
+
}
|
|
1796
|
+
export interface FilterSepia {
|
|
1797
|
+
sepia: number | `${number}%`
|
|
1798
|
+
}
|
|
1799
|
+
export interface FilterDropShadow {
|
|
1800
|
+
dropShadow: {
|
|
1801
|
+
offsetX: SpaceTokens | number | (string & {})
|
|
1802
|
+
offsetY: SpaceTokens | number | (string & {})
|
|
1803
|
+
blurRadius?: SpaceTokens | number | (string & {})
|
|
1804
|
+
color?: ColorStyleProp | (string & {})
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
export type FilterFunction =
|
|
1809
|
+
| FilterBrightness
|
|
1810
|
+
| FilterOpacity
|
|
1811
|
+
| FilterBlur
|
|
1812
|
+
| FilterContrast
|
|
1813
|
+
| FilterGrayscale
|
|
1814
|
+
| FilterHueRotate
|
|
1815
|
+
| FilterInvert
|
|
1816
|
+
| FilterSaturate
|
|
1817
|
+
| FilterSepia
|
|
1818
|
+
| FilterDropShadow
|
|
1819
|
+
|
|
1820
|
+
export type FilterValue = FilterFunction | FilterFunction[] | (string & {})
|
|
1821
|
+
|
|
1759
1822
|
interface ExtraStyleProps {
|
|
1760
1823
|
/**
|
|
1761
1824
|
* Web-only style property. Will be omitted on native.
|
|
1762
1825
|
*/
|
|
1763
1826
|
contain?: Properties['contain']
|
|
1764
1827
|
/**
|
|
1765
|
-
*
|
|
1828
|
+
* Cursor style. Supported on web, and iOS 17+ (trackpad/stylus/gaze).
|
|
1766
1829
|
*/
|
|
1767
1830
|
cursor?: Properties['cursor']
|
|
1768
1831
|
/**
|
|
1769
|
-
*
|
|
1832
|
+
* Outline color. Supported on web and native.
|
|
1770
1833
|
*/
|
|
1771
|
-
outlineColor?:
|
|
1834
|
+
outlineColor?: ColorStyleProp
|
|
1772
1835
|
/**
|
|
1773
|
-
*
|
|
1836
|
+
* Outline offset. Supported on web and native.
|
|
1774
1837
|
*/
|
|
1775
1838
|
outlineOffset?: SpaceValue
|
|
1776
1839
|
/**
|
|
1777
|
-
*
|
|
1840
|
+
* Outline style. Supported on web and native.
|
|
1778
1841
|
*/
|
|
1779
|
-
outlineStyle?:
|
|
1842
|
+
outlineStyle?: 'solid' | 'dotted' | 'dashed' | (string & {})
|
|
1780
1843
|
/**
|
|
1781
|
-
*
|
|
1844
|
+
* Outline width. Supported on web and native.
|
|
1782
1845
|
*/
|
|
1783
1846
|
outlineWidth?: SpaceValue
|
|
1784
1847
|
/**
|
|
@@ -1813,10 +1876,12 @@ interface ExtraStyleProps {
|
|
|
1813
1876
|
* Web-only style property. Will be omitted on native.
|
|
1814
1877
|
*/
|
|
1815
1878
|
backgroundSize?: Properties['backgroundSize']
|
|
1879
|
+
// boxSizing - provided by RN's ViewStyle
|
|
1816
1880
|
/**
|
|
1817
|
-
*
|
|
1881
|
+
* CSS box-shadow. Supports tokens: "$2 $4 $8 $shadowColor"
|
|
1882
|
+
* Also accepts object/array format. Supported on web and native.
|
|
1818
1883
|
*/
|
|
1819
|
-
|
|
1884
|
+
boxShadow?: BoxShadowValue
|
|
1820
1885
|
/**
|
|
1821
1886
|
* Web-only style property. Will be omitted on native.
|
|
1822
1887
|
*/
|
|
@@ -1842,13 +1907,12 @@ interface ExtraStyleProps {
|
|
|
1842
1907
|
| `${TwoValueTransformOrigin} ${Px}`
|
|
1843
1908
|
|
|
1844
1909
|
/**
|
|
1845
|
-
*
|
|
1846
|
-
|
|
1847
|
-
filter?: Properties['filter']
|
|
1848
|
-
/**
|
|
1849
|
-
* Web-only style property. Will be omitted on native.
|
|
1910
|
+
* Graphical filter effects. Supported on web and native.
|
|
1911
|
+
* Cross-platform: brightness, opacity. Android 12+: blur, contrast, dropShadow, etc.
|
|
1850
1912
|
*/
|
|
1851
|
-
|
|
1913
|
+
filter?: FilterValue
|
|
1914
|
+
// mixBlendMode - provided by RN's ViewStyle
|
|
1915
|
+
// isolation - provided by RN's ViewStyle
|
|
1852
1916
|
/**
|
|
1853
1917
|
* Web-only style property. Will be omitted on native.
|
|
1854
1918
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_withStableStyle.d.ts","sourceRoot":"","sources":["../src/_withStableStyle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"_withStableStyle.d.ts","sourceRoot":"","sources":["../src/_withStableStyle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,4DAA4D;AAE5D,eAAO,MAAM,gBAAgB,GAC3B,WAAW,GAAG,EACd,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,KAAK,MAAM,qFAkBvD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expandStyle.d.ts","sourceRoot":"","sources":["../../src/helpers/expandStyle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAQ/C,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,eAAe,
|
|
1
|
+
{"version":3,"file":"expandStyle.d.ts","sourceRoot":"","sources":["../../src/helpers/expandStyle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAQ/C,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,eAAe,CA2CpE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Some parts adapted from react-native-web
|
|
3
|
+
* Copyright (c) Nicolas Gallagher licensed under the MIT license.
|
|
4
|
+
*/
|
|
5
|
+
import type { PropMappedValue } from '../types';
|
|
6
|
+
export declare function expandStyle(key: string, value: any): PropMappedValue;
|
|
7
|
+
//# sourceMappingURL=expandStyle.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expandStyle.native.d.ts","sourceRoot":"","sources":["../../src/helpers/expandStyle.native.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AA8C/C,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,eAAe,CAwCpE"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export declare function getOppositeScheme(scheme: string): "light" | "dark";
|
|
2
|
+
/**
|
|
3
|
+
* Check if a style key is a color property that supports DynamicColorIOS.
|
|
4
|
+
*/
|
|
5
|
+
export declare function isColorStyleKey(key: string): boolean;
|
|
2
6
|
export declare function getDynamicVal({ scheme, val, oppositeVal, }: {
|
|
3
7
|
scheme: string;
|
|
4
8
|
val: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDynamicVal.d.ts","sourceRoot":"","sources":["../../src/helpers/getDynamicVal.ts"],"names":[],"mappings":"AAAA,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,oBAE/C;AAED,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,GAAG,EACH,WAAW,GACZ,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE;;;;EAQtD;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,OAK/D"}
|
|
1
|
+
{"version":3,"file":"getDynamicVal.d.ts","sourceRoot":"","sources":["../../src/helpers/getDynamicVal.ts"],"names":[],"mappings":"AAAA,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,oBAE/C;AA8BD;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,GAAG,EACH,WAAW,GACZ,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE;;;;EAQtD;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,OAK/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EACV,gBAAgB,EAEhB,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,aAAa,
|
|
1
|
+
{"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EACV,gBAAgB,EAEhB,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,aAAa,EAGb,eAAe,EACf,YAAY,EAEZ,qBAAqB,EAErB,SAAS,EACT,WAAW,EAEZ,MAAM,UAAU,CAAA;AA0BjB,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAE3D,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAOhE,eAAO,MAAM,mBAAmB,sCAA6C,CAAA;AAE7E,KAAK,aAAa,GAAG,CACnB,KAAK,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAC7B,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,qBAAqB,EACrC,UAAU,EAAE,eAAe,EAC3B,iBAAiB,CAAC,EAAE,cAAc,GAAG,IAAI,EACzC,OAAO,CAAC,EAAE,iBAAiB,EAC3B,YAAY,CAAC,EAAE,gBAAgB,GAAG,IAAI,EAEtC,WAAW,CAAC,EAAE,MAAM,EACpB,iBAAiB,CAAC,EAAE,OAAO,EAC3B,KAAK,CAAC,EAAE,SAAS,KACd,IAAI,GAAG,cAAc,CAAA;AAE1B,eAAO,MAAM,UAAU,MAAM,CAAA;AAoD7B,eAAO,MAAM,cAAc,EAAE,aAiuC5B,CAAA;AA+DD,eAAO,MAAM,WAAW,GACtB,YAAY,aAAa,EACzB,QAAQ,MAAM,EACd,SAAS,MAAM,EACf,sBAAsB,OAAO,KAC5B,SAyFF,CAAA;AAQD,eAAO,MAAM,cAAc,EAAE,aAY5B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propMapper.d.ts","sourceRoot":"","sources":["../../src/helpers/propMapper.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EAEV,eAAe,EAEf,qBAAqB,EAGtB,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"propMapper.d.ts","sourceRoot":"","sources":["../../src/helpers/propMapper.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EAEV,eAAe,EAEf,qBAAqB,EAGtB,MAAM,UAAU,CAAA;AA0EjB,eAAO,MAAM,UAAU,EAAE,UA8FxB,CAAA;AAoGD,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,qBAAqB,sBAkBtF;AAqKD,eAAO,MAAM,cAAc,GACzB,KAAK,MAAM,EACX,OAAO,MAAM,EACb,YAAY,eAAe,EAC3B,YAAY,OAAO,CAAC,aAAa,CAAC,QAsInC,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { GetStyleState, PropMapper, SplitStyleProps, TamaguiInternalConfig } from '../types';
|
|
2
|
+
export declare const propMapper: PropMapper;
|
|
3
|
+
export declare function getFontFamilyFromNameOrVariable(input: any, conf: TamaguiInternalConfig): string | undefined;
|
|
4
|
+
export declare const getTokenForKey: (key: string, value: string, styleProps: SplitStyleProps, styleState: Partial<GetStyleState>) => any;
|
|
5
|
+
//# sourceMappingURL=propMapper.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propMapper.native.d.ts","sourceRoot":"","sources":["../../src/helpers/propMapper.native.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EAEV,eAAe,EAEf,qBAAqB,EAGtB,MAAM,UAAU,CAAA;AA6DjB,eAAO,MAAM,UAAU,EAAE,UA8FxB,CAAA;AAoGD,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,qBAAqB,sBAkBtF;AAqKD,eAAO,MAAM,cAAc,GACzB,KAAK,MAAM,EACX,OAAO,MAAM,EACb,YAAY,eAAe,EAC3B,YAAY,OAAO,CAAC,aAAa,CAAC,QAsInC,CAAA"}
|
|
@@ -68,7 +68,6 @@ export declare const webPropsToSkip: {
|
|
|
68
68
|
borderLeftStyle: boolean;
|
|
69
69
|
borderRightStyle: boolean;
|
|
70
70
|
borderTopStyle: boolean;
|
|
71
|
-
boxSizing: boolean;
|
|
72
71
|
caretColor: boolean;
|
|
73
72
|
clipPath: boolean;
|
|
74
73
|
contain: boolean;
|
|
@@ -92,13 +91,8 @@ export declare const webPropsToSkip: {
|
|
|
92
91
|
maskRepeat: boolean;
|
|
93
92
|
maskSize: boolean;
|
|
94
93
|
maskType: boolean;
|
|
95
|
-
mixBlendMode: boolean;
|
|
96
94
|
objectFit: boolean;
|
|
97
95
|
objectPosition: boolean;
|
|
98
|
-
outlineOffset: boolean;
|
|
99
|
-
outlineStyle: boolean;
|
|
100
|
-
outlineWidth: boolean;
|
|
101
|
-
outlineColor: boolean;
|
|
102
96
|
overflowBlock: boolean;
|
|
103
97
|
overflowInline: boolean;
|
|
104
98
|
overflowX: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webPropsToSkip.native.d.ts","sourceRoot":"","sources":["../../src/helpers/webPropsToSkip.native.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"webPropsToSkip.native.d.ts","sourceRoot":"","sources":["../../src/helpers/webPropsToSkip.native.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4C1B,CAAA"}
|
package/types/types.d.ts
CHANGED
|
@@ -955,29 +955,75 @@ export interface TransformStyleProps {
|
|
|
955
955
|
rotateX?: `${number}deg` | UnionableString;
|
|
956
956
|
rotateZ?: `${number}deg` | UnionableString;
|
|
957
957
|
}
|
|
958
|
+
export interface BoxShadowObject {
|
|
959
|
+
offsetX: SpaceTokens | number | (string & {});
|
|
960
|
+
offsetY: SpaceTokens | number | (string & {});
|
|
961
|
+
blurRadius?: SpaceTokens | number | (string & {});
|
|
962
|
+
spreadDistance?: SpaceTokens | number | (string & {});
|
|
963
|
+
color?: ColorStyleProp | (string & {});
|
|
964
|
+
inset?: boolean;
|
|
965
|
+
}
|
|
966
|
+
export type BoxShadowValue = BoxShadowObject | BoxShadowObject[] | (string & {});
|
|
967
|
+
export interface FilterBrightness {
|
|
968
|
+
brightness: number | `${number}%`;
|
|
969
|
+
}
|
|
970
|
+
export interface FilterOpacity {
|
|
971
|
+
opacity: number | `${number}%`;
|
|
972
|
+
}
|
|
973
|
+
export interface FilterBlur {
|
|
974
|
+
blur: SpaceTokens | number | string;
|
|
975
|
+
}
|
|
976
|
+
export interface FilterContrast {
|
|
977
|
+
contrast: number | `${number}%`;
|
|
978
|
+
}
|
|
979
|
+
export interface FilterGrayscale {
|
|
980
|
+
grayscale: number | `${number}%`;
|
|
981
|
+
}
|
|
982
|
+
export interface FilterHueRotate {
|
|
983
|
+
hueRotate: `${number}deg` | `${number}rad`;
|
|
984
|
+
}
|
|
985
|
+
export interface FilterInvert {
|
|
986
|
+
invert: number | `${number}%`;
|
|
987
|
+
}
|
|
988
|
+
export interface FilterSaturate {
|
|
989
|
+
saturate: number | `${number}%`;
|
|
990
|
+
}
|
|
991
|
+
export interface FilterSepia {
|
|
992
|
+
sepia: number | `${number}%`;
|
|
993
|
+
}
|
|
994
|
+
export interface FilterDropShadow {
|
|
995
|
+
dropShadow: {
|
|
996
|
+
offsetX: SpaceTokens | number | (string & {});
|
|
997
|
+
offsetY: SpaceTokens | number | (string & {});
|
|
998
|
+
blurRadius?: SpaceTokens | number | (string & {});
|
|
999
|
+
color?: ColorStyleProp | (string & {});
|
|
1000
|
+
};
|
|
1001
|
+
}
|
|
1002
|
+
export type FilterFunction = FilterBrightness | FilterOpacity | FilterBlur | FilterContrast | FilterGrayscale | FilterHueRotate | FilterInvert | FilterSaturate | FilterSepia | FilterDropShadow;
|
|
1003
|
+
export type FilterValue = FilterFunction | FilterFunction[] | (string & {});
|
|
958
1004
|
interface ExtraStyleProps {
|
|
959
1005
|
/**
|
|
960
1006
|
* Web-only style property. Will be omitted on native.
|
|
961
1007
|
*/
|
|
962
1008
|
contain?: Properties['contain'];
|
|
963
1009
|
/**
|
|
964
|
-
*
|
|
1010
|
+
* Cursor style. Supported on web, and iOS 17+ (trackpad/stylus/gaze).
|
|
965
1011
|
*/
|
|
966
1012
|
cursor?: Properties['cursor'];
|
|
967
1013
|
/**
|
|
968
|
-
*
|
|
1014
|
+
* Outline color. Supported on web and native.
|
|
969
1015
|
*/
|
|
970
|
-
outlineColor?:
|
|
1016
|
+
outlineColor?: ColorStyleProp;
|
|
971
1017
|
/**
|
|
972
|
-
*
|
|
1018
|
+
* Outline offset. Supported on web and native.
|
|
973
1019
|
*/
|
|
974
1020
|
outlineOffset?: SpaceValue;
|
|
975
1021
|
/**
|
|
976
|
-
*
|
|
1022
|
+
* Outline style. Supported on web and native.
|
|
977
1023
|
*/
|
|
978
|
-
outlineStyle?:
|
|
1024
|
+
outlineStyle?: 'solid' | 'dotted' | 'dashed' | (string & {});
|
|
979
1025
|
/**
|
|
980
|
-
*
|
|
1026
|
+
* Outline width. Supported on web and native.
|
|
981
1027
|
*/
|
|
982
1028
|
outlineWidth?: SpaceValue;
|
|
983
1029
|
/**
|
|
@@ -1013,9 +1059,10 @@ interface ExtraStyleProps {
|
|
|
1013
1059
|
*/
|
|
1014
1060
|
backgroundSize?: Properties['backgroundSize'];
|
|
1015
1061
|
/**
|
|
1016
|
-
*
|
|
1062
|
+
* CSS box-shadow. Supports tokens: "$2 $4 $8 $shadowColor"
|
|
1063
|
+
* Also accepts object/array format. Supported on web and native.
|
|
1017
1064
|
*/
|
|
1018
|
-
|
|
1065
|
+
boxShadow?: BoxShadowValue;
|
|
1019
1066
|
/**
|
|
1020
1067
|
* Web-only style property. Will be omitted on native.
|
|
1021
1068
|
*/
|
|
@@ -1030,13 +1077,10 @@ interface ExtraStyleProps {
|
|
|
1030
1077
|
*/
|
|
1031
1078
|
transformOrigin?: PxOrPct | 'left' | 'center' | 'right' | 'top' | 'bottom' | TwoValueTransformOrigin | `${TwoValueTransformOrigin} ${Px}`;
|
|
1032
1079
|
/**
|
|
1033
|
-
*
|
|
1034
|
-
|
|
1035
|
-
filter?: Properties['filter'];
|
|
1036
|
-
/**
|
|
1037
|
-
* Web-only style property. Will be omitted on native.
|
|
1080
|
+
* Graphical filter effects. Supported on web and native.
|
|
1081
|
+
* Cross-platform: brightness, opacity. Android 12+: blur, contrast, dropShadow, etc.
|
|
1038
1082
|
*/
|
|
1039
|
-
|
|
1083
|
+
filter?: FilterValue;
|
|
1040
1084
|
/**
|
|
1041
1085
|
* Web-only style property. Will be omitted on native.
|
|
1042
1086
|
*/
|