@xylabs/react-button 3.1.0-rc.3 → 3.1.0-rc.4
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/components/ButtonEx.js +40 -0
- package/dist/components/ButtonEx.js.map +1 -0
- package/dist/components/ButtonEx.mjs +16 -0
- package/dist/components/ButtonEx.mjs.map +1 -0
- package/dist/components/ButtonEx.stories.js +58 -0
- package/dist/components/ButtonEx.stories.js.map +1 -0
- package/dist/components/ButtonEx.stories.mjs +32 -0
- package/dist/components/ButtonEx.stories.mjs.map +1 -0
- package/dist/components/ButtonExBase.js +47 -0
- package/dist/components/ButtonExBase.js.map +1 -0
- package/dist/components/ButtonExBase.mjs +23 -0
- package/dist/components/ButtonExBase.mjs.map +1 -0
- package/dist/components/ButtonExProps.js +17 -0
- package/dist/components/ButtonExProps.js.map +1 -0
- package/dist/components/ButtonExProps.mjs +1 -0
- package/dist/components/ButtonExProps.mjs.map +1 -0
- package/dist/components/ButtonExTo.js +43 -0
- package/dist/components/ButtonExTo.js.map +1 -0
- package/dist/components/ButtonExTo.mjs +19 -0
- package/dist/components/ButtonExTo.mjs.map +1 -0
- package/dist/components/index.js +25 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +3 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/esm/components/ButtonEx.d.ts +5 -0
- package/dist/esm/components/ButtonEx.d.ts.map +1 -0
- package/dist/esm/components/ButtonEx.js +16 -0
- package/dist/esm/components/ButtonEx.js.map +1 -0
- package/dist/esm/components/ButtonEx.stories.d.ts +8 -0
- package/dist/esm/components/ButtonEx.stories.d.ts.map +1 -0
- package/dist/esm/components/ButtonEx.stories.js +32 -0
- package/dist/esm/components/ButtonEx.stories.js.map +1 -0
- package/dist/esm/components/ButtonExBase.d.ts +5 -0
- package/dist/esm/components/ButtonExBase.d.ts.map +1 -0
- package/dist/esm/components/ButtonExBase.js +23 -0
- package/dist/esm/components/ButtonExBase.js.map +1 -0
- package/dist/esm/components/ButtonExProps.d.ts +10 -0
- package/dist/esm/components/ButtonExProps.d.ts.map +1 -0
- package/dist/esm/components/ButtonExProps.js +1 -0
- package/dist/esm/components/ButtonExProps.js.map +1 -0
- package/dist/esm/components/ButtonExTo.d.ts +5 -0
- package/dist/esm/components/ButtonExTo.d.ts.map +1 -0
- package/dist/esm/components/ButtonExTo.js +19 -0
- package/dist/esm/components/ButtonExTo.js.map +1 -0
- package/dist/esm/components/index.d.ts +3 -0
- package/dist/esm/components/index.d.ts.map +1 -0
- package/dist/esm/components/index.js +3 -0
- package/dist/esm/components/index.js.map +1 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/index.js +3 -61
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -53
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
|
@@ -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,58 @@
|
|
|
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_stories_exports = {};
|
|
20
|
+
__export(ButtonEx_stories_exports, {
|
|
21
|
+
BusyCircular: () => BusyCircular,
|
|
22
|
+
BusyLinear: () => BusyLinear,
|
|
23
|
+
Default: () => Default,
|
|
24
|
+
default: () => ButtonEx_stories_default
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(ButtonEx_stories_exports);
|
|
27
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
29
|
+
var import_ButtonEx = require("./ButtonEx");
|
|
30
|
+
const StorybookEntry = {
|
|
31
|
+
argTypes: {},
|
|
32
|
+
component: import_ButtonEx.ButtonEx,
|
|
33
|
+
parameters: {
|
|
34
|
+
docs: {
|
|
35
|
+
page: null
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
title: "button/ButtonEx"
|
|
39
|
+
};
|
|
40
|
+
const DefaultTemplate = (args) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexRow, { justifyContent: "flex-start", children: [
|
|
41
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_flexbox.FlexCol, { marginX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ButtonEx.ButtonEx, { ...args, children: "Default" }) }),
|
|
42
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_flexbox.FlexCol, { marginX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ButtonEx.ButtonEx, { variant: "outlined", ...args, children: "Outlined" }) }),
|
|
43
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_flexbox.FlexCol, { marginX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ButtonEx.ButtonEx, { variant: "contained", ...args, children: "Contained" }) })
|
|
44
|
+
] });
|
|
45
|
+
const Default = DefaultTemplate.bind({});
|
|
46
|
+
Default.args = {};
|
|
47
|
+
const BusyCircular = DefaultTemplate.bind({});
|
|
48
|
+
BusyCircular.args = { busy: true, busyVariant: "circular" };
|
|
49
|
+
const BusyLinear = DefaultTemplate.bind({});
|
|
50
|
+
BusyLinear.args = { busy: true, busyVariant: "linear" };
|
|
51
|
+
var ButtonEx_stories_default = StorybookEntry;
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
BusyCircular,
|
|
55
|
+
BusyLinear,
|
|
56
|
+
Default
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=ButtonEx.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/ButtonEx.stories.tsx"],"sourcesContent":["import { Meta, StoryFn } from '@storybook/react'\nimport { FlexCol, FlexRow } from '@xylabs/react-flexbox'\n\nimport { ButtonEx } from './ButtonEx'\n\nconst StorybookEntry = {\n argTypes: {},\n component: ButtonEx,\n parameters: {\n docs: {\n page: null,\n },\n },\n title: 'button/ButtonEx',\n} as Meta<typeof ButtonEx>\n\nconst DefaultTemplate: StoryFn<typeof ButtonEx> = (args) => (\n <FlexRow justifyContent=\"flex-start\">\n <FlexCol marginX={1}>\n <ButtonEx {...args}>Default</ButtonEx>\n </FlexCol>\n <FlexCol marginX={1}>\n <ButtonEx variant=\"outlined\" {...args}>\n Outlined\n </ButtonEx>\n </FlexCol>\n <FlexCol marginX={1}>\n <ButtonEx variant=\"contained\" {...args}>\n Contained\n </ButtonEx>\n </FlexCol>\n </FlexRow>\n)\n\nconst Default = DefaultTemplate.bind({})\nDefault.args = {}\n\nconst BusyCircular = DefaultTemplate.bind({})\nBusyCircular.args = { busy: true, busyVariant: 'circular' }\n\nconst BusyLinear = DefaultTemplate.bind({})\nBusyLinear.args = { busy: true, busyVariant: 'linear' }\n\nexport { BusyCircular, BusyLinear, Default }\n// eslint-disable-next-line import/no-default-export\nexport default StorybookEntry\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBE;AAhBF,2BAAiC;AAEjC,sBAAyB;AAEzB,MAAM,iBAAiB;AAAA,EACrB,UAAU,CAAC;AAAA,EACX,WAAW;AAAA,EACX,YAAY;AAAA,IACV,MAAM;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,OAAO;AACT;AAEA,MAAM,kBAA4C,CAAC,SACjD,6CAAC,gCAAQ,gBAAe,cACtB;AAAA,8CAAC,gCAAQ,SAAS,GAChB,sDAAC,4BAAU,GAAG,MAAM,qBAAO,GAC7B;AAAA,EACA,4CAAC,gCAAQ,SAAS,GAChB,sDAAC,4BAAS,SAAQ,YAAY,GAAG,MAAM,sBAEvC,GACF;AAAA,EACA,4CAAC,gCAAQ,SAAS,GAChB,sDAAC,4BAAS,SAAQ,aAAa,GAAG,MAAM,uBAExC,GACF;AAAA,GACF;AAGF,MAAM,UAAU,gBAAgB,KAAK,CAAC,CAAC;AACvC,QAAQ,OAAO,CAAC;AAEhB,MAAM,eAAe,gBAAgB,KAAK,CAAC,CAAC;AAC5C,aAAa,OAAO,EAAE,MAAM,MAAM,aAAa,WAAW;AAE1D,MAAM,aAAa,gBAAgB,KAAK,CAAC,CAAC;AAC1C,WAAW,OAAO,EAAE,MAAM,MAAM,aAAa,SAAS;AAItD,IAAO,2BAAQ;","names":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FlexCol, FlexRow } from "@xylabs/react-flexbox";
|
|
3
|
+
import { ButtonEx } from "./ButtonEx";
|
|
4
|
+
const StorybookEntry = {
|
|
5
|
+
argTypes: {},
|
|
6
|
+
component: ButtonEx,
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: {
|
|
9
|
+
page: null
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
title: "button/ButtonEx"
|
|
13
|
+
};
|
|
14
|
+
const DefaultTemplate = (args) => /* @__PURE__ */ jsxs(FlexRow, { justifyContent: "flex-start", children: [
|
|
15
|
+
/* @__PURE__ */ jsx(FlexCol, { marginX: 1, children: /* @__PURE__ */ jsx(ButtonEx, { ...args, children: "Default" }) }),
|
|
16
|
+
/* @__PURE__ */ jsx(FlexCol, { marginX: 1, children: /* @__PURE__ */ jsx(ButtonEx, { variant: "outlined", ...args, children: "Outlined" }) }),
|
|
17
|
+
/* @__PURE__ */ jsx(FlexCol, { marginX: 1, children: /* @__PURE__ */ jsx(ButtonEx, { variant: "contained", ...args, children: "Contained" }) })
|
|
18
|
+
] });
|
|
19
|
+
const Default = DefaultTemplate.bind({});
|
|
20
|
+
Default.args = {};
|
|
21
|
+
const BusyCircular = DefaultTemplate.bind({});
|
|
22
|
+
BusyCircular.args = { busy: true, busyVariant: "circular" };
|
|
23
|
+
const BusyLinear = DefaultTemplate.bind({});
|
|
24
|
+
BusyLinear.args = { busy: true, busyVariant: "linear" };
|
|
25
|
+
var ButtonEx_stories_default = StorybookEntry;
|
|
26
|
+
export {
|
|
27
|
+
BusyCircular,
|
|
28
|
+
BusyLinear,
|
|
29
|
+
Default,
|
|
30
|
+
ButtonEx_stories_default as default
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=ButtonEx.stories.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/ButtonEx.stories.tsx"],"sourcesContent":["import { Meta, StoryFn } from '@storybook/react'\nimport { FlexCol, FlexRow } from '@xylabs/react-flexbox'\n\nimport { ButtonEx } from './ButtonEx'\n\nconst StorybookEntry = {\n argTypes: {},\n component: ButtonEx,\n parameters: {\n docs: {\n page: null,\n },\n },\n title: 'button/ButtonEx',\n} as Meta<typeof ButtonEx>\n\nconst DefaultTemplate: StoryFn<typeof ButtonEx> = (args) => (\n <FlexRow justifyContent=\"flex-start\">\n <FlexCol marginX={1}>\n <ButtonEx {...args}>Default</ButtonEx>\n </FlexCol>\n <FlexCol marginX={1}>\n <ButtonEx variant=\"outlined\" {...args}>\n Outlined\n </ButtonEx>\n </FlexCol>\n <FlexCol marginX={1}>\n <ButtonEx variant=\"contained\" {...args}>\n Contained\n </ButtonEx>\n </FlexCol>\n </FlexRow>\n)\n\nconst Default = DefaultTemplate.bind({})\nDefault.args = {}\n\nconst BusyCircular = DefaultTemplate.bind({})\nBusyCircular.args = { busy: true, busyVariant: 'circular' }\n\nconst BusyLinear = DefaultTemplate.bind({})\nBusyLinear.args = { busy: true, busyVariant: 'linear' }\n\nexport { BusyCircular, BusyLinear, Default }\n// eslint-disable-next-line import/no-default-export\nexport default StorybookEntry\n"],"mappings":"AAiBE,SAEI,KAFJ;AAhBF,SAAS,SAAS,eAAe;AAEjC,SAAS,gBAAgB;AAEzB,MAAM,iBAAiB;AAAA,EACrB,UAAU,CAAC;AAAA,EACX,WAAW;AAAA,EACX,YAAY;AAAA,IACV,MAAM;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,OAAO;AACT;AAEA,MAAM,kBAA4C,CAAC,SACjD,qBAAC,WAAQ,gBAAe,cACtB;AAAA,sBAAC,WAAQ,SAAS,GAChB,8BAAC,YAAU,GAAG,MAAM,qBAAO,GAC7B;AAAA,EACA,oBAAC,WAAQ,SAAS,GAChB,8BAAC,YAAS,SAAQ,YAAY,GAAG,MAAM,sBAEvC,GACF;AAAA,EACA,oBAAC,WAAQ,SAAS,GAChB,8BAAC,YAAS,SAAQ,aAAa,GAAG,MAAM,uBAExC,GACF;AAAA,GACF;AAGF,MAAM,UAAU,gBAAgB,KAAK,CAAC,CAAC;AACvC,QAAQ,OAAO,CAAC;AAEhB,MAAM,eAAe,gBAAgB,KAAK,CAAC,CAAC;AAC5C,aAAa,OAAO,EAAE,MAAM,MAAM,aAAa,WAAW;AAE1D,MAAM,aAAa,gBAAgB,KAAK,CAAC,CAAC;AAC1C,WAAW,OAAO,EAAE,MAAM,MAAM,aAAa,SAAS;AAItD,IAAO,2BAAQ;","names":[]}
|
|
@@ -0,0 +1,47 @@
|
|
|
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 ButtonExBase_exports = {};
|
|
20
|
+
__export(ButtonExBase_exports, {
|
|
21
|
+
ButtonExBase: () => ButtonExBase
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(ButtonExBase_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_material = require("@mui/material");
|
|
26
|
+
var import_react_shared = require("@xylabs/react-shared");
|
|
27
|
+
var import_react = require("react");
|
|
28
|
+
const ButtonExBase = (0, import_react.forwardRef)((props, ref) => {
|
|
29
|
+
const theme = (0, import_material.useTheme)();
|
|
30
|
+
const { busy, busyVariant = "linear", busyOpacity, onClick, children, ...rootProps } = (0, import_react_shared.mergeBoxlikeStyles)(theme, props);
|
|
31
|
+
const localOnClick = (event) => {
|
|
32
|
+
if (!busy) {
|
|
33
|
+
onClick?.(event);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Button, { ref, onClick: localOnClick, ...rootProps, children: [
|
|
37
|
+
busy && busyVariant === "linear" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_shared.BusyLinearProgress, { rounded: true, opacity: busyOpacity ?? 0 }) : null,
|
|
38
|
+
busy && busyVariant === "circular" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_shared.BusyCircularProgress, { rounded: true, size: 24, opacity: busyOpacity ?? 0.5 }) : null,
|
|
39
|
+
children
|
|
40
|
+
] });
|
|
41
|
+
});
|
|
42
|
+
ButtonExBase.displayName = "ButtonExBaseXYLabs";
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
ButtonExBase
|
|
46
|
+
});
|
|
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,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,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,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,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,8 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FlexCol, FlexRow } from "@xylabs/react-flexbox";
|
|
3
|
+
import { ButtonEx } from "./ButtonEx";
|
|
4
|
+
const StorybookEntry = {
|
|
5
|
+
argTypes: {},
|
|
6
|
+
component: ButtonEx,
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: {
|
|
9
|
+
page: null
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
title: "button/ButtonEx"
|
|
13
|
+
};
|
|
14
|
+
const DefaultTemplate = (args) => /* @__PURE__ */ jsxs(FlexRow, { justifyContent: "flex-start", children: [
|
|
15
|
+
/* @__PURE__ */ jsx(FlexCol, { marginX: 1, children: /* @__PURE__ */ jsx(ButtonEx, { ...args, children: "Default" }) }),
|
|
16
|
+
/* @__PURE__ */ jsx(FlexCol, { marginX: 1, children: /* @__PURE__ */ jsx(ButtonEx, { variant: "outlined", ...args, children: "Outlined" }) }),
|
|
17
|
+
/* @__PURE__ */ jsx(FlexCol, { marginX: 1, children: /* @__PURE__ */ jsx(ButtonEx, { variant: "contained", ...args, children: "Contained" }) })
|
|
18
|
+
] });
|
|
19
|
+
const Default = DefaultTemplate.bind({});
|
|
20
|
+
Default.args = {};
|
|
21
|
+
const BusyCircular = DefaultTemplate.bind({});
|
|
22
|
+
BusyCircular.args = { busy: true, busyVariant: "circular" };
|
|
23
|
+
const BusyLinear = DefaultTemplate.bind({});
|
|
24
|
+
BusyLinear.args = { busy: true, busyVariant: "linear" };
|
|
25
|
+
var ButtonEx_stories_default = StorybookEntry;
|
|
26
|
+
export {
|
|
27
|
+
BusyCircular,
|
|
28
|
+
BusyLinear,
|
|
29
|
+
Default,
|
|
30
|
+
ButtonEx_stories_default as default
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=ButtonEx.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ButtonEx.stories.tsx"],"sourcesContent":["import { Meta, StoryFn } from '@storybook/react'\nimport { FlexCol, FlexRow } from '@xylabs/react-flexbox'\n\nimport { ButtonEx } from './ButtonEx'\n\nconst StorybookEntry = {\n argTypes: {},\n component: ButtonEx,\n parameters: {\n docs: {\n page: null,\n },\n },\n title: 'button/ButtonEx',\n} as Meta<typeof ButtonEx>\n\nconst DefaultTemplate: StoryFn<typeof ButtonEx> = (args) => (\n <FlexRow justifyContent=\"flex-start\">\n <FlexCol marginX={1}>\n <ButtonEx {...args}>Default</ButtonEx>\n </FlexCol>\n <FlexCol marginX={1}>\n <ButtonEx variant=\"outlined\" {...args}>\n Outlined\n </ButtonEx>\n </FlexCol>\n <FlexCol marginX={1}>\n <ButtonEx variant=\"contained\" {...args}>\n Contained\n </ButtonEx>\n </FlexCol>\n </FlexRow>\n)\n\nconst Default = DefaultTemplate.bind({})\nDefault.args = {}\n\nconst BusyCircular = DefaultTemplate.bind({})\nBusyCircular.args = { busy: true, busyVariant: 'circular' }\n\nconst BusyLinear = DefaultTemplate.bind({})\nBusyLinear.args = { busy: true, busyVariant: 'linear' }\n\nexport { BusyCircular, BusyLinear, Default }\n// eslint-disable-next-line import/no-default-export\nexport default StorybookEntry\n"],"mappings":"AAiBE,SAEI,KAFJ;AAhBF,SAAS,SAAS,eAAe;AAEjC,SAAS,gBAAgB;AAEzB,MAAM,iBAAiB;AAAA,EACrB,UAAU,CAAC;AAAA,EACX,WAAW;AAAA,EACX,YAAY;AAAA,IACV,MAAM;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,OAAO;AACT;AAEA,MAAM,kBAA4C,CAAC,SACjD,qBAAC,WAAQ,gBAAe,cACtB;AAAA,sBAAC,WAAQ,SAAS,GAChB,8BAAC,YAAU,GAAG,MAAM,qBAAO,GAC7B;AAAA,EACA,oBAAC,WAAQ,SAAS,GAChB,8BAAC,YAAS,SAAQ,YAAY,GAAG,MAAM,sBAEvC,GACF;AAAA,EACA,oBAAC,WAAQ,SAAS,GAChB,8BAAC,YAAS,SAAQ,aAAa,GAAG,MAAM,uBAExC,GACF;AAAA,GACF;AAGF,MAAM,UAAU,gBAAgB,KAAK,CAAC,CAAC;AACvC,QAAQ,OAAO,CAAC;AAEhB,MAAM,eAAe,gBAAgB,KAAK,CAAC,CAAC;AAC5C,aAAa,OAAO,EAAE,MAAM,MAAM,aAAa,WAAW;AAE1D,MAAM,aAAa,gBAAgB,KAAK,CAAC,CAAC;AAC1C,WAAW,OAAO,EAAE,MAAM,MAAM,aAAa,SAAS;AAItD,IAAO,2BAAQ;","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,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,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,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,"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,"sources":["../../src/index.ts"],"sourcesContent":["export * from './components'\n"],"mappings":"AAAA,cAAc;","names":[]}
|
package/dist/index.js
CHANGED
|
@@ -3,10 +3,6 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
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
6
|
var __copyProps = (to, from, except, desc) => {
|
|
11
7
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
8
|
for (let key of __getOwnPropNames(from))
|
|
@@ -15,67 +11,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
11
|
}
|
|
16
12
|
return to;
|
|
17
13
|
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
15
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
16
|
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
ButtonEx: () => ButtonEx
|
|
24
|
-
});
|
|
25
17
|
module.exports = __toCommonJS(src_exports);
|
|
26
|
-
|
|
27
|
-
// src/components/ButtonEx.tsx
|
|
28
|
-
var import_react3 = require("react");
|
|
29
|
-
|
|
30
|
-
// src/components/ButtonExBase.tsx
|
|
31
|
-
var import_material = require("@mui/material");
|
|
32
|
-
var import_react_shared = require("@xylabs/react-shared");
|
|
33
|
-
var import_react = require("react");
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
-
var ButtonExBase = (0, import_react.forwardRef)((props, ref) => {
|
|
36
|
-
const theme = (0, import_material.useTheme)();
|
|
37
|
-
const { busy, busyVariant = "linear", busyOpacity, onClick, children, ...rootProps } = (0, import_react_shared.mergeBoxlikeStyles)(theme, props);
|
|
38
|
-
const localOnClick = (event) => {
|
|
39
|
-
if (!busy) {
|
|
40
|
-
onClick?.(event);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Button, { ref, onClick: localOnClick, ...rootProps, children: [
|
|
44
|
-
busy && busyVariant === "linear" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_shared.BusyLinearProgress, { rounded: true, opacity: busyOpacity ?? 0 }) : null,
|
|
45
|
-
busy && busyVariant === "circular" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_shared.BusyCircularProgress, { rounded: true, size: 24, opacity: busyOpacity ?? 0.5 }) : null,
|
|
46
|
-
children
|
|
47
|
-
] });
|
|
48
|
-
});
|
|
49
|
-
ButtonExBase.displayName = "ButtonExBaseXYLabs";
|
|
50
|
-
|
|
51
|
-
// src/components/ButtonExTo.tsx
|
|
52
|
-
var import_react2 = require("react");
|
|
53
|
-
var import_react_router_dom = require("react-router-dom");
|
|
54
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
55
|
-
var 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";
|
|
18
|
+
__reExport(src_exports, require("./components"), module.exports);
|
|
77
19
|
// Annotate the CommonJS export names for ESM import in node:
|
|
78
20
|
0 && (module.exports = {
|
|
79
|
-
|
|
21
|
+
...require("./components")
|
|
80
22
|
});
|
|
81
23
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './components'\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,yBAAd;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,54 +1,2 @@
|
|
|
1
|
-
|
|
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
|
-
};
|
|
1
|
+
export * from "./components";
|
|
54
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/
|
|
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.4"
|
|
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.4",
|
|
23
|
+
"@xylabs/ts-scripts-yarn3": "^3.0.36",
|
|
24
|
+
"@xylabs/tsconfig-react": "^3.0.36",
|
|
25
25
|
"react": "^18.2.0",
|
|
26
26
|
"react-dom": "^18.2.0",
|
|
27
27
|
"react-router-dom": "^6.16.0",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
},
|
|
48
48
|
"browser": {
|
|
49
49
|
"import": {
|
|
50
|
-
"types": "./dist/index.d.
|
|
51
|
-
"default": "./dist/index.
|
|
50
|
+
"types": "./dist/esm/index.d.ts",
|
|
51
|
+
"default": "./dist/esm/index.js"
|
|
52
52
|
},
|
|
53
53
|
"require": {
|
|
54
54
|
"types": "./dist/index.d.ts",
|
|
@@ -80,6 +80,6 @@
|
|
|
80
80
|
},
|
|
81
81
|
"sideEffects": false,
|
|
82
82
|
"types": "dist/index.d.ts",
|
|
83
|
-
"version": "3.1.0-rc.
|
|
83
|
+
"version": "3.1.0-rc.4",
|
|
84
84
|
"stableVersion": "3.0.0"
|
|
85
85
|
}
|