@telia/teddy 0.0.9 → 0.0.11

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 (73) hide show
  1. package/dist/assets/badge.css +1 -1
  2. package/dist/assets/heading.css +1 -1
  3. package/dist/assets/main.css +1 -1
  4. package/dist/assets/navigation-menu.css +1 -1
  5. package/dist/assets/radio-group.css +1 -1
  6. package/dist/badge-DscsRVHR.js +1825 -0
  7. package/dist/components/accordion/accordion.d.ts +1 -1
  8. package/dist/components/accordion/accordion.js +3 -3
  9. package/dist/components/accordion/index.js +1 -1
  10. package/dist/components/badge/badge.js +3 -3
  11. package/dist/components/badge/index.js +1 -1
  12. package/dist/components/box/box.js +8 -8
  13. package/dist/components/button/button.d.ts +2 -1
  14. package/dist/components/button/button.js +59 -60
  15. package/dist/components/card/card.js +3 -3
  16. package/dist/components/card/index.js +1 -1
  17. package/dist/components/flex/flex.js +1 -1
  18. package/dist/components/grid/grid.js +6 -6
  19. package/dist/components/heading/heading.d.ts +9 -36
  20. package/dist/components/heading/heading.js +36 -37
  21. package/dist/components/index.d.ts +2 -0
  22. package/dist/components/index.js +35 -33
  23. package/dist/components/modal/index.d.ts +2 -0
  24. package/dist/components/modal/index.js +4 -0
  25. package/dist/components/modal/modal.d.ts +76 -0
  26. package/dist/components/modal/modal.js +28 -0
  27. package/dist/components/navigation-menu/index.js +1 -1
  28. package/dist/components/navigation-menu/navigation-menu.d.ts +2 -0
  29. package/dist/components/navigation-menu/navigation-menu.js +8 -1032
  30. package/dist/components/notification/index.d.ts +2 -0
  31. package/dist/components/notification/index.js +4 -0
  32. package/dist/components/notification/notification.d.ts +59 -0
  33. package/dist/components/notification/notification.js +27 -0
  34. package/dist/components/radio-group/index.js +1 -1
  35. package/dist/components/radio-group/radio-group.js +1 -1
  36. package/dist/components/text-field/text-field.js +15 -15
  37. package/dist/components/toggle/index.js +1 -1
  38. package/dist/components/toggle/toggle.d.ts +1 -1
  39. package/dist/components/toggle/toggle.js +3 -3
  40. package/dist/{index-0Eg2mucA.js → index-FPIZOCcD.js} +80 -80
  41. package/dist/main.js +51 -49
  42. package/dist/navigation-menu-DKuyW8zE.js +1036 -0
  43. package/dist/{radio-group-BR5SMJXJ.js → radio-group-B--zT3OL.js} +8 -8
  44. package/dist/tokens/breakpoint/variables.json.d.ts +11 -0
  45. package/dist/utils/component-props-as.d.ts +5 -0
  46. package/dist/utils/component-props-as.js +1 -0
  47. package/dist/utils/layout/align.d.ts +46 -0
  48. package/dist/utils/layout/align.js +31 -0
  49. package/dist/utils/layout/flex.d.ts +294 -0
  50. package/dist/utils/layout/flex.js +60 -0
  51. package/dist/utils/layout/gap.d.ts +340 -0
  52. package/dist/utils/layout/gap.js +21 -0
  53. package/dist/utils/layout/grid.d.ts +313 -0
  54. package/dist/utils/layout/grid.js +116 -0
  55. package/dist/utils/layout/height.d.ts +118 -0
  56. package/dist/utils/layout/height.js +50 -0
  57. package/dist/utils/layout/index.d.ts +70 -0
  58. package/dist/utils/layout/index.js +71 -0
  59. package/dist/utils/layout/justify.d.ts +39 -0
  60. package/dist/utils/layout/justify.js +16 -0
  61. package/dist/utils/layout/margin.d.ts +478 -0
  62. package/dist/utils/layout/margin.js +32 -0
  63. package/dist/utils/layout/padding.d.ts +478 -0
  64. package/dist/utils/layout/padding.js +32 -0
  65. package/dist/utils/layout/util.d.ts +82 -0
  66. package/dist/utils/layout/util.js +32 -0
  67. package/dist/utils/layout/width.d.ts +69 -0
  68. package/dist/utils/layout/width.js +25 -0
  69. package/package.json +5 -1
  70. package/dist/badge-9vHb0-Jo.js +0 -721
  71. package/dist/tokens/spacing/variables.json.d.ts +0 -34
  72. package/dist/utils/layout.d.ts +0 -150
  73. package/dist/utils/layout.js +0 -221
@@ -36,7 +36,7 @@ type ContentProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Con
36
36
  * -----------------------------------------------------------------------------------------------*/
37
37
  type TitleProps = Omit<HeadingProps['Root'], 'variant'> & {
38
38
  variant?: HeadingProps['Root']['variant'];
39
- } & (HeadingProps['AsChildProps'] | HeadingProps['H1Props'] | HeadingProps['H2Props'] | HeadingProps['H3Props'] | HeadingProps['H4Props'] | HeadingProps['H5Props'] | HeadingProps['H6Props']);
39
+ } & (HeadingProps['AsChildProps'] | HeadingProps['AsProps']);
40
40
  declare const Accordion: React.ForwardRefExoticComponent<RootProps & React.RefAttributes<HTMLDivElement>> & {
41
41
  Trigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
42
42
  hideIndicator?: boolean | undefined;
@@ -1,12 +1,12 @@
1
1
  import "react/jsx-runtime";
2
2
  import "../../clsx-DB4S2d7J.js";
3
3
  import "react";
4
- import { A as y } from "../../badge-9vHb0-Jo.js";
5
- import "../../radio-group-BR5SMJXJ.js";
4
+ import { A as y } from "../../badge-DscsRVHR.js";
5
+ import "../../radio-group-B--zT3OL.js";
6
6
  import "../box/box.js";
7
7
  import "../flex/flex.js";
8
8
  import "../grid/grid.js";
9
- import "../navigation-menu/navigation-menu.js";
9
+ import "../../navigation-menu-DKuyW8zE.js";
10
10
  import "../link/link.js";
11
11
  import "../button/button.js";
12
12
  import "../field-error-text/field-error-text.js";
@@ -1,4 +1,4 @@
1
- import { A as c } from "../../badge-9vHb0-Jo.js";
1
+ import { A as c } from "../../badge-DscsRVHR.js";
2
2
  export {
3
3
  c as Accordion
4
4
  };
@@ -1,13 +1,13 @@
1
1
  import "react/jsx-runtime";
2
2
  import "../../clsx-DB4S2d7J.js";
3
3
  import "react";
4
- import { B as y } from "../../badge-9vHb0-Jo.js";
4
+ import { B as y } from "../../badge-DscsRVHR.js";
5
5
  import "../../index-DpfSJps6.js";
6
- import "../../radio-group-BR5SMJXJ.js";
6
+ import "../../radio-group-B--zT3OL.js";
7
7
  import "../box/box.js";
8
8
  import "../flex/flex.js";
9
9
  import "../grid/grid.js";
10
- import "../navigation-menu/navigation-menu.js";
10
+ import "../../navigation-menu-DKuyW8zE.js";
11
11
  import "../link/link.js";
12
12
  import "../button/button.js";
13
13
  import "../field-error-text/field-error-text.js";
@@ -1,4 +1,4 @@
1
- import { B as o } from "../../badge-9vHb0-Jo.js";
1
+ import { B as o } from "../../badge-DscsRVHR.js";
2
2
  export {
3
3
  o as Badge
4
4
  };
@@ -1,11 +1,11 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import m from "react";
3
- import { c as p } from "../../clsx-DB4S2d7J.js";
4
- import { extractPropsResponsiveLayout as f } from "../../utils/layout.js";
5
- import { $ as i } from "../../index-DpfSJps6.js";
6
- const l = {}, d = "teddy-box", n = m.forwardRef((o, s) => {
7
- const { className: t, asChild: e, ...r } = f(o), c = p([l[`${d}`]], t);
8
- return /* @__PURE__ */ a(e ? i : "div", { ...r, ref: s, className: c });
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import p from "react";
3
+ import { c as f } from "../../clsx-DB4S2d7J.js";
4
+ import { extractProps as l } from "../../utils/layout/index.js";
5
+ import { $ as d } from "../../index-DpfSJps6.js";
6
+ const i = {}, x = "teddy-box", n = p.forwardRef((o, s) => {
7
+ const { className: t, asChild: r, style: e, ...c } = l(o), a = f([i[`${x}`]], t);
8
+ return /* @__PURE__ */ m(r ? d : "div", { ...c, style: e, ref: s, className: a });
9
9
  });
10
10
  n.displayName = "Box";
11
11
  export {
@@ -1,9 +1,10 @@
1
+ import { ChildrenLayoutProps } from '../../utils/layout';
1
2
  import * as React from 'react';
2
3
  declare const variants: readonly ["primary", "secondary", "destructive", "tertiary-purple", "text", "expressive", "primary-negative", "secondary-negative", "destructive-negative", "tertiary-purple-negative", "text-negative", "expressive-negative"];
3
4
  export type Variant = (typeof variants)[number];
4
5
  declare const sizes: readonly ["sm", "md", "lg"];
5
6
  export type Size = (typeof sizes)[number];
6
- type ButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'aria-label'> & {
7
+ type ButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'aria-label'> & ChildrenLayoutProps & {
7
8
  asChild?: boolean;
8
9
  loading?: boolean;
9
10
  fullWidth?: boolean;
@@ -1,10 +1,11 @@
1
1
  import '../../assets/button.css';
2
- import { jsxs as x, jsx as r } from "react/jsx-runtime";
3
- import { a as $, $ as A } from "../../index-DpfSJps6.js";
2
+ import { jsxs as $, jsx as _ } from "react/jsx-runtime";
3
+ import { a as A, $ as C } from "../../index-DpfSJps6.js";
4
4
  import { c as I } from "../../clsx-DB4S2d7J.js";
5
- import * as w from "react";
6
- import { Spinner as N } from "../spinner/spinner.js";
7
- const j = "_fadeInAnimation_1biph_1", C = "_scaleInAnimation_1biph_1", t = {
5
+ import * as N from "react";
6
+ import { Spinner as w } from "../spinner/spinner.js";
7
+ import { extractProps as j } from "../../utils/layout/index.js";
8
+ const k = "_fadeInAnimation_1biph_1", R = "_scaleInAnimation_1biph_1", t = {
8
9
  "teddy-button": "_teddy-button_1biph_18",
9
10
  "teddy-button--sm": "_teddy-button--sm_1biph_53",
10
11
  "teddy-button--icon-only": "_teddy-button--icon-only_1biph_56",
@@ -26,10 +27,10 @@ const j = "_fadeInAnimation_1biph_1", C = "_scaleInAnimation_1biph_1", t = {
26
27
  "teddy-button--text-negative": "_teddy-button--text-negative_1biph_195",
27
28
  "teddy-button--text": "_teddy-button--text_1biph_195",
28
29
  "teddy-button__loading": "_teddy-button__loading_1biph_242",
29
- fadeInAnimation: j,
30
+ fadeInAnimation: k,
30
31
  "teddy-button__spinner": "_teddy-button__spinner_1biph_253",
31
- scaleInAnimation: C
32
- }, e = "teddy-button", R = [
32
+ scaleInAnimation: R
33
+ }, e = "teddy-button", W = [
33
34
  "primary",
34
35
  "secondary",
35
36
  "destructive",
@@ -42,65 +43,63 @@ const j = "_fadeInAnimation_1biph_1", C = "_scaleInAnimation_1biph_1", t = {
42
43
  "tertiary-purple-negative",
43
44
  "text-negative",
44
45
  "expressive-negative"
45
- ], s = w.forwardRef(
46
- ({
47
- className: y,
46
+ ], b = N.forwardRef((y, p) => {
47
+ const {
48
+ className: u,
48
49
  variant: d,
49
50
  size: o = "md",
50
- iconOnly: u,
51
- fullWidth: p,
51
+ iconOnly: c,
52
+ fullWidth: l,
52
53
  disabled: i = !1,
53
54
  loading: n = !1,
54
- asChild: c = !1,
55
+ asChild: v = !1,
55
56
  onClick: a,
56
- children: l,
57
- ..._
58
- }, v) => {
59
- const m = c ? A : "button", h = I(
60
- [t[e], t[`${e}--${d}`], t[`${e}--${o}`]],
61
- {
62
- [t[`${e}--icon-only`]]: u,
63
- [t[`${e}--negative`]]: d.endsWith("negative"),
64
- [t[`${e}--full-width`]]: p,
65
- [t[`${e}--disabled`]]: i || n
66
- },
67
- y
68
- );
69
- function g(b) {
70
- if (i || n) {
71
- b.preventDefault();
72
- return;
73
- }
74
- a && a(b);
57
+ children: m,
58
+ ...s
59
+ } = j(y), h = v ? C : "button", g = I(
60
+ [t[e], t[`${e}--${d}`], t[`${e}--${o}`]],
61
+ {
62
+ [t[`${e}--icon-only`]]: c,
63
+ [t[`${e}--negative`]]: d.endsWith("negative"),
64
+ [t[`${e}--full-width`]]: l,
65
+ [t[`${e}--disabled`]]: i || n
66
+ },
67
+ u
68
+ );
69
+ function f(r) {
70
+ if (i || n) {
71
+ r.preventDefault();
72
+ return;
75
73
  }
76
- const f = () => d.endsWith("negative") ? "negative-disabled" : "disabled";
77
- return /* @__PURE__ */ x(
78
- m,
79
- {
80
- className: h,
81
- "aria-disabled": _["aria-disabled"] || i || n,
82
- onClick: g,
83
- ref: v,
84
- ..._,
85
- children: [
86
- /* @__PURE__ */ r($, { children: l }),
87
- n && /* @__PURE__ */ r(
88
- N,
89
- {
90
- size: o === "lg" ? "xs" : "xxs",
91
- variant: f(),
92
- className: t[`${e}__spinner`]
93
- }
94
- )
95
- ]
96
- }
97
- );
74
+ a && a(r);
98
75
  }
99
- );
100
- s.displayName = "Button";
101
- const D = Object.assign(s, {
102
- variants: R
76
+ const x = () => d.endsWith("negative") ? "negative-disabled" : "disabled";
77
+ return /* @__PURE__ */ $(
78
+ h,
79
+ {
80
+ className: g,
81
+ "aria-disabled": s["aria-disabled"] || i || n,
82
+ onClick: f,
83
+ ref: p,
84
+ ...s,
85
+ children: [
86
+ /* @__PURE__ */ _(A, { children: m }),
87
+ n && /* @__PURE__ */ _(
88
+ w,
89
+ {
90
+ size: o === "lg" ? "xs" : "xxs",
91
+ variant: x(),
92
+ className: t[`${e}__spinner`]
93
+ }
94
+ )
95
+ ]
96
+ }
97
+ );
98
+ });
99
+ b.displayName = "Button";
100
+ const P = Object.assign(b, {
101
+ variants: W
103
102
  });
104
103
  export {
105
- D as Button
104
+ P as Button
106
105
  };
@@ -1,12 +1,12 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "../../clsx-DB4S2d7J.js";
4
- import { C as y } from "../../badge-9vHb0-Jo.js";
5
- import "../../radio-group-BR5SMJXJ.js";
4
+ import { C as y } from "../../badge-DscsRVHR.js";
5
+ import "../../radio-group-B--zT3OL.js";
6
6
  import "../box/box.js";
7
7
  import "../flex/flex.js";
8
8
  import "../grid/grid.js";
9
- import "../navigation-menu/navigation-menu.js";
9
+ import "../../navigation-menu-DKuyW8zE.js";
10
10
  import "../link/link.js";
11
11
  import "../button/button.js";
12
12
  import "../field-error-text/field-error-text.js";
@@ -1,4 +1,4 @@
1
- import { C as o } from "../../badge-9vHb0-Jo.js";
1
+ import { C as o } from "../../badge-DscsRVHR.js";
2
2
  export {
3
3
  o as Card
4
4
  };
@@ -3,7 +3,7 @@ import { jsx as a } from "react/jsx-runtime";
3
3
  import m from "react";
4
4
  import { c as l } from "../../clsx-DB4S2d7J.js";
5
5
  import { $ as f } from "../../index-DpfSJps6.js";
6
- import { extractPropsResponsiveLayout as d } from "../../utils/layout.js";
6
+ import { extractProps as d } from "../../utils/layout/index.js";
7
7
  const p = {
8
8
  "teddy-flex": "_teddy-flex_19teo_2"
9
9
  }, x = "teddy-flex", i = m.forwardRef((e, o) => {
@@ -3,14 +3,14 @@ import { jsx as m } from "react/jsx-runtime";
3
3
  import i from "react";
4
4
  import { c as p } from "../../clsx-DB4S2d7J.js";
5
5
  import { $ as f } from "../../index-DpfSJps6.js";
6
- import { extractPropsResponsiveLayout as l } from "../../utils/layout.js";
6
+ import { extractProps as l } from "../../utils/layout/index.js";
7
7
  const n = {
8
8
  "teddy-grid": "_teddy-grid_1dv1t_2"
9
- }, y = "teddy-grid", x = i.forwardRef((s, o) => {
10
- const { className: r, as: t = "div", asChild: e, ...a } = l(s), c = e ? f : t, d = p([n[`${y}`]], r);
11
- return /* @__PURE__ */ m(c, { ...a, ref: o, className: d });
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 });
12
12
  });
13
- x.displayName = "Grid";
13
+ y.displayName = "Grid";
14
14
  export {
15
- x as Grid
15
+ y as Grid
16
16
  };
@@ -1,41 +1,19 @@
1
+ import { ChildrenLayoutProps } from '../../utils/layout';
1
2
  import { default as React } from 'react';
2
3
 
3
4
  /** -------------------------------------------------------------------------------------------------
4
5
  * Heading
5
6
  * -----------------------------------------------------------------------------------------------*/
6
7
  declare const headingVariants: readonly ["title-100", "title-200", "title-300", "title-400", "title-500", "title-600", "title-700", "subsection-100", "display-25", "display-50", "display-100", "display-200"];
7
- type AsChildProps = {
8
- /**
9
- * If `true`, the children element will be cloned and used instead of the heading element.
10
- */
8
+ type HeadingVariant = (typeof headingVariants)[number];
9
+ type HeadingAsChildProps = {
11
10
  asChild: true;
12
11
  as?: never;
13
12
  } & React.ComponentPropsWithoutRef<'h1'>;
14
- type H1Props = {
15
- as: 'h1';
13
+ type HeadingAsProps = {
14
+ as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
16
15
  asChild?: false;
17
16
  } & React.ComponentPropsWithoutRef<'h1'>;
18
- type H2Props = {
19
- as: 'h2';
20
- asChild?: false;
21
- } & React.ComponentPropsWithoutRef<'h2'>;
22
- type H3Props = {
23
- as: 'h3';
24
- asChild?: false;
25
- } & React.ComponentPropsWithoutRef<'h3'>;
26
- type H4Props = {
27
- as: 'h4';
28
- asChild?: false;
29
- } & React.ComponentPropsWithoutRef<'h4'>;
30
- type H5Props = {
31
- as: 'h5';
32
- asChild?: false;
33
- } & React.ComponentPropsWithoutRef<'h5'>;
34
- type H6Props = {
35
- as: 'h6';
36
- asChild?: false;
37
- } & React.ComponentPropsWithoutRef<'h6'>;
38
- type HeadingVariant = (typeof headingVariants)[number];
39
17
  type RootProps = {
40
18
  /**
41
19
  * EnableHyphenation
@@ -43,21 +21,16 @@ type RootProps = {
43
21
  * https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens
44
22
  */
45
23
  enableHyphenation?: boolean;
46
- variant: HeadingVariant;
47
- } & (AsChildProps | H1Props | H2Props | H3Props | H4Props | H5Props | H6Props);
24
+ variant?: HeadingVariant;
25
+ } & ChildrenLayoutProps & (HeadingAsChildProps | HeadingAsProps);
48
26
  declare const Heading: React.ForwardRefExoticComponent<RootProps & React.RefAttributes<HTMLHeadingElement>> & {
49
27
  headingVariants: readonly ["title-100", "title-200", "title-300", "title-400", "title-500", "title-600", "title-700", "subsection-100", "display-25", "display-50", "display-100", "display-200"];
50
28
  };
51
29
  type HeadingProps = {
52
30
  Root: RootProps;
53
31
  headingVariants: typeof headingVariants;
54
- AsChildProps: AsChildProps;
55
- H1Props: H1Props;
56
- H2Props: H2Props;
57
- H3Props: H3Props;
58
- H4Props: H4Props;
59
- H5Props: H5Props;
60
- H6Props: H6Props;
32
+ AsChildProps: HeadingAsChildProps;
33
+ AsProps: HeadingAsProps;
61
34
  };
62
35
  export { Heading };
63
36
  export type { HeadingProps };
@@ -1,24 +1,25 @@
1
1
  import '../../assets/heading.css';
2
- import { jsx as n } from "react/jsx-runtime";
3
- import { $ as q } from "../../index-DpfSJps6.js";
4
- import { c as o } from "../../clsx-DB4S2d7J.js";
5
- import p from "react";
6
- const d = {
7
- "teddy-heading": "_teddy-heading_1qjqc_2",
8
- "teddy-heading--hyphens": "_teddy-heading--hyphens_1qjqc_9",
9
- "teddy-heading--subsection-100": "_teddy-heading--subsection-100_1qjqc_12",
10
- "teddy-heading--title-100": "_teddy-heading--title-100_1qjqc_18",
11
- "teddy-heading--title-200": "_teddy-heading--title-200_1qjqc_24",
12
- "teddy-heading--title-300": "_teddy-heading--title-300_1qjqc_30",
13
- "teddy-heading--title-400": "_teddy-heading--title-400_1qjqc_36",
14
- "teddy-heading--title-500": "_teddy-heading--title-500_1qjqc_42",
15
- "teddy-heading--title-600": "_teddy-heading--title-600_1qjqc_48",
16
- "teddy-heading--title-700": "_teddy-heading--title-700_1qjqc_54",
17
- "teddy-heading--display-25": "_teddy-heading--display-25_1qjqc_60",
18
- "teddy-heading--display-50": "_teddy-heading--display-50_1qjqc_66",
19
- "teddy-heading--display-100": "_teddy-heading--display-100_1qjqc_72",
20
- "teddy-heading--display-200": "_teddy-heading--display-200_1qjqc_78"
21
- }, e = "teddy-heading", j = [
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 = {
8
+ "teddy-heading": "_teddy-heading_r8os0_2",
9
+ "teddy-heading--hyphens": "_teddy-heading--hyphens_r8os0_9",
10
+ "teddy-heading--subsection-100": "_teddy-heading--subsection-100_r8os0_12",
11
+ "teddy-heading--title-100": "_teddy-heading--title-100_r8os0_18",
12
+ "teddy-heading--title-200": "_teddy-heading--title-200_r8os0_24",
13
+ "teddy-heading--title-300": "_teddy-heading--title-300_r8os0_30",
14
+ "teddy-heading--title-400": "_teddy-heading--title-400_r8os0_36",
15
+ "teddy-heading--title-500": "_teddy-heading--title-500_r8os0_42",
16
+ "teddy-heading--title-600": "_teddy-heading--title-600_r8os0_48",
17
+ "teddy-heading--title-700": "_teddy-heading--title-700_r8os0_54",
18
+ "teddy-heading--display-25": "_teddy-heading--display-25_r8os0_60",
19
+ "teddy-heading--display-50": "_teddy-heading--display-50_r8os0_66",
20
+ "teddy-heading--display-100": "_teddy-heading--display-100_r8os0_72",
21
+ "teddy-heading--display-200": "_teddy-heading--display-200_r8os0_78"
22
+ }, d = "teddy-heading", $ = [
22
23
  "title-100",
23
24
  "title-200",
24
25
  "title-300",
@@ -31,23 +32,21 @@ const d = {
31
32
  "display-50",
32
33
  "display-100",
33
34
  "display-200"
34
- ], y = p.forwardRef(
35
- ({ className: s, children: t, variant: i, asChild: _, enableHyphenation: l, as: a, ...h }, c) => {
36
- const g = o(
37
- d[`${e}`],
38
- {
39
- [d[`${e}--${i}`]]: i,
40
- [d[`${e}--hyphens`]]: l
41
- },
42
- s
43
- );
44
- return /* @__PURE__ */ n(q, { ...h, ref: c, className: g, children: _ ? t : a ? /* @__PURE__ */ n(a, { children: t }) : null });
45
- }
46
- );
47
- y.displayName = "Heading";
48
- const u = Object.assign(y, {
49
- headingVariants: j
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}`],
38
+ {
39
+ [e[`${d}--${i}`]]: i,
40
+ [e[`${d}--hyphens`]]: h
41
+ },
42
+ _
43
+ );
44
+ return /* @__PURE__ */ s(c, { ...r, ref: y, className: g, children: o ? t : a ? /* @__PURE__ */ s(a, { children: t }) : null });
45
+ });
46
+ n.displayName = "Heading";
47
+ const R = Object.assign(n, {
48
+ headingVariants: $
50
49
  });
51
50
  export {
52
- u as Heading
51
+ R as Heading
53
52
  };
@@ -1,3 +1,5 @@
1
+ export * from './modal';
2
+ export * from './notification';
1
3
  export * from './radio-group';
2
4
  export * from './box';
3
5
  export * from './flex';
@@ -1,46 +1,48 @@
1
- import { R as e } from "../radio-group-BR5SMJXJ.js";
2
- import { Box as p } from "./box/box.js";
3
- import { Flex as f } from "./flex/flex.js";
4
- import { A as a, B as i, C as n, T as d } from "../badge-9vHb0-Jo.js";
5
- import { Grid as s } from "./grid/grid.js";
6
- import { NavigationMenu as T } from "./navigation-menu/navigation-menu.js";
7
- import { Link as c } from "./link/link.js";
8
- import { Button as H } from "./button/button.js";
9
- import { FieldErrorText as G } from "./field-error-text/field-error-text.js";
1
+ import { A as e, B as t, C as p, M as x, N as f, T as a } from "../badge-DscsRVHR.js";
2
+ import { R as i } from "../radio-group-B--zT3OL.js";
3
+ import { Box as d } from "./box/box.js";
4
+ import { Flex as l } from "./flex/flex.js";
5
+ import { Grid as T } from "./grid/grid.js";
6
+ import { N as g } from "../navigation-menu-DKuyW8zE.js";
7
+ import { Link as H } from "./link/link.js";
8
+ import { Button as F } from "./button/button.js";
9
+ import { FieldErrorText as I } from "./field-error-text/field-error-text.js";
10
10
  import { HelperText as A } from "./helper-text/helper-text.js";
11
11
  import { default as L } from "../assets/5161b177f001ea1a.svg";
12
12
  import { Icon as S } from "./icon/icon.js";
13
13
  import { Input as k, InputGroup as v } from "./input/input.js";
14
14
  import { Label as E } from "./label/label.js";
15
- import { Spinner as N } from "./spinner/spinner.js";
16
- import { Text as h } from "./text/text.js";
17
- import { TextField as q } from "./text-field/text-field.js";
18
- import { Heading as z } from "./heading/heading.js";
19
- import { VisuallyHidden as J } from "./visually-hidden/visually-hidden.js";
20
- import { TextSpacing as O } from "./text-spacing/text-spacing.js";
15
+ import { Spinner as h } from "./spinner/spinner.js";
16
+ import { Text as q } from "./text/text.js";
17
+ import { TextField as z } from "./text-field/text-field.js";
18
+ import { Heading as J } from "./heading/heading.js";
19
+ import { VisuallyHidden as O } from "./visually-hidden/visually-hidden.js";
20
+ import { TextSpacing as Q } from "./text-spacing/text-spacing.js";
21
21
  export {
22
- a as Accordion,
23
- i as Badge,
24
- p as Box,
25
- H as Button,
26
- n as Card,
27
- G as FieldErrorText,
28
- f as Flex,
29
- s as Grid,
30
- z as Heading,
22
+ e as Accordion,
23
+ t as Badge,
24
+ d as Box,
25
+ F as Button,
26
+ p as Card,
27
+ I as FieldErrorText,
28
+ l as Flex,
29
+ T as Grid,
30
+ J as Heading,
31
31
  A as HelperText,
32
32
  S as Icon,
33
33
  k as Input,
34
34
  v as InputGroup,
35
35
  E as Label,
36
- c as Link,
37
- T as NavigationMenu,
38
- e as RadioGroup,
39
- N as Spinner,
40
- h as Text,
41
- q as TextField,
42
- O as TextSpacing,
43
- d as Toggle,
44
- J as VisuallyHidden,
36
+ H as Link,
37
+ x as Modal,
38
+ g as NavigationMenu,
39
+ f as Notification,
40
+ i as RadioGroup,
41
+ h as Spinner,
42
+ q as Text,
43
+ z as TextField,
44
+ Q as TextSpacing,
45
+ a as Toggle,
46
+ O as VisuallyHidden,
45
47
  L as iconsHref
46
48
  };
@@ -0,0 +1,2 @@
1
+ export { Modal } from './modal';
2
+ export type { ModalProps } from './modal';
@@ -0,0 +1,4 @@
1
+ import { M as r } from "../../badge-DscsRVHR.js";
2
+ export {
3
+ r as Modal
4
+ };
@@ -0,0 +1,76 @@
1
+ import { ComponentPropsAs } from '../../utils/component-props-as';
2
+ import { Flex, Heading, Text } from '..';
3
+ import { default as React } from 'react';
4
+
5
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
6
+ type RootProps = Omit<React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>, 'modal'>;
7
+ /** -------------------------------------------------------------------------------------------------
8
+ * ModalTrigger
9
+ * -----------------------------------------------------------------------------------------------*/
10
+ type TriggerProps = Omit<React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>, 'asChild' | 'children'> & {
11
+ children: React.ReactElement;
12
+ };
13
+ type OverlayProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay> & {
14
+ container?: React.ComponentProps<typeof DialogPrimitive.Portal>['container'];
15
+ };
16
+ /** -------------------------------------------------------------------------------------------------
17
+ * ModalContent
18
+ * -----------------------------------------------------------------------------------------------*/
19
+ type ContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;
20
+ type GroupProps = React.ComponentPropsWithoutRef<typeof Flex> & {
21
+ variant?: 'title' | 'action';
22
+ };
23
+ /** -------------------------------------------------------------------------------------------------
24
+ * ModalTitle
25
+ * -----------------------------------------------------------------------------------------------*/
26
+ type TitleProps = Omit<React.ComponentPropsWithoutRef<typeof Heading>, 'asChild'>;
27
+ /** -------------------------------------------------------------------------------------------------
28
+ * ModalDescription
29
+ * -----------------------------------------------------------------------------------------------*/
30
+ type DescriptionProps = ComponentPropsAs<typeof Text, 'p'>;
31
+ /** -------------------------------------------------------------------------------------------------
32
+ * ModalImage
33
+ * -----------------------------------------------------------------------------------------------*/
34
+ type ImageProps = React.ComponentPropsWithoutRef<'img'> & {
35
+ asChild?: boolean;
36
+ };
37
+ /** -------------------------------------------------------------------------------------------------
38
+ * ModalClose
39
+ * -----------------------------------------------------------------------------------------------*/
40
+ type CloseProps = Omit<React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>, 'asChild' | 'children'> & ({
41
+ children: React.ReactElement;
42
+ slot: 'content';
43
+ } | {
44
+ ['aria-label']: string;
45
+ slot: 'floating';
46
+ children?: never;
47
+ });
48
+ /** -------------------------------------------------------------------------------------------------*/
49
+ export declare const Modal: React.FC<RootProps> & {
50
+ Trigger: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref">, "asChild" | "children"> & {
51
+ children: React.ReactElement;
52
+ } & React.RefAttributes<HTMLButtonElement>>;
53
+ Content: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
54
+ Title: React.ForwardRefExoticComponent<TitleProps & React.RefAttributes<HTMLHeadingElement>>;
55
+ Overlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
56
+ container?: React.ComponentProps<typeof DialogPrimitive.Portal>['container'];
57
+ } & React.RefAttributes<HTMLDivElement>>;
58
+ Description: React.ForwardRefExoticComponent<DescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
59
+ Close: React.ForwardRefExoticComponent<CloseProps & React.RefAttributes<HTMLButtonElement>>;
60
+ Image: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "ref"> & {
61
+ asChild?: boolean | undefined;
62
+ } & React.RefAttributes<HTMLImageElement>>;
63
+ Group: React.ForwardRefExoticComponent<GroupProps & React.RefAttributes<HTMLDivElement>>;
64
+ };
65
+ export type ModalProps = {
66
+ Root: RootProps;
67
+ Trigger: TriggerProps;
68
+ Content: ContentProps;
69
+ Title: TitleProps;
70
+ Description: DescriptionProps;
71
+ Overlay: OverlayProps;
72
+ Group: GroupProps;
73
+ Close: CloseProps;
74
+ Image: ImageProps;
75
+ };
76
+ export {};