@indico-data/design-system 3.3.0 → 3.5.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.
@@ -0,0 +1,172 @@
1
+ // ============================================================================
2
+ // SEMANTIC TOKENS - Following Figma's Exact Token Structure
3
+ // ============================================================================
4
+ // These tokens map semantic meaning to our base palette colors and align with Figma
5
+ // All tokens use --pf-semantic prefix. Eventually the word 'semantic' should be removed.
6
+ // In the meantime, it is helpful to distinguish existing tokens with figma aligned ones
7
+
8
+ // Light Theme
9
+ :root [data-theme='light'] {
10
+ // Utility Colors
11
+ --pf-semantic-utility-info-default: var(--pf-secondary-color-450);
12
+ --pf-semantic-utility-info-light: var(--pf-secondary-color-400);
13
+ --pf-semantic-utility-info-dark: var(--pf-secondary-color-550);
14
+ --pf-semantic-utility-warning-default: var(--pf-yellow-color-400);
15
+ --pf-semantic-utility-warning-light: var(--pf-yellow-color-300);
16
+ --pf-semantic-utility-warning-dark: var(--pf-yellow-color-550);
17
+ --pf-semantic-utility-error-default: var(--pf-red-color-450);
18
+ --pf-semantic-utility-error-light: var(--pf-red-color-300);
19
+ --pf-semantic-utility-error-dark: var(--pf-red-color-600);
20
+ --pf-semantic-utility-success-default: var(--pf-green-color-500);
21
+ --pf-semantic-utility-success-light: var(--pf-green-color-400);
22
+ --pf-semantic-utility-success-dark: var(--pf-green-color-600);
23
+ --pf-semantic-utility-neutral-default: var(--pf-gray-color-500);
24
+ --pf-semantic-utility-neutral-light: var(--pf-gray-color-400);
25
+ --pf-semantic-utility-neutral-dark: var(--pf-gray-color-600);
26
+ --pf-semantic-utility-brand-default: var(--pf-blue-color-450);
27
+ --pf-semantic-utility-brand-light: var(--pf-blue-color-300);
28
+ --pf-semantic-utility-brand-dark: var(--pf-blue-color-550);
29
+ --pf-semantic-utility-pending-default: var(--pf-pink-color-500);
30
+ --pf-semantic-utility-pending-light: var(--pf-pink-color-300);
31
+ --pf-semantic-utility-pending-dark: var(--pf-pink-color-600);
32
+ --pf-semantic-utility-orange-default: var(--pf-orange-color-400);
33
+ --pf-semantic-utility-orange-light: var(--pf-orange-color-300);
34
+ --pf-semantic-utility-orange-dark: var(--pf-orange-color-500);
35
+ --pf-semantic-utility-purple-default: var(--pf-purple-color-500);
36
+ --pf-semantic-utility-purple-light: var(--pf-purple-color-300);
37
+ --pf-semantic-utility-purple-dark: var(--pf-purple-color-600);
38
+ --pf-semantic-utility-teal-default: var(--pf-teal-color-550);
39
+ --pf-semantic-utility-teal-light: var(--pf-teal-color-300);
40
+ --pf-semantic-utility-teal-dark: var(--pf-teal-color-600);
41
+
42
+ // Background
43
+ --pf-semantic-page-background: var(--pf-gray-color-100);
44
+ --pf-semantic-background-primary: var(--pf-gray-color-150);
45
+ --pf-semantic-background-secondary: var(--pf-gray-color-50);
46
+ --pf-semantic-background-tertiary: var(--pf-gray-color-200);
47
+ --pf-semantic-background-quaternary: var(--pf-gray-color-250);
48
+ --pf-semantic-background-accent: var(--pf-secondary-color-200);
49
+ --pf-semantic-background-highlight: var(--pf-blue-color-250);
50
+ --pf-semantic-background-brand-solid: var(--pf-blue-color-500);
51
+ --pf-semantic-background-brand-hover: var(--pf-blue-color-600);
52
+ --pf-semantic-background-inverted: var(--pf-tertiary-color-900);
53
+
54
+ // Border
55
+ --pf-semantic-border-primary: var(--pf-gray-color-300);
56
+ --pf-semantic-border-secondary: var(--pf-gray-color-250);
57
+ --pf-semantic-border-hover: var(--pf-gray-color-400);
58
+ --pf-semantic-border-soft: var(--pf-secondary-color-450);
59
+ --pf-semantic-border-accent: var(--pf-blue-color-450);
60
+ --pf-semantic-border-error: var(--pf-red-color-450);
61
+ --pf-semantic-border-warning: var(--pf-yellow-color-400);
62
+ --pf-semantic-border-pending: var(--pf-orange-color-400);
63
+ --pf-semantic-border-success: var(--pf-green-color-500);
64
+ --pf-semantic-border-info: var(--pf-secondary-color-450);
65
+ --pf-semantic-border-neutral: var(--pf-gray-color-500);
66
+
67
+ // Brand Logo
68
+ --pf-semantic-logo-primary: var(--pf-blue-color-450);
69
+ --pf-semantic-logo-secondary: var(--pf-primary-color-800);
70
+
71
+ // Font & Icon
72
+ --pf-semantic-font-regular: var(--pf-primary-color-800);
73
+ --pf-semantic-font-inverted: var(--pf-gray-color-50);
74
+ --pf-semantic-font-soft: var(--pf-gray-color-700);
75
+ --pf-semantic-font-mute: var(--pf-gray-color-800);
76
+ --pf-semantic-font-link: var(--pf-blue-color-500);
77
+ --pf-semantic-font-placeholder: var(--pf-gray-color-450);
78
+ --pf-semantic-font-disabled: var(--pf-gray-color-400);
79
+ --pf-semantic-font-accent: var(--pf-blue-color-500);
80
+ --pf-semantic-font-error: var(--pf-red-color-450);
81
+ --pf-semantic-font-success: var(--pf-green-color-600);
82
+
83
+ // Elevation
84
+ --pf-semantic-elevation-1: var(--pf-opacity-black-100);
85
+ --pf-semantic-elevation-2: var(--pf-opacity-black-150);
86
+ --pf-semantic-elevation-3: var(--pf-opacity-black-200);
87
+ --pf-semantic-elevation-4: var(--pf-opacity-black-250);
88
+ --pf-semantic-elevation-5: var(--pf-opacity-black-300);
89
+ }
90
+
91
+ // Dark Theme
92
+ :root [data-theme='dark'] {
93
+ // Utility Colors
94
+ --pf-semantic-utility-info-default: var(--pf-secondary-color-450);
95
+ --pf-semantic-utility-info-light: var(--pf-secondary-color-400);
96
+ --pf-semantic-utility-info-dark: var(--pf-secondary-color-550);
97
+ --pf-semantic-utility-warning-default: var(--pf-yellow-color-400);
98
+ --pf-semantic-utility-warning-light: var(--pf-yellow-color-300);
99
+ --pf-semantic-utility-warning-dark: var(--pf-yellow-color-550);
100
+ --pf-semantic-utility-error-default: var(--pf-red-color-450);
101
+ --pf-semantic-utility-error-light: var(--pf-red-color-300);
102
+ --pf-semantic-utility-error-dark: var(--pf-red-color-500);
103
+ --pf-semantic-utility-success-default: var(--pf-green-color-500);
104
+ --pf-semantic-utility-success-light: var(--pf-green-color-400);
105
+ --pf-semantic-utility-success-dark: var(--pf-green-color-600);
106
+ --pf-semantic-utility-neutral-default: var(--pf-gray-color-500);
107
+ --pf-semantic-utility-neutral-light: var(--pf-gray-color-400);
108
+ --pf-semantic-utility-neutral-dark: var(--pf-gray-color-600);
109
+ --pf-semantic-utility-brand-default: var(--pf-blue-color-450);
110
+ --pf-semantic-utility-brand-light: var(--pf-blue-color-300);
111
+ --pf-semantic-utility-brand-dark: var(--pf-blue-color-550);
112
+ --pf-semantic-utility-pending-default: var(--pf-pink-color-500);
113
+ --pf-semantic-utility-pending-light: var(--pf-pink-color-300);
114
+ --pf-semantic-utility-pending-dark: var(--pf-pink-color-600);
115
+ --pf-semantic-utility-orange-default: var(--pf-orange-color-400);
116
+ --pf-semantic-utility-orange-light: var(--pf-orange-color-300);
117
+ --pf-semantic-utility-orange-dark: var(--pf-orange-color-500);
118
+ --pf-semantic-utility-purple-default: var(--pf-purple-color-500);
119
+ --pf-semantic-utility-purple-light: var(--pf-purple-color-300);
120
+ --pf-semantic-utility-purple-dark: var(--pf-purple-color-600);
121
+ --pf-semantic-utility-teal-default: var(--pf-teal-color-550);
122
+ --pf-semantic-utility-teal-light: var(--pf-teal-color-300);
123
+ --pf-semantic-utility-teal-dark: var(--pf-teal-color-600);
124
+
125
+ // Background
126
+ --pf-semantic-page-background: var(--pf-primary-color-700);
127
+ --pf-semantic-background-primary: var(--pf-primary-color-900);
128
+ --pf-semantic-background-secondary: var(--pf-primary-color-800);
129
+ --pf-semantic-background-tertiary: var(--pf-primary-color-600);
130
+ --pf-semantic-background-quaternary: var(--pf-primary-color-500);
131
+ --pf-semantic-background-accent: var(--pf-blue-color-800);
132
+ --pf-semantic-background-highlight: var(--pf-blue-color-700);
133
+ --pf-semantic-background-brand-solid: var(--pf-secondary-color-450);
134
+ --pf-semantic-background-brand-hover: var(--pf-secondary-color-600);
135
+ --pf-semantic-background-inverted: var(--pf-tertiary-color-100);
136
+
137
+ // Border
138
+ --pf-semantic-border-primary: var(--pf-tertiary-color-700);
139
+ --pf-semantic-border-secondary: var(--pf-primary-color-600);
140
+ --pf-semantic-border-hover: var(--pf-tertiary-color-600);
141
+ --pf-semantic-border-soft: var(--pf-secondary-color-600);
142
+ --pf-semantic-border-accent: var(--pf-secondary-color-400);
143
+ --pf-semantic-border-error: var(--pf-red-color-450);
144
+ --pf-semantic-border-warning: var(--pf-yellow-color-400);
145
+ --pf-semantic-border-pending: var(--pf-orange-color-400);
146
+ --pf-semantic-border-success: var(--pf-green-color-500);
147
+ --pf-semantic-border-info: var(--pf-secondary-color-450);
148
+ --pf-semantic-border-neutral: var(--pf-gray-color-500);
149
+
150
+ // Brand Logo
151
+ --pf-semantic-logo-primary: var(--pf-blue-color-450);
152
+ --pf-semantic-logo-secondary: var(--pf-gray-color-50);
153
+
154
+ // Font & Icon
155
+ --pf-semantic-font-regular: var(--pf-gray-color-50);
156
+ --pf-semantic-font-inverted: var(--pf-gray-color-900);
157
+ --pf-semantic-font-soft: var(--pf-tertiary-color-300);
158
+ --pf-semantic-font-mute: var(--pf-tertiary-color-400);
159
+ --pf-semantic-font-link: var(--pf-secondary-color-400);
160
+ --pf-semantic-font-placeholder: var(--pf-tertiary-color-450);
161
+ --pf-semantic-font-disabled: var(--pf-tertiary-color-700);
162
+ --pf-semantic-font-accent: var(--pf-secondary-color-400);
163
+ --pf-semantic-font-error: var(--pf-red-color-300);
164
+ --pf-semantic-font-success: var(--pf-green-color-400);
165
+
166
+ // Elevation
167
+ --pf-semantic-elevation-1: var(--pf-opacity-black-200);
168
+ --pf-semantic-elevation-2: var(--pf-opacity-black-250);
169
+ --pf-semantic-elevation-3: var(--pf-opacity-black-300);
170
+ --pf-semantic-elevation-4: var(--pf-opacity-black-400);
171
+ --pf-semantic-elevation-5: var(--pf-opacity-black-450);
172
+ }
@@ -20,7 +20,7 @@
20
20
  --pf-border-color-secondary: var(--pf-gray-color-250);
21
21
  --pf-border-hover-color: var(--pf-gray-color-400);
22
22
  --pf-border-color-soft: var(--pf-secondary-color-450);
23
- --pf-border-color-accent: var(--pf-brand-color-450);
23
+ --pf-border-color-accent: var(--pf-blue-color-450);
24
24
  --pf-border-color-error: var(--pf-error-color);
25
25
  --pf-border-color-warning: var(--pf-warning-color);
26
26
  --pf-border-color-info: var(--pf-info-color);
@@ -1,5 +1,4 @@
1
1
  @import 'typography';
2
- @import 'colors';
3
2
  @import 'icons';
4
3
  @import 'borders';
5
4
  @import 'padding';
@@ -0,0 +1,56 @@
1
+ import { Canvas, Meta, Controls } from '@storybook/blocks';
2
+ import * as Colors from './Colors.stories';
3
+
4
+ <Meta title="Styles/Base Palette Colors" />
5
+ # Base Palette Colors
6
+
7
+ These are the base palette colors used to build semantic tokens. Do not use these directly!
8
+
9
+ ## Color Structure
10
+
11
+ ### Base Colors
12
+
13
+ - **Primary**: Blue-gray palette (#50647c) - Main brand colors
14
+ - **Secondary**: Blue palette (#1474b8) - Accent and interactive elements
15
+ - **Tertiary**: Gray-blue palette (#6a7798) - Supporting elements
16
+ - **Gray**: Neutral grays (#808080) - Text and backgrounds
17
+ - **Red**: Error and destructive actions (#a3292d)
18
+ - **Orange**: Warning and attention (#994733)
19
+ - **Yellow**: Caution and highlights (#ad871f)
20
+ - **Green**: Success and positive actions (#14b869)
21
+ - **Purple**: Special and premium features (#5c29a3)
22
+ - **Pink**: Unique and creative elements (#a3292d)
23
+ - **Teal**: Information and data (#29a3a3)
24
+ - **Blue**: Brand and primary actions (#2989ff)
25
+
26
+ ### Color Scale
27
+
28
+ Each color family follows a consistent scale: 50, 100, 150, 200, 250, 300, 400, 450, 500, 550, 600, 700, 800, 900
29
+
30
+ Click on the swatch to copy the color to your clipboard.
31
+
32
+ <Canvas of={Colors.Default} />
33
+
34
+ ## CSS Variable Syntax
35
+
36
+ In order to use or override a color listed above, you would use the following syntax.
37
+
38
+ ### Using A Variable
39
+
40
+ The syntax for invoking a variable in your CSS code follows this pattern.
41
+
42
+ ```css
43
+ .myElement {
44
+ color: var(--pf-primary-color-100);
45
+ }
46
+ ```
47
+
48
+ ### Overriding A Variable
49
+
50
+ The syntax for overriding a variable in your CSS code follows this pattern.
51
+
52
+ ```css
53
+ :root {
54
+ --pf-primary-color-100: #ff0000;
55
+ }
56
+ ```
@@ -1,25 +1,31 @@
1
1
  import React from 'react';
2
2
  import { Container, Row, Col } from 'react-grid-system';
3
- import { colorList, darkThemeColors, lightThemeColors, utilityColorList } from './constants';
3
+ import { colorList, themeColors, utilityColorList } from './constants';
4
4
  import { Swatch } from './Swatch';
5
- import { useTheme } from './hooks';
6
5
 
7
6
  export const Colors = () => {
8
- const theme = useTheme();
9
- const themeColors = theme === 'dark' ? darkThemeColors : lightThemeColors;
10
-
11
7
  return (
12
8
  <Container>
13
9
  <Row>
14
10
  {colorList.map((color) => {
15
- const colorShades = Object.keys(themeColors[color])
11
+ const colorData = themeColors[color];
12
+ if (!colorData || !('base' in colorData)) return null;
13
+
14
+ const colorShades = Object.keys(colorData)
16
15
  .map(Number)
17
16
  .sort((a, b) => a - b);
17
+
18
18
  return (
19
19
  <Col sm={6} key={color}>
20
20
  <h1 className="text-capitalize my-5">{color}</h1>
21
+
22
+ <div className="my-3">
23
+ <Swatch key="base" color={color} colorValue={colorData.base || colorData['500']} />
24
+ </div>
25
+
21
26
  {colorShades.map((shade) => {
22
- const colorValue = themeColors[color][shade];
27
+ const colorValue = colorData[shade.toString() as keyof typeof colorData];
28
+ if (!colorValue) return null;
23
29
  return <Swatch key={shade} color={color} shade={shade} colorValue={colorValue} />;
24
30
  })}
25
31
  </Col>
@@ -28,9 +34,28 @@ export const Colors = () => {
28
34
  </Row>
29
35
  <Row>
30
36
  <Col sm={6} key="utility">
31
- <h1 className="text-capitalize my-5">Utility Colors</h1>
37
+ <h1 className="text-capitalize my-5">Light Mode Utility Colors</h1>
38
+ {utilityColorList.map((color) => {
39
+ return (
40
+ <Swatch
41
+ key={'light-' + color}
42
+ color={color}
43
+ colorValue={themeColors.utilityLight[color]}
44
+ />
45
+ );
46
+ })}
47
+ </Col>
48
+
49
+ <Col sm={6} key="utility">
50
+ <h1 className="text-capitalize my-5">Dark Mode Utility Colors</h1>
32
51
  {utilityColorList.map((color) => {
33
- return <Swatch key={color} color={color} colorValue={themeColors.utility[color]} />;
52
+ return (
53
+ <Swatch
54
+ key={'dark-' + color}
55
+ color={color}
56
+ colorValue={themeColors.utilityDark[color]}
57
+ />
58
+ );
34
59
  })}
35
60
  </Col>
36
61
  </Row>