Skip to content

chore: remove & rename icons #1696

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

Merged
merged 5 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .changeset/angry-tigers-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@strapi/icons': major
---

chore!: removes some icons and renames others

Users should refer to the BREAKING_CHANGES.md for more information on how to migrate. Most of the icons have been visually changed. Snapshots will most likely need to be updated.
7 changes: 7 additions & 0 deletions .changeset/proud-kings-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@strapi/design-system': major
---

chore!: remove the Icon component

Users should instead apply `fill` and `stroke` directly to the icon component as theme colors are now possible.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ package-lock.json
dist
storybook-static
**/strapi-icons/src/*
!**/strapi-icons/src/index.ts
!**/strapi-icons/src/symbols-index.ts

############################
# Visual Studio Code
Expand Down
318 changes: 318 additions & 0 deletions BREAKING_CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,321 @@ This was just a wrapped component around `Flex`. You should use `Flex` instead.
#### `ToggleCheckbox`

This is the same component as `ToggleInput` and therefore you should use that instead.

### Icon Updates

Many of the icons have been updated visually, this will effect snapshot tests. The default size is `1.6rem` for an icon, in the Strapi design-system this equates to 16px. We have also ensured that `paths` do not have any `fill` or `stroke` properties set, this allows the icon to be styled with CSS except for specific use cases we don't expect users to encounter. The default `color` is `currentColor` which means it will inherit the color of the parent element. We encourage users to use the `Icon` component to render icons as it gives access to the `theme` object in styled-components.

The following icons have been removed:

#### Apps

Replaced with `GridNine`

#### Attachment

Replaced with `Paperclip`

#### Blocks

Replaced with `BlocksField` and exported from `@strapi/icons/symbols`.

#### Boolean

Replaced with `BooleanField` and exported from `@strapi/icons/symbols`

#### Brush

Replaced with `PaintBrush`

#### CarretDown

Replaced with `CaretDown`

#### CarretUp

Replaced with `CaretUp`

#### CodeSquare

Now exported from `@strapi/icons/symbols`

#### Component

Replaced with `ComponentField` and exported from `@strapi/icons/symbols`

#### Connector

Replaced with `Faders`

#### Cube

Removed.

#### Cup

Replaced with `Coffee`

#### Dashboard

Replaced with `SquareFour`

#### Date

Replaced with `DateField`

#### Discord

Now exported from `@strapi/icons/symbols`

#### Discourse

Now exported from `@strapi/icons/symbols`

#### Doctor

Replaced with `Stethoscope`

#### Dot

Removed.

#### DynamicZone

Replaced with `DynamicZoneField` and exported from `@strapi/icons/symbols`

#### Email

Replaced with `EmailField` and exported from `@strapi/icons/symbols`

#### EmptyData

Now exported from `@strapi/icons/symbols`

#### EmptyDocuments

Now exported from `@strapi/icons/symbols`

#### EmptyPermissions

Now exported from `@strapi/icons/symbols`

#### EmptyPictures

Now exported from `@strapi/icons/symbols`

#### Enumeration

Replaced with `EnumerationField` and exported from `@strapi/icons/symbols`

#### Envelop

Replaced with `Mail`

#### Equalizer

Replaced with `SlidersHorizontal`

#### ExclamationMarkCircle

Replaced with `WarningCircle`

#### Exit

Replaced with `SignOut`

#### Facebook

Now exported from `@strapi/icons/symbols`

#### FeatherSquare

Now exported from `@strapi/icons/symbols`

#### Gate

Replaced with `CastleTurret`

#### Github

Now exported from `@strapi/icons/symbols`

#### GlassesSquare

Now exported from `@strapi/icons/symbols`

#### Grid

Replaced with `GridFour`

#### Headphone

Replaced with `Headphones`

#### History

Replaced with `ClockCounterClockwise`

#### InformationSquare

Now exported from `@strapi/icons/symbols`

#### Json

Replaced with `JsonField` and exported from `@strapi/icons/symbols`

#### Landscape

Replaced with `Images`

#### LandscapeSmall

Replaced with `Images`

#### Layer

Replaced with `ListPlus`

#### LinkSmall

Replaced with `Link`

#### Media

Replaced with `MediaField` and exported from `@strapi/icons/symbols`

#### Medium

Now exported from `@strapi/icons/symbols`

#### MenuBurger

Replaced with `List`

#### MinusOutlined

Replaced with `MinusCircle`

#### Music

Replaced with `MusicNotes`

#### Number

Replaced with `NumberField` and exported from `@strapi/icons/symbols`

#### OnholdCarretDown

Replaced with `CaretDown`

#### OnholdCarretUp

Replaced with `CaretUp`

#### Paint

Replaced with `PaintBrush`

#### Password

Replaced with `PasswordField`

#### Picture

Replaced with `Image`

#### PicturePlus

Replaced with `PlusCircle`

#### PlaySquare

Now exported from `@strapi/icons/symbols`

#### Puzzle

Replaced with `PuzzlePiece`

#### Quote

Replaced with `Quotes`

#### QuoteClosed

Replaced with `Quotes`

#### Reddit

Now exported from `@strapi/icons/symbols`

#### Refresh

Replaced with `ArrowClockwise`

#### Relation

Replaced with `RelationField` and exported from `@strapi/icons/symbols`

#### Repeat

Removed.

#### RichText

Replaced with `RichTextField` and exported from `@strapi/icons/symbols`

#### Rotate

Replaced with `ArrowsCounterClockwise`

#### SearchIcon

Removed, use `Search` instead.

#### Seed

Replaced with `Plant`

#### Slideshow

Replaced with `PresentationChart`

#### Spark

Replaced with `Sparkle`

#### Spinner

Replaced with `Loader`

#### Strapi

Now exported from `@strapi/icons/symbols`

#### Text

Replace with `TextField` and exported from `@strapi/icons/symbols`

#### Twitter

Replaced with `X` and exported from `@strapi/icons/symbols`

#### Uid

Replaced with `UidField` and exported from `@strapi/icons/symbols`

#### Write

Replaced with `Feather`

## Icon has been removed

The `Icon` component has been removed. It's primary function was to allow you to apply theme colors to icons, this is now doable with the actual icon:

```ts
// before
<Icon as={Plus} color="primary700" />

// after
<Plus fill="primary700" />
```
7 changes: 3 additions & 4 deletions docs/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const config: StorybookConfig = {
allowSyntheticDefaultImports: false,
esModuleInterop: false,
},
propFilter: () => {
return true;
},
},
},
viteFinal: (config) => {
Expand Down Expand Up @@ -40,10 +43,6 @@ const config: StorybookConfig = {
name: getAbsolutePath('@storybook/react-vite'),
options: {},
},

docs: {
autodocs: true,
},
};

function getAbsolutePath<T extends string>(value: T): T {
Expand Down
13 changes: 12 additions & 1 deletion docs/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,21 @@ const preview: Preview = {
parameters: {
options: {
storySort: {
order: ['Design System', ['Primitives', 'Technical Components', 'Components']],
order: [
'Foundations',
['Overview', 'Icons', ['Overview', '*']],
'Primitives',
['Overview', '*'],
'Design System',
['Technical Components', 'Components'],
'Utilities',
],
},
},
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
expanded: true,
},
darkMode: {
// Override the default dark theme
dark: createCustomTheme({ theme: darkTheme, asStorybookTheme: false }),
Expand Down
4 changes: 0 additions & 4 deletions docs/custom.d.ts

This file was deleted.

Loading