@ornikar/kitt-universal 1.0.0-pre
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/dist/index-browser-all-dev.es.js +1934 -0
- package/dist/index-browser-all-dev.es.js.map +1 -0
- package/dist/index-browser-all.es.js +1920 -0
- package/dist/index-browser-all.es.js.map +1 -0
- package/dist/index-node-12.13-dev.cjs.js +2059 -0
- package/dist/index-node-12.13-dev.cjs.js.map +1 -0
- package/dist/index-node-12.13.cjs.js +2048 -0
- package/dist/index-node-12.13.cjs.js.map +1 -0
- package/index.js +7 -0
- package/package.json +61 -0
- package/src/.eslintrc.json +42 -0
- package/src/Avatar/Avatar.stories.tsx +47 -0
- package/src/Avatar/Avatar.tsx +60 -0
- package/src/Avatar/__snapshots__/Avatar.stories.tsx.snap +1229 -0
- package/src/Button/Button.stories.tsx +303 -0
- package/src/Button/Button.tsx +60 -0
- package/src/Button/ButtonContainer.tsx +32 -0
- package/src/Button/ButtonContent.tsx +133 -0
- package/src/Button/__snapshots__/Button.stories.tsx.snap +7483 -0
- package/src/Button/useButton.ts +14 -0
- package/src/Card/Card.stories.tsx +33 -0
- package/src/Card/Card.tsx +25 -0
- package/src/Card/__snapshots__/Card.stories.tsx.snap +306 -0
- package/src/FullScreenModal/Body.tsx +25 -0
- package/src/FullScreenModal/FullScreenModal.stories.tsx +65 -0
- package/src/FullScreenModal/FullScreenModal.tsx +21 -0
- package/src/FullScreenModal/Header.tsx +129 -0
- package/src/FullScreenModal/__snapshots__/FullScreenModal.stories.tsx.snap +771 -0
- package/src/Icon/Icon.stories.tsx +61 -0
- package/src/Icon/Icon.tsx +37 -0
- package/src/Icon/SpinningIcon.tsx +38 -0
- package/src/Icon/SpinningIcon.web.css +13 -0
- package/src/Icon/SpinningIcon.web.tsx +11 -0
- package/src/Icon/__snapshots__/Icon.stories.tsx.snap +5648 -0
- package/src/KittBreakpoints.ts +44 -0
- package/src/KittThemeProvider.tsx +30 -0
- package/src/ListItem/ListItem.stories.tsx +124 -0
- package/src/ListItem/ListItem.tsx +61 -0
- package/src/ListItem/ListItemContent.tsx +17 -0
- package/src/ListItem/ListItemSideContent.tsx +41 -0
- package/src/ListItem/__snapshots__/ListItem.stories.tsx.snap +1514 -0
- package/src/Loader/LargeLoader.tsx +12 -0
- package/src/Loader/LargeLoader.web.css +103 -0
- package/src/Loader/LargeLoader.web.test.tsx +10 -0
- package/src/Loader/LargeLoader.web.tsx +18 -0
- package/src/Loader/Loader.stories.tsx +49 -0
- package/src/Loader/Loader.tsx +21 -0
- package/src/Loader/Loader.web.test.tsx +20 -0
- package/src/Loader/Loader.web.tsx +14 -0
- package/src/Loader/__snapshots__/LargeLoader.web.test.tsx.snap +33 -0
- package/src/Loader/__snapshots__/Loader.stories.tsx.snap +607 -0
- package/src/Loader/__snapshots__/Loader.web.test.tsx.snap +103 -0
- package/src/Message/Message.stories.tsx +104 -0
- package/src/Message/Message.tsx +114 -0
- package/src/Message/__snapshots__/Message.stories.tsx.snap +2776 -0
- package/src/Modal/Body.tsx +20 -0
- package/src/Modal/Footer.tsx +18 -0
- package/src/Modal/Header.tsx +66 -0
- package/src/Modal/Modal.stories.tsx +183 -0
- package/src/Modal/Modal.tsx +66 -0
- package/src/Modal/OnCloseContext.ts +3 -0
- package/src/Modal/__snapshots__/Modal.stories.tsx.snap +2960 -0
- package/src/Notification/Notification.stories.tsx +103 -0
- package/src/Notification/Notification.tsx +21 -0
- package/src/Notification/__snapshots__/Notification.stories.tsx.snap +2861 -0
- package/src/Overlay/Overlay.tsx +22 -0
- package/src/Tag/Tag.stories.tsx +19 -0
- package/src/Tag/Tag.tsx +31 -0
- package/src/Tag/__snapshots__/Tag.stories.tsx.snap +303 -0
- package/src/Tooltip/Tooltip.tsx +17 -0
- package/src/__mocks__/react-native-safe-area-context.tsx +26 -0
- package/src/forms/InputFeedback/InputFeedback.stories.tsx +20 -0
- package/src/forms/InputFeedback/InputFeedback.tsx +28 -0
- package/src/forms/InputFeedback/__snapshots__/InputFeedback.stories.tsx.snap +252 -0
- package/src/forms/InputField/InputField.stories.tsx +21 -0
- package/src/forms/InputField/InputField.tsx +45 -0
- package/src/forms/InputField/__snapshots__/InputField.stories.tsx.snap +240 -0
- package/src/forms/InputFormState.ts +1 -0
- package/src/forms/InputText/InputText.stories.tsx +87 -0
- package/src/forms/InputText/InputText.tsx +172 -0
- package/src/forms/InputText/__snapshots__/InputText.stories.tsx.snap +4274 -0
- package/src/forms/InputText/useInputText.ts +19 -0
- package/src/forms/Label/Label.stories.tsx +16 -0
- package/src/forms/Label/Label.tsx +17 -0
- package/src/forms/Label/__snapshots__/Label.stories.tsx.snap +174 -0
- package/src/forms/Radio/Radio.stories.tsx +50 -0
- package/src/forms/Radio/Radio.tsx +81 -0
- package/src/forms/Radio/__snapshots__/Radio.stories.tsx.snap +967 -0
- package/src/forms/TextArea/TextArea.stories.tsx +74 -0
- package/src/forms/TextArea/TextArea.tsx +12 -0
- package/src/forms/TextArea/__snapshots__/TextArea.stories.tsx.snap +2091 -0
- package/src/index.ts +43 -0
- package/src/stories/Block.tsx +24 -0
- package/src/stories/Flex.tsx +16 -0
- package/src/stories/color-tokens.stories.tsx +143 -0
- package/src/stories-list.tsx +22 -0
- package/src/story-components/Section.tsx +56 -0
- package/src/story-components/Story.tsx +24 -0
- package/src/story-components/StoryDecorator.tsx +8 -0
- package/src/story-components/StoryGrid.tsx +80 -0
- package/src/story-components/StoryTitle.stories.tsx +12 -0
- package/src/story-components/StoryTitle.tsx +69 -0
- package/src/story-components/__snapshots__/StoryTitle.stories.tsx.snap +155 -0
- package/src/story-components/index.ts +13 -0
- package/src/themes/default.ts +34 -0
- package/src/themes/late-ocean/avatarLateOceanTheme.ts +12 -0
- package/src/themes/late-ocean/buttonLateOceanTheme.ts +37 -0
- package/src/themes/late-ocean/cardLateOceanTheme.ts +19 -0
- package/src/themes/late-ocean/colorsLateOceanTheme.ts +19 -0
- package/src/themes/late-ocean/feedbackMessageLateOceanTheme.ts +10 -0
- package/src/themes/late-ocean/formLateOceanTheme.ts +9 -0
- package/src/themes/late-ocean/fullScreenModalLateOceanTheme.ts +8 -0
- package/src/themes/late-ocean/inputFieldLateOceanTheme.ts +4 -0
- package/src/themes/late-ocean/inputLateOceanTheme.ts +55 -0
- package/src/themes/late-ocean/listItemLateOceanTheme.ts +8 -0
- package/src/themes/late-ocean/radioLateOceanTheme.ts +19 -0
- package/src/themes/late-ocean/shadowsLateOceanTheme.ts +3 -0
- package/src/themes/late-ocean/tagLateOceanTheme.ts +17 -0
- package/src/themes/late-ocean/typographyLateOceanTheme.ts +94 -0
- package/src/themes/palettes/lateOceanColorPalette.ts +24 -0
- package/src/typings/babel-config.d.ts +6 -0
- package/src/typings/metro.d.ts +6 -0
- package/src/typography/Typography.stories.tsx +115 -0
- package/src/typography/Typography.tsx +165 -0
- package/src/typography/TypographyIcon.stories.tsx +32 -0
- package/src/typography/TypographyIcon.tsx +35 -0
- package/src/typography/TypographyLink.stories.tsx +89 -0
- package/src/typography/TypographyLink.tsx +48 -0
- package/src/typography/__snapshots__/Typography.stories.tsx.snap +6118 -0
- package/src/typography/__snapshots__/TypographyIcon.stories.tsx.snap +334 -0
- package/src/typography/__snapshots__/TypographyLink.stories.tsx.snap +10945 -0
- package/src/utils/storybook/decorators/KittThemeDecorator.tsx +11 -0
- package/src/utils/storybook/decorators/SafeAreaProviderDecorator.tsx +11 -0
- package/src/utils/storybook/setup-global-decorators.ts +6 -0
- package/src/utils/tests/renderWithProvidersUtils.tsx +17 -0
- package/src/utils/typeUtils.ts +6 -0
- package/src/utils/windowSize/MatchWindowSize.tsx +14 -0
- package/src/utils/windowSize/__snapshots__/windowSize.stories.tsx.snap +1485 -0
- package/src/utils/windowSize/createWindowSizeHelper.test.ts +11 -0
- package/src/utils/windowSize/createWindowSizeHelper.ts +65 -0
- package/src/utils/windowSize/useMatchWindowSize.ts +14 -0
- package/src/utils/windowSize/useWindowSize.ts +1 -0
- package/src/utils/windowSize/windowSize.stories.tsx +116 -0
- package/tsconfig.build.json +30 -0
- package/tsconfig.json +13 -0
- package/yarn-error.log +22274 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
|
+
import { storiesOf } from '@storybook/react-native';
|
|
3
|
+
import type { ReactElement } from 'react';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { StoryComponents } from '../../story-components';
|
|
6
|
+
import type { TextAreaProps } from './TextArea';
|
|
7
|
+
import { TextArea } from './TextArea';
|
|
8
|
+
|
|
9
|
+
const { Section, Story, StoryGrid } = StoryComponents;
|
|
10
|
+
|
|
11
|
+
const defaultPlaceholder = 'Placeholder';
|
|
12
|
+
const filledValue =
|
|
13
|
+
'The original Knight Rider series followed the adventures of Michael Knight, a modern-day crime fighter who uses a technologically advanced, artificially intelligent automobile. This car, named KITT, is virtually indestructible, due to a high-tech coating applied to it.';
|
|
14
|
+
|
|
15
|
+
interface TextAreaVariationProps extends Partial<TextAreaProps> {
|
|
16
|
+
variationTitle: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function TextAreaVariation({ variationTitle, ...props }: TextAreaVariationProps): ReactElement {
|
|
20
|
+
return (
|
|
21
|
+
<Section key={variationTitle} title={variationTitle}>
|
|
22
|
+
<StoryGrid.Row breakpoint="medium">
|
|
23
|
+
<StoryGrid.Col title="Empty">
|
|
24
|
+
<TextArea placeholder={defaultPlaceholder} onChange={action('Changed')} {...props} />
|
|
25
|
+
</StoryGrid.Col>
|
|
26
|
+
<StoryGrid.Col title="Filled">
|
|
27
|
+
<TextArea placeholder={defaultPlaceholder} value={filledValue} onChange={action('Changed')} {...props} />
|
|
28
|
+
</StoryGrid.Col>
|
|
29
|
+
<StoryGrid.Col title="Hover">
|
|
30
|
+
<TextArea
|
|
31
|
+
placeholder={defaultPlaceholder}
|
|
32
|
+
value={filledValue}
|
|
33
|
+
internalForceState="hover"
|
|
34
|
+
onChange={action('Changed')}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
</StoryGrid.Col>
|
|
38
|
+
<StoryGrid.Col title="Focus">
|
|
39
|
+
<TextArea
|
|
40
|
+
placeholder={defaultPlaceholder}
|
|
41
|
+
value={filledValue}
|
|
42
|
+
internalForceState="focus"
|
|
43
|
+
onChange={action('Changed')}
|
|
44
|
+
{...props}
|
|
45
|
+
/>
|
|
46
|
+
</StoryGrid.Col>
|
|
47
|
+
<StoryGrid.Col title="Disabled">
|
|
48
|
+
<TextArea disabled placeholder={defaultPlaceholder} onChange={action('Changed')} {...props} />
|
|
49
|
+
</StoryGrid.Col>
|
|
50
|
+
<StoryGrid.Col title={'Disabled\u00A0Filled'}>
|
|
51
|
+
<TextArea
|
|
52
|
+
disabled
|
|
53
|
+
placeholder={defaultPlaceholder}
|
|
54
|
+
value={filledValue}
|
|
55
|
+
onChange={action('Changed')}
|
|
56
|
+
{...props}
|
|
57
|
+
/>
|
|
58
|
+
</StoryGrid.Col>
|
|
59
|
+
</StoryGrid.Row>
|
|
60
|
+
</Section>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
storiesOf('kitt/Forms', module).add('TextArea', () => (
|
|
65
|
+
<Story title="TextArea">
|
|
66
|
+
<Section.DemoSection>
|
|
67
|
+
<TextArea placeholder="Placeholder" onChange={action('Changed')} />
|
|
68
|
+
</Section.DemoSection>
|
|
69
|
+
|
|
70
|
+
<TextAreaVariation variationTitle="Default" />
|
|
71
|
+
<TextAreaVariation variationTitle="Valid" state="valid" />
|
|
72
|
+
<TextAreaVariation variationTitle="Invalid" state="invalid" />
|
|
73
|
+
</Story>
|
|
74
|
+
));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useTheme } from 'styled-components/native';
|
|
4
|
+
import type { InputTextProps } from '../InputText/InputText';
|
|
5
|
+
import { InputText } from '../InputText/InputText';
|
|
6
|
+
|
|
7
|
+
export interface TextAreaProps extends Omit<InputTextProps, 'type'> {}
|
|
8
|
+
|
|
9
|
+
export function TextArea({ ...props }: TextAreaProps): ReactElement {
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
return <InputText multiline {...props} type="text" minHeight={theme.kitt.forms.input.textAreaMinHeight} />;
|
|
12
|
+
}
|