@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ornikar/bumper",
|
|
3
|
-
"version": "2.8.0",
|
|
3
|
+
"version": "2.8.1-canary.1768927687.5a0439490957cfbbe8b8c5136c5fc68b0828466d.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"directory": "@ornikar/bumper",
|
|
@@ -28,7 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@babel/runtime": "^7.24.0",
|
|
31
|
-
"@
|
|
31
|
+
"@ornikar/kitt-icons": "14.3.2-canary.1768927687.5a0439490957cfbbe8b8c5136c5fc68b0828466d.0",
|
|
32
|
+
"@tamagui/core": "1.144.2",
|
|
33
|
+
"@tamagui/image": "1.144.2",
|
|
34
|
+
"@tamagui/scroll-view": "1.144.2"
|
|
32
35
|
},
|
|
33
36
|
"peerDependencies": {
|
|
34
37
|
"@storybook/preview-api": ">=8.6.15",
|
|
@@ -49,8 +52,9 @@
|
|
|
49
52
|
},
|
|
50
53
|
"devDependencies": {
|
|
51
54
|
"@babel/core": "7.27.1",
|
|
55
|
+
"@phosphor-icons/core": "2.1.1",
|
|
52
56
|
"@testing-library/dom": "10.4.1",
|
|
53
|
-
"@testing-library/react": "16.3.
|
|
57
|
+
"@testing-library/react": "16.3.2",
|
|
54
58
|
"@testing-library/react-native": "13.3.3",
|
|
55
59
|
"@types/react": "18.3.27",
|
|
56
60
|
"react": "18.3.1",
|
package/src/index.ts
CHANGED
|
@@ -4,8 +4,12 @@ export { BumperProvider } from './system/core/provider/BumperProvider';
|
|
|
4
4
|
// Primitives
|
|
5
5
|
export type { CenterProps } from './system/core/primitives/Center';
|
|
6
6
|
export { Center } from './system/core/primitives/Center';
|
|
7
|
+
export type { ImageProps } from './system/core/primitives/Image/Image';
|
|
8
|
+
export { Image } from './system/core/primitives/Image/Image';
|
|
7
9
|
export type { PressableProps } from './system/core/primitives/Pressable';
|
|
8
10
|
export { Pressable } from './system/core/primitives/Pressable';
|
|
11
|
+
export type { ScrollViewProps } from './system/core/primitives/ScrollView/ScrollView';
|
|
12
|
+
export { ScrollView } from './system/core/primitives/ScrollView/ScrollView';
|
|
9
13
|
export type { HStackProps, StackProps, VStackProps } from './system/core/primitives/Stack';
|
|
10
14
|
export { HStack, Stack, VStack } from './system/core/primitives/Stack';
|
|
11
15
|
export type { ViewProps } from './system/core/primitives/View';
|
|
@@ -14,6 +18,7 @@ export { View } from './system/core/primitives/View';
|
|
|
14
18
|
// Typography
|
|
15
19
|
export type { TypographyTextProps } from './system/content/typography/Typography';
|
|
16
20
|
export { Typography } from './system/content/typography/Typography';
|
|
21
|
+
export type { TypographyIconProps } from './system/content/typography/TypographyIcon';
|
|
17
22
|
|
|
18
23
|
// Breakpoints
|
|
19
24
|
export { useBreakpointValue } from './system/core/breakpoints/hooks/useBreakpointValue';
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CheckCircleRegularIcon,
|
|
3
|
+
InfoRegularIcon,
|
|
4
|
+
StarRegularIcon,
|
|
5
|
+
WarningRegularIcon,
|
|
6
|
+
} from '@ornikar/kitt-icons/phosphor';
|
|
7
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
8
|
+
import { HStack, VStack } from '../../core/primitives/Stack';
|
|
9
|
+
import { Typography } from '../typography/Typography';
|
|
10
|
+
import { Icon } from './Icon';
|
|
11
|
+
|
|
12
|
+
const meta: Meta<typeof Icon> = {
|
|
13
|
+
title: 'Bumper/Content/Icon/Features',
|
|
14
|
+
component: Icon,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
export const Sizes: Story = {
|
|
21
|
+
render: () => (
|
|
22
|
+
<HStack gap="$space.16" alignItems="center">
|
|
23
|
+
<VStack alignItems="center" gap="$space.8">
|
|
24
|
+
<Icon icon={<StarRegularIcon />} size="$size.16" />
|
|
25
|
+
<Typography.Text variant="body-xs" color="$content.base.mid">
|
|
26
|
+
16
|
|
27
|
+
</Typography.Text>
|
|
28
|
+
</VStack>
|
|
29
|
+
<VStack alignItems="center" gap="$space.8">
|
|
30
|
+
<Icon icon={<StarRegularIcon />} size="$size.20" />
|
|
31
|
+
<Typography.Text variant="body-xs" color="$content.base.mid">
|
|
32
|
+
20
|
|
33
|
+
</Typography.Text>
|
|
34
|
+
</VStack>
|
|
35
|
+
<VStack alignItems="center" gap="$space.8">
|
|
36
|
+
<Icon icon={<StarRegularIcon />} size="$size.24" />
|
|
37
|
+
<Typography.Text variant="body-xs" color="$content.base.mid">
|
|
38
|
+
24
|
|
39
|
+
</Typography.Text>
|
|
40
|
+
</VStack>
|
|
41
|
+
<VStack alignItems="center" gap="$space.8">
|
|
42
|
+
<Icon icon={<StarRegularIcon />} size="$size.32" />
|
|
43
|
+
<Typography.Text variant="body-xs" color="$content.base.mid">
|
|
44
|
+
32
|
|
45
|
+
</Typography.Text>
|
|
46
|
+
</VStack>
|
|
47
|
+
<VStack alignItems="center" gap="$space.8">
|
|
48
|
+
<Icon icon={<StarRegularIcon />} size="$size.48" />
|
|
49
|
+
<Typography.Text variant="body-xs" color="$content.base.mid">
|
|
50
|
+
48
|
|
51
|
+
</Typography.Text>
|
|
52
|
+
</VStack>
|
|
53
|
+
<VStack alignItems="center" gap="$space.8">
|
|
54
|
+
<Icon icon={<StarRegularIcon />} size="$size.64" />
|
|
55
|
+
<Typography.Text variant="body-xs" color="$content.base.mid">
|
|
56
|
+
64
|
|
57
|
+
</Typography.Text>
|
|
58
|
+
</VStack>
|
|
59
|
+
</HStack>
|
|
60
|
+
),
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const Colors: Story = {
|
|
64
|
+
render: () => (
|
|
65
|
+
<HStack gap="$space.16" alignItems="center">
|
|
66
|
+
<VStack alignItems="center" gap="$space.8">
|
|
67
|
+
<Icon icon={<StarRegularIcon />} size="$size.24" color="$content.base.hi" />
|
|
68
|
+
<Typography.Text variant="body-xs" color="$content.base.mid">
|
|
69
|
+
base.hi
|
|
70
|
+
</Typography.Text>
|
|
71
|
+
</VStack>
|
|
72
|
+
<VStack alignItems="center" gap="$space.8">
|
|
73
|
+
<Icon icon={<StarRegularIcon />} size="$size.24" color="$content.base.mid" />
|
|
74
|
+
<Typography.Text variant="body-xs" color="$content.base.mid">
|
|
75
|
+
base.mid
|
|
76
|
+
</Typography.Text>
|
|
77
|
+
</VStack>
|
|
78
|
+
<VStack alignItems="center" gap="$space.8">
|
|
79
|
+
<Icon icon={<StarRegularIcon />} size="$size.24" color="$content.base.low" />
|
|
80
|
+
<Typography.Text variant="body-xs" color="$content.base.mid">
|
|
81
|
+
base.low
|
|
82
|
+
</Typography.Text>
|
|
83
|
+
</VStack>
|
|
84
|
+
<VStack alignItems="center" gap="$space.8">
|
|
85
|
+
<Icon icon={<StarRegularIcon />} size="$size.24" color="$content.accent" />
|
|
86
|
+
<Typography.Text variant="body-xs" color="$content.base.mid">
|
|
87
|
+
accent
|
|
88
|
+
</Typography.Text>
|
|
89
|
+
</VStack>
|
|
90
|
+
<VStack alignItems="center" gap="$space.8">
|
|
91
|
+
<Icon icon={<CheckCircleRegularIcon />} size="$size.24" color="$content.success" />
|
|
92
|
+
<Typography.Text variant="body-xs" color="$content.base.mid">
|
|
93
|
+
success
|
|
94
|
+
</Typography.Text>
|
|
95
|
+
</VStack>
|
|
96
|
+
<VStack alignItems="center" gap="$space.8">
|
|
97
|
+
<Icon icon={<WarningRegularIcon />} size="$size.24" color="$content.warning" />
|
|
98
|
+
<Typography.Text variant="body-xs" color="$content.base.mid">
|
|
99
|
+
warning
|
|
100
|
+
</Typography.Text>
|
|
101
|
+
</VStack>
|
|
102
|
+
<VStack alignItems="center" gap="$space.8">
|
|
103
|
+
<Icon icon={<WarningRegularIcon />} size="$size.24" color="$content.danger" />
|
|
104
|
+
<Typography.Text variant="body-xs" color="$content.base.mid">
|
|
105
|
+
danger
|
|
106
|
+
</Typography.Text>
|
|
107
|
+
</VStack>
|
|
108
|
+
<VStack alignItems="center" gap="$space.8">
|
|
109
|
+
<Icon icon={<InfoRegularIcon />} size="$size.24" color="$content.info" />
|
|
110
|
+
<Typography.Text variant="body-xs" color="$content.base.mid">
|
|
111
|
+
info
|
|
112
|
+
</Typography.Text>
|
|
113
|
+
</VStack>
|
|
114
|
+
</HStack>
|
|
115
|
+
),
|
|
116
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { StarRegularIcon } from '@ornikar/kitt-icons/phosphor';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { Icon } from './Icon';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Icon> = {
|
|
6
|
+
title: 'Bumper/Content/Icon',
|
|
7
|
+
component: Icon,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
argTypes: {
|
|
10
|
+
size: {
|
|
11
|
+
control: 'select',
|
|
12
|
+
options: ['$size.16', '$size.20', '$size.24', '$size.32', '$size.48', '$size.64', '$size.80', '$size.96'],
|
|
13
|
+
description: 'Icon size (uses size tokens)',
|
|
14
|
+
},
|
|
15
|
+
color: {
|
|
16
|
+
control: 'select',
|
|
17
|
+
options: [
|
|
18
|
+
'$content.base.low',
|
|
19
|
+
'$content.base.mid',
|
|
20
|
+
'$content.base.hi',
|
|
21
|
+
'$content.accent',
|
|
22
|
+
'$content.promo',
|
|
23
|
+
'$content.info',
|
|
24
|
+
'$content.success',
|
|
25
|
+
'$content.warning',
|
|
26
|
+
'$content.danger',
|
|
27
|
+
'$content.muted',
|
|
28
|
+
'$content.disabled',
|
|
29
|
+
],
|
|
30
|
+
description: 'Icon color (semantic theme token)',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default meta;
|
|
36
|
+
type Story = StoryObj<typeof meta>;
|
|
37
|
+
|
|
38
|
+
export const Default: Story = {
|
|
39
|
+
args: {
|
|
40
|
+
icon: <StarRegularIcon />,
|
|
41
|
+
size: '$size.20',
|
|
42
|
+
color: '$content.base.hi',
|
|
43
|
+
},
|
|
44
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ColorTokens, GetProps, WithMediaProps } from '@tamagui/core';
|
|
2
|
+
import { View, styled, useStyle } from '@tamagui/core';
|
|
3
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
4
|
+
import { cloneElement } from 'react';
|
|
5
|
+
|
|
6
|
+
const IconContainer = styled(View, {
|
|
7
|
+
name: 'Icon',
|
|
8
|
+
variants: {
|
|
9
|
+
size: {
|
|
10
|
+
'...size': (size, { tokens }) => {
|
|
11
|
+
return {
|
|
12
|
+
width: tokens.size[size],
|
|
13
|
+
height: tokens.size[size],
|
|
14
|
+
};
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
} as const,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
type IconContainerProps = GetProps<typeof IconContainer>;
|
|
21
|
+
|
|
22
|
+
interface InternalIconProps {
|
|
23
|
+
icon: ReactElement;
|
|
24
|
+
color?: ColorTokens;
|
|
25
|
+
size?: IconContainerProps['size'];
|
|
26
|
+
testID?: IconContainerProps['testID'];
|
|
27
|
+
/** @ignore */
|
|
28
|
+
alignSelf?: IconContainerProps['alignSelf'];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type IconProps = InternalIconProps & WithMediaProps<InternalIconProps>;
|
|
32
|
+
|
|
33
|
+
export function Icon({ icon, color = '$content.base.hi', size = '$size.20', testID, alignSelf }: IconProps): ReactNode {
|
|
34
|
+
const style = useStyle({ color });
|
|
35
|
+
|
|
36
|
+
const clonedIcon = cloneElement(icon, { color: style.color });
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<IconContainer size={size} testID={testID} alignSelf={alignSelf}>
|
|
40
|
+
{clonedIcon}
|
|
41
|
+
</IconContainer>
|
|
42
|
+
);
|
|
43
|
+
}
|