@xylabs/react-button 3.4.1 → 4.0.0
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/browser/index.d.ts +14 -2
- package/dist/browser/index.mjs +65 -0
- package/dist/browser/index.mjs.map +1 -0
- package/package.json +11 -31
- package/src/components/ButtonEx.stories.tsx +5 -3
- package/src/components/ButtonEx.tsx +4 -4
- package/src/components/ButtonExBase.tsx +8 -8
- package/src/components/ButtonExTo.tsx +3 -3
- package/src/components/index.ts +2 -2
- package/src/index.ts +1 -1
- package/xy.config.ts +12 -0
- package/dist/browser/components/ButtonEx.d.cts +0 -4
- package/dist/browser/components/ButtonEx.d.cts.map +0 -1
- package/dist/browser/components/ButtonEx.d.mts +0 -4
- package/dist/browser/components/ButtonEx.d.mts.map +0 -1
- package/dist/browser/components/ButtonEx.d.ts +0 -4
- package/dist/browser/components/ButtonEx.d.ts.map +0 -1
- package/dist/browser/components/ButtonExBase.d.cts +0 -4
- package/dist/browser/components/ButtonExBase.d.cts.map +0 -1
- package/dist/browser/components/ButtonExBase.d.mts +0 -4
- package/dist/browser/components/ButtonExBase.d.mts.map +0 -1
- package/dist/browser/components/ButtonExBase.d.ts +0 -4
- package/dist/browser/components/ButtonExBase.d.ts.map +0 -1
- package/dist/browser/components/ButtonExProps.d.cts +0 -10
- package/dist/browser/components/ButtonExProps.d.cts.map +0 -1
- package/dist/browser/components/ButtonExProps.d.mts +0 -10
- package/dist/browser/components/ButtonExProps.d.mts.map +0 -1
- package/dist/browser/components/ButtonExProps.d.ts +0 -10
- package/dist/browser/components/ButtonExProps.d.ts.map +0 -1
- package/dist/browser/components/ButtonExTo.d.cts +0 -4
- package/dist/browser/components/ButtonExTo.d.cts.map +0 -1
- package/dist/browser/components/ButtonExTo.d.mts +0 -4
- package/dist/browser/components/ButtonExTo.d.mts.map +0 -1
- package/dist/browser/components/ButtonExTo.d.ts +0 -4
- package/dist/browser/components/ButtonExTo.d.ts.map +0 -1
- package/dist/browser/components/index.d.cts +0 -3
- package/dist/browser/components/index.d.cts.map +0 -1
- package/dist/browser/components/index.d.mts +0 -3
- package/dist/browser/components/index.d.mts.map +0 -1
- package/dist/browser/components/index.d.ts +0 -3
- package/dist/browser/components/index.d.ts.map +0 -1
- package/dist/browser/index.cjs +0 -73
- package/dist/browser/index.cjs.map +0 -1
- package/dist/browser/index.d.cts +0 -2
- package/dist/browser/index.d.cts.map +0 -1
- package/dist/browser/index.d.mts +0 -2
- package/dist/browser/index.d.mts.map +0 -1
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/index.js +0 -50
- package/dist/browser/index.js.map +0 -1
- package/dist/neutral/components/ButtonEx.d.cts +0 -4
- package/dist/neutral/components/ButtonEx.d.cts.map +0 -1
- package/dist/neutral/components/ButtonEx.d.mts +0 -4
- package/dist/neutral/components/ButtonEx.d.mts.map +0 -1
- package/dist/neutral/components/ButtonEx.d.ts +0 -4
- package/dist/neutral/components/ButtonEx.d.ts.map +0 -1
- package/dist/neutral/components/ButtonExBase.d.cts +0 -4
- package/dist/neutral/components/ButtonExBase.d.cts.map +0 -1
- package/dist/neutral/components/ButtonExBase.d.mts +0 -4
- package/dist/neutral/components/ButtonExBase.d.mts.map +0 -1
- package/dist/neutral/components/ButtonExBase.d.ts +0 -4
- package/dist/neutral/components/ButtonExBase.d.ts.map +0 -1
- package/dist/neutral/components/ButtonExProps.d.cts +0 -10
- package/dist/neutral/components/ButtonExProps.d.cts.map +0 -1
- package/dist/neutral/components/ButtonExProps.d.mts +0 -10
- package/dist/neutral/components/ButtonExProps.d.mts.map +0 -1
- package/dist/neutral/components/ButtonExProps.d.ts +0 -10
- package/dist/neutral/components/ButtonExProps.d.ts.map +0 -1
- package/dist/neutral/components/ButtonExTo.d.cts +0 -4
- package/dist/neutral/components/ButtonExTo.d.cts.map +0 -1
- package/dist/neutral/components/ButtonExTo.d.mts +0 -4
- package/dist/neutral/components/ButtonExTo.d.mts.map +0 -1
- package/dist/neutral/components/ButtonExTo.d.ts +0 -4
- package/dist/neutral/components/ButtonExTo.d.ts.map +0 -1
- package/dist/neutral/components/index.d.cts +0 -3
- package/dist/neutral/components/index.d.cts.map +0 -1
- package/dist/neutral/components/index.d.mts +0 -3
- package/dist/neutral/components/index.d.mts.map +0 -1
- package/dist/neutral/components/index.d.ts +0 -3
- package/dist/neutral/components/index.d.ts.map +0 -1
- package/dist/neutral/index.cjs +0 -73
- package/dist/neutral/index.cjs.map +0 -1
- package/dist/neutral/index.d.cts +0 -2
- package/dist/neutral/index.d.cts.map +0 -1
- package/dist/neutral/index.d.mts +0 -2
- package/dist/neutral/index.d.mts.map +0 -1
- package/dist/neutral/index.d.ts +0 -2
- package/dist/neutral/index.d.ts.map +0 -1
- package/dist/neutral/index.js +0 -50
- package/dist/neutral/index.js.map +0 -1
- package/dist/node/components/ButtonEx.d.cts +0 -4
- package/dist/node/components/ButtonEx.d.cts.map +0 -1
- package/dist/node/components/ButtonEx.d.mts +0 -4
- package/dist/node/components/ButtonEx.d.mts.map +0 -1
- package/dist/node/components/ButtonEx.d.ts +0 -4
- package/dist/node/components/ButtonEx.d.ts.map +0 -1
- package/dist/node/components/ButtonExBase.d.cts +0 -4
- package/dist/node/components/ButtonExBase.d.cts.map +0 -1
- package/dist/node/components/ButtonExBase.d.mts +0 -4
- package/dist/node/components/ButtonExBase.d.mts.map +0 -1
- package/dist/node/components/ButtonExBase.d.ts +0 -4
- package/dist/node/components/ButtonExBase.d.ts.map +0 -1
- package/dist/node/components/ButtonExProps.d.cts +0 -10
- package/dist/node/components/ButtonExProps.d.cts.map +0 -1
- package/dist/node/components/ButtonExProps.d.mts +0 -10
- package/dist/node/components/ButtonExProps.d.mts.map +0 -1
- package/dist/node/components/ButtonExProps.d.ts +0 -10
- package/dist/node/components/ButtonExProps.d.ts.map +0 -1
- package/dist/node/components/ButtonExTo.d.cts +0 -4
- package/dist/node/components/ButtonExTo.d.cts.map +0 -1
- package/dist/node/components/ButtonExTo.d.mts +0 -4
- package/dist/node/components/ButtonExTo.d.mts.map +0 -1
- package/dist/node/components/ButtonExTo.d.ts +0 -4
- package/dist/node/components/ButtonExTo.d.ts.map +0 -1
- package/dist/node/components/index.d.cts +0 -3
- package/dist/node/components/index.d.cts.map +0 -1
- package/dist/node/components/index.d.mts +0 -3
- package/dist/node/components/index.d.mts.map +0 -1
- package/dist/node/components/index.d.ts +0 -3
- package/dist/node/components/index.d.ts.map +0 -1
- package/dist/node/index.cjs +0 -77
- package/dist/node/index.cjs.map +0 -1
- package/dist/node/index.d.cts +0 -2
- package/dist/node/index.d.cts.map +0 -1
- package/dist/node/index.d.mts +0 -2
- package/dist/node/index.d.mts.map +0 -1
- package/dist/node/index.d.ts +0 -2
- package/dist/node/index.d.ts.map +0 -1
- package/dist/node/index.js +0 -50
- package/dist/node/index.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonEx.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonEx.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAGnD,QAAA,MAAM,QAAQ,6GAEZ,CAAA;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonEx.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonEx.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAGnD,QAAA,MAAM,QAAQ,6GAEZ,CAAA;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExBase.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExBase.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,QAAA,MAAM,YAAY,6GAqBhB,CAAA;AAIF,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExBase.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExBase.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,QAAA,MAAM,YAAY,6GAqBhB,CAAA;AAIF,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExBase.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExBase.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,QAAA,MAAM,YAAY,6GAqBhB,CAAA;AAIF,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from '@mui/material';
|
|
2
|
-
import { BoxlikeComponentProps, BusyProps } from '@xylabs/react-shared';
|
|
3
|
-
import type { NavigateOptions, To } from 'react-router-dom';
|
|
4
|
-
interface ButtonExProps extends Omit<ButtonProps, 'ref'>, BoxlikeComponentProps, BusyProps {
|
|
5
|
-
target?: string;
|
|
6
|
-
to?: To;
|
|
7
|
-
toOptions?: NavigateOptions;
|
|
8
|
-
}
|
|
9
|
-
export type { ButtonExProps };
|
|
10
|
-
//# sourceMappingURL=ButtonExProps.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExProps.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExProps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AAE3D,UAAU,aAAc,SAAQ,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,qBAAqB,EAAE,SAAS;IACxF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,SAAS,CAAC,EAAE,eAAe,CAAA;CAC5B;AAED,YAAY,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from '@mui/material';
|
|
2
|
-
import { BoxlikeComponentProps, BusyProps } from '@xylabs/react-shared';
|
|
3
|
-
import type { NavigateOptions, To } from 'react-router-dom';
|
|
4
|
-
interface ButtonExProps extends Omit<ButtonProps, 'ref'>, BoxlikeComponentProps, BusyProps {
|
|
5
|
-
target?: string;
|
|
6
|
-
to?: To;
|
|
7
|
-
toOptions?: NavigateOptions;
|
|
8
|
-
}
|
|
9
|
-
export type { ButtonExProps };
|
|
10
|
-
//# sourceMappingURL=ButtonExProps.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExProps.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExProps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AAE3D,UAAU,aAAc,SAAQ,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,qBAAqB,EAAE,SAAS;IACxF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,SAAS,CAAC,EAAE,eAAe,CAAA;CAC5B;AAED,YAAY,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from '@mui/material';
|
|
2
|
-
import { BoxlikeComponentProps, BusyProps } from '@xylabs/react-shared';
|
|
3
|
-
import type { NavigateOptions, To } from 'react-router-dom';
|
|
4
|
-
interface ButtonExProps extends Omit<ButtonProps, 'ref'>, BoxlikeComponentProps, BusyProps {
|
|
5
|
-
target?: string;
|
|
6
|
-
to?: To;
|
|
7
|
-
toOptions?: NavigateOptions;
|
|
8
|
-
}
|
|
9
|
-
export type { ButtonExProps };
|
|
10
|
-
//# sourceMappingURL=ButtonExProps.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExProps.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExProps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AAE3D,UAAU,aAAc,SAAQ,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,qBAAqB,EAAE,SAAS;IACxF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,SAAS,CAAC,EAAE,eAAe,CAAA;CAC5B;AAED,YAAY,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExTo.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExTo.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,QAAA,MAAM,UAAU,6GAUd,CAAA;AAIF,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExTo.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExTo.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,QAAA,MAAM,UAAU,6GAUd,CAAA;AAIF,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExTo.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExTo.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,QAAA,MAAM,UAAU,6GAUd,CAAA;AAIF,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA"}
|
package/dist/neutral/index.cjs
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
ButtonEx: () => ButtonEx
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(src_exports);
|
|
26
|
-
|
|
27
|
-
// src/components/ButtonEx.tsx
|
|
28
|
-
var import_react3 = require("react");
|
|
29
|
-
|
|
30
|
-
// src/components/ButtonExBase.tsx
|
|
31
|
-
var import_material = require("@mui/material");
|
|
32
|
-
var import_react_shared = require("@xylabs/react-shared");
|
|
33
|
-
var import_react = require("react");
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
-
var ButtonExBase = (0, import_react.forwardRef)((props, ref) => {
|
|
36
|
-
const theme = (0, import_material.useTheme)();
|
|
37
|
-
const { busy, busyVariant = "linear", busyOpacity, onClick, children, ...rootProps } = (0, import_react_shared.mergeBoxlikeStyles)(theme, props);
|
|
38
|
-
const localOnClick = (event) => {
|
|
39
|
-
if (!busy) {
|
|
40
|
-
onClick?.(event);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Button, { ref, onClick: localOnClick, ...rootProps, children: [
|
|
44
|
-
busy && busyVariant === "linear" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_shared.BusyLinearProgress, { rounded: true, opacity: busyOpacity ?? 0 }) : null,
|
|
45
|
-
busy && busyVariant === "circular" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_shared.BusyCircularProgress, { rounded: true, size: 24, opacity: busyOpacity ?? 0.5 }) : null,
|
|
46
|
-
children
|
|
47
|
-
] });
|
|
48
|
-
});
|
|
49
|
-
ButtonExBase.displayName = "ButtonExBaseXYLabs";
|
|
50
|
-
|
|
51
|
-
// src/components/ButtonExTo.tsx
|
|
52
|
-
var import_react2 = require("react");
|
|
53
|
-
var import_react_router_dom = require("react-router-dom");
|
|
54
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
55
|
-
var ButtonToEx = (0, import_react2.forwardRef)(({ to, toOptions, onClick, ...props }, ref) => {
|
|
56
|
-
const navigate = (0, import_react_router_dom.useNavigate)();
|
|
57
|
-
const localOnClick = (event) => {
|
|
58
|
-
onClick?.(event);
|
|
59
|
-
if (to) {
|
|
60
|
-
navigate(to, toOptions);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ButtonExBase, { ref, onClick: localOnClick, ...props });
|
|
64
|
-
});
|
|
65
|
-
ButtonToEx.displayName = "ButtonToExXYLabs";
|
|
66
|
-
|
|
67
|
-
// src/components/ButtonEx.tsx
|
|
68
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
69
|
-
var ButtonEx = (0, import_react3.forwardRef)(({ to, ...props }, ref) => {
|
|
70
|
-
return to ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ButtonToEx, { to, ref, ...props }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ButtonExBase, { ...props });
|
|
71
|
-
});
|
|
72
|
-
ButtonEx.displayName = "ButtonExXYLabs";
|
|
73
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/components/ButtonEx.tsx","../../src/components/ButtonExBase.tsx","../../src/components/ButtonExTo.tsx"],"sourcesContent":["export * from './components/index.js'\n","import { forwardRef } from 'react'\n\nimport { ButtonExBase } from './ButtonExBase.jsx'\nimport { ButtonExProps } from './ButtonExProps.jsx'\nimport { ButtonToEx } from './ButtonExTo.jsx'\n\nconst ButtonEx = forwardRef<HTMLButtonElement, ButtonExProps>(({ to, ...props }, ref) => {\n return to ? <ButtonToEx to={to} ref={ref} {...props} /> : <ButtonExBase {...props} />\n})\n\nButtonEx.displayName = 'ButtonExXYLabs'\n\nexport { ButtonEx }\n","import { Button, useTheme } from '@mui/material'\nimport { BusyCircularProgress, BusyLinearProgress, mergeBoxlikeStyles } from '@xylabs/react-shared'\nimport { forwardRef, MouseEvent } from 'react'\n\nimport { ButtonExProps } from './ButtonExProps.jsx'\n\nconst ButtonExBase = forwardRef<HTMLButtonElement, ButtonExProps>((props, ref) => {\n const theme = useTheme()\n const { busy, busyVariant = 'linear', busyOpacity, onClick, children, ...rootProps } = mergeBoxlikeStyles<ButtonExProps>(theme, props)\n\n const localOnClick = (event: MouseEvent<HTMLButtonElement>) => {\n if (!busy) {\n onClick?.(event)\n }\n }\n\n return (\n <Button ref={ref} onClick={localOnClick} {...rootProps}>\n {busy && busyVariant === 'linear' ?\n <BusyLinearProgress rounded opacity={busyOpacity ?? 0} />\n : null}\n {busy && busyVariant === 'circular' ?\n <BusyCircularProgress rounded size={24} opacity={busyOpacity ?? 0.5} />\n : null}\n {children}\n </Button>\n )\n})\n\nButtonExBase.displayName = 'ButtonExBaseXYLabs'\n\nexport { ButtonExBase }\n","import { forwardRef, MouseEvent } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ButtonExBase } from './ButtonExBase.jsx'\nimport { ButtonExProps } from './ButtonExProps.jsx'\n\nconst ButtonToEx = forwardRef<HTMLButtonElement, ButtonExProps>(({ to, toOptions, onClick, ...props }, ref) => {\n const navigate = useNavigate()\n const localOnClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event)\n if (to) {\n navigate(to, toOptions)\n }\n }\n\n return <ButtonExBase ref={ref} onClick={localOnClick} {...props} />\n})\n\nButtonToEx.displayName = 'ButtonToExXYLabs'\n\nexport { ButtonToEx }\n"],"mappings":";;;;;;;;;;;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AED,SAAS,cAAc;","names":["import_react","import_react","import_jsx_runtime","import_jsx_runtime"]}
|
package/dist/neutral/index.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA"}
|
package/dist/neutral/index.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA"}
|
package/dist/neutral/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA"}
|
package/dist/neutral/index.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// src/components/ButtonEx.tsx
|
|
2
|
-
import { forwardRef as forwardRef3 } from "react";
|
|
3
|
-
|
|
4
|
-
// src/components/ButtonExBase.tsx
|
|
5
|
-
import { Button, useTheme } from "@mui/material";
|
|
6
|
-
import { BusyCircularProgress, BusyLinearProgress, mergeBoxlikeStyles } from "@xylabs/react-shared";
|
|
7
|
-
import { forwardRef } from "react";
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
var ButtonExBase = forwardRef((props, ref) => {
|
|
10
|
-
const theme = useTheme();
|
|
11
|
-
const { busy, busyVariant = "linear", busyOpacity, onClick, children, ...rootProps } = mergeBoxlikeStyles(theme, props);
|
|
12
|
-
const localOnClick = (event) => {
|
|
13
|
-
if (!busy) {
|
|
14
|
-
onClick?.(event);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
return /* @__PURE__ */ jsxs(Button, { ref, onClick: localOnClick, ...rootProps, children: [
|
|
18
|
-
busy && busyVariant === "linear" ? /* @__PURE__ */ jsx(BusyLinearProgress, { rounded: true, opacity: busyOpacity ?? 0 }) : null,
|
|
19
|
-
busy && busyVariant === "circular" ? /* @__PURE__ */ jsx(BusyCircularProgress, { rounded: true, size: 24, opacity: busyOpacity ?? 0.5 }) : null,
|
|
20
|
-
children
|
|
21
|
-
] });
|
|
22
|
-
});
|
|
23
|
-
ButtonExBase.displayName = "ButtonExBaseXYLabs";
|
|
24
|
-
|
|
25
|
-
// src/components/ButtonExTo.tsx
|
|
26
|
-
import { forwardRef as forwardRef2 } from "react";
|
|
27
|
-
import { useNavigate } from "react-router-dom";
|
|
28
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
29
|
-
var ButtonToEx = forwardRef2(({ to, toOptions, onClick, ...props }, ref) => {
|
|
30
|
-
const navigate = useNavigate();
|
|
31
|
-
const localOnClick = (event) => {
|
|
32
|
-
onClick?.(event);
|
|
33
|
-
if (to) {
|
|
34
|
-
navigate(to, toOptions);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
return /* @__PURE__ */ jsx2(ButtonExBase, { ref, onClick: localOnClick, ...props });
|
|
38
|
-
});
|
|
39
|
-
ButtonToEx.displayName = "ButtonToExXYLabs";
|
|
40
|
-
|
|
41
|
-
// src/components/ButtonEx.tsx
|
|
42
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
43
|
-
var ButtonEx = forwardRef3(({ to, ...props }, ref) => {
|
|
44
|
-
return to ? /* @__PURE__ */ jsx3(ButtonToEx, { to, ref, ...props }) : /* @__PURE__ */ jsx3(ButtonExBase, { ...props });
|
|
45
|
-
});
|
|
46
|
-
ButtonEx.displayName = "ButtonExXYLabs";
|
|
47
|
-
export {
|
|
48
|
-
ButtonEx
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/ButtonEx.tsx","../../src/components/ButtonExBase.tsx","../../src/components/ButtonExTo.tsx"],"sourcesContent":["import { forwardRef } from 'react'\n\nimport { ButtonExBase } from './ButtonExBase.jsx'\nimport { ButtonExProps } from './ButtonExProps.jsx'\nimport { ButtonToEx } from './ButtonExTo.jsx'\n\nconst ButtonEx = forwardRef<HTMLButtonElement, ButtonExProps>(({ to, ...props }, ref) => {\n return to ? <ButtonToEx to={to} ref={ref} {...props} /> : <ButtonExBase {...props} />\n})\n\nButtonEx.displayName = 'ButtonExXYLabs'\n\nexport { ButtonEx }\n","import { Button, useTheme } from '@mui/material'\nimport { BusyCircularProgress, BusyLinearProgress, mergeBoxlikeStyles } from '@xylabs/react-shared'\nimport { forwardRef, MouseEvent } from 'react'\n\nimport { ButtonExProps } from './ButtonExProps.jsx'\n\nconst ButtonExBase = forwardRef<HTMLButtonElement, ButtonExProps>((props, ref) => {\n const theme = useTheme()\n const { busy, busyVariant = 'linear', busyOpacity, onClick, children, ...rootProps } = mergeBoxlikeStyles<ButtonExProps>(theme, props)\n\n const localOnClick = (event: MouseEvent<HTMLButtonElement>) => {\n if (!busy) {\n onClick?.(event)\n }\n }\n\n return (\n <Button ref={ref} onClick={localOnClick} {...rootProps}>\n {busy && busyVariant === 'linear' ?\n <BusyLinearProgress rounded opacity={busyOpacity ?? 0} />\n : null}\n {busy && busyVariant === 'circular' ?\n <BusyCircularProgress rounded size={24} opacity={busyOpacity ?? 0.5} />\n : null}\n {children}\n </Button>\n )\n})\n\nButtonExBase.displayName = 'ButtonExBaseXYLabs'\n\nexport { ButtonExBase }\n","import { forwardRef, MouseEvent } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ButtonExBase } from './ButtonExBase.jsx'\nimport { ButtonExProps } from './ButtonExProps.jsx'\n\nconst ButtonToEx = forwardRef<HTMLButtonElement, ButtonExProps>(({ to, toOptions, onClick, ...props }, ref) => {\n const navigate = useNavigate()\n const localOnClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event)\n if (to) {\n navigate(to, toOptions)\n }\n }\n\n return <ButtonExBase ref={ref} onClick={localOnClick} {...props} />\n})\n\nButtonToEx.display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AD,KAAC,cAAW,IAAQ,KAAW,GAAG,OAAO,IAAK,gBAAAA,KAAC,gBAAc,GAAG,OAAO;AACrF,CAAC;AAED,SAAS,cAAc;","names":["forwardRef","forwardRef","jsx","forwardRef","jsx","forwardRef"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonEx.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonEx.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAGnD,QAAA,MAAM,QAAQ,6GAEZ,CAAA;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonEx.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonEx.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAGnD,QAAA,MAAM,QAAQ,6GAEZ,CAAA;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonEx.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonEx.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAGnD,QAAA,MAAM,QAAQ,6GAEZ,CAAA;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExBase.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExBase.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,QAAA,MAAM,YAAY,6GAqBhB,CAAA;AAIF,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExBase.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExBase.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,QAAA,MAAM,YAAY,6GAqBhB,CAAA;AAIF,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExBase.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExBase.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,QAAA,MAAM,YAAY,6GAqBhB,CAAA;AAIF,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from '@mui/material';
|
|
2
|
-
import { BoxlikeComponentProps, BusyProps } from '@xylabs/react-shared';
|
|
3
|
-
import type { NavigateOptions, To } from 'react-router-dom';
|
|
4
|
-
interface ButtonExProps extends Omit<ButtonProps, 'ref'>, BoxlikeComponentProps, BusyProps {
|
|
5
|
-
target?: string;
|
|
6
|
-
to?: To;
|
|
7
|
-
toOptions?: NavigateOptions;
|
|
8
|
-
}
|
|
9
|
-
export type { ButtonExProps };
|
|
10
|
-
//# sourceMappingURL=ButtonExProps.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExProps.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExProps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AAE3D,UAAU,aAAc,SAAQ,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,qBAAqB,EAAE,SAAS;IACxF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,SAAS,CAAC,EAAE,eAAe,CAAA;CAC5B;AAED,YAAY,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from '@mui/material';
|
|
2
|
-
import { BoxlikeComponentProps, BusyProps } from '@xylabs/react-shared';
|
|
3
|
-
import type { NavigateOptions, To } from 'react-router-dom';
|
|
4
|
-
interface ButtonExProps extends Omit<ButtonProps, 'ref'>, BoxlikeComponentProps, BusyProps {
|
|
5
|
-
target?: string;
|
|
6
|
-
to?: To;
|
|
7
|
-
toOptions?: NavigateOptions;
|
|
8
|
-
}
|
|
9
|
-
export type { ButtonExProps };
|
|
10
|
-
//# sourceMappingURL=ButtonExProps.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExProps.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExProps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AAE3D,UAAU,aAAc,SAAQ,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,qBAAqB,EAAE,SAAS;IACxF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,SAAS,CAAC,EAAE,eAAe,CAAA;CAC5B;AAED,YAAY,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from '@mui/material';
|
|
2
|
-
import { BoxlikeComponentProps, BusyProps } from '@xylabs/react-shared';
|
|
3
|
-
import type { NavigateOptions, To } from 'react-router-dom';
|
|
4
|
-
interface ButtonExProps extends Omit<ButtonProps, 'ref'>, BoxlikeComponentProps, BusyProps {
|
|
5
|
-
target?: string;
|
|
6
|
-
to?: To;
|
|
7
|
-
toOptions?: NavigateOptions;
|
|
8
|
-
}
|
|
9
|
-
export type { ButtonExProps };
|
|
10
|
-
//# sourceMappingURL=ButtonExProps.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExProps.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExProps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AAE3D,UAAU,aAAc,SAAQ,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,qBAAqB,EAAE,SAAS;IACxF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,SAAS,CAAC,EAAE,eAAe,CAAA;CAC5B;AAED,YAAY,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExTo.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExTo.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,QAAA,MAAM,UAAU,6GAUd,CAAA;AAIF,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExTo.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExTo.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,QAAA,MAAM,UAAU,6GAUd,CAAA;AAIF,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExTo.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExTo.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,QAAA,MAAM,UAAU,6GAUd,CAAA;AAIF,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA"}
|
package/dist/node/index.cjs
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
ButtonEx: () => ButtonEx
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(src_exports);
|
|
26
|
-
|
|
27
|
-
// src/components/ButtonEx.tsx
|
|
28
|
-
var import_react3 = require("react");
|
|
29
|
-
|
|
30
|
-
// src/components/ButtonExBase.tsx
|
|
31
|
-
var import_material = require("@mui/material");
|
|
32
|
-
var import_react_shared = require("@xylabs/react-shared");
|
|
33
|
-
var import_react = require("react");
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
-
var ButtonExBase = (0, import_react.forwardRef)((props, ref) => {
|
|
36
|
-
const theme = (0, import_material.useTheme)();
|
|
37
|
-
const { busy, busyVariant = "linear", busyOpacity, onClick, children, ...rootProps } = (0, import_react_shared.mergeBoxlikeStyles)(theme, props);
|
|
38
|
-
const localOnClick = (event) => {
|
|
39
|
-
if (!busy) {
|
|
40
|
-
onClick == null ? void 0 : onClick(event);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Button, { ref, onClick: localOnClick, ...rootProps, children: [
|
|
44
|
-
busy && busyVariant === "linear" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_shared.BusyLinearProgress, { rounded: true, opacity: busyOpacity ?? 0 }) : null,
|
|
45
|
-
busy && busyVariant === "circular" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_shared.BusyCircularProgress, { rounded: true, size: 24, opacity: busyOpacity ?? 0.5 }) : null,
|
|
46
|
-
children
|
|
47
|
-
] });
|
|
48
|
-
});
|
|
49
|
-
ButtonExBase.displayName = "ButtonExBaseXYLabs";
|
|
50
|
-
|
|
51
|
-
// src/components/ButtonExTo.tsx
|
|
52
|
-
var import_react2 = require("react");
|
|
53
|
-
var import_react_router_dom = require("react-router-dom");
|
|
54
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
55
|
-
var ButtonToEx = (0, import_react2.forwardRef)(({ to, toOptions, onClick, ...props }, ref) => {
|
|
56
|
-
const navigate = (0, import_react_router_dom.useNavigate)();
|
|
57
|
-
const localOnClick = (event) => {
|
|
58
|
-
onClick == null ? void 0 : onClick(event);
|
|
59
|
-
if (to) {
|
|
60
|
-
navigate(to, toOptions);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ButtonExBase, { ref, onClick: localOnClick, ...props });
|
|
64
|
-
});
|
|
65
|
-
ButtonToEx.displayName = "ButtonToExXYLabs";
|
|
66
|
-
|
|
67
|
-
// src/components/ButtonEx.tsx
|
|
68
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
69
|
-
var ButtonEx = (0, import_react3.forwardRef)(({ to, ...props }, ref) => {
|
|
70
|
-
return to ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ButtonToEx, { to, ref, ...props }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ButtonExBase, { ...props });
|
|
71
|
-
});
|
|
72
|
-
ButtonEx.displayName = "ButtonExXYLabs";
|
|
73
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
74
|
-
0 && (module.exports = {
|
|
75
|
-
ButtonEx
|
|
76
|
-
});
|
|
77
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/node/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/components/ButtonEx.tsx","../../src/components/ButtonExBase.tsx","../../src/components/ButtonExTo.tsx"],"sourcesContent":["export * from './components/index.js'\n","import { forwardRef } from 'react'\n\nimport { ButtonExBase } from './ButtonExBase.jsx'\nimport { ButtonExProps } from './ButtonExProps.jsx'\nimport { ButtonToEx } from './ButtonExTo.jsx'\n\nconst ButtonEx = forwardRef<HTMLButtonElement, ButtonExProps>(({ to, ...props }, ref) => {\n return to ? <ButtonToEx to={to} ref={ref} {...props} /> : <ButtonExBase {...props} />\n})\n\nButtonEx.displayName = 'ButtonExXYLabs'\n\nexport { ButtonEx }\n","import { Button, useTheme } from '@mui/material'\nimport { BusyCircularProgress, BusyLinearProgress, mergeBoxlikeStyles } from '@xylabs/react-shared'\nimport { forwardRef, MouseEvent } from 'react'\n\nimport { ButtonExProps } from './ButtonExProps.jsx'\n\nconst ButtonExBase = forwardRef<HTMLButtonElement, ButtonExProps>((props, ref) => {\n const theme = useTheme()\n const { busy, busyVariant = 'linear', busyOpacity, onClick, children, ...rootProps } = mergeBoxlikeStyles<ButtonExProps>(theme, props)\n\n const localOnClick = (event: MouseEvent<HTMLButtonElement>) => {\n if (!busy) {\n onClick?.(event)\n }\n }\n\n return (\n <Button ref={ref} onClick={localOnClick} {...rootProps}>\n {busy && busyVariant === 'linear' ?\n <BusyLinearProgress rounded opacity={busyOpacity ?? 0} />\n : null}\n {busy && busyVariant === 'circular' ?\n <BusyCircularProgress rounded size={24} opacity={busyOpacity ?? 0.5} />\n : null}\n {children}\n </Button>\n )\n})\n\nButtonExBase.displayName = 'ButtonExBaseXYLabs'\n\nexport { ButtonExBase }\n","import { forwardRef, MouseEvent } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ButtonExBase } from './ButtonExBase.jsx'\nimport { ButtonExProps } from './ButtonExProps.jsx'\n\nconst ButtonToEx = forwardRef<HTMLButtonElement, ButtonExProps>(({ to, toOptions, onClick, ...props }, ref) => {\n const navigate = useNavigate()\n const localOnClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event)\n if (to) {\n navigate(to, toOptions)\n }\n }\n\n return <ButtonExBase ref={ref} onClick={localOnClick} {...props} />\n})\n\nButtonToEx.displayName = 'ButtonToExXYLabs'\n\nexport { But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,OAAO;AACrF,CAAC;AAED,SAAS,cAAc;","names":["import_react","import_react","import_jsx_runtime","import_jsx_runtime"]}
|
package/dist/node/index.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA"}
|
package/dist/node/index.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA"}
|
package/dist/node/index.d.ts
DELETED