@enact/ui 4.5.2 → 4.5.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/AnnounceDecorator/Announce.js +1 -40
- package/AnnounceDecorator/AnnounceDecorator.js +3 -21
- package/AnnounceDecorator/tests/Announce-specs.js +2 -7
- package/AnnounceDecorator/tests/AnnounceDecorator-specs.js +2 -6
- package/AnnounceDecorator/tests/useAnnounce-specs.js +8 -19
- package/AnnounceDecorator/useAnnounce.js +0 -6
- package/BodyText/BodyText.js +6 -26
- package/BodyText/tests/BodyText-specs.js +0 -19
- package/Button/Button.js +26 -56
- package/Button/tests/Button-specs.js +0 -26
- package/CHANGELOG.md +4 -0
- package/Cancelable/Cancelable.js +8 -47
- package/Cancelable/cancelHandler.js +5 -12
- package/Cancelable/modalHandler.js +3 -11
- package/Cancelable/tests/Cancelable-specs.js +3 -57
- package/Changeable/Changeable.js +2 -34
- package/Changeable/tests/Changeable-specs.js +20 -66
- package/ComponentOverride/ComponentOverride.js +1 -13
- package/FloatingLayer/FloatingLayer.js +17 -73
- package/FloatingLayer/FloatingLayerContainer.js +0 -15
- package/FloatingLayer/FloatingLayerDecorator.js +4 -17
- package/FloatingLayer/Scrim.js +9 -53
- package/FloatingLayer/index.js +0 -4
- package/FloatingLayer/tests/FloatingLayer-specs.js +8 -22
- package/FloatingLayer/tests/Scrim-specs.js +0 -9
- package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +0 -13
- package/FloatingLayer/useFloatingLayer.js +3 -14
- package/FloatingLayer/useFloatingLayerDecorator.js +3 -11
- package/ForwardRef/ForwardRef.js +1 -10
- package/GridListImageItem/GridListImageItem.js +17 -50
- package/Group/Group.js +4 -35
- package/Group/GroupItem.js +15 -32
- package/Group/tests/Group-specs.js +0 -32
- package/Heading/Heading.js +7 -35
- package/Heading/tests/Heading-specs.js +81 -14
- package/Icon/Icon.js +14 -48
- package/Icon/tests/Icon-specs.js +0 -22
- package/IconButton/IconButton.js +12 -50
- package/IconButton/tests/IconButton-specs.js +0 -7
- package/Image/Image.js +16 -45
- package/Image/tests/Image-specs.js +0 -14
- package/ImageItem/ImageItem.js +17 -46
- package/ImageItem/tests/ImageItem-specs.js +0 -25
- package/Item/Item.js +8 -32
- package/Item/tests/Item-specs.js +0 -24
- package/LabeledIcon/LabeledIcon.js +19 -50
- package/LabeledIcon/tests/LabeledIcon-specs.js +0 -14
- package/Layout/Cell.js +11 -37
- package/Layout/Layout.js +14 -37
- package/Layout/tests/Layout-specs.js +10 -39
- package/Marquee/MarqueeBase.js +29 -63
- package/Marquee/MarqueeController.js +11 -72
- package/Marquee/MarqueeDecorator.js +62 -196
- package/Marquee/index.js +1 -5
- package/Marquee/tests/Marquee-specs.js +258 -87
- package/Measurable/Measurable.js +12 -34
- package/Measurable/tests/Measurable-specs.js +115 -0
- package/Media/Media.js +15 -65
- package/Media/tests/Media-specs.js +168 -0
- package/Placeholder/PlaceholderControllerDecorator.js +7 -43
- package/Placeholder/PlaceholderDecorator.js +7 -38
- package/Placeholder/index.js +0 -4
- package/Placeholder/tests/PlaceholderControllerDecorator-specs.js +25 -0
- package/Placeholder/tests/PlaceholderDecorator-specs.js +28 -0
- package/ProgressBar/ProgressBar.js +13 -44
- package/ProgressBar/tests/ProgressBar-specs.js +0 -17
- package/RadioDecorator/RadioControllerDecorator.js +1 -29
- package/RadioDecorator/RadioDecorator.js +4 -42
- package/RadioDecorator/tests/RadioDecorator-specs.js +12 -49
- package/Repeater/Repeater.js +9 -33
- package/Repeater/tests/Repeater-specs.js +0 -38
- package/Resizable/Resizable.js +7 -35
- package/Resizable/tests/Resizable-specs.js +34 -0
- package/Routable/Link.js +8 -44
- package/Routable/Routable.js +10 -33
- package/Routable/Route.js +0 -6
- package/Routable/Router.js +13 -56
- package/Routable/tests/Routable-specs.js +7 -33
- package/Routable/tests/Router-specs.js +18 -44
- package/Routable/useLink.js +4 -8
- package/Routable/util.js +18 -24
- package/Scrollable/ScrollAnimator.js +49 -65
- package/Scrollable/ScrollThumb.js +2 -13
- package/Scrollable/Scrollable.js +179 -386
- package/Scrollable/ScrollableNative.js +188 -391
- package/Scrollable/Scrollbar.js +28 -100
- package/Scroller/Scroller.js +15 -39
- package/Scroller/ScrollerBasic.js +34 -89
- package/Scroller/UiScrollerBase.js +31 -84
- package/Skinnable/Skinnable.js +11 -38
- package/Skinnable/tests/Skinnable-specs.js +3 -74
- package/Skinnable/tests/useSkins-specs.js +1 -13
- package/Skinnable/tests/util-specs.js +0 -14
- package/Skinnable/useSkins.js +8 -15
- package/Skinnable/util.js +9 -20
- package/Slider/Knob.js +5 -24
- package/Slider/PositionDecorator.js +16 -54
- package/Slider/Slider.js +26 -64
- package/Slider/tests/Slider-specs.js +94 -7
- package/Slider/utils.js +0 -2
- package/SlotItem/SlotItem.js +15 -41
- package/SlotItem/tests/SlotItem-specs.js +0 -5
- package/Slottable/Slottable.js +4 -12
- package/Slottable/tests/Slottable-specs.js +19 -46
- package/Slottable/tests/useSlots-specs.js +27 -65
- package/Slottable/useSlots.js +8 -33
- package/Spinner/Spinner.js +15 -42
- package/Spinner/tests/Spinner-specs.js +0 -15
- package/ToggleIcon/ToggleIcon.js +10 -36
- package/ToggleIcon/tests/ToggleIcon-specs.js +0 -16
- package/ToggleItem/ToggleItem.js +15 -52
- package/ToggleItem/tests/ToggleItem-specs.js +0 -30
- package/Toggleable/Toggle.js +1 -15
- package/Toggleable/Toggleable.js +12 -45
- package/Toggleable/tests/Toggleable-specs.js +28 -96
- package/Toggleable/useToggle.js +3 -19
- package/Touchable/ClickAllow.js +5 -14
- package/Touchable/Drag.js +16 -54
- package/Touchable/Flick.js +11 -42
- package/Touchable/Hold.js +21 -68
- package/Touchable/Touch.js +37 -65
- package/Touchable/Touchable.js +32 -71
- package/Touchable/config.js +8 -22
- package/Touchable/tests/Touchable-specs.js +270 -119
- package/Touchable/tests/useTouch-specs.js +6 -80
- package/Touchable/useTouch.js +17 -34
- package/Transition/Transition.js +37 -118
- package/Transition/tests/Transition-specs.js +20 -60
- package/ViewManager/Arranger.js +10 -22
- package/ViewManager/TransitionGroup.js +31 -106
- package/ViewManager/View.js +35 -91
- package/ViewManager/ViewManager.js +19 -83
- package/ViewManager/tests/View-specs.js +0 -17
- package/ViewManager/tests/ViewManager-specs.js +236 -305
- package/ViewManager/tests/test-utils.js +0 -8
- package/VirtualList/UiVirtualListBase.js +256 -406
- package/VirtualList/VirtualList.js +29 -69
- package/VirtualList/VirtualListBase.js +0 -3
- package/VirtualList/VirtualListBasic.js +270 -428
- package/VirtualList/tests/VirtualList-specs.js +9 -37
- package/internal/IdProvider/IdProvider.js +7 -21
- package/internal/IdProvider/Provider.js +4 -17
- package/internal/IdProvider/tests/IdProvider-specs.js +44 -0
- package/internal/IdProvider/tests/useId-specs.js +7 -22
- package/internal/IdProvider/useId.js +0 -6
- package/internal/Pure/Pure.js +3 -30
- package/internal/Pure/tests/Pure-specs.js +88 -0
- package/internal/localized-fonts/localized-fonts.js +33 -62
- package/internal/localized-fonts/tests/localized-fonts-specs.js +33 -0
- package/internal/selection/selection.js +1 -6
- package/internal/selection/tests/selection-specs.js +6 -4
- package/internal/validators/tests/validators-specs.js +80 -0
- package/internal/validators/validators.js +14 -34
- package/package.json +8 -2
- package/resolution/ResolutionDecorator.js +4 -40
- package/resolution/index.js +0 -7
- package/resolution/resolution.js +42 -80
- package/resolution/tests/ResolutionDecorator-specs.js +4 -11
- package/resolution/tests/resolution-specs.js +2 -2
- package/useControlledState/tests/useControlledState-specs.js +15 -46
- package/useControlledState/useControlledState.js +11 -22
- package/useScroll/ScrollAnimator.js +49 -65
- package/useScroll/Scrollbar.js +22 -58
- package/useScroll/ScrollbarTrack.js +3 -19
- package/useScroll/useScroll.js +267 -454
- package/useScroll/utilDOM.js +8 -14
- package/useScroll/utilEvent.js +0 -4
package/Skinnable/Skinnable.js
CHANGED
|
@@ -10,33 +10,19 @@ Object.defineProperty(exports, "useSkins", {
|
|
|
10
10
|
return _useSkins["default"];
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
|
|
14
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
14
|
var _hoc = _interopRequireDefault(require("@enact/core/hoc"));
|
|
17
|
-
|
|
18
15
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
-
|
|
20
16
|
var _useSkins = _interopRequireDefault(require("./useSkins"));
|
|
21
|
-
|
|
22
17
|
var _util = require("./util");
|
|
23
|
-
|
|
24
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
-
|
|
26
19
|
var _excluded = ["className", "skin", "skinVariants"];
|
|
27
|
-
|
|
28
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
|
-
|
|
30
21
|
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; }
|
|
31
|
-
|
|
32
22
|
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; }
|
|
33
|
-
|
|
34
23
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
35
|
-
|
|
36
24
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
37
|
-
|
|
38
25
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
39
|
-
|
|
40
26
|
/**
|
|
41
27
|
* Default config for `Skinnable`.
|
|
42
28
|
*
|
|
@@ -55,7 +41,6 @@ var defaultConfig = {
|
|
|
55
41
|
* @memberof ui/Skinnable.Skinnable.defaultConfig
|
|
56
42
|
*/
|
|
57
43
|
variantsProp: null,
|
|
58
|
-
|
|
59
44
|
/**
|
|
60
45
|
* The prop in which to pass the effective skin to the wrapped component.
|
|
61
46
|
*
|
|
@@ -65,7 +50,6 @@ var defaultConfig = {
|
|
|
65
50
|
* @memberof ui/Skinnable.Skinnable.defaultConfig
|
|
66
51
|
*/
|
|
67
52
|
prop: null,
|
|
68
|
-
|
|
69
53
|
/**
|
|
70
54
|
* A hash mapping the available skin names to their CSS class name.
|
|
71
55
|
*
|
|
@@ -75,7 +59,6 @@ var defaultConfig = {
|
|
|
75
59
|
* @memberof ui/Skinnable.Skinnable.defaultConfig
|
|
76
60
|
*/
|
|
77
61
|
skins: null,
|
|
78
|
-
|
|
79
62
|
/**
|
|
80
63
|
* Assign a default skin from the `skins` list.
|
|
81
64
|
*
|
|
@@ -86,7 +69,6 @@ var defaultConfig = {
|
|
|
86
69
|
* @memberof ui/Skinnable.Skinnable.defaultConfig
|
|
87
70
|
*/
|
|
88
71
|
defaultSkin: null,
|
|
89
|
-
|
|
90
72
|
/**
|
|
91
73
|
* Initial collection of applied variants
|
|
92
74
|
*
|
|
@@ -97,7 +79,6 @@ var defaultConfig = {
|
|
|
97
79
|
* @memberof ui/Skinnable.Skinnable.defaultConfig
|
|
98
80
|
*/
|
|
99
81
|
defaultVariants: null,
|
|
100
|
-
|
|
101
82
|
/**
|
|
102
83
|
* A complete list of all supported variants.
|
|
103
84
|
*
|
|
@@ -109,6 +90,7 @@ var defaultConfig = {
|
|
|
109
90
|
*/
|
|
110
91
|
allowedVariants: null
|
|
111
92
|
};
|
|
93
|
+
|
|
112
94
|
/**
|
|
113
95
|
* A higher-order component that assigns skinning classes for the purposes of styling children components.
|
|
114
96
|
*
|
|
@@ -139,21 +121,20 @@ var defaultConfig = {
|
|
|
139
121
|
* @hoc
|
|
140
122
|
* @public
|
|
141
123
|
*/
|
|
142
|
-
|
|
143
124
|
var Skinnable = (0, _hoc["default"])(defaultConfig, function (config, Wrapped) {
|
|
144
125
|
var prop = config.prop,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
var defaultVariants = (0, _util.objectify)(config.defaultVariants);
|
|
126
|
+
skins = config.skins,
|
|
127
|
+
defaultSkin = config.defaultSkin,
|
|
128
|
+
variants = config.allowedVariants,
|
|
129
|
+
variantsProp = config.variantsProp;
|
|
130
|
+
var defaultVariants = (0, _util.objectify)(config.defaultVariants);
|
|
150
131
|
|
|
132
|
+
// eslint-disable-next-line no-shadow
|
|
151
133
|
function Skinnable(_ref) {
|
|
152
134
|
var className = _ref.className,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
135
|
+
skin = _ref.skin,
|
|
136
|
+
skinVariants = _ref.skinVariants,
|
|
137
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
157
138
|
var hook = (0, _useSkins["default"])({
|
|
158
139
|
defaultSkin: defaultSkin,
|
|
159
140
|
defaultVariants: defaultVariants,
|
|
@@ -163,25 +144,18 @@ var Skinnable = (0, _hoc["default"])(defaultConfig, function (config, Wrapped) {
|
|
|
163
144
|
variants: variants
|
|
164
145
|
});
|
|
165
146
|
var allClassNames = (0, _classnames["default"])(hook.className, className);
|
|
166
|
-
|
|
167
147
|
if (allClassNames) {
|
|
168
148
|
rest.className = allClassNames;
|
|
169
149
|
}
|
|
170
|
-
|
|
171
150
|
if (prop) {
|
|
172
151
|
rest[prop] = hook.skin;
|
|
173
152
|
}
|
|
174
|
-
|
|
175
153
|
if (variantsProp) {
|
|
176
154
|
rest[variantsProp] = hook.variants;
|
|
177
155
|
}
|
|
178
|
-
|
|
179
156
|
return hook.provideSkins( /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapped, _objectSpread({}, rest)));
|
|
180
157
|
}
|
|
181
|
-
|
|
182
|
-
Skinnable.propTypes =
|
|
183
|
-
/** @lends ui/Skinnable.Skinnable.prototype */
|
|
184
|
-
{
|
|
158
|
+
Skinnable.propTypes = /** @lends ui/Skinnable.Skinnable.prototype */{
|
|
185
159
|
/**
|
|
186
160
|
* The name of the skin a component should use to render itself. Available skins are
|
|
187
161
|
* defined in the "defaultConfig" for this HOC.
|
|
@@ -190,7 +164,6 @@ var Skinnable = (0, _hoc["default"])(defaultConfig, function (config, Wrapped) {
|
|
|
190
164
|
* @public
|
|
191
165
|
*/
|
|
192
166
|
skin: _propTypes["default"].string,
|
|
193
|
-
|
|
194
167
|
/**
|
|
195
168
|
* The variant(s) on a skin that a component should use when rendering. These will
|
|
196
169
|
* typically alter the appearance of a skin's existing definition in a way that does not
|
|
@@ -1,31 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("@testing-library/jest-dom");
|
|
4
|
-
|
|
5
4
|
var _react = require("@testing-library/react");
|
|
6
|
-
|
|
7
5
|
var _Skinnable = _interopRequireDefault(require("../Skinnable"));
|
|
8
|
-
|
|
9
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
|
|
11
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
|
-
|
|
13
8
|
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; }
|
|
14
|
-
|
|
15
9
|
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; }
|
|
16
|
-
|
|
17
10
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
-
|
|
19
11
|
describe('Skinnable Specs', function () {
|
|
20
12
|
test('should do nothing when nothing is specified', function () {
|
|
21
13
|
var config = {};
|
|
22
14
|
var data;
|
|
23
|
-
|
|
24
15
|
var Component = function Component(props) {
|
|
25
16
|
data = props;
|
|
26
17
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread({}, props));
|
|
27
18
|
};
|
|
28
|
-
|
|
29
19
|
var SkinnableComponent = (0, _Skinnable["default"])(config, Component);
|
|
30
20
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinnableComponent, {}));
|
|
31
21
|
expect(data).toMatchObject({});
|
|
@@ -38,19 +28,15 @@ describe('Skinnable Specs', function () {
|
|
|
38
28
|
light: 'lightSkin'
|
|
39
29
|
}
|
|
40
30
|
};
|
|
41
|
-
|
|
42
31
|
var Component = function Component(props) {
|
|
43
32
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread({}, props));
|
|
44
33
|
};
|
|
45
|
-
|
|
46
34
|
var SkinnableComponent = (0, _Skinnable["default"])(config, Component);
|
|
47
35
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinnableComponent, {
|
|
48
36
|
"data-testid": "skinnableComponent"
|
|
49
37
|
}));
|
|
50
38
|
var expected = 'darkSkin';
|
|
51
|
-
|
|
52
39
|
var component = _react.screen.getByTestId('skinnableComponent');
|
|
53
|
-
|
|
54
40
|
expect(component).toHaveClass(expected);
|
|
55
41
|
});
|
|
56
42
|
test('should add the preferred skin class when the skin prop is specified', function () {
|
|
@@ -61,20 +47,16 @@ describe('Skinnable Specs', function () {
|
|
|
61
47
|
light: 'lightSkin'
|
|
62
48
|
}
|
|
63
49
|
};
|
|
64
|
-
|
|
65
50
|
var Component = function Component(props) {
|
|
66
51
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread({}, props));
|
|
67
52
|
};
|
|
68
|
-
|
|
69
53
|
var SkinnableComponent = (0, _Skinnable["default"])(config, Component);
|
|
70
54
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinnableComponent, {
|
|
71
55
|
"data-testid": "skinnableComponent",
|
|
72
56
|
skin: "light"
|
|
73
57
|
}));
|
|
74
58
|
var expected = 'lightSkin';
|
|
75
|
-
|
|
76
59
|
var component = _react.screen.getByTestId('skinnableComponent');
|
|
77
|
-
|
|
78
60
|
expect(component).toHaveClass(expected);
|
|
79
61
|
});
|
|
80
62
|
test('should ignore the preferred skin prop if it\'s not one of the available skins', function () {
|
|
@@ -86,12 +68,10 @@ describe('Skinnable Specs', function () {
|
|
|
86
68
|
}
|
|
87
69
|
};
|
|
88
70
|
var data;
|
|
89
|
-
|
|
90
71
|
var Component = function Component(props) {
|
|
91
72
|
data = props;
|
|
92
73
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread({}, props));
|
|
93
74
|
};
|
|
94
|
-
|
|
95
75
|
var SkinnableComponent = (0, _Skinnable["default"])(config, Component);
|
|
96
76
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinnableComponent, {
|
|
97
77
|
"data-testid": "skinnableComponent",
|
|
@@ -107,11 +87,9 @@ describe('Skinnable Specs', function () {
|
|
|
107
87
|
light: 'lightSkin'
|
|
108
88
|
}
|
|
109
89
|
};
|
|
110
|
-
|
|
111
90
|
var Component = function Component(props) {
|
|
112
91
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread({}, props));
|
|
113
92
|
};
|
|
114
|
-
|
|
115
93
|
var SkinnableComponent = (0, _Skinnable["default"])(config, Component);
|
|
116
94
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinnableComponent, {
|
|
117
95
|
className: "cheatingComponent",
|
|
@@ -119,9 +97,7 @@ describe('Skinnable Specs', function () {
|
|
|
119
97
|
skin: "potato"
|
|
120
98
|
}));
|
|
121
99
|
var expected = 'cheatingComponent';
|
|
122
|
-
|
|
123
100
|
var component = _react.screen.getByTestId('skinnableComponent');
|
|
124
|
-
|
|
125
101
|
expect(component).toHaveClass(expected);
|
|
126
102
|
});
|
|
127
103
|
test('should ignore the skinVariants prop if there are no defined allowedVariants', function () {
|
|
@@ -132,20 +108,16 @@ describe('Skinnable Specs', function () {
|
|
|
132
108
|
light: 'lightSkin'
|
|
133
109
|
}
|
|
134
110
|
};
|
|
135
|
-
|
|
136
111
|
var Component = function Component(props) {
|
|
137
112
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread({}, props));
|
|
138
113
|
};
|
|
139
|
-
|
|
140
114
|
var SkinnableComponent = (0, _Skinnable["default"])(config, Component);
|
|
141
115
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinnableComponent, {
|
|
142
116
|
"data-testid": "skinnableComponent",
|
|
143
117
|
skinVariants: "potato"
|
|
144
118
|
}));
|
|
145
119
|
var expected = 'darkSkin';
|
|
146
|
-
|
|
147
120
|
var component = _react.screen.getByTestId('skinnableComponent');
|
|
148
|
-
|
|
149
121
|
expect(component).toHaveClass(expected);
|
|
150
122
|
});
|
|
151
123
|
test('should only apply allowed variants assigned by the skinVariants prop', function () {
|
|
@@ -157,20 +129,16 @@ describe('Skinnable Specs', function () {
|
|
|
157
129
|
},
|
|
158
130
|
allowedVariants: ['normal', 'smallCaps', 'unicase']
|
|
159
131
|
};
|
|
160
|
-
|
|
161
132
|
var Component = function Component(props) {
|
|
162
133
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread({}, props));
|
|
163
134
|
};
|
|
164
|
-
|
|
165
135
|
var SkinnableComponent = (0, _Skinnable["default"])(config, Component);
|
|
166
136
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinnableComponent, {
|
|
167
137
|
"data-testid": "skinnableComponent",
|
|
168
138
|
skinVariants: "normal potato unicase"
|
|
169
139
|
}));
|
|
170
140
|
var expected = 'darkSkin normal unicase';
|
|
171
|
-
|
|
172
141
|
var component = _react.screen.getByTestId('skinnableComponent');
|
|
173
|
-
|
|
174
142
|
expect(component).toHaveClass(expected);
|
|
175
143
|
});
|
|
176
144
|
test('should apply default variants even if the skinVariants prop is explicitly empty', function () {
|
|
@@ -183,20 +151,16 @@ describe('Skinnable Specs', function () {
|
|
|
183
151
|
},
|
|
184
152
|
allowedVariants: ['normal', 'smallCaps', 'unicase']
|
|
185
153
|
};
|
|
186
|
-
|
|
187
154
|
var Component = function Component(props) {
|
|
188
155
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread({}, props));
|
|
189
156
|
};
|
|
190
|
-
|
|
191
157
|
var SkinnableComponent = (0, _Skinnable["default"])(config, Component);
|
|
192
158
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinnableComponent, {
|
|
193
159
|
"data-testid": "skinnableComponent",
|
|
194
160
|
skinVariants: ""
|
|
195
161
|
}));
|
|
196
162
|
var expected = 'darkSkin normal';
|
|
197
|
-
|
|
198
163
|
var component = _react.screen.getByTestId('skinnableComponent');
|
|
199
|
-
|
|
200
164
|
expect(component).toHaveClass(expected);
|
|
201
165
|
});
|
|
202
166
|
test('should apply default variants and the skinVariants if both are defined', function () {
|
|
@@ -209,20 +173,16 @@ describe('Skinnable Specs', function () {
|
|
|
209
173
|
},
|
|
210
174
|
allowedVariants: ['normal', 'smallCaps', 'unicase']
|
|
211
175
|
};
|
|
212
|
-
|
|
213
176
|
var Component = function Component(props) {
|
|
214
177
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread({}, props));
|
|
215
178
|
};
|
|
216
|
-
|
|
217
179
|
var SkinnableComponent = (0, _Skinnable["default"])(config, Component);
|
|
218
180
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinnableComponent, {
|
|
219
181
|
"data-testid": "skinnableComponent",
|
|
220
182
|
skinVariants: "unicase"
|
|
221
183
|
}));
|
|
222
184
|
var expected = 'darkSkin normal unicase';
|
|
223
|
-
|
|
224
185
|
var component = _react.screen.getByTestId('skinnableComponent');
|
|
225
|
-
|
|
226
186
|
expect(component).toHaveClass(expected);
|
|
227
187
|
});
|
|
228
188
|
test('should apply variants supplied via an array or a string in the same way', function () {
|
|
@@ -235,26 +195,20 @@ describe('Skinnable Specs', function () {
|
|
|
235
195
|
},
|
|
236
196
|
allowedVariants: ['normal', 'smallCaps', 'unicase']
|
|
237
197
|
};
|
|
238
|
-
|
|
239
198
|
var Component = function Component(props) {
|
|
240
199
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread({}, props));
|
|
241
200
|
};
|
|
242
|
-
|
|
243
201
|
var SkinnableComponent = (0, _Skinnable["default"])(config, Component);
|
|
244
202
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinnableComponent, {
|
|
245
203
|
"data-testid": "skinnableComponent1",
|
|
246
204
|
skinVariants: "normal unicase"
|
|
247
205
|
}));
|
|
248
|
-
|
|
249
206
|
var component1ClassNames = _react.screen.getByTestId('skinnableComponent1').className;
|
|
250
|
-
|
|
251
207
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinnableComponent, {
|
|
252
208
|
"data-testid": "skinnableComponent2",
|
|
253
209
|
skinVariants: ['normal', 'unicase']
|
|
254
210
|
}));
|
|
255
|
-
|
|
256
211
|
var component2ClassNames = _react.screen.getByTestId('skinnableComponent2').className;
|
|
257
|
-
|
|
258
212
|
expect(component1ClassNames).toEqual(component2ClassNames);
|
|
259
213
|
});
|
|
260
214
|
test('should allow opting out of the default variants if an object is supplied to skinVariants with false as variant-key values', function () {
|
|
@@ -267,11 +221,9 @@ describe('Skinnable Specs', function () {
|
|
|
267
221
|
},
|
|
268
222
|
allowedVariants: ['normal', 'smallCaps', 'unicase']
|
|
269
223
|
};
|
|
270
|
-
|
|
271
224
|
var Component = function Component(props) {
|
|
272
225
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread({}, props));
|
|
273
226
|
};
|
|
274
|
-
|
|
275
227
|
var SkinnableComponent = (0, _Skinnable["default"])(config, Component);
|
|
276
228
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinnableComponent, {
|
|
277
229
|
"data-testid": "skinnableComponent",
|
|
@@ -281,9 +233,7 @@ describe('Skinnable Specs', function () {
|
|
|
281
233
|
}
|
|
282
234
|
}));
|
|
283
235
|
var expected = 'darkSkin unicase';
|
|
284
|
-
|
|
285
236
|
var component = _react.screen.getByTestId('skinnableComponent');
|
|
286
|
-
|
|
287
237
|
expect(component).toHaveClass(expected);
|
|
288
238
|
});
|
|
289
239
|
test('should ignore variants, sent by an object, equaling null, undefined, or empty string', function () {
|
|
@@ -296,11 +246,9 @@ describe('Skinnable Specs', function () {
|
|
|
296
246
|
},
|
|
297
247
|
allowedVariants: ['normal', 'smallCaps', 'unicase']
|
|
298
248
|
};
|
|
299
|
-
|
|
300
249
|
var Component = function Component(props) {
|
|
301
250
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread({}, props));
|
|
302
251
|
};
|
|
303
|
-
|
|
304
252
|
var SkinnableComponent = (0, _Skinnable["default"])(config, Component);
|
|
305
253
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinnableComponent, {
|
|
306
254
|
"data-testid": "skinnableComponent",
|
|
@@ -311,9 +259,7 @@ describe('Skinnable Specs', function () {
|
|
|
311
259
|
}
|
|
312
260
|
}));
|
|
313
261
|
var expected = 'darkSkin normal';
|
|
314
|
-
|
|
315
262
|
var component = _react.screen.getByTestId('skinnableComponent');
|
|
316
|
-
|
|
317
263
|
expect(component).toHaveClass(expected);
|
|
318
264
|
});
|
|
319
265
|
test('should apply parent variants', function () {
|
|
@@ -326,11 +272,9 @@ describe('Skinnable Specs', function () {
|
|
|
326
272
|
},
|
|
327
273
|
allowedVariants: ['normal', 'smallCaps', 'unicase']
|
|
328
274
|
};
|
|
329
|
-
|
|
330
275
|
var Component = function Component(props) {
|
|
331
276
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread({}, props));
|
|
332
277
|
};
|
|
333
|
-
|
|
334
278
|
var SkinnableParent = (0, _Skinnable["default"])(config, Component);
|
|
335
279
|
var SkinnableChild = (0, _Skinnable["default"])(config, Component);
|
|
336
280
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinnableParent, {
|
|
@@ -341,9 +285,7 @@ describe('Skinnable Specs', function () {
|
|
|
341
285
|
})
|
|
342
286
|
}));
|
|
343
287
|
var expected = 'darkSkin normal unicase smallCaps';
|
|
344
|
-
|
|
345
288
|
var component = _react.screen.getByTestId('skinnableChild');
|
|
346
|
-
|
|
347
289
|
expect(component).toHaveClass(expected);
|
|
348
290
|
});
|
|
349
291
|
test('should be able to override a parent\'s variants by assigning a false skinVariant', function () {
|
|
@@ -356,11 +298,9 @@ describe('Skinnable Specs', function () {
|
|
|
356
298
|
},
|
|
357
299
|
allowedVariants: ['normal', 'smallCaps', 'unicase']
|
|
358
300
|
};
|
|
359
|
-
|
|
360
301
|
var Component = function Component(props) {
|
|
361
302
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread({}, props));
|
|
362
303
|
};
|
|
363
|
-
|
|
364
304
|
var SkinnableParent = (0, _Skinnable["default"])(config, Component);
|
|
365
305
|
var SkinnableChild = (0, _Skinnable["default"])(config, Component);
|
|
366
306
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinnableParent, {
|
|
@@ -373,9 +313,7 @@ describe('Skinnable Specs', function () {
|
|
|
373
313
|
})
|
|
374
314
|
}));
|
|
375
315
|
var expected = 'darkSkin normal smallCaps';
|
|
376
|
-
|
|
377
316
|
var component = _react.screen.getByTestId('skinnableChild');
|
|
378
|
-
|
|
379
317
|
expect(component).toHaveClass(expected);
|
|
380
318
|
});
|
|
381
319
|
test('should inherit an overridden default variant', function () {
|
|
@@ -388,11 +326,9 @@ describe('Skinnable Specs', function () {
|
|
|
388
326
|
},
|
|
389
327
|
allowedVariants: ['normal', 'smallCaps', 'unicase']
|
|
390
328
|
};
|
|
391
|
-
|
|
392
329
|
var Component = function Component(props) {
|
|
393
330
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread({}, props));
|
|
394
331
|
};
|
|
395
|
-
|
|
396
332
|
var SkinnableParent = (0, _Skinnable["default"])(config, Component);
|
|
397
333
|
var SkinnableChild = (0, _Skinnable["default"])(config, Component);
|
|
398
334
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinnableParent, {
|
|
@@ -406,9 +342,7 @@ describe('Skinnable Specs', function () {
|
|
|
406
342
|
})
|
|
407
343
|
}));
|
|
408
344
|
var expected = 'darkSkin';
|
|
409
|
-
|
|
410
345
|
var component = _react.screen.getByTestId('innerChild');
|
|
411
|
-
|
|
412
346
|
expect(component).toHaveClass(expected);
|
|
413
347
|
});
|
|
414
348
|
test('should not force re-render of child if child unaffected', function () {
|
|
@@ -422,27 +356,22 @@ describe('Skinnable Specs', function () {
|
|
|
422
356
|
allowedVariants: ['normal', 'smallCaps', 'unicase']
|
|
423
357
|
};
|
|
424
358
|
var wasRendered = jest.fn();
|
|
425
|
-
|
|
426
359
|
var Component = function Component(props) {
|
|
427
360
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread({}, props));
|
|
428
361
|
};
|
|
429
|
-
|
|
430
362
|
var ChildComponent = function ChildComponent() {
|
|
431
363
|
wasRendered();
|
|
432
364
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
433
365
|
children: "Hello"
|
|
434
366
|
});
|
|
435
367
|
};
|
|
436
|
-
|
|
437
368
|
var SkinnableParent = (0, _Skinnable["default"])(config, Component);
|
|
438
369
|
var SkinnableChild = (0, _Skinnable["default"])(config, ChildComponent);
|
|
439
370
|
var childrenProp = /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinnableChild, {});
|
|
440
|
-
|
|
441
371
|
var _render = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinnableParent, {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
372
|
+
children: childrenProp
|
|
373
|
+
})),
|
|
374
|
+
rerender = _render.rerender;
|
|
446
375
|
rerender( /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinnableParent, {
|
|
447
376
|
className: "foo",
|
|
448
377
|
children: childrenProp
|
|
@@ -1,42 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("@testing-library/jest-dom");
|
|
4
|
-
|
|
5
4
|
var _react = require("@testing-library/react");
|
|
6
|
-
|
|
7
5
|
var _useSkins = _interopRequireDefault(require("../useSkins"));
|
|
8
|
-
|
|
9
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
|
|
11
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
|
-
|
|
13
8
|
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; }
|
|
14
|
-
|
|
15
9
|
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; }
|
|
16
|
-
|
|
17
10
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
-
|
|
19
11
|
describe('Skinnable Specs', function () {
|
|
20
12
|
var data;
|
|
21
|
-
|
|
22
13
|
var Base = function Base(props) {
|
|
23
14
|
data = props;
|
|
24
15
|
return null;
|
|
25
16
|
};
|
|
26
|
-
|
|
27
17
|
function Component(_ref) {
|
|
28
18
|
var config = _ref.config;
|
|
29
19
|
var skins = (0, _useSkins["default"])(config);
|
|
30
20
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Base, _objectSpread({}, skins));
|
|
31
21
|
}
|
|
32
|
-
|
|
33
22
|
function Parent(_ref2) {
|
|
34
23
|
var config = _ref2.config,
|
|
35
|
-
|
|
24
|
+
children = _ref2.children;
|
|
36
25
|
var skins = (0, _useSkins["default"])(config);
|
|
37
26
|
return skins.provideSkins(children);
|
|
38
27
|
}
|
|
39
|
-
|
|
40
28
|
test('should add a default skin class when no skin prop is specified', function () {
|
|
41
29
|
var config = {
|
|
42
30
|
defaultSkin: 'dark',
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _util = require("../util");
|
|
4
|
-
|
|
5
4
|
var _this = void 0;
|
|
6
|
-
|
|
7
5
|
describe('Skinnable/util/objectify Specs', function () {
|
|
8
6
|
test('should convert a plain string to an object with one key and value true', function () {
|
|
9
7
|
var subject = 'string1';
|
|
@@ -72,49 +70,37 @@ describe('Skinnable/util/preferDefined Specs', function () {
|
|
|
72
70
|
test('should return the first element if it is a normal string', function () {
|
|
73
71
|
var subject = ['string1', 'string2'];
|
|
74
72
|
var expected = 'string1';
|
|
75
|
-
|
|
76
73
|
var actual = _util.preferDefined.apply(_this, subject);
|
|
77
|
-
|
|
78
74
|
expect(actual).toEqual(expected);
|
|
79
75
|
});
|
|
80
76
|
test('should return the first element if even if it is an empty string', function () {
|
|
81
77
|
var subject = ['', 'string2'];
|
|
82
78
|
var expected = '';
|
|
83
|
-
|
|
84
79
|
var actual = _util.preferDefined.apply(_this, subject);
|
|
85
|
-
|
|
86
80
|
expect(actual).toEqual(expected);
|
|
87
81
|
});
|
|
88
82
|
test('should return the first element if it is a true boolean', function () {
|
|
89
83
|
var subject = [true, 'string2'];
|
|
90
84
|
var expected = true;
|
|
91
|
-
|
|
92
85
|
var actual = _util.preferDefined.apply(_this, subject);
|
|
93
|
-
|
|
94
86
|
expect(actual).toEqual(expected);
|
|
95
87
|
});
|
|
96
88
|
test('should return the first element if it is a false boolean', function () {
|
|
97
89
|
var subject = [false, 'string2'];
|
|
98
90
|
var expected = false;
|
|
99
|
-
|
|
100
91
|
var actual = _util.preferDefined.apply(_this, subject);
|
|
101
|
-
|
|
102
92
|
expect(actual).toEqual(expected);
|
|
103
93
|
});
|
|
104
94
|
test('should return the second element if the first is null', function () {
|
|
105
95
|
var subject = [null, 'string2'];
|
|
106
96
|
var expected = 'string2';
|
|
107
|
-
|
|
108
97
|
var actual = _util.preferDefined.apply(_this, subject);
|
|
109
|
-
|
|
110
98
|
expect(actual).toEqual(expected);
|
|
111
99
|
});
|
|
112
100
|
test('should return the second element if the first is undefined', function () {
|
|
113
101
|
var subject = [void 0, 'string2'];
|
|
114
102
|
var expected = 'string2';
|
|
115
|
-
|
|
116
103
|
var actual = _util.preferDefined.apply(_this, subject);
|
|
117
|
-
|
|
118
104
|
expect(actual).toEqual(expected);
|
|
119
105
|
});
|
|
120
106
|
});
|
package/Skinnable/useSkins.js
CHANGED
|
@@ -5,13 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
exports.useSkins = useSkins;
|
|
8
|
-
|
|
9
8
|
var _react = require("react");
|
|
10
|
-
|
|
11
9
|
var _util = require("./util");
|
|
12
|
-
|
|
13
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
|
|
15
11
|
/**
|
|
16
12
|
* Allows a component to respond to skin changes via the Context API
|
|
17
13
|
*
|
|
@@ -32,6 +28,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
32
28
|
* @private
|
|
33
29
|
*/
|
|
34
30
|
var SkinContext = /*#__PURE__*/(0, _react.createContext)(null);
|
|
31
|
+
|
|
35
32
|
/**
|
|
36
33
|
* Configuration for `useSkins`
|
|
37
34
|
*
|
|
@@ -88,19 +85,16 @@ var SkinContext = /*#__PURE__*/(0, _react.createContext)(null);
|
|
|
88
85
|
* @returns {useSkinsInterface}
|
|
89
86
|
* @private
|
|
90
87
|
*/
|
|
91
|
-
|
|
92
88
|
function useSkins(config) {
|
|
93
89
|
var defaultSkin = config.defaultSkin,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
90
|
+
defaultVariants = config.defaultVariants,
|
|
91
|
+
skin = config.skin,
|
|
92
|
+
skins = config.skins,
|
|
93
|
+
skinVariants = config.skinVariants,
|
|
94
|
+
variants = config.variants;
|
|
100
95
|
var _ref = (0, _react.useContext)(SkinContext) || {},
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
96
|
+
parentSkin = _ref.parentSkin,
|
|
97
|
+
parentVariants = _ref.parentVariants;
|
|
104
98
|
var effectiveSkin = (0, _util.determineSkin)(defaultSkin, skin, parentSkin);
|
|
105
99
|
var effectiveVariants = (0, _react.useMemo)(function () {
|
|
106
100
|
return (0, _util.determineVariants)(defaultVariants, variants, skinVariants, parentVariants);
|
|
@@ -125,6 +119,5 @@ function useSkins(config) {
|
|
|
125
119
|
provideSkins: provideSkins
|
|
126
120
|
};
|
|
127
121
|
}
|
|
128
|
-
|
|
129
122
|
var _default = useSkins;
|
|
130
123
|
exports["default"] = _default;
|