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

New Design system implementation + MUI5 upgrade #494

Merged
merged 155 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from 154 commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
94423c3
Integration between Figma and Storybook (#488)
vmilan Oct 17, 2022
936a0db
Split carto theme into sections (#495)
vmilan Oct 18, 2022
d56f379
New color palette of the design system (#497)
vmilan Oct 19, 2022
2640689
New typography toolkit for MUI carto-theme (#498)
vmilan Oct 19, 2022
1773777
Mui v5 upgrade (#501)
VictorVelarde Oct 24, 2022
050c714
Run codemod link-underline-hover (#503)
VictorVelarde Oct 24, 2022
5d8c2b3
Spacings, borders and shadows Foundations (#507)
vmilan Oct 26, 2022
7a18d2f
Colors and Typography improvements (#502)
vmilan Oct 26, 2022
3f26d2f
New Typography component (#506)
vmilan Oct 27, 2022
e688d18
Bump experimental version names, to be coordinated with official bran…
VictorVelarde Oct 27, 2022
3c9cf55
v0.0.0-experimental-muiv5-1.5.0-alpha.4-0
VictorVelarde Oct 27, 2022
c12d5dd
Adjust peer deps to published
VictorVelarde Oct 27, 2022
6973468
Design System breakpoints and theme types (#513)
vmilan Oct 28, 2022
8fa8cf1
v0.0.0-experimental-muiv5-1.5.0-alpha.4-1
VictorVelarde Oct 28, 2022
08602da
Bump peers with last prerelease
VictorVelarde Oct 28, 2022
152343d
Add module augmentation for Theme & ThemeOptions
VictorVelarde Oct 28, 2022
6640eee
v0.0.0-experimental-muiv5-1.5.0-alpha.4-2
VictorVelarde Oct 28, 2022
1c4f64f
Adapt peer deps to new patch
VictorVelarde Oct 28, 2022
29e3508
Add Figma links into Storybook (#515)
vmilan Oct 31, 2022
41d2bf6
Mui5 migration: Breaking changes in v5: styles and theme (#514)
vmilan Oct 31, 2022
1055064
v0.0.0-experimental-muiv5-1.5.0-alpha.4-3
VictorVelarde Oct 31, 2022
85c43ca
Improve module augmentation + export already created CARTO theme (#516)
VictorVelarde Oct 31, 2022
294e0d4
Bump peer deps
VictorVelarde Oct 31, 2022
fdaf707
v0.0.0-experimental-muiv5-1.5.0-alpha.4-4
VictorVelarde Oct 31, 2022
6be61c9
Bump peers
VictorVelarde Oct 31, 2022
65f5640
Export new already created theme
VictorVelarde Oct 31, 2022
bf4de35
v0.0.0-experimental-muiv5-1.5.0-alpha.4-5
VictorVelarde Oct 31, 2022
b3a9ac6
Bump peers
VictorVelarde Oct 31, 2022
15d004c
Add responsive font sizes to cartoTheme created by default
VictorVelarde Oct 31, 2022
e7110e0
Mui5 migration: Breaking changes in v5: components (#518)
vmilan Nov 2, 2022
842ad4d
v0.0.0-experimental-muiv5-1.5.0-alpha.4-6
VictorVelarde Nov 2, 2022
e724c44
Bump peers to next experimental
VictorVelarde Nov 2, 2022
4b7f247
New design system applied to priority 1 components (#523)
vmilan Nov 9, 2022
6dc326f
v0.0.0-experimental-muiv5-1.5.0-alpha.4-7
VictorVelarde Nov 9, 2022
af93f3b
Bump peers to next experimental
VictorVelarde Nov 9, 2022
eda3ccc
Replace kebab-case properties in styles (#530)
vmilan Nov 14, 2022
0a06d93
Improvements in Components priority 1 after design review (#529)
vmilan Nov 14, 2022
74998cf
Radio and Checkbox components adapted to the new design system (#532)
vmilan Nov 14, 2022
8457467
v0.0.0-experimental-muiv5-1.5.0-alpha.4-8
vmilan Nov 14, 2022
737c8ad
update peer dependencies tag version
vmilan Nov 14, 2022
dc600a9
Design review of Toggle component (#533)
vmilan Nov 16, 2022
39e9fbb
Switch component adapted to the new design system (#534)
vmilan Nov 16, 2022
017d157
v0.0.0-experimental-muiv5-1.5.0-alpha.4-9
vmilan Nov 16, 2022
a062ac1
peer dependencies
vmilan Nov 16, 2022
d6c6293
Tooltip component adapted to the new design system (#536)
vmilan Nov 18, 2022
856dc1d
v0.0.0-experimental-muiv5-1.5.0-alpha.4-10
vmilan Nov 18, 2022
c985726
peer dependencies
vmilan Nov 18, 2022
43da365
Tabs component adapted to the new design system (#537)
vmilan Nov 22, 2022
8b14697
v0.0.0-experimental-muiv5-1.5.0-alpha.4-11
vmilan Nov 22, 2022
d12d587
peer dependencies
vmilan Nov 22, 2022
79741f0
TextField and TextArea components adapted to the new design system (#…
vmilan Nov 25, 2022
c757910
v0.0.0-experimental-muiv5-1.5.0-alpha.4-12
vmilan Nov 25, 2022
1275c26
peer dependencies
vmilan Nov 25, 2022
c16f1d9
Select component adapted to the new design system (#544)
vmilan Dec 1, 2022
7cf148e
v0.0.0-experimental-muiv5-1.5.0-alpha.4-13
vmilan Dec 1, 2022
58245a7
peer dependencies
vmilan Dec 1, 2022
72370d1
v0.0.0-experimental-muiv5-1.5.0-alpha.4-14
VictorVelarde Dec 1, 2022
7fcb4cd
Bump to latest pre-release
VictorVelarde Dec 1, 2022
d1df5ec
Divider component adapted to the new design system (#546)
vmilan Dec 2, 2022
7d55be5
Fix disableElevation default prop (#547)
VictorVelarde Dec 2, 2022
7753293
UploadField component adapted to the new design system (#545)
vmilan Dec 2, 2022
7f6f431
v0.0.0-experimental-muiv5-1.5.0-alpha.4-15
VictorVelarde Dec 2, 2022
a53f16c
Design changes in UploadField component (#548)
vmilan Dec 15, 2022
23843ba
Chip component adapted to the new design system (#551)
vmilan Dec 15, 2022
328a74b
v0.0.0-experimental-muiv5-1.5.0-alpha.4-16
vmilan Dec 15, 2022
ef52c16
peer dependencies
vmilan Dec 15, 2022
25fc62b
Default props of core components to meet the common use case (#552)
vmilan Dec 16, 2022
d739a19
v0.0.0-experimental-muiv5-1.5.0-alpha.4-17
vmilan Dec 16, 2022
66354bc
peer dependencies
vmilan Dec 16, 2022
2edb413
Adjustments in theme to fix uses cases in cloud-native (#553)
vmilan Dec 20, 2022
65b6bc9
v0.0.0-experimental-muiv5-1.5.0-alpha.4-18
vmilan Dec 20, 2022
f3a5562
peer dependencies
vmilan Dec 20, 2022
18d9171
New color variant in FAB button (#554)
vmilan Dec 21, 2022
1145e2e
v0.0.0-experimental-muiv5-1.5.0-alpha.4-19
vmilan Dec 21, 2022
b94354a
peer dependencies
vmilan Dec 21, 2022
d57a54a
New AppBar component (v1) and default props changes (#555)
vmilan Dec 22, 2022
90c6cdb
Inputs size to small by default (#556)
vmilan Dec 22, 2022
6a3d598
v0.0.0-experimental-muiv5-1.5.0-alpha.4-20
vmilan Dec 22, 2022
e721678
peer dependencies
vmilan Dec 22, 2022
9e94ece
appbar fixes
vmilan Dec 23, 2022
4167fb7
v0.0.0-experimental-muiv5-1.5.0-alpha.4-21
vmilan Dec 23, 2022
295d933
peer dependencies
vmilan Dec 23, 2022
04e1753
appbar fixes
vmilan Jan 3, 2023
ee926dd
v0.0.0-experimental-muiv5-1.5.0-alpha.4-22
vmilan Jan 3, 2023
d9209c6
peer dependencies
vmilan Jan 3, 2023
890e84b
appbar fixes
vmilan Jan 3, 2023
2ff5e1a
v0.0.0-experimental-muiv5-1.5.0-alpha.4-23
vmilan Jan 3, 2023
308133a
peer dependencies
vmilan Jan 3, 2023
e1b914c
appbar story ready
vmilan Jan 4, 2023
a874fff
appbar fixes
vmilan Jan 4, 2023
778eead
v0.0.0-experimental-muiv5-1.5.0-alpha.4-24
vmilan Jan 4, 2023
73d2b03
peer dependencies
vmilan Jan 4, 2023
7aa48e5
Adjustments in theme to fix uses cases in cloud-native (#560)
vmilan Jan 11, 2023
1acb305
v0.0.0-experimental-muiv5-1.5.0-alpha.4-25
vmilan Jan 11, 2023
cc2bcc0
peer dependencies
vmilan Jan 11, 2023
f0fac9c
peer dependencies
vmilan Jan 11, 2023
a769698
v0.0.0-experimental-muiv5-1.5.0-alpha.4-26
vmilan Jan 11, 2023
4929eea
peer dependencies
vmilan Jan 11, 2023
123ad98
Widgets adapted to the new design system (#562)
vmilan Jan 11, 2023
2de6b3a
v0.0.0-experimental-muiv5-1.5.0-alpha.4-27
vmilan Jan 11, 2023
a315fa9
peer dependencies
vmilan Jan 11, 2023
4c8a59a
widgets fixes
vmilan Jan 11, 2023
685741d
v0.0.0-experimental-muiv5-1.5.0-alpha.4-28
vmilan Jan 11, 2023
82084a0
peer dependencies
vmilan Jan 11, 2023
071e54c
Cherry pick from #531 PR (#564)
vmilan Jan 12, 2023
c4e5880
v0.0.0-experimental-muiv5-1.5.0-alpha.4-29
vmilan Jan 12, 2023
767dfbf
peer dependencies
vmilan Jan 12, 2023
ebbc128
doNotFillIcon
vmilan Jan 12, 2023
efb51bb
v0.0.0-experimental-muiv5-1.5.0-alpha.4-30
vmilan Jan 12, 2023
1474947
peer dependencies
vmilan Jan 12, 2023
92ff1c2
Fixes in Autocomplete component (#565)
vmilan Jan 12, 2023
04297f6
v0.0.0-experimental-muiv5-1.5.0-alpha.4-31
vmilan Jan 12, 2023
894733f
peer dependencies
vmilan Jan 12, 2023
bf913f1
v0.0.0-experimental-muiv5-1.5.0-alpha.4-32
vmilan Jan 12, 2023
8e9a6fb
peer dependencies
vmilan Jan 12, 2023
ac18e1d
Adjustments in theme to fix uses cases in cloud-native (#567)
vmilan Jan 16, 2023
5f8da1b
v0.0.0-experimental-muiv5-1.5.0-alpha.4-33
vmilan Jan 16, 2023
737dc53
peer dependencies
vmilan Jan 16, 2023
561baa7
remove unused getMaterialUIContext function
vmilan Jan 16, 2023
275712c
remove unused getMaterialUIContext function
vmilan Jan 16, 2023
195acd0
Update design-system branch with master (#568)
vmilan Jan 17, 2023
42eeffb
v0.0.0-experimental-muiv5-1.5.0-alpha.11-01
vmilan Jan 17, 2023
2ece9e8
peer dependencies
vmilan Jan 17, 2023
ec617e5
Adjustments in theme to fix uses cases in cloud-native (#572)
vmilan Jan 19, 2023
4d9f18a
v0.0.0-experimental-muiv5-1.5.0-alpha.11-02
vmilan Jan 19, 2023
0c992b3
peer dependencies
vmilan Jan 19, 2023
b932124
fix tabs test
vmilan Jan 20, 2023
b3f7c21
v0.0.0-experimental-muiv5-1.5.0-alpha.11-03
vmilan Jan 20, 2023
bc69007
peer dependencies
vmilan Jan 20, 2023
c1613e2
Adjustments in theme to fix uses cases in cloud-native (#585)
vmilan Jan 25, 2023
1e41c3f
v0.0.0-experimental-muiv5-1.5.0-alpha.11-04
vmilan Jan 25, 2023
1763a3e
peer dependencies
vmilan Jan 25, 2023
ed11103
Update design-system branch with master (1.5.0-alpha.14) (#586)
vmilan Jan 25, 2023
99feef1
v0.0.0-experimental-muiv5-1.5.0-alpha.14-01
vmilan Jan 25, 2023
51ecd0e
peer dependencies
vmilan Jan 25, 2023
60cd7eb
Adjustments in theme to fix uses cases in cloud-native (#589)
vmilan Jan 31, 2023
a6c73e3
v0.0.0-experimental-muiv5-1.5.0-alpha.14-02
vmilan Jan 31, 2023
b49137b
peer dependencies
vmilan Jan 31, 2023
40025ae
quick fix
vmilan Jan 31, 2023
c27e0bf
v0.0.0-experimental-muiv5-1.5.0-alpha.14-03
vmilan Jan 31, 2023
f886a5b
peer dependencies
vmilan Jan 31, 2023
0ce3221
Adjustments in theme to fix uses cases in cloud-native (#594)
vmilan Feb 3, 2023
14eeb5e
v0.0.0-experimental-muiv5-1.5.0-alpha.14-04
vmilan Feb 3, 2023
8346451
peer dependencies
vmilan Feb 3, 2023
9b79cb8
Update design-system branch with master (1.5.1) (#596)
vmilan Feb 7, 2023
3b237bd
v0.0.0-experimental-muiv5-1.5.1-01
vmilan Feb 7, 2023
a82ab38
peer dependencies
vmilan Feb 7, 2023
ec931b0
Update design-system branch with master (#600)
vmilan Feb 13, 2023
61c16cd
Prepare changelog entry for alpha release
VictorVelarde Feb 13, 2023
c5c5dd2
v2.0.0-alpha.0
vmilan Feb 13, 2023
c0e5a11
bump peer deps
vmilan Feb 13, 2023
7d23f63
Prepare changelog
VictorVelarde Feb 14, 2023
80e7c54
v2.0.0-beta.0
VictorVelarde Feb 14, 2023
0541b40
Bump peer deps
VictorVelarde Feb 14, 2023
56acdf2
merge
vmilan Feb 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,79 @@

## Not released

## 2.0

### 2.0.0-beta.0 (2023-02-14)
### 2.0.0-alpha.0 (2023-02-13)

- MUI5 & new Design System upgrade [#494](https://github.com/CartoDB/carto-react/pull/494)

## 1.5

### 1.5.1 (2023-02-06)

- Add optional sortByColumnType param to fix number sorting in TableWidget [#593](https://github.com/CartoDB/carto-react/pull/593)
- Requests to CARTO APIs V3 will be authorized through the Authorization header instead of using a query param [#592](https://github.com/CartoDB/carto-react/pull/592)
- Provide unified CLIENT_ID for metrics [#591](https://github.com/CartoDB/carto-react/pull/591)

### 1.5.0 (2023-01-31)

### 1.5.0-alpha.15 (2023-01-30)

- Fix support for MVT in FeaturesDroppedLoader [#587](https://github.com/CartoDB/carto-react/pull/587)

### 1.5.0-alpha.14 (2023-01-24)

- Fix isDroppingFeatures converting to Boolean [#583](https://github.com/CartoDB/carto-react/pull/583)

### 1.5.0-alpha.13 (2023-01-23)

- Improve typing for FeatureSelectionWidget [#580](https://github.com/CartoDB/carto-react/pull/580)
- Fix ComparativeCategoryWidgetUI tooltip formatter [#579](https://github.com/CartoDB/carto-react/pull/579)
- Fix gmaps warning caused by callback now been mandatary from version >=3.51.6 [#581](https://github.com/CartoDB/carto-react/pull/581)

### 1.5.0-alpha.12 (2023-01-20)

- HistogramWidget: fix handling of min/max properties [#574](https://github.com/CartoDB/carto-react/pull/574)
- Adapt comparative category widget design [#575](https://github.com/CartoDB/carto-react/pull/575)
- Improved Comparative Formula UI props interface [#573](https://github.com/CartoDB/carto-react/pull/573)

### 1.5.0-alpha.11 (2023-01-18)

- Remove custom fetch function. Fixes issues with icon loading and FillStyleExtensions [#561](https://github.com/CartoDB/carto-react/pull/561)
- Bump deck.gl to latest 8.8.23 [#571](https://github.com/CartoDB/carto-react/pull/571)

### 1.5.0-alpha.10 (2023-01-04)

- Allow to use custom version explicitly in GoogleMap (not 'beta' by default now) [#550](https://github.com/CartoDB/carto-react/pull/550)
- Fix lack of refresh in BarWidgetUI when modifying yAxisData dinamically [#558](https://github.com/CartoDB/carto-react/pull/558)

### 1.5.0-alpha.9 (2022-11-29)

- Improve rendering performance of FeatureSelectionLayer (mask layer) [#541](https://github.com/CartoDB/carto-react/pull/541)

### 1.5.0-alpha.8 (2022-11-25)

- Implement ComparativePieWidgetUI [#510](https://github.com/CartoDB/carto-react/pull/510)
- Fix `executeSQL` through **POST** request [#531](https://github.com/CartoDB/carto-react/pull/531)

### 1.5.0-alpha.7 (2022-11-09)

- Implement ComparativeCategoryWidgetUI [#505](https://github.com/CartoDB/carto-react/pull/505)
- Fix `executeModel` through **POST** request [#525](https://github.com/CartoDB/carto-react/pull/525)

### 1.5.0-alpha.6 (2022-11-02)

- Fix TileLayer unauthorized error due to [breaking changes](https://github.com/visgl/deck.gl/pull/7287) in deck.gl >=8.9.0-alpha.3 and >=8.8.15 [#519](https://github.com/CartoDB/carto-react/pull/519)
- Bump deck.gl to 8.8.15 [#520](https://github.com/CartoDB/carto-react/pull/520)
- Fix missing implementation in stats to support `queryParameters` in RangeWidget and HistogramWidget [#517](https://github.com/CartoDB/carto-react/pull/517)
- AnimatedNumber component with hook wrapping `animateValue` [#509](https://github.com/CartoDB/carto-react/pull/509)
- Implement ComparativeFormulaWidgetUI [#504](https://github.com/CartoDB/carto-react/pull/504)

### 1.5.0-alpha.5 (2022-10-26)

- Fix LegendCategories displaying outlined points [#508](https://github.com/CartoDB/carto-react/pull/508)

### 1.5.0-alpha.4 (2022-10-14)

- Update nebula to latest stable 1.0.4 and deck.gl ^8.9.0-alpha.4 [#491](https://github.com/CartoDB/carto-react/pull/491)
Expand All @@ -24,6 +95,14 @@

## 1.4

### 1.4.3 (2022-11-03)

- Fix TileLayer unauthorized error due to [breaking changes](https://github.com/visgl/deck.gl/pull/7287) in deck.gl >=8.8.15 [#519](https://github.com/CartoDB/carto-react/pull/519)

### 1.4.2 (2022-10-27)

- Support for **deck.gl 8.8.15** _(breaking change)_. It requires ‘quadbin’ >= 0.1.5

### 1.4.1 (2022-09-20)

- Fix the Feature selection tool by setting the `EditableGeoJsonLayer` billboard property to false to be compatible with Google raster base maps
Expand Down
11 changes: 9 additions & 2 deletions DEVELOPERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Then, inside the proper template folder in carto-react-template, link packages w

You will need npm credentials under @carto organization.

To make a **prerelease**:
### To make a **prerelease**:

1. Create a new branch from master, named after the new version (eg, if current version is v1.0.0-rc.2, `git checkout -b release-1.0.0-rc.3`)
2. Modify the changelog, creating a new entry with current contents from `Not released` for the new release; eg: `## 1.0.0-rc.3 (2021-03-22)`. Keep 'Not released' header for the future work, and commit it to the new branch
Expand All @@ -47,11 +47,18 @@ To make a **prerelease**:
8. Choose `Custom prerelease` and ensure the packages version proposed is correct (eg. change suffix to 'alpha' or 'beta', instead of 'rc' if required)
9. Once the npm package has been published, `Merge the PR` to master from github
10. Update the storybook (if required)
11. Coordinate with the design team on minor and major bump versions. C4R and Design system library must have the same paired version.

To make an official **release**:
### To make an official **release**:

1. Repeat the same steps as in a prerelease, but executing `yarn publish:release`

### To apply a hotfix patch

- If change also applies to current master, it's recommended to start by creating a PR applying the fix it (to avoid forgetting it).
- Then create a branch for the patch release, but this time start with the desired (usually stable) branch. For example, to create a patch 1.4.8, while not affecting current master, do `git checkout -b release-v1.4.8 release-v1.4.7`. Then apply there, locally, all changes as needed. If you created a first PR for master, you can use cherry-pick to share changes among master & patch.
- After having everything ready, go as usual, with changelog entry + `yarn publish:release`

## Firebase deployment of storybook

(Restricted to CARTO developers)
Expand Down
215 changes: 215 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
# Upgrade to the new design system

# Breaking changes in Mui v5

Please, follow the Mui guides related to breaking changes in components and styles:

- [Styles](https://mui.com/material-ui/migration/v5-style-changes/)
- [Components](https://mui.com/material-ui/migration/v5-component-changes/)

# MUI theme

[carto-theme.js](https://github.com/CartoDB/carto-react/blob/master/packages/react-ui/src/theme/carto-theme.js) file splitted in sections:

- CSS baseline
- Color palette
- Typography
- Shadows
- Components overrides

Also added some files for shared constants (`themeConstants.js`) and useful functions (`themeUtils.js`).

Removed unused custom `createTheme` function in `carto-theme.js`.

## theme.spacing

We have a new custom spacing constant in carto-theme, `spacingValue`, which you should use instead of the common `theme.spacing()` function in cases where you need to do value calculations, because since Mui v5, theme.spacing is no longer a number, but a string in this format: `number + px`.

Note that if you're using `calc()` in your styles, you can keep using `theme.spacing()` as usual.

`theme.spacingValue * 2`

Needed changes:

1. Change `${theme.spacing(xx)}px` by `${theme.spacing(xx)}`. It means, without the `px` ending, since in Mui v5 it is appended to the end of the string by default.

Tip: An easy search to catch up this, would be `)}px`

2. Change `-theme.spacing(xx)` by `theme.spacing(-xx)`. It means, move the negative symbol inside the function.

Tip: An easy search to catch up this, would be `-theme.spacing(`

## Icons

We have this kind of rules in buttons to cover the common use cases:

`svg path { fill: currentColor }`

In case you don't need the icon to be filled, you can apply this class to the svg parent: `.doNotFillIcon`

`<CloseIcon className="doNotFillIcon" />`

## Typography

`responsiveFontSizes` simplified due we want to resize only a few variants through the theme.

Added a few custom variants to the typography set:

- overlineDelicate
- code1
- code2
- code3

Some variants have been replaced because they were so specific to some components, these are:

- charts (replaced by `theme.palette.overline + weight='strong'`)

For external use: `Open Sans` and `Montserrat` families have been replaced by `Inter` and `Overpass Mono`, you have an example of this in the [`preview-head.html`](https://github.com/CartoDB/carto-react/blob/master/packages/react-ui/storybook/.storybook/preview-head.html) file.

We have a `Typography` component that uses `Mui Typography` and extends it with some useful props:

- weight
- italic

This way we can be more flexible regarding text styles without adding too many variants to the Mui component.

In short, instead of Mui Typography, the component you should use to add text is this one:
`react-ui/src/components/atoms/Typography`

For external use: `import { Typography } from '@carto/react-ui';`.

## Colors

Some keys have been removed from [color palette](https://github.com/CartoDB/carto-react/tree/master/packages/react-ui/src/theme) due they are unused:

- activatedOpacity
- hoverOpacity
- disabledOpacity
- selectedOpacity
- focusOpacity
- other, all removed but divider, which is moved to first level

Some others have been moved or replaced because they aren't native MUI keys and are so specific to some components, these are:

- charts (replaced by `theme.palette.black[%]`)

`grey palette` is not used to design (and therefore not for style) components directly. We have a set of neutral colors to use in the custom `default` variant.

We also have a set of `shade` colors (with transparency):

- black
- white

Important: `primary.relatedLight` and `secondary.relatedLight` has to be replaced by `primary.background` and `secondary.background`.

## Spacing

Design is restringed to a few specific values for spacing, which are:

`0.5, 1, 1.5, 2, 2.5, 3, 4, 5, 6, 7, 8, 9, 12, 15`.

## Shapes

Design is restringed to a few specific values for border radius, which are:

`0.5, 1, 1.5, 2`.

Use: `borderRadius: theme.spacing(x)`

## Shadows / Elevations

Design is restringed to a few specific values for shadows, which are:

`0, 1, 2, 4, 6, 8, 16, 24`.

# Components

## Button

We have a `Button` component that uses `Mui Button` and wraps its children in `Typography` to meet with the designed behavior (text overflow case).

So, instead of Mui Button, the component you should use to create buttons is this one:
`react-ui/src/components/atoms/Button`

For external use: `import { Button } from '@carto/react-ui';`.

## Tooltip

Now, by default is placed `top` and has an `arrow` indicator, so you don't need to specify these properties anymore.

We have a new component for building data structures within Tooltips, `TooltipData`.

## Password Input Field

We have a custom component to build the show / hide content logic on top of TextField Mui component.

Instead of `<TextField type='password' /> ` you can use:
`react-ui/src/components/atoms/PasswordField`

For external use: `import { PasswordField } from '@carto/react-ui';`.

## Select Field

We have a custom component to build the `placeholder` and `multiple selection` logic on top of TextField Mui component.

Instead of `<TextField select /> ` or `<Select />` you can use:
`react-ui/src/components/atoms/SelectField`

For external use: `import { SelectField } from '@carto/react-ui';`.

## InputFile / UploadField

This component is used to display and input `type='file'`.

We are replacing `InputFile` component by the new `UploadField`.

Instead of `<Inputfile /> ` you can use:
`react-ui/src/components/molecules/UploadField`

For external use: `import { UploadField } from '@carto/react-ui';`.

## AppBar

We have a custom component to build the basic structure and styles on top of AppBar Mui component.

This component normalize size and position of common elements like:

- logo
- Texts
- Avatar
- Burger menu icon

You can use `<AppBar /> ` from:
`react-ui/src/components/organisms/AppBar`

For external use: `import { AppBar } from '@carto/react-ui';`.

# Testing

Mui5 has changed the DOM tags, so this is causing some E2E test to fail.

## Aria attributes

Mui5 has improve the `accesibility` of many of the components, adding by default some attributes to the DOM, like aria-label.

This can cause some tests to fail if `aria-label` is not correctly created, because if this attribute is present, `Playwright` will check its content rather than the text of the node itself.

## Tabs

Some tests rely on tab clicking, but with the new design, the click is disabled on selected tab. So, if your test fails in an assert like this:

`await page.getByRole('tab', { name: 'Map' }).click()`

Before the click, yo have to check if the tab is selected.

We have an `isAriaAttributeValue` function in `@utils/ariaAssertions` to check for some aria tags not supported by default by Playwright.

This assert will pass:

```
const MapPreviewTab = page.getByRole('tab', { name: 'Map' })

if (await isAriaAttributeValue(MapPreviewTab, 'selected', 'false')) {
await MapPreviewTab.click()
}
```
20 changes: 7 additions & 13 deletions jest.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
// collectCoverageFrom: undefined,

// The directory where Jest should output its coverage files
coverageDirectory: "coverage",
coverageDirectory: 'coverage',

// An array of regexp pattern strings used to skip coverage collection
// coveragePathIgnorePatterns: [
Expand All @@ -40,9 +40,7 @@ module.exports = {
// "lcov",
// "clover"
// ],
coverageReporters: [
"json"
],
coverageReporters: ['json'],

// An object that configures minimum threshold enforcement for coverage results
// coverageThreshold: undefined,
Expand All @@ -69,9 +67,7 @@ module.exports = {
// maxWorkers: "50%",

// An array of directory names to be searched recursively up from the requiring module's location
moduleDirectories: [
"node_modules"
],
moduleDirectories: ['node_modules'],

// An array of file extensions your modules use
// moduleFileExtensions: [
Expand Down Expand Up @@ -154,10 +150,7 @@ module.exports = {
// "**/__tests__/**/*.[jt]s?(x)",
// "**/?(*.)+(spec|test).[tj]s?(x)"
// ],
testMatch: [
"**/?(*.)+(spec|test).js"
],

testMatch: ['**/?(*.)+(spec|test).js'],

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
// testPathIgnorePatterns: [
Expand Down Expand Up @@ -187,8 +180,9 @@ module.exports = {
// "/node_modules/",
// "\\.pnp\\.[^\\/]+$"
// ],
transformIgnorePatterns: ['node_modules/(?!(@mapbox/tiny-sdf|mapbox-gl)/)'],

transformIgnorePatterns: [
'node_modules/(?!(@mapbox/tiny-sdf|mapbox-gl|d3-array|internmap|d3-color|d3-scale|d3-interpolate|d3-format|d3-time|d3-time-format)/)'
]

// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
// unmockedModulePathPatterns: undefined,
Expand Down
Loading