@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
@@ -0,0 +1,138 @@
1
+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
+
3
+ exports[`Bumper/Core/Primitives/ScrollView Default 1`] = `
4
+ <DocumentFragment>
5
+ <div
6
+ class="css-view-g5y9jx r-flex-13awgt0"
7
+ >
8
+ <span
9
+ class=""
10
+ style="display: contents;"
11
+ >
12
+ <span
13
+ class=" "
14
+ style="display: contents;"
15
+ >
16
+ <span
17
+ class=" t_light is_Theme"
18
+ style="display: contents;"
19
+ >
20
+ <span
21
+ class="_dsp_contents"
22
+ >
23
+ <div
24
+ class="css-view-g5y9jx r-WebkitOverflowScrolling-150rngu r-flexDirection-eqz5dr r-flexGrow-16y2uox r-flexShrink-1wbh5a2 r-overflowX-11yh6sk r-overflowY-1rnoaur r-transform-agouwx is_ScrollView _height-t-size-size42947888 _width-t-size-size42948634"
25
+ >
26
+ <div
27
+ class="css-view-g5y9jx"
28
+ style="gap: var(--t-space-space--8);"
29
+ >
30
+ <div
31
+ class="_dsp-flex _alignItems-stretch _fd-column _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _backgroundColor-bg--info--m3355 _paddingTop-t-space-spa1366020313 _paddingRight-t-space-spa1366020313 _paddingBottom-t-space-spa1366020313 _paddingLeft-t-space-spa1366020313 _btlr-t-radius-ra1673638410 _btrr-t-radius-ra1673638410 _bbrr-t-radius-ra1673638410 _bblr-t-radius-ra1673638410"
32
+ >
33
+ <span
34
+ class="font_GTStandard _WebkitFontSmoothing-_platformweb_antialiased _dsp-inline _bxs-border-box _ww-break-word _ws-pre-wrap _marginTop-0px _marginRight-0px _marginBottom-0px _marginLeft-0px _ff-f-family _fs-f-size-body1510 _lh-f-lineHeigh201793153 _ls-f-letterSpa1099960310"
35
+ data-disable-theme="true"
36
+ >
37
+ Item 1
38
+ </span>
39
+ </div>
40
+ <div
41
+ class="_dsp-flex _alignItems-stretch _fd-column _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _backgroundColor-bg--info--m3355 _paddingTop-t-space-spa1366020313 _paddingRight-t-space-spa1366020313 _paddingBottom-t-space-spa1366020313 _paddingLeft-t-space-spa1366020313 _btlr-t-radius-ra1673638410 _btrr-t-radius-ra1673638410 _bbrr-t-radius-ra1673638410 _bblr-t-radius-ra1673638410"
42
+ >
43
+ <span
44
+ class="font_GTStandard _WebkitFontSmoothing-_platformweb_antialiased _dsp-inline _bxs-border-box _ww-break-word _ws-pre-wrap _marginTop-0px _marginRight-0px _marginBottom-0px _marginLeft-0px _ff-f-family _fs-f-size-body1510 _lh-f-lineHeigh201793153 _ls-f-letterSpa1099960310"
45
+ data-disable-theme="true"
46
+ >
47
+ Item 2
48
+ </span>
49
+ </div>
50
+ <div
51
+ class="_dsp-flex _alignItems-stretch _fd-column _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _backgroundColor-bg--info--m3355 _paddingTop-t-space-spa1366020313 _paddingRight-t-space-spa1366020313 _paddingBottom-t-space-spa1366020313 _paddingLeft-t-space-spa1366020313 _btlr-t-radius-ra1673638410 _btrr-t-radius-ra1673638410 _bbrr-t-radius-ra1673638410 _bblr-t-radius-ra1673638410"
52
+ >
53
+ <span
54
+ class="font_GTStandard _WebkitFontSmoothing-_platformweb_antialiased _dsp-inline _bxs-border-box _ww-break-word _ws-pre-wrap _marginTop-0px _marginRight-0px _marginBottom-0px _marginLeft-0px _ff-f-family _fs-f-size-body1510 _lh-f-lineHeigh201793153 _ls-f-letterSpa1099960310"
55
+ data-disable-theme="true"
56
+ >
57
+ Item 3
58
+ </span>
59
+ </div>
60
+ <div
61
+ class="_dsp-flex _alignItems-stretch _fd-column _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _backgroundColor-bg--info--m3355 _paddingTop-t-space-spa1366020313 _paddingRight-t-space-spa1366020313 _paddingBottom-t-space-spa1366020313 _paddingLeft-t-space-spa1366020313 _btlr-t-radius-ra1673638410 _btrr-t-radius-ra1673638410 _bbrr-t-radius-ra1673638410 _bblr-t-radius-ra1673638410"
62
+ >
63
+ <span
64
+ class="font_GTStandard _WebkitFontSmoothing-_platformweb_antialiased _dsp-inline _bxs-border-box _ww-break-word _ws-pre-wrap _marginTop-0px _marginRight-0px _marginBottom-0px _marginLeft-0px _ff-f-family _fs-f-size-body1510 _lh-f-lineHeigh201793153 _ls-f-letterSpa1099960310"
65
+ data-disable-theme="true"
66
+ >
67
+ Item 4
68
+ </span>
69
+ </div>
70
+ <div
71
+ class="_dsp-flex _alignItems-stretch _fd-column _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _backgroundColor-bg--info--m3355 _paddingTop-t-space-spa1366020313 _paddingRight-t-space-spa1366020313 _paddingBottom-t-space-spa1366020313 _paddingLeft-t-space-spa1366020313 _btlr-t-radius-ra1673638410 _btrr-t-radius-ra1673638410 _bbrr-t-radius-ra1673638410 _bblr-t-radius-ra1673638410"
72
+ >
73
+ <span
74
+ class="font_GTStandard _WebkitFontSmoothing-_platformweb_antialiased _dsp-inline _bxs-border-box _ww-break-word _ws-pre-wrap _marginTop-0px _marginRight-0px _marginBottom-0px _marginLeft-0px _ff-f-family _fs-f-size-body1510 _lh-f-lineHeigh201793153 _ls-f-letterSpa1099960310"
75
+ data-disable-theme="true"
76
+ >
77
+ Item 5
78
+ </span>
79
+ </div>
80
+ <div
81
+ class="_dsp-flex _alignItems-stretch _fd-column _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _backgroundColor-bg--info--m3355 _paddingTop-t-space-spa1366020313 _paddingRight-t-space-spa1366020313 _paddingBottom-t-space-spa1366020313 _paddingLeft-t-space-spa1366020313 _btlr-t-radius-ra1673638410 _btrr-t-radius-ra1673638410 _bbrr-t-radius-ra1673638410 _bblr-t-radius-ra1673638410"
82
+ >
83
+ <span
84
+ class="font_GTStandard _WebkitFontSmoothing-_platformweb_antialiased _dsp-inline _bxs-border-box _ww-break-word _ws-pre-wrap _marginTop-0px _marginRight-0px _marginBottom-0px _marginLeft-0px _ff-f-family _fs-f-size-body1510 _lh-f-lineHeigh201793153 _ls-f-letterSpa1099960310"
85
+ data-disable-theme="true"
86
+ >
87
+ Item 6
88
+ </span>
89
+ </div>
90
+ <div
91
+ class="_dsp-flex _alignItems-stretch _fd-column _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _backgroundColor-bg--info--m3355 _paddingTop-t-space-spa1366020313 _paddingRight-t-space-spa1366020313 _paddingBottom-t-space-spa1366020313 _paddingLeft-t-space-spa1366020313 _btlr-t-radius-ra1673638410 _btrr-t-radius-ra1673638410 _bbrr-t-radius-ra1673638410 _bblr-t-radius-ra1673638410"
92
+ >
93
+ <span
94
+ class="font_GTStandard _WebkitFontSmoothing-_platformweb_antialiased _dsp-inline _bxs-border-box _ww-break-word _ws-pre-wrap _marginTop-0px _marginRight-0px _marginBottom-0px _marginLeft-0px _ff-f-family _fs-f-size-body1510 _lh-f-lineHeigh201793153 _ls-f-letterSpa1099960310"
95
+ data-disable-theme="true"
96
+ >
97
+ Item 7
98
+ </span>
99
+ </div>
100
+ <div
101
+ class="_dsp-flex _alignItems-stretch _fd-column _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _backgroundColor-bg--info--m3355 _paddingTop-t-space-spa1366020313 _paddingRight-t-space-spa1366020313 _paddingBottom-t-space-spa1366020313 _paddingLeft-t-space-spa1366020313 _btlr-t-radius-ra1673638410 _btrr-t-radius-ra1673638410 _bbrr-t-radius-ra1673638410 _bblr-t-radius-ra1673638410"
102
+ >
103
+ <span
104
+ class="font_GTStandard _WebkitFontSmoothing-_platformweb_antialiased _dsp-inline _bxs-border-box _ww-break-word _ws-pre-wrap _marginTop-0px _marginRight-0px _marginBottom-0px _marginLeft-0px _ff-f-family _fs-f-size-body1510 _lh-f-lineHeigh201793153 _ls-f-letterSpa1099960310"
105
+ data-disable-theme="true"
106
+ >
107
+ Item 8
108
+ </span>
109
+ </div>
110
+ <div
111
+ class="_dsp-flex _alignItems-stretch _fd-column _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _backgroundColor-bg--info--m3355 _paddingTop-t-space-spa1366020313 _paddingRight-t-space-spa1366020313 _paddingBottom-t-space-spa1366020313 _paddingLeft-t-space-spa1366020313 _btlr-t-radius-ra1673638410 _btrr-t-radius-ra1673638410 _bbrr-t-radius-ra1673638410 _bblr-t-radius-ra1673638410"
112
+ >
113
+ <span
114
+ class="font_GTStandard _WebkitFontSmoothing-_platformweb_antialiased _dsp-inline _bxs-border-box _ww-break-word _ws-pre-wrap _marginTop-0px _marginRight-0px _marginBottom-0px _marginLeft-0px _ff-f-family _fs-f-size-body1510 _lh-f-lineHeigh201793153 _ls-f-letterSpa1099960310"
115
+ data-disable-theme="true"
116
+ >
117
+ Item 9
118
+ </span>
119
+ </div>
120
+ <div
121
+ class="_dsp-flex _alignItems-stretch _fd-column _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _backgroundColor-bg--info--m3355 _paddingTop-t-space-spa1366020313 _paddingRight-t-space-spa1366020313 _paddingBottom-t-space-spa1366020313 _paddingLeft-t-space-spa1366020313 _btlr-t-radius-ra1673638410 _btrr-t-radius-ra1673638410 _bbrr-t-radius-ra1673638410 _bblr-t-radius-ra1673638410"
122
+ >
123
+ <span
124
+ class="font_GTStandard _WebkitFontSmoothing-_platformweb_antialiased _dsp-inline _bxs-border-box _ww-break-word _ws-pre-wrap _marginTop-0px _marginRight-0px _marginBottom-0px _marginLeft-0px _ff-f-family _fs-f-size-body1510 _lh-f-lineHeigh201793153 _ls-f-letterSpa1099960310"
125
+ data-disable-theme="true"
126
+ >
127
+ Item 10
128
+ </span>
129
+ </div>
130
+ </div>
131
+ </div>
132
+ </span>
133
+ </span>
134
+ </span>
135
+ </span>
136
+ </div>
137
+ </DocumentFragment>
138
+ `;
@@ -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
+ };