@tamagui/web 1.77.1 → 1.79.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 (49) hide show
  1. package/dist/cjs/createTamagui.js +5 -1
  2. package/dist/cjs/createTamagui.js.map +1 -1
  3. package/dist/cjs/createTamagui.native.js +5 -1
  4. package/dist/cjs/createTamagui.native.js.map +1 -1
  5. package/dist/cjs/helpers/getSplitStyles.js +5 -5
  6. package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
  7. package/dist/cjs/helpers/getSplitStyles.native.js +4 -4
  8. package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
  9. package/dist/cjs/helpers/propMapper.js +15 -4
  10. package/dist/cjs/helpers/propMapper.js.map +1 -1
  11. package/dist/cjs/helpers/propMapper.native.js +15 -4
  12. package/dist/cjs/helpers/propMapper.native.js.map +1 -1
  13. package/dist/cjs/views/Text.js +7 -4
  14. package/dist/cjs/views/Text.js.map +1 -1
  15. package/dist/cjs/views/Text.native.js +1 -0
  16. package/dist/cjs/views/Text.native.js.map +1 -1
  17. package/dist/esm/createTamagui.js +5 -1
  18. package/dist/esm/createTamagui.js.map +1 -1
  19. package/dist/esm/createTamagui.native.js +5 -1
  20. package/dist/esm/createTamagui.native.js.map +1 -1
  21. package/dist/esm/helpers/getSplitStyles.js +5 -5
  22. package/dist/esm/helpers/getSplitStyles.js.map +1 -1
  23. package/dist/esm/helpers/getSplitStyles.native.js +4 -4
  24. package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
  25. package/dist/esm/helpers/propMapper.js +14 -4
  26. package/dist/esm/helpers/propMapper.js.map +1 -1
  27. package/dist/esm/helpers/propMapper.native.js +14 -4
  28. package/dist/esm/helpers/propMapper.native.js.map +1 -1
  29. package/dist/esm/views/Text.js +7 -4
  30. package/dist/esm/views/Text.js.map +1 -1
  31. package/dist/esm/views/Text.native.js +1 -0
  32. package/dist/esm/views/Text.native.js.map +1 -1
  33. package/package.json +9 -9
  34. package/src/createComponent.tsx +1 -1
  35. package/src/createTamagui.ts +5 -1
  36. package/src/helpers/getSplitStyles.tsx +4 -6
  37. package/src/helpers/propMapper.ts +19 -1
  38. package/src/types.tsx +34 -19
  39. package/src/views/Text.tsx +13 -9
  40. package/types/createComponent.d.ts +1 -1
  41. package/types/createComponent.d.ts.map +1 -1
  42. package/types/createTamagui.d.ts.map +1 -1
  43. package/types/helpers/getSplitStyles.d.ts.map +1 -1
  44. package/types/helpers/propMapper.d.ts.map +1 -1
  45. package/types/hooks/useConfiguration.d.ts +2 -1
  46. package/types/hooks/useConfiguration.d.ts.map +1 -1
  47. package/types/types.d.ts +19 -12
  48. package/types/types.d.ts.map +1 -1
  49. package/types/views/Text.d.ts.map +1 -1
@@ -77,8 +77,6 @@ import {
77
77
  import { getPropMappedFontFamily, propMapper } from './propMapper'
78
78
  import { pseudoDescriptors, pseudoPriorities } from './pseudoDescriptors'
79
79
 
80
- const fontFamilyKey = 'fontFamily'
81
-
82
80
  // bugfix for some reason it gets reset
83
81
  const IS_STATIC = process.env.IS_STATIC === 'is_static'
84
82
 
@@ -188,7 +186,7 @@ export const getSplitStyles: StyleSplitter = (
188
186
  * Not the biggest fan of creating an object but it is a nice API
189
187
  */
190
188
  const styleState: GetStyleState = {
191
- curProps: Object.assign({}, props),
189
+ curProps: { ...props },
192
190
  classNames,
193
191
  conf,
194
192
  props,
@@ -274,7 +272,7 @@ export const getSplitStyles: StyleSplitter = (
274
272
  if (process.env.TAMAGUI_TARGET === 'web') {
275
273
  // add container style
276
274
  const identifier = `t_group_${valInit}`
277
- const containerType = conf.settings.webContainerType || 'size'
275
+ const containerType = conf.settings.webContainerType || 'inline-size'
278
276
  const containerCSS = {
279
277
  identifier,
280
278
  property: 'container',
@@ -623,7 +621,7 @@ export const getSplitStyles: StyleSplitter = (
623
621
  if (isText) {
624
622
  if (
625
623
  valInit &&
626
- (keyInit === fontFamilyKey || keyInit === shorthands[fontFamilyKey]) &&
624
+ (keyInit === 'fontFamily' || keyInit === shorthands['fontFamily']) &&
627
625
  valInit in conf.fontsParsed
628
626
  ) {
629
627
  styleState.fontFamily = valInit
@@ -1032,7 +1030,7 @@ export const getSplitStyles: StyleSplitter = (
1032
1030
  mediaState[mediaKeyShort],
1033
1031
  importanceBump
1034
1032
  )
1035
- if (key === fontFamilyKey) {
1033
+ if (key === 'fontFamily') {
1036
1034
  styleState.fontFamily = mediaStyle.fontFamily as string
1037
1035
  }
1038
1036
  }
@@ -24,6 +24,13 @@ export const propMapper: PropMapper = (key, value, styleStateIn, subPropsIn) =>
24
24
  if (key === 'elevationAndroid') return
25
25
  }
26
26
 
27
+ if (value === 'unset') {
28
+ const unsetVal = styleStateIn.conf.unset?.[key]
29
+ if (unsetVal != null) {
30
+ value = unsetVal
31
+ }
32
+ }
33
+
27
34
  // we use this for the sub-props like pseudos so we need to overwrite the "props" in styleState
28
35
  // fallbackProps is awkward thanks to static
29
36
  // also we need to override the props here because subStyles pass in a sub-style props object
@@ -85,7 +92,15 @@ export const propMapper: PropMapper = (key, value, styleStateIn, subPropsIn) =>
85
92
  }
86
93
 
87
94
  if (shouldReturn || value != null) {
88
- return (styleProps.noExpand ? null : expandStyle(key, value)) || [[key, value]]
95
+ const result = (styleProps.noExpand ? null : expandStyle(key, value)) || [
96
+ [key, value],
97
+ ]
98
+
99
+ if (key === 'fontFamily') {
100
+ fontFamilyCache.set(result, lastFontFamilyToken)
101
+ }
102
+
103
+ return result
89
104
  }
90
105
  }
91
106
 
@@ -348,6 +363,8 @@ const fontShorthand = {
348
363
  fontWeight: 'weight',
349
364
  }
350
365
 
366
+ let lastFontFamilyToken: any = null
367
+
351
368
  export const getTokenForKey = (
352
369
  key: string,
353
370
  value: string,
@@ -380,6 +397,7 @@ export const getTokenForKey = (
380
397
  ? getFontsForLanguage(conf.fontsParsed, context.language)
381
398
  : conf.fontsParsed
382
399
  valOrVar = fontsParsed[value]?.family || value
400
+ lastFontFamilyToken = value
383
401
  hasSet = true
384
402
  break
385
403
  }
package/src/types.tsx CHANGED
@@ -112,7 +112,7 @@ export type TamaguiComponentPropsBaseBase = {
112
112
  tabIndex?: string | number
113
113
 
114
114
  /**
115
- * Equivalent to role="" attribute on web for accesibility
115
+ * Equivalent to role="" attribute on web for accessibility
116
116
  */
117
117
  role?: Role
118
118
 
@@ -539,7 +539,7 @@ type GetAltThemeNames<S> =
539
539
  type SpacerPropsBase = {
540
540
  size?: SpaceValue
541
541
  flex?: boolean | number
542
- direction?: SpaceDirection
542
+ direction?: SpaceDirection | 'unset'
543
543
  }
544
544
 
545
545
  type SpacerOwnProps = SpacerPropsBase &
@@ -629,7 +629,7 @@ type GenericTamaguiSettings = {
629
629
  *
630
630
  * 1. Only use light/dark changes of themes at the root of your app
631
631
  * 2. Don't use <Theme inverse> or themeInverse
632
- * 3. Always change light/dark alongside the Appearance.colorSheme
632
+ * 3. Always change light/dark alongside the Appearance.colorScheme
633
633
  *
634
634
  * Then this feature is safe to turn on and will significantly speed up dark/light re-renders.
635
635
  */
@@ -652,7 +652,16 @@ type GenericTamaguiSettings = {
652
652
 
653
653
  export type TamaguiSettings = TamaguiConfig['settings']
654
654
 
655
+ type AllStyleProps = keyof StackStyleProps
656
+
657
+ export type BaseStyleProps = {
658
+ [Key in keyof TextStylePropsBase]?: TextStyleProps[Key] | GetThemeValueForKey<Key>
659
+ } & {
660
+ [Key in keyof StackStylePropsBase]?: StackStyleProps[Key] | GetThemeValueForKey<Key>
661
+ }
662
+
655
663
  export type CreateTamaguiProps = {
664
+ unset?: BaseStyleProps
656
665
  reactNative?: any
657
666
  shorthands?: CreateShorthands
658
667
  media?: GenericTamaguiConfig['media']
@@ -1184,18 +1193,19 @@ export type ThemeValueGet<K extends string | number | symbol> = K extends 'theme
1184
1193
  ? FontLetterSpacingTokens
1185
1194
  : never
1186
1195
 
1196
+ export type GetThemeValueForKey<K extends string | symbol | number> =
1197
+ | ThemeValueGet<K>
1198
+ | ThemeValueFallback
1199
+ | (TamaguiSettings extends { autocompleteSpecificTokens: infer Val }
1200
+ ? Val extends true | undefined
1201
+ ? SpecificTokens
1202
+ : never
1203
+ : never)
1204
+
1187
1205
  export type WithThemeValues<T extends object> = {
1188
1206
  [K in keyof T]: ThemeValueGet<K> extends never
1189
- ? T[K]
1190
- :
1191
- | ThemeValueGet<K>
1192
- | Exclude<T[K], string>
1193
- | ThemeValueFallback
1194
- | (TamaguiSettings extends { autocompleteSpecificTokens: infer Val }
1195
- ? Val extends true | undefined
1196
- ? SpecificTokens
1197
- : never
1198
- : never)
1207
+ ? T[K] | 'unset'
1208
+ : GetThemeValueForKey<K> | Exclude<T[K], string> | 'unset'
1199
1209
  }
1200
1210
 
1201
1211
  type NarrowShorthands = Narrow<Shorthands>
@@ -1320,7 +1330,12 @@ type OmitRemovedNonWebProps = 'onLayout' | keyof GestureResponderHandlers
1320
1330
 
1321
1331
  export type StackNonStyleProps = Omit<
1322
1332
  ViewProps,
1323
- 'display' | 'children' | OmitRemovedNonWebProps | keyof ExtendBaseStackProps | 'style'
1333
+ | 'pointerEvents'
1334
+ | 'display'
1335
+ | 'children'
1336
+ | OmitRemovedNonWebProps
1337
+ | keyof ExtendBaseStackProps
1338
+ | 'style'
1324
1339
  > &
1325
1340
  ExtendBaseStackProps &
1326
1341
  TamaguiComponentPropsBase & {
@@ -1506,7 +1521,7 @@ export type StaticConfigPublic = {
1506
1521
  inlineWhenUnflattened?: Set<string>
1507
1522
 
1508
1523
  /**
1509
- * (compiler) A bit odd, only for more advanced heirarchies.
1524
+ * (compiler) A bit odd, only for more advanced hierarchies.
1510
1525
  * Indicates that the component will set this prop so the
1511
1526
  * static extraction can ensure it sets them to ={undefined}
1512
1527
  * so they get overriddent. In the future, this can be smarter.
@@ -1514,7 +1529,7 @@ export type StaticConfigPublic = {
1514
1529
  ensureOverriddenProp?: { [key: string]: boolean }
1515
1530
 
1516
1531
  /**
1517
- * Auto-detected, but can ovverride. Wraps children to space them on top
1532
+ * Auto-detected, but can override. Wraps children to space them on top
1518
1533
  */
1519
1534
  isZStack?: boolean
1520
1535
 
@@ -1524,7 +1539,7 @@ export type StaticConfigPublic = {
1524
1539
  isReactNative?: boolean
1525
1540
 
1526
1541
  /**
1527
- * By default if styled() doesn't recognize a parent Tamagui compoent or specific react-native views,
1542
+ * By default if styled() doesn't recognize a parent Tamagui component or specific react-native views,
1528
1543
  * it will assume the passed in component only accepts style={} for react-native compatibility.
1529
1544
  * Setting `acceptsClassName: true` indicates Tamagui can pass in className props.
1530
1545
  */
@@ -1544,7 +1559,7 @@ type StaticConfigBase = StaticConfigPublic & {
1544
1559
  componentName?: string
1545
1560
 
1546
1561
  /**
1547
- * Merges into defaultProps later on, used internally yonly
1562
+ * Merges into defaultProps later on, used internally only
1548
1563
  */
1549
1564
  defaultVariants?: { [key: string]: any }
1550
1565
 
@@ -1554,7 +1569,7 @@ type StaticConfigBase = StaticConfigPublic & {
1554
1569
  memo?: boolean
1555
1570
 
1556
1571
  /**
1557
- * By default if styled() doesn't recognize a parent Tamagui compoent or specific react-native views,
1572
+ * By default if styled() doesn't recognize a parent Tamagui component or specific react-native views,
1558
1573
  * it will assume the passed in component only accepts style={} for react-native compatibility.
1559
1574
  * Setting `acceptsClassName: true` indicates Tamagui can pass in className props.
1560
1575
  */
@@ -12,21 +12,25 @@ const ellipseStyle = {
12
12
 
13
13
  export type Text = TamaguiTextElement
14
14
 
15
+ const defaultWebStyle = {
16
+ display: 'inline',
17
+ boxSizing: 'border-box',
18
+ wordWrap: 'break-word',
19
+ margin: 0,
20
+ }
21
+
15
22
  export const Text = createComponent<TextProps, Text, TextPropsBase>({
16
23
  acceptsClassName: true,
17
24
  isText: true,
18
25
 
19
- defaultProps:
20
- process.env.TAMAGUI_TARGET === 'web'
21
- ? {
22
- display: 'inline',
23
- boxSizing: 'border-box',
24
- wordWrap: 'break-word',
25
- margin: 0,
26
- }
26
+ defaultProps: {
27
+ fontFamily: 'unset',
28
+ ...(process.env.TAMAGUI_TARGET === 'web'
29
+ ? defaultWebStyle
27
30
  : {
28
31
  suppressHighlighting: true,
29
- },
32
+ }),
33
+ },
30
34
 
31
35
  inlineWhenUnflattened: new Set(['fontFamily']),
32
36
 
@@ -11,7 +11,7 @@ export type SpacedChildrenProps = {
11
11
  children?: React.ReactNode;
12
12
  space?: SpaceValue;
13
13
  spaceFlex?: boolean | number;
14
- direction?: SpaceDirection;
14
+ direction?: SpaceDirection | 'unset';
15
15
  separator?: React.ReactNode;
16
16
  debug?: DebugProp;
17
17
  };
@@ -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,EAKT,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,YAAY,EAEZ,gBAAgB,EAGhB,cAAc,EAEd,SAAS,EAKV,MAAM,SAAS,CAAA;AAoBhB,eAAO,MAAM,QAAQ,eAAsB,CAAA;AA6D3C,wBAAgB,eAAe,CAC7B,kBAAkB,SAAS,UAAU,GAAG,SAAS,GAAG,EAAE,EACtD,GAAG,GAAG,cAAc,EACpB,SAAS,GAAG,KAAK,EACjB,YAAY,EAAE,YAAY,8DAsrC3B;AAsBD,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,OAEjD;AAiBD,eAAO,MAAM,MAAM,4DAqCjB,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC5B,SAAS,CAAC,EAAE,cAAc,CAAA;IAC1B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB,CAAA;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,mBAiGxD"}
1
+ {"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"AAIA,OAAO,KAaN,MAAM,OAAO,CAAA;AAuBd,OAAO,EAEL,SAAS,EAKT,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,YAAY,EAEZ,gBAAgB,EAGhB,cAAc,EAEd,SAAS,EAKV,MAAM,SAAS,CAAA;AAoBhB,eAAO,MAAM,QAAQ,eAAsB,CAAA;AA6D3C,wBAAgB,eAAe,CAC7B,kBAAkB,SAAS,UAAU,GAAG,SAAS,GAAG,EAAE,EACtD,GAAG,GAAG,cAAc,EACpB,SAAS,GAAG,KAAK,EACjB,YAAY,EAAE,YAAY,8DAsrC3B;AAsBD,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,OAEjD;AAiBD,eAAO,MAAM,MAAM,4DAqCjB,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC5B,SAAS,CAAC,EAAE,cAAc,GAAG,OAAO,CAAA;IACpC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB,CAAA;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,mBAiGxD"}
@@ -1 +1 @@
1
- {"version":3,"file":"createTamagui.d.ts","sourceRoot":"","sources":["../src/createTamagui.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,kBAAkB,EAKlB,kBAAkB,EAMnB,MAAM,SAAS,CAAA;AAKhB,wBAAgB,aAAa,CAAC,IAAI,SAAS,kBAAkB,EAC3D,QAAQ,EAAE,IAAI,GACb,kBAAkB,CAAC,IAAI,CAAC,CA+Q1B"}
1
+ {"version":3,"file":"createTamagui.d.ts","sourceRoot":"","sources":["../src/createTamagui.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,kBAAkB,EAKlB,kBAAkB,EAMnB,MAAM,SAAS,CAAA;AAKhB,wBAAgB,aAAa,CAAC,IAAI,SAAS,kBAAkB,EAC3D,QAAQ,EAAE,IAAI,GACb,kBAAkB,CAAC,IAAI,CAAC,CAmR1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAEV,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,aAAa,EAOb,eAAe,EACf,YAAY,EAEZ,qBAAqB,EAErB,cAAc,EACd,WAAW,EAEZ,MAAM,UAAU,CAAA;AA8BjB,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAE3D,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,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;AAuB7B,eAAO,MAAM,cAAc,EAAE,aAurC5B,CAAA;AA2DD,eAAO,MAAM,WAAW,eACV,aAAa,UACjB,MAAM,WACL,MAAM,wBACO,OAAO,KAC5B,cA2BF,CAAA;AAqBD,eAAO,MAAM,cAAc,EAAE,aAQ5B,CAAA"}
1
+ {"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAEV,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,aAAa,EAOb,eAAe,EACf,YAAY,EAEZ,qBAAqB,EAErB,cAAc,EACd,WAAW,EAEZ,MAAM,UAAU,CAAA;AA4BjB,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAE3D,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,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;AAuB7B,eAAO,MAAM,cAAc,EAAE,aAurC5B,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,UAqExB,CAAA;AAgGD,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,qBAAqB,sBAkBtF;AAMD,eAAO,MAAM,uBAAuB,cAAe,GAAG,QAErD,CAAA;AA2ID,eAAO,MAAM,cAAc,QACpB,MAAM,SACJ,MAAM,wDAED,QAAQ,aAAa,CAAC,QAsFnC,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,UAoFxB,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"}
@@ -7,6 +7,7 @@ export declare const useConfiguration: () => {
7
7
  language: Partial<{
8
8
  [x: string]: import("..").FontLanguages;
9
9
  }> | null;
10
+ unset?: import("..").BaseStyleProps | undefined;
10
11
  reactNative?: any;
11
12
  selectionStyles?: ((theme: Record<string, string>) => {
12
13
  backgroundColor?: any;
@@ -67,7 +68,7 @@ export declare const useConfiguration: () => {
67
68
  autocompleteSpecificTokens?: (boolean | "except-special") | undefined;
68
69
  mediaPropOrder?: boolean | undefined;
69
70
  fastSchemeChange?: boolean | undefined;
70
- webContainerType?: "size" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | "inline-size" | undefined;
71
+ webContainerType?: "unset" | "size" | "inherit" | "initial" | "revert" | "revert-layer" | "normal" | "inline-size" | undefined;
71
72
  };
72
73
  tokens: Omit<{
73
74
  [x: string]: {
@@ -1 +1 @@
1
- {"version":3,"file":"useConfiguration.d.ts","sourceRoot":"","sources":["../../src/hooks/useConfiguration.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQ5B,CAAA"}
1
+ {"version":3,"file":"useConfiguration.d.ts","sourceRoot":"","sources":["../../src/hooks/useConfiguration.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQ5B,CAAA"}
package/types/types.d.ts CHANGED
@@ -75,7 +75,7 @@ export type TamaguiComponentPropsBaseBase = {
75
75
  */
76
76
  tabIndex?: string | number;
77
77
  /**
78
- * Equivalent to role="" attribute on web for accesibility
78
+ * Equivalent to role="" attribute on web for accessibility
79
79
  */
80
80
  role?: Role;
81
81
  /**
@@ -337,7 +337,7 @@ type GetAltThemeNames<S> = (S extends `${string}_${infer Alt}` ? GetAltThemeName
337
337
  type SpacerPropsBase = {
338
338
  size?: SpaceValue;
339
339
  flex?: boolean | number;
340
- direction?: SpaceDirection;
340
+ direction?: SpaceDirection | 'unset';
341
341
  };
342
342
  type SpacerOwnProps = SpacerPropsBase & WithThemeShorthandsPseudosMediaAnimation<SpacerPropsBase>;
343
343
  export type SpacerProps = Omit<StackProps, 'flex' | 'direction' | 'size'> & SpacerOwnProps;
@@ -405,7 +405,7 @@ type GenericTamaguiSettings = {
405
405
  *
406
406
  * 1. Only use light/dark changes of themes at the root of your app
407
407
  * 2. Don't use <Theme inverse> or themeInverse
408
- * 3. Always change light/dark alongside the Appearance.colorSheme
408
+ * 3. Always change light/dark alongside the Appearance.colorScheme
409
409
  *
410
410
  * Then this feature is safe to turn on and will significantly speed up dark/light re-renders.
411
411
  */
@@ -417,7 +417,13 @@ type GenericTamaguiSettings = {
417
417
  webContainerType?: 'normal' | 'size' | 'inline-size' | 'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset';
418
418
  };
419
419
  export type TamaguiSettings = TamaguiConfig['settings'];
420
+ export type BaseStyleProps = {
421
+ [Key in keyof TextStylePropsBase]?: TextStyleProps[Key] | GetThemeValueForKey<Key>;
422
+ } & {
423
+ [Key in keyof StackStylePropsBase]?: StackStyleProps[Key] | GetThemeValueForKey<Key>;
424
+ };
420
425
  export type CreateTamaguiProps = {
426
+ unset?: BaseStyleProps;
421
427
  reactNative?: any;
422
428
  shorthands?: CreateShorthands;
423
429
  media?: GenericTamaguiConfig['media'];
@@ -666,10 +672,11 @@ export type ThemeValueGet<K extends string | number | symbol> = K extends 'theme
666
672
  width: SpaceTokens;
667
673
  height: SpaceTokens;
668
674
  } : SpaceTokens | ThemeValueFallbackSpace : K extends ColorKeys ? ColorTokens | ThemeValueFallbackColor : K extends ZIndexKeys ? ZIndexTokens | ThemeValueFallbackZIndex : K extends LineHeightKeys ? FontLineHeightTokens : K extends FontWeightKeys ? FontWeightTokens : K extends FontLetterSpacingKeys ? FontLetterSpacingTokens : never;
675
+ export type GetThemeValueForKey<K extends string | symbol | number> = ThemeValueGet<K> | ThemeValueFallback | (TamaguiSettings extends {
676
+ autocompleteSpecificTokens: infer Val;
677
+ } ? Val extends true | undefined ? SpecificTokens : never : never);
669
678
  export type WithThemeValues<T extends object> = {
670
- [K in keyof T]: ThemeValueGet<K> extends never ? T[K] : ThemeValueGet<K> | Exclude<T[K], string> | ThemeValueFallback | (TamaguiSettings extends {
671
- autocompleteSpecificTokens: infer Val;
672
- } ? Val extends true | undefined ? SpecificTokens : never : never);
679
+ [K in keyof T]: ThemeValueGet<K> extends never ? T[K] | 'unset' : GetThemeValueForKey<K> | Exclude<T[K], string> | 'unset';
673
680
  };
674
681
  type NarrowShorthands = Narrow<Shorthands>;
675
682
  export type Longhands = NarrowShorthands[keyof NarrowShorthands];
@@ -735,7 +742,7 @@ export interface ExtendBaseTextProps {
735
742
  }
736
743
  type LooseCombinedObjects<A extends Object, B extends Object> = A | B | (A & B);
737
744
  type OmitRemovedNonWebProps = 'onLayout' | keyof GestureResponderHandlers;
738
- export type StackNonStyleProps = Omit<ViewProps, 'display' | 'children' | OmitRemovedNonWebProps | keyof ExtendBaseStackProps | 'style'> & ExtendBaseStackProps & TamaguiComponentPropsBase & {
745
+ export type StackNonStyleProps = Omit<ViewProps, 'pointerEvents' | 'display' | 'children' | OmitRemovedNonWebProps | keyof ExtendBaseStackProps | 'style'> & ExtendBaseStackProps & TamaguiComponentPropsBase & {
739
746
  style?: StyleProp<LooseCombinedObjects<React.CSSProperties, ViewStyle>>;
740
747
  };
741
748
  export type StackStyleProps = WithThemeShorthandsPseudosMediaAnimation<StackStylePropsBase>;
@@ -836,7 +843,7 @@ export type StaticConfigPublic = {
836
843
  */
837
844
  inlineWhenUnflattened?: Set<string>;
838
845
  /**
839
- * (compiler) A bit odd, only for more advanced heirarchies.
846
+ * (compiler) A bit odd, only for more advanced hierarchies.
840
847
  * Indicates that the component will set this prop so the
841
848
  * static extraction can ensure it sets them to ={undefined}
842
849
  * so they get overriddent. In the future, this can be smarter.
@@ -845,7 +852,7 @@ export type StaticConfigPublic = {
845
852
  [key: string]: boolean;
846
853
  };
847
854
  /**
848
- * Auto-detected, but can ovverride. Wraps children to space them on top
855
+ * Auto-detected, but can override. Wraps children to space them on top
849
856
  */
850
857
  isZStack?: boolean;
851
858
  /**
@@ -853,7 +860,7 @@ export type StaticConfigPublic = {
853
860
  */
854
861
  isReactNative?: boolean;
855
862
  /**
856
- * By default if styled() doesn't recognize a parent Tamagui compoent or specific react-native views,
863
+ * By default if styled() doesn't recognize a parent Tamagui component or specific react-native views,
857
864
  * it will assume the passed in component only accepts style={} for react-native compatibility.
858
865
  * Setting `acceptsClassName: true` indicates Tamagui can pass in className props.
859
866
  */
@@ -868,7 +875,7 @@ type StaticConfigBase = StaticConfigPublic & {
868
875
  */
869
876
  componentName?: string;
870
877
  /**
871
- * Merges into defaultProps later on, used internally yonly
878
+ * Merges into defaultProps later on, used internally only
872
879
  */
873
880
  defaultVariants?: {
874
881
  [key: string]: any;
@@ -878,7 +885,7 @@ type StaticConfigBase = StaticConfigPublic & {
878
885
  */
879
886
  memo?: boolean;
880
887
  /**
881
- * By default if styled() doesn't recognize a parent Tamagui compoent or specific react-native views,
888
+ * By default if styled() doesn't recognize a parent Tamagui component or specific react-native views,
882
889
  * it will assume the passed in component only accepts style={} for react-native compatibility.
883
890
  * Setting `acceptsClassName: true` indicates Tamagui can pass in className props.
884
891
  */