@tamagui/web 1.80.4 → 1.81.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.
Files changed (68) hide show
  1. package/dist/cjs/createComponent.js +1 -1
  2. package/dist/cjs/createComponent.js.map +1 -1
  3. package/dist/cjs/createComponent.native.js.map +1 -1
  4. package/dist/cjs/helpers/createStyledContext.js +9 -3
  5. package/dist/cjs/helpers/createStyledContext.js.map +1 -1
  6. package/dist/cjs/helpers/createStyledContext.native.js +9 -3
  7. package/dist/cjs/helpers/createStyledContext.native.js.map +1 -1
  8. package/dist/cjs/helpers/getSplitStyles.js +12 -7
  9. package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
  10. package/dist/cjs/helpers/getSplitStyles.native.js +10 -5
  11. package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
  12. package/dist/cjs/helpers/objectIdentityKey.js +1 -1
  13. package/dist/cjs/helpers/objectIdentityKey.js.map +1 -1
  14. package/dist/cjs/helpers/objectIdentityKey.native.js +1 -1
  15. package/dist/cjs/helpers/objectIdentityKey.native.js.map +1 -1
  16. package/dist/cjs/helpers/propMapper.js +27 -21
  17. package/dist/cjs/helpers/propMapper.js.map +1 -1
  18. package/dist/cjs/helpers/propMapper.native.js +27 -21
  19. package/dist/cjs/helpers/propMapper.native.js.map +1 -1
  20. package/dist/cjs/styled.js.map +1 -1
  21. package/dist/cjs/styled.native.js.map +1 -1
  22. package/dist/cjs/views/Text.js +0 -1
  23. package/dist/cjs/views/Text.js.map +1 -1
  24. package/dist/cjs/views/Text.native.js +0 -1
  25. package/dist/cjs/views/Text.native.js.map +1 -1
  26. package/dist/esm/createComponent.js +1 -1
  27. package/dist/esm/createComponent.js.map +1 -1
  28. package/dist/esm/createComponent.native.js.map +1 -1
  29. package/dist/esm/helpers/createStyledContext.js +9 -3
  30. package/dist/esm/helpers/createStyledContext.js.map +1 -1
  31. package/dist/esm/helpers/createStyledContext.native.js +9 -3
  32. package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
  33. package/dist/esm/helpers/getSplitStyles.js +12 -7
  34. package/dist/esm/helpers/getSplitStyles.js.map +1 -1
  35. package/dist/esm/helpers/getSplitStyles.native.js +10 -5
  36. package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
  37. package/dist/esm/helpers/objectIdentityKey.js +1 -1
  38. package/dist/esm/helpers/objectIdentityKey.js.map +1 -1
  39. package/dist/esm/helpers/objectIdentityKey.native.js +1 -1
  40. package/dist/esm/helpers/objectIdentityKey.native.js.map +1 -1
  41. package/dist/esm/helpers/propMapper.js +26 -20
  42. package/dist/esm/helpers/propMapper.js.map +1 -1
  43. package/dist/esm/helpers/propMapper.native.js +26 -20
  44. package/dist/esm/helpers/propMapper.native.js.map +1 -1
  45. package/dist/esm/styled.js.map +1 -1
  46. package/dist/esm/styled.native.js.map +1 -1
  47. package/dist/esm/views/Text.js +0 -1
  48. package/dist/esm/views/Text.js.map +1 -1
  49. package/dist/esm/views/Text.native.js +0 -1
  50. package/dist/esm/views/Text.native.js.map +1 -1
  51. package/package.json +10 -10
  52. package/src/createComponent.tsx +3 -1
  53. package/src/helpers/createStyledContext.tsx +10 -3
  54. package/src/helpers/getSplitStyles.tsx +14 -6
  55. package/src/helpers/objectIdentityKey.tsx +1 -1
  56. package/src/helpers/propMapper.ts +36 -26
  57. package/src/styled.tsx +17 -6
  58. package/src/types.tsx +6 -19
  59. package/src/views/Text.tsx +0 -2
  60. package/types/createComponent.d.ts.map +1 -1
  61. package/types/helpers/createStyledContext.d.ts.map +1 -1
  62. package/types/helpers/getSplitStyles.d.ts.map +1 -1
  63. package/types/helpers/propMapper.d.ts.map +1 -1
  64. package/types/styled.d.ts +3 -3
  65. package/types/styled.d.ts.map +1 -1
  66. package/types/types.d.ts +6 -19
  67. package/types/types.d.ts.map +1 -1
  68. package/types/views/Text.d.ts.map +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/web",
3
- "version": "1.80.4",
3
+ "version": "1.81.0",
4
4
  "source": "src/index.ts",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -27,20 +27,20 @@
27
27
  "reset.css"
28
28
  ],
29
29
  "dependencies": {
30
- "@tamagui/compose-refs": "1.80.4",
31
- "@tamagui/constants": "1.80.4",
32
- "@tamagui/helpers": "1.80.4",
33
- "@tamagui/normalize-css-color": "1.80.4",
34
- "@tamagui/timer": "1.80.4",
35
- "@tamagui/use-did-finish-ssr": "1.80.4",
36
- "@tamagui/use-event": "1.80.4",
37
- "@tamagui/use-force-update": "1.80.4"
30
+ "@tamagui/compose-refs": "1.81.0",
31
+ "@tamagui/constants": "1.81.0",
32
+ "@tamagui/helpers": "1.81.0",
33
+ "@tamagui/normalize-css-color": "1.81.0",
34
+ "@tamagui/timer": "1.81.0",
35
+ "@tamagui/use-did-finish-ssr": "1.81.0",
36
+ "@tamagui/use-event": "1.81.0",
37
+ "@tamagui/use-force-update": "1.81.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "react": "*"
41
41
  },
42
42
  "devDependencies": {
43
- "@tamagui/build": "1.80.4",
43
+ "@tamagui/build": "1.81.0",
44
44
  "@testing-library/react": "^14.0.0",
45
45
  "csstype": "^3.0.10",
46
46
  "react": "^18.2.0",
@@ -944,7 +944,9 @@ export function createComponent<
944
944
  }
945
945
  viewProps.style = [...(Array.isArray(style) ? style : [style]), cnStyles]
946
946
  } else {
947
- viewProps.className = className
947
+ if (className) {
948
+ viewProps.className = className
949
+ }
948
950
  viewProps.style = style
949
951
  }
950
952
  } else {
@@ -30,13 +30,20 @@ export function createStyledContext<VariantProps extends Record<string, any>>(
30
30
  scope,
31
31
  ...values
32
32
  }: VariantProps & { children?: React.ReactNode; scope: string }) => {
33
- const value = useMemo(() => {
33
+ let current: any
34
+ try {
35
+ current = useStyledContext(scope)
36
+ } catch {
37
+ // ok
38
+ }
39
+ const next = useMemo(() => {
34
40
  return {
35
41
  // this ! is a workaround for ts error
36
42
  ...defaultValues!,
43
+ ...current,
37
44
  ...values,
38
45
  }
39
- }, [objectIdentityKey(values)])
46
+ }, [objectIdentityKey(values), current])
40
47
  let Provider = OGProvider
41
48
  if (scope) {
42
49
  let ScopedContext = scopedContexts.get(scope)
@@ -46,7 +53,7 @@ export function createStyledContext<VariantProps extends Record<string, any>>(
46
53
  }
47
54
  Provider = ScopedContext.Provider
48
55
  }
49
- return <Provider value={value}>{children}</Provider>
56
+ return <Provider value={next}>{children}</Provider>
50
57
  }
51
58
 
52
59
  // use consumerComponent just to give a better error message
@@ -126,6 +126,15 @@ export const PROP_SPLIT = '-'
126
126
  // dynamicThemeAccess,
127
127
  // }
128
128
 
129
+ function isValidStyleKey(key: string, staticConfig: StaticConfig) {
130
+ const validStyleProps =
131
+ staticConfig.validStyles ?? (staticConfig.isText ? stylePropsText : validStyles)
132
+ return (
133
+ key in validStyleProps ||
134
+ (staticConfig.acceptTokens && key in staticConfig.acceptTokens)
135
+ )
136
+ }
137
+
129
138
  export const getSplitStyles: StyleSplitter = (
130
139
  props,
131
140
  staticConfig,
@@ -162,7 +171,6 @@ export const getSplitStyles: StyleSplitter = (
162
171
  acceptsClassName,
163
172
  } = staticConfig
164
173
 
165
- const validStyleProps = isText ? stylePropsText : validStyles
166
174
  const viewProps: GetStyleResult['viewProps'] = {}
167
175
  const mediaState = styleProps.mediaState || globalMediaState
168
176
  const usedKeys: Record<string, number> = {}
@@ -296,13 +304,12 @@ export const getSplitStyles: StyleSplitter = (
296
304
  }
297
305
 
298
306
  const valInitType = typeof valInit
299
-
300
- styleState.curProps[keyInit] = valInit
307
+ const isValidStyleKeyInit = isValidStyleKey(keyInit, staticConfig)
301
308
 
302
309
  // TODO this is duplicated! but seems to be fixing some bugs so leaving got now
303
310
  if (process.env.TAMAGUI_TARGET === 'web') {
304
311
  if (valInitType === 'string' && valInit[0] === '_') {
305
- if (keyInit in validStyleProps || keyInit.includes('-')) {
312
+ if (isValidStyleKeyInit || keyInit.includes('-')) {
306
313
  if (process.env.NODE_ENV === 'development' && debug) {
307
314
  log(`Adding compiled style ${keyInit}: ${valInit}`)
308
315
  }
@@ -319,6 +326,8 @@ export const getSplitStyles: StyleSplitter = (
319
326
  }
320
327
  }
321
328
 
329
+ styleState.curProps[keyInit] = valInit
330
+
322
331
  if (process.env.TAMAGUI_TARGET === 'native') {
323
332
  if (!isAndroid) {
324
333
  // only works in android
@@ -529,7 +538,6 @@ export const getSplitStyles: StyleSplitter = (
529
538
  * for if there's a pseudo/media returned from it.
530
539
  */
531
540
 
532
- const isValidStyleKeyInit = keyInit in validStyleProps
533
541
  const isShorthand = keyInit in shorthands
534
542
 
535
543
  let isVariant = !isValidStyleKeyInit && variants && keyInit in variants
@@ -1059,7 +1067,7 @@ export const getSplitStyles: StyleSplitter = (
1059
1067
  // is HOC we can just pass through the styles as props
1060
1068
  // this fixes issues where style prop got merged with wrong priority
1061
1069
  !isHOC &&
1062
- (key in validStyleProps ||
1070
+ (isValidStyleKey(key, staticConfig) ||
1063
1071
  (process.env.TAMAGUI_TARGET === 'native' && isAndroid && key === 'elevation'))
1064
1072
  ) {
1065
1073
  mergeStyle(styleState, key, val)
@@ -4,7 +4,7 @@ export function objectIdentityKey(obj: Object) {
4
4
  k += key
5
5
  const arg = obj[key]
6
6
  let type = typeof arg
7
- if (!arg || type !== 'object') {
7
+ if (!arg || (type !== 'object' && type !== 'function')) {
8
8
  k += type + arg
9
9
  } else if (cache.has(arg)) {
10
10
  k += cache.get(arg)
@@ -378,7 +378,7 @@ export const getTokenForKey = (
378
378
  return value
379
379
  }
380
380
 
381
- const { theme, conf = getConfig(), context, fontFamily } = styleState
381
+ const { theme, conf = getConfig(), context, fontFamily, staticConfig } = styleState
382
382
 
383
383
  const tokensParsed = conf.tokensParsed
384
384
  let valOrVar: any
@@ -394,42 +394,52 @@ export const getTokenForKey = (
394
394
  hasSet = true
395
395
  valOrVar = conf.specificTokens[value]
396
396
  } else {
397
- switch (key) {
398
- case 'fontFamily': {
399
- const fontsParsed = context?.language
400
- ? getFontsForLanguage(conf.fontsParsed, context.language)
401
- : conf.fontsParsed
402
- valOrVar = fontsParsed[value]?.family || value
403
- lastFontFamilyToken = value
397
+ const customTokenAccept = staticConfig?.acceptTokens?.[key]
398
+ if (customTokenAccept) {
399
+ const val = tokensParsed[customTokenAccept][value]
400
+ if (val) {
401
+ valOrVar = val
404
402
  hasSet = true
405
- break
406
403
  }
407
- case 'fontSize':
408
- case 'lineHeight':
409
- case 'letterSpacing':
410
- case 'fontWeight': {
411
- const defaultFont = conf.defaultFont || '$body'
412
- const fam = fontFamily || defaultFont
413
- if (fam) {
404
+ } else {
405
+ switch (key) {
406
+ case 'fontFamily': {
414
407
  const fontsParsed = context?.language
415
408
  ? getFontsForLanguage(conf.fontsParsed, context.language)
416
409
  : conf.fontsParsed
417
- const font = fontsParsed[fam] || fontsParsed[defaultFont]
418
- valOrVar = font?.[fontShorthand[key] || key]?.[value] || value
410
+ valOrVar = fontsParsed[value]?.family || value
411
+ lastFontFamilyToken = value
419
412
  hasSet = true
413
+ break
414
+ }
415
+ case 'fontSize':
416
+ case 'lineHeight':
417
+ case 'letterSpacing':
418
+ case 'fontWeight': {
419
+ const defaultFont = conf.defaultFont || '$body'
420
+ const fam = fontFamily || defaultFont
421
+ if (fam) {
422
+ const fontsParsed = context?.language
423
+ ? getFontsForLanguage(conf.fontsParsed, context.language)
424
+ : conf.fontsParsed
425
+ const font = fontsParsed[fam] || fontsParsed[defaultFont]
426
+ valOrVar = font?.[fontShorthand[key] || key]?.[value] || value
427
+ hasSet = true
428
+ }
429
+ break
420
430
  }
421
- break
422
431
  }
423
- }
424
- for (const cat in tokenCategories) {
425
- if (key in tokenCategories[cat]) {
426
- const res = tokensParsed[cat][value]
427
- if (res != null) {
428
- valOrVar = res
429
- hasSet = true
432
+ for (const cat in tokenCategories) {
433
+ if (key in tokenCategories[cat]) {
434
+ const res = tokensParsed[cat][value]
435
+ if (res != null) {
436
+ valOrVar = res
437
+ hasSet = true
438
+ }
430
439
  }
431
440
  }
432
441
  }
442
+
433
443
  if (!hasSet) {
434
444
  const spaceVar = tokensParsed.space[value]
435
445
  if (spaceVar != null) {
package/src/styled.tsx CHANGED
@@ -5,15 +5,19 @@ import type { GetRef } from './interfaces/GetRef'
5
5
  import { getReactNativeConfig } from './setupReactNative'
6
6
  import type {
7
7
  GetProps,
8
+ GetTokenString,
8
9
  GetVariantValues,
9
10
  MediaProps,
10
11
  PseudoProps,
11
12
  StaticConfig,
12
13
  StylableComponent,
13
14
  TamaguiComponent,
15
+ ThemeValueByCategory,
16
+ Tokens,
14
17
  VariantDefinitions,
15
18
  VariantSpreadFunction,
16
19
  } from './types'
20
+ import { Stack } from './views/Stack'
17
21
 
18
22
  type GetBaseProps<A extends StylableComponent> = A extends TamaguiComponent<
19
23
  any,
@@ -49,7 +53,8 @@ type AreVariantsUndefined<V> = V extends undefined
49
53
 
50
54
  export function styled<
51
55
  ParentComponent extends StylableComponent,
52
- Variants extends VariantDefinitions<ParentComponent> | void
56
+ Variants extends VariantDefinitions<ParentComponent> | void,
57
+ StyledStaticConfig extends Partial<StaticConfig>
53
58
  >(
54
59
  ComponentIn: ParentComponent,
55
60
  // this should be Partial<GetProps<ParentComponent>> but causes excessively deep type issues
@@ -60,7 +65,7 @@ export function styled<
60
65
  context?: StyledContext
61
66
  acceptsClassName?: boolean
62
67
  },
63
- staticExtractionOptions?: Partial<StaticConfig>
68
+ staticExtractionOptions?: StyledStaticConfig
64
69
  ) {
65
70
  // do type stuff at top for easier readability
66
71
 
@@ -83,7 +88,14 @@ export function styled<
83
88
  | (Key extends keyof OurVariantProps ? OurVariantProps[Key] : undefined)
84
89
  }
85
90
 
86
- type OurPropsBaseBase = ParentPropsBase & MergedVariants
91
+ type AcceptedTokens = StyledStaticConfig['acceptTokens']
92
+ type CustomTokenProps = AcceptedTokens extends Object
93
+ ? {
94
+ [Key in keyof AcceptedTokens]: ThemeValueByCategory<AcceptedTokens[Key]>
95
+ }
96
+ : {}
97
+
98
+ type OurPropsBaseBase = ParentPropsBase & MergedVariants & CustomTokenProps
87
99
 
88
100
  /**
89
101
  * de-opting a bit of type niceness because were hitting depth issues too soon
@@ -94,16 +106,15 @@ export function styled<
94
106
  * that would give you nicely merged pseudo sub-styles but its just too much for TS
95
107
  * so now pseudos wont be nicely typed inside media queries, but at least we can nest
96
108
  */
97
- type OurPropsBase = OurPropsBaseBase
98
109
 
99
110
  type Props = Variants extends void
100
111
  ? GetProps<ParentComponent>
101
112
  : // start with base props
102
- OurPropsBase &
113
+ OurPropsBaseBase &
103
114
  // add in pseudo
104
115
  PseudoProps<Partial<OurPropsBaseBase>> &
105
116
  // add in media
106
- MediaProps<Partial<OurPropsBase>>
117
+ MediaProps<Partial<OurPropsBaseBase>>
107
118
 
108
119
  type ParentStaticProperties = {
109
120
  [Key in Exclude<
package/src/types.tsx CHANGED
@@ -1144,7 +1144,7 @@ export type ThemeValueFallbackZIndex =
1144
1144
  WebStyleValueUniversal
1145
1145
  >
1146
1146
 
1147
- type GetTokenString<A> = A extends string | number ? `$${A}` : `$${string}`
1147
+ export type GetTokenString<A> = A extends string | number ? `$${A}` : `$${string}`
1148
1148
 
1149
1149
  export type SpecificTokens<
1150
1150
  Record = Tokens,
@@ -1279,7 +1279,7 @@ export type ThemeValueByCategory<K extends string | number | symbol> = K extends
1279
1279
  ? FontLetterSpacingTokens
1280
1280
  : K extends keyof Tokens
1281
1281
  ? // fallback to user-defined tokens
1282
- GetTokenString<Tokens[K]>
1282
+ GetTokenString<keyof Tokens[K]>
1283
1283
  : never
1284
1284
 
1285
1285
  type FontKeys = 'fontFamily'
@@ -1628,9 +1628,11 @@ export type StaticConfigPublic = {
1628
1628
  validStyles?: { [key: string]: boolean }
1629
1629
 
1630
1630
  /**
1631
- * (compiler) If these props are encountered, bail on all optimization.
1631
+ * Accept Tamagui tokens for these props (key for the prop key, val for the token category)
1632
1632
  */
1633
- deoptProps?: Set<string>
1633
+ acceptTokens?: {
1634
+ [key: string]: keyof Tokens
1635
+ }
1634
1636
 
1635
1637
  /**
1636
1638
  * (compiler) If these props are encountered, leave them un-extracted.
@@ -1643,14 +1645,6 @@ export type StaticConfigPublic = {
1643
1645
  */
1644
1646
  inlineWhenUnflattened?: Set<string>
1645
1647
 
1646
- /**
1647
- * (compiler) A bit odd, only for more advanced hierarchies.
1648
- * Indicates that the component will set this prop so the
1649
- * static extraction can ensure it sets them to ={undefined}
1650
- * so they get overriddent. In the future, this can be smarter.
1651
- */
1652
- ensureOverriddenProp?: { [key: string]: boolean }
1653
-
1654
1648
  /**
1655
1649
  * Auto-detected, but can override. Wraps children to space them on top
1656
1650
  */
@@ -1691,13 +1685,6 @@ type StaticConfigBase = StaticConfigPublic & {
1691
1685
  */
1692
1686
  memo?: boolean
1693
1687
 
1694
- /**
1695
- * By default if styled() doesn't recognize a parent Tamagui component or specific react-native views,
1696
- * it will assume the passed in component only accepts style={} for react-native compatibility.
1697
- * Setting `acceptsClassName: true` indicates Tamagui can pass in className props.
1698
- */
1699
- acceptsClassName?: boolean
1700
-
1701
1688
  /**
1702
1689
  * Used internally for handling focus
1703
1690
  */
@@ -80,8 +80,6 @@ export const Text = createComponent<TextProps, Text, TextPropsBase>({
80
80
  },
81
81
  },
82
82
 
83
- deoptProps: new Set(process.env.TAMAGUI_TARGET === 'web' ? [] : ['ellipse']),
84
-
85
83
  validStyles: {
86
84
  ...validStyles,
87
85
  ...stylePropsTextOnly,
@@ -1 +1 @@
1
- {"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"AAIA,OAAO,KAaN,MAAM,OAAO,CAAA;AAuBd,OAAO,EAEL,SAAS,EAMT,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,cAAc,EACd,YAAY,EAEZ,gBAAgB,EAGhB,cAAc,EAEd,SAAS,EAKV,MAAM,SAAS,CAAA;AAoBhB,eAAO,MAAM,QAAQ,eAAsB,CAAA;AA6D3C,wBAAgB,eAAe,CA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C,CA2C7B;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,GAAG;KAAG,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM;CAAE,CAAA"}
1
+ {"version":3,"file":"createStyledContext.d.ts","sourceRoot":"","sources":["../../src/helpers/createStyledContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAA;AAIjE,MAAM,MAAM,aAAa,CAAC,KAAK,SAAS,MAAM,GAAG,GAAG,IAAI,IAAI,CAC1D,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EACpB,UAAU,CACX,GAAG;IACF,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC7B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,QAAQ,EAAE,KAAK,CAAC,uBAAuB,CACrC,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,GAAG;QAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;QAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CACF,CAAA;IACD,gBAAgB,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,KAAK,CAAA;CAC5C,CAAA;AAED,wBAAgB,mBAAmB,CAAC,YAAY,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1E,aAAa,CAAC,EAAE,YAAY,GAC3B,aAAa,CAAC,YAAY,CAAC,CAkD7B;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,GAAG;KAAG,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM;CAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAEV,iBAAiB,EAC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,CAAA;AAMhE,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,EAE3B,WAAW,CAAC,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,SAAS,KACd,cAAc,CAAA;AAEnB,eAAO,MAAM,UAAU,MAAM,CAAA;AAgC7B,eAAO,MAAM,cAAc,EAAE,aA+rC5B,CAAA;AA2DD,eAAO,MAAM,WAAW,eACV,aAAa,UACjB,MAAM,WACL,MAAM,wBACO,OAAO,KAC5B,cA2BF,CAAA;AAqBD,eAAO,MAAM,cAAc,EAAE,aAQ5B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"propMapper.d.ts","sourceRoot":"","sources":["../../src/helpers/propMapper.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EACV,iBAAiB,EAEjB,qBAAqB,EAEtB,MAAM,UAAU,CAAA;AAOjB,eAAO,MAAM,UAAU,EAAE,UAuFxB,CAAA;AAgGD,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,qBAAqB,sBAkBtF;AAMD,eAAO,MAAM,uBAAuB,cAAe,GAAG,QAErD,CAAA;AA6ID,eAAO,MAAM,cAAc,QACpB,MAAM,SACJ,MAAM,wDAED,QAAQ,aAAa,CAAC,QAuFnC,CAAA"}
1
+ {"version":3,"file":"propMapper.d.ts","sourceRoot":"","sources":["../../src/helpers/propMapper.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EACV,iBAAiB,EAEjB,qBAAqB,EAEtB,MAAM,UAAU,CAAA;AAOjB,eAAO,MAAM,UAAU,EAAE,UAuFxB,CAAA;AAgGD,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,qBAAqB,sBAkBtF;AAMD,eAAO,MAAM,uBAAuB,cAAe,GAAG,QAErD,CAAA;AA6ID,eAAO,MAAM,cAAc,QACpB,MAAM,SACJ,MAAM,wDAED,QAAQ,aAAa,CAAC,QAiGnC,CAAA"}
package/types/styled.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { StyledContext } from './helpers/createStyledContext';
2
2
  import type { GetRef } from './interfaces/GetRef';
3
- import type { GetProps, GetVariantValues, MediaProps, PseudoProps, StaticConfig, StylableComponent, TamaguiComponent, VariantDefinitions, VariantSpreadFunction } from './types';
3
+ import type { GetProps, GetVariantValues, MediaProps, PseudoProps, StaticConfig, StylableComponent, TamaguiComponent, ThemeValueByCategory, VariantDefinitions, VariantSpreadFunction } from './types';
4
4
  type GetBaseProps<A extends StylableComponent> = A extends TamaguiComponent<any, any, infer P> ? P : GetProps<A>;
5
5
  type GetVariantProps<A extends StylableComponent> = A extends TamaguiComponent<any, any, any, infer V> ? V : {};
6
6
  type GetVariantAcceptedValues<V> = V extends Object ? {
@@ -8,12 +8,12 @@ type GetVariantAcceptedValues<V> = V extends Object ? {
8
8
  } : undefined;
9
9
  type ValueOf<T> = T[keyof T];
10
10
  type AreVariantsUndefined<V> = V extends undefined ? true : ValueOf<V> extends undefined ? true : false;
11
- export declare function styled<ParentComponent extends StylableComponent, Variants extends VariantDefinitions<ParentComponent> | void>(ComponentIn: ParentComponent, options?: GetProps<ParentComponent> & {
11
+ export declare function styled<ParentComponent extends StylableComponent, Variants extends VariantDefinitions<ParentComponent> | void, StyledStaticConfig extends Partial<StaticConfig>>(ComponentIn: ParentComponent, options?: GetProps<ParentComponent> & {
12
12
  name?: string;
13
13
  variants?: Variants | undefined;
14
14
  defaultVariants?: GetVariantAcceptedValues<Variants>;
15
15
  context?: StyledContext;
16
16
  acceptsClassName?: boolean;
17
- }, staticExtractionOptions?: Partial<StaticConfig>): TamaguiComponent<Variants extends void ? GetProps<ParentComponent> : GetBaseProps<ParentComponent> & (AreVariantsUndefined<Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>> extends true ? GetVariantProps<ParentComponent> : AreVariantsUndefined<GetVariantProps<ParentComponent>> extends true ? Variants extends undefined ? {} : GetVariantAcceptedValues<Variants> : { [Key in keyof GetVariantProps<ParentComponent> | keyof (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>)]?: (Key extends keyof GetVariantProps<ParentComponent> ? GetVariantProps<ParentComponent>[Key] : undefined) | (Key extends keyof (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>) ? (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>)[Key] : undefined) | undefined; }) & PseudoProps<Partial<GetBaseProps<ParentComponent> & (AreVariantsUndefined<Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>> extends true ? GetVariantProps<ParentComponent> : AreVariantsUndefined<GetVariantProps<ParentComponent>> extends true ? Variants extends undefined ? {} : GetVariantAcceptedValues<Variants> : { [Key in keyof GetVariantProps<ParentComponent> | keyof (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>)]?: (Key extends keyof GetVariantProps<ParentComponent> ? GetVariantProps<ParentComponent>[Key] : undefined) | (Key extends keyof (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>) ? (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>)[Key] : undefined) | undefined; })>> & MediaProps<Partial<GetBaseProps<ParentComponent> & (AreVariantsUndefined<Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>> extends true ? GetVariantProps<ParentComponent> : AreVariantsUndefined<GetVariantProps<ParentComponent>> extends true ? Variants extends undefined ? {} : GetVariantAcceptedValues<Variants> : { [Key in keyof GetVariantProps<ParentComponent> | keyof (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>)]?: (Key extends keyof GetVariantProps<ParentComponent> ? GetVariantProps<ParentComponent>[Key] : undefined) | (Key extends keyof (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>) ? (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>)[Key] : undefined) | undefined; })>>, GetRef<ParentComponent>, GetBaseProps<ParentComponent>, AreVariantsUndefined<Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>> extends true ? GetVariantProps<ParentComponent> : AreVariantsUndefined<GetVariantProps<ParentComponent>> extends true ? Variants extends undefined ? {} : GetVariantAcceptedValues<Variants> : { [Key in keyof GetVariantProps<ParentComponent> | keyof (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>)]?: (Key extends keyof GetVariantProps<ParentComponent> ? GetVariantProps<ParentComponent>[Key] : undefined) | (Key extends keyof (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>) ? (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>)[Key] : undefined) | undefined; }, { [Key_1 in Exclude<keyof ParentComponent, "defaultProps" | "propTypes" | "staticConfig" | "extractable" | "styleable" | "$$typeof">]: ParentComponent[Key_1]; }>;
17
+ }, staticExtractionOptions?: StyledStaticConfig): TamaguiComponent<Variants extends void ? GetProps<ParentComponent> : GetBaseProps<ParentComponent> & (AreVariantsUndefined<Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>> extends true ? GetVariantProps<ParentComponent> : AreVariantsUndefined<GetVariantProps<ParentComponent>> extends true ? Variants extends undefined ? {} : GetVariantAcceptedValues<Variants> : { [Key in keyof GetVariantProps<ParentComponent> | keyof (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>)]?: (Key extends keyof GetVariantProps<ParentComponent> ? GetVariantProps<ParentComponent>[Key] : undefined) | (Key extends keyof (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>) ? (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>)[Key] : undefined) | undefined; }) & (StyledStaticConfig["acceptTokens"] extends Object ? { [Key_1 in keyof StyledStaticConfig["acceptTokens"]]: ThemeValueByCategory<StyledStaticConfig["acceptTokens"][Key_1]>; } : {}) & PseudoProps<Partial<GetBaseProps<ParentComponent> & (AreVariantsUndefined<Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>> extends true ? GetVariantProps<ParentComponent> : AreVariantsUndefined<GetVariantProps<ParentComponent>> extends true ? Variants extends undefined ? {} : GetVariantAcceptedValues<Variants> : { [Key in keyof GetVariantProps<ParentComponent> | keyof (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>)]?: (Key extends keyof GetVariantProps<ParentComponent> ? GetVariantProps<ParentComponent>[Key] : undefined) | (Key extends keyof (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>) ? (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>)[Key] : undefined) | undefined; }) & (StyledStaticConfig["acceptTokens"] extends Object ? { [Key_1 in keyof StyledStaticConfig["acceptTokens"]]: ThemeValueByCategory<StyledStaticConfig["acceptTokens"][Key_1]>; } : {})>> & MediaProps<Partial<GetBaseProps<ParentComponent> & (AreVariantsUndefined<Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>> extends true ? GetVariantProps<ParentComponent> : AreVariantsUndefined<GetVariantProps<ParentComponent>> extends true ? Variants extends undefined ? {} : GetVariantAcceptedValues<Variants> : { [Key in keyof GetVariantProps<ParentComponent> | keyof (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>)]?: (Key extends keyof GetVariantProps<ParentComponent> ? GetVariantProps<ParentComponent>[Key] : undefined) | (Key extends keyof (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>) ? (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>)[Key] : undefined) | undefined; }) & (StyledStaticConfig["acceptTokens"] extends Object ? { [Key_1 in keyof StyledStaticConfig["acceptTokens"]]: ThemeValueByCategory<StyledStaticConfig["acceptTokens"][Key_1]>; } : {})>>, GetRef<ParentComponent>, GetBaseProps<ParentComponent>, AreVariantsUndefined<Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>> extends true ? GetVariantProps<ParentComponent> : AreVariantsUndefined<GetVariantProps<ParentComponent>> extends true ? Variants extends undefined ? {} : GetVariantAcceptedValues<Variants> : { [Key in keyof GetVariantProps<ParentComponent> | keyof (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>)]?: (Key extends keyof GetVariantProps<ParentComponent> ? GetVariantProps<ParentComponent>[Key] : undefined) | (Key extends keyof (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>) ? (Variants extends undefined ? {} : GetVariantAcceptedValues<Variants>)[Key] : undefined) | undefined; }, { [Key_2 in Exclude<keyof ParentComponent, "defaultProps" | "propTypes" | "staticConfig" | "extractable" | "styleable" | "$$typeof">]: ParentComponent[Key_2]; }>;
18
18
  export {};
19
19
  //# sourceMappingURL=styled.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../src/styled.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAE7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAEjD,OAAO,KAAK,EACV,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAEhB,KAAK,YAAY,CAAC,CAAC,SAAS,iBAAiB,IAAI,CAAC,SAAS,gBAAgB,CACzE,GAAG,EACH,GAAG,EACH,MAAM,CAAC,CACR,GACG,CAAC,GACD,QAAQ,CAAC,CAAC,CAAC,CAAA;AAEf,KAAK,eAAe,CAAC,CAAC,SAAS,iBAAiB,IAAI,CAAC,SAAS,gBAAgB,CAC5E,GAAG,EACH,GAAG,EACH,GAAG,EACH,MAAM,CAAC,CACR,GACG,CAAC,GACD,EAAE,CAAA;AAEN,KAAK,wBAAwB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAC/C;KACG,GAAG,IAAI,MAAM,C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B,CAAC,EAAE,OAAO,CAAA;CAC3B,EACD,uBAAuB,CAAC,EAAE,kBAAkB,8wHA6L7C"}
package/types/types.d.ts CHANGED
@@ -637,7 +637,7 @@ export type ThemeValueFallbackSize = GetThemeValueFallbackFor<AllowedValueSettin
637
637
  export type ThemeValueFallbackColor = ThemeValueFallback | GetThemeValueFallbackFor<AllowedValueSettingColor, never, SomewhatSpecificColorValue, UnionableString | UnionableNumber, WebStyleValueUniversal>;
638
638
  export type ThemeValueFallbackRadius = ThemeValueFallback | GetThemeValueFallbackFor<AllowedValueSettingRadius, never, UnionableNumber, UnionableNumber, WebStyleValueUniversal>;
639
639
  export type ThemeValueFallbackZIndex = ThemeValueFallback | GetThemeValueFallbackFor<AllowedValueSettingZIndex, never, UnionableNumber, UnionableNumber, WebStyleValueUniversal>;
640
- type GetTokenString<A> = A extends string | number ? `$${A}` : `$${string}`;
640
+ export type GetTokenString<A> = A extends string | number ? `$${A}` : `$${string}`;
641
641
  export type SpecificTokens<Record = Tokens, RK extends keyof Record = keyof Record> = RK extends string ? `$${RK}.${keyof Record[RK] extends string | number ? keyof Record[RK] : never}` : never;
642
642
  export type SpecificTokensSpecial = TamaguiSettings extends {
643
643
  autocompleteSpecificTokens: infer Val;
@@ -677,7 +677,7 @@ type ParseFont<A extends GenericFont> = {
677
677
  face: TokenPrefixedIfExists<A['face']>;
678
678
  };
679
679
  type TokenPrefixedIfExists<A> = A extends Object ? TokenPrefixed<A> : {};
680
- export type ThemeValueByCategory<K extends string | number | symbol> = K extends 'theme' ? ThemeTokens : K extends 'size' ? SizeTokens : K extends 'font' ? FontTokens : K extends 'fontSize' ? FontSizeTokens : K extends 'space' ? SpaceTokens : K extends 'color' ? ColorTokens : K extends 'zIndex' ? ZIndexTokens : K extends 'lineHeight' ? FontLineHeightTokens : K extends 'fontWeight' ? FontWeightTokens : K extends 'letterSpacing' ? FontLetterSpacingTokens : K extends keyof Tokens ? GetTokenString<Tokens[K]> : never;
680
+ export type ThemeValueByCategory<K extends string | number | symbol> = K extends 'theme' ? ThemeTokens : K extends 'size' ? SizeTokens : K extends 'font' ? FontTokens : K extends 'fontSize' ? FontSizeTokens : K extends 'space' ? SpaceTokens : K extends 'color' ? ColorTokens : K extends 'zIndex' ? ZIndexTokens : K extends 'lineHeight' ? FontLineHeightTokens : K extends 'fontWeight' ? FontWeightTokens : K extends 'letterSpacing' ? FontLetterSpacingTokens : K extends keyof Tokens ? GetTokenString<keyof Tokens[K]> : never;
681
681
  type FontKeys = 'fontFamily';
682
682
  type FontSizeKeys = 'fontSize';
683
683
  type FontWeightKeys = 'fontWeight';
@@ -847,9 +847,11 @@ export type StaticConfigPublic = {
847
847
  [key: string]: boolean;
848
848
  };
849
849
  /**
850
- * (compiler) If these props are encountered, bail on all optimization.
850
+ * Accept Tamagui tokens for these props (key for the prop key, val for the token category)
851
851
  */
852
- deoptProps?: Set<string>;
852
+ acceptTokens?: {
853
+ [key: string]: keyof Tokens;
854
+ };
853
855
  /**
854
856
  * (compiler) If these props are encountered, leave them un-extracted.
855
857
  */
@@ -859,15 +861,6 @@ export type StaticConfigPublic = {
859
861
  * Only applies to style attributes
860
862
  */
861
863
  inlineWhenUnflattened?: Set<string>;
862
- /**
863
- * (compiler) A bit odd, only for more advanced hierarchies.
864
- * Indicates that the component will set this prop so the
865
- * static extraction can ensure it sets them to ={undefined}
866
- * so they get overriddent. In the future, this can be smarter.
867
- */
868
- ensureOverriddenProp?: {
869
- [key: string]: boolean;
870
- };
871
864
  /**
872
865
  * Auto-detected, but can override. Wraps children to space them on top
873
866
  */
@@ -901,12 +894,6 @@ type StaticConfigBase = StaticConfigPublic & {
901
894
  * Memoize the component
902
895
  */
903
896
  memo?: boolean;
904
- /**
905
- * By default if styled() doesn't recognize a parent Tamagui component or specific react-native views,
906
- * it will assume the passed in component only accepts style={} for react-native compatibility.
907
- * Setting `acceptsClassName: true` indicates Tamagui can pass in className props.
908
- */
909
- acceptsClassName?: boolean;
910
897
  /**
911
898
  * Used internally for handling focus
912
899
  */