-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: We define a list of icons in `RTLIconList.tsx` that we automatically flip for right-to-left content. This works for web, but we need to make this list available for iOS and Android. Solution: - Move the list of icons to a JSON file, and import it into `RTLIconList.tsx`. Test manually via the docs site. - Update `/foundations/international_design/rtl_guidelines/iconography` to use this same icon list. Jira: GESTALT-8856
- Loading branch information
Showing
3 changed files
with
49 additions
and
54 deletions.
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
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,32 @@ | ||
{ | ||
"flipOnRtlIconNames": [ | ||
"ads-overview", | ||
"ads-stats", | ||
"arrow-back", | ||
"arrow-circle-forward", | ||
"arrow-end", | ||
"arrow-forward", | ||
"arrow-start", | ||
"arrow-up-right", | ||
"chevron-left-circle", | ||
"chevron-right-circle", | ||
"compose", | ||
"directional-arrow-left", | ||
"directional-arrow-right", | ||
"flip-vertical", | ||
"hand-pointing", | ||
"link", | ||
"mute", | ||
"redo", | ||
"reorder-images", | ||
"send", | ||
"sound", | ||
"speech-ellipsis", | ||
"speech", | ||
"switch-account", | ||
"text-size", | ||
"undo", | ||
"visit" | ||
], | ||
"swapOnRtlIconNames": ["list-numbered"] | ||
} |
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 |
---|---|---|
@@ -1,38 +1,14 @@ | ||
import rtlIconListJson from 'gestalt-design-tokens/src/utils/rtlIconList.json'; | ||
import icons from '../icons/index'; | ||
import compactIconsVR from '../icons-vr-theme/compact/index'; | ||
|
||
type IconName = keyof typeof icons | keyof typeof compactIconsVR; | ||
|
||
const swapOnRtlIconNames: ReadonlyArray<IconName> = Object.freeze(['list-numbered']); | ||
|
||
const flipOnRtlIconNames: ReadonlyArray<IconName | undefined> = Object.freeze([ | ||
'ads-stats', | ||
'ads-overview', | ||
'arrow-back', | ||
'arrow-circle-forward', | ||
'arrow-end', | ||
'arrow-forward', | ||
'arrow-start', | ||
'arrow-up-right', | ||
'compose', | ||
'chevron-left-circle', | ||
'chevron-right-circle', | ||
'directional-arrow-left', | ||
'directional-arrow-right', | ||
'flip-vertical', | ||
'hand-pointing', | ||
'link', | ||
'mute', | ||
'reorder-images', | ||
'send', | ||
'sound', | ||
'speech', | ||
'speech-ellipsis', | ||
'switch-account', | ||
'text-size', | ||
'redo', | ||
'undo', | ||
'visit', | ||
]); | ||
const swapOnRtlIconNames = Object.freeze(rtlIconListJson.swapOnRtlIconNames) as ReadonlyArray< | ||
IconName | undefined | ||
>; | ||
const flipOnRtlIconNames = Object.freeze(rtlIconListJson.flipOnRtlIconNames) as ReadonlyArray< | ||
IconName | undefined | ||
>; | ||
|
||
export { flipOnRtlIconNames, swapOnRtlIconNames }; |