Skip to content

Commit f4eac53

Browse files
committed
chore(Stepper): added icon story
1 parent c1710d5 commit f4eac53

3 files changed

Lines changed: 35 additions & 5 deletions

File tree

docs/INSTALLATION.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Install SGDS web components locally with the following command
88

99
```js
1010

11-
npm install @govtechsg/sgds-web-component@3.19.0
11+
npm install @govtechsg/sgds-web-component@3.19.1
1212

1313
```
1414

@@ -53,14 +53,14 @@ This method registers all SGDS elements up front in the Custom Elements Registry
5353
5454
```js
5555
// Load global css file
56-
<link href='https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@3.19.0/themes/day.css' rel='stylesheet' type='text/css' />
57-
<link href='https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@3.19.0/css/sgds.css' rel='stylesheet' type='text/css' />
56+
<link href='https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@3.19.1/themes/day.css' rel='stylesheet' type='text/css' />
57+
<link href='https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@3.19.1/css/sgds.css' rel='stylesheet' type='text/css' />
5858

5959
// it is recommended to load a particular version when using cdn e.g. https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@1.0.2
60-
<script src="https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@3.19.0" async crossorigin="anonymous" integrity="sha384-YyOd0WvMkjNXe/YZvQtV3ubH7kcwNVwNELO7gxbVbs3TZpHcUz421oWhRMq0hHRH"></script>
60+
<script src="https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@3.19.1" async crossorigin="anonymous" integrity="sha384-q0ApD7UB4FXJLvsXruVOTA9jSBfelxkXUaN3f6ZHRYc0tr1xyNCNAnKT3igeVKRD"></script>
6161

6262
//or load a single component e.g. Masthead
63-
<script src="https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@3.19.0/components/Masthead/index.umd.min.js" async crossorigin="anonymous" integrity="sha384-5OKa7RaQpYeIsx/ZOXW2ttNUa7ftAEKXiWuSgFRmlXJUaJ1Bvf3etjlCw2qqjia8"></script>
63+
<script src="https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@3.19.1/components/Masthead/index.umd.min.js" async crossorigin="anonymous" integrity="sha384-5OKa7RaQpYeIsx/ZOXW2ttNUa7ftAEKXiWuSgFRmlXJUaJ1Bvf3etjlCw2qqjia8"></script>
6464

6565
```
6666

stories/component-templates/Stepper/additional.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ export interface SgdsStepProperties {
2424
<Story of={StepperStories.StepComponentClickable} />
2525
</Canvas>
2626

27+
### Custom Icon
28+
29+
Use the `iconName` prop on `<sgds-step>` to replace the default step number with an icon from the SGDS icon set.
30+
31+
<Canvas of={StepperStories.CustomIcon}>
32+
<Story of={StepperStories.CustomIcon} />
33+
</Canvas>
34+
2735
### Step states (active, completed, disabled)
2836

2937
<Canvas of={StepperStories.StepStates}>

stories/component-templates/Stepper/additional.stories.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,28 @@ export const SlottedClickable = {
147147
tags: ["!dev"]
148148
};
149149

150+
const CustomIconTemplate = () => html`
151+
<sgds-stepper activeStep="1">
152+
<sgds-step stepHeader="Personal Details" iconName="user-circle">
153+
<div>Provide your personal information.</div>
154+
</sgds-step>
155+
<sgds-step stepHeader="Address" iconName="geo-alt">
156+
<div>Enter your address and contact details.</div>
157+
</sgds-step>
158+
<sgds-step stepHeader="Review" iconName="check-circle-fill">
159+
<div>Review all details before submitting.</div>
160+
</sgds-step>
161+
</sgds-stepper>
162+
`;
163+
164+
export const CustomIcon = {
165+
render: CustomIconTemplate.bind({}),
166+
name: "Custom Icon",
167+
args: {},
168+
parameters: {},
169+
tags: ["!dev"]
170+
};
171+
150172
const MockStepperTemplate = () => html`<mock-stepper></mock-stepper>`;
151173

152174
export const StepperExample = {

0 commit comments

Comments
 (0)