@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,34 +0,0 @@
1
- import type { WindowSizeHelper } from '../utils/windowSize/createWindowSizeHelper';
2
- import { avatarLateOceanTheme } from './late-ocean/avatarLateOceanTheme';
3
- import { buttonLateOceanTheme } from './late-ocean/buttonLateOceanTheme';
4
- import { cardLateOceanTheme } from './late-ocean/cardLateOceanTheme';
5
- import { colorsLateOceanTheme } from './late-ocean/colorsLateOceanTheme';
6
- import { feedbackMessageLateOceanTheme } from './late-ocean/feedbackMessageLateOceanTheme';
7
- import { formsLateOceanTheme } from './late-ocean/formLateOceanTheme';
8
- import { fullScreenModalLateOceanTheme } from './late-ocean/fullScreenModalLateOceanTheme';
9
- import { listItemLateOceanTheme } from './late-ocean/listItemLateOceanTheme';
10
- import { shadowsLateOceanTheme } from './late-ocean/shadowsLateOceanTheme';
11
- import { tagLateOceanTheme } from './late-ocean/tagLateOceanTheme';
12
- import { typographyLateOceanTheme } from './late-ocean/typographyLateOceanTheme';
13
- import { lateOceanColorPalette } from './palettes/lateOceanColorPalette';
14
-
15
- export const theme = {
16
- spacing: 4,
17
- colors: colorsLateOceanTheme,
18
- palettes: { lateOcean: lateOceanColorPalette },
19
- avatar: avatarLateOceanTheme,
20
- button: buttonLateOceanTheme,
21
- card: cardLateOceanTheme,
22
- feedbackMessage: feedbackMessageLateOceanTheme,
23
- forms: formsLateOceanTheme,
24
- typography: typographyLateOceanTheme,
25
- tag: tagLateOceanTheme,
26
- shadows: shadowsLateOceanTheme,
27
- fullScreenModal: fullScreenModalLateOceanTheme,
28
- listItem: listItemLateOceanTheme,
29
- };
30
-
31
- export type KittTheme = {
32
- kitt: typeof theme;
33
- responsive: WindowSizeHelper;
34
- } & Record<string, unknown>;
@@ -1,12 +0,0 @@
1
- import { lateOceanColorPalette } from '../palettes/lateOceanColorPalette';
2
-
3
- export const avatarLateOceanTheme = {
4
- default: {
5
- color: lateOceanColorPalette.white,
6
- backgroundColor: lateOceanColorPalette.lateOcean,
7
- },
8
- light: {
9
- color: lateOceanColorPalette.black1000,
10
- backgroundColor: lateOceanColorPalette.black100,
11
- },
12
- };
@@ -1,37 +0,0 @@
1
- import { lateOceanColorPalette } from '../palettes/lateOceanColorPalette';
2
-
3
- export const buttonLateOceanTheme = {
4
- borderRadius: '30px',
5
- borderWidth: '2px',
6
- minHeight: '42px',
7
- minWidth: '40px',
8
- maxWidth: '335px',
9
- iconSize: 18,
10
- contentPadding: {
11
- default: '8px 16px',
12
- },
13
- primary: {
14
- backgroundColor: lateOceanColorPalette.lateOcean,
15
- disabledBackgroundColor: lateOceanColorPalette.black50,
16
- pressedBackgroundColor: lateOceanColorPalette.lateOceanLight1,
17
- disabledBorderColor: lateOceanColorPalette.black100,
18
- },
19
- secondary: {
20
- backgroundColor: lateOceanColorPalette.black50,
21
- disabledBackgroundColor: lateOceanColorPalette.black50,
22
- pressedBackgroundColor: lateOceanColorPalette.black100,
23
- disabledBorderColor: lateOceanColorPalette.black100,
24
- },
25
- subtle: {
26
- backgroundColor: lateOceanColorPalette.transparent,
27
- disabledBackgroundColor: lateOceanColorPalette.transparent,
28
- pressedBackgroundColor: lateOceanColorPalette.transparent,
29
- disabledBorderColor: lateOceanColorPalette.transparent,
30
- },
31
- 'subtle-dark': {
32
- backgroundColor: lateOceanColorPalette.transparent,
33
- disabledBackgroundColor: lateOceanColorPalette.transparent,
34
- pressedBackgroundColor: lateOceanColorPalette.transparent,
35
- disabledBorderColor: lateOceanColorPalette.transparent,
36
- },
37
- };
@@ -1,19 +0,0 @@
1
- import { lateOceanColorPalette } from '../palettes/lateOceanColorPalette';
2
-
3
- export const cardLateOceanTheme = {
4
- borderRadius: '20px',
5
- borderWidth: '2px',
6
- padding: '16px',
7
- primary: {
8
- backgroundColor: lateOceanColorPalette.white,
9
- borderColor: lateOceanColorPalette.lateOcean,
10
- },
11
- secondary: {
12
- backgroundColor: lateOceanColorPalette.white,
13
- borderColor: lateOceanColorPalette.black100,
14
- },
15
- subtle: {
16
- backgroundColor: lateOceanColorPalette.black50,
17
- borderColor: lateOceanColorPalette.black100,
18
- },
19
- };
@@ -1,19 +0,0 @@
1
- import { lateOceanColorPalette } from '../palettes/lateOceanColorPalette';
2
-
3
- export const colorsLateOceanTheme = {
4
- primary: lateOceanColorPalette.lateOcean,
5
- accent: lateOceanColorPalette.warmEmbrace,
6
- accentLight: lateOceanColorPalette.warmEmbraceLight1,
7
- success: lateOceanColorPalette.viride,
8
- correct: lateOceanColorPalette.viride,
9
- danger: lateOceanColorPalette.englishVermillon,
10
- separator: lateOceanColorPalette.black100,
11
- hover: lateOceanColorPalette.black100,
12
- uiBackground: lateOceanColorPalette.black25,
13
- uiBackgroundLight: lateOceanColorPalette.white,
14
- overlay: {
15
- dark: 'rgba(41, 48, 51, 0.25)',
16
- light: 'rgba(255, 255, 255, 0.90)',
17
- fullscreenLoader: 'rgba(0, 0, 0, 0.25)',
18
- },
19
- };
@@ -1,10 +0,0 @@
1
- import { lateOceanColorPalette } from '../palettes/lateOceanColorPalette';
2
-
3
- export const feedbackMessageLateOceanTheme = {
4
- backgroundColors: {
5
- success: lateOceanColorPalette.viride,
6
- danger: lateOceanColorPalette.englishVermillon,
7
- warning: lateOceanColorPalette.goldCrayola,
8
- info: lateOceanColorPalette.aero,
9
- },
10
- };
@@ -1,9 +0,0 @@
1
- import { inputFieldLateOceanTheme } from './inputFieldLateOceanTheme';
2
- import { inputLateOceanTheme } from './inputLateOceanTheme';
3
- import { radioLateOceanTheme } from './radioLateOceanTheme';
4
-
5
- export const formsLateOceanTheme = {
6
- input: inputLateOceanTheme,
7
- radio: radioLateOceanTheme,
8
- inputField: inputFieldLateOceanTheme,
9
- };
@@ -1,9 +0,0 @@
1
- import { lateOceanColorPalette } from '../palettes/lateOceanColorPalette';
2
-
3
- export const fullScreenModalLateOceanTheme = {
4
- header: {
5
- paddingVertical: 12,
6
- paddingHorizontal: 16,
7
- borderColor: lateOceanColorPalette.black100,
8
- },
9
- };
@@ -1,4 +0,0 @@
1
- export const inputFieldLateOceanTheme = {
2
- labelContainerPaddingBottom: 5,
3
- iconMarginLeft: 6,
4
- };
@@ -1,55 +0,0 @@
1
- import type { InputTextState } from '../../forms/InputText/InputText';
2
- import { lateOceanColorPalette } from '../palettes/lateOceanColorPalette';
3
- import type { typographyLateOceanTheme } from './typographyLateOceanTheme';
4
-
5
- export type TypographyColor = keyof typeof typographyLateOceanTheme.colors;
6
- export interface InputStateStyle {
7
- backgroundColor?: string;
8
- borderColor: string;
9
- color: TypographyColor;
10
- passwordButtonIconColor: TypographyColor;
11
- }
12
-
13
- const inputStatesStyle: Record<InputTextState, InputStateStyle> = {
14
- default: {
15
- backgroundColor: lateOceanColorPalette.white,
16
- borderColor: lateOceanColorPalette.black100,
17
- color: 'black',
18
- passwordButtonIconColor: 'black',
19
- },
20
- hover: {
21
- borderColor: lateOceanColorPalette.black200,
22
- color: 'black',
23
- passwordButtonIconColor: 'black',
24
- },
25
- focus: {
26
- borderColor: lateOceanColorPalette.lateOcean,
27
- color: 'black',
28
- passwordButtonIconColor: 'black',
29
- },
30
- disabled: {
31
- backgroundColor: lateOceanColorPalette.black50,
32
- borderColor: lateOceanColorPalette.black100,
33
- color: 'black-light',
34
- passwordButtonIconColor: 'black-light',
35
- },
36
- invalid: {
37
- borderColor: lateOceanColorPalette.englishVermillon,
38
- color: 'black',
39
- passwordButtonIconColor: 'black',
40
- },
41
- };
42
-
43
- export const inputLateOceanTheme = {
44
- marginTop: '2px',
45
- marginBottom: '4px',
46
- borderWidth: '2px',
47
- borderRadius: '10px',
48
- passwordButtonIconSize: 20,
49
- padding: '7px 16px',
50
- paddingSingleLineIOS: '12px 16px',
51
- selectionColor: lateOceanColorPalette.lateOcean,
52
- placeholderColor: 'black-light' as const,
53
- textAreaMinHeight: 120,
54
- states: inputStatesStyle,
55
- };
@@ -1,8 +0,0 @@
1
- import { colorsLateOceanTheme } from './colorsLateOceanTheme';
2
-
3
- export const listItemLateOceanTheme = {
4
- padding: '12px 16px',
5
- borderColor: colorsLateOceanTheme.separator,
6
- borderWidth: '1px',
7
- innerMargin: '8px',
8
- };
@@ -1,19 +0,0 @@
1
- import { lateOceanColorPalette } from '../palettes/lateOceanColorPalette';
2
-
3
- export const radioLateOceanTheme = {
4
- size: 18,
5
- unchecked: {
6
- backgroundColor: lateOceanColorPalette.white,
7
- borderWidth: '2px',
8
- borderColor: lateOceanColorPalette.black200,
9
- },
10
- checked: {
11
- backgroundColor: lateOceanColorPalette.lateOcean,
12
- innerSize: 5,
13
- innerBackgroundColor: lateOceanColorPalette.white,
14
- },
15
- disabled: {
16
- backgroundColor: lateOceanColorPalette.black50,
17
- borderColor: lateOceanColorPalette.black100,
18
- },
19
- };
@@ -1,3 +0,0 @@
1
- export const shadowsLateOceanTheme = {
2
- medium: '0px 10px 20px rgba(41, 48, 51, 0.25)',
3
- };
@@ -1,17 +0,0 @@
1
- import { lateOceanColorPalette } from '../palettes/lateOceanColorPalette';
2
-
3
- export const tagLateOceanTheme = {
4
- borderRadius: '10px',
5
- padding: '2px 12px',
6
- primary: {
7
- // eslint-disable-next-line unicorn/expiring-todo-comments
8
- // TODO: validate Moon shadow color with design team
9
- backgroundColor: '#EDEBFC',
10
- },
11
- default: {
12
- backgroundColor: lateOceanColorPalette.black50,
13
- },
14
- danger: {
15
- backgroundColor: lateOceanColorPalette.warmEmbrace,
16
- },
17
- };
@@ -1,94 +0,0 @@
1
- import { Platform } from 'react-native';
2
- import { lateOceanColorPalette } from '../palettes/lateOceanColorPalette';
3
-
4
- const calcLineHeight = (fontSize: number, lineHeightMultiplier: number): number =>
5
- Math.round(fontSize * lineHeightMultiplier);
6
-
7
- export interface TypographyTypeConfig {
8
- baseAndSmall: {
9
- fontSize: string;
10
- lineHeight: string;
11
- };
12
- mediumAndWide: {
13
- fontSize: string;
14
- lineHeight: string;
15
- };
16
- }
17
-
18
- const createTypographyTypeConfig = (
19
- lineHeightMultiplier: number,
20
- baseAndSmallFontSize: number,
21
- mediumAndWideFontSize: number,
22
- ): TypographyTypeConfig => ({
23
- baseAndSmall: {
24
- fontSize: `${baseAndSmallFontSize}px`,
25
- lineHeight: `${calcLineHeight(lineHeightMultiplier, baseAndSmallFontSize)}px`,
26
- },
27
- mediumAndWide: {
28
- fontSize: `${mediumAndWideFontSize}px`,
29
- lineHeight: `${calcLineHeight(lineHeightMultiplier, baseAndSmallFontSize)}px`,
30
- },
31
- });
32
-
33
- export const typographyLateOceanTheme = {
34
- colors: {
35
- black: lateOceanColorPalette.black1000,
36
- 'black-light': lateOceanColorPalette.black555,
37
- grey: lateOceanColorPalette.black555,
38
- 'grey-light': lateOceanColorPalette.black200,
39
- white: lateOceanColorPalette.white,
40
- 'white-light': lateOceanColorPalette.white,
41
- primary: lateOceanColorPalette.lateOcean,
42
- 'primary-light': lateOceanColorPalette.lateOceanLight1,
43
- accent: lateOceanColorPalette.warmEmbrace,
44
- success: lateOceanColorPalette.viride,
45
- danger: lateOceanColorPalette.englishVermillon,
46
- },
47
- types: {
48
- headers: {
49
- fontFamily: {
50
- regular: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
51
- bold: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
52
- italic: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
53
- },
54
- fontWeight: 400,
55
- fontStyle: 'normal',
56
- configs: {
57
- // also known as xxlarge
58
- header1: createTypographyTypeConfig(1.3, 38, 62),
59
- // also known as xlarge
60
- header2: createTypographyTypeConfig(1.3, 32, 48),
61
- // also known as medium
62
- header3: createTypographyTypeConfig(1.3, 24, 36),
63
- // also known as xsmall
64
- header4: createTypographyTypeConfig(1.3, 18, 24),
65
- // also known as xxsmall
66
- header5: createTypographyTypeConfig(1.3, 18, 18),
67
- },
68
- },
69
- bodies: {
70
- fontFamily: {
71
- regular: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans',
72
- bold: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold',
73
- italic: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Italic',
74
- },
75
- fontWeight: {
76
- regular: 400,
77
- bold: 700,
78
- italic: 400,
79
- },
80
- fontStyle: {
81
- regular: 'normal',
82
- bold: 'normal',
83
- italic: 'italic',
84
- },
85
- configs: {
86
- 'body-large': createTypographyTypeConfig(1.6, 18, 24),
87
- 'body-medium': createTypographyTypeConfig(1.6, 18, 18),
88
- body: createTypographyTypeConfig(1.6, 16, 16),
89
- 'body-small': createTypographyTypeConfig(1.6, 14, 14),
90
- 'body-xsmall': createTypographyTypeConfig(1.6, 12, 12),
91
- },
92
- },
93
- },
94
- };
@@ -1,24 +0,0 @@
1
- export const lateOceanColorPalette = {
2
- lateOcean: '#4C34E0',
3
- lateOceanLight1: '#705DE6',
4
- lateOceanLight2: '#9485EC',
5
- lateOceanLight3: '#D6BAF9',
6
-
7
- warmEmbrace: '#F4D3CE',
8
- warmEmbraceLight1: '#FFEDE6',
9
-
10
- black1000: '#000000',
11
- black555: '#737373',
12
- black200: '#CCCCCC',
13
- black100: '#E5E5E5',
14
- black50: '#F2F2F2',
15
- black25: '#F9F9F9',
16
- white: '#FFFFFF',
17
-
18
- viride: '#38836D',
19
- englishVermillon: '#D44148',
20
- goldCrayola: '#F8C583',
21
- aero: '#89BDDD',
22
-
23
- transparent: 'transparent',
24
- };
@@ -1,6 +0,0 @@
1
- declare module '*.inline.svg' {
2
- import * as React from 'react';
3
-
4
- const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
5
- export default ReactComponent;
6
- }
@@ -1,6 +0,0 @@
1
- declare module '*.png' {
2
- import { ImageSourcePropType } from 'react-native';
3
-
4
- const src: ImageSourcePropType;
5
- export default src;
6
- }
@@ -1,113 +0,0 @@
1
- import { storiesOf } from '@storybook/react-native';
2
- import { Section, Story, StoryGrid } from '@ornikar/kitt-universal';
3
- import type { FC, ReactElement } from 'react';
4
- import React from 'react';
5
- import { useWindowDimensions } from 'react-native';
6
- import styled from 'styled-components/native';
7
- import type { BlockProps } from '../stories/Block';
8
- import { BlockWithPadding } from '../stories/Block';
9
- import type { TypographyProps, TypographyPropsWithoutRole } from './Typography';
10
- import { Typography } from './Typography';
11
-
12
- const groups: {
13
- background: BlockProps['color'];
14
- colors: [TypographyProps['color'], TypographyProps['color']];
15
- }[] = [
16
- { background: 'transparent', colors: ['black', 'black-light'] },
17
- { background: 'dark', colors: ['white', 'white-light'] },
18
- { background: 'transparent', colors: ['primary', 'accent'] },
19
- { background: 'transparent', colors: ['success', 'danger'] },
20
- ];
21
-
22
- const variants: NonNullable<TypographyProps['variant']>[] = ['bold', 'regular', 'italic'];
23
- const typographyTypes: { component: FC<TypographyPropsWithoutRole>; base: NonNullable<TypographyProps['base']> }[] = [
24
- { component: Typography.h1, base: 'header1' },
25
- { component: Typography.h1, base: 'header2' },
26
- { component: Typography.h1, base: 'header3' },
27
- { component: Typography.h1, base: 'header4' },
28
- { component: Typography.h1, base: 'header5' },
29
- { component: Typography.Text, base: 'body-large' },
30
- { component: Typography.Text, base: 'body-medium' },
31
- { component: Typography.Text, base: 'body' },
32
- { component: Typography.Text, base: 'body-small' },
33
- { component: Typography.Text, base: 'body-xsmall' },
34
- ];
35
-
36
- const ucFirst = (string: string): string => string[0].toUpperCase() + string.slice(1);
37
- const formatColorName = (colorName = 'black'): string => colorName.split('-').map(ucFirst).join('\u00A0');
38
-
39
- const BlockTitle = styled(Typography.Text)`
40
- overflow: hidden;
41
- margin-top: 10px;
42
- `;
43
-
44
- const ViewWithMarginTop = styled.View`
45
- overflow: hidden;
46
- margin-top: 10px;
47
- `;
48
-
49
- function TypographyStory(): ReactElement {
50
- // eslint-disable-next-line unicorn/expiring-todo-comments
51
- // TODO use useBreakpoint instead
52
- const { width } = useWindowDimensions();
53
-
54
- const isMediumOrHigher = width >= 768;
55
- return (
56
- <Story title="Typography Text">
57
- <Section.DemoSection>
58
- <Typography.Text base="body-large" color="black">
59
- The future is in{' '}
60
- <Typography.Text variant="bold">
61
- our <Typography.Text color="primary">hands</Typography.Text>
62
- </Typography.Text>{' '}
63
- to shape.
64
- </Typography.Text>
65
- </Section.DemoSection>
66
-
67
- {groups.map(({ background, colors }, index) => (
68
- <BlockWithPadding
69
- /* eslint-disable-next-line react/no-array-index-key */
70
- key={index}
71
- color={background}
72
- >
73
- <StoryGrid.Row breakpoint="medium">
74
- {colors.filter(Boolean).map((color) =>
75
- variants.map((variant, variantIndex) => (
76
- <StoryGrid.Col key={variant} title={isMediumOrHigher ? variant : undefined} titleColor={color}>
77
- {variantIndex === 0 || isMediumOrHigher ? (
78
- <BlockTitle base="header2" color={color} variant="bold">
79
- {variantIndex === 0 ? formatColorName(color) : '\u00A0'}
80
- </BlockTitle>
81
- ) : null}
82
- {typographyTypes.map(({ component: Component, base }) => {
83
- const isHeaderForbiddenVariant = base.startsWith('header') && variant !== 'bold';
84
- return !isMediumOrHigher && isHeaderForbiddenVariant ? null : (
85
- <ViewWithMarginTop key={base}>
86
- <Component
87
- color={color}
88
- variant={base.startsWith('h') && variant === 'regular' ? 'bold' : variant}
89
- base={base}
90
- >
91
- {isHeaderForbiddenVariant ? (
92
- <>{'\u00A0'}</>
93
- ) : (
94
- <>
95
- {base}
96
- {isMediumOrHigher ? null : `\u00A0/\u00A0${variant}`}
97
- </>
98
- )}
99
- </Component>
100
- </ViewWithMarginTop>
101
- );
102
- })}
103
- </StoryGrid.Col>
104
- )),
105
- )}
106
- </StoryGrid.Row>
107
- </BlockWithPadding>
108
- ))}
109
- </Story>
110
- );
111
- }
112
-
113
- storiesOf('kitt-universal/Typography', module).add('Text', () => <TypographyStory />);