@ornikar/kitt-universal 27.4.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.
- package/AGENTS.md +30 -0
- package/CHANGELOG.md +28 -0
- package/dist/definitions/CardModal/CardModalAnimation/CardModalAnimation.web.d.ts.map +1 -1
- package/dist/definitions/DialogModal/DialogModalAnimation/DialogModalAnimation.web.d.ts.map +1 -1
- package/dist/definitions/FullscreenModal/FullscreenModalAnimation.web.d.ts.map +1 -1
- package/dist/definitions/GoogleMapsAutocompleteProvider/GoogleMapsAutocompleteProvider.d.ts.map +1 -1
- package/dist/definitions/MapMarker/MapMarker.d.ts +2 -5
- package/dist/definitions/MapMarker/MapMarker.d.ts.map +1 -1
- package/dist/definitions/MapMarker/constants.d.ts +6 -0
- package/dist/definitions/MapMarker/constants.d.ts.map +1 -0
- package/dist/definitions/MapMarker/utils/getBackgroundColor.d.ts +2 -1
- package/dist/definitions/MapMarker/utils/getBackgroundColor.d.ts.map +1 -1
- package/dist/definitions/Picker/Picker.web.d.ts.map +1 -1
- package/dist/definitions/TabBar/TabBar.d.ts +6 -4
- package/dist/definitions/TabBar/TabBar.d.ts.map +1 -1
- package/dist/definitions/TabBar/TabBarItem.d.ts +11 -1
- package/dist/definitions/TabBar/TabBarItem.d.ts.map +1 -1
- package/dist/definitions/TimePicker/TimePicker.web.d.ts.map +1 -1
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +180 -12
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +1 -12
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/cardModal.d.ts +21 -4
- package/dist/definitions/themes/late-ocean/cardModal.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/dialogModal.d.ts +21 -4
- package/dist/definitions/themes/late-ocean/dialogModal.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/fullscreenModal.d.ts +21 -4
- package/dist/definitions/themes/late-ocean/fullscreenModal.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/icon.d.ts +0 -20
- package/dist/definitions/themes/late-ocean/icon.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/shadows.d.ts +4 -2
- package/dist/definitions/themes/late-ocean/shadows.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/skeleton.d.ts +2 -1
- package/dist/definitions/themes/late-ocean/skeleton.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/tabBar.d.ts +34 -0
- package/dist/definitions/themes/late-ocean/tabBar.d.ts.map +1 -0
- package/dist/definitions/typography/Typography.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyIcon.d.ts.map +1 -1
- package/dist/definitions/typography/utils/getTypographyFamily.d.ts +2 -1
- package/dist/definitions/typography/utils/getTypographyFamily.d.ts.map +1 -1
- package/dist/index-metro.es.android.js +665 -289
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +665 -289
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-22.17.cjs.js +555 -178
- package/dist/index-node-22.17.cjs.js.map +1 -1
- package/dist/index-node-22.17.cjs.web.css +2 -2
- package/dist/index-node-22.17.cjs.web.js +522 -172
- package/dist/index-node-22.17.cjs.web.js.map +1 -1
- package/dist/index-node-22.17.es.mjs +555 -178
- package/dist/index-node-22.17.es.mjs.map +1 -1
- package/dist/index-node-22.17.es.web.css +2 -2
- package/dist/index-node-22.17.es.web.mjs +522 -172
- package/dist/index-node-22.17.es.web.mjs.map +1 -1
- package/dist/index.es.js +664 -316
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +641 -284
- package/dist/index.es.web.js.map +1 -1
- package/dist/linaria-themes-metro.es.android.js +219 -46
- package/dist/linaria-themes-metro.es.android.js.map +1 -1
- package/dist/linaria-themes-metro.es.ios.js +219 -46
- package/dist/linaria-themes-metro.es.ios.js.map +1 -1
- package/dist/linaria-themes-node-22.17.cjs.js +219 -46
- package/dist/linaria-themes-node-22.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-22.17.cjs.web.js +219 -46
- package/dist/linaria-themes-node-22.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-node-22.17.es.mjs +219 -46
- package/dist/linaria-themes-node-22.17.es.mjs.map +1 -1
- package/dist/linaria-themes-node-22.17.es.web.mjs +219 -46
- package/dist/linaria-themes-node-22.17.es.web.mjs.map +1 -1
- package/dist/linaria-themes.es.js +219 -46
- package/dist/linaria-themes.es.js.map +1 -1
- package/dist/linaria-themes.es.web.js +219 -46
- package/dist/linaria-themes.es.web.js.map +1 -1
- package/dist/styles.css +2 -2
- package/dist/tsbuildinfo +1 -1
- package/package.json +2 -2
- package/scripts/codemods/__testfixtures__/card-modal/basic.input.js +19 -0
- package/scripts/codemods/__testfixtures__/card-modal/basic.output.js +15 -0
- package/scripts/codemods/__testfixtures__/card-modal/withExpressions.input.js +23 -0
- package/scripts/codemods/__testfixtures__/card-modal/withExpressions.output.js +19 -0
- package/scripts/codemods/__testfixtures__/card-modal/wrongOrder.input.js +19 -0
- package/scripts/codemods/__testfixtures__/card-modal/wrongOrder.output.js +15 -0
- package/scripts/codemods/__testfixtures__/csf1-csf2/decorator.input.tsx +11 -0
- package/scripts/codemods/__testfixtures__/csf1-csf2/decorator.output.tsx +17 -0
- package/scripts/codemods/__testfixtures__/csf1-csf2/default.input.tsx +88 -0
- package/scripts/codemods/__testfixtures__/csf1-csf2/default.output.tsx +94 -0
- package/scripts/codemods/__testfixtures__/csf1-csf2/parameters.input.tsx +21 -0
- package/scripts/codemods/__testfixtures__/csf1-csf2/parameters.output.tsx +28 -0
- package/scripts/codemods/__testfixtures__/fullscreen-modal/basic.input.js +19 -0
- package/scripts/codemods/__testfixtures__/fullscreen-modal/basic.output.js +15 -0
- package/scripts/codemods/__testfixtures__/fullscreen-modal/withExpressions.input.js +23 -0
- package/scripts/codemods/__testfixtures__/fullscreen-modal/withExpressions.output.js +19 -0
- package/scripts/codemods/__testfixtures__/fullscreen-modal/wrongOrder.input.js +19 -0
- package/scripts/codemods/__testfixtures__/fullscreen-modal/wrongOrder.output.js +15 -0
- package/scripts/codemods/__testfixtures__/navigation-modal/basic.input.js +19 -0
- package/scripts/codemods/__testfixtures__/navigation-modal/basic.output.js +15 -0
- package/scripts/codemods/__testfixtures__/navigation-modal/withExpressions.input.js +23 -0
- package/scripts/codemods/__testfixtures__/navigation-modal/withExpressions.output.js +19 -0
- package/scripts/codemods/__testfixtures__/navigation-modal/wrongOrder.input.js +19 -0
- package/scripts/codemods/__testfixtures__/navigation-modal/wrongOrder.output.js +15 -0
- package/scripts/codemods/__tests__/card-modal.test.js +10 -0
- package/scripts/codemods/__tests__/csf1-csf2.test.ts +10 -0
- package/scripts/codemods/__tests__/fullscreen-modal.test.js +10 -0
- package/scripts/codemods/__tests__/navigation-modal.test.js +10 -0
- package/scripts/codemods/card-modal.js +155 -0
- package/scripts/codemods/csf1-csf2.js +257 -0
- package/scripts/codemods/fullscreen-modal.js +155 -0
- package/scripts/codemods/navigation-modal.js +155 -0
- package/scripts/{run-transformers.js → run-codemods.js} +30 -32
- 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.
|
|
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-
|
|
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
|
+
});
|