Skip to content

Commit f98fa63

Browse files
authored
feat: Add not-started status type for StatusIndicator (#3960)
1 parent e8ce360 commit f98fa63

File tree

11 files changed

+41
-2
lines changed

11 files changed

+41
-2
lines changed

pages/status-indicator/permutations.page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import ScreenshotArea from '../utils/screenshot-area';
1010

1111
const permutations = createPermutations<InternalStatusIndicatorProps>([
1212
{
13-
type: ['error', 'warning', 'success', 'info', 'stopped', 'pending', 'in-progress', 'loading'],
13+
type: ['error', 'warning', 'success', 'info', 'stopped', 'pending', 'in-progress', 'loading', 'not-started'],
1414
},
1515
{
1616
type: ['pending'],

pages/status-indicator/simple.page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const statusToText: [StatusIndicatorProps.Type, string][] = [
1313
['pending', 'Pending'],
1414
['in-progress', 'In progress'],
1515
['loading', 'Loading'],
16+
['not-started', 'Not started'],
1617
];
1718

1819
export default function StatusIndicatorScenario() {

pages/steps/permutations-utils.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,12 @@ const allStatusesSteps: ReadonlyArray<StepsProps.Step> = [
295295
header: 'loading step',
296296
details: 'Test description',
297297
},
298+
{
299+
status: 'not-started',
300+
statusIconAriaLabel: 'not started',
301+
header: 'not started step',
302+
details: 'Test description',
303+
},
298304
];
299305

300306
const emptySteps: ReadonlyArray<StepsProps.Step> = [];

src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3066,6 +3066,7 @@ Instead, use \`onSelect\` in combination with the \`onChange\` handler only as a
30663066
"status-in-progress",
30673067
"status-info",
30683068
"status-negative",
3069+
"status-not-started",
30693070
"status-positive",
30703071
"status-stopped",
30713072
"status-warning",
@@ -5059,6 +5060,7 @@ This property is ignored if you use a predefined icon or if you set your custom
50595060
"status-in-progress",
50605061
"status-info",
50615062
"status-negative",
5063+
"status-not-started",
50625064
"status-positive",
50635065
"status-stopped",
50645066
"status-warning",
@@ -5844,6 +5846,7 @@ The main action also supports the following properties of the [button](/componen
58445846
"status-in-progress",
58455847
"status-info",
58465848
"status-negative",
5849+
"status-not-started",
58475850
"status-positive",
58485851
"status-stopped",
58495852
"status-warning",
@@ -13504,6 +13507,7 @@ use the \`id\` attribute, consider setting it on a parent element instead.",
1350413507
"status-in-progress",
1350513508
"status-info",
1350613509
"status-negative",
13510+
"status-not-started",
1350713511
"status-positive",
1350813512
"status-stopped",
1350913513
"status-warning",
@@ -14161,6 +14165,11 @@ The same applies to switching icons in the same configuration (for example, \`{'
1416114165
"optional": true,
1416214166
"type": "React.ReactNode",
1416314167
},
14168+
{
14169+
"name": "status-not-started",
14170+
"optional": true,
14171+
"type": "React.ReactNode",
14172+
},
1416414173
{
1416514174
"name": "status-pending",
1416614175
"optional": true,
@@ -18839,6 +18848,7 @@ This property is ignored if you use a predefined icon or if you set your custom
1883918848
"status-in-progress",
1884018849
"status-info",
1884118850
"status-negative",
18851+
"status-not-started",
1884218852
"status-positive",
1884318853
"status-stopped",
1884418854
"status-warning",
@@ -21691,6 +21701,7 @@ The event \`detail\` contains the current \`selectedOption\`.",
2169121701
"status-in-progress",
2169221702
"status-info",
2169321703
"status-negative",
21704+
"status-not-started",
2169421705
"status-positive",
2169521706
"status-stopped",
2169621707
"status-warning",
@@ -22282,6 +22293,7 @@ If you want to clear the selection, use \`null\`.",
2228222293
"status-in-progress",
2228322294
"status-info",
2228422295
"status-negative",
22296+
"status-not-started",
2228522297
"status-positive",
2228622298
"status-stopped",
2228722299
"status-warning",
@@ -23394,6 +23406,7 @@ We do not support using this attribute to apply custom styling.",
2339423406
"success",
2339523407
"warning",
2339623408
"info",
23409+
"not-started",
2339723410
],
2339823411
},
2339923412
"name": "type",
@@ -26924,6 +26937,7 @@ If an href is provided, it opens the link in a new tab.",
2692426937
"status-in-progress",
2692526938
"status-info",
2692626939
"status-negative",
26940+
"status-not-started",
2692726941
"status-positive",
2692826942
"status-stopped",
2692926943
"status-warning",
@@ -27127,6 +27141,7 @@ We do not support using this attribute to apply custom styling.",
2712727141
"status-in-progress",
2712827142
"status-info",
2712927143
"status-negative",
27144+
"status-not-started",
2713027145
"status-positive",
2713127146
"status-stopped",
2713227147
"status-warning",

src/icon-provider/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export namespace IconProviderProps {
126126
'status-in-progress'?: ReactNode | null;
127127
'status-info'?: ReactNode | null;
128128
'status-negative'?: ReactNode | null;
129+
'status-not-started'?: ReactNode | null;
129130
'status-pending'?: ReactNode | null;
130131
'status-positive'?: ReactNode | null;
131132
'status-stopped'?: ReactNode | null;
Lines changed: 3 additions & 0 deletions
Loading

src/icon/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ export namespace IconProps {
188188
| 'status-in-progress'
189189
| 'status-info'
190190
| 'status-negative'
191+
| 'status-not-started'
191192
| 'status-pending'
192193
| 'status-positive'
193194
| 'status-stopped'

src/status-indicator/interfaces.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ export interface StatusIndicatorProps extends BaseComponentProps {
4545
export namespace StatusIndicatorProps {
4646
// Why not enums? Explained there
4747
// https://stackoverflow.com/questions/52393730/typescript-string-literal-union-type-from-enum
48-
export type Type = 'error' | 'warning' | 'success' | 'info' | 'stopped' | 'pending' | 'in-progress' | 'loading';
48+
export type Type =
49+
| 'error'
50+
| 'warning'
51+
| 'success'
52+
| 'info'
53+
| 'stopped'
54+
| 'pending'
55+
| 'in-progress'
56+
| 'loading'
57+
| 'not-started';
4958
export type Color = 'blue' | 'grey' | 'green' | 'red' | 'yellow';
5059
}

src/status-indicator/internal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const typeToIcon: (size: IconProps.Size) => Record<StatusIndicatorProps.Type, JS
4545
pending: <InternalIcon name="status-pending" size={size} />,
4646
'in-progress': <InternalIcon name="status-in-progress" size={size} />,
4747
loading: <InternalSpinner />,
48+
'not-started': <InternalIcon name="status-not-started" size={size} />,
4849
});
4950

5051
interface InternalStatusIconProps extends Pick<InternalStatusIndicatorProps, 'type' | 'iconAriaLabel'> {

src/status-indicator/styles.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ $_status-colors: (
1818
'pending': awsui.$color-text-status-inactive,
1919
'in-progress': awsui.$color-text-status-inactive,
2020
'loading': awsui.$color-text-status-inactive,
21+
'not-started': awsui.$color-text-status-inactive,
2122
);
2223

2324
$_color-overrides: (

0 commit comments

Comments
 (0)