@vkzstudio/muza-ui 1.0.42 → 1.0.43
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/Button/Button.d.ts +9 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +60 -55
- package/dist/components/Button/Button.stories.d.ts +2 -0
- package/dist/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/EdgeButton/EdgeButton.d.ts +6 -1
- package/dist/components/EdgeButton/EdgeButton.d.ts.map +1 -1
- package/dist/components/EdgeButton/EdgeButton.js +70 -46
- package/dist/components/EdgeButton/EdgeButton.stories.d.ts +2 -0
- package/dist/components/EdgeButton/EdgeButton.stories.d.ts.map +1 -1
- package/dist/muza-ui.css +1 -1
- package/package.json +1 -1
|
@@ -21,7 +21,15 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
21
21
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'icon';
|
|
22
22
|
/** Stretches button to fill its container width. @default false */
|
|
23
23
|
fullWidth?: boolean;
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* When true, merges Button props/styles onto the single child element via
|
|
26
|
+
* Radix `Slot` (e.g. `<Button asChild><Link href="/">Home</Link></Button>`
|
|
27
|
+
* renders an `<a>` with all button styling and click target). Icons and the
|
|
28
|
+
* `loading` spinner are injected as siblings of the child's original content.
|
|
29
|
+
* Note: `disabled` has no effect on non-`<button>` children — use
|
|
30
|
+
* `aria-disabled` on the child instead.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
25
33
|
asChild?: boolean;
|
|
26
34
|
/** React node displayed as an icon. Position controlled by `iconPosition`. */
|
|
27
35
|
icon?: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAI5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD;;;;GAIG;AACH,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,IAAI,CAAC,YAAY,CAAC,OAAO,cAAc,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAChE;;;;OAIG;IACH,OAAO,CAAC,EACJ,SAAS,GACT,WAAW,GACX,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,YAAY,CAAA;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAA;IACzC,mEAAmE;IACnE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,6HAA6H;IAC7H,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IAC9B,qIAAqI;IACrI,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,wFAAwF;IACxF,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,wFAAwF;IACxF,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,QAAA,MAAM,MAAM,uFAqFX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -1,71 +1,76 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as j, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import { Slot as v, Slottable as u } from "@radix-ui/react-slot";
|
|
3
4
|
import "class-variance-authority";
|
|
4
|
-
import { ButtonLoader as
|
|
5
|
-
import { buttonVariants as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Typography as
|
|
8
|
-
const
|
|
5
|
+
import { ButtonLoader as w } from "./ButtonLoader.js";
|
|
6
|
+
import { buttonVariants as E } from "./buttonVariants.js";
|
|
7
|
+
import { cn as c } from "../../utils/cn.js";
|
|
8
|
+
import { Typography as R } from "../Typography/Typography.js";
|
|
9
|
+
const S = m.forwardRef(
|
|
9
10
|
({
|
|
10
|
-
className:
|
|
11
|
-
variant:
|
|
12
|
-
size:
|
|
13
|
-
fullWidth:
|
|
14
|
-
asChild:
|
|
15
|
-
icon:
|
|
16
|
-
iconPosition:
|
|
11
|
+
className: y,
|
|
12
|
+
variant: b,
|
|
13
|
+
size: a,
|
|
14
|
+
fullWidth: x,
|
|
15
|
+
asChild: p = !1,
|
|
16
|
+
icon: r,
|
|
17
|
+
iconPosition: n = "start",
|
|
17
18
|
secondIcon: s,
|
|
18
|
-
ghost:
|
|
19
|
-
danger:
|
|
20
|
-
loading:
|
|
21
|
-
children:
|
|
19
|
+
ghost: d = !1,
|
|
20
|
+
danger: f = !1,
|
|
21
|
+
loading: e = !1,
|
|
22
|
+
children: t,
|
|
22
23
|
...h
|
|
23
|
-
},
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
b,
|
|
24
|
+
}, N) => {
|
|
25
|
+
const g = p ? v : "button", i = a === "icon" || d, l = (L) => /* @__PURE__ */ o(
|
|
26
|
+
R,
|
|
27
27
|
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
variant: "cta",
|
|
29
|
+
size: a === "sm" || a === "xs" ? "sm" : "base",
|
|
30
|
+
weight: "medium",
|
|
31
|
+
component: "span",
|
|
32
|
+
fixY: !0,
|
|
33
|
+
className: c("transition-opacity", {
|
|
34
|
+
"opacity-0": e
|
|
35
|
+
}),
|
|
36
|
+
children: L
|
|
37
|
+
}
|
|
38
|
+
), B = () => p ? m.isValidElement(t) ? /* @__PURE__ */ o(u, { children: m.cloneElement(
|
|
39
|
+
t,
|
|
40
|
+
void 0,
|
|
41
|
+
l(t.props.children)
|
|
42
|
+
) }) : /* @__PURE__ */ o(u, { children: t }) : t && l(t);
|
|
43
|
+
return /* @__PURE__ */ j(
|
|
44
|
+
g,
|
|
45
|
+
{
|
|
46
|
+
className: c(
|
|
47
|
+
E({
|
|
48
|
+
variant: b,
|
|
49
|
+
size: a,
|
|
50
|
+
fullWidth: x,
|
|
51
|
+
iconOnly: a === "icon" || !t,
|
|
52
|
+
ghost: i,
|
|
53
|
+
danger: f,
|
|
54
|
+
loading: e,
|
|
55
|
+
className: y
|
|
38
56
|
})
|
|
39
57
|
),
|
|
40
|
-
ref:
|
|
41
|
-
"data-ghost":
|
|
42
|
-
"data-danger":
|
|
58
|
+
ref: N,
|
|
59
|
+
"data-ghost": i,
|
|
60
|
+
"data-danger": f,
|
|
43
61
|
...h,
|
|
44
62
|
children: [
|
|
45
|
-
|
|
46
|
-
(s ||
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
{
|
|
50
|
-
variant: "cta",
|
|
51
|
-
size: t == "sm" || t == "xs" ? "sm" : "base",
|
|
52
|
-
weight: "medium",
|
|
53
|
-
component: "span",
|
|
54
|
-
fixY: !0,
|
|
55
|
-
className: f("transition-opacity", {
|
|
56
|
-
"opacity-0": o
|
|
57
|
-
}),
|
|
58
|
-
children: r
|
|
59
|
-
}
|
|
60
|
-
),
|
|
61
|
-
s || p === "end" && a
|
|
63
|
+
e && /* @__PURE__ */ o("span", { className: "absolute", children: /* @__PURE__ */ o(w, {}) }),
|
|
64
|
+
(s || n === "start") && r,
|
|
65
|
+
B(),
|
|
66
|
+
s || n === "end" && r
|
|
62
67
|
]
|
|
63
68
|
}
|
|
64
69
|
);
|
|
65
70
|
}
|
|
66
71
|
);
|
|
67
|
-
|
|
72
|
+
S.displayName = "Button";
|
|
68
73
|
export {
|
|
69
|
-
|
|
70
|
-
|
|
74
|
+
S as Button,
|
|
75
|
+
E as buttonVariants
|
|
71
76
|
};
|
|
@@ -13,5 +13,7 @@ export declare const AllSizes: Story;
|
|
|
13
13
|
export declare const InteractiveStates: Story;
|
|
14
14
|
export declare const IconExamples: Story;
|
|
15
15
|
export declare const WithSecondIcon: Story;
|
|
16
|
+
export declare const AsChildAnchor: Story;
|
|
17
|
+
export declare const AsChildEdgeCases: Story;
|
|
16
18
|
export declare const ResponsiveExample: Story;
|
|
17
19
|
//# sourceMappingURL=Button.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.stories.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAW3D,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAA;AAoBnD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAqF7B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAA;AAEpC,eAAO,MAAM,OAAO,EAAE,KAarB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAetB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAe7B,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAoCtB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAgBvB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAyCzB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAkDtB,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAmF/B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KA8D1B,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAgB5B,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAgB3B,CAAA;AAaD,eAAO,MAAM,gBAAgB,EAAE,KAmL9B,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAgC/B,CAAA"}
|
|
@@ -17,7 +17,12 @@ export interface EdgeButtonProps extends React.ButtonHTMLAttributes<HTMLButtonEl
|
|
|
17
17
|
*/
|
|
18
18
|
disabled?: boolean;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* When true, merges EdgeButton props/styles onto the single child element via
|
|
21
|
+
* Radix `Slot` (e.g. `<EdgeButton asChild><a href="/help">Help</a></EdgeButton>`
|
|
22
|
+
* renders an `<a>` with all button styling and click target). The leading icon
|
|
23
|
+
* and text are injected as siblings of the child's original content.
|
|
24
|
+
* Note: `disabled` has no effect on non-`<button>` children — use
|
|
25
|
+
* `aria-disabled` on the child instead.
|
|
21
26
|
* @default false
|
|
22
27
|
*/
|
|
23
28
|
asChild?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EdgeButton.d.ts","sourceRoot":"","sources":["../../../src/components/EdgeButton/EdgeButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"EdgeButton.d.ts","sourceRoot":"","sources":["../../../src/components/EdgeButton/EdgeButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,QAAA,MAAM,kBAAkB;;8EAwBvB,CAAA;AAED;;;;;GAKG;AACH,MAAM,WAAW,eACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACrD,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACvB;AAED,QAAA,MAAM,UAAU,2FAmFf,CAAA;AAID,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as a } from "react/jsx-runtime";
|
|
2
|
+
import s from "react";
|
|
3
|
+
import { Slot as h, Slottable as l } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as x } from "class-variance-authority";
|
|
5
|
+
import { sharedButtonVariants as d } from "../Button/buttonVariants.js";
|
|
6
|
+
import { cn as y } from "../../utils/cn.js";
|
|
7
|
+
import { Typography as j } from "../Typography/Typography.js";
|
|
8
|
+
const _ = x(
|
|
8
9
|
[
|
|
9
10
|
"inline-flex items-center justify-center",
|
|
10
11
|
"h-comp-help-button-h gap-comp-button-gap px-comp-help-button-p",
|
|
@@ -12,7 +13,7 @@ const z = u(
|
|
|
12
13
|
"&>svg]:duration-250 transition-colors duration-250 [&>svg]:transition-opacity",
|
|
13
14
|
"[&>svg]:size-icon-medium",
|
|
14
15
|
"disabled:pointer-events-none",
|
|
15
|
-
...
|
|
16
|
+
...d.primary
|
|
16
17
|
],
|
|
17
18
|
{
|
|
18
19
|
variants: {
|
|
@@ -28,45 +29,68 @@ const z = u(
|
|
|
28
29
|
disabled: !1
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
|
-
),
|
|
32
|
-
({
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
32
|
+
), B = s.forwardRef(
|
|
33
|
+
({
|
|
34
|
+
onClick: u,
|
|
35
|
+
disabled: p,
|
|
36
|
+
text: m,
|
|
37
|
+
className: c,
|
|
38
|
+
asChild: n,
|
|
39
|
+
icon: o,
|
|
40
|
+
children: t,
|
|
41
|
+
...f
|
|
42
|
+
}, b) => {
|
|
43
|
+
const g = n ? h : "button", r = m ? /* @__PURE__ */ e(
|
|
44
|
+
j,
|
|
45
|
+
{
|
|
46
|
+
component: "span",
|
|
47
|
+
size: "base",
|
|
48
|
+
variant: "cta",
|
|
49
|
+
weight: "medium",
|
|
50
|
+
fixY: !0,
|
|
51
|
+
children: m
|
|
52
|
+
}
|
|
53
|
+
) : null, v = () => n ? s.isValidElement(t) ? /* @__PURE__ */ e(l, { children: s.cloneElement(
|
|
54
|
+
t,
|
|
55
|
+
void 0,
|
|
56
|
+
/* @__PURE__ */ i(a, { children: [
|
|
57
|
+
o,
|
|
58
|
+
r,
|
|
59
|
+
t.props.children
|
|
60
|
+
] })
|
|
61
|
+
) }) : /* @__PURE__ */ i(a, { children: [
|
|
62
|
+
o,
|
|
63
|
+
r,
|
|
64
|
+
/* @__PURE__ */ e(l, { children: t })
|
|
65
|
+
] }) : /* @__PURE__ */ i(a, { children: [
|
|
66
|
+
o,
|
|
67
|
+
r,
|
|
68
|
+
t
|
|
69
|
+
] });
|
|
70
|
+
return /* @__PURE__ */ e(
|
|
71
|
+
g,
|
|
72
|
+
{
|
|
73
|
+
ref: b,
|
|
74
|
+
onClick: p ? void 0 : u,
|
|
75
|
+
...n ? {} : { type: "button", disabled: p },
|
|
76
|
+
className: y(
|
|
77
|
+
"inline-flex items-center justify-center",
|
|
78
|
+
"h-comp-help-button-h gap-comp-button-gap px-comp-help-button-p",
|
|
79
|
+
"rounded-tl-2xl",
|
|
80
|
+
"cursor-pointer disabled:pointer-events-none",
|
|
81
|
+
"&>svg]:duration-250 transition-colors duration-250 [&>svg]:transition-opacity",
|
|
82
|
+
"[&>svg]:size-icon-medium",
|
|
83
|
+
...d.primary,
|
|
84
|
+
c
|
|
62
85
|
),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
86
|
+
...f,
|
|
87
|
+
children: v()
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
67
91
|
);
|
|
68
|
-
|
|
92
|
+
B.displayName = "EdgeButton";
|
|
69
93
|
export {
|
|
70
|
-
|
|
71
|
-
|
|
94
|
+
B as EdgeButton,
|
|
95
|
+
_ as edgeButtonVariants
|
|
72
96
|
};
|
|
@@ -8,4 +8,6 @@ export declare const WithIcon: Story;
|
|
|
8
8
|
export declare const InteractiveStates: Story;
|
|
9
9
|
export declare const Accessibility: Story;
|
|
10
10
|
export declare const Playground: Story;
|
|
11
|
+
export declare const AsChildAnchor: Story;
|
|
12
|
+
export declare const AsChildEdgeCases: Story;
|
|
11
13
|
//# sourceMappingURL=EdgeButton.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EdgeButton.stories.d.ts","sourceRoot":"","sources":["../../../src/components/EdgeButton/EdgeButton.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EdgeButton.stories.d.ts","sourceRoot":"","sources":["../../../src/components/EdgeButton/EdgeButton.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAI3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAIzC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAkGjC,CAAA;AAED,eAAe,IAAI,CAAA;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAA;AAExC,eAAO,MAAM,OAAO,EAAE,KAYrB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KActB,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAqD/B,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAmD3B,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAexB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAe3B,CAAA;AAaD,eAAO,MAAM,gBAAgB,EAAE,KA+H9B,CAAA"}
|