@telia/teddy 0.0.65 → 0.0.66

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 (40) hide show
  1. package/dist/components/card/card-availability.cjs +34 -0
  2. package/dist/components/card/card-availability.d.ts +10 -0
  3. package/dist/components/card/card-availability.js +34 -0
  4. package/dist/components/card/card-button.cjs +17 -11
  5. package/dist/components/card/card-button.d.ts +4 -2
  6. package/dist/components/card/card-button.js +19 -13
  7. package/dist/components/card/card-color-dots.cjs +18 -0
  8. package/dist/components/card/card-color-dots.d.ts +9 -0
  9. package/dist/components/card/card-color-dots.js +18 -0
  10. package/dist/components/card/card-content.cjs +1 -1
  11. package/dist/components/card/card-content.js +1 -1
  12. package/dist/components/card/card-description.cjs +16 -0
  13. package/dist/components/card/card-description.d.ts +6 -0
  14. package/dist/components/card/card-description.js +16 -0
  15. package/dist/components/card/card-line.cjs +14 -4
  16. package/dist/components/card/card-line.js +14 -4
  17. package/dist/components/card/card-link.cjs +2 -1
  18. package/dist/components/card/card-link.js +2 -1
  19. package/dist/components/card/card-overline.cjs +16 -0
  20. package/dist/components/card/card-overline.d.ts +6 -0
  21. package/dist/components/card/card-overline.js +16 -0
  22. package/dist/components/card/card-price.cjs +34 -0
  23. package/dist/components/card/card-price.d.ts +9 -0
  24. package/dist/components/card/card-price.js +34 -0
  25. package/dist/components/card/card-slot.cjs +20 -14
  26. package/dist/components/card/card-slot.d.ts +3 -1
  27. package/dist/components/card/card-slot.js +21 -15
  28. package/dist/components/card/card.cjs +46 -32
  29. package/dist/components/card/card.d.ts +2 -1
  30. package/dist/components/card/card.js +46 -32
  31. package/dist/components/card/index.cjs +16 -1
  32. package/dist/components/card/index.d.ts +18 -1
  33. package/dist/components/card/index.js +16 -1
  34. package/dist/components/list/index.d.ts +1 -0
  35. package/dist/components/list/list.cjs +16 -22
  36. package/dist/components/list/list.d.ts +2 -0
  37. package/dist/components/list/list.js +16 -22
  38. package/dist/components/notification/notification.d.ts +1 -1
  39. package/dist/style.css +260 -171
  40. package/package.json +1 -1
@@ -0,0 +1,34 @@
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_card_card = require("./card.cjs");
7
+ require("../badge/badge.cjs");
8
+ const components_badge_alertBadge = require("../badge/alert-badge.cjs");
9
+ require("../badge/counter-badge.cjs");
10
+ const components_text_text = require("../text/text.cjs");
11
+ const components_flex_flex = require("../flex/flex.cjs");
12
+ const components_card_cardLine = require("./card-line.cjs");
13
+ const components_box_box = require("../box/box.cjs");
14
+ const Availability = React.forwardRef(
15
+ ({ className, variant = "success", statusText, ...props }, forwardRef) => {
16
+ const rootAvailabilityClass = `${components_card_card.rootClassName}__availability`;
17
+ const classes = clsx(
18
+ [components_card_card.styles[rootAvailabilityClass]],
19
+ {
20
+ [components_card_card.styles[`${rootAvailabilityClass}--${variant}`]]: true
21
+ },
22
+ className
23
+ );
24
+ return /* @__PURE__ */ jsxRuntime.jsxs(components_box_box.Box, { className: classes, children: [
25
+ /* @__PURE__ */ jsxRuntime.jsx(components_card_cardLine.Line, {}),
26
+ /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { ref: forwardRef, direction: "row", justify: "center", align: "center", children: [
27
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: components_card_card.styles[`${rootAvailabilityClass}--badge`], children: /* @__PURE__ */ jsxRuntime.jsx(components_badge_alertBadge.AlertBadge, { variant, ...props }) }),
28
+ /* @__PURE__ */ jsxRuntime.jsx(components_text_text.Text, { children: statusText })
29
+ ] })
30
+ ] });
31
+ }
32
+ );
33
+ Availability.displayName = "Availability";
34
+ exports.Availability = Availability;
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ import { AlertBadge as PrimitiveAlertBadge } from '../badge';
3
+
4
+ export type AvailabilityProps = Partial<React.ComponentPropsWithoutRef<typeof PrimitiveAlertBadge>> & {
5
+ statusText: string;
6
+ };
7
+ /** The stock status for the product */
8
+ export declare const Availability: React.ForwardRefExoticComponent<Partial<Omit<import('../badge').AlertBadgeProps & React.RefAttributes<HTMLSpanElement>, "ref">> & {
9
+ statusText: string;
10
+ } & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,34 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import React__default from "react";
3
+ import clsx from "clsx";
4
+ import { s as styles, rootClassName } from "./card.js";
5
+ import "../badge/badge.js";
6
+ import { AlertBadge } from "../badge/alert-badge.js";
7
+ import "../badge/counter-badge.js";
8
+ import { Text } from "../text/text.js";
9
+ import { Flex } from "../flex/flex.js";
10
+ import { Line } from "./card-line.js";
11
+ import { Box } from "../box/box.js";
12
+ const Availability = React__default.forwardRef(
13
+ ({ className, variant = "success", statusText, ...props }, forwardRef) => {
14
+ const rootAvailabilityClass = `${rootClassName}__availability`;
15
+ const classes = clsx(
16
+ [styles[rootAvailabilityClass]],
17
+ {
18
+ [styles[`${rootAvailabilityClass}--${variant}`]]: true
19
+ },
20
+ className
21
+ );
22
+ return /* @__PURE__ */ jsxs(Box, { className: classes, children: [
23
+ /* @__PURE__ */ jsx(Line, {}),
24
+ /* @__PURE__ */ jsxs(Flex, { ref: forwardRef, direction: "row", justify: "center", align: "center", children: [
25
+ /* @__PURE__ */ jsx("div", { className: styles[`${rootAvailabilityClass}--badge`], children: /* @__PURE__ */ jsx(AlertBadge, { variant, ...props }) }),
26
+ /* @__PURE__ */ jsx(Text, { children: statusText })
27
+ ] })
28
+ ] });
29
+ }
30
+ );
31
+ Availability.displayName = "Availability";
32
+ export {
33
+ Availability
34
+ };
@@ -6,6 +6,8 @@ const clsx = require("clsx");
6
6
  const components_card_card = require("./card.cjs");
7
7
  const utils_composeRefs = require("../../utils/composeRefs.cjs");
8
8
  const components_button_button = require("../button/button.cjs");
9
+ const components_flex_flex = require("../flex/flex.cjs");
10
+ const components_text_text = require("../text/text.cjs");
9
11
  function getButtonVariant(variant) {
10
12
  switch (variant) {
11
13
  case "purple-dark":
@@ -15,8 +17,9 @@ function getButtonVariant(variant) {
15
17
  }
16
18
  }
17
19
  const Button = React.forwardRef(
18
- ({ className, iconOnly, ...props }, forwardRef) => {
20
+ ({ className, iconOnly, disclaimer, ...props }, forwardRef) => {
19
21
  const context = React.useContext(components_card_card.RootContext);
22
+ const wrapperClasses = clsx([components_card_card.styles[`${components_card_card.actionElementIdentifier}-wrapper`]]);
20
23
  const classes = clsx(
21
24
  [components_card_card.styles[`${components_card_card.rootClassName}__button`]],
22
25
  components_card_card.styles[components_card_card.actionElementIdentifier],
@@ -26,16 +29,19 @@ const Button = React.forwardRef(
26
29
  className
27
30
  );
28
31
  const ref = utils_composeRefs.composeRefs(context == null ? void 0 : context.buttonRef, forwardRef);
29
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
30
- components_button_button.Button,
31
- {
32
- ...!iconOnly || !props["aria-label"] ? { iconOnly: false, "aria-label": void 0 } : { iconOnly: true, "aria-label": props["aria-label"] },
33
- ref,
34
- variant: getButtonVariant(context == null ? void 0 : context.variant),
35
- ...props,
36
- className: classes
37
- }
38
- ) });
32
+ return /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { mb: "200", className: wrapperClasses, children: [
33
+ disclaimer && /* @__PURE__ */ jsxRuntime.jsx(components_text_text.Text, { mr: "100", variant: "additional-100", children: disclaimer }),
34
+ /* @__PURE__ */ jsxRuntime.jsx(
35
+ components_button_button.Button,
36
+ {
37
+ ...!iconOnly || !props["aria-label"] ? { iconOnly: false, "aria-label": void 0 } : { iconOnly: true, "aria-label": props["aria-label"] },
38
+ ref,
39
+ variant: getButtonVariant(context == null ? void 0 : context.variant),
40
+ ...props,
41
+ className: classes
42
+ }
43
+ )
44
+ ] });
39
45
  }
40
46
  );
41
47
  Button.displayName = "Button";
@@ -1,9 +1,11 @@
1
1
  import { default as React } from 'react';
2
2
  import { ButtonProps as PrimitiveButtonProps } from '../button';
3
3
 
4
- export type ButtonProps = PrimitiveButtonProps;
4
+ export type ButtonProps = PrimitiveButtonProps & {
5
+ disclaimer?: string;
6
+ };
5
7
  /**
6
8
  * The button element is used when you want a trigger in the card
7
9
  * When this card button element is used, the entire card is clickable
8
10
  */
9
- export declare const Button: React.ForwardRefExoticComponent<PrimitiveButtonProps & React.RefAttributes<HTMLButtonElement>>;
11
+ export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
@@ -1,9 +1,11 @@
1
- import { jsx, Fragment } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import React__default from "react";
3
3
  import clsx from "clsx";
4
- import { RootContext, s as styles, rootClassName, actionElementIdentifier } from "./card.js";
4
+ import { RootContext, s as styles, actionElementIdentifier, rootClassName } from "./card.js";
5
5
  import { composeRefs } from "../../utils/composeRefs.js";
6
6
  import { Button as Button$1 } from "../button/button.js";
7
+ import { Flex } from "../flex/flex.js";
8
+ import { Text } from "../text/text.js";
7
9
  function getButtonVariant(variant) {
8
10
  switch (variant) {
9
11
  case "purple-dark":
@@ -13,8 +15,9 @@ function getButtonVariant(variant) {
13
15
  }
14
16
  }
15
17
  const Button = React__default.forwardRef(
16
- ({ className, iconOnly, ...props }, forwardRef) => {
18
+ ({ className, iconOnly, disclaimer, ...props }, forwardRef) => {
17
19
  const context = React__default.useContext(RootContext);
20
+ const wrapperClasses = clsx([styles[`${actionElementIdentifier}-wrapper`]]);
18
21
  const classes = clsx(
19
22
  [styles[`${rootClassName}__button`]],
20
23
  styles[actionElementIdentifier],
@@ -24,16 +27,19 @@ const Button = React__default.forwardRef(
24
27
  className
25
28
  );
26
29
  const ref = composeRefs(context == null ? void 0 : context.buttonRef, forwardRef);
27
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
28
- Button$1,
29
- {
30
- ...!iconOnly || !props["aria-label"] ? { iconOnly: false, "aria-label": void 0 } : { iconOnly: true, "aria-label": props["aria-label"] },
31
- ref,
32
- variant: getButtonVariant(context == null ? void 0 : context.variant),
33
- ...props,
34
- className: classes
35
- }
36
- ) });
30
+ return /* @__PURE__ */ jsxs(Flex, { mb: "200", className: wrapperClasses, children: [
31
+ disclaimer && /* @__PURE__ */ jsx(Text, { mr: "100", variant: "additional-100", children: disclaimer }),
32
+ /* @__PURE__ */ jsx(
33
+ Button$1,
34
+ {
35
+ ...!iconOnly || !props["aria-label"] ? { iconOnly: false, "aria-label": void 0 } : { iconOnly: true, "aria-label": props["aria-label"] },
36
+ ref,
37
+ variant: getButtonVariant(context == null ? void 0 : context.variant),
38
+ ...props,
39
+ className: classes
40
+ }
41
+ )
42
+ ] });
37
43
  }
38
44
  );
39
45
  Button.displayName = "Button";
@@ -0,0 +1,18 @@
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_card_card = require("./card.cjs");
7
+ const components_flex_flex = require("../flex/flex.cjs");
8
+ const components_colorDot_index = require("../color-dot/index.cjs");
9
+ const components_box_box = require("../box/box.cjs");
10
+ const ColorDots = React.forwardRef(
11
+ ({ className, colors, keyPrefix }, forwardRef) => {
12
+ const rootColorDotsClass = `${components_card_card.rootClassName}__color-dots`;
13
+ const classes = clsx([components_card_card.styles[rootColorDotsClass]], className);
14
+ return /* @__PURE__ */ jsxRuntime.jsx(components_flex_flex.Flex, { mb: "200", ref: forwardRef, direction: "row", justify: "flex-start", align: "center", className: classes, children: colors.map((color) => /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { mr: "150", children: /* @__PURE__ */ jsxRuntime.jsx(components_colorDot_index.ColorDot, { color, size: "xs", bordered: true }) }, `teddy-card-color-dot-${keyPrefix}-${color}`)) });
15
+ }
16
+ );
17
+ ColorDots.displayName = "ColorDots";
18
+ exports.ColorDots = ColorDots;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+
3
+ export type ColorDotsProps = {
4
+ colors: string[];
5
+ className?: string;
6
+ keyPrefix?: string;
7
+ };
8
+ /** The stock status for the product */
9
+ export declare const ColorDots: React.ForwardRefExoticComponent<ColorDotsProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,18 @@
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 "./card.js";
5
+ import { Flex } from "../flex/flex.js";
6
+ import { ColorDot } from "../color-dot/index.js";
7
+ import { Box } from "../box/box.js";
8
+ const ColorDots = React__default.forwardRef(
9
+ ({ className, colors, keyPrefix }, forwardRef) => {
10
+ const rootColorDotsClass = `${rootClassName}__color-dots`;
11
+ const classes = clsx([styles[rootColorDotsClass]], className);
12
+ return /* @__PURE__ */ jsx(Flex, { mb: "200", ref: forwardRef, direction: "row", justify: "flex-start", align: "center", className: classes, children: colors.map((color) => /* @__PURE__ */ jsx(Box, { mr: "150", children: /* @__PURE__ */ jsx(ColorDot, { color, size: "xs", bordered: true }) }, `teddy-card-color-dot-${keyPrefix}-${color}`)) });
13
+ }
14
+ );
15
+ ColorDots.displayName = "ColorDots";
16
+ export {
17
+ ColorDots
18
+ };
@@ -8,7 +8,7 @@ const components_box_box = require("../box/box.cjs");
8
8
  const Content = React.forwardRef(
9
9
  ({ className, ...props }, forwardRef) => {
10
10
  const classes = clsx([components_card_card.styles[`${components_card_card.rootClassName}__content`]], className);
11
- return /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { ...props, ref: forwardRef, className: classes });
11
+ return /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { mb: "200", ...props, ref: forwardRef, className: classes });
12
12
  }
13
13
  );
14
14
  Content.displayName = "Content";
@@ -6,7 +6,7 @@ import { Box } from "../box/box.js";
6
6
  const Content = React__default.forwardRef(
7
7
  ({ className, ...props }, forwardRef) => {
8
8
  const classes = clsx([styles[`${rootClassName}__content`]], className);
9
- return /* @__PURE__ */ jsx(Box, { ...props, ref: forwardRef, className: classes });
9
+ return /* @__PURE__ */ jsx(Box, { mb: "200", ...props, ref: forwardRef, className: classes });
10
10
  }
11
11
  );
12
12
  Content.displayName = "Content";
@@ -0,0 +1,16 @@
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_card_card = require("./card.cjs");
7
+ const components_text_text = require("../text/text.cjs");
8
+ const Description = React.forwardRef(
9
+ ({ className, ...props }, forwardRef) => {
10
+ const classes = clsx([components_card_card.styles[`${components_card_card.rootClassName}__description`]], className);
11
+ const variant = props.variant ?? "paragraph-100";
12
+ return /* @__PURE__ */ jsxRuntime.jsx(components_text_text.Text, { ...props, variant, ref: forwardRef, className: classes });
13
+ }
14
+ );
15
+ Description.displayName = "Description";
16
+ exports.Description = Description;
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ import { Text as PrimitiveText } from '../text';
3
+
4
+ export type DescriptionProps = Partial<React.ComponentPropsWithoutRef<typeof PrimitiveText>>;
5
+ /** The Description for the card */
6
+ export declare const Description: React.ForwardRefExoticComponent<DescriptionProps & React.RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,16 @@
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 "./card.js";
5
+ import { Text } from "../text/text.js";
6
+ const Description = React__default.forwardRef(
7
+ ({ className, ...props }, forwardRef) => {
8
+ const classes = clsx([styles[`${rootClassName}__description`]], className);
9
+ const variant = props.variant ?? "paragraph-100";
10
+ return /* @__PURE__ */ jsx(Text, { ...props, variant, ref: forwardRef, className: classes });
11
+ }
12
+ );
13
+ Description.displayName = "Description";
14
+ export {
15
+ Description
16
+ };
@@ -3,11 +3,21 @@ 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_card_card = require("./card.cjs");
7
6
  const components_box_box = require("../box/box.cjs");
8
- const tokens_spacing_variables = require("../../tokens/spacing/variables.cjs");
7
+ const components_card_card = require("./card.cjs");
9
8
  const Line = React.forwardRef(({ className, ...props }, forwardRef) => {
10
- const classes = clsx([components_card_card.styles[`${components_card_card.rootClassName}__line`]], className);
11
- return /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { width: "100%", p: "0", m: `${tokens_spacing_variables.teddySpacing50} 0`, ...props, ref: forwardRef, className: classes, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("hr", {}) });
9
+ const context = React.useContext(components_card_card.RootContext);
10
+ const layout = context == null ? void 0 : context.layout;
11
+ const classes = clsx(
12
+ [components_card_card.styles[`${components_card_card.rootClassName}__line`]],
13
+ {
14
+ [components_card_card.styles[`${components_card_card.rootClassName}__inset`]]: layout === "product",
15
+ [components_card_card.styles[`${components_card_card.rootClassName}__inset--left`]]: layout === "product",
16
+ [components_card_card.styles[`${components_card_card.rootClassName}__inset--right`]]: layout === "product"
17
+ },
18
+ className
19
+ );
20
+ const width = layout === "product" ? "calc(100% + 2*var(--teddy-spacing-250)" : "100%";
21
+ return /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { width, mt: "50", mb: "50", p: "0", ...props, ref: forwardRef, className: classes, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("hr", {}) });
12
22
  });
13
23
  exports.Line = Line;
@@ -1,12 +1,22 @@
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 "./card.js";
5
4
  import { Box } from "../box/box.js";
6
- import { teddySpacing50 } from "../../tokens/spacing/variables.js";
5
+ import { RootContext, s as styles, rootClassName } from "./card.js";
7
6
  const Line = React__default.forwardRef(({ className, ...props }, forwardRef) => {
8
- const classes = clsx([styles[`${rootClassName}__line`]], className);
9
- return /* @__PURE__ */ jsx(Box, { width: "100%", p: "0", m: `${teddySpacing50} 0`, ...props, ref: forwardRef, className: classes, asChild: true, children: /* @__PURE__ */ jsx("hr", {}) });
7
+ const context = React__default.useContext(RootContext);
8
+ const layout = context == null ? void 0 : context.layout;
9
+ const classes = clsx(
10
+ [styles[`${rootClassName}__line`]],
11
+ {
12
+ [styles[`${rootClassName}__inset`]]: layout === "product",
13
+ [styles[`${rootClassName}__inset--left`]]: layout === "product",
14
+ [styles[`${rootClassName}__inset--right`]]: layout === "product"
15
+ },
16
+ className
17
+ );
18
+ const width = layout === "product" ? "calc(100% + 2*var(--teddy-spacing-250)" : "100%";
19
+ return /* @__PURE__ */ jsx(Box, { width, mt: "50", mb: "50", p: "0", ...props, ref: forwardRef, className: classes, asChild: true, children: /* @__PURE__ */ jsx("hr", {}) });
10
20
  });
11
21
  export {
12
22
  Line
@@ -10,8 +10,9 @@ const Link = React.forwardRef(
10
10
  ({ className, ...props }, forwardRef) => {
11
11
  const context = React.useContext(components_card_card.RootContext);
12
12
  const classes = clsx([components_card_card.styles[`${components_card_card.rootClassName}__link`]], components_card_card.styles[components_card_card.actionElementIdentifier], className);
13
+ const wrapperClasses = clsx([components_card_card.styles[`${components_card_card.actionElementIdentifier}-wrapper`]]);
13
14
  const ref = utils_composeRefs.composeRefs(context == null ? void 0 : context.linkRef, forwardRef);
14
- return /* @__PURE__ */ jsxRuntime.jsx(components_link_link.Link, { ...props, ref, className: classes });
15
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: wrapperClasses, children: /* @__PURE__ */ jsxRuntime.jsx(components_link_link.Link, { ...props, ref, className: classes }) });
15
16
  }
16
17
  );
17
18
  Link.displayName = "Link";
@@ -8,8 +8,9 @@ const Link = React__default.forwardRef(
8
8
  ({ className, ...props }, forwardRef) => {
9
9
  const context = React__default.useContext(RootContext);
10
10
  const classes = clsx([styles[`${rootClassName}__link`]], styles[actionElementIdentifier], className);
11
+ const wrapperClasses = clsx([styles[`${actionElementIdentifier}-wrapper`]]);
11
12
  const ref = composeRefs(context == null ? void 0 : context.linkRef, forwardRef);
12
- return /* @__PURE__ */ jsx(Link$1, { ...props, ref, className: classes });
13
+ return /* @__PURE__ */ jsx("div", { className: wrapperClasses, children: /* @__PURE__ */ jsx(Link$1, { ...props, ref, className: classes }) });
13
14
  }
14
15
  );
15
16
  Link.displayName = "Link";
@@ -0,0 +1,16 @@
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_card_card = require("./card.cjs");
7
+ const components_text_text = require("../text/text.cjs");
8
+ const Overline = React.forwardRef(
9
+ ({ className, ...props }, forwardRef) => {
10
+ const classes = clsx([components_card_card.styles[`${components_card_card.rootClassName}__overline`]], className);
11
+ const variant = props.variant ?? "overline-100";
12
+ return /* @__PURE__ */ jsxRuntime.jsx(components_text_text.Text, { ...props, variant, ref: forwardRef, className: classes });
13
+ }
14
+ );
15
+ Overline.displayName = "Overline";
16
+ exports.Overline = Overline;
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ import { Text as PrimitiveText } from '../text';
3
+
4
+ export type OverlineProps = Partial<React.ComponentPropsWithoutRef<typeof PrimitiveText>>;
5
+ /** The Overline for the card */
6
+ export declare const Overline: React.ForwardRefExoticComponent<OverlineProps & React.RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,16 @@
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 "./card.js";
5
+ import { Text } from "../text/text.js";
6
+ const Overline = React__default.forwardRef(
7
+ ({ className, ...props }, forwardRef) => {
8
+ const classes = clsx([styles[`${rootClassName}__overline`]], className);
9
+ const variant = props.variant ?? "overline-100";
10
+ return /* @__PURE__ */ jsx(Text, { ...props, variant, ref: forwardRef, className: classes });
11
+ }
12
+ );
13
+ Overline.displayName = "Overline";
14
+ export {
15
+ Overline
16
+ };
@@ -0,0 +1,34 @@
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_card_card = require("./card.cjs");
7
+ const components_flex_flex = require("../flex/flex.cjs");
8
+ const components_text_text = require("../text/text.cjs");
9
+ const Price = React.forwardRef(
10
+ ({ className, pricePrefix, priceText }, forwardRef) => {
11
+ const rootColorDotsClass = `${components_card_card.rootClassName}__price`;
12
+ const classes = clsx([components_card_card.styles[rootColorDotsClass]], className);
13
+ return /* @__PURE__ */ jsxRuntime.jsx(
14
+ components_flex_flex.Flex,
15
+ {
16
+ flexGrow: "1",
17
+ mt: "auto",
18
+ mb: "100",
19
+ ref: forwardRef,
20
+ className: classes,
21
+ direction: "row",
22
+ align: "baseline",
23
+ asChild: true,
24
+ children: /* @__PURE__ */ jsxRuntime.jsxs(components_text_text.Text, { variant: "paragraph-100", as: "p", children: [
25
+ pricePrefix,
26
+ " ",
27
+ /* @__PURE__ */ jsxRuntime.jsx(components_text_text.Text, { variant: "paragraph-100-bold", as: "span", ml: "50", children: priceText })
28
+ ] })
29
+ }
30
+ );
31
+ }
32
+ );
33
+ Price.displayName = "Price";
34
+ exports.Price = Price;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+
3
+ export type PriceProps = {
4
+ pricePrefix: string;
5
+ priceText: string;
6
+ className?: string;
7
+ };
8
+ /** The stock status for the product */
9
+ export declare const Price: React.ForwardRefExoticComponent<PriceProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,34 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import React__default from "react";
3
+ import clsx from "clsx";
4
+ import { s as styles, rootClassName } from "./card.js";
5
+ import { Flex } from "../flex/flex.js";
6
+ import { Text } from "../text/text.js";
7
+ const Price = React__default.forwardRef(
8
+ ({ className, pricePrefix, priceText }, forwardRef) => {
9
+ const rootColorDotsClass = `${rootClassName}__price`;
10
+ const classes = clsx([styles[rootColorDotsClass]], className);
11
+ return /* @__PURE__ */ jsx(
12
+ Flex,
13
+ {
14
+ flexGrow: "1",
15
+ mt: "auto",
16
+ mb: "100",
17
+ ref: forwardRef,
18
+ className: classes,
19
+ direction: "row",
20
+ align: "baseline",
21
+ asChild: true,
22
+ children: /* @__PURE__ */ jsxs(Text, { variant: "paragraph-100", as: "p", children: [
23
+ pricePrefix,
24
+ " ",
25
+ /* @__PURE__ */ jsx(Text, { variant: "paragraph-100-bold", as: "span", ml: "50", children: priceText })
26
+ ] })
27
+ }
28
+ );
29
+ }
30
+ );
31
+ Price.displayName = "Price";
32
+ export {
33
+ Price
34
+ };
@@ -5,8 +5,26 @@ const React = require("react");
5
5
  const clsx = require("clsx");
6
6
  const components_card_card = require("./card.cjs");
7
7
  const components_box_box = require("../box/box.cjs");
8
+ const getOffsets = (layout, align) => {
9
+ switch (layout) {
10
+ case "product":
11
+ return {
12
+ top: "200",
13
+ right: "200"
14
+ };
15
+ default:
16
+ return {
17
+ top: (align == null ? void 0 : align.includes("top")) ? "0" : void 0,
18
+ bottom: (align == null ? void 0 : align.includes("bottom")) ? "0" : void 0,
19
+ left: (align == null ? void 0 : align.includes("left")) ? "200" : (align == null ? void 0 : align.includes("right")) ? void 0 : "50%",
20
+ right: (align == null ? void 0 : align.includes("right")) ? "200" : void 0
21
+ };
22
+ }
23
+ };
8
24
  const Slot = React.forwardRef(
9
- ({ className, align, ...props }, forwardRef) => {
25
+ ({ className, align = "top-right", ...props }, forwardRef) => {
26
+ const context = React.useContext(components_card_card.RootContext);
27
+ const layout = context == null ? void 0 : context.layout;
10
28
  const classes = clsx(
11
29
  [
12
30
  components_card_card.styles[`${components_card_card.rootClassName}__slot`],
@@ -17,19 +35,7 @@ const Slot = React.forwardRef(
17
35
  ],
18
36
  className
19
37
  );
20
- return /* @__PURE__ */ jsxRuntime.jsx(
21
- components_box_box.Box,
22
- {
23
- position: "absolute",
24
- top: (align == null ? void 0 : align.includes("top")) ? "0" : void 0,
25
- bottom: (align == null ? void 0 : align.includes("bottom")) ? "0" : void 0,
26
- left: (align == null ? void 0 : align.includes("left")) ? "200" : (align == null ? void 0 : align.includes("right")) ? void 0 : "50%",
27
- right: (align == null ? void 0 : align.includes("right")) ? "200" : void 0,
28
- ...props,
29
- ref: forwardRef,
30
- className: classes
31
- }
32
- );
38
+ return /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { position: "absolute", ...getOffsets(layout, align), ...props, ref: forwardRef, className: classes });
33
39
  }
34
40
  );
35
41
  Slot.displayName = "Slot";
@@ -1,8 +1,10 @@
1
1
  import { default as React } from 'react';
2
2
  import { Box } from '../box';
3
3
 
4
+ type Align = 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
4
5
  export type SlotProps = React.ComponentPropsWithoutRef<typeof Box> & {
5
- align?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
6
+ align?: Align;
6
7
  };
7
8
  /** An element that has absolute position, used to place content on the edge of the card */
8
9
  export declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLDivElement>>;
10
+ export {};
@@ -1,10 +1,28 @@
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 "./card.js";
4
+ import { RootContext, s as styles, rootClassName } from "./card.js";
5
5
  import { Box } from "../box/box.js";
6
+ const getOffsets = (layout, align) => {
7
+ switch (layout) {
8
+ case "product":
9
+ return {
10
+ top: "200",
11
+ right: "200"
12
+ };
13
+ default:
14
+ return {
15
+ top: (align == null ? void 0 : align.includes("top")) ? "0" : void 0,
16
+ bottom: (align == null ? void 0 : align.includes("bottom")) ? "0" : void 0,
17
+ left: (align == null ? void 0 : align.includes("left")) ? "200" : (align == null ? void 0 : align.includes("right")) ? void 0 : "50%",
18
+ right: (align == null ? void 0 : align.includes("right")) ? "200" : void 0
19
+ };
20
+ }
21
+ };
6
22
  const Slot = React__default.forwardRef(
7
- ({ className, align, ...props }, forwardRef) => {
23
+ ({ className, align = "top-right", ...props }, forwardRef) => {
24
+ const context = React__default.useContext(RootContext);
25
+ const layout = context == null ? void 0 : context.layout;
8
26
  const classes = clsx(
9
27
  [
10
28
  styles[`${rootClassName}__slot`],
@@ -15,19 +33,7 @@ const Slot = React__default.forwardRef(
15
33
  ],
16
34
  className
17
35
  );
18
- return /* @__PURE__ */ jsx(
19
- Box,
20
- {
21
- position: "absolute",
22
- top: (align == null ? void 0 : align.includes("top")) ? "0" : void 0,
23
- bottom: (align == null ? void 0 : align.includes("bottom")) ? "0" : void 0,
24
- left: (align == null ? void 0 : align.includes("left")) ? "200" : (align == null ? void 0 : align.includes("right")) ? void 0 : "50%",
25
- right: (align == null ? void 0 : align.includes("right")) ? "200" : void 0,
26
- ...props,
27
- ref: forwardRef,
28
- className: classes
29
- }
30
- );
36
+ return /* @__PURE__ */ jsx(Box, { position: "absolute", ...getOffsets(layout, align), ...props, ref: forwardRef, className: classes });
31
37
  }
32
38
  );
33
39
  Slot.displayName = "Slot";