@elliemae/ds-button-group 2.3.0-alpha.8 → 2.3.0-next.2

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.
@@ -0,0 +1,107 @@
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;
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const defaultProps = {
6
+ spacing: null,
7
+ children: [],
8
+ containerProps: {}
9
+ };
10
+
11
+ exports.defaultProps = defaultProps;
package/cjs/index.js ADDED
@@ -0,0 +1,11 @@
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;
@@ -0,0 +1,95 @@
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 };
@@ -0,0 +1,7 @@
1
+ const defaultProps = {
2
+ spacing: null,
3
+ children: [],
4
+ containerProps: {}
5
+ };
6
+
7
+ export { defaultProps };
package/esm/index.js ADDED
@@ -0,0 +1 @@
1
+ export { DSButtonGroup, DSButtonGroupWithSchema, DSButtonGroup as default } from './DSButtonGroup.js';
package/package.json CHANGED
@@ -1,26 +1,23 @@
1
1
  {
2
2
  "name": "@elliemae/ds-button-group",
3
- "version": "2.3.0-alpha.8",
3
+ "version": "2.3.0-next.2",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Button Group",
6
- "files": [
7
- "dist"
8
- ],
9
- "module": "./dist/esm/index.js",
10
- "main": "./dist/cjs/index.js",
11
- "types": "./dist/types/index.d.ts",
6
+ "module": "./esm/index.js",
7
+ "main": "./cjs/index.js",
8
+ "types": "./types/index.d.ts",
12
9
  "exports": {
13
10
  ".": {
14
- "import": "./dist/esm/index.js",
15
- "require": "./dist/cjs/index.js"
11
+ "import": "./esm/index.js",
12
+ "require": "./cjs/index.js"
16
13
  },
17
14
  "./DSButtonGroup": {
18
- "import": "./dist/esm/DSButtonGroup.js",
19
- "require": "./dist/cjs/DSButtonGroup.js"
15
+ "import": "./esm/DSButtonGroup.js",
16
+ "require": "./cjs/DSButtonGroup.js"
20
17
  },
21
18
  "./defaultProps": {
22
- "import": "./dist/esm/defaultProps.js",
23
- "require": "./dist/cjs/defaultProps.js"
19
+ "import": "./esm/defaultProps.js",
20
+ "require": "./cjs/defaultProps.js"
24
21
  }
25
22
  },
26
23
  "sideEffects": [
@@ -32,18 +29,24 @@
32
29
  "url": "https://git.elliemae.io/platform-ui/dimsum.git"
33
30
  },
34
31
  "engines": {
35
- "pnpm": ">=6",
36
- "node": ">=16"
32
+ "npm": ">=7",
33
+ "node": ">=14"
37
34
  },
38
35
  "author": "ICE MT",
36
+ "scripts": {
37
+ "dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
38
+ "prebuild": "exit 0",
39
+ "predev": "exit 0",
40
+ "build": "node ../../scripts/build/build.js"
41
+ },
39
42
  "dependencies": {
40
- "@elliemae/ds-button": "2.3.0-alpha.8",
41
- "@elliemae/ds-classnames": "2.3.0-alpha.8",
42
- "@elliemae/ds-shared": "2.3.0-alpha.8",
43
+ "@elliemae/ds-button": "2.3.0-next.2",
44
+ "@elliemae/ds-classnames": "2.3.0-next.2",
45
+ "@elliemae/ds-shared": "2.3.0-next.2",
43
46
  "react-desc": "~4.1.3"
44
47
  },
45
48
  "devDependencies": {
46
- "@testing-library/jest-dom": "~5.15.1",
49
+ "@testing-library/jest-dom": "~5.15.0",
47
50
  "@testing-library/react": "~12.1.2"
48
51
  },
49
52
  "peerDependencies": {
@@ -52,12 +55,7 @@
52
55
  },
53
56
  "publishConfig": {
54
57
  "access": "public",
55
- "typeSafety": false
56
- },
57
- "scripts": {
58
- "dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
59
- "prebuild": "exit 0",
60
- "predev": "exit 0",
61
- "build": "node ../../scripts/build/build.js"
58
+ "directory": "dist",
59
+ "generateSubmodules": true
62
60
  }
63
61
  }
@@ -0,0 +1,82 @@
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?: unknown): JSX.Element;
78
+ propTypes: unknown;
79
+ toTypescript: () => import("react-desc").TypescriptSchema;
80
+ };
81
+ export { DSButtonGroup, DSButtonGroupWithSchema };
82
+ export default DSButtonGroup;
@@ -0,0 +1,5 @@
1
+ export declare const defaultProps: {
2
+ spacing: null;
3
+ children: never[];
4
+ containerProps: {};
5
+ };
@@ -0,0 +1,2 @@
1
+ export * from './DSButtonGroup';
2
+ export { default } from './DSButtonGroup';
@@ -0,0 +1 @@
1
+ export {};
@@ -1,85 +0,0 @@
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 DSButtonGroup_exports = {};
29
- __export(DSButtonGroup_exports, {
30
- DSButtonGroup: () => DSButtonGroup,
31
- DSButtonGroupWithSchema: () => DSButtonGroupWithSchema,
32
- default: () => DSButtonGroup_default
33
- });
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));
66
- DSButtonGroup.defaultProps = {
67
- size: "m",
68
- buttonType: "secondary",
69
- orientation: "horizontal"
70
- };
71
- const props = {
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")
78
- };
79
- DSButtonGroup.defaultProps = import_defaultProps.defaultProps;
80
- DSButtonGroup.propTypes = props;
81
- const DSButtonGroupWithSchema = (0, import_react_desc.describe)(DSButtonGroup);
82
- DSButtonGroupWithSchema.propTypes = props;
83
- var DSButtonGroup_default = DSButtonGroup;
84
- module.exports = __toCommonJS(DSButtonGroup_exports);
85
- //# sourceMappingURL=DSButtonGroup.js.map
@@ -1,7 +0,0 @@
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,39 +0,0 @@
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
@@ -1,7 +0,0 @@
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/dist/cjs/index.js DELETED
@@ -1,36 +0,0 @@
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
@@ -1,7 +0,0 @@
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,59 +0,0 @@
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",
28
- spacing
29
- },
30
- ...containerProps
31
- }, React2.Children.map(buttons, (button) => React2.cloneElement(button, {
32
- buttonType,
33
- size,
34
- ...button.props
35
- }), null));
36
- DSButtonGroup.defaultProps = {
37
- size: "m",
38
- buttonType: "secondary",
39
- orientation: "horizontal"
40
- };
41
- const props = {
42
- containerProps: PropTypes.shape({}).description("props injected to wrapper of page header"),
43
- size: PropTypes.oneOf(dsBasicSizes).description("['s', 'm', 'l']"),
44
- buttonType: PropTypes.oneOf(buttonTypes).description("['primary', 'secondary', 'text', 'link']"),
45
- orientation: PropTypes.oneOf(buttonGroupOrientation).description("['horizontal', 'vertical']"),
46
- spacing: PropTypes.oneOf(dsBasicSizes).description("['s', 'm', 'l']"),
47
- children: PropTypes.arrayOf(DSButton).description("Button group items to show of type DSButton")
48
- };
49
- DSButtonGroup.defaultProps = defaultProps;
50
- DSButtonGroup.propTypes = props;
51
- const DSButtonGroupWithSchema = describe(DSButtonGroup);
52
- DSButtonGroupWithSchema.propTypes = props;
53
- var DSButtonGroup_default = DSButtonGroup;
54
- export {
55
- DSButtonGroup,
56
- DSButtonGroupWithSchema,
57
- DSButtonGroup_default as default
58
- };
59
- //# sourceMappingURL=DSButtonGroup.js.map
@@ -1,7 +0,0 @@
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,10 +0,0 @@
1
- import * as React from "react";
2
- const defaultProps = {
3
- spacing: null,
4
- children: [],
5
- containerProps: {}
6
- };
7
- export {
8
- defaultProps
9
- };
10
- //# sourceMappingURL=defaultProps.js.map
@@ -1,7 +0,0 @@
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/dist/esm/index.js DELETED
@@ -1,7 +0,0 @@
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
@@ -1,7 +0,0 @@
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
- }