@telia/teddy 0.0.24 → 0.0.26

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 (205) hide show
  1. package/dist/components/accordion/accordion-content.cjs +32 -0
  2. package/dist/components/accordion/accordion-header.cjs +33 -0
  3. package/dist/components/accordion/accordion-indicator.cjs +16 -0
  4. package/dist/components/accordion/accordion-item.cjs +32 -0
  5. package/dist/components/accordion/accordion-root.cjs +56 -0
  6. package/dist/components/accordion/accordion-root.js +11 -11
  7. package/dist/components/accordion/accordion-title.cjs +15 -0
  8. package/dist/components/accordion/accordion-trigger.cjs +37 -0
  9. package/dist/components/accordion/index.cjs +25 -0
  10. package/dist/components/accordion/index.js +7 -0
  11. package/dist/components/badge/badge.cjs +43 -0
  12. package/dist/components/badge/index.cjs +4 -0
  13. package/dist/components/box/box.cjs +17 -0
  14. package/dist/components/box/index.cjs +4 -0
  15. package/dist/components/button/button.cjs +130 -0
  16. package/dist/components/button/button.js +24 -24
  17. package/dist/components/button/index.cjs +4 -0
  18. package/dist/components/card/card.cjs +219 -0
  19. package/dist/components/card/index.cjs +4 -0
  20. package/dist/components/chip/chip-indicator.cjs +16 -0
  21. package/dist/components/chip/chip-item.cjs +45 -0
  22. package/dist/components/chip/chip.cjs +48 -0
  23. package/dist/components/chip/index.cjs +10 -0
  24. package/dist/components/drawer/drawer-close.cjs +39 -0
  25. package/dist/components/drawer/drawer-close.d.ts +0 -3
  26. package/dist/components/drawer/drawer-close.js +1 -1
  27. package/dist/components/drawer/drawer-content.cjs +42 -0
  28. package/dist/components/drawer/drawer-content.d.ts +0 -3
  29. package/dist/components/drawer/drawer-content.js +1 -1
  30. package/dist/components/drawer/drawer-description.cjs +36 -0
  31. package/dist/components/drawer/drawer-description.d.ts +0 -3
  32. package/dist/components/drawer/drawer-description.js +1 -1
  33. package/dist/components/drawer/drawer-footer.cjs +16 -0
  34. package/dist/components/drawer/drawer-footer.d.ts +0 -3
  35. package/dist/components/drawer/drawer-footer.js +1 -1
  36. package/dist/components/drawer/drawer-overlay.cjs +43 -0
  37. package/dist/components/drawer/drawer-overlay.d.ts +0 -3
  38. package/dist/components/drawer/drawer-overlay.js +1 -1
  39. package/dist/components/drawer/drawer-root.cjs +28 -0
  40. package/dist/components/drawer/drawer-root.d.ts +1 -1
  41. package/dist/components/drawer/drawer-title.cjs +34 -0
  42. package/dist/components/drawer/drawer-title.d.ts +4 -3
  43. package/dist/components/drawer/drawer-title.js +1 -1
  44. package/dist/components/drawer/drawer-trigger.cjs +27 -0
  45. package/dist/components/drawer/drawer-trigger.d.ts +5 -3
  46. package/dist/components/drawer/index.cjs +28 -0
  47. package/dist/components/drawer/index.d.ts +28 -0
  48. package/dist/components/drawer/index.js +8 -0
  49. package/dist/components/field-error-text/field-error-text.cjs +30 -0
  50. package/dist/components/field-error-text/index.cjs +4 -0
  51. package/dist/components/flex/flex.cjs +19 -0
  52. package/dist/components/flex/index.cjs +4 -0
  53. package/dist/components/grid/grid.cjs +19 -0
  54. package/dist/components/grid/index.cjs +4 -0
  55. package/dist/components/heading/heading.cjs +55 -0
  56. package/dist/components/heading/index.cjs +4 -0
  57. package/dist/components/helper-text/helper-text.cjs +21 -0
  58. package/dist/components/helper-text/helper-text.d.ts +2 -4
  59. package/dist/components/helper-text/index.cjs +4 -0
  60. package/dist/components/icon/AllIcons.cjs +1091 -0
  61. package/dist/components/icon/AllIcons.d.ts +2 -0
  62. package/dist/components/icon/AllIcons.js +1092 -0
  63. package/dist/components/icon/icon.cjs +29 -0
  64. package/dist/components/icon/index.cjs +8 -0
  65. package/dist/components/icon/index.d.ts +1 -0
  66. package/dist/components/icon/index.js +2 -0
  67. package/dist/components/image/image.cjs +17 -0
  68. package/dist/components/image/index.cjs +4 -0
  69. package/dist/components/index.cjs +66 -0
  70. package/dist/components/index.js +6 -3
  71. package/dist/components/input/index.cjs +14 -0
  72. package/dist/components/input/index.d.ts +27 -2
  73. package/dist/components/input/index.js +10 -1
  74. package/dist/components/input/input-clear-button.cjs +43 -0
  75. package/dist/components/input/input-clear-button.d.ts +6 -0
  76. package/dist/components/input/input-clear-button.js +43 -0
  77. package/dist/components/input/input-group.cjs +132 -0
  78. package/dist/components/input/input-group.d.ts +16 -0
  79. package/dist/components/input/input-group.js +132 -0
  80. package/dist/components/input/input-indicator.cjs +10 -0
  81. package/dist/components/input/input-indicator.d.ts +23 -0
  82. package/dist/components/input/input-indicator.js +10 -0
  83. package/dist/components/input/input.cjs +9 -0
  84. package/dist/components/input/input.d.ts +4 -28
  85. package/dist/components/input/input.js +7 -114
  86. package/dist/components/label/index.cjs +4 -0
  87. package/dist/components/label/label.cjs +44 -0
  88. package/dist/components/link/index.cjs +4 -0
  89. package/dist/components/link/link.cjs +37 -0
  90. package/dist/components/link/link.js +10 -10
  91. package/dist/components/modal/index.cjs +4 -0
  92. package/dist/components/modal/modal.cjs +210 -0
  93. package/dist/components/modal/modal.js +17 -16
  94. package/dist/components/navigation-menu/index.cjs +4 -0
  95. package/dist/components/navigation-menu/navigation-menu.cjs +412 -0
  96. package/dist/components/navigation-menu/navigation-menu.d.ts +2 -0
  97. package/dist/components/navigation-menu/navigation-menu.js +24 -22
  98. package/dist/components/notification/index.cjs +4 -0
  99. package/dist/components/notification/notification.cjs +116 -0
  100. package/dist/components/notification/notification.js +8 -8
  101. package/dist/components/radio-group/index.cjs +4 -0
  102. package/dist/components/radio-group/radio-group.cjs +110 -0
  103. package/dist/components/scroll-area/index.cjs +9 -0
  104. package/dist/components/scroll-area/scroll-area-bar.cjs +175 -0
  105. package/dist/components/scroll-area/scroll-area-bar.js +8 -8
  106. package/dist/components/scroll-area/scroll-area-button.cjs +11 -0
  107. package/dist/components/scroll-area/scroll-area-corner.cjs +8 -0
  108. package/dist/components/scroll-area/scroll-area-item.cjs +42 -0
  109. package/dist/components/scroll-area/scroll-area-item.js +2 -1
  110. package/dist/components/scroll-area/scroll-area-root.cjs +11 -0
  111. package/dist/components/scroll-area/scroll-area-thumb.cjs +8 -0
  112. package/dist/components/spinner/index.cjs +4 -0
  113. package/dist/components/spinner/spinner.cjs +57 -0
  114. package/dist/components/tabs/index.cjs +16 -0
  115. package/dist/components/tabs/tabs-content.cjs +32 -0
  116. package/dist/components/tabs/tabs-list.cjs +39 -0
  117. package/dist/components/tabs/tabs-list.js +6 -4
  118. package/dist/components/tabs/tabs-root.cjs +75 -0
  119. package/dist/components/tabs/tabs-root.d.ts +4 -7
  120. package/dist/components/tabs/tabs-root.js +25 -8
  121. package/dist/components/tabs/tabs-scroll-button.cjs +15 -0
  122. package/dist/components/tabs/tabs-scroll.cjs +22 -0
  123. package/dist/components/tabs/tabs-trigger.cjs +55 -0
  124. package/dist/components/tabs/tabs-trigger.js +19 -9
  125. package/dist/components/text/index.cjs +4 -0
  126. package/dist/components/text/text.cjs +49 -0
  127. package/dist/components/text-field/index.cjs +31 -0
  128. package/dist/components/text-field/index.d.ts +63 -2
  129. package/dist/components/text-field/index.js +28 -1
  130. package/dist/components/text-field/text-field-button.cjs +31 -0
  131. package/dist/components/text-field/text-field-button.d.ts +27 -0
  132. package/dist/components/text-field/text-field-button.js +31 -0
  133. package/dist/components/text-field/text-field-clear-button.cjs +12 -0
  134. package/dist/components/text-field/text-field-clear-button.d.ts +6 -0
  135. package/dist/components/text-field/text-field-clear-button.js +12 -0
  136. package/dist/components/text-field/text-field-error-list.cjs +28 -0
  137. package/dist/components/text-field/text-field-error-list.d.ts +9 -0
  138. package/dist/components/text-field/text-field-error-list.js +28 -0
  139. package/dist/components/text-field/text-field-helper-text.cjs +19 -0
  140. package/dist/components/text-field/text-field-helper-text.d.ts +5 -0
  141. package/dist/components/text-field/text-field-helper-text.js +19 -0
  142. package/dist/components/text-field/text-field-indicator.cjs +14 -0
  143. package/dist/components/text-field/text-field-indicator.d.ts +6 -0
  144. package/dist/components/text-field/text-field-indicator.js +14 -0
  145. package/dist/components/text-field/text-field-input-group.cjs +11 -0
  146. package/dist/components/text-field/text-field-input-group.d.ts +7 -0
  147. package/dist/components/text-field/text-field-input-group.js +11 -0
  148. package/dist/components/text-field/text-field-input.cjs +27 -0
  149. package/dist/components/text-field/text-field-input.d.ts +5 -0
  150. package/dist/components/text-field/text-field-input.js +27 -0
  151. package/dist/components/text-field/text-field-label.cjs +27 -0
  152. package/dist/components/text-field/text-field-label.d.ts +8 -0
  153. package/dist/components/text-field/text-field-label.js +27 -0
  154. package/dist/components/text-field/text-field.cjs +54 -0
  155. package/dist/components/text-field/text-field.d.ts +12 -58
  156. package/dist/components/text-field/text-field.js +17 -101
  157. package/dist/components/text-field/util.cjs +4 -0
  158. package/dist/components/text-field/util.d.ts +1 -0
  159. package/dist/components/text-field/util.js +4 -0
  160. package/dist/components/text-spacing/index.cjs +4 -0
  161. package/dist/components/text-spacing/text-spacing.cjs +19 -0
  162. package/dist/components/toggle/index.cjs +4 -0
  163. package/dist/components/toggle/toggle.cjs +104 -0
  164. package/dist/components/visually-hidden/index.cjs +4 -0
  165. package/dist/components/visually-hidden/visually-hidden.cjs +26 -0
  166. package/dist/drawer.module-BxsrDZFu.js +14 -0
  167. package/dist/drawer.module-CWDhohQm.cjs +13 -0
  168. package/dist/icons/category.cjs +335 -0
  169. package/dist/icons/name.cjs +335 -0
  170. package/dist/icons/name.d.cjs +1 -0
  171. package/dist/main.cjs +374 -0
  172. package/dist/main.js +6 -3
  173. package/dist/style.css +573 -492
  174. package/dist/tokens/border/variables.cjs +20 -0
  175. package/dist/tokens/breakpoint/variables.cjs +10 -0
  176. package/dist/tokens/color/variables.cjs +454 -0
  177. package/dist/tokens/index.cjs +310 -0
  178. package/dist/tokens/motion/variables.cjs +24 -0
  179. package/dist/tokens/shadow/variables.cjs +10 -0
  180. package/dist/tokens/spacing/variables.cjs +48 -0
  181. package/dist/tokens/typography/variables.cjs +50 -0
  182. package/dist/utils/action.cjs +21 -0
  183. package/dist/utils/component-props-as.cjs +1 -0
  184. package/dist/utils/composeEventHandlers.cjs +11 -0
  185. package/dist/utils/composeRefs.cjs +18 -0
  186. package/dist/utils/generate-styling/align.cjs +32 -0
  187. package/dist/utils/generate-styling/color.cjs +12 -0
  188. package/dist/utils/generate-styling/flex.cjs +67 -0
  189. package/dist/utils/generate-styling/gap.cjs +22 -0
  190. package/dist/utils/generate-styling/grid.cjs +123 -0
  191. package/dist/utils/generate-styling/height.cjs +51 -0
  192. package/dist/utils/generate-styling/index.cjs +97 -0
  193. package/dist/utils/generate-styling/inset.cjs +33 -0
  194. package/dist/utils/generate-styling/justify.cjs +18 -0
  195. package/dist/utils/generate-styling/margin.cjs +33 -0
  196. package/dist/utils/generate-styling/object-fit.cjs +18 -0
  197. package/dist/utils/generate-styling/padding.cjs +33 -0
  198. package/dist/utils/generate-styling/position.cjs +21 -0
  199. package/dist/utils/generate-styling/util.cjs +33 -0
  200. package/dist/utils/generate-styling/width.cjs +26 -0
  201. package/dist/vite-env.d.cjs +1 -0
  202. package/package.json +6 -4
  203. package/dist/components/text-field/tex-field-label.d.ts +0 -0
  204. package/dist/components/text-field/tex-field-label.js +0 -1
  205. package/dist/drawer.module-B3QhrxH1.js +0 -14
@@ -0,0 +1,10 @@
1
+ import "react/jsx-runtime";
2
+ import "clsx";
3
+ import "react";
4
+ import "../../assets/sprite.5636ec8e-teddy.svg";
5
+ import "../icon/icon.js";
6
+ import "../spinner/spinner.js";
7
+ import { a } from "./input-group.js";
8
+ export {
9
+ a as Indicator
10
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ require("react/jsx-runtime");
4
+ require("clsx");
5
+ require("react");
6
+ const components_input_inputGroup = require("./input-group.cjs");
7
+ require("../../utils/composeRefs.cjs");
8
+ exports.Input = components_input_inputGroup.Input;
9
+ exports.rootClassName = components_input_inputGroup.rootClassName;
@@ -1,9 +1,9 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- type InputGroupRootProps = React.ComponentPropsWithoutRef<'div'> & {};
3
+ export declare const rootClassName = "teddy-input";
4
4
  type ValidationState = 'valid' | 'invalid';
5
5
  type Input = React.ComponentPropsWithoutRef<'input'>;
6
- type InputProps = Omit<Input, 'children'> & {
6
+ export type InputProps = Omit<Input, 'children'> & {
7
7
  /** Whether the input should display its "valid" or "invalid" visual styling. */
8
8
  validationState?: ValidationState;
9
9
  /** Whether to show a loading indicator. */
@@ -12,7 +12,7 @@ type InputProps = Omit<Input, 'children'> & {
12
12
  onValueChange?: (value: string) => void;
13
13
  };
14
14
  /** The input element */
15
- declare const Input: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "children"> & {
15
+ export declare const Input: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "children"> & {
16
16
  /** Whether the input should display its "valid" or "invalid" visual styling. */
17
17
  validationState?: ValidationState | undefined;
18
18
  /** Whether to show a loading indicator. */
@@ -20,28 +20,4 @@ declare const Input: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTM
20
20
  /** Called when the value changes. */
21
21
  onValueChange?: ((value: string) => void) | undefined;
22
22
  } & React.RefAttributes<HTMLInputElement>>;
23
- type InputIndicatorProps = React.ComponentPropsWithoutRef<'svg'> & {
24
- isLoading?: boolean;
25
- isValid?: boolean;
26
- };
27
- declare const InputGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>> & {
28
- Input: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "children"> & {
29
- /** Whether the input should display its "valid" or "invalid" visual styling. */
30
- validationState?: ValidationState | undefined;
31
- /** Whether to show a loading indicator. */
32
- isLoading?: boolean | undefined;
33
- /** Called when the value changes. */
34
- onValueChange?: ((value: string) => void) | undefined;
35
- } & React.RefAttributes<HTMLInputElement>>;
36
- Indicator: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & {
37
- isLoading?: boolean | undefined;
38
- isValid?: boolean | undefined;
39
- } & React.RefAttributes<SVGSVGElement>>;
40
- };
41
- type InputGroupProps = {
42
- Root: InputGroupRootProps;
43
- Input: InputProps;
44
- Indicator: InputIndicatorProps;
45
- };
46
- export { Input, InputGroup };
47
- export type { InputGroupProps, InputProps };
23
+ export {};
@@ -1,116 +1,9 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import clsx from "clsx";
3
- import React__default from "react";
4
- import "../../assets/sprite.5636ec8e-teddy.svg";
5
- import { Icon } from "../icon/icon.js";
6
- import { Spinner } from "../spinner/spinner.js";
7
- const fadeInAnimation = "_fadeInAnimation_1o9uu_1";
8
- const scaleInAnimation = "_scaleInAnimation_1o9uu_1";
9
- const styles = {
10
- "teddy-input": "_teddy-input_1o9uu_17",
11
- "teddy-input__frame": "_teddy-input__frame_1o9uu_24",
12
- "teddy-input__input": "_teddy-input__input_1o9uu_31",
13
- "teddy-input__input--valid": "_teddy-input__input--valid_1o9uu_66",
14
- "teddy-input__input--invalid": "_teddy-input__input--invalid_1o9uu_66",
15
- "teddy-input__indicator": "_teddy-input__indicator_1o9uu_72",
16
- "teddy-input__input--error": "_teddy-input__input--error_1o9uu_75",
17
- fadeInAnimation,
18
- scaleInAnimation
19
- };
20
- const rootClassName = "teddy-input";
21
- function setCursorOnInput(e) {
22
- const target = e == null ? void 0 : e.target;
23
- if (target.closest("input, button, a"))
24
- return;
25
- const input = [...e.currentTarget.getElementsByTagName("input")].find((input2) => input2);
26
- if (!input)
27
- return;
28
- const position = input.compareDocumentPosition(target);
29
- const targetIsBeforeInput = (position & Node.DOCUMENT_POSITION_PRECEDING) !== 0;
30
- const cursorPosition = targetIsBeforeInput ? 0 : input.value.length;
31
- requestAnimationFrame(() => {
32
- try {
33
- input.setSelectionRange(cursorPosition, cursorPosition);
34
- } finally {
35
- input.focus();
36
- }
37
- });
38
- }
39
- const InputGroupContext = React__default.createContext(void 0);
40
- const InputGroupRoot = React__default.forwardRef(
41
- ({ className, children, ...props }, forwardRef) => {
42
- const classes = clsx([styles[`${rootClassName}`]], className);
43
- return /* @__PURE__ */ jsxs("div", { ...props, onPointerDown: setCursorOnInput, ref: forwardRef, className: classes, children: [
44
- /* @__PURE__ */ jsx(InputGroupContext.Provider, { value: true, children }),
45
- /* @__PURE__ */ jsx("div", { className: styles[`${rootClassName}__frame`] })
46
- ] });
47
- }
48
- );
49
- InputGroupRoot.displayName = "InputGroup";
50
- const Input = React__default.forwardRef(
51
- ({ className, onValueChange, isLoading, validationState, ...props }, forwardRef) => {
52
- const groupContext = React__default.useContext(InputGroupContext);
53
- const classes = clsx(
54
- [
55
- styles[`${rootClassName}__input`],
56
- {
57
- [styles[`${rootClassName}__input--valid`]]: validationState === "valid",
58
- [styles[`${rootClassName}__input--error`]]: validationState === "invalid"
59
- }
60
- ],
61
- className
62
- );
63
- const hasInputGroup = groupContext === true;
64
- function onChange(e) {
65
- onValueChange == null ? void 0 : onValueChange(e.target.value);
66
- if (props.onChange)
67
- props.onChange(e);
68
- }
69
- if (hasInputGroup) {
70
- return /* @__PURE__ */ jsx(
71
- "input",
72
- {
73
- "aria-invalid": validationState === "invalid",
74
- ...props,
75
- onChange,
76
- className: classes,
77
- ref: forwardRef
78
- }
79
- );
80
- }
81
- return /* @__PURE__ */ jsxs(InputGroupRoot, { children: [
82
- /* @__PURE__ */ jsx(
83
- "input",
84
- {
85
- "aria-invalid": validationState === "invalid",
86
- ...props,
87
- onChange,
88
- className: classes,
89
- ref: forwardRef
90
- }
91
- ),
92
- /* @__PURE__ */ jsx(InputIndicator, { isValid: validationState === "valid", isLoading })
93
- ] });
94
- }
95
- );
96
- Input.displayName = "Input";
97
- const InputIndicator = React__default.forwardRef(
98
- ({ className, isLoading, isValid, ...props }, forwardRef) => {
99
- if (!isValid && !isLoading)
100
- return null;
101
- if (!isValid && isLoading) {
102
- return /* @__PURE__ */ jsx(Spinner, { className, size: "xs", ...props, ref: forwardRef });
103
- }
104
- const classes = clsx([styles[`${rootClassName}__indicator`]], className);
105
- return /* @__PURE__ */ jsx(Icon, { ...props, size: "md", name: "check-circle-filled", className: classes, ref: forwardRef });
106
- }
107
- );
108
- InputIndicator.displayName = "InputIndicator";
109
- const InputGroup = Object.assign(InputGroupRoot, {
110
- Input,
111
- Indicator: InputIndicator
112
- });
1
+ import "react/jsx-runtime";
2
+ import "clsx";
3
+ import "react";
4
+ import { I, r } from "./input-group.js";
5
+ import "../../utils/composeRefs.js";
113
6
  export {
114
- Input,
115
- InputGroup
7
+ I as Input,
8
+ r as rootClassName
116
9
  };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const components_label_label = require("./label.cjs");
4
+ exports.Label = components_label_label.Label;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const LabelPrimitive = require("@radix-ui/react-label");
5
+ const clsx = require("clsx");
6
+ const React = require("react");
7
+ function _interopNamespaceDefault(e) {
8
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
9
+ if (e) {
10
+ for (const k in e) {
11
+ if (k !== "default") {
12
+ const d = Object.getOwnPropertyDescriptor(e, k);
13
+ Object.defineProperty(n, k, d.get ? d : {
14
+ enumerable: true,
15
+ get: () => e[k]
16
+ });
17
+ }
18
+ }
19
+ }
20
+ n.default = e;
21
+ return Object.freeze(n);
22
+ }
23
+ const LabelPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(LabelPrimitive);
24
+ const styles = {
25
+ "teddy-label": "_teddy-label_1hc8e_1",
26
+ "teddy-label--disabled": "_teddy-label--disabled_1hc8e_8",
27
+ "teddy-label--required": "_teddy-label--required_1hc8e_12"
28
+ };
29
+ const rootClassName = "teddy-label";
30
+ const Label = React.forwardRef(
31
+ ({ className, disabled, isRequired, children, ...props }, ref) => {
32
+ const classes = clsx(
33
+ [styles[rootClassName]],
34
+ {
35
+ [styles[`${rootClassName}--disabled`]]: disabled,
36
+ [styles[`${rootClassName}--required`]]: isRequired
37
+ },
38
+ className
39
+ );
40
+ return /* @__PURE__ */ jsxRuntime.jsx(LabelPrimitive__namespace.Root, { ...props, ref, className: classes, children });
41
+ }
42
+ );
43
+ Label.displayName = "Label";
44
+ exports.Label = Label;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const components_link_link = require("./link.cjs");
4
+ exports.Link = components_link_link.Link;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const clsx = require("clsx");
5
+ const React = require("react");
6
+ const reactSlot = require("@radix-ui/react-slot");
7
+ const styles = {
8
+ "teddy-link": "_teddy-link_azi31_2",
9
+ "teddy-link--text": "_teddy-link--text_azi31_16",
10
+ "teddy-link--standalone": "_teddy-link--standalone_azi31_16",
11
+ "teddy-link--navigation": "_teddy-link--navigation_azi31_16",
12
+ "teddy-link--disable-visited": "_teddy-link--disable-visited_azi31_26",
13
+ "teddy-link--text-negative": "_teddy-link--text-negative_azi31_29",
14
+ "teddy-link--standalone-negative": "_teddy-link--standalone-negative_azi31_29",
15
+ "teddy-link--navigation-negative": "_teddy-link--navigation-negative_azi31_29",
16
+ "teddy-link--ensure-target-area": "_teddy-link--ensure-target-area_azi31_57",
17
+ "teddy-link--silent": "_teddy-link--silent_azi31_63"
18
+ };
19
+ const rootClassName = "teddy-link";
20
+ const Link = React.forwardRef(
21
+ ({ className, variant, silent, disableVisited, ensureTargetArea, asChild, children, ...props }, forwardRef) => {
22
+ const classes = clsx(
23
+ [styles[`${rootClassName}`]],
24
+ styles[`${rootClassName}--${variant}`],
25
+ {
26
+ [styles[`${rootClassName}--silent`]]: silent,
27
+ [styles[`${rootClassName}--negative`]]: variant.endsWith("negative"),
28
+ [styles[`${rootClassName}--disable-visited`]]: disableVisited ?? silent,
29
+ [styles[`${rootClassName}--ensure-target-area`]]: ensureTargetArea
30
+ },
31
+ className
32
+ );
33
+ return /* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slot, { ...props, ref: forwardRef, className: classes, children: asChild ? children : /* @__PURE__ */ jsxRuntime.jsx("a", { href: props.href, children }) });
34
+ }
35
+ );
36
+ Link.displayName = "Link";
37
+ exports.Link = Link;
@@ -3,16 +3,16 @@ import clsx from "clsx";
3
3
  import React__default from "react";
4
4
  import { Slot } from "@radix-ui/react-slot";
5
5
  const styles = {
6
- "teddy-link": "_teddy-link_zi6ey_1",
7
- "teddy-link--text": "_teddy-link--text_zi6ey_15",
8
- "teddy-link--standalone": "_teddy-link--standalone_zi6ey_15",
9
- "teddy-link--navigation": "_teddy-link--navigation_zi6ey_15",
10
- "teddy-link--disable-visited": "_teddy-link--disable-visited_zi6ey_25",
11
- "teddy-link--text-negative": "_teddy-link--text-negative_zi6ey_28",
12
- "teddy-link--standalone-negative": "_teddy-link--standalone-negative_zi6ey_28",
13
- "teddy-link--navigation-negative": "_teddy-link--navigation-negative_zi6ey_28",
14
- "teddy-link--ensure-target-area": "_teddy-link--ensure-target-area_zi6ey_56",
15
- "teddy-link--silent": "_teddy-link--silent_zi6ey_62"
6
+ "teddy-link": "_teddy-link_azi31_2",
7
+ "teddy-link--text": "_teddy-link--text_azi31_16",
8
+ "teddy-link--standalone": "_teddy-link--standalone_azi31_16",
9
+ "teddy-link--navigation": "_teddy-link--navigation_azi31_16",
10
+ "teddy-link--disable-visited": "_teddy-link--disable-visited_azi31_26",
11
+ "teddy-link--text-negative": "_teddy-link--text-negative_azi31_29",
12
+ "teddy-link--standalone-negative": "_teddy-link--standalone-negative_azi31_29",
13
+ "teddy-link--navigation-negative": "_teddy-link--navigation-negative_azi31_29",
14
+ "teddy-link--ensure-target-area": "_teddy-link--ensure-target-area_azi31_57",
15
+ "teddy-link--silent": "_teddy-link--silent_azi31_63"
16
16
  };
17
17
  const rootClassName = "teddy-link";
18
18
  const Link = React__default.forwardRef(
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const components_modal_modal = require("./modal.cjs");
4
+ exports.Modal = components_modal_modal.Modal;
@@ -0,0 +1,210 @@
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 DrawerPrimitive = require("@radix-ui/react-dialog");
6
+ require("../scroll-area/index.cjs");
7
+ require("../tabs/index.cjs");
8
+ require("../drawer/index.cjs");
9
+ require("../image/image.cjs");
10
+ require("../chip/index.cjs");
11
+ require("../notification/notification.cjs");
12
+ require("../radio-group/radio-group.cjs");
13
+ require("../box/box.cjs");
14
+ const components_flex_flex = require("../flex/flex.cjs");
15
+ require("../card/card.cjs");
16
+ require("../grid/grid.cjs");
17
+ require("../navigation-menu/navigation-menu.cjs");
18
+ require("../toggle/toggle.cjs");
19
+ require("../accordion/index.cjs");
20
+ require("../link/link.cjs");
21
+ require("../badge/badge.cjs");
22
+ const components_button_button = require("../button/button.cjs");
23
+ require("../field-error-text/field-error-text.cjs");
24
+ require("../helper-text/helper-text.cjs");
25
+ require("../../assets/sprite.5636ec8e-teddy.svg");
26
+ const components_icon_icon = require("../icon/icon.cjs");
27
+ require("../input/index.cjs");
28
+ require("../label/label.cjs");
29
+ require("../spinner/spinner.cjs");
30
+ const components_text_text = require("../text/text.cjs");
31
+ require("../text-field/index.cjs");
32
+ const components_heading_heading = require("../heading/heading.cjs");
33
+ require("../visually-hidden/visually-hidden.cjs");
34
+ require("../text-spacing/text-spacing.cjs");
35
+ const clsx = require("clsx");
36
+ const reactSlot = require("@radix-ui/react-slot");
37
+ const utils_composeRefs = require("../../utils/composeRefs.cjs");
38
+ function _interopNamespaceDefault(e) {
39
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
40
+ if (e) {
41
+ for (const k in e) {
42
+ if (k !== "default") {
43
+ const d = Object.getOwnPropertyDescriptor(e, k);
44
+ Object.defineProperty(n, k, d.get ? d : {
45
+ enumerable: true,
46
+ get: () => e[k]
47
+ });
48
+ }
49
+ }
50
+ }
51
+ n.default = e;
52
+ return Object.freeze(n);
53
+ }
54
+ const DrawerPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(DrawerPrimitive);
55
+ const styles = {
56
+ "teddy-modal__overlay": "_teddy-modal__overlay_3n21u_25",
57
+ "teddy-modal__content": "_teddy-modal__content_3n21u_37",
58
+ "teddy-modal__scroll": "_teddy-modal__scroll_3n21u_55",
59
+ "teddy-modal__image": "_teddy-modal__image_3n21u_59",
60
+ "teddy-modal__close--floating": "_teddy-modal__close--floating_3n21u_69",
61
+ "teddy-modal__group": "_teddy-modal__group_3n21u_74",
62
+ "teddy-modal__group--title": "_teddy-modal__group--title_3n21u_78",
63
+ "teddy-modal__group--scroll": "_teddy-modal__group--scroll_3n21u_84",
64
+ "teddy-modal__group--action": "_teddy-modal__group--action_3n21u_93",
65
+ "modal-overlay-no-op": "_modal-overlay-no-op_3n21u_1",
66
+ "teddy-fade-in": "_teddy-fade-in_3n21u_1",
67
+ "teddy-fade-out": "_teddy-fade-out_3n21u_1",
68
+ "modal-content-show": "_modal-content-show_3n21u_1",
69
+ "modal-content-hide": "_modal-content-hide_3n21u_1",
70
+ "teddy-overlay-no-op": "_teddy-overlay-no-op_3n21u_1"
71
+ };
72
+ const rootClassName = "teddy-modal";
73
+ const RootContext = React.createContext({
74
+ imageRef: null,
75
+ actionGroupRef: null,
76
+ scrollRef: null
77
+ });
78
+ const Root = (props) => {
79
+ const imageRef = React.useRef(null);
80
+ const actionGroupRef = React.useRef(null);
81
+ const scrollRef = React.useRef(null);
82
+ return /* @__PURE__ */ jsxRuntime.jsx(RootContext.Provider, { value: { imageRef, actionGroupRef, scrollRef }, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerPrimitive__namespace.Root, { ...props, modal: true }) });
83
+ };
84
+ Root.displayName = "Dialog.Root";
85
+ const Trigger = React.forwardRef(
86
+ ({ children, ...props }, forwardedRef) => /* @__PURE__ */ jsxRuntime.jsx(DrawerPrimitive__namespace.Trigger, { ...props, ref: forwardedRef, asChild: true, children })
87
+ );
88
+ Trigger.displayName = "Dialog.Trigger";
89
+ const OverlayContext = React.createContext(false);
90
+ const Overlay = React.forwardRef(
91
+ ({ className, forceMount, container, ...rest }, forwardedRef) => {
92
+ const classes = clsx([styles[`${rootClassName}__overlay`]], className);
93
+ return /* @__PURE__ */ jsxRuntime.jsx(OverlayContext.Provider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerPrimitive__namespace.Portal, { container, forceMount, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerPrimitive__namespace.Overlay, { className: classes, ref: forwardedRef, ...rest }) }) });
94
+ }
95
+ );
96
+ Overlay.displayName = "Dialog.Content";
97
+ const InnerContent = React.forwardRef(
98
+ function InnerContent2({ asChild, children, className, ...props }, forwardedRef) {
99
+ const classes = clsx([styles[`${rootClassName}__scroll`]], className);
100
+ const context = React.useContext(RootContext);
101
+ return /* @__PURE__ */ jsxRuntime.jsx(
102
+ DrawerPrimitive__namespace.Content,
103
+ {
104
+ ...props,
105
+ ref: forwardedRef,
106
+ className: clsx([styles[`${rootClassName}__content`]]),
107
+ asChild: true,
108
+ children: /* @__PURE__ */ jsxRuntime.jsx(components_flex_flex.Flex, { children: /* @__PURE__ */ jsxRuntime.jsx(
109
+ components_flex_flex.Flex,
110
+ {
111
+ ...asChild ? { as: void 0, asChild } : {},
112
+ direction: "column",
113
+ align: "start",
114
+ maxWidth: { md: "600px" },
115
+ className: classes,
116
+ ref: context.scrollRef,
117
+ children
118
+ }
119
+ ) })
120
+ }
121
+ );
122
+ }
123
+ );
124
+ const Content = React.forwardRef(
125
+ ({ forceMount, ...contentProps }, forwardedRef) => {
126
+ const hasOverlay = React.useContext(OverlayContext);
127
+ if (!hasOverlay)
128
+ return /* @__PURE__ */ jsxRuntime.jsx(Overlay, { forceMount, children: /* @__PURE__ */ jsxRuntime.jsx(InnerContent, { ref: forwardedRef, ...contentProps }) });
129
+ return /* @__PURE__ */ jsxRuntime.jsx(InnerContent, { ref: forwardedRef, ...contentProps });
130
+ }
131
+ );
132
+ Content.displayName = "Dialog.Content";
133
+ const GroupContext = React.createContext(false);
134
+ const Group = React.forwardRef(
135
+ ({ className, variant, ...props }, forwardedRef) => {
136
+ const strollerRef = React.useContext(RootContext).scrollRef;
137
+ const [isOverflowing, setIsOverflowing] = React.useState(false);
138
+ React.useEffect(() => {
139
+ if (strollerRef == null ? void 0 : strollerRef.current) {
140
+ const hasOverflow = strollerRef.current.scrollHeight > strollerRef.current.clientHeight;
141
+ setIsOverflowing(hasOverflow);
142
+ }
143
+ }, [strollerRef]);
144
+ const classes = clsx(
145
+ [styles[`${rootClassName}__group`]],
146
+ {
147
+ [styles[`${rootClassName}__group--action`]]: variant === "action",
148
+ [styles[`${rootClassName}__group--title`]]: variant === "title",
149
+ [styles[`${rootClassName}__group--scroll`]]: isOverflowing
150
+ },
151
+ className
152
+ );
153
+ return /* @__PURE__ */ jsxRuntime.jsx(GroupContext.Provider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(
154
+ components_flex_flex.Flex,
155
+ {
156
+ ...variant === "action" ? {
157
+ gap: "200",
158
+ justify: { md: "end" },
159
+ align: { sm: "stretch", md: "end" },
160
+ direction: { sm: "column-reverse", md: "row" }
161
+ } : { direction: "column" },
162
+ ref: forwardedRef,
163
+ ...props,
164
+ className: classes
165
+ }
166
+ ) });
167
+ }
168
+ );
169
+ Group.displayName = "Dialog.Group";
170
+ const TitleInner = React.forwardRef(
171
+ function TitleInner2(props, forwardedRef) {
172
+ return /* @__PURE__ */ jsxRuntime.jsx(DrawerPrimitive__namespace.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { variant: "title-200", as: "h2", ...props, asChild: false, ref: forwardedRef }) });
173
+ }
174
+ );
175
+ const Title = React.forwardRef((props, forwardedRef) => {
176
+ const isInsideGroup = React.useContext(GroupContext);
177
+ if (!isInsideGroup) {
178
+ return /* @__PURE__ */ jsxRuntime.jsx(Group, { variant: "title", children: /* @__PURE__ */ jsxRuntime.jsx(TitleInner, { ...props, ref: forwardedRef }) });
179
+ }
180
+ return /* @__PURE__ */ jsxRuntime.jsx(TitleInner, { ...props, ref: forwardedRef });
181
+ });
182
+ Title.displayName = "Dialog.Title";
183
+ const Description = React.forwardRef((props, forwardedRef) => /* @__PURE__ */ jsxRuntime.jsx(DrawerPrimitive__namespace.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(components_text_text.Text, { as: "p", variant: "paragraph-100", ...props, asChild: false, ref: forwardedRef }) }));
184
+ Description.displayName = "Dialog.Description";
185
+ const Image = React.forwardRef(({ asChild, ...props }, forwardedRef) => {
186
+ const classes = clsx([styles[`${rootClassName}__image`]], props.className);
187
+ const context = React.useContext(RootContext);
188
+ const Comp = asChild ? reactSlot.Slot : "img";
189
+ return /* @__PURE__ */ jsxRuntime.jsx(Comp, { ...props, className: classes, ref: utils_composeRefs.composeRefs(context.imageRef, forwardedRef) });
190
+ });
191
+ Image.displayName = "Dialog.Image";
192
+ const Close = React.forwardRef(
193
+ ({ className, ...props }, forwardedRef) => {
194
+ const classes = clsx([styles[`${rootClassName}__close`]], {
195
+ [styles[`${rootClassName}__close--floating`]]: props.slot === "floating",
196
+ className
197
+ });
198
+ const imageRef = React.useContext(RootContext).imageRef;
199
+ const [hasImage, setHasImage] = React.useState(false);
200
+ React.useEffect(() => {
201
+ if (imageRef == null ? void 0 : imageRef.current) {
202
+ setHasImage(true);
203
+ }
204
+ }, [imageRef]);
205
+ return /* @__PURE__ */ jsxRuntime.jsx(DrawerPrimitive__namespace.Close, { ...props, className: classes, ref: forwardedRef, asChild: true, children: props.children || /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { variant: hasImage ? "primary-negative" : "tertiary-purple", iconOnly: true, "aria-label": props["aria-label"], children: /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "close" }) }) });
206
+ }
207
+ );
208
+ Close.displayName = "Dialog.Close";
209
+ const Modal = Object.assign(Root, { Trigger, Content, Title, Overlay, Description, Close, Image, Group });
210
+ exports.Modal = Modal;
@@ -22,11 +22,11 @@ import "../field-error-text/field-error-text.js";
22
22
  import "../helper-text/helper-text.js";
23
23
  import "../../assets/sprite.5636ec8e-teddy.svg";
24
24
  import { Icon } from "../icon/icon.js";
25
- import "../input/input.js";
25
+ import "../input/index.js";
26
26
  import "../label/label.js";
27
27
  import "../spinner/spinner.js";
28
28
  import { Text } from "../text/text.js";
29
- import "../text-field/text-field.js";
29
+ import "../text-field/index.js";
30
30
  import { Heading } from "../heading/heading.js";
31
31
  import "../visually-hidden/visually-hidden.js";
32
32
  import "../text-spacing/text-spacing.js";
@@ -34,20 +34,21 @@ import clsx from "clsx";
34
34
  import { Slot } from "@radix-ui/react-slot";
35
35
  import { composeRefs } from "../../utils/composeRefs.js";
36
36
  const styles = {
37
- "teddy-modal__overlay": "_teddy-modal__overlay_vfo5b_17",
38
- "teddy-modal__content": "_teddy-modal__content_vfo5b_29",
39
- "teddy-modal__scroll": "_teddy-modal__scroll_vfo5b_47",
40
- "teddy-modal__image": "_teddy-modal__image_vfo5b_51",
41
- "teddy-modal__close--floating": "_teddy-modal__close--floating_vfo5b_61",
42
- "teddy-modal__group": "_teddy-modal__group_vfo5b_66",
43
- "teddy-modal__group--title": "_teddy-modal__group--title_vfo5b_70",
44
- "teddy-modal__group--scroll": "_teddy-modal__group--scroll_vfo5b_76",
45
- "teddy-modal__group--action": "_teddy-modal__group--action_vfo5b_85",
46
- "modal-overlay-no-op": "_modal-overlay-no-op_vfo5b_1",
47
- "teddy-fade-in": "_teddy-fade-in_vfo5b_1",
48
- "teddy-fade-out": "_teddy-fade-out_vfo5b_1",
49
- "modal-content-show": "_modal-content-show_vfo5b_1",
50
- "modal-content-hide": "_modal-content-hide_vfo5b_1"
37
+ "teddy-modal__overlay": "_teddy-modal__overlay_3n21u_25",
38
+ "teddy-modal__content": "_teddy-modal__content_3n21u_37",
39
+ "teddy-modal__scroll": "_teddy-modal__scroll_3n21u_55",
40
+ "teddy-modal__image": "_teddy-modal__image_3n21u_59",
41
+ "teddy-modal__close--floating": "_teddy-modal__close--floating_3n21u_69",
42
+ "teddy-modal__group": "_teddy-modal__group_3n21u_74",
43
+ "teddy-modal__group--title": "_teddy-modal__group--title_3n21u_78",
44
+ "teddy-modal__group--scroll": "_teddy-modal__group--scroll_3n21u_84",
45
+ "teddy-modal__group--action": "_teddy-modal__group--action_3n21u_93",
46
+ "modal-overlay-no-op": "_modal-overlay-no-op_3n21u_1",
47
+ "teddy-fade-in": "_teddy-fade-in_3n21u_1",
48
+ "teddy-fade-out": "_teddy-fade-out_3n21u_1",
49
+ "modal-content-show": "_modal-content-show_3n21u_1",
50
+ "modal-content-hide": "_modal-content-hide_3n21u_1",
51
+ "teddy-overlay-no-op": "_teddy-overlay-no-op_3n21u_1"
51
52
  };
52
53
  const rootClassName = "teddy-modal";
53
54
  const RootContext = React__default.createContext({
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const components_navigationMenu_navigationMenu = require("./navigation-menu.cjs");
4
+ exports.NavigationMenu = components_navigationMenu_navigationMenu.NavigationMenu;