tamagui 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/helpers/inputHelpers.js +6 -5
- package/dist/cjs/helpers/inputHelpers.js.map +2 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/views/Fieldset.js +1 -0
- package/dist/cjs/views/Fieldset.js.map +2 -2
- package/dist/cjs/views/Group.js +3 -3
- package/dist/cjs/views/Group.js.map +2 -2
- package/dist/cjs/views/Input.js +1 -1
- package/dist/cjs/views/Input.js.map +1 -1
- package/dist/cjs/views/Skeleton.js +2 -2
- package/dist/cjs/views/Skeleton.js.map +2 -2
- package/dist/esm/helpers/inputHelpers.js +7 -10
- package/dist/esm/helpers/inputHelpers.js.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/views/Fieldset.js +1 -0
- package/dist/esm/views/Fieldset.js.map +2 -2
- package/dist/esm/views/Group.js +3 -3
- package/dist/esm/views/Group.js.map +2 -2
- package/dist/esm/views/Input.js +1 -1
- package/dist/esm/views/Input.js.map +1 -1
- package/dist/esm/views/Skeleton.js +1 -1
- package/dist/esm/views/Skeleton.js.map +2 -2
- package/dist/jsx/helpers/inputHelpers.js +7 -10
- package/dist/jsx/helpers/inputHelpers.js.map +2 -2
- package/dist/jsx/index.js +1 -1
- package/dist/jsx/index.js.map +2 -2
- package/dist/jsx/views/Fieldset.js +1 -0
- package/dist/jsx/views/Fieldset.js.map +2 -2
- package/dist/jsx/views/Group.js +3 -3
- package/dist/jsx/views/Group.js.map +2 -2
- package/dist/jsx/views/Input.js +1 -1
- package/dist/jsx/views/Input.js.map +1 -1
- package/dist/jsx/views/Skeleton.js +1 -1
- package/dist/jsx/views/Skeleton.js.map +2 -2
- package/package.json +57 -46
- package/src/helpers/inputHelpers.tsx +10 -11
- package/src/index.ts +1 -3
- package/src/views/Fieldset.tsx +1 -0
- package/src/views/Group.tsx +4 -3
- package/src/views/Input.tsx +1 -1
- package/src/views/Skeleton.tsx +2 -2
- package/types/index.d.ts +2 -2
- package/types/views/LinearGradient.d.ts +1 -1
- package/types/views/Skeleton.d.ts +1 -1
- package/src/lib/linear-gradient.ts +0 -2
- package/src/views/LinearGradient.tsx +0 -71
package/dist/jsx/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './setup'\n\nexport * from '@tamagui/adapt'\nexport * from '@tamagui/alert-dialog'\nexport * from '@tamagui/animate-presence'\nexport * from '@tamagui/avatar'\nexport * from '@tamagui/button'\nexport * from '@tamagui/card'\nexport * from '@tamagui/compose-refs'\nexport * from '@tamagui/create-context'\nexport * from '@tamagui/dialog'\nexport * from '@tamagui/font-size'\nexport * from '@tamagui/helpers-tamagui'\nexport * from '@tamagui/image'\nexport * from '@tamagui/label'\nexport * from '@tamagui/list-item'\nexport * from '@tamagui/popover'\nexport * from '@tamagui/popper'\nexport * from '@tamagui/portal'\nexport * from '@tamagui/progress'\nexport * from '@tamagui/scroll-view'\nexport * from '@tamagui/select'\nexport * from '@tamagui/separator'\nexport * from '@tamagui/shapes'\nexport * from '@tamagui/sheet'\nexport * from '@tamagui/slider'\nexport * from '@tamagui/stacks'\nexport * from '@tamagui/switch'\nexport * from '@tamagui/text'\nexport * from '@tamagui/tooltip'\nexport * from '@tamagui/use-controllable-state'\nexport * from '@tamagui/use-debounce'\nexport * from '@tamagui/use-force-update'\nexport * from '@tamagui/use-window-dimensions'\nexport * from '@tamagui/visually-hidden'\n\nexport * from './createTamagui'\n\nexport * from './views/TamaguiProvider'\nexport * from './viewTypes'\n\nexport * from './views/Anchor'\nexport * from './views/EnsureFlexed'\nexport * from './views/Fieldset'\nexport * from './views/Form'\nexport * from './views/Grid'\nexport * from './views/Input'\nexport * from './views/Group'\nexport * from './views/Layouts'\
|
|
5
|
-
"mappings": "AAAA,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AAEd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;
|
|
4
|
+
"sourcesContent": ["export * from './setup'\n\nexport * from '@tamagui/adapt'\nexport * from '@tamagui/alert-dialog'\nexport * from '@tamagui/animate-presence'\nexport * from '@tamagui/avatar'\nexport * from '@tamagui/button'\nexport * from '@tamagui/card'\nexport * from '@tamagui/compose-refs'\nexport * from '@tamagui/create-context'\nexport * from '@tamagui/dialog'\nexport * from '@tamagui/font-size'\nexport * from '@tamagui/helpers-tamagui'\nexport * from '@tamagui/image'\nexport * from '@tamagui/label'\nexport * from '@tamagui/linear-gradient'\nexport * from '@tamagui/list-item'\nexport * from '@tamagui/popover'\nexport * from '@tamagui/popper'\nexport * from '@tamagui/portal'\nexport * from '@tamagui/progress'\nexport * from '@tamagui/scroll-view'\nexport * from '@tamagui/select'\nexport * from '@tamagui/separator'\nexport * from '@tamagui/shapes'\nexport * from '@tamagui/sheet'\nexport * from '@tamagui/slider'\nexport * from '@tamagui/stacks'\nexport * from '@tamagui/switch'\nexport * from '@tamagui/text'\nexport * from '@tamagui/tooltip'\nexport * from '@tamagui/use-controllable-state'\nexport * from '@tamagui/use-debounce'\nexport * from '@tamagui/use-force-update'\nexport * from '@tamagui/use-window-dimensions'\nexport * from '@tamagui/visually-hidden'\n\nexport * from './createTamagui'\n\nexport * from './views/TamaguiProvider'\nexport * from './viewTypes'\n\nexport * from './views/Anchor'\nexport * from './views/EnsureFlexed'\nexport * from './views/Fieldset'\nexport * from './views/Form'\nexport * from './views/Grid'\nexport * from './views/Input'\nexport * from './views/Group'\nexport * from './views/Layouts'\n// export * from './views/Skeleton'\nexport * from './views/Spinner'\nexport * from './views/TextArea'\n\n// since we overlap with StackProps and potentially others\n// lets be explicit on what gets exported\nexport type {\n AnimationKeys,\n ColorTokens,\n CreateTamaguiConfig,\n CreateTamaguiProps,\n FontColorTokens,\n FontLetterSpacingTokens,\n FontLineHeightTokens,\n FontSizeTokens,\n FontStyleTokens,\n FontTokens,\n FontTransformTokens,\n FontWeightTokens,\n GenericFont,\n GenericTamaguiConfig,\n GetAnimationKeys,\n GetProps,\n GetVariantProps,\n GenericTextVariants,\n GenericStackVariants,\n Media,\n MediaPropKeys,\n MediaQueries,\n MediaQueryState,\n RNWTextProps,\n RNWViewProps,\n Shorthands,\n SizeTokens,\n SpaceTokens,\n SpacerProps,\n StackPropsBase,\n TamaguiElement,\n StackNonStyleProps,\n StaticConfig,\n StaticConfigParsed,\n TamaguiBaseTheme,\n TamaguiComponent,\n TamaguiComponentPropsBase,\n TamaguiConfig,\n FontLanguages,\n TamaguiCustomConfig,\n TamaguiInternalConfig,\n TamaguiProviderProps,\n TextProps,\n TextPropsBase,\n TextNonStyleProps,\n ThemeKeys,\n ThemeName,\n ThemeParsed,\n ThemeProps,\n Themes,\n ThemeValueFallback,\n Tokens,\n TransformStyleProps,\n VariantSpreadExtras,\n VariantSpreadFunction,\n ZIndexTokens,\n} from '@tamagui/core'\n\nexport {\n // components\n Spacer,\n Stack,\n Text,\n Theme,\n FontLanguage,\n Unspaced,\n // context,\n TextAncestorContext,\n // constants\n isChrome,\n isClient,\n isServer,\n isTouchable,\n isWeb,\n isWebTouchable,\n mediaQueryConfig,\n createComponent,\n createFont,\n createShorthands,\n createTheme,\n addTheme,\n updateTheme,\n createTokens,\n createVariable,\n getConfig,\n getAnimationDriver,\n getMedia,\n getStylesAtomic,\n getThemes,\n getTokens,\n getVariable,\n variableToString,\n getVariableValue,\n getVariableName,\n insertFont,\n isTamaguiElement,\n isTamaguiComponent,\n isVariable,\n matchMedia,\n mediaObjectToString,\n mediaState,\n spacedChildren,\n styled,\n themeable,\n withStaticProperties,\n // hooks\n useGet,\n useEvent,\n useDidFinishSSR,\n useIsomorphicLayoutEffect,\n useIsTouchDevice,\n useMedia,\n useTheme,\n useThemeName,\n useSafeRef,\n} from '@tamagui/core'\n"],
|
|
5
|
+
"mappings": "AAAA,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AAEd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AA+Dd;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Fieldset.tsx"],
|
|
4
|
-
"sourcesContent": ["import { GetProps, styled } from '@tamagui/core'\nimport { YStack } from '@tamagui/stacks'\n\nexport const Fieldset = styled(YStack, {\n name: 'Fieldset',\n\n variants: {\n horizontal: {\n true: {\n flexDirection: 'row',\n alignItems: 'center',\n },\n },\n } as const,\n})\n\nexport type FieldsetProps = GetProps<typeof Fieldset>\n"],
|
|
5
|
-
"mappings": "AAAA,SAAmB,cAAc;AACjC,SAAS,cAAc;AAEhB,MAAM,WAAW,OAAO,QAAQ;AAAA,EACrC,MAAM;AAAA,
|
|
4
|
+
"sourcesContent": ["import { GetProps, styled } from '@tamagui/core'\nimport { YStack } from '@tamagui/stacks'\n\nexport const Fieldset = styled(YStack, {\n name: 'Fieldset',\n tag: 'fieldset',\n\n variants: {\n horizontal: {\n true: {\n flexDirection: 'row',\n alignItems: 'center',\n },\n },\n } as const,\n})\n\nexport type FieldsetProps = GetProps<typeof Fieldset>\n"],
|
|
5
|
+
"mappings": "AAAA,SAAmB,cAAc;AACjC,SAAS,cAAc;AAEhB,MAAM,WAAW,OAAO,QAAQ;AAAA,EACrC,MAAM;AAAA,EACN,KAAK;AAAA,EAEL,UAAU;AAAA,IACR,YAAY;AAAA,MACV,MAAM;AAAA,QACJ,eAAe;AAAA,QACf,YAAY;AAAA,MACd;AAAA,IACF;AAAA,EACF;AACF,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/jsx/views/Group.js
CHANGED
|
@@ -18,14 +18,14 @@ const GroupFrame = styled(ThemeableStack, {
|
|
|
18
18
|
y: 0,
|
|
19
19
|
variants: {
|
|
20
20
|
size: (val, { tokens }) => {
|
|
21
|
-
const borderRadius = tokens.radius[val] ?? val ?? tokens.radius["$
|
|
21
|
+
const borderRadius = tokens.radius[val] ?? val ?? tokens.radius["$true"];
|
|
22
22
|
return {
|
|
23
23
|
borderRadius
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
defaultVariants: {
|
|
28
|
-
size: "$
|
|
28
|
+
size: "$true"
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
function createGroup(verticalDefault) {
|
|
@@ -34,7 +34,7 @@ function createGroup(verticalDefault) {
|
|
|
34
34
|
const {
|
|
35
35
|
children: childrenProp,
|
|
36
36
|
space,
|
|
37
|
-
size = "$
|
|
37
|
+
size = "$true",
|
|
38
38
|
spaceDirection,
|
|
39
39
|
separator,
|
|
40
40
|
scrollable,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Group.tsx"],
|
|
4
|
-
"sourcesContent": ["import {\n GetProps,\n TamaguiElement,\n getConfig,\n getExpandedShorthands,\n getTokens,\n getVariableValue,\n isTamaguiElement,\n mergeProps,\n spacedChildren,\n styled,\n useMediaPropsActive,\n} from '@tamagui/core'\nimport { ThemeableStack } from '@tamagui/stacks'\nimport React, { Children, forwardRef, isValidElement } from 'react'\nimport { ScrollView } from 'react-native'\n\nexport const GroupFrame = styled(ThemeableStack, {\n name: 'GroupFrame',\n backgroundColor: '$background',\n y: 0,\n\n variants: {\n size: (val, { tokens }) => {\n const borderRadius = tokens.radius[val] ?? val ?? tokens.radius['$
|
|
5
|
-
"mappings": "AAAA;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAC/B,OAAO,SAAS,UAAU,YAAY,sBAAsB;AAC5D,SAAS,kBAAkB;AAEpB,MAAM,aAAa,OAAO,gBAAgB;AAAA,EAC/C,MAAM;AAAA,EACN,iBAAiB;AAAA,EACjB,GAAG;AAAA,EAEH,UAAU;AAAA,IACR,MAAM,CAAC,KAAK,EAAE,OAAO,MAAM;AACzB,YAAM,eAAe,OAAO,OAAO,QAAQ,OAAO,OAAO,OAAO;AAChE,aAAO;AAAA,QACL;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EAEA,iBAAiB;AAAA,IACf,MAAM;AAAA,EACR;AACF,CAAC;AAaD,SAAS,YAAY,iBAA0B;AAC7C,SAAO,WAAuC,CAAC,OAAO,QAAQ;AAC5D,UAAM,cAAc,oBAAoB,KAAK;AAE7C,UAAM;AAAA,MACJ,UAAU;AAAA,MACV;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW;AAAA,MACX,UAAU;AAAA,MACV,yBAAyB;AAAA,MACzB;AAAA,SACG;AAAA,IACL,IAAI,sBAAsB,WAAW;AAErC,UAAM,SACJ,iBACC,OAAO,iBAAiB,UAAU,IAAI,EAAE,OAAO,KAAK,IAAI,IAAI;
|
|
4
|
+
"sourcesContent": ["import {\n GetProps,\n TamaguiElement,\n getConfig,\n getExpandedShorthands,\n getTokens,\n getVariableValue,\n isTamaguiElement,\n mergeProps,\n spacedChildren,\n styled,\n useMediaPropsActive,\n} from '@tamagui/core'\nimport { ThemeableStack } from '@tamagui/stacks'\nimport React, { Children, forwardRef, isValidElement } from 'react'\nimport { ScrollView } from 'react-native'\n\nexport const GroupFrame = styled(ThemeableStack, {\n name: 'GroupFrame',\n backgroundColor: '$background',\n y: 0,\n\n variants: {\n size: (val, { tokens }) => {\n const borderRadius = tokens.radius[val] ?? val ?? tokens.radius['$true']\n return {\n borderRadius,\n }\n },\n } as const,\n\n defaultVariants: {\n size: '$true',\n },\n})\n\nexport type GroupProps = GetProps<typeof GroupFrame> & {\n scrollable?: boolean\n /**\n * @default false\n */\n showScrollIndicator?: boolean\n disabled?: boolean\n vertical?: boolean\n disablePassBorderRadius?: boolean\n}\n\nfunction createGroup(verticalDefault: boolean) {\n return forwardRef<TamaguiElement, GroupProps>((props, ref) => {\n const activeProps = useMediaPropsActive(props)\n\n const {\n children: childrenProp,\n space,\n size = '$true',\n spaceDirection,\n separator,\n scrollable,\n vertical = verticalDefault,\n disabled: disabledProp,\n disablePassBorderRadius: disablePassBorderRadiusProp,\n borderRadius,\n ...restProps\n } = getExpandedShorthands(activeProps)\n\n const radius =\n borderRadius ??\n (size ? getVariableValue(getTokens(true).radius[size]) - 1 : undefined)\n\n const hasRadius = radius !== undefined\n const disablePassBorderRadius = disablePassBorderRadiusProp ?? !hasRadius\n const childrens = Children.toArray(childrenProp)\n const children = childrens.map((child, i) => {\n if (!isValidElement(child)) return child\n const disabled = child.props.disabled ?? disabledProp\n\n const isFirst = i === 0\n const isLast = i === childrens.length - 1\n\n const radiusStyles = disablePassBorderRadius\n ? null\n : {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n ...(hasRadius && {\n ...(isFirst &&\n !vertical && {\n borderTopLeftRadius: radius,\n borderBottomLeftRadius: radius,\n }),\n ...(isFirst &&\n vertical && {\n borderTopLeftRadius: radius,\n borderTopRightRadius: radius,\n }),\n ...(isLast &&\n !vertical && {\n borderTopRightRadius: radius,\n borderBottomRightRadius: radius,\n }),\n ...(isLast &&\n vertical && {\n borderBottomLeftRadius: radius,\n borderBottomRightRadius: radius,\n }),\n }),\n }\n\n const props = {\n disabled,\n ...(isTamaguiElement(child) ? radiusStyles : { style: radiusStyles }),\n }\n\n return cloneElementWithPropOrder(child, props)\n })\n\n return (\n <GroupFrame\n ref={ref}\n size={size}\n flexDirection={!vertical ? 'row' : 'column'}\n borderRadius={borderRadius}\n {...restProps}\n >\n {wrapScroll(\n activeProps,\n spacedChildren({\n direction: spaceDirection,\n separator,\n space,\n children,\n })\n )}\n </GroupFrame>\n )\n })\n}\n\nexport const YGroup = createGroup(true)\nexport const XGroup = createGroup(false)\n\nconst wrapScroll = (\n { scrollable, vertical, showScrollIndicator = false }: GroupProps,\n children: any\n) => {\n if (scrollable)\n return (\n <ScrollView\n {...(vertical && {\n showsVerticalScrollIndicator: showScrollIndicator,\n })}\n {...(!vertical && {\n horizontal: true,\n showsHorizontalScrollIndicator: showScrollIndicator,\n })}\n >\n {children}\n </ScrollView>\n )\n return children\n}\n\nconst cloneElementWithPropOrder = (child: any, props: Object) => {\n const next = mergeProps(child.props, props, false, getConfig().shorthands)[0]\n return React.cloneElement({ ...child, props: null }, next)\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": ["props"]
|
|
7
7
|
}
|
package/dist/jsx/views/Input.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Input.tsx"],
|
|
4
|
-
"sourcesContent": ["import { GetProps, setupReactNative, styled } from '@tamagui/core'\nimport { focusableInputHOC } from '@tamagui/focusable'\nimport { TextInput } from 'react-native'\n\nimport { inputSizeVariant } from '../helpers/inputHelpers'\n\nsetupReactNative({\n TextInput,\n})\n\nexport const InputFrame = styled(\n TextInput,\n {\n name: 'Input',\n fontFamily: '$body',\n borderWidth: 1,\n outlineWidth: 0,\n color: '$color',\n focusable: true,\n borderColor: '$borderColor',\n backgroundColor: '$background',\n placeholderTextColor: '$placeholderColor',\n\n // this fixes a flex bug where it overflows container\n minWidth: 0,\n\n hoverStyle: {\n borderColor: '$borderColorHover',\n },\n\n focusStyle: {\n borderColor: '$borderColorFocus',\n borderWidth: 2,\n marginHorizontal: -1,\n },\n\n variants: {\n size: {\n '...size': inputSizeVariant,\n },\n } as const,\n\n defaultVariants: {\n size: '$
|
|
4
|
+
"sourcesContent": ["import { GetProps, setupReactNative, styled } from '@tamagui/core'\nimport { focusableInputHOC } from '@tamagui/focusable'\nimport { TextInput } from 'react-native'\n\nimport { inputSizeVariant } from '../helpers/inputHelpers'\n\nsetupReactNative({\n TextInput,\n})\n\nexport const InputFrame = styled(\n TextInput,\n {\n name: 'Input',\n fontFamily: '$body',\n borderWidth: 1,\n outlineWidth: 0,\n color: '$color',\n focusable: true,\n borderColor: '$borderColor',\n backgroundColor: '$background',\n placeholderTextColor: '$placeholderColor',\n\n // this fixes a flex bug where it overflows container\n minWidth: 0,\n\n hoverStyle: {\n borderColor: '$borderColorHover',\n },\n\n focusStyle: {\n borderColor: '$borderColorFocus',\n borderWidth: 2,\n marginHorizontal: -1,\n },\n\n variants: {\n size: {\n '...size': inputSizeVariant,\n },\n } as const,\n\n defaultVariants: {\n size: '$true',\n },\n },\n {\n isInput: true,\n }\n)\n\nexport type InputProps = GetProps<typeof InputFrame>\n\nexport const Input = focusableInputHOC(InputFrame)\n"],
|
|
5
5
|
"mappings": "AAAA,SAAmB,kBAAkB,cAAc;AACnD,SAAS,yBAAyB;AAClC,SAAS,iBAAiB;AAE1B,SAAS,wBAAwB;AAEjC,iBAAiB;AAAA,EACf;AACF,CAAC;AAEM,MAAM,aAAa;AAAA,EACxB;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,cAAc;AAAA,IACd,OAAO;AAAA,IACP,WAAW;AAAA,IACX,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,sBAAsB;AAAA,IAGtB,UAAU;AAAA,IAEV,YAAY;AAAA,MACV,aAAa;AAAA,IACf;AAAA,IAEA,YAAY;AAAA,MACV,aAAa;AAAA,MACb,aAAa;AAAA,MACb,kBAAkB;AAAA,IACpB;AAAA,IAEA,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,WAAW;AAAA,MACb;AAAA,IACF;AAAA,IAEA,iBAAiB;AAAA,MACf,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA;AAAA,IACE,SAAS;AAAA,EACX;AACF;AAIO,MAAM,QAAQ,kBAAkB,UAAU;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { styled } from "@tamagui/core";
|
|
2
|
+
import { LinearGradient } from "@tamagui/linear-gradient";
|
|
2
3
|
import { YStack } from "@tamagui/stacks";
|
|
3
4
|
import { forwardRef } from "react";
|
|
4
|
-
import { LinearGradient } from "./LinearGradient";
|
|
5
5
|
import { VisuallyHidden } from "./VisuallyHidden";
|
|
6
6
|
const SkeletonFrame = styled(YStack, {
|
|
7
7
|
name: "Skeleton",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Skeleton.tsx"],
|
|
4
|
-
"sourcesContent": ["import { GetProps, TamaguiElement, styled } from '@tamagui/core'\nimport {
|
|
5
|
-
"mappings": "AAAA,SAAmC,cAAc;AACjD,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAE3B,SAAS,
|
|
4
|
+
"sourcesContent": ["import { GetProps, TamaguiElement, styled } from '@tamagui/core'\nimport { LinearGradient, LinearGradientProps } from '@tamagui/linear-gradient'\nimport { YStack } from '@tamagui/stacks'\nimport { forwardRef } from 'react'\n\nimport { VisuallyHidden } from './VisuallyHidden'\n\nexport const SkeletonFrame = styled(YStack, {\n name: 'Skeleton',\n backgroundColor: '$backgroundHover',\n overflow: 'hidden',\n position: 'relative',\n})\n\nexport type SkeletonProps = GetProps<typeof SkeletonFrame>\n\nexport const Skeleton = SkeletonFrame.extractable(\n forwardRef<TamaguiElement>(({ children, ...props }: SkeletonProps, ref) => {\n return (\n <SkeletonFrame ref={ref} {...props}>\n <SkeletonShine />\n <VisuallyHidden preserveDimensions>{children}</VisuallyHidden>\n </SkeletonFrame>\n )\n })\n)\n\nexport const SkeletonShine = (props: LinearGradientProps) => {\n return (\n <LinearGradient\n position=\"absolute\"\n top={0}\n bottom={0}\n width=\"25%\"\n colors={['$background', '$color']}\n {...props}\n />\n )\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAmC,cAAc;AACjD,SAAS,sBAA2C;AACpD,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAE3B,SAAS,sBAAsB;AAExB,MAAM,gBAAgB,OAAO,QAAQ;AAAA,EAC1C,MAAM;AAAA,EACN,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV,UAAU;AACZ,CAAC;AAIM,MAAM,WAAW,cAAc;AAAA,EACpC,WAA2B,CAAC,EAAE,aAAa,MAAM,GAAkB,QAAQ;AACzE,WACE,CAAC,cAAc,KAAK,SAAS;AAAA,MAC3B,CAAC,cAAc;AAAA,MACf,CAAC,eAAe,oBAAoB,SAAS,EAA5C;AAAA,IACH,EAHC;AAAA,EAKL,CAAC;AACH;AAEO,MAAM,gBAAgB,CAAC,UAA+B;AAC3D,SACE,CAAC,eACC,SAAS,WACT,KAAK,GACL,QAAQ,GACR,MAAM,MACN,QAAQ,CAAC,eAAe,QAAQ,OAC5B,OACN;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tamagui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css",
|
|
6
6
|
"*setup.js"
|
|
@@ -25,59 +25,70 @@
|
|
|
25
25
|
"check": "yarn check-circular-deps",
|
|
26
26
|
"check-circular-deps": "npx madge --circular ./src/index.ts"
|
|
27
27
|
},
|
|
28
|
+
"exports": {
|
|
29
|
+
"./package.json": "./package.json",
|
|
30
|
+
".": {
|
|
31
|
+
"import": "./dist/esm/index.js",
|
|
32
|
+
"require": "./dist/cjs/index.js"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
28
35
|
"dependencies": {
|
|
29
|
-
"@tamagui/adapt": "^1.0.
|
|
30
|
-
"@tamagui/alert-dialog": "^1.0.
|
|
31
|
-
"@tamagui/animate-presence": "^1.0.
|
|
32
|
-
"@tamagui/avatar": "^1.0.
|
|
33
|
-
"@tamagui/button": "^1.0.
|
|
34
|
-
"@tamagui/card": "^1.0.
|
|
35
|
-
"@tamagui/compose-refs": "^1.0.
|
|
36
|
-
"@tamagui/core": "^1.0.
|
|
37
|
-
"@tamagui/create-context": "^1.0.
|
|
38
|
-
"@tamagui/dialog": "^1.0.
|
|
39
|
-
"@tamagui/fake-react-native": "^1.0.
|
|
40
|
-
"@tamagui/font-size": "^1.0.
|
|
41
|
-
"@tamagui/get-button-sized": "^1.0.
|
|
42
|
-
"@tamagui/get-font-sized": "^1.0.
|
|
43
|
-
"@tamagui/
|
|
44
|
-
"@tamagui/helpers
|
|
45
|
-
"@tamagui/
|
|
46
|
-
"@tamagui/
|
|
47
|
-
"@tamagui/
|
|
48
|
-
"@tamagui/
|
|
49
|
-
"@tamagui/
|
|
50
|
-
"@tamagui/
|
|
51
|
-
"@tamagui/
|
|
52
|
-
"@tamagui/
|
|
53
|
-
"@tamagui/
|
|
54
|
-
"@tamagui/
|
|
55
|
-
"@tamagui/
|
|
56
|
-
"@tamagui/
|
|
57
|
-
"@tamagui/
|
|
58
|
-
"@tamagui/
|
|
59
|
-
"@tamagui/
|
|
60
|
-
"@tamagui/
|
|
61
|
-
"@tamagui/
|
|
62
|
-
"@tamagui/
|
|
63
|
-
"@tamagui/
|
|
64
|
-
"@tamagui/
|
|
65
|
-
"@tamagui/use-
|
|
66
|
-
"@tamagui/use-
|
|
67
|
-
"@tamagui/use-
|
|
68
|
-
"@tamagui/
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"react": "^18.2.0",
|
|
72
|
-
"react-dom": "^18.2.0"
|
|
36
|
+
"@tamagui/adapt": "^1.0.4",
|
|
37
|
+
"@tamagui/alert-dialog": "^1.0.4",
|
|
38
|
+
"@tamagui/animate-presence": "^1.0.4",
|
|
39
|
+
"@tamagui/avatar": "^1.0.4",
|
|
40
|
+
"@tamagui/button": "^1.0.4",
|
|
41
|
+
"@tamagui/card": "^1.0.4",
|
|
42
|
+
"@tamagui/compose-refs": "^1.0.4",
|
|
43
|
+
"@tamagui/core": "^1.0.4",
|
|
44
|
+
"@tamagui/create-context": "^1.0.4",
|
|
45
|
+
"@tamagui/dialog": "^1.0.4",
|
|
46
|
+
"@tamagui/fake-react-native": "^1.0.4",
|
|
47
|
+
"@tamagui/font-size": "^1.0.4",
|
|
48
|
+
"@tamagui/get-button-sized": "^1.0.4",
|
|
49
|
+
"@tamagui/get-font-sized": "^1.0.4",
|
|
50
|
+
"@tamagui/get-size": "^1.0.4",
|
|
51
|
+
"@tamagui/helpers": "^1.0.4",
|
|
52
|
+
"@tamagui/helpers-tamagui": "^1.0.4",
|
|
53
|
+
"@tamagui/image": "^1.0.4",
|
|
54
|
+
"@tamagui/label": "^1.0.4",
|
|
55
|
+
"@tamagui/linear-gradient": "^1.0.4",
|
|
56
|
+
"@tamagui/list-item": "^1.0.4",
|
|
57
|
+
"@tamagui/popover": "^1.0.4",
|
|
58
|
+
"@tamagui/popper": "^1.0.4",
|
|
59
|
+
"@tamagui/portal": "^1.0.4",
|
|
60
|
+
"@tamagui/progress": "^1.0.4",
|
|
61
|
+
"@tamagui/react-native-media-driver": "^1.0.4",
|
|
62
|
+
"@tamagui/scroll-view": "^1.0.4",
|
|
63
|
+
"@tamagui/select": "^1.0.4",
|
|
64
|
+
"@tamagui/separator": "^1.0.4",
|
|
65
|
+
"@tamagui/shapes": "^1.0.4",
|
|
66
|
+
"@tamagui/sheet": "^1.0.4",
|
|
67
|
+
"@tamagui/slider": "^1.0.4",
|
|
68
|
+
"@tamagui/stacks": "^1.0.4",
|
|
69
|
+
"@tamagui/switch": "^1.0.4",
|
|
70
|
+
"@tamagui/text": "^1.0.4",
|
|
71
|
+
"@tamagui/tooltip": "^1.0.4",
|
|
72
|
+
"@tamagui/use-controllable-state": "^1.0.4",
|
|
73
|
+
"@tamagui/use-debounce": "^1.0.4",
|
|
74
|
+
"@tamagui/use-event": "^1.0.4",
|
|
75
|
+
"@tamagui/use-force-update": "^1.0.4",
|
|
76
|
+
"@tamagui/use-window-dimensions": "^1.0.4",
|
|
77
|
+
"@tamagui/visually-hidden": "^1.0.4"
|
|
73
78
|
},
|
|
74
79
|
"peerDependencies": {
|
|
80
|
+
"expo-screen-orientation": "*",
|
|
81
|
+
"react": "*",
|
|
82
|
+
"react-dom": "*",
|
|
75
83
|
"react-native-web": "*"
|
|
76
84
|
},
|
|
77
85
|
"devDependencies": {
|
|
78
|
-
"@tamagui/build": "^1.0.
|
|
86
|
+
"@tamagui/build": "^1.0.4",
|
|
79
87
|
"@types/node": "^16.11.9",
|
|
80
88
|
"@types/react": "^18.0.15",
|
|
89
|
+
"expo-screen-orientation": "^5.0.1",
|
|
90
|
+
"react": "^18.2.0",
|
|
91
|
+
"react-dom": "^18.2.0",
|
|
81
92
|
"react-native-web": "^0.18.3"
|
|
82
93
|
},
|
|
83
94
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14"
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SizeVariantSpreadFunction,
|
|
3
|
-
getVariableValue,
|
|
4
|
-
isWeb,
|
|
5
|
-
stepTokenUpOrDown,
|
|
6
|
-
} from '@tamagui/core'
|
|
1
|
+
import { SizeVariantSpreadFunction, getVariableValue, isWeb } from '@tamagui/core'
|
|
7
2
|
import { getButtonSized } from '@tamagui/get-button-sized'
|
|
8
3
|
import { getFontSized } from '@tamagui/get-font-sized'
|
|
4
|
+
import { stepTokenUpOrDown } from '@tamagui/get-size'
|
|
9
5
|
|
|
10
|
-
export const inputSizeVariant: SizeVariantSpreadFunction<any> = (
|
|
6
|
+
export const inputSizeVariant: SizeVariantSpreadFunction<any> = (
|
|
7
|
+
val = '$true',
|
|
8
|
+
extras
|
|
9
|
+
) => {
|
|
11
10
|
if (extras.props.multiline || extras.props.numberOfLines > 1) {
|
|
12
11
|
return textAreaSizeVariant(val, extras)
|
|
13
12
|
}
|
|
14
13
|
const buttonStyles = getButtonSized(val, extras)
|
|
15
|
-
const paddingHorizontal = stepTokenUpOrDown(
|
|
14
|
+
const paddingHorizontal = stepTokenUpOrDown('space', val, -1, [2])
|
|
16
15
|
const fontStyle = getFontSized(val, extras)
|
|
17
16
|
// lineHeight messes up input on native
|
|
18
17
|
if (!isWeb && fontStyle) {
|
|
@@ -26,7 +25,7 @@ export const inputSizeVariant: SizeVariantSpreadFunction<any> = (val = '$4', ext
|
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
export const textAreaSizeVariant: SizeVariantSpreadFunction<any> = (
|
|
29
|
-
val = '$
|
|
28
|
+
val = '$true',
|
|
30
29
|
extras
|
|
31
30
|
) => {
|
|
32
31
|
const { props } = extras
|
|
@@ -35,8 +34,8 @@ export const textAreaSizeVariant: SizeVariantSpreadFunction<any> = (
|
|
|
35
34
|
const height = props.numberOfLines
|
|
36
35
|
? (props.numberOfLines || 1) * getVariableValue(fontStyle.lineHeight)
|
|
37
36
|
: 'auto'
|
|
38
|
-
const paddingVertical = stepTokenUpOrDown(
|
|
39
|
-
const paddingHorizontal = stepTokenUpOrDown(
|
|
37
|
+
const paddingVertical = stepTokenUpOrDown('space', val, -2, [2])
|
|
38
|
+
const paddingHorizontal = stepTokenUpOrDown('space', val, -1, [2])
|
|
40
39
|
return {
|
|
41
40
|
...buttonStyles,
|
|
42
41
|
...fontStyle,
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from '@tamagui/font-size'
|
|
|
13
13
|
export * from '@tamagui/helpers-tamagui'
|
|
14
14
|
export * from '@tamagui/image'
|
|
15
15
|
export * from '@tamagui/label'
|
|
16
|
+
export * from '@tamagui/linear-gradient'
|
|
16
17
|
export * from '@tamagui/list-item'
|
|
17
18
|
export * from '@tamagui/popover'
|
|
18
19
|
export * from '@tamagui/popper'
|
|
@@ -47,7 +48,6 @@ export * from './views/Grid'
|
|
|
47
48
|
export * from './views/Input'
|
|
48
49
|
export * from './views/Group'
|
|
49
50
|
export * from './views/Layouts'
|
|
50
|
-
export * from './views/LinearGradient'
|
|
51
51
|
// export * from './views/Skeleton'
|
|
52
52
|
export * from './views/Spinner'
|
|
53
53
|
export * from './views/TextArea'
|
|
@@ -81,8 +81,6 @@ export type {
|
|
|
81
81
|
RNWTextProps,
|
|
82
82
|
RNWViewProps,
|
|
83
83
|
Shorthands,
|
|
84
|
-
Slot,
|
|
85
|
-
Slottable,
|
|
86
84
|
SizeTokens,
|
|
87
85
|
SpaceTokens,
|
|
88
86
|
SpacerProps,
|
package/src/views/Fieldset.tsx
CHANGED
package/src/views/Group.tsx
CHANGED
|
@@ -22,7 +22,7 @@ export const GroupFrame = styled(ThemeableStack, {
|
|
|
22
22
|
|
|
23
23
|
variants: {
|
|
24
24
|
size: (val, { tokens }) => {
|
|
25
|
-
const borderRadius = tokens.radius[val] ?? val ?? tokens.radius['$
|
|
25
|
+
const borderRadius = tokens.radius[val] ?? val ?? tokens.radius['$true']
|
|
26
26
|
return {
|
|
27
27
|
borderRadius,
|
|
28
28
|
}
|
|
@@ -30,7 +30,7 @@ export const GroupFrame = styled(ThemeableStack, {
|
|
|
30
30
|
} as const,
|
|
31
31
|
|
|
32
32
|
defaultVariants: {
|
|
33
|
-
size: '$
|
|
33
|
+
size: '$true',
|
|
34
34
|
},
|
|
35
35
|
})
|
|
36
36
|
|
|
@@ -52,7 +52,7 @@ function createGroup(verticalDefault: boolean) {
|
|
|
52
52
|
const {
|
|
53
53
|
children: childrenProp,
|
|
54
54
|
space,
|
|
55
|
-
size = '$
|
|
55
|
+
size = '$true',
|
|
56
56
|
spaceDirection,
|
|
57
57
|
separator,
|
|
58
58
|
scrollable,
|
|
@@ -66,6 +66,7 @@ function createGroup(verticalDefault: boolean) {
|
|
|
66
66
|
const radius =
|
|
67
67
|
borderRadius ??
|
|
68
68
|
(size ? getVariableValue(getTokens(true).radius[size]) - 1 : undefined)
|
|
69
|
+
|
|
69
70
|
const hasRadius = radius !== undefined
|
|
70
71
|
const disablePassBorderRadius = disablePassBorderRadiusProp ?? !hasRadius
|
|
71
72
|
const childrens = Children.toArray(childrenProp)
|
package/src/views/Input.tsx
CHANGED
package/src/views/Skeleton.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { GetProps, TamaguiElement, styled } from '@tamagui/core'
|
|
2
|
+
import { LinearGradient, LinearGradientProps } from '@tamagui/linear-gradient'
|
|
2
3
|
import { YStack } from '@tamagui/stacks'
|
|
3
4
|
import { forwardRef } from 'react'
|
|
4
5
|
|
|
5
|
-
import { LinearGradient, LinearGradientProps } from './LinearGradient'
|
|
6
6
|
import { VisuallyHidden } from './VisuallyHidden'
|
|
7
7
|
|
|
8
8
|
export const SkeletonFrame = styled(YStack, {
|
|
@@ -22,7 +22,7 @@ export const Skeleton = SkeletonFrame.extractable(
|
|
|
22
22
|
<VisuallyHidden preserveDimensions>{children}</VisuallyHidden>
|
|
23
23
|
</SkeletonFrame>
|
|
24
24
|
)
|
|
25
|
-
})
|
|
25
|
+
})
|
|
26
26
|
)
|
|
27
27
|
|
|
28
28
|
export const SkeletonShine = (props: LinearGradientProps) => {
|
package/types/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export * from '@tamagui/font-size';
|
|
|
12
12
|
export * from '@tamagui/helpers-tamagui';
|
|
13
13
|
export * from '@tamagui/image';
|
|
14
14
|
export * from '@tamagui/label';
|
|
15
|
+
export * from '@tamagui/linear-gradient';
|
|
15
16
|
export * from '@tamagui/list-item';
|
|
16
17
|
export * from '@tamagui/popover';
|
|
17
18
|
export * from '@tamagui/popper';
|
|
@@ -43,9 +44,8 @@ export * from './views/Grid';
|
|
|
43
44
|
export * from './views/Input';
|
|
44
45
|
export * from './views/Group';
|
|
45
46
|
export * from './views/Layouts';
|
|
46
|
-
export * from './views/LinearGradient';
|
|
47
47
|
export * from './views/Spinner';
|
|
48
48
|
export * from './views/TextArea';
|
|
49
|
-
export type { AnimationKeys, ColorTokens, CreateTamaguiConfig, CreateTamaguiProps, FontColorTokens, FontLetterSpacingTokens, FontLineHeightTokens, FontSizeTokens, FontStyleTokens, FontTokens, FontTransformTokens, FontWeightTokens, GenericFont, GenericTamaguiConfig, GetAnimationKeys, GetProps, GetVariantProps, GenericTextVariants, GenericStackVariants, Media, MediaPropKeys, MediaQueries, MediaQueryState, RNWTextProps, RNWViewProps, Shorthands,
|
|
49
|
+
export type { AnimationKeys, ColorTokens, CreateTamaguiConfig, CreateTamaguiProps, FontColorTokens, FontLetterSpacingTokens, FontLineHeightTokens, FontSizeTokens, FontStyleTokens, FontTokens, FontTransformTokens, FontWeightTokens, GenericFont, GenericTamaguiConfig, GetAnimationKeys, GetProps, GetVariantProps, GenericTextVariants, GenericStackVariants, Media, MediaPropKeys, MediaQueries, MediaQueryState, RNWTextProps, RNWViewProps, Shorthands, SizeTokens, SpaceTokens, SpacerProps, StackPropsBase, TamaguiElement, StackNonStyleProps, StaticConfig, StaticConfigParsed, TamaguiBaseTheme, TamaguiComponent, TamaguiComponentPropsBase, TamaguiConfig, FontLanguages, TamaguiCustomConfig, TamaguiInternalConfig, TamaguiProviderProps, TextProps, TextPropsBase, TextNonStyleProps, ThemeKeys, ThemeName, ThemeParsed, ThemeProps, Themes, ThemeValueFallback, Tokens, TransformStyleProps, VariantSpreadExtras, VariantSpreadFunction, ZIndexTokens, } from '@tamagui/core';
|
|
50
50
|
export { Spacer, Stack, Text, Theme, FontLanguage, Unspaced, TextAncestorContext, isChrome, isClient, isServer, isTouchable, isWeb, isWebTouchable, mediaQueryConfig, createComponent, createFont, createShorthands, createTheme, addTheme, updateTheme, createTokens, createVariable, getConfig, getAnimationDriver, getMedia, getStylesAtomic, getThemes, getTokens, getVariable, variableToString, getVariableValue, getVariableName, insertFont, isTamaguiElement, isTamaguiComponent, isVariable, matchMedia, mediaObjectToString, mediaState, spacedChildren, styled, themeable, withStaticProperties, useGet, useEvent, useDidFinishSSR, useIsomorphicLayoutEffect, useIsTouchDevice, useMedia, useTheme, useThemeName, useSafeRef, } from '@tamagui/core';
|
|
51
51
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -2,7 +2,7 @@ import { ColorTokens, ThemeTokens } from '@tamagui/core';
|
|
|
2
2
|
import { YStackProps } from '@tamagui/stacks';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { View } from 'react-native';
|
|
5
|
-
import { LinearGradientProps as ExpoLinearGradientProps } from '
|
|
5
|
+
import { LinearGradientProps as ExpoLinearGradientProps } from '../../../linear-gradient/src/linear-gradient';
|
|
6
6
|
export type LinearGradientProps = Omit<ExpoLinearGradientProps, 'colors'> & Omit<YStackProps, 'children' | keyof ExpoLinearGradientProps> & {
|
|
7
7
|
colors?: (ColorTokens | ThemeTokens | (string & {}))[];
|
|
8
8
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { GetProps, TamaguiElement } from '@tamagui/core';
|
|
3
|
-
import { LinearGradientProps } from '
|
|
3
|
+
import { LinearGradientProps } from '@tamagui/linear-gradient';
|
|
4
4
|
export declare const SkeletonFrame: import("@tamagui/core").TamaguiComponent<(Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
|
|
5
5
|
readonly fullscreen?: boolean | undefined;
|
|
6
6
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ColorTokens,
|
|
3
|
-
ThemeTokens,
|
|
4
|
-
getVariable,
|
|
5
|
-
styled,
|
|
6
|
-
themeable,
|
|
7
|
-
useTheme,
|
|
8
|
-
} from '@tamagui/core'
|
|
9
|
-
import { YStack, YStackProps } from '@tamagui/stacks'
|
|
10
|
-
import * as React from 'react'
|
|
11
|
-
import { StyleSheet, View } from 'react-native'
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
LinearGradient as ExpoLinearGradient,
|
|
15
|
-
LinearGradientProps as ExpoLinearGradientProps,
|
|
16
|
-
} from '../lib/linear-gradient'
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
export type LinearGradientProps = Omit<ExpoLinearGradientProps, 'colors'> &
|
|
20
|
-
Omit<YStackProps, 'children' | keyof ExpoLinearGradientProps> & {
|
|
21
|
-
colors?: (ColorTokens | ThemeTokens | (string & {}))[]
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const LinearGradient: React.ForwardRefExoticComponent<
|
|
25
|
-
LinearGradientProps & React.RefAttributes<HTMLElement | View>
|
|
26
|
-
> = YStack.extractable(
|
|
27
|
-
themeable(
|
|
28
|
-
React.forwardRef((props: LinearGradientProps, ref) => {
|
|
29
|
-
const {
|
|
30
|
-
start,
|
|
31
|
-
end,
|
|
32
|
-
colors: colorsProp,
|
|
33
|
-
locations,
|
|
34
|
-
children,
|
|
35
|
-
...stackProps
|
|
36
|
-
} = props
|
|
37
|
-
const colors = useThemeColors(colorsProp || [])
|
|
38
|
-
return (
|
|
39
|
-
// @ts-ignore
|
|
40
|
-
<LinearGradientFrame ref={ref} {...stackProps}>
|
|
41
|
-
<ExpoLinearGradient
|
|
42
|
-
start={start}
|
|
43
|
-
end={end}
|
|
44
|
-
colors={colors}
|
|
45
|
-
locations={locations}
|
|
46
|
-
style={StyleSheet.absoluteFill}
|
|
47
|
-
>
|
|
48
|
-
{children}
|
|
49
|
-
</ExpoLinearGradient>
|
|
50
|
-
</LinearGradientFrame>
|
|
51
|
-
)
|
|
52
|
-
}),
|
|
53
|
-
),
|
|
54
|
-
) as any
|
|
55
|
-
|
|
56
|
-
const LinearGradientFrame = styled(YStack, {
|
|
57
|
-
name: 'LinearGradient',
|
|
58
|
-
overflow: 'hidden',
|
|
59
|
-
position: 'relative',
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
// resolve tamagui theme values
|
|
63
|
-
const useThemeColors = (colors: string[]) => {
|
|
64
|
-
const theme = useTheme()
|
|
65
|
-
return colors.map((color) => {
|
|
66
|
-
if (color[0] === '$') {
|
|
67
|
-
return getVariable(theme[color] || color)
|
|
68
|
-
}
|
|
69
|
-
return color
|
|
70
|
-
})
|
|
71
|
-
}
|