@indico-data/design-system 2.25.0 → 2.26.0
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/lib/index.css +40 -0
- package/lib/index.esm.css +40 -0
- package/lib/src/stylesAndAnimations/colors/Swatch.d.ts +1 -1
- package/lib/src/stylesAndAnimations/colors/constants.d.ts +1 -0
- package/package.json +1 -1
- package/src/styles/_colors.scss +12 -1
- package/src/stylesAndAnimations/colors/Colors.tsx +15 -1
- package/src/stylesAndAnimations/colors/Swatch.tsx +10 -6
- package/src/stylesAndAnimations/colors/UtilityClasses.tsx +18 -0
- package/src/stylesAndAnimations/colors/constants.ts +15 -0
package/lib/index.css
CHANGED
|
@@ -3004,6 +3004,46 @@ p,
|
|
|
3004
3004
|
background-color: var(--pf-red-color-900);
|
|
3005
3005
|
}
|
|
3006
3006
|
|
|
3007
|
+
.color-success {
|
|
3008
|
+
color: var(--pf-success-color);
|
|
3009
|
+
}
|
|
3010
|
+
|
|
3011
|
+
.bg-success {
|
|
3012
|
+
background-color: var(--pf-success-color);
|
|
3013
|
+
}
|
|
3014
|
+
|
|
3015
|
+
.color-info {
|
|
3016
|
+
color: var(--pf-info-color);
|
|
3017
|
+
}
|
|
3018
|
+
|
|
3019
|
+
.bg-info {
|
|
3020
|
+
background-color: var(--pf-info-color);
|
|
3021
|
+
}
|
|
3022
|
+
|
|
3023
|
+
.color-neutral {
|
|
3024
|
+
color: var(--pf-neutral-color);
|
|
3025
|
+
}
|
|
3026
|
+
|
|
3027
|
+
.bg-neutral {
|
|
3028
|
+
background-color: var(--pf-neutral-color);
|
|
3029
|
+
}
|
|
3030
|
+
|
|
3031
|
+
.color-warning {
|
|
3032
|
+
color: var(--pf-warning-color);
|
|
3033
|
+
}
|
|
3034
|
+
|
|
3035
|
+
.bg-warning {
|
|
3036
|
+
background-color: var(--pf-warning-color);
|
|
3037
|
+
}
|
|
3038
|
+
|
|
3039
|
+
.color-error {
|
|
3040
|
+
color: var(--pf-error-color);
|
|
3041
|
+
}
|
|
3042
|
+
|
|
3043
|
+
.bg-error {
|
|
3044
|
+
background-color: var(--pf-error-color);
|
|
3045
|
+
}
|
|
3046
|
+
|
|
3007
3047
|
.border {
|
|
3008
3048
|
border: solid 1px;
|
|
3009
3049
|
}
|
package/lib/index.esm.css
CHANGED
|
@@ -3004,6 +3004,46 @@ p,
|
|
|
3004
3004
|
background-color: var(--pf-red-color-900);
|
|
3005
3005
|
}
|
|
3006
3006
|
|
|
3007
|
+
.color-success {
|
|
3008
|
+
color: var(--pf-success-color);
|
|
3009
|
+
}
|
|
3010
|
+
|
|
3011
|
+
.bg-success {
|
|
3012
|
+
background-color: var(--pf-success-color);
|
|
3013
|
+
}
|
|
3014
|
+
|
|
3015
|
+
.color-info {
|
|
3016
|
+
color: var(--pf-info-color);
|
|
3017
|
+
}
|
|
3018
|
+
|
|
3019
|
+
.bg-info {
|
|
3020
|
+
background-color: var(--pf-info-color);
|
|
3021
|
+
}
|
|
3022
|
+
|
|
3023
|
+
.color-neutral {
|
|
3024
|
+
color: var(--pf-neutral-color);
|
|
3025
|
+
}
|
|
3026
|
+
|
|
3027
|
+
.bg-neutral {
|
|
3028
|
+
background-color: var(--pf-neutral-color);
|
|
3029
|
+
}
|
|
3030
|
+
|
|
3031
|
+
.color-warning {
|
|
3032
|
+
color: var(--pf-warning-color);
|
|
3033
|
+
}
|
|
3034
|
+
|
|
3035
|
+
.bg-warning {
|
|
3036
|
+
background-color: var(--pf-warning-color);
|
|
3037
|
+
}
|
|
3038
|
+
|
|
3039
|
+
.color-error {
|
|
3040
|
+
color: var(--pf-error-color);
|
|
3041
|
+
}
|
|
3042
|
+
|
|
3043
|
+
.bg-error {
|
|
3044
|
+
background-color: var(--pf-error-color);
|
|
3045
|
+
}
|
|
3046
|
+
|
|
3007
3047
|
.border {
|
|
3008
3048
|
border: solid 1px;
|
|
3009
3049
|
}
|
package/package.json
CHANGED
package/src/styles/_colors.scss
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
$color-names: "primary", "secondary", "gray", "green", "orange", "red";
|
|
3
3
|
$color-grades: "100", "200", "300", "400", "500", "600", "700", "800", "900";
|
|
4
|
+
$utility-color-names: "success", "info", "neutral", "warning", "error";
|
|
4
5
|
|
|
5
6
|
@each $color-name in $color-names {
|
|
6
7
|
.color-#{$color-name} {
|
|
@@ -20,4 +21,14 @@ $color-grades: "100", "200", "300", "400", "500", "600", "700", "800", "900";
|
|
|
20
21
|
background-color: var(--pf-#{$color-name}-color-#{$color-grade});
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
|
-
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@each $color-name in $utility-color-names {
|
|
27
|
+
.color-#{$color-name} {
|
|
28
|
+
color: var(--pf-#{$color-name}-color);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.bg-#{$color-name} {
|
|
32
|
+
background-color: var(--pf-#{$color-name}-color);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Container, Row, Col } from 'react-grid-system';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
colorList,
|
|
5
|
+
darkThemeColors,
|
|
6
|
+
lightThemeColors,
|
|
7
|
+
shades,
|
|
8
|
+
utilityColorList,
|
|
9
|
+
} from './constants';
|
|
4
10
|
import { Swatch } from './Swatch';
|
|
5
11
|
import { useTheme } from './hooks'; // import the custom hook
|
|
6
12
|
|
|
@@ -24,6 +30,14 @@ export const Colors = () => {
|
|
|
24
30
|
);
|
|
25
31
|
})}
|
|
26
32
|
</Row>
|
|
33
|
+
<Row>
|
|
34
|
+
<Col sm={4} key="utility">
|
|
35
|
+
<h1 className="text-capitalize my-5">Utility Colors</h1>
|
|
36
|
+
{utilityColorList.map((color) => {
|
|
37
|
+
return <Swatch key={color} color={color} colorValue={themeColors.utility[color]} />;
|
|
38
|
+
})}
|
|
39
|
+
</Col>
|
|
40
|
+
</Row>
|
|
27
41
|
</Container>
|
|
28
42
|
);
|
|
29
43
|
};
|
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './swatches.scss';
|
|
3
3
|
import { Row, Col } from 'react-grid-system';
|
|
4
|
+
|
|
4
5
|
interface Props {
|
|
5
6
|
color: string;
|
|
6
|
-
shade: number;
|
|
7
7
|
colorValue: string;
|
|
8
|
+
shade?: number;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export const Swatch = ({ color, shade, colorValue }: Props) => {
|
|
11
|
-
const handleCopy = (
|
|
12
|
-
navigator.clipboard.writeText(
|
|
12
|
+
const handleCopy = (value: string) => {
|
|
13
|
+
navigator.clipboard.writeText(value);
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
return (
|
|
16
|
-
<Row className="sb__swatch" key={shade} onClick={() => handleCopy(colorValue)}>
|
|
17
|
+
<Row className="sb__swatch" key={shade ?? colorValue} onClick={() => handleCopy(colorValue)}>
|
|
17
18
|
<Col xs="content">
|
|
18
|
-
<div
|
|
19
|
+
<div
|
|
20
|
+
className={`sb__swatch__block bg-${color}${shade ? `-${shade}` : ''}`}
|
|
21
|
+
title={`--pf-${color}-color${shade ? `-${shade}` : ''}`}
|
|
22
|
+
></div>
|
|
19
23
|
</Col>
|
|
20
24
|
<Col className="sb__swatch__description">
|
|
21
|
-
{shade} - {colorValue}
|
|
25
|
+
{`${shade ? `${shade} - ` : `${color} - `}${colorValue}`}
|
|
22
26
|
</Col>
|
|
23
27
|
</Row>
|
|
24
28
|
);
|
|
@@ -91,6 +91,24 @@ export const UtilityClasses = () => {
|
|
|
91
91
|
<span className="color-red">red</span>
|
|
92
92
|
</li>
|
|
93
93
|
</ul>
|
|
94
|
+
<h2>Utility Colors</h2>
|
|
95
|
+
<ul>
|
|
96
|
+
<li>
|
|
97
|
+
<span className="color-success">success</span>
|
|
98
|
+
</li>
|
|
99
|
+
<li>
|
|
100
|
+
<span className="color-info">info</span>
|
|
101
|
+
</li>
|
|
102
|
+
<li>
|
|
103
|
+
<span className="color-neutral">neutral</span>
|
|
104
|
+
</li>
|
|
105
|
+
<li>
|
|
106
|
+
<span className="color-warning">warning</span>
|
|
107
|
+
</li>
|
|
108
|
+
<li>
|
|
109
|
+
<span className="color-error">error</span>
|
|
110
|
+
</li>
|
|
111
|
+
</ul>
|
|
94
112
|
</>
|
|
95
113
|
);
|
|
96
114
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export const colorList = ['primary', 'secondary', 'gray', 'red', 'orange', 'green'];
|
|
2
|
+
export const utilityColorList = ['success', 'info', 'neutral', 'warning', 'error'];
|
|
2
3
|
export const lightThemeColors = {
|
|
3
4
|
primary: {
|
|
4
5
|
base: '#6833D0',
|
|
@@ -72,6 +73,13 @@ export const lightThemeColors = {
|
|
|
72
73
|
800: '#B01B1D',
|
|
73
74
|
900: '#9D181A',
|
|
74
75
|
},
|
|
76
|
+
utility: {
|
|
77
|
+
success: '#168116',
|
|
78
|
+
info: '#2070D1',
|
|
79
|
+
neutral: '#BFC1C3',
|
|
80
|
+
warning: '#C7892F',
|
|
81
|
+
error: '#D52023',
|
|
82
|
+
},
|
|
75
83
|
} as Record<string, any>;
|
|
76
84
|
|
|
77
85
|
export const darkThemeColors = {
|
|
@@ -147,5 +155,12 @@ export const darkThemeColors = {
|
|
|
147
155
|
800: '#9a3132',
|
|
148
156
|
900: '#752324',
|
|
149
157
|
},
|
|
158
|
+
utility: {
|
|
159
|
+
success: '#199D19',
|
|
160
|
+
info: '#0070F5',
|
|
161
|
+
neutral: '#BFC1C3',
|
|
162
|
+
warning: '#DA9534',
|
|
163
|
+
error: '#F44D4F',
|
|
164
|
+
},
|
|
150
165
|
} as Record<string, any>;
|
|
151
166
|
export const shades = 9;
|