react-native-unistyles 2.0.0-alpha.4 → 2.0.0-alpha.6

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.
Files changed (96) hide show
  1. package/cxx/UnistylesRuntime.cpp +262 -0
  2. package/cxx/UnistylesRuntime.h +61 -0
  3. package/ios/UnistylesModule.mm +8 -3
  4. package/lib/commonjs/Unistyles.js +1 -1
  5. package/lib/commonjs/Unistyles.js.map +1 -1
  6. package/lib/commonjs/UnistylesEngine.js +9 -5
  7. package/lib/commonjs/UnistylesEngine.js.map +1 -1
  8. package/lib/commonjs/createStyleSheet.js.map +1 -1
  9. package/lib/commonjs/types/cxx.js +1 -2
  10. package/lib/commonjs/types/cxx.js.map +1 -1
  11. package/lib/commonjs/useStyles.js +0 -2
  12. package/lib/commonjs/useStyles.js.map +1 -1
  13. package/lib/commonjs/useUnistyles.js +9 -15
  14. package/lib/commonjs/useUnistyles.js.map +1 -1
  15. package/lib/commonjs/utils/breakpoints.js +23 -70
  16. package/lib/commonjs/utils/breakpoints.js.map +1 -1
  17. package/lib/commonjs/utils/common.js +8 -1
  18. package/lib/commonjs/utils/common.js.map +1 -1
  19. package/lib/commonjs/utils/index.js +7 -0
  20. package/lib/commonjs/utils/index.js.map +1 -1
  21. package/lib/commonjs/utils/mediaQueries.js +58 -149
  22. package/lib/commonjs/utils/mediaQueries.js.map +1 -1
  23. package/lib/commonjs/utils/styles.js +11 -51
  24. package/lib/commonjs/utils/styles.js.map +1 -1
  25. package/lib/module/Unistyles.js +2 -2
  26. package/lib/module/Unistyles.js.map +1 -1
  27. package/lib/module/UnistylesEngine.js +7 -3
  28. package/lib/module/UnistylesEngine.js.map +1 -1
  29. package/lib/module/createStyleSheet.js.map +1 -1
  30. package/lib/module/types/cxx.js +1 -2
  31. package/lib/module/types/cxx.js.map +1 -1
  32. package/lib/module/useStyles.js +0 -3
  33. package/lib/module/useStyles.js.map +1 -1
  34. package/lib/module/useUnistyles.js +9 -15
  35. package/lib/module/useUnistyles.js.map +1 -1
  36. package/lib/module/utils/breakpoints.js +24 -71
  37. package/lib/module/utils/breakpoints.js.map +1 -1
  38. package/lib/module/utils/common.js +7 -0
  39. package/lib/module/utils/common.js.map +1 -1
  40. package/lib/module/utils/index.js +1 -1
  41. package/lib/module/utils/index.js.map +1 -1
  42. package/lib/module/utils/mediaQueries.js +58 -149
  43. package/lib/module/utils/mediaQueries.js.map +1 -1
  44. package/lib/module/utils/styles.js +10 -51
  45. package/lib/module/utils/styles.js.map +1 -1
  46. package/lib/typescript/src/Unistyles.d.ts +2 -2
  47. package/lib/typescript/src/Unistyles.d.ts.map +1 -1
  48. package/lib/typescript/src/UnistylesEngine.d.ts +4 -1
  49. package/lib/typescript/src/UnistylesEngine.d.ts.map +1 -1
  50. package/lib/typescript/src/UnistylesRuntime.d.ts +2 -2
  51. package/lib/typescript/src/UnistylesRuntime.d.ts.map +1 -1
  52. package/lib/typescript/src/createStyleSheet.d.ts +2 -5
  53. package/lib/typescript/src/createStyleSheet.d.ts.map +1 -1
  54. package/lib/typescript/src/global.d.ts +2 -1
  55. package/lib/typescript/src/global.d.ts.map +1 -1
  56. package/lib/typescript/src/types/breakpoints.d.ts +2 -1
  57. package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
  58. package/lib/typescript/src/types/core.d.ts +18 -16
  59. package/lib/typescript/src/types/core.d.ts.map +1 -1
  60. package/lib/typescript/src/types/cxx.d.ts +15 -14
  61. package/lib/typescript/src/types/cxx.d.ts.map +1 -1
  62. package/lib/typescript/src/types/index.d.ts +1 -1
  63. package/lib/typescript/src/types/index.d.ts.map +1 -1
  64. package/lib/typescript/src/types/mediaQueries.d.ts +5 -3
  65. package/lib/typescript/src/types/mediaQueries.d.ts.map +1 -1
  66. package/lib/typescript/src/useStyles.d.ts +2 -4
  67. package/lib/typescript/src/useStyles.d.ts.map +1 -1
  68. package/lib/typescript/src/useUnistyles.d.ts +3 -1
  69. package/lib/typescript/src/useUnistyles.d.ts.map +1 -1
  70. package/lib/typescript/src/utils/breakpoints.d.ts +2 -60
  71. package/lib/typescript/src/utils/breakpoints.d.ts.map +1 -1
  72. package/lib/typescript/src/utils/common.d.ts +7 -0
  73. package/lib/typescript/src/utils/common.d.ts.map +1 -1
  74. package/lib/typescript/src/utils/index.d.ts +1 -1
  75. package/lib/typescript/src/utils/index.d.ts.map +1 -1
  76. package/lib/typescript/src/utils/mediaQueries.d.ts +8 -127
  77. package/lib/typescript/src/utils/mediaQueries.d.ts.map +1 -1
  78. package/lib/typescript/src/utils/styles.d.ts +1 -46
  79. package/lib/typescript/src/utils/styles.d.ts.map +1 -1
  80. package/package.json +10 -1
  81. package/src/Unistyles.ts +3 -3
  82. package/src/UnistylesEngine.ts +12 -3
  83. package/src/createStyleSheet.ts +2 -5
  84. package/src/global.ts +2 -1
  85. package/src/types/breakpoints.ts +6 -3
  86. package/src/types/core.ts +25 -22
  87. package/src/types/cxx.ts +17 -16
  88. package/src/types/index.ts +1 -1
  89. package/src/types/mediaQueries.ts +9 -4
  90. package/src/useStyles.ts +5 -8
  91. package/src/useUnistyles.ts +12 -24
  92. package/src/utils/breakpoints.ts +31 -74
  93. package/src/utils/common.ts +8 -0
  94. package/src/utils/index.ts +1 -1
  95. package/src/utils/mediaQueries.ts +105 -154
  96. package/src/utils/styles.ts +13 -55
@@ -1,80 +1,110 @@
1
+ import type { UnistylesBreakpoints } from 'react-native-unistyles'
1
2
  import type { ScreenSize } from '../types'
3
+ import type { MediaQueries } from '../types'
4
+
5
+ const parseLhs = (lhs: string, breakpoints: UnistylesBreakpoints, hasRhs: boolean) => {
6
+ const matches = lhs.match(/([([])|([^[\]()]+)|([\])])/g)
7
+
8
+ if (!hasRhs) {
9
+ const [openBracket, value, closeBracket] = matches as [string, string, string]
10
+ const spacelessValue = value?.trim()
11
+ const parsedNumber = Number(spacelessValue)
12
+
13
+ const parsedValue = isNaN(parsedNumber)
14
+ ? breakpoints[spacelessValue as keyof UnistylesBreakpoints] as number
15
+ : parsedNumber
16
+
17
+ return [
18
+ Number(openBracket === '('),
19
+ closeBracket === ')'
20
+ ? parsedValue - 1
21
+ : parsedValue
22
+ ]
23
+ }
24
+
25
+ const [openBracket, value] = matches as [string, string]
26
+
27
+ if (!value) {
28
+ return [Number(openBracket === '(')]
29
+ }
30
+
31
+ const spacelessValue = value?.trim()
32
+ const parsedNumber = Number(spacelessValue)
33
+
34
+ const parsedValue = isNaN(parsedNumber)
35
+ ? breakpoints[spacelessValue as keyof UnistylesBreakpoints] as number
36
+ : parsedNumber
37
+
38
+ return openBracket === '('
39
+ ? [parsedValue - 1]
40
+ : [parsedValue]
41
+ }
42
+
43
+ const parseRhs = (rhs: string, breakpoints: UnistylesBreakpoints) => {
44
+ const matches = rhs.match(/([([])|([^[\]()]+)|([\])])/g)
45
+ const [value, closeBrackets] = matches as [string, string]
46
+ const spacelessValue = value.trim()
47
+ const parsedNumber = Number(spacelessValue)
48
+
49
+ const parsedValue = isNaN(parsedNumber)
50
+ ? breakpoints[spacelessValue as keyof UnistylesBreakpoints] as number
51
+ : parsedNumber
52
+
53
+ return [
54
+ closeBrackets === ')'
55
+ ? parsedValue - 1
56
+ : parsedValue
57
+ ]
58
+ }
2
59
 
3
- /**
4
- * Extracts numeric values from a coded string.
5
- *
6
- * The function is designed to process strings that have a format like "w[100,200]" or "h[300]".
7
- * It removes characters 'w', 'h', '[', and ']' from the input string and then extracts the numbers.
8
- *
9
- * @param {string} codedValue - The input string to extract values from.
10
- * @returns {Array<number>} An array of extracted numbers. Can contain one or two numbers based on the input format.
11
- *
12
- * @example
13
- * extractValues("w[100,200]") // returns [100, 200]
14
- * extractValues("h[300]") // returns [300]
15
- * extractValues("h[,300]") // returns [0,300]
16
- * extractValues("h[100,]") // returns [100]
17
- */
18
- export const extractValues = (codedValue: string): Array<number> => {
19
- const [lh, rh] = codedValue
20
- .replace(/[wh[\]]/g, '')
21
- .split(',')
22
-
23
- return rh
24
- ? [Number(lh), Number(rh)]
25
- : [Number(lh)]
60
+ export const extractValues = (pattern: string, breakpoints: UnistylesBreakpoints): Array<number> => {
61
+ const [lhs, rhs] = pattern
62
+ .replace(/(:w|:h)/g, '')
63
+ .split(',') as [string, string | undefined]
64
+
65
+ if (!rhs) {
66
+ return parseLhs(lhs, breakpoints, false)
67
+ }
68
+
69
+ const [parsedLhs] = parseLhs(lhs, breakpoints, true)
70
+
71
+ if (parsedLhs === undefined || isNaN(parsedLhs)) {
72
+ return []
73
+ }
74
+
75
+ const [parsedRhs] = parseRhs(rhs, breakpoints)
76
+
77
+ if (parsedRhs === undefined || isNaN(parsedRhs)) {
78
+ return []
79
+ }
80
+
81
+ return [
82
+ parsedLhs,
83
+ parsedRhs
84
+ ]
26
85
  }
27
86
 
28
- /**
29
- * Determines if the given screen size matches the specified breakpoint query.
30
- *
31
- * The function checks if the screen size (width and/or height) falls within the range
32
- * specified by the breakpoint query. The query can specify width (using 'w'), height (using 'h'),
33
- * or both.
34
- *
35
- * @param {string} query - The breakpoint query string. Examples: 'w[100,200]', 'h[300]', 'w[100,200]h[300,400]'.
36
- * @param {ScreenSize} screenSize - The screen size to check against the breakpoint query.
37
- * @returns {boolean} True if the screen size matches the breakpoint query, false otherwise.
38
- *
39
- * @example
40
- * const screenSize = { width: 150, height: 350 }
41
- * isWithinBreakpoint('w[100,200]', screenSize) // returns true
42
- * isWithinBreakpoint('h[400]', screenSize) // returns false
43
- */
44
- export const isWithinBreakpoint = (query: string, screenSize: ScreenSize): boolean => {
45
- if (query.includes('w') && query.includes('h')) {
46
- return isWithinTheWidthAndHeight(query, screenSize)
87
+ export const isWithinBreakpoint = (query: string, screenSize: ScreenSize, breakpoints: UnistylesBreakpoints): boolean => {
88
+ const hasWidthBreakpoint = query.includes(':w')
89
+ const hasHeightBreakpoint = query.includes(':h')
90
+
91
+ if (hasWidthBreakpoint && hasHeightBreakpoint) {
92
+ return isWithinTheWidthAndHeight(query, screenSize, breakpoints)
47
93
  }
48
94
 
49
- if (query.charAt(0) === 'w') {
50
- return isWithinTheWidth(query, screenSize.width)
95
+ if (hasWidthBreakpoint) {
96
+ return isWithinTheWidth(query, screenSize.width, breakpoints)
51
97
  }
52
98
 
53
- if (query.charAt(0) === 'h') {
54
- return isWithinTheHeight(query, screenSize.height)
99
+ if (hasHeightBreakpoint) {
100
+ return isWithinTheHeight(query, screenSize.height, breakpoints)
55
101
  }
56
102
 
57
103
  return false
58
104
  }
59
105
 
60
- /**
61
- * Determines if the given width matches the specified width range in the query.
62
- *
63
- * The function checks if the provided width falls within the range specified by the query.
64
- * The query specifies a width range using a format like 'w[100,200]'. If only one value is provided,
65
- * it's treated as a minimum width.
66
- *
67
- * @param {string} query - The width query string. Examples: 'w[100,200]' or 'w[100]'.
68
- * @param {number} width - The width to check against the query.
69
- * @returns {boolean} True if the width matches the query range, false otherwise.
70
- *
71
- * @example
72
- * isWithinTheWidth('w[100,200]', 150) // returns true
73
- * isWithinTheWidth('w[100]', 50) // returns false
74
- * isWithinTheWidth('w[100]', 150) // returns true
75
- */
76
- export const isWithinTheWidth = (query: string, width: number): boolean => {
77
- const [minWidth, maxWidth] = extractValues(query) as [number, number | undefined]
106
+ export const isWithinTheWidth = (query: string, width: number, breakpoints: UnistylesBreakpoints): boolean => {
107
+ const [minWidth, maxWidth] = extractValues(query, breakpoints) as [number, number | undefined]
78
108
 
79
109
  if (maxWidth && width >= minWidth && width <= maxWidth) {
80
110
  return true
@@ -83,24 +113,8 @@ export const isWithinTheWidth = (query: string, width: number): boolean => {
83
113
  return !maxWidth && width >= minWidth
84
114
  }
85
115
 
86
- /**
87
- * Determines if the given height matches the specified height range in the query.
88
- *
89
- * The function checks if the provided height falls within the range specified by the query.
90
- * The query specifies a height range using a format like 'h[100,200]'. If only one value is provided,
91
- * it's treated as a minimum height.
92
- *
93
- * @param {string} query - The height query string. Examples: 'h[100,200]' or 'h[100]'.
94
- * @param {number} height - The height to check against the query.
95
- * @returns {boolean} True if the height matches the query range, false otherwise.
96
- *
97
- * @example
98
- * isWithinTheHeight('h[100,200]', 150) // returns true
99
- * isWithinTheHeight('h[100]', 50) // returns false
100
- * isWithinTheHeight('h[100]', 150) // returns true
101
- */
102
- export const isWithinTheHeight = (query: string, height: number): boolean => {
103
- const [minHeight, maxHeight] = extractValues(query) as [number, number | undefined]
116
+ export const isWithinTheHeight = (query: string, height: number, breakpoints: UnistylesBreakpoints): boolean => {
117
+ const [minHeight, maxHeight] = extractValues(query, breakpoints) as [number, number | undefined]
104
118
 
105
119
  if (maxHeight && height >= minHeight && height <= maxHeight) {
106
120
  return true
@@ -109,92 +123,29 @@ export const isWithinTheHeight = (query: string, height: number): boolean => {
109
123
  return !maxHeight && height >= minHeight
110
124
  }
111
125
 
112
- /**
113
- * Determines if the given screen size matches both the specified width and height ranges in the query.
114
- *
115
- * The function checks if the provided screen size (both width and height) falls within the ranges
116
- * specified by the query. The query can specify both width and height using a format like 'w[100,200]:h[300,400]'.
117
- *
118
- * @param {string} query - The combined width and height query string. Example: 'w[100,200]:h[300,400]'.
119
- * @param {ScreenSize} screenSize - The screen size to check against the query.
120
- * @returns {boolean} True if the screen size matches both the width and height ranges in the query, false otherwise.
121
- *
122
- * @example
123
- * const screenSize = { width: 150, height: 350 }
124
- * isWithinTheWidthAndHeight('w[100,200]:h[300,400]', screenSize) // returns true
125
- * isWithinTheWidthAndHeight('w[100,200]:h[400,500]', screenSize) // returns false
126
- */
127
- export const isWithinTheWidthAndHeight = (query: string, screenSize: ScreenSize): boolean => {
126
+ export const isWithinTheWidthAndHeight = (query: string, screenSize: ScreenSize, breakpoints: UnistylesBreakpoints): boolean => {
128
127
  const result = query
129
128
  .split(':')
130
129
  .filter(Boolean)
131
- .map(q => isWithinBreakpoint(q, screenSize))
130
+ .map(q => isWithinBreakpoint(`:${q}`, screenSize, breakpoints))
132
131
  .filter(Boolean)
133
132
 
134
133
  return result.length === 2
135
134
  }
136
135
 
137
- /**
138
- * Checks if the given query string is a valid custom media query.
139
- *
140
- * The valid custom media query formats include:
141
- * - :w[200]
142
- * - :w[0, 200]
143
- * - :w[, 300]
144
- * - :h[200]
145
- * - :h[0, 500]
146
- * - :h[,200]
147
- * - :w[100, 300]:h[200,500]
148
- * - :h[200,500]:w[100, 300]
149
- *
150
- * @param {string} query - The query string to be checked.
151
- * @returns {boolean} Returns `true` if the query is a valid custom media query, otherwise `false`.
152
- * @example
153
- *
154
- * isMediaQuery(':w[200]') // true
155
- * isMediaQuery(':w100]') // false
156
- */
157
136
  export const isMediaQuery = (query: string): boolean => {
158
- const regex = /^(?:(:w\[\d*(?:,\s?\d+)?])?(:h\[\d*(?:,\s?\d+)?])?|(:h\[\d*(?:,\s?\d+)?])?(:w\[\d*(?:,\s?\d+)?])?)$/
137
+ const regex = /(:w|:h)/
159
138
 
160
139
  return query.length > 0 && regex.test(query)
161
140
  }
162
141
 
163
- /**
164
- * Retrieves the first matching custom media query key based on the provided screen size.
165
- *
166
- * The function processes an array of media queries and returns the first query that matches
167
- * the given screen size. The media queries can be in formats like:
168
- * - w[200]
169
- * - w[0, 200]
170
- * - w[, 300]
171
- * - h[200]
172
- * - h[0, 500]
173
- * - h[,200]
174
- * - w[100, 300]:h[200,500]
175
- * - h[200,500]:w[100, 300]
176
- *
177
- * @param {Array<[string, string | number]>} mediaQueries - An array of tuples containing media query keys and associated values.
178
- * @param {ScreenSize} screenSize - An object representing the screen size to be checked against the media queries.
179
- * @returns {string | undefined} Returns the first matching media query key or `undefined` if no match is found.
180
- * @example
181
- *
182
- * const queries = [[':w[200]', 'value1'], [':h[300,500]', 'value2']]
183
- * const size = { width: 250, height: 400 }
184
- * getKeyForCustomMediaQuery(queries, size) // ':w[200]
185
- */
186
- export const getKeyForCustomMediaQuery = (mediaQueries: Array<[string, string | number | undefined]>, screenSize: ScreenSize): string | undefined => {
142
+ export const getKeyForCustomMediaQuery = (
143
+ mediaQueries: Array<[keyof UnistylesBreakpoints | MediaQueries, string | number | undefined]>,
144
+ screenSize: ScreenSize,
145
+ breakpoints: UnistylesBreakpoints
146
+ ): string | undefined => {
187
147
  const [matchedQuery] = mediaQueries
188
- .flatMap(([key]) => {
189
- if (key.includes('w') && key.includes('h')) {
190
- return isWithinBreakpoint(key, screenSize) ? key : undefined
191
- }
192
-
193
- return key
194
- .split(':')
195
- .filter(Boolean)
196
- .map(query => isWithinBreakpoint(query, screenSize) ? key : undefined)
197
- })
148
+ .flatMap(([key]) => isWithinBreakpoint(key, screenSize, breakpoints) ? key : undefined)
198
149
  .filter(Boolean)
199
150
 
200
151
  return matchedQuery
@@ -1,30 +1,9 @@
1
- import type { CustomNamedStyles, ScreenSize } from '../types'
1
+ import type { CustomNamedStyles, MediaQueries, ScreenSize } from '../types'
2
2
  import { getValueForBreakpoint } from './breakpoints'
3
3
  import { normalizeStyles } from './normalizeStyles'
4
- import { isWeb } from './common'
5
4
  import type { UnistylesBreakpoints } from '../global'
5
+ import { isAndroid, isIOS, isWeb } from './common'
6
6
 
7
- /**
8
- * Proxies a function to parse its return value for custom media queries or breakpoints.
9
- *
10
- * @template B - An object type where keys represent breakpoint names and values represent breakpoint values.
11
- *
12
- * @param {Function} fn - The function to be proxified.
13
- * @param {keyof B & string} breakpoint - The breakpoint name to check against.
14
- * @param {ScreenSize} screenSize - An object representing the screen size to be checked against the media queries.
15
- * @param breakpointPairs - sorted pairs of breakpoints
16
- *
17
- * @returns {Function} Returns the proxified function
18
- *
19
- * @example
20
- *
21
- * const myFunction = () => ({ ':w[200]': 'value1', sm: 'value2' })
22
- * const screenSize = { width: 250, height: 400 }
23
- * const breakpoints = { sm: 300, md: 600 }
24
- *
25
- * const proxifiedFunction = proxifyFunction(myFunction, 'sm', screenSize, breakpoints)
26
- * proxifiedFunction() // parsed style based on screenSize and breakpoints
27
- */
28
7
  export const proxifyFunction = (
29
8
  fn: Function, breakpoint: keyof UnistylesBreakpoints & string,
30
9
  screenSize: ScreenSize
@@ -33,37 +12,20 @@ export const proxifyFunction = (
33
12
  parseStyle(target.apply(thisArg, argumentsList), breakpoint, screenSize)
34
13
  })
35
14
 
36
- /**
37
- * Parses a style object to resolve custom media queries or breakpoints based on the provided screen size and breakpoints.
38
- *
39
- * The function processes each key-value pair in the style object. If the value is a function or a valid style (not an object or a 'transform' key),
40
- * it is returned as-is. Otherwise, the function attempts to resolve the value based on the provided breakpoint, screen size, and defined breakpoints.
41
- *
42
- * @template T - The type of the style object.
43
- * @template B - An object type where keys represent breakpoint names and values represent breakpoint values.
44
- *
45
- * @param {CustomNamedStyles<T, B>} style - The style object to be parsed.
46
- * @param {keyof B & string} breakpoint - The breakpoint name to check against.
47
- * @param {ScreenSize} screenSize - An object representing the screen size to be checked against the media queries.
48
- * @param breakpointPairs - sorted pairs of breakpoints
49
- *
50
- * @returns {Record<string, string | number | Function>} Returns the parsed style object with resolved custom media queries or breakpoints.
51
- *
52
- * @example
53
- *
54
- * const style = { fontSize: { sm: '12px', md: '16px' } }
55
- * const screenSize = { width: 300, height: 400 }
56
- * const breakpoints = { xs: 0, sm: 300, md: 600 }
57
- *
58
- * const parsedStyle = parseStyle(style, 'sm', screenSize, breakpoints)
59
- * // { fontSize: '12px' }
60
- */
15
+ export const isPlatformColor = <T extends {}>(value: T): boolean => {
16
+ if (isIOS) {
17
+ return 'semantic' in value && typeof value.semantic === 'object'
18
+ }
19
+
20
+ return isAndroid && 'resource_paths' in value && typeof value.resource_paths === 'object'
21
+ }
22
+
61
23
  export const parseStyle = <T>(
62
24
  style: CustomNamedStyles<T>,
63
25
  breakpoint: keyof UnistylesBreakpoints & string,
64
26
  screenSize: ScreenSize
65
27
  ): T => {
66
- const entries = Object.entries(style) as [[
28
+ const entries = Object.entries(style || {}) as [[
67
29
  keyof T,
68
30
  CustomNamedStyles<T> | Record<keyof UnistylesBreakpoints & string, string | number | undefined>]
69
31
  ]
@@ -90,7 +52,7 @@ export const parseStyle = <T>(
90
52
  }
91
53
 
92
54
  const isDynamicFunction = typeof value === 'function'
93
- const isValidStyle = typeof value !== 'object'
55
+ const isValidStyle = typeof value !== 'object' || isPlatformColor(value)
94
56
 
95
57
  if (isDynamicFunction || isValidStyle) {
96
58
  return [key, value]
@@ -98,11 +60,7 @@ export const parseStyle = <T>(
98
60
 
99
61
  return [
100
62
  key,
101
- getValueForBreakpoint(
102
- value as Record<keyof UnistylesBreakpoints & string, string | number | undefined>,
103
- breakpoint,
104
- screenSize
105
- )
63
+ getValueForBreakpoint(value as Record<keyof UnistylesBreakpoints | MediaQueries, string | number | undefined>)
106
64
  ]
107
65
  })
108
66
  )