@indico-data/design-system 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 (161) hide show
  1. package/.babelrc +27 -0
  2. package/.eslintignore +6 -0
  3. package/.eslintrc.js +63 -0
  4. package/.husky/pre-commit +4 -0
  5. package/.prettierignore +3 -0
  6. package/.prettierrc +6 -0
  7. package/.stackblitzrc +4 -0
  8. package/.storybook/indico-data-logo.svg +1 -0
  9. package/.storybook/main.ts +36 -0
  10. package/.storybook/preview-head.html +19 -0
  11. package/.storybook/preview.ts +24 -0
  12. package/.storybook/themes.js +24 -0
  13. package/.yarn/releases/yarn-classic.cjs +179386 -0
  14. package/.yarnrc.yml +1 -0
  15. package/README.md +30 -0
  16. package/package.json +79 -0
  17. package/src/components/Accordion/Accordion.stories.tsx +47 -0
  18. package/src/components/Accordion/Accordion.styles.ts +35 -0
  19. package/src/components/Accordion/Accordion.tsx +30 -0
  20. package/src/components/Accordion/index.ts +1 -0
  21. package/src/components/Icon/Icon.stories.tsx +60 -0
  22. package/src/components/Icon/Icon.tsx +75 -0
  23. package/src/components/Icon/faIcons.tsx +168 -0
  24. package/src/components/Icon/index.ts +2 -0
  25. package/src/components/Icon/indicons.tsx +699 -0
  26. package/src/components/Icon/storyHelpers.tsx +87 -0
  27. package/src/components/ListTable/Header/Header.styles.ts +62 -0
  28. package/src/components/ListTable/Header/Header.tsx +67 -0
  29. package/src/components/ListTable/Header/index.ts +1 -0
  30. package/src/components/ListTable/ListTable.stories.tsx +301 -0
  31. package/src/components/ListTable/ListTable.styles.ts +76 -0
  32. package/src/components/ListTable/ListTable.tsx +135 -0
  33. package/src/components/ListTable/index.ts +1 -0
  34. package/src/components/ListTable/mock-data/index.ts +1 -0
  35. package/src/components/ListTable/mock-data/mock-data.ts +291 -0
  36. package/src/components/Pagination/Pagination.stories.tsx +45 -0
  37. package/src/components/Pagination/Pagination.styles.ts +51 -0
  38. package/src/components/Pagination/Pagination.tsx +118 -0
  39. package/src/components/Pagination/index.ts +1 -0
  40. package/src/components/basic-section/Section/Section.stories.tsx +14 -0
  41. package/src/components/basic-section/Section/Section.styles.ts +8 -0
  42. package/src/components/basic-section/Section/Section.tsx +30 -0
  43. package/src/components/basic-section/Section/index.ts +1 -0
  44. package/src/components/basic-section/SectionBlock/SectionBlock.styles.ts +15 -0
  45. package/src/components/basic-section/SectionBlock/SectionBlock.tsx +37 -0
  46. package/src/components/basic-section/SectionBlock/index.ts +1 -0
  47. package/src/components/basic-section/SectionBody/SectionBody.stories.tsx +16 -0
  48. package/src/components/basic-section/SectionBody/SectionBody.styles.ts +18 -0
  49. package/src/components/basic-section/SectionBody/SectionBody.tsx +30 -0
  50. package/src/components/basic-section/SectionBody/index.ts +1 -0
  51. package/src/components/basic-section/SectionHeader/SectionHeader.stories.tsx +17 -0
  52. package/src/components/basic-section/SectionHeader/SectionHeader.styles.ts +5 -0
  53. package/src/components/basic-section/SectionHeader/SectionHeader.tsx +35 -0
  54. package/src/components/basic-section/SectionHeader/index.ts +1 -0
  55. package/src/components/basic-section/SectionTable/SectionTable.styles.ts +237 -0
  56. package/src/components/basic-section/SectionTable/SectionTable.tsx +229 -0
  57. package/src/components/basic-section/SectionTable/index.ts +1 -0
  58. package/src/components/basic-section/index.ts +5 -0
  59. package/src/components/buttons/Button/Button.stories.tsx +80 -0
  60. package/src/components/buttons/Button/Button.styles.ts +99 -0
  61. package/src/components/buttons/Button/Button.tsx +74 -0
  62. package/src/components/buttons/Button/index.ts +1 -0
  63. package/src/components/buttons/IconButton/IconButton.stories.tsx +96 -0
  64. package/src/components/buttons/IconButton/IconButton.styles.ts +78 -0
  65. package/src/components/buttons/IconButton/IconButton.tsx +109 -0
  66. package/src/components/buttons/IconButton/index.ts +1 -0
  67. package/src/components/buttons/commonStyles.ts +108 -0
  68. package/src/components/buttons/index.ts +2 -0
  69. package/src/components/buttons/types.ts +2 -0
  70. package/src/components/dropdowns/BorderSelect/BorderSelect.stories.tsx +22 -0
  71. package/src/components/dropdowns/BorderSelect/BorderSelect.styles.ts +73 -0
  72. package/src/components/dropdowns/BorderSelect/BorderSelect.tsx +85 -0
  73. package/src/components/dropdowns/BorderSelect/index.ts +1 -0
  74. package/src/components/dropdowns/MultiCombobox/MultiCombobox.stories.tsx +146 -0
  75. package/src/components/dropdowns/MultiCombobox/MultiCombobox.styles.ts +89 -0
  76. package/src/components/dropdowns/MultiCombobox/MultiCombobox.tsx +123 -0
  77. package/src/components/dropdowns/MultiCombobox/index.ts +1 -0
  78. package/src/components/dropdowns/Select/Select.stories.tsx +54 -0
  79. package/src/components/dropdowns/Select/Select.styles.ts +73 -0
  80. package/src/components/dropdowns/Select/Select.tsx +69 -0
  81. package/src/components/dropdowns/Select/index.ts +1 -0
  82. package/src/components/dropdowns/SingleCombobox/SingleCombobox.stories.tsx +61 -0
  83. package/src/components/dropdowns/SingleCombobox/SingleCombobox.styles.ts +56 -0
  84. package/src/components/dropdowns/SingleCombobox/SingleCombobox.tsx +103 -0
  85. package/src/components/dropdowns/SingleCombobox/index.ts +1 -0
  86. package/src/components/dropdowns/commonStyles.ts +65 -0
  87. package/src/components/dropdowns/index.ts +4 -0
  88. package/src/components/dropdowns/types.ts +45 -0
  89. package/src/components/dropdowns/useCombobox.ts +32 -0
  90. package/src/components/dropdowns/utils.tsx +25 -0
  91. package/src/components/index.ts +9 -0
  92. package/src/components/inputs/EditableInput/EditableInput.stories.tsx +26 -0
  93. package/src/components/inputs/EditableInput/EditableInput.styles.ts +21 -0
  94. package/src/components/inputs/EditableInput/EditableInput.tsx +103 -0
  95. package/src/components/inputs/EditableInput/index.ts +1 -0
  96. package/src/components/inputs/NumberInput/NumberInput.stories.tsx +72 -0
  97. package/src/components/inputs/NumberInput/NumberInput.styles.ts +66 -0
  98. package/src/components/inputs/NumberInput/NumberInput.tsx +153 -0
  99. package/src/components/inputs/NumberInput/index.ts +1 -0
  100. package/src/components/inputs/SearchInput/SearchInput.stories.tsx +17 -0
  101. package/src/components/inputs/SearchInput/SearchInput.styles.ts +25 -0
  102. package/src/components/inputs/SearchInput/SearchInput.tsx +47 -0
  103. package/src/components/inputs/SearchInput/index.ts +1 -0
  104. package/src/components/inputs/TextInput/TextInput.stories.tsx +104 -0
  105. package/src/components/inputs/TextInput/TextInput.styles.ts +74 -0
  106. package/src/components/inputs/TextInput/TextInput.tsx +116 -0
  107. package/src/components/inputs/TextInput/index.ts +1 -0
  108. package/src/components/inputs/index.ts +4 -0
  109. package/src/components/inputs/inputsCommon.styles.ts +61 -0
  110. package/src/components/loading-indicators/BarSpinner/BarSpinner.stories.tsx +14 -0
  111. package/src/components/loading-indicators/BarSpinner/BarSpinner.styles.ts +53 -0
  112. package/src/components/loading-indicators/BarSpinner/BarSpinner.tsx +21 -0
  113. package/src/components/loading-indicators/BarSpinner/index.ts +1 -0
  114. package/src/components/loading-indicators/CirclePulse/CirclePulse.stories.tsx +22 -0
  115. package/src/components/loading-indicators/CirclePulse/CirclePulse.styles.ts +81 -0
  116. package/src/components/loading-indicators/CirclePulse/CirclePulse.tsx +61 -0
  117. package/src/components/loading-indicators/CirclePulse/index.ts +1 -0
  118. package/src/components/loading-indicators/CircleSpinner/CircleSpinner.stories.tsx +16 -0
  119. package/src/components/loading-indicators/CircleSpinner/CircleSpinner.tsx +37 -0
  120. package/src/components/loading-indicators/CircleSpinner/index.ts +1 -0
  121. package/src/components/loading-indicators/LoadingList/LoadingList.stories.tsx +14 -0
  122. package/src/components/loading-indicators/LoadingList/LoadingList.styles.ts +42 -0
  123. package/src/components/loading-indicators/LoadingList/LoadingList.tsx +9 -0
  124. package/src/components/loading-indicators/LoadingList/index.ts +1 -0
  125. package/src/components/loading-indicators/PercentageRing/PercentageRing.stories.tsx +18 -0
  126. package/src/components/loading-indicators/PercentageRing/PercentageRing.styles.ts +27 -0
  127. package/src/components/loading-indicators/PercentageRing/PercentageRing.tsx +76 -0
  128. package/src/components/loading-indicators/PercentageRing/index.ts +1 -0
  129. package/src/components/loading-indicators/RandomLoadingMessage/RandomLoadingMessage.stories.tsx +16 -0
  130. package/src/components/loading-indicators/RandomLoadingMessage/RandomLoadingMessage.tsx +18 -0
  131. package/src/components/loading-indicators/RandomLoadingMessage/index.ts +1 -0
  132. package/src/components/loading-indicators/RandomLoadingMessage/random-messages.js +67 -0
  133. package/src/components/loading-indicators/index.ts +6 -0
  134. package/src/components/user-feedback/Shrug/Shrug.stories.tsx +38 -0
  135. package/src/components/user-feedback/Shrug/Shrug.styles.ts +23 -0
  136. package/src/components/user-feedback/Shrug/Shrug.tsx +44 -0
  137. package/src/components/user-feedback/Shrug/index.ts +1 -0
  138. package/src/components/user-feedback/index.ts +1 -0
  139. package/src/index.tsx +18 -0
  140. package/src/styles/globals/buttons.ts +154 -0
  141. package/src/styles/globals/forms.ts +103 -0
  142. package/src/styles/globals/index.tsx +25 -0
  143. package/src/styles/globals/layout.ts +25 -0
  144. package/src/styles/globals/lists.ts +23 -0
  145. package/src/styles/globals/margin-padding.ts +33 -0
  146. package/src/styles/globals/media.ts +13 -0
  147. package/src/styles/globals/tables.ts +34 -0
  148. package/src/styles/globals/typography.ts +95 -0
  149. package/src/styles/globals/utility-classes.ts +76 -0
  150. package/src/tokens/animation.ts +6 -0
  151. package/src/tokens/breakpoints.ts +11 -0
  152. package/src/tokens/colors.ts +279 -0
  153. package/src/tokens/index.ts +20 -0
  154. package/src/tokens/margin.ts +5 -0
  155. package/src/tokens/numbers.js +41 -0
  156. package/src/tokens/padding.ts +5 -0
  157. package/src/tokens/spacings.ts +5 -0
  158. package/src/tokens/typography.ts +37 -0
  159. package/src/types.ts +6 -0
  160. package/tsconfig.json +13 -0
  161. package/webpack.config.js +35 -0
package/.babelrc ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "presets": [
3
+ [
4
+ "@babel/preset-env",
5
+ {
6
+ "targets": {
7
+ "chrome": "100"
8
+ }
9
+ }
10
+ ],
11
+ [
12
+ "@babel/preset-react",
13
+ {
14
+ "runtime": "automatic"
15
+ }
16
+ ],
17
+ "@babel/preset-typescript"
18
+ ],
19
+ "plugins": [
20
+ [
21
+ "babel-plugin-styled-components",
22
+ {
23
+ "ssr": false
24
+ }
25
+ ]
26
+ ]
27
+ }
package/.eslintignore ADDED
@@ -0,0 +1,6 @@
1
+ node_modules/
2
+ build/
3
+ dist/
4
+ webpack.config.js
5
+ jest.config.js
6
+ scripts/
package/.eslintrc.js ADDED
@@ -0,0 +1,63 @@
1
+ module.exports = {
2
+ env: {
3
+ browser: true,
4
+ es2021: true,
5
+ },
6
+ extends: [
7
+ 'eslint:recommended',
8
+ 'plugin:@typescript-eslint/recommended',
9
+ 'plugin:react/recommended',
10
+ ],
11
+ overrides: [
12
+ {
13
+ env: {
14
+ node: true,
15
+ },
16
+ files: ['.eslintrc.{js,cjs}'],
17
+ parserOptions: {
18
+ sourceType: 'script',
19
+ },
20
+ },
21
+ ],
22
+ parser: '@typescript-eslint/parser',
23
+ parserOptions: {
24
+ ecmaVersion: 'latest',
25
+ sourceType: 'module',
26
+ },
27
+ plugins: ['@typescript-eslint', 'react'],
28
+ rules: {
29
+ 'no-debugger': 'error',
30
+ 'no-console': ['error', { allow: ['warn', 'error', 'info'] }],
31
+ 'react-hooks/rules-of-hooks': 'error',
32
+ 'react-hooks/exhaustive-deps': 'off',
33
+ 'react/prop-types': 'off',
34
+ 'react/display-name': 'off',
35
+ 'react/no-unescaped-entities': 'off',
36
+ 'react/no-string-refs': 'off',
37
+ semi: 'warn',
38
+ 'no-unused-expressions': 'off',
39
+ eqeqeq: ['error', 'always'],
40
+ 'prefer-const': 'warn',
41
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
42
+ '@typescript-eslint/no-explicit-any': 'off',
43
+ '@typescript-eslint/no-empty-function': 'off',
44
+ '@typescript-eslint/no-inferrable-types': 'off',
45
+ '@typescript-eslint/no-var-requires': 'off',
46
+ '@typescript-eslint/ban-ts-comment': 'off',
47
+ '@typescript-eslint/ban-types': 'off',
48
+ '@typescript-eslint/no-this-alias': 'off',
49
+ '@typescript-eslint/no-unused-vars': ['error', { args: 'after-used', argsIgnorePattern: '^_' }],
50
+ '@typescript-eslint/no-non-null-assertion': 'off',
51
+ 'max-len': [
52
+ 'warn',
53
+ {
54
+ code: 100,
55
+ ignoreComments: true,
56
+ ignoreTrailingComments: true,
57
+ ignoreUrls: true,
58
+ ignoreStrings: true,
59
+ ignoreTemplateLiterals: true,
60
+ },
61
+ ],
62
+ },
63
+ };
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ npx lint-staged
@@ -0,0 +1,3 @@
1
+ # Ignore artifacts:
2
+ build
3
+ coverage
package/.prettierrc ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "tabWidth": 2,
3
+ "printWidth": 100,
4
+ "singleQuote": true,
5
+ "semi": true
6
+ }
package/.stackblitzrc ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "installDependencies": true,
3
+ "startCommand": "yarn storybook"
4
+ }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 202 73" height="107.499999" width="300"><title>Indico Data</title><path d="M115 71.5h-8.7V50.3h8.7c5.9 0 10.6 4.8 10.6 10.6s-4.7 10.6-10.6 10.6zm-3.9-4.8h3.9c3.2 0 5.8-2.6 5.8-5.8s-2.6-5.8-5.8-5.8h-3.9v11.6zM173 50.3h-16.5v4.5h5.8v16.8h4.8V54.7h5.8l.1-4.4zm-34.3 0L131 71.5h5.1l1.3-3.5h8.3l1.3 3.5h5.1l-7.7-21.2h-5.7zm.3 13.2l2.5-7 2.5 7h-5zm46.6-13.2l-7.7 21.2h5.1l1.3-3.5h8.3l1.3 3.5h5.1l-7.7-21.2h-5.7zm.3 13.2l2.5-7 2.5 7h-5z" fill="#000"></path><path d="M9.3 1.4v41.3H1V1.4h8.3zm133.2 41.5c5.6 0 10.9-2.2 14.8-6.2l-5.9-5.9c-2.4 2.4-5.6 3.7-9 3.7s-6.5-1.3-8.9-3.7-3.7-5.5-3.7-8.9 1.3-6.6 3.7-9c4.9-4.9 13-5 17.9-.1l5.9-5.9c-8-8-21.3-7.9-29.5.3-4 4-6.2 9.2-6.2 14.8s2.2 10.9 6.1 14.8c3.9 4 9.2 6.1 14.8 6.1zM100.3 22c0-11.4-9.3-20.6-20.7-20.6H62.9v41.2h16.8c11.3 0 20.6-9.3 20.6-20.6zM71.2 9.7h8.4C86.4 9.7 92 15.2 92 22s-5.5 12.3-12.3 12.3h-8.4l-.1-24.6zm112.1 9.2h-6.2v6.2h6.2v-6.2zm-77 6.2v17.5h8.3V25.1h-8.3zm8.4-6.2V1.4h-8.3V19h8.3v-.1zm53.2 0c1.4-5.5 6.4-9.5 12.3-9.5s10.9 4.1 12.3 9.5h8.5C199.5 8.8 190.7 1 180.2 1s-19.3 7.8-20.8 17.9h8.5zm24.6 6.2c-1.4 5.4-6.4 9.5-12.3 9.5s-10.9-4-12.3-9.5h-8.5c1.5 10.1 10.3 17.8 20.8 17.8s19.3-7.8 20.8-17.8h-8.5zM46.3 1.4v28.1L26.7 1.4h-9.2v41.3h8.3v-28l19.5 28h9.3V1.4h-8.3z" fill="#0070f5"></path></svg>
@@ -0,0 +1,36 @@
1
+ import type { StorybookConfig } from '@storybook/react-webpack5';
2
+
3
+ const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
4
+
5
+ const config: StorybookConfig = {
6
+ stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
7
+ addons: [
8
+ '@storybook/addon-links',
9
+ '@storybook/addon-essentials',
10
+ '@storybook/addon-onboarding',
11
+ '@storybook/addon-interactions',
12
+ '@storybook/addon-themes',
13
+ '@storybook/addon-a11y',
14
+ '@storybook/addon-styling',
15
+ '@storybook/addon-docs',
16
+ ],
17
+ webpackFinal: async (config) => {
18
+ if (config.resolve) {
19
+ config.resolve.plugins = [
20
+ ...(config.resolve.plugins || []),
21
+ new TsconfigPathsPlugin({
22
+ extensions: config.resolve.extensions,
23
+ }),
24
+ ];
25
+ }
26
+ return config;
27
+ },
28
+ framework: {
29
+ name: '@storybook/react-webpack5',
30
+ options: {},
31
+ },
32
+ docs: {
33
+ autodocs: 'tag',
34
+ },
35
+ };
36
+ export default config;
@@ -0,0 +1,19 @@
1
+ <link href="https://fonts.googleapis.com/css?family=Noto+Sans" rel="stylesheet" />
2
+
3
+ <style>
4
+ button[title='Zoom in'],
5
+ button[title='Zoom out'],
6
+ button[title='Reset zoom'] {
7
+ background-color: transparent;
8
+ box-shadow: none;
9
+ padding: 0.75em 1em;
10
+ }
11
+
12
+ input[type='number'] {
13
+ background-color: revert;
14
+ }
15
+
16
+ .sbdocs.sbdocs-content {
17
+ max-width: 1200px;
18
+ }
19
+ </style>
@@ -0,0 +1,24 @@
1
+ import type { Preview } from '@storybook/react';
2
+
3
+ import { withThemeFromJSXProvider } from '@storybook/addon-themes';
4
+ import { GlobalStyles } from '../src/styles/globals';
5
+
6
+ export const decorators = [
7
+ withThemeFromJSXProvider({
8
+ GlobalStyles, // Adds your GlobalStyle component to all stories
9
+ }),
10
+ ];
11
+
12
+ const preview: Preview = {
13
+ parameters: {
14
+ actions: { argTypesRegex: '^on[A-Z].*' },
15
+ controls: {
16
+ matchers: {
17
+ color: /(background|color)$/i,
18
+ date: /Date$/i,
19
+ },
20
+ },
21
+ },
22
+ };
23
+
24
+ export default preview;
@@ -0,0 +1,24 @@
1
+ import { create } from '@storybook/theming/create';
2
+
3
+ import indicoDataLogo from './indico-data-logo.svg';
4
+
5
+ export const lightTheme = create({
6
+ // UI
7
+ appBorderRadius: 4,
8
+
9
+ // Typography
10
+ fontBase: 'Noto Sans, Avenir Next, Avenir, Noto, sans-serif',
11
+ fontCode: 'monospace',
12
+
13
+ // Form colors
14
+ inputBorderRadius: 4,
15
+
16
+ brandTitle: 'indico',
17
+ brandUrl: 'indicodata.ai',
18
+
19
+ base: 'light',
20
+
21
+ appBg: 'rgba(132,152,182,0.2)',
22
+
23
+ brandImage: indicoDataLogo,
24
+ });