@carto/meridian-ds 2.0.1 → 2.0.2-alpha-timeseries.1

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,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - fix(TimeSeriesWidgetUI): Fix TimeSeriesWidgetUI overflowing available height [#226](https://github.com/CartoDB/meridian-ds/pull/226)
6
+
5
7
  ## 2.0
6
8
 
7
9
  ### 2.0.1
@@ -1 +1 @@
1
- {"version":3,"file":"ChartLegend.d.ts","sourceRoot":"","sources":["../../../src/widgets/ChartLegend.tsx"],"names":[],"mappings":"AAoEA,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,MAAM,EACN,kBAAkB,EAClB,MAAkB,EAClB,eAAe,GAChB,EAAE;IACD,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACzD,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,eAAe,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;CACjD,2CAkJA"}
1
+ {"version":3,"file":"ChartLegend.d.ts","sourceRoot":"","sources":["../../../src/widgets/ChartLegend.tsx"],"names":[],"mappings":"AAmEA,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,MAAM,EACN,kBAAkB,EAClB,MAAkB,EAClB,eAAe,GAChB,EAAE;IACD,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACzD,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,eAAe,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;CACjD,2CAsJA"}
@@ -2016,7 +2016,7 @@ function PieSkeleton({ height }) {
2016
2016
  }
2017
2017
  const Legend$1 = material.styled(material.Box)(({ theme }) => ({
2018
2018
  position: "relative",
2019
- padding: theme.spacing(1.25, 1, 0, 1),
2019
+ padding: theme.spacing(0.75, 0.75, 0, 0.75),
2020
2020
  width: "100%"
2021
2021
  }));
2022
2022
  const ItemsContainer = material.styled(material.Box)(({ theme }) => ({
@@ -2025,9 +2025,8 @@ const ItemsContainer = material.styled(material.Box)(({ theme }) => ({
2025
2025
  flexDirection: "row",
2026
2026
  overflowX: "hidden",
2027
2027
  gap: theme.spacing(2),
2028
- // Accessibility tweak to display focus indicator properly
2029
- padding: theme.spacing(0.5),
2030
- margin: theme.spacing(-0.5)
2028
+ // a11y: padding prevents clipping focus outline
2029
+ padding: theme.spacing(0.25)
2031
2030
  }));
2032
2031
  const Item = material.styled(material.Box)(({ theme }) => ({
2033
2032
  display: "flex",
@@ -2081,6 +2080,9 @@ function ChartLegend({
2081
2080
  const legendRef = React.useRef(null);
2082
2081
  const containerRef = React.useRef(null);
2083
2082
  const showMoreButtonsRef = React.useRef(null);
2083
+ if (series.length === 0) {
2084
+ series = [{ name: "", color: theme.palette.text.disabled }];
2085
+ }
2084
2086
  const intl = reactIntl.useIntl();
2085
2087
  const intlConfig = TablePaginationActions.useImperativeIntl(intl);
2086
2088
  function handleClickRight() {
@@ -2141,7 +2143,7 @@ function ChartLegend({
2141
2143
  return /* @__PURE__ */ jsxRuntime.jsxs(
2142
2144
  Item,
2143
2145
  {
2144
- tabIndex: 0,
2146
+ tabIndex: onCategoryClick ? 0 : void 0,
2145
2147
  onClick: onCategoryClick ? () => onCategoryClick(category.name) : void 0,
2146
2148
  onKeyDown: onCategoryClick ? (e) => onCategoryPress(e, category.name) : void 0,
2147
2149
  style: {
@@ -2159,7 +2161,7 @@ function ChartLegend({
2159
2161
  {
2160
2162
  variant: "overline",
2161
2163
  color: selected ? void 0 : "text.disabled",
2162
- children: label
2164
+ children: label || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: " " })
2163
2165
  }
2164
2166
  )
2165
2167
  ]
@@ -4764,7 +4766,7 @@ function TimeSeriesWidgetUIContent({
4764
4766
  );
4765
4767
  const isLegendVisible = Boolean(showLegend ?? series.length > 1);
4766
4768
  const header = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4767
- /* @__PURE__ */ jsxRuntime.jsx(material.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(TablePaginationActions.Typography, { color: "textSecondary", variant: "caption", children: currentDate ?? "-" }) }),
4769
+ /* @__PURE__ */ jsxRuntime.jsx(material.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(TablePaginationActions.Typography, { color: "textSecondary", variant: "caption", children: currentDate || "-" }) }),
4768
4770
  filterable && showClearButton && /* @__PURE__ */ jsxRuntime.jsx(
4769
4771
  material.Link,
4770
4772
  {
@@ -2014,7 +2014,7 @@ function PieSkeleton({ height }) {
2014
2014
  }
2015
2015
  const Legend$1 = styled(Box)(({ theme }) => ({
2016
2016
  position: "relative",
2017
- padding: theme.spacing(1.25, 1, 0, 1),
2017
+ padding: theme.spacing(0.75, 0.75, 0, 0.75),
2018
2018
  width: "100%"
2019
2019
  }));
2020
2020
  const ItemsContainer = styled(Box)(({ theme }) => ({
@@ -2023,9 +2023,8 @@ const ItemsContainer = styled(Box)(({ theme }) => ({
2023
2023
  flexDirection: "row",
2024
2024
  overflowX: "hidden",
2025
2025
  gap: theme.spacing(2),
2026
- // Accessibility tweak to display focus indicator properly
2027
- padding: theme.spacing(0.5),
2028
- margin: theme.spacing(-0.5)
2026
+ // a11y: padding prevents clipping focus outline
2027
+ padding: theme.spacing(0.25)
2029
2028
  }));
2030
2029
  const Item = styled(Box)(({ theme }) => ({
2031
2030
  display: "flex",
@@ -2079,6 +2078,9 @@ function ChartLegend({
2079
2078
  const legendRef = useRef(null);
2080
2079
  const containerRef = useRef(null);
2081
2080
  const showMoreButtonsRef = useRef(null);
2081
+ if (series.length === 0) {
2082
+ series = [{ name: "", color: theme.palette.text.disabled }];
2083
+ }
2082
2084
  const intl = useIntl();
2083
2085
  const intlConfig = useImperativeIntl(intl);
2084
2086
  function handleClickRight() {
@@ -2139,7 +2141,7 @@ function ChartLegend({
2139
2141
  return /* @__PURE__ */ jsxs(
2140
2142
  Item,
2141
2143
  {
2142
- tabIndex: 0,
2144
+ tabIndex: onCategoryClick ? 0 : void 0,
2143
2145
  onClick: onCategoryClick ? () => onCategoryClick(category.name) : void 0,
2144
2146
  onKeyDown: onCategoryClick ? (e) => onCategoryPress(e, category.name) : void 0,
2145
2147
  style: {
@@ -2157,7 +2159,7 @@ function ChartLegend({
2157
2159
  {
2158
2160
  variant: "overline",
2159
2161
  color: selected ? void 0 : "text.disabled",
2160
- children: label
2162
+ children: label || /* @__PURE__ */ jsx(Fragment, { children: " " })
2161
2163
  }
2162
2164
  )
2163
2165
  ]
@@ -4762,7 +4764,7 @@ function TimeSeriesWidgetUIContent({
4762
4764
  );
4763
4765
  const isLegendVisible = Boolean(showLegend ?? series.length > 1);
4764
4766
  const header = /* @__PURE__ */ jsxs(Fragment, { children: [
4765
- /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Typography, { color: "textSecondary", variant: "caption", children: currentDate ?? "-" }) }),
4767
+ /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Typography, { color: "textSecondary", variant: "caption", children: currentDate || "-" }) }),
4766
4768
  filterable && showClearButton && /* @__PURE__ */ jsx(
4767
4769
  Link,
4768
4770
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carto/meridian-ds",
3
- "version": "2.0.1",
3
+ "version": "2.0.2-alpha-timeseries.1",
4
4
  "description": "CARTO Meridian Design System",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -165,5 +165,6 @@
165
165
  "bugs": {
166
166
  "url": "https://github.com/CartoDB/meridian-ds/issues"
167
167
  },
168
- "homepage": "https://github.com/CartoDB/meridian-ds#readme"
168
+ "homepage": "https://github.com/CartoDB/meridian-ds#readme",
169
+ "stableVersion": "2.0.1"
169
170
  }