@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.
Files changed (67) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/definitions/index.d.ts +5 -0
  3. package/dist/definitions/index.d.ts.map +1 -1
  4. package/dist/definitions/system/content/icon/Icon.d.ts +18 -0
  5. package/dist/definitions/system/content/icon/Icon.d.ts.map +1 -0
  6. package/dist/definitions/system/content/typography/Typography.d.ts +8 -7
  7. package/dist/definitions/system/content/typography/Typography.d.ts.map +1 -1
  8. package/dist/definitions/system/content/typography/TypographyIcon.d.ts +9 -0
  9. package/dist/definitions/system/content/typography/TypographyIcon.d.ts.map +1 -0
  10. package/dist/definitions/system/content/typography/TypographyView.d.ts +18 -0
  11. package/dist/definitions/system/content/typography/TypographyView.d.ts.map +1 -0
  12. package/dist/definitions/system/content/typography/utils/getVariantAndWeightValues.d.ts +2 -1
  13. package/dist/definitions/system/content/typography/utils/getVariantAndWeightValues.d.ts.map +1 -1
  14. package/dist/definitions/system/content/typography/utils/typographyContext.d.ts +16 -0
  15. package/dist/definitions/system/content/typography/utils/typographyContext.d.ts.map +1 -0
  16. package/dist/definitions/system/core/primitives/Image/Image.d.ts +3 -0
  17. package/dist/definitions/system/core/primitives/Image/Image.d.ts.map +1 -0
  18. package/dist/definitions/system/core/primitives/ScrollView/ScrollView.d.ts +3 -0
  19. package/dist/definitions/system/core/primitives/ScrollView/ScrollView.d.ts.map +1 -0
  20. package/dist/index-metro.es.android.js +117 -11
  21. package/dist/index-metro.es.android.js.map +1 -1
  22. package/dist/index-metro.es.ios.js +117 -11
  23. package/dist/index-metro.es.ios.js.map +1 -1
  24. package/dist/index-node-22.22.cjs.js +121 -7
  25. package/dist/index-node-22.22.cjs.js.map +1 -1
  26. package/dist/index-node-22.22.cjs.web.js +121 -7
  27. package/dist/index-node-22.22.cjs.web.js.map +1 -1
  28. package/dist/index-node-22.22.es.mjs +121 -9
  29. package/dist/index-node-22.22.es.mjs.map +1 -1
  30. package/dist/index-node-22.22.es.web.mjs +121 -9
  31. package/dist/index-node-22.22.es.web.mjs.map +1 -1
  32. package/dist/index.es.js +115 -11
  33. package/dist/index.es.js.map +1 -1
  34. package/dist/index.es.web.js +115 -11
  35. package/dist/index.es.web.js.map +1 -1
  36. package/dist/tsbuildinfo +1 -1
  37. package/package.json +7 -3
  38. package/src/index.ts +5 -0
  39. package/src/system/content/icon/Icon.features.stories.tsx +116 -0
  40. package/src/system/content/icon/Icon.stories.tsx +44 -0
  41. package/src/system/content/icon/Icon.tsx +43 -0
  42. package/src/system/content/icon/__snapshots__/Icon.features.stories.tsx.snap +569 -0
  43. package/src/system/content/icon/__snapshots__/Icon.stories.tsx.snap +29 -0
  44. package/src/system/content/icon/__snapshots_web__/Icon.features.stories.tsx.snap +309 -0
  45. package/src/system/content/icon/__snapshots_web__/Icon.stories.tsx.snap +33 -0
  46. package/src/system/content/typography/Typography.tsx +24 -15
  47. package/src/system/content/typography/TypographyIcon.features.stories.tsx +163 -0
  48. package/src/system/content/typography/TypographyIcon.stories.tsx +52 -0
  49. package/src/system/content/typography/TypographyIcon.tsx +33 -0
  50. package/src/system/content/typography/TypographyView.tsx +34 -0
  51. package/src/system/content/typography/__snapshots__/TypographyIcon.features.stories.tsx.snap +839 -0
  52. package/src/system/content/typography/__snapshots__/TypographyIcon.stories.tsx.snap +31 -0
  53. package/src/system/content/typography/__snapshots_web__/TypographyIcon.features.stories.tsx.snap +543 -0
  54. package/src/system/content/typography/__snapshots_web__/TypographyIcon.stories.tsx.snap +37 -0
  55. package/src/system/content/typography/utils/getVariantAndWeightValues.tsx +2 -6
  56. package/src/system/content/typography/utils/typographyContext.ts +29 -0
  57. package/src/system/core/primitives/Image/Image.stories.tsx +39 -0
  58. package/src/system/core/primitives/Image/Image.ts +2 -0
  59. package/src/system/core/primitives/Image/__snapshots__/Image.stories.tsx.snap +30 -0
  60. package/src/system/core/primitives/Image/__snapshots_web__/Image.stories.tsx.snap +40 -0
  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
@@ -0,0 +1,33 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { Except } from 'type-fest';
3
+ import type { IconProps } from '../icon/Icon';
4
+ import { Icon } from '../icon/Icon';
5
+ import type { TypographyTextProps } from './Typography';
6
+ import { TypographyView } from './TypographyView';
7
+ import { useTypographyColor } from './utils/typographyContext';
8
+
9
+ export interface TypographyIconProps extends Except<IconProps, 'color'> {
10
+ color?: TypographyTextProps['color'];
11
+ }
12
+
13
+ function TypographyIconInternal(props: TypographyIconProps): ReactNode {
14
+ return (
15
+ <TypographyView>
16
+ <Icon {...props} />
17
+ </TypographyView>
18
+ );
19
+ }
20
+
21
+ function TypographyIconInheritColor(props: TypographyIconProps): ReactNode {
22
+ const typographyColorAncestorValue = useTypographyColor();
23
+
24
+ return <TypographyIconInternal color={typographyColorAncestorValue || undefined} {...props} />;
25
+ }
26
+
27
+ export function TypographyIcon({ color, ...props }: TypographyIconProps): ReactNode {
28
+ if (color) {
29
+ return <TypographyIconInternal color={color} {...props} />;
30
+ }
31
+
32
+ return <TypographyIconInheritColor {...props} />;
33
+ }
@@ -0,0 +1,34 @@
1
+ import type { GetProps } from '@tamagui/core';
2
+ import { View, styled } from '@tamagui/core';
3
+ import type { ReactNode } from 'react';
4
+ import { useTypographyContext } from './utils/typographyContext';
5
+
6
+ const InternalTypographyView = styled(View, {
7
+ name: 'TypographyView',
8
+ });
9
+
10
+ type TypographyViewProps = GetProps<typeof InternalTypographyView>;
11
+
12
+ /**
13
+ *
14
+ * A wrapper component that applies typography styles to its children in order to maintain consistent style between web and native
15
+ * In native, it simply renders a View as it renders correctly by default
16
+ * In web, it ensures that the display is set to inline-flex when inside a Typography context
17
+ *
18
+ * React Native Web includes this implementation in its codebase
19
+ * but Tamagui does not use React Native Webview, we need to implement it ourselves
20
+ *
21
+ * Inside a Typography component, always use TypographyView to wrap external components like Icon or Svg
22
+ */
23
+ export function TypographyView(props: TypographyViewProps): ReactNode {
24
+ const isInTypographyContext = useTypographyContext();
25
+
26
+ return (
27
+ <InternalTypographyView
28
+ {...props}
29
+ $platform-web={
30
+ isInTypographyContext ? { ...props['$platform-web'], display: 'inline-flex' } : props['$platform-web']
31
+ }
32
+ />
33
+ );
34
+ }