Skip to content

Commit 37db4d3

Browse files
committed
docs(icon): minor icon documentation updates
- add figma design link to icon in storybook - refactor: use Container in icon tests template - small formatting adjustments to icon docs, including added subheadings
1 parent 71ee472 commit 37db4d3

File tree

3 files changed

+38
-33
lines changed

3 files changed

+38
-33
lines changed

components/icon/stories/icon.mdx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,26 @@ The SVG icons used in Spectrum CSS are a part of two different icon sets, "workf
2020

2121
### Workflow icons
2222

23-
The workflow icon set contains several hundred icons to choose from.
24-
These icons can be seen in use within Button, Action button, Menu, and many other components.
23+
The workflow icon set contains several hundred icons to choose from. For a full list of all icons within this set, see **[workflow icons](/story/components-icon--workflow)**.
24+
These icons can be seen in use within button, action button, menu, and many other components.
2525
Here is an example with just a few of these icons:
2626

2727
<Canvas of={IconStories.WorkflowDefault} />
2828

29-
These icons use "t-shirt" sizes, e.g. small or medium, that are the same width and height for each icon in the set. Note that the
30-
extra-extra-large size is currently *not* part of the design specifications and may be deprecated in the near future:
29+
#### T-shirt sizing
30+
31+
Workflow icons use "t-shirt" sizes, e.g. small or medium, that are the same width and height for each icon in the set. Note that the
32+
extra-extra-large size is currently _not_ part of the design specifications and may be deprecated in the near future:
3133

3234
<Canvas of={IconStories.WorkflowSizing} />
3335

3436
### UI icons
3537

3638
UI icons are atomic pieces (e.g., arrows, crosses, etc.) that are used as part of some components. The chevron within
37-
the [Combobox component](?path=/docs/components-combobox--docs) is one example.
39+
the [Combobox component](/docs/components-combobox--docs) is one example. For a full list of all icons within this
40+
set, see **[ui icons](/story/components-icon--ui)**.
41+
42+
#### Numbered sizing
3843

3944
Unlike workflow icons, each UI icon comes in specific numbered sizes. They do not use "t-shirt" sizing.
4045
They have unique classes applied that set their size in CSS. For example:
@@ -50,6 +55,8 @@ An example of some UI icons in their available sizes:
5055

5156
<Canvas of={IconStories.UIDefault} />
5257

58+
#### Directional icons
59+
5360
Directional UI icons such as Chevron and Arrow have classes for each direction. They rotate the same base icon with a CSS `transform: rotate`. For example, the `Arrow100.svg` icon is used
5461
with:
5562

components/icon/stories/icon.stories.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ export default {
8181
parameters: {
8282
packageJson,
8383
metadata,
84+
design: {
85+
type: "figma",
86+
url: "https://www.figma.com/design/9qeVZSJ9t0kv6r7njzgHx7/S2-%2F-Styles-visualizer-(WIP)?node-id=295-24257&t=ZC7fyaQ0VQYQ5VYM-1",
87+
},
8488
},
8589
tags: ["!autodocs"],
8690
};

components/icon/stories/icon.test.js

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Variants } from "@spectrum-css/preview/decorators";
1+
import { Container, Variants } from "@spectrum-css/preview/decorators";
22
import { Template as Typography } from "@spectrum-css/typography/stories/template.js";
33
import { html } from "lit";
44
import { styleMap } from "lit/directives/style-map.js";
@@ -12,20 +12,14 @@ import { uiIconsWithDirections, uniqueUiIconBaseNames, workflowSizes } from "./u
1212
* - All UI icons, organized within a grid by sizing number and name
1313
*/
1414
export const TestTemplate = (args, context) => html`
15-
<div style=${styleMap({
16-
"display": "flex",
17-
"gap": "12px",
18-
})}>
19-
<div>
20-
${Typography({
21-
customClasses: ["chromatic-ignore"],
22-
semantics: "detail",
23-
size: "l",
24-
content: ["Workflow icons"],
25-
customStyles: {
26-
"--mod-detail-font-color": "var(--spectrum-seafoam-900)",
27-
}
28-
})}
15+
${Container({
16+
heading: "Workflow icon examples",
17+
withBorder: false,
18+
direction: "row",
19+
wrapperStyles: {
20+
columnGap: "12px",
21+
},
22+
content: html`
2923
<div
3024
style=${styleMap({
3125
"display": "grid",
@@ -75,17 +69,17 @@ export const TestTemplate = (args, context) => html`
7569
}, context))}
7670
`)}
7771
</div>
78-
</div>
79-
<div>
80-
${Typography({
81-
customClasses: ["chromatic-ignore"],
82-
semantics: "detail",
83-
size: "l",
84-
content: ["UI icons"],
85-
customStyles: {
86-
"--mod-detail-font-color": "var(--spectrum-seafoam-900)",
87-
},
88-
})}
72+
`,
73+
}, context)}
74+
75+
${Container({
76+
heading: "UI icon set",
77+
withBorder: false,
78+
direction: "row",
79+
wrapperStyles: {
80+
columnGap: "12px",
81+
},
82+
content: html`
8983
<div
9084
style=${styleMap({
9185
"display": "grid",
@@ -125,8 +119,8 @@ export const TestTemplate = (args, context) => html`
125119
return print;
126120
}, [])}
127121
</div>
128-
</div>
129-
</div>
122+
`,
123+
}, context)}
130124
`;
131125

132126
export const IconGroup = Variants({

0 commit comments

Comments
 (0)