@ornikar/bumper 2.7.2-canary.1768566928.e85c568dc49c9180e37b7aec8792b1e8d45968a6.0 → 2.8.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.
Files changed (93) hide show
  1. package/CHANGELOG.md +4 -4
  2. package/CLAUDE.md +45 -0
  3. package/dist/definitions/system/core/breakpoints/hooks/useCurrentBreakpointName.d.ts +1 -1
  4. package/dist/definitions/system/core/breakpoints/hooks/useCurrentBreakpointName.d.ts.map +1 -1
  5. package/dist/definitions/system/core/breakpoints/utils/breakpointsUtils.d.ts +1 -1
  6. package/dist/definitions/system/core/breakpoints/utils/breakpointsUtils.d.ts.map +1 -1
  7. package/dist/definitions/system/core/primitives/Pressable.d.ts +0 -9
  8. package/dist/definitions/system/core/primitives/Pressable.d.ts.map +1 -1
  9. package/dist/definitions/system/core/{breakpoints/constants.d.ts → tokens/breakpoints.d.ts} +1 -1
  10. package/dist/definitions/system/core/tokens/breakpoints.d.ts.map +1 -0
  11. package/dist/definitions/tamagui.config.d.ts +2 -28
  12. package/dist/definitions/tamagui.config.d.ts.map +1 -1
  13. package/dist/index-metro.es.android.js +42 -26
  14. package/dist/index-metro.es.android.js.map +1 -1
  15. package/dist/index-metro.es.ios.js +42 -26
  16. package/dist/index-metro.es.ios.js.map +1 -1
  17. package/dist/index-node-22.22.cjs.js +42 -26
  18. package/dist/index-node-22.22.cjs.js.map +1 -1
  19. package/dist/index-node-22.22.cjs.web.js +42 -26
  20. package/dist/index-node-22.22.cjs.web.js.map +1 -1
  21. package/dist/index-node-22.22.es.mjs +42 -26
  22. package/dist/index-node-22.22.es.mjs.map +1 -1
  23. package/dist/index-node-22.22.es.web.mjs +42 -26
  24. package/dist/index-node-22.22.es.web.mjs.map +1 -1
  25. package/dist/index.es.js +36 -20
  26. package/dist/index.es.js.map +1 -1
  27. package/dist/index.es.web.js +36 -20
  28. package/dist/index.es.web.js.map +1 -1
  29. package/dist/tsbuildinfo +1 -1
  30. package/package.json +9 -9
  31. package/src/system/content/typography/Typography.features.stories.tsx +156 -0
  32. package/src/system/content/typography/Typography.stories.tsx +72 -166
  33. package/src/system/content/typography/__snapshots__/Typography.features.stories.tsx.snap +826 -0
  34. package/src/system/content/typography/__snapshots__/Typography.stories.tsx.snap +10 -1990
  35. package/src/system/content/typography/__snapshots_web__/Typography.features.stories.tsx.snap +501 -0
  36. package/src/system/content/typography/__snapshots_web__/Typography.stories.tsx.snap +7 -808
  37. package/src/system/core/breakpoints/hooks/useBreakpointValue.test.ts +1 -1
  38. package/src/system/core/breakpoints/hooks/useCurrentBreakpointName.test.ts +1 -1
  39. package/src/system/core/breakpoints/hooks/useCurrentBreakpointName.ts +1 -1
  40. package/src/system/core/breakpoints/utils/breakpointsUtils.test.ts +1 -1
  41. package/src/system/core/breakpoints/utils/breakpointsUtils.ts +1 -1
  42. package/src/system/core/primitives/Center.features.stories.tsx +63 -0
  43. package/src/system/core/primitives/Center.stories.tsx +111 -12
  44. package/src/system/core/primitives/Pressable.features.stories.tsx +171 -0
  45. package/src/system/core/primitives/Pressable.stories.tsx +82 -20
  46. package/src/system/core/primitives/Pressable.tsx +0 -9
  47. package/src/system/core/primitives/Stack.features.stories.tsx +179 -0
  48. package/src/system/core/primitives/Stack.stories.tsx +74 -44
  49. package/src/system/core/primitives/View.features.stories.tsx +452 -0
  50. package/src/system/core/primitives/View.stories.tsx +122 -9
  51. package/src/system/core/primitives/__snapshots__/Center.features.stories.tsx.snap +208 -0
  52. package/src/system/core/primitives/__snapshots__/Center.stories.tsx.snap +13 -8
  53. package/src/system/core/primitives/__snapshots__/Pressable.features.stories.tsx.snap +470 -0
  54. package/src/system/core/primitives/__snapshots__/Pressable.stories.tsx.snap +11 -10
  55. package/src/system/core/primitives/__snapshots__/Stack.features.stories.tsx.snap +1234 -0
  56. package/src/system/core/primitives/__snapshots__/Stack.stories.tsx.snap +63 -84
  57. package/src/system/core/primitives/__snapshots__/View.features.stories.tsx.snap +2338 -0
  58. package/src/system/core/primitives/__snapshots__/View.stories.tsx.snap +6 -4
  59. package/src/system/core/primitives/__snapshots_web__/Center.features.stories.tsx.snap +107 -0
  60. package/src/system/core/primitives/__snapshots_web__/Center.stories.tsx.snap +9 -6
  61. package/src/system/core/primitives/__snapshots_web__/Pressable.features.stories.tsx.snap +193 -0
  62. package/src/system/core/primitives/__snapshots_web__/Pressable.stories.tsx.snap +5 -5
  63. package/src/system/core/primitives/__snapshots_web__/Stack.features.stories.tsx.snap +515 -0
  64. package/src/system/core/primitives/__snapshots_web__/Stack.stories.tsx.snap +30 -22
  65. package/src/system/core/primitives/__snapshots_web__/View.features.stories.tsx.snap +941 -0
  66. package/src/system/core/primitives/__snapshots_web__/View.stories.tsx.snap +3 -3
  67. package/src/system/core/themes/__snapshots__/light.stories.tsx.snap +3822 -2233
  68. package/src/system/core/themes/__snapshots_web__/light.stories.tsx.snap +1244 -992
  69. package/src/system/core/themes/light.stories.tsx +61 -28
  70. package/src/system/core/tokens/__snapshots__/breakpoints.stories.tsx.snap +423 -0
  71. package/src/system/core/tokens/__snapshots__/fonts.stories.tsx.snap +1635 -0
  72. package/src/system/core/tokens/__snapshots__/radius.stories.tsx.snap +383 -0
  73. package/src/system/core/tokens/__snapshots__/size.stories.tsx.snap +864 -0
  74. package/src/system/core/tokens/__snapshots__/space.stories.tsx.snap +945 -0
  75. package/src/system/core/tokens/__snapshots_web__/breakpoints.stories.tsx.snap +194 -0
  76. package/src/system/core/tokens/__snapshots_web__/fonts.stories.tsx.snap +729 -0
  77. package/src/system/core/tokens/__snapshots_web__/radius.stories.tsx.snap +174 -0
  78. package/src/system/core/tokens/__snapshots_web__/size.stories.tsx.snap +363 -0
  79. package/src/system/core/tokens/__snapshots_web__/space.stories.tsx.snap +396 -0
  80. package/src/system/core/tokens/breakpoints.stories.tsx +46 -0
  81. package/src/system/core/tokens/fonts.stories.tsx +39 -0
  82. package/src/system/core/tokens/palettes/__snapshots__/deepPurpleColorPalette.stories.tsx.snap +4337 -2747
  83. package/src/system/core/tokens/palettes/__snapshots_web__/deepPurpleColorPalette.stories.tsx.snap +1525 -1257
  84. package/src/system/core/tokens/palettes/deepPurpleColorPalette.stories.tsx +42 -28
  85. package/src/system/core/tokens/radius.stories.tsx +39 -0
  86. package/src/system/core/tokens/size.stories.tsx +39 -0
  87. package/src/system/core/tokens/space.stories.tsx +40 -0
  88. package/src/tamagui.config.ts +3 -3
  89. package/dist/definitions/system/core/breakpoints/constants.d.ts.map +0 -1
  90. package/src/system/core/breakpoints/__snapshots__/breakpoints.stories.tsx.snap +0 -49
  91. package/src/system/core/breakpoints/__snapshots_web__/breakpoints.stories.tsx.snap +0 -43
  92. package/src/system/core/breakpoints/breakpoints.stories.tsx +0 -45
  93. /package/src/system/core/{breakpoints/constants.ts → tokens/breakpoints.ts} +0 -0
@@ -0,0 +1,179 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { Typography } from '../../content/typography/Typography';
3
+ import { HStack, Stack, VStack } from './Stack';
4
+ import { View } from './View';
5
+
6
+ const meta: Meta<typeof Stack> = {
7
+ title: 'Bumper/Core/Primitives/Stack/Features',
8
+ component: Stack,
9
+ };
10
+
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+
14
+ export const VStackBasic: Story = {
15
+ render: () => (
16
+ <VStack gap="$space.16" backgroundColor="$bg.base.mid.default" padding="$space.16" borderRadius="$radius.m">
17
+ <View backgroundColor="$bg.accent.default" padding="$space.16" borderRadius="$radius.s">
18
+ <Typography.Text variant="body-m" color="$content.base.onContrasted.hi">
19
+ VStack Item 1
20
+ </Typography.Text>
21
+ </View>
22
+ <View backgroundColor="$bg.promo.hi.default" padding="$space.16" borderRadius="$radius.s">
23
+ <Typography.Text variant="body-m" color="$content.base.onContrasted.hi">
24
+ VStack Item 2
25
+ </Typography.Text>
26
+ </View>
27
+ <View backgroundColor="$bg.info.hi" padding="$space.16" borderRadius="$radius.s">
28
+ <Typography.Text variant="body-m" color="$content.base.onContrasted.hi">
29
+ VStack Item 3
30
+ </Typography.Text>
31
+ </View>
32
+ </VStack>
33
+ ),
34
+ };
35
+
36
+ export const HStackBasic: Story = {
37
+ render: () => (
38
+ <HStack gap="$space.16" backgroundColor="$bg.base.mid.default" padding="$space.16" borderRadius="$radius.m">
39
+ <View backgroundColor="$bg.accent.default" padding="$space.16" borderRadius="$radius.s">
40
+ <Typography.Text variant="body-m" color="$content.base.onContrasted.hi">
41
+ HStack Item 1
42
+ </Typography.Text>
43
+ </View>
44
+ <View backgroundColor="$bg.promo.hi.default" padding="$space.16" borderRadius="$radius.s">
45
+ <Typography.Text variant="body-m" color="$content.base.onContrasted.hi">
46
+ HStack Item 2
47
+ </Typography.Text>
48
+ </View>
49
+ <View backgroundColor="$bg.info.hi" padding="$space.16" borderRadius="$radius.s">
50
+ <Typography.Text variant="body-m" color="$content.base.onContrasted.hi">
51
+ HStack Item 3
52
+ </Typography.Text>
53
+ </View>
54
+ </HStack>
55
+ ),
56
+ };
57
+
58
+ export const FlexWrap: Story = {
59
+ render: () => (
60
+ <HStack
61
+ gap="$space.8"
62
+ flexWrap="wrap"
63
+ backgroundColor="$bg.base.mid.default"
64
+ padding="$space.16"
65
+ borderRadius="$radius.m"
66
+ maxWidth={400}
67
+ >
68
+ {Array.from({ length: 10 }, (_, i) => (
69
+ <View key={`item-${i}`} backgroundColor="$bg.accent.default" padding="$space.12" borderRadius="$radius.s">
70
+ <Typography.Text variant="body-s" color="$content.base.onContrasted.hi">
71
+ Item {i + 1}
72
+ </Typography.Text>
73
+ </View>
74
+ ))}
75
+ </HStack>
76
+ ),
77
+ };
78
+
79
+ export const NestedStacks: Story = {
80
+ render: () => (
81
+ <VStack gap="$space.16" backgroundColor="$bg.base.hi.default" padding="$space.24" borderRadius="$radius.l">
82
+ <Typography.Text variant="heading-m">Nested Stacks Layout</Typography.Text>
83
+
84
+ <VStack gap="$space.12" backgroundColor="$bg.base.low.default" padding="$space.16" borderRadius="$radius.m">
85
+ <Typography.Text variant="label-m">Section 1</Typography.Text>
86
+ <HStack gap="$space.8">
87
+ <View backgroundColor="$bg.info.mid" padding="$space.12" borderRadius="$radius.s" flexGrow={1}>
88
+ <Typography.Text variant="body-s">Col 1</Typography.Text>
89
+ </View>
90
+ <View backgroundColor="$bg.success.mid" padding="$space.12" borderRadius="$radius.s" flexGrow={1}>
91
+ <Typography.Text variant="body-s">Col 2</Typography.Text>
92
+ </View>
93
+ </HStack>
94
+ </VStack>
95
+
96
+ <VStack gap="$space.12" backgroundColor="$bg.base.low.default" padding="$space.16" borderRadius="$radius.m">
97
+ <Typography.Text variant="label-m">Section 2</Typography.Text>
98
+ <VStack gap="$space.8">
99
+ <View backgroundColor="$bg.warning.mid" padding="$space.12" borderRadius="$radius.s">
100
+ <Typography.Text variant="body-s">Row 1</Typography.Text>
101
+ </View>
102
+ <View backgroundColor="$bg.danger.mid" padding="$space.12" borderRadius="$radius.s">
103
+ <Typography.Text variant="body-s">Row 2</Typography.Text>
104
+ </View>
105
+ </VStack>
106
+ </VStack>
107
+ </VStack>
108
+ ),
109
+ };
110
+
111
+ export const FlexGrowExample: Story = {
112
+ render: () => (
113
+ <HStack
114
+ gap="$space.8"
115
+ backgroundColor="$bg.base.mid.default"
116
+ padding="$space.16"
117
+ borderRadius="$radius.m"
118
+ height="$size.144"
119
+ >
120
+ <View backgroundColor="$bg.info.mid" padding="$space.12" borderRadius="$radius.s">
121
+ <Typography.Text variant="body-s">Fixed</Typography.Text>
122
+ </View>
123
+ <View backgroundColor="$bg.success.mid" padding="$space.12" borderRadius="$radius.s" flexGrow={1}>
124
+ <Typography.Text variant="body-s">flexGrow: 1</Typography.Text>
125
+ </View>
126
+ <View backgroundColor="$bg.warning.mid" padding="$space.12" borderRadius="$radius.s" flexGrow={2}>
127
+ <Typography.Text variant="body-s">flexGrow: 2</Typography.Text>
128
+ </View>
129
+ <View backgroundColor="$bg.danger.mid" padding="$space.12" borderRadius="$radius.s">
130
+ <Typography.Text variant="body-s">Fixed</Typography.Text>
131
+ </View>
132
+ </HStack>
133
+ ),
134
+ };
135
+
136
+ export const GridLikeLayout: Story = {
137
+ render: () => (
138
+ <VStack gap="$space.16" backgroundColor="$bg.base.mid.default" padding="$space.16" borderRadius="$radius.m">
139
+ <HStack gap="$space.16">
140
+ <View backgroundColor="$bg.accent.default" padding="$space.24" borderRadius="$radius.s" flexGrow={1}>
141
+ <Typography.Text variant="body-m" color="$content.base.onContrasted.hi">
142
+ 1
143
+ </Typography.Text>
144
+ </View>
145
+ <View backgroundColor="$bg.promo.hi.default" padding="$space.24" borderRadius="$radius.s" flexGrow={1}>
146
+ <Typography.Text variant="body-m" color="$content.base.onContrasted.hi">
147
+ 2
148
+ </Typography.Text>
149
+ </View>
150
+ </HStack>
151
+
152
+ <HStack gap="$space.16">
153
+ <View backgroundColor="$bg.info.hi" padding="$space.24" borderRadius="$radius.s" flexGrow={1}>
154
+ <Typography.Text variant="body-m" color="$content.base.onContrasted.hi">
155
+ 3
156
+ </Typography.Text>
157
+ </View>
158
+ <View backgroundColor="$bg.success.hi" padding="$space.24" borderRadius="$radius.s" flexGrow={1}>
159
+ <Typography.Text variant="body-m" color="$content.base.onContrasted.hi">
160
+ 4
161
+ </Typography.Text>
162
+ </View>
163
+ </HStack>
164
+
165
+ <HStack gap="$space.16">
166
+ <View backgroundColor="$bg.warning.hi" padding="$space.24" borderRadius="$radius.s" flexGrow={1}>
167
+ <Typography.Text variant="body-m" color="$content.base.onContrasted.hi">
168
+ 5
169
+ </Typography.Text>
170
+ </View>
171
+ <View backgroundColor="$bg.danger.hi" padding="$space.24" borderRadius="$radius.s" flexGrow={1}>
172
+ <Typography.Text variant="body-m" color="$content.base.onContrasted.hi">
173
+ 6
174
+ </Typography.Text>
175
+ </View>
176
+ </HStack>
177
+ </VStack>
178
+ ),
179
+ };
@@ -1,49 +1,79 @@
1
- import type { Meta, StoryFn } from '@storybook/react';
2
- import type { StackProps } from './Stack';
3
- import { HStack, Stack, VStack } from './Stack';
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { Typography } from '../../content/typography/Typography';
3
+ import { Stack } from './Stack';
4
4
  import { View } from './View';
5
5
 
6
- export default {
7
- title: 'bumper/Primitives',
6
+ const meta: Meta<typeof Stack> = {
7
+ title: 'Bumper/Core/Primitives/Stack',
8
8
  component: Stack,
9
- } satisfies Meta<StackProps>;
9
+ tags: ['autodocs'],
10
+ argTypes: {
11
+ flexDirection: {
12
+ control: 'select',
13
+ options: ['row', 'column', 'row-reverse', 'column-reverse'],
14
+ description: 'Flex direction',
15
+ },
16
+ gap: {
17
+ control: 'select',
18
+ options: [
19
+ '$space.none',
20
+ '$space.2',
21
+ '$space.4',
22
+ '$space.8',
23
+ '$space.12',
24
+ '$space.16',
25
+ '$space.24',
26
+ '$space.32',
27
+ '$space.40',
28
+ '$space.48',
29
+ '$space.56',
30
+ '$space.64',
31
+ '$space.80',
32
+ ],
33
+ description: 'Gap between items (space token)',
34
+ },
35
+ padding: {
36
+ control: 'select',
37
+ options: [
38
+ '$space.none',
39
+ '$space.2',
40
+ '$space.4',
41
+ '$space.8',
42
+ '$space.12',
43
+ '$space.16',
44
+ '$space.24',
45
+ '$space.32',
46
+ '$space.40',
47
+ '$space.48',
48
+ '$space.56',
49
+ '$space.64',
50
+ '$space.80',
51
+ ],
52
+ description: 'Padding (space token)',
53
+ },
54
+ },
55
+ };
10
56
 
11
- const items = (
12
- <>
13
- <View
14
- width="$size.64"
15
- height="$size.20"
16
- backgroundColor="$bg.accent.default"
17
- padding="$space.4"
18
- borderRadius="$radius.s"
19
- />
57
+ export default meta;
58
+ type Story = StoryObj<typeof meta>;
20
59
 
21
- <View
22
- width="$size.64"
23
- height="$size.20"
24
- backgroundColor="$bg.highlight.hi.default"
25
- padding="$space.4"
26
- borderRadius="$radius.s"
27
- />
28
-
29
- <View
30
- width="$size.64"
31
- height="$size.20"
32
- backgroundColor="$bg.highlight.mid.default"
33
- padding="$space.4"
34
- borderRadius="$radius.s"
35
- />
36
- </>
37
- );
38
-
39
- export const StackStory: StoryFn<typeof Stack> = () => (
40
- <>
41
- <HStack gap="$space.4">{items}</HStack>
42
-
43
- <VStack gap="$space.4" marginTop="$space.16">
44
- {items}
45
- </VStack>
46
- </>
47
- );
48
-
49
- StackStory.storyName = 'Stack';
60
+ export const Default: Story = {
61
+ args: {
62
+ flexDirection: 'row',
63
+ gap: '$space.16',
64
+ padding: '$space.16',
65
+ },
66
+ render: (args) => (
67
+ <Stack {...args}>
68
+ <View backgroundColor="$bg.info.mid" padding="$space.12" borderRadius="$radius.s">
69
+ <Typography.Text variant="body-s">Item 1</Typography.Text>
70
+ </View>
71
+ <View backgroundColor="$bg.success.mid" padding="$space.12" borderRadius="$radius.s">
72
+ <Typography.Text variant="body-s">Item 2</Typography.Text>
73
+ </View>
74
+ <View backgroundColor="$bg.warning.mid" padding="$space.12" borderRadius="$radius.s">
75
+ <Typography.Text variant="body-s">Item 3</Typography.Text>
76
+ </View>
77
+ </Stack>
78
+ ),
79
+ };