@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.
Files changed (139) hide show
  1. package/package.json +4 -4
  2. package/CHANGELOG.md +0 -8
  3. package/src/.eslintrc.json +0 -19
  4. package/src/Avatar/Avatar.stories.tsx +0 -45
  5. package/src/Avatar/Avatar.tsx +0 -60
  6. package/src/Avatar/__snapshots__/Avatar.stories.tsx.snap +0 -1229
  7. package/src/Button/Button.stories.tsx +0 -301
  8. package/src/Button/Button.tsx +0 -60
  9. package/src/Button/ButtonContainer.tsx +0 -32
  10. package/src/Button/ButtonContent.tsx +0 -133
  11. package/src/Button/__snapshots__/Button.stories.tsx.snap +0 -7483
  12. package/src/Button/useButton.ts +0 -14
  13. package/src/Card/Card.stories.tsx +0 -31
  14. package/src/Card/Card.tsx +0 -25
  15. package/src/Card/__snapshots__/Card.stories.tsx.snap +0 -306
  16. package/src/FullScreenModal/Body.tsx +0 -25
  17. package/src/FullScreenModal/FullScreenModal.stories.tsx +0 -63
  18. package/src/FullScreenModal/FullScreenModal.tsx +0 -21
  19. package/src/FullScreenModal/Header.tsx +0 -129
  20. package/src/FullScreenModal/__snapshots__/FullScreenModal.stories.tsx.snap +0 -771
  21. package/src/Icon/Icon.stories.tsx +0 -59
  22. package/src/Icon/Icon.tsx +0 -37
  23. package/src/Icon/SpinningIcon.tsx +0 -38
  24. package/src/Icon/SpinningIcon.web.module.css +0 -13
  25. package/src/Icon/SpinningIcon.web.module.css.d.ts +0 -6
  26. package/src/Icon/SpinningIcon.web.tsx +0 -11
  27. package/src/Icon/__snapshots__/Icon.stories.tsx.snap +0 -5648
  28. package/src/KittBreakpoints.ts +0 -44
  29. package/src/ListItem/ListItem.stories.tsx +0 -122
  30. package/src/ListItem/ListItem.tsx +0 -61
  31. package/src/ListItem/ListItemContent.tsx +0 -17
  32. package/src/ListItem/ListItemSideContent.tsx +0 -41
  33. package/src/ListItem/__snapshots__/ListItem.stories.tsx.snap +0 -1514
  34. package/src/Loader/LargeLoader.tsx +0 -12
  35. package/src/Loader/LargeLoader.web.module.css +0 -103
  36. package/src/Loader/LargeLoader.web.module.css.d.ts +0 -11
  37. package/src/Loader/LargeLoader.web.test.tsx +0 -10
  38. package/src/Loader/LargeLoader.web.tsx +0 -18
  39. package/src/Loader/Loader.stories.tsx +0 -47
  40. package/src/Loader/Loader.tsx +0 -21
  41. package/src/Loader/Loader.web.test.tsx +0 -20
  42. package/src/Loader/Loader.web.tsx +0 -14
  43. package/src/Loader/__snapshots__/LargeLoader.web.test.tsx.snap +0 -33
  44. package/src/Loader/__snapshots__/Loader.stories.tsx.snap +0 -607
  45. package/src/Loader/__snapshots__/Loader.web.test.tsx.snap +0 -103
  46. package/src/Message/Message.stories.tsx +0 -102
  47. package/src/Message/Message.tsx +0 -114
  48. package/src/Message/__snapshots__/Message.stories.tsx.snap +0 -2776
  49. package/src/Modal/Body.tsx +0 -20
  50. package/src/Modal/Footer.tsx +0 -18
  51. package/src/Modal/Header.tsx +0 -66
  52. package/src/Modal/Modal.stories.tsx +0 -181
  53. package/src/Modal/Modal.tsx +0 -66
  54. package/src/Modal/OnCloseContext.ts +0 -3
  55. package/src/Modal/__snapshots__/Modal.stories.tsx.snap +0 -2960
  56. package/src/Notification/Notification.stories.tsx +0 -102
  57. package/src/Notification/Notification.tsx +0 -21
  58. package/src/Notification/__snapshots__/Notification.stories.tsx.snap +0 -2861
  59. package/src/Overlay/Overlay.tsx +0 -22
  60. package/src/Tag/Tag.stories.tsx +0 -18
  61. package/src/Tag/Tag.tsx +0 -31
  62. package/src/Tag/__snapshots__/Tag.stories.tsx.snap +0 -303
  63. package/src/Tooltip/Tooltip.tsx +0 -17
  64. package/src/__mocks__/react-native-safe-area-context.tsx +0 -26
  65. package/src/forms/InputFeedback/InputFeedback.stories.tsx +0 -17
  66. package/src/forms/InputFeedback/InputFeedback.tsx +0 -28
  67. package/src/forms/InputFeedback/__snapshots__/InputFeedback.stories.tsx.snap +0 -252
  68. package/src/forms/InputField/InputField.stories.tsx +0 -19
  69. package/src/forms/InputField/InputField.tsx +0 -45
  70. package/src/forms/InputField/__snapshots__/InputField.stories.tsx.snap +0 -240
  71. package/src/forms/InputFormState.ts +0 -1
  72. package/src/forms/InputText/InputText.stories.tsx +0 -85
  73. package/src/forms/InputText/InputText.tsx +0 -172
  74. package/src/forms/InputText/__snapshots__/InputText.stories.tsx.snap +0 -4274
  75. package/src/forms/InputText/useInputText.ts +0 -19
  76. package/src/forms/Label/Label.stories.tsx +0 -14
  77. package/src/forms/Label/Label.tsx +0 -17
  78. package/src/forms/Label/__snapshots__/Label.stories.tsx.snap +0 -174
  79. package/src/forms/Radio/Radio.stories.tsx +0 -48
  80. package/src/forms/Radio/Radio.tsx +0 -81
  81. package/src/forms/Radio/__snapshots__/Radio.stories.tsx.snap +0 -967
  82. package/src/forms/TextArea/TextArea.stories.tsx +0 -72
  83. package/src/forms/TextArea/TextArea.tsx +0 -12
  84. package/src/forms/TextArea/__snapshots__/TextArea.stories.tsx.snap +0 -2091
  85. package/src/index.ts +0 -61
  86. package/src/stories/Block.tsx +0 -24
  87. package/src/stories/Flex.tsx +0 -16
  88. package/src/stories/color-tokens.stories.tsx +0 -143
  89. package/src/stories-list.ts +0 -22
  90. package/src/story-components/Section.tsx +0 -56
  91. package/src/story-components/Story.tsx +0 -24
  92. package/src/story-components/StoryDecorator.tsx +0 -8
  93. package/src/story-components/StoryGrid.tsx +0 -80
  94. package/src/story-components/StoryTitle.stories.tsx +0 -12
  95. package/src/story-components/StoryTitle.tsx +0 -69
  96. package/src/story-components/__snapshots__/StoryTitle.stories.tsx.snap +0 -155
  97. package/src/story-components/index.ts +0 -5
  98. package/src/themes/default.ts +0 -34
  99. package/src/themes/late-ocean/avatarLateOceanTheme.ts +0 -12
  100. package/src/themes/late-ocean/buttonLateOceanTheme.ts +0 -37
  101. package/src/themes/late-ocean/cardLateOceanTheme.ts +0 -19
  102. package/src/themes/late-ocean/colorsLateOceanTheme.ts +0 -19
  103. package/src/themes/late-ocean/feedbackMessageLateOceanTheme.ts +0 -10
  104. package/src/themes/late-ocean/formLateOceanTheme.ts +0 -9
  105. package/src/themes/late-ocean/fullScreenModalLateOceanTheme.ts +0 -9
  106. package/src/themes/late-ocean/inputFieldLateOceanTheme.ts +0 -4
  107. package/src/themes/late-ocean/inputLateOceanTheme.ts +0 -55
  108. package/src/themes/late-ocean/listItemLateOceanTheme.ts +0 -8
  109. package/src/themes/late-ocean/radioLateOceanTheme.ts +0 -19
  110. package/src/themes/late-ocean/shadowsLateOceanTheme.ts +0 -3
  111. package/src/themes/late-ocean/tagLateOceanTheme.ts +0 -17
  112. package/src/themes/late-ocean/typographyLateOceanTheme.ts +0 -94
  113. package/src/themes/palettes/lateOceanColorPalette.ts +0 -24
  114. package/src/typings/babel-config.d.ts +0 -6
  115. package/src/typings/metro.d.ts +0 -6
  116. package/src/typography/Typography.stories.tsx +0 -113
  117. package/src/typography/Typography.tsx +0 -165
  118. package/src/typography/TypographyIcon.stories.tsx +0 -31
  119. package/src/typography/TypographyIcon.tsx +0 -35
  120. package/src/typography/TypographyLink.stories.tsx +0 -88
  121. package/src/typography/TypographyLink.tsx +0 -48
  122. package/src/typography/__snapshots__/Typography.stories.tsx.snap +0 -6118
  123. package/src/typography/__snapshots__/TypographyIcon.stories.tsx.snap +0 -334
  124. package/src/typography/__snapshots__/TypographyLink.stories.tsx.snap +0 -10945
  125. package/src/useKittTheme.tsx +0 -12
  126. package/src/utils/storybook/decorators/KittThemeDecorator.tsx +0 -27
  127. package/src/utils/storybook/decorators/SafeAreaProviderDecorator.tsx +0 -11
  128. package/src/utils/storybook/setup-global-decorators.ts +0 -6
  129. package/src/utils/tests/renderWithProvidersUtils.tsx +0 -17
  130. package/src/utils/typeUtils.ts +0 -6
  131. package/src/utils/windowSize/MatchWindowSize.tsx +0 -14
  132. package/src/utils/windowSize/__snapshots__/windowSize.stories.tsx.snap +0 -1485
  133. package/src/utils/windowSize/createWindowSizeHelper.test.ts +0 -11
  134. package/src/utils/windowSize/createWindowSizeHelper.ts +0 -65
  135. package/src/utils/windowSize/useMatchWindowSize.ts +0 -14
  136. package/src/utils/windowSize/useWindowSize.ts +0 -1
  137. package/src/utils/windowSize/windowSize.stories.tsx +0 -115
  138. package/tsconfig.build.json +0 -33
  139. package/tsconfig.json +0 -13
@@ -1,44 +0,0 @@
1
- export const KittBreakpoints = {
2
- /**
3
- * min-width: 0
4
- */
5
- BASE: 0,
6
- /**
7
- * min-width: 480px
8
- */
9
- SMALL: 480,
10
- /**
11
- * min-width: 768px
12
- */
13
- MEDIUM: 768,
14
- /**
15
- * min-width: 1024px
16
- */
17
- LARGE: 1024,
18
- /**
19
- * min-width: 1280px
20
- */
21
- WIDE: 1280,
22
- };
23
-
24
- export const KittBreakpointsMax = {
25
- /**
26
- * max-width: 479px
27
- */
28
- BASE: KittBreakpoints.SMALL - 1,
29
- /**
30
- * max-width: 767px
31
- */
32
- SMALL: KittBreakpoints.MEDIUM - 1,
33
- /**
34
- * max-width: 1023px
35
- */
36
- MEDIUM: KittBreakpoints.LARGE - 1,
37
- /**
38
- * max-width: 1279px
39
- */
40
- LARGE: KittBreakpoints.WIDE - 1,
41
- };
42
-
43
- export type KittBreakpoint = typeof KittBreakpoints[keyof typeof KittBreakpoints];
44
- export type KittBreakpointMax = typeof KittBreakpointsMax[keyof typeof KittBreakpointsMax];
@@ -1,122 +0,0 @@
1
- import { action } from '@storybook/addon-actions';
2
- import { storiesOf } from '@storybook/react-native';
3
- import { Section, Story } from '@ornikar/kitt-universal';
4
- import React from 'react';
5
- import { Avatar, ChevronRightIcon, Typography, TypographyIcon, UserIcon } from '..';
6
- import { ListItem } from './ListItem';
7
-
8
- storiesOf('kitt-universal/Data Display', module).add('List Item', () => (
9
- <Story title="List Item">
10
- <Section.DemoSection>
11
- <ListItem
12
- withPadding
13
- borders="both"
14
- left={
15
- <ListItem.SideContent>
16
- <Avatar />
17
- </ListItem.SideContent>
18
- }
19
- right={
20
- <ListItem.SideContent align="center">
21
- <TypographyIcon icon={<ChevronRightIcon />} />
22
- </ListItem.SideContent>
23
- }
24
- onPress={action('On Press')}
25
- >
26
- <Typography.Text base="body" ellipsizeMode="tail" numberOfLines={2}>
27
- List Item - Demo
28
- </Typography.Text>
29
- </ListItem>
30
- </Section.DemoSection>
31
-
32
- <Section title="Default">
33
- <ListItem onPress={action('On Press')}>
34
- <Typography.Text base="body">List Item - Default</Typography.Text>
35
- </ListItem>
36
- </Section>
37
-
38
- <Section title="With Padding">
39
- <ListItem withPadding onPress={action('On Press')}>
40
- <Typography.Text base="body">List Item - With Padding</Typography.Text>
41
- </ListItem>
42
- </Section>
43
-
44
- <Section title="With Borders">
45
- <ListItem borders="both" onPress={action('On Press')}>
46
- <Typography.Text base="body">List Item - With Borders</Typography.Text>
47
- </ListItem>
48
- </Section>
49
-
50
- <Section title="With Right Content">
51
- <Section.SubSection title="center">
52
- <ListItem
53
- right={
54
- <ListItem.SideContent align="center">
55
- <TypographyIcon icon={<ChevronRightIcon />} />
56
- </ListItem.SideContent>
57
- }
58
- >
59
- <Typography.Text base="body">List Item - With Centered Right Content</Typography.Text>
60
- </ListItem>
61
- </Section.SubSection>
62
-
63
- <Section.SubSection title="flex-end">
64
- <ListItem
65
- right={
66
- <ListItem.SideContent align="flex-end">
67
- <TypographyIcon icon={<ChevronRightIcon />} />
68
- </ListItem.SideContent>
69
- }
70
- >
71
- <Typography.Text base="body">List Item - With Centered Right Content</Typography.Text>
72
- </ListItem>
73
- </Section.SubSection>
74
- </Section>
75
-
76
- <Section title="With Left Content">
77
- <Section.SubSection title="center">
78
- <ListItem
79
- left={
80
- <ListItem.SideContent align="center">
81
- <TypographyIcon icon={<UserIcon />} align="center" />
82
- </ListItem.SideContent>
83
- }
84
- >
85
- <Typography.Text base="body">List Item - With Centered Left Content</Typography.Text>
86
- </ListItem>
87
- </Section.SubSection>
88
-
89
- <Section.SubSection title="flex-end">
90
- <ListItem
91
- left={
92
- <ListItem.SideContent align="flex-end">
93
- <TypographyIcon icon={<UserIcon />} align="center" />
94
- </ListItem.SideContent>
95
- }
96
- >
97
- <Typography.Text base="body">List Item - With Centered Left Content</Typography.Text>
98
- </ListItem>
99
- </Section.SubSection>
100
- </Section>
101
-
102
- <Section title="With Ellipsed Text">
103
- <ListItem
104
- left={
105
- <ListItem.SideContent>
106
- <TypographyIcon icon={<UserIcon />} align="center" />
107
- </ListItem.SideContent>
108
- }
109
- right={
110
- <ListItem.SideContent align="center">
111
- <TypographyIcon icon={<ChevronRightIcon />} />
112
- </ListItem.SideContent>
113
- }
114
- >
115
- <Typography.Text base="body" ellipsizeMode="tail" numberOfLines={2}>
116
- This is a long text, showcasing the ability of the ListItem component to have custom content. This one has two
117
- lines max, the rest will be ellipsed.
118
- </Typography.Text>
119
- </ListItem>
120
- </Section>
121
- </Story>
122
- ));
@@ -1,61 +0,0 @@
1
- import type { ReactElement, ReactNode } from 'react';
2
- import React from 'react';
3
- import type { PressableProps } from 'react-native';
4
- import { Pressable } from 'react-native';
5
- import styled from 'styled-components/native';
6
- import { ListItemContent } from './ListItemContent';
7
- import { ListItemSideContainer, ListItemSideContent } from './ListItemSideContent';
8
-
9
- type Borders = 'top' | 'bottom' | 'both';
10
-
11
- export interface ListItemProps extends PressableProps {
12
- children: NonNullable<ReactNode>;
13
- left?: ReactNode;
14
- right?: ReactNode;
15
- borders?: Borders;
16
- withPadding?: boolean;
17
- }
18
-
19
- interface ContainerViewProps extends Pick<ListItemProps, 'borders' | 'withPadding'> {}
20
-
21
- const ContainerView = styled.View<ContainerViewProps>`
22
- flex-direction: row;
23
- padding: ${({ withPadding, theme }) => (withPadding ? theme.kitt.listItem.padding : 0)};
24
- ${({ theme, borders }) => {
25
- const { borderWidth } = theme.kitt.listItem;
26
-
27
- if (borders === 'top') {
28
- return `border-top-width: ${borderWidth}`;
29
- }
30
-
31
- if (borders === 'bottom') {
32
- return `border-bottom-width: ${borderWidth}`;
33
- }
34
-
35
- if (borders === 'both') {
36
- return `border-top-width: ${borderWidth}; border-bottom-width: ${borderWidth}`;
37
- }
38
-
39
- return 'border: none';
40
- }};
41
- border-color: ${({ theme }) => theme.kitt.listItem.borderColor};
42
- background-color: ${({ theme }) => theme.kitt.colors.uiBackgroundLight};
43
- `;
44
-
45
- export function ListItem({ children, withPadding, borders, left, right, ...rest }: ListItemProps): ReactElement {
46
- return (
47
- <Pressable {...rest}>
48
- <ContainerView withPadding={withPadding} borders={borders}>
49
- {left ? <ListItemSideContainer side="left">{left}</ListItemSideContainer> : null}
50
-
51
- <ListItemContent>{children}</ListItemContent>
52
-
53
- {right ? <ListItemSideContainer side="right">{right}</ListItemSideContainer> : null}
54
- </ContainerView>
55
- </Pressable>
56
- );
57
- }
58
-
59
- ListItem.Content = ListItemContent;
60
- ListItem.SideContent = ListItemSideContent;
61
- ListItem.SideContainer = ListItemSideContainer;
@@ -1,17 +0,0 @@
1
- import type { ReactElement, ReactNode } from 'react';
2
- import React from 'react';
3
- import type { ViewProps } from 'react-native';
4
- import styled from 'styled-components/native';
5
-
6
- export interface ListItemContentProps extends ViewProps {
7
- children: NonNullable<ReactNode>;
8
- }
9
-
10
- const ContentView = styled.View`
11
- flex: 1 0 0%;
12
- align-self: center;
13
- `;
14
-
15
- export function ListItemContent({ children, ...rest }: ListItemContentProps): ReactElement {
16
- return <ContentView {...rest}>{children}</ContentView>;
17
- }
@@ -1,41 +0,0 @@
1
- import type { ReactElement, ReactNode } from 'react';
2
- import React from 'react';
3
- import type { ViewProps, ViewStyle } from 'react-native';
4
- import styled from 'styled-components/native';
5
-
6
- export interface ListItemSideContainerProps extends ViewProps {
7
- children: NonNullable<ReactNode>;
8
- side?: 'left' | 'right';
9
- }
10
-
11
- const SideContainerView = styled.View<ListItemSideContainerProps>`
12
- flex-direction: row;
13
- margin-left: ${({ theme, side }) => (side === 'right' ? theme.kitt.listItem.innerMargin : 0)};
14
- margin-right: ${({ theme, side }) => (side === 'left' ? theme.kitt.listItem.innerMargin : 0)};
15
- `;
16
-
17
- // Handles the vertical alignment of the side elements of the list item
18
- export function ListItemSideContainer({ children, side = 'left', ...rest }: ListItemSideContainerProps): ReactElement {
19
- return (
20
- <SideContainerView side={side} {...rest}>
21
- {children}
22
- </SideContainerView>
23
- );
24
- }
25
-
26
- export interface ListItemSideContentProps extends ViewProps {
27
- children: NonNullable<ReactNode>;
28
- align?: ViewStyle['alignSelf'];
29
- }
30
-
31
- const SideContentView = styled.View<ListItemSideContentProps>`
32
- align-self: ${({ align }) => align};
33
- `;
34
-
35
- export function ListItemSideContent({ children, align = 'auto', ...rest }: ListItemSideContentProps): ReactElement {
36
- return (
37
- <SideContentView align={align} {...rest}>
38
- {children}
39
- </SideContentView>
40
- );
41
- }