Skip to content

Commit 79d75b6

Browse files
committed
Merge branch 'jialecl/actionsCell-icon' of https://github.com/dxc-technology/halstack-react into jialecl/actionsCell-icon
2 parents c4718c0 + 6614bac commit 79d75b6

File tree

4 files changed

+37
-61
lines changed

4 files changed

+37
-61
lines changed

website/package-lock.json

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

website/screens/components/button/code/ButtonCodePage.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,14 @@ const sections = [
8585
</TableCode>
8686
</td>
8787
<td>
88-
Element or path used as the icon that will be placed next to the
89-
button label.
88+
<DxcLink newWindow href="https://fonts.google.com/icons">
89+
Material Symbol
90+
</DxcLink>{" "}
91+
name or SVG element as the icon that will be placed next to the
92+
label. When using Material Symbols, replace spaces with
93+
underscores. By default they are outlined if you want it to be
94+
filled prefix the symbol name with{" "}
95+
<TableCode>"filled_"</TableCode>.
9096
</td>
9197
<td>-</td>
9298
</tr>

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

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,11 @@
11
import { DxcButton, DxcFlex, DxcInset } from "@dxc-technology/halstack-react";
22

33
const code = `() => {
4-
const icon = (
5-
<svg
6-
xmlns="http://www.w3.org/2000/svg"
7-
height="48"
8-
viewBox="0 -960 960 960"
9-
width="48"
10-
fill="currentColor"
11-
>
12-
<path d="m480-121-41-37q-105.768-97.121-174.884-167.561Q195-396 154-451.5T96.5-552Q80-597 80-643q0-90.155 60.5-150.577Q201-854 290-854q57 0 105.5 27t84.5 78q42-54 89-79.5T670-854q89 0 149.5 60.423Q880-733.155 880-643q0 46-16.5 91T806-451.5Q765-396 695.884-325.561 626.768-255.121 521-158l-41 37Zm0-79q101.236-92.995 166.618-159.498Q712-426 750.5-476t54-89.135q15.5-39.136 15.5-77.72Q820-709 778-751.5T670.225-794q-51.524 0-95.375 31.5Q531-731 504-674h-49q-26-56-69.85-88-43.851-32-95.375-32Q224-794 182-751.5t-42 108.816Q140-604 155.5-564.5t54 90Q248-424 314-358t166 158Zm0-297Z" />
13-
</svg>
14-
);
15-
164
return (
175
<DxcInset space="2rem">
186
<DxcFlex gap="1.5rem">
19-
<DxcButton icon={icon} label="Donate" />
20-
<DxcButton icon={icon} mode="secondary" title="Donate" />
7+
<DxcButton icon="volunteer_activism" label="Donate" />
8+
<DxcButton icon="filled_volunteer_activism" mode="secondary" title="Donate" />
219
</DxcFlex>
2210
</DxcInset>
2311
);

website/screens/components/button/usage/examples/iconUsage.ts

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,46 @@
11
import { DxcButton, DxcFlex, DxcInset } from "@dxc-technology/halstack-react";
22

33
const code = `() => {
4-
const icon = (
5-
<svg
6-
x="0px"
7-
y="0px"
8-
width="24px"
9-
height="24px"
10-
viewBox="0 0 24 24"
11-
enableBackground="new 0 0 24 24"
12-
fill="currentColor"
13-
>
14-
<g id="Bounding_Box">
15-
<rect fill="none" width="24" height="24" />
16-
</g>
17-
<g id="Master">
18-
<path d="M19,9.3V4h-3v2.6L12,3L2,12h3v8h5v-6h4v6h5v-8h3L19,9.3z M10,10c0-1.1,0.9-2,2-2s2,0.9,2,2H10z" />
19-
</g>
20-
</svg>
21-
);
224
235
return (
246
<DxcInset space="2rem">
257
<DxcFlex direction="column" gap="1.5rem">
268
<DxcFlex justifyContent="space-evenly">
27-
<DxcButton label="Primary" size="large" icon={icon} />
9+
<DxcButton label="Primary" size="large" icon="filled_home" />
2810
<DxcButton
2911
label="Primary"
3012
size="large"
3113
iconPosition="after"
32-
icon={icon}
14+
icon="filled_home"
3315
/>
34-
<DxcButton icon={icon} title="Go home" />
16+
<DxcButton icon="filled_home" title="Go home" />
3517
</DxcFlex>
3618
<DxcFlex justifyContent="space-evenly">
3719
<DxcButton
3820
size="large"
3921
mode="secondary"
4022
label="Secondary"
41-
icon={icon}
23+
icon="filled_home"
4224
/>
4325
<DxcButton
4426
size="large"
4527
mode="secondary"
4628
label="Secondary"
4729
iconPosition="after"
48-
icon={icon}
30+
icon="filled_home"
4931
/>
50-
<DxcButton mode="secondary" icon={icon} title="Go home" />
32+
<DxcButton mode="secondary" icon="filled_home" title="Go home" />
5133
</DxcFlex>
5234
<DxcFlex justifyContent="space-evenly">
53-
<DxcButton label="Text" mode="text" size="large" icon={icon} />
35+
<DxcButton label="Text" mode="text" size="large" icon="filled_home" />
5436
<DxcButton
5537
label="Text"
5638
mode="text"
5739
size="large"
5840
iconPosition="after"
59-
icon={icon}
41+
icon="filled_home"
6042
/>
61-
<DxcButton mode="text" icon={icon} title="Go home" />
43+
<DxcButton mode="text" icon="filled_home" title="Go home" />
6244
</DxcFlex>
6345
</DxcFlex>
6446
</DxcInset>

0 commit comments

Comments
 (0)