@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
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { storiesOf } from '@storybook/react-native';
|
|
2
|
-
import * as icons from '@ornikar/kitt-icons';
|
|
3
|
-
import { Section, Story } from '@ornikar/kitt-universal';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import type { ViewStyle } from 'react-native';
|
|
6
|
-
import { Flex } from '../stories/Flex';
|
|
7
|
-
import { Typography } from '../typography/Typography';
|
|
8
|
-
import { Icon } from './Icon';
|
|
9
|
-
|
|
10
|
-
const aligns: NonNullable<ViewStyle['alignSelf']>[] = ['flex-start', 'center', 'baseline', 'flex-end'];
|
|
11
|
-
|
|
12
|
-
storiesOf('kitt-universal/Icon', module)
|
|
13
|
-
.addParameters({
|
|
14
|
-
jest: {
|
|
15
|
-
createBeforeAfterEachCallbacks: () => ({
|
|
16
|
-
before: () => jest.useFakeTimers(),
|
|
17
|
-
}),
|
|
18
|
-
},
|
|
19
|
-
})
|
|
20
|
-
.add('Icon', () => (
|
|
21
|
-
<Story title="Icon">
|
|
22
|
-
<Section.DemoSection>
|
|
23
|
-
<Icon color="#000" icon={<icons.AlertCircleIcon />} />
|
|
24
|
-
<Icon spin color="#000" icon={<icons.LoaderIcon />} />
|
|
25
|
-
</Section.DemoSection>
|
|
26
|
-
|
|
27
|
-
<Section title="Size">
|
|
28
|
-
<Flex direction="row">
|
|
29
|
-
{[20, 40, 60].map((size) => (
|
|
30
|
-
<Flex key={size} direction="row" padding={2}>
|
|
31
|
-
<Icon color="#000" size={size} icon={<icons.AlertCircleIcon />} />
|
|
32
|
-
<Typography.Text base="body-small"> {size}</Typography.Text>
|
|
33
|
-
</Flex>
|
|
34
|
-
))}
|
|
35
|
-
</Flex>
|
|
36
|
-
</Section>
|
|
37
|
-
|
|
38
|
-
<Section title="Align">
|
|
39
|
-
{aligns.map((align) => (
|
|
40
|
-
<Flex key={align} direction="row" padding={2}>
|
|
41
|
-
<Icon color="#000" align={align} icon={<icons.AlertCircleIcon />} />
|
|
42
|
-
<Typography.Text base="body-large"> {align}</Typography.Text>
|
|
43
|
-
</Flex>
|
|
44
|
-
))}
|
|
45
|
-
</Section>
|
|
46
|
-
</Story>
|
|
47
|
-
))
|
|
48
|
-
.add('Icon List', () => (
|
|
49
|
-
<Story title="Icon List">
|
|
50
|
-
<Flex direction="row">
|
|
51
|
-
{Object.entries(icons).map(([name, IconComponent]) => (
|
|
52
|
-
<Flex key={name} direction="row" padding={2}>
|
|
53
|
-
<Icon color="#000" icon={<IconComponent />} />
|
|
54
|
-
<Typography.Text base="body-small"> {name}</Typography.Text>
|
|
55
|
-
</Flex>
|
|
56
|
-
))}
|
|
57
|
-
</Flex>
|
|
58
|
-
</Story>
|
|
59
|
-
));
|
package/src/Icon/Icon.tsx
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { ReactElement } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import type { ViewStyle } from 'react-native';
|
|
4
|
-
import styled from 'styled-components/native';
|
|
5
|
-
import { SpinningIcon } from './SpinningIcon';
|
|
6
|
-
|
|
7
|
-
export interface IconProps {
|
|
8
|
-
icon: ReactElement;
|
|
9
|
-
size?: number;
|
|
10
|
-
color: string;
|
|
11
|
-
spin?: boolean;
|
|
12
|
-
align?: ViewStyle['alignSelf'];
|
|
13
|
-
testID?: ViewStyle['testID'];
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface IconContainerProps {
|
|
17
|
-
size?: number;
|
|
18
|
-
color: string;
|
|
19
|
-
align?: ViewStyle['alignSelf'];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const IconContainer = styled.View<IconContainerProps>`
|
|
23
|
-
color: ${({ color }) => color};
|
|
24
|
-
width: ${({ size }) => size}px;
|
|
25
|
-
height: ${({ size }) => size}px;
|
|
26
|
-
align-self: ${({ align = 'auto' }) => align};
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
|
-
export function Icon({ icon, size = 20, spin, align, color }: IconProps): ReactElement {
|
|
30
|
-
const clonedIcon = React.cloneElement(icon, { color });
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<IconContainer align={align} size={size} color={color}>
|
|
34
|
-
{spin ? <SpinningIcon>{clonedIcon}</SpinningIcon> : clonedIcon}
|
|
35
|
-
</IconContainer>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import React, { useEffect, useRef } from 'react';
|
|
3
|
-
import { Animated, Easing } from 'react-native';
|
|
4
|
-
|
|
5
|
-
export interface SpinningIconProps {
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function SpinningIcon({ children }: SpinningIconProps): ReactElement {
|
|
10
|
-
const animationRef = useRef(new Animated.Value(0));
|
|
11
|
-
|
|
12
|
-
const rotation = animationRef.current.interpolate({
|
|
13
|
-
inputRange: [0, 1],
|
|
14
|
-
outputRange: ['0deg', '360deg'],
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
if (process.env.TESTS) return undefined;
|
|
19
|
-
|
|
20
|
-
const animation = Animated.loop(
|
|
21
|
-
Animated.timing(animationRef.current, {
|
|
22
|
-
toValue: 1,
|
|
23
|
-
duration: 1100,
|
|
24
|
-
easing: Easing.linear,
|
|
25
|
-
useNativeDriver: true,
|
|
26
|
-
}),
|
|
27
|
-
);
|
|
28
|
-
animation.start();
|
|
29
|
-
return () => {
|
|
30
|
-
if (process.env.TESTS) return undefined;
|
|
31
|
-
|
|
32
|
-
animation.stop();
|
|
33
|
-
return undefined;
|
|
34
|
-
};
|
|
35
|
-
}, []);
|
|
36
|
-
|
|
37
|
-
return <Animated.View style={{ transform: [{ rotate: rotation }] }}>{children}</Animated.View>;
|
|
38
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import styles from './SpinningIcon.web.module.css';
|
|
4
|
-
|
|
5
|
-
export interface SpinningIconProps {
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function SpinningIcon({ children }: SpinningIconProps): ReactElement {
|
|
10
|
-
return <span className={styles.SpinningIcon}>{children}</span>;
|
|
11
|
-
}
|