@xylabs/react-button 3.4.2 → 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/package.json +7 -27
- package/xy.config.ts +12 -0
- package/dist/browser/components/ButtonEx.d.cts +0 -5
- package/dist/browser/components/ButtonEx.d.cts.map +0 -1
- package/dist/browser/components/ButtonEx.d.mts +0 -5
- package/dist/browser/components/ButtonEx.d.mts.map +0 -1
- package/dist/browser/components/ButtonEx.d.ts +0 -5
- package/dist/browser/components/ButtonEx.d.ts.map +0 -1
- package/dist/browser/components/ButtonExBase.d.cts +0 -5
- package/dist/browser/components/ButtonExBase.d.cts.map +0 -1
- package/dist/browser/components/ButtonExBase.d.mts +0 -5
- package/dist/browser/components/ButtonExBase.d.mts.map +0 -1
- package/dist/browser/components/ButtonExBase.d.ts +0 -5
- 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 -5
- package/dist/browser/components/ButtonExTo.d.cts.map +0 -1
- package/dist/browser/components/ButtonExTo.d.mts +0 -5
- package/dist/browser/components/ButtonExTo.d.mts.map +0 -1
- package/dist/browser/components/ButtonExTo.d.ts +0 -5
- 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 -96
- 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/neutral/components/ButtonEx.d.cts +0 -5
- package/dist/neutral/components/ButtonEx.d.cts.map +0 -1
- package/dist/neutral/components/ButtonEx.d.mts +0 -5
- package/dist/neutral/components/ButtonEx.d.mts.map +0 -1
- package/dist/neutral/components/ButtonEx.d.ts +0 -5
- package/dist/neutral/components/ButtonEx.d.ts.map +0 -1
- package/dist/neutral/components/ButtonExBase.d.cts +0 -5
- package/dist/neutral/components/ButtonExBase.d.cts.map +0 -1
- package/dist/neutral/components/ButtonExBase.d.mts +0 -5
- package/dist/neutral/components/ButtonExBase.d.mts.map +0 -1
- package/dist/neutral/components/ButtonExBase.d.ts +0 -5
- 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 -5
- package/dist/neutral/components/ButtonExTo.d.cts.map +0 -1
- package/dist/neutral/components/ButtonExTo.d.mts +0 -5
- package/dist/neutral/components/ButtonExTo.d.mts.map +0 -1
- package/dist/neutral/components/ButtonExTo.d.ts +0 -5
- 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 -96
- 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.mjs +0 -65
- package/dist/neutral/index.mjs.map +0 -1
- package/dist/node/components/ButtonEx.d.cts +0 -5
- package/dist/node/components/ButtonEx.d.cts.map +0 -1
- package/dist/node/components/ButtonEx.d.mts +0 -5
- package/dist/node/components/ButtonEx.d.mts.map +0 -1
- package/dist/node/components/ButtonEx.d.ts +0 -5
- package/dist/node/components/ButtonEx.d.ts.map +0 -1
- package/dist/node/components/ButtonExBase.d.cts +0 -5
- package/dist/node/components/ButtonExBase.d.cts.map +0 -1
- package/dist/node/components/ButtonExBase.d.mts +0 -5
- package/dist/node/components/ButtonExBase.d.mts.map +0 -1
- package/dist/node/components/ButtonExBase.d.ts +0 -5
- 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 -5
- package/dist/node/components/ButtonExTo.d.cts.map +0 -1
- package/dist/node/components/ButtonExTo.d.mts +0 -5
- package/dist/node/components/ButtonExTo.d.mts.map +0 -1
- package/dist/node/components/ButtonExTo.d.ts +0 -5
- 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 -100
- 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.mjs +0 -65
- package/dist/node/index.mjs.map +0 -1
package/dist/neutral/index.cjs
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all)
|
|
11
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from))
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
-
|
|
31
|
-
// src/index.ts
|
|
32
|
-
var src_exports = {};
|
|
33
|
-
__export(src_exports, {
|
|
34
|
-
ButtonEx: () => ButtonEx
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(src_exports);
|
|
37
|
-
|
|
38
|
-
// src/components/ButtonEx.tsx
|
|
39
|
-
var import_react3 = __toESM(require("react"), 1);
|
|
40
|
-
|
|
41
|
-
// src/components/ButtonExBase.tsx
|
|
42
|
-
var import_material = require("@mui/material");
|
|
43
|
-
var import_react_shared = require("@xylabs/react-shared");
|
|
44
|
-
var import_react = __toESM(require("react"), 1);
|
|
45
|
-
var ButtonExBase = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
|
|
46
|
-
const theme = (0, import_material.useTheme)();
|
|
47
|
-
const { busy, busyVariant = "linear", busyOpacity, onClick, children, ...rootProps } = (0, import_react_shared.mergeBoxlikeStyles)(theme, props);
|
|
48
|
-
const localOnClick = /* @__PURE__ */ __name((event) => {
|
|
49
|
-
if (!busy) {
|
|
50
|
-
onClick?.(event);
|
|
51
|
-
}
|
|
52
|
-
}, "localOnClick");
|
|
53
|
-
return /* @__PURE__ */ import_react.default.createElement(import_material.Button, {
|
|
54
|
-
ref,
|
|
55
|
-
onClick: localOnClick,
|
|
56
|
-
...rootProps
|
|
57
|
-
}, busy && busyVariant === "linear" ? /* @__PURE__ */ import_react.default.createElement(import_react_shared.BusyLinearProgress, {
|
|
58
|
-
rounded: true,
|
|
59
|
-
opacity: busyOpacity ?? 0
|
|
60
|
-
}) : null, busy && busyVariant === "circular" ? /* @__PURE__ */ import_react.default.createElement(import_react_shared.BusyCircularProgress, {
|
|
61
|
-
rounded: true,
|
|
62
|
-
size: 24,
|
|
63
|
-
opacity: busyOpacity ?? 0.5
|
|
64
|
-
}) : null, children);
|
|
65
|
-
});
|
|
66
|
-
ButtonExBase.displayName = "ButtonExBaseXYLabs";
|
|
67
|
-
|
|
68
|
-
// src/components/ButtonExTo.tsx
|
|
69
|
-
var import_react2 = __toESM(require("react"), 1);
|
|
70
|
-
var import_react_router_dom = require("react-router-dom");
|
|
71
|
-
var ButtonToEx = /* @__PURE__ */ (0, import_react2.forwardRef)(({ to, toOptions, onClick, ...props }, ref) => {
|
|
72
|
-
const navigate = (0, import_react_router_dom.useNavigate)();
|
|
73
|
-
const localOnClick = /* @__PURE__ */ __name((event) => {
|
|
74
|
-
onClick?.(event);
|
|
75
|
-
if (to) {
|
|
76
|
-
navigate(to, toOptions);
|
|
77
|
-
}
|
|
78
|
-
}, "localOnClick");
|
|
79
|
-
return /* @__PURE__ */ import_react2.default.createElement(ButtonExBase, {
|
|
80
|
-
ref,
|
|
81
|
-
onClick: localOnClick,
|
|
82
|
-
...props
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
ButtonToEx.displayName = "ButtonToExXYLabs";
|
|
86
|
-
|
|
87
|
-
// src/components/ButtonEx.tsx
|
|
88
|
-
var ButtonEx = /* @__PURE__ */ (0, import_react3.forwardRef)(({ to, ...props }, ref) => {
|
|
89
|
-
return to ? /* @__PURE__ */ import_react3.default.createElement(ButtonToEx, {
|
|
90
|
-
to,
|
|
91
|
-
ref,
|
|
92
|
-
...props
|
|
93
|
-
}) : /* @__PURE__ */ import_react3.default.createElement(ButtonExBase, props);
|
|
94
|
-
});
|
|
95
|
-
ButtonEx.displayName = "ButtonExXYLabs";
|
|
96
|
-
//# 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.ts'\n","import React, { forwardRef } from 'react'\n\nimport { ButtonExBase } from './ButtonExBase.tsx'\nimport { ButtonExProps } from './ButtonExProps.tsx'\nimport { ButtonToEx } from './ButtonExTo.tsx'\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 React, { forwardRef, MouseEvent } from 'react'\n\nimport { ButtonExProps } from './ButtonExProps.tsx'\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 React, { forwardRef, MouseEvent } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ButtonExBase } from './ButtonExBase.tsx'\nimport { ButtonExProps } from './ButtonExProps.tsx'\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACAA,IAAAA,gBAAkC;;;ACAlC,sBAAiC;AACjC,0BAA6E;AAC7E,mBAA8C;AAI9C,IAAMC,eAAeC,6CAA6C,CAACC,OAAOC,QAAAA;AACxE,QAAMC,YAAQC,0BAAAA;AACd,QAAM,EAAEC,MAAMC,cAAc,UAAUC,aAAaC,SAASC,UAAU,GAAGC,UAAAA,QAAcC,wCAAkCR,OAAOF,KAAAA;AAEhI,QAAMW,eAAe,wBAACC,UAAAA;AACpB,QAAI,CAACR,MAAM;AACTG,gBAAUK,KAAAA;IACZ;EACF,GAJqB;AAMrB,SACE,6BAAAC,QAAA,cAACC,wBAAAA;IAAOb;IAAUM,SAASI;IAAe,GAAGF;KAC1CL,QAAQC,gBAAgB,WACrB,6BAAAQ,QAAA,cAACE,wCAAAA;IAAmBC,SAAAA;IAAQC,SAASX,eAAe;OACpD,MACHF,QAAQC,gBAAgB,aACrB,6BAAAQ,QAAA,cAACK,0CAAAA;IAAqBF,SAAAA;IAAQG,MAAM;IAAIF,SAASX,eAAe;OAChE,MACHE,QAAAA;AAGP,CAAA;AAEAV,aAAasB,cAAc;;;AC7B3B,IAAAC,gBAA8C;AAC9C,8BAA4B;AAK5B,IAAMC,aAAaC,8CAA6C,CAAC,EAAEC,IAAIC,WAAWC,SAAS,GAAGC,MAAAA,GAASC,QAAAA;AACrG,QAAMC,eAAWC,qCAAAA;AACjB,QAAMC,eAAe,wBAACC,UAAAA;AACpBN,cAAUM,KAAAA;AACV,QAAIR,IAAI;AACNK,eAASL,IAAIC,SAAAA;IACf;EACF,GALqB;AAOrB,SAAO,8BAAAQ,QAAA,cAACC,cAAAA;IAAaN;IAAUF,SAASK;IAAe,GAAGJ;;AAC5D,CAAA;AAEAL,WAAWa,cAAc;;;AFZzB,IAAMC,WAAWC,8CAA6C,CAAC,EAAEC,IAAI,GAAGC,MAAAA,GAASC,QAAAA;AAC/E,SAAOF,KAAK,8BAAAG,QAAA,cAACC,YAAAA;IAAWJ;IAAQE;IAAW,GAAGD;OAAY,8BAAAE,QAAA,cAACE,cAAiBJ,KAAAA;AAC9E,CAAA;AAEAH,SAASQ,cAAc;","names":["import_react","ButtonExBase","forwardRef","props","ref","theme","useTheme","busy","busyVariant","busyOpacity","onClick","children","rootProps","mergeBoxlikeStyles","localOnClick","event","React","Button","BusyLinearProgress","rounded","opacity","BusyCircularProgress","size","displayName","import_react","ButtonToEx","forwardRef","to","toOptions","onClick","props","ref","navigate","useNavigate","localOnClick","event","React","ButtonExBase","displayName","ButtonEx","forwardRef","to","props","ref","React","ButtonToEx","ButtonExBase","displayName"]}
|
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.mjs
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/components/ButtonEx.tsx
|
|
5
|
-
import React3, { forwardRef as forwardRef3 } from "react";
|
|
6
|
-
|
|
7
|
-
// src/components/ButtonExBase.tsx
|
|
8
|
-
import { Button, useTheme } from "@mui/material";
|
|
9
|
-
import { BusyCircularProgress, BusyLinearProgress, mergeBoxlikeStyles } from "@xylabs/react-shared";
|
|
10
|
-
import React, { forwardRef } from "react";
|
|
11
|
-
var ButtonExBase = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
12
|
-
const theme = useTheme();
|
|
13
|
-
const { busy, busyVariant = "linear", busyOpacity, onClick, children, ...rootProps } = mergeBoxlikeStyles(theme, props);
|
|
14
|
-
const localOnClick = /* @__PURE__ */ __name((event) => {
|
|
15
|
-
if (!busy) {
|
|
16
|
-
onClick?.(event);
|
|
17
|
-
}
|
|
18
|
-
}, "localOnClick");
|
|
19
|
-
return /* @__PURE__ */ React.createElement(Button, {
|
|
20
|
-
ref,
|
|
21
|
-
onClick: localOnClick,
|
|
22
|
-
...rootProps
|
|
23
|
-
}, busy && busyVariant === "linear" ? /* @__PURE__ */ React.createElement(BusyLinearProgress, {
|
|
24
|
-
rounded: true,
|
|
25
|
-
opacity: busyOpacity ?? 0
|
|
26
|
-
}) : null, busy && busyVariant === "circular" ? /* @__PURE__ */ React.createElement(BusyCircularProgress, {
|
|
27
|
-
rounded: true,
|
|
28
|
-
size: 24,
|
|
29
|
-
opacity: busyOpacity ?? 0.5
|
|
30
|
-
}) : null, children);
|
|
31
|
-
});
|
|
32
|
-
ButtonExBase.displayName = "ButtonExBaseXYLabs";
|
|
33
|
-
|
|
34
|
-
// src/components/ButtonExTo.tsx
|
|
35
|
-
import React2, { forwardRef as forwardRef2 } from "react";
|
|
36
|
-
import { useNavigate } from "react-router-dom";
|
|
37
|
-
var ButtonToEx = /* @__PURE__ */ forwardRef2(({ to, toOptions, onClick, ...props }, ref) => {
|
|
38
|
-
const navigate = useNavigate();
|
|
39
|
-
const localOnClick = /* @__PURE__ */ __name((event) => {
|
|
40
|
-
onClick?.(event);
|
|
41
|
-
if (to) {
|
|
42
|
-
navigate(to, toOptions);
|
|
43
|
-
}
|
|
44
|
-
}, "localOnClick");
|
|
45
|
-
return /* @__PURE__ */ React2.createElement(ButtonExBase, {
|
|
46
|
-
ref,
|
|
47
|
-
onClick: localOnClick,
|
|
48
|
-
...props
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
ButtonToEx.displayName = "ButtonToExXYLabs";
|
|
52
|
-
|
|
53
|
-
// src/components/ButtonEx.tsx
|
|
54
|
-
var ButtonEx = /* @__PURE__ */ forwardRef3(({ to, ...props }, ref) => {
|
|
55
|
-
return to ? /* @__PURE__ */ React3.createElement(ButtonToEx, {
|
|
56
|
-
to,
|
|
57
|
-
ref,
|
|
58
|
-
...props
|
|
59
|
-
}) : /* @__PURE__ */ React3.createElement(ButtonExBase, props);
|
|
60
|
-
});
|
|
61
|
-
ButtonEx.displayName = "ButtonExXYLabs";
|
|
62
|
-
export {
|
|
63
|
-
ButtonEx
|
|
64
|
-
};
|
|
65
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/ButtonEx.tsx","../../src/components/ButtonExBase.tsx","../../src/components/ButtonExTo.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\n\nimport { ButtonExBase } from './ButtonExBase.tsx'\nimport { ButtonExProps } from './ButtonExProps.tsx'\nimport { ButtonToEx } from './ButtonExTo.tsx'\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 React, { forwardRef, MouseEvent } from 'react'\n\nimport { ButtonExProps } from './ButtonExProps.tsx'\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 React, { forwardRef, MouseEvent } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ButtonExBase } from './ButtonExBase.tsx'\nimport { ButtonExProps } from './ButtonExProps.tsx'\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":";;;;AAAA,OAAOA,UAASC,cAAAA,mBAAkB;;;ACAlC,SAASC,QAAQC,gBAAgB;AACjC,SAASC,sBAAsBC,oBAAoBC,0BAA0B;AAC7E,OAAOC,SAASC,kBAA8B;AAI9C,IAAMC,eAAeC,2BAA6C,CAACC,OAAOC,QAAAA;AACxE,QAAMC,QAAQC,SAAAA;AACd,QAAM,EAAEC,MAAMC,cAAc,UAAUC,aAAaC,SAASC,UAAU,GAAGC,UAAAA,IAAcC,mBAAkCR,OAAOF,KAAAA;AAEhI,QAAMW,eAAe,wBAACC,UAAAA;AACpB,QAAI,CAACR,MAAM;AACTG,gBAAUK,KAAAA;IACZ;EACF,GAJqB;AAMrB,SACE,sBAAA,cAACC,QAAAA;IAAOZ;IAAUM,SAASI;IAAe,GAAGF;KAC1CL,QAAQC,gBAAgB,WACrB,sBAAA,cAACS,oBAAAA;IAAmBC,SAAAA;IAAQC,SAASV,eAAe;OACpD,MACHF,QAAQC,gBAAgB,aACrB,sBAAA,cAACY,sBAAAA;IAAqBF,SAAAA;IAAQG,MAAM;IAAIF,SAASV,eAAe;OAChE,MACHE,QAAAA;AAGP,CAAA;AAEAV,aAAaqB,cAAc;;;AC7B3B,OAAOC,UAASC,cAAAA,mBAA8B;AAC9C,SAASC,mBAAmB;AAK5B,IAAMC,aAAaC,gBAAAA,YAA6C,CAAC,EAAEC,IAAIC,WAAWC,SAAS,GAAGC,MAAAA,GAASC,QAAAA;AACrG,QAAMC,WAAWC,YAAAA;AACjB,QAAMC,eAAe,wBAACC,UAAAA;AACpBN,cAAUM,KAAAA;AACV,QAAIR,IAAI;AACNK,eAASL,IAAIC,SAAAA;IACf;EACF,GALqB;AAOrB,SAAO,gBAAAQ,OAAA,cAACC,cAAAA;IAAaN;IAAUF,SAASK;IAAe,GAAGJ;;AAC5D,CAAA;AAEAL,WAAWa,cAAc;;;AFZzB,IAAMC,WAAWC,gBAAAA,YAA6C,CAAC,EAAEC,IAAI,GAAGC,MAAAA,GAASC,QAAAA;AAC/E,SAAOF,KAAK,gBAAAG,OAAA,cAACC,YAAAA;IAAWJ;IAAQE;IAAW,GAAGD;OAAY,gBAAAE,OAAA,cAACE,cAAiBJ,KAAAA;AAC9E,CAAA;AAEAH,SAASQ,cAAc;","names":["React","forwardRef","Button","useTheme","BusyCircularProgress","BusyLinearProgress","mergeBoxlikeStyles","React","forwardRef","ButtonExBase","forwardRef","props","ref","theme","useTheme","busy","busyVariant","busyOpacity","onClick","children","rootProps","mergeBoxlikeStyles","localOnClick","event","Button","BusyLinearProgress","rounded","opacity","BusyCircularProgress","size","displayName","React","forwardRef","useNavigate","ButtonToEx","forwardRef","to","toOptions","onClick","props","ref","navigate","useNavigate","localOnClick","event","React","ButtonExBase","displayName","ButtonEx","forwardRef","to","props","ref","React","ButtonToEx","ButtonExBase","displayName"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonEx.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonEx.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAGzC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAGnD,QAAA,MAAM,QAAQ,yFAEZ,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":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAGzC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAGnD,QAAA,MAAM,QAAQ,yFAEZ,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":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAGzC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAGnD,QAAA,MAAM,QAAQ,yFAEZ,CAAA;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ButtonExProps } from './ButtonExProps.tsx';
|
|
3
|
-
declare const ButtonExBase: React.ForwardRefExoticComponent<ButtonExProps & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
-
export { ButtonExBase };
|
|
5
|
-
//# sourceMappingURL=ButtonExBase.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExBase.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExBase.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiC,MAAM,OAAO,CAAA;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,QAAA,MAAM,YAAY,yFAqBhB,CAAA;AAIF,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ButtonExProps } from './ButtonExProps.tsx';
|
|
3
|
-
declare const ButtonExBase: React.ForwardRefExoticComponent<ButtonExProps & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
-
export { ButtonExBase };
|
|
5
|
-
//# sourceMappingURL=ButtonExBase.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExBase.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExBase.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiC,MAAM,OAAO,CAAA;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,QAAA,MAAM,YAAY,yFAqBhB,CAAA;AAIF,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ButtonExProps } from './ButtonExProps.tsx';
|
|
3
|
-
declare const ButtonExBase: React.ForwardRefExoticComponent<ButtonExProps & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
-
export { ButtonExBase };
|
|
5
|
-
//# sourceMappingURL=ButtonExBase.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonExBase.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExBase.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiC,MAAM,OAAO,CAAA;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,QAAA,MAAM,YAAY,yFAqBhB,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":"AAAA,OAAO,KAAiC,MAAM,OAAO,CAAA;AAIrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,QAAA,MAAM,UAAU,yFAUd,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":"AAAA,OAAO,KAAiC,MAAM,OAAO,CAAA;AAIrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,QAAA,MAAM,UAAU,yFAUd,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":"AAAA,OAAO,KAAiC,MAAM,OAAO,CAAA;AAIrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,QAAA,MAAM,UAAU,yFAUd,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,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all)
|
|
11
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from))
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
-
|
|
31
|
-
// src/index.ts
|
|
32
|
-
var src_exports = {};
|
|
33
|
-
__export(src_exports, {
|
|
34
|
-
ButtonEx: () => ButtonEx
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(src_exports);
|
|
37
|
-
|
|
38
|
-
// src/components/ButtonEx.tsx
|
|
39
|
-
var import_react3 = __toESM(require("react"), 1);
|
|
40
|
-
|
|
41
|
-
// src/components/ButtonExBase.tsx
|
|
42
|
-
var import_material = require("@mui/material");
|
|
43
|
-
var import_react_shared = require("@xylabs/react-shared");
|
|
44
|
-
var import_react = __toESM(require("react"), 1);
|
|
45
|
-
var ButtonExBase = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
|
|
46
|
-
const theme = (0, import_material.useTheme)();
|
|
47
|
-
const { busy, busyVariant = "linear", busyOpacity, onClick, children, ...rootProps } = (0, import_react_shared.mergeBoxlikeStyles)(theme, props);
|
|
48
|
-
const localOnClick = /* @__PURE__ */ __name((event) => {
|
|
49
|
-
if (!busy) {
|
|
50
|
-
onClick == null ? void 0 : onClick(event);
|
|
51
|
-
}
|
|
52
|
-
}, "localOnClick");
|
|
53
|
-
return /* @__PURE__ */ import_react.default.createElement(import_material.Button, {
|
|
54
|
-
ref,
|
|
55
|
-
onClick: localOnClick,
|
|
56
|
-
...rootProps
|
|
57
|
-
}, busy && busyVariant === "linear" ? /* @__PURE__ */ import_react.default.createElement(import_react_shared.BusyLinearProgress, {
|
|
58
|
-
rounded: true,
|
|
59
|
-
opacity: busyOpacity ?? 0
|
|
60
|
-
}) : null, busy && busyVariant === "circular" ? /* @__PURE__ */ import_react.default.createElement(import_react_shared.BusyCircularProgress, {
|
|
61
|
-
rounded: true,
|
|
62
|
-
size: 24,
|
|
63
|
-
opacity: busyOpacity ?? 0.5
|
|
64
|
-
}) : null, children);
|
|
65
|
-
});
|
|
66
|
-
ButtonExBase.displayName = "ButtonExBaseXYLabs";
|
|
67
|
-
|
|
68
|
-
// src/components/ButtonExTo.tsx
|
|
69
|
-
var import_react2 = __toESM(require("react"), 1);
|
|
70
|
-
var import_react_router_dom = require("react-router-dom");
|
|
71
|
-
var ButtonToEx = /* @__PURE__ */ (0, import_react2.forwardRef)(({ to, toOptions, onClick, ...props }, ref) => {
|
|
72
|
-
const navigate = (0, import_react_router_dom.useNavigate)();
|
|
73
|
-
const localOnClick = /* @__PURE__ */ __name((event) => {
|
|
74
|
-
onClick == null ? void 0 : onClick(event);
|
|
75
|
-
if (to) {
|
|
76
|
-
navigate(to, toOptions);
|
|
77
|
-
}
|
|
78
|
-
}, "localOnClick");
|
|
79
|
-
return /* @__PURE__ */ import_react2.default.createElement(ButtonExBase, {
|
|
80
|
-
ref,
|
|
81
|
-
onClick: localOnClick,
|
|
82
|
-
...props
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
ButtonToEx.displayName = "ButtonToExXYLabs";
|
|
86
|
-
|
|
87
|
-
// src/components/ButtonEx.tsx
|
|
88
|
-
var ButtonEx = /* @__PURE__ */ (0, import_react3.forwardRef)(({ to, ...props }, ref) => {
|
|
89
|
-
return to ? /* @__PURE__ */ import_react3.default.createElement(ButtonToEx, {
|
|
90
|
-
to,
|
|
91
|
-
ref,
|
|
92
|
-
...props
|
|
93
|
-
}) : /* @__PURE__ */ import_react3.default.createElement(ButtonExBase, props);
|
|
94
|
-
});
|
|
95
|
-
ButtonEx.displayName = "ButtonExXYLabs";
|
|
96
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
97
|
-
0 && (module.exports = {
|
|
98
|
-
ButtonEx
|
|
99
|
-
});
|
|
100
|
-
//# 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.ts'\n","import React, { forwardRef } from 'react'\n\nimport { ButtonExBase } from './ButtonExBase.tsx'\nimport { ButtonExProps } from './ButtonExProps.tsx'\nimport { ButtonToEx } from './ButtonExTo.tsx'\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 React, { forwardRef, MouseEvent } from 'react'\n\nimport { ButtonExProps } from './ButtonExProps.tsx'\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 React, { forwardRef, MouseEvent } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ButtonExBase } from './ButtonExBase.tsx'\nimport { ButtonExProps } from './ButtonExProps.tsx'\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACAA,IAAAA,gBAAkC;;;ACAlC,sBAAiC;AACjC,0BAA6E;AAC7E,mBAA8C;AAI9C,IAAMC,eAAeC,6CAA6C,CAACC,OAAOC,QAAAA;AACxE,QAAMC,YAAQC,0BAAAA;AACd,QAAM,EAAEC,MAAMC,cAAc,UAAUC,aAAaC,SAASC,UAAU,GAAGC,UAAAA,QAAcC,wCAAkCR,OAAOF,KAAAA;AAEhI,QAAMW,eAAe,wBAACC,UAAAA;AACpB,QAAI,CAACR,MAAM;AACTG,yCAAUK;IACZ;EACF,GAJqB;AAMrB,SACE,6BAAAC,QAAA,cAACC,wBAAAA;IAAOb;IAAUM,SAASI;IAAe,GAAGF;KAC1CL,QAAQC,gBAAgB,WACrB,6BAAAQ,QAAA,cAACE,wCAAAA;IAAmBC,SAAAA;IAAQC,SAASX,eAAe;OACpD,MACHF,QAAQC,gBAAgB,aACrB,6BAAAQ,QAAA,cAACK,0CAAAA;IAAqBF,SAAAA;IAAQG,MAAM;IAAIF,SAASX,eAAe;OAChE,MACHE,QAAAA;AAGP,CAAA;AAEAV,aAAasB,cAAc;;;AC7B3B,IAAAC,gBAA8C;AAC9C,8BAA4B;AAK5B,IAAMC,aAAaC,8CAA6C,CAAC,EAAEC,IAAIC,WAAWC,SAAS,GAAGC,MAAAA,GAASC,QAAAA;AACrG,QAAMC,eAAWC,qCAAAA;AACjB,QAAMC,eAAe,wBAACC,UAAAA;AACpBN,uCAAUM;AACV,QAAIR,IAAI;AACNK,eAASL,IAAIC,SAAAA;IACf;EACF,GALqB;AAOrB,SAAO,8BAAAQ,QAAA,cAACC,cAAAA;IAAaN;IAAUF,SAASK;IAAe,GAAGJ;;AAC5D,CAAA;AAEAL,WAAWa,cAAc;;;AFZzB,IAAMC,WAAWC,8CAA6C,CAAC,EAAEC,IAAI,GAAGC,MAAAA,GAASC,QAAAA;AAC/E,SAAOF,KAAK,8BAAAG,QAAA,cAACC,YAAAA;IAAWJ;IAAQE;IAAW,GAAGD;OAAY,8BAAAE,QAAA,cAACE,cAAiBJ,KAAAA;AAC9E,CAAA;AAEAH,SAASQ,cAAc;","names":["import_react","ButtonExBase","forwardRef","props","ref","theme","useTheme","busy","busyVariant","busyOpacity","onClick","children","rootProps","mergeBoxlikeStyles","localOnClick","event","React","Button","BusyLinearProgress","rounded","opacity","BusyCircularProgress","size","displayName","import_react","ButtonToEx","forwardRef","to","toOptions","onClick","props","ref","navigate","useNavigate","localOnClick","event","React","ButtonExBase","displayName","ButtonEx","forwardRef","to","props","ref","React","ButtonToEx","ButtonExBase","displayName"]}
|
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
package/dist/node/index.d.ts.map
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.mjs
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/components/ButtonEx.tsx
|
|
5
|
-
import React3, { forwardRef as forwardRef3 } from "react";
|
|
6
|
-
|
|
7
|
-
// src/components/ButtonExBase.tsx
|
|
8
|
-
import { Button, useTheme } from "@mui/material";
|
|
9
|
-
import { BusyCircularProgress, BusyLinearProgress, mergeBoxlikeStyles } from "@xylabs/react-shared";
|
|
10
|
-
import React, { forwardRef } from "react";
|
|
11
|
-
var ButtonExBase = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
12
|
-
const theme = useTheme();
|
|
13
|
-
const { busy, busyVariant = "linear", busyOpacity, onClick, children, ...rootProps } = mergeBoxlikeStyles(theme, props);
|
|
14
|
-
const localOnClick = /* @__PURE__ */ __name((event) => {
|
|
15
|
-
if (!busy) {
|
|
16
|
-
onClick == null ? void 0 : onClick(event);
|
|
17
|
-
}
|
|
18
|
-
}, "localOnClick");
|
|
19
|
-
return /* @__PURE__ */ React.createElement(Button, {
|
|
20
|
-
ref,
|
|
21
|
-
onClick: localOnClick,
|
|
22
|
-
...rootProps
|
|
23
|
-
}, busy && busyVariant === "linear" ? /* @__PURE__ */ React.createElement(BusyLinearProgress, {
|
|
24
|
-
rounded: true,
|
|
25
|
-
opacity: busyOpacity ?? 0
|
|
26
|
-
}) : null, busy && busyVariant === "circular" ? /* @__PURE__ */ React.createElement(BusyCircularProgress, {
|
|
27
|
-
rounded: true,
|
|
28
|
-
size: 24,
|
|
29
|
-
opacity: busyOpacity ?? 0.5
|
|
30
|
-
}) : null, children);
|
|
31
|
-
});
|
|
32
|
-
ButtonExBase.displayName = "ButtonExBaseXYLabs";
|
|
33
|
-
|
|
34
|
-
// src/components/ButtonExTo.tsx
|
|
35
|
-
import React2, { forwardRef as forwardRef2 } from "react";
|
|
36
|
-
import { useNavigate } from "react-router-dom";
|
|
37
|
-
var ButtonToEx = /* @__PURE__ */ forwardRef2(({ to, toOptions, onClick, ...props }, ref) => {
|
|
38
|
-
const navigate = useNavigate();
|
|
39
|
-
const localOnClick = /* @__PURE__ */ __name((event) => {
|
|
40
|
-
onClick == null ? void 0 : onClick(event);
|
|
41
|
-
if (to) {
|
|
42
|
-
navigate(to, toOptions);
|
|
43
|
-
}
|
|
44
|
-
}, "localOnClick");
|
|
45
|
-
return /* @__PURE__ */ React2.createElement(ButtonExBase, {
|
|
46
|
-
ref,
|
|
47
|
-
onClick: localOnClick,
|
|
48
|
-
...props
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
ButtonToEx.displayName = "ButtonToExXYLabs";
|
|
52
|
-
|
|
53
|
-
// src/components/ButtonEx.tsx
|
|
54
|
-
var ButtonEx = /* @__PURE__ */ forwardRef3(({ to, ...props }, ref) => {
|
|
55
|
-
return to ? /* @__PURE__ */ React3.createElement(ButtonToEx, {
|
|
56
|
-
to,
|
|
57
|
-
ref,
|
|
58
|
-
...props
|
|
59
|
-
}) : /* @__PURE__ */ React3.createElement(ButtonExBase, props);
|
|
60
|
-
});
|
|
61
|
-
ButtonEx.displayName = "ButtonExXYLabs";
|
|
62
|
-
export {
|
|
63
|
-
ButtonEx
|
|
64
|
-
};
|
|
65
|
-
//# sourceMappingURL=index.mjs.map
|
package/dist/node/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/ButtonEx.tsx","../../src/components/ButtonExBase.tsx","../../src/components/ButtonExTo.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\n\nimport { ButtonExBase } from './ButtonExBase.tsx'\nimport { ButtonExProps } from './ButtonExProps.tsx'\nimport { ButtonToEx } from './ButtonExTo.tsx'\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 React, { forwardRef, MouseEvent } from 'react'\n\nimport { ButtonExProps } from './ButtonExProps.tsx'\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 React, { forwardRef, MouseEvent } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ButtonExBase } from './ButtonExBase.tsx'\nimport { ButtonExProps } from './ButtonExProps.tsx'\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":";;;;AAAA,OAAOA,UAASC,cAAAA,mBAAkB;;;ACAlC,SAASC,QAAQC,gBAAgB;AACjC,SAASC,sBAAsBC,oBAAoBC,0BAA0B;AAC7E,OAAOC,SAASC,kBAA8B;AAI9C,IAAMC,eAAeC,2BAA6C,CAACC,OAAOC,QAAAA;AACxE,QAAMC,QAAQC,SAAAA;AACd,QAAM,EAAEC,MAAMC,cAAc,UAAUC,aAAaC,SAASC,UAAU,GAAGC,UAAAA,IAAcC,mBAAkCR,OAAOF,KAAAA;AAEhI,QAAMW,eAAe,wBAACC,UAAAA;AACpB,QAAI,CAACR,MAAM;AACTG,yCAAUK;IACZ;EACF,GAJqB;AAMrB,SACE,sBAAA,cAACC,QAAAA;IAAOZ;IAAUM,SAASI;IAAe,GAAGF;KAC1CL,QAAQC,gBAAgB,WACrB,sBAAA,cAACS,oBAAAA;IAAmBC,SAAAA;IAAQC,SAASV,eAAe;OACpD,MACHF,QAAQC,gBAAgB,aACrB,sBAAA,cAACY,sBAAAA;IAAqBF,SAAAA;IAAQG,MAAM;IAAIF,SAASV,eAAe;OAChE,MACHE,QAAAA;AAGP,CAAA;AAEAV,aAAaqB,cAAc;;;AC7B3B,OAAOC,UAASC,cAAAA,mBAA8B;AAC9C,SAASC,mBAAmB;AAK5B,IAAMC,aAAaC,gBAAAA,YAA6C,CAAC,EAAEC,IAAIC,WAAWC,SAAS,GAAGC,MAAAA,GAASC,QAAAA;AACrG,QAAMC,WAAWC,YAAAA;AACjB,QAAMC,eAAe,wBAACC,UAAAA;AACpBN,uCAAUM;AACV,QAAIR,IAAI;AACNK,eAASL,IAAIC,SAAAA;IACf;EACF,GALqB;AAOrB,SAAO,gBAAAQ,OAAA,cAACC,cAAAA;IAAaN;IAAUF,SAASK;IAAe,GAAGJ;;AAC5D,CAAA;AAEAL,WAAWa,cAAc;;;AFZzB,IAAMC,WAAWC,gBAAAA,YAA6C,CAAC,EAAEC,IAAI,GAAGC,MAAAA,GAASC,QAAAA;AAC/E,SAAOF,KAAK,gBAAAG,OAAA,cAACC,YAAAA;IAAWJ;IAAQE;IAAW,GAAGD;OAAY,gBAAAE,OAAA,cAACE,cAAiBJ,KAAAA;AAC9E,CAAA;AAEAH,SAASQ,cAAc;","names":["React","forwardRef","Button","useTheme","BusyCircularProgress","BusyLinearProgress","mergeBoxlikeStyles","React","forwardRef","ButtonExBase","forwardRef","props","ref","theme","useTheme","busy","busyVariant","busyOpacity","onClick","children","rootProps","mergeBoxlikeStyles","localOnClick","event","Button","BusyLinearProgress","rounded","opacity","BusyCircularProgress","size","displayName","React","forwardRef","useNavigate","ButtonToEx","forwardRef","to","toOptions","onClick","props","ref","navigate","useNavigate","localOnClick","event","React","ButtonExBase","displayName","ButtonEx","forwardRef","to","props","ref","React","ButtonToEx","ButtonExBase","displayName"]}
|