@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,22 +0,0 @@
1
- import type { ReactElement } from 'react';
2
- import React from 'react';
3
- import type { GestureResponderEvent } from 'react-native';
4
- import { StyleSheet, View } from 'react-native';
5
- import styled from 'styled-components/native';
6
-
7
- interface OverlayProps {
8
- onPress?: (event: GestureResponderEvent) => void;
9
- }
10
-
11
- const OverlayPressable = styled.Pressable(({ theme }) => ({
12
- ...StyleSheet.absoluteFillObject,
13
- backgroundColor: theme.kitt.colors.overlay.dark,
14
- }));
15
-
16
- export function Overlay({ onPress }: OverlayProps): ReactElement {
17
- return (
18
- <OverlayPressable onPress={onPress}>
19
- <View />
20
- </OverlayPressable>
21
- );
22
- }
@@ -1,18 +0,0 @@
1
- import { storiesOf } from '@storybook/react-native';
2
- import { Section, Story } from '@ornikar/kitt-universal';
3
- import React from 'react';
4
- import { Tag } from './Tag';
5
-
6
- storiesOf('kitt-universal/Data Display', module).add('Tag', () => (
7
- <Story title="Tag">
8
- <Section title="Default">
9
- <Tag label="Examen" />
10
- </Section>
11
- <Section title="Primary">
12
- <Tag type="primary" label="Examen" />
13
- </Section>
14
- <Section title="Danger">
15
- <Tag type="danger" label="Examen" />
16
- </Section>
17
- </Story>
18
- ));
package/src/Tag/Tag.tsx DELETED
@@ -1,31 +0,0 @@
1
- import type { ReactElement, ReactNode } from 'react';
2
- import React from 'react';
3
- import styled from 'styled-components/native';
4
- import { Typography } from '../typography/Typography';
5
-
6
- type TagType = 'primary' | 'default' | 'danger';
7
-
8
- export interface TagProps {
9
- label: ReactNode;
10
- type?: TagType;
11
- }
12
- interface ContainerProps {
13
- type: TagType;
14
- }
15
-
16
- const Container = styled.View<ContainerProps>`
17
- background-color: ${({ theme, type }) => theme.kitt.tag[type].backgroundColor};
18
- padding: ${({ theme }) => theme.kitt.tag.padding};
19
- border-radius: ${({ theme }) => theme.kitt.tag.borderRadius};
20
- align-self: flex-start;
21
- `;
22
-
23
- export function Tag({ label, type = 'default' }: TagProps): ReactElement {
24
- return (
25
- <Container type={type}>
26
- <Typography.Text base="body-xsmall" color={type === 'primary' ? 'primary-light' : undefined}>
27
- {label}
28
- </Typography.Text>
29
- </Container>
30
- );
31
- }
@@ -1,303 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`kitt-universal/Data Display Tag 1`] = `
4
- <RNCSafeAreaProvider
5
- onInsetsChange={[Function]}
6
- style={
7
- Array [
8
- Object {
9
- "flex": 1,
10
- },
11
- undefined,
12
- ]
13
- }
14
- >
15
- <RCTScrollView
16
- style={
17
- Array [
18
- Object {
19
- "paddingBottom": 10,
20
- "paddingLeft": 10,
21
- "paddingRight": 10,
22
- "paddingTop": 10,
23
- },
24
- ]
25
- }
26
- >
27
- <View>
28
- <View
29
- style={
30
- Array [
31
- Object {
32
- "marginBottom": 30,
33
- },
34
- ]
35
- }
36
- >
37
- <Text
38
- aria-level="1"
39
- color="black"
40
- isHeader={true}
41
- style={
42
- Array [
43
- Object {
44
- "color": "#000000",
45
- "fontFamily": "Moderat-Extended-Bold",
46
- "fontSize": 38,
47
- "fontStyle": "normal",
48
- "fontWeight": "400",
49
- "lineHeight": 49,
50
- "textDecorationColor": "#000000",
51
- },
52
- ]
53
- }
54
- type="header1"
55
- variant="bold"
56
- >
57
- Tag
58
- </Text>
59
- </View>
60
- <View
61
- style={
62
- Array [
63
- Object {
64
- "marginBottom": 30,
65
- },
66
- ]
67
- }
68
- >
69
- <View
70
- style={
71
- Array [
72
- Object {
73
- "marginBottom": 30,
74
- },
75
- ]
76
- }
77
- >
78
- <Text
79
- aria-level="2"
80
- color="black"
81
- isHeader={true}
82
- style={
83
- Array [
84
- Object {
85
- "color": "#000000",
86
- "fontFamily": "Moderat-Extended-Bold",
87
- "fontSize": 32,
88
- "fontStyle": "normal",
89
- "fontWeight": "400",
90
- "lineHeight": 42,
91
- "textDecorationColor": "#000000",
92
- },
93
- ]
94
- }
95
- type="header2"
96
- variant="bold"
97
- >
98
- Default
99
- </Text>
100
- </View>
101
- <View
102
- style={
103
- Array [
104
- Object {
105
- "alignSelf": "flex-start",
106
- "backgroundColor": "#F2F2F2",
107
- "borderRadius": 10,
108
- "paddingBottom": 2,
109
- "paddingLeft": 12,
110
- "paddingRight": 12,
111
- "paddingTop": 2,
112
- },
113
- ]
114
- }
115
- type="default"
116
- >
117
- <Text
118
- color="black"
119
- isHeader={false}
120
- style={
121
- Array [
122
- Object {
123
- "color": "#000000",
124
- "fontFamily": "NotoSans",
125
- "fontSize": 12,
126
- "fontStyle": "normal",
127
- "fontWeight": "400",
128
- "lineHeight": 19,
129
- "textDecorationColor": "#000000",
130
- },
131
- ]
132
- }
133
- type="body-xsmall"
134
- variant="regular"
135
- >
136
- Examen
137
- </Text>
138
- </View>
139
- </View>
140
- <View
141
- style={
142
- Array [
143
- Object {
144
- "marginBottom": 30,
145
- },
146
- ]
147
- }
148
- >
149
- <View
150
- style={
151
- Array [
152
- Object {
153
- "marginBottom": 30,
154
- },
155
- ]
156
- }
157
- >
158
- <Text
159
- aria-level="2"
160
- color="black"
161
- isHeader={true}
162
- style={
163
- Array [
164
- Object {
165
- "color": "#000000",
166
- "fontFamily": "Moderat-Extended-Bold",
167
- "fontSize": 32,
168
- "fontStyle": "normal",
169
- "fontWeight": "400",
170
- "lineHeight": 42,
171
- "textDecorationColor": "#000000",
172
- },
173
- ]
174
- }
175
- type="header2"
176
- variant="bold"
177
- >
178
- Primary
179
- </Text>
180
- </View>
181
- <View
182
- style={
183
- Array [
184
- Object {
185
- "alignSelf": "flex-start",
186
- "backgroundColor": "#EDEBFC",
187
- "borderRadius": 10,
188
- "paddingBottom": 2,
189
- "paddingLeft": 12,
190
- "paddingRight": 12,
191
- "paddingTop": 2,
192
- },
193
- ]
194
- }
195
- type="primary"
196
- >
197
- <Text
198
- color="primary-light"
199
- isHeader={false}
200
- style={
201
- Array [
202
- Object {
203
- "color": "#705DE6",
204
- "fontFamily": "NotoSans",
205
- "fontSize": 12,
206
- "fontStyle": "normal",
207
- "fontWeight": "400",
208
- "lineHeight": 19,
209
- "textDecorationColor": "#705DE6",
210
- },
211
- ]
212
- }
213
- type="body-xsmall"
214
- variant="regular"
215
- >
216
- Examen
217
- </Text>
218
- </View>
219
- </View>
220
- <View
221
- style={
222
- Array [
223
- Object {
224
- "marginBottom": 30,
225
- },
226
- ]
227
- }
228
- >
229
- <View
230
- style={
231
- Array [
232
- Object {
233
- "marginBottom": 30,
234
- },
235
- ]
236
- }
237
- >
238
- <Text
239
- aria-level="2"
240
- color="black"
241
- isHeader={true}
242
- style={
243
- Array [
244
- Object {
245
- "color": "#000000",
246
- "fontFamily": "Moderat-Extended-Bold",
247
- "fontSize": 32,
248
- "fontStyle": "normal",
249
- "fontWeight": "400",
250
- "lineHeight": 42,
251
- "textDecorationColor": "#000000",
252
- },
253
- ]
254
- }
255
- type="header2"
256
- variant="bold"
257
- >
258
- Danger
259
- </Text>
260
- </View>
261
- <View
262
- style={
263
- Array [
264
- Object {
265
- "alignSelf": "flex-start",
266
- "backgroundColor": "#F4D3CE",
267
- "borderRadius": 10,
268
- "paddingBottom": 2,
269
- "paddingLeft": 12,
270
- "paddingRight": 12,
271
- "paddingTop": 2,
272
- },
273
- ]
274
- }
275
- type="danger"
276
- >
277
- <Text
278
- color="black"
279
- isHeader={false}
280
- style={
281
- Array [
282
- Object {
283
- "color": "#000000",
284
- "fontFamily": "NotoSans",
285
- "fontSize": 12,
286
- "fontStyle": "normal",
287
- "fontWeight": "400",
288
- "lineHeight": 19,
289
- "textDecorationColor": "#000000",
290
- },
291
- ]
292
- }
293
- type="body-xsmall"
294
- variant="regular"
295
- >
296
- Examen
297
- </Text>
298
- </View>
299
- </View>
300
- </View>
301
- </RCTScrollView>
302
- </RNCSafeAreaProvider>
303
- `;
@@ -1,17 +0,0 @@
1
- import type { ReactElement, ReactNode } from 'react';
2
- import React from 'react';
3
- import { View } from 'react-native';
4
-
5
- export type TooltipPosition = 'bottom' | 'top' | 'left' | 'right';
6
-
7
- export interface TooltipProps {
8
- children: NonNullable<ReactNode>;
9
- content: NonNullable<ReactNode>;
10
- defaultVisible?: boolean;
11
- fullWidth?: boolean;
12
- position: TooltipPosition;
13
- }
14
-
15
- export function Tooltip({ children }: TooltipProps): ReactElement {
16
- return <View>{children}</View>;
17
- }
@@ -1,26 +0,0 @@
1
- import type { ReactElement } from 'react';
2
- import React from 'react';
3
- import type { SafeAreaViewProps } from 'react-native-safe-area-context';
4
- import { SafeAreaProvider as RNSafeAreaProvider } from 'react-native-safe-area-context';
5
-
6
- export * from 'react-native-safe-area-context';
7
-
8
- export const useSafeAreaInsets = (): { bottom: number; top: number; left: number; right: number } => ({
9
- top: 0,
10
- bottom: 0,
11
- right: 0,
12
- left: 0,
13
- });
14
-
15
- export function SafeAreaProvider({ children }: SafeAreaViewProps): ReactElement {
16
- return (
17
- <RNSafeAreaProvider
18
- initialMetrics={{
19
- frame: { x: 0, y: 0, width: 0, height: 0 },
20
- insets: { top: 0, left: 0, right: 0, bottom: 0 },
21
- }}
22
- >
23
- {children}
24
- </RNSafeAreaProvider>
25
- );
26
- }
@@ -1,17 +0,0 @@
1
- import { storiesOf } from '@storybook/react-native';
2
- import { InputFeedback, Section, Story } from '@ornikar/kitt-universal';
3
- import React from 'react';
4
-
5
- storiesOf('kitt-universal/Forms', module).add('Input Feedback', () => (
6
- <Story title="Input Feedback">
7
- <Section title="Demo">
8
- <InputFeedback>Le numéro NEPH est composé de 12 chiffres</InputFeedback>
9
- </Section>
10
- <Section title="Valid">
11
- <InputFeedback state="valid">{'Le numéro NEPH renseigné est valide\u00A0!'}</InputFeedback>
12
- </Section>
13
- <Section title="Invalid">
14
- <InputFeedback state="invalid">{'Le numéro NEPH comporte 12 caractères\u00A0!'}</InputFeedback>
15
- </Section>
16
- </Story>
17
- ));
@@ -1,28 +0,0 @@
1
- import type { ReactElement, ReactNode } from 'react';
2
- import React from 'react';
3
- import type { TypographyColor, TypographyProps } from '../../typography/Typography';
4
- import { Typography } from '../../typography/Typography';
5
- import type { InputFormState } from '../InputFormState';
6
-
7
- export interface InputFeedbackProps {
8
- state?: InputFormState;
9
- testID?: TypographyProps['testID'];
10
- children: NonNullable<ReactNode>;
11
- }
12
-
13
- const getColorFromState = (state?: InputFormState): TypographyColor => {
14
- switch (state) {
15
- case 'invalid':
16
- return 'danger';
17
- default:
18
- return 'grey';
19
- }
20
- };
21
-
22
- export function InputFeedback({ state, testID, children }: InputFeedbackProps): ReactElement {
23
- return (
24
- <Typography.Text base="body-small" color={getColorFromState(state)} testID={testID}>
25
- {children}
26
- </Typography.Text>
27
- );
28
- }