Skip to content

Commit

Permalink
docs: new icon docs and some restructuring to design templates (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
tibuurcio authored Oct 18, 2024
1 parent 51f723e commit 97029ce
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 92 deletions.
File renamed without changes.
File renamed without changes.
92 changes: 0 additions & 92 deletions docs/Foundations/Icons.mdx

This file was deleted.

63 changes: 63 additions & 0 deletions docs/Foundations/Icons/How to use.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# How to use Icons

<br />

## Adding and Updating Icons

The Design team provides SVG files with the final icon names. These SVG files must be minified and follow the project's styling guidelines. You can prettify them using the SVGPrettifier tool, which ensures the correct size and properties are applied to the SVG.


### Steps to Add a New Icon:

1. **Ensure name of icon follows the desired principles**:
<details>
<summary>Here's the naming principles all icons should follow</summary>

Names should be semantic, describing the pattern rather than the shape. For instance, "mp_act_lt_delete" describes an action icon in light style for deletion. Even though it may look like a "trash" icon, the name reflects the specific action (delete) rather than the object (trash). Multiple icons may have the same shape but different names based on semantic meaning.

- Prefix: "mp"
- Category (abbreviated):
- act (UI Actions)
- info (Informational)
- pm (Product Model)
- [Other categories as needed]
- Style (abbreviated):
- lt (Light)
- dt (Duotone)
- Other styles as needed
- Semantic description
</details>

2. **Ensure the icon svg structure is correct by using the Prettify tool**:
Use the [SVGPrettifier Story](?path=/docs/components-other-svgprettifier--documentation) to clean up the SVG file and ensure it meets the necessary formatting standards (size, properties, etc).
The [SVGPrettifier](https://mparticle.github.io/aquarium/?path=/docs/components-other-svgprettifier--documentation) component is used to upload and prettify SVG files. Each SVG must follow the project's styling guidelines and have a unique name to avoid overwriting existing icons.

3. **Update the Icon Type**:
Add the new icon name to the TypeScript type definition in the [src/types/icons](https://github.com/mParticle/aquarium/blob/3abc3b71916ab5a7db3c4f93e06ad2bd5845e1bf/src/types/icons.ts) file.

4. **Update Icon Components**:
Add the icon components in the [src/components/icons](https://github.com/mParticle/aquarium/blob/3abc3b71916ab5a7db3c4f93e06ad2bd5845e1bf/src/components/icons/index.ts) directory, where all icon components are stored.

5. **Update the Icons Object**:
Ensure the new icons are included in the Icons object located in [src/constants/Icons](https://github.com/mParticle/aquarium/blob/3abc3b71916ab5a7db3c4f93e06ad2bd5845e1bf/src/constants/Icons.ts). This object is used across the project to reference all available icons.


### Related Links

| Type | Resource|
| -------- | ------- |
| Eames | [Figma Icon library](https://www.figma.com/design/3j5Nb0oOSkF3DW3URS8yex/mParticle-Icons-1.0.0?node-id=2055-9952&t=K7xlZo0hE2tn2y54-0) |
|Eames| [Icon Guidelines for designers](https://mparticle.atlassian.net/wiki/spaces/DMP/pages/3988914258/Icons) |
| Eames | [Fontawesome Library](https://fontawesome.com/search?o=r&s=ligh) |


### FAQ

**Q:** What if an icon in Figma has a FontAwesome name or doesn't follow the standard naming format? Should I name it myself?
**A:** Please contact the design team. They'll provide the correct name and make sure the icon is properly reflected in the design library.

**Q:** When do we use mParticle custom icons instead of default Ant Design (AntD) icons?
**A:** In our design system Eames, Ant Design (AntD) icons are the primary choice across components. However, custom mParticle icons are used in the following scenarios:
- When the design team explicitly requests a customized icon.
- When the AntD library does not offer a suitable icon for a specific use case.
- When an existing AntD icon does not align with mParticle’s design or functional requirements.
13 changes: 13 additions & 0 deletions docs/Foundations/Icons/Icon Library.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Story } from '@storybook/blocks';

import * as IconStories from '../../../src/components/general/Icon/Icon.stories';

# Icons

### Overview

mParticle icon library is mP icons, a carefully curated collection based on [FontAwesome](https://fontawesome.com/search?o=r&s=light). Our design team has selected icons specifically for mParticle use cases, defined the semantic layer, and applied customizations as needed.

### Available Icons

<Story of={IconStories.IconTable} />

0 comments on commit 97029ce

Please sign in to comment.