@ornikar/kitt-universal 1.0.0 → 1.0.1
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/package.json +4 -4
- package/CHANGELOG.md +0 -8
- package/src/.eslintrc.json +0 -19
- package/src/Avatar/Avatar.stories.tsx +0 -45
- package/src/Avatar/Avatar.tsx +0 -60
- package/src/Avatar/__snapshots__/Avatar.stories.tsx.snap +0 -1229
- package/src/Button/Button.stories.tsx +0 -301
- package/src/Button/Button.tsx +0 -60
- package/src/Button/ButtonContainer.tsx +0 -32
- package/src/Button/ButtonContent.tsx +0 -133
- package/src/Button/__snapshots__/Button.stories.tsx.snap +0 -7483
- package/src/Button/useButton.ts +0 -14
- package/src/Card/Card.stories.tsx +0 -31
- package/src/Card/Card.tsx +0 -25
- package/src/Card/__snapshots__/Card.stories.tsx.snap +0 -306
- package/src/FullScreenModal/Body.tsx +0 -25
- package/src/FullScreenModal/FullScreenModal.stories.tsx +0 -63
- package/src/FullScreenModal/FullScreenModal.tsx +0 -21
- package/src/FullScreenModal/Header.tsx +0 -129
- package/src/FullScreenModal/__snapshots__/FullScreenModal.stories.tsx.snap +0 -771
- package/src/Icon/Icon.stories.tsx +0 -59
- package/src/Icon/Icon.tsx +0 -37
- package/src/Icon/SpinningIcon.tsx +0 -38
- package/src/Icon/SpinningIcon.web.module.css +0 -13
- package/src/Icon/SpinningIcon.web.module.css.d.ts +0 -6
- package/src/Icon/SpinningIcon.web.tsx +0 -11
- package/src/Icon/__snapshots__/Icon.stories.tsx.snap +0 -5648
- package/src/KittBreakpoints.ts +0 -44
- package/src/ListItem/ListItem.stories.tsx +0 -122
- package/src/ListItem/ListItem.tsx +0 -61
- package/src/ListItem/ListItemContent.tsx +0 -17
- package/src/ListItem/ListItemSideContent.tsx +0 -41
- package/src/ListItem/__snapshots__/ListItem.stories.tsx.snap +0 -1514
- package/src/Loader/LargeLoader.tsx +0 -12
- package/src/Loader/LargeLoader.web.module.css +0 -103
- package/src/Loader/LargeLoader.web.module.css.d.ts +0 -11
- package/src/Loader/LargeLoader.web.test.tsx +0 -10
- package/src/Loader/LargeLoader.web.tsx +0 -18
- package/src/Loader/Loader.stories.tsx +0 -47
- package/src/Loader/Loader.tsx +0 -21
- package/src/Loader/Loader.web.test.tsx +0 -20
- package/src/Loader/Loader.web.tsx +0 -14
- package/src/Loader/__snapshots__/LargeLoader.web.test.tsx.snap +0 -33
- package/src/Loader/__snapshots__/Loader.stories.tsx.snap +0 -607
- package/src/Loader/__snapshots__/Loader.web.test.tsx.snap +0 -103
- package/src/Message/Message.stories.tsx +0 -102
- package/src/Message/Message.tsx +0 -114
- package/src/Message/__snapshots__/Message.stories.tsx.snap +0 -2776
- package/src/Modal/Body.tsx +0 -20
- package/src/Modal/Footer.tsx +0 -18
- package/src/Modal/Header.tsx +0 -66
- package/src/Modal/Modal.stories.tsx +0 -181
- package/src/Modal/Modal.tsx +0 -66
- package/src/Modal/OnCloseContext.ts +0 -3
- package/src/Modal/__snapshots__/Modal.stories.tsx.snap +0 -2960
- package/src/Notification/Notification.stories.tsx +0 -102
- package/src/Notification/Notification.tsx +0 -21
- package/src/Notification/__snapshots__/Notification.stories.tsx.snap +0 -2861
- package/src/Overlay/Overlay.tsx +0 -22
- package/src/Tag/Tag.stories.tsx +0 -18
- package/src/Tag/Tag.tsx +0 -31
- package/src/Tag/__snapshots__/Tag.stories.tsx.snap +0 -303
- package/src/Tooltip/Tooltip.tsx +0 -17
- package/src/__mocks__/react-native-safe-area-context.tsx +0 -26
- package/src/forms/InputFeedback/InputFeedback.stories.tsx +0 -17
- package/src/forms/InputFeedback/InputFeedback.tsx +0 -28
- package/src/forms/InputFeedback/__snapshots__/InputFeedback.stories.tsx.snap +0 -252
- package/src/forms/InputField/InputField.stories.tsx +0 -19
- package/src/forms/InputField/InputField.tsx +0 -45
- package/src/forms/InputField/__snapshots__/InputField.stories.tsx.snap +0 -240
- package/src/forms/InputFormState.ts +0 -1
- package/src/forms/InputText/InputText.stories.tsx +0 -85
- package/src/forms/InputText/InputText.tsx +0 -172
- package/src/forms/InputText/__snapshots__/InputText.stories.tsx.snap +0 -4274
- package/src/forms/InputText/useInputText.ts +0 -19
- package/src/forms/Label/Label.stories.tsx +0 -14
- package/src/forms/Label/Label.tsx +0 -17
- package/src/forms/Label/__snapshots__/Label.stories.tsx.snap +0 -174
- package/src/forms/Radio/Radio.stories.tsx +0 -48
- package/src/forms/Radio/Radio.tsx +0 -81
- package/src/forms/Radio/__snapshots__/Radio.stories.tsx.snap +0 -967
- package/src/forms/TextArea/TextArea.stories.tsx +0 -72
- package/src/forms/TextArea/TextArea.tsx +0 -12
- package/src/forms/TextArea/__snapshots__/TextArea.stories.tsx.snap +0 -2091
- package/src/index.ts +0 -61
- package/src/stories/Block.tsx +0 -24
- package/src/stories/Flex.tsx +0 -16
- package/src/stories/color-tokens.stories.tsx +0 -143
- package/src/stories-list.ts +0 -22
- package/src/story-components/Section.tsx +0 -56
- package/src/story-components/Story.tsx +0 -24
- package/src/story-components/StoryDecorator.tsx +0 -8
- package/src/story-components/StoryGrid.tsx +0 -80
- package/src/story-components/StoryTitle.stories.tsx +0 -12
- package/src/story-components/StoryTitle.tsx +0 -69
- package/src/story-components/__snapshots__/StoryTitle.stories.tsx.snap +0 -155
- package/src/story-components/index.ts +0 -5
- package/src/themes/default.ts +0 -34
- package/src/themes/late-ocean/avatarLateOceanTheme.ts +0 -12
- package/src/themes/late-ocean/buttonLateOceanTheme.ts +0 -37
- package/src/themes/late-ocean/cardLateOceanTheme.ts +0 -19
- package/src/themes/late-ocean/colorsLateOceanTheme.ts +0 -19
- package/src/themes/late-ocean/feedbackMessageLateOceanTheme.ts +0 -10
- package/src/themes/late-ocean/formLateOceanTheme.ts +0 -9
- package/src/themes/late-ocean/fullScreenModalLateOceanTheme.ts +0 -9
- package/src/themes/late-ocean/inputFieldLateOceanTheme.ts +0 -4
- package/src/themes/late-ocean/inputLateOceanTheme.ts +0 -55
- package/src/themes/late-ocean/listItemLateOceanTheme.ts +0 -8
- package/src/themes/late-ocean/radioLateOceanTheme.ts +0 -19
- package/src/themes/late-ocean/shadowsLateOceanTheme.ts +0 -3
- package/src/themes/late-ocean/tagLateOceanTheme.ts +0 -17
- package/src/themes/late-ocean/typographyLateOceanTheme.ts +0 -94
- package/src/themes/palettes/lateOceanColorPalette.ts +0 -24
- package/src/typings/babel-config.d.ts +0 -6
- package/src/typings/metro.d.ts +0 -6
- package/src/typography/Typography.stories.tsx +0 -113
- package/src/typography/Typography.tsx +0 -165
- package/src/typography/TypographyIcon.stories.tsx +0 -31
- package/src/typography/TypographyIcon.tsx +0 -35
- package/src/typography/TypographyLink.stories.tsx +0 -88
- package/src/typography/TypographyLink.tsx +0 -48
- package/src/typography/__snapshots__/Typography.stories.tsx.snap +0 -6118
- package/src/typography/__snapshots__/TypographyIcon.stories.tsx.snap +0 -334
- package/src/typography/__snapshots__/TypographyLink.stories.tsx.snap +0 -10945
- package/src/useKittTheme.tsx +0 -12
- package/src/utils/storybook/decorators/KittThemeDecorator.tsx +0 -27
- package/src/utils/storybook/decorators/SafeAreaProviderDecorator.tsx +0 -11
- package/src/utils/storybook/setup-global-decorators.ts +0 -6
- package/src/utils/tests/renderWithProvidersUtils.tsx +0 -17
- package/src/utils/typeUtils.ts +0 -6
- package/src/utils/windowSize/MatchWindowSize.tsx +0 -14
- package/src/utils/windowSize/__snapshots__/windowSize.stories.tsx.snap +0 -1485
- package/src/utils/windowSize/createWindowSizeHelper.test.ts +0 -11
- package/src/utils/windowSize/createWindowSizeHelper.ts +0 -65
- package/src/utils/windowSize/useMatchWindowSize.ts +0 -14
- package/src/utils/windowSize/useWindowSize.ts +0 -1
- package/src/utils/windowSize/windowSize.stories.tsx +0 -115
- package/tsconfig.build.json +0 -33
- package/tsconfig.json +0 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ornikar/kitt-universal",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"sideEffects": false,
|
|
16
16
|
"browser": "./dist/index-browser-all.es",
|
|
17
17
|
"engines": {
|
|
18
|
-
"node": ">= 14.17.
|
|
18
|
+
"node": ">= 14.17.5",
|
|
19
19
|
"yarn": ">= 1.12.3"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@babel/runtime": "^7.13.0",
|
|
26
|
-
"@ornikar/kitt-icons": "^2.0.
|
|
26
|
+
"@ornikar/kitt-icons": "^2.0.1",
|
|
27
27
|
"type-fest": "^1.0.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"react-test-renderer": "17.0.1",
|
|
53
53
|
"styled-components": "5.3.3"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "ff0b50b968a2bb12b43099e6371c43eadc9c4913"
|
|
56
56
|
}
|
package/CHANGELOG.md
DELETED
package/src/.eslintrc.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"root": true,
|
|
3
|
-
"parser": "@typescript-eslint/parser",
|
|
4
|
-
"parserOptions": {
|
|
5
|
-
"project": "@ornikar/kitt-universal/tsconfig.json"
|
|
6
|
-
},
|
|
7
|
-
"extends": [
|
|
8
|
-
"@ornikar/eslint-config-typescript-react",
|
|
9
|
-
"@ornikar/eslint-config/rollup",
|
|
10
|
-
"../../../.eslintrc-base.src.json"
|
|
11
|
-
],
|
|
12
|
-
"settings": {
|
|
13
|
-
"import/resolver": {
|
|
14
|
-
"node": {
|
|
15
|
-
"moduleDirectory": ["node_modules", "src"]
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { storiesOf } from '@storybook/react-native';
|
|
2
|
-
import { Section, Story, StoryGrid } from '@ornikar/kitt-universal';
|
|
3
|
-
import type { ReactElement } from 'react';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { Avatar } from './Avatar';
|
|
6
|
-
|
|
7
|
-
interface AvatarWrapperProps {
|
|
8
|
-
children: ReactElement;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function AvatarWrapper({ children }: AvatarWrapperProps): ReactElement {
|
|
12
|
-
return (
|
|
13
|
-
<StoryGrid.Row breakpoint="small">
|
|
14
|
-
<StoryGrid.Col title="Default">{children}</StoryGrid.Col>
|
|
15
|
-
|
|
16
|
-
<StoryGrid.Col title="Round">{React.cloneElement(children, { round: true })}</StoryGrid.Col>
|
|
17
|
-
|
|
18
|
-
<StoryGrid.Col title="Light">{React.cloneElement(children, { light: true })}</StoryGrid.Col>
|
|
19
|
-
|
|
20
|
-
<StoryGrid.Col title="Small">{React.cloneElement(children, { size: 32 })}</StoryGrid.Col>
|
|
21
|
-
</StoryGrid.Row>
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
storiesOf('kitt-universal/Data Display', module).add('Avatar', () => (
|
|
26
|
-
<Story title="Avatar">
|
|
27
|
-
<Section title="With Source">
|
|
28
|
-
<AvatarWrapper>
|
|
29
|
-
<Avatar src="https://assets.staging-fr-onroad.com/avatars/2237155ce2af98ee5fd.jpeg" />
|
|
30
|
-
</AvatarWrapper>
|
|
31
|
-
</Section>
|
|
32
|
-
|
|
33
|
-
<Section title="With Initials">
|
|
34
|
-
<AvatarWrapper>
|
|
35
|
-
<Avatar firstname="Michael" lastname="Knight" />
|
|
36
|
-
</AvatarWrapper>
|
|
37
|
-
</Section>
|
|
38
|
-
|
|
39
|
-
<Section title="Without Name">
|
|
40
|
-
<AvatarWrapper>
|
|
41
|
-
<Avatar />
|
|
42
|
-
</AvatarWrapper>
|
|
43
|
-
</Section>
|
|
44
|
-
</Story>
|
|
45
|
-
));
|
package/src/Avatar/Avatar.tsx
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { UserIcon } from '@ornikar/kitt-icons';
|
|
2
|
-
import type { ReactElement } from 'react';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { Image } from 'react-native';
|
|
5
|
-
import styled from 'styled-components/native';
|
|
6
|
-
import { Icon } from '../Icon/Icon';
|
|
7
|
-
import { Typography } from '../typography/Typography';
|
|
8
|
-
|
|
9
|
-
const getFirstCharacter = (string: string): string => (string ? string[0] : '');
|
|
10
|
-
|
|
11
|
-
const getInitials = (firstname: string, lastname: string): string =>
|
|
12
|
-
(getFirstCharacter(firstname) + getFirstCharacter(lastname)).toUpperCase();
|
|
13
|
-
|
|
14
|
-
export interface AvatarProps {
|
|
15
|
-
size?: number;
|
|
16
|
-
src?: string | null;
|
|
17
|
-
firstname?: string | null;
|
|
18
|
-
lastname?: string | null;
|
|
19
|
-
round?: boolean;
|
|
20
|
-
light?: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface StyledAvatarViewProps extends Pick<AvatarProps, 'round' | 'light'> {
|
|
24
|
-
size: number;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const StyledAvatarView = styled.View<StyledAvatarViewProps>`
|
|
28
|
-
border-radius: ${({ round, size }) => (round ? size / 2 : 10)}px;
|
|
29
|
-
background-color: ${({ theme, light }) =>
|
|
30
|
-
light ? theme.kitt.avatar.light.backgroundColor : theme.kitt.avatar.default.backgroundColor};
|
|
31
|
-
height: ${({ size }) => size}px;
|
|
32
|
-
width: ${({ size }) => size}px;
|
|
33
|
-
overflow: hidden;
|
|
34
|
-
align-items: center;
|
|
35
|
-
justify-content: center;
|
|
36
|
-
`;
|
|
37
|
-
|
|
38
|
-
function AvatarContent({ size = 40, src, firstname, lastname, light }: AvatarProps): ReactElement {
|
|
39
|
-
if (src) {
|
|
40
|
-
return <Image source={{ uri: src }} style={{ width: size, height: size }} />;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (firstname && lastname) {
|
|
44
|
-
return (
|
|
45
|
-
<Typography.Text base="body-small" variant="bold" color={light ? 'black' : 'white'}>
|
|
46
|
-
{getInitials(firstname, lastname)}
|
|
47
|
-
</Typography.Text>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return <Icon icon={<UserIcon />} color={light ? 'black' : 'white'} size={size / 2} />;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export function Avatar({ size = 40, ...rest }: AvatarProps): ReactElement {
|
|
55
|
-
return (
|
|
56
|
-
<StyledAvatarView {...rest} size={size}>
|
|
57
|
-
<AvatarContent {...rest} size={size} />
|
|
58
|
-
</StyledAvatarView>
|
|
59
|
-
);
|
|
60
|
-
}
|