@carto/meridian-ds 1.4.4-alpha-others.2 → 1.4.4-alpha-icons-shapes.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,15 +2,19 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
- - TimeSeriesWidgetUI: handle empty categories [#195](https://github.com/CartoDB/meridian-ds/pull/195)
5
+ - Fix Icon shapes size [#194](https://github.com/CartoDB/meridian-ds/pull/194)
6
+
7
+ ## 1.0
8
+
9
+ ### 1.4.4
10
+
6
11
  - feat(widgets): Pie&Category widget acceps otherValues prop [#186](https://github.com/CartoDB/meridian-ds/pull/186)
12
+ - TimeSeriesWidgetUI: handle empty categories [#195](https://github.com/CartoDB/meridian-ds/pull/195)
7
13
  - New CodeAreaField & CodeAreaDialog components [#175](https://github.com/CartoDB/meridian-ds/pull/175)
8
- - Expose OrderTypes enum in widgets [#192](https://github.com/CartoDB/meridian-ds/pull/192)
9
14
  - New CopiableComponent component [#187](https://github.com/CartoDB/meridian-ds/pull/187)
10
15
  - Expose OrderTypes enum in widgets [#192](https://github.com/CartoDB/meridian-ds/pull/192)
11
16
  - Disable minification in published builds [#190](https://github.com/CartoDB/meridian-ds/pull/190)
12
-
13
- ## 1.0
17
+ - Fix issue with Category Widget not holding all selected values [#198](https://github.com/CartoDB/meridian-ds/pull/198)
14
18
 
15
19
  ### 1.4.3
16
20
 
@@ -520,8 +520,13 @@ const dataDisplayOverrides = {
520
520
  // Svg Icons
521
521
  MuiSvgIcon: {
522
522
  styleOverrides: {
523
- root: () => ({
524
- fontSize: TablePaginationActions.ICON_SIZE_MEDIUM
523
+ root: ({ theme: theme2 }) => ({
524
+ fontSize: TablePaginationActions.ICON_SIZE_MEDIUM,
525
+ // Force the size of the inner shapes to match the icon size
526
+ "& rect, & circle, & polygon": {
527
+ minWidth: theme2.spacing(2),
528
+ minHeight: theme2.spacing(2)
529
+ }
525
530
  }),
526
531
  fontSizeSmall: () => ({
527
532
  fontSize: TablePaginationActions.ICON_SIZE_SMALL
@@ -520,8 +520,13 @@ const dataDisplayOverrides = {
520
520
  // Svg Icons
521
521
  MuiSvgIcon: {
522
522
  styleOverrides: {
523
- root: () => ({
524
- fontSize: ICON_SIZE_MEDIUM
523
+ root: ({ theme: theme2 }) => ({
524
+ fontSize: ICON_SIZE_MEDIUM,
525
+ // Force the size of the inner shapes to match the icon size
526
+ "& rect, & circle, & polygon": {
527
+ minWidth: theme2.spacing(2),
528
+ minHeight: theme2.spacing(2)
529
+ }
525
530
  }),
526
531
  fontSizeSmall: () => ({
527
532
  fontSize: ICON_SIZE_SMALL
@@ -1 +1 @@
1
- {"version":3,"file":"data-display.d.ts","sourceRoot":"","sources":["../../../../../src/theme/sections/components/data-display.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAkBxD,eAAO,MAAM,oBAAoB,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CA0iB3D,CAAA"}
1
+ {"version":3,"file":"data-display.d.ts","sourceRoot":"","sources":["../../../../../src/theme/sections/components/data-display.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAkBxD,eAAO,MAAM,oBAAoB,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAgjB3D,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"CategoryWidgetUI.d.ts","sourceRoot":"","sources":["../../../../src/widgets/CategoryWidgetUI/CategoryWidgetUI.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,SAAS,EAAW,MAAM,YAAY,CAAA;AAkB/C,OAAO,EAAE,UAAU,EAAiB,MAAM,wBAAwB,CAAA;AAClE,OAAO,EAAwB,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAI7E,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG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AO,EAAwB,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAI7E,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;AAChD,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,IAAI,EAAE,QAAQ,CAAA;CACf,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,IAAI,EAAE,YAAY,EAAE,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,cAAc,CAAA;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,CAAA;IAC/B,0BAA0B,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAA;CAC9D,CAAA;AAOD,iBAAS,gBAAgB,CAAC,EACxB,IAAI,EACJ,SAAoB,EACpB,MAAkB,EAClB,QAAY,EACZ,WAAW,EACX,KAA0B,EAC1B,kBAA8B,EAC9B,0BAAqC,EACrC,SAAgB,EAChB,UAAiB,EACjB,UAAiB,EACjB,SAAS,GACV,EAAE,qBAAqB,2CAklBvB;AAED,eAAe,gBAAgB,CAAA"}
@@ -821,8 +821,15 @@ function CategoryWidgetUI({
821
821
  const intl = reactIntl.useIntl();
822
822
  const intlConfig = TablePaginationActions.useImperativeIntl(intl);
823
823
  function sortBlockedSameAsData(blockedCategories2) {
824
- return sortedData.reduce((acum, elem) => {
825
- if (blockedCategories2.includes(elem.name)) {
824
+ const blockedCategoriesSet = new Set(blockedCategories2);
825
+ let sortedByOrderData = data;
826
+ if (order === OrderTypes.Ranking) {
827
+ sortedByOrderData = [...data].sort(
828
+ (a, b) => (b.value ?? 0) - (a.value ?? 0)
829
+ );
830
+ }
831
+ return sortedByOrderData.reduce((acum, elem) => {
832
+ if (blockedCategoriesSet.has(elem.name)) {
826
833
  acum.push(elem.name);
827
834
  }
828
835
  return acum;
@@ -1080,6 +1087,18 @@ function CategoryWidgetUI({
1080
1087
  material.Checkbox,
1081
1088
  {
1082
1089
  checked: tempBlockedCategories.includes(data2.name),
1090
+ onChange: (e) => {
1091
+ if (e.target.checked) {
1092
+ setTempBlockedCategories([
1093
+ ...tempBlockedCategories,
1094
+ data2.name
1095
+ ]);
1096
+ } else {
1097
+ setTempBlockedCategories(
1098
+ tempBlockedCategories.filter((c) => c !== data2.name)
1099
+ );
1100
+ }
1101
+ },
1083
1102
  tabIndex: -1
1084
1103
  }
1085
1104
  ) }),
@@ -819,8 +819,15 @@ function CategoryWidgetUI({
819
819
  const intl = useIntl();
820
820
  const intlConfig = useImperativeIntl(intl);
821
821
  function sortBlockedSameAsData(blockedCategories2) {
822
- return sortedData.reduce((acum, elem) => {
823
- if (blockedCategories2.includes(elem.name)) {
822
+ const blockedCategoriesSet = new Set(blockedCategories2);
823
+ let sortedByOrderData = data;
824
+ if (order === OrderTypes.Ranking) {
825
+ sortedByOrderData = [...data].sort(
826
+ (a, b) => (b.value ?? 0) - (a.value ?? 0)
827
+ );
828
+ }
829
+ return sortedByOrderData.reduce((acum, elem) => {
830
+ if (blockedCategoriesSet.has(elem.name)) {
824
831
  acum.push(elem.name);
825
832
  }
826
833
  return acum;
@@ -1078,6 +1085,18 @@ function CategoryWidgetUI({
1078
1085
  Checkbox,
1079
1086
  {
1080
1087
  checked: tempBlockedCategories.includes(data2.name),
1088
+ onChange: (e) => {
1089
+ if (e.target.checked) {
1090
+ setTempBlockedCategories([
1091
+ ...tempBlockedCategories,
1092
+ data2.name
1093
+ ]);
1094
+ } else {
1095
+ setTempBlockedCategories(
1096
+ tempBlockedCategories.filter((c) => c !== data2.name)
1097
+ );
1098
+ }
1099
+ },
1081
1100
  tabIndex: -1
1082
1101
  }
1083
1102
  ) }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carto/meridian-ds",
3
- "version": "1.4.4-alpha-others.2",
3
+ "version": "1.4.4-alpha-icons-shapes.2",
4
4
  "description": "CARTO Meridian Design System",
5
5
  "type": "module",
6
6
  "scripts": {