@telia/teddy 0.0.15 → 0.0.17
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/dist/components/accordion/accordion.d.ts +2 -1
- package/dist/components/accordion/accordion.js +90 -24
- package/dist/components/accordion/index.js +2 -2
- package/dist/components/badge/badge.js +40 -24
- package/dist/components/badge/index.js +2 -2
- package/dist/components/box/box.js +14 -10
- package/dist/components/box/index.js +2 -2
- package/dist/components/button/button.js +60 -52
- package/dist/components/button/index.js +2 -2
- package/dist/components/card/card.d.ts +35 -3
- package/dist/components/card/card.js +209 -25
- package/dist/components/card/index.js +2 -2
- package/dist/components/field-error-text/field-error-text.js +21 -19
- package/dist/components/field-error-text/index.js +2 -2
- package/dist/components/flex/flex.js +15 -12
- package/dist/components/flex/index.js +2 -2
- package/dist/components/grid/grid.js +15 -12
- package/dist/components/grid/index.js +2 -2
- package/dist/components/heading/heading.js +22 -19
- package/dist/components/heading/index.js +2 -2
- package/dist/components/helper-text/helper-text.js +14 -13
- package/dist/components/helper-text/index.js +2 -2
- package/dist/components/icon/icon.js +16 -14
- package/dist/components/icon/index.js +4 -4
- package/dist/components/index.js +51 -46
- package/dist/components/input/index.js +3 -3
- package/dist/components/input/input.js +79 -66
- package/dist/components/label/index.js +2 -2
- package/dist/components/label/label.js +17 -23
- package/dist/components/link/index.js +2 -2
- package/dist/components/link/link.js +20 -19
- package/dist/components/modal/index.js +2 -2
- package/dist/components/modal/modal.js +173 -14
- package/dist/components/navigation-menu/index.js +2 -2
- package/dist/components/navigation-menu/navigation-menu.js +391 -8
- package/dist/components/notification/index.js +2 -2
- package/dist/components/notification/notification.d.ts +8 -7
- package/dist/components/notification/notification.js +96 -24
- package/dist/components/radio-group/index.js +2 -2
- package/dist/components/radio-group/radio-group.js +91 -8
- package/dist/components/spinner/index.js +2 -2
- package/dist/components/spinner/spinner.js +36 -29
- package/dist/components/text/index.js +2 -2
- package/dist/components/text/text.js +18 -17
- package/dist/components/text-field/index.js +2 -2
- package/dist/components/text-field/text-field.js +110 -90
- package/dist/components/text-spacing/index.js +2 -2
- package/dist/components/text-spacing/text-spacing.js +14 -12
- package/dist/components/toggle/index.js +2 -2
- package/dist/components/toggle/toggle.d.ts +1 -1
- package/dist/components/toggle/toggle.js +84 -23
- package/dist/components/visually-hidden/index.js +2 -2
- package/dist/components/visually-hidden/visually-hidden.js +17 -15
- package/dist/icons/category.js +2 -2
- package/dist/icons/name.js +2 -2
- package/dist/main.js +359 -61
- package/dist/style.css +3406 -0
- package/dist/tokens/border/variables.js +18 -10
- package/dist/tokens/breakpoint/variables.js +8 -5
- package/dist/tokens/color/variables.js +452 -227
- package/dist/tokens/index.d.ts +7 -7
- package/dist/tokens/index.js +308 -14
- package/dist/tokens/motion/variables.js +22 -12
- package/dist/tokens/shadow/variables.js +8 -5
- package/dist/tokens/spacing/variables.js +46 -24
- package/dist/tokens/typography/variables.js +48 -25
- package/dist/utils/action.js +10 -7
- package/dist/utils/composeEventHandlers.js +7 -5
- package/dist/utils/composeRefs.js +13 -9
- package/dist/utils/layout/align.js +5 -4
- package/dist/utils/layout/flex.js +25 -18
- package/dist/utils/layout/gap.js +7 -6
- package/dist/utils/layout/grid.js +31 -24
- package/dist/utils/layout/height.js +12 -11
- package/dist/utils/layout/index.d.ts +1863 -0
- package/dist/utils/layout/index.js +77 -59
- package/dist/utils/layout/inset.js +10 -9
- package/dist/utils/layout/justify.js +6 -5
- package/dist/utils/layout/margin.js +10 -9
- package/dist/utils/layout/padding.js +10 -9
- package/dist/utils/layout/position.js +6 -5
- package/dist/utils/layout/util.js +7 -6
- package/dist/utils/layout/width.js +8 -7
- package/package.json +22 -14
- package/dist/assets/badge.css +0 -1
- package/dist/assets/button.css +0 -1
- package/dist/assets/field-error-text.css +0 -1
- package/dist/assets/flex.css +0 -1
- package/dist/assets/grid.css +0 -1
- package/dist/assets/heading.css +0 -1
- package/dist/assets/helper-text.css +0 -1
- package/dist/assets/icon.css +0 -1
- package/dist/assets/input.css +0 -1
- package/dist/assets/label.css +0 -1
- package/dist/assets/link.css +0 -1
- package/dist/assets/main.css +0 -1
- package/dist/assets/navigation-menu.css +0 -1
- package/dist/assets/radio-group.css +0 -1
- package/dist/assets/spinner.css +0 -1
- package/dist/assets/text-field.css +0 -1
- package/dist/assets/text-spacing.css +0 -1
- package/dist/assets/text.css +0 -1
- package/dist/assets/visually-hidden.css +0 -1
- package/dist/badge-Cnug5TzH.js +0 -1855
- package/dist/clsx-DB4S2d7J.js +0 -22
- package/dist/index-DM5e-Whg.js +0 -43
- package/dist/index-DpfSJps6.js +0 -75
- package/dist/index-FPIZOCcD.js +0 -305
- package/dist/navigation-menu-DKuyW8zE.js +0 -1036
- package/dist/radio-group-B--zT3OL.js +0 -440
- package/dist/variables-BKiPmtHY.js +0 -458
- package/dist/variables-BkY5b0io.js +0 -14
- package/dist/variables-Bq0YUbLS.js +0 -14
- package/dist/variables-CDK515QX.js +0 -52
- package/dist/variables-CMRTN8qo.js +0 -28
- package/dist/variables-Dmoh9YtD.js +0 -54
- package/dist/variables-IczXZ5CN.js +0 -24
|
@@ -1,27 +1,93 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
import "react";
|
|
4
|
-
import
|
|
5
|
-
import "
|
|
6
|
-
import "../box/box.js";
|
|
7
|
-
import "../flex/flex.js";
|
|
8
|
-
import "../grid/grid.js";
|
|
9
|
-
import "../../navigation-menu-DKuyW8zE.js";
|
|
10
|
-
import "../link/link.js";
|
|
11
|
-
import "../button/button.js";
|
|
12
|
-
import "../field-error-text/field-error-text.js";
|
|
13
|
-
import "../helper-text/helper-text.js";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import React__default from "react";
|
|
4
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
5
|
+
import { Heading } from "../heading/heading.js";
|
|
14
6
|
import "../../assets/4bbd022cee9b0f06.svg";
|
|
15
|
-
import "../icon/icon.js";
|
|
16
|
-
import "
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
7
|
+
import { Icon } from "../icon/icon.js";
|
|
8
|
+
import { Slottable } from "@radix-ui/react-slot";
|
|
9
|
+
const slideDown = "_slideDown_fs2mc_1";
|
|
10
|
+
const slideUp = "_slideUp_fs2mc_1";
|
|
11
|
+
const styles = {
|
|
12
|
+
"teddy-accordion--indented": "_teddy-accordion--indented_fs2mc_3",
|
|
13
|
+
"teddy-accordion__trigger": "_teddy-accordion__trigger_fs2mc_3",
|
|
14
|
+
"teddy-accordion__content": "_teddy-accordion__content_fs2mc_4",
|
|
15
|
+
"teddy-accordion--negative": "_teddy-accordion--negative_fs2mc_13",
|
|
16
|
+
"teddy-accordion__header": "_teddy-accordion__header_fs2mc_13",
|
|
17
|
+
"teddy-accordion__title": "_teddy-accordion__title_fs2mc_17",
|
|
18
|
+
"teddy-accordion__item": "_teddy-accordion__item_fs2mc_28",
|
|
19
|
+
"teddy-accordion": "_teddy-accordion_fs2mc_3",
|
|
20
|
+
"teddy-accordion__indicator": "_teddy-accordion__indicator_fs2mc_107",
|
|
21
|
+
slideDown,
|
|
22
|
+
slideUp
|
|
23
|
+
};
|
|
24
|
+
const rootClassName = "teddy-accordion";
|
|
25
|
+
const Root = React__default.forwardRef(
|
|
26
|
+
({ className, variant = "default", children, indented = false, ...props }, forwardRef) => {
|
|
27
|
+
const classes = clsx(
|
|
28
|
+
styles[rootClassName],
|
|
29
|
+
styles[`${rootClassName}--${variant}`],
|
|
30
|
+
{
|
|
31
|
+
[styles[`${rootClassName}--indented`]]: indented
|
|
32
|
+
},
|
|
33
|
+
className
|
|
34
|
+
);
|
|
35
|
+
return /* @__PURE__ */ jsx(AccordionPrimitive.Root, { ...props, ref: forwardRef, className: classes, children });
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
Root.displayName = "Accordion";
|
|
39
|
+
const Item = React__default.forwardRef(
|
|
40
|
+
({ className, children, ...props }, forwardRef) => {
|
|
41
|
+
const classes = clsx([styles[`${rootClassName}__item`]], className);
|
|
42
|
+
return /* @__PURE__ */ jsx(AccordionPrimitive.Item, { ...props, ref: forwardRef, className: classes, children });
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
const Header = React__default.forwardRef(
|
|
46
|
+
({ className, children, ...props }, forwardRef) => {
|
|
47
|
+
const classes = clsx([styles[`${rootClassName}__header`]], className);
|
|
48
|
+
return /* @__PURE__ */ jsx(AccordionPrimitive.Header, { ...props, ref: forwardRef, asChild: true, className: classes, children: /* @__PURE__ */ jsx(Heading, { variant: "title-100", ...props.asChild ? { asChild: true } : { as: "h3" }, children }) });
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
Header.displayName = "Accordion.Header";
|
|
52
|
+
const Trigger = React__default.forwardRef(
|
|
53
|
+
({ className, children, hideIndicator, ...props }, forwardRef) => {
|
|
54
|
+
const classes = clsx([styles[`${rootClassName}__trigger`]], className);
|
|
55
|
+
return /* @__PURE__ */ jsxs(AccordionPrimitive.Trigger, { ...props, ref: forwardRef, className: classes, children: [
|
|
56
|
+
/* @__PURE__ */ jsx(Slottable, { children }),
|
|
57
|
+
!hideIndicator && /* @__PURE__ */ jsx(Indicator, {})
|
|
58
|
+
] });
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
Trigger.displayName = "Accordion.Trigger";
|
|
62
|
+
const Indicator = React__default.forwardRef(
|
|
63
|
+
({ className, children, ...props }, forwardRef) => {
|
|
64
|
+
const classes = clsx([styles[`${rootClassName}__indicator`]], className);
|
|
65
|
+
return /* @__PURE__ */ jsx(Icon, { "aria-hidden": true, name: "chevron-down", ...props, ref: forwardRef, className: classes, children });
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
Indicator.displayName = "Accordion.Indicator";
|
|
69
|
+
const Content = React__default.forwardRef(
|
|
70
|
+
({ className, children, ...props }, forwardRef) => {
|
|
71
|
+
const classes = clsx([styles[`${rootClassName}__content`]], className);
|
|
72
|
+
return /* @__PURE__ */ jsx(AccordionPrimitive.Content, { ...props, ref: forwardRef, className: classes, children });
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
Content.displayName = "Accordion.Content";
|
|
76
|
+
const Title = React__default.forwardRef(
|
|
77
|
+
({ className, children, variant = "title-400", ...props }, forwardRef) => {
|
|
78
|
+
const classes = clsx([styles[`${rootClassName}__title`]], className);
|
|
79
|
+
return /* @__PURE__ */ jsx(Heading, { ...props, variant, ref: forwardRef, className: classes, children });
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
Title.displayName = "Accordion.Title";
|
|
83
|
+
const Accordion = Object.assign(Root, {
|
|
84
|
+
Trigger,
|
|
85
|
+
Content,
|
|
86
|
+
Header,
|
|
87
|
+
Item,
|
|
88
|
+
Indicator,
|
|
89
|
+
Title
|
|
90
|
+
});
|
|
25
91
|
export {
|
|
26
|
-
|
|
92
|
+
Accordion
|
|
27
93
|
};
|
|
@@ -1,27 +1,43 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
import "react";
|
|
4
|
-
import {
|
|
5
|
-
import "../../index-DpfSJps6.js";
|
|
6
|
-
import "../../radio-group-B--zT3OL.js";
|
|
7
|
-
import "../box/box.js";
|
|
8
|
-
import "../flex/flex.js";
|
|
9
|
-
import "../grid/grid.js";
|
|
10
|
-
import "../../navigation-menu-DKuyW8zE.js";
|
|
11
|
-
import "../link/link.js";
|
|
12
|
-
import "../button/button.js";
|
|
13
|
-
import "../field-error-text/field-error-text.js";
|
|
14
|
-
import "../helper-text/helper-text.js";
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import React__default from "react";
|
|
4
|
+
import { Slottable, Slot } from "@radix-ui/react-slot";
|
|
15
5
|
import "../../assets/4bbd022cee9b0f06.svg";
|
|
16
|
-
import "../icon/icon.js";
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
6
|
+
import { Icon } from "../icon/icon.js";
|
|
7
|
+
const styles = {
|
|
8
|
+
"teddy-badge": "_teddy-badge_sg6ab_1",
|
|
9
|
+
"teddy-badge--attention": "_teddy-badge--attention_sg6ab_13",
|
|
10
|
+
"teddy-badge--special": "_teddy-badge--special_sg6ab_17",
|
|
11
|
+
"teddy-badge--neutral": "_teddy-badge--neutral_sg6ab_21",
|
|
12
|
+
"teddy-badge--information": "_teddy-badge--information_sg6ab_25",
|
|
13
|
+
"teddy-badge--success": "_teddy-badge--success_sg6ab_29",
|
|
14
|
+
"teddy-badge--warning": "_teddy-badge--warning_sg6ab_33",
|
|
15
|
+
"teddy-badge--error": "_teddy-badge--error_sg6ab_37"
|
|
16
|
+
};
|
|
17
|
+
const rootClassName = "teddy-badge";
|
|
18
|
+
function getIcon(variant) {
|
|
19
|
+
if (variant === "success") {
|
|
20
|
+
return "check-circle";
|
|
21
|
+
}
|
|
22
|
+
if (variant === "warning") {
|
|
23
|
+
return "alert";
|
|
24
|
+
}
|
|
25
|
+
if (variant === "error") {
|
|
26
|
+
return "error";
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const Badge = React__default.forwardRef(
|
|
30
|
+
({ className, variant, hideIcon, asChild, children, ...props }, forwardRef) => {
|
|
31
|
+
const classes = clsx([styles[`${rootClassName}`]], [styles[`${rootClassName}--${variant}`]], className);
|
|
32
|
+
const Comp = asChild ? Slot : "span";
|
|
33
|
+
const iconName = getIcon(variant);
|
|
34
|
+
return /* @__PURE__ */ jsxs(Comp, { ...props, ref: forwardRef, className: classes, children: [
|
|
35
|
+
!hideIcon && iconName && /* @__PURE__ */ jsx(Icon, { name: iconName }),
|
|
36
|
+
/* @__PURE__ */ jsx(Slottable, { children })
|
|
37
|
+
] });
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
Badge.displayName = "Badge";
|
|
25
41
|
export {
|
|
26
|
-
|
|
42
|
+
Badge
|
|
27
43
|
};
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { extractProps
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React__default from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { extractProps } from "../../utils/layout/index.js";
|
|
5
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
6
|
+
const styles = {};
|
|
7
|
+
const rootClassName = "teddy-box";
|
|
8
|
+
const Box = React__default.forwardRef((props, forwardRef) => {
|
|
9
|
+
const { className, asChild, style, ...rest } = extractProps(props);
|
|
10
|
+
const classes = clsx([styles[`${rootClassName}`]], className);
|
|
11
|
+
const Comp = asChild ? Slot : "div";
|
|
12
|
+
return /* @__PURE__ */ jsx(Comp, { ...rest, style, ref: forwardRef, className: classes });
|
|
9
13
|
});
|
|
10
|
-
|
|
14
|
+
Box.displayName = "Box";
|
|
11
15
|
export {
|
|
12
|
-
|
|
16
|
+
Box
|
|
13
17
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
const
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Slottable, Slot } from "@radix-ui/react-slot";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { Spinner } from "../spinner/spinner.js";
|
|
6
|
+
import { extractProps } from "../../utils/layout/index.js";
|
|
7
|
+
const fadeInAnimation = "_fadeInAnimation_1biph_1";
|
|
8
|
+
const scaleInAnimation = "_scaleInAnimation_1biph_1";
|
|
9
|
+
const styles = {
|
|
9
10
|
"teddy-button": "_teddy-button_1biph_18",
|
|
10
11
|
"teddy-button--sm": "_teddy-button--sm_1biph_53",
|
|
11
12
|
"teddy-button--icon-only": "_teddy-button--icon-only_1biph_56",
|
|
@@ -27,10 +28,12 @@ const k = "_fadeInAnimation_1biph_1", R = "_scaleInAnimation_1biph_1", t = {
|
|
|
27
28
|
"teddy-button--text-negative": "_teddy-button--text-negative_1biph_195",
|
|
28
29
|
"teddy-button--text": "_teddy-button--text_1biph_195",
|
|
29
30
|
"teddy-button__loading": "_teddy-button__loading_1biph_242",
|
|
30
|
-
fadeInAnimation
|
|
31
|
+
fadeInAnimation,
|
|
31
32
|
"teddy-button__spinner": "_teddy-button__spinner_1biph_253",
|
|
32
|
-
scaleInAnimation
|
|
33
|
-
}
|
|
33
|
+
scaleInAnimation
|
|
34
|
+
};
|
|
35
|
+
const rootClassName = "teddy-button";
|
|
36
|
+
const variants = [
|
|
34
37
|
"primary",
|
|
35
38
|
"secondary",
|
|
36
39
|
"destructive",
|
|
@@ -43,63 +46,68 @@ const k = "_fadeInAnimation_1biph_1", R = "_scaleInAnimation_1biph_1", t = {
|
|
|
43
46
|
"tertiary-purple-negative",
|
|
44
47
|
"text-negative",
|
|
45
48
|
"expressive-negative"
|
|
46
|
-
]
|
|
49
|
+
];
|
|
50
|
+
const Root = React.forwardRef((args, ref) => {
|
|
47
51
|
const {
|
|
48
|
-
className
|
|
49
|
-
variant
|
|
50
|
-
size
|
|
51
|
-
iconOnly
|
|
52
|
-
fullWidth
|
|
53
|
-
disabled
|
|
54
|
-
loading
|
|
55
|
-
asChild
|
|
56
|
-
onClick
|
|
57
|
-
children
|
|
58
|
-
...
|
|
59
|
-
} =
|
|
60
|
-
|
|
52
|
+
className,
|
|
53
|
+
variant,
|
|
54
|
+
size = "md",
|
|
55
|
+
iconOnly,
|
|
56
|
+
fullWidth,
|
|
57
|
+
disabled = false,
|
|
58
|
+
loading = false,
|
|
59
|
+
asChild = false,
|
|
60
|
+
onClick,
|
|
61
|
+
children,
|
|
62
|
+
...props
|
|
63
|
+
} = extractProps(args);
|
|
64
|
+
const Comp = asChild ? Slot : "button";
|
|
65
|
+
const classes = clsx(
|
|
66
|
+
[styles[rootClassName], styles[`${rootClassName}--${variant}`], styles[`${rootClassName}--${size}`]],
|
|
61
67
|
{
|
|
62
|
-
[
|
|
63
|
-
[
|
|
64
|
-
[
|
|
65
|
-
[
|
|
68
|
+
[styles[`${rootClassName}--icon-only`]]: iconOnly,
|
|
69
|
+
[styles[`${rootClassName}--negative`]]: variant.endsWith("negative"),
|
|
70
|
+
[styles[`${rootClassName}--full-width`]]: fullWidth,
|
|
71
|
+
[styles[`${rootClassName}--disabled`]]: disabled || loading
|
|
66
72
|
},
|
|
67
|
-
|
|
73
|
+
className
|
|
68
74
|
);
|
|
69
|
-
function
|
|
70
|
-
if (
|
|
71
|
-
|
|
75
|
+
function handleClick(event) {
|
|
76
|
+
if (disabled || loading) {
|
|
77
|
+
event.preventDefault();
|
|
72
78
|
return;
|
|
73
79
|
}
|
|
74
|
-
|
|
80
|
+
if (onClick) {
|
|
81
|
+
onClick(event);
|
|
82
|
+
}
|
|
75
83
|
}
|
|
76
|
-
const
|
|
77
|
-
return /* @__PURE__ */
|
|
78
|
-
|
|
84
|
+
const getSpinnerVariant = () => variant.endsWith("negative") ? "negative-disabled" : "disabled";
|
|
85
|
+
return /* @__PURE__ */ jsxs(
|
|
86
|
+
Comp,
|
|
79
87
|
{
|
|
80
|
-
className:
|
|
81
|
-
"aria-disabled":
|
|
82
|
-
onClick:
|
|
83
|
-
ref
|
|
84
|
-
...
|
|
88
|
+
className: classes,
|
|
89
|
+
"aria-disabled": props["aria-disabled"] || disabled || loading,
|
|
90
|
+
onClick: handleClick,
|
|
91
|
+
ref,
|
|
92
|
+
...props,
|
|
85
93
|
children: [
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
|
|
88
|
-
|
|
94
|
+
/* @__PURE__ */ jsx(Slottable, { children }),
|
|
95
|
+
loading && /* @__PURE__ */ jsx(
|
|
96
|
+
Spinner,
|
|
89
97
|
{
|
|
90
|
-
size:
|
|
91
|
-
variant:
|
|
92
|
-
className:
|
|
98
|
+
size: size === "lg" ? "xs" : "xxs",
|
|
99
|
+
variant: getSpinnerVariant(),
|
|
100
|
+
className: styles[`${rootClassName}__spinner`]
|
|
93
101
|
}
|
|
94
102
|
)
|
|
95
103
|
]
|
|
96
104
|
}
|
|
97
105
|
);
|
|
98
106
|
});
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
variants
|
|
107
|
+
Root.displayName = "Button";
|
|
108
|
+
const Button = Object.assign(Root, {
|
|
109
|
+
variants
|
|
102
110
|
});
|
|
103
111
|
export {
|
|
104
|
-
|
|
112
|
+
Button
|
|
105
113
|
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
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';
|
|
2
6
|
import { default as React } from 'react';
|
|
3
7
|
|
|
4
8
|
declare const variantOptions: readonly ["purple-light", "purple-dark", "gray", "white", "beige"];
|
|
@@ -34,11 +38,17 @@ type ImageProps = React.ComponentPropsWithoutRef<'img'> & {
|
|
|
34
38
|
/** The inset allows make the image bleed out to the edges */
|
|
35
39
|
inset?: (typeof insetOptions)[number];
|
|
36
40
|
};
|
|
37
|
-
type ButtonProps = Omit<React.ComponentPropsWithoutRef<typeof PrimitiveButton>, 'variant'
|
|
41
|
+
type ButtonProps = Omit<React.ComponentPropsWithoutRef<typeof PrimitiveButton>, 'variant'> & {
|
|
42
|
+
variant?: React.ComponentPropsWithoutRef<typeof PrimitiveButton>['variant'];
|
|
43
|
+
};
|
|
38
44
|
/** -------------------------------------------------------------------------------------------------
|
|
39
45
|
* Link
|
|
40
46
|
* -----------------------------------------------------------------------------------------------*/
|
|
41
47
|
type LinkProps = React.ComponentPropsWithoutRef<typeof PrimitiveLink>;
|
|
48
|
+
/** -------------------------------------------------------------------------------------------------
|
|
49
|
+
* Line
|
|
50
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
51
|
+
type LineProps = Omit<React.ComponentPropsWithoutRef<typeof Box>, 'asChild' | 'as' | 'children'>;
|
|
42
52
|
declare const Card: React.ForwardRefExoticComponent<RootProps & React.RefAttributes<HTMLDivElement>> & {
|
|
43
53
|
Root: React.ForwardRefExoticComponent<RootProps & React.RefAttributes<HTMLDivElement>>;
|
|
44
54
|
Heading: React.ForwardRefExoticComponent<HeadingProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
@@ -47,7 +57,27 @@ declare const Card: React.ForwardRefExoticComponent<RootProps & React.RefAttribu
|
|
|
47
57
|
/** The inset allows make the image bleed out to the edges */
|
|
48
58
|
inset?: "all" | "top" | "bottom" | "right" | "left" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "top-right-left" | "bottom-left-right" | "top-bottom" | "left-right" | undefined;
|
|
49
59
|
} & React.RefAttributes<HTMLImageElement>>;
|
|
50
|
-
Button: React.ForwardRefExoticComponent<
|
|
60
|
+
Button: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-label"> & import('../../utils/layout/flex').FlexChildren & import('../../utils/layout/grid').GridChildren & import('../../utils/layout/position').PositionProps & import('../../utils/layout/inset').InsetProps & import('../../utils/layout/margin').MarginProps & import('../../utils/layout/padding').PaddingProps & import('../../utils/layout/width').WidthProps & import('../../utils/layout/height').HeightProps & {
|
|
61
|
+
asChild?: boolean | undefined;
|
|
62
|
+
loading?: boolean | undefined;
|
|
63
|
+
fullWidth?: boolean | undefined;
|
|
64
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
65
|
+
variant: "text" | "primary" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative";
|
|
66
|
+
} & {
|
|
67
|
+
iconOnly: true;
|
|
68
|
+
"aria-label": string;
|
|
69
|
+
} & React.RefAttributes<HTMLButtonElement>, "ref"> | Omit<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-label"> & import('../../utils/layout/flex').FlexChildren & import('../../utils/layout/grid').GridChildren & import('../../utils/layout/position').PositionProps & import('../../utils/layout/inset').InsetProps & import('../../utils/layout/margin').MarginProps & import('../../utils/layout/padding').PaddingProps & import('../../utils/layout/width').WidthProps & import('../../utils/layout/height').HeightProps & {
|
|
70
|
+
asChild?: boolean | undefined;
|
|
71
|
+
loading?: boolean | undefined;
|
|
72
|
+
fullWidth?: boolean | undefined;
|
|
73
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
74
|
+
variant: "text" | "primary" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative";
|
|
75
|
+
} & {
|
|
76
|
+
iconOnly?: false | undefined;
|
|
77
|
+
"aria-label"?: string | undefined;
|
|
78
|
+
} & React.RefAttributes<HTMLButtonElement>, "ref">, "variant"> & {
|
|
79
|
+
variant?: "text" | "primary" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative" | undefined;
|
|
80
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
51
81
|
Link: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
52
82
|
asChild?: boolean | undefined;
|
|
53
83
|
disableVisited?: boolean | undefined;
|
|
@@ -56,6 +86,7 @@ declare const Card: React.ForwardRefExoticComponent<RootProps & React.RefAttribu
|
|
|
56
86
|
variant: "text" | "navigation" | "text-negative" | "standalone" | "standalone-negative" | "navigation-negative";
|
|
57
87
|
} & React.RefAttributes<HTMLAnchorElement>, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
58
88
|
Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLDivElement>>;
|
|
89
|
+
Line: React.ForwardRefExoticComponent<LineProps & React.RefAttributes<HTMLDivElement>>;
|
|
59
90
|
variantOptions: readonly ["purple-light", "purple-dark", "gray", "white", "beige"];
|
|
60
91
|
insetOptions: readonly ["top", "bottom", "left", "right", "all", "top-right-left", "bottom-left-right", "top-left", "top-right", "bottom-left", "bottom-right", "top-bottom", "left-right"];
|
|
61
92
|
};
|
|
@@ -67,6 +98,7 @@ type CardProps = {
|
|
|
67
98
|
Image: ImageProps;
|
|
68
99
|
Slot: SlotProps;
|
|
69
100
|
Link: LinkProps;
|
|
101
|
+
Line: LineProps;
|
|
70
102
|
};
|
|
71
103
|
export { Card };
|
|
72
104
|
export type { CardProps };
|