@indico-data/design-system 2.28.1 → 2.29.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.
@@ -1,4 +1,4 @@
1
- import { SemanticColor } from '@/types';
1
+ import { SemanticColor } from 'src/types';
2
2
  import React from 'react';
3
3
  export type PillSize = 'sm' | 'md' | 'lg';
4
4
  export type PillColor = SemanticColor | 'neutral';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indico-data/design-system",
3
- "version": "2.28.1",
3
+ "version": "2.29.0",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "lib/index.js",
@@ -201,3 +201,6 @@
201
201
  .btn--outline {
202
202
  background-color: var(--pf-button-outline-background-color);
203
203
  }
204
+ .btn.btn--primary.btn--text {
205
+ color: var(--pf-link-color);
206
+ }
@@ -13,6 +13,7 @@
13
13
  --pf-card-background-color: var(--pf-primary-color);
14
14
  --pf-card-border-color: var(--pf-primary-color-200);
15
15
  --pf-card-text-color: var(--pf-gray-color-100);
16
+ --pf-card-border-color: var(--pf-steel-color-600);
16
17
  }
17
18
 
18
19
  .card {
@@ -3,12 +3,12 @@
3
3
  :root [data-theme='light'],
4
4
  :root [data-theme='dark'] {
5
5
  --pf-floatui-background-color: var(--pf-white-color);
6
- --pf-floatui-border-color: var(--pf-gray-color-900);
6
+ --pf-floatui-border-color: var(--pf-border-color-900);
7
7
  --pf-floatui-border-radius: var(--pf-rounded);
8
8
  }
9
9
 
10
10
  // Dark Theme Specific Variables
11
11
  :root [data-theme='dark'] {
12
12
  --pf-floatui-background-color: var(--pf-primary-color-600);
13
- --pf-floatui-border-color: var(--pf-gray-color);
13
+ --pf-floatui-border-color: var(--pf-border-color);
14
14
  }
@@ -20,7 +20,7 @@
20
20
  --pf-input-background-color: var(--pf-primary-color);
21
21
  --pf-input-border-color: var(--pf-form-input-border-color);
22
22
  --pf-input-text-color: var(--pf-gray-color-100);
23
- --pf-input-placeholder-text-color: var(--pf-gray-color);
23
+ --pf-input-placeholder-text-color: var(--pf-gray-color-600);
24
24
  --pf-input-help-text-color: var(--pf-gray-color-200);
25
25
  --pf-input-disabled-background-color: var(--pf-primary-color-200);
26
26
  --pf-input-disabled-border-color: var(--pf-gray-color-300);
@@ -1,4 +1,4 @@
1
- import { SemanticColor } from '@/types';
1
+ import { SemanticColor } from 'src/types';
2
2
  import React from 'react';
3
3
 
4
4
  export type PillSize = 'sm' | 'md' | 'lg';
@@ -14,20 +14,7 @@ export const Typography = createGlobalStyle`
14
14
  font-style: normal;
15
15
  }
16
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
- }
17
+
31
18
 
32
19
  h3 {
33
20
  font-size: ${TYPOGRAPHY.fontSize.subheadLarge};
@@ -1,20 +1,18 @@
1
1
  $sizes: thin, sm, md, lg, 0, xl;
2
- $values: var(--pf-border-thin), var(--pf-border-sm), var(--pf-border-md), var(--pf-border-lg), 0, var(--pf-border-xl);
3
- $directions: (
4
- "t",
5
- top),
6
- ("b", bottom),
7
- ("l", left),
8
- ("r", right
9
- );
2
+ $values: var(--pf-border-thin), var(--pf-border-sm), var(--pf-border-md), var(--pf-border-lg), 0,
3
+ var(--pf-border-xl);
4
+ $directions: ('t', top), ('b', bottom), ('l', left), ('r', right);
10
5
  $styles: dashed, dotted, double, solid;
11
- $color-names: "primary", "secondary", "gray", "steel", "green", "orange", "red";
12
- $color-grades: "100", "200", "300", "400", "500", "600", "700", "800", "900";
6
+ $color-names: 'primary', 'secondary', 'gray', 'steel', 'green', 'orange', 'red';
7
+ $color-grades: '100', '200', '300', '400', '500', '600', '700', '800', '900';
13
8
  $radiusSizes: 0, sm, lg, md, xl, pill, circle, shaped;
14
- $radiusValues: var(--pf-rounded-0), var(--pf-rounded-sm), var(--pf-rounded-md), var(--pf-rounded-lg), var(--pf-rounded-xl), var(--pf-rounded-pill), var(--pf-rounded-circle), var(--pf-rounded-shaped);
9
+ $radiusValues: var(--pf-rounded-0), var(--pf-rounded-sm), var(--pf-rounded-md), var(--pf-rounded-lg),
10
+ var(--pf-rounded-xl), var(--pf-rounded-pill), var(--pf-rounded-circle), var(--pf-rounded-shaped);
15
11
 
16
12
  .border {
17
13
  border: solid 1px;
14
+ border-color: var(--pf-border-color);
15
+ border-radius: var(--pf-rounded);
18
16
  }
19
17
 
20
18
  @each $size, $value in zip($sizes, $values) {
@@ -57,4 +55,4 @@ $radiusValues: var(--pf-rounded-0), var(--pf-rounded-sm), var(--pf-rounded-md),
57
55
  .rounded-#{$size} {
58
56
  border-radius: $value;
59
57
  }
60
- }
58
+ }
@@ -1,7 +1,6 @@
1
-
2
- $color-names: "primary", "secondary", "gray", "steel", "green", "orange", "red";
3
- $color-grades: "100", "200", "300", "400", "500", "600", "700", "800", "900";
4
- $utility-color-names: "success", "info", "neutral", "warning", "error";
1
+ $color-names: 'primary', 'secondary', 'gray', 'steel', 'green', 'orange', 'red';
2
+ $color-grades: '100', '200', '300', '400', '500', '600', '700', '800', '900';
3
+ $utility-color-names: 'success', 'info', 'neutral', 'warning', 'error';
5
4
 
6
5
  @each $color-name in $color-names {
7
6
  .color-#{$color-name} {
@@ -32,3 +31,10 @@ $utility-color-names: "success", "info", "neutral", "warning", "error";
32
31
  background-color: var(--pf-#{$color-name}-color);
33
32
  }
34
33
  }
34
+
35
+ .link-color {
36
+ color: var(--pf-link-color);
37
+ }
38
+ .active-link-color {
39
+ color: var(--pf-active-link-color);
40
+ }
@@ -0,0 +1,7 @@
1
+ :root [data-theme='light'],
2
+ :root {
3
+ --sheets-background-color: var(--pf-gray-color-100);
4
+ }
5
+ :root [data-theme='dark'] {
6
+ --sheets-background-color: var(--pf-primary-color-400);
7
+ }
@@ -1,11 +1,79 @@
1
- // Common Variables
2
- :root,
3
1
  :root [data-theme='light'],
4
- :root [data-theme='dark'] {
5
- --pf-form-input-border-color: var(--pf-gray-color-700);
2
+ :root {
3
+ // Globals
4
+ // ***********************************************************************************************************************************
5
+ --pf-white-color: #ffffff;
6
+ --pf-black-color: #000000;
7
+ --pf-background-color-light: var(--pf-gray-color-100);
8
+ --pf-background-color: var(--pf-white-color);
9
+ --pf-background-color-dark: var(--pf-gray-color-300);
10
+ --pf-background-secondary-color-light: var(--secondary-color-300);
11
+ --pf-background-color-secondary: var(--pf-secondary-color-500);
12
+ --pf-background-color-secondary-dark: var(--pf-secondary-color-900);
13
+
14
+ // Fonts
15
+ // ***********************************************************************************************************************************
16
+ --pf-font-color: var(--pf-gray-color);
17
+ --pf-font-color-emphasis: var(--pf-gray-color-800);
18
+ --pf-font-color-light: var(--pf-gray-color-400);
19
+ --pf-font-color-light-header: var(--pf-primary-color-100);
20
+
21
+ // Links
22
+ // ***********************************************************************************************************************************
23
+ --pf-link-color: var(--pf-primary-color);
24
+ --pf-active-link-color: var(--pf-primary-color-600);
25
+
26
+ // Borders
27
+ // ***********************************************************************************************************************************
28
+ --pf-border-color: var(--pf-gray-color-200);
29
+ --pf-border-color-light: var(--pf-gray-color-100);
30
+ --pf-horizontal-line-color: var(--pf-gray-color-200);
6
31
  }
7
32
 
8
- // Dark Theme Specific Variables
9
33
  :root [data-theme='dark'] {
10
- --pf-form-input-border-color: var(--pf-primary-color-200);
34
+ // Globals
35
+ // ***********************************************************************************************************************************
36
+ --pf-white-color: #ffffff;
37
+ --pf-black-color: #000000;
38
+ --pf-background-color-light: var(--primary-color-300);
39
+ --pf-background-color: var(--pf-primary-color-600);
40
+ --pf-background-color-dark: var(--pf-primary-color-900);
41
+ --pf-background-secondary-color-light: var(--secondary-color-300);
42
+ --pf-background-color-secondary: var(--pf-secondary-color-500);
43
+ --pf-background-color-secondary-dark: var(--pf-secondary-color-900);
44
+
45
+ // Fonts
46
+ // ***********************************************************************************************************************************
47
+ --pf-font-color: var(--pf-gray-color);
48
+ --pf-font-color-emphasis: var(--pf-gray-color-300);
49
+ --pf-font-color-light: var(--pf-gray-color-100);
50
+ --pf-font-color-light-header: var(--pf-primary-color-100);
51
+
52
+ // Links
53
+ // ***********************************************************************************************************************************
54
+ --pf-link-color: var(--pf-gray-color-300);
55
+ --pf-active-link-color: var(--pf-gray-color-100);
56
+
57
+ // Borders
58
+ // ***********************************************************************************************************************************
59
+ --pf-horizontal-line-color: var(--pf-primary-color-200);
60
+ --pf-border-color: var(--pf-steel-color-600);
61
+ --pf-border-color-light: var(--pf-steel-color-400);
62
+ }
63
+
64
+ // Global Styles
65
+ // ***********************************************************************************************************************************
66
+ html,
67
+ body {
68
+ padding: 0;
69
+ margin: 0;
70
+ color: var(--pf-font-color);
71
+ font-size: var(--pf-font-size-base);
72
+ font-family: var(--pf-font-family-base);
73
+ font-weight: var(--pf-font-weight-regular);
74
+ }
75
+
76
+ .theme {
77
+ background-color: var(--pf-background-color);
78
+ color: var(--pf-font-color);
11
79
  }
@@ -20,6 +20,7 @@
20
20
  @import '../components/floatUI/styles/FloatUI.scss';
21
21
  @import '../legacy/components/inputs/NoInputDatePicker/NoInputDatePicker.scss';
22
22
  @import '../components/pill/styles/Pill.scss';
23
+ @import 'sheets'; // Port to an sheets component when we build it
23
24
  @import 'typography';
24
25
  @import 'colors';
25
26
  @import 'borders';
@@ -13,4 +13,17 @@
13
13
  --pf-rounded-pill: 9999px;
14
14
  --pf-rounded-circle: 50%;
15
15
  --pf-rounded-shaped: 24px 0;
16
- }
16
+ }
17
+
18
+ :root [data-theme='light'],
19
+ :root {
20
+ --pf-border-color: var(--pf-gray-color-200);
21
+ --pf-border-color-light: var(--pf-gray-color-100);
22
+ --pf-horizontal-line-color: var(--pf-gray-color-200);
23
+ }
24
+
25
+ :root [data-theme='dark'] {
26
+ --pf-horizontal-line-color: var(--pf-primary-color-200);
27
+ --pf-border-color: var(--pf-steel-color-600);
28
+ --pf-border-color-light: var(--pf-steel-color-400);
29
+ }
@@ -33,3 +33,15 @@
33
33
  --pf-label-size-md: var(--pf-font-size-body);
34
34
  --pf-label-size-lg: var(--pf-font-size-h2);
35
35
  }
36
+
37
+ h1,
38
+ h2,
39
+ h3,
40
+ h4,
41
+ h5,
42
+ h6,
43
+ p,
44
+ ul,
45
+ li {
46
+ color: var(--pf-font-color);
47
+ }
@@ -40,6 +40,8 @@
40
40
  --pf-gray-color-900: #141414;
41
41
 
42
42
  // Steel Color
43
+ --pf-steel-color: #7c8594;
44
+
43
45
  --pf-steel-color-100: #f4f6f8;
44
46
  --pf-steel-color-200: #d9dee5;
45
47
  --pf-steel-color-300: #bcc3cd;
@@ -86,9 +88,6 @@
86
88
  --pf-red-color-800: #b01b1d;
87
89
  --pf-red-color-900: #9d181a;
88
90
 
89
- //White color
90
- --pf-white-color: #ffffff;
91
-
92
91
  // Utility Colors
93
92
  --pf-error-color: var(--pf-red-color-600);
94
93
  --pf-success-color: var(--pf-green-color-600);
@@ -5,6 +5,10 @@ import './borders.scss';
5
5
  export const BorderColor = () => {
6
6
  return (
7
7
  <div className="sb__border-story">
8
+ <div>
9
+ <div className="sb__square bg-gray-800 border border-lg"></div>
10
+ <p className="text-align--center">border</p>
11
+ </div>
8
12
  <div>
9
13
  <div className="sb__square bg-gray-800 border border-lg border-primary"></div>
10
14
  <p className="text-align--center">border-primary</p>
@@ -29,6 +33,10 @@ export const BorderColor = () => {
29
33
  <div className="sb__square bg-gray-800 border border-lg border-orange"></div>
30
34
  <p className="text-align--center">border-orange</p>
31
35
  </div>
36
+ <div>
37
+ <div className="sb__square bg-gray-800 border border-lg border-steel"></div>
38
+ <p className="text-align--center">border-steel</p>
39
+ </div>
32
40
  </div>
33
41
  );
34
42
  };
@@ -8,10 +8,10 @@ import {
8
8
  utilityColorList,
9
9
  } from './constants';
10
10
  import { Swatch } from './Swatch';
11
- import { useTheme } from './hooks'; // import the custom hook
11
+ import { useTheme } from './hooks';
12
12
 
13
13
  export const Colors = () => {
14
- const theme = useTheme(); // use the custom hook
14
+ const theme = useTheme();
15
15
 
16
16
  const themeColors = theme === 'dark' ? darkThemeColors : lightThemeColors;
17
17
 
@@ -20,7 +20,7 @@ export const Colors = () => {
20
20
  <Row>
21
21
  {colorList.map((color) => {
22
22
  return (
23
- <Col sm={4} key={color}>
23
+ <Col sm={6} key={color}>
24
24
  <h1 className="text-capitalize my-5">{color}</h1>
25
25
  {Array.from({ length: shades }, (_, i) => (i + 1) * 100).map((shade) => {
26
26
  const colorValue = themeColors[color][shade];
@@ -31,7 +31,7 @@ export const Colors = () => {
31
31
  })}
32
32
  </Row>
33
33
  <Row>
34
- <Col sm={4} key="utility">
34
+ <Col sm={6} key="utility">
35
35
  <h1 className="text-capitalize my-5">Utility Colors</h1>
36
36
  {utilityColorList.map((color) => {
37
37
  return <Swatch key={color} color={color} colorValue={themeColors.utility[color]} />;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import './swatches.scss';
3
3
  import { Row, Col } from 'react-grid-system';
4
+ import { Icon } from '../../components';
4
5
 
5
6
  interface Props {
6
7
  color: string;
@@ -13,16 +14,39 @@ export const Swatch = ({ color, shade, colorValue }: Props) => {
13
14
  navigator.clipboard.writeText(value);
14
15
  };
15
16
 
17
+ const cssVar = `--pf-${color}-color${shade ? `-${shade}` : ''}`;
18
+
16
19
  return (
17
- <Row className="sb__swatch" key={shade ?? colorValue} onClick={() => handleCopy(colorValue)}>
20
+ <Row className="sb__swatch" key={shade ?? colorValue}>
18
21
  <Col xs="content">
19
22
  <div
20
23
  className={`sb__swatch__block bg-${color}${shade ? `-${shade}` : ''}`}
21
- title={`--pf-${color}-color${shade ? `-${shade}` : ''}`}
24
+ title={cssVar}
22
25
  ></div>
23
26
  </Col>
24
- <Col className="sb__swatch__description">
25
- {`${shade ? `${shade} - ` : `${color} - `}${colorValue}`}
27
+ <Col xs={1} className="sb__swatch__description">
28
+ {colorValue}
29
+ </Col>
30
+ <Col xs="content">
31
+ <span
32
+ className="sb__swatch__hex link-color"
33
+ onClick={() => handleCopy(colorValue)}
34
+ style={{ cursor: 'pointer', margin: '0 10px' }}
35
+ >
36
+ <Icon className="ml-8" name="fa-copy" />
37
+ </span>
38
+ </Col>
39
+ <Col xs="content" className="sb__swatch__description">
40
+ {cssVar}
41
+ </Col>
42
+ <Col xs={1}>
43
+ <span
44
+ className="sb__swatch__var link-color"
45
+ onClick={() => handleCopy(cssVar)}
46
+ style={{ cursor: 'pointer' }}
47
+ >
48
+ <Icon name="fa-copy" />
49
+ </span>
26
50
  </Col>
27
51
  </Row>
28
52
  );
@@ -2,9 +2,142 @@ import '../../styles/_colors.scss';
2
2
  import { Canvas, Meta, Controls } from '@storybook/blocks';
3
3
  import * as UtilityClasses from './UtilityClasses.stories';
4
4
 
5
- {' '}
6
5
  <Meta title="Utility Classes/Colors" />
7
6
  # Color Utility Classes
8
7
 
9
8
  The following pattern is to be used as a method of styling your elements with the colors listed below. We support ***100 to 900*** for our variable ranges.
10
- <Canvas of={UtilityClasses.Default} />
9
+ <Canvas of={UtilityClasses.Default}
10
+ source={{
11
+ code: `
12
+ <Row>
13
+ <Col xs={12} className="my-5">
14
+ <h1 className="mb-5">Color Classes</h1>
15
+ <p>
16
+ The below code will apply the background color of the element to the primary color 100.
17
+ Omitting the number will default to 500. <strong>NOTE</strong> The background classes
18
+ here have no color style, it is added for documentation contrast
19
+ </p>
20
+ </Col>
21
+ <Col sm={12} md={6}>
22
+ <h1 className="mb-5">Backgrounds</h1>
23
+ <div className="bg-primary pa-2">
24
+ <span className="color-gray-100">bg-primary</span>
25
+ </div>
26
+ <div className="bg-primary-100 pa-2">bg-primary-100</div>
27
+ <div className="bg-primary-200 pa-2">bg-primary-200</div>
28
+ <div className="bg-primary-300 pa-2">bg-primary-300</div>
29
+ <div className="bg-primary-400 pa-2">bg-primary-400</div>
30
+ <div className="bg-primary-500 pa-2">bg-primary-500</div>
31
+ <div className="bg-primary-600 pa-2">
32
+ <span className="color-gray-10">bg-primary-600</span>
33
+ </div>
34
+ <div className="bg-primary-700 pa-2">
35
+ <span className="color-gray-100">bg-primary-700</span>
36
+ </div>
37
+ <div className="bg-primary-800 pa-2">
38
+ <span className="color-gray-100">bg-primary-800</span>
39
+ </div>
40
+ <div className="bg-primary-900 pa-2">
41
+ <span className="color-gray-100">bg-primary-900</span>
42
+ </div>
43
+ </Col>
44
+ <Col sm={12} md={6}>
45
+ <h1 className="mb-5">Text</h1>
46
+ <ul>
47
+ <li>
48
+ <span className="color-primary">color-primary</span>
49
+ </li>
50
+ <li>
51
+ <span className="color-primary-100">color-primary-100</span>
52
+ </li>
53
+ <li>
54
+ <span className="color-primary-200">color-primary-200</span>
55
+ </li>
56
+ <li>
57
+ <span className="color-primary-300">color-primary-300</span>
58
+ </li>
59
+ <li>
60
+ <span className="color-primary-400">color-primary-400</span>
61
+ </li>
62
+ <li>
63
+ <span className="color-primary-500">color-primary-500</span>
64
+ </li>
65
+ <li>
66
+ <span className="color-primary-600">color-primary-600</span>
67
+ </li>
68
+ <li>
69
+ <span className="color-primary-700">color-primary-700</span>
70
+ </li>
71
+ <li>
72
+ <span className="color-primary-800">color-primary-800</span>
73
+ </li>
74
+ <li>
75
+ <span className="color-primary-900">color-primary-900</span>
76
+ </li>
77
+ </ul>
78
+ </Col>
79
+ <Col className="my-5" xs={12}>
80
+ <hr />
81
+ <p>
82
+ The below code will apply the text color of the element to the primary color 100.
83
+ Omitting the number will default to 500.
84
+ </p>
85
+ </Col>
86
+ <Col sm={12} md={6}>
87
+ <h2 className="mb-5">Text Colors</h2>
88
+ <ul>
89
+ <li>
90
+ <span className="color-primary">primary</span>
91
+ </li>
92
+ <li>
93
+ <span className="color-secondary">secondary</span>
94
+ </li>
95
+ <li>
96
+ <span className="color-gray">gray</span>
97
+ </li>
98
+ <li>
99
+ <span className="color-steel">steel</span>
100
+ </li>
101
+ <li>
102
+ <span className="color-green">green</span>
103
+ </li>
104
+ <li>
105
+ <span className="color-orange">orange</span>
106
+ </li>
107
+ <li>
108
+ <span className="color-red">red</span>
109
+ </li>
110
+ </ul>
111
+ </Col>
112
+ <Col sm={12} md={6}>
113
+ <h2 className="mb-5">Utility Colors</h2>
114
+ <ul>
115
+ <li>
116
+ <span className="color-success">success</span>
117
+ </li>
118
+ <li>
119
+ <span className="color-info">info</span>
120
+ </li>
121
+ <li>
122
+ <span className="color-neutral">neutral</span>
123
+ </li>
124
+ <li>
125
+ <span className="color-warning">warning</span>
126
+ </li>
127
+ <li>
128
+ <span className="color-error">error</span>
129
+ </li>
130
+ </ul>
131
+ </Col>
132
+ <Col xs={12}>
133
+ <hr />
134
+ <h2>Usage Example</h2>
135
+ <div className="bg-primary-200 pa-5">
136
+ <p className="color-primary-900">
137
+ This background color will be Background Primary Color 200 with text color of
138
+ color-primary-900
139
+ </p>
140
+ </div>
141
+ </Col>
142
+ </Row>
143
+ `, }} />