@pedidopago/ui 1.0.8 → 1.1.2
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/components/Alert/alert.test.js +9 -1
- package/dist/components/Alert/index.js +47 -35
- package/dist/components/Avatar/avatar.test.js +9 -1
- package/dist/components/Avatar/index.js +47 -27
- package/dist/components/Avatar/styles.d.ts.map +1 -1
- package/dist/components/Avatar/styles.js +4 -4
- package/dist/components/Badge/badge.test.js +9 -1
- package/dist/components/Badge/index.js +24 -15
- package/dist/components/Button/Button.test.js +19 -7
- package/dist/components/Button/index.js +28 -16
- package/dist/components/Card/ButtonCard/index.js +24 -10
- package/dist/components/Card/Expansion/index.js +24 -17
- package/dist/components/Card/card.test.js +9 -1
- package/dist/components/Card/index.js +43 -19
- package/dist/components/CheckboxInput/checkbox-input.test.js +9 -1
- package/dist/components/CheckboxInput/components/MultipleCheckbox.js +58 -43
- package/dist/components/CheckboxInput/index.js +29 -18
- package/dist/components/ColorPicker/colorpicker.test.js +9 -1
- package/dist/components/ColorPicker/components/ColorHue.js +17 -10
- package/dist/components/ColorPicker/components/ColorInput.js +3 -1
- package/dist/components/ColorPicker/components/ColorPickerBox.js +13 -9
- package/dist/components/ColorPicker/components/ColorPointer.js +3 -1
- package/dist/components/ColorPicker/components/ColorSelector.js +8 -2
- package/dist/components/ColorPicker/index.js +44 -34
- package/dist/components/DatePicker/components/DatePickerContent.js +113 -79
- package/dist/components/DatePicker/components/DateYearPicker.js +45 -32
- package/dist/components/DatePicker/datepicker.test.js +9 -1
- package/dist/components/DatePicker/index.js +40 -29
- package/dist/components/Dialog/dialog-example.js +21 -13
- package/dist/components/Dialog/dialog.test.js +5 -1
- package/dist/components/Dialog/index.js +59 -46
- package/dist/components/Dropzone/dropzone.test.js +9 -1
- package/dist/components/Dropzone/index.js +122 -97
- package/dist/components/Flex/flex.test.js +128 -14
- package/dist/components/Flex/index.js +11 -3
- package/dist/components/Grid/grid.test.js +86 -81
- package/dist/components/Grid/index.js +11 -3
- package/dist/components/Icon/icon.test.js +3 -3
- package/dist/components/Icon/index.js +8 -2
- package/dist/components/IconItem/IconItem.test.js +9 -1
- package/dist/components/IconItem/index.js +33 -18
- package/dist/components/ImageItem/imageFake.js +13 -9
- package/dist/components/ImageItem/index.js +36 -24
- package/dist/components/ImageItem/input.test.js +10 -7
- package/dist/components/Input/index.js +67 -40
- package/dist/components/Input/input.test.js +4 -4
- package/dist/components/Label/index.js +12 -9
- package/dist/components/Label/input.test.js +3 -1
- package/dist/components/List/index.js +15 -4
- package/dist/components/List/list.test.js +36 -18
- package/dist/components/Menu/components/Submenu.d.ts.map +1 -1
- package/dist/components/Menu/components/Submenu.js +49 -26
- package/dist/components/Menu/index.d.ts.map +1 -1
- package/dist/components/Menu/index.js +19 -10
- package/dist/components/Menu/menu.test.js +14 -14
- package/dist/components/Menu/styles.d.ts +1 -0
- package/dist/components/Menu/styles.d.ts.map +1 -1
- package/dist/components/Menu/styles.js +19 -15
- package/dist/components/Modal/index.js +24 -19
- package/dist/components/Modal/modal.test.js +44 -12
- package/dist/components/Pagination/index.js +54 -45
- package/dist/components/Pagination/pagination.test.js +13 -11
- package/dist/components/Progress/Circle/index.js +38 -29
- package/dist/components/Progress/Linear/index.js +24 -17
- package/dist/components/Progress/index.js +4 -2
- package/dist/components/Progress/progress.test.js +9 -1
- package/dist/components/RadioInput/components/ChoiceList/index.js +28 -20
- package/dist/components/RadioInput/index.js +27 -22
- package/dist/components/RadioInput/radio-input.test.js +118 -87
- package/dist/components/Rating/components/GradientIcon/index.js +24 -17
- package/dist/components/Rating/components/RatingWithMultipleValues/RatingWithMultipleValues.js +24 -22
- package/dist/components/Rating/components/RatingWithSingleValue/RatingWithSingleValue.js +21 -17
- package/dist/components/Rating/index.js +29 -26
- package/dist/components/Rating/rating.test.js +3 -1
- package/dist/components/SelectInput/components/OptionsArea/index.js +37 -32
- package/dist/components/SelectInput/components/SelectArea/index.js +46 -34
- package/dist/components/SelectInput/index.js +26 -23
- package/dist/components/SelectInput/selectInput.test.js +10 -4
- package/dist/components/Skeleton/index.js +11 -1
- package/dist/components/Skeleton/skeleton.test.js +3 -1
- package/dist/components/Slider/components/SliderPointer.d.ts.map +1 -1
- package/dist/components/Slider/components/SliderPointer.js +23 -8
- package/dist/components/Slider/components/SliderRail.js +8 -2
- package/dist/components/Slider/components/SliderSelector.js +86 -78
- package/dist/components/Slider/index.js +28 -16
- package/dist/components/Slider/slider.test.js +9 -1
- package/dist/components/Spinner/index.js +3 -1
- package/dist/components/Spinner/spinner.test.js +9 -1
- package/dist/components/Steps/index.js +25 -17
- package/dist/components/Steps/steps.test.js +3 -1
- package/dist/components/Switch/index.js +23 -17
- package/dist/components/Switch/input.test.js +3 -1
- package/dist/components/Table/components/MenuItem.js +16 -13
- package/dist/components/Table/index.js +139 -99
- package/dist/components/Table/table.test.js +3 -1
- package/dist/components/Tabs/TabsExample.js +37 -23
- package/dist/components/Tabs/components/Tab.js +12 -3
- package/dist/components/Tabs/components/TabPanel.js +8 -3
- package/dist/components/Tabs/components/Tabs.js +33 -23
- package/dist/components/Tabs/tabs.test.js +103 -83
- package/dist/components/Tag/index.js +21 -16
- package/dist/components/Tag/tag.test.js +9 -7
- package/dist/components/TextAreaInput/index.js +25 -15
- package/dist/components/TextAreaInput/text-area-input.test.js +8 -2
- package/dist/components/Thumbnail/index.js +71 -60
- package/dist/components/Thumbnail/thumbnail.test.js +9 -1
- package/dist/components/Timeline/components/Timeline.js +9 -5
- package/dist/components/Timeline/components/TimelineContent.js +31 -15
- package/dist/components/Timeline/components/TimelineItem.js +11 -1
- package/dist/components/Timeline/components/TimelineSeparator.js +9 -4
- package/dist/components/Timeline/timeline.test.js +105 -76
- package/dist/components/Toast/button-example.js +10 -5
- package/dist/components/Toast/components/Toast.js +16 -11
- package/dist/components/Toast/contexts/ToastProvider.js +6 -3
- package/dist/components/Toast/index.js +90 -62
- package/dist/components/Toast/toast.test.js +11 -1
- package/dist/components/Tooltip/componenteTeste.js +42 -14
- package/dist/components/Tooltip/index.js +56 -46
- package/dist/components/Tooltip/tooltip.test.js +13 -8
- package/dist/components/Typography/index.js +11 -3
- package/dist/components/Typography/typography.test.js +3 -1
- package/dist/shared/components/FocusLock/index.js +11 -4
- package/dist/shared/tests/test-utils.js +6 -3
- package/dist/shared/theme/button-example.js +6 -3
- package/dist/shared/theme/contexts/ThemeContext.d.ts.map +1 -1
- package/dist/shared/theme/contexts/ThemeContext.js +12 -29
- package/dist/shared/theme/theme.test.js +25 -11
- package/package.json +1 -1
- package/dist/components/Slider/icons/pointer.js +0 -15
- package/dist/shared/logos/pp_logo_horizontal.js +0 -51
- package/dist/shared/logos/pp_logo_horizontal_dark_mode.js +0 -51
- package/dist/shared/logos/pp_logo_vertical.js +0 -51
- package/dist/shared/logos/pp_logo_vertical_dark_mode.js +0 -51
|
@@ -15,8 +15,16 @@ var _Tooltip = _interopRequireDefault(require("../Tooltip"));
|
|
|
15
15
|
|
|
16
16
|
var _ButtonCard = require("./ButtonCard");
|
|
17
17
|
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
20
28
|
function Card(_ref) {
|
|
21
29
|
var title = _ref.title,
|
|
22
30
|
subtitle = _ref.subtitle,
|
|
@@ -35,25 +43,41 @@ function Card(_ref) {
|
|
|
35
43
|
btPrimary = _ref.btPrimary,
|
|
36
44
|
btSecondary = _ref.btSecondary,
|
|
37
45
|
btColumn = _ref.btColumn;
|
|
38
|
-
return /*#__PURE__*/
|
|
46
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.CardBody, {
|
|
39
47
|
outlined: outlined,
|
|
40
48
|
hover: hover,
|
|
41
|
-
active: active
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
49
|
+
active: active,
|
|
50
|
+
children: [media && /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
51
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Media, {
|
|
52
|
+
src: media
|
|
53
|
+
})
|
|
54
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.CardContent, {
|
|
55
|
+
padding: padding,
|
|
56
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.HeaderCard, {
|
|
57
|
+
children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Title, {
|
|
58
|
+
color: titleColor,
|
|
59
|
+
children: title
|
|
60
|
+
}), icon && (tooltip ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, _objectSpread(_objectSpread({}, tooltip), {}, {
|
|
61
|
+
children: icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
62
|
+
name: icon
|
|
63
|
+
})
|
|
64
|
+
})) : icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
65
|
+
name: icon
|
|
66
|
+
}))]
|
|
67
|
+
}), subtitle && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.SubtitleText, {
|
|
68
|
+
children: subtitle
|
|
69
|
+
}), supporingText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.SupporingText, {
|
|
70
|
+
children: supporingText
|
|
71
|
+
}), expand ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Expansion.Expansion, {
|
|
72
|
+
expandedHeight: expandedHeight,
|
|
73
|
+
children: children
|
|
74
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Content, {
|
|
75
|
+
children: children
|
|
76
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonCard.ButtonCardArea, {
|
|
77
|
+
btPrimary: btPrimary,
|
|
78
|
+
btSecondary: btSecondary,
|
|
79
|
+
btColumn: btColumn
|
|
80
|
+
})]
|
|
81
|
+
})]
|
|
82
|
+
});
|
|
59
83
|
}
|
|
@@ -8,8 +8,16 @@ var _react = require("@testing-library/react");
|
|
|
8
8
|
|
|
9
9
|
var _ = _interopRequireDefault(require("."));
|
|
10
10
|
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
|
|
11
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
14
|
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
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; }
|
|
20
|
+
|
|
13
21
|
var mockPropCheckboxChildren = [{
|
|
14
22
|
label: 'Children-1',
|
|
15
23
|
value: 'children-1',
|
|
@@ -25,7 +33,7 @@ var mockPropCheckboxChildren = [{
|
|
|
25
33
|
}];
|
|
26
34
|
|
|
27
35
|
var makeSut = function makeSut(props) {
|
|
28
|
-
var sut = (0, _testUtils.render)( /*#__PURE__*/
|
|
36
|
+
var sut = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, _objectSpread({}, props)));
|
|
29
37
|
var checkbox = sut.container.querySelector('input');
|
|
30
38
|
var label = sut.container.querySelector('label');
|
|
31
39
|
return {
|
|
@@ -11,12 +11,12 @@ var _Icon = _interopRequireDefault(require("../../Icon"));
|
|
|
11
11
|
|
|
12
12
|
var _styles = require("../styles");
|
|
13
13
|
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
14
16
|
var _excluded = ["id", "label", "color", "checkboxChildren", "isDisabled", "onChangeValue"];
|
|
15
17
|
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
|
-
|
|
20
20
|
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; }
|
|
21
21
|
|
|
22
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; }
|
|
@@ -161,13 +161,13 @@ var MultipleCheckbox = function MultipleCheckbox(_ref) {
|
|
|
161
161
|
if (!parentChecked) {
|
|
162
162
|
return null;
|
|
163
163
|
} else if (hasDeselectedChildren) {
|
|
164
|
-
return /*#__PURE__*/
|
|
164
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
165
165
|
name: "minus",
|
|
166
166
|
color: "neutral.white",
|
|
167
167
|
size: 20
|
|
168
168
|
});
|
|
169
169
|
} else {
|
|
170
|
-
return /*#__PURE__*/
|
|
170
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
171
171
|
name: "check",
|
|
172
172
|
color: "neutral.white",
|
|
173
173
|
size: 20
|
|
@@ -175,45 +175,60 @@ var MultipleCheckbox = function MultipleCheckbox(_ref) {
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
return /*#__PURE__*/
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
role: "
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
178
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.MultipleWrapper, {
|
|
179
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Wrapper, {
|
|
180
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.CheckBoxWrapper, {
|
|
181
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
182
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Checkbox, _objectSpread({
|
|
183
|
+
id: id,
|
|
184
|
+
type: "checkbox",
|
|
185
|
+
color: color,
|
|
186
|
+
checked: parentChecked,
|
|
187
|
+
onChange: handleParentChange,
|
|
188
|
+
disabled: isDisabled
|
|
189
|
+
}, rest)), handleRenderParentIcon()]
|
|
190
|
+
})
|
|
191
|
+
}), label && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Label, {
|
|
192
|
+
htmlFor: id,
|
|
193
|
+
isDisabled: isDisabled,
|
|
194
|
+
children: label
|
|
195
|
+
})]
|
|
196
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ChildrensWrapper, {
|
|
197
|
+
role: "list",
|
|
198
|
+
children: childrenData.map(function (_ref2) {
|
|
199
|
+
var label = _ref2.label,
|
|
200
|
+
id = _ref2.id,
|
|
201
|
+
value = _ref2.value,
|
|
202
|
+
hasSelected = _ref2.hasSelected;
|
|
203
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Wrapper, {
|
|
204
|
+
role: "listitem",
|
|
205
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.CheckBoxWrapper, {
|
|
206
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
207
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Checkbox, {
|
|
208
|
+
type: "checkbox",
|
|
209
|
+
disabled: isDisabled,
|
|
210
|
+
id: id,
|
|
211
|
+
color: color,
|
|
212
|
+
checked: hasSelected,
|
|
213
|
+
onChange: function onChange(event) {
|
|
214
|
+
return handleChildrenChange(event, id);
|
|
215
|
+
}
|
|
216
|
+
}), hasSelected ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
217
|
+
size: 20,
|
|
218
|
+
name: "check",
|
|
219
|
+
color: "neutral.white"
|
|
220
|
+
}) : '']
|
|
221
|
+
})
|
|
222
|
+
}), label && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Label, {
|
|
223
|
+
htmlFor: id,
|
|
224
|
+
isDisabled: isDisabled,
|
|
225
|
+
color: color,
|
|
226
|
+
children: label
|
|
227
|
+
})]
|
|
228
|
+
}, value);
|
|
229
|
+
})
|
|
230
|
+
})]
|
|
231
|
+
});
|
|
217
232
|
};
|
|
218
233
|
|
|
219
234
|
var _default = MultipleCheckbox;
|
|
@@ -13,11 +13,17 @@ var _MultipleCheckbox = _interopRequireDefault(require("./components/MultipleChe
|
|
|
13
13
|
|
|
14
14
|
var _styles = require("./styles");
|
|
15
15
|
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
16
18
|
var _excluded = ["label", "id", "isDisabled", "isInderteminate", "defaultIsChecked", "isMultiple", "color", "checkboxChildren", "onChangeValue"];
|
|
17
19
|
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
|
-
function
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
21
27
|
|
|
22
28
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
23
29
|
|
|
@@ -60,7 +66,7 @@ var CheckboxInput = function CheckboxInput(_ref) {
|
|
|
60
66
|
}
|
|
61
67
|
|
|
62
68
|
if (isMultiple && checkboxChildren) {
|
|
63
|
-
return /*#__PURE__*/
|
|
69
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_MultipleCheckbox.default, {
|
|
64
70
|
checkboxChildren: checkboxChildren,
|
|
65
71
|
id: id,
|
|
66
72
|
color: color,
|
|
@@ -73,22 +79,27 @@ var CheckboxInput = function CheckboxInput(_ref) {
|
|
|
73
79
|
(0, _react.useEffect)(function () {
|
|
74
80
|
setChecked(defaultIsChecked || false);
|
|
75
81
|
}, [defaultIsChecked]);
|
|
76
|
-
return /*#__PURE__*/
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Wrapper, {
|
|
83
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.CheckboxWrapper, {
|
|
84
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Checkbox, _objectSpread({
|
|
85
|
+
type: "checkbox",
|
|
86
|
+
id: id,
|
|
87
|
+
color: color,
|
|
88
|
+
checked: checked,
|
|
89
|
+
onChange: handleChange,
|
|
90
|
+
disabled: isDisabled
|
|
91
|
+
}, rest)), checked && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
92
|
+
name: isInderteminate ? 'minus' : 'check',
|
|
93
|
+
size: 16,
|
|
94
|
+
color: "#fff"
|
|
95
|
+
})]
|
|
96
|
+
}), label && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Label, {
|
|
97
|
+
isDisabled: isDisabled,
|
|
98
|
+
htmlFor: id,
|
|
99
|
+
color: color,
|
|
100
|
+
children: label
|
|
101
|
+
})]
|
|
102
|
+
});
|
|
92
103
|
};
|
|
93
104
|
|
|
94
105
|
var _default = CheckboxInput;
|
|
@@ -6,10 +6,18 @@ require("@testing-library/jest-dom");
|
|
|
6
6
|
|
|
7
7
|
var _ = _interopRequireDefault(require("."));
|
|
8
8
|
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
|
|
9
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
12
|
|
|
13
|
+
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
|
+
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
|
+
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
|
+
|
|
11
19
|
var setup = function setup(props) {
|
|
12
|
-
var utils = (0, _testUtils.render)( /*#__PURE__*/
|
|
20
|
+
var utils = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, _objectSpread({}, props)));
|
|
13
21
|
return utils;
|
|
14
22
|
};
|
|
15
23
|
|
|
@@ -15,6 +15,8 @@ var _conversors = require("../utils/conversors");
|
|
|
15
15
|
|
|
16
16
|
var _ColorPointer = _interopRequireDefault(require("./ColorPointer"));
|
|
17
17
|
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
22
|
var Hue = function Hue(_ref) {
|
|
@@ -31,16 +33,21 @@ var Hue = function Hue(_ref) {
|
|
|
31
33
|
v: 100,
|
|
32
34
|
a: 1
|
|
33
35
|
};
|
|
34
|
-
return /*#__PURE__*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.ColorHueWrapper, {
|
|
37
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ColorHueCircle, {
|
|
38
|
+
style: {
|
|
39
|
+
backgroundColor: (0, _conversors.hsvaToHslaString)(hsva)
|
|
40
|
+
}
|
|
41
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ColorHueSliderContainer, {
|
|
42
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorSelector.default, {
|
|
43
|
+
onMove: handleMovePointer,
|
|
44
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorPointer.default, {
|
|
45
|
+
hsva: handleHueHsva,
|
|
46
|
+
left: hsva.h / 360
|
|
47
|
+
})
|
|
48
|
+
})
|
|
49
|
+
})]
|
|
50
|
+
});
|
|
44
51
|
};
|
|
45
52
|
|
|
46
53
|
var ColorHue = /*#__PURE__*/(0, _react.memo)(Hue);
|
|
@@ -17,6 +17,8 @@ var _parsers = require("../utils/parsers");
|
|
|
17
17
|
|
|
18
18
|
var _useTheme2 = require("../../../shared/theme/hooks/useTheme");
|
|
19
19
|
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
23
|
|
|
22
24
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -65,7 +67,7 @@ var ColorInput = function ColorInput(_ref) {
|
|
|
65
67
|
(0, _react.useEffect)(function () {
|
|
66
68
|
setValue((0, _parsers.colorToOutputMode)((0, _conversors.hsvaToRgbaString)(hsva), colorMode));
|
|
67
69
|
}, [hsva, colorMode]);
|
|
68
|
-
return /*#__PURE__*/
|
|
70
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Input.default, {
|
|
69
71
|
labelBackground: {
|
|
70
72
|
dark: theme.colors.neutral.neutral6,
|
|
71
73
|
light: theme.colors.neutral.white
|
|
@@ -15,6 +15,8 @@ var _conversors = require("../utils/conversors");
|
|
|
15
15
|
|
|
16
16
|
var _styles = require("../styles");
|
|
17
17
|
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
22
|
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; }
|
|
@@ -44,15 +46,17 @@ var PickerBox = function PickerBox(_ref) {
|
|
|
44
46
|
a: 1
|
|
45
47
|
})
|
|
46
48
|
};
|
|
47
|
-
return /*#__PURE__*/
|
|
48
|
-
style: style
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ColorSaturationWrapper, {
|
|
50
|
+
style: style,
|
|
51
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorSelector.default, {
|
|
52
|
+
onMove: handleMoveColor,
|
|
53
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorPointer.default, {
|
|
54
|
+
hsva: hsva,
|
|
55
|
+
top: 1 - hsva.v / 100,
|
|
56
|
+
left: hsva.s / 100
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
});
|
|
56
60
|
};
|
|
57
61
|
|
|
58
62
|
var ColorPickerBox = /*#__PURE__*/(0, _react.memo)(PickerBox);
|
|
@@ -9,6 +9,8 @@ var _styles = require("../styles");
|
|
|
9
9
|
|
|
10
10
|
var _conversors = require("../utils/conversors");
|
|
11
11
|
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
|
|
12
14
|
var ColorPointer = function ColorPointer(_ref) {
|
|
13
15
|
var _ref$top = _ref.top,
|
|
14
16
|
top = _ref$top === void 0 ? 0.5 : _ref$top,
|
|
@@ -19,7 +21,7 @@ var ColorPointer = function ColorPointer(_ref) {
|
|
|
19
21
|
left: "".concat(left * 100, "%"),
|
|
20
22
|
backgroundColor: (0, _conversors.hsvaToHslaString)(hsva)
|
|
21
23
|
};
|
|
22
|
-
return /*#__PURE__*/
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ColorPointerWrapper, {
|
|
23
25
|
style: styles
|
|
24
26
|
});
|
|
25
27
|
};
|
|
@@ -11,9 +11,15 @@ var _useCachedCallback = require("../hooks/useCachedCallback");
|
|
|
11
11
|
|
|
12
12
|
var _styles = require("../styles");
|
|
13
13
|
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
14
16
|
var _excluded = ["onMove"];
|
|
15
17
|
|
|
16
|
-
function
|
|
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
|
+
|
|
22
|
+
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; }
|
|
17
23
|
|
|
18
24
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
19
25
|
|
|
@@ -119,7 +125,7 @@ var Selector = function Selector(_ref) {
|
|
|
119
125
|
(0, _react.useEffect)(function () {
|
|
120
126
|
return toggleMoveEvent;
|
|
121
127
|
}, [toggleMoveEvent]);
|
|
122
|
-
return /*#__PURE__*/
|
|
128
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ColorSelectorWrapper, _objectSpread({
|
|
123
129
|
ref: container,
|
|
124
130
|
onMouseDown: handleMoveStart,
|
|
125
131
|
onTouchStart: handleMoveStart,
|
|
@@ -21,6 +21,8 @@ var _useHsva3 = require("./hooks/useHsva");
|
|
|
21
21
|
|
|
22
22
|
var _styles = require("./styles");
|
|
23
23
|
|
|
24
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
+
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
27
|
|
|
26
28
|
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; }
|
|
@@ -64,40 +66,48 @@ var ColorPicker = function ColorPicker(_ref) {
|
|
|
64
66
|
onSave && onSave((0, _parsers.colorToOutputMode)((0, _conversors.hsvaToRgbaString)(hsva), (0, _parsers.colorMode)(initialColor)));
|
|
65
67
|
}
|
|
66
68
|
|
|
67
|
-
return /*#__PURE__*/
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
69
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.ColorPickerContainer, {
|
|
70
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorPickerBox.default, {
|
|
71
|
+
hsva: hsva,
|
|
72
|
+
onChange: function onChange(hsva) {
|
|
73
|
+
handleChange(hsva);
|
|
74
|
+
setInputAlert({
|
|
75
|
+
alert: undefined
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.ColorPickerContainerWrapper, {
|
|
79
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorHue.default, {
|
|
80
|
+
onChange: function onChange(hue) {
|
|
81
|
+
var modifedHsva = _objectSpread(_objectSpread({}, hsva), {}, {
|
|
82
|
+
h: hue
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
handleChange(modifedHsva);
|
|
86
|
+
setInputAlert({
|
|
87
|
+
alert: undefined
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
hsva: hsva
|
|
91
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorInput.default, {
|
|
92
|
+
hsva: hsva,
|
|
93
|
+
onChange: handleChange,
|
|
94
|
+
colorMode: (0, _parsers.colorMode)(initialColor),
|
|
95
|
+
inputAlert: inputAlert,
|
|
96
|
+
setInputAlert: setInputAlert
|
|
97
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.ColorPickerButtonsWrapper, {
|
|
98
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ColorPickerButton, {
|
|
99
|
+
bgTransparent: true,
|
|
100
|
+
onClick: function onClick() {
|
|
101
|
+
onCancel && onCancel();
|
|
102
|
+
},
|
|
103
|
+
children: "Cancelar"
|
|
104
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ColorPickerButton, {
|
|
105
|
+
onClick: handleSave,
|
|
106
|
+
children: "Salvar cor"
|
|
107
|
+
})]
|
|
108
|
+
})]
|
|
109
|
+
})]
|
|
110
|
+
});
|
|
101
111
|
};
|
|
102
112
|
|
|
103
113
|
var _default = ColorPicker;
|