@elliemae/ds-button-group 3.0.0-alpha.0 → 3.0.0-alpha.1

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.
@@ -2,8 +2,22 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
6
  var __getProtoOf = Object.getPrototypeOf;
6
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
+ };
7
21
  var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
22
  var __export = (target, all) => {
9
23
  for (var name in all)
@@ -51,18 +65,16 @@ const DSButtonGroup = ({
51
65
  spacing,
52
66
  children: buttons,
53
67
  containerProps
54
- }) => /* @__PURE__ */ import_react.default.createElement(GroupContainer, {
68
+ }) => /* @__PURE__ */ import_react.default.createElement(GroupContainer, __spreadValues({
55
69
  classProps: {
56
70
  vertical: orientation === "vertical",
57
71
  horizontal: orientation !== "vertical",
58
72
  spacing
59
- },
60
- ...containerProps
61
- }, import_react.default.Children.map(buttons, (button) => import_react.default.cloneElement(button, {
73
+ }
74
+ }, containerProps), import_react.default.Children.map(buttons, (button) => import_react.default.cloneElement(button, __spreadValues({
62
75
  buttonType,
63
- size,
64
- ...button.props
65
- }), null));
76
+ size
77
+ }, button.props)), null));
66
78
  DSButtonGroup.defaultProps = {
67
79
  size: "m",
68
80
  buttonType: "secondary",
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/DSButtonGroup.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
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,EAIh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B,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
6
  "names": []
7
7
  }
@@ -1,3 +1,19 @@
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
+ };
1
17
  import * as React from "react";
2
18
  import React2 from "react";
3
19
  import { PropTypes, describe } from "react-desc";
@@ -21,18 +37,16 @@ const DSButtonGroup = ({
21
37
  spacing,
22
38
  children: buttons,
23
39
  containerProps
24
- }) => /* @__PURE__ */ React2.createElement(GroupContainer, {
40
+ }) => /* @__PURE__ */ React2.createElement(GroupContainer, __spreadValues({
25
41
  classProps: {
26
42
  vertical: orientation === "vertical",
27
43
  horizontal: orientation !== "vertical",
28
44
  spacing
29
- },
30
- ...containerProps
31
- }, React2.Children.map(buttons, (button) => React2.cloneElement(button, {
45
+ }
46
+ }, containerProps), React2.Children.map(buttons, (button) => React2.cloneElement(button, __spreadValues({
32
47
  buttonType,
33
- size,
34
- ...button.props
35
- }), null));
48
+ size
49
+ }, button.props)), null));
36
50
  DSButtonGroup.defaultProps = {
37
51
  size: "m",
38
52
  buttonType: "secondary",
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSButtonGroup.tsx"],
4
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,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version": "3.0.0-alpha.0",
3
+ "version": "3.0.0-alpha.1",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Button Group",
6
6
  "files": [
@@ -43,9 +43,9 @@
43
43
  "indent": 4
44
44
  },
45
45
  "dependencies": {
46
- "@elliemae/ds-button": "3.0.0-alpha.0",
47
- "@elliemae/ds-classnames": "3.0.0-alpha.0",
48
- "@elliemae/ds-shared": "3.0.0-alpha.0",
46
+ "@elliemae/ds-button": "3.0.0-alpha.1",
47
+ "@elliemae/ds-classnames": "3.0.0-alpha.1",
48
+ "@elliemae/ds-shared": "3.0.0-alpha.1",
49
49
  "react-desc": "~4.1.3"
50
50
  },
51
51
  "devDependencies": {
@@ -64,6 +64,7 @@
64
64
  "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
65
65
  "test": "node ../../scripts/testing/test.mjs",
66
66
  "lint": "node ../../scripts/lint.mjs",
67
+ "dts": "node ../../scripts/dts.mjs",
67
68
  "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
68
69
  }
69
70
  }
@@ -1,82 +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?: unknown): JSX.Element;
78
- propTypes: unknown;
79
- toTypescript: () => import("react-desc").TypescriptSchema;
80
- };
81
- export { DSButtonGroup, DSButtonGroupWithSchema };
82
- export default DSButtonGroup;
@@ -1,5 +0,0 @@
1
- export declare const defaultProps: {
2
- spacing: null;
3
- children: never[];
4
- containerProps: {};
5
- };
@@ -1,2 +0,0 @@
1
- export * from './DSButtonGroup';
2
- export { default } from './DSButtonGroup';
@@ -1 +0,0 @@
1
- export {};