@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.
- package/.babelrc +27 -0
- package/.eslintignore +6 -0
- package/.eslintrc.js +63 -0
- package/.husky/pre-commit +4 -0
- package/.prettierignore +3 -0
- package/.prettierrc +6 -0
- package/.stackblitzrc +4 -0
- package/.storybook/indico-data-logo.svg +1 -0
- package/.storybook/main.ts +36 -0
- package/.storybook/preview-head.html +19 -0
- package/.storybook/preview.ts +24 -0
- package/.storybook/themes.js +24 -0
- package/.yarn/releases/yarn-classic.cjs +179386 -0
- package/.yarnrc.yml +1 -0
- package/README.md +30 -0
- package/package.json +79 -0
- package/src/components/Accordion/Accordion.stories.tsx +47 -0
- package/src/components/Accordion/Accordion.styles.ts +35 -0
- package/src/components/Accordion/Accordion.tsx +30 -0
- package/src/components/Accordion/index.ts +1 -0
- package/src/components/Icon/Icon.stories.tsx +60 -0
- package/src/components/Icon/Icon.tsx +75 -0
- package/src/components/Icon/faIcons.tsx +168 -0
- package/src/components/Icon/index.ts +2 -0
- package/src/components/Icon/indicons.tsx +699 -0
- package/src/components/Icon/storyHelpers.tsx +87 -0
- package/src/components/ListTable/Header/Header.styles.ts +62 -0
- package/src/components/ListTable/Header/Header.tsx +67 -0
- package/src/components/ListTable/Header/index.ts +1 -0
- package/src/components/ListTable/ListTable.stories.tsx +301 -0
- package/src/components/ListTable/ListTable.styles.ts +76 -0
- package/src/components/ListTable/ListTable.tsx +135 -0
- package/src/components/ListTable/index.ts +1 -0
- package/src/components/ListTable/mock-data/index.ts +1 -0
- package/src/components/ListTable/mock-data/mock-data.ts +291 -0
- package/src/components/Pagination/Pagination.stories.tsx +45 -0
- package/src/components/Pagination/Pagination.styles.ts +51 -0
- package/src/components/Pagination/Pagination.tsx +118 -0
- package/src/components/Pagination/index.ts +1 -0
- package/src/components/basic-section/Section/Section.stories.tsx +14 -0
- package/src/components/basic-section/Section/Section.styles.ts +8 -0
- package/src/components/basic-section/Section/Section.tsx +30 -0
- package/src/components/basic-section/Section/index.ts +1 -0
- package/src/components/basic-section/SectionBlock/SectionBlock.styles.ts +15 -0
- package/src/components/basic-section/SectionBlock/SectionBlock.tsx +37 -0
- package/src/components/basic-section/SectionBlock/index.ts +1 -0
- package/src/components/basic-section/SectionBody/SectionBody.stories.tsx +16 -0
- package/src/components/basic-section/SectionBody/SectionBody.styles.ts +18 -0
- package/src/components/basic-section/SectionBody/SectionBody.tsx +30 -0
- package/src/components/basic-section/SectionBody/index.ts +1 -0
- package/src/components/basic-section/SectionHeader/SectionHeader.stories.tsx +17 -0
- package/src/components/basic-section/SectionHeader/SectionHeader.styles.ts +5 -0
- package/src/components/basic-section/SectionHeader/SectionHeader.tsx +35 -0
- package/src/components/basic-section/SectionHeader/index.ts +1 -0
- package/src/components/basic-section/SectionTable/SectionTable.styles.ts +237 -0
- package/src/components/basic-section/SectionTable/SectionTable.tsx +229 -0
- package/src/components/basic-section/SectionTable/index.ts +1 -0
- package/src/components/basic-section/index.ts +5 -0
- package/src/components/buttons/Button/Button.stories.tsx +80 -0
- package/src/components/buttons/Button/Button.styles.ts +99 -0
- package/src/components/buttons/Button/Button.tsx +74 -0
- package/src/components/buttons/Button/index.ts +1 -0
- package/src/components/buttons/IconButton/IconButton.stories.tsx +96 -0
- package/src/components/buttons/IconButton/IconButton.styles.ts +78 -0
- package/src/components/buttons/IconButton/IconButton.tsx +109 -0
- package/src/components/buttons/IconButton/index.ts +1 -0
- package/src/components/buttons/commonStyles.ts +108 -0
- package/src/components/buttons/index.ts +2 -0
- package/src/components/buttons/types.ts +2 -0
- package/src/components/dropdowns/BorderSelect/BorderSelect.stories.tsx +22 -0
- package/src/components/dropdowns/BorderSelect/BorderSelect.styles.ts +73 -0
- package/src/components/dropdowns/BorderSelect/BorderSelect.tsx +85 -0
- package/src/components/dropdowns/BorderSelect/index.ts +1 -0
- package/src/components/dropdowns/MultiCombobox/MultiCombobox.stories.tsx +146 -0
- package/src/components/dropdowns/MultiCombobox/MultiCombobox.styles.ts +89 -0
- package/src/components/dropdowns/MultiCombobox/MultiCombobox.tsx +123 -0
- package/src/components/dropdowns/MultiCombobox/index.ts +1 -0
- package/src/components/dropdowns/Select/Select.stories.tsx +54 -0
- package/src/components/dropdowns/Select/Select.styles.ts +73 -0
- package/src/components/dropdowns/Select/Select.tsx +69 -0
- package/src/components/dropdowns/Select/index.ts +1 -0
- package/src/components/dropdowns/SingleCombobox/SingleCombobox.stories.tsx +61 -0
- package/src/components/dropdowns/SingleCombobox/SingleCombobox.styles.ts +56 -0
- package/src/components/dropdowns/SingleCombobox/SingleCombobox.tsx +103 -0
- package/src/components/dropdowns/SingleCombobox/index.ts +1 -0
- package/src/components/dropdowns/commonStyles.ts +65 -0
- package/src/components/dropdowns/index.ts +4 -0
- package/src/components/dropdowns/types.ts +45 -0
- package/src/components/dropdowns/useCombobox.ts +32 -0
- package/src/components/dropdowns/utils.tsx +25 -0
- package/src/components/index.ts +9 -0
- package/src/components/inputs/EditableInput/EditableInput.stories.tsx +26 -0
- package/src/components/inputs/EditableInput/EditableInput.styles.ts +21 -0
- package/src/components/inputs/EditableInput/EditableInput.tsx +103 -0
- package/src/components/inputs/EditableInput/index.ts +1 -0
- package/src/components/inputs/NumberInput/NumberInput.stories.tsx +72 -0
- package/src/components/inputs/NumberInput/NumberInput.styles.ts +66 -0
- package/src/components/inputs/NumberInput/NumberInput.tsx +153 -0
- package/src/components/inputs/NumberInput/index.ts +1 -0
- package/src/components/inputs/SearchInput/SearchInput.stories.tsx +17 -0
- package/src/components/inputs/SearchInput/SearchInput.styles.ts +25 -0
- package/src/components/inputs/SearchInput/SearchInput.tsx +47 -0
- package/src/components/inputs/SearchInput/index.ts +1 -0
- package/src/components/inputs/TextInput/TextInput.stories.tsx +104 -0
- package/src/components/inputs/TextInput/TextInput.styles.ts +74 -0
- package/src/components/inputs/TextInput/TextInput.tsx +116 -0
- package/src/components/inputs/TextInput/index.ts +1 -0
- package/src/components/inputs/index.ts +4 -0
- package/src/components/inputs/inputsCommon.styles.ts +61 -0
- package/src/components/loading-indicators/BarSpinner/BarSpinner.stories.tsx +14 -0
- package/src/components/loading-indicators/BarSpinner/BarSpinner.styles.ts +53 -0
- package/src/components/loading-indicators/BarSpinner/BarSpinner.tsx +21 -0
- package/src/components/loading-indicators/BarSpinner/index.ts +1 -0
- package/src/components/loading-indicators/CirclePulse/CirclePulse.stories.tsx +22 -0
- package/src/components/loading-indicators/CirclePulse/CirclePulse.styles.ts +81 -0
- package/src/components/loading-indicators/CirclePulse/CirclePulse.tsx +61 -0
- package/src/components/loading-indicators/CirclePulse/index.ts +1 -0
- package/src/components/loading-indicators/CircleSpinner/CircleSpinner.stories.tsx +16 -0
- package/src/components/loading-indicators/CircleSpinner/CircleSpinner.tsx +37 -0
- package/src/components/loading-indicators/CircleSpinner/index.ts +1 -0
- package/src/components/loading-indicators/LoadingList/LoadingList.stories.tsx +14 -0
- package/src/components/loading-indicators/LoadingList/LoadingList.styles.ts +42 -0
- package/src/components/loading-indicators/LoadingList/LoadingList.tsx +9 -0
- package/src/components/loading-indicators/LoadingList/index.ts +1 -0
- package/src/components/loading-indicators/PercentageRing/PercentageRing.stories.tsx +18 -0
- package/src/components/loading-indicators/PercentageRing/PercentageRing.styles.ts +27 -0
- package/src/components/loading-indicators/PercentageRing/PercentageRing.tsx +76 -0
- package/src/components/loading-indicators/PercentageRing/index.ts +1 -0
- package/src/components/loading-indicators/RandomLoadingMessage/RandomLoadingMessage.stories.tsx +16 -0
- package/src/components/loading-indicators/RandomLoadingMessage/RandomLoadingMessage.tsx +18 -0
- package/src/components/loading-indicators/RandomLoadingMessage/index.ts +1 -0
- package/src/components/loading-indicators/RandomLoadingMessage/random-messages.js +67 -0
- package/src/components/loading-indicators/index.ts +6 -0
- package/src/components/user-feedback/Shrug/Shrug.stories.tsx +38 -0
- package/src/components/user-feedback/Shrug/Shrug.styles.ts +23 -0
- package/src/components/user-feedback/Shrug/Shrug.tsx +44 -0
- package/src/components/user-feedback/Shrug/index.ts +1 -0
- package/src/components/user-feedback/index.ts +1 -0
- package/src/index.tsx +18 -0
- package/src/styles/globals/buttons.ts +154 -0
- package/src/styles/globals/forms.ts +103 -0
- package/src/styles/globals/index.tsx +25 -0
- package/src/styles/globals/layout.ts +25 -0
- package/src/styles/globals/lists.ts +23 -0
- package/src/styles/globals/margin-padding.ts +33 -0
- package/src/styles/globals/media.ts +13 -0
- package/src/styles/globals/tables.ts +34 -0
- package/src/styles/globals/typography.ts +95 -0
- package/src/styles/globals/utility-classes.ts +76 -0
- package/src/tokens/animation.ts +6 -0
- package/src/tokens/breakpoints.ts +11 -0
- package/src/tokens/colors.ts +279 -0
- package/src/tokens/index.ts +20 -0
- package/src/tokens/margin.ts +5 -0
- package/src/tokens/numbers.js +41 -0
- package/src/tokens/padding.ts +5 -0
- package/src/tokens/spacings.ts +5 -0
- package/src/tokens/typography.ts +37 -0
- package/src/types.ts +6 -0
- package/tsconfig.json +13 -0
- 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
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
|
+
};
|
package/.prettierignore
ADDED
package/.prettierrc
ADDED
package/.stackblitzrc
ADDED
|
@@ -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
|
+
});
|