@ornikar/bumper 2.8.1-canary.1768839311.501438316959a9593513e74c70cb87b0597f2db6.0 → 2.8.1-canary.1768927687.5a0439490957cfbbe8b8c5136c5fc68b0828466d.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -6
- package/dist/definitions/index.d.ts +3 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/system/content/icon/Icon.d.ts +4 -7
- package/dist/definitions/system/content/icon/Icon.d.ts.map +1 -1
- package/dist/definitions/system/content/typography/Typography.d.ts +8 -7
- package/dist/definitions/system/content/typography/Typography.d.ts.map +1 -1
- package/dist/definitions/system/content/typography/TypographyIcon.d.ts +9 -0
- package/dist/definitions/system/content/typography/TypographyIcon.d.ts.map +1 -0
- package/dist/definitions/system/content/typography/TypographyView.d.ts +18 -0
- package/dist/definitions/system/content/typography/TypographyView.d.ts.map +1 -0
- package/dist/definitions/system/content/typography/utils/getVariantAndWeightValues.d.ts +2 -1
- package/dist/definitions/system/content/typography/utils/getVariantAndWeightValues.d.ts.map +1 -1
- package/dist/definitions/system/content/typography/utils/typographyContext.d.ts +16 -0
- package/dist/definitions/system/content/typography/utils/typographyContext.d.ts.map +1 -0
- package/dist/definitions/system/core/primitives/Image/Image.d.ts +3 -0
- package/dist/definitions/system/core/primitives/Image/Image.d.ts.map +1 -0
- package/dist/index-metro.es.android.js +116 -11
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +116 -11
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-22.22.cjs.js +119 -7
- package/dist/index-node-22.22.cjs.js.map +1 -1
- package/dist/index-node-22.22.cjs.web.js +119 -7
- package/dist/index-node-22.22.cjs.web.js.map +1 -1
- package/dist/index-node-22.22.es.mjs +120 -9
- package/dist/index-node-22.22.es.mjs.map +1 -1
- package/dist/index-node-22.22.es.web.mjs +120 -9
- package/dist/index-node-22.22.es.web.mjs.map +1 -1
- package/dist/index.es.js +114 -11
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +114 -11
- package/dist/index.es.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +11 -10
- package/src/index.ts +3 -0
- package/src/system/content/icon/Icon.tsx +4 -14
- package/src/system/content/icon/__snapshots_web__/Icon.features.stories.tsx.snap +2 -2
- package/src/system/content/icon/__snapshots_web__/Icon.stories.tsx.snap +1 -1
- package/src/system/content/typography/Typography.tsx +24 -15
- package/src/system/content/typography/TypographyIcon.features.stories.tsx +163 -0
- package/src/system/content/typography/TypographyIcon.stories.tsx +52 -0
- package/src/system/content/typography/TypographyIcon.tsx +33 -0
- package/src/system/content/typography/TypographyView.tsx +34 -0
- package/src/system/content/typography/__snapshots__/TypographyIcon.features.stories.tsx.snap +839 -0
- package/src/system/content/typography/__snapshots__/TypographyIcon.stories.tsx.snap +31 -0
- package/src/system/content/typography/__snapshots_web__/Typography.features.stories.tsx.snap +7 -7
- package/src/system/content/typography/__snapshots_web__/Typography.stories.tsx.snap +1 -1
- package/src/system/content/typography/__snapshots_web__/TypographyIcon.features.stories.tsx.snap +543 -0
- package/src/system/content/typography/__snapshots_web__/TypographyIcon.stories.tsx.snap +37 -0
- package/src/system/content/typography/utils/getVariantAndWeightValues.tsx +2 -6
- package/src/system/content/typography/utils/typographyContext.ts +29 -0
- package/src/system/core/primitives/Image/Image.stories.tsx +39 -0
- package/src/system/core/primitives/Image/Image.ts +2 -0
- package/src/system/core/primitives/Image/__snapshots__/Image.stories.tsx.snap +30 -0
- package/src/system/core/primitives/Image/__snapshots_web__/Image.stories.tsx.snap +40 -0
- package/src/system/core/primitives/ScrollView/__snapshots_web__/ScrollView.features.stories.tsx.snap +11 -11
- package/src/system/core/primitives/ScrollView/__snapshots_web__/ScrollView.stories.tsx.snap +3 -3
- package/src/system/core/primitives/__snapshots_web__/Center.features.stories.tsx.snap +2 -2
- package/src/system/core/primitives/__snapshots_web__/Center.stories.tsx.snap +1 -1
- package/src/system/core/primitives/__snapshots_web__/Pressable.features.stories.tsx.snap +3 -3
- package/src/system/core/primitives/__snapshots_web__/Pressable.stories.tsx.snap +1 -1
- package/src/system/core/primitives/__snapshots_web__/Stack.features.stories.tsx.snap +6 -6
- package/src/system/core/primitives/__snapshots_web__/Stack.stories.tsx.snap +1 -1
- package/src/system/core/primitives/__snapshots_web__/View.features.stories.tsx.snap +11 -11
- package/src/system/core/primitives/__snapshots_web__/View.stories.tsx.snap +1 -1
- package/src/system/core/themes/__snapshots_web__/light.stories.tsx.snap +1 -1
- package/src/system/core/tokens/__snapshots_web__/breakpoints.stories.tsx.snap +1 -1
- package/src/system/core/tokens/__snapshots_web__/fonts.stories.tsx.snap +1 -1
- package/src/system/core/tokens/__snapshots_web__/radius.stories.tsx.snap +1 -1
- package/src/system/core/tokens/__snapshots_web__/size.stories.tsx.snap +1 -1
- package/src/system/core/tokens/__snapshots_web__/space.stories.tsx.snap +1 -1
- package/src/system/core/tokens/palettes/__snapshots_web__/deepPurpleColorPalette.stories.tsx.snap +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,18 +3,15 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [2.8.1-canary.
|
|
6
|
+
## [2.8.1-canary.1768927687.5a0439490957cfbbe8b8c5136c5fc68b0828466d.0](https://github.com/ornikar/kitt/compare/@ornikar/bumper@2.8.0...@ornikar/bumper@2.8.1-canary.1768927687.5a0439490957cfbbe8b8c5136c5fc68b0828466d.0) (2026-01-20)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Features
|
|
10
10
|
|
|
11
|
+
* **bumper:** add Image primitive [OSE-22653] ([#2854](https://github.com/ornikar/kitt/issues/2854)) ([ff6ef30](https://github.com/ornikar/kitt/commit/ff6ef30e9b68525d893591297955718f331d4c5f))
|
|
11
12
|
* **bumper:** add ScrollView primitive [OSE-22231] ([#2853](https://github.com/ornikar/kitt/issues/2853)) ([c1657e6](https://github.com/ornikar/kitt/commit/c1657e677d375077e44e3908fa00afe3d9568ea1))
|
|
12
13
|
* **bumper:** create Icon component OSE-22651 ([#2850](https://github.com/ornikar/kitt/issues/2850)) ([badab32](https://github.com/ornikar/kitt/commit/badab3252d3ed42a97dafa5084baca4c4c34c24b))
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
### Bug Fixes
|
|
16
|
-
|
|
17
|
-
* **tsc:** react 19 typing issue with ReactElement ([5014383](https://github.com/ornikar/kitt/commit/501438316959a9593513e74c70cb87b0597f2db6))
|
|
14
|
+
* **bumper:** create TypographyIcon OSE-22633 ([#2855](https://github.com/ornikar/kitt/issues/2855)) ([297fe14](https://github.com/ornikar/kitt/commit/297fe148e19d80fa39a225fff62279ba901bc876))
|
|
18
15
|
|
|
19
16
|
|
|
20
17
|
|
|
@@ -2,6 +2,8 @@ export { BumperDecorator } from './shared/storybook/BumperDecorator';
|
|
|
2
2
|
export { BumperProvider } from './system/core/provider/BumperProvider';
|
|
3
3
|
export type { CenterProps } from './system/core/primitives/Center';
|
|
4
4
|
export { Center } from './system/core/primitives/Center';
|
|
5
|
+
export type { ImageProps } from './system/core/primitives/Image/Image';
|
|
6
|
+
export { Image } from './system/core/primitives/Image/Image';
|
|
5
7
|
export type { PressableProps } from './system/core/primitives/Pressable';
|
|
6
8
|
export { Pressable } from './system/core/primitives/Pressable';
|
|
7
9
|
export type { ScrollViewProps } from './system/core/primitives/ScrollView/ScrollView';
|
|
@@ -12,6 +14,7 @@ export type { ViewProps } from './system/core/primitives/View';
|
|
|
12
14
|
export { View } from './system/core/primitives/View';
|
|
13
15
|
export type { TypographyTextProps } from './system/content/typography/Typography';
|
|
14
16
|
export { Typography } from './system/content/typography/Typography';
|
|
17
|
+
export type { TypographyIconProps } from './system/content/typography/TypographyIcon';
|
|
15
18
|
export { useBreakpointValue } from './system/core/breakpoints/hooks/useBreakpointValue';
|
|
16
19
|
export { useCurrentBreakpointName } from './system/core/breakpoints/hooks/useCurrentBreakpointName';
|
|
17
20
|
export { useWindowSize } from './system/core/breakpoints/hooks/useWindowSize';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAGvE,YAAY,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,YAAY,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC/D,YAAY,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,gDAAgD,CAAC;AAC5E,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC3F,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACvE,YAAY,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAGrD,YAAY,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAGvE,YAAY,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,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
}, import("@tamagui/core").StaticConfigPublic>;
|
|
6
6
|
type IconContainerProps = GetProps<typeof IconContainer>;
|
|
7
|
-
interface
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
interface IconProps {
|
|
11
|
-
icon: ReactElement<IconElementProps>;
|
|
7
|
+
interface InternalIconProps {
|
|
8
|
+
icon: ReactElement;
|
|
12
9
|
color?: ColorTokens;
|
|
13
10
|
size?: IconContainerProps['size'];
|
|
14
11
|
testID?: IconContainerProps['testID'];
|
|
15
12
|
/** @ignore */
|
|
16
13
|
alignSelf?: IconContainerProps['alignSelf'];
|
|
17
14
|
}
|
|
18
|
-
type
|
|
19
|
-
export declare function Icon({ icon, color, size, testID, alignSelf
|
|
15
|
+
export type IconProps = InternalIconProps & WithMediaProps<InternalIconProps>;
|
|
16
|
+
export declare function Icon({ icon, color, size, testID, alignSelf }: IconProps): ReactNode;
|
|
20
17
|
export {};
|
|
21
18
|
//# sourceMappingURL=Icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../../src/system/content/icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrD,QAAA,MAAM,aAAa;;8CAYjB,CAAC;AAEH,KAAK,kBAAkB,GAAG,QAAQ,CAAC,OAAO,aAAa,CAAC,CAAC;AAEzD,UAAU,
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../../src/system/content/icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrD,QAAA,MAAM,aAAa;;8CAYjB,CAAC;AAEH,KAAK,kBAAkB,GAAG,QAAQ,CAAC,OAAO,aAAa,CAAC,CAAC;AAEzD,UAAU,iBAAiB;IACzB,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,IAAI,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACtC,cAAc;IACd,SAAS,CAAC,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;CAC7C;AAED,MAAM,MAAM,SAAS,GAAG,iBAAiB,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAE9E,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,KAA0B,EAAE,IAAiB,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG,SAAS,CAUrH"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { GetProps, TamaguiComponent, WithMediaProps } from '@tamagui/core';
|
|
1
|
+
import type { ColorTokens, GetProps, TamaguiComponent, WithMediaProps } from '@tamagui/core';
|
|
2
2
|
import { type Except } from 'type-fest';
|
|
3
|
-
import type { BodyFontVariants, ContentCapsVariants,
|
|
3
|
+
import type { BodyFontVariants, ContentCapsVariants, HeadingFontVariants, LabelFontVariants } from '../../core/tokens/fonts';
|
|
4
|
+
import { TypographyIcon } from './TypographyIcon';
|
|
4
5
|
type PropsWithoutMedia<A> = {
|
|
5
6
|
[Key in keyof A as Key extends `$${string}` ? never : Key]?: A[Key];
|
|
6
7
|
};
|
|
@@ -10,11 +11,10 @@ declare const InternalTypography: TamaguiComponent<import("@tamagui/core").TamaD
|
|
|
10
11
|
weight?: "bold" | "semibold" | "regular" | undefined;
|
|
11
12
|
}, import("@tamagui/core").StaticConfigPublic>;
|
|
12
13
|
export type InternalTypographyProps = GetProps<typeof InternalTypography>;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
type TypographyPropsWithoutFontStyleProps = Except<InternalTypographyProps, TypographyExcludedFontStyleProps>;
|
|
14
|
+
type TypographyExcludedFontStyleProps = 'fontFamily' | 'fontSize' | 'lineHeight' | 'fontStyle' | 'fontVariant' | 'fontWeight' | 'color';
|
|
15
|
+
type TypographyPropsWithoutFontStyleProps = Except<InternalTypographyProps, TypographyExcludedFontStyleProps> & {
|
|
16
|
+
color: ColorTokens;
|
|
17
|
+
};
|
|
18
18
|
export interface BodyProps extends TypographyPropsWithoutFontStyleProps {
|
|
19
19
|
variant?: BodyFontVariants;
|
|
20
20
|
weight?: 'regular' | 'bold';
|
|
@@ -39,6 +39,7 @@ export declare const Typography: {
|
|
|
39
39
|
Header4: TamaguiComponent<TypographyTextProps>;
|
|
40
40
|
Header5: TamaguiComponent<TypographyTextProps>;
|
|
41
41
|
Header6: TamaguiComponent<TypographyTextProps>;
|
|
42
|
+
Icon: typeof TypographyIcon;
|
|
42
43
|
};
|
|
43
44
|
export {};
|
|
44
45
|
//# sourceMappingURL=Typography.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../../../../../src/system/content/typography/Typography.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAuB,gBAAgB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../../../../../src/system/content/typography/Typography.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAuB,gBAAgB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAElH,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EAEnB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO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U;;;;;;;;;;;;CAStB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { Except } from 'type-fest';
|
|
3
|
+
import type { IconProps } from '../icon/Icon';
|
|
4
|
+
import type { TypographyTextProps } from './Typography';
|
|
5
|
+
export interface TypographyIconProps extends Except<IconProps, 'color'> {
|
|
6
|
+
color?: TypographyTextProps['color'];
|
|
7
|
+
}
|
|
8
|
+
export declare function TypographyIcon({ color, ...props }: TypographyIconProps): ReactNode;
|
|
9
|
+
//# sourceMappingURL=TypographyIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypographyIcon.d.ts","sourceRoot":"","sources":["../../../../../src/system/content/typography/TypographyIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAIxD,MAAM,WAAW,mBAAoB,SAAQ,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC;IACrE,KAAK,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;CACtC;AAgBD,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,GAAG,SAAS,CAMlF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { GetProps } from '@tamagui/core';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
declare const InternalTypographyView: import("@tamagui/core").TamaguiComponent<import("@tamagui/core").TamaDefer, import("@tamagui/core").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {}, import("@tamagui/core").StaticConfigPublic>;
|
|
4
|
+
type TypographyViewProps = GetProps<typeof InternalTypographyView>;
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* A wrapper component that applies typography styles to its children in order to maintain consistent style between web and native
|
|
8
|
+
* In native, it simply renders a View as it renders correctly by default
|
|
9
|
+
* In web, it ensures that the display is set to inline-flex when inside a Typography context
|
|
10
|
+
*
|
|
11
|
+
* React Native Web includes this implementation in its codebase
|
|
12
|
+
* but Tamagui does not use React Native Webview, we need to implement it ourselves
|
|
13
|
+
*
|
|
14
|
+
* Inside a Typography component, always use TypographyView to wrap external components like Icon or Svg
|
|
15
|
+
*/
|
|
16
|
+
export declare function TypographyView(props: TypographyViewProps): ReactNode;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=TypographyView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypographyView.d.ts","sourceRoot":"","sources":["../../../../../src/system/content/typography/TypographyView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,QAAA,MAAM,sBAAsB,iQAE1B,CAAC;AAEH,KAAK,mBAAmB,GAAG,QAAQ,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEnE;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,SAAS,CAWpE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FontVariants } from '../../../core/tokens/fonts';
|
|
2
|
-
import type { InternalTypographyProps, TypographyTextProps
|
|
2
|
+
import type { InternalTypographyProps, TypographyTextProps } from '../Typography';
|
|
3
|
+
import type { TypographyVariantContextValue, TypographyWeightContextValue } from './typographyContext';
|
|
3
4
|
interface VariantAndWeightValues {
|
|
4
5
|
weight: InternalTypographyProps['weight'] | undefined;
|
|
5
6
|
variant: FontVariants | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getVariantAndWeightValues.d.ts","sourceRoot":"","sources":["../../../../../../src/system/content/typography/utils/getVariantAndWeightValues.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"getVariantAndWeightValues.d.ts","sourceRoot":"","sources":["../../../../../../src/system/content/typography/utils/getVariantAndWeightValues.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAClF,OAAO,KAAK,EAAE,6BAA6B,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAEvG,UAAU,sBAAsB;IAC9B,MAAM,EAAE,uBAAuB,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;IACtD,OAAO,EAAE,YAAY,GAAG,SAAS,CAAC;CACnC;AAED,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,mBAAmB,CAAC,QAAQ,CAAC,EACzC,WAAW,EAAE,mBAAmB,CAAC,SAAS,CAAC,EAC3C,6BAA6B,EAAE,4BAA4B,EAC3D,8BAA8B,EAAE,6BAA6B,GAC5D,sBAAsB,CAuBxB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FontVariants } from '../../../core/tokens/fonts';
|
|
2
|
+
import type { TypographyTextProps } from '../Typography';
|
|
3
|
+
export type TypographyVariantContextValue = FontVariants | null;
|
|
4
|
+
export type TypographyWeightContextValue = 'regular' | 'bold' | 'semibold' | null;
|
|
5
|
+
export type TypograhyColorContextValue = TypographyTextProps['color'] | null;
|
|
6
|
+
type TypographyContextValue = boolean;
|
|
7
|
+
export declare const TypographyVariantContext: import("react").Context<TypographyVariantContextValue>;
|
|
8
|
+
export declare const TypographyWeightContext: import("react").Context<TypographyWeightContextValue>;
|
|
9
|
+
export declare const TypograhyColorContext: import("react").Context<TypograhyColorContextValue>;
|
|
10
|
+
export declare const TypographyContext: import("react").Context<boolean>;
|
|
11
|
+
export declare const useTypographyColor: () => TypograhyColorContextValue;
|
|
12
|
+
export declare const useTypographyVariant: () => TypographyVariantContextValue;
|
|
13
|
+
export declare const useTypographyWeight: () => TypographyWeightContextValue;
|
|
14
|
+
export declare const useTypographyContext: () => TypographyContextValue;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=typographyContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typographyContext.d.ts","sourceRoot":"","sources":["../../../../../../src/system/content/typography/utils/typographyContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD,MAAM,MAAM,6BAA6B,GAAG,YAAY,GAAG,IAAI,CAAC;AAChE,MAAM,MAAM,4BAA4B,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC;AAClF,MAAM,MAAM,0BAA0B,GAAG,mBAAmB,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AAC7E,KAAK,sBAAsB,GAAG,OAAO,CAAC;AAEtC,eAAO,MAAM,wBAAwB,wDAAqD,CAAC;AAC3F,eAAO,MAAM,uBAAuB,uDAAoD,CAAC;AACzF,eAAO,MAAM,qBAAqB,qDAAkD,CAAC;AACrF,eAAO,MAAM,iBAAiB,kCAAgC,CAAC;AAE/D,eAAO,MAAM,kBAAkB,QAAO,0BAErC,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAO,6BAEvC,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAAO,4BAEtC,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAO,sBAEvC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../../../src/system/core/primitives/Image/Image.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { makeDecorator } from '@storybook/preview-api';
|
|
2
|
-
import { createFont, createTokens, createTamagui, TamaguiProvider, styled, View, Stack, Text, useMedia } from '@tamagui/core';
|
|
2
|
+
import { createFont, createTokens, createTamagui, TamaguiProvider, styled, View, Stack, useStyle, Text, useMedia } from '@tamagui/core';
|
|
3
3
|
export { Stack, View } from '@tamagui/core';
|
|
4
4
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
7
|
-
import {
|
|
7
|
+
import { cloneElement, createContext, useContext, useMemo } from 'react';
|
|
8
|
+
export { Image } from '@tamagui/image';
|
|
8
9
|
export { ScrollView } from '@tamagui/scroll-view';
|
|
9
10
|
export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
10
11
|
|
|
@@ -406,7 +407,7 @@ const Center = styled(View, {
|
|
|
406
407
|
alignItems: 'center'
|
|
407
408
|
});
|
|
408
409
|
|
|
409
|
-
const _excluded = ["as"];
|
|
410
|
+
const _excluded$1 = ["as"];
|
|
410
411
|
/**
|
|
411
412
|
* A polymorphic Pressable component that can render as any Tamagui primitive.
|
|
412
413
|
*/
|
|
@@ -414,7 +415,7 @@ function Pressable(_ref) {
|
|
|
414
415
|
let {
|
|
415
416
|
as
|
|
416
417
|
} = _ref,
|
|
417
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
418
|
+
rest = _objectWithoutProperties(_ref, _excluded$1);
|
|
418
419
|
const Component = styled(as !== null && as !== void 0 ? as : View, {
|
|
419
420
|
name: 'Pressable',
|
|
420
421
|
role: 'button',
|
|
@@ -432,6 +433,107 @@ const VStack = styled(Stack, {
|
|
|
432
433
|
flexDirection: 'column'
|
|
433
434
|
});
|
|
434
435
|
|
|
436
|
+
const IconContainer = styled(View, {
|
|
437
|
+
name: 'Icon',
|
|
438
|
+
variants: {
|
|
439
|
+
size: {
|
|
440
|
+
'...size': (size, {
|
|
441
|
+
tokens
|
|
442
|
+
}) => {
|
|
443
|
+
return {
|
|
444
|
+
width: tokens.size[size],
|
|
445
|
+
height: tokens.size[size]
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
function Icon({
|
|
452
|
+
icon,
|
|
453
|
+
color = '$content.base.hi',
|
|
454
|
+
size = '$size.20',
|
|
455
|
+
testID,
|
|
456
|
+
alignSelf
|
|
457
|
+
}) {
|
|
458
|
+
const style = useStyle({
|
|
459
|
+
color
|
|
460
|
+
});
|
|
461
|
+
const clonedIcon = /*#__PURE__*/cloneElement(icon, {
|
|
462
|
+
color: style.color
|
|
463
|
+
});
|
|
464
|
+
return /*#__PURE__*/jsx(IconContainer, {
|
|
465
|
+
size: size,
|
|
466
|
+
testID: testID,
|
|
467
|
+
alignSelf: alignSelf,
|
|
468
|
+
children: clonedIcon
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
const TypographyVariantContext = /*#__PURE__*/createContext(null);
|
|
473
|
+
const TypographyWeightContext = /*#__PURE__*/createContext(null);
|
|
474
|
+
const TypograhyColorContext = /*#__PURE__*/createContext(null);
|
|
475
|
+
const TypographyContext = /*#__PURE__*/createContext(false);
|
|
476
|
+
const useTypographyColor = () => {
|
|
477
|
+
return useContext(TypograhyColorContext);
|
|
478
|
+
};
|
|
479
|
+
const useTypographyVariant = () => {
|
|
480
|
+
return useContext(TypographyVariantContext);
|
|
481
|
+
};
|
|
482
|
+
const useTypographyWeight = () => {
|
|
483
|
+
return useContext(TypographyWeightContext);
|
|
484
|
+
};
|
|
485
|
+
const useTypographyContext = () => {
|
|
486
|
+
return useContext(TypographyContext);
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
const InternalTypographyView = styled(View, {
|
|
490
|
+
name: 'TypographyView'
|
|
491
|
+
});
|
|
492
|
+
/**
|
|
493
|
+
*
|
|
494
|
+
* A wrapper component that applies typography styles to its children in order to maintain consistent style between web and native
|
|
495
|
+
* In native, it simply renders a View as it renders correctly by default
|
|
496
|
+
* In web, it ensures that the display is set to inline-flex when inside a Typography context
|
|
497
|
+
*
|
|
498
|
+
* React Native Web includes this implementation in its codebase
|
|
499
|
+
* but Tamagui does not use React Native Webview, we need to implement it ourselves
|
|
500
|
+
*
|
|
501
|
+
* Inside a Typography component, always use TypographyView to wrap external components like Icon or Svg
|
|
502
|
+
*/
|
|
503
|
+
function TypographyView(props) {
|
|
504
|
+
const isInTypographyContext = useTypographyContext();
|
|
505
|
+
return /*#__PURE__*/jsx(InternalTypographyView, _objectSpread(_objectSpread({}, props), {}, {
|
|
506
|
+
"$platform-web": isInTypographyContext ? _objectSpread(_objectSpread({}, props['$platform-web']), {}, {
|
|
507
|
+
display: 'inline-flex'
|
|
508
|
+
}) : props['$platform-web']
|
|
509
|
+
}));
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
const _excluded = ["color"];
|
|
513
|
+
function TypographyIconInternal(props) {
|
|
514
|
+
return /*#__PURE__*/jsx(TypographyView, {
|
|
515
|
+
children: /*#__PURE__*/jsx(Icon, _objectSpread({}, props))
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
function TypographyIconInheritColor(props) {
|
|
519
|
+
const typographyColorAncestorValue = useTypographyColor();
|
|
520
|
+
return /*#__PURE__*/jsx(TypographyIconInternal, _objectSpread({
|
|
521
|
+
color: typographyColorAncestorValue || undefined
|
|
522
|
+
}, props));
|
|
523
|
+
}
|
|
524
|
+
function TypographyIcon(_ref) {
|
|
525
|
+
let {
|
|
526
|
+
color
|
|
527
|
+
} = _ref,
|
|
528
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
529
|
+
if (color) {
|
|
530
|
+
return /*#__PURE__*/jsx(TypographyIconInternal, _objectSpread({
|
|
531
|
+
color: color
|
|
532
|
+
}, props));
|
|
533
|
+
}
|
|
534
|
+
return /*#__PURE__*/jsx(TypographyIconInheritColor, _objectSpread({}, props));
|
|
535
|
+
}
|
|
536
|
+
|
|
435
537
|
function getVariantAndWeightValues(weightProp, variantProp, typographyWeightAncestorValue, typographyVariantAncestorValue) {
|
|
436
538
|
const computedVariant = variantProp || typographyVariantAncestorValue || undefined;
|
|
437
539
|
if (computedVariant) {
|
|
@@ -502,16 +604,14 @@ const InternalTypography = styled(Text, {
|
|
|
502
604
|
weight: 'regular'
|
|
503
605
|
}
|
|
504
606
|
});
|
|
505
|
-
const TypographyVariantContext = /*#__PURE__*/createContext(null);
|
|
506
|
-
const TypographyWeightContext = /*#__PURE__*/createContext(null);
|
|
507
|
-
const TypograhyColorContext = /*#__PURE__*/createContext(null);
|
|
508
607
|
|
|
509
608
|
// Remove font-related style props from InternalTypography Props
|
|
510
609
|
|
|
511
610
|
const TypographyBase = InternalTypography.styleable((props, ref) => {
|
|
512
|
-
const typographyVariantAncestorValue =
|
|
513
|
-
const typographyWeightAncestorValue =
|
|
514
|
-
const typographyColorAncestorValue =
|
|
611
|
+
const typographyVariantAncestorValue = useTypographyVariant();
|
|
612
|
+
const typographyWeightAncestorValue = useTypographyWeight();
|
|
613
|
+
const typographyColorAncestorValue = useTypographyColor();
|
|
614
|
+
const typographyContext = useTypographyContext();
|
|
515
615
|
const {
|
|
516
616
|
variant,
|
|
517
617
|
weight
|
|
@@ -524,6 +624,10 @@ const TypographyBase = InternalTypography.styleable((props, ref) => {
|
|
|
524
624
|
weight: weight,
|
|
525
625
|
variant: variant
|
|
526
626
|
}));
|
|
627
|
+
content = typographyContext ? content : /*#__PURE__*/jsx(TypographyContext.Provider, {
|
|
628
|
+
value: true,
|
|
629
|
+
children: content
|
|
630
|
+
});
|
|
527
631
|
|
|
528
632
|
// If a variant is provided, we set it in the context for children to be able to inherit variant value
|
|
529
633
|
content = props.variant ? /*#__PURE__*/jsx(TypographyVariantContext.Provider, {
|
|
@@ -561,7 +665,8 @@ const Typography = {
|
|
|
561
665
|
Header3: createHeading(3),
|
|
562
666
|
Header4: createHeading(4),
|
|
563
667
|
Header5: createHeading(5),
|
|
564
|
-
Header6: createHeading(6)
|
|
668
|
+
Header6: createHeading(6),
|
|
669
|
+
Icon: TypographyIcon
|
|
565
670
|
};
|
|
566
671
|
|
|
567
672
|
function getValueForBreakpoint(breakpoint, {
|