@ornikar/bumper 2.8.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 +12 -0
- package/dist/definitions/index.d.ts +5 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/system/content/icon/Icon.d.ts +18 -0
- package/dist/definitions/system/content/icon/Icon.d.ts.map +1 -0
- 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/definitions/system/core/primitives/ScrollView/ScrollView.d.ts +3 -0
- package/dist/definitions/system/core/primitives/ScrollView/ScrollView.d.ts.map +1 -0
- package/dist/index-metro.es.android.js +117 -11
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +117 -11
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-22.22.cjs.js +121 -7
- package/dist/index-node-22.22.cjs.js.map +1 -1
- package/dist/index-node-22.22.cjs.web.js +121 -7
- package/dist/index-node-22.22.cjs.web.js.map +1 -1
- package/dist/index-node-22.22.es.mjs +121 -9
- package/dist/index-node-22.22.es.mjs.map +1 -1
- package/dist/index-node-22.22.es.web.mjs +121 -9
- package/dist/index-node-22.22.es.web.mjs.map +1 -1
- package/dist/index.es.js +115 -11
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +115 -11
- package/dist/index.es.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +7 -3
- package/src/index.ts +5 -0
- package/src/system/content/icon/Icon.features.stories.tsx +116 -0
- package/src/system/content/icon/Icon.stories.tsx +44 -0
- package/src/system/content/icon/Icon.tsx +43 -0
- package/src/system/content/icon/__snapshots__/Icon.features.stories.tsx.snap +569 -0
- package/src/system/content/icon/__snapshots__/Icon.stories.tsx.snap +29 -0
- package/src/system/content/icon/__snapshots_web__/Icon.features.stories.tsx.snap +309 -0
- package/src/system/content/icon/__snapshots_web__/Icon.stories.tsx.snap +33 -0
- 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__/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/ScrollView.features.stories.tsx +84 -0
- package/src/system/core/primitives/ScrollView/ScrollView.stories.tsx +63 -0
- package/src/system/core/primitives/ScrollView/ScrollView.ts +2 -0
- package/src/system/core/primitives/ScrollView/__snapshots__/ScrollView.features.stories.tsx.snap +1245 -0
- package/src/system/core/primitives/ScrollView/__snapshots__/ScrollView.stories.tsx.snap +334 -0
- package/src/system/core/primitives/ScrollView/__snapshots_web__/ScrollView.features.stories.tsx.snap +503 -0
- package/src/system/core/primitives/ScrollView/__snapshots_web__/ScrollView.stories.tsx.snap +138 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { Except } from 'type-fest';
|
|
3
|
+
import type { IconProps } from '../icon/Icon';
|
|
4
|
+
import { Icon } from '../icon/Icon';
|
|
5
|
+
import type { TypographyTextProps } from './Typography';
|
|
6
|
+
import { TypographyView } from './TypographyView';
|
|
7
|
+
import { useTypographyColor } from './utils/typographyContext';
|
|
8
|
+
|
|
9
|
+
export interface TypographyIconProps extends Except<IconProps, 'color'> {
|
|
10
|
+
color?: TypographyTextProps['color'];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function TypographyIconInternal(props: TypographyIconProps): ReactNode {
|
|
14
|
+
return (
|
|
15
|
+
<TypographyView>
|
|
16
|
+
<Icon {...props} />
|
|
17
|
+
</TypographyView>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function TypographyIconInheritColor(props: TypographyIconProps): ReactNode {
|
|
22
|
+
const typographyColorAncestorValue = useTypographyColor();
|
|
23
|
+
|
|
24
|
+
return <TypographyIconInternal color={typographyColorAncestorValue || undefined} {...props} />;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function TypographyIcon({ color, ...props }: TypographyIconProps): ReactNode {
|
|
28
|
+
if (color) {
|
|
29
|
+
return <TypographyIconInternal color={color} {...props} />;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return <TypographyIconInheritColor {...props} />;
|
|
33
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { GetProps } from '@tamagui/core';
|
|
2
|
+
import { View, styled } from '@tamagui/core';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
import { useTypographyContext } from './utils/typographyContext';
|
|
5
|
+
|
|
6
|
+
const InternalTypographyView = styled(View, {
|
|
7
|
+
name: 'TypographyView',
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
type TypographyViewProps = GetProps<typeof InternalTypographyView>;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* A wrapper component that applies typography styles to its children in order to maintain consistent style between web and native
|
|
15
|
+
* In native, it simply renders a View as it renders correctly by default
|
|
16
|
+
* In web, it ensures that the display is set to inline-flex when inside a Typography context
|
|
17
|
+
*
|
|
18
|
+
* React Native Web includes this implementation in its codebase
|
|
19
|
+
* but Tamagui does not use React Native Webview, we need to implement it ourselves
|
|
20
|
+
*
|
|
21
|
+
* Inside a Typography component, always use TypographyView to wrap external components like Icon or Svg
|
|
22
|
+
*/
|
|
23
|
+
export function TypographyView(props: TypographyViewProps): ReactNode {
|
|
24
|
+
const isInTypographyContext = useTypographyContext();
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<InternalTypographyView
|
|
28
|
+
{...props}
|
|
29
|
+
$platform-web={
|
|
30
|
+
isInTypographyContext ? { ...props['$platform-web'], display: 'inline-flex' } : props['$platform-web']
|
|
31
|
+
}
|
|
32
|
+
/>
|
|
33
|
+
);
|
|
34
|
+
}
|