@ornikar/kitt-universal 27.5.0 → 27.5.1-canary.3a59d4ae3422049417956fa37f27d2e8f5f84aba.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 (86) hide show
  1. package/AGENTS.md +30 -0
  2. package/CHANGELOG.md +18 -0
  3. package/dist/definitions/TabBar/TabBar.d.ts +6 -4
  4. package/dist/definitions/TabBar/TabBar.d.ts.map +1 -1
  5. package/dist/definitions/TabBar/TabBarItem.d.ts +11 -1
  6. package/dist/definitions/TabBar/TabBarItem.d.ts.map +1 -1
  7. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +180 -12
  8. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
  9. package/dist/definitions/themes/default.d.ts +1 -12
  10. package/dist/definitions/themes/default.d.ts.map +1 -1
  11. package/dist/definitions/themes/late-ocean/icon.d.ts +0 -20
  12. package/dist/definitions/themes/late-ocean/icon.d.ts.map +1 -1
  13. package/dist/definitions/themes/late-ocean/tabBar.d.ts +34 -0
  14. package/dist/definitions/themes/late-ocean/tabBar.d.ts.map +1 -0
  15. package/dist/definitions/typography/Typography.d.ts.map +1 -1
  16. package/dist/definitions/typography/TypographyIcon.d.ts.map +1 -1
  17. package/dist/definitions/typography/utils/getTypographyFamily.d.ts +2 -1
  18. package/dist/definitions/typography/utils/getTypographyFamily.d.ts.map +1 -1
  19. package/dist/index-metro.es.android.js +565 -250
  20. package/dist/index-metro.es.android.js.map +1 -1
  21. package/dist/index-metro.es.ios.js +565 -250
  22. package/dist/index-metro.es.ios.js.map +1 -1
  23. package/dist/index-node-22.17.cjs.js +456 -140
  24. package/dist/index-node-22.17.cjs.js.map +1 -1
  25. package/dist/index-node-22.17.cjs.web.js +457 -141
  26. package/dist/index-node-22.17.cjs.web.js.map +1 -1
  27. package/dist/index-node-22.17.es.mjs +456 -140
  28. package/dist/index-node-22.17.es.mjs.map +1 -1
  29. package/dist/index-node-22.17.es.web.mjs +457 -141
  30. package/dist/index-node-22.17.es.web.mjs.map +1 -1
  31. package/dist/index.es.js +567 -242
  32. package/dist/index.es.js.map +1 -1
  33. package/dist/index.es.web.js +566 -241
  34. package/dist/index.es.web.js.map +1 -1
  35. package/dist/linaria-themes-metro.es.android.js +179 -36
  36. package/dist/linaria-themes-metro.es.android.js.map +1 -1
  37. package/dist/linaria-themes-metro.es.ios.js +179 -36
  38. package/dist/linaria-themes-metro.es.ios.js.map +1 -1
  39. package/dist/linaria-themes-node-22.17.cjs.js +179 -36
  40. package/dist/linaria-themes-node-22.17.cjs.js.map +1 -1
  41. package/dist/linaria-themes-node-22.17.cjs.web.js +179 -36
  42. package/dist/linaria-themes-node-22.17.cjs.web.js.map +1 -1
  43. package/dist/linaria-themes-node-22.17.es.mjs +179 -36
  44. package/dist/linaria-themes-node-22.17.es.mjs.map +1 -1
  45. package/dist/linaria-themes-node-22.17.es.web.mjs +179 -36
  46. package/dist/linaria-themes-node-22.17.es.web.mjs.map +1 -1
  47. package/dist/linaria-themes.es.js +179 -36
  48. package/dist/linaria-themes.es.js.map +1 -1
  49. package/dist/linaria-themes.es.web.js +179 -36
  50. package/dist/linaria-themes.es.web.js.map +1 -1
  51. package/dist/tsbuildinfo +1 -1
  52. package/package.json +2 -2
  53. package/scripts/codemods/__testfixtures__/card-modal/basic.input.js +19 -0
  54. package/scripts/codemods/__testfixtures__/card-modal/basic.output.js +15 -0
  55. package/scripts/codemods/__testfixtures__/card-modal/withExpressions.input.js +23 -0
  56. package/scripts/codemods/__testfixtures__/card-modal/withExpressions.output.js +19 -0
  57. package/scripts/codemods/__testfixtures__/card-modal/wrongOrder.input.js +19 -0
  58. package/scripts/codemods/__testfixtures__/card-modal/wrongOrder.output.js +15 -0
  59. package/scripts/codemods/__testfixtures__/csf1-csf2/decorator.input.tsx +11 -0
  60. package/scripts/codemods/__testfixtures__/csf1-csf2/decorator.output.tsx +17 -0
  61. package/scripts/codemods/__testfixtures__/csf1-csf2/default.input.tsx +88 -0
  62. package/scripts/codemods/__testfixtures__/csf1-csf2/default.output.tsx +94 -0
  63. package/scripts/codemods/__testfixtures__/csf1-csf2/parameters.input.tsx +21 -0
  64. package/scripts/codemods/__testfixtures__/csf1-csf2/parameters.output.tsx +28 -0
  65. package/scripts/codemods/__testfixtures__/fullscreen-modal/basic.input.js +19 -0
  66. package/scripts/codemods/__testfixtures__/fullscreen-modal/basic.output.js +15 -0
  67. package/scripts/codemods/__testfixtures__/fullscreen-modal/withExpressions.input.js +23 -0
  68. package/scripts/codemods/__testfixtures__/fullscreen-modal/withExpressions.output.js +19 -0
  69. package/scripts/codemods/__testfixtures__/fullscreen-modal/wrongOrder.input.js +19 -0
  70. package/scripts/codemods/__testfixtures__/fullscreen-modal/wrongOrder.output.js +15 -0
  71. package/scripts/codemods/__testfixtures__/navigation-modal/basic.input.js +19 -0
  72. package/scripts/codemods/__testfixtures__/navigation-modal/basic.output.js +15 -0
  73. package/scripts/codemods/__testfixtures__/navigation-modal/withExpressions.input.js +23 -0
  74. package/scripts/codemods/__testfixtures__/navigation-modal/withExpressions.output.js +19 -0
  75. package/scripts/codemods/__testfixtures__/navigation-modal/wrongOrder.input.js +19 -0
  76. package/scripts/codemods/__testfixtures__/navigation-modal/wrongOrder.output.js +15 -0
  77. package/scripts/codemods/__tests__/card-modal.test.js +10 -0
  78. package/scripts/codemods/__tests__/csf1-csf2.test.ts +10 -0
  79. package/scripts/codemods/__tests__/fullscreen-modal.test.js +10 -0
  80. package/scripts/codemods/__tests__/navigation-modal.test.js +10 -0
  81. package/scripts/codemods/card-modal.js +155 -0
  82. package/scripts/codemods/csf1-csf2.js +257 -0
  83. package/scripts/codemods/fullscreen-modal.js +155 -0
  84. package/scripts/codemods/navigation-modal.js +155 -0
  85. package/scripts/{run-transformers.js → run-codemods.js} +30 -32
  86. package/scripts/transformers/modals.js +0 -102
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ornikar/kitt-universal",
3
- "version": "27.5.0",
3
+ "version": "27.5.1-canary.3a59d4ae3422049417956fa37f27d2e8f5f84aba.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "directory": "@ornikar/kitt-universal",
@@ -72,7 +72,7 @@
72
72
  "./babel-plugin-csf-to-jest": "./babel-plugin-csf-to-jest.js"
73
73
  },
74
74
  "bin": {
75
- "run-transformers": "./scripts/run-transformers.js"
75
+ "run-codemods": "./scripts/run-codemods.js"
76
76
  },
77
77
  "engines": {
78
78
  "node": ">=22.17.0"
@@ -0,0 +1,19 @@
1
+ function Test() {
2
+ return (
3
+ <CardModal
4
+ header={<CardModal.Header title="With Header and Body" />}
5
+ body={
6
+ <CardModal.Body>
7
+ <LoremIpsum />
8
+ </CardModal.Body>
9
+ }
10
+ footer={
11
+ <CardModal.Footer shouldHandleBottomNotch={false}>
12
+ <Button stretch type="primary">
13
+ With Body and Footer
14
+ </Button>
15
+ </CardModal.Footer>
16
+ }
17
+ />
18
+ );
19
+ }
@@ -0,0 +1,15 @@
1
+ function Test() {
2
+ return (
3
+ <CardModal>
4
+ <CardModal.Header title="With Header and Body" />
5
+ <CardModal.Body>
6
+ <LoremIpsum />
7
+ </CardModal.Body>
8
+ <CardModal.Footer shouldHandleBottomNotch={false}>
9
+ <Button stretch type="primary">
10
+ With Body and Footer
11
+ </Button>
12
+ </CardModal.Footer>
13
+ </CardModal>
14
+ );
15
+ }
@@ -0,0 +1,23 @@
1
+ function Test() {
2
+ return (
3
+ <CardModal
4
+ header={shouldDisplayHeader ? <CardModal.Header title="With Header and Body" /> : null}
5
+ body={
6
+ shouldDisplayBody ? (
7
+ <View>
8
+ <LoremIpsum />
9
+ </View>
10
+ ) : null
11
+ }
12
+ footer={
13
+ shouldDisplayFooter ? (
14
+ <CardModal.Footer shouldHandleBottomNotch={false}>
15
+ <Button stretch type="primary">
16
+ With Body and Footer
17
+ </Button>
18
+ </CardModal.Footer>
19
+ ) : null
20
+ }
21
+ />
22
+ );
23
+ }
@@ -0,0 +1,19 @@
1
+ function Test() {
2
+ return (
3
+ <CardModal>
4
+ {shouldDisplayHeader ? <CardModal.Header title="With Header and Body" /> : null}
5
+ {shouldDisplayBody ? (
6
+ <View>
7
+ <LoremIpsum />
8
+ </View>
9
+ ) : null}
10
+ {shouldDisplayFooter ? (
11
+ <CardModal.Footer shouldHandleBottomNotch={false}>
12
+ <Button stretch type="primary">
13
+ With Body and Footer
14
+ </Button>
15
+ </CardModal.Footer>
16
+ ) : null}
17
+ </CardModal>
18
+ );
19
+ }
@@ -0,0 +1,19 @@
1
+ function Test() {
2
+ return (
3
+ <CardModal
4
+ footer={
5
+ <CardModal.Footer shouldHandleBottomNotch={false}>
6
+ <Button stretch type="primary">
7
+ With Body and Footer
8
+ </Button>
9
+ </CardModal.Footer>
10
+ }
11
+ header={<CardModal.Header title="With Header and Body" />}
12
+ body={
13
+ <CardModal.Body>
14
+ <LoremIpsum />
15
+ </CardModal.Body>
16
+ }
17
+ />
18
+ );
19
+ }
@@ -0,0 +1,15 @@
1
+ function Test() {
2
+ return (
3
+ <CardModal>
4
+ <CardModal.Header title="With Header and Body" />
5
+ <CardModal.Body>
6
+ <LoremIpsum />
7
+ </CardModal.Body>
8
+ <CardModal.Footer shouldHandleBottomNotch={false}>
9
+ <Button stretch type="primary">
10
+ With Body and Footer
11
+ </Button>
12
+ </CardModal.Footer>
13
+ </CardModal>
14
+ );
15
+ }
@@ -0,0 +1,11 @@
1
+ import { storiesOf } from '@storybook/react-native';
2
+ import {
3
+ NativeStoryDecorator,
4
+ AnotherDecorator,
5
+ } from '@ornikar/learner-apps-shared/src/storybook/decorators/NativeStoryDecorator';
6
+ import { NotificationEnablerScreenView } from './NotificationEnablerScreenView';
7
+
8
+ storiesOf('LNA/shared/components', module)
9
+ .addDecorator(NativeStoryDecorator)
10
+ .addDecorator(AnotherDecorator)
11
+ .add('NotificationEnablerScreen', () => <NotificationEnablerScreenView firstname="Michael" />);
@@ -0,0 +1,17 @@
1
+ import type { ComponentMeta, ComponentStory } from '@storybook/react-native';
2
+ import {
3
+ NativeStoryDecorator,
4
+ AnotherDecorator,
5
+ } from '@ornikar/learner-apps-shared/src/storybook/decorators/NativeStoryDecorator';
6
+ import { NotificationEnablerScreenView } from './NotificationEnablerScreenView';
7
+
8
+ export default {
9
+ title: 'LNA/shared/components',
10
+ component: NotificationEnablerScreenView,
11
+ decorators: [AnotherDecorator, NativeStoryDecorator],
12
+ } satisfies ComponentMeta<typeof NotificationEnablerScreenView>;
13
+
14
+ export const NotificationEnablerScreenStory: ComponentStory<typeof NotificationEnablerScreenView> = () => (
15
+ <NotificationEnablerScreenView firstname="Michael" />
16
+ );
17
+ NotificationEnablerScreenStory.storyName = 'NotificationEnablerScreen';
@@ -0,0 +1,88 @@
1
+ import { storiesOf } from '@storybook/react-native';
2
+ import { InfoRegularIcon } from '@ornikar/kitt-icons/phosphor';
3
+ import { HStack, IconButton, Story, StorySection, Typography, VStack } from '@ornikar/kitt-universal';
4
+ import type { ReactNode } from 'react';
5
+ import { useVisibility } from '../../hooks/useVisibility';
6
+ import { CustomTooltip } from './CustomTooltip';
7
+
8
+ function CustomTooltipWrapper(): ReactNode {
9
+ const { visible, toggle } = useVisibility(true);
10
+
11
+ return (
12
+ <Story title="CustomTooltip">
13
+ <StorySection title="Top (Default) | Right (Default)">
14
+ <CustomTooltip visible={visible} onTooltipPress={toggle}>
15
+ <Typography.Text>Press on this tooltip area to dismiss it.</Typography.Text>
16
+ </CustomTooltip>
17
+ <HStack paddingX="kitt.4" paddingY="kitt.2" space="kitt.2" alignItems="center" backgroundColor="kitt.amber.100">
18
+ <Typography.Text flexGrow={1}>Press the info button to toggle CustomTooltip.</Typography.Text>
19
+ <IconButton icon={<InfoRegularIcon />} onPress={toggle} />
20
+ </HStack>
21
+ </StorySection>
22
+
23
+ <StorySection title="Top | Center">
24
+ <CustomTooltip visible={visible} alignment="center" onTooltipPress={toggle}>
25
+ <Typography.Text>Press on this tooltip area to dismiss it.</Typography.Text>
26
+ </CustomTooltip>
27
+ <VStack paddingX="kitt.4" paddingY="kitt.2" space="kitt.2" alignItems="center" backgroundColor="kitt.amber.100">
28
+ <IconButton icon={<InfoRegularIcon />} onPress={toggle} />
29
+ <Typography.Text flexGrow={1}>Press the info button to toggle CustomTooltip.</Typography.Text>
30
+ </VStack>
31
+ </StorySection>
32
+
33
+ <StorySection title="Top | Left">
34
+ <CustomTooltip visible={visible} alignment="flex-start" onTooltipPress={toggle}>
35
+ <Typography.Text>Press on this tooltip area to dismiss it.</Typography.Text>
36
+ </CustomTooltip>
37
+ <HStack paddingX="kitt.4" paddingY="kitt.2" space="kitt.2" alignItems="center" backgroundColor="kitt.amber.100">
38
+ <IconButton icon={<InfoRegularIcon />} onPress={toggle} />
39
+ <Typography.Text flexGrow={1}>Press the info button to toggle CustomTooltip.</Typography.Text>
40
+ </HStack>
41
+ </StorySection>
42
+
43
+ <StorySection title="Bottom | Right (Default)">
44
+ <CustomTooltip visible={visible} position="bottom" positionOffset={56} onTooltipPress={toggle}>
45
+ <Typography.Text>Press on this tooltip area to dismiss it.</Typography.Text>
46
+ </CustomTooltip>
47
+ <HStack paddingX="kitt.4" paddingY="kitt.2" space="kitt.2" alignItems="center" backgroundColor="kitt.amber.100">
48
+ <Typography.Text flexGrow={1}>Press the info button to toggle CustomTooltip.</Typography.Text>
49
+ <IconButton icon={<InfoRegularIcon />} onPress={toggle} />
50
+ </HStack>
51
+ </StorySection>
52
+
53
+ <StorySection title="Bottom | Center">
54
+ <CustomTooltip
55
+ visible={visible}
56
+ position="bottom"
57
+ positionOffset={56}
58
+ alignment="center"
59
+ onTooltipPress={toggle}
60
+ >
61
+ <Typography.Text>Press on this tooltip area to dismiss it.</Typography.Text>
62
+ </CustomTooltip>
63
+ <VStack paddingX="kitt.4" paddingY="kitt.2" space="kitt.2" alignItems="center" backgroundColor="kitt.amber.100">
64
+ <IconButton icon={<InfoRegularIcon />} onPress={toggle} />
65
+ <Typography.Text flexGrow={1}>Press the info button to toggle CustomTooltip.</Typography.Text>
66
+ </VStack>
67
+ </StorySection>
68
+
69
+ <StorySection title="Bottom | Left">
70
+ <CustomTooltip
71
+ visible={visible}
72
+ position="bottom"
73
+ positionOffset={56}
74
+ alignment="flex-start"
75
+ onTooltipPress={toggle}
76
+ >
77
+ <Typography.Text>Press on this tooltip area to dismiss it.</Typography.Text>
78
+ </CustomTooltip>
79
+ <HStack paddingX="kitt.4" paddingY="kitt.2" space="kitt.2" alignItems="center" backgroundColor="kitt.amber.100">
80
+ <IconButton icon={<InfoRegularIcon />} onPress={toggle} />
81
+ <Typography.Text flexGrow={1}>Press the info button to toggle CustomTooltip.</Typography.Text>
82
+ </HStack>
83
+ </StorySection>
84
+ </Story>
85
+ );
86
+ }
87
+
88
+ storiesOf('LAS/shared/components', module).add('CustomTooltip', () => <CustomTooltipWrapper />);
@@ -0,0 +1,94 @@
1
+ import type { ComponentMeta, ComponentStory } from '@storybook/react-native';
2
+ import { InfoRegularIcon } from '@ornikar/kitt-icons/phosphor';
3
+ import { HStack, IconButton, Story, StorySection, Typography, VStack } from '@ornikar/kitt-universal';
4
+ import type { ReactNode } from 'react';
5
+ import { useVisibility } from '../../hooks/useVisibility';
6
+ import { CustomTooltip } from './CustomTooltip';
7
+
8
+ function CustomTooltipWrapper(): ReactNode {
9
+ const { visible, toggle } = useVisibility(true);
10
+
11
+ return (
12
+ <Story title="CustomTooltip">
13
+ <StorySection title="Top (Default) | Right (Default)">
14
+ <CustomTooltip visible={visible} onTooltipPress={toggle}>
15
+ <Typography.Text>Press on this tooltip area to dismiss it.</Typography.Text>
16
+ </CustomTooltip>
17
+ <HStack paddingX="kitt.4" paddingY="kitt.2" space="kitt.2" alignItems="center" backgroundColor="kitt.amber.100">
18
+ <Typography.Text flexGrow={1}>Press the info button to toggle CustomTooltip.</Typography.Text>
19
+ <IconButton icon={<InfoRegularIcon />} onPress={toggle} />
20
+ </HStack>
21
+ </StorySection>
22
+
23
+ <StorySection title="Top | Center">
24
+ <CustomTooltip visible={visible} alignment="center" onTooltipPress={toggle}>
25
+ <Typography.Text>Press on this tooltip area to dismiss it.</Typography.Text>
26
+ </CustomTooltip>
27
+ <VStack paddingX="kitt.4" paddingY="kitt.2" space="kitt.2" alignItems="center" backgroundColor="kitt.amber.100">
28
+ <IconButton icon={<InfoRegularIcon />} onPress={toggle} />
29
+ <Typography.Text flexGrow={1}>Press the info button to toggle CustomTooltip.</Typography.Text>
30
+ </VStack>
31
+ </StorySection>
32
+
33
+ <StorySection title="Top | Left">
34
+ <CustomTooltip visible={visible} alignment="flex-start" onTooltipPress={toggle}>
35
+ <Typography.Text>Press on this tooltip area to dismiss it.</Typography.Text>
36
+ </CustomTooltip>
37
+ <HStack paddingX="kitt.4" paddingY="kitt.2" space="kitt.2" alignItems="center" backgroundColor="kitt.amber.100">
38
+ <IconButton icon={<InfoRegularIcon />} onPress={toggle} />
39
+ <Typography.Text flexGrow={1}>Press the info button to toggle CustomTooltip.</Typography.Text>
40
+ </HStack>
41
+ </StorySection>
42
+
43
+ <StorySection title="Bottom | Right (Default)">
44
+ <CustomTooltip visible={visible} position="bottom" positionOffset={56} onTooltipPress={toggle}>
45
+ <Typography.Text>Press on this tooltip area to dismiss it.</Typography.Text>
46
+ </CustomTooltip>
47
+ <HStack paddingX="kitt.4" paddingY="kitt.2" space="kitt.2" alignItems="center" backgroundColor="kitt.amber.100">
48
+ <Typography.Text flexGrow={1}>Press the info button to toggle CustomTooltip.</Typography.Text>
49
+ <IconButton icon={<InfoRegularIcon />} onPress={toggle} />
50
+ </HStack>
51
+ </StorySection>
52
+
53
+ <StorySection title="Bottom | Center">
54
+ <CustomTooltip
55
+ visible={visible}
56
+ position="bottom"
57
+ positionOffset={56}
58
+ alignment="center"
59
+ onTooltipPress={toggle}
60
+ >
61
+ <Typography.Text>Press on this tooltip area to dismiss it.</Typography.Text>
62
+ </CustomTooltip>
63
+ <VStack paddingX="kitt.4" paddingY="kitt.2" space="kitt.2" alignItems="center" backgroundColor="kitt.amber.100">
64
+ <IconButton icon={<InfoRegularIcon />} onPress={toggle} />
65
+ <Typography.Text flexGrow={1}>Press the info button to toggle CustomTooltip.</Typography.Text>
66
+ </VStack>
67
+ </StorySection>
68
+
69
+ <StorySection title="Bottom | Left">
70
+ <CustomTooltip
71
+ visible={visible}
72
+ position="bottom"
73
+ positionOffset={56}
74
+ alignment="flex-start"
75
+ onTooltipPress={toggle}
76
+ >
77
+ <Typography.Text>Press on this tooltip area to dismiss it.</Typography.Text>
78
+ </CustomTooltip>
79
+ <HStack paddingX="kitt.4" paddingY="kitt.2" space="kitt.2" alignItems="center" backgroundColor="kitt.amber.100">
80
+ <IconButton icon={<InfoRegularIcon />} onPress={toggle} />
81
+ <Typography.Text flexGrow={1}>Press the info button to toggle CustomTooltip.</Typography.Text>
82
+ </HStack>
83
+ </StorySection>
84
+ </Story>
85
+ );
86
+ }
87
+
88
+ export default {
89
+ title: 'LAS/shared/components',
90
+ component: CustomTooltipWrapper,
91
+ } satisfies ComponentMeta<typeof CustomTooltipWrapper>;
92
+
93
+ export const CustomTooltipStory: ComponentStory<typeof CustomTooltipWrapper> = () => <CustomTooltipWrapper />;
94
+ CustomTooltipStory.storyName = 'CustomTooltip';
@@ -0,0 +1,21 @@
1
+ import { storiesOf } from '@storybook/react-native';
2
+ import { GestureHandlerRootView } from 'react-native-gesture-handler';
3
+ import { NativeStoryDecorator } from '@ornikar/learner-apps-shared/src/storybook/decorators/NativeStoryDecorator';
4
+ import { WelcomePageView } from './WelcomePageView';
5
+
6
+ storiesOf('Learner Native App/Authentication/Pages/WelcomePageView', module)
7
+ .addDecorator(NativeStoryDecorator)
8
+ .addParameters({
9
+ chromatic: { disable: true },
10
+ jest: {
11
+ createBeforeAfterEachCallbacks: () => ({
12
+ before: () => jest.useFakeTimers({ legacyFakeTimers: true }),
13
+ after: () => jest.useRealTimers(),
14
+ }),
15
+ },
16
+ })
17
+ .add('WelcomePageView', () => (
18
+ <GestureHandlerRootView>
19
+ <WelcomePageView topInset={60} bottomInset={0} />
20
+ </GestureHandlerRootView>
21
+ ));
@@ -0,0 +1,28 @@
1
+ import type { ComponentMeta, ComponentStory } from '@storybook/react-native';
2
+ import { GestureHandlerRootView } from 'react-native-gesture-handler';
3
+ import { NativeStoryDecorator } from '@ornikar/learner-apps-shared/src/storybook/decorators/NativeStoryDecorator';
4
+ import { WelcomePageView } from './WelcomePageView';
5
+
6
+ export default {
7
+ title: 'LNA/authentication/pages',
8
+ component: WelcomePageView,
9
+ decorators: [NativeStoryDecorator],
10
+
11
+ parameters: {
12
+ chromatic: { disable: true },
13
+ jest: {
14
+ createBeforeAfterEachCallbacks: () => ({
15
+ before: () => jest.useFakeTimers({ legacyFakeTimers: true }),
16
+ after: () => jest.useRealTimers(),
17
+ }),
18
+ },
19
+ },
20
+ } satisfies ComponentMeta<typeof WelcomePageView>;
21
+
22
+ export const WelcomePageStory: ComponentStory<typeof WelcomePageView> = () => (
23
+ <GestureHandlerRootView>
24
+ <WelcomePageView topInset={60} bottomInset={0} />
25
+ </GestureHandlerRootView>
26
+ );
27
+
28
+ WelcomePageStory.storyName = 'WelcomePage';
@@ -0,0 +1,19 @@
1
+ function Test() {
2
+ return (
3
+ <FullscreenModal
4
+ header={<FullscreenModal.Header title="With Header and Body" />}
5
+ body={
6
+ <FullscreenModal.Body>
7
+ <LoremIpsum />
8
+ </FullscreenModal.Body>
9
+ }
10
+ footer={
11
+ <FullscreenModal.Footer shouldHandleBottomNotch={false}>
12
+ <Button stretch type="primary">
13
+ With Body and Footer
14
+ </Button>
15
+ </FullscreenModal.Footer>
16
+ }
17
+ />
18
+ );
19
+ }
@@ -0,0 +1,15 @@
1
+ function Test() {
2
+ return (
3
+ <FullscreenModal>
4
+ <FullscreenModal.Header title="With Header and Body" />
5
+ <FullscreenModal.Body>
6
+ <LoremIpsum />
7
+ </FullscreenModal.Body>
8
+ <FullscreenModal.Footer shouldHandleBottomNotch={false}>
9
+ <Button stretch type="primary">
10
+ With Body and Footer
11
+ </Button>
12
+ </FullscreenModal.Footer>
13
+ </FullscreenModal>
14
+ );
15
+ }
@@ -0,0 +1,23 @@
1
+ function Test() {
2
+ return (
3
+ <FullscreenModal
4
+ header={shouldDisplayHeader ? <FullscreenModal.Header title="With Header and Body" /> : null}
5
+ body={
6
+ shouldDisplayBody ? (
7
+ <View>
8
+ <LoremIpsum />
9
+ </View>
10
+ ) : null
11
+ }
12
+ footer={
13
+ shouldDisplayFooter ? (
14
+ <FullscreenModal.Footer shouldHandleBottomNotch={false}>
15
+ <Button stretch type="primary">
16
+ With Body and Footer
17
+ </Button>
18
+ </FullscreenModal.Footer>
19
+ ) : null
20
+ }
21
+ />
22
+ );
23
+ }
@@ -0,0 +1,19 @@
1
+ function Test() {
2
+ return (
3
+ <FullscreenModal>
4
+ {shouldDisplayHeader ? <FullscreenModal.Header title="With Header and Body" /> : null}
5
+ {shouldDisplayBody ? (
6
+ <View>
7
+ <LoremIpsum />
8
+ </View>
9
+ ) : null}
10
+ {shouldDisplayFooter ? (
11
+ <FullscreenModal.Footer shouldHandleBottomNotch={false}>
12
+ <Button stretch type="primary">
13
+ With Body and Footer
14
+ </Button>
15
+ </FullscreenModal.Footer>
16
+ ) : null}
17
+ </FullscreenModal>
18
+ );
19
+ }
@@ -0,0 +1,19 @@
1
+ function Test() {
2
+ return (
3
+ <FullscreenModal
4
+ footer={
5
+ <FullscreenModal.Footer shouldHandleBottomNotch={false}>
6
+ <Button stretch type="primary">
7
+ With Body and Footer
8
+ </Button>
9
+ </FullscreenModal.Footer>
10
+ }
11
+ header={<FullscreenModal.Header title="With Header and Body" />}
12
+ body={
13
+ <FullscreenModal.Body>
14
+ <LoremIpsum />
15
+ </FullscreenModal.Body>
16
+ }
17
+ />
18
+ );
19
+ }
@@ -0,0 +1,15 @@
1
+ function Test() {
2
+ return (
3
+ <FullscreenModal>
4
+ <FullscreenModal.Header title="With Header and Body" />
5
+ <FullscreenModal.Body>
6
+ <LoremIpsum />
7
+ </FullscreenModal.Body>
8
+ <FullscreenModal.Footer shouldHandleBottomNotch={false}>
9
+ <Button stretch type="primary">
10
+ With Body and Footer
11
+ </Button>
12
+ </FullscreenModal.Footer>
13
+ </FullscreenModal>
14
+ );
15
+ }
@@ -0,0 +1,19 @@
1
+ function Test() {
2
+ return (
3
+ <NavigationModal
4
+ header={<NavigationModal.Header title="With Header and Body" />}
5
+ body={
6
+ <NavigationModal.Body>
7
+ <LoremIpsum />
8
+ </NavigationModal.Body>
9
+ }
10
+ footer={
11
+ <NavigationModal.Footer shouldHandleBottomNotch={false}>
12
+ <Button stretch type="primary">
13
+ With Body and Footer
14
+ </Button>
15
+ </NavigationModal.Footer>
16
+ }
17
+ />
18
+ );
19
+ }
@@ -0,0 +1,15 @@
1
+ function Test() {
2
+ return (
3
+ <NavigationModal>
4
+ <NavigationModal.Header title="With Header and Body" />
5
+ <NavigationModal.Body>
6
+ <LoremIpsum />
7
+ </NavigationModal.Body>
8
+ <NavigationModal.Footer shouldHandleBottomNotch={false}>
9
+ <Button stretch type="primary">
10
+ With Body and Footer
11
+ </Button>
12
+ </NavigationModal.Footer>
13
+ </NavigationModal>
14
+ );
15
+ }
@@ -0,0 +1,23 @@
1
+ function Test() {
2
+ return (
3
+ <NavigationModal
4
+ header={shouldDisplayHeader ? <NavigationModal.Header title="With Header and Body" /> : null}
5
+ body={
6
+ shouldDisplayBody ? (
7
+ <View>
8
+ <LoremIpsum />
9
+ </View>
10
+ ) : null
11
+ }
12
+ footer={
13
+ shouldDisplayFooter ? (
14
+ <NavigationModal.Footer shouldHandleBottomNotch={false}>
15
+ <Button stretch type="primary">
16
+ With Body and Footer
17
+ </Button>
18
+ </NavigationModal.Footer>
19
+ ) : null
20
+ }
21
+ />
22
+ );
23
+ }
@@ -0,0 +1,19 @@
1
+ function Test() {
2
+ return (
3
+ <NavigationModal>
4
+ {shouldDisplayHeader ? <NavigationModal.Header title="With Header and Body" /> : null}
5
+ {shouldDisplayBody ? (
6
+ <View>
7
+ <LoremIpsum />
8
+ </View>
9
+ ) : null}
10
+ {shouldDisplayFooter ? (
11
+ <NavigationModal.Footer shouldHandleBottomNotch={false}>
12
+ <Button stretch type="primary">
13
+ With Body and Footer
14
+ </Button>
15
+ </NavigationModal.Footer>
16
+ ) : null}
17
+ </NavigationModal>
18
+ );
19
+ }
@@ -0,0 +1,19 @@
1
+ function Test() {
2
+ return (
3
+ <NavigationModal
4
+ footer={
5
+ <NavigationModal.Footer shouldHandleBottomNotch={false}>
6
+ <Button stretch type="primary">
7
+ With Body and Footer
8
+ </Button>
9
+ </NavigationModal.Footer>
10
+ }
11
+ header={<NavigationModal.Header title="With Header and Body" />}
12
+ body={
13
+ <NavigationModal.Body>
14
+ <LoremIpsum />
15
+ </NavigationModal.Body>
16
+ }
17
+ />
18
+ );
19
+ }
@@ -0,0 +1,15 @@
1
+ function Test() {
2
+ return (
3
+ <NavigationModal>
4
+ <NavigationModal.Header title="With Header and Body" />
5
+ <NavigationModal.Body>
6
+ <LoremIpsum />
7
+ </NavigationModal.Body>
8
+ <NavigationModal.Footer shouldHandleBottomNotch={false}>
9
+ <Button stretch type="primary">
10
+ With Body and Footer
11
+ </Button>
12
+ </NavigationModal.Footer>
13
+ </NavigationModal>
14
+ );
15
+ }
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ jest.autoMockOff();
4
+ const { defineTest } = require('jscodeshift/dist/testUtils');
5
+
6
+ const tests = ['basic', 'withExpressions', 'wrongOrder'];
7
+
8
+ describe('CardModal', () => {
9
+ tests.forEach((test) => defineTest(__dirname, 'card-modal', null, `card-modal/${test}`));
10
+ });