@elliemae/ds-classnames 1.57.1 → 2.0.0-alpha.11

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.
Files changed (64) hide show
  1. package/cjs/aggregatedClasses.js +53 -64
  2. package/cjs/classNameManager.js +77 -12
  3. package/cjs/converPropsToFormModifiers.js +23 -31
  4. package/cjs/convertPropToFeedBackModifiers.js +24 -32
  5. package/cjs/convertPropsToColorModifiers.js +21 -27
  6. package/cjs/convertPropsToLayoutModifiers.js +24 -32
  7. package/cjs/convertPropsToSizeModifiers.js +29 -42
  8. package/cjs/convertPropsToTextModifiers.js +23 -28
  9. package/cjs/index.js +3 -18
  10. package/cjs/validateNativeProps.js +11 -20
  11. package/esm/aggregatedClasses.js +47 -59
  12. package/esm/classNameManager.js +75 -10
  13. package/esm/converPropsToFormModifiers.js +23 -27
  14. package/esm/convertPropToFeedBackModifiers.js +25 -29
  15. package/esm/convertPropsToColorModifiers.js +21 -23
  16. package/esm/convertPropsToLayoutModifiers.js +25 -29
  17. package/esm/convertPropsToSizeModifiers.js +29 -38
  18. package/esm/convertPropsToTextModifiers.js +22 -23
  19. package/esm/index.js +1 -15
  20. package/esm/validateNativeProps.js +10 -19
  21. package/package.json +62 -9
  22. package/types/aggregatedClasses.d.ts +4 -0
  23. package/types/classNameManager.d.ts +24 -0
  24. package/types/converPropsToFormModifiers.d.ts +14 -0
  25. package/types/convertPropToFeedBackModifiers.d.ts +16 -0
  26. package/types/convertPropsToColorModifiers.d.ts +10 -0
  27. package/types/convertPropsToLayoutModifiers.d.ts +16 -0
  28. package/types/convertPropsToSizeModifiers.d.ts +24 -0
  29. package/types/convertPropsToTextModifiers.d.ts +14 -0
  30. package/types/index.d.ts +2 -0
  31. package/types/validateNativeProps.d.ts +265 -0
  32. package/aggregatedClasses/package.json +0 -10
  33. package/cjs/aggregatedClasses.js.map +0 -1
  34. package/cjs/classNameManager-a0bcf533.js +0 -87
  35. package/cjs/classNameManager-a0bcf533.js.map +0 -1
  36. package/cjs/classNameManager.js.map +0 -1
  37. package/cjs/converPropsToFormModifiers.js.map +0 -1
  38. package/cjs/convertPropToFeedBackModifiers.js.map +0 -1
  39. package/cjs/convertPropsToColorModifiers.js.map +0 -1
  40. package/cjs/convertPropsToLayoutModifiers.js.map +0 -1
  41. package/cjs/convertPropsToSizeModifiers.js.map +0 -1
  42. package/cjs/convertPropsToTextModifiers.js.map +0 -1
  43. package/cjs/index.js.map +0 -1
  44. package/cjs/validateNativeProps.js.map +0 -1
  45. package/classNameManager/package.json +0 -10
  46. package/converPropsToFormModifiers/package.json +0 -10
  47. package/convertPropToFeedBackModifiers/package.json +0 -10
  48. package/convertPropsToColorModifiers/package.json +0 -10
  49. package/convertPropsToLayoutModifiers/package.json +0 -10
  50. package/convertPropsToSizeModifiers/package.json +0 -10
  51. package/convertPropsToTextModifiers/package.json +0 -10
  52. package/esm/aggregatedClasses.js.map +0 -1
  53. package/esm/classNameManager-177ee1bb.js +0 -79
  54. package/esm/classNameManager-177ee1bb.js.map +0 -1
  55. package/esm/classNameManager.js.map +0 -1
  56. package/esm/converPropsToFormModifiers.js.map +0 -1
  57. package/esm/convertPropToFeedBackModifiers.js.map +0 -1
  58. package/esm/convertPropsToColorModifiers.js.map +0 -1
  59. package/esm/convertPropsToLayoutModifiers.js.map +0 -1
  60. package/esm/convertPropsToSizeModifiers.js.map +0 -1
  61. package/esm/convertPropsToTextModifiers.js.map +0 -1
  62. package/esm/index.js.map +0 -1
  63. package/esm/validateNativeProps.js.map +0 -1
  64. package/validateNativeProps/package.json +0 -10
package/cjs/index.js CHANGED
@@ -2,25 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var classNameManager = require('./classNameManager-a0bcf533.js');
5
+ var classNameManager = require('./classNameManager.js');
6
6
  var aggregatedClasses = require('./aggregatedClasses.js');
7
- require('@babel/runtime/helpers/toConsumableArray');
8
- require('@elliemae/ds-utilities');
9
- require('./converPropsToFormModifiers.js');
10
- require('./convertPropsToLayoutModifiers.js');
11
- require('./convertPropToFeedBackModifiers.js');
12
- require('./convertPropsToSizeModifiers.js');
13
- require('./convertPropsToTextModifiers.js');
14
- require('./convertPropsToColorModifiers.js');
15
- require('@babel/runtime/helpers/objectWithoutProperties');
16
- require('@babel/runtime/helpers/defineProperty');
17
- require('react');
18
- require('obj-str');
19
- require('./validateNativeProps.js');
20
7
 
21
8
 
22
9
 
23
- exports.convertPropToCssClassName = classNameManager.cssPipeline;
24
- exports.cssPrefix = classNameManager.cssPrefix;
25
- exports.aggregatedClasses = aggregatedClasses['default'];
26
- //# sourceMappingURL=index.js.map
10
+ exports.convertPropToCssClassName = classNameManager["default"];
11
+ exports.aggregatedClasses = aggregatedClasses["default"];
@@ -10,10 +10,10 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
10
10
 
11
11
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
12
12
 
13
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
13
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
14
14
 
15
15
  /* eslint-disable max-lines */
16
- var attributeWhiteList = {
16
+ const attributeWhiteList = {
17
17
  accept: true,
18
18
  acceptCharset: true,
19
19
  accessKey: true,
@@ -129,7 +129,7 @@ var attributeWhiteList = {
129
129
  wmode: true,
130
130
  wrap: true
131
131
  };
132
- var svgAttributesWhiteList = {
132
+ const svgAttributesWhiteList = {
133
133
  clipPath: true,
134
134
  cx: true,
135
135
  cy: true,
@@ -185,7 +185,7 @@ var svgAttributesWhiteList = {
185
185
  y2: true,
186
186
  y: true
187
187
  };
188
- var otherWhiteList = {
188
+ const otherWhiteList = {
189
189
  autoCapitalize: true,
190
190
  autoCorrect: true,
191
191
  property: true,
@@ -198,7 +198,7 @@ var otherWhiteList = {
198
198
  results: true,
199
199
  autoSave: true
200
200
  };
201
- var eventsWhiteList = {
201
+ const eventsWhiteList = {
202
202
  onCopy: true,
203
203
  onCut: true,
204
204
  onPaste: true,
@@ -280,17 +280,11 @@ var eventsWhiteList = {
280
280
  onTransitionEnd: true,
281
281
  onToggle: true
282
282
  };
283
- var whiteList = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, attributeWhiteList), svgAttributesWhiteList), otherWhiteList), eventsWhiteList);
284
- var isDataAttribute = function isDataAttribute(attribute) {
285
- return attribute.substring(0, 5) === 'data-';
286
- };
287
- var isAriaAttribute = function isAriaAttribute(attribute) {
288
- return attribute.substring(0, 6) === 'aria-';
289
- };
290
- var isValidNativeAttribute = function isValidNativeAttribute(attribute) {
291
- return whiteList[attribute] === true || isDataAttribute(attribute) || isAriaAttribute(attribute) || attribute.toLowerCase() === attribute;
292
- };
293
- var nativeHTMLElements = {
283
+ const whiteList = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, attributeWhiteList), svgAttributesWhiteList), otherWhiteList), eventsWhiteList);
284
+ const isDataAttribute = attribute => attribute.substring(0, 5) === 'data-';
285
+ const isAriaAttribute = attribute => attribute.substring(0, 6) === 'aria-';
286
+ const isValidNativeAttribute = attribute => whiteList[attribute] === true || isDataAttribute(attribute) || isAriaAttribute(attribute) || attribute.toLowerCase() === attribute;
287
+ const nativeHTMLElements = {
294
288
  a: true,
295
289
  abbr: true,
296
290
  address: true,
@@ -404,13 +398,10 @@ var nativeHTMLElements = {
404
398
  video: true,
405
399
  wbr: true
406
400
  };
407
- var isNativeHTMLElement = function isNativeHTMLElement(type) {
408
- return nativeHTMLElements[type] === true;
409
- };
401
+ const isNativeHTMLElement = type => nativeHTMLElements[type] === true;
410
402
 
411
403
  exports.isAriaAttribute = isAriaAttribute;
412
404
  exports.isDataAttribute = isDataAttribute;
413
405
  exports.isNativeHTMLElement = isNativeHTMLElement;
414
406
  exports.isValidNativeAttribute = isValidNativeAttribute;
415
407
  exports.whiteList = whiteList;
416
- //# sourceMappingURL=validateNativeProps.js.map
@@ -2,82 +2,70 @@ import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutPr
2
2
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
3
  import React from 'react';
4
4
  import cx from 'obj-str';
5
- import { D as DimsumConfig, c as cssPipeline } from './classNameManager-177ee1bb.js';
5
+ import cssPipeline from './classNameManager.js';
6
+ import DimsumConfig from '@elliemae/ds-shared/dimsum.config';
6
7
  import { isNativeHTMLElement, isValidNativeAttribute } from './validateNativeProps.js';
7
- import '@babel/runtime/helpers/esm/toConsumableArray';
8
- import '@elliemae/ds-utilities';
9
- import './converPropsToFormModifiers.js';
10
- import './convertPropsToLayoutModifiers.js';
11
- import './convertPropToFeedBackModifiers.js';
12
- import './convertPropsToSizeModifiers.js';
13
- import './convertPropsToTextModifiers.js';
14
- import './convertPropsToColorModifiers.js';
15
8
 
16
- var _excluded = ["innerRef", "children", "classProps", "useComponent", "className", "as"];
9
+ const _excluded = ["innerRef", "children", "classProps", "useComponent", "className", "as"];
17
10
 
18
11
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
19
12
 
20
13
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
21
- var cssPrefix = DimsumConfig.classNamePrefix;
14
+ const cssPrefix = DimsumConfig.classNamePrefix;
22
15
 
23
- var generateClassNameWithModifier = function generateClassNameWithModifier(block, element, modifier) {
24
- return "".concat(cssPrefix, "-").concat(block).concat(element ? "__".concat(element) : '', "--").concat(modifier);
25
- };
16
+ const generateClassNameWithModifier = (block, element, modifier) => "".concat(cssPrefix, "-").concat(block).concat(element ? "__".concat(element) : '', "--").concat(modifier);
26
17
 
27
- var appendBlockAndPrefixToObj = function appendBlockAndPrefixToObj(obj, block, element) {
28
- return obj ? Object.keys(obj).reduce(function (acc, key) {
29
- return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, "".concat(generateClassNameWithModifier(block, element, key)), obj[key]));
30
- }, {}) : [];
31
- };
18
+ const appendBlockAndPrefixToObj = (obj, block, element) => obj ? Object.keys(obj).reduce((acc, key) => _objectSpread(_objectSpread({}, acc), {}, {
19
+ ["".concat(generateClassNameWithModifier(block, element, key))]: obj[key]
20
+ }), {}) : [];
32
21
 
33
22
  function aggregatedClasses(type, props) {
34
23
  // aggregatedClasses options parameters
35
- return function (block, element, additionalModifiers) {
36
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
37
- return /*#__PURE__*/React.forwardRef(function (_ref, ref) {
38
- var innerRef = _ref.innerRef,
39
- children = _ref.children,
40
- classProps = _ref.classProps;
41
- _ref.useComponent;
42
- var className = _ref.className,
43
- as = _ref.as,
44
- rest = _objectWithoutProperties(_ref, _excluded);
24
+ return (block, element, additionalModifiers, options = {}) => /*#__PURE__*/React.forwardRef((_ref, ref) => {
25
+ let {
26
+ innerRef,
27
+ children,
28
+ classProps,
29
+ useComponent,
30
+ className,
31
+ as
32
+ } = _ref,
33
+ rest = _objectWithoutProperties(_ref, _excluded);
45
34
 
46
- // get the additional classNames either from a function or an object
47
- var otherModifiers = appendBlockAndPrefixToObj(additionalModifiers, block, element);
48
- if (typeof additionalModifiers === 'function') otherModifiers = appendBlockAndPrefixToObj(additionalModifiers(_objectSpread(_objectSpread(_objectSpread({}, rest), classProps), {}, {
49
- className: className
50
- })), block, element);
51
- var otherModifiersStr = cx(otherModifiers);
52
- var prefix = options.prefix,
53
- _options$propsToRemov = options.propsToRemoveFromFinalElement,
54
- propsToRemoveFromFinalElement = _options$propsToRemov === void 0 ? [] : _options$propsToRemov;
35
+ // get the additional classNames either from a function or an object
36
+ let otherModifiers = appendBlockAndPrefixToObj(additionalModifiers, block, element);
37
+ if (typeof additionalModifiers === 'function') otherModifiers = appendBlockAndPrefixToObj(additionalModifiers(_objectSpread(_objectSpread(_objectSpread({}, rest), classProps), {}, {
38
+ className
39
+ })), block, element);
40
+ const otherModifiersStr = cx(otherModifiers);
41
+ const {
42
+ prefix,
43
+ propsToRemoveFromFinalElement = []
44
+ } = options;
45
+ const {
46
+ cssClassName: classNames
47
+ } = cssPipeline(block, null, _objectSpread({}, classProps), {
48
+ prefix,
49
+ element
50
+ });
55
51
 
56
- var _convertPropToCssClas = cssPipeline(block, null, _objectSpread({}, classProps), {
57
- prefix: prefix,
58
- element: element
59
- }),
60
- classNames = _convertPropToCssClas.cssClassName;
52
+ const cleanedPropsPassedDown = _objectSpread(_objectSpread({}, props), rest);
61
53
 
62
- var cleanedPropsPassedDown = _objectSpread(_objectSpread({}, props), rest);
54
+ propsToRemoveFromFinalElement.forEach(propKey => {
55
+ delete cleanedPropsPassedDown[propKey];
56
+ });
63
57
 
64
- propsToRemoveFromFinalElement.forEach(function (propKey) {
65
- delete cleanedPropsPassedDown[propKey];
58
+ if (isNativeHTMLElement(block)) {
59
+ Object.keys(cleanedPropsPassedDown).forEach(key => {
60
+ if (!isValidNativeAttribute(key)) delete cleanedPropsPassedDown[key];
66
61
  });
62
+ }
67
63
 
68
- if (isNativeHTMLElement(block)) {
69
- Object.keys(cleanedPropsPassedDown).forEach(function (key) {
70
- if (!isValidNativeAttribute(key)) delete cleanedPropsPassedDown[key];
71
- });
72
- }
73
-
74
- return /*#__PURE__*/React.createElement(as || type, _objectSpread({
75
- ref: innerRef || ref,
76
- className: [classNames, otherModifiersStr, className].join(' ')
77
- }, cleanedPropsPassedDown), children);
78
- });
79
- };
64
+ return /*#__PURE__*/React.createElement(as || type, _objectSpread({
65
+ ref: innerRef || ref,
66
+ className: [classNames, otherModifiersStr, className].join(' ')
67
+ }, cleanedPropsPassedDown), children);
68
+ });
80
69
  }
81
70
 
82
71
  export { cssPrefix, aggregatedClasses as default };
83
- //# sourceMappingURL=aggregatedClasses.js.map
@@ -1,10 +1,75 @@
1
- import '@babel/runtime/helpers/esm/toConsumableArray';
2
- import '@elliemae/ds-utilities';
3
- export { a as cssPrefix, c as default } from './classNameManager-177ee1bb.js';
4
- import './converPropsToFormModifiers.js';
5
- import './convertPropsToLayoutModifiers.js';
6
- import './convertPropToFeedBackModifiers.js';
7
- import './convertPropsToSizeModifiers.js';
8
- import './convertPropsToTextModifiers.js';
9
- import './convertPropsToColorModifiers.js';
10
- //# sourceMappingURL=classNameManager.js.map
1
+ import 'core-js/modules/web.dom-collections.iterator.js';
2
+ import { isEmpty } from '@elliemae/ds-utilities/utils';
3
+ import DimsumConfig from '@elliemae/ds-shared/dimsum.config';
4
+ import pipe from './converPropsToFormModifiers.js';
5
+ import pipe$1 from './convertPropsToLayoutModifiers.js';
6
+ import pipe$2 from './convertPropToFeedBackModifiers.js';
7
+ import pipe$3 from './convertPropsToSizeModifiers.js';
8
+ import pipe$4 from './convertPropsToTextModifiers.js';
9
+ import pipe$5 from './convertPropsToColorModifiers.js';
10
+
11
+ const cssPrefix = "".concat(DimsumConfig.classNamePrefix, "-");
12
+
13
+ const executePipelines = props => {
14
+ const form = pipe().execute(props);
15
+ const layout = pipe$1().execute(props);
16
+ const feedback = pipe$2().execute(props);
17
+ const size = pipe$3().execute(props);
18
+ const text = pipe$4().execute(props);
19
+ const color = pipe$5().execute(props);
20
+ return [...form, ...layout, ...feedback, ...size, ...text, ...color];
21
+ };
22
+ /**
23
+ * Docs: http://getbem.com/naming/
24
+ * blockName
25
+ * cssClassNameModifier: Main modifier
26
+ * props { hasError, hasWarning, hasSuccess, readOnly, disabled}
27
+ *
28
+ * @param blockName
29
+ * @param cssClassNameModifier
30
+ * @param props
31
+ * @param options
32
+ */
33
+
34
+
35
+ const cssPipeline = (blockName = 'block', cssClassNameModifier = '', props = {}, options = {}) => {
36
+ const {
37
+ prefix,
38
+ element
39
+ } = options;
40
+ const prefixBlockName = "".concat(prefix || cssPrefix).concat(blockName).concat(element ? "__".concat(element) : ''); // PipeLine
41
+
42
+ const pipes = !isEmpty(props) ? executePipelines(props) : [];
43
+ const basePipeline = [prefixBlockName, ...pipes]; // specific classname
44
+
45
+ const className = cssClassNameModifier ? [...basePipeline].join(" ".concat(prefixBlockName, "--")).concat(" ".concat(cssClassNameModifier)) : [...basePipeline].join(" ".concat(prefixBlockName, "--"));
46
+ return {
47
+ blockName,
48
+ cssPrefix,
49
+ prefixBlockName,
50
+ cssClassName: className,
51
+
52
+ mainModifier(modifier) {
53
+ return "".concat(className, "--").concat(modifier);
54
+ },
55
+
56
+ classNameBlock(elementName, usePrefix = true) {
57
+ return "".concat(!usePrefix ? blockName : prefixBlockName, "-").concat(elementName);
58
+ },
59
+
60
+ classNameBlockModifier(modifierName, elementBlockName = '') {
61
+ return "".concat(prefixBlockName, "-").concat(elementBlockName, "--").concat(modifierName);
62
+ },
63
+
64
+ classNameElement(elementName, elementBlockName = '') {
65
+ return "".concat(prefixBlockName).concat(elementBlockName ? "-".concat(elementBlockName) : '', "__").concat(elementName);
66
+ },
67
+
68
+ classNameModifier(modifierName, elementName = '') {
69
+ return "".concat(prefixBlockName).concat(elementName ? "__".concat(elementName) : '', "--").concat(modifierName);
70
+ }
71
+
72
+ };
73
+ };
74
+
75
+ export { cssPrefix, cssPipeline as default };
@@ -1,13 +1,11 @@
1
- import _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';
1
+ import 'core-js/modules/web.dom-collections.iterator.js';
2
2
 
3
- var basicAction = function basicAction(_ref) {
4
- var _ref$readOnly = _ref.readOnly,
5
- readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
6
- _ref$disabled = _ref.disabled,
7
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
8
- _ref$checked = _ref.checked,
9
- checked = _ref$checked === void 0 ? false : _ref$checked;
10
- var cssModifier = []; // input state modifiers
3
+ const basicAction = ({
4
+ readOnly = false,
5
+ disabled = false,
6
+ checked = false
7
+ }) => {
8
+ const cssModifier = []; // input state modifiers
11
9
 
12
10
  if (checked) cssModifier.push('checked');
13
11
  if (readOnly) cssModifier.push('readonly');
@@ -15,23 +13,21 @@ var basicAction = function basicAction(_ref) {
15
13
  return cssModifier;
16
14
  };
17
15
 
18
- var instance = [basicAction];
19
-
20
- var pipe = function pipe() {
21
- return {
22
- getInstance: function getInstance() {
23
- return instance;
24
- },
25
- add: function add(customModifier) {
26
- instance.push(customModifier);
27
- },
28
- execute: function execute(props) {
29
- return instance.reduce(function (temp, action) {
30
- return [].concat(_toConsumableArray(temp), _toConsumableArray(action(props)));
31
- }, []);
32
- }
33
- };
34
- };
16
+ const instance = [basicAction];
17
+
18
+ const pipe = () => ({
19
+ getInstance() {
20
+ return instance;
21
+ },
22
+
23
+ add(customModifier) {
24
+ instance.push(customModifier);
25
+ },
26
+
27
+ execute(props) {
28
+ return instance.reduce((temp, action) => [...temp, ...action(props)], []);
29
+ }
30
+
31
+ });
35
32
 
36
33
  export { pipe as default };
37
- //# sourceMappingURL=converPropsToFormModifiers.js.map
@@ -1,37 +1,33 @@
1
- import _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';
2
-
3
- var basicAction = function basicAction(_ref) {
4
- var _ref$hasError = _ref.hasError,
5
- hasError = _ref$hasError === void 0 ? false : _ref$hasError,
6
- _ref$hasWarning = _ref.hasWarning,
7
- hasWarning = _ref$hasWarning === void 0 ? false : _ref$hasWarning,
8
- _ref$hasSuccess = _ref.hasSuccess,
9
- hasSuccess = _ref$hasSuccess === void 0 ? false : _ref$hasSuccess,
10
- modalType = _ref.modalType;
11
- var cssModifier = []; // valid state modifier
1
+ import 'core-js/modules/web.dom-collections.iterator.js';
2
+
3
+ const basicAction = ({
4
+ hasError = false,
5
+ hasWarning = false,
6
+ hasSuccess = false,
7
+ modalType
8
+ }) => {
9
+ const cssModifier = []; // valid state modifier
12
10
 
13
11
  if (hasError) cssModifier.push('error');else if (hasWarning) cssModifier.push('warning');else if (hasSuccess) cssModifier.push('success');
14
12
  if (modalType) cssModifier.push("modal-type-".concat(modalType));
15
13
  return cssModifier;
16
14
  };
17
15
 
18
- var instance = [basicAction];
19
-
20
- var pipe = function pipe() {
21
- return {
22
- getInstance: function getInstance() {
23
- return instance;
24
- },
25
- add: function add(customModifier) {
26
- instance.push(customModifier);
27
- },
28
- execute: function execute(props) {
29
- return instance.reduce(function (temp, action) {
30
- return [].concat(_toConsumableArray(temp), _toConsumableArray(action(props)));
31
- }, []);
32
- }
33
- };
34
- };
16
+ const instance = [basicAction];
17
+
18
+ const pipe = () => ({
19
+ getInstance() {
20
+ return instance;
21
+ },
22
+
23
+ add(customModifier) {
24
+ instance.push(customModifier);
25
+ },
26
+
27
+ execute(props) {
28
+ return instance.reduce((temp, action) => [...temp, ...action(props)], []);
29
+ }
30
+
31
+ });
35
32
 
36
33
  export { pipe as default };
37
- //# sourceMappingURL=convertPropToFeedBackModifiers.js.map
@@ -1,9 +1,9 @@
1
- import _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';
1
+ import 'core-js/modules/web.dom-collections.iterator.js';
2
2
 
3
- var basicAction = function basicAction(_ref) {
4
- var _ref$color = _ref.color,
5
- color = _ref$color === void 0 ? null : _ref$color;
6
- var cssModifier = [];
3
+ const basicAction = ({
4
+ color = null
5
+ }) => {
6
+ const cssModifier = [];
7
7
 
8
8
  if (color && color[0]) {
9
9
  if (color[1] !== null) cssModifier.push("color-".concat(color[0], "-").concat(color[1]));else cssModifier.push("color-".concat(color[0]));
@@ -12,23 +12,21 @@ var basicAction = function basicAction(_ref) {
12
12
  return cssModifier;
13
13
  };
14
14
 
15
- var instance = [basicAction];
16
-
17
- var pipe = function pipe() {
18
- return {
19
- getInstance: function getInstance() {
20
- return instance;
21
- },
22
- add: function add(customModifier) {
23
- instance.push(customModifier);
24
- },
25
- execute: function execute(props) {
26
- return instance.reduce(function (temp, action) {
27
- return [].concat(_toConsumableArray(temp), _toConsumableArray(action(props)));
28
- }, []);
29
- }
30
- };
31
- };
15
+ const instance = [basicAction];
16
+
17
+ const pipe = () => ({
18
+ getInstance() {
19
+ return instance;
20
+ },
21
+
22
+ add(customModifier) {
23
+ instance.push(customModifier);
24
+ },
25
+
26
+ execute(props) {
27
+ return instance.reduce((temp, action) => [...temp, ...action(props)], []);
28
+ }
29
+
30
+ });
32
31
 
33
32
  export { pipe as default };
34
- //# sourceMappingURL=convertPropsToColorModifiers.js.map
@@ -1,14 +1,12 @@
1
- import _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';
2
-
3
- var basicAction = function basicAction(_ref) {
4
- var id = _ref.id,
5
- _ref$buttonType = _ref.buttonType,
6
- buttonType = _ref$buttonType === void 0 ? 'default' : _ref$buttonType,
7
- _ref$fluidWidth = _ref.fluidWidth,
8
- fluidWidth = _ref$fluidWidth === void 0 ? false : _ref$fluidWidth,
9
- _ref$fluidHeight = _ref.fluidHeight,
10
- fluidHeight = _ref$fluidHeight === void 0 ? false : _ref$fluidHeight;
11
- var cssModifier = []; // buttons types
1
+ import 'core-js/modules/web.dom-collections.iterator.js';
2
+
3
+ const basicAction = ({
4
+ id,
5
+ buttonType = 'default',
6
+ fluidWidth = false,
7
+ fluidHeight = false
8
+ }) => {
9
+ const cssModifier = []; // buttons types
12
10
 
13
11
  if (id) cssModifier.push("id-".concat(id));
14
12
  if (buttonType) cssModifier.push(buttonType);
@@ -17,23 +15,21 @@ var basicAction = function basicAction(_ref) {
17
15
  return cssModifier;
18
16
  };
19
17
 
20
- var instance = [basicAction];
21
-
22
- var pipe = function pipe() {
23
- return {
24
- getInstance: function getInstance() {
25
- return instance;
26
- },
27
- add: function add(customModifier) {
28
- instance.push(customModifier);
29
- },
30
- execute: function execute(props) {
31
- return instance.reduce(function (temp, action) {
32
- return [].concat(_toConsumableArray(temp), _toConsumableArray(action(props)));
33
- }, []);
34
- }
35
- };
36
- };
18
+ const instance = [basicAction];
19
+
20
+ const pipe = () => ({
21
+ getInstance() {
22
+ return instance;
23
+ },
24
+
25
+ add(customModifier) {
26
+ instance.push(customModifier);
27
+ },
28
+
29
+ execute(props) {
30
+ return instance.reduce((temp, action) => [...temp, ...action(props)], []);
31
+ }
32
+
33
+ });
37
34
 
38
35
  export { pipe as default };
39
- //# sourceMappingURL=convertPropsToLayoutModifiers.js.map
@@ -1,46 +1,37 @@
1
- import _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';
2
-
3
- var basicAction = function basicAction(_ref) {
4
- var _ref$size = _ref.size,
5
- size = _ref$size === void 0 ? null : _ref$size,
6
- _ref$extraTight = _ref.extraTight,
7
- extraTight = _ref$extraTight === void 0 ? false : _ref$extraTight,
8
- _ref$tight = _ref.tight,
9
- tight = _ref$tight === void 0 ? false : _ref$tight,
10
- _ref$base = _ref.base,
11
- base = _ref$base === void 0 ? false : _ref$base,
12
- _ref$bitLoose = _ref.bitLoose,
13
- bitLoose = _ref$bitLoose === void 0 ? false : _ref$bitLoose,
14
- _ref$loose = _ref.loose,
15
- loose = _ref$loose === void 0 ? false : _ref$loose,
16
- _ref$extraLoose = _ref.extraLoose,
17
- extraLoose = _ref$extraLoose === void 0 ? false : _ref$extraLoose,
18
- _ref$superLoose = _ref.superLoose,
19
- superLoose = _ref$superLoose === void 0 ? false : _ref$superLoose;
20
- var cssModifier = [];
1
+ import 'core-js/modules/web.dom-collections.iterator.js';
2
+
3
+ const basicAction = ({
4
+ size = null,
5
+ extraTight = false,
6
+ tight = false,
7
+ base = false,
8
+ bitLoose = false,
9
+ loose = false,
10
+ extraLoose = false,
11
+ superLoose = false
12
+ }) => {
13
+ const cssModifier = [];
21
14
  if (size) cssModifier.push("".concat(size)); // Size as Flag
22
15
 
23
16
  if (extraTight) cssModifier.push('size-extra-tight');else if (tight) cssModifier.push('size-tight');else if (base) cssModifier.push('size-base');else if (bitLoose) cssModifier.push('size-bit-loose');else if (loose) cssModifier.push('size-loose');else if (extraLoose) cssModifier.push('size-extra-loose');else if (superLoose) cssModifier.push('size-super-loose');
24
17
  return cssModifier;
25
18
  };
26
19
 
27
- var instance = [basicAction];
28
-
29
- var pipe = function pipe() {
30
- return {
31
- getInstance: function getInstance() {
32
- return instance;
33
- },
34
- add: function add(customModifier) {
35
- instance.push(customModifier);
36
- },
37
- execute: function execute(props) {
38
- return instance.reduce(function (temp, action) {
39
- return [].concat(_toConsumableArray(temp), _toConsumableArray(action(props)));
40
- }, []);
41
- }
42
- };
43
- };
20
+ const instance = [basicAction];
21
+
22
+ const pipe = () => ({
23
+ getInstance() {
24
+ return instance;
25
+ },
26
+
27
+ add(customModifier) {
28
+ instance.push(customModifier);
29
+ },
30
+
31
+ execute(props) {
32
+ return instance.reduce((temp, action) => [...temp, ...action(props)], []);
33
+ }
34
+
35
+ });
44
36
 
45
37
  export { pipe as default };
46
- //# sourceMappingURL=convertPropsToSizeModifiers.js.map