@ornikar/bumper 2.8.1-canary.1768839311.501438316959a9593513e74c70cb87b0597f2db6.0 → 2.8.1-canary.1769087114.a46790da1b5b6361954b6ad25766074d3ed69784.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 +6 -6
- package/dist/definitions/index.d.ts +5 -1
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/shared/storybook/StoryTitle.d.ts +1 -1
- package/dist/definitions/shared/storybook/helpers/argsHelpers.d.ts +8 -0
- package/dist/definitions/shared/storybook/helpers/argsHelpers.d.ts.map +1 -0
- 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 +11 -19
- 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/TypographyLink.d.ts +9 -0
- package/dist/definitions/system/content/typography/TypographyLink.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/index.d.ts +21 -0
- package/dist/definitions/system/content/typography/index.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/themes/light/light.d.ts +3 -0
- package/dist/definitions/system/core/themes/light/light.d.ts.map +1 -0
- package/dist/definitions/system/core/themes/themes.d.ts +6 -0
- package/dist/definitions/system/core/themes/themes.d.ts.map +1 -0
- package/dist/definitions/tamagui.config.d.ts +1 -57
- package/dist/definitions/tamagui.config.d.ts.map +1 -1
- package/dist/index-metro.es.android.js +151 -12
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +151 -12
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-22.22.cjs.js +154 -8
- package/dist/index-node-22.22.cjs.js.map +1 -1
- package/dist/index-node-22.22.cjs.web.js +154 -8
- package/dist/index-node-22.22.cjs.web.js.map +1 -1
- package/dist/index-node-22.22.es.mjs +155 -10
- package/dist/index-node-22.22.es.mjs.map +1 -1
- package/dist/index-node-22.22.es.web.mjs +155 -10
- package/dist/index-node-22.22.es.web.mjs.map +1 -1
- package/dist/index.es.js +149 -12
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +149 -12
- package/dist/index.es.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +11 -10
- package/src/index.ts +5 -1
- package/src/shared/storybook/StoryTitle.tsx +1 -1
- package/src/shared/storybook/helpers/argsHelpers.ts +47 -0
- package/src/system/content/icon/Icon.features.stories.tsx +1 -1
- package/src/system/content/icon/Icon.stories.tsx +3 -22
- 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.features.stories.tsx +1 -1
- package/src/system/content/typography/Typography.stories.tsx +3 -23
- package/src/system/content/typography/Typography.tsx +24 -27
- package/src/system/content/typography/TypographyIcon.features.stories.tsx +163 -0
- package/src/system/content/typography/TypographyIcon.stories.tsx +35 -0
- package/src/system/content/typography/TypographyIcon.tsx +33 -0
- package/src/system/content/typography/TypographyLink.features.stories.tsx +62 -0
- package/src/system/content/typography/TypographyLink.stories.tsx +72 -0
- package/src/system/content/typography/TypographyLink.tsx +38 -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__/TypographyLink.features.stories.tsx.snap +229 -0
- package/src/system/content/typography/__snapshots__/TypographyLink.stories.tsx.snap +41 -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/__snapshots_web__/TypographyLink.features.stories.tsx.snap +196 -0
- package/src/system/content/typography/__snapshots_web__/TypographyLink.stories.tsx.snap +33 -0
- package/src/system/content/typography/index.ts +15 -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/Center.features.stories.tsx +1 -1
- package/src/system/core/primitives/Center.stories.tsx +6 -89
- package/src/system/core/primitives/Image/Image.stories.tsx +34 -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/Pressable.features.stories.tsx +1 -1
- package/src/system/core/primitives/Pressable.stories.tsx +4 -53
- package/src/system/core/primitives/ScrollView/ScrollView.features.stories.tsx +1 -1
- package/src/system/core/primitives/ScrollView/ScrollView.stories.tsx +3 -6
- 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/Stack.features.stories.tsx +1 -1
- package/src/system/core/primitives/Stack.stories.tsx +4 -39
- package/src/system/core/primitives/View.features.stories.tsx +1 -1
- package/src/system/core/primitives/View.stories.tsx +6 -107
- 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/__snapshots_web__}/light.stories.tsx.snap +1 -1
- package/src/system/core/themes/{light.stories.tsx → light/light.stories.tsx} +5 -5
- package/src/system/core/themes/{light.ts → light/light.ts} +3 -2
- package/src/system/core/themes/themes.ts +69 -0
- 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/breakpoints.stories.tsx +1 -1
- package/src/system/core/tokens/fonts.stories.tsx +1 -1
- package/src/system/core/tokens/palettes/__snapshots_web__/deepPurpleColorPalette.stories.tsx.snap +1 -1
- package/src/system/core/tokens/palettes/deepPurpleColorPalette.stories.tsx +1 -1
- package/src/system/core/tokens/radius.stories.tsx +1 -1
- package/src/system/core/tokens/size.stories.tsx +1 -1
- package/src/system/core/tokens/space.stories.tsx +1 -1
- package/src/tamagui.config.ts +1 -1
- package/dist/definitions/system/core/themes/light.d.ts +0 -58
- package/dist/definitions/system/core/themes/light.d.ts.map +0 -1
- /package/src/system/core/themes/{__snapshots__ → light/__snapshots__}/light.stories.tsx.snap +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { VStack } from '../../core/primitives/Stack';
|
|
3
|
+
import { TypographyLink } from './TypographyLink';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof TypographyLink> = {
|
|
6
|
+
title: 'Bumper/Content/TypographyLink/Features',
|
|
7
|
+
component: TypographyLink,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
|
|
13
|
+
export const DisabledFalse: Story = {
|
|
14
|
+
args: {
|
|
15
|
+
disabled: false,
|
|
16
|
+
children: 'Enabled link (clickable with pointer cursor)',
|
|
17
|
+
onPress: () => alert('Link clicked!'),
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const DisabledTrue: Story = {
|
|
22
|
+
args: {
|
|
23
|
+
disabled: true,
|
|
24
|
+
children: 'Disabled link (not-allowed cursor, onPress removed)',
|
|
25
|
+
onPress: () => alert('This should not be called'),
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const NoUnderlineFalse: Story = {
|
|
30
|
+
args: {
|
|
31
|
+
noUnderline: false,
|
|
32
|
+
children: 'Link with underline (default)',
|
|
33
|
+
onPress: () => alert('Link clicked!'),
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const NoUnderlineTrue: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
noUnderline: true,
|
|
40
|
+
children: 'Link without underline',
|
|
41
|
+
onPress: () => alert('Link clicked!'),
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const StateHover: Story = {
|
|
46
|
+
render: () => (
|
|
47
|
+
<VStack gap="$space.16">
|
|
48
|
+
<TypographyLink forceStyle="hover" onPress={() => alert('Link clicked!')}>
|
|
49
|
+
Forced hover state - underline removed (hoverStyle applied)
|
|
50
|
+
</TypographyLink>
|
|
51
|
+
<TypographyLink noUnderline forceStyle="hover" onPress={() => alert('Link clicked!')}>
|
|
52
|
+
Forced hover state with noUnderline - no visual change
|
|
53
|
+
</TypographyLink>
|
|
54
|
+
<TypographyLink disabled forceStyle="hover" onPress={() => alert('Link clicked!')}>
|
|
55
|
+
Forced hover state on disabled - underline removed (hoverStyle applied)
|
|
56
|
+
</TypographyLink>
|
|
57
|
+
<TypographyLink disabled noUnderline forceStyle="hover" onPress={() => alert('Link clicked!')}>
|
|
58
|
+
Forced hover state with noUnderline on disabled - no visual change
|
|
59
|
+
</TypographyLink>
|
|
60
|
+
</VStack>
|
|
61
|
+
),
|
|
62
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { contentColorArgType } from '../../../shared/storybook/helpers/argsHelpers';
|
|
3
|
+
import { TypographyLink } from './TypographyLink';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof TypographyLink> = {
|
|
6
|
+
title: 'Bumper/Content/TypographyLink',
|
|
7
|
+
component: TypographyLink,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
argTypes: {
|
|
10
|
+
variant: {
|
|
11
|
+
control: 'select',
|
|
12
|
+
options: [
|
|
13
|
+
'heading-2xl',
|
|
14
|
+
'heading-xl',
|
|
15
|
+
'heading-l',
|
|
16
|
+
'heading-m',
|
|
17
|
+
'heading-s',
|
|
18
|
+
'heading-xs',
|
|
19
|
+
'heading-2xs',
|
|
20
|
+
'body-xl',
|
|
21
|
+
'body-l',
|
|
22
|
+
'body-m',
|
|
23
|
+
'body-s',
|
|
24
|
+
'body-xs',
|
|
25
|
+
'label-xl',
|
|
26
|
+
'label-l',
|
|
27
|
+
'label-m',
|
|
28
|
+
'label-s',
|
|
29
|
+
'content-caps-3xl',
|
|
30
|
+
'content-caps-2xl',
|
|
31
|
+
'content-caps-xl',
|
|
32
|
+
'content-caps-l',
|
|
33
|
+
'content-caps-m',
|
|
34
|
+
'content-caps-s',
|
|
35
|
+
'content-caps-xs',
|
|
36
|
+
],
|
|
37
|
+
description: 'Typography variant (inherited from Typography.Text)',
|
|
38
|
+
},
|
|
39
|
+
weight: {
|
|
40
|
+
control: 'select',
|
|
41
|
+
options: ['regular', 'semibold', 'bold'],
|
|
42
|
+
description: 'Font weight (inherited from Typography.Text)',
|
|
43
|
+
},
|
|
44
|
+
color: contentColorArgType,
|
|
45
|
+
disabled: {
|
|
46
|
+
control: 'boolean',
|
|
47
|
+
description: 'When true, shows not-allowed cursor and disabled color',
|
|
48
|
+
},
|
|
49
|
+
noUnderline: {
|
|
50
|
+
control: 'boolean',
|
|
51
|
+
description: 'When true, removes the underline decoration',
|
|
52
|
+
},
|
|
53
|
+
onPress: {
|
|
54
|
+
description: 'Click/press handler (automatically removed when disabled=true)',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export default meta;
|
|
60
|
+
type Story = StoryObj<typeof meta>;
|
|
61
|
+
|
|
62
|
+
export const Default: Story = {
|
|
63
|
+
args: {
|
|
64
|
+
variant: 'body-m',
|
|
65
|
+
weight: 'regular',
|
|
66
|
+
color: '$content.accent',
|
|
67
|
+
disabled: false,
|
|
68
|
+
noUnderline: false,
|
|
69
|
+
children: 'This is a link',
|
|
70
|
+
onPress: () => alert('Link clicked!'),
|
|
71
|
+
},
|
|
72
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { GetProps } from '@tamagui/core';
|
|
2
|
+
import { styled } from '@tamagui/core';
|
|
3
|
+
import { TypographyBase } from './Typography';
|
|
4
|
+
|
|
5
|
+
export const TypographyLink = styled(TypographyBase, {
|
|
6
|
+
name: 'TypographyLink',
|
|
7
|
+
role: 'link',
|
|
8
|
+
variants: {
|
|
9
|
+
disabled: {
|
|
10
|
+
true: {
|
|
11
|
+
cursor: 'not-allowed',
|
|
12
|
+
onPress: undefined,
|
|
13
|
+
color: '$content.disabled',
|
|
14
|
+
hoverStyle: undefined,
|
|
15
|
+
},
|
|
16
|
+
false: {
|
|
17
|
+
cursor: 'pointer',
|
|
18
|
+
hoverStyle: {
|
|
19
|
+
textDecorationLine: 'none',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
noUnderline: {
|
|
24
|
+
true: {
|
|
25
|
+
textDecorationLine: 'none',
|
|
26
|
+
},
|
|
27
|
+
false: {
|
|
28
|
+
textDecorationLine: 'underline',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
} as const,
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
disabled: false,
|
|
34
|
+
noUnderline: false,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export type TypographyLinkProps = GetProps<typeof TypographyLink>;
|
|
@@ -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
|
+
}
|