@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
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { CircleSpinner } from './CircleSpinner';
|
|
2
|
+
export { BarSpinner } from './BarSpinner';
|
|
3
|
+
export { CirclePulse } from './CirclePulse';
|
|
4
|
+
export { RandomLoadingMessage } from './RandomLoadingMessage';
|
|
5
|
+
export { PercentageRing } from './PercentageRing';
|
|
6
|
+
export { LoadingList } from './LoadingList';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
|
+
|
|
5
|
+
import { Shrug } from './Shrug';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
component: Shrug,
|
|
9
|
+
title: 'User Feedback/Shrug',
|
|
10
|
+
argTypes: {},
|
|
11
|
+
args: {
|
|
12
|
+
message: 'There are no workflows associated with this dataset.',
|
|
13
|
+
},
|
|
14
|
+
decorators: [
|
|
15
|
+
(Story) => (
|
|
16
|
+
<MemoryRouter>
|
|
17
|
+
<Story />
|
|
18
|
+
</MemoryRouter>
|
|
19
|
+
),
|
|
20
|
+
],
|
|
21
|
+
} satisfies Meta<typeof Shrug>;
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
type Story = StoryObj<typeof Shrug>;
|
|
25
|
+
|
|
26
|
+
export const MessageOnly: Story = {};
|
|
27
|
+
|
|
28
|
+
export const WithButtonAction: Story = {
|
|
29
|
+
args: { buttonText: 'Do something', buttonAction: () => {} },
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const WithLinkAction: Story = {
|
|
33
|
+
args: { actionText: 'Go back', actionLink: 'https://indico.io' },
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const ComponentMessage: Story = {
|
|
37
|
+
args: { message: <h2>Hello there! I'm an element</h2> },
|
|
38
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
import { COLORS, TYPOGRAPHY } from '@/tokens';
|
|
4
|
+
|
|
5
|
+
export const StyledShrug = styled.div`
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: center;
|
|
9
|
+
|
|
10
|
+
padding: 2em;
|
|
11
|
+
|
|
12
|
+
font-size: ${TYPOGRAPHY.fontSize.subheadLarge};
|
|
13
|
+
|
|
14
|
+
p {
|
|
15
|
+
font-size: inherit;
|
|
16
|
+
margin-top: 2em;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
svg {
|
|
20
|
+
fill: ${COLORS.iron};
|
|
21
|
+
opacity: 0.5;
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// TODO: This component's migration was fast-tracked for Insights. Assess for potential refactor and documentation.
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Link } from 'react-router-dom';
|
|
5
|
+
|
|
6
|
+
import { Button, Icon } from '@/components';
|
|
7
|
+
import { PermafrostComponent } from '@/types';
|
|
8
|
+
|
|
9
|
+
import { StyledShrug } from './Shrug.styles';
|
|
10
|
+
|
|
11
|
+
type Props = PermafrostComponent & {
|
|
12
|
+
actionLink?: string;
|
|
13
|
+
actionText?: string;
|
|
14
|
+
buttonAction?(): void;
|
|
15
|
+
buttonText?: string;
|
|
16
|
+
message?: string | React.ReactNode;
|
|
17
|
+
messageProps?: { 'data-cy': string };
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export function Shrug(props: Props): React.ReactElement {
|
|
21
|
+
const { actionLink, actionText, buttonAction, buttonText, className, id, message } = props;
|
|
22
|
+
return (
|
|
23
|
+
<StyledShrug className={className} data-cy={props['data-cy']} id={id}>
|
|
24
|
+
<Icon name="shrug" size={['260px', '84px']} />
|
|
25
|
+
{typeof message === 'string' ? (
|
|
26
|
+
<p className="t-subhead-large" {...props?.messageProps}>
|
|
27
|
+
{message}
|
|
28
|
+
</p>
|
|
29
|
+
) : (
|
|
30
|
+
message
|
|
31
|
+
)}
|
|
32
|
+
{actionLink && actionText && (
|
|
33
|
+
<Link to={actionLink} className="button blue cta" style={{ marginTop: '20px' }}>
|
|
34
|
+
{actionText}
|
|
35
|
+
</Link>
|
|
36
|
+
)}
|
|
37
|
+
{buttonAction && buttonText && (
|
|
38
|
+
<Button onClick={buttonAction} style={{ marginTop: '20px' }} variant="cta">
|
|
39
|
+
{buttonText}
|
|
40
|
+
</Button>
|
|
41
|
+
)}
|
|
42
|
+
</StyledShrug>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Shrug } from './Shrug';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Shrug } from './Shrug';
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { StrictMode } from 'react';
|
|
2
|
+
import * as ReactDOMClient from 'react-dom/client';
|
|
3
|
+
|
|
4
|
+
const root = ReactDOMClient.createRoot(document.body);
|
|
5
|
+
|
|
6
|
+
function App() {
|
|
7
|
+
return (
|
|
8
|
+
<div>
|
|
9
|
+
<h1>Hello</h1>
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
root.render(
|
|
15
|
+
<StrictMode>
|
|
16
|
+
<App />
|
|
17
|
+
</StrictMode>,
|
|
18
|
+
);
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { createGlobalStyle, css } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
import { COLORS, TYPOGRAPHY, ANIMATION } from '@/tokens';
|
|
4
|
+
|
|
5
|
+
const buttonColor = COLORS.darkFontColor;
|
|
6
|
+
const buttonBackground = COLORS.iron;
|
|
7
|
+
|
|
8
|
+
const buttonDefault = css`
|
|
9
|
+
appearance: none;
|
|
10
|
+
background-color: ${buttonBackground};
|
|
11
|
+
border: 0;
|
|
12
|
+
border-radius: 2px;
|
|
13
|
+
color: ${buttonColor};
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
display: inline-block;
|
|
16
|
+
font-family: ${TYPOGRAPHY.fontFamily.base};
|
|
17
|
+
font-size: ${TYPOGRAPHY.fontSize.base};
|
|
18
|
+
line-height: 1;
|
|
19
|
+
padding: ${TYPOGRAPHY.spacing.half} ${TYPOGRAPHY.spacing.base};
|
|
20
|
+
text-align: center;
|
|
21
|
+
text-decoration: none;
|
|
22
|
+
transition: background-color ${ANIMATION.duration} ${ANIMATION.timing};
|
|
23
|
+
user-select: none;
|
|
24
|
+
vertical-align: middle;
|
|
25
|
+
white-space: nowrap;
|
|
26
|
+
box-shadow: 0 1px 1px 0 ${COLORS.black};
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
export const Buttons = createGlobalStyle`
|
|
30
|
+
button,
|
|
31
|
+
[type='button'],
|
|
32
|
+
[type='reset'],
|
|
33
|
+
[type='submit'],
|
|
34
|
+
.button {
|
|
35
|
+
${buttonDefault}
|
|
36
|
+
|
|
37
|
+
&:hover,
|
|
38
|
+
&:focus {
|
|
39
|
+
background-color: #bebebe;
|
|
40
|
+
color: ${buttonColor};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&:disabled {
|
|
44
|
+
cursor: not-allowed;
|
|
45
|
+
|
|
46
|
+
background-color: ${COLORS.romanSilver};
|
|
47
|
+
|
|
48
|
+
&:hover {
|
|
49
|
+
background-color: ${COLORS.romanSilver};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&.red {
|
|
54
|
+
background-color: ${COLORS.red};
|
|
55
|
+
color: ${COLORS.hiliteFontColor};
|
|
56
|
+
|
|
57
|
+
&:hover {
|
|
58
|
+
background-color: #ed3c39;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:disabled {
|
|
62
|
+
opacity: 0.5;
|
|
63
|
+
cursor: not-allowed;
|
|
64
|
+
background-color: ${COLORS.red};
|
|
65
|
+
|
|
66
|
+
&:hover {
|
|
67
|
+
background-color: ${COLORS.red};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&.round:disabled {
|
|
72
|
+
opacity: 0.5;
|
|
73
|
+
cursor: not-allowed;
|
|
74
|
+
background-color: ${COLORS.red};
|
|
75
|
+
|
|
76
|
+
&:hover {
|
|
77
|
+
background-color: ${COLORS.red};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&.blue {
|
|
83
|
+
background-color: ${COLORS.curiousBlue};
|
|
84
|
+
color: ${COLORS.hiliteFontColor};
|
|
85
|
+
|
|
86
|
+
&:hover {
|
|
87
|
+
background-color: #1777c2;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&:disabled {
|
|
91
|
+
opacity: 0.5;
|
|
92
|
+
cursor: not-allowed;
|
|
93
|
+
background-color: #1e88e5;
|
|
94
|
+
|
|
95
|
+
&:hover {
|
|
96
|
+
background-color: #1e88e5;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&.green {
|
|
102
|
+
background-color: ${COLORS.green};
|
|
103
|
+
color: ${COLORS.hiliteFontColor};
|
|
104
|
+
|
|
105
|
+
&:hover {
|
|
106
|
+
background-color: #419a45;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&:disabled {
|
|
110
|
+
opacity: 0.5;
|
|
111
|
+
cursor: not-allowed;
|
|
112
|
+
background-color: #419a45;
|
|
113
|
+
|
|
114
|
+
&:hover {
|
|
115
|
+
background-color: #419a45;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&.cta {
|
|
121
|
+
font-size: ${TYPOGRAPHY.fontSize.subheadLarge};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&.round {
|
|
125
|
+
border-radius: 50%;
|
|
126
|
+
padding: 10px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&.link-style {
|
|
130
|
+
background: none;
|
|
131
|
+
box-shadow: none;
|
|
132
|
+
text-decoration: underline;
|
|
133
|
+
padding: 0;
|
|
134
|
+
transition: color ${ANIMATION.duration} ${ANIMATION.timing}, text-decoration-color ${ANIMATION.duration} ${ANIMATION.timing};
|
|
135
|
+
color: ${COLORS.midFontColor};
|
|
136
|
+
text-decoration-color: currentColor;
|
|
137
|
+
|
|
138
|
+
&:hover {
|
|
139
|
+
text-decoration-color: transparent;
|
|
140
|
+
color: ${COLORS.defaultFontColor};
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.fa-fw {
|
|
145
|
+
width: 1em;
|
|
146
|
+
text-align: center;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
i {
|
|
150
|
+
display: inline-block;
|
|
151
|
+
margin-right: 2px;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
`;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { createGlobalStyle } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
import { COLORS, TYPOGRAPHY, ANIMATION } from '@/tokens';
|
|
4
|
+
import { colorUtils } from '@indico-data/utils';
|
|
5
|
+
|
|
6
|
+
const formBoxShadow = 'inset 0 0 0 rgba(#000, 0)';
|
|
7
|
+
const formBoxShadowFocus = formBoxShadow;
|
|
8
|
+
|
|
9
|
+
export const Forms = createGlobalStyle`
|
|
10
|
+
fieldset {
|
|
11
|
+
background-color: transparent;
|
|
12
|
+
border: 0;
|
|
13
|
+
margin: 0;
|
|
14
|
+
padding: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
legend {
|
|
18
|
+
font-weight: 600;
|
|
19
|
+
margin-bottom: ${TYPOGRAPHY.spacing.quarter};
|
|
20
|
+
padding: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
label {
|
|
24
|
+
display: block;
|
|
25
|
+
font-size: ${TYPOGRAPHY.fontSize.subheadSmall};
|
|
26
|
+
margin-bottom: ${TYPOGRAPHY.spacing.quarter};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
input,
|
|
30
|
+
select,
|
|
31
|
+
textarea {
|
|
32
|
+
display: block;
|
|
33
|
+
font-family: ${TYPOGRAPHY.fontFamily.base};
|
|
34
|
+
font-size: ${TYPOGRAPHY.fontSize.subheadSmall};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
[type='color'],
|
|
38
|
+
[type='date'],
|
|
39
|
+
[type='datetime'],
|
|
40
|
+
[type='datetime-local'],
|
|
41
|
+
[type='email'],
|
|
42
|
+
[type='month'],
|
|
43
|
+
[type='number'],
|
|
44
|
+
[type='password'],
|
|
45
|
+
[type='search'],
|
|
46
|
+
[type='tel'],
|
|
47
|
+
[type='text'],
|
|
48
|
+
[type='time'],
|
|
49
|
+
[type='url'],
|
|
50
|
+
[type='week'],
|
|
51
|
+
input:not([type]),
|
|
52
|
+
textarea {
|
|
53
|
+
appearance: none;
|
|
54
|
+
background-color: ${COLORS.clay};
|
|
55
|
+
border: ${COLORS.clay};
|
|
56
|
+
border-radius: 2px;
|
|
57
|
+
box-shadow: ${formBoxShadow};
|
|
58
|
+
box-sizing: border-box;
|
|
59
|
+
color: ${COLORS.defaultFontColor};
|
|
60
|
+
margin-bottom: ${TYPOGRAPHY.spacing.half};
|
|
61
|
+
padding: ${TYPOGRAPHY.spacing.third};
|
|
62
|
+
transition: border-color ${ANIMATION.duration} ${ANIMATION.timing};
|
|
63
|
+
width: 100%;
|
|
64
|
+
|
|
65
|
+
&:hover {
|
|
66
|
+
// border-color: ${colorUtils.shade(COLORS.borderColor, 20)};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&:focus {
|
|
70
|
+
border-color: ${COLORS.actionColor};
|
|
71
|
+
box-shadow: ${formBoxShadowFocus};
|
|
72
|
+
outline: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&:disabled {
|
|
76
|
+
// background-color: ${colorUtils.shade(COLORS.backgroundColor, 5)};
|
|
77
|
+
cursor: not-allowed;
|
|
78
|
+
|
|
79
|
+
&:hover {
|
|
80
|
+
border: 1px solid ${COLORS.lightGray};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&::placeholder {
|
|
85
|
+
// color: ${colorUtils.tint(COLORS.defaultFontColor, 40)};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
textarea {
|
|
90
|
+
resize: vertical;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[type="checkbox"],
|
|
94
|
+
[type="radio"] {
|
|
95
|
+
display: inline;
|
|
96
|
+
margin-right: ${TYPOGRAPHY.spacing.quarter};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
[type="file"] {
|
|
100
|
+
margin-bottom: ${TYPOGRAPHY.spacing.half};
|
|
101
|
+
width: 100%;
|
|
102
|
+
}
|
|
103
|
+
`;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { UtilityClasses } from './utility-classes';
|
|
4
|
+
import { Forms } from './forms';
|
|
5
|
+
import { Buttons } from './buttons';
|
|
6
|
+
import { Layout } from './layout';
|
|
7
|
+
import { Lists } from './lists';
|
|
8
|
+
import { Media } from './media';
|
|
9
|
+
import { Tables } from './tables';
|
|
10
|
+
import { Typography } from './typography';
|
|
11
|
+
import { MarginPadding } from './margin-padding';
|
|
12
|
+
|
|
13
|
+
export const GlobalStyles = () => (
|
|
14
|
+
<>
|
|
15
|
+
<UtilityClasses />
|
|
16
|
+
<Buttons />
|
|
17
|
+
<Forms />
|
|
18
|
+
<Layout />
|
|
19
|
+
<Lists />
|
|
20
|
+
<Media />
|
|
21
|
+
<Tables />
|
|
22
|
+
<Typography />
|
|
23
|
+
<MarginPadding />
|
|
24
|
+
</>
|
|
25
|
+
);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createGlobalStyle } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
import { allColors } from '@/tokens/colors';
|
|
4
|
+
|
|
5
|
+
export const Layout = createGlobalStyle`
|
|
6
|
+
html {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
*,
|
|
11
|
+
*:before,
|
|
12
|
+
*:after {
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
html,
|
|
17
|
+
body {
|
|
18
|
+
height: 100%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
body {
|
|
22
|
+
margin: 0;
|
|
23
|
+
background-color: var(${allColors.backgroundColor});
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createGlobalStyle } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
export const Lists = createGlobalStyle`
|
|
4
|
+
ul,
|
|
5
|
+
ol {
|
|
6
|
+
list-style-type: none;
|
|
7
|
+
margin: 0;
|
|
8
|
+
padding: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
dl {
|
|
12
|
+
margin: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
dt {
|
|
16
|
+
font-weight: 600;
|
|
17
|
+
margin: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
dd {
|
|
21
|
+
margin: 0;
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createGlobalStyle } from 'styled-components';
|
|
2
|
+
import { MARGINS, PADDINGS } from '@/tokens';
|
|
3
|
+
|
|
4
|
+
export const MarginPadding = createGlobalStyle`
|
|
5
|
+
.pt-md {
|
|
6
|
+
padding-top: ${PADDINGS.md};
|
|
7
|
+
}
|
|
8
|
+
.pt-sm {
|
|
9
|
+
padding-top: ${PADDINGS.sm};
|
|
10
|
+
}
|
|
11
|
+
.pb-md {
|
|
12
|
+
padding-bottom: ${PADDINGS.md};
|
|
13
|
+
}
|
|
14
|
+
.pb-sm {
|
|
15
|
+
padding-bottom: ${PADDINGS.sm};
|
|
16
|
+
}
|
|
17
|
+
.mt-md {
|
|
18
|
+
margin-top: ${MARGINS.md};
|
|
19
|
+
}
|
|
20
|
+
.mt-sm {
|
|
21
|
+
margin-top: ${MARGINS.sm};
|
|
22
|
+
}
|
|
23
|
+
.mb-md {
|
|
24
|
+
margin-bottom: ${MARGINS.md};
|
|
25
|
+
}
|
|
26
|
+
.mb-sm {
|
|
27
|
+
margin-bottom: ${MARGINS.sm};
|
|
28
|
+
}
|
|
29
|
+
.my-md {
|
|
30
|
+
margin-top: ${MARGINS.md};
|
|
31
|
+
margin-bottom: ${MARGINS.md};
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createGlobalStyle } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
import { colorUtils } from '@indico-data/utils';
|
|
4
|
+
|
|
5
|
+
import { COLORS, TYPOGRAPHY } from '@/tokens';
|
|
6
|
+
|
|
7
|
+
export const Tables = createGlobalStyle`
|
|
8
|
+
table {
|
|
9
|
+
border-collapse: collapse;
|
|
10
|
+
margin: ${TYPOGRAPHY.spacing.half} 0;
|
|
11
|
+
table-layout: fixed;
|
|
12
|
+
width: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
th {
|
|
16
|
+
font-size: ${TYPOGRAPHY.fontSize.subheadSmall};
|
|
17
|
+
// border-bottom: 0.5px solid ${colorUtils.hexToRgb(COLORS.defaultFontColor, 0.1)};
|
|
18
|
+
padding: 20px 15px 5px;
|
|
19
|
+
font-weight: 400;
|
|
20
|
+
text-align: left;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
td {
|
|
24
|
+
// border-bottom: 0.5px solid ${colorUtils.hexToRgb(COLORS.defaultFontColor, 0.1)};
|
|
25
|
+
padding: 20px 15px;
|
|
26
|
+
font-size: ${TYPOGRAPHY.fontSize.base};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
tr,
|
|
30
|
+
td,
|
|
31
|
+
th {
|
|
32
|
+
vertical-align: middle;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { createGlobalStyle } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
import { COLORS, TYPOGRAPHY, ANIMATION } from '@/tokens';
|
|
4
|
+
|
|
5
|
+
export const Typography = createGlobalStyle`
|
|
6
|
+
html {
|
|
7
|
+
color: ${COLORS.defaultFontColor};
|
|
8
|
+
font-family: ${TYPOGRAPHY.fontFamily.base};
|
|
9
|
+
font-size: 100%;
|
|
10
|
+
line-height: ${TYPOGRAPHY.lineHeight.base};
|
|
11
|
+
-webkit-font-smoothing: antialiased;
|
|
12
|
+
-moz-osx-font-smoothing: grayscale;
|
|
13
|
+
font-weight: 400;
|
|
14
|
+
font-style: normal;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
h1,
|
|
18
|
+
h2,
|
|
19
|
+
h3,
|
|
20
|
+
h4,
|
|
21
|
+
h5,
|
|
22
|
+
h6 {
|
|
23
|
+
font-family: ${TYPOGRAPHY.fontFamily.base};
|
|
24
|
+
font-size: ${TYPOGRAPHY.fontSize.display};
|
|
25
|
+
line-height: ${TYPOGRAPHY.lineHeight.heading};
|
|
26
|
+
margin: 0 0 10px;
|
|
27
|
+
color: ${COLORS.lightGray};
|
|
28
|
+
font-weight: 400;
|
|
29
|
+
font-style: normal;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
h3 {
|
|
33
|
+
font-size: ${TYPOGRAPHY.fontSize.subheadLarge};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
h4 {
|
|
37
|
+
font-size: ${TYPOGRAPHY.fontSize.base};
|
|
38
|
+
color: ${COLORS.defaultFontColor};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
h5 {
|
|
42
|
+
font-size: ${TYPOGRAPHY.fontSize.caption};
|
|
43
|
+
color: ${COLORS.defaultFontColor};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
p {
|
|
47
|
+
margin: 0 0;
|
|
48
|
+
font-size: ${TYPOGRAPHY.fontSize.base};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.t-caption { font-size: ${TYPOGRAPHY.fontSize.caption}; }
|
|
52
|
+
.t-base { font-size: ${TYPOGRAPHY.fontSize.base}; }
|
|
53
|
+
.t-subhead-small { font-size: ${TYPOGRAPHY.fontSize.subheadSmall}; }
|
|
54
|
+
.t-subhead-large { font-size: ${TYPOGRAPHY.fontSize.subheadLarge}; }
|
|
55
|
+
.t-display { font-size: ${TYPOGRAPHY.fontSize.display}; }
|
|
56
|
+
|
|
57
|
+
.t-bold { font-weight: bold; }
|
|
58
|
+
.t-italic { font-style: italic; }
|
|
59
|
+
|
|
60
|
+
.error {
|
|
61
|
+
color: ${COLORS.red};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.prompt {
|
|
65
|
+
color: ${COLORS.curiousBlue};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.warning {
|
|
69
|
+
color: ${COLORS.yellow};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.success {
|
|
73
|
+
color: ${COLORS.green};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
a {
|
|
77
|
+
color: ${COLORS.actionColor};
|
|
78
|
+
transition: color ${ANIMATION.duration} ${ANIMATION.timing};
|
|
79
|
+
|
|
80
|
+
&:active,
|
|
81
|
+
&:focus,
|
|
82
|
+
&:hover {
|
|
83
|
+
color: ${COLORS.defaultFontColor};
|
|
84
|
+
text-decoration: none;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
hr {
|
|
89
|
+
border-bottom: 1px solid ${COLORS.borderColor};
|
|
90
|
+
border-left: 0;
|
|
91
|
+
border-right: 0;
|
|
92
|
+
border-top: 0;
|
|
93
|
+
margin: ${TYPOGRAPHY.spacing.base} 0;
|
|
94
|
+
}
|
|
95
|
+
`;
|