@indico-data/design-system 2.24.1 → 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 +66 -0
- package/lib/index.esm.css +66 -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/styles/_typography.scss +15 -0
- package/src/styles/variables/_typography.scss +6 -0
- 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
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
--pf-font-weight-medium: 500;
|
|
22
22
|
--pf-font-weight-bold: 700;
|
|
23
23
|
--pf-font-weight-heavy: 900;
|
|
24
|
+
/* Labels */
|
|
25
|
+
--pf-label-size: var(--pf-font-size-body);
|
|
26
|
+
--pf-label-size-sm: var(--pf-font-size-overline);
|
|
27
|
+
--pf-label-size-md: var(--pf-font-size-body);
|
|
28
|
+
--pf-label-size-lg: var(--pf-font-size-h2);
|
|
24
29
|
}
|
|
25
30
|
|
|
26
31
|
:root [data-theme=light],
|
|
@@ -2246,6 +2251,11 @@ form {
|
|
|
2246
2251
|
--pf-font-weight-medium: 500;
|
|
2247
2252
|
--pf-font-weight-bold: 700;
|
|
2248
2253
|
--pf-font-weight-heavy: 900;
|
|
2254
|
+
/* Labels */
|
|
2255
|
+
--pf-label-size: var(--pf-font-size-body);
|
|
2256
|
+
--pf-label-size-sm: var(--pf-font-size-overline);
|
|
2257
|
+
--pf-label-size-md: var(--pf-font-size-body);
|
|
2258
|
+
--pf-label-size-lg: var(--pf-font-size-h2);
|
|
2249
2259
|
}
|
|
2250
2260
|
|
|
2251
2261
|
html {
|
|
@@ -2498,6 +2508,22 @@ p,
|
|
|
2498
2508
|
color: var(--pf-info-color);
|
|
2499
2509
|
}
|
|
2500
2510
|
|
|
2511
|
+
.label-size--default {
|
|
2512
|
+
font-size: var(--pf-label-size);
|
|
2513
|
+
}
|
|
2514
|
+
|
|
2515
|
+
.label-size--small {
|
|
2516
|
+
font-size: var(--pf-label-size-small);
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
.label-size--medium {
|
|
2520
|
+
font-size: var(--pf-label-size-medium);
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2523
|
+
.label-size--large {
|
|
2524
|
+
font-size: var(--pf-label-size-large);
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2501
2527
|
.color-primary {
|
|
2502
2528
|
color: var(--pf-primary-color);
|
|
2503
2529
|
}
|
|
@@ -2978,6 +3004,46 @@ p,
|
|
|
2978
3004
|
background-color: var(--pf-red-color-900);
|
|
2979
3005
|
}
|
|
2980
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
|
+
|
|
2981
3047
|
.border {
|
|
2982
3048
|
border: solid 1px;
|
|
2983
3049
|
}
|
package/lib/index.esm.css
CHANGED
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
--pf-font-weight-medium: 500;
|
|
22
22
|
--pf-font-weight-bold: 700;
|
|
23
23
|
--pf-font-weight-heavy: 900;
|
|
24
|
+
/* Labels */
|
|
25
|
+
--pf-label-size: var(--pf-font-size-body);
|
|
26
|
+
--pf-label-size-sm: var(--pf-font-size-overline);
|
|
27
|
+
--pf-label-size-md: var(--pf-font-size-body);
|
|
28
|
+
--pf-label-size-lg: var(--pf-font-size-h2);
|
|
24
29
|
}
|
|
25
30
|
|
|
26
31
|
:root [data-theme=light],
|
|
@@ -2246,6 +2251,11 @@ form {
|
|
|
2246
2251
|
--pf-font-weight-medium: 500;
|
|
2247
2252
|
--pf-font-weight-bold: 700;
|
|
2248
2253
|
--pf-font-weight-heavy: 900;
|
|
2254
|
+
/* Labels */
|
|
2255
|
+
--pf-label-size: var(--pf-font-size-body);
|
|
2256
|
+
--pf-label-size-sm: var(--pf-font-size-overline);
|
|
2257
|
+
--pf-label-size-md: var(--pf-font-size-body);
|
|
2258
|
+
--pf-label-size-lg: var(--pf-font-size-h2);
|
|
2249
2259
|
}
|
|
2250
2260
|
|
|
2251
2261
|
html {
|
|
@@ -2498,6 +2508,22 @@ p,
|
|
|
2498
2508
|
color: var(--pf-info-color);
|
|
2499
2509
|
}
|
|
2500
2510
|
|
|
2511
|
+
.label-size--default {
|
|
2512
|
+
font-size: var(--pf-label-size);
|
|
2513
|
+
}
|
|
2514
|
+
|
|
2515
|
+
.label-size--small {
|
|
2516
|
+
font-size: var(--pf-label-size-small);
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
.label-size--medium {
|
|
2520
|
+
font-size: var(--pf-label-size-medium);
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2523
|
+
.label-size--large {
|
|
2524
|
+
font-size: var(--pf-label-size-large);
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2501
2527
|
.color-primary {
|
|
2502
2528
|
color: var(--pf-primary-color);
|
|
2503
2529
|
}
|
|
@@ -2978,6 +3004,46 @@ p,
|
|
|
2978
3004
|
background-color: var(--pf-red-color-900);
|
|
2979
3005
|
}
|
|
2980
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
|
+
|
|
2981
3047
|
.border {
|
|
2982
3048
|
border: solid 1px;
|
|
2983
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
|
+
}
|
|
@@ -132,3 +132,18 @@ html {
|
|
|
132
132
|
.text-info {
|
|
133
133
|
color: var(--pf-info-color);
|
|
134
134
|
}
|
|
135
|
+
|
|
136
|
+
// Label Sizes
|
|
137
|
+
@each $size-name,
|
|
138
|
+
$size-var
|
|
139
|
+
in (
|
|
140
|
+
default: --pf-label-size,
|
|
141
|
+
small: --pf-label-size-small,
|
|
142
|
+
medium: --pf-label-size-medium,
|
|
143
|
+
large: --pf-label-size-large
|
|
144
|
+
)
|
|
145
|
+
{
|
|
146
|
+
.label-size--#{$size-name} {
|
|
147
|
+
font-size: var(#{$size-var});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -26,4 +26,10 @@
|
|
|
26
26
|
--pf-font-weight-medium: 500;
|
|
27
27
|
--pf-font-weight-bold: 700;
|
|
28
28
|
--pf-font-weight-heavy: 900;
|
|
29
|
+
|
|
30
|
+
/* Labels */
|
|
31
|
+
--pf-label-size: var(--pf-font-size-body);
|
|
32
|
+
--pf-label-size-sm: var(--pf-font-size-overline);
|
|
33
|
+
--pf-label-size-md: var(--pf-font-size-body);
|
|
34
|
+
--pf-label-size-lg: var(--pf-font-size-h2);
|
|
29
35
|
}
|
|
@@ -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;
|