@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,19 +0,0 @@
1
- import { useState } from 'react';
2
-
3
- export const useInputText = (): {
4
- isFocused: boolean;
5
- handleInputFocus: () => void;
6
- handleInputBlur: () => void;
7
- isPasswordVisible: boolean;
8
- togglePasswordVisibility: () => void;
9
- } => {
10
- const [isFocused, setIsFocused] = useState<boolean>(false);
11
- const [isPasswordVisible, setIsPasswordVisible] = useState<boolean>(false);
12
-
13
- const handleInputFocus = (): void => setIsFocused(true);
14
- const handleInputBlur = (): void => setIsFocused(false);
15
-
16
- const togglePasswordVisibility = (): void => setIsPasswordVisible((isVisible) => !isVisible);
17
-
18
- return { isFocused, handleInputFocus, handleInputBlur, togglePasswordVisibility, isPasswordVisible };
19
- };
@@ -1,14 +0,0 @@
1
- import { storiesOf } from '@storybook/react-native';
2
- import { Section, Story } from '@ornikar/kitt-universal';
3
- import React from 'react';
4
- import { InputText } from '../InputText/InputText';
5
- import { Label } from './Label';
6
-
7
- storiesOf('kitt-universal/Forms', module).add('Label', () => (
8
- <Story title="Label">
9
- <Section title="Demo">
10
- <Label htmlFor="fake-id">Mon adresse</Label>
11
- <InputText type="text" nativeID="fake-id" />
12
- </Section>
13
- </Story>
14
- ));
@@ -1,17 +0,0 @@
1
- import type { ReactElement, ReactNode } from 'react';
2
- import React from 'react';
3
- import { Platform } from 'react-native';
4
- import { Typography } from '../../typography/Typography';
5
-
6
- export interface LabelProps {
7
- htmlFor: string;
8
- children: NonNullable<ReactNode>;
9
- }
10
-
11
- export function Label({ htmlFor, children }: LabelProps): ReactElement {
12
- return (
13
- <Typography.Text base="body">
14
- {Platform.OS === 'web' ? <label htmlFor={htmlFor}>{children}</label> : children}
15
- </Typography.Text>
16
- );
17
- }
@@ -1,174 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`kitt-universal/Forms Label 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
- Label
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
- Demo
99
- </Text>
100
- </View>
101
- <Text
102
- color="black"
103
- isHeader={false}
104
- style={
105
- Array [
106
- Object {
107
- "color": "#000000",
108
- "fontFamily": "NotoSans",
109
- "fontSize": 16,
110
- "fontStyle": "normal",
111
- "fontWeight": "400",
112
- "lineHeight": 26,
113
- "textDecorationColor": "#000000",
114
- },
115
- ]
116
- }
117
- type="body"
118
- variant="regular"
119
- >
120
- Mon adresse
121
- </Text>
122
- <View
123
- style={
124
- Array [
125
- Object {
126
- "marginBottom": 4,
127
- "marginTop": 2,
128
- },
129
- ]
130
- }
131
- >
132
- <TextInput
133
- allowFontScaling={true}
134
- autoCompleteType="off"
135
- autoCorrect={true}
136
- editable={true}
137
- keyboardType="default"
138
- minHeight={0}
139
- nativeID="fake-id"
140
- onBlur={[Function]}
141
- onFocus={[Function]}
142
- placeholderTextColor="#737373"
143
- rejectResponderTermination={true}
144
- secureTextEntry={false}
145
- selectionColor="#4C34E0"
146
- state="default"
147
- style={
148
- Array [
149
- Object {
150
- "backgroundColor": "#FFFFFF",
151
- "borderColor": "#E5E5E5",
152
- "borderRadius": 10,
153
- "borderWidth": 2,
154
- "color": "#000000",
155
- "fontFamily": "NotoSans",
156
- "fontSize": 16,
157
- "lineHeight": 0,
158
- "minHeight": 0,
159
- "paddingBottom": 12,
160
- "paddingLeft": 16,
161
- "paddingRight": 16,
162
- "paddingTop": 12,
163
- },
164
- ]
165
- }
166
- textContentType="none"
167
- underlineColorAndroid="transparent"
168
- />
169
- </View>
170
- </View>
171
- </View>
172
- </RCTScrollView>
173
- </RNCSafeAreaProvider>
174
- `;
@@ -1,48 +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 { Radio } from './Radio';
6
-
7
- storiesOf('kitt-universal/Forms', module).add('Radio', () => (
8
- <Story title="Radio">
9
- <Section.DemoSection>
10
- <Radio id="radio-demo" name="radio-demo" value="value" onChange={action('change')}>
11
- Placeholder
12
- </Radio>
13
- </Section.DemoSection>
14
-
15
- <Section title="Unchecked">
16
- <Section.SubSection title="default">
17
- <Radio id="unchecked-default" name="unchecked-default" value="value" onChange={action('change')} />
18
- </Section.SubSection>
19
- <Section.SubSection title="with text">
20
- <Radio id="unchecked-with-text" name="unchecked-with-text" value="value" onChange={action('change')}>
21
- Placeholder
22
- </Radio>
23
- </Section.SubSection>
24
- </Section>
25
-
26
- <Section title="Checked">
27
- <Section.SubSection title="default">
28
- <Radio checked id="checked-default" name="checked-default" value="value" onChange={action('change')} />
29
- </Section.SubSection>
30
- <Section.SubSection title="with text">
31
- <Radio checked id="checked-with-text" name="checked-with-text" value="value" onChange={action('change')}>
32
- Placeholder
33
- </Radio>
34
- </Section.SubSection>
35
- </Section>
36
-
37
- <Section title="Disabled">
38
- <Section.SubSection title="default">
39
- <Radio disabled id="disabled-default" name="disabled-default" value="value" onChange={action('change')} />
40
- </Section.SubSection>
41
- <Section.SubSection title="with text">
42
- <Radio disabled id="disabled-with-text" name="disabled-with-text" value="value" onChange={action('change')}>
43
- Placeholder
44
- </Radio>
45
- </Section.SubSection>
46
- </Section>
47
- </Story>
48
- ));
@@ -1,81 +0,0 @@
1
- import type { ReactElement, ReactNode } from 'react';
2
- import React from 'react';
3
- import type { PressableProps } from 'react-native';
4
- import styled from 'styled-components/native';
5
- import { Typography } from '../../typography/Typography';
6
-
7
- export interface RadioProps {
8
- id: string;
9
- name: string;
10
- checked?: boolean;
11
- disabled?: boolean;
12
- right?: boolean;
13
- children?: NonNullable<ReactNode>;
14
- value: string;
15
- onChange: (newValue: string) => void;
16
- }
17
-
18
- interface OuterRadioProps {
19
- disabled: boolean;
20
- }
21
-
22
- const OuterRadio = styled.View<OuterRadioProps>`
23
- background-color: ${({ theme, disabled }) =>
24
- theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].backgroundColor};
25
- width: ${({ theme }) => theme.kitt.forms.radio.size}px;
26
- height: ${({ theme }) => theme.kitt.forms.radio.size}px;
27
- border-radius: ${({ theme }) => theme.kitt.forms.radio.size / 2}px;
28
- border-width: ${({ theme }) => theme.kitt.forms.radio.unchecked.borderWidth};
29
- border-color: ${({ theme, disabled }) => theme.kitt.forms.radio[disabled ? 'disabled' : 'unchecked'].borderColor};
30
- `;
31
- const SelectedOuterRadio = styled.View`
32
- background-color: ${({ theme }) => theme.kitt.forms.radio.checked.backgroundColor};
33
- width: ${({ theme }) => theme.kitt.forms.radio.size}px;
34
- height: ${({ theme }) => theme.kitt.forms.radio.size}px;
35
- border-radius: ${({ theme }) => theme.kitt.forms.radio.size / 2}px;
36
- justify-content: center;
37
- align-items: center;
38
- `;
39
- const SelectedInnerRadio = styled.View`
40
- background-color: ${({ theme }) => theme.kitt.forms.radio.checked.innerBackgroundColor};
41
- width: ${({ theme }) => theme.kitt.forms.radio.checked.innerSize}px;
42
- height: ${({ theme }) => theme.kitt.forms.radio.checked.innerSize}px;
43
- border-radius: ${({ theme }) => theme.kitt.forms.radio.checked.innerSize / 2}px;
44
- `;
45
- const Container = styled.Pressable`
46
- flex-direction: row;
47
- align-items: center;
48
- `;
49
-
50
- const Text = styled(Typography.Text)`
51
- margin-left: ${({ theme }) => theme.kitt.spacing * 2}px;
52
- `;
53
-
54
- export function Radio({ id, checked, onChange, value, disabled = false, children }: RadioProps): ReactElement {
55
- const handlePress: PressableProps['onPress'] = () => {
56
- onChange(value);
57
- };
58
-
59
- return (
60
- <Container
61
- nativeID={id}
62
- disabled={disabled}
63
- accessibilityRole="radio"
64
- aria-checked={checked}
65
- accessible={checked && !disabled}
66
- onPress={handlePress}
67
- >
68
- {checked && !disabled ? (
69
- <SelectedOuterRadio>
70
- <SelectedInnerRadio />
71
- </SelectedOuterRadio>
72
- ) : (
73
- <OuterRadio disabled={disabled} />
74
- )}
75
-
76
- <Text base="body" color={disabled ? 'black-light' : 'black'}>
77
- {children}
78
- </Text>
79
- </Container>
80
- );
81
- }