@telia/teddy 0.0.15 → 0.0.16

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 (116) hide show
  1. package/dist/components/accordion/accordion.d.ts +2 -1
  2. package/dist/components/accordion/accordion.js +90 -24
  3. package/dist/components/accordion/index.js +2 -2
  4. package/dist/components/badge/badge.js +40 -24
  5. package/dist/components/badge/index.js +2 -2
  6. package/dist/components/box/box.js +14 -10
  7. package/dist/components/box/index.js +2 -2
  8. package/dist/components/button/button.js +60 -52
  9. package/dist/components/button/index.js +2 -2
  10. package/dist/components/card/card.d.ts +29 -3
  11. package/dist/components/card/card.js +202 -25
  12. package/dist/components/card/index.js +2 -2
  13. package/dist/components/field-error-text/field-error-text.js +21 -19
  14. package/dist/components/field-error-text/index.js +2 -2
  15. package/dist/components/flex/flex.js +15 -12
  16. package/dist/components/flex/index.js +2 -2
  17. package/dist/components/grid/grid.js +15 -12
  18. package/dist/components/grid/index.js +2 -2
  19. package/dist/components/heading/heading.js +22 -19
  20. package/dist/components/heading/index.js +2 -2
  21. package/dist/components/helper-text/helper-text.js +14 -13
  22. package/dist/components/helper-text/index.js +2 -2
  23. package/dist/components/icon/icon.js +16 -14
  24. package/dist/components/icon/index.js +4 -4
  25. package/dist/components/index.js +51 -46
  26. package/dist/components/input/index.js +3 -3
  27. package/dist/components/input/input.js +79 -66
  28. package/dist/components/label/index.js +2 -2
  29. package/dist/components/label/label.js +17 -23
  30. package/dist/components/link/index.js +2 -2
  31. package/dist/components/link/link.js +20 -19
  32. package/dist/components/modal/index.js +2 -2
  33. package/dist/components/modal/modal.js +173 -14
  34. package/dist/components/navigation-menu/index.js +2 -2
  35. package/dist/components/navigation-menu/navigation-menu.js +391 -8
  36. package/dist/components/notification/index.js +2 -2
  37. package/dist/components/notification/notification.d.ts +8 -7
  38. package/dist/components/notification/notification.js +96 -24
  39. package/dist/components/radio-group/index.js +2 -2
  40. package/dist/components/radio-group/radio-group.js +91 -8
  41. package/dist/components/spinner/index.js +2 -2
  42. package/dist/components/spinner/spinner.js +36 -29
  43. package/dist/components/text/index.js +2 -2
  44. package/dist/components/text/text.js +18 -17
  45. package/dist/components/text-field/index.js +2 -2
  46. package/dist/components/text-field/text-field.js +110 -90
  47. package/dist/components/text-spacing/index.js +2 -2
  48. package/dist/components/text-spacing/text-spacing.js +14 -12
  49. package/dist/components/toggle/index.js +2 -2
  50. package/dist/components/toggle/toggle.d.ts +1 -1
  51. package/dist/components/toggle/toggle.js +84 -23
  52. package/dist/components/visually-hidden/index.js +2 -2
  53. package/dist/components/visually-hidden/visually-hidden.js +17 -15
  54. package/dist/icons/category.js +2 -2
  55. package/dist/icons/name.js +2 -2
  56. package/dist/main.js +359 -61
  57. package/dist/style.css +3402 -0
  58. package/dist/tokens/border/variables.js +18 -10
  59. package/dist/tokens/breakpoint/variables.js +8 -5
  60. package/dist/tokens/color/variables.js +452 -227
  61. package/dist/tokens/index.d.ts +7 -7
  62. package/dist/tokens/index.js +308 -14
  63. package/dist/tokens/motion/variables.js +22 -12
  64. package/dist/tokens/shadow/variables.js +8 -5
  65. package/dist/tokens/spacing/variables.js +46 -24
  66. package/dist/tokens/typography/variables.js +48 -25
  67. package/dist/utils/action.js +10 -7
  68. package/dist/utils/composeEventHandlers.js +7 -5
  69. package/dist/utils/composeRefs.js +13 -9
  70. package/dist/utils/layout/align.js +5 -4
  71. package/dist/utils/layout/flex.js +25 -18
  72. package/dist/utils/layout/gap.js +7 -6
  73. package/dist/utils/layout/grid.js +31 -24
  74. package/dist/utils/layout/height.js +12 -11
  75. package/dist/utils/layout/index.js +76 -59
  76. package/dist/utils/layout/inset.js +10 -9
  77. package/dist/utils/layout/justify.js +6 -5
  78. package/dist/utils/layout/margin.js +10 -9
  79. package/dist/utils/layout/padding.js +10 -9
  80. package/dist/utils/layout/position.js +6 -5
  81. package/dist/utils/layout/util.js +7 -6
  82. package/dist/utils/layout/width.js +8 -7
  83. package/package.json +21 -14
  84. package/dist/assets/badge.css +0 -1
  85. package/dist/assets/button.css +0 -1
  86. package/dist/assets/field-error-text.css +0 -1
  87. package/dist/assets/flex.css +0 -1
  88. package/dist/assets/grid.css +0 -1
  89. package/dist/assets/heading.css +0 -1
  90. package/dist/assets/helper-text.css +0 -1
  91. package/dist/assets/icon.css +0 -1
  92. package/dist/assets/input.css +0 -1
  93. package/dist/assets/label.css +0 -1
  94. package/dist/assets/link.css +0 -1
  95. package/dist/assets/main.css +0 -1
  96. package/dist/assets/navigation-menu.css +0 -1
  97. package/dist/assets/radio-group.css +0 -1
  98. package/dist/assets/spinner.css +0 -1
  99. package/dist/assets/text-field.css +0 -1
  100. package/dist/assets/text-spacing.css +0 -1
  101. package/dist/assets/text.css +0 -1
  102. package/dist/assets/visually-hidden.css +0 -1
  103. package/dist/badge-Cnug5TzH.js +0 -1855
  104. package/dist/clsx-DB4S2d7J.js +0 -22
  105. package/dist/index-DM5e-Whg.js +0 -43
  106. package/dist/index-DpfSJps6.js +0 -75
  107. package/dist/index-FPIZOCcD.js +0 -305
  108. package/dist/navigation-menu-DKuyW8zE.js +0 -1036
  109. package/dist/radio-group-B--zT3OL.js +0 -440
  110. package/dist/variables-BKiPmtHY.js +0 -458
  111. package/dist/variables-BkY5b0io.js +0 -14
  112. package/dist/variables-Bq0YUbLS.js +0 -14
  113. package/dist/variables-CDK515QX.js +0 -52
  114. package/dist/variables-CMRTN8qo.js +0 -28
  115. package/dist/variables-Dmoh9YtD.js +0 -54
  116. package/dist/variables-IczXZ5CN.js +0 -24
@@ -1,27 +1,204 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import "../../clsx-DB4S2d7J.js";
4
- import { C as y } from "../../badge-Cnug5TzH.js";
5
- import "../../radio-group-B--zT3OL.js";
6
- import "../box/box.js";
7
- import "../flex/flex.js";
8
- import "../grid/grid.js";
9
- import "../../navigation-menu-DKuyW8zE.js";
10
- import "../link/link.js";
11
- import "../button/button.js";
12
- import "../field-error-text/field-error-text.js";
13
- import "../helper-text/helper-text.js";
14
- import "../../assets/4bbd022cee9b0f06.svg";
15
- import "../input/input.js";
16
- import "../label/label.js";
17
- import "../spinner/spinner.js";
18
- import "../text/text.js";
19
- import "../text-field/text-field.js";
20
- import "../heading/heading.js";
21
- import "../visually-hidden/visually-hidden.js";
22
- import "../text-spacing/text-spacing.js";
23
- import "../../utils/composeRefs.js";
24
- import "../../utils/composeEventHandlers.js";
1
+ import { jsx, Fragment } from "react/jsx-runtime";
2
+ import React__default from "react";
3
+ import clsx from "clsx";
4
+ import { composeRefs } from "../../utils/composeRefs.js";
5
+ import { composeEventHandlers } from "../../utils/composeEventHandlers.js";
6
+ import { Flex } from "../flex/flex.js";
7
+ import { Box } from "../box/box.js";
8
+ import { Heading as Heading$1 } from "../heading/heading.js";
9
+ import { Button as Button$1 } from "../button/button.js";
10
+ import { Link as Link$1 } from "../link/link.js";
11
+ import { TextSpacing } from "../text-spacing/text-spacing.js";
12
+ const styles = {
13
+ "teddy-card": "_teddy-card_16ne3_3",
14
+ "teddy-card__slot": "_teddy-card__slot_16ne3_13",
15
+ "teddy-card__slot--bottom": "_teddy-card__slot--bottom_16ne3_16",
16
+ "teddy-card__slot--center": "_teddy-card__slot--center_16ne3_19",
17
+ "teddy-card__action": "_teddy-card__action_16ne3_40",
18
+ "teddy-card__action--disabled": "_teddy-card__action--disabled_16ne3_40",
19
+ "teddy-card--border": "_teddy-card--border_16ne3_46",
20
+ "teddy-card--purple-light": "_teddy-card--purple-light_16ne3_49",
21
+ "teddy-card--purple-dark": "_teddy-card--purple-dark_16ne3_63",
22
+ "teddy-card--white": "_teddy-card--white_16ne3_82",
23
+ "teddy-card--gray": "_teddy-card--gray_16ne3_96",
24
+ "teddy-card--beige": "_teddy-card--beige_16ne3_110",
25
+ "teddy-card__image--as-background": "_teddy-card__image--as-background_16ne3_124",
26
+ "teddy-card__heading": "_teddy-card__heading_16ne3_127",
27
+ "teddy-card--background-image": "_teddy-card--background-image_16ne3_130",
28
+ "teddy-card__image": "_teddy-card__image_16ne3_124",
29
+ "teddy-card__image--inset-top": "_teddy-card__image--inset-top_16ne3_145",
30
+ "teddy-card__image--inset-bottom": "_teddy-card__image--inset-bottom_16ne3_148",
31
+ "teddy-card__image--inset-left": "_teddy-card__image--inset-left_16ne3_151",
32
+ "teddy-card__image--inset-right": "_teddy-card__image--inset-right_16ne3_154"
33
+ };
34
+ const rootClassName = "teddy-card";
35
+ const actionElementIdentifier = `${rootClassName}__action`;
36
+ const variantOptions = ["purple-light", "purple-dark", "gray", "white", "beige"];
37
+ const RootContext = React__default.createContext(void 0);
38
+ const Root = React__default.forwardRef(
39
+ ({ className, children, backgroundImageSrc, variant, bordered, ...props }, forwardRef) => {
40
+ const buttonRef = React__default.useRef(null);
41
+ const linkRef = React__default.useRef(null);
42
+ const classes = clsx(
43
+ [styles[`${rootClassName}`]],
44
+ {
45
+ [styles[`${rootClassName}--${variant}`]]: variant,
46
+ [styles[`${rootClassName}--border`]]: bordered,
47
+ [styles[`${rootClassName}--background-image`]]: backgroundImageSrc
48
+ },
49
+ className
50
+ );
51
+ return /* @__PURE__ */ jsx(RootContext.Provider, { value: { buttonRef, linkRef, variant }, children: /* @__PURE__ */ jsx(TextSpacing, { asChild: true, children: /* @__PURE__ */ jsx(
52
+ Flex,
53
+ {
54
+ direction: "column",
55
+ ...props,
56
+ className: classes,
57
+ style: backgroundImageSrc ? { background: `url(${backgroundImageSrc})`, ...props.style } : props.style,
58
+ onClick: composeEventHandlers(props.onClick, (e) => {
59
+ var _a;
60
+ if (e.isDefaultPrevented())
61
+ return;
62
+ if (linkRef.current)
63
+ return linkRef.current.click();
64
+ (_a = buttonRef.current) == null ? void 0 : _a.click();
65
+ }),
66
+ ref: forwardRef,
67
+ children
68
+ }
69
+ ) }) });
70
+ }
71
+ );
72
+ Root.displayName = "Card";
73
+ const Heading = React__default.forwardRef(
74
+ ({ className, variant = "title-200", as = "h2", ...props }, forwardRef) => {
75
+ const classes = clsx([styles[`${rootClassName}__heading`]], className);
76
+ return /* @__PURE__ */ jsx(
77
+ Heading$1,
78
+ {
79
+ ...props,
80
+ ...!props.asChild ? { as, asChild: false } : { as: void 0, asChild: true },
81
+ variant,
82
+ ref: forwardRef,
83
+ className: classes
84
+ }
85
+ );
86
+ }
87
+ );
88
+ Heading.displayName = "Card.Heading";
89
+ const Content = React__default.forwardRef(({ className, ...props }, forwardRef) => {
90
+ const classes = clsx([styles[`${rootClassName}__content`]], className);
91
+ return /* @__PURE__ */ jsx("div", { ...props, ref: forwardRef, className: classes });
92
+ });
93
+ Content.displayName = "Card.Content";
94
+ const Slot = React__default.forwardRef(({ className, align, ...props }, forwardRef) => {
95
+ const classes = clsx(
96
+ [
97
+ styles[`${rootClassName}__slot`],
98
+ {
99
+ [styles[`${rootClassName}__slot--center`]]: align === "top" || align === "bottom",
100
+ [styles[`${rootClassName}__slot--bottom`]]: align == null ? void 0 : align.includes("bottom")
101
+ }
102
+ ],
103
+ className
104
+ );
105
+ return /* @__PURE__ */ jsx(
106
+ Box,
107
+ {
108
+ position: "absolute",
109
+ top: (align == null ? void 0 : align.includes("top")) ? "0" : void 0,
110
+ bottom: (align == null ? void 0 : align.includes("bottom")) ? "0" : void 0,
111
+ left: (align == null ? void 0 : align.includes("left")) ? "200" : (align == null ? void 0 : align.includes("right")) ? void 0 : "50%",
112
+ right: (align == null ? void 0 : align.includes("right")) ? "200" : void 0,
113
+ ...props,
114
+ ref: forwardRef,
115
+ className: classes
116
+ }
117
+ );
118
+ });
119
+ const insetOptions = [
120
+ "top",
121
+ "bottom",
122
+ "left",
123
+ "right",
124
+ "all",
125
+ "top-right-left",
126
+ "bottom-left-right",
127
+ "top-left",
128
+ "top-right",
129
+ "bottom-left",
130
+ "bottom-right",
131
+ "top-bottom",
132
+ "left-right"
133
+ ];
134
+ const Image = React__default.forwardRef(({ className, ...props }, forwardRef) => {
135
+ var _a, _b, _c, _d, _e, _f, _g, _h;
136
+ const classes = clsx(
137
+ [styles[`${rootClassName}__image`]],
138
+ {
139
+ [styles[`${rootClassName}__image--inset-top`]]: ((_a = props.inset) == null ? void 0 : _a.includes("top")) || ((_b = props.inset) == null ? void 0 : _b.includes("all")),
140
+ [styles[`${rootClassName}__image--inset-bottom`]]: ((_c = props.inset) == null ? void 0 : _c.includes("bottom")) || ((_d = props.inset) == null ? void 0 : _d.includes("all")),
141
+ [styles[`${rootClassName}__image--inset-left`]]: ((_e = props.inset) == null ? void 0 : _e.includes("left")) || ((_f = props.inset) == null ? void 0 : _f.includes("all")),
142
+ [styles[`${rootClassName}__image--inset-right`]]: ((_g = props.inset) == null ? void 0 : _g.includes("right")) || ((_h = props.inset) == null ? void 0 : _h.includes("all"))
143
+ },
144
+ className
145
+ );
146
+ return /* @__PURE__ */ jsx("img", { ...props, ref: forwardRef, className: classes });
147
+ });
148
+ Image.displayName = "Card.Image";
149
+ function getButtonVariant(variant) {
150
+ switch (variant) {
151
+ case "purple-dark":
152
+ return "primary-negative";
153
+ default:
154
+ return "primary";
155
+ }
156
+ }
157
+ const Button = React__default.forwardRef(
158
+ ({ className, iconOnly = false, ...props }, forwardRef) => {
159
+ const context = React__default.useContext(RootContext);
160
+ const classes = clsx(
161
+ [styles[`${rootClassName}__button`]],
162
+ styles[actionElementIdentifier],
163
+ {
164
+ [styles[`${actionElementIdentifier}--disabled`]]: props.disabled
165
+ },
166
+ className
167
+ );
168
+ const ref = composeRefs(context == null ? void 0 : context.buttonRef, forwardRef);
169
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
170
+ Button$1,
171
+ {
172
+ ...!iconOnly || !props["aria-label"] ? { iconOnly: false, "aria-label": void 0 } : { iconOnly: true, "aria-label": props["aria-label"] },
173
+ ref,
174
+ variant: getButtonVariant(context == null ? void 0 : context.variant),
175
+ ...props,
176
+ className: classes
177
+ }
178
+ ) });
179
+ }
180
+ );
181
+ Button.displayName = "Card.Button";
182
+ const Link = React__default.forwardRef(
183
+ ({ className, ...props }, forwardRef) => {
184
+ const context = React__default.useContext(RootContext);
185
+ const classes = clsx([styles[`${rootClassName}__link`]], styles[actionElementIdentifier], className);
186
+ const ref = composeRefs(context == null ? void 0 : context.linkRef, forwardRef);
187
+ return /* @__PURE__ */ jsx(Link$1, { ...props, ref, className: classes });
188
+ }
189
+ );
190
+ Link.displayName = "Card.Link";
191
+ const Card = Object.assign(Root, {
192
+ Root,
193
+ Heading,
194
+ Content,
195
+ Image,
196
+ Button,
197
+ Link,
198
+ Slot,
199
+ variantOptions,
200
+ insetOptions
201
+ });
25
202
  export {
26
- y as Card
203
+ Card
27
204
  };
@@ -1,4 +1,4 @@
1
- import { C as o } from "../../badge-Cnug5TzH.js";
1
+ import { Card } from "./card.js";
2
2
  export {
3
- o as Card
3
+ Card
4
4
  };
@@ -1,28 +1,30 @@
1
- import '../../assets/field-error-text.css';
2
- import { jsx as s } from "react/jsx-runtime";
3
- import { c as i } from "../../clsx-DB4S2d7J.js";
4
- import a from "react";
1
+ import { jsx } from "react/jsx-runtime";
2
+ import clsx from "clsx";
3
+ import React__default from "react";
5
4
  import "../../assets/4bbd022cee9b0f06.svg";
6
- import { Icon as n } from "../icon/icon.js";
7
- import { Text as m } from "../text/text.js";
8
- const c = {
5
+ import { Icon } from "../icon/icon.js";
6
+ import { Text } from "../text/text.js";
7
+ const styles = {
9
8
  "teddy-field-error-text": "_teddy-field-error-text_1735t_1",
10
9
  "teddy-field-error-text__indicator": "_teddy-field-error-text__indicator_1735t_12"
11
- }, l = "teddy-field-error-text", _ = a.forwardRef(
12
- ({ className: r, name: t = "error-filled", ...e }, o) => {
13
- const d = i([c[`${l}__indicator`]], r);
14
- return /* @__PURE__ */ s(n, { ...e, name: t, ref: o, className: d });
10
+ };
11
+ const rootClassName = "teddy-field-error-text";
12
+ const FieldErrorTextIndicator = React__default.forwardRef(
13
+ ({ className, name = "error-filled", ...props }, forwardRef) => {
14
+ const classes = clsx([styles[`${rootClassName}__indicator`]], className);
15
+ return /* @__PURE__ */ jsx(Icon, { ...props, name, ref: forwardRef, className: classes });
15
16
  }
16
- ), f = a.forwardRef(
17
- ({ className: r, children: t, ...e }, o) => {
18
- const d = i([c[l]], r);
19
- return /* @__PURE__ */ s(m, { ...e, ref: o, className: d, children: t });
17
+ );
18
+ const FieldErrorTextRoot = React__default.forwardRef(
19
+ ({ className, children, ...props }, forwardRef) => {
20
+ const classes = clsx([styles[rootClassName]], className);
21
+ return /* @__PURE__ */ jsx(Text, { ...props, ref: forwardRef, className: classes, children });
20
22
  }
21
23
  );
22
- f.displayName = "FieldErrorText";
23
- const N = Object.assign(f, {
24
- Indicator: _
24
+ FieldErrorTextRoot.displayName = "FieldErrorText";
25
+ const FieldErrorText = Object.assign(FieldErrorTextRoot, {
26
+ Indicator: FieldErrorTextIndicator
25
27
  });
26
28
  export {
27
- N as FieldErrorText
29
+ FieldErrorText
28
30
  };
@@ -1,4 +1,4 @@
1
- import { FieldErrorText as o } from "./field-error-text.js";
1
+ import { FieldErrorText } from "./field-error-text.js";
2
2
  export {
3
- o as FieldErrorText
3
+ FieldErrorText
4
4
  };
@@ -1,16 +1,19 @@
1
- import '../../assets/flex.css';
2
- import { jsx as a } from "react/jsx-runtime";
3
- import m from "react";
4
- import { c as l } from "../../clsx-DB4S2d7J.js";
5
- import { $ as f } from "../../index-DpfSJps6.js";
6
- import { extractProps as d } from "../../utils/layout/index.js";
7
- const p = {
1
+ import { jsx } from "react/jsx-runtime";
2
+ import React__default from "react";
3
+ import clsx from "clsx";
4
+ import { Slot } from "@radix-ui/react-slot";
5
+ import { extractProps } from "../../utils/layout/index.js";
6
+ const styles = {
8
7
  "teddy-flex": "_teddy-flex_19teo_2"
9
- }, x = "teddy-flex", i = m.forwardRef((e, o) => {
10
- const { className: s, asChild: t, ...r } = d(e), c = l([p[`${x}`]], s);
11
- return /* @__PURE__ */ a(t ? f : "div", { ...r, ref: o, className: c });
8
+ };
9
+ const rootClassName = "teddy-flex";
10
+ const Flex = React__default.forwardRef((props, forwardRef) => {
11
+ const { className, asChild, ...rest } = extractProps(props);
12
+ const classes = clsx([styles[`${rootClassName}`]], className);
13
+ const Comp = asChild ? Slot : "div";
14
+ return /* @__PURE__ */ jsx(Comp, { ...rest, ref: forwardRef, className: classes });
12
15
  });
13
- i.displayName = "Flex";
16
+ Flex.displayName = "Flex";
14
17
  export {
15
- i as Flex
18
+ Flex
16
19
  };
@@ -1,4 +1,4 @@
1
- import { Flex as r } from "./flex.js";
1
+ import { Flex } from "./flex.js";
2
2
  export {
3
- r as Flex
3
+ Flex
4
4
  };
@@ -1,16 +1,19 @@
1
- import '../../assets/grid.css';
2
- import { jsx as m } from "react/jsx-runtime";
3
- import i from "react";
4
- import { c as p } from "../../clsx-DB4S2d7J.js";
5
- import { $ as f } from "../../index-DpfSJps6.js";
6
- import { extractProps as l } from "../../utils/layout/index.js";
7
- const n = {
1
+ import { jsx } from "react/jsx-runtime";
2
+ import React__default from "react";
3
+ import clsx from "clsx";
4
+ import { Slot } from "@radix-ui/react-slot";
5
+ import { extractProps } from "../../utils/layout/index.js";
6
+ const styles = {
8
7
  "teddy-grid": "_teddy-grid_1dv1t_2"
9
- }, x = "teddy-grid", y = i.forwardRef((r, s) => {
10
- const { className: o, as: t = "div", asChild: e, ...a } = l(r), c = e ? f : t, d = p([n[`${x}`]], o);
11
- return /* @__PURE__ */ m(c, { ...a, ref: s, className: d });
8
+ };
9
+ const rootClassName = "teddy-grid";
10
+ const Grid = React__default.forwardRef((args, forwardRef) => {
11
+ const { className, as: Tag = "div", asChild, ...props } = extractProps(args);
12
+ const Comp = asChild ? Slot : Tag;
13
+ const classes = clsx([styles[`${rootClassName}`]], className);
14
+ return /* @__PURE__ */ jsx(Comp, { ...props, ref: forwardRef, className: classes });
12
15
  });
13
- y.displayName = "Grid";
16
+ Grid.displayName = "Grid";
14
17
  export {
15
- y as Grid
18
+ Grid
16
19
  };
@@ -1,4 +1,4 @@
1
- import { Grid as d } from "./grid.js";
1
+ import { Grid } from "./grid.js";
2
2
  export {
3
- d as Grid
3
+ Grid
4
4
  };
@@ -1,10 +1,9 @@
1
- import '../../assets/heading.css';
2
- import { jsx as s } from "react/jsx-runtime";
3
- import { $ as c } from "../../index-DpfSJps6.js";
4
- import { c as p } from "../../clsx-DB4S2d7J.js";
5
- import m from "react";
6
- import { extractProps as f } from "../../utils/layout/index.js";
7
- const e = {
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+ import clsx from "clsx";
4
+ import React__default from "react";
5
+ import { extractProps } from "../../utils/layout/index.js";
6
+ const styles = {
8
7
  "teddy-heading": "_teddy-heading_r8os0_2",
9
8
  "teddy-heading--hyphens": "_teddy-heading--hyphens_r8os0_9",
10
9
  "teddy-heading--subsection-100": "_teddy-heading--subsection-100_r8os0_12",
@@ -19,7 +18,9 @@ const e = {
19
18
  "teddy-heading--display-50": "_teddy-heading--display-50_r8os0_66",
20
19
  "teddy-heading--display-100": "_teddy-heading--display-100_r8os0_72",
21
20
  "teddy-heading--display-200": "_teddy-heading--display-200_r8os0_78"
22
- }, d = "teddy-heading", $ = [
21
+ };
22
+ const rootClassName = "teddy-heading";
23
+ const headingVariants = [
23
24
  "title-100",
24
25
  "title-200",
25
26
  "title-300",
@@ -32,21 +33,23 @@ const e = {
32
33
  "display-50",
33
34
  "display-100",
34
35
  "display-200"
35
- ], n = m.forwardRef((l, y) => {
36
- const { className: _, children: t, variant: i, asChild: o, enableHyphenation: h, as: a, ...r } = f(l), g = p(
37
- e[`${d}`],
36
+ ];
37
+ const Root = React__default.forwardRef((props, forwardRef) => {
38
+ const { className, children, variant, asChild, enableHyphenation, as: Tag, ...rest } = extractProps(props);
39
+ const classes = clsx(
40
+ styles[`${rootClassName}`],
38
41
  {
39
- [e[`${d}--${i}`]]: i,
40
- [e[`${d}--hyphens`]]: h
42
+ [styles[`${rootClassName}--${variant}`]]: variant,
43
+ [styles[`${rootClassName}--hyphens`]]: enableHyphenation
41
44
  },
42
- _
45
+ className
43
46
  );
44
- return /* @__PURE__ */ s(c, { ...r, ref: y, className: g, children: o ? t : a ? /* @__PURE__ */ s(a, { children: t }) : null });
47
+ return /* @__PURE__ */ jsx(Slot, { ...rest, ref: forwardRef, className: classes, children: asChild ? children : Tag ? /* @__PURE__ */ jsx(Tag, { children }) : null });
45
48
  });
46
- n.displayName = "Heading";
47
- const R = Object.assign(n, {
48
- headingVariants: $
49
+ Root.displayName = "Heading";
50
+ const Heading = Object.assign(Root, {
51
+ headingVariants
49
52
  });
50
53
  export {
51
- R as Heading
54
+ Heading
52
55
  };
@@ -1,4 +1,4 @@
1
- import { Heading as r } from "./heading.js";
1
+ import { Heading } from "./heading.js";
2
2
  export {
3
- r as Heading
3
+ Heading
4
4
  };
@@ -1,20 +1,21 @@
1
- import '../../assets/helper-text.css';
2
- import { jsx as l } from "react/jsx-runtime";
3
- import { c as a } from "../../clsx-DB4S2d7J.js";
4
- import o from "react";
5
- const p = {
1
+ import { jsx } from "react/jsx-runtime";
2
+ import clsx from "clsx";
3
+ import React__default from "react";
4
+ const styles = {
6
5
  "teddy-helper-text": "_teddy-helper-text_6xdzb_1",
7
6
  "teddy-helper-text--disabled": "_teddy-helper-text--disabled_6xdzb_9"
8
- }, x = "teddy-helper-text", c = o.forwardRef(
9
- ({ className: e, children: t, ...r }, s) => {
10
- const d = a(
11
- [p[x]],
12
- e
7
+ };
8
+ const rootClassName = "teddy-helper-text";
9
+ const HelperText = React__default.forwardRef(
10
+ ({ className, children, ...props }, forwardRef) => {
11
+ const classes = clsx(
12
+ [styles[rootClassName]],
13
+ className
13
14
  );
14
- return /* @__PURE__ */ l("span", { ...r, ref: s, className: d, children: t });
15
+ return /* @__PURE__ */ jsx("span", { ...props, ref: forwardRef, className: classes, children });
15
16
  }
16
17
  );
17
- c.displayName = "HelperText";
18
+ HelperText.displayName = "HelperText";
18
19
  export {
19
- c as HelperText
20
+ HelperText
20
21
  };
@@ -1,4 +1,4 @@
1
- import { HelperText as o } from "./helper-text.js";
1
+ import { HelperText } from "./helper-text.js";
2
2
  export {
3
- o as HelperText
3
+ HelperText
4
4
  };
@@ -1,8 +1,7 @@
1
- import '../../assets/icon.css';
2
- import { jsxs as y, jsx as d } from "react/jsx-runtime";
3
- import f from "../../assets/4bbd022cee9b0f06.svg";
4
- import { c as s } from "../../clsx-DB4S2d7J.js";
5
- const t = {
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import iconsHref from "../../assets/4bbd022cee9b0f06.svg";
3
+ import clsx from "clsx";
4
+ const styles = {
6
5
  "teddy-icon": "_teddy-icon_1rwgf_2",
7
6
  "teddy-icon--font": "_teddy-icon--font_1rwgf_7",
8
7
  "teddy-icon--xxs": "_teddy-icon--xxs_1rwgf_11",
@@ -12,16 +11,19 @@ const t = {
12
11
  "teddy-icon--lg": "_teddy-icon--lg_1rwgf_27",
13
12
  "teddy-icon--xl": "_teddy-icon--xl_1rwgf_31",
14
13
  "teddy-icon-with-children": "_teddy-icon-with-children_1rwgf_35"
15
- }, o = "teddy-icon", l = `${o}-with-children`;
16
- function g({ name: n, size: c = "font", className: e, children: i, ...r }) {
17
- if (i)
18
- return /* @__PURE__ */ y("span", { className: s([t[l]]), children: [
19
- /* @__PURE__ */ d(g, { name: n, size: c, className: e, ...r }),
20
- i
14
+ };
15
+ const rootClassName = "teddy-icon";
16
+ const rootClassNameWithChildren = `${rootClassName}-with-children`;
17
+ function Icon({ name, size = "font", className, children, ...props }) {
18
+ if (children) {
19
+ return /* @__PURE__ */ jsxs("span", { className: clsx([styles[rootClassNameWithChildren]]), children: [
20
+ /* @__PURE__ */ jsx(Icon, { name, size, className, ...props }),
21
+ children
21
22
  ] });
22
- const _ = s([t[o], t[`${o}--${c}`]], e);
23
- return /* @__PURE__ */ d("svg", { ...r, className: _, children: /* @__PURE__ */ d("use", { href: `${f}#${n}` }) });
23
+ }
24
+ const classes = clsx([styles[rootClassName], styles[`${rootClassName}--${size}`]], className);
25
+ return /* @__PURE__ */ jsx("svg", { ...props, className: classes, children: /* @__PURE__ */ jsx("use", { href: `${iconsHref}#${name}` }) });
24
26
  }
25
27
  export {
26
- g as Icon
28
+ Icon
27
29
  };
@@ -1,6 +1,6 @@
1
- import { default as e } from "../../assets/4bbd022cee9b0f06.svg";
2
- import { Icon as t } from "./icon.js";
1
+ import { default as default2 } from "../../assets/4bbd022cee9b0f06.svg";
2
+ import { Icon } from "./icon.js";
3
3
  export {
4
- t as Icon,
5
- e as iconsHref
4
+ Icon,
5
+ default2 as iconsHref
6
6
  };