@elliemae/ds-button-group 2.2.0 → 2.3.0-alpha.3

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.
@@ -1,107 +1,85 @@
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
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);
41
26
  };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var DSButtonGroup_exports = {};
29
+ __export(DSButtonGroup_exports, {
30
+ DSButtonGroup: () => DSButtonGroup,
31
+ DSButtonGroupWithSchema: () => DSButtonGroupWithSchema,
32
+ default: () => DSButtonGroup_default
42
33
  });
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
-
34
+ var React = __toESM(require("react"));
35
+ var import_react = __toESM(require("react"));
36
+ var import_react_desc = require("react-desc");
37
+ var import_ds_classnames = require("@elliemae/ds-classnames");
38
+ var import_ds_button = __toESM(require("@elliemae/ds-button"));
39
+ var import_prop_types = require("@elliemae/ds-shared/prop-types");
40
+ var import_defaultProps = require("./defaultProps");
41
+ const blockName = "button-group";
42
+ const GroupContainer = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, null, ({ vertical, horizontal, spacing }) => ({
43
+ vertical,
44
+ horizontal,
45
+ [spacing]: spacing
46
+ }));
47
+ const DSButtonGroup = ({
48
+ size,
49
+ buttonType,
50
+ orientation,
51
+ spacing,
52
+ children: buttons,
53
+ containerProps
54
+ }) => /* @__PURE__ */ import_react.default.createElement(GroupContainer, {
55
+ classProps: {
56
+ vertical: orientation === "vertical",
57
+ horizontal: orientation !== "vertical",
58
+ spacing
59
+ },
60
+ ...containerProps
61
+ }, import_react.default.Children.map(buttons, (button) => import_react.default.cloneElement(button, {
62
+ buttonType,
63
+ size,
64
+ ...button.props
65
+ }), null));
67
66
  DSButtonGroup.defaultProps = {
68
- size: 'm',
69
- buttonType: 'secondary',
70
- orientation: 'horizontal'
67
+ size: "m",
68
+ buttonType: "secondary",
69
+ orientation: "horizontal"
71
70
  };
72
71
  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')
72
+ containerProps: import_react_desc.PropTypes.shape({}).description("props injected to wrapper of page header"),
73
+ size: import_react_desc.PropTypes.oneOf(import_prop_types.dsBasicSizes).description("['s', 'm', 'l']"),
74
+ buttonType: import_react_desc.PropTypes.oneOf(import_ds_button.buttonTypes).description("['primary', 'secondary', 'text', 'link']"),
75
+ orientation: import_react_desc.PropTypes.oneOf(import_prop_types.orientation).description("['horizontal', 'vertical']"),
76
+ spacing: import_react_desc.PropTypes.oneOf(import_prop_types.dsBasicSizes).description("['s', 'm', 'l']"),
77
+ children: import_react_desc.PropTypes.arrayOf(import_ds_button.default).description("Button group items to show of type DSButton")
100
78
  };
101
- DSButtonGroup.defaultProps = defaultProps.defaultProps;
102
- const DSButtonGroupWithSchema = reactDesc.describe(DSButtonGroup);
79
+ DSButtonGroup.defaultProps = import_defaultProps.defaultProps;
80
+ DSButtonGroup.propTypes = props;
81
+ const DSButtonGroupWithSchema = (0, import_react_desc.describe)(DSButtonGroup);
103
82
  DSButtonGroupWithSchema.propTypes = props;
104
-
105
- exports.DSButtonGroup = DSButtonGroup;
106
- exports.DSButtonGroupWithSchema = DSButtonGroupWithSchema;
107
- exports["default"] = DSButtonGroup;
83
+ var DSButtonGroup_default = DSButtonGroup;
84
+ module.exports = __toCommonJS(DSButtonGroup_exports);
85
+ //# 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 {\n dsBasicSizes,\n orientation as buttonGroupOrientation,\n} from '@elliemae/ds-shared/prop-types';\nimport { defaultProps } from './defaultProps';\n\nconst blockName = 'button-group';\n\nconst GroupContainer = aggregatedClasses('div')(\n blockName,\n null,\n ({ vertical, horizontal, spacing }) => ({\n vertical,\n horizontal,\n [spacing]: spacing,\n }),\n);\n\nconst DSButtonGroup = ({\n size,\n buttonType,\n orientation,\n spacing,\n children: buttons,\n containerProps,\n}) => (\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\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(\n 'props injected to wrapper of page header',\n ),\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(\n \"['primary', 'secondary', 'text', 'link']\",\n ),\n /**\n * ['horizontal', 'vertical']\n */\n orientation: PropTypes.oneOf(buttonGroupOrientation).description(\n \"['horizontal', 'vertical']\",\n ),\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(\n 'Button group items to show of type DSButton',\n ),\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,wBAGO;AACP,0BAA6B;AAE7B,MAAM,YAAY;AAElB,MAAM,iBAAiB,4CAAkB,OACvC,WACA,MACA,CAAC,EAAE,UAAU,YAAY,cAAe;AAAA,EACtC;AAAA,EACA;AAAA,GACC,UAAU;AAAA;AAIf,MAAM,gBAAgB,CAAC;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,MAEA,mDAAC,gBAAD;AAAA,EACE,YAAY;AAAA,IACV,UAAU,gBAAgB;AAAA,IAC1B,YAAY,gBAAgB;AAAA,IAC5B;AAAA;AAAA,KAEE;AAAA,GAEH,qBAAM,SAAS,IACd,SACA,CAAC,WACC,qBAAM,aAAa,QAAQ;AAAA,EACzB;AAAA,EACA;AAAA,KAGG,OAAO;AAAA,IAEd;AAKN,cAAc,eAAe;AAAA,EAC3B,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,aAAa;AAAA;AAGf,MAAM,QAAQ;AAAA,EAEZ,gBAAgB,4BAAU,MAAM,IAAI,YAClC;AAAA,EAKF,MAAM,4BAAU,MAAM,gCAAc,YAAY;AAAA,EAIhD,YAAY,4BAAU,MAAM,8BAAa,YACvC;AAAA,EAKF,aAAa,4BAAU,MAAM,+BAAwB,YACnD;AAAA,EAKF,SAAS,4BAAU,MAAM,gCAAc,YAAY;AAAA,EAInD,UAAU,4BAAU,QAAQ,0BAAU,YACpC;AAAA;AAIJ,cAAc,eAAe;AAE7B,cAAc,YAAY;AAE1B,MAAM,0BAA0B,gCAAS;AAEzC,wBAAwB,YAAY;AAGpC,IAAO,wBAAQ;",
6
+ "names": []
7
+ }
@@ -1,11 +1,39 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
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"));
5
33
  const defaultProps = {
6
34
  spacing: null,
7
35
  children: [],
8
36
  containerProps: {}
9
37
  };
10
-
11
- exports.defaultProps = defaultProps;
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
+ }
package/cjs/index.js CHANGED
@@ -1,11 +1,36 @@
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;
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
+ }
@@ -1,95 +1,59 @@
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,
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { PropTypes, describe } from "react-desc";
4
+ import { aggregatedClasses } from "@elliemae/ds-classnames";
5
+ import DSButton, { buttonTypes } from "@elliemae/ds-button";
6
+ import {
7
+ dsBasicSizes,
8
+ orientation as buttonGroupOrientation
9
+ } from "@elliemae/ds-shared/prop-types";
10
+ import { defaultProps } from "./defaultProps";
11
+ const blockName = "button-group";
12
+ const GroupContainer = aggregatedClasses("div")(blockName, null, ({ vertical, horizontal, spacing }) => ({
13
+ vertical,
14
+ horizontal,
15
+ [spacing]: spacing
16
+ }));
17
+ const DSButtonGroup = ({
18
+ size,
19
+ buttonType,
20
+ orientation,
21
+ spacing,
22
+ children: buttons,
23
+ containerProps
24
+ }) => /* @__PURE__ */ React2.createElement(GroupContainer, {
25
+ classProps: {
26
+ vertical: orientation === "vertical",
27
+ horizontal: orientation !== "vertical",
25
28
  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
-
29
+ },
30
+ ...containerProps
31
+ }, React2.Children.map(buttons, (button) => React2.cloneElement(button, {
32
+ buttonType,
33
+ size,
34
+ ...button.props
35
+ }), null));
57
36
  DSButtonGroup.defaultProps = {
58
- size: 'm',
59
- buttonType: 'secondary',
60
- orientation: 'horizontal'
37
+ size: "m",
38
+ buttonType: "secondary",
39
+ orientation: "horizontal"
61
40
  };
62
41
  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
- */
42
+ containerProps: PropTypes.shape({}).description("props injected to wrapper of page header"),
69
43
  size: PropTypes.oneOf(dsBasicSizes).description("['s', 'm', 'l']"),
70
-
71
- /**
72
- * ['primary', 'secondary', 'text', 'link']
73
- */
74
44
  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
- */
45
+ orientation: PropTypes.oneOf(buttonGroupOrientation).description("['horizontal', 'vertical']"),
84
46
  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')
47
+ children: PropTypes.arrayOf(DSButton).description("Button group items to show of type DSButton")
90
48
  };
91
49
  DSButtonGroup.defaultProps = defaultProps;
50
+ DSButtonGroup.propTypes = props;
92
51
  const DSButtonGroupWithSchema = describe(DSButtonGroup);
93
52
  DSButtonGroupWithSchema.propTypes = props;
94
-
95
- export { DSButtonGroup, DSButtonGroupWithSchema, DSButtonGroup as default };
53
+ var DSButtonGroup_default = DSButtonGroup;
54
+ export {
55
+ DSButtonGroup,
56
+ DSButtonGroupWithSchema,
57
+ DSButtonGroup_default as default
58
+ };
59
+ //# 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 {\n dsBasicSizes,\n orientation as buttonGroupOrientation,\n} from '@elliemae/ds-shared/prop-types';\nimport { defaultProps } from './defaultProps';\n\nconst blockName = 'button-group';\n\nconst GroupContainer = aggregatedClasses('div')(\n blockName,\n null,\n ({ vertical, horizontal, spacing }) => ({\n vertical,\n horizontal,\n [spacing]: spacing,\n }),\n);\n\nconst DSButtonGroup = ({\n size,\n buttonType,\n orientation,\n spacing,\n children: buttons,\n containerProps,\n}) => (\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\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(\n 'props injected to wrapper of page header',\n ),\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(\n \"['primary', 'secondary', 'text', 'link']\",\n ),\n /**\n * ['horizontal', 'vertical']\n */\n orientation: PropTypes.oneOf(buttonGroupOrientation).description(\n \"['horizontal', 'vertical']\",\n ),\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(\n 'Button group items to show of type DSButton',\n ),\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;AAAA;AAAA;AAAA;AAIA;AAEA,MAAM,YAAY;AAElB,MAAM,iBAAiB,kBAAkB,OACvC,WACA,MACA,CAAC,EAAE,UAAU,YAAY,cAAe;AAAA,EACtC;AAAA,EACA;AAAA,GACC,UAAU;AAAA;AAIf,MAAM,gBAAgB,CAAC;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,MAEA,qCAAC,gBAAD;AAAA,EACE,YAAY;AAAA,IACV,UAAU,gBAAgB;AAAA,IAC1B,YAAY,gBAAgB;AAAA,IAC5B;AAAA;AAAA,KAEE;AAAA,GAEH,OAAM,SAAS,IACd,SACA,CAAC,WACC,OAAM,aAAa,QAAQ;AAAA,EACzB;AAAA,EACA;AAAA,KAGG,OAAO;AAAA,IAEd;AAKN,cAAc,eAAe;AAAA,EAC3B,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,aAAa;AAAA;AAGf,MAAM,QAAQ;AAAA,EAEZ,gBAAgB,UAAU,MAAM,IAAI,YAClC;AAAA,EAKF,MAAM,UAAU,MAAM,cAAc,YAAY;AAAA,EAIhD,YAAY,UAAU,MAAM,aAAa,YACvC;AAAA,EAKF,aAAa,UAAU,MAAM,wBAAwB,YACnD;AAAA,EAKF,SAAS,UAAU,MAAM,cAAc,YAAY;AAAA,EAInD,UAAU,UAAU,QAAQ,UAAU,YACpC;AAAA;AAIJ,cAAc,eAAe;AAE7B,cAAc,YAAY;AAE1B,MAAM,0BAA0B,SAAS;AAEzC,wBAAwB,YAAY;AAGpC,IAAO,wBAAQ;",
6
+ "names": []
7
+ }
@@ -1,7 +1,10 @@
1
+ import * as React from "react";
1
2
  const defaultProps = {
2
3
  spacing: null,
3
4
  children: [],
4
5
  containerProps: {}
5
6
  };
6
-
7
- export { defaultProps };
7
+ export {
8
+ defaultProps
9
+ };
10
+ //# sourceMappingURL=defaultProps.js.map
@@ -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
+ }
package/esm/index.js CHANGED
@@ -1 +1,7 @@
1
- export { DSButtonGroup, DSButtonGroupWithSchema, DSButtonGroup as default } from './DSButtonGroup.js';
1
+ import * as React from "react";
2
+ export * from "./DSButtonGroup";
3
+ import { default as default2 } from "./DSButtonGroup";
4
+ export {
5
+ default2 as default
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-button-group",
3
- "version": "2.2.0",
3
+ "version": "2.3.0-alpha.3",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Button Group",
6
6
  "module": "./esm/index.js",
@@ -40,9 +40,9 @@
40
40
  "build": "node ../../scripts/build/build.js"
41
41
  },
42
42
  "dependencies": {
43
- "@elliemae/ds-button": "2.2.0",
44
- "@elliemae/ds-classnames": "2.2.0",
45
- "@elliemae/ds-shared": "2.2.0",
43
+ "@elliemae/ds-button": "2.3.0-alpha.3",
44
+ "@elliemae/ds-classnames": "2.3.0-alpha.3",
45
+ "@elliemae/ds-shared": "2.3.0-alpha.3",
46
46
  "react-desc": "~4.1.3"
47
47
  },
48
48
  "devDependencies": {