@pismo/marola 1.0.0-beta.10 → 1.0.0-beta.11
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.
|
@@ -16,6 +16,8 @@ type ButtonCoreProps = {
|
|
|
16
16
|
variant?: Variant;
|
|
17
17
|
/** mui base button props */
|
|
18
18
|
muiButtonBaseProps?: MUIButtonBaseProps;
|
|
19
|
+
/** Id to be applied as `data-testid` on the container element */
|
|
20
|
+
'data-testid'?: string;
|
|
19
21
|
};
|
|
20
22
|
interface ButtonPropsWithLink extends ButtonCoreProps {
|
|
21
23
|
/** link for component to navigate to, if provide component will be an anchor */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import '../../assets/Button.css';
|
|
2
|
-
import { jsx as p, jsxs as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { c } from "../../clsx-DB4S2d7J.js";
|
|
5
|
-
import { LoadingSpinner as
|
|
6
|
-
import { B as
|
|
7
|
-
const
|
|
2
|
+
import { jsx as p, jsxs as l } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as x, useMemo as c } from "react";
|
|
4
|
+
import { c as v } from "../../clsx-DB4S2d7J.js";
|
|
5
|
+
import { LoadingSpinner as m } from "../LoadingSpinner/LoadingSpinner.js";
|
|
6
|
+
import { B as f } from "../../Button-DiLqcAJG.js";
|
|
7
|
+
const k = "_button_dxo5v_57", t = {
|
|
8
8
|
"u-typography-h1": "_u-typography-h1_dxo5v_1",
|
|
9
9
|
"u-typography-h2": "_u-typography-h2_dxo5v_8",
|
|
10
10
|
"u-typography-h3": "_u-typography-h3_dxo5v_15",
|
|
@@ -15,7 +15,7 @@ const f = "_button_dxo5v_57", t = {
|
|
|
15
15
|
"u-typography-base--xxl": "_u-typography-base--xxl_dxo5v_49",
|
|
16
16
|
"u-typography-base--xl": "_u-typography-base--xl_dxo5v_53",
|
|
17
17
|
"u-typography-base--lg": "_u-typography-base--lg_dxo5v_57",
|
|
18
|
-
button:
|
|
18
|
+
button: k,
|
|
19
19
|
"u-typography-base--sm": "_u-typography-base--sm_dxo5v_61",
|
|
20
20
|
"u-typography-base--bold": "_u-typography-base--bold_dxo5v_65",
|
|
21
21
|
"u-typography-base--strikethrough": "_u-typography-base--strikethrough_dxo5v_68",
|
|
@@ -25,41 +25,43 @@ const f = "_button_dxo5v_57", t = {
|
|
|
25
25
|
"button--secondary": "_button--secondary_dxo5v_101",
|
|
26
26
|
"button--quick": "_button--quick_dxo5v_118",
|
|
27
27
|
"button__loading-container": "_button__loading-container_dxo5v_138"
|
|
28
|
-
},
|
|
28
|
+
}, S = x((y, _) => {
|
|
29
29
|
const {
|
|
30
30
|
onClick: u,
|
|
31
|
-
link:
|
|
32
|
-
loading:
|
|
31
|
+
link: e,
|
|
32
|
+
loading: n,
|
|
33
33
|
children: a,
|
|
34
34
|
type: s = "button",
|
|
35
35
|
disabled: h,
|
|
36
36
|
className: r,
|
|
37
37
|
variant: o = "primary",
|
|
38
|
-
muiButtonBaseProps: d
|
|
39
|
-
|
|
38
|
+
muiButtonBaseProps: d,
|
|
39
|
+
"data-testid": g
|
|
40
|
+
} = y, i = {
|
|
40
41
|
invert: o === "secondary" || o === "quick"
|
|
41
|
-
},
|
|
42
|
-
() =>
|
|
42
|
+
}, b = c(
|
|
43
|
+
() => v([t.button, t[`button--${o}`], r]),
|
|
43
44
|
[r, o]
|
|
44
45
|
);
|
|
45
46
|
return /* @__PURE__ */ p(
|
|
46
|
-
|
|
47
|
+
f,
|
|
47
48
|
{
|
|
48
49
|
type: s,
|
|
49
|
-
href:
|
|
50
|
+
href: e,
|
|
50
51
|
onClick: u,
|
|
51
52
|
disabled: h,
|
|
52
|
-
className:
|
|
53
|
+
className: b,
|
|
53
54
|
ref: _,
|
|
55
|
+
"data-testid": g,
|
|
54
56
|
...d ?? {},
|
|
55
|
-
children:
|
|
56
|
-
/* @__PURE__ */ p(
|
|
57
|
+
children: n ? /* @__PURE__ */ l("div", { className: t["button__loading-container"], children: [
|
|
58
|
+
/* @__PURE__ */ p(m, { ...i }),
|
|
57
59
|
a
|
|
58
60
|
] }) : a
|
|
59
61
|
}
|
|
60
62
|
);
|
|
61
63
|
});
|
|
62
64
|
export {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
S as Button,
|
|
66
|
+
S as default
|
|
65
67
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pismo/marola",
|
|
3
3
|
"description": "CDX tribe component library",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.11",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"types": "dist/main.d.ts",
|
|
@@ -34,13 +34,16 @@
|
|
|
34
34
|
"prebuild": "yarn export-files & yarn generate-icon-types",
|
|
35
35
|
"build": "tsc --p ./tsconfig-build.json && vite build && mv ./dist/assets/marola.css ./dist",
|
|
36
36
|
"postbuild": "storybook build --disable-telemetry --output-dir build",
|
|
37
|
-
"storybook": "storybook dev -p 6006"
|
|
37
|
+
"storybook": "storybook dev -p 6006",
|
|
38
|
+
"prepare": "husky"
|
|
38
39
|
},
|
|
39
40
|
"peerDependencies": {
|
|
40
41
|
"react": "^18.2.0",
|
|
41
42
|
"react-dom": "^18.2.0"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
45
|
+
"@commitlint/cli": "^19.3.0",
|
|
46
|
+
"@commitlint/config-conventional": "^19.2.2",
|
|
44
47
|
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
|
|
45
48
|
"@storybook/addon-a11y": "^8.0.8",
|
|
46
49
|
"@storybook/addon-essentials": "^8.0.8",
|
|
@@ -70,6 +73,7 @@
|
|
|
70
73
|
"glob": "^10.3.14",
|
|
71
74
|
"husky": "^9.0.11",
|
|
72
75
|
"jsdom": "^24.0.0",
|
|
76
|
+
"lint-staged": "^15.2.7",
|
|
73
77
|
"prettier": "^3.2.5",
|
|
74
78
|
"react": "^18.2.0",
|
|
75
79
|
"react-dom": "^18.2.0",
|
|
@@ -91,4 +95,4 @@
|
|
|
91
95
|
"@mui/base": "^5.0.0-beta.40",
|
|
92
96
|
"@mui/material": "^5.15.15"
|
|
93
97
|
}
|
|
94
|
-
}
|
|
98
|
+
}
|