@coinbase/cds-mobile 8.25.0 → 8.26.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 (77) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dts/alpha/select/DefaultSelectControl.d.ts +2 -8
  3. package/dts/alpha/select/DefaultSelectControl.d.ts.map +1 -1
  4. package/dts/alpha/select/DefaultSelectDropdown.d.ts.map +1 -1
  5. package/dts/alpha/select/DefaultSelectOptionGroup.d.ts +8 -0
  6. package/dts/alpha/select/DefaultSelectOptionGroup.d.ts.map +1 -0
  7. package/dts/alpha/select/Select.d.ts +23 -366
  8. package/dts/alpha/select/Select.d.ts.map +1 -1
  9. package/dts/alpha/select/index.d.ts +2 -0
  10. package/dts/alpha/select/index.d.ts.map +1 -1
  11. package/dts/alpha/select/types.d.ts +486 -0
  12. package/dts/alpha/select/types.d.ts.map +1 -0
  13. package/dts/alpha/select-chip/SelectChip.d.ts +26 -0
  14. package/dts/alpha/select-chip/SelectChip.d.ts.map +1 -0
  15. package/dts/alpha/select-chip/SelectChipControl.d.ts +14 -0
  16. package/dts/alpha/select-chip/SelectChipControl.d.ts.map +1 -0
  17. package/dts/alpha/select-chip/index.d.ts +3 -0
  18. package/dts/alpha/select-chip/index.d.ts.map +1 -0
  19. package/dts/chips/Chip.d.ts.map +1 -1
  20. package/dts/chips/SelectChip.d.ts +8 -0
  21. package/dts/chips/SelectChip.d.ts.map +1 -1
  22. package/dts/examples/ExampleScreen.d.ts +26 -1
  23. package/dts/examples/ExampleScreen.d.ts.map +1 -1
  24. package/esm/alpha/select/DefaultSelectControl.js +46 -8
  25. package/esm/alpha/select/DefaultSelectDropdown.js +100 -31
  26. package/esm/alpha/select/DefaultSelectOption.js +1 -1
  27. package/esm/alpha/select/DefaultSelectOptionGroup.js +90 -0
  28. package/esm/alpha/select/Select.js +10 -26
  29. package/esm/alpha/select/index.js +3 -1
  30. package/esm/alpha/select/types.js +50 -0
  31. package/esm/alpha/select-chip/SelectChip.js +31 -0
  32. package/esm/alpha/select-chip/SelectChipControl.js +111 -0
  33. package/esm/alpha/select-chip/__stories__/SelectChip.stories.js +538 -0
  34. package/esm/alpha/select-chip/index.js +2 -0
  35. package/esm/banner/__stories__/Banner.stories.js +133 -294
  36. package/esm/banner/__stories__/BannerActions.stories.js +276 -0
  37. package/esm/banner/__stories__/BannerLayout.stories.js +329 -0
  38. package/esm/cells/__stories__/ListCell.stories.js +1 -17
  39. package/esm/cells/__stories__/ListCellFallback.stories.js +1 -0
  40. package/esm/chips/Chip.js +4 -1
  41. package/esm/chips/SelectChip.js +9 -0
  42. package/esm/examples/ExampleScreen.js +79 -58
  43. package/esm/icons/__stories__/IconSheet.js +35 -13
  44. package/esm/illustrations/__stories__/HeroSquare.stories.js +70 -2
  45. package/esm/illustrations/__stories__/Pictogram.stories.js +70 -2
  46. package/esm/illustrations/__stories__/SpotIcon.stories.js +70 -2
  47. package/esm/illustrations/__stories__/SpotRectangle.stories.js +68 -2
  48. package/esm/illustrations/__stories__/SpotSquare.stories.js +68 -2
  49. package/esm/media/__stories__/CarouselMedia.stories.js +2 -5
  50. package/esm/numpad/__stories__/Numpad.stories.js +8 -5
  51. package/esm/page/__stories__/PageFooter.stories.js +5 -4
  52. package/esm/page/__stories__/PageFooterInPage.stories.js +20 -19
  53. package/esm/page/__stories__/PageHeader.stories.js +4 -4
  54. package/esm/page/__stories__/PageHeaderInErrorEmptyState.stories.js +6 -4
  55. package/esm/page/__stories__/PageHeaderInPage.stories.js +20 -18
  56. package/esm/section-header/__stories__/SectionHeader.stories.js +4 -4
  57. package/esm/sticky-footer/__stories__/StickyFooter.stories.js +6 -8
  58. package/esm/tour/__stories__/Tour.stories.js +13 -166
  59. package/esm/typography/__stories__/TextBody.stories.js +2 -0
  60. package/esm/typography/__stories__/TextCaption.stories.js +2 -0
  61. package/esm/typography/__stories__/TextCore.stories.js +2 -0
  62. package/esm/typography/__stories__/TextDisplay1.stories.js +2 -0
  63. package/esm/typography/__stories__/TextDisplay2.stories.js +2 -0
  64. package/esm/typography/__stories__/TextDisplay3.stories.js +2 -0
  65. package/esm/typography/__stories__/TextHeadline.stories.js +2 -0
  66. package/esm/typography/__stories__/TextLabel1.stories.js +2 -0
  67. package/esm/typography/__stories__/TextLabel2.stories.js +2 -0
  68. package/esm/typography/__stories__/TextLegal.stories.js +2 -0
  69. package/esm/typography/__stories__/TextTitle1.stories.js +2 -0
  70. package/esm/typography/__stories__/TextTitle2.stories.js +2 -0
  71. package/esm/typography/__stories__/TextTitle3.stories.js +2 -0
  72. package/esm/typography/__stories__/TextTitle4.stories.js +2 -0
  73. package/package.json +2 -2
  74. package/esm/icons/__stories__/Icon.stories.js +0 -98
  75. package/esm/illustrations/__stories__/getIllustrationSheet.js +0 -164
  76. /package/esm/alpha/select/__stories__/{Select.stories.js → AlphaSelect.stories.js} +0 -0
  77. /package/esm/alpha/tabbed-chips/__stories__/{TabbedChips.stories.js → AlphaTabbedChips.stories.js} +0 -0
@@ -1,2 +1,68 @@
1
- import { getIllustrationSheet } from './getIllustrationSheet';
2
- export default getIllustrationSheet('spotRectangle');
1
+ import React from 'react';
2
+ import { illustrationDimensions, illustrationSizes } from '@coinbase/cds-common/tokens/illustrations';
3
+ import spotRectangleVersionMap from '@coinbase/cds-illustrations/__generated__/spotRectangle/data/versionMap';
4
+ import { Example, ExampleScreen } from '../../examples/ExampleScreen';
5
+ import { HStack, VStack } from '../../layout';
6
+ import { ThemeProvider } from '../../system/ThemeProvider';
7
+ import { defaultTheme } from '../../themes/defaultTheme';
8
+ import { Text } from '../../typography/Text';
9
+ import { SpotRectangle } from '../index';
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ const COLOR_SCHEMES = ['light', 'dark'];
12
+ const ITEMS_PER_EXAMPLE = 12;
13
+ const SPOT_RECTANGLE_SCALE = 0.3;
14
+ const spotRectangleDimension = illustrationDimensions.spotRectangle[0];
15
+ const [spotRectangleWidth] = illustrationSizes[spotRectangleDimension];
16
+ const PREVIEW_WIDTH = spotRectangleWidth * SPOT_RECTANGLE_SCALE;
17
+ const spotRectangleNames = Object.keys(spotRectangleVersionMap);
18
+ const spotRectangleGroups = [];
19
+ for (let i = 0; i < spotRectangleNames.length; i += ITEMS_PER_EXAMPLE) {
20
+ spotRectangleGroups.push(spotRectangleNames.slice(i, i + ITEMS_PER_EXAMPLE));
21
+ }
22
+ const SpotRectanglePreview = _ref => {
23
+ let {
24
+ name
25
+ } = _ref;
26
+ return /*#__PURE__*/_jsxs(VStack, {
27
+ gap: 0,
28
+ style: {
29
+ width: PREVIEW_WIDTH * COLOR_SCHEMES.length
30
+ },
31
+ children: [/*#__PURE__*/_jsx(Text, {
32
+ ellipsize: "tail",
33
+ font: "legal",
34
+ numberOfLines: 1,
35
+ children: name
36
+ }), /*#__PURE__*/_jsx(HStack, {
37
+ gap: 0,
38
+ children: COLOR_SCHEMES.map(scheme => /*#__PURE__*/_jsx(ThemeProvider, {
39
+ activeColorScheme: scheme,
40
+ theme: defaultTheme,
41
+ children: /*#__PURE__*/_jsx(VStack, {
42
+ background: "bg",
43
+ overflow: "hidden",
44
+ width: PREVIEW_WIDTH,
45
+ children: /*#__PURE__*/_jsx(SpotRectangle, {
46
+ name: name,
47
+ scaleMultiplier: SPOT_RECTANGLE_SCALE
48
+ })
49
+ })
50
+ }, name + "-" + scheme))
51
+ })]
52
+ });
53
+ };
54
+ const SpotRectangleStory = () => {
55
+ return /*#__PURE__*/_jsx(ExampleScreen, {
56
+ children: spotRectangleGroups.map((group, index, arr) => /*#__PURE__*/_jsx(Example, {
57
+ title: "Spot Rectangles " + (index + 1) + " of " + arr.length,
58
+ children: /*#__PURE__*/_jsx(HStack, {
59
+ flexWrap: "wrap",
60
+ gap: 1,
61
+ children: group.map(name => /*#__PURE__*/_jsx(SpotRectanglePreview, {
62
+ name: name
63
+ }, name))
64
+ })
65
+ }, "spot-rectangles-" + index))
66
+ });
67
+ };
68
+ export default SpotRectangleStory;
@@ -1,2 +1,68 @@
1
- import { getIllustrationSheet } from './getIllustrationSheet';
2
- export default getIllustrationSheet('spotSquare');
1
+ import React from 'react';
2
+ import { illustrationDimensions, illustrationSizes } from '@coinbase/cds-common/tokens/illustrations';
3
+ import spotSquareVersionMap from '@coinbase/cds-illustrations/__generated__/spotSquare/data/versionMap';
4
+ import { Example, ExampleScreen } from '../../examples/ExampleScreen';
5
+ import { HStack, VStack } from '../../layout';
6
+ import { ThemeProvider } from '../../system/ThemeProvider';
7
+ import { defaultTheme } from '../../themes/defaultTheme';
8
+ import { Text } from '../../typography/Text';
9
+ import { SpotSquare } from '../index';
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ const COLOR_SCHEMES = ['light', 'dark'];
12
+ const ITEMS_PER_EXAMPLE = 16;
13
+ const SPOT_SQUARE_SCALE = 0.4;
14
+ const spotSquareDimensionKey = illustrationDimensions.spotSquare[0];
15
+ const [spotSquareWidth] = illustrationSizes[spotSquareDimensionKey];
16
+ const PREVIEW_WIDTH = spotSquareWidth * SPOT_SQUARE_SCALE;
17
+ const spotSquareNames = Object.keys(spotSquareVersionMap);
18
+ const spotSquareGroups = [];
19
+ for (let i = 0; i < spotSquareNames.length; i += ITEMS_PER_EXAMPLE) {
20
+ spotSquareGroups.push(spotSquareNames.slice(i, i + ITEMS_PER_EXAMPLE));
21
+ }
22
+ const SpotSquarePreview = _ref => {
23
+ let {
24
+ name
25
+ } = _ref;
26
+ return /*#__PURE__*/_jsxs(VStack, {
27
+ gap: 0,
28
+ style: {
29
+ width: PREVIEW_WIDTH * COLOR_SCHEMES.length
30
+ },
31
+ children: [/*#__PURE__*/_jsx(Text, {
32
+ ellipsize: "tail",
33
+ font: "legal",
34
+ numberOfLines: 1,
35
+ children: name
36
+ }), /*#__PURE__*/_jsx(HStack, {
37
+ gap: 0,
38
+ children: COLOR_SCHEMES.map(scheme => /*#__PURE__*/_jsx(ThemeProvider, {
39
+ activeColorScheme: scheme,
40
+ theme: defaultTheme,
41
+ children: /*#__PURE__*/_jsx(VStack, {
42
+ background: "bg",
43
+ overflow: "hidden",
44
+ width: PREVIEW_WIDTH,
45
+ children: /*#__PURE__*/_jsx(SpotSquare, {
46
+ name: name,
47
+ scaleMultiplier: SPOT_SQUARE_SCALE
48
+ })
49
+ })
50
+ }, name + "-" + scheme))
51
+ })]
52
+ });
53
+ };
54
+ const SpotSquareStory = () => {
55
+ return /*#__PURE__*/_jsx(ExampleScreen, {
56
+ children: spotSquareGroups.map((group, index, arr) => /*#__PURE__*/_jsx(Example, {
57
+ title: "Spot Squares " + (index + 1) + " of " + arr.length,
58
+ children: /*#__PURE__*/_jsx(HStack, {
59
+ flexWrap: "wrap",
60
+ gap: 1,
61
+ children: group.map(name => /*#__PURE__*/_jsx(SpotSquarePreview, {
62
+ name: name
63
+ }, name))
64
+ })
65
+ }, "spot-square-" + index))
66
+ });
67
+ };
68
+ export default SpotSquareStory;
@@ -1,5 +1,4 @@
1
1
  import React, { memo, useCallback, useMemo, useRef } from 'react';
2
- import { SafeAreaProvider } from 'react-native-safe-area-context';
3
2
  import { useIndexCounter } from '@coinbase/cds-common/hooks/useIndexCounter';
4
3
  import { svgs } from '@coinbase/cds-common/internal/data/assets';
5
4
  import { Button } from '../../buttons';
@@ -173,10 +172,8 @@ const DynamicItemsExample = () => {
173
172
  });
174
173
  };
175
174
  const CarouselScreen = () => {
176
- return /*#__PURE__*/_jsx(SafeAreaProvider, {
177
- children: /*#__PURE__*/_jsxs(ExampleScreen, {
178
- children: [/*#__PURE__*/_jsx(ProgressBarsExample, {}), /*#__PURE__*/_jsx(DynamicItemsExample, {}), /*#__PURE__*/_jsx(SimpleExample, {}), /*#__PURE__*/_jsx(UpdateOnMountExample, {}), /*#__PURE__*/_jsx(TriggerViaButton, {})]
179
- })
175
+ return /*#__PURE__*/_jsxs(ExampleScreen, {
176
+ children: [/*#__PURE__*/_jsx(ProgressBarsExample, {}), /*#__PURE__*/_jsx(DynamicItemsExample, {}), /*#__PURE__*/_jsx(SimpleExample, {}), /*#__PURE__*/_jsx(UpdateOnMountExample, {}), /*#__PURE__*/_jsx(TriggerViaButton, {})]
180
177
  });
181
178
  };
182
179
  export default CarouselScreen;
@@ -3,7 +3,7 @@ import { View } from 'react-native';
3
3
  import { Banner } from '../../banner/Banner';
4
4
  import { Button, ButtonGroup } from '../../buttons';
5
5
  import { TextInput } from '../../controls';
6
- import { ExampleScreen } from '../../examples/ExampleScreen';
6
+ import { Example, ExampleScreen } from '../../examples/ExampleScreen';
7
7
  import { useSafeBottomPadding } from '../../hooks/useSafeBottomPadding';
8
8
  import { useTheme } from '../../hooks/useTheme';
9
9
  import { Box, HStack, VStack } from '../../layout';
@@ -220,10 +220,13 @@ const NumpadExample2 = () => {
220
220
  };
221
221
  const NumpadScreen = () => {
222
222
  return /*#__PURE__*/_jsx(ExampleScreen, {
223
- children: /*#__PURE__*/_jsxs(VStack, {
224
- gap: 2,
225
- padding: 2,
226
- children: [/*#__PURE__*/_jsx(NumpadExample1, {}), /*#__PURE__*/_jsx(NumpadExample2, {})]
223
+ children: /*#__PURE__*/_jsx(Example, {
224
+ title: "Numpad Examples",
225
+ children: /*#__PURE__*/_jsxs(VStack, {
226
+ gap: 2,
227
+ padding: 2,
228
+ children: [/*#__PURE__*/_jsx(NumpadExample1, {}), /*#__PURE__*/_jsx(NumpadExample2, {})]
229
+ })
227
230
  })
228
231
  });
229
232
  };
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
- import { View } from 'react-native';
3
2
  import { NoopFn } from '@coinbase/cds-common/utils/mockUtils';
4
3
  import { Button, ButtonGroup } from '../../buttons';
5
- import { ExampleScreen } from '../../examples/ExampleScreen';
4
+ import { Example, ExampleScreen } from '../../examples/ExampleScreen';
6
5
  import { Icon } from '../../icons';
7
6
  import { Divider } from '../../layout';
8
7
  import { PageFooter } from '../PageFooter';
@@ -41,8 +40,10 @@ const exampleProps = {
41
40
  })
42
41
  };
43
42
  const PageFooterScreen = () => {
44
- return /*#__PURE__*/_jsx(View, {
45
- children: /*#__PURE__*/_jsxs(ExampleScreen, {
43
+ return /*#__PURE__*/_jsx(ExampleScreen, {
44
+ paddingX: 0,
45
+ children: /*#__PURE__*/_jsxs(Example, {
46
+ gap: 0,
46
47
  children: [/*#__PURE__*/_jsx(PageFooter, {
47
48
  action: exampleProps.endButton,
48
49
  background: "bgPrimaryWash"
@@ -1,11 +1,10 @@
1
1
  import React from 'react';
2
- import { View } from 'react-native';
3
2
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
4
3
  import { NoopFn } from '@coinbase/cds-common/utils/mockUtils';
5
4
  import { Button, ButtonGroup } from '../../buttons';
6
- import { ExampleScreen } from '../../examples/ExampleScreen';
5
+ import { Example, ExampleScreen } from '../../examples/ExampleScreen';
7
6
  import { Icon } from '../../icons';
8
- import { VStack } from '../../layout';
7
+ import { Box, VStack } from '../../layout';
9
8
  import { Text } from '../../typography/Text';
10
9
  import { PageFooter } from '../PageFooter';
11
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -50,13 +49,15 @@ const exampleProps = {
50
49
  };
51
50
  const PageFooterInPageScreen = () => {
52
51
  const inset = useSafeAreaInsets();
53
- return /*#__PURE__*/_jsxs(View, {
54
- children: [/*#__PURE__*/_jsx(ExampleScreen, {
55
- children: /*#__PURE__*/_jsx(VStack, {
52
+ return /*#__PURE__*/_jsx(ExampleScreen, {
53
+ paddingX: 0,
54
+ children: /*#__PURE__*/_jsxs(Example, {
55
+ hideDivider: true,
56
+ height: "100%",
57
+ children: [/*#__PURE__*/_jsx(VStack, {
56
58
  alignContent: "center",
57
59
  alignItems: "center",
58
60
  dangerouslySetBackground: "#FADADD",
59
- flexGrow: 1,
60
61
  gap: 0,
61
62
  justifyContent: "center",
62
63
  left: 0,
@@ -65,18 +66,18 @@ const PageFooterInPageScreen = () => {
65
66
  font: "title1",
66
67
  children: "Primary Content"
67
68
  })
68
- })
69
- }), /*#__PURE__*/_jsx(View, {
70
- style: {
71
- position: 'absolute',
72
- bottom: inset.bottom / 2,
73
- left: 0,
74
- right: 0
75
- },
76
- children: /*#__PURE__*/_jsx(PageFooter, {
77
- action: exampleProps.endButtons2
78
- })
79
- })]
69
+ }), /*#__PURE__*/_jsx(Box, {
70
+ style: {
71
+ position: 'absolute',
72
+ bottom: inset.bottom / 2,
73
+ left: 0,
74
+ right: 0
75
+ },
76
+ children: /*#__PURE__*/_jsx(PageFooter, {
77
+ action: exampleProps.endButtons2
78
+ })
79
+ })]
80
+ })
80
81
  });
81
82
  };
82
83
  export default PageFooterInPageScreen;
@@ -1,10 +1,9 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
2
  import React from 'react';
3
- import { View } from 'react-native';
4
3
  import { assets } from '@coinbase/cds-common/internal/data/assets';
5
4
  import { NoopFn } from '@coinbase/cds-common/utils/mockUtils';
6
5
  import { Button, ButtonGroup, IconButton } from '../../buttons';
7
- import { ExampleScreen } from '../../examples/ExampleScreen';
6
+ import { Example, ExampleScreen } from '../../examples/ExampleScreen';
8
7
  import { useTheme } from '../../hooks/useTheme';
9
8
  import { LogoMark } from '../../icons';
10
9
  import { Box, Divider, HStack, VStack } from '../../layout';
@@ -137,8 +136,9 @@ const PageHeaderScreen = () => {
137
136
  paddingStart: theme.space[1.5]
138
137
  }
139
138
  };
140
- return /*#__PURE__*/_jsx(View, {
141
- children: /*#__PURE__*/_jsx(ExampleScreen, {
139
+ return /*#__PURE__*/_jsx(ExampleScreen, {
140
+ children: /*#__PURE__*/_jsx(Example, {
141
+ title: "PageHeader Variants",
142
142
  children: /*#__PURE__*/_jsxs(VStack, {
143
143
  gap: 3,
144
144
  children: [/*#__PURE__*/_jsx(PageHeader, {
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
- import { View } from 'react-native';
3
2
  import { assets } from '@coinbase/cds-common/internal/data/assets';
4
3
  import { NoopFn } from '@coinbase/cds-common/utils/mockUtils';
5
4
  import { IconButton } from '../../buttons';
6
- import { ExampleScreen } from '../../examples/ExampleScreen';
5
+ import { Example, ExampleScreen } from '../../examples/ExampleScreen';
7
6
  import { LogoMark } from '../../icons';
8
7
  import { SpotSquare } from '../../illustrations';
9
8
  import { Box, VStack } from '../../layout';
@@ -31,8 +30,11 @@ const exampleProps = {
31
30
  })
32
31
  };
33
32
  const PageHeaderInErrorEmptyState = () => {
34
- return /*#__PURE__*/_jsx(View, {
35
- children: /*#__PURE__*/_jsx(ExampleScreen, {
33
+ return /*#__PURE__*/_jsx(ExampleScreen, {
34
+ children: /*#__PURE__*/_jsx(Example, {
35
+ hideDivider: true,
36
+ height: "100%",
37
+ title: "Error/Empty State",
36
38
  children: /*#__PURE__*/_jsxs(VStack, {
37
39
  gap: 0,
38
40
  width: "100%",
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
- import { View } from 'react-native';
3
2
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
4
3
  import { NoopFn } from '@coinbase/cds-common/utils/mockUtils';
5
4
  import { Button, ButtonGroup, IconButton } from '../../buttons';
6
- import { ExampleScreen } from '../../examples/ExampleScreen';
7
- import { VStack } from '../../layout';
5
+ import { Example, ExampleScreen } from '../../examples/ExampleScreen';
6
+ import { Box, VStack } from '../../layout';
8
7
  import { Text } from '../../typography/Text';
9
8
  import { PageFooter } from '../PageFooter';
10
9
  import { PageHeader } from '../PageHeader';
@@ -33,9 +32,12 @@ const exampleProps = {
33
32
  };
34
33
  const PageHeaderInPage = () => {
35
34
  const inset = useSafeAreaInsets();
36
- return /*#__PURE__*/_jsxs(View, {
37
- children: [/*#__PURE__*/_jsx(ExampleScreen, {
38
- children: /*#__PURE__*/_jsxs(VStack, {
35
+ return /*#__PURE__*/_jsx(ExampleScreen, {
36
+ paddingX: 0,
37
+ children: /*#__PURE__*/_jsxs(Example, {
38
+ hideDivider: true,
39
+ height: "100%",
40
+ children: [/*#__PURE__*/_jsxs(VStack, {
39
41
  gap: 0,
40
42
  width: "100%",
41
43
  children: [/*#__PURE__*/_jsx(PageHeader, {
@@ -62,18 +64,18 @@ const PageHeaderInPage = () => {
62
64
  children: "Primary Content"
63
65
  })
64
66
  })]
65
- })
66
- }), /*#__PURE__*/_jsx(View, {
67
- style: {
68
- position: 'absolute',
69
- bottom: inset.bottom / 2,
70
- left: 0,
71
- right: 0
72
- },
73
- children: /*#__PURE__*/_jsx(PageFooter, {
74
- action: exampleProps.endButtons
75
- })
76
- })]
67
+ }), /*#__PURE__*/_jsx(Box, {
68
+ style: {
69
+ position: 'absolute',
70
+ bottom: inset.bottom / 2,
71
+ left: 0,
72
+ right: 0
73
+ },
74
+ children: /*#__PURE__*/_jsx(PageFooter, {
75
+ action: exampleProps.endButtons
76
+ })
77
+ })]
78
+ })
77
79
  });
78
80
  };
79
81
  export default PageHeaderInPage;
@@ -1,12 +1,11 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
2
  import React, { useState } from 'react';
3
- import { View } from 'react-native';
4
3
  import { assets } from '@coinbase/cds-common/internal/data/assets';
5
4
  import { NoopFn } from '@coinbase/cds-common/utils/mockUtils';
6
5
  import { Button, IconButton } from '../../buttons';
7
6
  import { SelectChip } from '../../chips/SelectChip';
8
7
  import { SearchInput, SelectOption } from '../../controls';
9
- import { ExampleScreen } from '../../examples/ExampleScreen';
8
+ import { Example, ExampleScreen } from '../../examples/ExampleScreen';
10
9
  import { Icon } from '../../icons';
11
10
  import { Divider, HStack } from '../../layout';
12
11
  import { RemoteImage } from '../../media';
@@ -62,8 +61,9 @@ const SelectChipDropdown = () => {
62
61
  });
63
62
  };
64
63
  const SectionHeaderScreen = () => {
65
- return /*#__PURE__*/_jsx(View, {
66
- children: /*#__PURE__*/_jsxs(ExampleScreen, {
64
+ return /*#__PURE__*/_jsx(ExampleScreen, {
65
+ children: /*#__PURE__*/_jsxs(Example, {
66
+ title: "SectionHeader Variants",
67
67
  children: [/*#__PURE__*/_jsx(SectionHeader, {
68
68
  title: "SectionHeader"
69
69
  }), /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(SectionHeader, _extends({}, defaultProps, {
@@ -12,14 +12,12 @@ const StickyFooterScreen = () => {
12
12
  setShowStickyFooter(!showStickyFooter);
13
13
  }, [showStickyFooter]);
14
14
  const inset = useSafeAreaInsets();
15
- return /*#__PURE__*/_jsxs(View, {
16
- children: [/*#__PURE__*/_jsx(ExampleScreen, {
17
- children: /*#__PURE__*/_jsx(Example, {
18
- title: "StickyFooter with Screen",
19
- children: /*#__PURE__*/_jsx(Button, {
20
- onPress: handleButtonPress,
21
- children: showStickyFooter ? 'Close' : 'Open'
22
- })
15
+ return /*#__PURE__*/_jsxs(ExampleScreen, {
16
+ children: [/*#__PURE__*/_jsx(Example, {
17
+ title: "StickyFooter with Screen",
18
+ children: /*#__PURE__*/_jsx(Button, {
19
+ onPress: handleButtonPress,
20
+ children: showStickyFooter ? 'Close' : 'Open'
23
21
  })
24
22
  }), showStickyFooter && /*#__PURE__*/_jsx(View, {
25
23
  style: {
@@ -1,6 +1,5 @@
1
1
  import React, { useCallback, useMemo, useRef, useState } from 'react';
2
2
  import { Button as NativeButton, Image } from 'react-native';
3
- import { ScrollView } from 'react-native-gesture-handler';
4
3
  import { ethBackground } from '@coinbase/cds-common/internal/data/assets';
5
4
  import { useTourContext } from '@coinbase/cds-common/tour/TourContext';
6
5
  import { Button } from '../../buttons';
@@ -250,171 +249,19 @@ const TourStory = () => {
250
249
  });
251
250
  }
252
251
  }], []);
253
- return /*#__PURE__*/_jsx(Tour, {
254
- activeTourStep: activeTourStep,
255
- onChange: setActiveTourStep,
256
- steps: tourSteps,
257
- children: /*#__PURE__*/_jsx(ScrollView, {
258
- ref: scrollViewRef,
259
- style: {
260
- flex: 1
261
- },
262
- children: /*#__PURE__*/_jsx(ExampleScreen, {
263
- children: /*#__PURE__*/_jsx(Example, {
264
- children: /*#__PURE__*/_jsx(TourExamples, {
265
- ids: ['step1', 'step2', 'step3', 'step4'],
266
- step2Ref: step2Ref,
267
- step3Ref: step3Ref,
268
- step4Ref: step4Ref
269
- })
270
- })
271
- })
272
- })
273
- });
274
- };
275
- export const TourWithStringLiteralIdStory = () => {
276
- const [activeTourStep, setActiveTourStep] = useState(null);
277
- const scrollViewRef = useRef(null);
278
- const step2Ref = useRef(null);
279
- const step3Ref = useRef(null);
280
- const step4Ref = useRef(null);
281
- const complexIdTourSteps = useMemo(() => [{
282
- id: 'step-id-1',
283
- onBeforeActive: () => console.log('step1 before'),
284
- Component: StepOne
285
- }, {
286
- id: 'step-id-2',
287
- arrowColor: 'yellow',
288
- onBeforeActive: async () => {
289
- console.log('step2 before');
290
- await scrollIntoView(scrollViewRef, step2Ref);
291
- },
292
- Component: () => {
293
- const {
294
- goNextTourStep,
295
- stopTour
296
- } = useTourContext();
297
- return /*#__PURE__*/_jsx(Coachmark, {
298
- action: /*#__PURE__*/_jsx(Button, {
299
- compact: true,
300
- onPress: goNextTourStep,
301
- variant: "secondary",
302
- children: "Next"
303
- }),
304
- closeButtonAccessibilityLabel: "Close",
305
- content: /*#__PURE__*/_jsxs(VStack, {
306
- gap: 2,
307
- children: [/*#__PURE__*/_jsx(Text, {
308
- color: "fgMuted",
309
- font: "caption",
310
- children: "50%"
311
- }), /*#__PURE__*/_jsx(ProgressBar, {
312
- progress: 0.5
313
- }), /*#__PURE__*/_jsx(Text, {
314
- font: "body",
315
- children: "Add up to 3 lines of body copy. Deliver your message with clarity and impact"
316
- })]
317
- }),
318
- media: /*#__PURE__*/_jsx(Image, {
319
- accessibilityIgnoresInvertColors: true,
320
- source: {
321
- uri: ethBackground
322
- },
323
- style: {
324
- width: '100%',
325
- height: 150
326
- }
327
- }),
328
- onClose: stopTour,
329
- title: "My second step"
330
- });
331
- }
332
- }, {
333
- id: 'step-id-3',
334
- onBeforeActive: async () => {
335
- console.log('step3 before');
336
- await scrollIntoView(scrollViewRef, step3Ref);
337
- },
338
- Component: () => {
339
- const {
340
- stopTour,
341
- goNextTourStep,
342
- goPreviousTourStep
343
- } = useTourContext();
344
- return /*#__PURE__*/_jsx(Coachmark, {
345
- action: /*#__PURE__*/_jsxs(HStack, {
346
- gap: 1,
347
- children: [/*#__PURE__*/_jsx(Button, {
348
- compact: true,
349
- onPress: goPreviousTourStep,
350
- variant: "secondary",
351
- children: "Back"
352
- }), /*#__PURE__*/_jsx(Button, {
353
- compact: true,
354
- onPress: goNextTourStep,
355
- variant: "secondary",
356
- children: "Next"
357
- }), /*#__PURE__*/_jsx(Button, {
358
- compact: true,
359
- onPress: stopTour,
360
- variant: "secondary",
361
- children: "Done"
362
- })]
363
- }),
364
- content: "Add up to 3 lines of body copy. Deliver your message with clarity and impact",
365
- title: "My third step",
366
- width: 350
367
- });
368
- }
369
- }, {
370
- id: 'step-id-4',
371
- onBeforeActive: async () => {
372
- console.log('step4 before');
373
- await scrollIntoView(scrollViewRef, step4Ref);
374
- },
375
- Component: () => {
376
- const {
377
- stopTour,
378
- goPreviousTourStep
379
- } = useTourContext();
380
- return /*#__PURE__*/_jsx(Coachmark, {
381
- action: /*#__PURE__*/_jsxs(HStack, {
382
- gap: 1,
383
- children: [/*#__PURE__*/_jsx(Button, {
384
- compact: true,
385
- onPress: goPreviousTourStep,
386
- variant: "secondary",
387
- children: "Back"
388
- }), /*#__PURE__*/_jsx(Button, {
389
- compact: true,
390
- onPress: stopTour,
391
- variant: "secondary",
392
- children: "Done"
393
- })]
394
- }),
395
- content: "Add up to 3 lines of body copy. Deliver your message with clarity and impact",
396
- title: "My last step",
397
- width: 250
398
- });
399
- }
400
- }], []);
401
- return /*#__PURE__*/_jsx(Tour, {
402
- activeTourStep: activeTourStep,
403
- onChange: setActiveTourStep,
404
- steps: complexIdTourSteps,
405
- children: /*#__PURE__*/_jsx(ScrollView, {
406
- ref: scrollViewRef,
407
- style: {
408
- flex: 1
409
- },
410
- children: /*#__PURE__*/_jsx(ExampleScreen, {
411
- children: /*#__PURE__*/_jsx(Example, {
412
- children: /*#__PURE__*/_jsx(TourExamples, {
413
- ids: complexIdTourSteps.map(s => s.id),
414
- step2Ref: step2Ref,
415
- step3Ref: step3Ref,
416
- step4Ref: step4Ref
417
- })
252
+ return /*#__PURE__*/_jsx(ExampleScreen, {
253
+ ref: scrollViewRef,
254
+ children: /*#__PURE__*/_jsx(Example, {
255
+ title: "Tour Example",
256
+ children: /*#__PURE__*/_jsx(Tour, {
257
+ activeTourStep: activeTourStep,
258
+ onChange: setActiveTourStep,
259
+ steps: tourSteps,
260
+ children: /*#__PURE__*/_jsx(TourExamples, {
261
+ ids: ['step1', 'step2', 'step3', 'step4'],
262
+ step2Ref: step2Ref,
263
+ step3Ref: step3Ref,
264
+ step4Ref: step4Ref
418
265
  })
419
266
  })
420
267
  })
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { TextBody } from '../TextBody';
3
3
  import TextExamplesScreen from './TextExamples';
4
+
5
+ // eslint-disable-next-line internal/example-screen-default
4
6
  import { jsx as _jsx } from "react/jsx-runtime";
5
7
  export default () => /*#__PURE__*/_jsx(TextExamplesScreen, {
6
8
  component: TextBody
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { TextCaption } from '../TextCaption';
3
3
  import TextExamplesScreen from './TextExamples';
4
+
5
+ // eslint-disable-next-line internal/example-screen-default
4
6
  import { jsx as _jsx } from "react/jsx-runtime";
5
7
  export default () => /*#__PURE__*/_jsx(TextExamplesScreen, {
6
8
  component: TextCaption
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { Text } from '../Text';
3
3
  import TextExamplesScreen from './TextExamples';
4
+
5
+ // eslint-disable-next-line internal/example-screen-default
4
6
  import { jsx as _jsx } from "react/jsx-runtime";
5
7
  export default () => /*#__PURE__*/_jsx(TextExamplesScreen, {
6
8
  component: Text