@vkzstudio/muza-ui 1.0.15 → 1.0.16
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.
|
@@ -25,8 +25,10 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
25
25
|
asChild?: boolean;
|
|
26
26
|
/** React node displayed as an icon. Position controlled by `iconPosition`. */
|
|
27
27
|
icon?: React.ReactNode;
|
|
28
|
-
/** Places icon before (`start`) or after (`end`) the button text. @default 'start' */
|
|
28
|
+
/** Places icon before (`start`) or after (`end`) the button text. Ignored when `secondIcon` is provided. @default 'start' */
|
|
29
29
|
iconPosition?: 'start' | 'end';
|
|
30
|
+
/** Optional trailing icon. When set, `icon` is always rendered at the start and `secondIcon` at the end, ignoring `iconPosition`. */
|
|
31
|
+
secondIcon?: React.ReactNode;
|
|
30
32
|
/** Removes background, showing only text and icon with hover effects. @default false */
|
|
31
33
|
ghost?: boolean;
|
|
32
34
|
/** Applies destructive/error styling for delete or dangerous actions. @default false */
|
|
@@ -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;AAC9B,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,IA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O,CAAA;IAChB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,QAAA,MAAM,MAAM,uFAiEX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -1,70 +1,71 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as N, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
3
|
import "class-variance-authority";
|
|
4
|
-
import { ButtonLoader as
|
|
5
|
-
import { buttonVariants as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Typography as
|
|
8
|
-
const
|
|
4
|
+
import { ButtonLoader as B } from "./ButtonLoader.js";
|
|
5
|
+
import { buttonVariants as g } from "./buttonVariants.js";
|
|
6
|
+
import { cn as f } from "../../utils/cn.js";
|
|
7
|
+
import { Typography as j } from "../Typography/Typography.js";
|
|
8
|
+
const w = d.forwardRef(
|
|
9
9
|
({
|
|
10
|
-
className:
|
|
11
|
-
variant:
|
|
10
|
+
className: i,
|
|
11
|
+
variant: u,
|
|
12
12
|
size: t,
|
|
13
|
-
fullWidth:
|
|
14
|
-
asChild:
|
|
15
|
-
icon:
|
|
16
|
-
iconPosition:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
fullWidth: c,
|
|
14
|
+
asChild: l = !1,
|
|
15
|
+
icon: a,
|
|
16
|
+
iconPosition: p = "start",
|
|
17
|
+
secondIcon: s,
|
|
18
|
+
ghost: y = !1,
|
|
19
|
+
danger: e = !1,
|
|
20
|
+
loading: o = !1,
|
|
21
|
+
children: r,
|
|
22
|
+
...h
|
|
23
|
+
}, x) => {
|
|
24
|
+
const b = l ? "span" : "button", n = t === "icon" || y;
|
|
25
|
+
return /* @__PURE__ */ N(
|
|
26
|
+
b,
|
|
26
27
|
{
|
|
27
|
-
className:
|
|
28
|
-
|
|
29
|
-
variant:
|
|
28
|
+
className: f(
|
|
29
|
+
g({
|
|
30
|
+
variant: u,
|
|
30
31
|
size: t,
|
|
31
|
-
fullWidth:
|
|
32
|
-
iconOnly: t === "icon" || !
|
|
33
|
-
ghost:
|
|
34
|
-
danger:
|
|
35
|
-
loading:
|
|
36
|
-
className:
|
|
32
|
+
fullWidth: c,
|
|
33
|
+
iconOnly: t === "icon" || !r,
|
|
34
|
+
ghost: n,
|
|
35
|
+
danger: e,
|
|
36
|
+
loading: o,
|
|
37
|
+
className: i
|
|
37
38
|
})
|
|
38
39
|
),
|
|
39
|
-
ref:
|
|
40
|
-
"data-ghost":
|
|
41
|
-
"data-danger":
|
|
42
|
-
...
|
|
40
|
+
ref: x,
|
|
41
|
+
"data-ghost": n,
|
|
42
|
+
"data-danger": e,
|
|
43
|
+
...h,
|
|
43
44
|
children: [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
o && /* @__PURE__ */ m("span", { className: "absolute", children: /* @__PURE__ */ m(B, {}) }),
|
|
46
|
+
(s || p === "start") && a,
|
|
47
|
+
r && /* @__PURE__ */ m(
|
|
48
|
+
j,
|
|
48
49
|
{
|
|
49
50
|
variant: "cta",
|
|
50
51
|
size: t == "sm" || t == "xs" ? "sm" : "base",
|
|
51
52
|
weight: "medium",
|
|
52
53
|
component: "span",
|
|
53
54
|
fixY: !0,
|
|
54
|
-
className:
|
|
55
|
-
"opacity-0":
|
|
55
|
+
className: f("transition-opacity", {
|
|
56
|
+
"opacity-0": o
|
|
56
57
|
}),
|
|
57
|
-
children:
|
|
58
|
+
children: r
|
|
58
59
|
}
|
|
59
60
|
),
|
|
60
|
-
|
|
61
|
+
s || p === "end" && a
|
|
61
62
|
]
|
|
62
63
|
}
|
|
63
64
|
);
|
|
64
65
|
}
|
|
65
66
|
);
|
|
66
|
-
|
|
67
|
+
w.displayName = "Button";
|
|
67
68
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
w as Button,
|
|
70
|
+
g as buttonVariants
|
|
70
71
|
};
|
|
@@ -12,5 +12,6 @@ export declare const AllVariants: Story;
|
|
|
12
12
|
export declare const AllSizes: Story;
|
|
13
13
|
export declare const InteractiveStates: Story;
|
|
14
14
|
export declare const IconExamples: Story;
|
|
15
|
+
export declare const WithSecondIcon: Story;
|
|
15
16
|
export declare const ResponsiveExample: Story;
|
|
16
17
|
//# 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":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAU3D,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAA;AAoBnD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAU3D,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAA;AAoBnD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAoF7B,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,iBAAiB,EAAE,KAgC/B,CAAA"}
|