@tamagui/core 1.0.1-beta.41 → 1.0.1-beta.44

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 (62) hide show
  1. package/dist/cjs/createComponent.js +71 -29
  2. package/dist/cjs/createComponent.js.map +2 -2
  3. package/dist/cjs/createTamagui.js +2 -0
  4. package/dist/cjs/createTamagui.js.map +2 -2
  5. package/dist/cjs/createTokens.js +1 -1
  6. package/dist/cjs/createTokens.js.map +2 -2
  7. package/dist/cjs/createVariable.js +2 -1
  8. package/dist/cjs/createVariable.js.map +2 -2
  9. package/dist/cjs/helpers/extendStaticConfig.js +0 -1
  10. package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
  11. package/dist/cjs/helpers/getSize.js.map +2 -2
  12. package/dist/cjs/helpers/getStackSize.js +1 -1
  13. package/dist/cjs/helpers/getStackSize.js.map +2 -2
  14. package/dist/cjs/index.js +1 -0
  15. package/dist/cjs/index.js.map +2 -2
  16. package/dist/cjs/styled.js.map +2 -2
  17. package/dist/cjs/types.js.map +1 -1
  18. package/dist/cjs/views/Slot.js +3 -9
  19. package/dist/cjs/views/Slot.js.map +2 -2
  20. package/dist/esm/createComponent.js +71 -30
  21. package/dist/esm/createComponent.js.map +2 -2
  22. package/dist/esm/createTamagui.js +2 -0
  23. package/dist/esm/createTamagui.js.map +2 -2
  24. package/dist/esm/createTokens.js +1 -1
  25. package/dist/esm/createTokens.js.map +2 -2
  26. package/dist/esm/createVariable.js +2 -1
  27. package/dist/esm/createVariable.js.map +2 -2
  28. package/dist/esm/helpers/extendStaticConfig.js +0 -4
  29. package/dist/esm/helpers/extendStaticConfig.js.map +2 -2
  30. package/dist/esm/helpers/getSize.js.map +2 -2
  31. package/dist/esm/helpers/getStackSize.js +1 -1
  32. package/dist/esm/helpers/getStackSize.js.map +2 -2
  33. package/dist/esm/index.js +1 -0
  34. package/dist/esm/index.js.map +2 -2
  35. package/dist/esm/styled.js.map +2 -2
  36. package/dist/esm/views/Slot.js +3 -10
  37. package/dist/esm/views/Slot.js.map +2 -2
  38. package/dist/jsx/createComponent.js +67 -26
  39. package/dist/jsx/createTamagui.js +2 -0
  40. package/dist/jsx/createTokens.js +1 -1
  41. package/dist/jsx/createVariable.js +2 -1
  42. package/dist/jsx/helpers/extendStaticConfig.js +0 -4
  43. package/dist/jsx/helpers/getStackSize.js +1 -1
  44. package/dist/jsx/index.js +1 -0
  45. package/dist/jsx/views/Slot.js +3 -7
  46. package/package.json +6 -6
  47. package/types/createComponent.d.ts +23 -13
  48. package/types/createComponent.d.ts.map +1 -1
  49. package/types/createVariable.d.ts +3 -1
  50. package/types/createVariable.d.ts.map +1 -1
  51. package/types/helpers/extendStaticConfig.d.ts.map +1 -1
  52. package/types/helpers/getSize.d.ts +1 -1
  53. package/types/helpers/getSize.d.ts.map +1 -1
  54. package/types/helpers/getStackSize.d.ts +3 -3
  55. package/types/helpers/getStackSize.d.ts.map +1 -1
  56. package/types/index.d.ts +1 -0
  57. package/types/index.d.ts.map +1 -1
  58. package/types/styled.d.ts +2 -2
  59. package/types/styled.d.ts.map +1 -1
  60. package/types/types.d.ts +10 -8
  61. package/types/types.d.ts.map +1 -1
  62. package/types/views/Slot.d.ts.map +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/styled.tsx"],
4
- "sourcesContent": ["import { Image, Text, TextInput } from 'react-native'\n\nimport { createComponent } from './createComponent'\nimport { RNComponents } from './helpers/RNComponents'\nimport {\n GetProps,\n GetVariantValues,\n MediaProps,\n PseudoProps,\n StaticConfig,\n StylableComponent,\n TamaguiComponent,\n VariantDefinitions,\n VariantSpreadFunction,\n} from './types'\n\n// TODO may be able to use this in the options?: arg below directly\nexport type StyledOptions<ParentComponent extends StylableComponent> = GetProps<ParentComponent> & {\n name?: string\n variants?: VariantDefinitions<ParentComponent> | undefined\n defaultVariants?: { [key: string]: any }\n}\n\nexport function styled<\n ParentComponent extends StylableComponent,\n Variants extends VariantDefinitions<ParentComponent> | symbol =\n | VariantDefinitions<ParentComponent>\n | symbol\n>(\n Component: ParentComponent,\n // this should be Partial<GetProps<ParentComponent>> but causes excessively deep type issues\n options?: GetProps<ParentComponent> & {\n name?: string\n variants?: Variants | undefined\n // thought i had this typed, but can't get it linked\n defaultVariants?: { [key: string]: any }\n },\n staticExtractionOptions?: Partial<StaticConfig>\n) {\n const staticConfigProps = (() => {\n if (options) {\n const { variants, name, defaultVariants, ...defaultProps } = options\n if (defaultVariants) {\n Object.assign(defaultProps, defaultVariants)\n }\n const isReactNativeWeb =\n 'staticConfig' in Component\n ? Component.staticConfig.isReactNativeWeb\n : RNComponents.has(Component)\n const reactNativeWebComponent = isReactNativeWeb\n ? Component['staticConfig']?.reactNativeWebComponent || Component\n : null\n const isTamagui = !isReactNativeWeb && 'staticConfig' in Component\n const Comp = reactNativeWebComponent || (Component as any)\n const isImage = !!(defaultProps.isImage || (!isTamagui ? Comp === Image : false))\n const isInput = !!(defaultProps.isInput || (!isTamagui ? Comp === TextInput : false))\n const isText = !!(defaultProps.isText || (!isTamagui ? isInput || Comp === Text : false))\n\n const conf: Partial<StaticConfig> = {\n ...staticExtractionOptions,\n ...(!isTamagui && {\n Component: Comp,\n }),\n isTamagui,\n // this type gets messed up by options?: Partial<GetProps<ParentComponent>> above\n // take away the Partial<> and it's fine\n variants,\n defaultProps,\n defaultVariants,\n componentName: name,\n isReactNativeWeb,\n // for nesting multiple levels of rnw styled() need keep use the OG component\n reactNativeWebComponent,\n isInput,\n isText,\n isImage,\n }\n\n return conf\n }\n return {}\n })()\n\n const component = createComponent(staticConfigProps, Component)\n\n // get parent props without pseudos and medias so we can rebuild both with new variants\n type ParentPropsBase = ParentComponent extends TamaguiComponent<any, any, infer P>\n ? P\n : GetProps<ParentComponent>\n type ParentVariants = ParentComponent extends TamaguiComponent<any, any, any, infer V> ? V : {}\n\n type OurVariants = Variants extends symbol\n ? {}\n : {\n [Key in keyof Variants]?: Variants[Key] extends VariantSpreadFunction<any, infer Val>\n ? Val\n : GetVariantValues<keyof Variants[Key]>\n }\n\n type VariantProps = Omit<ParentVariants, keyof OurVariants> & OurVariants\n type OurPropsBase = ParentPropsBase & VariantProps\n\n type Props = Variants extends void | symbol\n ? GetProps<ParentComponent>\n : // start with base props\n OurPropsBase &\n // add in media (+ pseudos nested)\n MediaProps<Partial<OurPropsBase>> &\n // add in pseudos\n PseudoProps<Partial<OurPropsBase>>\n\n return component as TamaguiComponent<\n Props,\n // TODO infer ref\n any,\n ParentPropsBase,\n ParentVariants & OurVariants\n >\n}\n\n// test types:\n// // variants\n// export const XStack = styled(Stack, {\n// flexDirection: 'row',\n// name: 'XStack',\n// variants: {\n// fullscreen: {\n// true: {},\n// },\n// elevation: {\n// '...size': (val) => ({}),\n// },\n// },\n// })\n// const InBetween = styled(XStack, {})\n// type INBVariants = typeof InBetween extends TamaguiComponent<any, any, any, infer Variants> ? Variants: never\n// const SwitchFrame = styled(InBetween, {\n// name: 'Switch',\n// tag: 'button',\n// borderRadius: 100,\n// borderWidth: 0,\n// variants: {\n// name: {\n// true: {\n// backgroundColor: 'aliceblue'\n// },\n// // 1: {\n\n// // },\n// // ':number': (val) => {\n// // return {}\n// // },\n// // \"...fontSize\": (val) => {\n// // return {}\n// // },\n// // \"...color\": (val) => {\n// // return {}\n// // }\n// }\n// },\n// defaultVariants: {\n// size: '$4',\n// },\n// })\n// const x = <XStack fullscreen />\n// const y = <XStack fullscreen />\n// const z = <SwitchFrame fullscreen name />\n\n// depth:\n// export const SizableText = styled(Stack, {\n// name: 'SizableText',\n// backgroundColor: 'red',\n// variants: {\n// size: {\n// '...fontSize': (val, { props }) => {\n// return {\n// backgroundColor: '',\n// }\n// },\n// },\n// },\n// })\n// export const Heading = styled(SizableText, {\n// tag: 'span',\n// name: 'Heading',\n// accessibilityRole: 'header',\n// size: '$8',\n// margin: 0,\n// })\n// export const Paragraph = styled(SizableText, {\n// tag: 'p',\n// margin: 10,\n// variants: {\n// another: {\n// true: {},\n// },\n// },\n// })\n// export const Paragraph2 = styled(Paragraph, {\n// tag: 'p',\n// variants: {\n// another: {\n// '...color': (val) => ({\n// backgroundColor: 'red',\n// }),\n// },\n// },\n// })\n// const a = <SizableText size=\"$10\" />\n// const b = <Paragraph size=\"$10\" another />\n// const c = <Paragraph2 size=\"$10\" another=\"aliceblue\" />\n// export const SizableText2 = styled(SizableText, {\n// })\n// const xx = <SizableText2 abc />\n// export const Paragraph = styled(SizableText, {\n// name: 'Paragraph',\n// })\n// export const Heading = styled(Paragraph, {\n// tag: 'span',\n// margin: 0,\n// })\n// export const H2 = styled(Heading, {\n// name: 'H2',\n// })\n// const x = <H2 color=\"red\" />\n"],
5
- "mappings": ";;AAAA;AAEA;AACA;AAoBO,gBAML,WAEA,SAMA,yBACA;AACA,QAAM,oBAAqB,OAAM;AAvCnC;AAwCI,QAAI,SAAS;AACX,YAAM,EAAE,UAAU,MAAM,oBAAoB,iBAAiB;AAC7D,UAAI,iBAAiB;AACnB,eAAO,OAAO,cAAc,eAAe;AAAA,MAC7C;AACA,YAAM,mBACJ,kBAAkB,YACd,UAAU,aAAa,mBACvB,aAAa,IAAI,SAAS;AAChC,YAAM,0BAA0B,mBAC5B,iBAAU,oBAAV,mBAA2B,4BAA2B,YACtD;AACJ,YAAM,YAAY,CAAC,oBAAoB,kBAAkB;AACzD,YAAM,OAAO,2BAA4B;AACzC,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,QAAQ;AAC1E,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,YAAY;AAC9E,YAAM,SAAS,CAAC,CAAE,cAAa,UAAW,EAAC,YAAY,WAAW,SAAS,OAAO;AAElF,YAAM,OAA8B;AAAA,WAC/B;AAAA,WACC,CAAC,aAAa;AAAA,UAChB,WAAW;AAAA,QACb;AAAA,QACA;AAAA,QAGA;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf;AAAA,QAEA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAEA,aAAO;AAAA,IACT;AACA,WAAO,CAAC;AAAA,EACV,GAAG;AAEH,QAAM,YAAY,gBAAgB,mBAAmB,SAAS;AA4B9D,SAAO;AAOT;AA/FgB;",
4
+ "sourcesContent": ["import { Image, Text, TextInput } from 'react-native'\n\nimport { createComponent } from './createComponent'\nimport { RNComponents } from './helpers/RNComponents'\nimport {\n GetProps,\n GetVariantValues,\n MediaProps,\n PseudoProps,\n StaticConfig,\n StylableComponent,\n TamaguiComponent,\n VariantDefinitions,\n VariantSpreadFunction,\n} from './types'\nimport { Stack } from './views/Stack'\n\n// TODO may be able to use this in the options?: arg below directly\nexport type StyledOptions<ParentComponent extends StylableComponent> = GetProps<ParentComponent> & {\n name?: string\n variants?: VariantDefinitions<ParentComponent> | undefined\n defaultVariants?: { [key: string]: any }\n}\n\nexport function styled<\n ParentComponent extends StylableComponent,\n Variants extends VariantDefinitions<ParentComponent> | void = VariantDefinitions<ParentComponent> | void\n>(\n Component: ParentComponent,\n // this should be Partial<GetProps<ParentComponent>> but causes excessively deep type issues\n options?: GetProps<ParentComponent> & {\n name?: string\n variants?: Variants | undefined\n // thought i had this typed, but can't get it linked\n defaultVariants?: { [key: string]: any }\n },\n staticExtractionOptions?: Partial<StaticConfig>\n) {\n const staticConfigProps = (() => {\n if (options) {\n const { variants, name, defaultVariants, ...defaultProps } = options\n if (defaultVariants) {\n Object.assign(defaultProps, defaultVariants)\n }\n const isReactNativeWeb =\n 'staticConfig' in Component\n ? Component.staticConfig.isReactNativeWeb\n : RNComponents.has(Component)\n const reactNativeWebComponent = isReactNativeWeb\n ? Component['staticConfig']?.reactNativeWebComponent || Component\n : null\n const isTamagui = !isReactNativeWeb && 'staticConfig' in Component\n const Comp = reactNativeWebComponent || (Component as any)\n const isImage = !!(defaultProps.isImage || (!isTamagui ? Comp === Image : false))\n const isInput = !!(defaultProps.isInput || (!isTamagui ? Comp === TextInput : false))\n const isText = !!(defaultProps.isText || (!isTamagui ? isInput || Comp === Text : false))\n\n const conf: Partial<StaticConfig> = {\n ...staticExtractionOptions,\n ...(!isTamagui && {\n Component: Comp,\n }),\n isTamagui,\n // this type gets messed up by options?: Partial<GetProps<ParentComponent>> above\n // take away the Partial<> and it's fine\n variants,\n defaultProps,\n defaultVariants,\n componentName: name,\n isReactNativeWeb,\n // for nesting multiple levels of rnw styled() need keep use the OG component\n reactNativeWebComponent,\n isInput,\n isText,\n isImage,\n }\n\n return conf\n }\n return {}\n })()\n\n const component = createComponent(staticConfigProps, Component)\n\n // get parent props without pseudos and medias so we can rebuild both with new variants\n type ParentPropsBase = ParentComponent extends TamaguiComponent<any, any, infer P>\n ? P\n : GetProps<ParentComponent>\n type ParentVariants = ParentComponent extends TamaguiComponent<any, any, any, infer V> ? V : {}\n\n type OurVariants = Variants extends void\n ? {}\n : {\n [Key in keyof Variants]?: Variants[Key] extends VariantSpreadFunction<any, infer Val>\n ? Val\n : GetVariantValues<keyof Variants[Key]>\n }\n\n type VariantProps = Omit<ParentVariants, keyof OurVariants> & OurVariants\n type OurPropsBase = ParentPropsBase & VariantProps\n\n type Props = Variants extends void\n ? GetProps<ParentComponent>\n : // start with base props\n OurPropsBase &\n // add in media (+ pseudos nested)\n MediaProps<Partial<OurPropsBase>> &\n // add in pseudos\n PseudoProps<Partial<OurPropsBase>>\n\n return component as TamaguiComponent<\n Props,\n // TODO infer ref\n any,\n ParentPropsBase,\n ParentVariants & OurVariants\n >\n}\n\n// breaking...\n// TODO see core/types.ts bug\n\n// export const XStack = styled(Stack, {\n// variants: {\n// horizontal: {\n// true: {\n// // flexDirection: 'row',\n// width: 0,\n// },\n// },\n// },\n// })\n\n// const Separator = styled(Stack, {\n// variants: {\n// vertical: {\n// true: {\n// flexDirection: 'row',\n// },\n// },\n// },\n// <--- have to add as const to get working???\n// })\n\n// type props = GetProps<typeof XStack>\n// type variants = typeof XStack extends TamaguiComponent<any, infer Variants> ? Variants : never\n// type variants2 = typeof Separator extends TamaguiComponent<any, infer Variants> ? Variants : never\n\n// const x = <XStack horizontal />\n// const x2 = <Separator vertical />\n"],
5
+ "mappings": ";;AAAA;AAEA;AACA;AAqBO,gBAIL,WAEA,SAMA,yBACA;AACA,QAAM,oBAAqB,OAAM;AAtCnC;AAuCI,QAAI,SAAS;AACX,YAAM,EAAE,UAAU,MAAM,oBAAoB,iBAAiB;AAC7D,UAAI,iBAAiB;AACnB,eAAO,OAAO,cAAc,eAAe;AAAA,MAC7C;AACA,YAAM,mBACJ,kBAAkB,YACd,UAAU,aAAa,mBACvB,aAAa,IAAI,SAAS;AAChC,YAAM,0BAA0B,mBAC5B,iBAAU,oBAAV,mBAA2B,4BAA2B,YACtD;AACJ,YAAM,YAAY,CAAC,oBAAoB,kBAAkB;AACzD,YAAM,OAAO,2BAA4B;AACzC,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,QAAQ;AAC1E,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,YAAY;AAC9E,YAAM,SAAS,CAAC,CAAE,cAAa,UAAW,EAAC,YAAY,WAAW,SAAS,OAAO;AAElF,YAAM,OAA8B;AAAA,WAC/B;AAAA,WACC,CAAC,aAAa;AAAA,UAChB,WAAW;AAAA,QACb;AAAA,QACA;AAAA,QAGA;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf;AAAA,QAEA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAEA,aAAO;AAAA,IACT;AACA,WAAO,CAAC;AAAA,EACV,GAAG;AAEH,QAAM,YAAY,gBAAgB,mBAAmB,SAAS;AA4B9D,SAAO;AAOT;AA7FgB;",
6
6
  "names": []
7
7
  }
@@ -4,14 +4,6 @@ import { composeRefs } from "@tamagui/compose-refs";
4
4
  import * as React from "react";
5
5
  const Slot = React.forwardRef((props, forwardedRef) => {
6
6
  const { children, ...slotProps } = props;
7
- if (React.Children.toArray(children).some(isSlottable)) {
8
- return /* @__PURE__ */ React.createElement(React.Fragment, null, React.Children.map(children, (child) => {
9
- return isSlottable(child) ? /* @__PURE__ */ React.createElement(SlotClone, {
10
- ...slotProps,
11
- ref: forwardedRef
12
- }, child.props.children) : child;
13
- }));
14
- }
15
7
  return /* @__PURE__ */ React.createElement(SlotClone, {
16
8
  ...slotProps,
17
9
  ref: forwardedRef
@@ -21,10 +13,11 @@ Slot.displayName = "Slot";
21
13
  const SlotClone = React.forwardRef((props, forwardedRef) => {
22
14
  const { children, ...slotProps } = props;
23
15
  if (React.isValidElement(children)) {
24
- return React.cloneElement(children, {
16
+ const childProps = {
25
17
  ...mergeProps(children, slotProps),
26
18
  ref: composeRefs(forwardedRef, children.ref)
27
- });
19
+ };
20
+ return React.cloneElement(children, childProps);
28
21
  }
29
22
  return React.Children.count(children) > 1 ? React.Children.only(null) : null;
30
23
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/views/Slot.tsx"],
4
- "sourcesContent": ["// via radix\n\nimport { composeRefs } from '@tamagui/compose-refs'\nimport * as React from 'react'\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\nexport type SlotProps = {\n children?: React.ReactNode\n}\n\nexport const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n\n if (React.Children.toArray(children).some(isSlottable)) {\n return (\n <>\n {React.Children.map(children, (child) => {\n return isSlottable(child) ? (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {child.props.children}\n </SlotClone>\n ) : (\n child\n )\n })}\n </>\n )\n }\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n )\n})\n\nSlot.displayName = 'Slot'\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode\n}\n\nconst SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n\n if (React.isValidElement(children)) {\n return React.cloneElement(children, {\n ...mergeProps(children, slotProps),\n ref: composeRefs(forwardedRef, (children as any).ref),\n })\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null\n})\n\nSlotClone.displayName = 'SlotClone'\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nexport const Slottable = ({ children }: { children: React.ReactNode }) => {\n return <>{children}</>\n}\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>\n\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement {\n return React.isValidElement(child)\n}\n\nconst pressMap = {\n onPress: 'onClick',\n onPressOut: 'onMouseOut',\n onPressIn: 'onMouseIn',\n}\n\nfunction mergeProps(child: any, slotProps: AnyProps) {\n const childProps = child.props\n\n // all child props should override\n const overrideProps = { ...childProps }\n\n const isHTMLChild = typeof child.type === 'string'\n\n if (isHTMLChild) {\n for (const key in pressMap) {\n if (key in slotProps) {\n slotProps[pressMap[key]] = slotProps[key]\n delete slotProps[key]\n }\n }\n }\n\n for (let propName in childProps) {\n const slotPropValue = slotProps[propName]\n const childPropValue = childProps[propName]\n\n if (isHTMLChild && pressMap[propName]) {\n propName = pressMap[propName]\n delete overrideProps[propName]\n }\n\n const isHandler = /^on[A-Z]/.test(propName)\n // if it's a handler, modify the override by composing the base handler\n if (isHandler) {\n overrideProps[propName] = (...args: unknown[]) => {\n childPropValue?.(...args)\n slotPropValue?.(...args)\n }\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue }\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ')\n }\n }\n\n return { ...slotProps, ...overrideProps }\n}\n"],
5
- "mappings": ";;AAEA;AACA;AAUO,MAAM,OAAO,MAAM,WAAmC,CAAC,OAAO,iBAAiB;AAC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A,EACF;AAEA,WAAS,YAAY,YAAY;AAC/B,UAAM,gBAAgB,UAAU;AAChC,UAAM,iBAAiB,WAAW;AAElC,QAAI,eAAe,SAAS,WAAW;AACrC,iBAAW,SAAS;AACpB,aAAO,cAAc;AAAA,IACvB;AAEA,UAAM,YAAY,WAAW,KAAK,QAAQ;AAE1C,QAAI,WAAW;AACb,oBAAc,YAAY,IAAI,SAAoB;AAChD,yDAAiB,GAAG;AACpB,uDAAgB,GAAG;AAAA,MACrB;AAAA,IACF,WAES,aAAa,SAAS;AAC7B,oBAAc,YAAY,KAAK,kBAAkB,eAAe;AAAA,IAClE,WAAW,aAAa,aAAa;AACnC,oBAAc,YAAY,CAAC,eAAe,cAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,IACpF;AAAA,EACF;AAEA,SAAO,KAAK,cAAc,cAAc;AAC1C;AA3CS;",
4
+ "sourcesContent": ["// via radix\n\nimport { composeRefs } from '@tamagui/compose-refs'\nimport * as React from 'react'\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\nexport type SlotProps = {\n children?: React.ReactNode\n}\n\nexport const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n )\n})\n\nSlot.displayName = 'Slot'\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode\n}\n\nconst SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n\n if (React.isValidElement(children)) {\n const childProps = {\n ...mergeProps(children, slotProps),\n ref: composeRefs(forwardedRef, (children as any).ref),\n }\n return React.cloneElement(children, childProps)\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null\n})\n\nSlotClone.displayName = 'SlotClone'\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nexport const Slottable = ({ children }: { children: React.ReactNode }) => {\n return <>{children}</>\n}\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>\n\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement {\n return React.isValidElement(child)\n}\n\nconst pressMap = {\n onPress: 'onClick',\n onPressOut: 'onMouseOut',\n onPressIn: 'onMouseIn',\n}\n\nfunction mergeProps(child: any, slotProps: AnyProps) {\n const childProps = child.props\n\n // all child props should override\n const overrideProps = { ...childProps }\n\n const isHTMLChild = typeof child.type === 'string'\n\n if (isHTMLChild) {\n for (const key in pressMap) {\n if (key in slotProps) {\n slotProps[pressMap[key]] = slotProps[key]\n delete slotProps[key]\n }\n }\n }\n\n for (let propName in childProps) {\n const slotPropValue = slotProps[propName]\n const childPropValue = childProps[propName]\n\n if (isHTMLChild && pressMap[propName]) {\n propName = pressMap[propName]\n delete overrideProps[propName]\n }\n\n const isHandler = /^on[A-Z]/.test(propName)\n // if it's a handler, modify the override by composing the base handler\n if (isHandler) {\n overrideProps[propName] = (...args: unknown[]) => {\n childPropValue?.(...args)\n slotPropValue?.(...args)\n }\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue }\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ')\n }\n }\n\n return { ...slotProps, ...overrideProps }\n}\n"],
5
+ "mappings": ";;AAEA;AACA;AAUO,MAAM,OAAO,MAAM,WAAmC,CAAC,OAAO,iBAAiB;AACpF,QAAM,EAAE,aAAa,cAAc;AACnC,SACE,oCAAC;AAAA,OAAc;AAAA,IAAW,KAAK;AAAA,KAC5B,QACH;AAEJ,CAAC;AAED,KAAK,cAAc;AAUnB,MAAM,YAAY,MAAM,WAAgC,CAAC,OAAO,iBAAiB;AAC/E,QAAM,EAAE,aAAa,cAAc;AAEnC,MAAI,MAAM,e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,GAAG;AAAA,IACpF;AAAA,EACF;AAEA,SAAO,KAAK,cAAc,cAAc;AAC1C;AA3CS;",
6
6
  "names": []
7
7
  }
@@ -97,7 +97,7 @@ function createComponent(configIn, ParentComponent) {
97
97
  props = tamaguiDefaultProps && !props.asChild ? { ...tamaguiDefaultProps, ...props } : props;
98
98
  const { Component, isText, isZStack } = staticConfig;
99
99
  const componentName = props.componentName || staticConfig.componentName;
100
- const componentClassName = props.componentName ? `is_${props.componentName}` : defaultComponentClassName;
100
+ const componentClassName = props.asChild ? "" : props.componentName ? `is_${props.componentName}` : defaultComponentClassName;
101
101
  if (process.env.NODE_ENV === "development") {
102
102
  if (props["debug"]) {
103
103
  console.log("\u26A0\uFE0F", componentName || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]", "debug on");
@@ -149,6 +149,7 @@ function createComponent(configIn, ParentComponent) {
149
149
  onMouseEnter,
150
150
  onMouseLeave,
151
151
  hrefAttrs,
152
+ separator,
152
153
  onClick,
153
154
  theme: _themeProp,
154
155
  defaultVariants,
@@ -526,7 +527,14 @@ function createComponent(configIn, ParentComponent) {
526
527
  if (process.env.NODE_ENV === "development" && props["debug"]) {
527
528
  console.log(" \xBB className", { splitStyles, style: style2, isStringElement, pseudos, state, classNames, propsClassName: props.className, classList, className: className.trim().split(" "), themeClassName: theme.className, values: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, getAllSelectors()[v]])) });
528
529
  }
529
- viewProps.className = className;
530
+ if (staticConfig.isReactNativeWeb) {
531
+ viewProps.dataSet = {
532
+ ...viewProps.dataSet,
533
+ className
534
+ };
535
+ } else {
536
+ viewProps.className = className;
537
+ }
530
538
  viewProps.style = style2;
531
539
  } else {
532
540
  viewProps.style = styles;
@@ -603,25 +611,22 @@ function createComponent(configIn, ParentComponent) {
603
611
  onPress == null ? void 0 : onPress(e);
604
612
  } : null
605
613
  } : null;
606
- const childEls = !children || asChild ? children : wrapThemeManagerContext(spacedChildren({
614
+ let childEls = !children || asChild ? children : wrapThemeManagerContext(spacedChildren({
615
+ separator,
607
616
  children,
608
617
  space,
609
618
  direction: props.spaceDirection || "both",
610
619
  isZStack
611
620
  }), getThemeManagerIfChanged(theme));
612
621
  let content;
613
- if (isWeb) {
614
- if (staticConfig.isReactNativeWeb) {
615
- viewProps.dataSet = {
616
- ...viewProps.dataSet,
617
- className: viewProps.className
618
- };
619
- }
620
- }
621
622
  if (asChild) {
622
623
  elementType = Slot;
623
- const onlyChild = React.Children.only(children);
624
- Object.assign(viewProps, onlyChild.props);
624
+ viewProps = {
625
+ ...viewProps,
626
+ onPress,
627
+ onPressIn,
628
+ onPressOut
629
+ };
625
630
  }
626
631
  if (isWeb) {
627
632
  const [pressableProps] = usePressable(events ? {
@@ -750,6 +755,10 @@ function createComponent(configIn, ParentComponent) {
750
755
  return res;
751
756
  }
752
757
  __name(createComponent, "createComponent");
758
+ const Unspaced = /* @__PURE__ */ __name((props) => {
759
+ return props.children;
760
+ }, "Unspaced");
761
+ Unspaced["isUnspaced"] = true;
753
762
  const Spacer = createComponent({
754
763
  memo: true,
755
764
  componentName: "Spacer",
@@ -796,14 +805,16 @@ function spacedChildren({
796
805
  children,
797
806
  space,
798
807
  direction,
799
- spaceFlex
808
+ spaceFlex,
809
+ separator
800
810
  }) {
801
- if (!space && !spaceFlex) {
811
+ const hasSpace = !!(space || spaceFlex);
812
+ const hasSeparator = !(separator === void 0 || separator === null);
813
+ if (!hasSpace && !hasSeparator) {
802
814
  return children;
803
815
  }
804
- const childrenList = Array.isArray(children) ? children : Children.toArray(children);
805
- const len = childrenList.length;
806
- if (len <= 1) {
816
+ const childrenList = Children.toArray(children);
817
+ if (childrenList.length <= 1) {
807
818
  return childrenList;
808
819
  }
809
820
  const final = [];
@@ -815,20 +826,49 @@ function spacedChildren({
815
826
  final.push(<Fragment key={index}>{isZStack ? <AbsoluteFill>{child}</AbsoluteFill> : child}</Fragment>);
816
827
  }
817
828
  const next = childrenList[index + 1];
818
- if (next && !isVisuallyHidden(next)) {
819
- final.push(<Spacer key={`_${index}_spacer`} direction={direction === "both" ? void 0 : direction === "row" || direction === "row-reverse" ? "horizontal" : "vertical"} size={space} {...spaceFlex && {
820
- flex: spaceFlex
821
- }} />);
829
+ if (next && !isUnspaced(next)) {
830
+ if (separator) {
831
+ if (hasSpace) {
832
+ final.push(createSpacer({
833
+ key: `_${index}_before_sep_spacer`,
834
+ direction,
835
+ space,
836
+ spaceFlex
837
+ }));
838
+ }
839
+ final.push(React.isValidElement(separator) ? React.cloneElement(separator, { key: `sep_${index}` }) : separator);
840
+ if (hasSpace) {
841
+ final.push(createSpacer({
842
+ key: `_${index}_after_sep_spacer`,
843
+ direction,
844
+ space,
845
+ spaceFlex
846
+ }));
847
+ }
848
+ } else {
849
+ final.push(createSpacer({
850
+ key: `_${index}_spacer`,
851
+ direction,
852
+ space,
853
+ spaceFlex
854
+ }));
855
+ }
822
856
  }
823
857
  }
824
858
  return final;
825
859
  }
826
860
  __name(spacedChildren, "spacedChildren");
827
- function isVisuallyHidden(child) {
828
- var _a;
829
- return (_a = child == null ? void 0 : child["type"]) == null ? void 0 : _a["isVisuallyHidden"];
861
+ function createSpacer({ key, direction, space, spaceFlex }) {
862
+ return <Spacer key={key} direction={direction === "both" ? void 0 : direction === "row" || direction === "row-reverse" ? "horizontal" : "vertical"} size={space} {...spaceFlex && {
863
+ flex: spaceFlex
864
+ }} />;
865
+ }
866
+ __name(createSpacer, "createSpacer");
867
+ function isUnspaced(child) {
868
+ var _a, _b;
869
+ return ((_a = child == null ? void 0 : child["type"]) == null ? void 0 : _a["isVisuallyHidden"]) || ((_b = child == null ? void 0 : child["type"]) == null ? void 0 : _b["isUnspaced"]);
830
870
  }
831
- __name(isVisuallyHidden, "isVisuallyHidden");
871
+ __name(isUnspaced, "isUnspaced");
832
872
  function AbsoluteFill(props) {
833
873
  return isWeb ? <div style={{
834
874
  position: "absolute",
@@ -860,6 +900,7 @@ const accessibilityRoleToWebRole = {
860
900
  export {
861
901
  AbsoluteFill,
862
902
  Spacer,
903
+ Unspaced,
863
904
  createComponent,
864
905
  mouseUps,
865
906
  spacedChildren
@@ -189,12 +189,14 @@ function ensureThemeVariable(theme, key) {
189
189
  const val = theme[key];
190
190
  if (!isVariable(val)) {
191
191
  theme[key] = createVariable({
192
+ key,
192
193
  name: key,
193
194
  val
194
195
  });
195
196
  } else {
196
197
  if (val.name !== key) {
197
198
  theme[key] = createVariable({
199
+ key,
198
200
  name: key,
199
201
  val: val.val
200
202
  });
@@ -17,7 +17,7 @@ const mapTokensToVariables = /* @__PURE__ */ __name((tokens, parentPath = "") =>
17
17
  if (val && typeof val === "object") {
18
18
  res[key] = mapTokensToVariables(tokens[key], name);
19
19
  } else {
20
- res[key] = createVariable({ val, name });
20
+ res[key] = createVariable({ val, name, key });
21
21
  }
22
22
  }
23
23
  return res;
@@ -4,10 +4,11 @@ var _a;
4
4
  import { isWeb } from "./constants/platform";
5
5
  const IS_VARIABLE_SYMBOL = "__isVariable__";
6
6
  class Variable {
7
- constructor({ val, name }) {
7
+ constructor({ val, name, key }) {
8
8
  this[_a] = true;
9
9
  this.val = isVariable(val) ? val.val : val;
10
10
  this.name = name;
11
+ this.key = key;
11
12
  this.variable = isWeb ? createCSSVariable(name) : this.val;
12
13
  }
13
14
  toString() {
@@ -35,10 +35,6 @@ function extendStaticConfig(config, parent) {
35
35
  ...parent.staticConfig.validStyles,
36
36
  ...config.validStyles
37
37
  } : parent.staticConfig.validStyles || stylePropsView,
38
- defaultVariants: {
39
- ...parent.staticConfig.defaultVariants,
40
- ...config.defaultVariants
41
- },
42
38
  defaultProps: {
43
39
  ...parent.staticConfig.defaultProps,
44
40
  ...parent.staticConfig.defaultVariants,
@@ -33,7 +33,7 @@ const createGetStackSize = /* @__PURE__ */ __name((scale) => (val, extras) => {
33
33
  paddingVertical: props.circular ? 0 : py
34
34
  };
35
35
  }, "createGetStackSize");
36
- const buttonScaling = { sizeX: 0.9, sizeY: 0.333 };
36
+ const buttonScaling = { sizeX: 0.75, sizeY: 0.333 };
37
37
  const getButtonSize = createGetStackSize(buttonScaling);
38
38
  export {
39
39
  buttonScaling,
package/dist/jsx/index.js CHANGED
@@ -35,6 +35,7 @@ export * from "./hooks/useMedia";
35
35
  export * from "./hooks/usePressable";
36
36
  export * from "./hooks/useTheme";
37
37
  export * from "./hooks/useUnmountEffect";
38
+ export * from "./views/Slot";
38
39
  export * from "./views/Stack";
39
40
  export * from "./views/Text";
40
41
  export * from "./views/TextAncestorContext";
@@ -4,21 +4,17 @@ import { composeRefs } from "@tamagui/compose-refs";
4
4
  import * as React from "react";
5
5
  const Slot = React.forwardRef((props, forwardedRef) => {
6
6
  const { children, ...slotProps } = props;
7
- if (React.Children.toArray(children).some(isSlottable)) {
8
- return <>{React.Children.map(children, (child) => {
9
- return isSlottable(child) ? <SlotClone {...slotProps} ref={forwardedRef}>{child.props.children}</SlotClone> : child;
10
- })}</>;
11
- }
12
7
  return <SlotClone {...slotProps} ref={forwardedRef}>{children}</SlotClone>;
13
8
  });
14
9
  Slot.displayName = "Slot";
15
10
  const SlotClone = React.forwardRef((props, forwardedRef) => {
16
11
  const { children, ...slotProps } = props;
17
12
  if (React.isValidElement(children)) {
18
- return React.cloneElement(children, {
13
+ const childProps = {
19
14
  ...mergeProps(children, slotProps),
20
15
  ref: composeRefs(forwardedRef, children.ref)
21
- });
16
+ };
17
+ return React.cloneElement(children, childProps);
22
18
  }
23
19
  return React.Children.count(children) > 1 ? React.Children.only(null) : null;
24
20
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/core",
3
- "version": "1.0.1-beta.41",
3
+ "version": "1.0.1-beta.44",
4
4
  "source": "src/index.ts",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -21,10 +21,10 @@
21
21
  ],
22
22
  "dependencies": {
23
23
  "@expo/match-media": "^0.3.0",
24
- "@tamagui/helpers": "^1.0.1-beta.41",
24
+ "@tamagui/helpers": "^1.0.1-beta.44",
25
25
  "@tamagui/ow": "^0.28.1",
26
- "@tamagui/use-debounce": "^1.0.1-beta.41",
27
- "@tamagui/use-force-update": "^1.0.1-beta.41",
26
+ "@tamagui/use-debounce": "^1.0.1-beta.44",
27
+ "@tamagui/use-force-update": "^1.0.1-beta.44",
28
28
  "expo-screen-orientation": "^4.2.0",
29
29
  "hyphenate-style-name": "^1.0.4",
30
30
  "inline-style-prefixer": "^6.0.0",
@@ -36,12 +36,12 @@
36
36
  "react-native-web": "*"
37
37
  },
38
38
  "devDependencies": {
39
- "@tamagui/build": "^1.0.1-beta.41",
39
+ "@tamagui/build": "^1.0.1-beta.44",
40
40
  "@types/react": "^17.0.35",
41
41
  "csstype": "^3.0.10",
42
42
  "esbuild": "^0.14.36",
43
43
  "react-native-web": "^0.17.5",
44
- "typescript": "^4.5.2"
44
+ "typescript": "^4.7.2"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"
@@ -1,19 +1,29 @@
1
- /// <reference types="react" />
2
- import { View } from 'react-native';
3
- import { SpaceDirection, SpaceTokens, StackProps, StaticConfig, StaticConfigParsed, StylableComponent, TamaguiComponent } from './types';
1
+ import React from 'react';
2
+ import { SpaceFlexDirection, SpaceTokens, StackProps, StaticConfig, StaticConfigParsed, StylableComponent, TamaguiComponent, TamaguiElement } from './types';
4
3
  export declare const mouseUps: Set<Function>;
5
- export declare function createComponent<ComponentPropTypes extends Object = {}, Ref = View, BaseProps = never>(configIn: Partial<StaticConfig> | StaticConfigParsed, ParentComponent?: StylableComponent): TamaguiComponent<ComponentPropTypes, Ref, BaseProps, {}>;
6
- export declare const Spacer: TamaguiComponent<Omit<StackProps, "flex" | "direction"> & {
7
- size?: SpaceTokens | undefined;
8
- flex?: number | boolean | undefined;
9
- direction?: "horizontal" | "vertical" | undefined;
10
- }, View, never, {}>;
11
- export declare function spacedChildren({ isZStack, children, space, direction, spaceFlex, }: {
4
+ export declare function createComponent<ComponentPropTypes extends Object = {}, Ref = TamaguiElement, BaseProps = never>(configIn: Partial<StaticConfig> | StaticConfigParsed, ParentComponent?: StylableComponent): TamaguiComponent<ComponentPropTypes, Ref, BaseProps, {}>;
5
+ export declare const Unspaced: {
6
+ (props: {
7
+ children?: any;
8
+ }): any;
9
+ isUnspaced: boolean;
10
+ };
11
+ declare type SpaceDirection = 'vertical' | 'horizontal';
12
+ export declare type SpacerProps = Omit<StackProps, 'flex' | 'direction'> & {
13
+ size?: number | SpaceTokens;
14
+ flex?: boolean | number;
15
+ direction?: SpaceDirection;
16
+ };
17
+ export declare const Spacer: TamaguiComponent<SpacerProps, TamaguiElement, never, {}>;
18
+ export declare type SpacedChildrenProps = {
12
19
  isZStack?: boolean;
13
- children: any;
20
+ children?: any;
14
21
  space?: any;
15
22
  spaceFlex?: boolean | number;
16
- direction?: SpaceDirection;
17
- }): any;
23
+ direction?: SpaceFlexDirection;
24
+ separator?: React.ReactNode;
25
+ };
26
+ export declare function spacedChildren({ isZStack, children, space, direction, spaceFlex, separator, }: SpacedChildrenProps): any;
18
27
  export declare function AbsoluteFill(props: any): JSX.Element;
28
+ export {};
19
29
  //# sourceMappingURL=createComponent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":";AAaA,OAAO,EAA+B,IAAI,EAAa,MAAM,cAAc,CAAA;AAiB3E,OAAO,EACL,cAAc,EACd,WAAW,EACX,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAKjB,MAAM,SAAS,CAAA;AAgBhB,eAAO,MAAM,QAAQ,eAAsB,CAAA;AA0B3C,wBAAgB,eAAe,CAC7B,kBAAkB,SAAS,MAAM,GAAG,EAAE,EACtC,GAAG,GAAG,IAAI,EACV,SAAS,GAAG,KAAK,EACjB,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,kBAAkB,EAAE,eAAe,CAAC,EAAE,iBAAiB,4DAk9B1F;AAKD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,cAAc,CAAA;CAC3B,CAAA;AACD,eAAO,MAAM,MAAM,0DA0CjB,CAAA;AAEF,oBAAY,mBAAmB,GAAG;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC5B,SAAS,CAAC,EAAE,kBAAkB,CAAA;IAC9B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC5B,CAAA;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAS,GACV,EAAE,mBAAmB,OAsErB;AA2BD,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,eAkBtC"}
@@ -4,12 +4,14 @@ export declare class Variable {
4
4
  name: string;
5
5
  val: string | number;
6
6
  variable: string | number;
7
- constructor({ val, name }: VariableIn);
7
+ key: string;
8
+ constructor({ val, name, key }: VariableIn);
8
9
  toString(): string;
9
10
  }
10
11
  declare type VariableIn = {
11
12
  val: string | number | Variable;
12
13
  name: string;
14
+ key: string;
13
15
  };
14
16
  export declare const createVariable: (props: VariableIn) => Variable;
15
17
  export declare function isVariable(v: Variable | any): v is Variable;
@@ -1 +1 @@
1
- {"version":3,"file":"createVariable.d.ts","sourceRoot":"","sources":["../src/createVariable.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,mBAAmB,CAAA;AAElD,qBAAa,QAAQ;IAInB,CAAC,kBAAkB,CAAC,UAAO;IAE3B,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;gBAEb,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,UAAU;IAOrC,QAAQ;CAGT;AAED,aAAK,UAAU,GAAG;IAAE,GAAG,EAAE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AO,MAAM,iBAAiB,QAAS,MAAM,iCAG5C,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"extendStaticConfig.d.ts","sourceRoot":"","sources":["../../src/helpers/extendStaticConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAG9E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,EAAE,iBAAiB,sBAiD3F;AAED,eAAO,MAAM,iBAAiB,WAAY,QAAQ,YAAY,CAAC,KAAG,kBAMjE,CAAA"}
1
+ {"version":3,"file":"extendStaticConfig.d.ts","sourceRoot":"","sources":["../../src/helpers/extendStaticConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAG9E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,EAAE,iBAAiB,sBA6C3F;AAED,eAAO,MAAM,iBAAiB,WAAY,QAAQ,YAAY,CAAC,KAAG,kBAMjE,CAAA"}
@@ -1,3 +1,3 @@
1
1
  import { SizeTokens } from '../types';
2
- export declare const getSize: (size?: SizeTokens | undefined, sizeUpOrDownBy?: number) => SizeTokens;
2
+ export declare const getSize: (size?: SizeTokens | undefined, sizeUpOrDownBy?: number) => import("..").Variable;
3
3
  //# sourceMappingURL=getSize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getSize.d.ts","sourceRoot":"","sources":["../../src/helpers/getSize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC,eAAO,MAAM,OAAO,UAAW,UAAU,GAAG,SAAS,wCAKpD,CAAA"}
1
+ {"version":3,"file":"getSize.d.ts","sourceRoot":"","sources":["../../src/helpers/getSize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC,eAAO,MAAM,OAAO,UAAW,UAAU,GAAG,SAAS,mDAKpD,CAAA"}
@@ -8,9 +8,9 @@ export declare type ScaleVariantExtras = Pick<VariantSpreadExtras<any>, 'tokens'
8
8
  export declare const getSizeScaledToFont: (val: string | number, { sizeX, sizeY }: ScaleProps, { tokens, props, fonts }: ScaleVariantExtras) => {
9
9
  px: number;
10
10
  py: number;
11
- radius: import("@tamagui/core").VariableVal;
12
- size: import("@tamagui/core").VariableVal;
13
- lineHeight: number | import("@tamagui/core").Variable | undefined;
11
+ radius: any;
12
+ size: any;
13
+ lineHeight: any;
14
14
  minHeight: number;
15
15
  };
16
16
  export declare const createGetStackSize: (scale: ScaleProps) => (val: SizeTokens | number, extras: VariantSpreadExtras<any>) => {
@@ -1 +1 @@
1
- {"version":3,"file":"getStackSize.d.ts","sourceRoot":"","sources":["../../src/helpers/getStackSize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAgC,MAAM,eAAe,CAAA;AAEjF,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAIrC,aAAK,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAElD,oBAAY,kBAAkB,GAAG,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC,CAAA;AAE7F,eAAO,MAAM,mBAAmB,QACzB,MAAM,GAAG,MAAM,oBACM,UAAU,4BACV,kBAAkB;;;;;;;CAqB7C,CAAA;AAED,eAAO,MAAM,kBAAkB,UACrB,UAAU,WAAW,UAAU,GAAG,MAAM,UAAU,oBAAoB,GAAG,CAAC;;;;;CASjF,CAAA;AAEH,eAAO,MAAM,aAAa;;;CAA+B,CAAA;AACzD,eAAO,MAAM,aAAa,QAZK,UAAU,GAAG,MAAM,UAAU,oBAAoB,GAAG,CAAC;;;;;CAYtB,CAAA"}
1
+ {"version":3,"file":"getStackSize.d.ts","sourceRoot":"","sources":["../../src/helpers/getStackSize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAgC,MAAM,eAAe,CAAA;AAEjF,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAIrC,aAAK,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAElD,oBAAY,kBAAkB,GAAG,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC,CAAA;AAE7F,eAAO,MAAM,mBAAmB,QACzB,MAAM,GAAG,MAAM,oBACM,UAAU,4BACV,kBAAkB;;;;;;;CAqB7C,CAAA;AAED,eAAO,MAAM,kBAAkB,UACrB,UAAU,WAAW,UAAU,GAAG,MAAM;;;;;CAS/C,CAAA;AAEH,eAAO,MAAM,aAAa;;;CAAgC,CAAA;AAC1D,eAAO,MAAM,aAAa,QAZK,UAAU,GAAG,MAAM;;;;;CAYY,CAAA"}
package/types/index.d.ts CHANGED
@@ -35,6 +35,7 @@ export * from './hooks/useMedia';
35
35
  export * from './hooks/usePressable';
36
36
  export * from './hooks/useTheme';
37
37
  export * from './hooks/useUnmountEffect';
38
+ export * from './views/Slot';
38
39
  export * from './views/Stack';
39
40
  export * from './views/Text';
40
41
  export * from './views/TextAncestorContext';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,cAAc,kBAAkB,CAAA;A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AAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAElC,cAAc,2BAA2B,CAAA;AACzC,cAAc,kBAAkB,CAAA"}
package/types/styled.d.ts CHANGED
@@ -6,11 +6,11 @@ export declare type StyledOptions<ParentComponent extends StylableComponent> = G
6
6
  [key: string]: any;
7
7
  };
8
8
  };
9
- export declare function styled<ParentComponent extends StylableComponent, Variants extends VariantDefinitions<ParentComponent> | symbol = VariantDefinitions<ParentComponent> | symbol>(Component: ParentComponent, options?: GetProps<ParentComponent> & {
9
+ export declare function styled<ParentComponent extends StylableComponent, Variants extends VariantDefinitions<ParentComponent> | void = VariantDefinitions<ParentComponent> | void>(Component: ParentComponent, options?: GetProps<ParentComponent> & {
10
10
  name?: string;
11
11
  variants?: Variants | undefined;
12
12
  defaultVariants?: {
13
13
  [key: string]: any;
14
14
  };
15
- }, staticExtractionOptions?: Partial<StaticConfig>): TamaguiComponent<Variants extends symbol | void ? GetProps<ParentComponent> : (ParentComponent extends TamaguiComponent<any, any, infer P, {}> ? P : GetProps<ParentComponent>) & Omit<ParentComponent extends TamaguiComponent<any, any, any, infer V> ? V : {}, keyof (Variants extends symbol ? {} : { [Key in keyof Variants]?: (Variants[Key] extends VariantSpreadFunction<any, infer Val> ? Val : GetVariantValues<keyof Variants[Key]>) | undefined; })> & (Variants extends symbol ? {} : { [Key in keyof Variants]?: (Variants[Key] extends VariantSpreadFunction<any, infer Val> ? Val : GetVariantValues<keyof Variants[Key]>) | undefined; }) & MediaProps<Partial<(ParentComponent extends TamaguiComponent<any, any, infer P, {}> ? P : GetProps<ParentComponent>) & Omit<ParentComponent extends TamaguiComponent<any, any, any, infer V> ? V : {}, keyof (Variants extends symbol ? {} : { [Key in keyof Variants]?: (Variants[Key] extends VariantSpreadFunction<any, infer Val> ? Val : GetVariantValues<keyof Variants[Key]>) | undefined; })> & (Variants extends symbol ? {} : { [Key in keyof Variants]?: (Variants[Key] extends VariantSpreadFunction<any, infer Val> ? Val : GetVariantValues<keyof Variants[Key]>) | undefined; })>> & PseudoProps<Partial<(ParentComponent extends TamaguiComponent<any, any, infer P, {}> ? P : GetProps<ParentComponent>) & Omit<ParentComponent extends TamaguiComponent<any, any, any, infer V> ? V : {}, keyof (Variants extends symbol ? {} : { [Key in keyof Variants]?: (Variants[Key] extends VariantSpreadFunction<any, infer Val> ? Val : GetVariantValues<keyof Variants[Key]>) | undefined; })> & (Variants extends symbol ? {} : { [Key in keyof Variants]?: (Variants[Key] extends VariantSpreadFunction<any, infer Val> ? Val : GetVariantValues<keyof Variants[Key]>) | undefined; })>>, any, ParentComponent extends TamaguiComponent<any, any, infer P, {}> ? P : GetProps<ParentComponent>, (ParentComponent extends TamaguiComponent<any, any, any, infer V> ? V : {}) & (Variants extends symbol ? {} : { [Key in keyof Variants]?: (Variants[Key] extends VariantSpreadFunction<any, infer Val> ? Val : GetVariantValues<keyof Variants[Key]>) | undefined; })>;
15
+ }, staticExtractionOptions?: Partial<StaticConfig>): TamaguiComponent<Variants extends void ? GetProps<ParentComponent> : (ParentComponent extends TamaguiComponent<any, any, infer P, {}> ? P : GetProps<ParentComponent>) & Omit<ParentComponent extends TamaguiComponent<any, any, any, infer V> ? V : {}, keyof (Variants extends void ? {} : { [Key in keyof Variants]?: (Variants[Key] extends VariantSpreadFunction<any, infer Val> ? Val : GetVariantValues<keyof Variants[Key]>) | undefined; })> & (Variants extends void ? {} : { [Key in keyof Variants]?: (Variants[Key] extends VariantSpreadFunction<any, infer Val> ? Val : GetVariantValues<keyof Variants[Key]>) | undefined; }) & MediaProps<Partial<(ParentComponent extends TamaguiComponent<any, any, infer P, {}> ? P : GetProps<ParentComponent>) & Omit<ParentComponent extends TamaguiComponent<any, any, any, infer V> ? V : {}, keyof (Variants extends void ? {} : { [Key in keyof Variants]?: (Variants[Key] extends VariantSpreadFunction<any, infer Val> ? Val : GetVariantValues<keyof Variants[Key]>) | undefined; })> & (Variants extends void ? {} : { [Key in keyof Variants]?: (Variants[Key] extends VariantSpreadFunction<any, infer Val> ? Val : GetVariantValues<keyof Variants[Key]>) | undefined; })>> & PseudoProps<Partial<(ParentComponent extends TamaguiComponent<any, any, infer P, {}> ? P : GetProps<ParentComponent>) & Omit<ParentComponent extends TamaguiComponent<any, any, any, infer V> ? V : {}, keyof (Variants extends void ? {} : { [Key in keyof Variants]?: (Variants[Key] extends VariantSpreadFunction<any, infer Val> ? Val : GetVariantValues<keyof Variants[Key]>) | undefined; })> & (Variants extends void ? {} : { [Key in keyof Variants]?: (Variants[Key] extends VariantSpreadFunction<any, infer Val> ? Val : GetVariantValues<keyof Variants[Key]>) | undefined; })>>, any, ParentComponent extends TamaguiComponent<any, any, infer P, {}> ? P : GetProps<ParentComponent>, (ParentComponent extends TamaguiComponent<any, any, any, infer V> ? V : {}) & (Variants extends void ? {} : { [Key in keyof Variants]?: (Variants[Key] extends VariantSpreadFunction<any, infer Val> ? Val : GetVariantValues<keyof Variants[Key]>) | undefined; })>;
16
16
  //# sourceMappingURL=styled.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../src/styled.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAGhB,oBAAY,aAAa,CAAC,eAAe,SAAS,iBAAiB,IAAI,QAAQ,CAAC,eAAe,CAAC,GAAG;IACjG,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,kBAAkB,CAAC,eAAe,CAAC,GAAG,SAAS,CAAA;IAC1D,eAAe,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAA;CACzC,CAAA;AAED,wBAAgB,MAAM,CACpB,eAAe,SAAS,iBAAiB,EACzC,QAAQ,SAAS,kBAAkB,CAAC,eAAe,CAAC,GAAG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AAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAA;CACzC,EACD,uBAAuB,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,8lEAiFhD"}
package/types/types.d.ts CHANGED
@@ -1,14 +1,17 @@
1
- import CSS from 'csstype';
1
+ import { Properties } from 'csstype';
2
2
  import React from 'react';
3
3
  import { GestureResponderEvent, Image, TextProps as ReactTextProps, Text, TextInput, TextStyle, View, ViewProps, ViewStyle } from 'react-native';
4
4
  import { Variable } from './createVariable';
5
5
  import { ResolveVariableTypes } from './helpers/createPropMapper';
6
6
  import { RNWTextProps, RNWViewProps } from './types-rnw';
7
7
  import { ThemeProviderProps } from './views/ThemeProvider';
8
+ export declare type SpaceFlexDirection = ViewStyle['flexDirection'] | 'both';
9
+ export declare type TamaguiElement = HTMLElement | View;
8
10
  export declare type TamaguiComponentPropsBase = {
9
11
  asChild?: boolean;
10
12
  space?: SpaceTokens;
11
- spaceDirection?: SpaceDirection;
13
+ spaceDirection?: SpaceFlexDirection;
14
+ separator?: React.ReactNode;
12
15
  dangerouslySetInnerHTML?: {
13
16
  __html: string;
14
17
  };
@@ -199,7 +202,6 @@ export declare type AnimationProp = AnimationKeys | {
199
202
  };
200
203
  }
201
204
  ];
202
- export declare type SpaceDirection = ViewStyle['flexDirection'] | 'both';
203
205
  declare type GetTokenFontKeysFor<A extends 'size' | 'weight' | 'letterSpacing' | 'family' | 'lineHeight' | 'transform' | 'style' | 'color'> = keyof TamaguiConfig['fonts']['body'][A];
204
206
  declare type GetTokenString<A> = A extends string | number ? `$${A}` : `$${string}`;
205
207
  export declare type SizeTokens = GetTokenString<keyof Tokens['size']> | number;
@@ -267,11 +269,11 @@ export declare type TextStylePropsBase = Omit<TextStyle, 'display' | 'backfaceVi
267
269
  ellipse?: boolean;
268
270
  selectable?: boolean;
269
271
  textDecorationDistance?: number;
270
- userSelect?: CSS.Properties['userSelect'];
271
- textOverflow?: CSS.Properties['textOverflow'];
272
- whiteSpace?: CSS.Properties['whiteSpace'];
273
- wordWrap?: CSS.Properties['wordWrap'];
274
- cursor?: CSS.Properties['cursor'];
272
+ userSelect?: Properties['userSelect'];
273
+ textOverflow?: Properties['textOverflow'];
274
+ whiteSpace?: Properties['whiteSpace'];
275
+ wordWrap?: Properties['wordWrap'];
276
+ cursor?: Properties['cursor'];
275
277
  };
276
278
  export declare type TextPropsBaseShared = Omit<ReactTextProps, 'children'> & RNWTextProps & TamaguiComponentPropsBase;
277
279
  export declare type TextPropsBase = TextPropsBaseShared & WithThemeAndShorthands<TextStylePropsBase>;