@indico-data/design-system 2.30.0 → 2.31.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indico-data/design-system",
3
- "version": "2.30.0",
3
+ "version": "2.31.0",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "lib/index.js",
@@ -1,11 +1,11 @@
1
- @import './variables.scss';
2
-
1
+ @import 'variables.scss';
3
2
  .floatui-container {
4
3
  z-index: 99;
5
4
  }
6
5
 
7
6
  .floatui-content {
8
7
  border-radius: var(--pf-floatui-border-radius);
9
- border: 1px solid var(--pf-floatui-border-color);
8
+ border: solid 1px;
9
+ border-color: var(--pf-floatui-border-color);
10
10
  background: var(--pf-floatui-background-color);
11
11
  }
@@ -1,3 +1,11 @@
1
1
  form {
2
2
  width: 100%;
3
3
  }
4
+ :root [data-theme='light'],
5
+ :root {
6
+ --pf-form-input-border-color: var(--pf-border-color);
7
+ }
8
+
9
+ :root [data-theme='dark'] {
10
+ --pf-form-input-border-color: var(--pf-border-color);
11
+ }
@@ -41,6 +41,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
41
41
  form,
42
42
  maxLength,
43
43
  autofocus,
44
+ defaultValue,
44
45
  ...rest
45
46
  },
46
47
  ref,
@@ -70,6 +71,8 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
70
71
  aria-invalid={hasErrors ? true : undefined}
71
72
  aria-describedby={hasErrors || helpText ? `${name}-helper` : undefined}
72
73
  aria-required={isRequired}
74
+ value={value}
75
+ defaultValue={defaultValue}
73
76
  {...rest}
74
77
  />
75
78
  </div>
@@ -6,6 +6,15 @@ const meta: Meta = {
6
6
  title: 'Components/Pill',
7
7
  component: Pill,
8
8
  argTypes: {
9
+ className: {
10
+ control: false,
11
+ table: {
12
+ category: 'Props',
13
+ type: {
14
+ summary: 'css class name',
15
+ },
16
+ },
17
+ },
9
18
  children: {
10
19
  control: 'text',
11
20
  description: 'The content displayed inside the pill',
@@ -16,7 +25,7 @@ const meta: Meta = {
16
25
  },
17
26
  },
18
27
  },
19
- status: {
28
+ color: {
20
29
  control: {
21
30
  type: 'select',
22
31
  options: ['success', 'warning', 'error', 'info', 'neutral', 'primary', 'secondary'],
@@ -7,9 +7,38 @@ import * as TableStories from './Table.stories';
7
7
 
8
8
  This component facilitates the rapid creation of responsive and paginated tables. This component was created using the React [Data Table Component](https://react-data-table-component.netlify.app/?path=/docs/api-props--docs) library as a base. You can read more on additional props not listed in this documentation at [this link](https://react-data-table-component.netlify.app/?path=/docs/api-props--docs).
9
9
 
10
- <Canvas
11
- of={TableStories.Default}
12
- />
13
-
10
+ <Canvas of={TableStories.Default} />
14
11
 
15
12
  <Controls of={TableStories.Default} />
13
+
14
+ ## Conditional Row Styles
15
+
16
+ The `conditionalRowStyles` prop allows you to apply custom styles to specific rows based on a condition. In the Permafrost design system, if you apply the `checked` or `highlighted` classes to a row via the `conditionalRowStyles` prop, the table will automatically pick up predefined styles for those rows.
17
+
18
+ - **`checked`**: This class is used to indicate rows that have been selected. When applied, the row will inherit the styles defined in the Permafrost design system.
19
+
20
+ - **`highlighted`**: This class is used to visually emphasize specific rows. When applied, the row will inherit styles defined in the design system, making the row stand out with distinct border and background colors.
21
+
22
+ ### Example Usage
23
+
24
+ Here's an example of how to use the `conditionalRowStyles` prop to apply the `checked` and `highlighted` classes:
25
+
26
+ ```jsx
27
+ const conditionalRowStyles = [
28
+ {
29
+ when: (row) => row.isSelected,
30
+ classNames: ['checked'],
31
+ },
32
+ {
33
+ when: (row) => row.isImportant,
34
+ classNames: ['highlighted'],
35
+ },
36
+ ];
37
+
38
+ <DataTable
39
+ title="Sample Table"
40
+ columns={columns}
41
+ data={data}
42
+ conditionalRowStyles={conditionalRowStyles}
43
+ />;
44
+ ```
@@ -67,27 +67,40 @@
67
67
  border-top: var(--pf-border-sm) solid var(--pf-table-border-color);
68
68
  }
69
69
  }
70
-
71
- &:last-child {
72
- .rdt_TableCell {
73
- border-bottom: var(--pf-border-sm) solid var(--pf-table-border-color);
74
- }
75
- }
76
70
  }
77
71
 
78
72
  .rdt_TableCell,
79
73
  .rdt_TableCol {
80
- font-size: var(--pf-font-size-base);
74
+ font-size: var(--pf-table-font-size);
81
75
 
82
76
  &:not(:first-child) {
83
77
  border-left: var(--pf-border-sm) solid var(--pf-table-border-color);
84
78
  }
85
79
  }
86
80
 
81
+ /* Striped: alternating background */
87
82
  .table--striped .rdt_TableRow:nth-child(odd) .rdt_TableCell {
88
83
  background-color: var(--pf-table-stripe-color);
89
84
  }
90
85
 
86
+ /* Checked: Precedence over striped */
87
+ .checked .rdt_TableCell {
88
+ background-color: var(--pf-table-checked-color) !important;
89
+ }
90
+
91
+ /* Highlighted: Precedence over checked */
92
+ .highlighted {
93
+ box-shadow: var(--pf-table-highlighted-box-shadow);
94
+ transform: translateY(-2px);
95
+ z-index: 1;
96
+ border-bottom: var(--pf-border-md) solid var(--pf-table-highlighted-color);
97
+
98
+ .rdt_TableCell {
99
+ border-top: var(--pf-border-md) solid var(--pf-table-highlighted-color);
100
+ background-color: var(--pf-table-highlighted-color) !important;
101
+ }
102
+ }
103
+
91
104
  .rdt_Pagination {
92
105
  border-top: var(--pf-border-sm) solid var(--pf-table-border-color);
93
106
  border-radius: 0 0 var(--pf-rounded) var(--pf-rounded);
@@ -1,4 +1,5 @@
1
1
  // Light Theme Specific Variables
2
+ :root,
2
3
  :root [data-theme='light'] {
3
4
  --pf-table-background-color: var(--pf-white-color);
4
5
  --pf-table-font-color: var(--pf-gray-color);
@@ -6,6 +7,10 @@
6
7
  --pf-table-stripe-color: var(--pf-gray-color-100);
7
8
  --pf-table-hover-color: var(--pf-gray-color-200);
8
9
  --pf-table-disabled-color: var(--pf-gray-color-300);
10
+ --pf-table-checked-color: var(--pf-secondary-color-100);
11
+ --pf-table-highlighted-color: var(--pf-gray-color-200);
12
+ --pf-table-highlighted-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), 0 8px 16px rgba(0, 0, 0, 0.2);
13
+ --pf-table-font-size: var(--pf-font-size-body2);
9
14
  }
10
15
 
11
16
  // Dark Theme Specific Variables
@@ -16,4 +21,7 @@
16
21
  --pf-table-stripe-color: var(--pf-primary-color-600);
17
22
  --pf-table-hover-color: var(--pf-primary-color-400);
18
23
  --pf-table-disabled-color: var(--pf-gray-color-900);
24
+ --pf-table-checked-color: var(--pf-secondary-color-900);
25
+ --pf-table-highlighted-color: var(--pf-primary-color-400);
26
+ --pf-table-highlighted-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), 0 8px 16px rgba(0, 0, 0, 0.3);
19
27
  }