@elliemae/ds-classnames 2.3.1 → 3.0.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.
- package/dist/cjs/aggregatedClasses.js +98 -0
- package/dist/cjs/aggregatedClasses.js.map +7 -0
- package/dist/cjs/aggregatedClasses.md +323 -0
- package/dist/cjs/classNameManager.js +83 -0
- package/dist/cjs/classNameManager.js.map +7 -0
- package/dist/cjs/converPropsToFormModifiers.js +62 -0
- package/dist/cjs/converPropsToFormModifiers.js.map +7 -0
- package/dist/cjs/convertPropToFeedBackModifiers.js +65 -0
- package/dist/cjs/convertPropToFeedBackModifiers.js.map +7 -0
- package/dist/cjs/convertPropsToColorModifiers.js +58 -0
- package/dist/cjs/convertPropsToColorModifiers.js.map +7 -0
- package/dist/cjs/convertPropsToLayoutModifiers.js +65 -0
- package/dist/cjs/convertPropsToLayoutModifiers.js.map +7 -0
- package/dist/cjs/convertPropsToSizeModifiers.js +77 -0
- package/dist/cjs/convertPropsToSizeModifiers.js.map +7 -0
- package/dist/cjs/convertPropsToTextModifiers.js +58 -0
- package/dist/cjs/convertPropsToTextModifiers.js.map +7 -0
- package/dist/cjs/dimsum.config.js +37 -0
- package/dist/cjs/dimsum.config.js.map +7 -0
- package/dist/cjs/index.js +38 -0
- package/dist/cjs/index.js.map +7 -0
- package/{cjs → dist/cjs}/validateNativeProps.js +57 -31
- package/dist/cjs/validateNativeProps.js.map +7 -0
- package/dist/esm/aggregatedClasses.js +74 -0
- package/dist/esm/aggregatedClasses.js.map +7 -0
- package/dist/esm/aggregatedClasses.md +323 -0
- package/dist/esm/classNameManager.js +54 -0
- package/dist/esm/classNameManager.js.map +7 -0
- package/dist/esm/converPropsToFormModifiers.js +33 -0
- package/dist/esm/converPropsToFormModifiers.js.map +7 -0
- package/dist/esm/convertPropToFeedBackModifiers.js +36 -0
- package/dist/esm/convertPropToFeedBackModifiers.js.map +7 -0
- package/dist/esm/convertPropsToColorModifiers.js +29 -0
- package/dist/esm/convertPropsToColorModifiers.js.map +7 -0
- package/dist/esm/convertPropsToLayoutModifiers.js +36 -0
- package/dist/esm/convertPropsToLayoutModifiers.js.map +7 -0
- package/dist/esm/convertPropsToSizeModifiers.js +48 -0
- package/dist/esm/convertPropsToSizeModifiers.js.map +7 -0
- package/dist/esm/convertPropsToTextModifiers.js +29 -0
- package/dist/esm/convertPropsToTextModifiers.js.map +7 -0
- package/dist/esm/dimsum.config.js +8 -0
- package/dist/esm/dimsum.config.js.map +7 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +7 -0
- package/{esm → dist/esm}/validateNativeProps.js +30 -19
- package/dist/esm/validateNativeProps.js.map +7 -0
- package/package.json +43 -35
- package/cjs/aggregatedClasses.js +0 -91
- package/cjs/classNameManager.js +0 -92
- package/cjs/converPropsToFormModifiers.js +0 -39
- package/cjs/convertPropToFeedBackModifiers.js +0 -39
- package/cjs/convertPropsToColorModifiers.js +0 -38
- package/cjs/convertPropsToLayoutModifiers.js +0 -41
- package/cjs/convertPropsToSizeModifiers.js +0 -43
- package/cjs/convertPropsToTextModifiers.js +0 -38
- package/cjs/index.js +0 -12
- package/esm/aggregatedClasses.js +0 -78
- package/esm/classNameManager.js +0 -83
- package/esm/converPropsToFormModifiers.js +0 -37
- package/esm/convertPropToFeedBackModifiers.js +0 -37
- package/esm/convertPropsToColorModifiers.js +0 -36
- package/esm/convertPropsToLayoutModifiers.js +0 -39
- package/esm/convertPropsToSizeModifiers.js +0 -41
- package/esm/convertPropsToTextModifiers.js +0 -36
- package/esm/index.js +0 -2
- package/types/aggregatedClasses.d.ts +0 -11
- package/types/classNameManager.d.ts +0 -28
- package/types/converPropsToFormModifiers.d.ts +0 -14
- package/types/convertPropToFeedBackModifiers.d.ts +0 -16
- package/types/convertPropsToColorModifiers.d.ts +0 -10
- package/types/convertPropsToLayoutModifiers.d.ts +0 -16
- package/types/convertPropsToSizeModifiers.d.ts +0 -24
- package/types/convertPropsToTextModifiers.d.ts +0 -14
- package/types/index.d.ts +0 -2
- package/types/validateNativeProps.d.ts +0 -265
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
4
|
-
require('core-js/modules/esnext.iterator.constructor.js');
|
|
5
|
-
require('core-js/modules/esnext.iterator.reduce.js');
|
|
6
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
7
|
-
|
|
8
|
-
const basicAction = _ref => {
|
|
9
|
-
let {
|
|
10
|
-
size = null,
|
|
11
|
-
extraTight = false,
|
|
12
|
-
tight = false,
|
|
13
|
-
base = false,
|
|
14
|
-
bitLoose = false,
|
|
15
|
-
loose = false,
|
|
16
|
-
extraLoose = false,
|
|
17
|
-
superLoose = false
|
|
18
|
-
} = _ref;
|
|
19
|
-
const cssModifier = [];
|
|
20
|
-
if (size) cssModifier.push("".concat(size)); // Size as Flag
|
|
21
|
-
|
|
22
|
-
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');
|
|
23
|
-
return cssModifier;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const instance = [basicAction];
|
|
27
|
-
|
|
28
|
-
const pipe = () => ({
|
|
29
|
-
getInstance() {
|
|
30
|
-
return instance;
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
add(customModifier) {
|
|
34
|
-
instance.push(customModifier);
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
execute(props) {
|
|
38
|
-
return instance.reduce((temp, action) => [...temp, ...action(props)], []);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
module.exports = pipe;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
4
|
-
require('core-js/modules/esnext.iterator.constructor.js');
|
|
5
|
-
require('core-js/modules/esnext.iterator.reduce.js');
|
|
6
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
7
|
-
|
|
8
|
-
const basicAction = _ref => {
|
|
9
|
-
let {
|
|
10
|
-
textEllipsis,
|
|
11
|
-
textAlignment,
|
|
12
|
-
wordBreak
|
|
13
|
-
} = _ref;
|
|
14
|
-
const cssModifier = [];
|
|
15
|
-
if (textEllipsis) cssModifier.push('text-overflow-ellipsis');
|
|
16
|
-
if (wordBreak) cssModifier.push('text-overflow-word-break');
|
|
17
|
-
if (['left', 'right', 'center', 'justify'].indexOf(textAlignment) > -1) cssModifier.push("text-align-".concat(textAlignment));
|
|
18
|
-
return cssModifier;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const instance = [basicAction];
|
|
22
|
-
|
|
23
|
-
const pipe = () => ({
|
|
24
|
-
getInstance() {
|
|
25
|
-
return instance;
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
add(customModifier) {
|
|
29
|
-
instance.push(customModifier);
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
execute(props) {
|
|
33
|
-
return instance.reduce((temp, action) => [...temp, ...action(props)], []);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
module.exports = pipe;
|
package/cjs/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var classNameManager = require('./classNameManager.js');
|
|
6
|
-
var aggregatedClasses = require('./aggregatedClasses.js');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports.convertPropToCssClassName = classNameManager["default"];
|
|
11
|
-
exports.cssPrefix = classNameManager.cssPrefix;
|
|
12
|
-
exports.aggregatedClasses = aggregatedClasses["default"];
|
package/esm/aggregatedClasses.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
3
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
4
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
5
|
-
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
6
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
7
|
-
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
8
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
9
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
10
|
-
import React from 'react';
|
|
11
|
-
import cx from 'obj-str';
|
|
12
|
-
import DimsumConfig from '@elliemae/ds-shared/dimsum.config';
|
|
13
|
-
import cssPipeline from './classNameManager.js';
|
|
14
|
-
import { isNativeHTMLElement, isValidNativeAttribute } from './validateNativeProps.js';
|
|
15
|
-
|
|
16
|
-
const _excluded = ["innerRef", "children", "classProps", "useComponent", "className", "as"];
|
|
17
|
-
|
|
18
|
-
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; }
|
|
19
|
-
|
|
20
|
-
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; }
|
|
21
|
-
const cssPrefix = DimsumConfig.classNamePrefix;
|
|
22
|
-
|
|
23
|
-
const generateClassNameWithModifier = (block, element, modifier) => "".concat(cssPrefix, "-").concat(block).concat(element ? "__".concat(element) : '', "--").concat(modifier);
|
|
24
|
-
|
|
25
|
-
const appendBlockAndPrefixToObj = (obj, block, element) => obj ? Object.keys(obj).reduce((acc, key) => _objectSpread(_objectSpread({}, acc), {}, {
|
|
26
|
-
["".concat(generateClassNameWithModifier(block, element, key))]: obj[key]
|
|
27
|
-
}), {}) : [];
|
|
28
|
-
|
|
29
|
-
const aggregatedClasses = (type, props) => function (block, element, additionalModifiers) {
|
|
30
|
-
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
31
|
-
return /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
32
|
-
let {
|
|
33
|
-
innerRef,
|
|
34
|
-
children,
|
|
35
|
-
classProps,
|
|
36
|
-
useComponent,
|
|
37
|
-
className,
|
|
38
|
-
as
|
|
39
|
-
} = _ref,
|
|
40
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
41
|
-
|
|
42
|
-
// get the additional classNames either from a function or an object
|
|
43
|
-
let otherModifiers = appendBlockAndPrefixToObj(additionalModifiers, block, element);
|
|
44
|
-
if (typeof additionalModifiers === 'function') otherModifiers = appendBlockAndPrefixToObj(additionalModifiers(_objectSpread(_objectSpread(_objectSpread({}, rest), classProps), {}, {
|
|
45
|
-
className
|
|
46
|
-
})), block, element);
|
|
47
|
-
const otherModifiersStr = cx(otherModifiers);
|
|
48
|
-
const {
|
|
49
|
-
prefix,
|
|
50
|
-
propsToRemoveFromFinalElement = []
|
|
51
|
-
} = options;
|
|
52
|
-
const {
|
|
53
|
-
cssClassName: classNames
|
|
54
|
-
} = cssPipeline(block, null, _objectSpread({}, classProps), {
|
|
55
|
-
prefix,
|
|
56
|
-
element
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
const cleanedPropsPassedDown = _objectSpread(_objectSpread({}, props), rest);
|
|
60
|
-
|
|
61
|
-
propsToRemoveFromFinalElement.forEach(propKey => {
|
|
62
|
-
delete cleanedPropsPassedDown[propKey];
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
if (isNativeHTMLElement(block)) {
|
|
66
|
-
Object.keys(cleanedPropsPassedDown).forEach(key => {
|
|
67
|
-
if (!isValidNativeAttribute(key)) delete cleanedPropsPassedDown[key];
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return /*#__PURE__*/React.createElement(as || type, _objectSpread({
|
|
72
|
-
ref: innerRef || ref,
|
|
73
|
-
className: [classNames, otherModifiersStr, className].join(' ')
|
|
74
|
-
}, cleanedPropsPassedDown), children);
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export { cssPrefix, aggregatedClasses as default };
|
package/esm/classNameManager.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
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 = function () {
|
|
36
|
-
let blockName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'block';
|
|
37
|
-
let cssClassNameModifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
38
|
-
let props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
39
|
-
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
40
|
-
const {
|
|
41
|
-
prefix,
|
|
42
|
-
element
|
|
43
|
-
} = options;
|
|
44
|
-
const prefixBlockName = "".concat(prefix || cssPrefix).concat(blockName).concat(element ? "__".concat(element) : ''); // PipeLine
|
|
45
|
-
|
|
46
|
-
const pipes = !isEmpty(props) ? executePipelines(props) : [];
|
|
47
|
-
const basePipeline = [prefixBlockName, ...pipes]; // specific classname
|
|
48
|
-
|
|
49
|
-
const className = cssClassNameModifier ? [...basePipeline].join(" ".concat(prefixBlockName, "--")).concat(" ".concat(cssClassNameModifier)) : [...basePipeline].join(" ".concat(prefixBlockName, "--"));
|
|
50
|
-
return {
|
|
51
|
-
blockName,
|
|
52
|
-
cssPrefix,
|
|
53
|
-
prefixBlockName,
|
|
54
|
-
cssClassName: className,
|
|
55
|
-
|
|
56
|
-
mainModifier(modifier) {
|
|
57
|
-
return "".concat(className, "--").concat(modifier);
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
classNameBlock(elementName) {
|
|
61
|
-
let usePrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
62
|
-
return "".concat(!usePrefix ? blockName : prefixBlockName, "-").concat(elementName);
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
classNameBlockModifier(modifierName) {
|
|
66
|
-
let elementBlockName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
67
|
-
return "".concat(prefixBlockName, "-").concat(elementBlockName, "--").concat(modifierName);
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
classNameElement(elementName) {
|
|
71
|
-
let elementBlockName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
72
|
-
return "".concat(prefixBlockName).concat(elementBlockName ? "-".concat(elementBlockName) : '', "__").concat(elementName);
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
classNameModifier(modifierName) {
|
|
76
|
-
let elementName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
77
|
-
return "".concat(prefixBlockName).concat(elementName ? "__".concat(elementName) : '', "--").concat(modifierName);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export { cssPrefix, cssPipeline as default };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
|
-
|
|
6
|
-
const basicAction = _ref => {
|
|
7
|
-
let {
|
|
8
|
-
readOnly = false,
|
|
9
|
-
disabled = false,
|
|
10
|
-
checked = false
|
|
11
|
-
} = _ref;
|
|
12
|
-
const cssModifier = []; // input state modifiers
|
|
13
|
-
|
|
14
|
-
if (checked) cssModifier.push('checked');
|
|
15
|
-
if (readOnly) cssModifier.push('readonly');
|
|
16
|
-
if (disabled) cssModifier.push('disabled');
|
|
17
|
-
return cssModifier;
|
|
18
|
-
};
|
|
19
|
-
|
|
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
|
-
});
|
|
36
|
-
|
|
37
|
-
export { pipe as default };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
|
-
|
|
6
|
-
const basicAction = _ref => {
|
|
7
|
-
let {
|
|
8
|
-
hasError = false,
|
|
9
|
-
hasWarning = false,
|
|
10
|
-
hasSuccess = false,
|
|
11
|
-
modalType
|
|
12
|
-
} = _ref;
|
|
13
|
-
const cssModifier = []; // valid state modifier
|
|
14
|
-
|
|
15
|
-
if (hasError) cssModifier.push('error');else if (hasWarning) cssModifier.push('warning');else if (hasSuccess) cssModifier.push('success');
|
|
16
|
-
if (modalType) cssModifier.push("modal-type-".concat(modalType));
|
|
17
|
-
return cssModifier;
|
|
18
|
-
};
|
|
19
|
-
|
|
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
|
-
});
|
|
36
|
-
|
|
37
|
-
export { pipe as default };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
|
-
|
|
6
|
-
const basicAction = _ref => {
|
|
7
|
-
let {
|
|
8
|
-
color = null
|
|
9
|
-
} = _ref;
|
|
10
|
-
const cssModifier = [];
|
|
11
|
-
|
|
12
|
-
if (color && color[0]) {
|
|
13
|
-
if (color[1] !== null) cssModifier.push("color-".concat(color[0], "-").concat(color[1]));else cssModifier.push("color-".concat(color[0]));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return cssModifier;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const instance = [basicAction];
|
|
20
|
-
|
|
21
|
-
const pipe = () => ({
|
|
22
|
-
getInstance() {
|
|
23
|
-
return instance;
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
add(customModifier) {
|
|
27
|
-
instance.push(customModifier);
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
execute(props) {
|
|
31
|
-
return instance.reduce((temp, action) => [...temp, ...action(props)], []);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
export { pipe as default };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
|
-
|
|
6
|
-
const basicAction = _ref => {
|
|
7
|
-
let {
|
|
8
|
-
id,
|
|
9
|
-
buttonType = 'default',
|
|
10
|
-
fluidWidth = false,
|
|
11
|
-
fluidHeight = false
|
|
12
|
-
} = _ref;
|
|
13
|
-
const cssModifier = []; // buttons types
|
|
14
|
-
|
|
15
|
-
if (id) cssModifier.push("id-".concat(id));
|
|
16
|
-
if (buttonType) cssModifier.push(buttonType);
|
|
17
|
-
if (fluidWidth) cssModifier.push('fluid-width');
|
|
18
|
-
if (fluidHeight) cssModifier.push('fluid-height');
|
|
19
|
-
return cssModifier;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const instance = [basicAction];
|
|
23
|
-
|
|
24
|
-
const pipe = () => ({
|
|
25
|
-
getInstance() {
|
|
26
|
-
return instance;
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
add(customModifier) {
|
|
30
|
-
instance.push(customModifier);
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
execute(props) {
|
|
34
|
-
return instance.reduce((temp, action) => [...temp, ...action(props)], []);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
export { pipe as default };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
|
-
|
|
6
|
-
const basicAction = _ref => {
|
|
7
|
-
let {
|
|
8
|
-
size = null,
|
|
9
|
-
extraTight = false,
|
|
10
|
-
tight = false,
|
|
11
|
-
base = false,
|
|
12
|
-
bitLoose = false,
|
|
13
|
-
loose = false,
|
|
14
|
-
extraLoose = false,
|
|
15
|
-
superLoose = false
|
|
16
|
-
} = _ref;
|
|
17
|
-
const cssModifier = [];
|
|
18
|
-
if (size) cssModifier.push("".concat(size)); // Size as Flag
|
|
19
|
-
|
|
20
|
-
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');
|
|
21
|
-
return cssModifier;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const instance = [basicAction];
|
|
25
|
-
|
|
26
|
-
const pipe = () => ({
|
|
27
|
-
getInstance() {
|
|
28
|
-
return instance;
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
add(customModifier) {
|
|
32
|
-
instance.push(customModifier);
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
execute(props) {
|
|
36
|
-
return instance.reduce((temp, action) => [...temp, ...action(props)], []);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
export { pipe as default };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
|
-
|
|
6
|
-
const basicAction = _ref => {
|
|
7
|
-
let {
|
|
8
|
-
textEllipsis,
|
|
9
|
-
textAlignment,
|
|
10
|
-
wordBreak
|
|
11
|
-
} = _ref;
|
|
12
|
-
const cssModifier = [];
|
|
13
|
-
if (textEllipsis) cssModifier.push('text-overflow-ellipsis');
|
|
14
|
-
if (wordBreak) cssModifier.push('text-overflow-word-break');
|
|
15
|
-
if (['left', 'right', 'center', 'justify'].indexOf(textAlignment) > -1) cssModifier.push("text-align-".concat(textAlignment));
|
|
16
|
-
return cssModifier;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const instance = [basicAction];
|
|
20
|
-
|
|
21
|
-
const pipe = () => ({
|
|
22
|
-
getInstance() {
|
|
23
|
-
return instance;
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
add(customModifier) {
|
|
27
|
-
instance.push(customModifier);
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
execute(props) {
|
|
31
|
-
return instance.reduce((temp, action) => [...temp, ...action(props)], []);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
export { pipe as default };
|
package/esm/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare const cssPrefix: any;
|
|
3
|
-
declare type AggregatedClassesT<T = unknown> = (type: any, props?: any) => (block: string, element?: string | null, additionalModifiers?: {
|
|
4
|
-
[key: string]: unknown;
|
|
5
|
-
} | ((arg: any) => {
|
|
6
|
-
[key: string]: unknown;
|
|
7
|
-
}), options?: {
|
|
8
|
-
[key: string]: unknown;
|
|
9
|
-
}) => React.ForwardRefExoticComponent<React.RefAttributes<T>>;
|
|
10
|
-
declare const aggregatedClasses: AggregatedClassesT;
|
|
11
|
-
export default aggregatedClasses;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export declare const cssPrefix: string;
|
|
2
|
-
/**
|
|
3
|
-
* Docs: http://getbem.com/naming/
|
|
4
|
-
* blockName
|
|
5
|
-
* cssClassNameModifier: Main modifier
|
|
6
|
-
* props { hasError, hasWarning, hasSuccess, readOnly, disabled}
|
|
7
|
-
*
|
|
8
|
-
* @param blockName
|
|
9
|
-
* @param cssClassNameModifier
|
|
10
|
-
* @param props
|
|
11
|
-
* @param options
|
|
12
|
-
*/
|
|
13
|
-
declare const cssPipeline: (blockName?: string, cssClassNameModifier?: string, props?: {
|
|
14
|
-
[key: string]: any;
|
|
15
|
-
}, options?: {
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
}) => {
|
|
18
|
-
blockName: string;
|
|
19
|
-
cssPrefix: string;
|
|
20
|
-
prefixBlockName: string;
|
|
21
|
-
cssClassName: string;
|
|
22
|
-
mainModifier(modifier: any): string;
|
|
23
|
-
classNameBlock(elementName: any, usePrefix?: boolean): string;
|
|
24
|
-
classNameBlockModifier(modifierName: any, elementBlockName?: string): string;
|
|
25
|
-
classNameElement(elementName: any, elementBlockName?: string): string;
|
|
26
|
-
classNameModifier(modifierName: any, elementName?: string): string;
|
|
27
|
-
};
|
|
28
|
-
export default cssPipeline;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
declare const pipe: () => {
|
|
2
|
-
getInstance(): (({ readOnly, disabled, checked, }: {
|
|
3
|
-
readOnly?: boolean | undefined;
|
|
4
|
-
disabled?: boolean | undefined;
|
|
5
|
-
checked?: boolean | undefined;
|
|
6
|
-
}) => string[])[];
|
|
7
|
-
add(customModifier: any): void;
|
|
8
|
-
execute(props: any): ({ readOnly, disabled, checked, }: {
|
|
9
|
-
readOnly?: boolean | undefined;
|
|
10
|
-
disabled?: boolean | undefined;
|
|
11
|
-
checked?: boolean | undefined;
|
|
12
|
-
}) => string[];
|
|
13
|
-
};
|
|
14
|
-
export default pipe;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
declare const pipe: () => {
|
|
2
|
-
getInstance(): (({ hasError, hasWarning, hasSuccess, modalType, }: {
|
|
3
|
-
hasError?: boolean | undefined;
|
|
4
|
-
hasWarning?: boolean | undefined;
|
|
5
|
-
hasSuccess?: boolean | undefined;
|
|
6
|
-
modalType: any;
|
|
7
|
-
}) => string[])[];
|
|
8
|
-
add(customModifier: any): void;
|
|
9
|
-
execute(props: any): ({ hasError, hasWarning, hasSuccess, modalType, }: {
|
|
10
|
-
hasError?: boolean | undefined;
|
|
11
|
-
hasWarning?: boolean | undefined;
|
|
12
|
-
hasSuccess?: boolean | undefined;
|
|
13
|
-
modalType: any;
|
|
14
|
-
}) => string[];
|
|
15
|
-
};
|
|
16
|
-
export default pipe;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
declare const pipe: () => {
|
|
2
|
-
getInstance(): (({ id, buttonType, fluidWidth, fluidHeight, }: {
|
|
3
|
-
id: any;
|
|
4
|
-
buttonType?: string | undefined;
|
|
5
|
-
fluidWidth?: boolean | undefined;
|
|
6
|
-
fluidHeight?: boolean | undefined;
|
|
7
|
-
}) => string[])[];
|
|
8
|
-
add(customModifier: any): void;
|
|
9
|
-
execute(props: any): ({ id, buttonType, fluidWidth, fluidHeight, }: {
|
|
10
|
-
id: any;
|
|
11
|
-
buttonType?: string | undefined;
|
|
12
|
-
fluidWidth?: boolean | undefined;
|
|
13
|
-
fluidHeight?: boolean | undefined;
|
|
14
|
-
}) => string[];
|
|
15
|
-
};
|
|
16
|
-
export default pipe;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
declare const pipe: () => {
|
|
2
|
-
getInstance(): (({ size, extraTight, tight, base, bitLoose, loose, extraLoose, superLoose, }: {
|
|
3
|
-
size?: null | undefined;
|
|
4
|
-
extraTight?: boolean | undefined;
|
|
5
|
-
tight?: boolean | undefined;
|
|
6
|
-
base?: boolean | undefined;
|
|
7
|
-
bitLoose?: boolean | undefined;
|
|
8
|
-
loose?: boolean | undefined;
|
|
9
|
-
extraLoose?: boolean | undefined;
|
|
10
|
-
superLoose?: boolean | undefined;
|
|
11
|
-
}) => string[])[];
|
|
12
|
-
add(customModifier: any): void;
|
|
13
|
-
execute(props: any): ({ size, extraTight, tight, base, bitLoose, loose, extraLoose, superLoose, }: {
|
|
14
|
-
size?: null | undefined;
|
|
15
|
-
extraTight?: boolean | undefined;
|
|
16
|
-
tight?: boolean | undefined;
|
|
17
|
-
base?: boolean | undefined;
|
|
18
|
-
bitLoose?: boolean | undefined;
|
|
19
|
-
loose?: boolean | undefined;
|
|
20
|
-
extraLoose?: boolean | undefined;
|
|
21
|
-
superLoose?: boolean | undefined;
|
|
22
|
-
}) => string[];
|
|
23
|
-
};
|
|
24
|
-
export default pipe;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
declare const pipe: () => {
|
|
2
|
-
getInstance(): (({ textEllipsis, textAlignment, wordBreak }: {
|
|
3
|
-
textEllipsis: any;
|
|
4
|
-
textAlignment: any;
|
|
5
|
-
wordBreak: any;
|
|
6
|
-
}) => string[])[];
|
|
7
|
-
add(customModifier: any): void;
|
|
8
|
-
execute(props: any): ({ textEllipsis, textAlignment, wordBreak }: {
|
|
9
|
-
textEllipsis: any;
|
|
10
|
-
textAlignment: any;
|
|
11
|
-
wordBreak: any;
|
|
12
|
-
}) => string[];
|
|
13
|
-
};
|
|
14
|
-
export default pipe;
|
package/types/index.d.ts
DELETED