@telia/teddy 0.2.17 → 0.3.1

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 (51) hide show
  1. package/dist/components/index.cjs +2 -2
  2. package/dist/components/index.js +1 -1
  3. package/dist/components/modal/modal.cjs +1 -1
  4. package/dist/components/modal/modal.js +1 -1
  5. package/dist/components/navigation-menu/global-navigation/utils.cjs +11 -11
  6. package/dist/components/navigation-menu/global-navigation/utils.d.ts +22 -22
  7. package/dist/components/navigation-menu/global-navigation/utils.js +11 -11
  8. package/dist/components/navigation-menu/navigation-menu.cjs +1 -1
  9. package/dist/components/navigation-menu/navigation-menu.js +1 -1
  10. package/dist/components/notabene/index.cjs +5 -10
  11. package/dist/components/notabene/index.d.ts +52 -9
  12. package/dist/components/notabene/index.js +5 -10
  13. package/dist/components/notabene/notabene-icon.cjs +1 -1
  14. package/dist/components/notabene/notabene-icon.js +1 -1
  15. package/dist/components/notification/index.cjs +13 -2
  16. package/dist/components/notification/index.d.ts +132 -2
  17. package/dist/components/notification/index.js +12 -1
  18. package/dist/components/notification/notification-dismiss.cjs +46 -0
  19. package/dist/components/notification/notification-dismiss.d.ts +5 -0
  20. package/dist/components/notification/notification-dismiss.js +29 -0
  21. package/dist/components/notification/notification-footer.cjs +18 -0
  22. package/dist/components/notification/notification-footer.d.ts +5 -0
  23. package/dist/components/notification/notification-footer.js +18 -0
  24. package/dist/components/notification/notification-heading.cjs +18 -0
  25. package/dist/components/notification/notification-heading.d.ts +5 -0
  26. package/dist/components/notification/notification-heading.js +18 -0
  27. package/dist/components/notification/notification-icon.cjs +32 -0
  28. package/dist/components/notification/notification-icon.d.ts +9 -0
  29. package/dist/components/notification/notification-icon.js +32 -0
  30. package/dist/components/notification/notification-root.cjs +59 -0
  31. package/dist/components/notification/notification-root.d.ts +86 -0
  32. package/dist/components/notification/notification-root.js +42 -0
  33. package/dist/components/notification/notification-text.cjs +15 -0
  34. package/dist/components/notification/notification-text.d.ts +5 -0
  35. package/dist/components/notification/notification-text.js +15 -0
  36. package/dist/components/radio-card-group/radio-card-group-content.cjs +1 -1
  37. package/dist/components/radio-card-group/radio-card-group-content.js +1 -1
  38. package/dist/components/radio-card-group/radio-card-group-item-title.cjs +1 -1
  39. package/dist/components/radio-card-group/radio-card-group-item-title.js +1 -1
  40. package/dist/components/radio-card-group/radio-card-group-item.cjs +1 -1
  41. package/dist/components/radio-card-group/radio-card-group-item.js +1 -1
  42. package/dist/main.cjs +2 -2
  43. package/dist/main.js +1 -1
  44. package/dist/style.css +52 -24
  45. package/package.json +16 -16
  46. package/dist/components/notification/notification.cjs +0 -116
  47. package/dist/components/notification/notification.d.ts +0 -106
  48. package/dist/components/notification/notification.js +0 -99
  49. /package/dist/components/notabene/{notabene.content.cjs → notabene-content.cjs} +0 -0
  50. /package/dist/components/notabene/{notabene.content.d.ts → notabene-content.d.ts} +0 -0
  51. /package/dist/components/notabene/{notabene.content.js → notabene-content.js} +0 -0
@@ -1,2 +1,132 @@
1
- export { Notification } from './notification';
2
- export type { NotificationProps } from './notification';
1
+ import { Dismiss, DismissProps } from './notification-dismiss';
2
+ import { Heading, HeadingProps } from './notification-heading';
3
+ import { Icon, IconProps } from './notification-icon';
4
+ import { RootProps } from './notification-root';
5
+ import { TextProps, Text } from './notification-text';
6
+ import { FooterProps, Footer } from './notification-footer';
7
+
8
+ type NotificationProps = {
9
+ Root: RootProps;
10
+ Text: TextProps;
11
+ Heading: HeadingProps;
12
+ Footer: FooterProps;
13
+ Icon: IconProps;
14
+ Dismiss: DismissProps;
15
+ };
16
+ /**
17
+ * Notifications are messages that communicate information or feedback to the user.
18
+ *
19
+ * @component
20
+ *
21
+ * @example
22
+ * <Notification variant="success">
23
+ * <Notification.Dismiss />
24
+ * <Notification.Heading as="h3">
25
+ * <Notification.Icon /> Notification Title</Notification.Heading>
26
+ * <Notification.Text>This is the detailed message of the notification.</Notification.Text>
27
+ * </Notification>
28
+ */
29
+ declare const Notification: import('react').ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('../../utils/generate-styling/flex').FlexChildren & import('../../utils/generate-styling/grid').GridChildren & import('../../utils/generate-styling/position').PositionProps & import('../../utils/generate-styling/inset').InsetProps & import('../../utils/generate-styling/radius').RadiusProps & import('../../utils/generate-styling/margin').MarginProps & import('../../utils/generate-styling/padding').PaddingProps & import('../../utils/generate-styling/width').WidthProps & import('../../utils/generate-styling/height').HeightProps & import('../../utils/generate-styling/color').ColorProps & {
30
+ display?: import('../../utils/generate-styling').DisplayChildren | undefined;
31
+ } & import('../../utils/generate-styling/gap').GapProps & {
32
+ align?: import('../../utils/generate-styling/align').Align | undefined;
33
+ justify?: import('../../utils/generate-styling/justify').Justify | undefined;
34
+ } & import('../../utils/generate-styling/grid').GridLayout & {
35
+ asChild: true;
36
+ as?: undefined;
37
+ } & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
38
+ asChild?: boolean | undefined;
39
+ variant?: "beige" | "gray" | "white" | "purple-light" | "purple-dark" | "beige-light" | undefined;
40
+ bordered?: boolean | undefined;
41
+ shadow?: boolean | undefined;
42
+ backgroundImageSrc?: string | undefined;
43
+ imageGradient?: ("default" | "dark" | "light") | undefined;
44
+ layout?: import('../card/card').Layout | undefined;
45
+ } & import('react').RefAttributes<HTMLDivElement>, "ref"> | Omit<Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('../../utils/generate-styling/flex').FlexChildren & import('../../utils/generate-styling/grid').GridChildren & import('../../utils/generate-styling/position').PositionProps & import('../../utils/generate-styling/inset').InsetProps & import('../../utils/generate-styling/radius').RadiusProps & import('../../utils/generate-styling/margin').MarginProps & import('../../utils/generate-styling/padding').PaddingProps & import('../../utils/generate-styling/width').WidthProps & import('../../utils/generate-styling/height').HeightProps & import('../../utils/generate-styling/color').ColorProps & {
46
+ display?: import('../../utils/generate-styling').DisplayChildren | undefined;
47
+ } & import('../../utils/generate-styling/gap').GapProps & {
48
+ align?: import('../../utils/generate-styling/align').Align | undefined;
49
+ justify?: import('../../utils/generate-styling/justify').Justify | undefined;
50
+ } & import('../../utils/generate-styling/grid').GridLayout & {
51
+ as?: "span" | undefined;
52
+ asChild?: false | undefined;
53
+ } & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
54
+ asChild?: boolean | undefined;
55
+ variant?: "beige" | "gray" | "white" | "purple-light" | "purple-dark" | "beige-light" | undefined;
56
+ bordered?: boolean | undefined;
57
+ shadow?: boolean | undefined;
58
+ backgroundImageSrc?: string | undefined;
59
+ imageGradient?: ("default" | "dark" | "light") | undefined;
60
+ layout?: import('../card/card').Layout | undefined;
61
+ } & import('react').RefAttributes<HTMLDivElement>, "ref"> | Omit<Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('../../utils/generate-styling/flex').FlexChildren & import('../../utils/generate-styling/grid').GridChildren & import('../../utils/generate-styling/position').PositionProps & import('../../utils/generate-styling/inset').InsetProps & import('../../utils/generate-styling/radius').RadiusProps & import('../../utils/generate-styling/margin').MarginProps & import('../../utils/generate-styling/padding').PaddingProps & import('../../utils/generate-styling/width').WidthProps & import('../../utils/generate-styling/height').HeightProps & import('../../utils/generate-styling/color').ColorProps & {
62
+ display?: import('../../utils/generate-styling').DisplayChildren | undefined;
63
+ } & import('../../utils/generate-styling/gap').GapProps & {
64
+ align?: import('../../utils/generate-styling/align').Align | undefined;
65
+ justify?: import('../../utils/generate-styling/justify').Justify | undefined;
66
+ } & import('../../utils/generate-styling/grid').GridLayout & {
67
+ as: "div";
68
+ asChild?: false | undefined;
69
+ } & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
70
+ asChild?: boolean | undefined;
71
+ variant?: "beige" | "gray" | "white" | "purple-light" | "purple-dark" | "beige-light" | undefined;
72
+ bordered?: boolean | undefined;
73
+ shadow?: boolean | undefined;
74
+ backgroundImageSrc?: string | undefined;
75
+ imageGradient?: ("default" | "dark" | "light") | undefined;
76
+ layout?: import('../card/card').Layout | undefined;
77
+ } & import('react').RefAttributes<HTMLDivElement>, "ref">, "as" | "layout" | "variant"> & {
78
+ variant?: "beige" | "gray" | "teal" | "error" | "warning" | "information" | "success" | undefined;
79
+ type?: "card" | "tile" | undefined;
80
+ open?: boolean | undefined;
81
+ defaultOpen?: boolean | undefined;
82
+ onOpenChange?: ((open: boolean) => void) | undefined;
83
+ role?: "alert" | undefined;
84
+ } & import('react').RefAttributes<HTMLDivElement>> & {
85
+ /**
86
+ * Text component displays the detailed message.
87
+ *
88
+ * @component
89
+ *
90
+ * @example
91
+ * <Notification.Text>This is the detailed message of the notification.</Notification.Text>
92
+ */
93
+ Text: typeof Text;
94
+ /**
95
+ * Heading component displays the title of the notification.
96
+ *
97
+ * @component
98
+ *
99
+ * @example
100
+ * <Notification.Heading as="h3">Notification Title</Notification.Heading>
101
+ */
102
+ Heading: typeof Heading;
103
+ /**
104
+ * Footer component displays the footer of the notification.
105
+ *
106
+ * @component
107
+ *
108
+ * @example
109
+ * <Notification.Footer">Notification Footer</Notification.Footer>
110
+ */
111
+ Footer: typeof Footer;
112
+ /**
113
+ * Icon component displays an icon in the notification. The icon is automatically determined based on the variant, but can be overridden.
114
+ *
115
+ * @component
116
+ *
117
+ * @example
118
+ * <Notification.Icon name="info" />
119
+ */
120
+ Icon: typeof Icon;
121
+ /**
122
+ * Dismiss component provides a button to dismiss the notification.
123
+ *
124
+ * @component
125
+ *
126
+ * @example
127
+ * <Notification.Dismiss />
128
+ */
129
+ Dismiss: typeof Dismiss;
130
+ };
131
+ export { Notification };
132
+ export type { NotificationProps };
@@ -1,4 +1,15 @@
1
- import { Notification } from "./notification.js";
1
+ import { Dismiss } from "./notification-dismiss.js";
2
+ import { Heading } from "./notification-heading.js";
3
+ import { Icon } from "./notification-icon.js";
4
+ import { Root } from "./notification-root.js";
5
+ import { Text } from "./notification-text.js";
6
+ import { Footer } from "./notification-footer.js";
7
+ const Notification = Root;
8
+ Notification.Text = Text;
9
+ Notification.Heading = Heading;
10
+ Notification.Footer = Footer;
11
+ Notification.Icon = Icon;
12
+ Notification.Dismiss = Dismiss;
2
13
  export {
3
14
  Notification
4
15
  };
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ const clsx = require("clsx");
6
+ const CollapsiblePrimitive = require("@radix-ui/react-collapsible");
7
+ const components_button_button = require("../button/button.cjs");
8
+ require("../../assets/sprite.1321fab0-teddy.svg");
9
+ const components_icon_icon = require("../icon/icon.cjs");
10
+ const components_notification_notificationRoot = require("./notification-root.cjs");
11
+ function _interopNamespaceDefault(e) {
12
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
13
+ if (e) {
14
+ for (const k in e) {
15
+ if (k !== "default") {
16
+ const d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: () => e[k]
20
+ });
21
+ }
22
+ }
23
+ }
24
+ n.default = e;
25
+ return Object.freeze(n);
26
+ }
27
+ const CollapsiblePrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(CollapsiblePrimitive);
28
+ const Dismiss = React.forwardRef(
29
+ ({ className, children, ...props }, forwardRef) => {
30
+ const classes = clsx([components_notification_notificationRoot.styles[`${components_notification_notificationRoot.rootClassName}__dismiss`]], className);
31
+ return /* @__PURE__ */ jsxRuntime.jsx(CollapsiblePrimitive__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
32
+ components_button_button.Button,
33
+ {
34
+ iconOnly: true,
35
+ "aria-label": "Lukk",
36
+ variant: "tertiary-purple",
37
+ ...props,
38
+ ref: forwardRef,
39
+ className: classes,
40
+ children: children || /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { size: "sm", name: "close" })
41
+ }
42
+ ) });
43
+ }
44
+ );
45
+ Dismiss.displayName = "Dismiss";
46
+ exports.Dismiss = Dismiss;
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ import { Button as ButtonPrimitives } from '../button';
3
+
4
+ export type DismissProps = Omit<React.ComponentPropsWithoutRef<typeof ButtonPrimitives>, 'variant'>;
5
+ export declare const Dismiss: React.ForwardRefExoticComponent<DismissProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,29 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import React__default from "react";
3
+ import clsx from "clsx";
4
+ import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
5
+ import { Button } from "../button/button.js";
6
+ import "../../assets/sprite.1321fab0-teddy.svg";
7
+ import { Icon } from "../icon/icon.js";
8
+ import { s as styles, rootClassName } from "./notification-root.js";
9
+ const Dismiss = React__default.forwardRef(
10
+ ({ className, children, ...props }, forwardRef) => {
11
+ const classes = clsx([styles[`${rootClassName}__dismiss`]], className);
12
+ return /* @__PURE__ */ jsx(CollapsiblePrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
13
+ Button,
14
+ {
15
+ iconOnly: true,
16
+ "aria-label": "Lukk",
17
+ variant: "tertiary-purple",
18
+ ...props,
19
+ ref: forwardRef,
20
+ className: classes,
21
+ children: children || /* @__PURE__ */ jsx(Icon, { size: "sm", name: "close" })
22
+ }
23
+ ) });
24
+ }
25
+ );
26
+ Dismiss.displayName = "Dismiss";
27
+ export {
28
+ Dismiss
29
+ };
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ const clsx = require("clsx");
6
+ const components_notification_notificationRoot = require("./notification-root.cjs");
7
+ const components_box_box = require("../box/box.cjs");
8
+ const Footer = React.forwardRef(
9
+ ({ className, ...props }, forwardRef) => {
10
+ const classes = clsx([components_notification_notificationRoot.styles[`${components_notification_notificationRoot.rootClassName}__footer`]], className);
11
+ const context = React.useContext(components_notification_notificationRoot.NotificationContext);
12
+ if ((context == null ? void 0 : context.type) === "tile")
13
+ return null;
14
+ return /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { ...props, ref: forwardRef, className: classes });
15
+ }
16
+ );
17
+ Footer.displayName = "Notification.Footer";
18
+ exports.Footer = Footer;
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ import { Box } from '../box';
3
+
4
+ export type FooterProps = React.ComponentPropsWithoutRef<typeof Box>;
5
+ export declare const Footer: React.ForwardRefExoticComponent<FooterProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,18 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import React__default from "react";
3
+ import clsx from "clsx";
4
+ import { s as styles, rootClassName, NotificationContext } from "./notification-root.js";
5
+ import { Box } from "../box/box.js";
6
+ const Footer = React__default.forwardRef(
7
+ ({ className, ...props }, forwardRef) => {
8
+ const classes = clsx([styles[`${rootClassName}__footer`]], className);
9
+ const context = React__default.useContext(NotificationContext);
10
+ if ((context == null ? void 0 : context.type) === "tile")
11
+ return null;
12
+ return /* @__PURE__ */ jsx(Box, { ...props, ref: forwardRef, className: classes });
13
+ }
14
+ );
15
+ Footer.displayName = "Notification.Footer";
16
+ export {
17
+ Footer
18
+ };
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ const components_heading_heading = require("../heading/heading.cjs");
6
+ const components_notification_notificationRoot = require("./notification-root.cjs");
7
+ const clsx = require("clsx");
8
+ const Heading = React.forwardRef(
9
+ ({ className, ...props }, forwardRef) => {
10
+ const classes = clsx([components_notification_notificationRoot.styles[`${components_notification_notificationRoot.rootClassName}__heading`]], className);
11
+ const context = React.useContext(components_notification_notificationRoot.NotificationContext);
12
+ if ((context == null ? void 0 : context.type) === "tile")
13
+ return null;
14
+ return /* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { ...props, variant: "subsection-100", asChild: false, ref: forwardRef, className: classes });
15
+ }
16
+ );
17
+ Heading.displayName = "Heading";
18
+ exports.Heading = Heading;
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ import { Heading as HeadingPrimitives } from '../heading';
3
+
4
+ export type HeadingProps = Omit<React.ComponentPropsWithoutRef<typeof HeadingPrimitives>, 'asChild' | 'variant'>;
5
+ export declare const Heading: React.ForwardRefExoticComponent<HeadingProps & React.RefAttributes<HTMLHeadingElement>>;
@@ -0,0 +1,18 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import React__default from "react";
3
+ import { Heading as Heading$1 } from "../heading/heading.js";
4
+ import { s as styles, rootClassName, NotificationContext } from "./notification-root.js";
5
+ import clsx from "clsx";
6
+ const Heading = React__default.forwardRef(
7
+ ({ className, ...props }, forwardRef) => {
8
+ const classes = clsx([styles[`${rootClassName}__heading`]], className);
9
+ const context = React__default.useContext(NotificationContext);
10
+ if ((context == null ? void 0 : context.type) === "tile")
11
+ return null;
12
+ return /* @__PURE__ */ jsx(Heading$1, { ...props, variant: "subsection-100", asChild: false, ref: forwardRef, className: classes });
13
+ }
14
+ );
15
+ Heading.displayName = "Heading";
16
+ export {
17
+ Heading
18
+ };
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ require("../../assets/sprite.1321fab0-teddy.svg");
6
+ const components_icon_icon = require("../icon/icon.cjs");
7
+ const components_notification_notificationRoot = require("./notification-root.cjs");
8
+ const clsx = require("clsx");
9
+ function getVariantIcon(variant) {
10
+ switch (variant) {
11
+ case "success":
12
+ return "check-circle-filled";
13
+ case "error":
14
+ return "error-filled";
15
+ case "warning":
16
+ return "alert-filled";
17
+ case "information":
18
+ return "info-filled";
19
+ }
20
+ }
21
+ const Icon = React.forwardRef(
22
+ ({ className, ...props }, forwardRef) => {
23
+ const classes = clsx([components_notification_notificationRoot.styles[`${components_notification_notificationRoot.rootClassName}__icon`]], className);
24
+ const context = React.useContext(components_notification_notificationRoot.NotificationContext);
25
+ const name = props.name || getVariantIcon(context == null ? void 0 : context.variant);
26
+ if (!name)
27
+ return props.children;
28
+ return /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { size: "md", ...props, name, ref: forwardRef, className: classes });
29
+ }
30
+ );
31
+ Icon.displayName = "Icon";
32
+ exports.Icon = Icon;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ import { Icon as IconPrimitives } from '../icon';
3
+
4
+ export type IconProps = Partial<React.ComponentPropsWithoutRef<typeof IconPrimitives>>;
5
+ export declare const Icon: React.ForwardRefExoticComponent<Partial<Omit<React.SVGProps<SVGSVGElement> & {
6
+ name: "link" | "map" | "menu" | "search" | "summary" | "time" | "video" | "filter" | "image" | "stop" | "key" | "x" | "download" | "split" | "alert" | "radio" | "email" | "copy" | "help" | "zoom-out" | "present" | "add" | "reverse" | "infinite" | "visible" | "zoom" | "alarm-off" | "alarm-on" | "attachment" | "bookmark-filled" | "bookmark" | "copy-filled" | "dislike" | "edit" | "heart-filled" | "heart" | "invisible" | "like" | "lock-open" | "lock" | "login" | "logout" | "maximize" | "minimize" | "mute" | "password-invisible" | "password-visible" | "play-filled" | "play" | "remove-filled" | "remove" | "save" | "send" | "settings" | "share" | "shortcut" | "shuffle" | "skip-back-10sec" | "skip-back-30sec" | "skip-forward-10sec" | "skip-forward-30sec" | "star-filled" | "star" | "switch-arrows" | "sync" | "tv-next" | "tv-pause" | "tv-previous" | "tv-stop" | "upload" | "volume" | "connected-building" | "home" | "hospital" | "industry" | "premises-datacenter" | "premises-large" | "premises-medium" | "premises-small" | "premises" | "store" | "address-book" | "b2b-customer" | "care" | "chat-robot" | "chat" | "child-1" | "child-2" | "conversation" | "customer-dialogue" | "dsl-hub" | "end-user" | "handshake" | "headphones" | "letter" | "mms" | "new-contact" | "new-group" | "news" | "parental-guide" | "people-hub" | "people" | "portal" | "signature" | "smiley-happy" | "smiley-sad" | "sms" | "support" | "user-admin" | "vcard" | "voicemail" | "battery" | "bluetooth" | "broadband" | "broken-phone" | "cast" | "cloud-connect" | "connected" | "core-router" | "daas-device" | "data-transfer" | "desktop" | "devices" | "esim-simcard" | "esim" | "face-id" | "fiber" | "fingerprint" | "fiveg" | "fourg" | "home-installation" | "industrial-iot" | "internet" | "it-service" | "laptop" | "mobile-broadband" | "network" | "phone-recycling" | "phone-ringing" | "phone" | "rack" | "refill-card" | "remote-control" | "repair" | "roaming" | "router" | "secure-device" | "sense-car" | "server" | "service-device" | "service-supervision" | "slow-wifi" | "smart-wifi" | "smartphone" | "smartwatch" | "tablet" | "trade-phone" | "tv" | "usb" | "voice-switch" | "wallplug" | "wireless-off" | "wireless-weak" | "wireless" | "world-alert" | "world-off" | "world-question" | "bar-chart" | "doc" | "document-doc" | "document-edit" | "document-pdf" | "document-ppt" | "excel" | "folder-copy" | "folder-new" | "folder" | "gif" | "graph" | "media-content" | "org-chart" | "pie-chart" | "print" | "register" | "report" | "simcard" | "spell-check" | "credit-card" | "euro" | "invoice" | "kontantkort" | "kr" | "late-payment" | "money-back-euro" | "money-back-kr" | "money-euro" | "money-kr" | "pay-monthly-euro" | "pay-monthly-kr" | "pay-once-euro" | "pay-once-kr" | "payment-success" | "savings" | "wallet" | "airplay" | "camera" | "entertainment" | "external" | "film" | "games" | "megaphone" | "microphone" | "music" | "player-settings" | "record" | "stream" | "trailer" | "video-conference" | "activity-level" | "ai-robot" | "bag" | "basketball" | "blood-pressure" | "bulb" | "business-continuity" | "business-intelligence" | "calendar" | "cart" | "close-circle" | "cloud" | "coffee" | "compass" | "construction" | "cookie" | "delivery" | "drone" | "education" | "efficiency" | "environment" | "facemask" | "flag" | "focus" | "food" | "fraud" | "getting-started" | "home-care" | "job-search" | "layers" | "measuring-health" | "moisture" | "offering" | "offshore" | "optimization" | "pebble" | "pet-dog" | "pin" | "plane" | "plus-minus" | "police" | "power-grid" | "press-button" | "price" | "pulse" | "recycle" | "reservation" | "route" | "ruler" | "satellite" | "secured-1" | "secured-2" | "security-camera" | "shopping" | "smart-connect" | "snowflake" | "speedometer" | "spyware" | "suitcase" | "sustainability" | "tag" | "temperature" | "thinking" | "train" | "transfer" | "undo" | "wavelength" | "weather" | "world" | "android" | "apple" | "bankid-norway" | "bankid" | "facebook" | "instagram" | "linkedin" | "snapchat" | "telia-logo" | "whatsapp" | "windows" | "youtube" | "alert-filled" | "check-circle-filled" | "check-circle" | "error-filled" | "error" | "info-filled" | "info" | "question-filled" | "question" | "warning" | "arrow-down" | "arrow-left" | "arrow-right" | "arrow-subdirectory" | "arrow-up" | "card-view" | "checkmark-bold" | "checkmark" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "close" | "grid-view" | "list-view" | "minus-bold" | "minus" | "more-horizontal" | "more-vertical" | "plus" | "services" | "sorter" | "table-view";
7
+ size?: ("sm" | "md" | "lg" | "xl" | "xs" | "font" | "xxs") | undefined;
8
+ children?: React.ReactNode;
9
+ }, "ref">> & React.RefAttributes<SVGSVGElement>>;
@@ -0,0 +1,32 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import React__default from "react";
3
+ import "../../assets/sprite.1321fab0-teddy.svg";
4
+ import { Icon as Icon$1 } from "../icon/icon.js";
5
+ import { s as styles, rootClassName, NotificationContext } from "./notification-root.js";
6
+ import clsx from "clsx";
7
+ function getVariantIcon(variant) {
8
+ switch (variant) {
9
+ case "success":
10
+ return "check-circle-filled";
11
+ case "error":
12
+ return "error-filled";
13
+ case "warning":
14
+ return "alert-filled";
15
+ case "information":
16
+ return "info-filled";
17
+ }
18
+ }
19
+ const Icon = React__default.forwardRef(
20
+ ({ className, ...props }, forwardRef) => {
21
+ const classes = clsx([styles[`${rootClassName}__icon`]], className);
22
+ const context = React__default.useContext(NotificationContext);
23
+ const name = props.name || getVariantIcon(context == null ? void 0 : context.variant);
24
+ if (!name)
25
+ return props.children;
26
+ return /* @__PURE__ */ jsx(Icon$1, { size: "md", ...props, name, ref: forwardRef, className: classes });
27
+ }
28
+ );
29
+ Icon.displayName = "Icon";
30
+ export {
31
+ Icon
32
+ };
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ const clsx = require("clsx");
6
+ const CollapsiblePrimitive = require("@radix-ui/react-collapsible");
7
+ const reactUseControllableState = require("@radix-ui/react-use-controllable-state");
8
+ const components_card_index = require("../card/index.cjs");
9
+ function _interopNamespaceDefault(e) {
10
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
11
+ if (e) {
12
+ for (const k in e) {
13
+ if (k !== "default") {
14
+ const d = Object.getOwnPropertyDescriptor(e, k);
15
+ Object.defineProperty(n, k, d.get ? d : {
16
+ enumerable: true,
17
+ get: () => e[k]
18
+ });
19
+ }
20
+ }
21
+ }
22
+ n.default = e;
23
+ return Object.freeze(n);
24
+ }
25
+ const CollapsiblePrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(CollapsiblePrimitive);
26
+ const styles = {
27
+ "teddy-notification": "_teddy-notification_18bjx_3",
28
+ "teddy-notification--success": "_teddy-notification--success_18bjx_11",
29
+ "teddy-notification--warning": "_teddy-notification--warning_18bjx_16",
30
+ "teddy-notification--error": "_teddy-notification--error_18bjx_21",
31
+ "teddy-notification--information": "_teddy-notification--information_18bjx_26",
32
+ "teddy-notification--beige": "_teddy-notification--beige_18bjx_31",
33
+ "teddy-notification--teal": "_teddy-notification--teal_18bjx_36",
34
+ "teddy-notification--gray": "_teddy-notification--gray_18bjx_41",
35
+ "teddy-notification--tile": "_teddy-notification--tile_18bjx_46",
36
+ "teddy-notification__text": "_teddy-notification__text_18bjx_49",
37
+ "teddy-notification__dismiss": "_teddy-notification__dismiss_18bjx_52",
38
+ "teddy-notification__heading": "_teddy-notification__heading_18bjx_56",
39
+ "teddy-notification__footer": "_teddy-notification__footer_18bjx_65",
40
+ "teddy-notification__icon": "_teddy-notification__icon_18bjx_68"
41
+ };
42
+ const rootClassName = "teddy-notification";
43
+ const NotificationContext = React.createContext(void 0);
44
+ const Root = React.forwardRef(
45
+ ({ className, open: openProp, defaultOpen, onOpenChange, variant, type, ...props }, forwardRef) => {
46
+ const classes = clsx([styles[`${rootClassName}`]], styles[`${rootClassName}--${variant}`], styles[`${rootClassName}--${type}`], className);
47
+ const [open = true, setOpen] = reactUseControllableState.useControllableState({
48
+ prop: openProp,
49
+ defaultProp: defaultOpen,
50
+ onChange: onOpenChange
51
+ });
52
+ return /* @__PURE__ */ jsxRuntime.jsx(NotificationContext.Provider, { value: { variant, type }, children: /* @__PURE__ */ jsxRuntime.jsx(CollapsiblePrimitive__namespace.Root, { open, onOpenChange: setOpen, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(CollapsiblePrimitive__namespace.Content, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(components_card_index.Card, { variant: "white", as: void 0, ...props, ref: forwardRef, className: classes }) }) }) });
53
+ }
54
+ );
55
+ Root.displayName = "Root";
56
+ exports.NotificationContext = NotificationContext;
57
+ exports.Root = Root;
58
+ exports.rootClassName = rootClassName;
59
+ exports.styles = styles;
@@ -0,0 +1,86 @@
1
+ import { default as React } from 'react';
2
+ import { Card } from '../card';
3
+
4
+ export declare const rootClassName = "teddy-notification";
5
+ export type RootProps = Omit<React.ComponentPropsWithoutRef<typeof Card>, 'variant' | 'as' | 'layout'> & {
6
+ /**
7
+ * The variant of the notification.
8
+ *
9
+ */
10
+ variant?: 'success' | 'error' | 'warning' | 'information' | 'beige' | 'teal' | 'gray';
11
+ /**
12
+ * The tyoe of the notification.
13
+ *
14
+ */
15
+ type?: 'card' | 'tile';
16
+ open?: boolean;
17
+ defaultOpen?: boolean;
18
+ onOpenChange?: (open: boolean) => void;
19
+ role?: 'alert';
20
+ };
21
+ export declare const NotificationContext: React.Context<Pick<RootProps, "type" | "variant"> | undefined>;
22
+ /** Groups Icon and Text parts. This component is based on the div element */
23
+ export declare const Root: React.ForwardRefExoticComponent<Omit<Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('../../utils/generate-styling/flex').FlexChildren & import('../../utils/generate-styling/grid').GridChildren & import('../../utils/generate-styling/position').PositionProps & import('../../utils/generate-styling/inset').InsetProps & import('../../utils/generate-styling/radius').RadiusProps & import('../../utils/generate-styling/margin').MarginProps & import('../../utils/generate-styling/padding').PaddingProps & import('../../utils/generate-styling/width').WidthProps & import('../../utils/generate-styling/height').HeightProps & import('../../utils/generate-styling/color').ColorProps & {
24
+ display?: import('../../utils/generate-styling').DisplayChildren | undefined;
25
+ } & import('../../utils/generate-styling/gap').GapProps & {
26
+ align?: import('../../utils/generate-styling/align').Align | undefined;
27
+ justify?: import('../../utils/generate-styling/justify').Justify | undefined;
28
+ } & import('../../utils/generate-styling/grid').GridLayout & {
29
+ asChild: true;
30
+ as?: undefined;
31
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & {
32
+ asChild?: boolean | undefined;
33
+ variant?: "beige" | "gray" | "white" | "purple-light" | "purple-dark" | "beige-light" | undefined;
34
+ bordered?: boolean | undefined;
35
+ shadow?: boolean | undefined;
36
+ backgroundImageSrc?: string | undefined;
37
+ imageGradient?: ("default" | "dark" | "light") | undefined;
38
+ layout?: import('../card/card').Layout | undefined;
39
+ } & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('../../utils/generate-styling/flex').FlexChildren & import('../../utils/generate-styling/grid').GridChildren & import('../../utils/generate-styling/position').PositionProps & import('../../utils/generate-styling/inset').InsetProps & import('../../utils/generate-styling/radius').RadiusProps & import('../../utils/generate-styling/margin').MarginProps & import('../../utils/generate-styling/padding').PaddingProps & import('../../utils/generate-styling/width').WidthProps & import('../../utils/generate-styling/height').HeightProps & import('../../utils/generate-styling/color').ColorProps & {
40
+ display?: import('../../utils/generate-styling').DisplayChildren | undefined;
41
+ } & import('../../utils/generate-styling/gap').GapProps & {
42
+ align?: import('../../utils/generate-styling/align').Align | undefined;
43
+ justify?: import('../../utils/generate-styling/justify').Justify | undefined;
44
+ } & import('../../utils/generate-styling/grid').GridLayout & {
45
+ as?: "span" | undefined;
46
+ asChild?: false | undefined;
47
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & {
48
+ asChild?: boolean | undefined;
49
+ variant?: "beige" | "gray" | "white" | "purple-light" | "purple-dark" | "beige-light" | undefined;
50
+ bordered?: boolean | undefined;
51
+ shadow?: boolean | undefined;
52
+ backgroundImageSrc?: string | undefined;
53
+ imageGradient?: ("default" | "dark" | "light") | undefined;
54
+ layout?: import('../card/card').Layout | undefined;
55
+ } & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('../../utils/generate-styling/flex').FlexChildren & import('../../utils/generate-styling/grid').GridChildren & import('../../utils/generate-styling/position').PositionProps & import('../../utils/generate-styling/inset').InsetProps & import('../../utils/generate-styling/radius').RadiusProps & import('../../utils/generate-styling/margin').MarginProps & import('../../utils/generate-styling/padding').PaddingProps & import('../../utils/generate-styling/width').WidthProps & import('../../utils/generate-styling/height').HeightProps & import('../../utils/generate-styling/color').ColorProps & {
56
+ display?: import('../../utils/generate-styling').DisplayChildren | undefined;
57
+ } & import('../../utils/generate-styling/gap').GapProps & {
58
+ align?: import('../../utils/generate-styling/align').Align | undefined;
59
+ justify?: import('../../utils/generate-styling/justify').Justify | undefined;
60
+ } & import('../../utils/generate-styling/grid').GridLayout & {
61
+ as: "div";
62
+ asChild?: false | undefined;
63
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & {
64
+ asChild?: boolean | undefined;
65
+ variant?: "beige" | "gray" | "white" | "purple-light" | "purple-dark" | "beige-light" | undefined;
66
+ bordered?: boolean | undefined;
67
+ shadow?: boolean | undefined;
68
+ backgroundImageSrc?: string | undefined;
69
+ imageGradient?: ("default" | "dark" | "light") | undefined;
70
+ layout?: import('../card/card').Layout | undefined;
71
+ } & React.RefAttributes<HTMLDivElement>, "ref">, "as" | "layout" | "variant"> & {
72
+ /**
73
+ * The variant of the notification.
74
+ *
75
+ */
76
+ variant?: "beige" | "gray" | "teal" | "error" | "warning" | "information" | "success" | undefined;
77
+ /**
78
+ * The tyoe of the notification.
79
+ *
80
+ */
81
+ type?: "card" | "tile" | undefined;
82
+ open?: boolean | undefined;
83
+ defaultOpen?: boolean | undefined;
84
+ onOpenChange?: ((open: boolean) => void) | undefined;
85
+ role?: "alert" | undefined;
86
+ } & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,42 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import React__default from "react";
3
+ import clsx from "clsx";
4
+ import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
5
+ import { useControllableState } from "@radix-ui/react-use-controllable-state";
6
+ import { Card } from "../card/index.js";
7
+ const styles = {
8
+ "teddy-notification": "_teddy-notification_18bjx_3",
9
+ "teddy-notification--success": "_teddy-notification--success_18bjx_11",
10
+ "teddy-notification--warning": "_teddy-notification--warning_18bjx_16",
11
+ "teddy-notification--error": "_teddy-notification--error_18bjx_21",
12
+ "teddy-notification--information": "_teddy-notification--information_18bjx_26",
13
+ "teddy-notification--beige": "_teddy-notification--beige_18bjx_31",
14
+ "teddy-notification--teal": "_teddy-notification--teal_18bjx_36",
15
+ "teddy-notification--gray": "_teddy-notification--gray_18bjx_41",
16
+ "teddy-notification--tile": "_teddy-notification--tile_18bjx_46",
17
+ "teddy-notification__text": "_teddy-notification__text_18bjx_49",
18
+ "teddy-notification__dismiss": "_teddy-notification__dismiss_18bjx_52",
19
+ "teddy-notification__heading": "_teddy-notification__heading_18bjx_56",
20
+ "teddy-notification__footer": "_teddy-notification__footer_18bjx_65",
21
+ "teddy-notification__icon": "_teddy-notification__icon_18bjx_68"
22
+ };
23
+ const rootClassName = "teddy-notification";
24
+ const NotificationContext = React__default.createContext(void 0);
25
+ const Root = React__default.forwardRef(
26
+ ({ className, open: openProp, defaultOpen, onOpenChange, variant, type, ...props }, forwardRef) => {
27
+ const classes = clsx([styles[`${rootClassName}`]], styles[`${rootClassName}--${variant}`], styles[`${rootClassName}--${type}`], className);
28
+ const [open = true, setOpen] = useControllableState({
29
+ prop: openProp,
30
+ defaultProp: defaultOpen,
31
+ onChange: onOpenChange
32
+ });
33
+ return /* @__PURE__ */ jsx(NotificationContext.Provider, { value: { variant, type }, children: /* @__PURE__ */ jsx(CollapsiblePrimitive.Root, { open, onOpenChange: setOpen, asChild: true, children: /* @__PURE__ */ jsx(CollapsiblePrimitive.Content, { asChild: true, children: /* @__PURE__ */ jsx(Card, { variant: "white", as: void 0, ...props, ref: forwardRef, className: classes }) }) }) });
34
+ }
35
+ );
36
+ Root.displayName = "Root";
37
+ export {
38
+ NotificationContext,
39
+ Root,
40
+ rootClassName,
41
+ styles as s
42
+ };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ const clsx = require("clsx");
6
+ const components_text_text = require("../text/text.cjs");
7
+ const components_notification_notificationRoot = require("./notification-root.cjs");
8
+ const Text = React.forwardRef(
9
+ ({ className, ...props }, forwardRef) => {
10
+ const classes = clsx([components_notification_notificationRoot.styles[`${components_notification_notificationRoot.rootClassName}__text`]], className);
11
+ return /* @__PURE__ */ jsxRuntime.jsx(components_text_text.Text, { ...props, ref: forwardRef, className: classes });
12
+ }
13
+ );
14
+ Text.displayName = "Text";
15
+ exports.Text = Text;