@indico-data/design-system 2.58.2 → 2.59.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/components/index.d.ts +1 -0
- package/lib/components/stepper/Stepper.d.ts +2 -0
- package/lib/components/stepper/Stepper.stories.d.ts +9 -0
- package/lib/components/stepper/__tests__/Stepper.tests.d.ts +1 -0
- package/lib/components/stepper/components/BackNavigation.d.ts +6 -0
- package/lib/components/stepper/components/Legend.d.ts +2 -0
- package/lib/components/stepper/components/NextNavigation.d.ts +8 -0
- package/lib/components/stepper/examples/MixedExample.d.ts +1 -0
- package/lib/components/stepper/examples/OptionalStepsExample.d.ts +1 -0
- package/lib/components/stepper/examples/RequiredStepsExample.d.ts +1 -0
- package/lib/components/stepper/examples/commonExample/CommonExample.d.ts +1 -0
- package/lib/components/stepper/examples/commonExample/steps/StepOne.d.ts +3 -0
- package/lib/components/stepper/examples/commonExample/steps/StepThree.d.ts +3 -0
- package/lib/components/stepper/examples/commonExample/steps/StepTwo.d.ts +3 -0
- package/lib/components/stepper/examples/constants.d.ts +61 -0
- package/lib/components/stepper/index.d.ts +1 -0
- package/lib/components/stepper/types.d.ts +24 -0
- package/lib/index.css +100 -2
- package/lib/index.d.ts +23 -2
- package/lib/index.esm.css +100 -2
- package/lib/index.esm.js +95 -29
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +94 -27
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/index.ts +1 -0
- package/src/components/stepper/Stepper.mdx +140 -0
- package/src/components/stepper/Stepper.stories.tsx +196 -0
- package/src/components/stepper/Stepper.tsx +85 -0
- package/src/components/stepper/__tests__/Stepper.tests.tsx +213 -0
- package/src/components/stepper/components/BackNavigation.tsx +22 -0
- package/src/components/stepper/components/Legend.tsx +66 -0
- package/src/components/stepper/components/NextNavigation.tsx +38 -0
- package/src/components/stepper/examples/MixedExample.tsx +140 -0
- package/src/components/stepper/examples/OptionalStepsExample.tsx +139 -0
- package/src/components/stepper/examples/RequiredStepsExample.tsx +158 -0
- package/src/components/stepper/examples/commonExample/CommonExample.tsx +115 -0
- package/src/components/stepper/examples/commonExample/steps/StepOne.tsx +57 -0
- package/src/components/stepper/examples/commonExample/steps/StepThree.tsx +56 -0
- package/src/components/stepper/examples/commonExample/steps/StepTwo.tsx +52 -0
- package/src/components/stepper/examples/constants.ts +168 -0
- package/src/components/stepper/index.ts +1 -0
- package/src/components/stepper/styles/Stepper.scss +131 -0
- package/src/components/stepper/types.ts +27 -0
- package/src/components/tanstackTable/components/TableBody/TableBody.tsx +2 -1
- package/src/components/tanstackTable/styles/table.scss +2 -2
- package/src/components/toast/Toast.mdx +1 -1
- package/src/components/toast/Toast.stories.tsx +1 -1
- package/src/index.ts +4 -2
- package/src/styles/index.scss +1 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Input } from '../../../..';
|
|
3
|
+
import { Col, Row } from '../../../..';
|
|
4
|
+
|
|
5
|
+
export const StepOne = ({ onCompletion }: { onCompletion: () => void }) => {
|
|
6
|
+
const [formValues, setFormValues] = useState({
|
|
7
|
+
applicationName: '',
|
|
8
|
+
applicationVersion: '',
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const handleInputChange = (field: string, value: string) => {
|
|
12
|
+
const updatedValues = {
|
|
13
|
+
...formValues,
|
|
14
|
+
[field]: value,
|
|
15
|
+
};
|
|
16
|
+
setFormValues(updatedValues);
|
|
17
|
+
if (
|
|
18
|
+
updatedValues.applicationName.trim() !== '' &&
|
|
19
|
+
updatedValues.applicationVersion.trim() !== ''
|
|
20
|
+
) {
|
|
21
|
+
onCompletion();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Row className="py-6">
|
|
27
|
+
<Col xs={12} className="mb-6">
|
|
28
|
+
<h3 data-testid="step-1-title" className="mb-2 color-secondary-100">
|
|
29
|
+
Application Name
|
|
30
|
+
</h3>
|
|
31
|
+
<p className="mb-4 color-tertiary-200 subtitle-2">
|
|
32
|
+
Please enter the name of the application you are publishing.
|
|
33
|
+
</p>
|
|
34
|
+
<Input
|
|
35
|
+
label="Application Name"
|
|
36
|
+
hasHiddenLabel
|
|
37
|
+
name="applicationName"
|
|
38
|
+
value={formValues.applicationName}
|
|
39
|
+
onChange={(e) => handleInputChange('applicationName', e.target.value)}
|
|
40
|
+
/>
|
|
41
|
+
</Col>
|
|
42
|
+
<Col xs={12}>
|
|
43
|
+
<h3 className="mb-2 color-secondary-100">Application Version</h3>
|
|
44
|
+
<p className="mb-4 color-tertiary-200 subtitle-2">
|
|
45
|
+
Please enter the version of the application you are publishing.
|
|
46
|
+
</p>
|
|
47
|
+
<Input
|
|
48
|
+
label="Application Version"
|
|
49
|
+
hasHiddenLabel
|
|
50
|
+
name="applicationVersion"
|
|
51
|
+
value={formValues.applicationVersion}
|
|
52
|
+
onChange={(e) => handleInputChange('applicationVersion', e.target.value)}
|
|
53
|
+
/>
|
|
54
|
+
</Col>
|
|
55
|
+
</Row>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Input } from '../../../..';
|
|
3
|
+
import { Col, Row } from '../../../..';
|
|
4
|
+
|
|
5
|
+
export const StepThree = ({ onCompletion }: { onCompletion: () => void }) => {
|
|
6
|
+
const [formValues, setFormValues] = useState({
|
|
7
|
+
userEmail: '',
|
|
8
|
+
userPhone: '',
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const handleInputChange = (field: string, value: string) => {
|
|
12
|
+
const updatedValues = {
|
|
13
|
+
...formValues,
|
|
14
|
+
[field]: value,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
setFormValues(updatedValues);
|
|
18
|
+
|
|
19
|
+
if (updatedValues.userEmail.trim() !== '' && updatedValues.userPhone.trim() !== '') {
|
|
20
|
+
onCompletion();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Row className="py-6">
|
|
26
|
+
<Col xs={12} className="mb-6">
|
|
27
|
+
<h3 data-testid="step-3-title" className="mb-2 color-secondary-100">
|
|
28
|
+
User Email
|
|
29
|
+
</h3>
|
|
30
|
+
<p className="mb-4 color-tertiary-200 subtitle-2">
|
|
31
|
+
Please enter your email address for contact.
|
|
32
|
+
</p>
|
|
33
|
+
<Input
|
|
34
|
+
label="User Email"
|
|
35
|
+
hasHiddenLabel
|
|
36
|
+
name="userEmail"
|
|
37
|
+
value={formValues.userEmail}
|
|
38
|
+
onChange={(e) => handleInputChange('userEmail', e.target.value)}
|
|
39
|
+
/>
|
|
40
|
+
</Col>
|
|
41
|
+
<Col xs={12}>
|
|
42
|
+
<h3 className="mb-2 color-secondary-100">User Phone</h3>
|
|
43
|
+
<p className="mb-4 color-tertiary-200 subtitle-2">
|
|
44
|
+
Please enter your phone number for contact.
|
|
45
|
+
</p>
|
|
46
|
+
<Input
|
|
47
|
+
label="User Phone"
|
|
48
|
+
hasHiddenLabel
|
|
49
|
+
name="userPhone"
|
|
50
|
+
value={formValues.userPhone}
|
|
51
|
+
onChange={(e) => handleInputChange('userPhone', e.target.value)}
|
|
52
|
+
/>
|
|
53
|
+
</Col>
|
|
54
|
+
</Row>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Input } from '../../../..';
|
|
3
|
+
import { Col, Row } from '../../../..';
|
|
4
|
+
|
|
5
|
+
export const StepTwo = ({ onCompletion }: { onCompletion: () => void }) => {
|
|
6
|
+
const [formValues, setFormValues] = useState({
|
|
7
|
+
agentName: '',
|
|
8
|
+
agentDescription: '',
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const handleInputChange = (field: string, value: string) => {
|
|
12
|
+
const updatedValues = {
|
|
13
|
+
...formValues,
|
|
14
|
+
[field]: value,
|
|
15
|
+
};
|
|
16
|
+
setFormValues(updatedValues);
|
|
17
|
+
if (updatedValues.agentName.trim() !== '' && updatedValues.agentDescription.trim() !== '') {
|
|
18
|
+
onCompletion();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Row className="py-6">
|
|
24
|
+
<Col xs={12} className="mb-6">
|
|
25
|
+
<h3 data-testid="step-2-title" className="mb-2 color-secondary-100">
|
|
26
|
+
Agent Name
|
|
27
|
+
</h3>
|
|
28
|
+
<p className="mb-4 color-tertiary-200 subtitle-2">Please enter the name of the agent.</p>
|
|
29
|
+
<Input
|
|
30
|
+
label="Agent Name"
|
|
31
|
+
hasHiddenLabel
|
|
32
|
+
name="agentName"
|
|
33
|
+
value={formValues.agentName}
|
|
34
|
+
onChange={(e) => handleInputChange('agentName', e.target.value)}
|
|
35
|
+
/>
|
|
36
|
+
</Col>
|
|
37
|
+
<Col xs={12}>
|
|
38
|
+
<h3 className="mb-2 color-secondary-100">Agent Description</h3>
|
|
39
|
+
<p className="mb-4 color-tertiary-200 subtitle-2">
|
|
40
|
+
Please provide a description of what this agent does.
|
|
41
|
+
</p>
|
|
42
|
+
<Input
|
|
43
|
+
label="Agent Description"
|
|
44
|
+
hasHiddenLabel
|
|
45
|
+
name="agentDescription"
|
|
46
|
+
value={formValues.agentDescription}
|
|
47
|
+
onChange={(e) => handleInputChange('agentDescription', e.target.value)}
|
|
48
|
+
/>
|
|
49
|
+
</Col>
|
|
50
|
+
</Row>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
// Common information box style
|
|
2
|
+
export const INFO_BOX_STYLE = {
|
|
3
|
+
padding: '15px',
|
|
4
|
+
color: 'var(--pf-font-color)',
|
|
5
|
+
marginBottom: '20px',
|
|
6
|
+
borderRadius: '5px',
|
|
7
|
+
border: '1px solid var(--pf-border-color)',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// Step status indicator styling
|
|
11
|
+
export const STATUS_INDICATOR_STYLE = (color: string) => ({
|
|
12
|
+
width: '12px',
|
|
13
|
+
height: '12px',
|
|
14
|
+
borderRadius: '50%',
|
|
15
|
+
backgroundColor: color,
|
|
16
|
+
display: 'inline-block',
|
|
17
|
+
marginRight: '8px',
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// Step data for different examples
|
|
21
|
+
export const MIXED_EXAMPLE_STEPS = [
|
|
22
|
+
{
|
|
23
|
+
id: 'step1',
|
|
24
|
+
title: 'Step 1',
|
|
25
|
+
isCompleted: false,
|
|
26
|
+
isOptional: false,
|
|
27
|
+
isSidebarEnabled: true,
|
|
28
|
+
isNextDisabled: false,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 'step2',
|
|
32
|
+
title: 'Step 2',
|
|
33
|
+
isCompleted: false,
|
|
34
|
+
isOptional: true,
|
|
35
|
+
isSidebarEnabled: true,
|
|
36
|
+
isNextDisabled: false,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 'step3',
|
|
40
|
+
title: 'Step 3',
|
|
41
|
+
isCompleted: false,
|
|
42
|
+
isOptional: true,
|
|
43
|
+
isSidebarEnabled: true,
|
|
44
|
+
isNextDisabled: false,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: 'step4',
|
|
48
|
+
title: 'Step 4',
|
|
49
|
+
isCompleted: false,
|
|
50
|
+
isOptional: true,
|
|
51
|
+
isSidebarEnabled: true,
|
|
52
|
+
isNextDisabled: false,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 'step5',
|
|
56
|
+
title: 'Step 5',
|
|
57
|
+
isCompleted: false,
|
|
58
|
+
isOptional: true,
|
|
59
|
+
isSidebarEnabled: true,
|
|
60
|
+
isNextDisabled: false,
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
export const REQUIRED_STEPS = [
|
|
65
|
+
{
|
|
66
|
+
id: 'step1',
|
|
67
|
+
title: 'Step 1',
|
|
68
|
+
isCompleted: false,
|
|
69
|
+
isOptional: false,
|
|
70
|
+
isSidebarEnabled: true,
|
|
71
|
+
isNextDisabled: false,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 'step2',
|
|
75
|
+
title: 'Step 2',
|
|
76
|
+
isCompleted: false,
|
|
77
|
+
isOptional: false,
|
|
78
|
+
isSidebarEnabled: false,
|
|
79
|
+
isNextDisabled: false,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: 'step3',
|
|
83
|
+
title: 'Step 3',
|
|
84
|
+
isCompleted: false,
|
|
85
|
+
isOptional: false,
|
|
86
|
+
isSidebarEnabled: false,
|
|
87
|
+
isNextDisabled: false,
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: 'step4',
|
|
91
|
+
title: 'Step 4',
|
|
92
|
+
isCompleted: false,
|
|
93
|
+
isOptional: false,
|
|
94
|
+
isSidebarEnabled: false,
|
|
95
|
+
isNextDisabled: false,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: 'step5',
|
|
99
|
+
title: 'Step 5',
|
|
100
|
+
isCompleted: false,
|
|
101
|
+
isOptional: false,
|
|
102
|
+
isSidebarEnabled: false,
|
|
103
|
+
isNextDisabled: false,
|
|
104
|
+
},
|
|
105
|
+
];
|
|
106
|
+
|
|
107
|
+
export const OPTIONAL_STEPS = [
|
|
108
|
+
{
|
|
109
|
+
id: 'step1',
|
|
110
|
+
title: 'Step 1',
|
|
111
|
+
isCompleted: false,
|
|
112
|
+
isOptional: true,
|
|
113
|
+
isSidebarEnabled: true,
|
|
114
|
+
isNextDisabled: false,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: 'step2',
|
|
118
|
+
title: 'Step 2',
|
|
119
|
+
isCompleted: false,
|
|
120
|
+
isOptional: true,
|
|
121
|
+
isSidebarEnabled: true,
|
|
122
|
+
isNextDisabled: false,
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: 'step3',
|
|
126
|
+
title: 'Step 3',
|
|
127
|
+
isCompleted: false,
|
|
128
|
+
isOptional: true,
|
|
129
|
+
isSidebarEnabled: true,
|
|
130
|
+
isNextDisabled: false,
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
id: 'step4',
|
|
134
|
+
title: 'Step 4',
|
|
135
|
+
isCompleted: false,
|
|
136
|
+
isOptional: true,
|
|
137
|
+
isSidebarEnabled: true,
|
|
138
|
+
isNextDisabled: false,
|
|
139
|
+
},
|
|
140
|
+
];
|
|
141
|
+
|
|
142
|
+
// Step content
|
|
143
|
+
export const STEP_CONTENT_DATA = {
|
|
144
|
+
step1: {
|
|
145
|
+
title: 'Basic Information',
|
|
146
|
+
content:
|
|
147
|
+
'This is the content for Step 1. In a real application, this might contain form fields for basic information.',
|
|
148
|
+
},
|
|
149
|
+
step2: {
|
|
150
|
+
title: 'Additional Details',
|
|
151
|
+
content:
|
|
152
|
+
'This is the content for Step 2. Here you might collect additional details from the user.',
|
|
153
|
+
},
|
|
154
|
+
step3: {
|
|
155
|
+
title: 'Preferences',
|
|
156
|
+
content: 'This is the content for Step 3. This could be where users set their preferences.',
|
|
157
|
+
},
|
|
158
|
+
step4: {
|
|
159
|
+
title: 'Review',
|
|
160
|
+
content:
|
|
161
|
+
'This is the content for Step 4. This might be a review page where users can check their inputs.',
|
|
162
|
+
},
|
|
163
|
+
step5: {
|
|
164
|
+
title: 'Submit',
|
|
165
|
+
content:
|
|
166
|
+
'This is the content for Step 5. This could be the final submission step with terms and conditions.',
|
|
167
|
+
},
|
|
168
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Stepper } from './Stepper';
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// Common Variables
|
|
2
|
+
:root,
|
|
3
|
+
:root [data-theme='light'],
|
|
4
|
+
:root [data-theme='dark'] {
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// Light Theme Specific Variables
|
|
8
|
+
:root [data-theme='light'] {
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Dark Theme Specific Variables
|
|
12
|
+
:root [data-theme='dark'] {
|
|
13
|
+
// Stepper Legend
|
|
14
|
+
--pf-stepper-background-color: var(--pf-primary-color-600);
|
|
15
|
+
--pf-stepper-legend-background-color: var(--pf-tertiary-color-600);
|
|
16
|
+
// Default Step
|
|
17
|
+
--pf-stepper-legend-circle-background-color: var(--pf-tertiary-color-450);
|
|
18
|
+
--pf-stepper-legend-circle-text-color: var(--pf-white-color);
|
|
19
|
+
--pf-stepper-legend-line-background-color: var(--pf-tertiary-color-450);
|
|
20
|
+
--pf-stepper-legend-step-text-color: var(--pf-white-color);
|
|
21
|
+
--pf-stepper-legend-step-disabled-text-color: var(--pf-tertiary-color-450);
|
|
22
|
+
|
|
23
|
+
// Completed Step
|
|
24
|
+
--pf-stepper-legend-circle-completed-background-color: var(--pf-secondary-color);
|
|
25
|
+
--pf-stepper-legend-circle-completed-text-color: var(--pf-white-color);
|
|
26
|
+
--pf-stepper-legend-line-completed-background-color: var(--pf-secondary-color);
|
|
27
|
+
// Current Step
|
|
28
|
+
--pf-stepper-legend-circle-current-background-color: var(--pf-secondary-color);
|
|
29
|
+
--pf-stepper-legend-circle-current-border-color: var(--pf-white-color);
|
|
30
|
+
--pf-stepper-legend-step-current-text-color: var(--pf-white-color);
|
|
31
|
+
--pf-stepper-legend-step-current-text-color: var(--pf-secondary-color);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.stepper {
|
|
35
|
+
padding: var(--pf-padding-8);
|
|
36
|
+
height: 100%;
|
|
37
|
+
display: grid;
|
|
38
|
+
grid-template-columns: auto 5fr;
|
|
39
|
+
gap: var(--pf-margin-8);
|
|
40
|
+
|
|
41
|
+
.stepper-body {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
height: 100%;
|
|
46
|
+
.stepper-content {
|
|
47
|
+
}
|
|
48
|
+
.stepper-actions {
|
|
49
|
+
display: flex;
|
|
50
|
+
justify-content: end;
|
|
51
|
+
align-items: center;
|
|
52
|
+
padding-top: var(--pf-padding-8);
|
|
53
|
+
border-top: solid 1px var(--pf-tertiary-color-800);
|
|
54
|
+
margin-top: var(--pf-margin-8);
|
|
55
|
+
margin-bottom: var(--pf-margin-8);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.stepper-navigation-back {
|
|
60
|
+
margin-right: var(--pf-margin-2);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.legend {
|
|
64
|
+
background-color: var(--pf-stepper-legend-background-color);
|
|
65
|
+
padding: var(--pf-padding-12) var(--pf-padding-8);
|
|
66
|
+
border-radius: var(--pf-rounded-xl);
|
|
67
|
+
width: 250px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.legend-header {
|
|
71
|
+
margin-bottom: var(--pf-margin-4);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.legend-body {
|
|
75
|
+
margin-bottom: var(--pf-margin-4);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.stepper-legend-circle {
|
|
79
|
+
width: 28px;
|
|
80
|
+
height: 28px;
|
|
81
|
+
border-radius: 50%;
|
|
82
|
+
background-color: var(--pf-stepper-legend-circle-background-color);
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
&.completed {
|
|
87
|
+
background-color: var(--pf-stepper-legend-circle-completed-background-color);
|
|
88
|
+
border-color: var(--pf-stepper-legend-circle-completed-background-color);
|
|
89
|
+
color: var(--pf-stepper-legend-circle-completed-text-color);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&.current {
|
|
93
|
+
background-color: var(--pf-stepper-legend-circle-current-background-color);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.stepper-legend-line {
|
|
98
|
+
width: 1px;
|
|
99
|
+
height: 30px;
|
|
100
|
+
min-height: 100%;
|
|
101
|
+
background-color: var(--pf-stepper-legend-line-background-color);
|
|
102
|
+
margin-left: 12px;
|
|
103
|
+
|
|
104
|
+
&--completed {
|
|
105
|
+
background-color: var(--pf-stepper-legend-line-completed-background-color);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.stepper-legend-step {
|
|
110
|
+
display: flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
.btn {
|
|
113
|
+
padding: 0;
|
|
114
|
+
margin-left: var(--pf-margin-2);
|
|
115
|
+
color: var(--pf-stepper-legend-step-text-color);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&--current-step {
|
|
119
|
+
.btn {
|
|
120
|
+
color: var(--pf-stepper-legend-step-current-text-color);
|
|
121
|
+
text-decoration: underline;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&--disabled-step {
|
|
126
|
+
.btn {
|
|
127
|
+
color: var(--pf-stepper-legend-step-disabled-text-color);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface StepperProps {
|
|
4
|
+
steps: Step[];
|
|
5
|
+
currentStep?: number;
|
|
6
|
+
legendHeader?: ReactNode;
|
|
7
|
+
legendFooter?: ReactNode;
|
|
8
|
+
onBackClick: () => void;
|
|
9
|
+
onNextClick: () => void;
|
|
10
|
+
onFinishClick: () => void;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
onStepClick: (step: number) => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface StepperLegendProps {
|
|
16
|
+
currentStep: number;
|
|
17
|
+
steps?: Step[];
|
|
18
|
+
onStepClick: (step: number) => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface Step {
|
|
22
|
+
label: string;
|
|
23
|
+
isCompleted?: boolean;
|
|
24
|
+
isNextDisabled?: boolean;
|
|
25
|
+
isOptional?: boolean;
|
|
26
|
+
isSidebarEnabled?: boolean;
|
|
27
|
+
}
|
|
@@ -64,10 +64,11 @@ export const TableBody = <T,>({
|
|
|
64
64
|
<tr className="tanstack-table__tbody__tr">
|
|
65
65
|
<td
|
|
66
66
|
className={classNames('tanstack-table__centered-row', {
|
|
67
|
-
'is-
|
|
67
|
+
'is-loading': isLoading,
|
|
68
68
|
})}
|
|
69
69
|
colSpan={columnsLength}
|
|
70
70
|
>
|
|
71
|
+
<h2 className="mb-12">Table is loading...</h2>
|
|
71
72
|
<CirclePulse data-testid="loading-indicator" />
|
|
72
73
|
</td>
|
|
73
74
|
</tr>
|
package/src/index.ts
CHANGED
|
@@ -32,11 +32,13 @@ export { Tooltip } from './components/tooltip';
|
|
|
32
32
|
export { Pagination } from './components/pagination';
|
|
33
33
|
export { CirclePulse } from './components/loading-indicators/CirclePulse';
|
|
34
34
|
export { BarSpinner } from './components/loading-indicators/BarSpinner/BarSpinner';
|
|
35
|
-
export {
|
|
35
|
+
export { Stepper } from './components/stepper';
|
|
36
|
+
|
|
36
37
|
// Utilities
|
|
37
38
|
export { registerFontAwesomeIcons } from './setup/setupIcons';
|
|
38
|
-
export {
|
|
39
|
+
export { Truncate } from './components/truncate';
|
|
39
40
|
|
|
41
|
+
export { toast, ToastContainer } from './components/toast';
|
|
40
42
|
// Types
|
|
41
43
|
export type {
|
|
42
44
|
ColumnDef,
|
package/src/styles/index.scss
CHANGED
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
@import '../components/loading-indicators/CirclePulse/CirclePulse.scss';
|
|
32
32
|
@import '../components/truncate/styles/Truncate.scss';
|
|
33
33
|
@import '../components/toast/styles/Toast.scss';
|
|
34
|
+
@import '../components/stepper/styles/Stepper.scss';
|
|
34
35
|
@import 'sheets'; // Port to an sheets component when we build it
|
|
35
36
|
@import 'typography';
|
|
36
37
|
@import 'colors';
|