@ornikar/bumper 2.7.2-canary.1768566928.e85c568dc49c9180e37b7aec8792b1e8d45968a6.0 → 2.8.1-canary.1768839311.501438316959a9593513e74c70cb87b0597f2db6.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 (114) hide show
  1. package/CHANGELOG.md +19 -4
  2. package/CLAUDE.md +45 -0
  3. package/dist/definitions/index.d.ts +2 -0
  4. package/dist/definitions/index.d.ts.map +1 -1
  5. package/dist/definitions/system/content/icon/Icon.d.ts +21 -0
  6. package/dist/definitions/system/content/icon/Icon.d.ts.map +1 -0
  7. package/dist/definitions/system/core/breakpoints/hooks/useCurrentBreakpointName.d.ts +1 -1
  8. package/dist/definitions/system/core/breakpoints/hooks/useCurrentBreakpointName.d.ts.map +1 -1
  9. package/dist/definitions/system/core/breakpoints/utils/breakpointsUtils.d.ts +1 -1
  10. package/dist/definitions/system/core/breakpoints/utils/breakpointsUtils.d.ts.map +1 -1
  11. package/dist/definitions/system/core/primitives/Pressable.d.ts +0 -9
  12. package/dist/definitions/system/core/primitives/Pressable.d.ts.map +1 -1
  13. package/dist/definitions/system/core/primitives/ScrollView/ScrollView.d.ts +3 -0
  14. package/dist/definitions/system/core/primitives/ScrollView/ScrollView.d.ts.map +1 -0
  15. package/dist/definitions/system/core/{breakpoints/constants.d.ts → tokens/breakpoints.d.ts} +1 -1
  16. package/dist/definitions/system/core/tokens/breakpoints.d.ts.map +1 -0
  17. package/dist/definitions/tamagui.config.d.ts +2 -28
  18. package/dist/definitions/tamagui.config.d.ts.map +1 -1
  19. package/dist/index-metro.es.android.js +43 -26
  20. package/dist/index-metro.es.android.js.map +1 -1
  21. package/dist/index-metro.es.ios.js +43 -26
  22. package/dist/index-metro.es.ios.js.map +1 -1
  23. package/dist/index-node-22.22.cjs.js +44 -26
  24. package/dist/index-node-22.22.cjs.js.map +1 -1
  25. package/dist/index-node-22.22.cjs.web.js +44 -26
  26. package/dist/index-node-22.22.cjs.web.js.map +1 -1
  27. package/dist/index-node-22.22.es.mjs +43 -26
  28. package/dist/index-node-22.22.es.mjs.map +1 -1
  29. package/dist/index-node-22.22.es.web.mjs +43 -26
  30. package/dist/index-node-22.22.es.web.mjs.map +1 -1
  31. package/dist/index.es.js +37 -20
  32. package/dist/index.es.js.map +1 -1
  33. package/dist/index.es.web.js +37 -20
  34. package/dist/index.es.web.js.map +1 -1
  35. package/dist/tsbuildinfo +1 -1
  36. package/package.json +5 -2
  37. package/src/index.ts +2 -0
  38. package/src/system/content/icon/Icon.features.stories.tsx +116 -0
  39. package/src/system/content/icon/Icon.stories.tsx +44 -0
  40. package/src/system/content/icon/Icon.tsx +53 -0
  41. package/src/system/content/icon/__snapshots__/Icon.features.stories.tsx.snap +569 -0
  42. package/src/system/content/icon/__snapshots__/Icon.stories.tsx.snap +29 -0
  43. package/src/system/content/icon/__snapshots_web__/Icon.features.stories.tsx.snap +309 -0
  44. package/src/system/content/icon/__snapshots_web__/Icon.stories.tsx.snap +33 -0
  45. package/src/system/content/typography/Typography.features.stories.tsx +156 -0
  46. package/src/system/content/typography/Typography.stories.tsx +72 -166
  47. package/src/system/content/typography/__snapshots__/Typography.features.stories.tsx.snap +826 -0
  48. package/src/system/content/typography/__snapshots__/Typography.stories.tsx.snap +10 -1990
  49. package/src/system/content/typography/__snapshots_web__/Typography.features.stories.tsx.snap +501 -0
  50. package/src/system/content/typography/__snapshots_web__/Typography.stories.tsx.snap +6 -807
  51. package/src/system/core/breakpoints/hooks/useBreakpointValue.test.ts +1 -1
  52. package/src/system/core/breakpoints/hooks/useCurrentBreakpointName.test.ts +1 -1
  53. package/src/system/core/breakpoints/hooks/useCurrentBreakpointName.ts +1 -1
  54. package/src/system/core/breakpoints/utils/breakpointsUtils.test.ts +1 -1
  55. package/src/system/core/breakpoints/utils/breakpointsUtils.ts +1 -1
  56. package/src/system/core/primitives/Center.features.stories.tsx +63 -0
  57. package/src/system/core/primitives/Center.stories.tsx +111 -12
  58. package/src/system/core/primitives/Pressable.features.stories.tsx +171 -0
  59. package/src/system/core/primitives/Pressable.stories.tsx +82 -20
  60. package/src/system/core/primitives/Pressable.tsx +0 -9
  61. package/src/system/core/primitives/ScrollView/ScrollView.features.stories.tsx +84 -0
  62. package/src/system/core/primitives/ScrollView/ScrollView.stories.tsx +63 -0
  63. package/src/system/core/primitives/ScrollView/ScrollView.ts +2 -0
  64. package/src/system/core/primitives/ScrollView/__snapshots__/ScrollView.features.stories.tsx.snap +1245 -0
  65. package/src/system/core/primitives/ScrollView/__snapshots__/ScrollView.stories.tsx.snap +334 -0
  66. package/src/system/core/primitives/ScrollView/__snapshots_web__/ScrollView.features.stories.tsx.snap +503 -0
  67. package/src/system/core/primitives/ScrollView/__snapshots_web__/ScrollView.stories.tsx.snap +138 -0
  68. package/src/system/core/primitives/Stack.features.stories.tsx +179 -0
  69. package/src/system/core/primitives/Stack.stories.tsx +74 -44
  70. package/src/system/core/primitives/View.features.stories.tsx +452 -0
  71. package/src/system/core/primitives/View.stories.tsx +122 -9
  72. package/src/system/core/primitives/__snapshots__/Center.features.stories.tsx.snap +208 -0
  73. package/src/system/core/primitives/__snapshots__/Center.stories.tsx.snap +13 -8
  74. package/src/system/core/primitives/__snapshots__/Pressable.features.stories.tsx.snap +470 -0
  75. package/src/system/core/primitives/__snapshots__/Pressable.stories.tsx.snap +11 -10
  76. package/src/system/core/primitives/__snapshots__/Stack.features.stories.tsx.snap +1234 -0
  77. package/src/system/core/primitives/__snapshots__/Stack.stories.tsx.snap +63 -84
  78. package/src/system/core/primitives/__snapshots__/View.features.stories.tsx.snap +2338 -0
  79. package/src/system/core/primitives/__snapshots__/View.stories.tsx.snap +6 -4
  80. package/src/system/core/primitives/__snapshots_web__/Center.features.stories.tsx.snap +107 -0
  81. package/src/system/core/primitives/__snapshots_web__/Center.stories.tsx.snap +8 -5
  82. package/src/system/core/primitives/__snapshots_web__/Pressable.features.stories.tsx.snap +193 -0
  83. package/src/system/core/primitives/__snapshots_web__/Pressable.stories.tsx.snap +4 -4
  84. package/src/system/core/primitives/__snapshots_web__/Stack.features.stories.tsx.snap +515 -0
  85. package/src/system/core/primitives/__snapshots_web__/Stack.stories.tsx.snap +29 -21
  86. package/src/system/core/primitives/__snapshots_web__/View.features.stories.tsx.snap +941 -0
  87. package/src/system/core/primitives/__snapshots_web__/View.stories.tsx.snap +2 -2
  88. package/src/system/core/themes/__snapshots__/light.stories.tsx.snap +3822 -2233
  89. package/src/system/core/themes/__snapshots_web__/light.stories.tsx.snap +1243 -991
  90. package/src/system/core/themes/light.stories.tsx +61 -28
  91. package/src/system/core/tokens/__snapshots__/breakpoints.stories.tsx.snap +423 -0
  92. package/src/system/core/tokens/__snapshots__/fonts.stories.tsx.snap +1635 -0
  93. package/src/system/core/tokens/__snapshots__/radius.stories.tsx.snap +383 -0
  94. package/src/system/core/tokens/__snapshots__/size.stories.tsx.snap +864 -0
  95. package/src/system/core/tokens/__snapshots__/space.stories.tsx.snap +945 -0
  96. package/src/system/core/tokens/__snapshots_web__/breakpoints.stories.tsx.snap +194 -0
  97. package/src/system/core/tokens/__snapshots_web__/fonts.stories.tsx.snap +729 -0
  98. package/src/system/core/tokens/__snapshots_web__/radius.stories.tsx.snap +174 -0
  99. package/src/system/core/tokens/__snapshots_web__/size.stories.tsx.snap +363 -0
  100. package/src/system/core/tokens/__snapshots_web__/space.stories.tsx.snap +396 -0
  101. package/src/system/core/tokens/breakpoints.stories.tsx +46 -0
  102. package/src/system/core/tokens/fonts.stories.tsx +39 -0
  103. package/src/system/core/tokens/palettes/__snapshots__/deepPurpleColorPalette.stories.tsx.snap +4337 -2747
  104. package/src/system/core/tokens/palettes/__snapshots_web__/deepPurpleColorPalette.stories.tsx.snap +1524 -1256
  105. package/src/system/core/tokens/palettes/deepPurpleColorPalette.stories.tsx +42 -28
  106. package/src/system/core/tokens/radius.stories.tsx +39 -0
  107. package/src/system/core/tokens/size.stories.tsx +39 -0
  108. package/src/system/core/tokens/space.stories.tsx +40 -0
  109. package/src/tamagui.config.ts +3 -3
  110. package/dist/definitions/system/core/breakpoints/constants.d.ts.map +0 -1
  111. package/src/system/core/breakpoints/__snapshots__/breakpoints.stories.tsx.snap +0 -49
  112. package/src/system/core/breakpoints/__snapshots_web__/breakpoints.stories.tsx.snap +0 -43
  113. package/src/system/core/breakpoints/breakpoints.stories.tsx +0 -45
  114. /package/src/system/core/{breakpoints/constants.ts → tokens/breakpoints.ts} +0 -0
@@ -1,172 +1,78 @@
1
- import type { Meta, StoryFn } from '@storybook/react';
2
- import type { FC } from 'react';
3
- import { StorySection } from '../../../shared/storybook/StorySection';
4
- import { VStack } from '../../core/primitives/Stack';
5
- import { View } from '../../core/primitives/View';
6
- import type {
7
- BodyFontVariants,
8
- ContentCapsVariants,
9
- FontVariants,
10
- HeadingFontVariants,
11
- LabelFontVariants,
12
- } from '../../core/tokens/fonts';
13
- import type { TypographyTextProps } from './Typography';
1
+ import type { Meta, StoryObj } from '@storybook/react';
14
2
  import { Typography } from './Typography';
15
3
 
16
- export default {
17
- title: 'bumper/Typography/Typography',
4
+ const meta: Meta<typeof Typography.Text> = {
5
+ title: 'Bumper/Content/Typography',
18
6
  component: Typography.Text,
19
- } satisfies Meta<typeof Typography.Text>;
20
-
21
- interface TypographyTypeWithComponent<T extends FontVariants> {
22
- component: FC<TypographyTextProps>;
23
- variant: T;
24
- weights: TypographyTextProps['weight'][];
25
- }
26
-
27
- const headingVariants: TypographyTypeWithComponent<HeadingFontVariants>[] = [
28
- { component: Typography.Text, variant: 'heading-2xl', weights: ['semibold'] },
29
- { component: Typography.Text, variant: 'heading-xl', weights: ['semibold'] },
30
- { component: Typography.Text, variant: 'heading-l', weights: ['semibold'] },
31
- { component: Typography.Text, variant: 'heading-m', weights: ['semibold'] },
32
- { component: Typography.Text, variant: 'heading-s', weights: ['semibold'] },
33
- { component: Typography.Text, variant: 'heading-xs', weights: ['semibold'] },
34
- { component: Typography.Text, variant: 'heading-2xs', weights: ['semibold'] },
35
- ];
36
-
37
- const bodyVariants: TypographyTypeWithComponent<BodyFontVariants>[] = [
38
- { component: Typography.Text, variant: 'body-xl', weights: ['bold', 'regular'] },
39
- { component: Typography.Text, variant: 'body-l', weights: ['bold', 'regular'] },
40
- { component: Typography.Text, variant: 'body-m', weights: ['bold', 'regular'] },
41
- { component: Typography.Text, variant: 'body-s', weights: ['bold', 'regular'] },
42
- { component: Typography.Text, variant: 'body-xs', weights: ['bold', 'regular'] },
43
- ];
44
-
45
- const labelVariants: TypographyTypeWithComponent<LabelFontVariants>[] = [
46
- { component: Typography.Text, variant: 'label-xl', weights: ['semibold'] },
47
- { component: Typography.Text, variant: 'label-l', weights: ['semibold'] },
48
- { component: Typography.Text, variant: 'label-m', weights: ['semibold'] },
49
- { component: Typography.Text, variant: 'label-s', weights: ['semibold'] },
50
- ];
51
-
52
- const contentCapsVariants: TypographyTypeWithComponent<ContentCapsVariants>[] = [
53
- { component: Typography.Text, variant: 'content-caps-3xl', weights: ['bold'] },
54
- { component: Typography.Text, variant: 'content-caps-2xl', weights: ['bold'] },
55
- { component: Typography.Text, variant: 'content-caps-xl', weights: ['bold'] },
56
- { component: Typography.Text, variant: 'content-caps-l', weights: ['bold'] },
57
- { component: Typography.Text, variant: 'content-caps-m', weights: ['bold'] },
58
- { component: Typography.Text, variant: 'content-caps-s', weights: ['bold'] },
59
- { component: Typography.Text, variant: 'content-caps-xs', weights: ['bold'] },
60
- ];
61
-
62
- interface TypographyTypesProps {
63
- types: TypographyTypeWithComponent<FontVariants>[];
64
- }
65
-
66
- function TypographyVariants({ types }: TypographyTypesProps) {
67
- return (
68
- <>
69
- {types.map((type) => {
70
- return type.weights.map((weight) => (
71
- <VStack key={`${type.variant}-${weight}`} marginBottom="$space.16">
72
- <Typography.Text variant="heading-s">{`${type.variant.split('-').join(' ')} - ${
73
- weight || ''
74
- }`}</Typography.Text>
75
- <View
76
- paddingVertical="$space.4"
77
- paddingHorizontal="$space.8"
78
- borderRadius="$radius.m"
79
- backgroundColor="$bg.base.mid.default"
80
- marginTop="$space.4"
81
- >
82
- {/* @ts-expect-error some variants does not support specific weight */}
83
- <Typography.Text variant={type.variant} weight={weight}>
84
- The quick brown fox jumps over the lazy dog
85
- </Typography.Text>
86
- </View>
87
- </VStack>
88
- ));
89
- })}
90
- </>
91
- );
92
- }
93
-
94
- export const TypographyStory: StoryFn<typeof Typography.Text> = (args) => (
95
- <>
96
- <StorySection.Demo>
97
- <Typography.Text {...args} />
98
- </StorySection.Demo>
99
- <StorySection title="Inheritance">
100
- <StorySection.SubSection title="Type inheritance">
101
- <Typography.Text variant="body-l">
102
- Type is body-l{' '}
103
- <Typography.Text variant="heading-l">
104
- type is heading-l <Typography.Text color="$content.accent">type is undefined</Typography.Text>
105
- </Typography.Text>{' '}
106
- <Typography.Text color="$content.danger">
107
- type is undefined <Typography.Text variant="body-s">Type is body-s</Typography.Text>
108
- </Typography.Text>
109
- .
110
- </Typography.Text>
111
- </StorySection.SubSection>
112
- <StorySection.SubSection title="Weight inheritance">
113
- <Typography.Text>
114
- weight is undefined{' '}
115
- <Typography.Text weight="bold">
116
- weight is bold{' '}
117
- <Typography.Text variant="heading-m">
118
- weight is undefined and type is heading-m{' '}
119
- <Typography.Text variant="body-m" weight="regular">
120
- weight is regular <Typography.Text weight="bold">weight is bold</Typography.Text>
121
- </Typography.Text>
122
- </Typography.Text>
123
- </Typography.Text>{' '}
124
- </Typography.Text>
125
- </StorySection.SubSection>
126
- <StorySection.SubSection title="Color inheritance">
127
- <Typography.Text>
128
- color is undefined{' '}
129
- <Typography.Text color="$content.accent">
130
- color is $content.accent{' '}
131
- <Typography.Text>
132
- color is undefined{' '}
133
- <Typography.Text color="$content.danger">
134
- color is content.danger{' '}
135
- <Typography.Text color="$content.base.hi">color is content.base.hi</Typography.Text>
136
- </Typography.Text>
137
- </Typography.Text>
138
- </Typography.Text>
139
- </Typography.Text>
140
- </StorySection.SubSection>
141
- <StorySection title="Heading">
142
- <TypographyVariants types={headingVariants} />
143
- </StorySection>
144
- <StorySection title="Body">
145
- <TypographyVariants types={bodyVariants} />
146
- </StorySection>
147
- <StorySection title="Label">
148
- <TypographyVariants types={labelVariants} />
149
- </StorySection>
150
- <StorySection title="Content Caps">
151
- <TypographyVariants types={contentCapsVariants} />
152
- </StorySection>
153
- <StorySection title="Accessibility">
154
- <Typography.Header1>role: heading aria-level: 1</Typography.Header1>
155
- <Typography.Header2>role: heading aria-level: 2</Typography.Header2>
156
- <Typography.Header3>role: heading aria-level: 3</Typography.Header3>
157
- <Typography.Header4>role: heading aria-level: 4</Typography.Header4>
158
- <Typography.Header5>role: heading aria-level: 5</Typography.Header5>
159
- <Typography.Header6>role: heading aria-level: 6</Typography.Header6>
160
- </StorySection>
161
- </StorySection>
162
- </>
163
- );
7
+ tags: ['autodocs'],
8
+ argTypes: {
9
+ variant: {
10
+ control: 'select',
11
+ options: [
12
+ 'heading-2xl',
13
+ 'heading-xl',
14
+ 'heading-l',
15
+ 'heading-m',
16
+ 'heading-s',
17
+ 'heading-xs',
18
+ 'heading-2xs',
19
+ 'body-xl',
20
+ 'body-l',
21
+ 'body-m',
22
+ 'body-s',
23
+ 'body-xs',
24
+ 'label-xl',
25
+ 'label-l',
26
+ 'label-m',
27
+ 'label-s',
28
+ 'content-caps-3xl',
29
+ 'content-caps-2xl',
30
+ 'content-caps-xl',
31
+ 'content-caps-l',
32
+ 'content-caps-m',
33
+ 'content-caps-s',
34
+ 'content-caps-xs',
35
+ ],
36
+ description: 'Typography variant (heading, body, label, or content-caps)',
37
+ },
38
+ weight: {
39
+ control: 'select',
40
+ options: ['regular', 'semibold', 'bold'],
41
+ description: 'Font weight (note: heading/label/content-caps variants have fixed weights)',
42
+ },
43
+ color: {
44
+ control: 'select',
45
+ options: [
46
+ '$content.base.low',
47
+ '$content.base.mid',
48
+ '$content.base.hi',
49
+ '$content.base.onContrasted.low',
50
+ '$content.base.onContrasted.mid',
51
+ '$content.base.onContrasted.hi',
52
+ '$content.accent',
53
+ '$content.promo',
54
+ '$content.promo.onContrasted',
55
+ '$content.info',
56
+ '$content.success',
57
+ '$content.warning',
58
+ '$content.danger',
59
+ '$content.muted',
60
+ '$content.disabled',
61
+ '$content.disabled.onContrasted',
62
+ ],
63
+ description: 'Text color (semantic theme token)',
64
+ },
65
+ },
66
+ };
164
67
 
165
- TypographyStory.storyName = 'Typography';
68
+ export default meta;
69
+ type Story = StoryObj<typeof meta>;
166
70
 
167
- TypographyStory.args = {
168
- children: 'Hello World',
169
- color: '$content.base.hi',
170
- weight: 'regular',
171
- variant: 'body-m',
71
+ export const Default: Story = {
72
+ args: {
73
+ variant: 'body-m',
74
+ weight: 'regular',
75
+ color: '$content.base.hi',
76
+ children: 'The quick brown fox jumps over the lazy dog',
77
+ },
172
78
  };