@elliemae/ds-button-group 3.0.0-next.1 → 3.0.0-next.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/cjs/DSButtonGroup.js +94 -0
- package/dist/cjs/DSButtonGroup.js.map +7 -0
- package/dist/cjs/defaultProps.js +39 -0
- package/dist/cjs/defaultProps.js.map +7 -0
- package/dist/cjs/index.js +36 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/esm/DSButtonGroup.js +67 -0
- package/dist/esm/DSButtonGroup.js.map +7 -0
- package/dist/esm/defaultProps.js +10 -0
- package/dist/esm/defaultProps.js.map +7 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +7 -0
- package/package.json +33 -23
- package/cjs/DSButtonGroup.js +0 -107
- package/cjs/defaultProps.js +0 -11
- package/cjs/index.js +0 -11
- package/esm/DSButtonGroup.js +0 -95
- package/esm/defaultProps.js +0 -7
- package/esm/index.js +0 -1
- package/types/DSButtonGroup.d.ts +0 -91
- package/types/defaultProps.d.ts +0 -5
- package/types/index.d.ts +0 -2
- package/types/tests/DSButtonGroup.events.test.d.ts +0 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
21
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
22
|
+
var __export = (target, all) => {
|
|
23
|
+
for (var name in all)
|
|
24
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
25
|
+
};
|
|
26
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
27
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
28
|
+
for (let key of __getOwnPropNames(module2))
|
|
29
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
30
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
31
|
+
}
|
|
32
|
+
return target;
|
|
33
|
+
};
|
|
34
|
+
var __toESM = (module2, isNodeMode) => {
|
|
35
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
36
|
+
};
|
|
37
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
38
|
+
return (module2, temp) => {
|
|
39
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
40
|
+
};
|
|
41
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
42
|
+
var DSButtonGroup_exports = {};
|
|
43
|
+
__export(DSButtonGroup_exports, {
|
|
44
|
+
DSButtonGroup: () => DSButtonGroup,
|
|
45
|
+
DSButtonGroupWithSchema: () => DSButtonGroupWithSchema,
|
|
46
|
+
default: () => DSButtonGroup_default
|
|
47
|
+
});
|
|
48
|
+
var React = __toESM(require("react"));
|
|
49
|
+
var import_react = __toESM(require("react"));
|
|
50
|
+
var import_react_desc = require("react-desc");
|
|
51
|
+
var import_ds_classnames = require("@elliemae/ds-classnames");
|
|
52
|
+
var import_ds_button = __toESM(require("@elliemae/ds-button"));
|
|
53
|
+
var import_prop_types = require("@elliemae/ds-shared/prop-types");
|
|
54
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
55
|
+
var import_defaultProps = require("./defaultProps");
|
|
56
|
+
const blockName = "button-group";
|
|
57
|
+
const GroupContainer = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, null, ({ vertical, horizontal, spacing }) => ({
|
|
58
|
+
vertical,
|
|
59
|
+
horizontal,
|
|
60
|
+
[spacing]: spacing
|
|
61
|
+
}));
|
|
62
|
+
const DSButtonGroup = ({ size, buttonType, orientation, spacing, children: buttons, containerProps }) => {
|
|
63
|
+
(0, import_ds_props_helpers.useDeprecateComponent)({ componentName: "ds-button-group", version: "3.x" });
|
|
64
|
+
return /* @__PURE__ */ import_react.default.createElement(GroupContainer, __spreadValues({
|
|
65
|
+
classProps: {
|
|
66
|
+
vertical: orientation === "vertical",
|
|
67
|
+
horizontal: orientation !== "vertical",
|
|
68
|
+
spacing
|
|
69
|
+
}
|
|
70
|
+
}, containerProps), import_react.default.Children.map(buttons, (button) => import_react.default.cloneElement(button, __spreadValues({
|
|
71
|
+
buttonType,
|
|
72
|
+
size
|
|
73
|
+
}, button.props)), null));
|
|
74
|
+
};
|
|
75
|
+
DSButtonGroup.defaultProps = {
|
|
76
|
+
size: "m",
|
|
77
|
+
buttonType: "secondary",
|
|
78
|
+
orientation: "horizontal"
|
|
79
|
+
};
|
|
80
|
+
const props = {
|
|
81
|
+
containerProps: import_react_desc.PropTypes.shape({}).description("props injected to wrapper of page header"),
|
|
82
|
+
size: import_react_desc.PropTypes.oneOf(import_prop_types.dsBasicSizes).description("['s', 'm', 'l']"),
|
|
83
|
+
buttonType: import_react_desc.PropTypes.oneOf(import_ds_button.buttonTypes).description("['primary', 'secondary', 'text', 'link']"),
|
|
84
|
+
orientation: import_react_desc.PropTypes.oneOf(import_prop_types.orientation).description("['horizontal', 'vertical']"),
|
|
85
|
+
spacing: import_react_desc.PropTypes.oneOf(import_prop_types.dsBasicSizes).description("['s', 'm', 'l']"),
|
|
86
|
+
children: import_react_desc.PropTypes.arrayOf(import_ds_button.default).description("Button group items to show of type DSButton")
|
|
87
|
+
};
|
|
88
|
+
DSButtonGroup.defaultProps = import_defaultProps.defaultProps;
|
|
89
|
+
DSButtonGroup.propTypes = props;
|
|
90
|
+
const DSButtonGroupWithSchema = (0, import_react_desc.describe)(DSButtonGroup);
|
|
91
|
+
DSButtonGroupWithSchema.propTypes = props;
|
|
92
|
+
var DSButtonGroup_default = DSButtonGroup;
|
|
93
|
+
module.exports = __toCommonJS(DSButtonGroup_exports);
|
|
94
|
+
//# sourceMappingURL=DSButtonGroup.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSButtonGroup.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport DSButton, { buttonTypes } from '@elliemae/ds-button';\nimport { dsBasicSizes, orientation as buttonGroupOrientation } from '@elliemae/ds-shared/prop-types';\nimport { useDeprecateComponent } from '@elliemae/ds-props-helpers';\nimport { defaultProps } from './defaultProps';\n\nconst blockName = 'button-group';\n\nconst GroupContainer = aggregatedClasses('div')(blockName, null, ({ vertical, horizontal, spacing }) => ({\n vertical,\n horizontal,\n [spacing]: spacing,\n}));\n\nconst DSButtonGroup = ({ size, buttonType, orientation, spacing, children: buttons, containerProps }) => {\n useDeprecateComponent({ componentName: 'ds-button-group', version: '3.x' });\n\n return (\n <GroupContainer\n classProps={{\n vertical: orientation === 'vertical',\n horizontal: orientation !== 'vertical',\n spacing,\n }}\n {...containerProps}\n >\n {React.Children.map(\n buttons,\n (button) =>\n React.cloneElement(button, {\n buttonType,\n size,\n // Keeping it this way to allow individual Buttons to override group props\n // [buttonType | size]\n ...button.props,\n }),\n null,\n )}\n </GroupContainer>\n );\n};\n\nDSButtonGroup.defaultProps = {\n size: 'm',\n buttonType: 'secondary',\n orientation: 'horizontal',\n};\n\nconst props = {\n /** props injected to wrapper of page header */\n containerProps: PropTypes.shape({}).description('props injected to wrapper of page header'),\n /**\n * ['s', 'm', 'l']\n */\n size: PropTypes.oneOf(dsBasicSizes).description(\"['s', 'm', 'l']\"),\n /**\n * ['primary', 'secondary', 'text', 'link']\n */\n buttonType: PropTypes.oneOf(buttonTypes).description(\"['primary', 'secondary', 'text', 'link']\"),\n /**\n * ['horizontal', 'vertical']\n */\n orientation: PropTypes.oneOf(buttonGroupOrientation).description(\"['horizontal', 'vertical']\"),\n /**\n * ['s', 'm', 'l']\n */\n spacing: PropTypes.oneOf(dsBasicSizes).description(\"['s', 'm', 'l']\"),\n /**\n * Button group items to show of type DSButton\n */\n children: PropTypes.arrayOf(DSButton).description('Button group items to show of type DSButton'),\n};\n\nDSButtonGroup.defaultProps = defaultProps;\n\nDSButtonGroup.propTypes = props;\n\nconst DSButtonGroupWithSchema = describe(DSButtonGroup);\n\nDSButtonGroupWithSchema.propTypes = props;\n\nexport { DSButtonGroup, DSButtonGroupWithSchema };\nexport default DSButtonGroup;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAoC;AACpC,2BAAkC;AAClC,uBAAsC;AACtC,wBAAoE;AACpE,8BAAsC;AACtC,0BAA6B;AAE7B,MAAM,YAAY;AAElB,MAAM,iBAAiB,4CAAkB,OAAO,WAAW,MAAM,CAAC,EAAE,UAAU,YAAY,cAAe;AAAA,EACvG;AAAA,EACA;AAAA,GACC,UAAU;AAAA;AAGb,MAAM,gBAAgB,CAAC,EAAE,MAAM,YAAY,aAAa,SAAS,UAAU,SAAS,qBAAqB;AACvG,qDAAsB,EAAE,eAAe,mBAAmB,SAAS;AAEnE,SACE,mDAAC,gBAAD;AAAA,IACE,YAAY;AAAA,MACV,UAAU,gBAAgB;AAAA,MAC1B,YAAY,gBAAgB;AAAA,MAC5B;AAAA;AAAA,KAEE,iBAEH,qBAAM,SAAS,IACd,SACA,CAAC,WACC,qBAAM,aAAa,QAAQ;AAAA,IACzB;AAAA,IACA;AAAA,KAGG,OAAO,SAEd;AAAA;AAMR,cAAc,eAAe;AAAA,EAC3B,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,aAAa;AAAA;AAGf,MAAM,QAAQ;AAAA,EAEZ,gBAAgB,4BAAU,MAAM,IAAI,YAAY;AAAA,EAIhD,MAAM,4BAAU,MAAM,gCAAc,YAAY;AAAA,EAIhD,YAAY,4BAAU,MAAM,8BAAa,YAAY;AAAA,EAIrD,aAAa,4BAAU,MAAM,+BAAwB,YAAY;AAAA,EAIjE,SAAS,4BAAU,MAAM,gCAAc,YAAY;AAAA,EAInD,UAAU,4BAAU,QAAQ,0BAAU,YAAY;AAAA;AAGpD,cAAc,eAAe;AAE7B,cAAc,YAAY;AAE1B,MAAM,0BAA0B,gCAAS;AAEzC,wBAAwB,YAAY;AAGpC,IAAO,wBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var defaultProps_exports = {};
|
|
29
|
+
__export(defaultProps_exports, {
|
|
30
|
+
defaultProps: () => defaultProps
|
|
31
|
+
});
|
|
32
|
+
var React = __toESM(require("react"));
|
|
33
|
+
const defaultProps = {
|
|
34
|
+
spacing: null,
|
|
35
|
+
children: [],
|
|
36
|
+
containerProps: {}
|
|
37
|
+
};
|
|
38
|
+
module.exports = __toCommonJS(defaultProps_exports);
|
|
39
|
+
//# sourceMappingURL=defaultProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/defaultProps.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export const defaultProps = {\n spacing: null,\n children: [],\n containerProps: {},\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,eAAe;AAAA,EAC1B,SAAS;AAAA,EACT,UAAU;AAAA,EACV,gBAAgB;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var src_exports = {};
|
|
29
|
+
__export(src_exports, {
|
|
30
|
+
default: () => import_DSButtonGroup.default
|
|
31
|
+
});
|
|
32
|
+
var React = __toESM(require("react"));
|
|
33
|
+
__reExport(src_exports, require("./DSButtonGroup"));
|
|
34
|
+
var import_DSButtonGroup = __toESM(require("./DSButtonGroup"));
|
|
35
|
+
module.exports = __toCommonJS(src_exports);
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export * from './DSButtonGroup';\nexport { default } from './DSButtonGroup';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc;AACd,2BAAwB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
import * as React from "react";
|
|
18
|
+
import React2 from "react";
|
|
19
|
+
import { PropTypes, describe } from "react-desc";
|
|
20
|
+
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
21
|
+
import DSButton, { buttonTypes } from "@elliemae/ds-button";
|
|
22
|
+
import { dsBasicSizes, orientation as buttonGroupOrientation } from "@elliemae/ds-shared/prop-types";
|
|
23
|
+
import { useDeprecateComponent } from "@elliemae/ds-props-helpers";
|
|
24
|
+
import { defaultProps } from "./defaultProps";
|
|
25
|
+
const blockName = "button-group";
|
|
26
|
+
const GroupContainer = aggregatedClasses("div")(blockName, null, ({ vertical, horizontal, spacing }) => ({
|
|
27
|
+
vertical,
|
|
28
|
+
horizontal,
|
|
29
|
+
[spacing]: spacing
|
|
30
|
+
}));
|
|
31
|
+
const DSButtonGroup = ({ size, buttonType, orientation, spacing, children: buttons, containerProps }) => {
|
|
32
|
+
useDeprecateComponent({ componentName: "ds-button-group", version: "3.x" });
|
|
33
|
+
return /* @__PURE__ */ React2.createElement(GroupContainer, __spreadValues({
|
|
34
|
+
classProps: {
|
|
35
|
+
vertical: orientation === "vertical",
|
|
36
|
+
horizontal: orientation !== "vertical",
|
|
37
|
+
spacing
|
|
38
|
+
}
|
|
39
|
+
}, containerProps), React2.Children.map(buttons, (button) => React2.cloneElement(button, __spreadValues({
|
|
40
|
+
buttonType,
|
|
41
|
+
size
|
|
42
|
+
}, button.props)), null));
|
|
43
|
+
};
|
|
44
|
+
DSButtonGroup.defaultProps = {
|
|
45
|
+
size: "m",
|
|
46
|
+
buttonType: "secondary",
|
|
47
|
+
orientation: "horizontal"
|
|
48
|
+
};
|
|
49
|
+
const props = {
|
|
50
|
+
containerProps: PropTypes.shape({}).description("props injected to wrapper of page header"),
|
|
51
|
+
size: PropTypes.oneOf(dsBasicSizes).description("['s', 'm', 'l']"),
|
|
52
|
+
buttonType: PropTypes.oneOf(buttonTypes).description("['primary', 'secondary', 'text', 'link']"),
|
|
53
|
+
orientation: PropTypes.oneOf(buttonGroupOrientation).description("['horizontal', 'vertical']"),
|
|
54
|
+
spacing: PropTypes.oneOf(dsBasicSizes).description("['s', 'm', 'l']"),
|
|
55
|
+
children: PropTypes.arrayOf(DSButton).description("Button group items to show of type DSButton")
|
|
56
|
+
};
|
|
57
|
+
DSButtonGroup.defaultProps = defaultProps;
|
|
58
|
+
DSButtonGroup.propTypes = props;
|
|
59
|
+
const DSButtonGroupWithSchema = describe(DSButtonGroup);
|
|
60
|
+
DSButtonGroupWithSchema.propTypes = props;
|
|
61
|
+
var DSButtonGroup_default = DSButtonGroup;
|
|
62
|
+
export {
|
|
63
|
+
DSButtonGroup,
|
|
64
|
+
DSButtonGroupWithSchema,
|
|
65
|
+
DSButtonGroup_default as default
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=DSButtonGroup.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSButtonGroup.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport DSButton, { buttonTypes } from '@elliemae/ds-button';\nimport { dsBasicSizes, orientation as buttonGroupOrientation } from '@elliemae/ds-shared/prop-types';\nimport { useDeprecateComponent } from '@elliemae/ds-props-helpers';\nimport { defaultProps } from './defaultProps';\n\nconst blockName = 'button-group';\n\nconst GroupContainer = aggregatedClasses('div')(blockName, null, ({ vertical, horizontal, spacing }) => ({\n vertical,\n horizontal,\n [spacing]: spacing,\n}));\n\nconst DSButtonGroup = ({ size, buttonType, orientation, spacing, children: buttons, containerProps }) => {\n useDeprecateComponent({ componentName: 'ds-button-group', version: '3.x' });\n\n return (\n <GroupContainer\n classProps={{\n vertical: orientation === 'vertical',\n horizontal: orientation !== 'vertical',\n spacing,\n }}\n {...containerProps}\n >\n {React.Children.map(\n buttons,\n (button) =>\n React.cloneElement(button, {\n buttonType,\n size,\n // Keeping it this way to allow individual Buttons to override group props\n // [buttonType | size]\n ...button.props,\n }),\n null,\n )}\n </GroupContainer>\n );\n};\n\nDSButtonGroup.defaultProps = {\n size: 'm',\n buttonType: 'secondary',\n orientation: 'horizontal',\n};\n\nconst props = {\n /** props injected to wrapper of page header */\n containerProps: PropTypes.shape({}).description('props injected to wrapper of page header'),\n /**\n * ['s', 'm', 'l']\n */\n size: PropTypes.oneOf(dsBasicSizes).description(\"['s', 'm', 'l']\"),\n /**\n * ['primary', 'secondary', 'text', 'link']\n */\n buttonType: PropTypes.oneOf(buttonTypes).description(\"['primary', 'secondary', 'text', 'link']\"),\n /**\n * ['horizontal', 'vertical']\n */\n orientation: PropTypes.oneOf(buttonGroupOrientation).description(\"['horizontal', 'vertical']\"),\n /**\n * ['s', 'm', 'l']\n */\n spacing: PropTypes.oneOf(dsBasicSizes).description(\"['s', 'm', 'l']\"),\n /**\n * Button group items to show of type DSButton\n */\n children: PropTypes.arrayOf(DSButton).description('Button group items to show of type DSButton'),\n};\n\nDSButtonGroup.defaultProps = defaultProps;\n\nDSButtonGroup.propTypes = props;\n\nconst DSButtonGroupWithSchema = describe(DSButtonGroup);\n\nDSButtonGroupWithSchema.propTypes = props;\n\nexport { DSButtonGroup, DSButtonGroupWithSchema };\nexport default DSButtonGroup;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,YAAY;AAElB,MAAM,iBAAiB,kBAAkB,OAAO,WAAW,MAAM,CAAC,EAAE,UAAU,YAAY,cAAe;AAAA,EACvG;AAAA,EACA;AAAA,GACC,UAAU;AAAA;AAGb,MAAM,gBAAgB,CAAC,EAAE,MAAM,YAAY,aAAa,SAAS,UAAU,SAAS,qBAAqB;AACvG,wBAAsB,EAAE,eAAe,mBAAmB,SAAS;AAEnE,SACE,qCAAC,gBAAD;AAAA,IACE,YAAY;AAAA,MACV,UAAU,gBAAgB;AAAA,MAC1B,YAAY,gBAAgB;AAAA,MAC5B;AAAA;AAAA,KAEE,iBAEH,OAAM,SAAS,IACd,SACA,CAAC,WACC,OAAM,aAAa,QAAQ;AAAA,IACzB;AAAA,IACA;AAAA,KAGG,OAAO,SAEd;AAAA;AAMR,cAAc,eAAe;AAAA,EAC3B,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,aAAa;AAAA;AAGf,MAAM,QAAQ;AAAA,EAEZ,gBAAgB,UAAU,MAAM,IAAI,YAAY;AAAA,EAIhD,MAAM,UAAU,MAAM,cAAc,YAAY;AAAA,EAIhD,YAAY,UAAU,MAAM,aAAa,YAAY;AAAA,EAIrD,aAAa,UAAU,MAAM,wBAAwB,YAAY;AAAA,EAIjE,SAAS,UAAU,MAAM,cAAc,YAAY;AAAA,EAInD,UAAU,UAAU,QAAQ,UAAU,YAAY;AAAA;AAGpD,cAAc,eAAe;AAE7B,cAAc,YAAY;AAE1B,MAAM,0BAA0B,SAAS;AAEzC,wBAAwB,YAAY;AAGpC,IAAO,wBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/defaultProps.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const defaultProps = {\n spacing: null,\n children: [],\n containerProps: {},\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,eAAe;AAAA,EAC1B,SAAS;AAAA,EACT,UAAU;AAAA,EACV,gBAAgB;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSButtonGroup';\nexport { default } from './DSButtonGroup';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-button-group",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Button Group",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"module": "./dist/esm/index.js",
|
|
10
|
+
"main": "./dist/cjs/index.js",
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
9
12
|
"exports": {
|
|
10
13
|
".": {
|
|
11
|
-
"import": "./esm/index.js",
|
|
12
|
-
"require": "./cjs/index.js"
|
|
14
|
+
"import": "./dist/esm/index.js",
|
|
15
|
+
"require": "./dist/cjs/index.js"
|
|
13
16
|
},
|
|
14
17
|
"./DSButtonGroup": {
|
|
15
|
-
"import": "./esm/DSButtonGroup.js",
|
|
16
|
-
"require": "./cjs/DSButtonGroup.js"
|
|
18
|
+
"import": "./dist/esm/DSButtonGroup.js",
|
|
19
|
+
"require": "./dist/cjs/DSButtonGroup.js"
|
|
17
20
|
},
|
|
18
21
|
"./defaultProps": {
|
|
19
|
-
"import": "./esm/defaultProps.js",
|
|
20
|
-
"require": "./cjs/defaultProps.js"
|
|
22
|
+
"import": "./dist/esm/defaultProps.js",
|
|
23
|
+
"require": "./dist/cjs/defaultProps.js"
|
|
21
24
|
}
|
|
22
25
|
},
|
|
23
26
|
"sideEffects": [
|
|
@@ -29,24 +32,25 @@
|
|
|
29
32
|
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
30
33
|
},
|
|
31
34
|
"engines": {
|
|
32
|
-
"
|
|
33
|
-
"node": ">=
|
|
35
|
+
"pnpm": ">=6",
|
|
36
|
+
"node": ">=16"
|
|
34
37
|
},
|
|
35
38
|
"author": "ICE MT",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
39
|
+
"jestSonar": {
|
|
40
|
+
"sonar56x": true,
|
|
41
|
+
"reportPath": "reports",
|
|
42
|
+
"reportFile": "tests.xml",
|
|
43
|
+
"indent": 4
|
|
41
44
|
},
|
|
42
45
|
"dependencies": {
|
|
43
|
-
"@elliemae/ds-button": "3.0.0-next.
|
|
44
|
-
"@elliemae/ds-classnames": "3.0.0-next.
|
|
45
|
-
"@elliemae/ds-
|
|
46
|
+
"@elliemae/ds-button": "3.0.0-next.5",
|
|
47
|
+
"@elliemae/ds-classnames": "3.0.0-next.5",
|
|
48
|
+
"@elliemae/ds-props-helpers": "3.0.0-next.5",
|
|
49
|
+
"@elliemae/ds-shared": "3.0.0-next.5",
|
|
46
50
|
"react-desc": "~4.1.3"
|
|
47
51
|
},
|
|
48
52
|
"devDependencies": {
|
|
49
|
-
"@testing-library/jest-dom": "~5.
|
|
53
|
+
"@testing-library/jest-dom": "~5.16.2",
|
|
50
54
|
"@testing-library/react": "~12.1.2"
|
|
51
55
|
},
|
|
52
56
|
"peerDependencies": {
|
|
@@ -55,7 +59,13 @@
|
|
|
55
59
|
},
|
|
56
60
|
"publishConfig": {
|
|
57
61
|
"access": "public",
|
|
58
|
-
"
|
|
59
|
-
|
|
62
|
+
"typeSafety": false
|
|
63
|
+
},
|
|
64
|
+
"scripts": {
|
|
65
|
+
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
66
|
+
"test": "node ../../scripts/testing/test.mjs",
|
|
67
|
+
"lint": "node ../../scripts/lint.mjs",
|
|
68
|
+
"dts": "node ../../scripts/dts.mjs",
|
|
69
|
+
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
|
60
70
|
}
|
|
61
71
|
}
|
package/cjs/DSButtonGroup.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
-
require('core-js/modules/esnext.async-iterator.map.js');
|
|
7
|
-
require('core-js/modules/esnext.iterator.map.js');
|
|
8
|
-
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
9
|
-
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
-
require('core-js/modules/esnext.iterator.filter.js');
|
|
11
|
-
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
12
|
-
require('core-js/modules/esnext.iterator.for-each.js');
|
|
13
|
-
var React = require('react');
|
|
14
|
-
var reactDesc = require('react-desc');
|
|
15
|
-
var dsClassnames = require('@elliemae/ds-classnames');
|
|
16
|
-
var DSButton = require('@elliemae/ds-button');
|
|
17
|
-
var propTypes = require('@elliemae/ds-shared/prop-types');
|
|
18
|
-
var defaultProps = require('./defaultProps.js');
|
|
19
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
20
|
-
|
|
21
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
|
-
|
|
23
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
24
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
|
-
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
26
|
-
|
|
27
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
28
|
-
|
|
29
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
30
|
-
const blockName = 'button-group';
|
|
31
|
-
const GroupContainer = dsClassnames.aggregatedClasses('div')(blockName, null, _ref => {
|
|
32
|
-
let {
|
|
33
|
-
vertical,
|
|
34
|
-
horizontal,
|
|
35
|
-
spacing
|
|
36
|
-
} = _ref;
|
|
37
|
-
return {
|
|
38
|
-
vertical,
|
|
39
|
-
horizontal,
|
|
40
|
-
[spacing]: spacing
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
const DSButtonGroup = _ref2 => {
|
|
45
|
-
let {
|
|
46
|
-
size,
|
|
47
|
-
buttonType,
|
|
48
|
-
orientation,
|
|
49
|
-
spacing,
|
|
50
|
-
children: buttons,
|
|
51
|
-
containerProps
|
|
52
|
-
} = _ref2;
|
|
53
|
-
return /*#__PURE__*/jsxRuntime.jsx(GroupContainer, _objectSpread(_objectSpread({
|
|
54
|
-
classProps: {
|
|
55
|
-
vertical: orientation === 'vertical',
|
|
56
|
-
horizontal: orientation !== 'vertical',
|
|
57
|
-
spacing
|
|
58
|
-
}
|
|
59
|
-
}, containerProps), {}, {
|
|
60
|
-
children: React__default["default"].Children.map(buttons, button => /*#__PURE__*/React__default["default"].cloneElement(button, _objectSpread({
|
|
61
|
-
buttonType,
|
|
62
|
-
size
|
|
63
|
-
}, button.props)), null)
|
|
64
|
-
}));
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
DSButtonGroup.defaultProps = {
|
|
68
|
-
size: 'm',
|
|
69
|
-
buttonType: 'secondary',
|
|
70
|
-
orientation: 'horizontal'
|
|
71
|
-
};
|
|
72
|
-
const props = {
|
|
73
|
-
/** props injected to wrapper of page header */
|
|
74
|
-
containerProps: reactDesc.PropTypes.shape({}).description('props injected to wrapper of page header'),
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* ['s', 'm', 'l']
|
|
78
|
-
*/
|
|
79
|
-
size: reactDesc.PropTypes.oneOf(propTypes.dsBasicSizes).description("['s', 'm', 'l']"),
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* ['primary', 'secondary', 'text', 'link']
|
|
83
|
-
*/
|
|
84
|
-
buttonType: reactDesc.PropTypes.oneOf(DSButton.buttonTypes).description("['primary', 'secondary', 'text', 'link']"),
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* ['horizontal', 'vertical']
|
|
88
|
-
*/
|
|
89
|
-
orientation: reactDesc.PropTypes.oneOf(propTypes.orientation).description("['horizontal', 'vertical']"),
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* ['s', 'm', 'l']
|
|
93
|
-
*/
|
|
94
|
-
spacing: reactDesc.PropTypes.oneOf(propTypes.dsBasicSizes).description("['s', 'm', 'l']"),
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Button group items to show of type DSButton
|
|
98
|
-
*/
|
|
99
|
-
children: reactDesc.PropTypes.arrayOf(DSButton__default["default"]).description('Button group items to show of type DSButton')
|
|
100
|
-
};
|
|
101
|
-
DSButtonGroup.defaultProps = defaultProps.defaultProps;
|
|
102
|
-
const DSButtonGroupWithSchema = reactDesc.describe(DSButtonGroup);
|
|
103
|
-
DSButtonGroupWithSchema.propTypes = props;
|
|
104
|
-
|
|
105
|
-
exports.DSButtonGroup = DSButtonGroup;
|
|
106
|
-
exports.DSButtonGroupWithSchema = DSButtonGroupWithSchema;
|
|
107
|
-
exports["default"] = DSButtonGroup;
|
package/cjs/defaultProps.js
DELETED
package/cjs/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var DSButtonGroup = require('./DSButtonGroup.js');
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports.DSButtonGroup = DSButtonGroup.DSButtonGroup;
|
|
10
|
-
exports.DSButtonGroupWithSchema = DSButtonGroup.DSButtonGroupWithSchema;
|
|
11
|
-
exports["default"] = DSButtonGroup.DSButtonGroup;
|
package/esm/DSButtonGroup.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
-
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.map.js';
|
|
4
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
5
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
6
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
7
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
8
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import { PropTypes, describe } from 'react-desc';
|
|
11
|
-
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
12
|
-
import DSButton, { buttonTypes } from '@elliemae/ds-button';
|
|
13
|
-
import { dsBasicSizes, orientation } from '@elliemae/ds-shared/prop-types';
|
|
14
|
-
import { defaultProps } from './defaultProps.js';
|
|
15
|
-
import { jsx } from 'react/jsx-runtime';
|
|
16
|
-
|
|
17
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
|
-
|
|
19
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
20
|
-
const blockName = 'button-group';
|
|
21
|
-
const GroupContainer = aggregatedClasses('div')(blockName, null, _ref => {
|
|
22
|
-
let {
|
|
23
|
-
vertical,
|
|
24
|
-
horizontal,
|
|
25
|
-
spacing
|
|
26
|
-
} = _ref;
|
|
27
|
-
return {
|
|
28
|
-
vertical,
|
|
29
|
-
horizontal,
|
|
30
|
-
[spacing]: spacing
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
const DSButtonGroup = _ref2 => {
|
|
35
|
-
let {
|
|
36
|
-
size,
|
|
37
|
-
buttonType,
|
|
38
|
-
orientation,
|
|
39
|
-
spacing,
|
|
40
|
-
children: buttons,
|
|
41
|
-
containerProps
|
|
42
|
-
} = _ref2;
|
|
43
|
-
return /*#__PURE__*/jsx(GroupContainer, _objectSpread(_objectSpread({
|
|
44
|
-
classProps: {
|
|
45
|
-
vertical: orientation === 'vertical',
|
|
46
|
-
horizontal: orientation !== 'vertical',
|
|
47
|
-
spacing
|
|
48
|
-
}
|
|
49
|
-
}, containerProps), {}, {
|
|
50
|
-
children: React.Children.map(buttons, button => /*#__PURE__*/React.cloneElement(button, _objectSpread({
|
|
51
|
-
buttonType,
|
|
52
|
-
size
|
|
53
|
-
}, button.props)), null)
|
|
54
|
-
}));
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
DSButtonGroup.defaultProps = {
|
|
58
|
-
size: 'm',
|
|
59
|
-
buttonType: 'secondary',
|
|
60
|
-
orientation: 'horizontal'
|
|
61
|
-
};
|
|
62
|
-
const props = {
|
|
63
|
-
/** props injected to wrapper of page header */
|
|
64
|
-
containerProps: PropTypes.shape({}).description('props injected to wrapper of page header'),
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* ['s', 'm', 'l']
|
|
68
|
-
*/
|
|
69
|
-
size: PropTypes.oneOf(dsBasicSizes).description("['s', 'm', 'l']"),
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* ['primary', 'secondary', 'text', 'link']
|
|
73
|
-
*/
|
|
74
|
-
buttonType: PropTypes.oneOf(buttonTypes).description("['primary', 'secondary', 'text', 'link']"),
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* ['horizontal', 'vertical']
|
|
78
|
-
*/
|
|
79
|
-
orientation: PropTypes.oneOf(orientation).description("['horizontal', 'vertical']"),
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* ['s', 'm', 'l']
|
|
83
|
-
*/
|
|
84
|
-
spacing: PropTypes.oneOf(dsBasicSizes).description("['s', 'm', 'l']"),
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Button group items to show of type DSButton
|
|
88
|
-
*/
|
|
89
|
-
children: PropTypes.arrayOf(DSButton).description('Button group items to show of type DSButton')
|
|
90
|
-
};
|
|
91
|
-
DSButtonGroup.defaultProps = defaultProps;
|
|
92
|
-
const DSButtonGroupWithSchema = describe(DSButtonGroup);
|
|
93
|
-
DSButtonGroupWithSchema.propTypes = props;
|
|
94
|
-
|
|
95
|
-
export { DSButtonGroup, DSButtonGroupWithSchema, DSButtonGroup as default };
|
package/esm/defaultProps.js
DELETED
package/esm/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DSButtonGroup, DSButtonGroupWithSchema, DSButtonGroup as default } from './DSButtonGroup.js';
|
package/types/DSButtonGroup.d.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
|
-
declare const DSButtonGroup: {
|
|
4
|
-
({ size, buttonType, orientation, spacing, children: buttons, containerProps, }: {
|
|
5
|
-
size: any;
|
|
6
|
-
buttonType: any;
|
|
7
|
-
orientation: any;
|
|
8
|
-
spacing: any;
|
|
9
|
-
children: any;
|
|
10
|
-
containerProps: any;
|
|
11
|
-
}): JSX.Element;
|
|
12
|
-
defaultProps: {
|
|
13
|
-
spacing: null;
|
|
14
|
-
children: never[];
|
|
15
|
-
containerProps: {};
|
|
16
|
-
} | {
|
|
17
|
-
size: string;
|
|
18
|
-
buttonType: string;
|
|
19
|
-
orientation: string;
|
|
20
|
-
};
|
|
21
|
-
propTypes: {
|
|
22
|
-
/** props injected to wrapper of page header */
|
|
23
|
-
containerProps: {
|
|
24
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
25
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
26
|
-
};
|
|
27
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* ['s', 'm', 'l']
|
|
31
|
-
*/
|
|
32
|
-
size: {
|
|
33
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
34
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
35
|
-
};
|
|
36
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* ['primary', 'secondary', 'text', 'link']
|
|
40
|
-
*/
|
|
41
|
-
buttonType: {
|
|
42
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
43
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
44
|
-
};
|
|
45
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* ['horizontal', 'vertical']
|
|
49
|
-
*/
|
|
50
|
-
orientation: {
|
|
51
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
52
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
53
|
-
};
|
|
54
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* ['s', 'm', 'l']
|
|
58
|
-
*/
|
|
59
|
-
spacing: {
|
|
60
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
61
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
62
|
-
};
|
|
63
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Button group items to show of type DSButton
|
|
67
|
-
*/
|
|
68
|
-
children: {
|
|
69
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
70
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
71
|
-
};
|
|
72
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
declare const DSButtonGroupWithSchema: {
|
|
77
|
-
(props?: {
|
|
78
|
-
size: any;
|
|
79
|
-
buttonType: any;
|
|
80
|
-
orientation: any;
|
|
81
|
-
spacing: any;
|
|
82
|
-
children: any;
|
|
83
|
-
containerProps: any;
|
|
84
|
-
} | undefined): JSX.Element;
|
|
85
|
-
propTypes: unknown;
|
|
86
|
-
toTypescript: () => import("react-desc").TypescriptSchema; /**
|
|
87
|
-
* Button group items to show of type DSButton
|
|
88
|
-
*/
|
|
89
|
-
};
|
|
90
|
-
export { DSButtonGroup, DSButtonGroupWithSchema };
|
|
91
|
-
export default DSButtonGroup;
|
package/types/defaultProps.d.ts
DELETED
package/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|