Skip to content
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

feat(Callout, Cards, Dialog, EmptyState, EmptyStateCard, FeedbackScreen, Tabs): remove icon prop and use only Icon/asset #1206

Merged
merged 7 commits into from
Sep 12, 2024

Conversation

marcoskolodny
Copy link
Collaborator

@marcoskolodny marcoskolodny commented Aug 21, 2024

BREAKING CHANGE: icon/Icon/asset props are renamed in several components

Issue: Link

⚠️ Remark

The only component that is not following the convention is the Sheet, because changing this would create inconsistencies with the bridge.

🗒️ Note

I've reviewed with @yceballost component by component and we concluded that we will proceed as follows (components in bold are affected by this PR):

Components with asset prop:

  • Callout
  • Cards
  • Dialogs
  • EmptyState
  • EmptyStateCard
  • FeedbackScreen (we want to allow Lottie animations in here for example, so Icon is not enough)
  • Accordion (no changes needed)
  • Lists (no changes needed)
  • Popover (no changes needed)

Components with Icon prop:

  • Tabs
  • Chips (no changes needed)
  • Avatar (no changes needed)
  • Menu (no changes needed)
  • Tag (no changes needed)
  • InfoFeedbackScreen (no changes needed)

Copy link

github-actions bot commented Aug 21, 2024

Size stats

master this branch diff
Total JS 12.2 MB 12.2 MB +243 B
JS without icons 2.03 MB 2.03 MB +243 B
Lib overhead 76.4 kB 76.4 kB 0 B
Lib overhead (gzip) 18.6 kB 18.6 kB 0 B

Copy link

github-actions bot commented Aug 21, 2024

Accessibility report
✔️ No issues found

ℹ️ You can run this locally by executing yarn audit-accessibility.

Copy link

github-actions bot commented Aug 21, 2024

Deploy preview for mistica-web ready!

✅ Preview
https://mistica-1ce5wlfbn-flows-projects-65bb050e.vercel.app

Built with commit 6490451.
This pull request is being automatically deployed with vercel-action

src/tabs.tsx Show resolved Hide resolved
src/tabs.tsx Outdated
@@ -33,7 +33,7 @@ export type TabsProps = {
tabs: ReadonlyArray<{
readonly text: string;
readonly trackingEvent?: TrackingEvent | ReadonlyArray<TrackingEvent>;
readonly icon?: React.ReactNode;
readonly Icon?: React.FC<IconProps>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider React.FC as deprecated. You can use React.ComponentType<IconProps>

Copy link
Collaborator Author

@marcoskolodny marcoskolodny Aug 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have React.FC in hundreds of files in Mistica:

image

I think we can solve this issue in the entire repo in a separate PR. I've created a Jira ticket to track this: https://jira.tid.es/browse/WEB-2003

@marcoskolodny marcoskolodny added this pull request to the merge queue Sep 12, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Sep 12, 2024
@marcoskolodny marcoskolodny added this pull request to the merge queue Sep 12, 2024
Merged via the queue into master with commit afc4604 Sep 12, 2024
11 checks passed
@marcoskolodny marcoskolodny deleted the WEB-1992-fix-icon-asset-naming-convention branch September 12, 2024 17:15
tuentisre pushed a commit that referenced this pull request Sep 12, 2024
# [15.21.0](v15.20.1...v15.21.0) (2024-09-12)

### Features

* **ButtonLink:** add default variant ([#1211](#1211)) ([047e058](047e058))
* **Callout, Cards, Dialog, EmptyState, EmptyStateCard, FeedbackScreen, Tabs:** remove icon prop and use only Icon/asset ([#1206](#1206)) ([afc4604](afc4604))
* **Feedback, FixedFooterLayout, Dialog, Accordion, Touchable, Header, IconButton, NavigationBar, OverscrollColor:** remove deprecated props ([#1205](#1205)) ([3808b4f](3808b4f))
* **Header, MainSectionHeader:** use "default" as component's default variant ([#1207](#1207)) ([8efe655](8efe655))
* **i18n:** refactor texts to improve bundle size ([#1228](#1228)) ([02e3ee1](02e3ee1))
* **Icons:** add new icons and rename others ([#1197](#1197)) ([0ff767c](0ff767c))
* **React:** require react18 and replace useAriaId with React.useId ([#1213](#1213)) ([672b873](672b873))
* **skin:** rename some design tokens ([#1203](#1203)) ([fcf15d0](fcf15d0))
* **Snackbar:** update snackbar duration logic ([#1208](#1208)) ([7df20eb](7df20eb))
* **ThemeVariant:** add media theme variant and update components in order to adapt to it ([#1236](#1236)) ([f14e82e](f14e82e))
* **Titles:** add new Title2, replace Title2 and Title3 with Title3 and Title4 respectively ([#1202](#1202)) ([7e405bb](7e405bb))
@tuentisre
Copy link
Collaborator

🎉 This PR is included in version 15.21.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

atabel pushed a commit that referenced this pull request Sep 13, 2024
…en, Tabs): remove icon prop and use only Icon/asset (#1206)

BREAKING CHANGE: icon/Icon/asset props are renamed in several components
atabel pushed a commit that referenced this pull request Sep 13, 2024
# [15.21.0](v15.20.1...v15.21.0) (2024-09-12)

### Features

* **ButtonLink:** add default variant ([#1211](#1211)) ([047e058](047e058))
* **Callout, Cards, Dialog, EmptyState, EmptyStateCard, FeedbackScreen, Tabs:** remove icon prop and use only Icon/asset ([#1206](#1206)) ([afc4604](afc4604))
* **Feedback, FixedFooterLayout, Dialog, Accordion, Touchable, Header, IconButton, NavigationBar, OverscrollColor:** remove deprecated props ([#1205](#1205)) ([3808b4f](3808b4f))
* **Header, MainSectionHeader:** use "default" as component's default variant ([#1207](#1207)) ([8efe655](8efe655))
* **i18n:** refactor texts to improve bundle size ([#1228](#1228)) ([02e3ee1](02e3ee1))
* **Icons:** add new icons and rename others ([#1197](#1197)) ([0ff767c](0ff767c))
* **React:** require react18 and replace useAriaId with React.useId ([#1213](#1213)) ([672b873](672b873))
* **skin:** rename some design tokens ([#1203](#1203)) ([fcf15d0](fcf15d0))
* **Snackbar:** update snackbar duration logic ([#1208](#1208)) ([7df20eb](7df20eb))
* **ThemeVariant:** add media theme variant and update components in order to adapt to it ([#1236](#1236)) ([f14e82e](f14e82e))
* **Titles:** add new Title2, replace Title2 and Title3 with Title3 and Title4 respectively ([#1202](#1202)) ([7e405bb](7e405bb))
tuentisre pushed a commit that referenced this pull request Sep 13, 2024
# [16.0.0](v15.20.1...v16.0.0) (2024-09-13)

### Features

* **ButtonLink:** add default variant ([#1211](#1211)) ([97aa4ad](97aa4ad))
* **Callout, Cards, Dialog, EmptyState, EmptyStateCard, FeedbackScreen, Tabs:** remove icon prop and use only Icon/asset ([#1206](#1206)) ([eb06fa3](eb06fa3))
* **Feedback, FixedFooterLayout, Dialog, Accordion, Touchable, Header, IconButton, NavigationBar, OverscrollColor:** remove deprecated props ([#1205](#1205)) ([e1c84ec](e1c84ec))
* **Header, MainSectionHeader:** use "default" as component's default variant ([#1207](#1207)) ([29e0ef4](29e0ef4))
* **i18n:** refactor texts to improve bundle size ([#1228](#1228)) ([088a290](088a290))
* **Icons:** add new icons and rename others ([#1197](#1197)) ([4cfffa5](4cfffa5))
* **React:** require react18 and replace useAriaId with React.useId ([#1213](#1213)) ([b29f778](b29f778))
* **skin:** rename some design tokens ([#1203](#1203)) ([d0a1452](d0a1452))
* **Snackbar:** update snackbar duration logic ([#1208](#1208)) ([2ef5804](2ef5804))
* **ThemeVariant:** add media theme variant and update components in order to adapt to it ([#1236](#1236)) ([eada194](eada194))
* **Titles:** add new Title2, replace Title2 and Title3 with Title3 and Title4 respectively ([#1202](#1202)) ([bed8fdf](bed8fdf))

### BREAKING CHANGES

* **ThemeVariant:** a new theme variant has been added and it may require changes in any logic that depends on variants
* **ButtonLink:** ButtonLink won't be small as default anymore
* **i18n:** texts from useTheme are now empty by default. If a mistica defined text is required, it should be imported from text-tokens and must be translated using the t function from useTheme
* **Callout, Cards, Dialog, EmptyState, EmptyStateCard, FeedbackScreen, Tabs:** icon/Icon/asset props are renamed in several components
* **skin:** some mistica internal tokens are renamed
* **Snackbar:** snackbar duration prop type has changed
* **React:** react17 is no longer supported by Mistica and useAriaId hook is removed
* **Header, MainSectionHeader:** Header's variant changes from inverse to default if variant prop is not used
* **Feedback, FixedFooterLayout, Dialog, Accordion, Touchable, Header, IconButton, NavigationBar, OverscrollColor:** deprecated props are removed in several components
* **Titles:** renamed Title2 to Title3 and Title3 to Title4
* **Icons:** renamed some icons

autentication-failure → authentication-failure
autentication-success → authentication-success
adn → dna
hamburguer → hamburger
garaje → garage
millenials → millennials
not-photo-camera → no-photo-camera
not-conexion-file → no-conexion-file
smiley-happy → face-happy
smiley-sad → face-sad
like → thumb-up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants