@carto/meridian-ds 2.7.0-alpha-loader.1 → 2.7.0-alpha-loader.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.
@@ -894,7 +894,10 @@ function _Loader({
894
894
  label,
895
895
  secondLabel,
896
896
  color = "primary",
897
+ size = 40,
897
898
  fullHeight,
899
+ labelTypographyProps,
900
+ secondLabelTypographyProps,
898
901
  ...otherProps
899
902
  }, ref) {
900
903
  const labelText = cssUtils.useTranslationWithFallback("c4r.utils.loader.label", label);
@@ -914,16 +917,27 @@ function _Loader({
914
917
  material.CircularProgress,
915
918
  {
916
919
  color,
920
+ size,
917
921
  "aria-labelledby": hasAnyLabel ? "loader-label" : void 0
918
922
  }
919
923
  ),
920
924
  hasAnyLabel && /* @__PURE__ */ jsxRuntime.jsxs(material.Stack, { direction: "column", alignItems: "center", children: [
921
- labelText && /* @__PURE__ */ jsxRuntime.jsx(cssUtils.Typography, { variant: "body2", color: "textSecondary", id: "loader-label", children: labelText }),
925
+ labelText && /* @__PURE__ */ jsxRuntime.jsx(
926
+ cssUtils.Typography,
927
+ {
928
+ variant: "body2",
929
+ color: "textSecondary",
930
+ ...labelTypographyProps,
931
+ id: "loader-label",
932
+ children: labelText
933
+ }
934
+ ),
922
935
  secondLabel && /* @__PURE__ */ jsxRuntime.jsx(
923
936
  cssUtils.Typography,
924
937
  {
925
938
  variant: "body2",
926
939
  color: "textSecondary",
940
+ ...secondLabelTypographyProps,
927
941
  id: labelText ? void 0 : "loader-label",
928
942
  children: secondLabel
929
943
  }
@@ -894,7 +894,10 @@ function _Loader({
894
894
  label,
895
895
  secondLabel,
896
896
  color = "primary",
897
+ size = 40,
897
898
  fullHeight,
899
+ labelTypographyProps,
900
+ secondLabelTypographyProps,
898
901
  ...otherProps
899
902
  }, ref) {
900
903
  const labelText = useTranslationWithFallback("c4r.utils.loader.label", label);
@@ -914,16 +917,27 @@ function _Loader({
914
917
  CircularProgress,
915
918
  {
916
919
  color,
920
+ size,
917
921
  "aria-labelledby": hasAnyLabel ? "loader-label" : void 0
918
922
  }
919
923
  ),
920
924
  hasAnyLabel && /* @__PURE__ */ jsxs(Stack, { direction: "column", alignItems: "center", children: [
921
- labelText && /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "textSecondary", id: "loader-label", children: labelText }),
925
+ labelText && /* @__PURE__ */ jsx(
926
+ Typography,
927
+ {
928
+ variant: "body2",
929
+ color: "textSecondary",
930
+ ...labelTypographyProps,
931
+ id: "loader-label",
932
+ children: labelText
933
+ }
934
+ ),
922
935
  secondLabel && /* @__PURE__ */ jsx(
923
936
  Typography,
924
937
  {
925
938
  variant: "body2",
926
939
  color: "textSecondary",
940
+ ...secondLabelTypographyProps,
927
941
  id: labelText ? void 0 : "loader-label",
928
942
  children: secondLabel
929
943
  }
@@ -1,8 +1,41 @@
1
1
  import { ReactNode } from 'react';
2
+ import { TypographyProps } from '../Typography';
2
3
  export type LoaderProps = {
4
+ /**
5
+ * The label to display.
6
+ * If not provided, the default label 'Loading...' will be displayed.
7
+ */
3
8
  label?: ReactNode;
9
+ /**
10
+ * The props to pass to the label Typography component to override the default styles.
11
+ */
12
+ labelTypographyProps?: TypographyProps;
13
+ /**
14
+ * The second label to display.
15
+ * If not provided, no second label will be displayed.
16
+ */
4
17
  secondLabel?: ReactNode;
18
+ /**
19
+ * The props to pass to the second label Typography component to override the default styles.
20
+ */
21
+ secondLabelTypographyProps?: TypographyProps;
22
+ /**
23
+ * The color of the circular progress.
24
+ * It supports both primary and secondary colors.
25
+ * @default 'primary'
26
+ */
5
27
  color?: 'primary' | 'secondary';
28
+ /**
29
+ * The size of the component.
30
+ * If using a number, the pixel unit is assumed.
31
+ * If using a string, you need to provide the CSS unit, for example '3rem'.
32
+ * @default 40
33
+ */
34
+ size?: number | string;
35
+ /**
36
+ * If `true`, the component will take the full height of its container.
37
+ * @default false
38
+ */
6
39
  fullHeight?: boolean;
7
40
  };
8
41
  declare const Loader: import('react').ForwardRefExoticComponent<LoaderProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"Loader.d.ts","sourceRoot":"","sources":["../../../../src/components/Loader/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA4B,MAAM,OAAO,CAAA;AAK3D,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAsED,QAAA,MAAM,MAAM,wGAAsB,CAAA;AAClC,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"Loader.d.ts","sourceRoot":"","sources":["../../../../src/components/Loader/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA4B,MAAM,OAAO,CAAA;AAE3D,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAA;AAG3D,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB;;OAEG;IACH,oBAAoB,CAAC,EAAE,eAAe,CAAA;IACtC;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB;;OAEG;IACH,0BAA0B,CAAC,EAAE,eAAe,CAAA;IAC5C;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;IAC/B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAgFD,QAAA,MAAM,MAAM,wGAAsB,CAAA;AAClC,eAAe,MAAM,CAAA"}
@@ -8,12 +8,34 @@ declare const options: {
8
8
  control: "select";
9
9
  options: string[];
10
10
  };
11
+ size: {
12
+ control: "select";
13
+ options: number[];
14
+ };
15
+ label: {
16
+ control: "text";
17
+ };
18
+ secondLabel: {
19
+ control: "text";
20
+ };
21
+ labelTypographyProps: {
22
+ control: "object";
23
+ };
24
+ secondLabelTypographyProps: {
25
+ control: "object";
26
+ };
27
+ fullHeight: {
28
+ table: {
29
+ defaultValue: {
30
+ summary: string;
31
+ };
32
+ };
33
+ control: "boolean";
34
+ };
11
35
  };
12
36
  args: {
13
- variant: string;
14
37
  color: string;
15
- disabled: boolean;
16
- loading: boolean;
38
+ fullHeight: boolean;
17
39
  };
18
40
  parameters: {
19
41
  design: {
@@ -37,6 +59,9 @@ export declare const Playground: {
37
59
  export declare const Color: {
38
60
  render: (args: LoaderProps) => import("react/jsx-runtime").JSX.Element;
39
61
  };
62
+ export declare const Size: {
63
+ render: (args: LoaderProps) => import("react/jsx-runtime").JSX.Element;
64
+ };
40
65
  export declare const LabelAndSecondLabel: {
41
66
  render: (args: LoaderProps) => import("react/jsx-runtime").JSX.Element;
42
67
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Loader.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Loader/Loader.stories.tsx"],"names":[],"mappings":"AAEA,OAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAG9C,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;CAyBG,CAAA;AAChB,eAAe,OAAO,CAAA;AA6DtB,eAAO,MAAM,UAAU;mBA3DC,WAAW;;;;;;CAgElC,CAAA;AAED,eAAO,MAAM,KAAK;mBAhEW,WAAW;CAkEvC,CAAA;AAED,eAAO,MAAM,mBAAmB;mBAtDH,WAAW;CAwDvC,CAAA;AAED,eAAO,MAAM,UAAU;mBA9BO,WAAW;CAgCxC,CAAA;AAED,eAAO,MAAM,cAAc;mBA9EH,WAAW;;;;;;CAmFlC,CAAA"}
1
+ {"version":3,"file":"Loader.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Loader/Loader.stories.tsx"],"names":[],"mappings":"AAEA,OAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAG9C,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CG,CAAA;AAChB,eAAe,OAAO,CAAA;AAqGtB,eAAO,MAAM,UAAU;mBAnGC,WAAW;;;;;;CAwGlC,CAAA;AAED,eAAO,MAAM,KAAK;mBAxGW,WAAW;CA0GvC,CAAA;AAED,eAAO,MAAM,IAAI;mBA9FW,WAAW;CAgGtC,CAAA;AAED,eAAO,MAAM,mBAAmB;mBA7EH,WAAW;CA+EvC,CAAA;AAED,eAAO,MAAM,UAAU;mBAlCO,WAAW;CAoCxC,CAAA;AAED,eAAO,MAAM,cAAc;mBA1HH,WAAW;;;;;;CA+HlC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carto/meridian-ds",
3
- "version": "2.7.0-alpha-loader.1",
3
+ "version": "2.7.0-alpha-loader.2",
4
4
  "description": "CARTO Meridian Design System",
5
5
  "type": "module",
6
6
  "scripts": {