@telia/teddy 0.6.0 → 0.6.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.
Files changed (46) hide show
  1. package/dist/components/card/card-carousel.cjs +57 -21
  2. package/dist/components/card/card-carousel.d.ts +1 -0
  3. package/dist/components/card/card-carousel.js +58 -22
  4. package/dist/components/carousel/carousel-root.cjs +4 -4
  5. package/dist/components/carousel/carousel-root.js +4 -4
  6. package/dist/components/{subscription-card/subscription-card-avatar.cjs → dashboard-card/dashboard-card-avatar.cjs} +3 -3
  7. package/dist/components/{subscription-card/subscription-card-avatar.js → dashboard-card/dashboard-card-avatar.js} +1 -1
  8. package/dist/components/{subscription-card/subscription-card-content.cjs → dashboard-card/dashboard-card-content.cjs} +2 -2
  9. package/dist/components/{subscription-card/subscription-card-content.js → dashboard-card/dashboard-card-content.js} +1 -1
  10. package/dist/components/{subscription-card/subscription-card-heading.cjs → dashboard-card/dashboard-card-heading.cjs} +2 -2
  11. package/dist/components/{subscription-card/subscription-card-heading.js → dashboard-card/dashboard-card-heading.js} +1 -1
  12. package/dist/components/dashboard-card/dashboard-card-illustration.cjs +14 -0
  13. package/dist/components/dashboard-card/dashboard-card-illustration.d.ts +4 -0
  14. package/dist/components/dashboard-card/dashboard-card-illustration.js +14 -0
  15. package/dist/components/{subscription-card/subscription-card-root.cjs → dashboard-card/dashboard-card-root.cjs} +15 -14
  16. package/dist/components/{subscription-card/subscription-card-root.d.ts → dashboard-card/dashboard-card-root.d.ts} +1 -1
  17. package/dist/components/{subscription-card/subscription-card-root.js → dashboard-card/dashboard-card-root.js} +15 -14
  18. package/dist/components/{subscription-card/subscription-card-subtitle.cjs → dashboard-card/dashboard-card-subtitle.cjs} +2 -2
  19. package/dist/components/{subscription-card/subscription-card-subtitle.js → dashboard-card/dashboard-card-subtitle.js} +1 -1
  20. package/dist/components/dashboard-card/index.cjs +21 -0
  21. package/dist/components/dashboard-card/index.d.ts +85 -0
  22. package/dist/components/dashboard-card/index.js +21 -0
  23. package/dist/components/index.cjs +2 -2
  24. package/dist/components/index.d.ts +1 -1
  25. package/dist/components/index.js +2 -2
  26. package/dist/components/modal/modal-close.cjs +1 -1
  27. package/dist/components/modal/modal-close.js +1 -1
  28. package/dist/components/navigation-menu/navigation-menu.cjs +1 -1
  29. package/dist/components/navigation-menu/navigation-menu.js +1 -1
  30. package/dist/components/radio-card-group/radio-card-group-content.cjs +1 -1
  31. package/dist/components/radio-card-group/radio-card-group-content.js +1 -1
  32. package/dist/components/radio-card-group/radio-card-group-item-title.cjs +1 -1
  33. package/dist/components/radio-card-group/radio-card-group-item-title.js +1 -1
  34. package/dist/components/radio-card-group/radio-card-group-item.cjs +1 -1
  35. package/dist/components/radio-card-group/radio-card-group-item.js +1 -1
  36. package/dist/main.cjs +2 -2
  37. package/dist/main.js +2 -2
  38. package/dist/style.css +87 -66
  39. package/package.json +1 -1
  40. package/dist/components/subscription-card/index.cjs +0 -18
  41. package/dist/components/subscription-card/index.d.ts +0 -74
  42. package/dist/components/subscription-card/index.js +0 -18
  43. /package/dist/components/{subscription-card/subscription-card-avatar.d.ts → dashboard-card/dashboard-card-avatar.d.ts} +0 -0
  44. /package/dist/components/{subscription-card/subscription-card-content.d.ts → dashboard-card/dashboard-card-content.d.ts} +0 -0
  45. /package/dist/components/{subscription-card/subscription-card-heading.d.ts → dashboard-card/dashboard-card-heading.d.ts} +0 -0
  46. /package/dist/components/{subscription-card/subscription-card-subtitle.d.ts → dashboard-card/dashboard-card-subtitle.d.ts} +0 -0
@@ -8,6 +8,7 @@ const components_carousel_carouselRoot = require("../carousel/carousel-root.cjs"
8
8
  const components_colorDot_index = require("../color-dot/index.cjs");
9
9
  const utils_breakpointToNumber = require("../../utils/breakpointToNumber.cjs");
10
10
  const tokens_breakpoint_variables = require("../../tokens/breakpoint/variables.cjs");
11
+ const components_text_text = require("../text/text.cjs");
11
12
  const ImageSlider = React.forwardRef(
12
13
  ({
13
14
  sliderRef,
@@ -18,13 +19,38 @@ const ImageSlider = React.forwardRef(
18
19
  onClick = () => void 0,
19
20
  onClickNext,
20
21
  onClickPrev,
21
- onChangeVariant = () => void 0
22
+ onChangeVariant = () => void 0,
23
+ maxDotsToShow = void 0
22
24
  }, forwardRef) => {
23
25
  const [selectedSlide, setSelectedSlide] = React.useState((settings == null ? void 0 : settings.initialSlide) || 0);
24
26
  const rootCarouselClass = `${components_card_card.rootClassName}__carousel`;
25
27
  const classes = clsx([components_card_card.styles[rootCarouselClass]], className);
26
28
  const internalSliderRef = React.useRef(null);
27
29
  const innerSliderRef = sliderRef || internalSliderRef;
30
+ const appendDots = maxDotsToShow ? getAppendDotsMethod(maxDotsToShow, selectedSlide) : void 0;
31
+ const defaultDettings = {
32
+ beforeChange: (_currentSlide, nextSlide) => {
33
+ setSelectedSlide(nextSlide);
34
+ onChangeVariant(variants[nextSlide]);
35
+ },
36
+ customPaging: (index) => {
37
+ const variant = variants[index];
38
+ return /* @__PURE__ */ jsxRuntime.jsx(components_colorDot_index.ColorDot, { color: variant.color, size: "xs", bordered: true, wide: index === selectedSlide });
39
+ },
40
+ swipe: false,
41
+ responsive: [
42
+ {
43
+ breakpoint: utils_breakpointToNumber.breakpointToNumber(tokens_breakpoint_variables.teddyBreakpointMd),
44
+ settings: {
45
+ swipe: true
46
+ }
47
+ }
48
+ ],
49
+ ...settings
50
+ };
51
+ if (maxDotsToShow && appendDots) {
52
+ defaultDettings.appendDots = appendDots;
53
+ }
28
54
  return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: forwardRef, className: classes, children: /* @__PURE__ */ jsxRuntime.jsx(
29
55
  components_carousel_carouselRoot.Carousel,
30
56
  {
@@ -33,30 +59,40 @@ const ImageSlider = React.forwardRef(
33
59
  onClickNext,
34
60
  onClickPrev,
35
61
  onClick,
36
- settings: {
37
- beforeChange: (_currentSlide, nextSlide) => {
38
- setSelectedSlide(nextSlide);
39
- onChangeVariant(variants[nextSlide]);
40
- },
41
- customPaging: (index) => {
42
- const variant = variants[index];
43
- return /* @__PURE__ */ jsxRuntime.jsx(components_colorDot_index.ColorDot, { color: variant.color, size: "xs", bordered: true, wide: index === selectedSlide });
44
- },
45
- swipe: false,
46
- responsive: [
47
- {
48
- breakpoint: utils_breakpointToNumber.breakpointToNumber(tokens_breakpoint_variables.teddyBreakpointMd),
49
- settings: {
50
- swipe: true
51
- }
52
- }
53
- ],
54
- ...settings
55
- },
62
+ settings: defaultDettings,
56
63
  children
57
64
  }
58
65
  ) });
59
66
  }
60
67
  );
68
+ const getAppendDotsMethod = (maxDotsToShow, selectedSlide) => {
69
+ return (dots) => {
70
+ const dotsArray = React.Children.toArray(dots);
71
+ const totalDots = dotsArray.length;
72
+ if (totalDots <= maxDotsToShow) {
73
+ return /* @__PURE__ */ jsxRuntime.jsx("ul", { children: dotsArray });
74
+ }
75
+ let startIndex = 0;
76
+ let endIndex = maxDotsToShow;
77
+ const halfMaxDots = Math.floor(maxDotsToShow / 2);
78
+ if (selectedSlide >= halfMaxDots) {
79
+ startIndex = selectedSlide - halfMaxDots;
80
+ endIndex = startIndex + maxDotsToShow;
81
+ if (endIndex > totalDots) {
82
+ endIndex = totalDots;
83
+ startIndex = totalDots - maxDotsToShow;
84
+ }
85
+ }
86
+ const visibleDots = dotsArray.slice(startIndex, endIndex);
87
+ return /* @__PURE__ */ jsxRuntime.jsxs("ul", { children: [
88
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(components_text_text.Text, { variant: "paragraph-100-medium", style: { visibility: startIndex > 0 ? "visible" : "hidden" }, children: "..." }) }),
89
+ visibleDots,
90
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(components_text_text.Text, { variant: "paragraph-100-medium", style: { visibility: endIndex < totalDots ? "visible" : "hidden" }, children: [
91
+ "+",
92
+ endIndex < totalDots ? totalDots - endIndex : 0
93
+ ] }) })
94
+ ] });
95
+ };
96
+ };
61
97
  ImageSlider.displayName = "ImageSlider";
62
98
  exports.ImageSlider = ImageSlider;
@@ -15,5 +15,6 @@ export interface ImageSliderProps {
15
15
  onClickNext?: () => void;
16
16
  onClickPrev?: () => void;
17
17
  onChangeVariant?: (variant: ImageSliderVariant) => void;
18
+ maxDotsToShow?: number;
18
19
  }
19
20
  export declare const ImageSlider: React.ForwardRefExoticComponent<ImageSliderProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,4 +1,4 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import React__default, { useState, useRef } from "react";
3
3
  import clsx from "clsx";
4
4
  import { s as styles, rootClassName } from "./card.js";
@@ -6,6 +6,7 @@ import { Carousel } from "../carousel/carousel-root.js";
6
6
  import { ColorDot } from "../color-dot/index.js";
7
7
  import { breakpointToNumber } from "../../utils/breakpointToNumber.js";
8
8
  import { teddyBreakpointMd } from "../../tokens/breakpoint/variables.js";
9
+ import { Text } from "../text/text.js";
9
10
  const ImageSlider = React__default.forwardRef(
10
11
  ({
11
12
  sliderRef,
@@ -16,13 +17,38 @@ const ImageSlider = React__default.forwardRef(
16
17
  onClick = () => void 0,
17
18
  onClickNext,
18
19
  onClickPrev,
19
- onChangeVariant = () => void 0
20
+ onChangeVariant = () => void 0,
21
+ maxDotsToShow = void 0
20
22
  }, forwardRef) => {
21
23
  const [selectedSlide, setSelectedSlide] = useState((settings == null ? void 0 : settings.initialSlide) || 0);
22
24
  const rootCarouselClass = `${rootClassName}__carousel`;
23
25
  const classes = clsx([styles[rootCarouselClass]], className);
24
26
  const internalSliderRef = useRef(null);
25
27
  const innerSliderRef = sliderRef || internalSliderRef;
28
+ const appendDots = maxDotsToShow ? getAppendDotsMethod(maxDotsToShow, selectedSlide) : void 0;
29
+ const defaultDettings = {
30
+ beforeChange: (_currentSlide, nextSlide) => {
31
+ setSelectedSlide(nextSlide);
32
+ onChangeVariant(variants[nextSlide]);
33
+ },
34
+ customPaging: (index) => {
35
+ const variant = variants[index];
36
+ return /* @__PURE__ */ jsx(ColorDot, { color: variant.color, size: "xs", bordered: true, wide: index === selectedSlide });
37
+ },
38
+ swipe: false,
39
+ responsive: [
40
+ {
41
+ breakpoint: breakpointToNumber(teddyBreakpointMd),
42
+ settings: {
43
+ swipe: true
44
+ }
45
+ }
46
+ ],
47
+ ...settings
48
+ };
49
+ if (maxDotsToShow && appendDots) {
50
+ defaultDettings.appendDots = appendDots;
51
+ }
26
52
  return /* @__PURE__ */ jsx("div", { ref: forwardRef, className: classes, children: /* @__PURE__ */ jsx(
27
53
  Carousel,
28
54
  {
@@ -31,31 +57,41 @@ const ImageSlider = React__default.forwardRef(
31
57
  onClickNext,
32
58
  onClickPrev,
33
59
  onClick,
34
- settings: {
35
- beforeChange: (_currentSlide, nextSlide) => {
36
- setSelectedSlide(nextSlide);
37
- onChangeVariant(variants[nextSlide]);
38
- },
39
- customPaging: (index) => {
40
- const variant = variants[index];
41
- return /* @__PURE__ */ jsx(ColorDot, { color: variant.color, size: "xs", bordered: true, wide: index === selectedSlide });
42
- },
43
- swipe: false,
44
- responsive: [
45
- {
46
- breakpoint: breakpointToNumber(teddyBreakpointMd),
47
- settings: {
48
- swipe: true
49
- }
50
- }
51
- ],
52
- ...settings
53
- },
60
+ settings: defaultDettings,
54
61
  children
55
62
  }
56
63
  ) });
57
64
  }
58
65
  );
66
+ const getAppendDotsMethod = (maxDotsToShow, selectedSlide) => {
67
+ return (dots) => {
68
+ const dotsArray = React__default.Children.toArray(dots);
69
+ const totalDots = dotsArray.length;
70
+ if (totalDots <= maxDotsToShow) {
71
+ return /* @__PURE__ */ jsx("ul", { children: dotsArray });
72
+ }
73
+ let startIndex = 0;
74
+ let endIndex = maxDotsToShow;
75
+ const halfMaxDots = Math.floor(maxDotsToShow / 2);
76
+ if (selectedSlide >= halfMaxDots) {
77
+ startIndex = selectedSlide - halfMaxDots;
78
+ endIndex = startIndex + maxDotsToShow;
79
+ if (endIndex > totalDots) {
80
+ endIndex = totalDots;
81
+ startIndex = totalDots - maxDotsToShow;
82
+ }
83
+ }
84
+ const visibleDots = dotsArray.slice(startIndex, endIndex);
85
+ return /* @__PURE__ */ jsxs("ul", { children: [
86
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Text, { variant: "paragraph-100-medium", style: { visibility: startIndex > 0 ? "visible" : "hidden" }, children: "..." }) }),
87
+ visibleDots,
88
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Text, { variant: "paragraph-100-medium", style: { visibility: endIndex < totalDots ? "visible" : "hidden" }, children: [
89
+ "+",
90
+ endIndex < totalDots ? totalDots - endIndex : 0
91
+ ] }) })
92
+ ] });
93
+ };
94
+ };
59
95
  ImageSlider.displayName = "ImageSlider";
60
96
  export {
61
97
  ImageSlider
@@ -7,10 +7,10 @@ const Slider = require("react-slick");
7
7
  require("../../assets/sprite.c3af21af-teddy.svg");
8
8
  const components_icon_icon = require("../icon/icon.cjs");
9
9
  const styles = {
10
- "teddy-carousel": "_teddy-carousel_8pf7z_2",
11
- "teddy-carousel__arrow": "_teddy-carousel__arrow_8pf7z_9",
12
- "teddy-carousel__item": "_teddy-carousel__item_8pf7z_21",
13
- "teddy-carousel--sm": "_teddy-carousel--sm_8pf7z_99"
10
+ "teddy-carousel": "_teddy-carousel_xzfbe_2",
11
+ "teddy-carousel__arrow": "_teddy-carousel__arrow_xzfbe_9",
12
+ "teddy-carousel__item": "_teddy-carousel__item_xzfbe_21",
13
+ "teddy-carousel--sm": "_teddy-carousel--sm_xzfbe_102"
14
14
  };
15
15
  const rootClassName = "teddy-carousel";
16
16
  const CustomArrow = ({
@@ -5,10 +5,10 @@ import Slider from "react-slick";
5
5
  import "../../assets/sprite.c3af21af-teddy.svg";
6
6
  import { Icon } from "../icon/icon.js";
7
7
  const styles = {
8
- "teddy-carousel": "_teddy-carousel_8pf7z_2",
9
- "teddy-carousel__arrow": "_teddy-carousel__arrow_8pf7z_9",
10
- "teddy-carousel__item": "_teddy-carousel__item_8pf7z_21",
11
- "teddy-carousel--sm": "_teddy-carousel--sm_8pf7z_99"
8
+ "teddy-carousel": "_teddy-carousel_xzfbe_2",
9
+ "teddy-carousel__arrow": "_teddy-carousel__arrow_xzfbe_9",
10
+ "teddy-carousel__item": "_teddy-carousel__item_xzfbe_21",
11
+ "teddy-carousel--sm": "_teddy-carousel--sm_xzfbe_102"
12
12
  };
13
13
  const rootClassName = "teddy-carousel";
14
14
  const CustomArrow = ({
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const clsx = require("clsx");
6
6
  const components_avatar_index = require("../avatar/index.cjs");
7
- const components_subscriptionCard_subscriptionCardRoot = require("./subscription-card-root.cjs");
7
+ const components_dashboardCard_dashboardCardRoot = require("./dashboard-card-root.cjs");
8
8
  const getDefaultVariant = (variant) => {
9
9
  switch (variant) {
10
10
  case "white":
@@ -15,8 +15,8 @@ const getDefaultVariant = (variant) => {
15
15
  };
16
16
  const Avatar = React.forwardRef(
17
17
  ({ className, ...props }, forwardRef) => {
18
- const classes = clsx([components_subscriptionCard_subscriptionCardRoot.styles[`${components_subscriptionCard_subscriptionCardRoot.rootClassName}__avatar`]], className);
19
- const rootContext = React.useContext(components_subscriptionCard_subscriptionCardRoot.RootContext);
18
+ const classes = clsx([components_dashboardCard_dashboardCardRoot.styles[`${components_dashboardCard_dashboardCardRoot.rootClassName}__avatar`]], className);
19
+ const rootContext = React.useContext(components_dashboardCard_dashboardCardRoot.RootContext);
20
20
  const cardVariant = rootContext == null ? void 0 : rootContext.variant;
21
21
  const variant = props.variant ?? getDefaultVariant(cardVariant);
22
22
  return /* @__PURE__ */ jsxRuntime.jsx(components_avatar_index.Avatar, { ...props, variant, ref: forwardRef, className: classes });
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import React__default from "react";
3
3
  import clsx from "clsx";
4
4
  import { Avatar as Avatar$1 } from "../avatar/index.js";
5
- import { s as styles, rootClassName, RootContext } from "./subscription-card-root.js";
5
+ import { s as styles, rootClassName, RootContext } from "./dashboard-card-root.js";
6
6
  const getDefaultVariant = (variant) => {
7
7
  switch (variant) {
8
8
  case "white":
@@ -3,10 +3,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const clsx = require("clsx");
6
- const components_subscriptionCard_subscriptionCardRoot = require("./subscription-card-root.cjs");
6
+ const components_dashboardCard_dashboardCardRoot = require("./dashboard-card-root.cjs");
7
7
  const Content = React.forwardRef(
8
8
  ({ className, ...props }, forwardRef) => {
9
- const classes = clsx([components_subscriptionCard_subscriptionCardRoot.styles[`${components_subscriptionCard_subscriptionCardRoot.rootClassName}__content`]], className);
9
+ const classes = clsx([components_dashboardCard_dashboardCardRoot.styles[`${components_dashboardCard_dashboardCardRoot.rootClassName}__content`]], className);
10
10
  return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, ref: forwardRef, className: classes });
11
11
  }
12
12
  );
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import React__default from "react";
3
3
  import clsx from "clsx";
4
- import { s as styles, rootClassName } from "./subscription-card-root.js";
4
+ import { s as styles, rootClassName } from "./dashboard-card-root.js";
5
5
  const Content = React__default.forwardRef(
6
6
  ({ className, ...props }, forwardRef) => {
7
7
  const classes = clsx([styles[`${rootClassName}__content`]], className);
@@ -4,10 +4,10 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const clsx = require("clsx");
6
6
  const components_heading_heading = require("../heading/heading.cjs");
7
- const components_subscriptionCard_subscriptionCardRoot = require("./subscription-card-root.cjs");
7
+ const components_dashboardCard_dashboardCardRoot = require("./dashboard-card-root.cjs");
8
8
  const Heading = React.forwardRef(
9
9
  ({ className, as = "h2", ...props }, forwardRef) => {
10
- const classes = clsx([components_subscriptionCard_subscriptionCardRoot.styles[`${components_subscriptionCard_subscriptionCardRoot.rootClassName}__heading`]], className);
10
+ const classes = clsx([components_dashboardCard_dashboardCardRoot.styles[`${components_dashboardCard_dashboardCardRoot.rootClassName}__heading`]], className);
11
11
  const variant = props.variant ?? "subsection-100";
12
12
  return /* @__PURE__ */ jsxRuntime.jsx(
13
13
  components_heading_heading.Heading,
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import React__default from "react";
3
3
  import clsx from "clsx";
4
4
  import { Heading as Heading$1 } from "../heading/heading.js";
5
- import { s as styles, rootClassName } from "./subscription-card-root.js";
5
+ import { s as styles, rootClassName } from "./dashboard-card-root.js";
6
6
  const Heading = React__default.forwardRef(
7
7
  ({ className, as = "h2", ...props }, forwardRef) => {
8
8
  const classes = clsx([styles[`${rootClassName}__heading`]], className);
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ const clsx = require("clsx");
6
+ const components_dashboardCard_dashboardCardRoot = require("./dashboard-card-root.cjs");
7
+ const Illustration = React.forwardRef(
8
+ ({ className, ...props }, forwardRef) => {
9
+ const classes = clsx([components_dashboardCard_dashboardCardRoot.styles[`${components_dashboardCard_dashboardCardRoot.rootClassName}__illustration`]], className);
10
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, ref: forwardRef, className: classes });
11
+ }
12
+ );
13
+ Illustration.displayName = "Illustration";
14
+ exports.Illustration = Illustration;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+
3
+ export type IllustrationProps = React.ComponentPropsWithoutRef<'div'>;
4
+ export declare const Illustration: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,14 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import React__default from "react";
3
+ import clsx from "clsx";
4
+ import { s as styles, rootClassName } from "./dashboard-card-root.js";
5
+ const Illustration = React__default.forwardRef(
6
+ ({ className, ...props }, forwardRef) => {
7
+ const classes = clsx([styles[`${rootClassName}__illustration`]], className);
8
+ return /* @__PURE__ */ jsx("div", { ...props, ref: forwardRef, className: classes });
9
+ }
10
+ );
11
+ Illustration.displayName = "Illustration";
12
+ export {
13
+ Illustration
14
+ };
@@ -7,21 +7,22 @@ const reactSlot = require("@radix-ui/react-slot");
7
7
  require("../../assets/sprite.c3af21af-teddy.svg");
8
8
  const components_icon_icon = require("../icon/icon.cjs");
9
9
  const styles = {
10
- "teddy-subscription-card": "_teddy-subscription-card_77suf_3",
11
- "teddy-subscription-card__content": "_teddy-subscription-card__content_77suf_18",
12
- "teddy-subscription-card--white": "_teddy-subscription-card--white_77suf_21",
13
- "teddy-subscription-card--disabled": "_teddy-subscription-card--disabled_77suf_25",
14
- "teddy-subscription-card--border": "_teddy-subscription-card--border_77suf_34",
15
- "teddy-subscription-card--grey": "_teddy-subscription-card--grey_77suf_46",
16
- "teddy-subscription-card--purple-light": "_teddy-subscription-card--purple-light_77suf_59",
17
- "teddy-subscription-card--beige-light": "_teddy-subscription-card--beige-light_77suf_72",
18
- "teddy-subscription-card__layout": "_teddy-subscription-card__layout_77suf_85",
19
- "teddy-subscription-card__avatar": "_teddy-subscription-card__avatar_77suf_94",
20
- "teddy-subscription-card__heading": "_teddy-subscription-card__heading_77suf_97",
21
- "teddy-subscription-card__subtitle": "_teddy-subscription-card__subtitle_77suf_100",
22
- "teddy-subscription-card__chevron": "_teddy-subscription-card__chevron_77suf_103"
10
+ "teddy-dashboard-card": "_teddy-dashboard-card_hkvyi_3",
11
+ "teddy-dashboard-card__content": "_teddy-dashboard-card__content_hkvyi_18",
12
+ "teddy-dashboard-card--white": "_teddy-dashboard-card--white_hkvyi_21",
13
+ "teddy-dashboard-card--disabled": "_teddy-dashboard-card--disabled_hkvyi_25",
14
+ "teddy-dashboard-card--border": "_teddy-dashboard-card--border_hkvyi_34",
15
+ "teddy-dashboard-card--grey": "_teddy-dashboard-card--grey_hkvyi_46",
16
+ "teddy-dashboard-card--purple-light": "_teddy-dashboard-card--purple-light_hkvyi_59",
17
+ "teddy-dashboard-card--beige-light": "_teddy-dashboard-card--beige-light_hkvyi_72",
18
+ "teddy-dashboard-card__layout": "_teddy-dashboard-card__layout_hkvyi_85",
19
+ "teddy-dashboard-card__avatar": "_teddy-dashboard-card__avatar_hkvyi_95",
20
+ "teddy-dashboard-card__illustration": "_teddy-dashboard-card__illustration_hkvyi_98",
21
+ "teddy-dashboard-card__heading": "_teddy-dashboard-card__heading_hkvyi_101",
22
+ "teddy-dashboard-card__subtitle": "_teddy-dashboard-card__subtitle_hkvyi_105",
23
+ "teddy-dashboard-card__chevron": "_teddy-dashboard-card__chevron_hkvyi_109"
23
24
  };
24
- const rootClassName = "teddy-subscription-card";
25
+ const rootClassName = "teddy-dashboard-card";
25
26
  const RootContext = React.createContext(void 0);
26
27
  const Root = React.forwardRef(
27
28
  ({ className, asChild, variant = "white", bordered = false, children, ...props }, forwardRef) => {
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- export declare const rootClassName = "teddy-subscription-card";
3
+ export declare const rootClassName = "teddy-dashboard-card";
4
4
  type Variant = 'white' | 'grey' | 'purple-light' | 'beige-light';
5
5
  export declare const RootContext: React.Context<{
6
6
  variant?: Variant | undefined;
@@ -5,21 +5,22 @@ import { Slottable, Slot } from "@radix-ui/react-slot";
5
5
  import "../../assets/sprite.c3af21af-teddy.svg";
6
6
  import { Icon } from "../icon/icon.js";
7
7
  const styles = {
8
- "teddy-subscription-card": "_teddy-subscription-card_77suf_3",
9
- "teddy-subscription-card__content": "_teddy-subscription-card__content_77suf_18",
10
- "teddy-subscription-card--white": "_teddy-subscription-card--white_77suf_21",
11
- "teddy-subscription-card--disabled": "_teddy-subscription-card--disabled_77suf_25",
12
- "teddy-subscription-card--border": "_teddy-subscription-card--border_77suf_34",
13
- "teddy-subscription-card--grey": "_teddy-subscription-card--grey_77suf_46",
14
- "teddy-subscription-card--purple-light": "_teddy-subscription-card--purple-light_77suf_59",
15
- "teddy-subscription-card--beige-light": "_teddy-subscription-card--beige-light_77suf_72",
16
- "teddy-subscription-card__layout": "_teddy-subscription-card__layout_77suf_85",
17
- "teddy-subscription-card__avatar": "_teddy-subscription-card__avatar_77suf_94",
18
- "teddy-subscription-card__heading": "_teddy-subscription-card__heading_77suf_97",
19
- "teddy-subscription-card__subtitle": "_teddy-subscription-card__subtitle_77suf_100",
20
- "teddy-subscription-card__chevron": "_teddy-subscription-card__chevron_77suf_103"
8
+ "teddy-dashboard-card": "_teddy-dashboard-card_hkvyi_3",
9
+ "teddy-dashboard-card__content": "_teddy-dashboard-card__content_hkvyi_18",
10
+ "teddy-dashboard-card--white": "_teddy-dashboard-card--white_hkvyi_21",
11
+ "teddy-dashboard-card--disabled": "_teddy-dashboard-card--disabled_hkvyi_25",
12
+ "teddy-dashboard-card--border": "_teddy-dashboard-card--border_hkvyi_34",
13
+ "teddy-dashboard-card--grey": "_teddy-dashboard-card--grey_hkvyi_46",
14
+ "teddy-dashboard-card--purple-light": "_teddy-dashboard-card--purple-light_hkvyi_59",
15
+ "teddy-dashboard-card--beige-light": "_teddy-dashboard-card--beige-light_hkvyi_72",
16
+ "teddy-dashboard-card__layout": "_teddy-dashboard-card__layout_hkvyi_85",
17
+ "teddy-dashboard-card__avatar": "_teddy-dashboard-card__avatar_hkvyi_95",
18
+ "teddy-dashboard-card__illustration": "_teddy-dashboard-card__illustration_hkvyi_98",
19
+ "teddy-dashboard-card__heading": "_teddy-dashboard-card__heading_hkvyi_101",
20
+ "teddy-dashboard-card__subtitle": "_teddy-dashboard-card__subtitle_hkvyi_105",
21
+ "teddy-dashboard-card__chevron": "_teddy-dashboard-card__chevron_hkvyi_109"
21
22
  };
22
- const rootClassName = "teddy-subscription-card";
23
+ const rootClassName = "teddy-dashboard-card";
23
24
  const RootContext = React__default.createContext(void 0);
24
25
  const Root = React__default.forwardRef(
25
26
  ({ className, asChild, variant = "white", bordered = false, children, ...props }, forwardRef) => {
@@ -4,10 +4,10 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const clsx = require("clsx");
6
6
  const components_text_text = require("../text/text.cjs");
7
- const components_subscriptionCard_subscriptionCardRoot = require("./subscription-card-root.cjs");
7
+ const components_dashboardCard_dashboardCardRoot = require("./dashboard-card-root.cjs");
8
8
  const Subtitle = React.forwardRef(
9
9
  ({ className, ...props }, forwardRef) => {
10
- const classes = clsx([components_subscriptionCard_subscriptionCardRoot.styles[`${components_subscriptionCard_subscriptionCardRoot.rootClassName}__subtitle`]], className);
10
+ const classes = clsx([components_dashboardCard_dashboardCardRoot.styles[`${components_dashboardCard_dashboardCardRoot.rootClassName}__subtitle`]], className);
11
11
  const variant = props.variant ?? "additional-100";
12
12
  return /* @__PURE__ */ jsxRuntime.jsx(components_text_text.Text, { faded: true, ...props, variant, ref: forwardRef, className: classes });
13
13
  }
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import React__default from "react";
3
3
  import clsx from "clsx";
4
4
  import { Text } from "../text/text.js";
5
- import { s as styles, rootClassName } from "./subscription-card-root.js";
5
+ import { s as styles, rootClassName } from "./dashboard-card-root.js";
6
6
  const Subtitle = React__default.forwardRef(
7
7
  ({ className, ...props }, forwardRef) => {
8
8
  const classes = clsx([styles[`${rootClassName}__subtitle`]], className);
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const components_dashboardCard_dashboardCardRoot = require("./dashboard-card-root.cjs");
4
+ const components_dashboardCard_dashboardCardHeading = require("./dashboard-card-heading.cjs");
5
+ const components_dashboardCard_dashboardCardSubtitle = require("./dashboard-card-subtitle.cjs");
6
+ const components_dashboardCard_dashboardCardAvatar = require("./dashboard-card-avatar.cjs");
7
+ const components_dashboardCard_dashboardCardContent = require("./dashboard-card-content.cjs");
8
+ const components_dashboardCard_dashboardCardIllustration = require("./dashboard-card-illustration.cjs");
9
+ const DashboardCard = components_dashboardCard_dashboardCardRoot.Root;
10
+ DashboardCard.displayName = "DashboardCard";
11
+ DashboardCard.Avatar = components_dashboardCard_dashboardCardAvatar.Avatar;
12
+ DashboardCard.Avatar.displayName = "DashboardCard.Avatar";
13
+ DashboardCard.Illustration = components_dashboardCard_dashboardCardIllustration.Illustration;
14
+ DashboardCard.Illustration.displayName = "DashboardCard.Illustration";
15
+ DashboardCard.Heading = components_dashboardCard_dashboardCardHeading.Heading;
16
+ DashboardCard.Heading.displayName = "DashboardCard.Heading";
17
+ DashboardCard.Subtitle = components_dashboardCard_dashboardCardSubtitle.Subtitle;
18
+ DashboardCard.Subtitle.displayName = "DashboardCard.Subtitle";
19
+ DashboardCard.Content = components_dashboardCard_dashboardCardContent.Content;
20
+ DashboardCard.Content.displayName = "DashboardCard.Content";
21
+ exports.DashboardCard = DashboardCard;
@@ -0,0 +1,85 @@
1
+ import { RootProps } from './dashboard-card-root';
2
+ import { Heading, HeadingProps } from './dashboard-card-heading';
3
+ import { Subtitle, SubtitleProps } from './dashboard-card-subtitle';
4
+ import { Avatar, AvatarProps } from './dashboard-card-avatar';
5
+ import { Content, ContentProps } from './dashboard-card-content';
6
+ import { Illustration, IllustrationProps } from './dashboard-card-illustration';
7
+
8
+ export type DashboardCardProps = {
9
+ Root: RootProps;
10
+ Avatar: AvatarProps;
11
+ Heading: HeadingProps;
12
+ Subtitle: SubtitleProps;
13
+ Content: ContentProps;
14
+ Illustration: IllustrationProps;
15
+ };
16
+ /**
17
+ * Dashboard card is used as a navigation anchor from MinSide homepage to other pages.
18
+ * The dashboard card by default is an anchor element, but it can be used as a button as well.
19
+ * Use the `asChild` prop to render it as a button. Button onClick event gives you an opportunity
20
+ * to handle your custom logic before the navigation happens. When you need just to navigate,
21
+ * prefer using default - anchor.
22
+ *
23
+ * @component
24
+ *
25
+ * @example
26
+ * <DashboardCard>
27
+ * <DashboardCard.Avatar/>
28
+ * <DashboardCard.Heading/>
29
+ * <DashboardCard.Subtitle/>
30
+ * <DashboardCard.Content/>
31
+ * </DashboardCard>
32
+ */
33
+ declare const DashboardCard: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
34
+ asChild?: boolean | undefined;
35
+ variant?: ("grey" | "white" | "purple-light" | "beige-light") | undefined;
36
+ bordered?: boolean | undefined;
37
+ disabled?: boolean | undefined;
38
+ } & import('react').RefAttributes<HTMLAnchorElement>> & {
39
+ /**
40
+ * Avatar component for the DashboardCard.
41
+ *
42
+ * @component
43
+ *
44
+ * @example
45
+ * <DashboardCard.Avatar/>
46
+ */
47
+ Avatar: typeof Avatar;
48
+ /**
49
+ * Illustration component for the DashboardCard.
50
+ *
51
+ * @component
52
+ *
53
+ * @example
54
+ * <DashboardCard.Illustration/>
55
+ */
56
+ Illustration: typeof Illustration;
57
+ /**
58
+ * Heading component for the DashboardCard.
59
+ *
60
+ * @component
61
+ *
62
+ * @example
63
+ * <DashboardCard.Heading/>
64
+ */
65
+ Heading: typeof Heading;
66
+ /**
67
+ * Subtitle component for the DashboardCard.
68
+ *
69
+ * @component
70
+ *
71
+ * @example
72
+ * <DashboardCard.Subtitle/>
73
+ */
74
+ Subtitle: typeof Subtitle;
75
+ /**
76
+ * Content component for the DashboardCard.
77
+ *
78
+ * @component
79
+ *
80
+ * @example
81
+ * <DashboardCard.Content/>
82
+ */
83
+ Content: typeof Content;
84
+ };
85
+ export { DashboardCard };
@@ -0,0 +1,21 @@
1
+ import { Root } from "./dashboard-card-root.js";
2
+ import { Heading } from "./dashboard-card-heading.js";
3
+ import { Subtitle } from "./dashboard-card-subtitle.js";
4
+ import { Avatar } from "./dashboard-card-avatar.js";
5
+ import { Content } from "./dashboard-card-content.js";
6
+ import { Illustration } from "./dashboard-card-illustration.js";
7
+ const DashboardCard = Root;
8
+ DashboardCard.displayName = "DashboardCard";
9
+ DashboardCard.Avatar = Avatar;
10
+ DashboardCard.Avatar.displayName = "DashboardCard.Avatar";
11
+ DashboardCard.Illustration = Illustration;
12
+ DashboardCard.Illustration.displayName = "DashboardCard.Illustration";
13
+ DashboardCard.Heading = Heading;
14
+ DashboardCard.Heading.displayName = "DashboardCard.Heading";
15
+ DashboardCard.Subtitle = Subtitle;
16
+ DashboardCard.Subtitle.displayName = "DashboardCard.Subtitle";
17
+ DashboardCard.Content = Content;
18
+ DashboardCard.Content.displayName = "DashboardCard.Content";
19
+ export {
20
+ DashboardCard
21
+ };