@xylabs/react-button 3.1.0-rc.3 → 3.1.0-rc.5
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/components/ButtonEx.d.mts.map +1 -0
- package/dist/browser/components/ButtonEx.d.ts +5 -0
- package/dist/browser/components/ButtonEx.d.ts.map +1 -0
- package/dist/browser/components/ButtonEx.js +16 -0
- package/dist/browser/components/ButtonEx.js.map +1 -0
- package/dist/browser/components/ButtonExBase.d.mts.map +1 -0
- package/dist/browser/components/ButtonExBase.d.ts +5 -0
- package/dist/browser/components/ButtonExBase.d.ts.map +1 -0
- package/dist/browser/components/ButtonExBase.js +23 -0
- package/dist/browser/components/ButtonExBase.js.map +1 -0
- package/dist/browser/components/ButtonExProps.d.mts.map +1 -0
- package/dist/browser/components/ButtonExProps.d.ts +10 -0
- package/dist/browser/components/ButtonExProps.d.ts.map +1 -0
- package/dist/browser/components/ButtonExProps.js +1 -0
- package/dist/browser/components/ButtonExProps.js.map +1 -0
- package/dist/browser/components/ButtonExTo.d.mts.map +1 -0
- package/dist/browser/components/ButtonExTo.d.ts +5 -0
- package/dist/browser/components/ButtonExTo.d.ts.map +1 -0
- package/dist/browser/components/ButtonExTo.js +19 -0
- package/dist/browser/components/ButtonExTo.js.map +1 -0
- package/dist/browser/components/index.d.mts.map +1 -0
- package/dist/browser/components/index.d.ts +3 -0
- package/dist/browser/components/index.d.ts.map +1 -0
- package/dist/browser/components/index.js +3 -0
- package/dist/browser/components/index.js.map +1 -0
- package/dist/{index.d.mts.map → browser/index.d.mts.map} +1 -1
- package/dist/{index.d.ts.map → browser/index.d.ts.map} +1 -1
- package/dist/browser/index.js +2 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/node/components/ButtonEx.d.mts +5 -0
- package/dist/node/components/ButtonEx.d.mts.map +1 -0
- package/dist/node/components/ButtonEx.d.ts +5 -0
- package/dist/node/components/ButtonEx.d.ts.map +1 -0
- package/dist/node/components/ButtonEx.js +40 -0
- package/dist/node/components/ButtonEx.js.map +1 -0
- package/dist/node/components/ButtonEx.mjs +16 -0
- package/dist/node/components/ButtonEx.mjs.map +1 -0
- package/dist/node/components/ButtonExBase.d.mts +5 -0
- package/dist/node/components/ButtonExBase.d.mts.map +1 -0
- package/dist/node/components/ButtonExBase.d.ts +5 -0
- package/dist/node/components/ButtonExBase.d.ts.map +1 -0
- package/dist/{index.js → node/components/ButtonExBase.js} +8 -42
- package/dist/node/components/ButtonExBase.js.map +1 -0
- package/dist/node/components/ButtonExBase.mjs +23 -0
- package/dist/node/components/ButtonExBase.mjs.map +1 -0
- package/dist/node/components/ButtonExProps.d.mts +10 -0
- package/dist/node/components/ButtonExProps.d.mts.map +1 -0
- package/dist/node/components/ButtonExProps.d.ts +10 -0
- package/dist/node/components/ButtonExProps.d.ts.map +1 -0
- package/dist/node/components/ButtonExProps.js +17 -0
- package/dist/node/components/ButtonExProps.js.map +1 -0
- package/dist/node/components/ButtonExProps.mjs +1 -0
- package/dist/node/components/ButtonExProps.mjs.map +1 -0
- package/dist/node/components/ButtonExTo.d.mts +5 -0
- package/dist/node/components/ButtonExTo.d.mts.map +1 -0
- package/dist/node/components/ButtonExTo.d.ts +5 -0
- package/dist/node/components/ButtonExTo.d.ts.map +1 -0
- package/dist/node/components/ButtonExTo.js +43 -0
- package/dist/node/components/ButtonExTo.js.map +1 -0
- package/dist/node/components/ButtonExTo.mjs +19 -0
- package/dist/node/components/ButtonExTo.mjs.map +1 -0
- package/dist/node/components/index.d.mts +3 -0
- package/dist/node/components/index.d.mts.map +1 -0
- package/dist/node/components/index.d.ts +3 -0
- package/dist/node/components/index.d.ts.map +1 -0
- package/dist/node/components/index.js +25 -0
- package/dist/node/components/index.js.map +1 -0
- package/dist/node/components/index.mjs +3 -0
- package/dist/node/components/index.mjs.map +1 -0
- package/dist/node/index.d.mts +2 -0
- package/dist/node/index.d.mts.map +1 -0
- package/dist/node/index.d.ts +2 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +23 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/index.mjs +2 -0
- package/dist/node/index.mjs.map +1 -0
- package/package.json +15 -21
- package/dist/components/ButtonEx.d.ts.map +0 -1
- package/dist/components/ButtonEx.stories.d.ts +0 -8
- package/dist/components/ButtonEx.stories.d.ts.map +0 -1
- package/dist/components/ButtonExBase.d.ts.map +0 -1
- package/dist/components/ButtonExProps.d.ts.map +0 -1
- package/dist/components/ButtonExTo.d.ts.map +0 -1
- package/dist/components/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -54
- package/dist/index.mjs.map +0 -1
- /package/dist/{components/ButtonEx.d.ts → browser/components/ButtonEx.d.mts} +0 -0
- /package/dist/{components/ButtonExBase.d.ts → browser/components/ButtonExBase.d.mts} +0 -0
- /package/dist/{components/ButtonExProps.d.ts → browser/components/ButtonExProps.d.mts} +0 -0
- /package/dist/{components/ButtonExTo.d.ts → browser/components/ButtonExTo.d.mts} +0 -0
- /package/dist/{components/index.d.ts → browser/components/index.d.mts} +0 -0
- /package/dist/{index.d.mts → browser/index.d.mts} +0 -0
- /package/dist/{index.d.ts → browser/index.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonEx.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonEx.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAG/C,QAAA,MAAM,QAAQ,6GAMZ,CAAA;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ButtonExProps } from './ButtonExProps';
|
|
3
|
+
declare const ButtonEx: import("react").ForwardRefExoticComponent<ButtonExProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { ButtonEx };
|
|
5
|
+
//# sourceMappingURL=ButtonEx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonEx.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonEx.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAG/C,QAAA,MAAM,QAAQ,6GAMZ,CAAA;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { ButtonExBase } from "./ButtonExBase";
|
|
4
|
+
import { ButtonExTo } from "./ButtonExTo";
|
|
5
|
+
const ButtonEx = forwardRef(({ to, ...props }, ref) => {
|
|
6
|
+
if (to) {
|
|
7
|
+
return /* @__PURE__ */ jsx(ButtonExTo, { to, ref, ...props });
|
|
8
|
+
} else {
|
|
9
|
+
return /* @__PURE__ */ jsx(ButtonExBase, { ...props });
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
ButtonEx.displayName = "ButtonExXYLabs";
|
|
13
|
+
export {
|
|
14
|
+
ButtonEx
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=ButtonEx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ButtonEx.tsx"],"sourcesContent":["import { forwardRef } from 'react'\n\nimport { ButtonExBase } from './ButtonExBase'\nimport { ButtonExProps } from './ButtonExProps'\nimport { ButtonExTo } from './ButtonExTo'\n\nconst ButtonEx = forwardRef<HTMLButtonElement, ButtonExProps>(({ to, ...props }, ref) => {\n if (to) {\n return <ButtonExTo to={to} ref={ref} {...props} />\n } else {\n return <ButtonExBase {...props} />\n }\n})\n\nButtonEx.displayName = 'ButtonExXYLabs'\n\nexport { ButtonEx }\n"],"mappings":"AAQW;AARX,SAAS,kBAAkB;AAE3B,SAAS,oBAAoB;AAE7B,SAAS,kBAAkB;AAE3B,MAAM,WAAW,WAA6C,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ;AACvF,MAAI,IAAI;AACN,WAAO,oBAAC,cAAW,IAAQ,KAAW,GAAG,OAAO;AAAA,EAClD,OAAO;AACL,WAAO,oBAAC,gBAAc,GAAG,OAAO;AAAA,EAClC;AACF,CAAC;AAED,SAAS,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonExBase.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExBase.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,QAAA,MAAM,YAAY,6GAiBhB,CAAA;AAIF,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ButtonExProps } from './ButtonExProps';
|
|
3
|
+
declare const ButtonExBase: import("react").ForwardRefExoticComponent<ButtonExProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { ButtonExBase };
|
|
5
|
+
//# sourceMappingURL=ButtonExBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonExBase.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExBase.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,QAAA,MAAM,YAAY,6GAiBhB,CAAA;AAIF,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, useTheme } from "@mui/material";
|
|
3
|
+
import { BusyCircularProgress, BusyLinearProgress, mergeBoxlikeStyles } from "@xylabs/react-shared";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
const ButtonExBase = forwardRef((props, ref) => {
|
|
6
|
+
const theme = useTheme();
|
|
7
|
+
const { busy, busyVariant = "linear", busyOpacity, onClick, children, ...rootProps } = mergeBoxlikeStyles(theme, props);
|
|
8
|
+
const localOnClick = (event) => {
|
|
9
|
+
if (!busy) {
|
|
10
|
+
onClick?.(event);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
return /* @__PURE__ */ jsxs(Button, { ref, onClick: localOnClick, ...rootProps, children: [
|
|
14
|
+
busy && busyVariant === "linear" ? /* @__PURE__ */ jsx(BusyLinearProgress, { rounded: true, opacity: busyOpacity ?? 0 }) : null,
|
|
15
|
+
busy && busyVariant === "circular" ? /* @__PURE__ */ jsx(BusyCircularProgress, { rounded: true, size: 24, opacity: busyOpacity ?? 0.5 }) : null,
|
|
16
|
+
children
|
|
17
|
+
] });
|
|
18
|
+
});
|
|
19
|
+
ButtonExBase.displayName = "ButtonExBaseXYLabs";
|
|
20
|
+
export {
|
|
21
|
+
ButtonExBase
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=ButtonExBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ButtonExBase.tsx"],"sourcesContent":["import { Button, useTheme } from '@mui/material'\nimport { BusyCircularProgress, BusyLinearProgress, mergeBoxlikeStyles } from '@xylabs/react-shared'\nimport { forwardRef, MouseEvent } from 'react'\n\nimport { ButtonExProps } from './ButtonExProps'\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' ? <BusyLinearProgress rounded opacity={busyOpacity ?? 0} /> : null}\n {busy && busyVariant === 'circular' ? <BusyCircularProgress rounded size={24} opacity={busyOpacity ?? 0.5} /> : null}\n {children}\n </Button>\n )\n})\n\nButtonExBase.displayName = 'ButtonExBaseXYLabs'\n\nexport { ButtonExBase }\n"],"mappings":"AAiBI,SACsC,KADtC;AAjBJ,SAAS,QAAQ,gBAAgB;AACjC,SAAS,sBAAsB,oBAAoB,0BAA0B;AAC7E,SAAS,kBAA8B;AAIvC,MAAM,eAAe,WAA6C,CAAC,OAAO,QAAQ;AAChF,QAAM,QAAQ,SAAS;AACvB,QAAM,EAAE,MAAM,cAAc,UAAU,aAAa,SAAS,UAAU,GAAG,UAAU,IAAI,mBAAkC,OAAO,KAAK;AAErI,QAAM,eAAe,CAAC,UAAyC;AAC7D,QAAI,CAAC,MAAM;AACT,gBAAU,KAAK;AAAA,IACjB;AAAA,EACF;AAEA,SACE,qBAAC,UAAO,KAAU,SAAS,cAAe,GAAG,WAC1C;AAAA,YAAQ,gBAAgB,WAAW,oBAAC,sBAAmB,SAAO,MAAC,SAAS,eAAe,GAAG,IAAK;AAAA,IAC/F,QAAQ,gBAAgB,aAAa,oBAAC,wBAAqB,SAAO,MAAC,MAAM,IAAI,SAAS,eAAe,KAAK,IAAK;AAAA,IAC/G;AAAA,KACH;AAEJ,CAAC;AAED,aAAa,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
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,EAAE,eAAe,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AAEtD,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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ButtonProps } from '@mui/material';
|
|
2
|
+
import { BoxlikeComponentProps, BusyProps } from '@xylabs/react-shared';
|
|
3
|
+
import { 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
|
|
@@ -0,0 +1 @@
|
|
|
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,EAAE,eAAe,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AAEtD,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=ButtonExProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
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,iBAAiB,CAAA;AAE/C,QAAA,MAAM,UAAU,yFAUd,CAAA;AAIF,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
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,iBAAiB,CAAA;AAE/C,QAAA,MAAM,UAAU,yFAUd,CAAA;AAIF,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useNavigate } from "react-router-dom";
|
|
4
|
+
import { ButtonExBase } from "./ButtonExBase";
|
|
5
|
+
const ButtonExTo = forwardRef(({ to, toOptions, onClick, ...props }, ref) => {
|
|
6
|
+
const navigate = useNavigate();
|
|
7
|
+
const localOnClick = (event) => {
|
|
8
|
+
onClick?.(event);
|
|
9
|
+
if (to) {
|
|
10
|
+
navigate(to, toOptions);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
return /* @__PURE__ */ jsx(ButtonExBase, { ref, onClick: localOnClick, ...props });
|
|
14
|
+
});
|
|
15
|
+
ButtonExTo.displayName = "ButtonExToXYLabs";
|
|
16
|
+
export {
|
|
17
|
+
ButtonExTo
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=ButtonExTo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ButtonExTo.tsx"],"sourcesContent":["import React, { forwardRef, MouseEvent } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ButtonExBase } from './ButtonExBase'\nimport { ButtonExProps } from './ButtonExProps'\n\nconst ButtonExTo = 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\nButtonExTo.displayName = 'ButtonExToXYLabs'\n\nexport { ButtonExTo }\n"],"mappings":"AAeS;AAfT,SAAgB,kBAA8B;AAC9C,SAAS,mBAAmB;AAE5B,SAAS,oBAAoB;AAG7B,MAAM,aAAa,WAA6C,CAAC,EAAE,IAAI,WAAW,SAAS,GAAG,MAAM,GAAG,QAAQ;AAC7G,QAAM,WAAW,YAAY;AAC7B,QAAM,eAAe,CAAC,UAAyC;AAC7D,cAAU,KAAK;AACf,QAAI,IAAI;AACN,eAAS,IAAI,SAAS;AAAA,IACxB;AAAA,EACF;AAEA,SAAO,oBAAC,gBAAa,KAAU,SAAS,cAAe,GAAG,OAAO;AACnE,CAAC;AAED,WAAW,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["export * from './ButtonEx'\nexport * from './ButtonExProps'\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './components'\n"],"mappings":"AAAA,cAAc;","names":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ButtonExProps } from './ButtonExProps';
|
|
3
|
+
declare const ButtonEx: import("react").ForwardRefExoticComponent<ButtonExProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { ButtonEx };
|
|
5
|
+
//# sourceMappingURL=ButtonEx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonEx.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonEx.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAG/C,QAAA,MAAM,QAAQ,6GAMZ,CAAA;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ButtonExProps } from './ButtonExProps';
|
|
3
|
+
declare const ButtonEx: import("react").ForwardRefExoticComponent<ButtonExProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { ButtonEx };
|
|
5
|
+
//# sourceMappingURL=ButtonEx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonEx.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonEx.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAG/C,QAAA,MAAM,QAAQ,6GAMZ,CAAA;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
var ButtonEx_exports = {};
|
|
20
|
+
__export(ButtonEx_exports, {
|
|
21
|
+
ButtonEx: () => ButtonEx
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(ButtonEx_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_react = require("react");
|
|
26
|
+
var import_ButtonExBase = require("./ButtonExBase");
|
|
27
|
+
var import_ButtonExTo = require("./ButtonExTo");
|
|
28
|
+
const ButtonEx = (0, import_react.forwardRef)(({ to, ...props }, ref) => {
|
|
29
|
+
if (to) {
|
|
30
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ButtonExTo.ButtonExTo, { to, ref, ...props });
|
|
31
|
+
} else {
|
|
32
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ButtonExBase.ButtonExBase, { ...props });
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
ButtonEx.displayName = "ButtonExXYLabs";
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
ButtonEx
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=ButtonEx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ButtonEx.tsx"],"sourcesContent":["import { forwardRef } from 'react'\n\nimport { ButtonExBase } from './ButtonExBase'\nimport { ButtonExProps } from './ButtonExProps'\nimport { ButtonExTo } from './ButtonExTo'\n\nconst ButtonEx = forwardRef<HTMLButtonElement, ButtonExProps>(({ to, ...props }, ref) => {\n if (to) {\n return <ButtonExTo to={to} ref={ref} {...props} />\n } else {\n return <ButtonExBase {...props} />\n }\n})\n\nButtonEx.displayName = 'ButtonExXYLabs'\n\nexport { ButtonEx }\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQW;AARX,mBAA2B;AAE3B,0BAA6B;AAE7B,wBAA2B;AAE3B,MAAM,eAAW,yBAA6C,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ;AACvF,MAAI,IAAI;AACN,WAAO,4CAAC,gCAAW,IAAQ,KAAW,GAAG,OAAO;AAAA,EAClD,OAAO;AACL,WAAO,4CAAC,oCAAc,GAAG,OAAO;AAAA,EAClC;AACF,CAAC;AAED,SAAS,cAAc;","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { ButtonExBase } from "./ButtonExBase";
|
|
4
|
+
import { ButtonExTo } from "./ButtonExTo";
|
|
5
|
+
const ButtonEx = forwardRef(({ to, ...props }, ref) => {
|
|
6
|
+
if (to) {
|
|
7
|
+
return /* @__PURE__ */ jsx(ButtonExTo, { to, ref, ...props });
|
|
8
|
+
} else {
|
|
9
|
+
return /* @__PURE__ */ jsx(ButtonExBase, { ...props });
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
ButtonEx.displayName = "ButtonExXYLabs";
|
|
13
|
+
export {
|
|
14
|
+
ButtonEx
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=ButtonEx.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ButtonEx.tsx"],"sourcesContent":["import { forwardRef } from 'react'\n\nimport { ButtonExBase } from './ButtonExBase'\nimport { ButtonExProps } from './ButtonExProps'\nimport { ButtonExTo } from './ButtonExTo'\n\nconst ButtonEx = forwardRef<HTMLButtonElement, ButtonExProps>(({ to, ...props }, ref) => {\n if (to) {\n return <ButtonExTo to={to} ref={ref} {...props} />\n } else {\n return <ButtonExBase {...props} />\n }\n})\n\nButtonEx.displayName = 'ButtonExXYLabs'\n\nexport { ButtonEx }\n"],"mappings":"AAQW;AARX,SAAS,kBAAkB;AAE3B,SAAS,oBAAoB;AAE7B,SAAS,kBAAkB;AAE3B,MAAM,WAAW,WAA6C,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ;AACvF,MAAI,IAAI;AACN,WAAO,oBAAC,cAAW,IAAQ,KAAW,GAAG,OAAO;AAAA,EAClD,OAAO;AACL,WAAO,oBAAC,gBAAc,GAAG,OAAO;AAAA,EAClC;AACF,CAAC;AAED,SAAS,cAAc;","names":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ButtonExProps } from './ButtonExProps';
|
|
3
|
+
declare const ButtonExBase: import("react").ForwardRefExoticComponent<ButtonExProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { ButtonExBase };
|
|
5
|
+
//# sourceMappingURL=ButtonExBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonExBase.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExBase.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,QAAA,MAAM,YAAY,6GAiBhB,CAAA;AAIF,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ButtonExProps } from './ButtonExProps';
|
|
3
|
+
declare const ButtonExBase: import("react").ForwardRefExoticComponent<ButtonExProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { ButtonExBase };
|
|
5
|
+
//# sourceMappingURL=ButtonExBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonExBase.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonExBase.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,QAAA,MAAM,YAAY,6GAiBhB,CAAA;AAIF,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -16,23 +16,16 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
ButtonEx: () => ButtonEx
|
|
19
|
+
var ButtonExBase_exports = {};
|
|
20
|
+
__export(ButtonExBase_exports, {
|
|
21
|
+
ButtonExBase: () => ButtonExBase
|
|
24
22
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
26
|
-
|
|
27
|
-
// src/components/ButtonEx.tsx
|
|
28
|
-
var import_react3 = require("react");
|
|
29
|
-
|
|
30
|
-
// src/components/ButtonExBase.tsx
|
|
23
|
+
module.exports = __toCommonJS(ButtonExBase_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
25
|
var import_material = require("@mui/material");
|
|
32
26
|
var import_react_shared = require("@xylabs/react-shared");
|
|
33
27
|
var import_react = require("react");
|
|
34
|
-
|
|
35
|
-
var ButtonExBase = (0, import_react.forwardRef)((props, ref) => {
|
|
28
|
+
const ButtonExBase = (0, import_react.forwardRef)((props, ref) => {
|
|
36
29
|
const theme = (0, import_material.useTheme)();
|
|
37
30
|
const { busy, busyVariant = "linear", busyOpacity, onClick, children, ...rootProps } = (0, import_react_shared.mergeBoxlikeStyles)(theme, props);
|
|
38
31
|
const localOnClick = (event) => {
|
|
@@ -47,35 +40,8 @@ var ButtonExBase = (0, import_react.forwardRef)((props, ref) => {
|
|
|
47
40
|
] });
|
|
48
41
|
});
|
|
49
42
|
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 ButtonExTo = (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
|
-
ButtonExTo.displayName = "ButtonExToXYLabs";
|
|
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
|
-
if (to) {
|
|
71
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ButtonExTo, { to, ref, ...props });
|
|
72
|
-
} else {
|
|
73
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ButtonExBase, { ...props });
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
ButtonEx.displayName = "ButtonExXYLabs";
|
|
77
43
|
// Annotate the CommonJS export names for ESM import in node:
|
|
78
44
|
0 && (module.exports = {
|
|
79
|
-
|
|
45
|
+
ButtonExBase
|
|
80
46
|
});
|
|
81
|
-
//# sourceMappingURL=
|
|
47
|
+
//# sourceMappingURL=ButtonExBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ButtonExBase.tsx"],"sourcesContent":["import { Button, useTheme } from '@mui/material'\nimport { BusyCircularProgress, BusyLinearProgress, mergeBoxlikeStyles } from '@xylabs/react-shared'\nimport { forwardRef, MouseEvent } from 'react'\n\nimport { ButtonExProps } from './ButtonExProps'\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' ? <BusyLinearProgress rounded opacity={busyOpacity ?? 0} /> : null}\n {busy && busyVariant === 'circular' ? <BusyCircularProgress rounded size={24} opacity={busyOpacity ?? 0.5} /> : null}\n {children}\n </Button>\n )\n})\n\nButtonExBase.displayName = 'ButtonExBaseXYLabs'\n\nexport { ButtonExBase }\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBI;AAjBJ,sBAAiC;AACjC,0BAA6E;AAC7E,mBAAuC;AAIvC,MAAM,mBAAe,yBAA6C,CAAC,OAAO,QAAQ;AAChF,QAAM,YAAQ,0BAAS;AACvB,QAAM,EAAE,MAAM,cAAc,UAAU,aAAa,SAAS,UAAU,GAAG,UAAU,QAAI,wCAAkC,OAAO,KAAK;AAErI,QAAM,eAAe,CAAC,UAAyC;AAC7D,QAAI,CAAC,MAAM;AACT,gBAAU,KAAK;AAAA,IACjB;AAAA,EACF;AAEA,SACE,6CAAC,0BAAO,KAAU,SAAS,cAAe,GAAG,WAC1C;AAAA,YAAQ,gBAAgB,WAAW,4CAAC,0CAAmB,SAAO,MAAC,SAAS,eAAe,GAAG,IAAK;AAAA,IAC/F,QAAQ,gBAAgB,aAAa,4CAAC,4CAAqB,SAAO,MAAC,MAAM,IAAI,SAAS,eAAe,KAAK,IAAK;AAAA,IAC/G;AAAA,KACH;AAEJ,CAAC;AAED,aAAa,cAAc;","names":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, useTheme } from "@mui/material";
|
|
3
|
+
import { BusyCircularProgress, BusyLinearProgress, mergeBoxlikeStyles } from "@xylabs/react-shared";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
const ButtonExBase = forwardRef((props, ref) => {
|
|
6
|
+
const theme = useTheme();
|
|
7
|
+
const { busy, busyVariant = "linear", busyOpacity, onClick, children, ...rootProps } = mergeBoxlikeStyles(theme, props);
|
|
8
|
+
const localOnClick = (event) => {
|
|
9
|
+
if (!busy) {
|
|
10
|
+
onClick?.(event);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
return /* @__PURE__ */ jsxs(Button, { ref, onClick: localOnClick, ...rootProps, children: [
|
|
14
|
+
busy && busyVariant === "linear" ? /* @__PURE__ */ jsx(BusyLinearProgress, { rounded: true, opacity: busyOpacity ?? 0 }) : null,
|
|
15
|
+
busy && busyVariant === "circular" ? /* @__PURE__ */ jsx(BusyCircularProgress, { rounded: true, size: 24, opacity: busyOpacity ?? 0.5 }) : null,
|
|
16
|
+
children
|
|
17
|
+
] });
|
|
18
|
+
});
|
|
19
|
+
ButtonExBase.displayName = "ButtonExBaseXYLabs";
|
|
20
|
+
export {
|
|
21
|
+
ButtonExBase
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=ButtonExBase.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ButtonExBase.tsx"],"sourcesContent":["import { Button, useTheme } from '@mui/material'\nimport { BusyCircularProgress, BusyLinearProgress, mergeBoxlikeStyles } from '@xylabs/react-shared'\nimport { forwardRef, MouseEvent } from 'react'\n\nimport { ButtonExProps } from './ButtonExProps'\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' ? <BusyLinearProgress rounded opacity={busyOpacity ?? 0} /> : null}\n {busy && busyVariant === 'circular' ? <BusyCircularProgress rounded size={24} opacity={busyOpacity ?? 0.5} /> : null}\n {children}\n </Button>\n )\n})\n\nButtonExBase.displayName = 'ButtonExBaseXYLabs'\n\nexport { ButtonExBase }\n"],"mappings":"AAiBI,SACsC,KADtC;AAjBJ,SAAS,QAAQ,gBAAgB;AACjC,SAAS,sBAAsB,oBAAoB,0BAA0B;AAC7E,SAAS,kBAA8B;AAIvC,MAAM,eAAe,WAA6C,CAAC,OAAO,QAAQ;AAChF,QAAM,QAAQ,SAAS;AACvB,QAAM,EAAE,MAAM,cAAc,UAAU,aAAa,SAAS,UAAU,GAAG,UAAU,IAAI,mBAAkC,OAAO,KAAK;AAErI,QAAM,eAAe,CAAC,UAAyC;AAC7D,QAAI,CAAC,MAAM;AACT,gBAAU,KAAK;AAAA,IACjB;AAAA,EACF;AAEA,SACE,qBAAC,UAAO,KAAU,SAAS,cAAe,GAAG,WAC1C;AAAA,YAAQ,gBAAgB,WAAW,oBAAC,sBAAmB,SAAO,MAAC,SAAS,eAAe,GAAG,IAAK;AAAA,IAC/F,QAAQ,gBAAgB,aAAa,oBAAC,wBAAqB,SAAO,MAAC,MAAM,IAAI,SAAS,eAAe,KAAK,IAAK;AAAA,IAC/G;AAAA,KACH;AAEJ,CAAC;AAED,aAAa,cAAc;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ButtonProps } from '@mui/material';
|
|
2
|
+
import { BoxlikeComponentProps, BusyProps } from '@xylabs/react-shared';
|
|
3
|
+
import { 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
|
|
@@ -0,0 +1 @@
|
|
|
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,EAAE,eAAe,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AAEtD,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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ButtonProps } from '@mui/material';
|
|
2
|
+
import { BoxlikeComponentProps, BusyProps } from '@xylabs/react-shared';
|
|
3
|
+
import { 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
|
|
@@ -0,0 +1 @@
|
|
|
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,EAAE,eAAe,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AAEtD,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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var ButtonExProps_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(ButtonExProps_exports);
|
|
17
|
+
//# sourceMappingURL=ButtonExProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ButtonExProps.tsx"],"sourcesContent":["import { ButtonProps } from '@mui/material'\nimport { BoxlikeComponentProps, BusyProps } from '@xylabs/react-shared'\nimport { NavigateOptions, To } from 'react-router-dom'\n\ninterface ButtonExProps extends Omit<ButtonProps, 'ref'>, BoxlikeComponentProps, BusyProps {\n target?: string\n to?: To\n toOptions?: NavigateOptions\n}\n\nexport type { ButtonExProps }\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=ButtonExProps.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
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,iBAAiB,CAAA;AAE/C,QAAA,MAAM,UAAU,yFAUd,CAAA;AAIF,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
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,iBAAiB,CAAA;AAE/C,QAAA,MAAM,UAAU,yFAUd,CAAA;AAIF,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
var ButtonExTo_exports = {};
|
|
20
|
+
__export(ButtonExTo_exports, {
|
|
21
|
+
ButtonExTo: () => ButtonExTo
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(ButtonExTo_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_react = require("react");
|
|
26
|
+
var import_react_router_dom = require("react-router-dom");
|
|
27
|
+
var import_ButtonExBase = require("./ButtonExBase");
|
|
28
|
+
const ButtonExTo = (0, import_react.forwardRef)(({ to, toOptions, onClick, ...props }, ref) => {
|
|
29
|
+
const navigate = (0, import_react_router_dom.useNavigate)();
|
|
30
|
+
const localOnClick = (event) => {
|
|
31
|
+
onClick?.(event);
|
|
32
|
+
if (to) {
|
|
33
|
+
navigate(to, toOptions);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ButtonExBase.ButtonExBase, { ref, onClick: localOnClick, ...props });
|
|
37
|
+
});
|
|
38
|
+
ButtonExTo.displayName = "ButtonExToXYLabs";
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
ButtonExTo
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=ButtonExTo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ButtonExTo.tsx"],"sourcesContent":["import React, { forwardRef, MouseEvent } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ButtonExBase } from './ButtonExBase'\nimport { ButtonExProps } from './ButtonExProps'\n\nconst ButtonExTo = 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\nButtonExTo.displayName = 'ButtonExToXYLabs'\n\nexport { ButtonExTo }\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeS;AAfT,mBAA8C;AAC9C,8BAA4B;AAE5B,0BAA6B;AAG7B,MAAM,iBAAa,yBAA6C,CAAC,EAAE,IAAI,WAAW,SAAS,GAAG,MAAM,GAAG,QAAQ;AAC7G,QAAM,eAAW,qCAAY;AAC7B,QAAM,eAAe,CAAC,UAAyC;AAC7D,cAAU,KAAK;AACf,QAAI,IAAI;AACN,eAAS,IAAI,SAAS;AAAA,IACxB;AAAA,EACF;AAEA,SAAO,4CAAC,oCAAa,KAAU,SAAS,cAAe,GAAG,OAAO;AACnE,CAAC;AAED,WAAW,cAAc;","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useNavigate } from "react-router-dom";
|
|
4
|
+
import { ButtonExBase } from "./ButtonExBase";
|
|
5
|
+
const ButtonExTo = forwardRef(({ to, toOptions, onClick, ...props }, ref) => {
|
|
6
|
+
const navigate = useNavigate();
|
|
7
|
+
const localOnClick = (event) => {
|
|
8
|
+
onClick?.(event);
|
|
9
|
+
if (to) {
|
|
10
|
+
navigate(to, toOptions);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
return /* @__PURE__ */ jsx(ButtonExBase, { ref, onClick: localOnClick, ...props });
|
|
14
|
+
});
|
|
15
|
+
ButtonExTo.displayName = "ButtonExToXYLabs";
|
|
16
|
+
export {
|
|
17
|
+
ButtonExTo
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=ButtonExTo.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ButtonExTo.tsx"],"sourcesContent":["import React, { forwardRef, MouseEvent } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ButtonExBase } from './ButtonExBase'\nimport { ButtonExProps } from './ButtonExProps'\n\nconst ButtonExTo = 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\nButtonExTo.displayName = 'ButtonExToXYLabs'\n\nexport { ButtonExTo }\n"],"mappings":"AAeS;AAfT,SAAgB,kBAA8B;AAC9C,SAAS,mBAAmB;AAE5B,SAAS,oBAAoB;AAG7B,MAAM,aAAa,WAA6C,CAAC,EAAE,IAAI,WAAW,SAAS,GAAG,MAAM,GAAG,QAAQ;AAC7G,QAAM,WAAW,YAAY;AAC7B,QAAM,eAAe,CAAC,UAAyC;AAC7D,cAAU,KAAK;AACf,QAAI,IAAI;AACN,eAAS,IAAI,SAAS;AAAA,IACxB;AAAA,EACF;AAEA,SAAO,oBAAC,gBAAa,KAAU,SAAS,cAAe,GAAG,OAAO;AACnE,CAAC;AAED,WAAW,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var components_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(components_exports);
|
|
18
|
+
__reExport(components_exports, require("./ButtonEx"), module.exports);
|
|
19
|
+
__reExport(components_exports, require("./ButtonExProps"), module.exports);
|
|
20
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
21
|
+
0 && (module.exports = {
|
|
22
|
+
...require("./ButtonEx"),
|
|
23
|
+
...require("./ButtonExProps")
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["export * from './ButtonEx'\nexport * from './ButtonExProps'\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,+BAAc,uBAAd;AACA,+BAAc,4BADd;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["export * from './ButtonEx'\nexport * from './ButtonExProps'\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var src_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(src_exports);
|
|
18
|
+
__reExport(src_exports, require("./components"), module.exports);
|
|
19
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
20
|
+
0 && (module.exports = {
|
|
21
|
+
...require("./components")
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './components'\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,yBAAd;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './components'\n"],"mappings":"AAAA,cAAc;","names":[]}
|
package/package.json
CHANGED
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
"packages/*"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@xylabs/react-shared": "~3.1.0-rc.
|
|
16
|
+
"@xylabs/react-shared": "~3.1.0-rc.5"
|
|
17
17
|
},
|
|
18
18
|
"description": "Common React library for all XY Labs projects that use React",
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@mui/material": "^5.14.10",
|
|
21
21
|
"@storybook/react": "^7.4.3",
|
|
22
|
-
"@xylabs/react-flexbox": "~3.1.0-rc.
|
|
23
|
-
"@xylabs/ts-scripts-yarn3": "^3.0.
|
|
24
|
-
"@xylabs/tsconfig-react": "^3.0.
|
|
22
|
+
"@xylabs/react-flexbox": "~3.1.0-rc.5",
|
|
23
|
+
"@xylabs/ts-scripts-yarn3": "^3.0.52",
|
|
24
|
+
"@xylabs/tsconfig-react": "^3.0.52",
|
|
25
25
|
"react": "^18.2.0",
|
|
26
26
|
"react-dom": "^18.2.0",
|
|
27
27
|
"react-router-dom": "^6.16.0",
|
|
@@ -37,33 +37,28 @@
|
|
|
37
37
|
".": {
|
|
38
38
|
"node": {
|
|
39
39
|
"import": {
|
|
40
|
-
"types": "./dist/index.d.mts",
|
|
41
|
-
"default": "./dist/index.mjs"
|
|
40
|
+
"types": "./dist/node/index.d.mts",
|
|
41
|
+
"default": "./dist/node/index.mjs"
|
|
42
42
|
},
|
|
43
43
|
"require": {
|
|
44
|
-
"types": "./dist/index.d.ts",
|
|
45
|
-
"default": "./dist/index.js"
|
|
44
|
+
"types": "./dist/node/index.d.ts",
|
|
45
|
+
"default": "./dist/node/index.js"
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"browser": {
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
"default": "./dist/index.mjs"
|
|
52
|
-
},
|
|
53
|
-
"require": {
|
|
54
|
-
"types": "./dist/index.d.ts",
|
|
55
|
-
"default": "./dist/index.js"
|
|
56
|
-
}
|
|
49
|
+
"types": "./dist/browser/index.d.ts",
|
|
50
|
+
"default": "./dist/browser/index.js"
|
|
57
51
|
},
|
|
58
|
-
"default": "./dist/index.
|
|
52
|
+
"default": "./dist/browser/index.js"
|
|
59
53
|
},
|
|
60
54
|
"./dist/docs.json": {
|
|
61
55
|
"default": "./dist/docs.json"
|
|
62
56
|
},
|
|
63
57
|
"./package.json": "./package.json"
|
|
64
58
|
},
|
|
65
|
-
"
|
|
66
|
-
"
|
|
59
|
+
"types": "dist/browser/index.d.ts",
|
|
60
|
+
"main": "./dist/node/index.js",
|
|
61
|
+
"module": "./dist/browser/index.js",
|
|
67
62
|
"homepage": "https://xylabs.com",
|
|
68
63
|
"keywords": [
|
|
69
64
|
"utility",
|
|
@@ -79,7 +74,6 @@
|
|
|
79
74
|
"url": "https://github.com/xylabs/sdk-react.git"
|
|
80
75
|
},
|
|
81
76
|
"sideEffects": false,
|
|
82
|
-
"
|
|
83
|
-
"version": "3.1.0-rc.3",
|
|
77
|
+
"version": "3.1.0-rc.5",
|
|
84
78
|
"stableVersion": "3.0.0"
|
|
85
79
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonEx.d.ts","sourceRoot":"","sources":["../../src/components/ButtonEx.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAG/C,QAAA,MAAM,QAAQ,6GAMZ,CAAA;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare const StorybookEntry: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("./ButtonExProps").ButtonExProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
3
|
-
declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./ButtonExProps").ButtonExProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
|
-
declare const BusyCircular: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./ButtonExProps").ButtonExProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
-
declare const BusyLinear: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./ButtonExProps").ButtonExProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
|
-
export { BusyCircular, BusyLinear, Default };
|
|
7
|
-
export default StorybookEntry;
|
|
8
|
-
//# sourceMappingURL=ButtonEx.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonEx.stories.d.ts","sourceRoot":"","sources":["../../src/components/ButtonEx.stories.tsx"],"names":[],"mappings":";AAKA,QAAA,MAAM,cAAc,+LASM,CAAA;AAoB1B,QAAA,MAAM,OAAO,2LAA2B,CAAA;AAGxC,QAAA,MAAM,YAAY,2LAA2B,CAAA;AAG7C,QAAA,MAAM,UAAU,2LAA2B,CAAA;AAG3C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,CAAA;AAE5C,eAAe,cAAc,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,iBAAiB,CAAA;AAE/C,QAAA,MAAM,YAAY,6GAiBhB,CAAA;AAIF,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -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,EAAE,eAAe,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AAEtD,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,iBAAiB,CAAA;AAE/C,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,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA"}
|
package/dist/index.js.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'\n","import { forwardRef } from 'react'\n\nimport { ButtonExBase } from './ButtonExBase'\nimport { ButtonExProps } from './ButtonExProps'\nimport { ButtonExTo } from './ButtonExTo'\n\nconst ButtonEx = forwardRef<HTMLButtonElement, ButtonExProps>(({ to, ...props }, ref) => {\n if (to) {\n return <ButtonExTo to={to} ref={ref} {...props} />\n } else {\n return <ButtonExBase {...props} />\n }\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'\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' ? <BusyLinearProgress rounded opacity={busyOpacity ?? 0} /> : null}\n {busy && busyVariant === 'circular' ? <BusyCircularProgress rounded size={24} opacity={busyOpacity ?? 0.5} /> : 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'\nimport { ButtonExProps } from './ButtonExProps'\n\nconst ButtonExTo = 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\nButtonExTo.displayName = 'ButtonExToXYLabs'\n\nexport { ButtonExTo }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA2B;;;ACA3B,sBAAiC;AACjC,0BAA6E;AAC7E,mBAAuC;AAenC;AAXJ,IAAM,mBAAe,yBAA6C,CAAC,OAAO,QAAQ;AAChF,QAAM,YAAQ,0BAAS;AACvB,QAAM,EAAE,MAAM,cAAc,UAAU,aAAa,SAAS,UAAU,GAAG,UAAU,QAAI,wCAAkC,OAAO,KAAK;AAErI,QAAM,eAAe,CAAC,UAAyC;AAC7D,QAAI,CAAC,MAAM;AACT,gBAAU,KAAK;AAAA,IACjB;AAAA,EACF;AAEA,SACE,6CAAC,0BAAO,KAAU,SAAS,cAAe,GAAG,WAC1C;AAAA,YAAQ,gBAAgB,WAAW,4CAAC,0CAAmB,SAAO,MAAC,SAAS,eAAe,GAAG,IAAK;AAAA,IAC/F,QAAQ,gBAAgB,aAAa,4CAAC,4CAAqB,SAAO,MAAC,MAAM,IAAI,SAAS,eAAe,KAAK,IAAK;AAAA,IAC/G;AAAA,KACH;AAEJ,CAAC;AAED,aAAa,cAAc;;;ACzB3B,IAAAC,gBAA8C;AAC9C,8BAA4B;AAcnB,IAAAC,sBAAA;AATT,IAAM,iBAAa,0BAA6C,CAAC,EAAE,IAAI,WAAW,SAAS,GAAG,MAAM,GAAG,QAAQ;AAC7G,QAAM,eAAW,qCAAY;AAC7B,QAAM,eAAe,CAAC,UAAyC;AAC7D,cAAU,KAAK;AACf,QAAI,IAAI;AACN,eAAS,IAAI,SAAS;AAAA,IACxB;AAAA,EACF;AAEA,SAAO,6CAAC,gBAAa,KAAU,SAAS,cAAe,GAAG,OAAO;AACnE,CAAC;AAED,WAAW,cAAc;;;AFVd,IAAAC,sBAAA;AAFX,IAAM,eAAW,0BAA6C,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ;AACvF,MAAI,IAAI;AACN,WAAO,6CAAC,cAAW,IAAQ,KAAW,GAAG,OAAO;AAAA,EAClD,OAAO;AACL,WAAO,6CAAC,gBAAc,GAAG,OAAO;AAAA,EAClC;AACF,CAAC;AAED,SAAS,cAAc;","names":["import_react","import_react","import_jsx_runtime","import_jsx_runtime"]}
|
package/dist/index.mjs
DELETED
|
@@ -1,54 +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 ButtonExTo = 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
|
-
ButtonExTo.displayName = "ButtonExToXYLabs";
|
|
40
|
-
|
|
41
|
-
// src/components/ButtonEx.tsx
|
|
42
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
43
|
-
var ButtonEx = forwardRef3(({ to, ...props }, ref) => {
|
|
44
|
-
if (to) {
|
|
45
|
-
return /* @__PURE__ */ jsx3(ButtonExTo, { to, ref, ...props });
|
|
46
|
-
} else {
|
|
47
|
-
return /* @__PURE__ */ jsx3(ButtonExBase, { ...props });
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
ButtonEx.displayName = "ButtonExXYLabs";
|
|
51
|
-
export {
|
|
52
|
-
ButtonEx
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=index.mjs.map
|
package/dist/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 { forwardRef } from 'react'\n\nimport { ButtonExBase } from './ButtonExBase'\nimport { ButtonExProps } from './ButtonExProps'\nimport { ButtonExTo } from './ButtonExTo'\n\nconst ButtonEx = forwardRef<HTMLButtonElement, ButtonExProps>(({ to, ...props }, ref) => {\n if (to) {\n return <ButtonExTo to={to} ref={ref} {...props} />\n } else {\n return <ButtonExBase {...props} />\n }\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'\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' ? <BusyLinearProgress rounded opacity={busyOpacity ?? 0} /> : null}\n {busy && busyVariant === 'circular' ? <BusyCircularProgress rounded size={24} opacity={busyOpacity ?? 0.5} /> : 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'\nimport { ButtonExProps } from './ButtonExProps'\n\nconst ButtonExTo = 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\nButtonExTo.displayName = 'ButtonExToXYLabs'\n\nexport { ButtonExTo }\n"],"mappings":";AAAA,SAAS,cAAAA,mBAAkB;;;ACA3B,SAAS,QAAQ,gBAAgB;AACjC,SAAS,sBAAsB,oBAAoB,0BAA0B;AAC7E,SAAS,kBAA8B;AAenC,SACsC,KADtC;AAXJ,IAAM,eAAe,WAA6C,CAAC,OAAO,QAAQ;AAChF,QAAM,QAAQ,SAAS;AACvB,QAAM,EAAE,MAAM,cAAc,UAAU,aAAa,SAAS,UAAU,GAAG,UAAU,IAAI,mBAAkC,OAAO,KAAK;AAErI,QAAM,eAAe,CAAC,UAAyC;AAC7D,QAAI,CAAC,MAAM;AACT,gBAAU,KAAK;AAAA,IACjB;AAAA,EACF;AAEA,SACE,qBAAC,UAAO,KAAU,SAAS,cAAe,GAAG,WAC1C;AAAA,YAAQ,gBAAgB,WAAW,oBAAC,sBAAmB,SAAO,MAAC,SAAS,eAAe,GAAG,IAAK;AAAA,IAC/F,QAAQ,gBAAgB,aAAa,oBAAC,wBAAqB,SAAO,MAAC,MAAM,IAAI,SAAS,eAAe,KAAK,IAAK;AAAA,IAC/G;AAAA,KACH;AAEJ,CAAC;AAED,aAAa,cAAc;;;ACzB3B,SAAgB,cAAAC,mBAA8B;AAC9C,SAAS,mBAAmB;AAcnB,gBAAAC,YAAA;AATT,IAAM,aAAaC,YAA6C,CAAC,EAAE,IAAI,WAAW,SAAS,GAAG,MAAM,GAAG,QAAQ;AAC7G,QAAM,WAAW,YAAY;AAC7B,QAAM,eAAe,CAAC,UAAyC;AAC7D,cAAU,KAAK;AACf,QAAI,IAAI;AACN,eAAS,IAAI,SAAS;AAAA,IACxB;AAAA,EACF;AAEA,SAAO,gBAAAD,KAAC,gBAAa,KAAU,SAAS,cAAe,GAAG,OAAO;AACnE,CAAC;AAED,WAAW,cAAc;;;AFVd,gBAAAE,YAAA;AAFX,IAAM,WAAWC,YAA6C,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ;AACvF,MAAI,IAAI;AACN,WAAO,gBAAAD,KAAC,cAAW,IAAQ,KAAW,GAAG,OAAO;AAAA,EAClD,OAAO;AACL,WAAO,gBAAAA,KAAC,gBAAc,GAAG,OAAO;AAAA,EAClC;AACF,CAAC;AAED,SAAS,cAAc;","names":["forwardRef","forwardRef","jsx","forwardRef","jsx","forwardRef"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|