@telia/teddy 0.0.18 → 0.0.19
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.
- package/README.md +0 -3
- package/dist/components/accordion/accordion.d.ts +2 -2
- package/dist/components/box/box.d.ts +1 -1
- package/dist/components/box/box.js +1 -1
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/card/card.d.ts +10 -9
- package/dist/components/card/card.js +37 -39
- package/dist/components/chip/chip-indicator.d.ts +9 -0
- package/dist/components/chip/chip-indicator.js +16 -0
- package/dist/components/chip/chip-item.d.ts +9 -0
- package/dist/components/chip/chip-item.js +28 -0
- package/dist/components/chip/chip.d.ts +20 -0
- package/dist/components/chip/chip.js +31 -0
- package/dist/components/chip/index.d.ts +17 -0
- package/dist/components/chip/index.js +10 -0
- package/dist/components/field-error-text/field-error-text.d.ts +2 -2
- package/dist/components/flex/flex.d.ts +1 -1
- package/dist/components/flex/flex.js +1 -1
- package/dist/components/grid/grid.d.ts +1 -1
- package/dist/components/grid/grid.js +1 -1
- package/dist/components/heading/heading.d.ts +1 -1
- package/dist/components/heading/heading.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +2 -0
- package/dist/components/modal/modal.d.ts +3 -3
- package/dist/components/modal/modal.js +1 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +1 -1
- package/dist/components/notification/notification.d.ts +21 -18
- package/dist/components/radio-group/radio-group.d.ts +1 -1
- package/dist/components/text/text.d.ts +3 -1
- package/dist/components/text/text.js +38 -27
- package/dist/components/text-field/text-field.d.ts +4 -4
- package/dist/components/toggle/toggle.d.ts +2 -2
- package/dist/main.js +2 -0
- package/dist/style.css +350 -221
- package/dist/utils/generate-styling/color.d.ts +15 -0
- package/dist/utils/generate-styling/color.js +12 -0
- package/dist/utils/{layout → generate-styling}/index.d.ts +18 -13
- package/dist/utils/{layout → generate-styling}/index.js +2 -0
- package/package.json +1 -1
- /package/dist/utils/{layout → generate-styling}/align.d.ts +0 -0
- /package/dist/utils/{layout → generate-styling}/align.js +0 -0
- /package/dist/utils/{layout → generate-styling}/flex.d.ts +0 -0
- /package/dist/utils/{layout → generate-styling}/flex.js +0 -0
- /package/dist/utils/{layout → generate-styling}/gap.d.ts +0 -0
- /package/dist/utils/{layout → generate-styling}/gap.js +0 -0
- /package/dist/utils/{layout → generate-styling}/grid.d.ts +0 -0
- /package/dist/utils/{layout → generate-styling}/grid.js +0 -0
- /package/dist/utils/{layout → generate-styling}/height.d.ts +0 -0
- /package/dist/utils/{layout → generate-styling}/height.js +0 -0
- /package/dist/utils/{layout → generate-styling}/inset.d.ts +0 -0
- /package/dist/utils/{layout → generate-styling}/inset.js +0 -0
- /package/dist/utils/{layout → generate-styling}/justify.d.ts +0 -0
- /package/dist/utils/{layout → generate-styling}/justify.js +0 -0
- /package/dist/utils/{layout → generate-styling}/margin.d.ts +0 -0
- /package/dist/utils/{layout → generate-styling}/margin.js +0 -0
- /package/dist/utils/{layout → generate-styling}/padding.d.ts +0 -0
- /package/dist/utils/{layout → generate-styling}/padding.js +0 -0
- /package/dist/utils/{layout → generate-styling}/position.d.ts +0 -0
- /package/dist/utils/{layout → generate-styling}/position.js +0 -0
- /package/dist/utils/{layout → generate-styling}/util.d.ts +0 -0
- /package/dist/utils/{layout → generate-styling}/util.js +0 -0
- /package/dist/utils/{layout → generate-styling}/width.d.ts +0 -0
- /package/dist/utils/{layout → generate-styling}/width.js +0 -0
package/README.md
CHANGED
|
@@ -22,9 +22,6 @@ Teddy is built on a foundation of three core principles:
|
|
|
22
22
|
- **Accessibility**: With a commitment to inclusivity, accessibility is at the forefront of our design process. We aim
|
|
23
23
|
to make our components universally usable, adhering to WCAG guidelines and accessibility best practices.
|
|
24
24
|
|
|
25
|
-
- **Performance**: We prioritize high performance to guarantee a smooth user experience. Our components are optimized
|
|
26
|
-
for efficiency, balancing speed with functionality.
|
|
27
|
-
|
|
28
25
|
## Getting Started
|
|
29
26
|
|
|
30
27
|
To contribute to or utilize Teddy:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IconProps } from '../icon';
|
|
2
|
-
import { HeadingProps } from '../heading';
|
|
3
1
|
import { default as React } from 'react';
|
|
2
|
+
import { HeadingProps } from '../heading';
|
|
3
|
+
import { IconProps } from '../icon';
|
|
4
4
|
|
|
5
5
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
6
6
|
/** -------------------------------------------------------------------------------------------------
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ChildrenLayoutProps } from '../../utils/layout';
|
|
2
1
|
import { default as React } from 'react';
|
|
2
|
+
import { ChildrenLayoutProps } from '../../utils/generate-styling';
|
|
3
3
|
|
|
4
4
|
/** -------------------------------------------------------------------------------------------------
|
|
5
5
|
* Box
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import React__default from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
import { extractProps } from "../../utils/
|
|
4
|
+
import { extractProps } from "../../utils/generate-styling/index.js";
|
|
5
5
|
import { Slot } from "@radix-ui/react-slot";
|
|
6
6
|
const styles = {};
|
|
7
7
|
const rootClassName = "teddy-box";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChildrenLayoutProps } from '../../utils/
|
|
1
|
+
import { ChildrenLayoutProps } from '../../utils/generate-styling';
|
|
2
2
|
import * as React from 'react';
|
|
3
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"];
|
|
4
4
|
export type Variant = (typeof variants)[number];
|
|
@@ -3,7 +3,7 @@ import { Slottable, Slot } from "@radix-ui/react-slot";
|
|
|
3
3
|
import { clsx } from "clsx";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { Spinner } from "../spinner/spinner.js";
|
|
6
|
-
import { extractProps } from "../../utils/
|
|
6
|
+
import { extractProps } from "../../utils/generate-styling/index.js";
|
|
7
7
|
const fadeInAnimation = "_fadeInAnimation_1biph_1";
|
|
8
8
|
const scaleInAnimation = "_scaleInAnimation_1biph_1";
|
|
9
9
|
const styles = {
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { Link as PrimitiveLink } from '../link';
|
|
2
|
-
import { Button as PrimitiveButton } from '../button';
|
|
3
|
-
import { Heading as PrimitiveHeading } from '../heading';
|
|
4
|
-
import { Box } from '../box';
|
|
5
|
-
import { Flex } from '../flex';
|
|
6
1
|
import { default as React } from 'react';
|
|
2
|
+
import { Box } from '../box';
|
|
3
|
+
import { Heading as PrimitiveHeading } from '../heading';
|
|
4
|
+
import { Button as PrimitiveButton } from '../button';
|
|
5
|
+
import { Link as PrimitiveLink } from '../link';
|
|
6
|
+
import { Grid } from '../grid';
|
|
7
7
|
|
|
8
8
|
declare const variantOptions: readonly ["purple-light", "purple-dark", "gray", "white", "beige"];
|
|
9
9
|
type Variant = (typeof variantOptions)[number];
|
|
10
10
|
/** -------------------------------------------------------------------------------------------------
|
|
11
11
|
* Root
|
|
12
12
|
* -----------------------------------------------------------------------------------------------*/
|
|
13
|
-
type RootProps = React.ComponentPropsWithoutRef<typeof
|
|
13
|
+
type RootProps = React.ComponentPropsWithoutRef<typeof Grid> & {
|
|
14
14
|
asChild?: boolean;
|
|
15
15
|
variant?: Variant;
|
|
16
16
|
bordered?: boolean;
|
|
17
|
+
shadow?: boolean;
|
|
17
18
|
backgroundImageSrc?: string;
|
|
18
19
|
};
|
|
19
20
|
/** -------------------------------------------------------------------------------------------------
|
|
@@ -55,9 +56,9 @@ declare const Card: React.ForwardRefExoticComponent<RootProps & React.RefAttribu
|
|
|
55
56
|
Content: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
56
57
|
Image: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "ref"> & {
|
|
57
58
|
/** The inset allows make the image bleed out to the edges */
|
|
58
|
-
inset?: "
|
|
59
|
+
inset?: "top" | "bottom" | "left" | "right" | "all" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "top-right-left" | "bottom-left-right" | "top-bottom" | "left-right" | undefined;
|
|
59
60
|
} & React.RefAttributes<HTMLImageElement>>;
|
|
60
|
-
Button: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-label"> & import('../../utils/
|
|
61
|
+
Button: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-label"> & 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/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 & {
|
|
61
62
|
asChild?: boolean | undefined;
|
|
62
63
|
loading?: boolean | undefined;
|
|
63
64
|
fullWidth?: boolean | undefined;
|
|
@@ -66,7 +67,7 @@ declare const Card: React.ForwardRefExoticComponent<RootProps & React.RefAttribu
|
|
|
66
67
|
} & {
|
|
67
68
|
iconOnly: true;
|
|
68
69
|
"aria-label": string;
|
|
69
|
-
} & React.RefAttributes<HTMLButtonElement>, "ref"> | Omit<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-label"> & import('../../utils/
|
|
70
|
+
} & React.RefAttributes<HTMLButtonElement>, "ref"> | Omit<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-label"> & 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/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 & {
|
|
70
71
|
asChild?: boolean | undefined;
|
|
71
72
|
loading?: boolean | undefined;
|
|
72
73
|
fullWidth?: boolean | undefined;
|
|
@@ -3,42 +3,43 @@ import React__default from "react";
|
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { composeRefs } from "../../utils/composeRefs.js";
|
|
5
5
|
import { composeEventHandlers } from "../../utils/composeEventHandlers.js";
|
|
6
|
-
import { Flex } from "../flex/flex.js";
|
|
7
6
|
import { Box } from "../box/box.js";
|
|
8
7
|
import { Heading as Heading$1 } from "../heading/heading.js";
|
|
9
8
|
import { Button as Button$1 } from "../button/button.js";
|
|
10
9
|
import { Link as Link$1 } from "../link/link.js";
|
|
11
|
-
import { TextSpacing } from "../text-spacing/text-spacing.js";
|
|
12
10
|
import { teddySpacing50 } from "../../tokens/spacing/variables.js";
|
|
11
|
+
import { Grid } from "../grid/grid.js";
|
|
13
12
|
const styles = {
|
|
14
|
-
"teddy-card": "_teddy-
|
|
15
|
-
"teddy-card__slot": "_teddy-
|
|
16
|
-
"teddy-card__slot--bottom": "_teddy-card__slot--
|
|
17
|
-
"teddy-card__slot--center": "_teddy-card__slot--
|
|
18
|
-
"teddy-
|
|
19
|
-
"teddy-card__action
|
|
20
|
-
"teddy-
|
|
21
|
-
"teddy-
|
|
22
|
-
"teddy-
|
|
23
|
-
"teddy-card--purple-
|
|
24
|
-
"teddy-card--
|
|
25
|
-
"teddy-card--
|
|
26
|
-
"teddy-card--
|
|
27
|
-
"teddy-
|
|
28
|
-
"teddy-
|
|
29
|
-
"teddy-
|
|
30
|
-
"teddy-
|
|
31
|
-
"teddy-card__image
|
|
32
|
-
"teddy-
|
|
33
|
-
"teddy-
|
|
34
|
-
"teddy-
|
|
13
|
+
"teddy-card": "_teddy-card_1occu_3",
|
|
14
|
+
"teddy-card__slot": "_teddy-card__slot_1occu_13",
|
|
15
|
+
"teddy-card__slot--bottom": "_teddy-card__slot--bottom_1occu_16",
|
|
16
|
+
"teddy-card__slot--center": "_teddy-card__slot--center_1occu_19",
|
|
17
|
+
"teddy-card--shadow": "_teddy-card--shadow_1occu_41",
|
|
18
|
+
"teddy-card__action": "_teddy-card__action_1occu_45",
|
|
19
|
+
"teddy-card__action--disabled": "_teddy-card__action--disabled_1occu_45",
|
|
20
|
+
"teddy-card--border": "_teddy-card--border_1occu_52",
|
|
21
|
+
"teddy-card__line": "_teddy-card__line_1occu_55",
|
|
22
|
+
"teddy-card--purple-light": "_teddy-card--purple-light_1occu_59",
|
|
23
|
+
"teddy-card--purple-dark": "_teddy-card--purple-dark_1occu_73",
|
|
24
|
+
"teddy-card--white": "_teddy-card--white_1occu_92",
|
|
25
|
+
"teddy-card--gray": "_teddy-card--gray_1occu_106",
|
|
26
|
+
"teddy-card--beige": "_teddy-card--beige_1occu_120",
|
|
27
|
+
"teddy-card__image--as-background": "_teddy-card__image--as-background_1occu_134",
|
|
28
|
+
"teddy-card__heading": "_teddy-card__heading_1occu_137",
|
|
29
|
+
"teddy-card--background-image": "_teddy-card--background-image_1occu_140",
|
|
30
|
+
"teddy-card__image": "_teddy-card__image_1occu_134",
|
|
31
|
+
"teddy-card__inset": "_teddy-card__inset_1occu_157",
|
|
32
|
+
"teddy-card__inset--top": "_teddy-card__inset--top_1occu_161",
|
|
33
|
+
"teddy-card__inset--bottom": "_teddy-card__inset--bottom_1occu_164",
|
|
34
|
+
"teddy-card__inset--left": "_teddy-card__inset--left_1occu_167",
|
|
35
|
+
"teddy-card__inset--right": "_teddy-card__inset--right_1occu_170"
|
|
35
36
|
};
|
|
36
37
|
const rootClassName = "teddy-card";
|
|
37
38
|
const actionElementIdentifier = `${rootClassName}__action`;
|
|
38
39
|
const variantOptions = ["purple-light", "purple-dark", "gray", "white", "beige"];
|
|
39
40
|
const RootContext = React__default.createContext(void 0);
|
|
40
41
|
const Root = React__default.forwardRef(
|
|
41
|
-
({ className, children, backgroundImageSrc, variant, bordered, ...props }, forwardRef) => {
|
|
42
|
+
({ className, children, shadow, backgroundImageSrc, variant, bordered, ...props }, forwardRef) => {
|
|
42
43
|
const buttonRef = React__default.useRef(null);
|
|
43
44
|
const linkRef = React__default.useRef(null);
|
|
44
45
|
const classes = clsx(
|
|
@@ -46,14 +47,14 @@ const Root = React__default.forwardRef(
|
|
|
46
47
|
{
|
|
47
48
|
[styles[`${rootClassName}--${variant}`]]: variant,
|
|
48
49
|
[styles[`${rootClassName}--border`]]: bordered,
|
|
50
|
+
[styles[`${rootClassName}--shadow`]]: shadow,
|
|
49
51
|
[styles[`${rootClassName}--background-image`]]: backgroundImageSrc
|
|
50
52
|
},
|
|
51
53
|
className
|
|
52
54
|
);
|
|
53
|
-
return /* @__PURE__ */ jsx(RootContext.Provider, { value: { buttonRef, linkRef, variant }, children: /* @__PURE__ */ jsx(
|
|
54
|
-
|
|
55
|
+
return /* @__PURE__ */ jsx(RootContext.Provider, { value: { buttonRef, linkRef, variant }, children: /* @__PURE__ */ jsx(
|
|
56
|
+
Grid,
|
|
55
57
|
{
|
|
56
|
-
direction: "column",
|
|
57
58
|
...props,
|
|
58
59
|
className: classes,
|
|
59
60
|
style: backgroundImageSrc ? { background: `url(${backgroundImageSrc})`, ...props.style } : props.style,
|
|
@@ -68,7 +69,7 @@ const Root = React__default.forwardRef(
|
|
|
68
69
|
ref: forwardRef,
|
|
69
70
|
children
|
|
70
71
|
}
|
|
71
|
-
) })
|
|
72
|
+
) });
|
|
72
73
|
}
|
|
73
74
|
);
|
|
74
75
|
Root.displayName = "Card";
|
|
@@ -135,17 +136,14 @@ const insetOptions = [
|
|
|
135
136
|
];
|
|
136
137
|
const Image = React__default.forwardRef(({ className, ...props }, forwardRef) => {
|
|
137
138
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
{
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
className
|
|
147
|
-
);
|
|
148
|
-
return /* @__PURE__ */ jsx("img", { ...props, ref: forwardRef, className: classes });
|
|
139
|
+
const classesImage = clsx([styles[`${rootClassName}__image`]], className);
|
|
140
|
+
const classesContainer = clsx([styles[`${rootClassName}__inset`]], {
|
|
141
|
+
[styles[`${rootClassName}__inset--top`]]: ((_a = props.inset) == null ? void 0 : _a.includes("top")) || ((_b = props.inset) == null ? void 0 : _b.includes("all")),
|
|
142
|
+
[styles[`${rootClassName}__inset--bottom`]]: ((_c = props.inset) == null ? void 0 : _c.includes("bottom")) || ((_d = props.inset) == null ? void 0 : _d.includes("all")),
|
|
143
|
+
[styles[`${rootClassName}__inset--left`]]: ((_e = props.inset) == null ? void 0 : _e.includes("left")) || ((_f = props.inset) == null ? void 0 : _f.includes("all")),
|
|
144
|
+
[styles[`${rootClassName}__inset--right`]]: ((_g = props.inset) == null ? void 0 : _g.includes("right")) || ((_h = props.inset) == null ? void 0 : _h.includes("all"))
|
|
145
|
+
});
|
|
146
|
+
return /* @__PURE__ */ jsx("div", { className: classesContainer, children: /* @__PURE__ */ jsx("img", { ...props, ref: forwardRef, className: classesImage }) });
|
|
149
147
|
});
|
|
150
148
|
Image.displayName = "Card.Image";
|
|
151
149
|
function getButtonVariant(variant) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Icon } from '../icon';
|
|
3
|
+
|
|
4
|
+
export type IndicatorProps = Partial<React.ComponentPropsWithoutRef<typeof Icon>>;
|
|
5
|
+
export declare const Indicator: React.ForwardRefExoticComponent<Partial<Omit<React.SVGProps<SVGSVGElement> & {
|
|
6
|
+
name: "key" | "search" | "split" | "link" | "add" | "reverse" | "infinite" | "radio" | "visible" | "copy" | "help" | "zoom-out" | "filter" | "x" | "zoom" | "menu" | "map" | "summary" | "time" | "video" | "image" | "stop" | "download" | "alert" | "email" | "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" | "shuffle" | "sync" | "skip-back-10sec" | "skip-back-30sec" | "skip-forward-10sec" | "skip-forward-30sec" | "star-filled" | "star" | "switch-arrows" | "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" | "present" | "press-button" | "price" | "pulse" | "recycle" | "reservation" | "route" | "ruler" | "satellite" | "secured-1" | "secured-2" | "security-camera" | "shopping" | "snowflake" | "speedometer" | "spyware" | "suitcase" | "sustainability" | "tag" | "temperature" | "thinking" | "train" | "transfer" | "undo" | "wavelength" | "weather" | "world" | "android" | "apple" | "bankid-norway" | "bankid" | "facebook" | "instagram" | "youtube" | "linkedin" | "snapchat" | "telia-logo" | "whatsapp" | "windows" | "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" | "font" | "xxs" | "xs") | undefined;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}, "ref">> & React.RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React__default from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { s as styles, rootClassName } from "./chip.js";
|
|
5
|
+
import "../../assets/5636ec8e4de58d64.svg";
|
|
6
|
+
import { Icon } from "../icon/icon.js";
|
|
7
|
+
const Indicator = React__default.forwardRef(
|
|
8
|
+
({ className, ...props }, forwardRef) => {
|
|
9
|
+
const classes = clsx([styles[`${rootClassName}__indicator`]], className);
|
|
10
|
+
return /* @__PURE__ */ jsx(Icon, { name: "checkmark", ...props, ref: forwardRef, className: classes });
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
Indicator.displayName = "Indicator";
|
|
14
|
+
export {
|
|
15
|
+
Indicator
|
|
16
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Flex } from '../flex';
|
|
3
|
+
|
|
4
|
+
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
5
|
+
export type ItemProps = React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> & {
|
|
6
|
+
unavailable?: boolean;
|
|
7
|
+
} & React.ComponentPropsWithoutRef<typeof Flex>;
|
|
8
|
+
/** An item in the group. */
|
|
9
|
+
export declare const Item: React.ForwardRefExoticComponent<ItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React__default from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
5
|
+
import { RootContext, s as styles, rootClassName } from "./chip.js";
|
|
6
|
+
import { Flex } from "../flex/flex.js";
|
|
7
|
+
import { Indicator } from "./chip-indicator.js";
|
|
8
|
+
const Item = React__default.forwardRef(function Item2({ className, unavailable, ...props }, forwardRef) {
|
|
9
|
+
const context = React__default.useContext(RootContext);
|
|
10
|
+
const classes = clsx(
|
|
11
|
+
[
|
|
12
|
+
styles[`${rootClassName}__item`],
|
|
13
|
+
{
|
|
14
|
+
[styles[`${rootClassName}__item--${context == null ? void 0 : context.variant}`]]: context == null ? void 0 : context.variant,
|
|
15
|
+
[styles[`${rootClassName}__item--unavailable`]]: unavailable
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
className
|
|
19
|
+
);
|
|
20
|
+
return /* @__PURE__ */ jsx(Flex, { gap: props.gap || "100", flexGrow: (context == null ? void 0 : context.fullWidth) ? "1" : "0", asChild: true, children: /* @__PURE__ */ jsxs(ToggleGroupPrimitive.Item, { ...props, className: classes, ref: forwardRef, children: [
|
|
21
|
+
props.children,
|
|
22
|
+
(context == null ? void 0 : context.variant) === "filter" && /* @__PURE__ */ jsx(Indicator, {})
|
|
23
|
+
] }) });
|
|
24
|
+
});
|
|
25
|
+
Item.displayName = "Item";
|
|
26
|
+
export {
|
|
27
|
+
Item
|
|
28
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Flex } from '../flex';
|
|
3
|
+
|
|
4
|
+
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
5
|
+
export declare const rootClassName = "teddy-chip";
|
|
6
|
+
/** -------------------------------------------------------------------------------------------------
|
|
7
|
+
* Root
|
|
8
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
9
|
+
export type Variant = 'choice' | 'filter';
|
|
10
|
+
export type RootProps = React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> & React.ComponentPropsWithoutRef<typeof Flex> & {
|
|
11
|
+
variant?: Variant;
|
|
12
|
+
fullWidth?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type RootContextValue = {
|
|
15
|
+
variant: Variant;
|
|
16
|
+
fullWidth?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare const RootContext: React.Context<RootContextValue | undefined>;
|
|
19
|
+
/** */
|
|
20
|
+
export declare const Root: React.ForwardRefExoticComponent<RootProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React__default from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
5
|
+
import { Flex } from "../flex/flex.js";
|
|
6
|
+
const styles = {
|
|
7
|
+
"teddy-chip__item": "_teddy-chip__item_1er2j_1",
|
|
8
|
+
"teddy-chip__item--unavailable": "_teddy-chip__item--unavailable_1er2j_33",
|
|
9
|
+
"teddy-chip__indicator": "_teddy-chip__indicator_1er2j_82"
|
|
10
|
+
};
|
|
11
|
+
const rootClassName = "teddy-chip";
|
|
12
|
+
const RootContext = React__default.createContext(void 0);
|
|
13
|
+
const Root = React__default.forwardRef(
|
|
14
|
+
({ className, children, fullWidth, variant, asChild, ...props }, forwardRef) => {
|
|
15
|
+
const classes = clsx([styles[`${rootClassName}`]], className);
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
RootContext.Provider,
|
|
18
|
+
{
|
|
19
|
+
value: { variant: variant || (props.type === "multiple" ? "filter" : "choice"), fullWidth },
|
|
20
|
+
children: /* @__PURE__ */ jsx(ToggleGroupPrimitive.Root, { ...props, ref: forwardRef, className: classes, asChild: true, children: /* @__PURE__ */ jsx(Flex, { gap: "200", ...asChild ? { asChild: true, as: void 0 } : { as: "div" }, children }) })
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
Root.displayName = "Root";
|
|
26
|
+
export {
|
|
27
|
+
Root,
|
|
28
|
+
RootContext,
|
|
29
|
+
rootClassName,
|
|
30
|
+
styles as s
|
|
31
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RootProps } from './chip';
|
|
2
|
+
import { IndicatorProps } from './chip-indicator';
|
|
3
|
+
import { ItemProps } from './chip-item';
|
|
4
|
+
|
|
5
|
+
export declare const Chip: import('react').ForwardRefExoticComponent<RootProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
6
|
+
Item: import('react').ForwardRefExoticComponent<ItemProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
Indicator: import('react').ForwardRefExoticComponent<Partial<Omit<import('react').SVGProps<SVGSVGElement> & {
|
|
8
|
+
name: "key" | "search" | "split" | "link" | "add" | "reverse" | "infinite" | "radio" | "visible" | "copy" | "help" | "zoom-out" | "filter" | "x" | "zoom" | "menu" | "map" | "summary" | "time" | "video" | "image" | "stop" | "download" | "alert" | "email" | "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" | "shuffle" | "sync" | "skip-back-10sec" | "skip-back-30sec" | "skip-forward-10sec" | "skip-forward-30sec" | "star-filled" | "star" | "switch-arrows" | "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" | "present" | "press-button" | "price" | "pulse" | "recycle" | "reservation" | "route" | "ruler" | "satellite" | "secured-1" | "secured-2" | "security-camera" | "shopping" | "snowflake" | "speedometer" | "spyware" | "suitcase" | "sustainability" | "tag" | "temperature" | "thinking" | "train" | "transfer" | "undo" | "wavelength" | "weather" | "world" | "android" | "apple" | "bankid-norway" | "bankid" | "facebook" | "instagram" | "youtube" | "linkedin" | "snapchat" | "telia-logo" | "whatsapp" | "windows" | "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";
|
|
9
|
+
size?: ("sm" | "md" | "lg" | "xl" | "font" | "xxs" | "xs") | undefined;
|
|
10
|
+
children?: import('react').ReactNode;
|
|
11
|
+
}, "ref">> & import('react').RefAttributes<SVGSVGElement>>;
|
|
12
|
+
};
|
|
13
|
+
export type ChipProps = {
|
|
14
|
+
Root: RootProps;
|
|
15
|
+
Item: ItemProps;
|
|
16
|
+
Indicator: IndicatorProps;
|
|
17
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TextProps } from '../text';
|
|
2
|
-
import { IconProps } from '../icon';
|
|
3
1
|
import { default as React } from 'react';
|
|
2
|
+
import { IconProps } from '../icon';
|
|
3
|
+
import { TextProps } from '../text';
|
|
4
4
|
|
|
5
5
|
export type FieldErrorTextIndicatorProps = Partial<IconProps>;
|
|
6
6
|
export type FieldErrorTextProps = TextProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LayoutFlexProps } from '../../utils/layout';
|
|
2
1
|
import { default as React } from 'react';
|
|
2
|
+
import { LayoutFlexProps } from '../../utils/generate-styling';
|
|
3
3
|
|
|
4
4
|
/** -------------------------------------------------------------------------------------------------
|
|
5
5
|
* Flex
|
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React__default from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { Slot } from "@radix-ui/react-slot";
|
|
5
|
-
import { extractProps } from "../../utils/
|
|
5
|
+
import { extractProps } from "../../utils/generate-styling/index.js";
|
|
6
6
|
const styles = {
|
|
7
7
|
"teddy-flex": "_teddy-flex_19teo_2"
|
|
8
8
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LayoutGridProps } from '../../utils/layout';
|
|
2
1
|
import { default as React } from 'react';
|
|
2
|
+
import { LayoutGridProps } from '../../utils/generate-styling';
|
|
3
3
|
|
|
4
4
|
/** -------------------------------------------------------------------------------------------------
|
|
5
5
|
* Grid
|
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React__default from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { Slot } from "@radix-ui/react-slot";
|
|
5
|
-
import { extractProps } from "../../utils/
|
|
5
|
+
import { extractProps } from "../../utils/generate-styling/index.js";
|
|
6
6
|
const styles = {
|
|
7
7
|
"teddy-grid": "_teddy-grid_1dv1t_2"
|
|
8
8
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ChildrenLayoutProps } from '../../utils/layout';
|
|
2
1
|
import { default as React } from 'react';
|
|
2
|
+
import { ChildrenLayoutProps } from '../../utils/generate-styling';
|
|
3
3
|
|
|
4
4
|
/** -------------------------------------------------------------------------------------------------
|
|
5
5
|
* Heading
|
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Slot } from "@radix-ui/react-slot";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import React__default from "react";
|
|
5
|
-
import { extractProps } from "../../utils/
|
|
5
|
+
import { extractProps } from "../../utils/generate-styling/index.js";
|
|
6
6
|
const styles = {
|
|
7
7
|
"teddy-heading": "_teddy-heading_r8os0_2",
|
|
8
8
|
"teddy-heading--hyphens": "_teddy-heading--hyphens_r8os0_9",
|
package/dist/components/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Chip } from "./chip/index.js";
|
|
1
2
|
import { Modal } from "./modal/modal.js";
|
|
2
3
|
import { Notification } from "./notification/notification.js";
|
|
3
4
|
import { RadioGroup } from "./radio-group/radio-group.js";
|
|
@@ -29,6 +30,7 @@ export {
|
|
|
29
30
|
Box,
|
|
30
31
|
Button,
|
|
31
32
|
Card,
|
|
33
|
+
Chip,
|
|
32
34
|
FieldErrorText,
|
|
33
35
|
Flex,
|
|
34
36
|
Grid,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ComponentPropsAs } from '../../utils/component-props-as';
|
|
2
|
-
import { Flex, Heading, Text } from '..';
|
|
3
1
|
import { default as React } from 'react';
|
|
2
|
+
import { Flex, Heading, Text } from '..';
|
|
3
|
+
import { ComponentPropsAs } from '../../utils/component-props-as';
|
|
4
4
|
|
|
5
5
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
6
6
|
type RootProps = Omit<React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>, 'modal'>;
|
|
@@ -47,7 +47,7 @@ type CloseProps = Omit<React.ComponentPropsWithoutRef<typeof DialogPrimitive.Clo
|
|
|
47
47
|
});
|
|
48
48
|
/** -------------------------------------------------------------------------------------------------*/
|
|
49
49
|
export declare const Modal: React.FC<RootProps> & {
|
|
50
|
-
Trigger: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref">, "
|
|
50
|
+
Trigger: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref">, "children" | "asChild"> & {
|
|
51
51
|
children: React.ReactElement;
|
|
52
52
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
53
53
|
Content: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import React__default, { useEffect } from "react";
|
|
3
3
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
4
|
+
import "../chip/index.js";
|
|
4
5
|
import "../notification/notification.js";
|
|
5
6
|
import "../radio-group/radio-group.js";
|
|
6
7
|
import "../box/box.js";
|
|
@@ -100,7 +100,7 @@ declare const NavigationMenu: React.ForwardRefExoticComponent<Omit<NavigationMen
|
|
|
100
100
|
variant?: "default" | "float" | undefined;
|
|
101
101
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
102
102
|
Link: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>, "ref"> & {
|
|
103
|
-
variant?: "
|
|
103
|
+
variant?: "small" | "button" | "default" | undefined;
|
|
104
104
|
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
105
105
|
Indicator: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuIndicatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
106
106
|
Viewport: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuViewportProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|