@indico-data/design-system 3.0.10 → 3.2.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/.storybook/main.ts +3 -0
- package/lib/components/badge/types.d.ts +4 -0
- package/lib/components/button/types.d.ts +52 -2
- package/lib/components/card/Card.d.ts +5 -0
- package/lib/components/floatUI/types.d.ts +7 -0
- package/lib/components/forms/checkbox/Checkbox.d.ts +7 -0
- package/lib/components/forms/date/datePicker/types.d.ts +10 -0
- package/lib/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.d.ts +16 -0
- package/lib/components/forms/date/inputDatePicker/SingleInputDatePicker.d.ts +8 -0
- package/lib/components/forms/date/inputDateRangePicker/InputDateRangePicker.d.ts +9 -0
- package/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.d.ts +9 -0
- package/lib/components/forms/numberInput/NumberInput.d.ts +4 -0
- package/lib/components/forms/passwordInput/PasswordInput.d.ts +1 -0
- package/lib/components/forms/radio/Radio.d.ts +6 -0
- package/lib/components/forms/select/Select.d.ts +10 -0
- package/lib/components/forms/textarea/Textarea.d.ts +7 -0
- package/lib/components/forms/timePicker/TimePicker.d.ts +5 -0
- package/lib/components/forms/toggle/Toggle.d.ts +7 -0
- package/lib/components/icons/types.d.ts +5 -0
- package/lib/components/loading-indicators/BarSpinner/BarSpinner.d.ts +4 -0
- package/lib/components/loading-indicators/CirclePulse/CirclePulse.d.ts +2 -0
- package/lib/components/menu/Menu.d.ts +1 -0
- package/lib/components/modal/types.d.ts +22 -0
- package/lib/components/pagination/types.d.ts +4 -0
- package/lib/components/pill/Pill.d.ts +1 -1
- package/lib/components/pill/Pill.stories.d.ts +2 -1
- package/lib/components/pill/types.d.ts +8 -2
- package/lib/components/skeleton/Skeleton.d.ts +5 -0
- package/lib/components/stepper/types.d.ts +9 -0
- package/lib/components/table/types.d.ts +9 -0
- package/lib/components/tanstackTable/TankstackTable.types.d.ts +25 -0
- package/lib/components/tanstackTable/components/ActionBar/ActionBar.d.ts +4 -0
- package/lib/components/tooltip/Tooltip.d.ts +6 -0
- package/lib/components/truncate/types.d.ts +4 -0
- package/lib/index.css +4977 -5020
- package/lib/index.d.ts +268 -5
- package/lib/index.esm.css +4977 -5020
- package/lib/index.esm.js +3 -2
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +3 -2
- package/lib/index.js.map +1 -1
- package/lib/types.d.ts +3 -1
- package/package.json +2 -1
- package/src/components/badge/Badge.stories.tsx +0 -4
- package/src/components/badge/types.ts +4 -0
- package/src/components/button/Button.stories.tsx +5 -18
- package/src/components/button/types.ts +52 -2
- package/src/components/card/Card.stories.tsx +0 -5
- package/src/components/card/Card.tsx +5 -0
- package/src/components/floatUI/FloatUI.stories.tsx +0 -11
- package/src/components/floatUI/types.ts +7 -0
- package/src/components/forms/checkbox/Checkbox.stories.tsx +0 -7
- package/src/components/forms/checkbox/Checkbox.tsx +7 -0
- package/src/components/forms/date/datePicker/DatePicker.stories.tsx +0 -33
- package/src/components/forms/date/datePicker/types.ts +10 -0
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.stories.tsx +5 -22
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.tsx +16 -0
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.stories.tsx +0 -25
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.tsx +8 -0
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.stories.tsx +0 -32
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.tsx +9 -0
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.stories.tsx +0 -28
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.tsx +9 -0
- package/src/components/forms/numberInput/NumberInput.stories.tsx +0 -4
- package/src/components/forms/numberInput/NumberInput.tsx +4 -0
- package/src/components/forms/passwordInput/PasswordInput.stories.tsx +0 -1
- package/src/components/forms/passwordInput/PasswordInput.tsx +1 -0
- package/src/components/forms/radio/Radio.stories.tsx +0 -6
- package/src/components/forms/radio/Radio.tsx +6 -0
- package/src/components/forms/select/Select.stories.tsx +1 -14
- package/src/components/forms/select/Select.tsx +10 -0
- package/src/components/forms/textarea/Textarea.stories.tsx +0 -7
- package/src/components/forms/textarea/Textarea.tsx +7 -0
- package/src/components/forms/timePicker/TimePicker.stories.tsx +0 -5
- package/src/components/forms/timePicker/TimePicker.tsx +5 -0
- package/src/components/forms/toggle/Toggle.stories.tsx +0 -7
- package/src/components/forms/toggle/Toggle.tsx +7 -0
- package/src/components/icons/Icon.stories.tsx +0 -7
- package/src/components/icons/types.ts +5 -0
- package/src/components/loading-indicators/BarSpinner/BarSpinner.stories.tsx +0 -5
- package/src/components/loading-indicators/BarSpinner/BarSpinner.tsx +4 -0
- package/src/components/loading-indicators/CirclePulse/CirclePulse.stories.tsx +0 -3
- package/src/components/loading-indicators/CirclePulse/CirclePulse.tsx +2 -0
- package/src/components/menu/Menu.stories.tsx +0 -3
- package/src/components/menu/Menu.tsx +1 -0
- package/src/components/modal/Modal.stories.tsx +1 -25
- package/src/components/modal/types.ts +22 -0
- package/src/components/pagination/Pagination.stories.tsx +0 -4
- package/src/components/pagination/types.ts +4 -0
- package/src/components/pill/Pill.mdx +6 -2
- package/src/components/pill/Pill.stories.tsx +50 -61
- package/src/components/pill/Pill.tsx +4 -2
- package/src/components/pill/__tests__/Pill.test.tsx +28 -10
- package/src/components/pill/styles/Pill.scss +12 -129
- package/src/components/pill/types.ts +8 -2
- package/src/components/skeleton/Skeleton.stories.tsx +0 -7
- package/src/components/skeleton/Skeleton.tsx +5 -0
- package/src/components/stepper/Stepper.stories.tsx +0 -19
- package/src/components/stepper/types.ts +9 -0
- package/src/components/table/Table.stories.tsx +0 -35
- package/src/components/table/types.ts +9 -0
- package/src/components/tanstackTable/TankstackTable.types.ts +25 -0
- package/src/components/tanstackTable/TanstackTable.stories.tsx +0 -29
- package/src/components/tanstackTable/components/ActionBar/ActionBar.stories.tsx +0 -4
- package/src/components/tanstackTable/components/ActionBar/ActionBar.tsx +4 -0
- package/src/components/tooltip/Tooltip.stories.tsx +0 -8
- package/src/components/tooltip/Tooltip.tsx +6 -0
- package/src/components/truncate/Truncate.stories.tsx +0 -8
- package/src/components/truncate/types.ts +4 -0
- package/src/styles/_colors.scss +9 -0
- package/src/styles/globals.scss +22 -0
- package/src/styles/index.scss +11 -10
- package/src/styles/variables/_colors.scss +269 -2
- package/src/types.ts +12 -8
- package/src/styles/variables/themes/dark.scss +0 -267
- package/src/styles/variables/themes/light.scss +0 -266
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { Pill } from './Pill';
|
|
3
3
|
import { Container, Row, Col } from 'react-grid-system';
|
|
4
|
+
import { ChromaticColor } from '@/types';
|
|
5
|
+
import { PillShade } from './types';
|
|
6
|
+
|
|
7
|
+
const CHROMATIC_COLORS: ChromaticColor[] = [
|
|
8
|
+
'blue',
|
|
9
|
+
'purple',
|
|
10
|
+
'red',
|
|
11
|
+
'yellow',
|
|
12
|
+
'gray',
|
|
13
|
+
'green',
|
|
14
|
+
'pink',
|
|
15
|
+
'orange',
|
|
16
|
+
'teal',
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
const SHADES: PillShade[] = [1, 2, 3, 4, 5];
|
|
4
20
|
|
|
5
21
|
const meta: Meta = {
|
|
6
22
|
title: 'Components/Pill',
|
|
@@ -17,7 +33,6 @@ const meta: Meta = {
|
|
|
17
33
|
},
|
|
18
34
|
children: {
|
|
19
35
|
control: 'text',
|
|
20
|
-
description: 'The content displayed inside the pill',
|
|
21
36
|
table: {
|
|
22
37
|
category: 'Props',
|
|
23
38
|
type: {
|
|
@@ -38,7 +53,6 @@ const meta: Meta = {
|
|
|
38
53
|
'pending',
|
|
39
54
|
'orange',
|
|
40
55
|
],
|
|
41
|
-
description: 'Applies a CSS class to change the style of the pill',
|
|
42
56
|
table: {
|
|
43
57
|
category: 'Props',
|
|
44
58
|
type: {
|
|
@@ -52,7 +66,6 @@ const meta: Meta = {
|
|
|
52
66
|
type: 'select',
|
|
53
67
|
options: ['sm', 'md', 'lg'],
|
|
54
68
|
},
|
|
55
|
-
description: 'Applies a CSS class to change the size of the pill',
|
|
56
69
|
table: {
|
|
57
70
|
category: 'Props',
|
|
58
71
|
type: {
|
|
@@ -69,8 +82,8 @@ type Story = StoryObj<typeof Pill>;
|
|
|
69
82
|
|
|
70
83
|
export const Default: Story = {
|
|
71
84
|
args: {
|
|
72
|
-
children: '
|
|
73
|
-
color: '
|
|
85
|
+
children: 'Green',
|
|
86
|
+
color: 'green',
|
|
74
87
|
},
|
|
75
88
|
render: (args) => {
|
|
76
89
|
return (
|
|
@@ -87,19 +100,13 @@ export const AllSizes: Story = {
|
|
|
87
100
|
<Container>
|
|
88
101
|
<Row>
|
|
89
102
|
<Col>
|
|
90
|
-
<Pill
|
|
91
|
-
Large (lg)
|
|
92
|
-
</Pill>
|
|
103
|
+
<Pill size="lg">Large (lg)</Pill>
|
|
93
104
|
</Col>
|
|
94
105
|
<Col>
|
|
95
|
-
<Pill
|
|
96
|
-
Medium (md)
|
|
97
|
-
</Pill>
|
|
106
|
+
<Pill size="md">Medium (md)</Pill>
|
|
98
107
|
</Col>
|
|
99
108
|
<Col>
|
|
100
|
-
<Pill
|
|
101
|
-
Small (sm)
|
|
102
|
-
</Pill>
|
|
109
|
+
<Pill size="sm">Small (sm)</Pill>
|
|
103
110
|
</Col>
|
|
104
111
|
</Row>
|
|
105
112
|
</Container>
|
|
@@ -107,58 +114,40 @@ export const AllSizes: Story = {
|
|
|
107
114
|
},
|
|
108
115
|
};
|
|
109
116
|
|
|
110
|
-
export const
|
|
117
|
+
export const AllDefaultColors: Story = {
|
|
111
118
|
render: () => {
|
|
112
119
|
return (
|
|
113
120
|
<Container>
|
|
114
|
-
<Row>
|
|
115
|
-
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
Warning
|
|
123
|
-
</Pill>
|
|
124
|
-
</Col>
|
|
125
|
-
<Col>
|
|
126
|
-
<Pill color="error" size="md">
|
|
127
|
-
Error
|
|
128
|
-
</Pill>
|
|
129
|
-
</Col>
|
|
130
|
-
<Col>
|
|
131
|
-
<Pill color="purple" size="md">
|
|
132
|
-
Purple
|
|
133
|
-
</Pill>
|
|
134
|
-
</Col>
|
|
135
|
-
<Col>
|
|
136
|
-
<Pill color="info" size="md">
|
|
137
|
-
Info
|
|
138
|
-
</Pill>
|
|
139
|
-
</Col>
|
|
140
|
-
<Col>
|
|
141
|
-
<Pill color="teal" size="md">
|
|
142
|
-
Teal
|
|
143
|
-
</Pill>
|
|
144
|
-
</Col>
|
|
145
|
-
<Col>
|
|
146
|
-
<Pill color="neutral" size="md">
|
|
147
|
-
Neutral
|
|
148
|
-
</Pill>
|
|
149
|
-
</Col>
|
|
150
|
-
<Col>
|
|
151
|
-
<Pill color="pending" size="md">
|
|
152
|
-
Pending
|
|
153
|
-
</Pill>
|
|
154
|
-
</Col>
|
|
155
|
-
<Col>
|
|
156
|
-
<Pill color="orange" size="md">
|
|
157
|
-
Orange
|
|
158
|
-
</Pill>
|
|
159
|
-
</Col>
|
|
121
|
+
<Row justify="start">
|
|
122
|
+
{CHROMATIC_COLORS.map((color: ChromaticColor) => (
|
|
123
|
+
<Col xs="content" className="mb-2">
|
|
124
|
+
<Pill color={color} size="md">
|
|
125
|
+
{color}
|
|
126
|
+
</Pill>
|
|
127
|
+
</Col>
|
|
128
|
+
))}
|
|
160
129
|
</Row>
|
|
161
130
|
</Container>
|
|
162
131
|
);
|
|
163
132
|
},
|
|
164
133
|
};
|
|
134
|
+
|
|
135
|
+
export const AllShades: Story = {
|
|
136
|
+
render: () => {
|
|
137
|
+
return (
|
|
138
|
+
<Container>
|
|
139
|
+
{CHROMATIC_COLORS.map((color: ChromaticColor) => (
|
|
140
|
+
<Row key={color}>
|
|
141
|
+
{SHADES.map((shade: PillShade) => (
|
|
142
|
+
<Col width={100} className="mb-2">
|
|
143
|
+
<Pill shade={shade} color={color} size="md">
|
|
144
|
+
{color}-{shade}
|
|
145
|
+
</Pill>
|
|
146
|
+
</Col>
|
|
147
|
+
))}
|
|
148
|
+
</Row>
|
|
149
|
+
))}
|
|
150
|
+
</Container>
|
|
151
|
+
);
|
|
152
|
+
},
|
|
153
|
+
};
|
|
@@ -4,12 +4,14 @@ import { PillProps } from './types';
|
|
|
4
4
|
export const Pill = ({
|
|
5
5
|
children,
|
|
6
6
|
className,
|
|
7
|
-
color = '
|
|
7
|
+
color = 'gray',
|
|
8
8
|
size = 'sm',
|
|
9
|
+
shade,
|
|
9
10
|
...rest
|
|
10
11
|
}: PillProps) => {
|
|
11
12
|
const pillClasses = classNames('pill', className, {
|
|
12
|
-
[`pill--${color}`]: color,
|
|
13
|
+
[`pill--${color}`]: color && !shade,
|
|
14
|
+
[`pill--${color}-${shade}`]: color && shade,
|
|
13
15
|
[`pill--${size}`]: size,
|
|
14
16
|
});
|
|
15
17
|
|
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react';
|
|
2
2
|
import { Pill } from '@/components/pill/Pill';
|
|
3
|
-
import { PillColor, PillSize } from '../types';
|
|
3
|
+
import { PillColor, PillShade, PillSize } from '../types';
|
|
4
4
|
|
|
5
5
|
const sizes = ['sm', 'md', 'lg'] as PillSize[];
|
|
6
6
|
const colors = [
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'
|
|
7
|
+
'blue',
|
|
8
|
+
'purple',
|
|
9
|
+
'red',
|
|
10
|
+
'yellow',
|
|
11
|
+
'gray',
|
|
12
|
+
'green',
|
|
13
|
+
'pink',
|
|
14
|
+
'orange',
|
|
15
|
+
'teal',
|
|
14
16
|
] as PillColor[];
|
|
15
17
|
|
|
18
|
+
const shades = [1, 2, 3, 4, 5] as PillShade[];
|
|
19
|
+
|
|
16
20
|
describe('Pill', () => {
|
|
17
21
|
sizes.forEach((size) => {
|
|
18
22
|
it(`checks that the proper size class is applied when size is ${size}`, () => {
|
|
19
23
|
render(
|
|
20
|
-
<Pill color="
|
|
24
|
+
<Pill color="blue" size={size} data-testid={`pill-${size}`}>
|
|
21
25
|
Success
|
|
22
26
|
</Pill>,
|
|
23
27
|
);
|
|
24
28
|
const pill = screen.getByTestId(`pill-${size}`);
|
|
25
|
-
expect(pill).toHaveClass(`pill pill--
|
|
29
|
+
expect(pill).toHaveClass(`pill pill--blue pill--${size}`);
|
|
26
30
|
});
|
|
27
31
|
});
|
|
28
32
|
|
|
@@ -37,4 +41,18 @@ describe('Pill', () => {
|
|
|
37
41
|
expect(pill).toHaveClass(`pill pill--${color} pill--md`);
|
|
38
42
|
});
|
|
39
43
|
});
|
|
44
|
+
|
|
45
|
+
colors.forEach((color) => {
|
|
46
|
+
shades.forEach((shade) => {
|
|
47
|
+
it(`checks that the proper style class has been applied when color is ${color} and shade is ${shade}`, () => {
|
|
48
|
+
render(
|
|
49
|
+
<Pill color={color} size="md" shade={shade} data-testid={`pill-${color}-${shade}`}>
|
|
50
|
+
Status
|
|
51
|
+
</Pill>,
|
|
52
|
+
);
|
|
53
|
+
const pill = screen.getByTestId(`pill-${color}-${shade}`);
|
|
54
|
+
expect(pill).toHaveClass(`pill pill--${color}-${shade} pill--md`);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
});
|
|
40
58
|
});
|
|
@@ -1,82 +1,3 @@
|
|
|
1
|
-
// Light Theme Specific Variables
|
|
2
|
-
:root [data-theme='light'] {
|
|
3
|
-
--pf-pill-info-background-color: var(--pf-info-color-dark);
|
|
4
|
-
--pf-pill-info-font-color: var(--pf-gray-color-50);
|
|
5
|
-
--pf-pill-info-border-color: var(--pf-info-color-dark);
|
|
6
|
-
|
|
7
|
-
--pf-pill-error-background-color: var(--pf-error-color-dark);
|
|
8
|
-
--pf-pill-error-font-color: var(--pf-gray-color-50);
|
|
9
|
-
--pf-pill-error-border-color: var(--pf-error-color-dark);
|
|
10
|
-
|
|
11
|
-
--pf-pill-warning-background-color: var(--pf-warning-color-dark);
|
|
12
|
-
--pf-pill-warning-font-color: var(--pf-gray-color-50);
|
|
13
|
-
--pf-pill-warning-border-color: var(--pf-warning-color-dark);
|
|
14
|
-
|
|
15
|
-
--pf-pill-neutral-background-color: var(--pf-gray-color-700);
|
|
16
|
-
--pf-pill-neutral-font-color: var(--pf-gray-color-50);
|
|
17
|
-
--pf-pill-neutral-border-color: var(--pf-gray-color-700);
|
|
18
|
-
|
|
19
|
-
--pf-pill-success-background-color: var(--pf-success-color-dark);
|
|
20
|
-
--pf-pill-success-font-color: var(--pf-gray-color-50);
|
|
21
|
-
--pf-pill-success-border-color: var(--pf-success-color-dark);
|
|
22
|
-
|
|
23
|
-
--pf-pill-purple-background-color: color-mix(in srgb, var(--pf-purple-color-450) 75%, black);
|
|
24
|
-
--pf-pill-purple-font-color: var(--pf-gray-color-50);
|
|
25
|
-
--pf-pill-purple-border-color: color-mix(in srgb, var(--pf-purple-color-450) 75%, black);
|
|
26
|
-
|
|
27
|
-
--pf-pill-pending-background-color: var(--pf-pending-color-dark);
|
|
28
|
-
--pf-pill-pending-font-color: var(--pf-gray-color-50);
|
|
29
|
-
--pf-pill-pending-border-color: var(--pf-pending-color-dark);
|
|
30
|
-
|
|
31
|
-
--pf-pill-orange-background-color: color-mix(in srgb, var(--pf-orange-color-500) 75%, black);
|
|
32
|
-
--pf-pill-orange-font-color: var(--pf-gray-color-50);
|
|
33
|
-
--pf-pill-orange-border-color: color-mix(in srgb, var(--pf-orange-color-500) 75%, black);
|
|
34
|
-
|
|
35
|
-
--pf-pill-teal-background-color: color-mix(in srgb, var(--pf-teal-color-600) 75%, black);
|
|
36
|
-
--pf-pill-teal-font-color: var(--pf-gray-color-50);
|
|
37
|
-
--pf-pill-teal-border-color: color-mix(in srgb, var(--pf-teal-color-600) 75%, black);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Dark Theme Specific Variables
|
|
41
|
-
:root [data-theme='dark'],
|
|
42
|
-
:root {
|
|
43
|
-
--pf-pill-info-background-color: var(--pf-info-color-dark);
|
|
44
|
-
--pf-pill-info-font-color: var(--pf-gray-color-50);
|
|
45
|
-
--pf-pill-info-border-color: var(--pf-info-color-dark);
|
|
46
|
-
|
|
47
|
-
--pf-pill-error-background-color: var(--pf-error-color-dark);
|
|
48
|
-
--pf-pill-error-font-color: var(--pf-gray-color-50);
|
|
49
|
-
--pf-pill-error-border-color: var(--pf-error-color-dark);
|
|
50
|
-
|
|
51
|
-
--pf-pill-warning-background-color: var(--pf-warning-color-dark);
|
|
52
|
-
--pf-pill-warning-font-color: var(--pf-gray-color-50);
|
|
53
|
-
--pf-pill-warning-border-color: var(--pf-warning-color-dark);
|
|
54
|
-
|
|
55
|
-
--pf-pill-neutral-background-color: var(--pf-gray-color-700);
|
|
56
|
-
--pf-pill-neutral-font-color: var(--pf-gray-color-50);
|
|
57
|
-
--pf-pill-neutral-border-color: var(--pf-gray-color-700);
|
|
58
|
-
|
|
59
|
-
--pf-pill-success-background-color: var(--pf-success-color-dark);
|
|
60
|
-
--pf-pill-success-font-color: var(--pf-gray-color-50);
|
|
61
|
-
--pf-pill-success-border-color: var(--pf-success-color-dark);
|
|
62
|
-
|
|
63
|
-
--pf-pill-purple-background-color: color-mix(in srgb, var(--pf-purple-color-450) 75%, black);
|
|
64
|
-
--pf-pill-purple-font-color: var(--pf-gray-color-50);
|
|
65
|
-
--pf-pill-purple-border-color: color-mix(in srgb, var(--pf-purple-color-450) 75%, black);
|
|
66
|
-
|
|
67
|
-
--pf-pill-pending-background-color: var(--pf-pending-color-dark);
|
|
68
|
-
--pf-pill-pending-font-color: var(--pf-gray-color-50);
|
|
69
|
-
--pf-pill-pending-border-color: var(--pf-pending-color-dark);
|
|
70
|
-
|
|
71
|
-
--pf-pill-orange-background-color: color-mix(in srgb, var(--pf-orange-color-500) 75%, black);
|
|
72
|
-
--pf-pill-orange-font-color: var(--pf-gray-color-50);
|
|
73
|
-
--pf-pill-orange-border-color: color-mix(in srgb, var(--pf-orange-color-500) 75%, black);
|
|
74
|
-
|
|
75
|
-
--pf-pill-teal-background-color: color-mix(in srgb, var(--pf-teal-color-600) 75%, black);
|
|
76
|
-
--pf-pill-teal-font-color: var(--pf-gray-color-50);
|
|
77
|
-
--pf-pill-teal-border-color: color-mix(in srgb, var(--pf-teal-color-600) 75%, black);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
1
|
.pill {
|
|
81
2
|
display: inline-block;
|
|
82
3
|
border-radius: var(--pf-rounded);
|
|
@@ -86,6 +7,7 @@
|
|
|
86
7
|
white-space: nowrap;
|
|
87
8
|
line-height: 1;
|
|
88
9
|
border: solid 1px;
|
|
10
|
+
color: var(--pf-font-color-light);
|
|
89
11
|
|
|
90
12
|
&--sm {
|
|
91
13
|
padding: var(--pf-padding-1) var(--pf-padding-2);
|
|
@@ -102,56 +24,17 @@
|
|
|
102
24
|
font-size: var(--pf-font-size-h2);
|
|
103
25
|
}
|
|
104
26
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
&--warning {
|
|
111
|
-
background-color: var(--pf-pill-warning-background-color);
|
|
112
|
-
color: var(--pf-pill-warning-font-color);
|
|
113
|
-
border-color: var(--pf-pill-warning-border-color);
|
|
114
|
-
}
|
|
115
|
-
&--info {
|
|
116
|
-
background-color: var(--pf-pill-info-background-color);
|
|
117
|
-
color: var(--pf-pill-info-font-color);
|
|
118
|
-
border-color: var(--pf-pill-info-border-color);
|
|
119
|
-
}
|
|
120
|
-
&--success {
|
|
121
|
-
background-color: var(--pf-pill-success-background-color);
|
|
122
|
-
color: var(--pf-pill-success-font-color);
|
|
123
|
-
border-color: var(--pf-pill-success-border-color);
|
|
124
|
-
}
|
|
125
|
-
&--neutral {
|
|
126
|
-
background-color: var(--pf-pill-neutral-background-color);
|
|
127
|
-
color: var(--pf-pill-neutral-font-color);
|
|
128
|
-
border-color: var(--pf-pill-neutral-border-color);
|
|
129
|
-
}
|
|
130
|
-
&--info {
|
|
131
|
-
background-color: var(--pf-pill-info-background-color);
|
|
132
|
-
color: var(--pf-pill-info-font-color);
|
|
133
|
-
border-color: var(--pf-pill-info-border-color);
|
|
134
|
-
}
|
|
135
|
-
&--pending {
|
|
136
|
-
background-color: var(--pf-pill-pending-background-color);
|
|
137
|
-
color: var(--pf-pill-pending-font-color);
|
|
138
|
-
border-color: var(--pf-pill-pending-border-color);
|
|
139
|
-
}
|
|
27
|
+
@each $color in $chromatic-color-names {
|
|
28
|
+
&--#{$color} {
|
|
29
|
+
background-color: var(--pf-item-#{$color}-color);
|
|
30
|
+
border-color: var(--pf-item-#{$color}-color);
|
|
31
|
+
}
|
|
140
32
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
&--orange {
|
|
148
|
-
background-color: var(--pf-pill-orange-background-color);
|
|
149
|
-
color: var(--pf-pill-orange-font-color);
|
|
150
|
-
border-color: var(--pf-pill-orange-border-color);
|
|
151
|
-
}
|
|
152
|
-
&--teal {
|
|
153
|
-
background-color: var(--pf-pill-teal-background-color);
|
|
154
|
-
color: var(--pf-pill-teal-font-color);
|
|
155
|
-
border-color: var(--pf-pill-teal-border-color);
|
|
33
|
+
@each $shade, $color-number in $item-shades-to-color-number {
|
|
34
|
+
&--#{$color}-#{$shade} {
|
|
35
|
+
background-color: var(--pf-item-#{$color}-#{$shade}-color);
|
|
36
|
+
border-color: var(--pf-item-#{$color}-#{$shade}-color);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
156
39
|
}
|
|
157
40
|
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChromaticColor } from '../../types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
export type PillSize = 'sm' | 'md' | 'lg';
|
|
5
|
-
export type PillColor =
|
|
5
|
+
export type PillColor = ChromaticColor;
|
|
6
|
+
export type PillShade = 1 | 2 | 3 | 4 | 5;
|
|
6
7
|
|
|
7
8
|
export interface PillProps {
|
|
9
|
+
/** The content displayed inside the pill */
|
|
8
10
|
children: React.ReactNode | React.ReactNode[];
|
|
11
|
+
/** Applies a CSS class to change the style of the pill */
|
|
9
12
|
color?: PillColor;
|
|
13
|
+
/** Applies a CSS class to change the size of the pill */
|
|
10
14
|
size?: PillSize;
|
|
15
|
+
/** Applies a CSS class to change the shade of the pill */
|
|
16
|
+
shade?: PillShade;
|
|
11
17
|
className?: string;
|
|
12
18
|
}
|
|
@@ -8,7 +8,6 @@ const meta: Meta = {
|
|
|
8
8
|
argTypes: {
|
|
9
9
|
className: {
|
|
10
10
|
control: 'text',
|
|
11
|
-
description: 'Additional classes for the skeleton component',
|
|
12
11
|
table: {
|
|
13
12
|
category: 'Props',
|
|
14
13
|
type: {
|
|
@@ -18,8 +17,6 @@ const meta: Meta = {
|
|
|
18
17
|
},
|
|
19
18
|
height: {
|
|
20
19
|
control: 'number',
|
|
21
|
-
description:
|
|
22
|
-
'The height of the skeleton component, either in px (number) or a generic string (e.g. "20px", "50%", "100%")',
|
|
23
20
|
table: {
|
|
24
21
|
category: 'Props',
|
|
25
22
|
type: {
|
|
@@ -29,8 +26,6 @@ const meta: Meta = {
|
|
|
29
26
|
},
|
|
30
27
|
width: {
|
|
31
28
|
control: 'number',
|
|
32
|
-
description:
|
|
33
|
-
'The width of the skeleton component, either in px (number) or a generic string (e.g. "20px", "50%", "100%")',
|
|
34
29
|
table: {
|
|
35
30
|
category: 'Props',
|
|
36
31
|
type: {
|
|
@@ -40,7 +35,6 @@ const meta: Meta = {
|
|
|
40
35
|
},
|
|
41
36
|
isCircle: {
|
|
42
37
|
control: 'boolean',
|
|
43
|
-
description: 'Sets the skeleton component to be a circle',
|
|
44
38
|
table: {
|
|
45
39
|
category: 'Props',
|
|
46
40
|
type: {
|
|
@@ -51,7 +45,6 @@ const meta: Meta = {
|
|
|
51
45
|
},
|
|
52
46
|
isFullHeight: {
|
|
53
47
|
control: 'boolean',
|
|
54
|
-
description: 'Sets the skeleton component to be full height',
|
|
55
48
|
table: {
|
|
56
49
|
category: 'Props',
|
|
57
50
|
type: {
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
type Props = {
|
|
2
|
+
/** Additional classes for the skeleton component */
|
|
2
3
|
className?: string;
|
|
4
|
+
/** The height of the skeleton component, either in px (number) or a generic string (e.g. "20px", "50%", "100%") */
|
|
3
5
|
height?: number | string;
|
|
6
|
+
/** The width of the skeleton component, either in px (number) or a generic string (e.g. "20px", "50%", "100%") */
|
|
4
7
|
width?: number | string;
|
|
8
|
+
/** Sets the skeleton component to be a circle */
|
|
5
9
|
isCircle?: boolean;
|
|
10
|
+
/** Sets the skeleton component to be full height */
|
|
6
11
|
isFullHeight?: boolean;
|
|
7
12
|
};
|
|
8
13
|
|
|
@@ -17,7 +17,6 @@ const meta: Meta = {
|
|
|
17
17
|
argTypes: {
|
|
18
18
|
legendHeader: {
|
|
19
19
|
control: false,
|
|
20
|
-
description: 'The header content for the legend.',
|
|
21
20
|
table: {
|
|
22
21
|
category: 'Props',
|
|
23
22
|
type: {
|
|
@@ -27,7 +26,6 @@ const meta: Meta = {
|
|
|
27
26
|
},
|
|
28
27
|
legendFooter: {
|
|
29
28
|
control: false,
|
|
30
|
-
description: 'The footer content for the legend.',
|
|
31
29
|
table: {
|
|
32
30
|
category: 'Props',
|
|
33
31
|
type: {
|
|
@@ -37,7 +35,6 @@ const meta: Meta = {
|
|
|
37
35
|
},
|
|
38
36
|
steps: {
|
|
39
37
|
control: false,
|
|
40
|
-
description: 'An array of step objects that define the stepper navigation.',
|
|
41
38
|
table: {
|
|
42
39
|
category: 'Props',
|
|
43
40
|
type: {
|
|
@@ -46,7 +43,6 @@ const meta: Meta = {
|
|
|
46
43
|
},
|
|
47
44
|
},
|
|
48
45
|
label: {
|
|
49
|
-
description: 'Display text for the step in the sidebar/legend',
|
|
50
46
|
table: {
|
|
51
47
|
category: 'Step Properties',
|
|
52
48
|
type: {
|
|
@@ -56,8 +52,6 @@ const meta: Meta = {
|
|
|
56
52
|
control: false,
|
|
57
53
|
},
|
|
58
54
|
isCompleted: {
|
|
59
|
-
description:
|
|
60
|
-
'Indicates whether this step has been completed. Used to track progress and determine whether to enable subsequent steps.',
|
|
61
55
|
table: {
|
|
62
56
|
category: 'Step Properties',
|
|
63
57
|
type: {
|
|
@@ -68,8 +62,6 @@ const meta: Meta = {
|
|
|
68
62
|
control: false,
|
|
69
63
|
},
|
|
70
64
|
isNextDisabled: {
|
|
71
|
-
description:
|
|
72
|
-
'When true, the Next button will be disabled for this step. Set to true for steps that require completion before proceeding.',
|
|
73
65
|
table: {
|
|
74
66
|
category: 'Step Properties',
|
|
75
67
|
type: {
|
|
@@ -80,8 +72,6 @@ const meta: Meta = {
|
|
|
80
72
|
control: false,
|
|
81
73
|
},
|
|
82
74
|
isOptional: {
|
|
83
|
-
description:
|
|
84
|
-
'When true, the step can be skipped (the Next button remains enabled). Used for optional information or steps that are not required to complete the flow.',
|
|
85
75
|
table: {
|
|
86
76
|
category: 'Step Properties',
|
|
87
77
|
type: {
|
|
@@ -92,8 +82,6 @@ const meta: Meta = {
|
|
|
92
82
|
control: false,
|
|
93
83
|
},
|
|
94
84
|
isSidebarEnabled: {
|
|
95
|
-
description:
|
|
96
|
-
'When true, the step is clickable in the sidebar. Used for restricting navigation until previous steps are completed.',
|
|
97
85
|
table: {
|
|
98
86
|
category: 'Step Properties',
|
|
99
87
|
type: {
|
|
@@ -105,8 +93,6 @@ const meta: Meta = {
|
|
|
105
93
|
},
|
|
106
94
|
currentStep: {
|
|
107
95
|
control: false,
|
|
108
|
-
description:
|
|
109
|
-
'The current step of the stepper. This value should be an index of the steps array.',
|
|
110
96
|
table: {
|
|
111
97
|
category: 'Props',
|
|
112
98
|
type: {
|
|
@@ -117,7 +103,6 @@ const meta: Meta = {
|
|
|
117
103
|
},
|
|
118
104
|
onBackClick: {
|
|
119
105
|
control: false,
|
|
120
|
-
description: 'The function to call when the back button is clicked.',
|
|
121
106
|
table: {
|
|
122
107
|
category: 'Callbacks',
|
|
123
108
|
type: {
|
|
@@ -127,7 +112,6 @@ const meta: Meta = {
|
|
|
127
112
|
},
|
|
128
113
|
onFinishClick: {
|
|
129
114
|
control: false,
|
|
130
|
-
description: 'The function to call when the finish button is clicked.',
|
|
131
115
|
table: {
|
|
132
116
|
category: 'Callbacks',
|
|
133
117
|
type: {
|
|
@@ -137,7 +121,6 @@ const meta: Meta = {
|
|
|
137
121
|
},
|
|
138
122
|
onStepClick: {
|
|
139
123
|
control: false,
|
|
140
|
-
description: 'The function to call when a step is clicked ont he legend.',
|
|
141
124
|
table: {
|
|
142
125
|
category: 'Callbacks',
|
|
143
126
|
type: {
|
|
@@ -147,7 +130,6 @@ const meta: Meta = {
|
|
|
147
130
|
},
|
|
148
131
|
onNextClick: {
|
|
149
132
|
control: false,
|
|
150
|
-
description: 'The function to call when the next button is clicked.',
|
|
151
133
|
table: {
|
|
152
134
|
category: 'Callbacks',
|
|
153
135
|
type: {
|
|
@@ -157,7 +139,6 @@ const meta: Meta = {
|
|
|
157
139
|
},
|
|
158
140
|
children: {
|
|
159
141
|
control: false,
|
|
160
|
-
description: 'Any item passed to this component as a child will be rendered as a step.',
|
|
161
142
|
table: {
|
|
162
143
|
category: 'Props',
|
|
163
144
|
type: {
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface StepperProps {
|
|
4
|
+
/** An array of step objects that define the stepper navigation. */
|
|
4
5
|
steps: Step[];
|
|
5
6
|
currentStep?: number;
|
|
7
|
+
/** The header content for the legend. */
|
|
6
8
|
legendHeader?: ReactNode;
|
|
9
|
+
/** The footer content for the legend. */
|
|
7
10
|
legendFooter?: ReactNode;
|
|
11
|
+
/** The function to call when the back button is clicked. */
|
|
8
12
|
onBackClick: () => void;
|
|
13
|
+
/** The function to call when the next button is clicked. */
|
|
9
14
|
onNextClick: () => void;
|
|
15
|
+
/** The function to call when the finish button is clicked. */
|
|
10
16
|
onFinishClick: () => void;
|
|
17
|
+
/** Any item passed to this component as a child will be rendered as a step. */
|
|
11
18
|
children: React.ReactNode;
|
|
19
|
+
/** The function to call when a step is clicked ont he legend. */
|
|
12
20
|
onStepClick: (step: number) => void;
|
|
13
21
|
}
|
|
14
22
|
|
|
@@ -19,6 +27,7 @@ export interface StepperLegendProps {
|
|
|
19
27
|
}
|
|
20
28
|
|
|
21
29
|
export interface Step {
|
|
30
|
+
/** Display text for the step in the sidebar/legend */
|
|
22
31
|
label: string;
|
|
23
32
|
isCompleted?: boolean;
|
|
24
33
|
isNextDisabled?: boolean;
|