react-outline 1.7.3 → 2.1.0
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/README.md +151 -116
- package/dist/Styles.js +34 -35
- package/dist/element.js +69 -88
- package/dist/main.js +22 -35
- package/dist/reactOutline.js +241 -0
- package/dist/reactOutline.js.map +7 -0
- package/dist/styleItem.js +105 -91
- package/dist/utils/buildCssString.js +2 -2
- package/dist/utils/genCss.js +21 -32
- package/dist/utils/genStyles.js +13 -26
- package/dist/utils/hasKids.js +2 -4
- package/dist/utils/index.js +80 -66
- package/dist/utils/makeid.js +3 -6
- package/dist/utils/object2css.js +10 -22
- package/dist/utils/pubsub.js +10 -24
- package/dist/utils/replaceColors.js +3 -4
- package/dist/utils/replacedStyleFn.js +5 -10
- package/dist/utils/sanitizeOutlineInput.js +8 -24
- package/dist/utils/separateCssStyle.js +5 -8
- package/dist/wrapStyles.js +18 -14
- package/index.d.ts +149 -0
- package/package.json +38 -24
- package/.babelrc +0 -6
- package/.travis.yml +0 -7
- package/__snapshots__/cornerCases.test.js.snap +0 -139
- package/__snapshots__/example.test.js.snap +0 -408
- package/cornerCases.test.js +0 -367
- package/dist/utils/sanitizeStyleObj.js +0 -22
- package/empty-module.js +0 -1
- package/example/.babelrc +0 -4
- package/example/.storybook/config.js +0 -7
- package/example/.storybook/webpack.config.js +0 -14
- package/example/README.md +0 -11
- package/example/package.json +0 -55
- package/example/stories/Animate/basic.js +0 -73
- package/example/stories/Basics/CreatingAndApplyingAStyle.js +0 -12
- package/example/stories/Basics/Form.js +0 -24
- package/example/stories/Basics/ImpliedTags.js +0 -40
- package/example/stories/Basics/PassingStyleAndFuntion.js +0 -13
- package/example/stories/Basics/PassingStyleAndFuntionAsArray.js +0 -13
- package/example/stories/Basics/ReusingElements.js +0 -13
- package/example/stories/Basics/Share.js +0 -19
- package/example/stories/Basics/UsingTheTagCreater.js +0 -13
- package/example/stories/Basics/WrappingAnExistingElement.js +0 -19
- package/example/stories/Button.js +0 -27
- package/example/stories/CSSHelpers/CssSelector.js +0 -24
- package/example/stories/CSSHelpers/CssSource.js +0 -18
- package/example/stories/CSSHelpers/DynamicCssSelectors.js +0 -24
- package/example/stories/CSSHelpers/Hover.js +0 -20
- package/example/stories/CSSHelpers/MediaQuery.js +0 -22
- package/example/stories/CSSHelpers/VendorPrefix.js +0 -19
- package/example/stories/CombineStyles/CreatingAndApplyingAStyle.js +0 -16
- package/example/stories/CombineStyles/LogicFnWithGenerateElement.js +0 -16
- package/example/stories/CombineStyles/PassStyleObjToGenerateElement.js +0 -9
- package/example/stories/CombineStyles/UsingAPropFlag.js +0 -16
- package/example/stories/CombineStyles/UsingTheTagCreater.js +0 -16
- package/example/stories/Ref/byFn.js +0 -51
- package/example/stories/Ref/onEvent.js +0 -43
- package/example/stories/RuntimeFunctions/DynamicStyles.js +0 -32
- package/example/stories/RuntimeFunctions/FunctionWithOutStyle.js +0 -31
- package/example/stories/RuntimeFunctions/ModifyingStyles.js +0 -36
- package/example/stories/RuntimeFunctions/WithGeneratedElements.js +0 -38
- package/example/stories/Welcome.js +0 -90
- package/example/stories/index.js +0 -88
- package/example/stories/load.js +0 -229
- package/example.test.js +0 -16
- package/source/Styles.js +0 -23
- package/source/element.js +0 -100
- package/source/main.js +0 -56
- package/source/styleItem.js +0 -105
- package/source/utils/buildCssString.js +0 -6
- package/source/utils/genCss.js +0 -30
- package/source/utils/genStyles.js +0 -19
- package/source/utils/hasKids.js +0 -6
- package/source/utils/index.js +0 -27
- package/source/utils/makeid.js +0 -9
- package/source/utils/object2css.js +0 -20
- package/source/utils/pubsub.js +0 -22
- package/source/utils/replaceColors.js +0 -11
- package/source/utils/replacedStyleFn.js +0 -30
- package/source/utils/sanitizeOutlineInput.js +0 -72
- package/source/utils/sanitizeStyleObj.js +0 -13
- package/source/utils/separateCssStyle.js +0 -25
- package/source/wrapStyles.js +0 -30
package/dist/main.js
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
var wrapStyles = (0, _wrapStyles2.default)(userSetOptions);
|
|
6
|
+
Object.defineProperty(exports, "Styles", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _Styles["default"];
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
exports["default"] = void 0;
|
|
13
|
+
exports.setOptions = setOptions;
|
|
14
|
+
exports.testing = void 0;
|
|
15
|
+
exports.withOptions = withOptions;
|
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
|
17
|
+
var _utils = require("./utils");
|
|
18
|
+
var _wrapStyles = _interopRequireDefault(require("./wrapStyles"));
|
|
19
|
+
var _Styles = _interopRequireDefault(require("./Styles"));
|
|
20
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
21
|
+
var userSetOptions = {
|
|
22
|
+
named: true /* prefix:getVendorPrefix()*/
|
|
23
|
+
};
|
|
24
|
+
var wrapStyles = (0, _wrapStyles["default"])(userSetOptions);
|
|
27
25
|
|
|
28
26
|
//=====================================================
|
|
29
27
|
//============================= top Level - Wrap Styles
|
|
@@ -31,12 +29,9 @@ var wrapStyles = (0, _wrapStyles2.default)(userSetOptions);
|
|
|
31
29
|
|
|
32
30
|
function outline(_styles) {
|
|
33
31
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
34
|
-
|
|
35
32
|
return sanitizeOutline((0, _utils.sanitizeOutlineInput)(_styles, options), options);
|
|
36
33
|
}
|
|
37
|
-
|
|
38
34
|
function sanitizeOutline(_styles, options) {
|
|
39
|
-
|
|
40
35
|
var wrappedStyles = wrapStyles(_styles, options);
|
|
41
36
|
wrappedStyles.colors = wrappedStyles.colors || options && options.colors || userSetOptions && userSetOptions.colors;
|
|
42
37
|
return wrappedStyles;
|
|
@@ -48,7 +43,6 @@ function sanitizeOutline(_styles, options) {
|
|
|
48
43
|
|
|
49
44
|
function withOptions(options) {
|
|
50
45
|
if (!options) throw new Error("Bad options values for react-outline:" + JSON.stringify(options));
|
|
51
|
-
|
|
52
46
|
var tempOutlineFn = function tempOutlineFn(_styles, optionsOrLogic) {
|
|
53
47
|
return sanitizeOutline((0, _utils.sanitizeOutlineInput)(_styles, optionsOrLogic), options);
|
|
54
48
|
};
|
|
@@ -57,7 +51,6 @@ function withOptions(options) {
|
|
|
57
51
|
}
|
|
58
52
|
return tempOutlineFn;
|
|
59
53
|
}
|
|
60
|
-
|
|
61
54
|
function setOptions(options) {
|
|
62
55
|
if (!options) throw new Error("Bad options values for react-outline:" + JSON.stringify(options));
|
|
63
56
|
if (options.colors) {
|
|
@@ -65,13 +58,7 @@ function setOptions(options) {
|
|
|
65
58
|
}
|
|
66
59
|
Object.assign(userSetOptions, options);
|
|
67
60
|
}
|
|
68
|
-
|
|
69
|
-
var testing = {
|
|
61
|
+
var testing = exports.testing = {
|
|
70
62
|
resetCSS: _utils.pubsub.clear
|
|
71
63
|
};
|
|
72
|
-
|
|
73
|
-
exports.default = outline;
|
|
74
|
-
exports.withOptions = withOptions;
|
|
75
|
-
exports.setOptions = setOptions;
|
|
76
|
-
exports.Styles = _Styles2.default;
|
|
77
|
-
exports.testing = testing;
|
|
64
|
+
var _default = exports["default"] = outline;
|