-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update iconography foundation pg.mdx #4356
Closed
Closed
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
45458ea
Update iconography foundation pg.mdx
amritadesmet c75c44d
Update iconography.mdx
amritadesmet 45bcd87
Update iconography.mdx
amritadesmet ff23cb1
add-images-foundations
amritadesmet f83f40d
docs:update iconograpy images
amritadesmet a811b8d
Fix lint. Update country symbol preview.
origami-z 0af6229
Merge branch 'main' into amritadesmet-iconography
mark-tate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,86 @@ title: Iconography | |
layout: DetailTechnical | ||
--- | ||
|
||
Icons are visually simplified and recognizable symbols that represent a specific action, object or concept. There are two variant types: Outline and Solid. All icons within the icon set have an outline variant, but not all have a solid variant, for instance, `minimize` (a horizontal dash). | ||
Icons are simplified visual representations of a specific action, object or concept. Country symbols represent a specific country and are used in contexts where geographical identification is necessary. | ||
|
||
The Salt design system has: | ||
|
||
- 415 icons | ||
- 265 outline icons | ||
- 150 solid icons | ||
|
||
## Icon variants | ||
|
||
Icons come in two variant types: **Outline** and **Solid**. Please note that all icons within the icon set have an outline variant, but 115 don’t have a solid variant. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "some don't have a solid variant", would be less effort to maintain |
||
|
||
### Solid icons | ||
|
||
Solid icons are faster to recognise than outline icons due to less visual noise, especially depending on the complexity of the icon. Solid icons better represent how we view objects, whereas outline icons are silhouettes and therefore can take longer to perceive. | ||
|
||
### Outline icons | ||
|
||
Outline icons have a lower emphasis on non-imperative items and are more recognisable when they have wider inner spacing. They’re also better to use when you need to make subtle design cues more noticeable. | ||
|
||
<Image | ||
src="/img/foundations/iconography-icon-variants.png" | ||
alt="Example of solid and outline icons" | ||
/> | ||
|
||
## All icons | ||
|
||
<IconPreview /> | ||
|
||
## Scaling icons with size icon | ||
|
||
Icon size will vary based on use case and system requirements. Standard sizing ensures components maintain a consistent spatial relationship with surrounding elements. | ||
|
||
<ImageSwitcher | ||
images={[ | ||
{ src: "/img/foundations/scale-icon.svg", alt: "" }, | ||
{ src: "/img/foundations/scale-icon-annotated.svg", alt: "" }, | ||
]} | ||
label="Show multipliers" | ||
/> | ||
|
||
| Size token | Multiplier | High density (px) | Medium | Low | Touch | | ||
| ------------------ | ---------- | ----------------- | ------ | --- | ----- | | ||
| `--salt-size-icon` | x1 | 12\* | 12 | 14 | 16 | | ||
| | x2 | 20 | 24 | 28 | 32 | | ||
| | x3 | 30 | 36 | 42 | 48 | | ||
| | x4 | 40 | 48 | 56 | 64 | | ||
|
||
\* Icons have a minimum size set at 12px and should not be displayed any smaller. For high density this means the default size of an icon is 12px, but the rest of the scale grows based on small base dimension. | ||
|
||
## Country symbols | ||
|
||
Country symbols can be considered icons that are visually representative of a country or inter-governmental organisation. All flags are available in both circle and rectangle shapes. | ||
|
||
<Image | ||
src="/img/foundations/iconography-countrysymbols-variant.png" | ||
alt="Example of circular flag next to rectangular flag" | ||
/> | ||
|
||
## All country symbols | ||
|
||
<CountrySymbolPreview /> | ||
|
||
## Scaling country symbols with size base | ||
|
||
Country symbols have a default size across all four densities, changed in multiples of the base size. | ||
|
||
<ImageSwitcher | ||
images={[ | ||
{ src: "/img/foundations/scale-country.svg", alt: "" }, | ||
{ src: "/img/foundations/scale-country-annotated.svg", alt: "" }, | ||
]} | ||
label="Show multipliers" | ||
/> | ||
|
||
| Size token | Multiplier | High density (px) | Medium | Low | Touch | | ||
| ------------------ | ---------- | ----------------- | ------ | --- | ----- | | ||
| `--salt-size-base` | x1 | 20 | 28 | 36 | 44 | | ||
| | x2 | 40 | 56 | 72 | 88 | | ||
| | x3 | 60 | 84 | 108 | 132 | | ||
| | x4 | 80 | 112 | 144 | 176 | | ||
|
||
:fragment{src="./fragments/feedback.mdx"} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions
63
site/src/components/country-symbol-preview/CountrySymbolPreview.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { | ||
FlowLayout, | ||
FormField, | ||
FormFieldLabel, | ||
Input, | ||
StackLayout, | ||
Text, | ||
} from "@salt-ds/core"; | ||
import { LazyCountrySymbol, countryMetaMap } from "@salt-ds/countries"; | ||
import { Suspense, useState } from "react"; | ||
|
||
// Mostly the same as AllCountrySymbols site example, could iterate later | ||
export const CountrySymbolPreview = () => { | ||
const [inputText, setInputText] = useState(""); | ||
|
||
return ( | ||
<Suspense fallback="Loading..."> | ||
<StackLayout | ||
separators | ||
style={{ width: "100%", height: "100%", padding: 10 }} | ||
> | ||
<FormField> | ||
<FormFieldLabel>Search country symbols</FormFieldLabel> | ||
<Input | ||
value={inputText} | ||
inputProps={{ | ||
onChange: (event) => { | ||
setInputText(event.target.value); | ||
}, | ||
}} | ||
/> | ||
</FormField> | ||
<div style={{ overflow: "auto", maxHeight: 600 }}> | ||
<FlowLayout gap={3}> | ||
{Object.values(countryMetaMap) | ||
.filter(({ countryCode, countryName }) => { | ||
const searchText = inputText.toLowerCase(); | ||
|
||
return ( | ||
countryCode.toLowerCase().includes(searchText) || | ||
countryName.toLowerCase().includes(searchText) | ||
); | ||
}) | ||
.map(({ countryCode, countryName }) => { | ||
return ( | ||
<StackLayout | ||
style={{ width: 140 }} | ||
gap={1} | ||
align="center" | ||
key={countryCode} | ||
> | ||
<LazyCountrySymbol code={countryCode} size={1} /> | ||
<Text>{countryCode}</Text> | ||
<Text style={{ textAlign: "center" }}>{countryName}</Text> | ||
</StackLayout> | ||
); | ||
})} | ||
</FlowLayout> | ||
</div> | ||
</StackLayout> | ||
</Suspense> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./CountrySymbolPreview"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI these numbers will go stale, the next time we add a new icon.
Will we remember to update the numbers and keep this paragraph updated?
If so, great.
Otherwise.. we could say over 500 icons and 200 country symbols or something, or remove, altogether.