Skip to content

Commit 63d5c38

Browse files
authored
Merge pull request #1870 from dxc-technology/jialecl/accordion-icon-doc
Accordion's icon doc updated
2 parents 9a4df96 + 9c2aee8 commit 63d5c38

File tree

3 files changed

+26
-38
lines changed

3 files changed

+26
-38
lines changed

website/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/screens/components/accordion/code/AccordionCodePage.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
DxcFlex,
33
DxcTable,
44
DxcParagraph,
5+
DxcLink,
56
} from "@dxc-technology/halstack-react";
67
import QuickNavContainer from "@/common/QuickNavContainer";
78
import QuickNavContainerLayout from "@/common/QuickNavContainerLayout";
@@ -70,8 +71,14 @@ const sections = [
7071
</TableCode>
7172
</td>
7273
<td>
73-
Element or path used as the icon that will be placed next to panel
74-
label.
74+
<DxcLink newWindow href="https://fonts.google.com/icons">
75+
Material Symbol
76+
</DxcLink>{" "}
77+
name or SVG element as the icon that will be placed next to the
78+
panel label. When using Material Symbols, replace spaces with
79+
underscores. By default they are outlined if you want it to be
80+
filled prefix the symbol name with{" "}
81+
<TableCode>"filled_"</TableCode>.
7582
</td>
7683
<td>-</td>
7784
</tr>
@@ -305,8 +312,14 @@ const sections = [
305312
</TableCode>
306313
</td>
307314
<td>
308-
Element or path used as the icon that will be placed next
309-
to panel label.
315+
<DxcLink newWindow href="https://fonts.google.com/icons">
316+
Material Symbol
317+
</DxcLink>{" "}
318+
name or SVG element as the icon that will be placed next
319+
to the panel label. When using Material Symbols, replace
320+
spaces with underscores. By default they are outlined if
321+
you want it to be filled prefix the symbol name with{" "}
322+
<TableCode>"filled_"</TableCode>.
310323
</td>
311324
<td>-</td>
312325
</tr>

website/screens/components/accordion/code/examples/icons.ts

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,11 @@ import {
77
import { useState } from "react";
88

99
const code = `() => {
10-
const infoIcon = (
11-
<svg
12-
xmlns="http://www.w3.org/2000/svg"
13-
width="23"
14-
height="23"
15-
viewBox="0 0 24 24"
16-
fill="currentColor"
17-
>
18-
<path d="M0 0h24v24H0z" fill="none" />
19-
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" />
20-
</svg>
21-
);
22-
23-
const successIcon = (
24-
<svg
25-
xmlns="http://www.w3.org/2000/svg"
26-
width="23"
27-
height="23"
28-
viewBox="0 0 24 24"
29-
fill="currentColor"
30-
>
31-
<path d="M0 0h24v24H0z" fill="none" />
32-
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" />
33-
</svg>
34-
);
3510
3611
return (
3712
<DxcInset space="2rem">
3813
<DxcFlex direction="column" gap="2rem">
39-
<DxcAccordion label="How to edit your profile?" icon={infoIcon}>
14+
<DxcAccordion label="How to edit your profile?" icon="filled_info">
4015
<DxcInset space="1.5rem">
4116
To edit your profile you need to go to Settings and click on
4217
Profile.
@@ -45,7 +20,7 @@ const code = `() => {
4520
<DxcAccordionGroup defaultIndexActive={0}>
4621
<DxcAccordionGroup.Accordion
4722
label="How to edit your profile?"
48-
icon={successIcon}
23+
icon="filled_check_circle"
4924
>
5025
<DxcInset space="1.5rem">
5126
To edit your profile you need to go to Settings and click on
@@ -54,7 +29,7 @@ const code = `() => {
5429
</DxcAccordionGroup.Accordion>
5530
<DxcAccordionGroup.Accordion
5631
label="How to log out?"
57-
icon={successIcon}
32+
icon="filled_check_circle"
5833
>
5934
<DxcInset space="1.5rem">
6035
To edit your profile you need to go to Settings and click on Log

0 commit comments

Comments
 (0)