@ornikar/bumper 3.6.1 → 3.7.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 (70) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/definitions/system/actions/Button/Button.d.ts +3 -3
  3. package/dist/definitions/system/actions/IconButton/IconButton.d.ts +1 -1
  4. package/dist/definitions/system/content/icon/Icon.d.ts +1 -1
  5. package/dist/definitions/system/content/icon/Icon.d.ts.map +1 -1
  6. package/dist/definitions/system/content/typography/Typography.d.ts.map +1 -1
  7. package/dist/definitions/system/types.d.ts +13 -2
  8. package/dist/definitions/system/types.d.ts.map +1 -1
  9. package/dist/index-metro.es.android.js +6 -4
  10. package/dist/index-metro.es.android.js.map +1 -1
  11. package/dist/index-metro.es.ios.js +6 -4
  12. package/dist/index-metro.es.ios.js.map +1 -1
  13. package/dist/index-node-22.22.cjs.js +5 -2
  14. package/dist/index-node-22.22.cjs.js.map +1 -1
  15. package/dist/index-node-22.22.cjs.web.js +5 -2
  16. package/dist/index-node-22.22.cjs.web.js.map +1 -1
  17. package/dist/index-node-22.22.es.mjs +5 -2
  18. package/dist/index-node-22.22.es.mjs.map +1 -1
  19. package/dist/index-node-22.22.es.web.mjs +5 -2
  20. package/dist/index-node-22.22.es.web.mjs.map +1 -1
  21. package/dist/index.es.js +6 -4
  22. package/dist/index.es.js.map +1 -1
  23. package/dist/index.es.web.js +6 -4
  24. package/dist/index.es.web.js.map +1 -1
  25. package/dist/tsbuildinfo +1 -1
  26. package/package.json +1 -1
  27. package/src/Bumper.mdx +5 -0
  28. package/src/system/actions/Button/Button.features.stories.tsx +13 -0
  29. package/src/system/actions/Button/Button.mdx +86 -0
  30. package/src/system/actions/Button/Button.stories.tsx +0 -1
  31. package/src/system/actions/Button/__snapshots__/Button.features.stories.tsx.snap +166 -0
  32. package/src/system/actions/Button/__snapshots_web__/Button.features.stories.tsx.snap +60 -0
  33. package/src/system/actions/IconButton/IconButton.features.stories.tsx +8 -0
  34. package/src/system/actions/IconButton/IconButton.mdx +74 -0
  35. package/src/system/actions/IconButton/IconButton.stories.tsx +0 -1
  36. package/src/system/actions/IconButton/__snapshots__/IconButton.features.stories.tsx.snap +76 -0
  37. package/src/system/actions/IconButton/__snapshots_web__/IconButton.features.stories.tsx.snap +39 -0
  38. package/src/system/content/icon/Icon.features.stories.tsx +12 -0
  39. package/src/system/content/icon/Icon.tsx +5 -1
  40. package/src/system/content/icon/__snapshots__/Icon.features.stories.tsx.snap +36 -1
  41. package/src/system/content/icon/__snapshots_web__/Icon.features.stories.tsx.snap +33 -1
  42. package/src/system/content/typography/Typography.features.stories.tsx +8 -0
  43. package/src/system/content/typography/Typography.tsx +3 -1
  44. package/src/system/content/typography/TypographyIcon.features.stories.tsx +9 -0
  45. package/src/system/content/typography/TypographyLink.features.stories.tsx +9 -0
  46. package/src/system/content/typography/__snapshots__/Typography.features.stories.tsx.snap +29 -0
  47. package/src/system/content/typography/__snapshots__/TypographyIcon.features.stories.tsx.snap +45 -0
  48. package/src/system/content/typography/__snapshots__/TypographyLink.features.stories.tsx.snap +55 -0
  49. package/src/system/content/typography/__snapshots_web__/Typography.features.stories.tsx.snap +29 -0
  50. package/src/system/content/typography/__snapshots_web__/TypographyIcon.features.stories.tsx.snap +41 -0
  51. package/src/system/content/typography/__snapshots_web__/TypographyLink.features.stories.tsx.snap +36 -0
  52. package/src/system/core/primitives/Center.features.stories.tsx +17 -0
  53. package/src/system/core/primitives/Pressable.features.stories.tsx +18 -0
  54. package/src/system/core/primitives/ScrollView/ScrollView.features.stories.tsx +14 -0
  55. package/src/system/core/primitives/ScrollView/__snapshots__/ScrollView.features.stories.tsx.snap +350 -0
  56. package/src/system/core/primitives/ScrollView/__snapshots_web__/ScrollView.features.stories.tsx.snap +130 -0
  57. package/src/system/core/primitives/Stack.features.stories.tsx +29 -0
  58. package/src/system/core/primitives/View.features.stories.tsx +30 -0
  59. package/src/system/core/primitives/__snapshots__/Center.features.stories.tsx.snap +50 -0
  60. package/src/system/core/primitives/__snapshots__/Pressable.features.stories.tsx.snap +60 -0
  61. package/src/system/core/primitives/__snapshots__/Stack.features.stories.tsx.snap +126 -0
  62. package/src/system/core/primitives/__snapshots__/View.features.stories.tsx.snap +126 -0
  63. package/src/system/core/primitives/__snapshots_web__/Center.features.stories.tsx.snap +34 -1
  64. package/src/system/core/primitives/__snapshots_web__/Pressable.features.stories.tsx.snap +35 -0
  65. package/src/system/core/primitives/__snapshots_web__/Stack.features.stories.tsx.snap +55 -0
  66. package/src/system/core/primitives/__snapshots_web__/View.features.stories.tsx.snap +55 -0
  67. package/src/system/dataDisplays/Badge/Badge.features.stories.tsx +10 -0
  68. package/src/system/dataDisplays/Badge/__snapshots__/Badge.features.stories.tsx.snap +30 -0
  69. package/src/system/dataDisplays/Badge/__snapshots_web__/Badge.features.stories.tsx.snap +27 -0
  70. package/src/system/types.ts +14 -3
@@ -188,7 +188,7 @@ exports[`Bumper/Content/Icon/Features DefaultSize 1`] = `
188
188
  class="is_VStack _dsp-flex _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _fd-column _alignItems-center _gap-t-space-spa94482166"
189
189
  >
190
190
  <div
191
- class="is_Icon _dsp-flex _alignItems-stretch _fd-column _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0"
191
+ class="is_Icon _dsp-flex _alignItems-stretch _fd-column _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _width-t-bumperIco1504282965 _height-t-bumperIco1504282965"
192
192
  >
193
193
  <svg
194
194
  color="var(--content--base--hi)"
@@ -226,6 +226,38 @@ exports[`Bumper/Content/Icon/Features DefaultSize 1`] = `
226
226
  </DocumentFragment>
227
227
  `;
228
228
 
229
+ exports[`Bumper/Content/Icon/Features Responsive 1`] = `
230
+ <DocumentFragment>
231
+ <div
232
+ class="css-view-g5y9jx r-flex-13awgt0"
233
+ >
234
+ <span
235
+ class=""
236
+ style="display: contents;"
237
+ >
238
+ <span
239
+ class=" "
240
+ style="display: contents;"
241
+ >
242
+ <span
243
+ class=" t_light is_Theme"
244
+ style="display: contents;"
245
+ >
246
+ <div
247
+ class="is_Icon _dsp-flex _alignItems-stretch _fd-column _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _width-t-bumperIco1504282971 _height-t-bumperIco1504282971"
248
+ >
249
+ <svg
250
+ color="var(--content--base--hi)"
251
+ data-file-name="star.inline.svg"
252
+ />
253
+ </div>
254
+ </span>
255
+ </span>
256
+ </span>
257
+ </div>
258
+ </DocumentFragment>
259
+ `;
260
+
229
261
  exports[`Bumper/Content/Icon/Features Sizes 1`] = `
230
262
  <DocumentFragment>
231
263
  <div
@@ -158,3 +158,11 @@ export const ContextInheritance: Story = {
158
158
  </VStack>
159
159
  ),
160
160
  };
161
+
162
+ export const Responsive: Story = {
163
+ render: () => (
164
+ <Typography.Text variant="body-s" $medium={{ variant: 'body-l' }} $large={{ variant: 'body-xl' }}>
165
+ Responsive text: body-s → body-l → heading-m
166
+ </Typography.Text>
167
+ ),
168
+ };
@@ -2,6 +2,7 @@ import type { ColorTokens, GetProps } from '@tamagui/core';
2
2
  import { Text, styled } from '@tamagui/core';
3
3
  import type { ReactNode } from 'react';
4
4
  import { type Except } from 'type-fest';
5
+ import { useProps } from '../../core/hooks/useProps';
5
6
  import {
6
7
  BODY_VARIANTS,
7
8
  type BodyFontVariants,
@@ -120,7 +121,8 @@ export const InternalTypography = styled(Text, {
120
121
  export type InternalTypographyProps = GetProps<typeof InternalTypography>;
121
122
 
122
123
  export function TypographyBase(props: TypographyTextProps): ReactNode {
123
- return <InternalTypography {...props} />;
124
+ const flattenProps = useProps(props);
125
+ return <InternalTypography {...flattenProps} />;
124
126
  }
125
127
 
126
128
  export const createHeading = (level: number): ((props: TypographyTextProps) => ReactNode) => {
@@ -126,6 +126,15 @@ export const DifferentSizes: Story = {
126
126
  ),
127
127
  };
128
128
 
129
+ export const Responsive: Story = {
130
+ render: () => (
131
+ <Typography.Text variant="body-m" color="$content.accent">
132
+ <TypographyIcon icon={<StarIcon />} size="$icon.s" $medium={{ size: '$icon.m' }} $large={{ size: '$icon.l' }} />{' '}
133
+ Icon scales across breakpoints
134
+ </Typography.Text>
135
+ ),
136
+ };
137
+
129
138
  export const NestedTypographyInheritance: Story = {
130
139
  render: () => (
131
140
  <VStack gap="$space.24">
@@ -96,3 +96,12 @@ export const StateHover: Story = {
96
96
  </VStack>
97
97
  ),
98
98
  };
99
+
100
+ export const Responsive: Story = {
101
+ render: () => (
102
+ <Typography.Text variant="body-s" $medium={{ variant: 'body-l' }}>
103
+ Text with <TypographyLink onPress={action('Link clicked!')}>a responsive link</TypographyLink> that scales with
104
+ its parent
105
+ </Typography.Text>
106
+ ),
107
+ };
@@ -882,3 +882,32 @@ exports[`Bumper/Content/Typography/Features LabelVariants 1`] = `
882
882
  </View>
883
883
  </RNCSafeAreaProvider>
884
884
  `;
885
+
886
+ exports[`Bumper/Content/Typography/Features Responsive 1`] = `
887
+ <RNCSafeAreaProvider
888
+ onInsetsChange={[Function]}
889
+ style={
890
+ [
891
+ {
892
+ "flex": 1,
893
+ },
894
+ undefined,
895
+ ]
896
+ }
897
+ >
898
+ <Text
899
+ style={
900
+ {
901
+ "color": "#101010",
902
+ "fontFamily": "GTStandardRegular",
903
+ "fontSize": 14,
904
+ "letterSpacing": 0.3,
905
+ "lineHeight": 20,
906
+ }
907
+ }
908
+ suppressHighlighting={true}
909
+ >
910
+ Responsive text: body-s → body-l → heading-m
911
+ </Text>
912
+ </RNCSafeAreaProvider>
913
+ `;
@@ -657,6 +657,51 @@ exports[`Bumper/Content/TypographyIcon/Features OverrideInheritedColor 1`] = `
657
657
  </RNCSafeAreaProvider>
658
658
  `;
659
659
 
660
+ exports[`Bumper/Content/TypographyIcon/Features Responsive 1`] = `
661
+ <RNCSafeAreaProvider
662
+ onInsetsChange={[Function]}
663
+ style={
664
+ [
665
+ {
666
+ "flex": 1,
667
+ },
668
+ undefined,
669
+ ]
670
+ }
671
+ >
672
+ <Text
673
+ style={
674
+ {
675
+ "color": "#563B56",
676
+ "fontFamily": "GTStandardRegular",
677
+ "fontSize": 16,
678
+ "letterSpacing": 0.3,
679
+ "lineHeight": 24,
680
+ }
681
+ }
682
+ suppressHighlighting={true}
683
+ >
684
+ <View>
685
+ <View
686
+ style={
687
+ {
688
+ "height": 16,
689
+ "width": 16,
690
+ }
691
+ }
692
+ >
693
+ <svg
694
+ color="#563B56"
695
+ data-file-name="star.inline.svg"
696
+ />
697
+ </View>
698
+ </View>
699
+
700
+ Icon scales across breakpoints
701
+ </Text>
702
+ </RNCSafeAreaProvider>
703
+ `;
704
+
660
705
  exports[`Bumper/Content/TypographyIcon/Features WithExplicitColor 1`] = `
661
706
  <RNCSafeAreaProvider
662
707
  onInsetsChange={[Function]}
@@ -315,6 +315,61 @@ exports[`Bumper/Content/TypographyLink/Features NoUnderlineTrue 1`] = `
315
315
  </RNCSafeAreaProvider>
316
316
  `;
317
317
 
318
+ exports[`Bumper/Content/TypographyLink/Features Responsive 1`] = `
319
+ <RNCSafeAreaProvider
320
+ onInsetsChange={[Function]}
321
+ style={
322
+ [
323
+ {
324
+ "flex": 1,
325
+ },
326
+ undefined,
327
+ ]
328
+ }
329
+ >
330
+ <Text
331
+ style={
332
+ {
333
+ "color": "#101010",
334
+ "fontFamily": "GTStandardRegular",
335
+ "fontSize": 14,
336
+ "letterSpacing": 0.3,
337
+ "lineHeight": 20,
338
+ }
339
+ }
340
+ suppressHighlighting={true}
341
+ >
342
+ Text with
343
+ <Text
344
+ onBlur={[Function]}
345
+ onClick={[Function]}
346
+ onFocus={[Function]}
347
+ onResponderGrant={[Function]}
348
+ onResponderMove={[Function]}
349
+ onResponderRelease={[Function]}
350
+ onResponderTerminate={[Function]}
351
+ onResponderTerminationRequest={[Function]}
352
+ onStartShouldSetResponder={[Function]}
353
+ role="link"
354
+ style={
355
+ {
356
+ "color": "#101010",
357
+ "fontFamily": "GTStandardRegular",
358
+ "fontSize": 14,
359
+ "letterSpacing": 0.3,
360
+ "lineHeight": 20,
361
+ "textDecorationLine": "underline",
362
+ }
363
+ }
364
+ suppressHighlighting={true}
365
+ >
366
+ a responsive link
367
+ </Text>
368
+ that scales with its parent
369
+ </Text>
370
+ </RNCSafeAreaProvider>
371
+ `;
372
+
318
373
  exports[`Bumper/Content/TypographyLink/Features StateHover 1`] = `
319
374
  <RNCSafeAreaProvider
320
375
  onInsetsChange={[Function]}
@@ -477,3 +477,32 @@ exports[`Bumper/Content/Typography/Features LabelVariants 1`] = `
477
477
  </div>
478
478
  </DocumentFragment>
479
479
  `;
480
+
481
+ exports[`Bumper/Content/Typography/Features Responsive 1`] = `
482
+ <DocumentFragment>
483
+ <div
484
+ class="css-view-g5y9jx r-flex-13awgt0"
485
+ >
486
+ <span
487
+ class=""
488
+ style="display: contents;"
489
+ >
490
+ <span
491
+ class=" "
492
+ style="display: contents;"
493
+ >
494
+ <span
495
+ class=" t_light is_Theme"
496
+ style="display: contents;"
497
+ >
498
+ <span
499
+ 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 _fw-f-weight-re98715119 _col-content--ba907952141"
500
+ >
501
+ Responsive text: body-s → body-l → heading-m
502
+ </span>
503
+ </span>
504
+ </span>
505
+ </span>
506
+ </div>
507
+ </DocumentFragment>
508
+ `;
@@ -405,6 +405,47 @@ exports[`Bumper/Content/TypographyIcon/Features OverrideInheritedColor 1`] = `
405
405
  </DocumentFragment>
406
406
  `;
407
407
 
408
+ exports[`Bumper/Content/TypographyIcon/Features Responsive 1`] = `
409
+ <DocumentFragment>
410
+ <div
411
+ class="css-view-g5y9jx r-flex-13awgt0"
412
+ >
413
+ <span
414
+ class=""
415
+ style="display: contents;"
416
+ >
417
+ <span
418
+ class=" "
419
+ style="display: contents;"
420
+ >
421
+ <span
422
+ class=" t_light is_Theme"
423
+ style="display: contents;"
424
+ >
425
+ <span
426
+ 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-body1504 _lh-f-lineHeigh201793147 _ls-f-letterSpa1099960304 _fw-f-weight-re98715119 _col-content--ac3049896"
427
+ >
428
+ <div
429
+ class="is_TypographyViewInternal _dsp-_platformweb_inline-flex _dsp-flex _alignItems-stretch _fd-column _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0"
430
+ >
431
+ <div
432
+ class="is_Icon _dsp-flex _alignItems-stretch _fd-column _fb-auto _bxs-border-box _pos-relative _minHeight-0px _minWidth-0px _flexShrink-0 _width-t-bumperIco1504282971 _height-t-bumperIco1504282971"
433
+ >
434
+ <svg
435
+ color="var(--content--accent)"
436
+ data-file-name="star.inline.svg"
437
+ />
438
+ </div>
439
+ </div>
440
+ Icon scales across breakpoints
441
+ </span>
442
+ </span>
443
+ </span>
444
+ </span>
445
+ </div>
446
+ </DocumentFragment>
447
+ `;
448
+
408
449
  exports[`Bumper/Content/TypographyIcon/Features WithExplicitColor 1`] = `
409
450
  <DocumentFragment>
410
451
  <div
@@ -226,6 +226,42 @@ exports[`Bumper/Content/TypographyLink/Features NoUnderlineTrue 1`] = `
226
226
  </DocumentFragment>
227
227
  `;
228
228
 
229
+ exports[`Bumper/Content/TypographyLink/Features Responsive 1`] = `
230
+ <DocumentFragment>
231
+ <div
232
+ class="css-view-g5y9jx r-flex-13awgt0"
233
+ >
234
+ <span
235
+ class=""
236
+ style="display: contents;"
237
+ >
238
+ <span
239
+ class=" "
240
+ style="display: contents;"
241
+ >
242
+ <span
243
+ class=" t_light is_Theme"
244
+ style="display: contents;"
245
+ >
246
+ <span
247
+ 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 _fw-f-weight-re98715119 _col-content--ba907952141"
248
+ >
249
+ Text with
250
+ <a
251
+ class="is_TypographyLink font_GTStandard _WebkitFontSmoothing-_platformweb_antialiased _td-0hover-none _dsp-inline _bxs-border-box _ww-break-word _ws-inherit _marginTop-0px _marginRight-0px _marginBottom-0px _marginLeft-0px _ff-f-family _fs-f-size-body1510 _lh-f-lineHeigh201793153 _ls-f-letterSpa1099960310 _fw-f-weight-re98715119 _col-content--ba907952141 _cur-pointer _td-underline _tt-inherit"
252
+ role="link"
253
+ >
254
+ a responsive link
255
+ </a>
256
+ that scales with its parent
257
+ </span>
258
+ </span>
259
+ </span>
260
+ </span>
261
+ </div>
262
+ </DocumentFragment>
263
+ `;
264
+
229
265
  exports[`Bumper/Content/TypographyLink/Features StateHover 1`] = `
230
266
  <DocumentFragment>
231
267
  <div
@@ -61,3 +61,20 @@ export const CircularCentering: Story = {
61
61
  </HStack>
62
62
  ),
63
63
  };
64
+
65
+ export const Responsive: Story = {
66
+ render: () => (
67
+ <Center
68
+ backgroundColor="$bg.accent.default"
69
+ width="$size.96"
70
+ height="$size.96"
71
+ padding="$space.8"
72
+ borderRadius="$radius.m"
73
+ $medium={{ width: '$size.144', height: '$size.144', padding: '$space.24' }}
74
+ >
75
+ <Typography.Text variant="body-m" color="$content.base.onContrasted.hi" textAlign="center">
76
+ Responsive
77
+ </Typography.Text>
78
+ </Center>
79
+ ),
80
+ };
@@ -143,3 +143,21 @@ export const PolymorphicAs: Story = {
143
143
  </VStack>
144
144
  ),
145
145
  };
146
+
147
+ export const Responsive: Story = {
148
+ render: () => (
149
+ <Pressable
150
+ backgroundColor="$bg.accent.default"
151
+ padding="$space.8"
152
+ borderRadius="$radius.s"
153
+ pressStyle={{ scale: 0.98 }}
154
+ $medium={{ padding: '$space.16', borderRadius: '$radius.m' }}
155
+ $large={{ padding: '$space.24', borderRadius: '$radius.l' }}
156
+ onPress={action('Pressed')}
157
+ >
158
+ <Typography.Text variant="body-m" color="$content.base.onContrasted.hi">
159
+ Responsive padding and radius
160
+ </Typography.Text>
161
+ </Pressable>
162
+ ),
163
+ };
@@ -82,3 +82,17 @@ export const ScrollDisabled: Story = {
82
82
  </VStack>
83
83
  ),
84
84
  };
85
+
86
+ export const Responsive: Story = {
87
+ render: () => (
88
+ <ScrollView height="$size.120" width="$size.176" $medium={{ height: '$size.176', width: '$size.208' }}>
89
+ <VStack gap="$space.8" padding="$space.8">
90
+ {Array.from({ length: 10 }, (_, i) => (
91
+ <View key={`item-${i}`} backgroundColor="$bg.info.mid" padding="$space.12" borderRadius="$radius.m">
92
+ <Typography.Text variant="body-s">Item {i + 1}</Typography.Text>
93
+ </View>
94
+ ))}
95
+ </VStack>
96
+ </ScrollView>
97
+ ),
98
+ };