Skip to content

Commit

Permalink
fix: rename icons (#364)
Browse files Browse the repository at this point in the history
Co-authored-by: mparticle-automation <[email protected]>
  • Loading branch information
gabyzif and mparticle-automation authored Aug 19, 2024
1 parent 2de2ee5 commit 223c47d
Show file tree
Hide file tree
Showing 13 changed files with 142 additions and 40 deletions.
2 changes: 1 addition & 1 deletion src/components/data-display/Avatar/Avatar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const meta: Meta<typeof Avatar> = {
options: ['Users', 'Sparkles'],
mapping: {
Users: <Icon name="users" />,
Sparkles: <Icon name="sparkles" />,
Sparkles: <Icon name="predictions" variant="duo-tone" />,
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/data-display/Collapse/Collapse.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ export const ExampleExtraNode: Story = {
// If you don't want click extra trigger collapse, you can prevent this:
event.stopPropagation()
}}>
<Icon name="gear" />
<Icon name="settings" />
</span>
)

Expand Down
8 changes: 4 additions & 4 deletions src/components/data-display/Statistic/Statistic.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ const meta: Meta<typeof Statistic> = {
control: 'select',
options: ['check', 'alicorn', 'wrench'],
mapping: {
check: <Icon name="check" />,
check: <Icon name="selected" />,
alicorn: <Icon name="alicorn" />,
wrench: <Icon name="wrench" />,
wrench: <Icon name="setup" />,
},
},
suffix: {
Expand Down Expand Up @@ -96,7 +96,7 @@ export const CustomPrecision: Story = {

export const CustomPrefix: Story = {
args: {
prefix: <Icon name="check" />,
prefix: <Icon name="selected" />,
},
}

Expand Down Expand Up @@ -194,7 +194,7 @@ export const ExampleWithCard: Story = {
value={9.3}
precision={2}
valueStyle={{ color: ColorError }}
prefix={<Icon name="wrench" />}
prefix={<Icon name="setup" />}
suffix="%"
/>
</Card>
Expand Down
4 changes: 2 additions & 2 deletions src/components/data-entry/Switch/Switch.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ export const ExampleTextAndIcon: Story = {
<Switch checkedChildren="Checked Text" unCheckedChildren="Unchecked Text" defaultChecked />
<Switch checkedChildren="1" unCheckedChildren="0" />
<Switch
checkedChildren={<Icon name="check" />}
unCheckedChildren={<Icon name="messageQuestion" />}
checkedChildren={<Icon name="selected" />}
unCheckedChildren={<Icon name="support" />}
defaultChecked
/>
</Space>
Expand Down
4 changes: 2 additions & 2 deletions src/components/feedback/Skeleton/Skeleton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export const ExampleList: Story = {
? [
<IconText icon={<Icon name="alicorn"></Icon>} text="156" key="list-vertical-star-o" />,
<IconText icon={<Icon name="users" />} text="156" key="list-vertical-like-o" />,
<IconText icon={<Icon name="gear" />} text="2" key="list-vertical-message" />,
<IconText icon={<Icon name="setup" />} text="2" key="list-vertical-message" />,
]
: undefined
}
Expand All @@ -276,4 +276,4 @@ export const ExampleList: Story = {
</ExampleStory>
)
},
}
}
2 changes: 1 addition & 1 deletion src/components/general/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const WithIconDefaultColorSM: Story = {

export const RoundIconButton: Story = {
args: {
icon: <Icon name="siteMap" size="xl" />,
icon: <Icon name="dataPlatform" size="xl" />,
children: ' ',
type: 'default',
shape: 'round',
Expand Down
5 changes: 3 additions & 2 deletions src/components/general/Icon/Icon.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const IconTable: React.FC<IIconProps> = ({ color = 'black', size = 'lg',
return (
<Flex vertical align="center" key={iconName}>
<Icon name={iconName} size={size} color={color} variant={variant} />
<p style={{ fontFamily: 'monospace', ...textStyle }}>
<p style={{ fontFamily: 'monospace', textAlign: 'center', ...textStyle }}>
{isDeprecated ? 'deprecated ' : ''}
{iconName}
</p>
Expand All @@ -45,7 +45,8 @@ The \`IconTable\` component is used to display a table of all available icons in
- \`variant\`: The variant of the icon. Available options are \`light\` and \`duo-tone\`.
#### Updating Icons
To update the icons:
The icon SVG and icon name are provided by the Design team. and the svg must be minified.
1. **Add New Icons**: Add the new icon SVGs to the \`src/constants/Icons\` directory. The icons should be curated by Design and the svg must be minified.
2. **Update Icon Constants**: Update the \`Icons\` object in \`src/constants/Icons\` to include the new icons.
Expand Down
2 changes: 1 addition & 1 deletion src/components/general/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const Icon: React.FC<IIconProps> = ({ name, color = 'default', size = 'lg
const icon: IconOptions = Icons[name]

if (icon?.deprecated) {
console.warn(`Icon with name "${name}" is deprecated. Please use ${icon?.deprecated} instead.`)
console.warn(`Icon with name "${name}" is deprecated. Please use "${icon?.deprecated}" instead.`)
}

const iconVariant = variant ?? icon.default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const defaultTools: IGlobalNavigationItem[] = [
{
label: 'Tool 1',
isActive: true,
icon: <Icon name="shieldKeyhole" />,
icon: <Icon name="privacy" />,
type: 'menu',
children: [
{ label: 'option 1', hrefOptions: { href: '/' } },
Expand All @@ -35,7 +35,7 @@ const defaultTools: IGlobalNavigationItem[] = [
},
{
label: 'Tool 2',
icon: <Icon name="heart" />,
icon: <Icon name="favorite" />,
type: 'menu',
children: [
{ label: 'option 1', hrefOptions: { href: '/' } },
Expand All @@ -54,13 +54,13 @@ const defaultManagement: IGlobalNavigationItem[] = [
{
label: 'Notifications',
hideLabel: true,
icon: <Icon name="cloud" />,
icon: <Icon name="api" />,
hrefOptions: { href: '/' },
},
{
label: 'Support',
hideLabel: true,
icon: <Icon name="messageQuestion" />,
icon: <Icon name="support" />,
type: 'menu',
children: [
{ label: 'option 1', hrefOptions: { href: '/' } },
Expand All @@ -71,7 +71,7 @@ const defaultManagement: IGlobalNavigationItem[] = [
{
label: 'Settings',
hideLabel: true,
icon: <Icon name="gear" />,
icon: <Icon name="settings" />,
type: 'menu',
children: [
{ label: 'option 1', hrefOptions: { href: '/' } },
Expand Down Expand Up @@ -164,7 +164,7 @@ export const Primary: Story = {

const mpLogo: IGlobalNavigationLogo = {
label: 'Data Platform',
icon: <Icon name="siteMap" />,
icon: <Icon name="dataPlatform" />,
onSuiteLogoClick: () => {
alert('Going to mP Home!')
},
Expand Down Expand Up @@ -200,7 +200,7 @@ function Beta(label: string) {
const mpTools: IGlobalNavigationItem[] = [
{
label: 'Activity',
icon: <Icon name="chartLine" />,
icon: <Icon name="trends" />,
type: 'menu',
children: [
{ hrefOptions: { href: '/' }, label: 'Platform Trends' },
Expand Down Expand Up @@ -252,7 +252,7 @@ const mpTools: IGlobalNavigationItem[] = [
},
{
label: 'Setup',
icon: <Icon name="wrench" />,
icon: <Icon name="setup" />,
type: 'menu',
children: [
{ hrefOptions: { href: '/' }, label: 'Inputs' },
Expand All @@ -263,7 +263,7 @@ const mpTools: IGlobalNavigationItem[] = [
},
{
label: 'Directory',
icon: <Icon name="grid" />,
icon: <Icon name="myHub" />,
hrefOptions: { href: '/' },
},
]
Expand All @@ -273,7 +273,7 @@ const mpManagement: IGlobalNavigationItem[] = [
isActive: true,
label: 'Support',
hideLabel: true,
icon: <Icon name="messageQuestion" />,
icon: <Icon name="support" />,
type: 'menu',
children: [
{ label: 'option 1', hrefOptions: { href: '/' } },
Expand All @@ -284,7 +284,7 @@ const mpManagement: IGlobalNavigationItem[] = [
{
label: 'Settings',
hideLabel: true,
icon: <Icon name="gear" />,
icon: <Icon name="settings" />,
type: 'menu',
children: [
{ hrefOptions: { href: '/' }, label: 'Platform Settings' },
Expand Down Expand Up @@ -547,13 +547,13 @@ const indLogo: IGlobalNavigationLogo = {
const indTools: IGlobalNavigationItem[] = [
{
label: 'My Hub',
icon: <Icon name="grid" />,
icon: <Icon name="myHub" />,
isActive: true,
hrefOptions: { href: '/' },
},
{
label: 'Saved',
icon: <Icon name="folderClosed" />,
icon: <Icon name="savedProjects" />,
hrefOptions: { href: '/' },
},
{
Expand All @@ -567,7 +567,7 @@ const indManagement: IGlobalNavigationItem[] = [
{
label: 'Support',
hideLabel: true,
icon: <Icon name="messageQuestion" />,
icon: <Icon name="support" />,
type: 'menu',
children: [
{ label: 'option 1', hrefOptions: { href: '/' } },
Expand All @@ -578,7 +578,7 @@ const indManagement: IGlobalNavigationItem[] = [
{
label: 'Settings',
hideLabel: true,
icon: <Icon name="gear" />,
icon: <Icon name="settings" />,
type: 'menu',
children: [
{ label: 'option 1', hrefOptions: { href: '/' } },
Expand Down Expand Up @@ -867,7 +867,7 @@ export const Indicative: Story = {

const cortexLogo: IGlobalNavigationLogo = {
label: 'Predictions',
icon: 'sparkles',
icon: 'predictions',
type: 'background-solid',
onSuiteLogoClick: () => {
alert('Going to Predictions Home!')
Expand All @@ -877,12 +877,12 @@ const cortexLogo: IGlobalNavigationLogo = {
const cortexTools: IGlobalNavigationItem[] = [
{
label: 'Pipelines',
icon: <Icon name="circleNodes" />,
icon: <Icon name="predictions" variant="duo-tone" />,
hrefOptions: { href: '/' },
},
{
label: 'Projects',
icon: <Icon name="split" />,
icon: <Icon name="journeys" />,
hrefOptions: { href: '/' },
isActive: true,
},
Expand All @@ -893,12 +893,12 @@ const cortexTools: IGlobalNavigationItem[] = [
},
{
label: 'API',
icon: <Icon name="cloud" />,
icon: <Icon name="predictions" variant="duo-tone" />,
hrefOptions: { href: '/' },
},
{
label: 'Insights',
icon: <Icon name="lightBulb" />,
icon: <Icon name="insights" />,
hrefOptions: { href: '/' },
},
]
Expand All @@ -907,7 +907,7 @@ const cortexManagement: IGlobalNavigationItem[] = [
{
label: 'Support',
hideLabel: true,
icon: <Icon name="messageQuestion" />,
icon: <Icon name="support" />,
type: 'menu',
children: [
{ label: 'option 1', hrefOptions: { href: '/' } },
Expand All @@ -918,7 +918,7 @@ const cortexManagement: IGlobalNavigationItem[] = [
{
label: 'Settings',
hideLabel: true,
icon: <Icon name="gear" />,
icon: <Icon name="settings" />,
type: 'menu',
children: [
{ label: 'option 1', hrefOptions: { href: '/' } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export function WorkspaceSelector(props: IWorkspaceSelectorProps) {
label: (
<Flex justify="space-between" align="center" gap="small">
{workspace.label}
{workspace.isActive && <Icon name="check" size="xs" color="text" />}
{workspace.isActive && <Icon name="selected" size="xs" color="text" />}
</Flex>
),
id: workspace.id,
Expand Down
6 changes: 3 additions & 3 deletions src/components/navigation/Steps/Steps.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export const ExampleIcon: Story = {
{
title: 'Verification',
status: 'finish',
icon: <Icon name="gear" />,
icon: <Icon name="settings" />,
},
{
title: 'Pay',
Expand All @@ -195,7 +195,7 @@ export const ExampleIcon: Story = {
{
title: 'Done',
status: 'wait',
icon: <Icon name="check" size="sm" />,
icon: <Icon name="selected" size="sm" />,
},
]}
/>
Expand Down Expand Up @@ -737,4 +737,4 @@ export const ExampleInline: Story = {
</ExampleStory>
)
},
}
}
Loading

0 comments on commit 223c47d

Please sign in to comment.