@pedidopago/ui 1.3.0 → 1.3.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/components/Alert/alert.test.js +8 -8
- package/dist/components/Alert/index.d.ts +2 -2
- package/dist/components/Alert/index.d.ts.map +1 -1
- package/dist/components/Alert/index.js +7 -26
- package/dist/components/Alert/styles.d.ts +0 -12
- package/dist/components/Alert/styles.d.ts.map +1 -1
- package/dist/components/Alert/styles.js +4 -22
- package/dist/components/Alert/types.d.ts +5 -22
- package/dist/components/Alert/types.d.ts.map +1 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +11 -2
- package/dist/components/Button/styles.js +1 -1
- package/dist/components/Button/types.d.ts +1 -0
- package/dist/components/Button/types.d.ts.map +1 -1
- package/dist/components/DateInput/DateInput-example.d.ts +2 -2
- package/dist/components/DateInput/DateInput-example.d.ts.map +1 -1
- package/dist/components/DateInput/DateInput-example.js +10 -15
- package/dist/components/DateInput/dateInput.test.js +4 -4
- package/dist/components/DateInput/index.d.ts +2 -2
- package/dist/components/DateInput/index.d.ts.map +1 -1
- package/dist/components/DateInput/index.js +65 -136
- package/dist/components/DateInput/styles.d.ts +7 -29
- package/dist/components/DateInput/styles.d.ts.map +1 -1
- package/dist/components/DateInput/styles.js +15 -19
- package/dist/components/DateInput/types.d.ts +7 -14
- package/dist/components/DateInput/types.d.ts.map +1 -1
- package/dist/components/DatePicker/datepicker.test.js +8 -8
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/index.js +4 -8
- package/dist/components/DatePicker/types.d.ts +3 -4
- package/dist/components/DatePicker/types.d.ts.map +1 -1
- package/dist/components/Input/index.js +14 -15
- package/dist/components/Input/styles.d.ts +1 -0
- package/dist/components/Input/styles.d.ts.map +1 -1
- package/dist/components/Input/styles.js +39 -34
- package/dist/components/Label/index.d.ts +2 -2
- package/dist/components/Label/index.d.ts.map +1 -1
- package/dist/components/Label/index.js +12 -23
- package/dist/components/Label/label.test.d.ts +2 -0
- package/dist/components/Label/label.test.d.ts.map +1 -0
- package/dist/components/Label/label.test.js +105 -0
- package/dist/components/Label/styles.js +1 -1
- package/dist/components/Label/types.d.ts +5 -6
- package/dist/components/Label/types.d.ts.map +1 -1
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/Modal/styles.d.ts.map +1 -1
- package/dist/components/Modal/styles.js +3 -3
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +21 -15
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +13 -3
- package/dist/components/Table/styles.d.ts.map +1 -1
- package/dist/components/Table/styles.js +5 -8
- package/dist/components/Toast/components/Toast.d.ts.map +1 -1
- package/dist/components/Toast/components/Toast.js +6 -7
- package/dist/components/Toast/contexts/ToastProvider.d.ts.map +1 -1
- package/dist/components/Toast/contexts/ToastProvider.js +3 -1
- package/dist/components/Toast/toast.test.js +10 -10
- package/dist/components/Toast/types.d.ts +8 -15
- package/dist/components/Toast/types.d.ts.map +1 -1
- package/dist/components/Tooltip/components/TooltipLabel.d.ts +4 -0
- package/dist/components/Tooltip/components/TooltipLabel.d.ts.map +1 -0
- package/dist/components/Tooltip/components/TooltipLabel.js +59 -0
- package/dist/components/Tooltip/index.d.ts +2 -2
- package/dist/components/Tooltip/index.d.ts.map +1 -1
- package/dist/components/Tooltip/index.js +91 -74
- package/dist/components/Tooltip/styles.d.ts +6 -14
- package/dist/components/Tooltip/styles.d.ts.map +1 -1
- package/dist/components/Tooltip/styles.js +9 -31
- package/dist/components/Tooltip/types.d.ts +17 -19
- package/dist/components/Tooltip/types.d.ts.map +1 -1
- package/dist/components/Typography/styles.d.ts +2 -2
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
19
19
|
|
|
20
20
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
21
21
|
|
|
22
|
-
var InputGroupElement = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 8px;\n border-radius: ", ";\n font-weight: ", ";\n\n transition: all 0.2s ease-in-out;\n\n &:hover fieldset {\n border-color: ", ";\n }\n\n &:hover > div > div:first-of-type {\n border-color: ", ";\n }\n\n &:focus-within > div > div:first-of-type {\n background: ", ";\n border-color: ", ";\n }\n\n &:focus-within > div > div:first-of-type span {\n color: ", ";\n }\n\n &:focus-within {\n border-radius: 2px solid ", ";\n }\n\n &:focus-within > div {\n box-shadow: 0 0 0 2px\n ", ";\n }\n\n &:focus-within label {\n transform: translate(19px, -11px) scale(0.8);\n\n background-color: ", ";\n height: 16px;\n }\n\n &:focus-within fieldset {\n border-width: 2px;\n border-color: ", ";\n }\n\n ", "\n\n & label {\n transform: ", ";\n\n background-color: ", ";\n\n height: ", ";\n }\n"])), function (props) {
|
|
22
|
+
var InputGroupElement = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 8px;\n border-radius: ", ";\n font-weight: ", ";\n\n transition: all 0.2s ease-in-out;\n\n &:hover fieldset {\n border-color: ", ";\n }\n\n &:hover > div > div:first-of-type {\n border-color: ", ";\n &:hover label {\n color: ", ";\n }\n }\n\n &:focus-within > div > div:first-of-type {\n background: ", ";\n border-color: ", ";\n }\n\n &:focus-within > div > div:first-of-type span {\n color: ", ";\n }\n\n &:focus-within {\n border-radius: 2px solid ", ";\n }\n &:focus-within label {\n color: ", ";\n }\n\n &:focus-within > div {\n box-shadow: 0 0 0 2px\n ", ";\n }\n\n &:focus-within label {\n transform: translate(19px, -11px) scale(0.8);\n\n background-color: ", ";\n height: 16px;\n }\n\n &:focus-within fieldset {\n border-width: 2px;\n border-color: ", ";\n }\n\n ", "\n\n & label {\n transform: ", ";\n\n background-color: ", ";\n\n height: ", ";\n }\n"])), function (props) {
|
|
23
23
|
return props.theme.borderRadius.default;
|
|
24
24
|
}, function (props) {
|
|
25
25
|
return props.theme.fontWeight[400];
|
|
@@ -51,6 +51,10 @@ var InputGroupElement = _styled.default.div(_templateObject || (_templateObject
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
return theme.colors.primary.hover;
|
|
54
|
+
}, function (_ref3) {
|
|
55
|
+
var theme = _ref3.theme,
|
|
56
|
+
hasDisabled = _ref3.hasDisabled;
|
|
57
|
+
return !hasDisabled && theme.colors.neutral.neutral5;
|
|
54
58
|
}, function (props) {
|
|
55
59
|
return !props.alert && props.withAddon && props.theme.colors.primary.disabled;
|
|
56
60
|
}, function (props) {
|
|
@@ -59,8 +63,11 @@ var InputGroupElement = _styled.default.div(_templateObject || (_templateObject
|
|
|
59
63
|
return !props.alert && props.theme.colors.primary.focus;
|
|
60
64
|
}, function (props) {
|
|
61
65
|
return props.theme.colors.primary.disabled;
|
|
66
|
+
}, function (_ref4) {
|
|
67
|
+
var theme = _ref4.theme;
|
|
68
|
+
return theme.colors.neutral.neutral5;
|
|
62
69
|
}, function (props) {
|
|
63
|
-
return props.alert ? props.theme.colorMode === 'dark' ? props.theme.colors[props.alert].dark : props.theme.colors[props.alert].blurred : props.theme.colors.primary.disabled;
|
|
70
|
+
return props.alert ? props.theme.colorMode === 'dark' ? props.theme.colors[props.alert].dark : "".concat(props.theme.colors[props.alert].blurred, "33") : props.theme.colors.primary.disabled;
|
|
64
71
|
}, function (props) {
|
|
65
72
|
if (props.labelBackground) {
|
|
66
73
|
if (_typeof(props.labelBackground) === 'object') {
|
|
@@ -78,8 +85,10 @@ var InputGroupElement = _styled.default.div(_templateObject || (_templateObject
|
|
|
78
85
|
return !props.alert && props.theme.colors.primary.hover;
|
|
79
86
|
}, function (props) {
|
|
80
87
|
return props.addonContent && (0, _react.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &:focus-within > div > div:first-of-type {\n border-color: ", ";\n background-color: ", ";\n }\n "])), props.alert ? 'transparent' : props.theme.colors.primary.focus, props.alert && props.alert === 'success' ? props.theme.colors.primary.focus : '');
|
|
81
|
-
}, function (
|
|
82
|
-
|
|
88
|
+
}, function (_ref5) {
|
|
89
|
+
var hasValueOnInput = _ref5.hasValueOnInput,
|
|
90
|
+
withIcon = _ref5.withIcon;
|
|
91
|
+
return hasValueOnInput ? 'translate(19px, -11px) scale(0.8) !important' : withIcon ? 'translate(60px, calc(100% - 10px))' : 'translate(20px, calc(100% - 10px))';
|
|
83
92
|
}, function (props) {
|
|
84
93
|
if (!props.hasValueOnInput) return 'unset';
|
|
85
94
|
|
|
@@ -95,8 +104,8 @@ var InputGroupElement = _styled.default.div(_templateObject || (_templateObject
|
|
|
95
104
|
dark: props.theme.colors.neutral.black,
|
|
96
105
|
light: props.theme.colors.neutral.white
|
|
97
106
|
}[props.theme.colorMode];
|
|
98
|
-
}, function (
|
|
99
|
-
var hasValueOnInput =
|
|
107
|
+
}, function (_ref6) {
|
|
108
|
+
var hasValueOnInput = _ref6.hasValueOnInput;
|
|
100
109
|
return hasValueOnInput ? '16px' : 'unset';
|
|
101
110
|
});
|
|
102
111
|
|
|
@@ -123,59 +132,55 @@ var InputIcon = _styled.default.div(_templateObject6 || (_templateObject6 = _tag
|
|
|
123
132
|
}, function (props) {
|
|
124
133
|
return props.clickable ? 'pointer' : 'default';
|
|
125
134
|
}, function (props) {
|
|
126
|
-
return props.theme.colorMode === 'dark' ? props.theme.colors.neutral.white : props.theme.colors.neutral.
|
|
135
|
+
return props.theme.colorMode === 'dark' ? props.theme.colors.neutral.white : props.theme.colors.neutral.neutral5;
|
|
127
136
|
});
|
|
128
137
|
|
|
129
138
|
exports.InputIcon = InputIcon;
|
|
130
139
|
|
|
131
|
-
var Input = _styled.default.input(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n width: 100%;\n padding: ", ";\n flex: 1;\n height: 100%;\n border: none;\n color: ", ";\n\n &::placeholder {\n color: ", ";\n }\n\n font-family: inherit;\n outline: none;\n font-size: ", ";\n background-color: transparent;\n position: relative;\n
|
|
140
|
+
var Input = _styled.default.input(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n width: 100%;\n padding: ", ";\n flex: 1;\n height: 100%;\n border: none;\n color: ", ";\n &:disabled {\n color: ", ";\n }\n\n &::placeholder {\n color: ", ";\n }\n\n font-family: inherit;\n outline: none;\n font-size: ", ";\n background-color: transparent;\n position: relative;\n font-weight: 500;\n"])), function (props) {
|
|
132
141
|
return props.withIcon ? props.hiddenContent ? '0 0' : '0 20px 0 0' : props.hiddenContent ? '0 0 0 20px' : '0 20px';
|
|
133
142
|
}, function (props) {
|
|
134
143
|
return props.theme.colorMode === 'dark' ? props.theme.colors.neutral.white : props.theme.colors.neutral.black;
|
|
135
|
-
}, function (
|
|
136
|
-
|
|
144
|
+
}, function (_ref7) {
|
|
145
|
+
var theme = _ref7.theme;
|
|
146
|
+
return theme.colors.neutral.neutral5;
|
|
147
|
+
}, function (_ref8) {
|
|
148
|
+
var theme = _ref8.theme;
|
|
149
|
+
return theme.colors.neutral.neutral5;
|
|
137
150
|
}, function (props) {
|
|
138
151
|
return props.theme.fontSizes.xs;
|
|
139
|
-
}, function (props) {
|
|
140
|
-
return props.theme.zIndex.level2;
|
|
141
152
|
});
|
|
142
153
|
|
|
143
154
|
exports.Input = Input;
|
|
144
155
|
|
|
145
|
-
var InputLabel = _styled.default.label(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n top: 0;\n left: 0;\n height: auto;\n padding: 0 6px;\n position: absolute;\n z-index: ", ";\n pointer-events: none;\n color: ", ";\n background-color: transparent;\n transform-origin: left;\n transition:
|
|
156
|
+
var InputLabel = _styled.default.label(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n top: 0;\n left: 0;\n height: auto;\n padding: 0 6px;\n position: absolute;\n z-index: ", ";\n pointer-events: none;\n color: ", ";\n background-color: transparent;\n transform-origin: left;\n transition: all ease 0.2s;\n font-weight: 500;\n"])), function (props) {
|
|
146
157
|
return props.theme.zIndex.level1;
|
|
147
158
|
}, function (props) {
|
|
148
|
-
return props.
|
|
159
|
+
return props.theme.colorMode === 'dark' ? props.theme.colors.neutral.white : props.theme.colors.neutral.neutral3;
|
|
149
160
|
});
|
|
150
161
|
|
|
151
162
|
exports.InputLabel = InputLabel;
|
|
152
163
|
|
|
153
|
-
var Fieldset = _styled.default.fieldset(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n margin: 0;\n top: 0;\n pointer-events: none;\n padding: 0 17px;\n overflow: hidden;\n\n background-color: ", ";\n\n border-radius: ", ";\n border: 2px solid\n ", ";\n border-left: ", ";\n\n transition: all 0.2s ease;\n"])), function (
|
|
154
|
-
var alert =
|
|
155
|
-
theme =
|
|
156
|
-
hasDisabled =
|
|
164
|
+
var Fieldset = _styled.default.fieldset(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n margin: 0;\n top: 0;\n pointer-events: none;\n padding: 0 17px;\n overflow: hidden;\n\n background-color: ", ";\n\n border-radius: ", ";\n border: 2px solid\n ", ";\n border-left: ", ";\n\n transition: all 0.2s ease;\n"])), function (_ref9) {
|
|
165
|
+
var alert = _ref9.alert,
|
|
166
|
+
theme = _ref9.theme,
|
|
167
|
+
hasDisabled = _ref9.hasDisabled;
|
|
157
168
|
|
|
158
169
|
if (alert && !hasDisabled) {
|
|
159
|
-
return
|
|
160
|
-
light: theme.colors[alert].blurred,
|
|
161
|
-
dark: theme.colors[alert].dark
|
|
162
|
-
}[theme.colorMode];
|
|
170
|
+
return "".concat(theme.colors[alert].blurred, "33");
|
|
163
171
|
}
|
|
164
172
|
|
|
165
173
|
if (hasDisabled) {
|
|
166
|
-
return
|
|
167
|
-
light: theme.colors.neutral.neutral1,
|
|
168
|
-
dark: theme.colors.neutral.neutral4
|
|
169
|
-
}[theme.colorMode];
|
|
174
|
+
return theme.colors.neutral.neutral1;
|
|
170
175
|
}
|
|
171
176
|
|
|
172
177
|
return 'transparent';
|
|
173
178
|
}, function (props) {
|
|
174
179
|
return props.withAddon ? "0 ".concat(props.theme.borderRadius.default, " ").concat(props.theme.borderRadius.default, " 0") : props.theme.borderRadius.default;
|
|
175
|
-
}, function (
|
|
176
|
-
var theme =
|
|
177
|
-
hasDisabled =
|
|
178
|
-
alert =
|
|
180
|
+
}, function (_ref10) {
|
|
181
|
+
var theme = _ref10.theme,
|
|
182
|
+
hasDisabled = _ref10.hasDisabled,
|
|
183
|
+
alert = _ref10.alert;
|
|
179
184
|
|
|
180
185
|
if (alert && !hasDisabled) {
|
|
181
186
|
return theme.colors[alert].default;
|
|
@@ -223,10 +228,10 @@ var AddonElement = _styled.default.div(_templateObject13 || (_templateObject13 =
|
|
|
223
228
|
light: props.theme.colors.neutral.neutral1,
|
|
224
229
|
dark: props.theme.colors.neutral.neutral6
|
|
225
230
|
}[props.theme.colorMode];
|
|
226
|
-
}, function (
|
|
227
|
-
var theme =
|
|
228
|
-
hasDisabled =
|
|
229
|
-
alert =
|
|
231
|
+
}, function (_ref11) {
|
|
232
|
+
var theme = _ref11.theme,
|
|
233
|
+
hasDisabled = _ref11.hasDisabled,
|
|
234
|
+
alert = _ref11.alert;
|
|
230
235
|
|
|
231
236
|
if (alert && !hasDisabled) {
|
|
232
237
|
return theme.colors[alert].default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Label/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Label/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAG3B,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,UAAU,CAkB9B,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -7,43 +7,32 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = require("@emotion/react");
|
|
9
9
|
|
|
10
|
-
var _styles = require("./styles");
|
|
11
|
-
|
|
12
10
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
13
11
|
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
var _invertColor = require("../../utils/invertColor");
|
|
12
|
+
var _styles = require("./styles");
|
|
17
13
|
|
|
18
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
15
|
|
|
20
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
17
|
|
|
22
18
|
var LabelInput = function LabelInput(_ref) {
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
var label = _ref.label,
|
|
20
|
+
_ref$labelType = _ref.labelType,
|
|
21
|
+
labelType = _ref$labelType === void 0 ? 'success' : _ref$labelType,
|
|
22
|
+
Icon = _ref.icon,
|
|
23
|
+
_ref$iconSide = _ref.iconSide,
|
|
24
|
+
iconSide = _ref$iconSide === void 0 ? 'left' : _ref$iconSide;
|
|
29
25
|
var theme = (0, _react.useTheme)();
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
return _allIcons.allIcons.some(function (svg) {
|
|
33
|
-
return svg.name === Icon;
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
var backgroundColor = LabelType ? theme.colors[LabelType].blurred : Color || (theme.colorMode === 'dark' ? theme.colors.neutral.neutral5 : theme.colors.neutral.neutral1);
|
|
38
|
-
var color = (0, _invertColor.invertColor)(backgroundColor || '#fff', true);
|
|
26
|
+
var backgroundColor = theme.colors[labelType].blurred;
|
|
27
|
+
var textColor = theme.colors[labelType].default;
|
|
39
28
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.LabelWrapper, {
|
|
40
29
|
backgroundColor: backgroundColor,
|
|
41
|
-
color:
|
|
30
|
+
color: textColor,
|
|
42
31
|
"data-testid": "label-wrapper",
|
|
43
|
-
children: [Icon &&
|
|
32
|
+
children: [Icon && iconSide === 'left' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
44
33
|
name: Icon,
|
|
45
34
|
size: "16px"
|
|
46
|
-
}),
|
|
35
|
+
}), label || 'default', Icon && iconSide === 'right' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
47
36
|
name: Icon,
|
|
48
37
|
size: "16px"
|
|
49
38
|
})]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.test.d.ts","sourceRoot":"","sources":["../../../src/components/Label/label.test.tsx"],"names":[],"mappings":"AAEA,OAAO,yCAAyC,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _testUtils = require("../../shared/tests/test-utils");
|
|
4
|
+
|
|
5
|
+
require("@testing-library/jest-dom/extend-expect");
|
|
6
|
+
|
|
7
|
+
var _ = _interopRequireDefault(require("."));
|
|
8
|
+
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
|
|
13
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
14
|
+
|
|
15
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
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; }
|
|
20
|
+
|
|
21
|
+
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; }
|
|
22
|
+
|
|
23
|
+
var setup = function setup(props) {
|
|
24
|
+
var utils = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, _objectSpread({}, props)));
|
|
25
|
+
var LabelWrapper = utils.getByTestId('label-wrapper');
|
|
26
|
+
return _objectSpread({
|
|
27
|
+
LabelWrapper: LabelWrapper
|
|
28
|
+
}, utils);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
describe('Label', function () {
|
|
32
|
+
it('Should be Rendered', function () {
|
|
33
|
+
var _setup = setup(),
|
|
34
|
+
LabelWrapper = _setup.LabelWrapper;
|
|
35
|
+
|
|
36
|
+
expect(LabelWrapper).toBeInTheDocument();
|
|
37
|
+
});
|
|
38
|
+
it('Render other labels', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
39
|
+
var LabelTest, _setup2, findByText, label;
|
|
40
|
+
|
|
41
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
42
|
+
while (1) {
|
|
43
|
+
switch (_context.prev = _context.next) {
|
|
44
|
+
case 0:
|
|
45
|
+
LabelTest = 'Teste';
|
|
46
|
+
_setup2 = setup({
|
|
47
|
+
label: LabelTest
|
|
48
|
+
}), findByText = _setup2.findByText;
|
|
49
|
+
_context.next = 4;
|
|
50
|
+
return findByText(LabelTest);
|
|
51
|
+
|
|
52
|
+
case 4:
|
|
53
|
+
label = _context.sent;
|
|
54
|
+
expect(label.innerHTML).toEqual(LabelTest);
|
|
55
|
+
|
|
56
|
+
case 6:
|
|
57
|
+
case "end":
|
|
58
|
+
return _context.stop();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}, _callee);
|
|
62
|
+
})));
|
|
63
|
+
it('Render Icons', function () {
|
|
64
|
+
var _LabelWrapper$querySe;
|
|
65
|
+
|
|
66
|
+
var icon = 'mail';
|
|
67
|
+
|
|
68
|
+
var _setup3 = setup({
|
|
69
|
+
icon: icon
|
|
70
|
+
}),
|
|
71
|
+
LabelWrapper = _setup3.LabelWrapper;
|
|
72
|
+
|
|
73
|
+
var SvgName = (_LabelWrapper$querySe = LabelWrapper.querySelector('svg')) === null || _LabelWrapper$querySe === void 0 ? void 0 : _LabelWrapper$querySe.getAttribute('name');
|
|
74
|
+
expect(SvgName).toEqual(icon);
|
|
75
|
+
});
|
|
76
|
+
it('Render Icons in Left', function () {
|
|
77
|
+
var _LabelWrapper$querySe2;
|
|
78
|
+
|
|
79
|
+
var label = 'Testing';
|
|
80
|
+
|
|
81
|
+
var _setup4 = setup({
|
|
82
|
+
icon: 'mail',
|
|
83
|
+
label: label
|
|
84
|
+
}),
|
|
85
|
+
LabelWrapper = _setup4.LabelWrapper;
|
|
86
|
+
|
|
87
|
+
var Icon = (_LabelWrapper$querySe2 = LabelWrapper.querySelector('svg')) === null || _LabelWrapper$querySe2 === void 0 ? void 0 : _LabelWrapper$querySe2.outerHTML;
|
|
88
|
+
expect(LabelWrapper.innerHTML).toEqual(Icon + label);
|
|
89
|
+
});
|
|
90
|
+
it('Render Icons in Right', function () {
|
|
91
|
+
var _LabelWrapper$querySe3;
|
|
92
|
+
|
|
93
|
+
var label = 'Testing';
|
|
94
|
+
|
|
95
|
+
var _setup5 = setup({
|
|
96
|
+
icon: 'mail',
|
|
97
|
+
iconSide: 'right',
|
|
98
|
+
label: label
|
|
99
|
+
}),
|
|
100
|
+
LabelWrapper = _setup5.LabelWrapper;
|
|
101
|
+
|
|
102
|
+
var Icon = (_LabelWrapper$querySe3 = LabelWrapper.querySelector('svg')) === null || _LabelWrapper$querySe3 === void 0 ? void 0 : _LabelWrapper$querySe3.outerHTML;
|
|
103
|
+
expect(LabelWrapper.innerHTML).toEqual(label + Icon);
|
|
104
|
+
});
|
|
105
|
+
});
|
|
@@ -21,7 +21,7 @@ var LabelWrapper = _styled.default.div(_templateObject || (_templateObject = _ta
|
|
|
21
21
|
return color;
|
|
22
22
|
}, function (_ref3) {
|
|
23
23
|
var theme = _ref3.theme;
|
|
24
|
-
return theme.fontSizes.
|
|
24
|
+
return theme.fontSizes.xxs;
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
exports.LabelWrapper = LabelWrapper;
|
|
@@ -7,11 +7,10 @@ export declare type IStyleProps = {
|
|
|
7
7
|
backgroundColor?: string;
|
|
8
8
|
color?: string;
|
|
9
9
|
};
|
|
10
|
-
export declare type
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Color?: string;
|
|
10
|
+
export declare type LabelProps = {
|
|
11
|
+
labelType?: 'success' | 'error' | 'warning' | 'informative' | 'critical' | 'success_secondary' | 'warning_secondary';
|
|
12
|
+
icon?: IconName;
|
|
13
|
+
label?: string;
|
|
14
|
+
iconSide?: 'left' | 'right';
|
|
16
15
|
};
|
|
17
16
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Label/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,oBAAY,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,oBAAY,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Label/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,oBAAY,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,SAAS,CAAC,EACN,SAAS,GACT,OAAO,GACP,SAAS,GACT,aAAa,GACb,UAAU,GACV,mBAAmB,GACnB,mBAAmB,CAAC;IACxB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B,CAAC"}
|
|
@@ -13,7 +13,7 @@ var _useDisableBodyScroll = require("../../shared/hooks/useDisableBodyScroll");
|
|
|
13
13
|
|
|
14
14
|
var _useKeyPress = require("../../shared/hooks/useKeyPress");
|
|
15
15
|
|
|
16
|
-
var _useWindowSize2 = require("
|
|
16
|
+
var _useWindowSize2 = require("../../shared/hooks/useWindowSize");
|
|
17
17
|
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/styles.ts"],"names":[],"mappings":";AACA,OAAO,EAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C,UAAU,mBAAmB;IAC3B,IAAI,EAAE,OAAO,CAAC;IAEd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,eAAe,EAAE,MAAM,CAAC;IAExB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,cAAc;;;+
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/styles.ts"],"names":[],"mappings":";AACA,OAAO,EAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C,UAAU,mBAAmB;IAC3B,IAAI,EAAE,OAAO,CAAC;IAEd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,eAAe,EAAE,MAAM,CAAC;IAExB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,cAAc;;;+HAsBzB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;UACjB,OAAO;;;yGA4Cb,CAAC;AAEH,eAAO,MAAM,OAAO;;;yGAgBlB,CAAC"}
|
|
@@ -26,7 +26,7 @@ var ModalContainer = _styled.default.div(function (_ref) {
|
|
|
26
26
|
var theme = _ref.theme,
|
|
27
27
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
28
28
|
|
|
29
|
-
return (0, _react.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n\n padding-bottom: 16px;\n\n width: 100%;\n max-width: ", ";\n max-height: ", ";\n\n position: fixed;\n left: ", ";\n top: ", ";\n transform: ", ";\n\n opacity: ", ";\n\n pointer-events: ", ";\n\n transition: opacity ease ", ";\n "])), props.maxWidth, props.maxHeight, props.left, props.top, props.anchorTranslate, props.open ? 1 : 0, props.open ? 'auto' : 'none', theme.transition.speed);
|
|
29
|
+
return (0, _react.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n\n padding-bottom: 16px;\n\n width: 100%;\n max-width: ", ";\n max-height: ", ";\n\n position: fixed;\n left: ", ";\n top: ", ";\n z-index: ", ";\n transform: ", ";\n\n opacity: ", ";\n\n pointer-events: ", ";\n\n transition: opacity ease ", ";\n "])), props.maxWidth, props.maxHeight, props.left, props.top, theme.zIndex.level24, props.anchorTranslate, props.open ? 1 : 0, props.open ? 'auto' : 'none', theme.transition.speed);
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
exports.ModalContainer = ModalContainer;
|
|
@@ -35,14 +35,14 @@ var ModalElement = _styled.default.div(function (_ref2) {
|
|
|
35
35
|
var theme = _ref2.theme,
|
|
36
36
|
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
37
37
|
|
|
38
|
-
return (0, _react.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n max-height: ", ";\n\n border-radius: ", ";\n\n
|
|
38
|
+
return (0, _react.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n max-height: ", ";\n\n border-radius: ", ";\n\n overflow-y: auto;\n overflow-x: hidden;\n\n transform: scale(", ");\n\n background: ", ";\n box-shadow: ", ";\n\n transition: transform ease ", ";\n\n &::-webkit-scrollbar {\n width: 6px;\n }\n\n &::-webkit-scrollbar-track {\n background: transparent;\n }\n\n &::-webkit-scrollbar-thumb {\n border-radius: ", ";\n background: ", ";\n }\n\n ", "\n "])), props.maxHeight, theme.borderRadius.default, props.open ? 1 : 0.8, theme.colors.background.light, theme.shadow.level1, theme.transition.speed, theme.borderRadius.default, theme.colors.primary.default, props.hideScrollBar && (0, _react.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ::-webkit-scrollbar {\n display: none;\n }\n\n scrollbar-width: none;\n\n -ms-overflow-style: none;\n "]))));
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
exports.ModalElement = ModalElement;
|
|
42
42
|
|
|
43
43
|
var Overlay = _styled.default.div(function (props) {
|
|
44
44
|
var theme = props.theme;
|
|
45
|
-
return (0, _react.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: fixed;\n left: 0px;\n right: 0px;\n top: 0px;\n bottom: 0px;\n\n background: ", ";\n opacity: 0;\n\n transition: opacity ease ", ";\n "])), theme.colors.neutral.neutral5, theme.transition.speed);
|
|
45
|
+
return (0, _react.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: fixed;\n left: 0px;\n right: 0px;\n top: 0px;\n bottom: 0px;\n z-index: ", ";\n\n background: ", ";\n opacity: 0;\n\n transition: opacity ease ", ";\n "])), theme.zIndex.level24, theme.colors.neutral.neutral5, theme.transition.speed);
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
exports.Overlay = Overlay;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EAKpB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAQtC,QAAA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EAKpB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAQtC,QAAA,MAAM,MAAM,kJAqIX,CAAC;AAGF,eAAe,MAAM,CAAC"}
|
|
@@ -90,18 +90,32 @@ var Select = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
setSelectedOption(option);
|
|
93
|
+
setFilled(option !== undefined);
|
|
93
94
|
setOptionsMenuOpen(false);
|
|
94
|
-
}
|
|
95
|
+
} // Sets default value
|
|
96
|
+
|
|
95
97
|
|
|
96
98
|
(0, _react.useEffect)(function () {
|
|
97
|
-
// Sets default value
|
|
98
99
|
if (rest.defaultValue) {
|
|
99
100
|
var defaultOptionIndex = options.findIndex(function (c) {
|
|
100
101
|
return c.value === rest.defaultValue;
|
|
101
102
|
});
|
|
102
103
|
if (defaultOptionIndex >= 0) selectOption(defaultOptionIndex);
|
|
103
104
|
}
|
|
104
|
-
}, []);
|
|
105
|
+
}, []); // Assures the option is selected throughout renders.
|
|
106
|
+
|
|
107
|
+
(0, _react.useEffect)(function () {
|
|
108
|
+
var _inputRef$current;
|
|
109
|
+
|
|
110
|
+
if (selectedOption === undefined || ((_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value) !== options[selectedOption].value) {
|
|
111
|
+
var optionIndex = options.findIndex(function (c) {
|
|
112
|
+
var _inputRef$current2;
|
|
113
|
+
|
|
114
|
+
return c.value === ((_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.value);
|
|
115
|
+
});
|
|
116
|
+
if (optionIndex >= 0) selectOption(optionIndex);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
105
119
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
106
120
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.SelectContainer, {
|
|
107
121
|
filled: filled || !!placeholder,
|
|
@@ -137,7 +151,7 @@ var Select = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
137
151
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
138
152
|
name: "chevron-down"
|
|
139
153
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("fieldset", {
|
|
140
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("legend", {
|
|
154
|
+
children: !!label && /*#__PURE__*/(0, _jsxRuntime.jsx)("legend", {
|
|
141
155
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
142
156
|
fontSize: "xxs",
|
|
143
157
|
variant: "span",
|
|
@@ -145,7 +159,7 @@ var Select = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
145
159
|
})
|
|
146
160
|
})
|
|
147
161
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("fieldset", {
|
|
148
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("legend", {
|
|
162
|
+
children: !!label && /*#__PURE__*/(0, _jsxRuntime.jsx)("legend", {
|
|
149
163
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
150
164
|
fontSize: "xxs",
|
|
151
165
|
variant: "span",
|
|
@@ -156,17 +170,10 @@ var Select = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
156
170
|
}), !!helperText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
157
171
|
fontSize: "xxs",
|
|
158
172
|
children: helperText
|
|
159
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", _objectSpread(
|
|
173
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", _objectSpread({
|
|
160
174
|
ref: inputRef,
|
|
161
175
|
tabIndex: -1
|
|
162
|
-
}, rest)
|
|
163
|
-
onChange: function onChange(e) {
|
|
164
|
-
var _rest$onChange;
|
|
165
|
-
|
|
166
|
-
setFilled(!!e.currentTarget.value);
|
|
167
|
-
(_rest$onChange = rest.onChange) === null || _rest$onChange === void 0 ? void 0 : _rest$onChange.call(rest, e);
|
|
168
|
-
}
|
|
169
|
-
}))]
|
|
176
|
+
}, rest))]
|
|
170
177
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.OptionsModal, {
|
|
171
178
|
open: optionsMenuOpen,
|
|
172
179
|
left: "".concat((_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.getBoundingClientRect().left, "px"),
|
|
@@ -176,7 +183,6 @@ var Select = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
176
183
|
offsetY: "".concat((_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.getBoundingClientRect().height, "px"),
|
|
177
184
|
maxWidth: "".concat((_containerRef$current4 = containerRef.current) === null || _containerRef$current4 === void 0 ? void 0 : _containerRef$current4.getBoundingClientRect().width, "px"),
|
|
178
185
|
hideOverlay: true,
|
|
179
|
-
disableScrollOnOpen: false,
|
|
180
186
|
onClose: function onClose() {
|
|
181
187
|
return setOptionsMenuOpen(false);
|
|
182
188
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Table/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAkD,MAAM,OAAO,CAAC;AAsBjG,OAAO,EAAE,WAAW,EAAkB,MAAM,SAAS,CAAC;AAMtD,wBAAgB,KAAK,CAAC,EACpB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,MAAM,EACN,IAAI,EACJ,GAAG,IAAI,EACR,EAAE,WAAW,GAAG,wBAAwB,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Table/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAkD,MAAM,OAAO,CAAC;AAsBjG,OAAO,EAAE,WAAW,EAAkB,MAAM,SAAS,CAAC;AAMtD,wBAAgB,KAAK,CAAC,EACpB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,MAAM,EACN,IAAI,EACJ,GAAG,IAAI,EACR,EAAE,WAAW,GAAG,wBAAwB,CAAC,OAAO,CAAC,eAsMjD"}
|
|
@@ -206,13 +206,23 @@ function Table(_ref) {
|
|
|
206
206
|
}), header.map(function (label) {
|
|
207
207
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("th", {
|
|
208
208
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
209
|
-
|
|
209
|
+
color: "neutral.neutral5",
|
|
210
|
+
fontSize: "xxxs",
|
|
210
211
|
fontWeight: "600",
|
|
211
212
|
children: label
|
|
212
213
|
})
|
|
213
214
|
}, (0, _GenerateKey.generateKey)());
|
|
214
215
|
})]
|
|
215
|
-
}), haveActions && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
216
|
+
}), haveActions && /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
217
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("th", {
|
|
218
|
+
children: !selectedRows.length && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
219
|
+
color: "neutral.neutral5",
|
|
220
|
+
fontSize: "xxxs",
|
|
221
|
+
fontWeight: "600",
|
|
222
|
+
children: "A\xE7\xF5es"
|
|
223
|
+
})
|
|
224
|
+
})
|
|
225
|
+
})]
|
|
216
226
|
})
|
|
217
227
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("tbody", {
|
|
218
228
|
children: rowsWithKey.map(function (row) {
|
|
@@ -229,7 +239,7 @@ function Table(_ref) {
|
|
|
229
239
|
}), row.items.map(function (cell) {
|
|
230
240
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
231
241
|
children: typeof cell === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
232
|
-
fontSize: "
|
|
242
|
+
fontSize: "xxxs",
|
|
233
243
|
fontWeight: "500",
|
|
234
244
|
children: cell
|
|
235
245
|
}) : cell
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Table/styles.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,eAAO,MAAM,WAAW;;;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Table/styles.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,eAAO,MAAM,WAAW;;;uIAqGtB,CAAC;AAEH,eAAO,MAAM,cAAc;;;yGAG1B,CAAC;AAEF,eAAO,MAAM,aAAa;;;0IAmExB,CAAC;AAEH,eAAO,MAAM,eAAe;;;yGAE3B,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;0IAiBhC,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;yGAiB7B,CAAC;AAEF,eAAO,MAAM,eAAe;;;8HA6B3B,CAAC"}
|
|
@@ -17,13 +17,13 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
17
17
|
|
|
18
18
|
var StyledTable = _styled.default.table(function (props) {
|
|
19
19
|
var theme = props.theme;
|
|
20
|
-
return (0, _react.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-spacing: 0px;\n\n & > thead {\n & > tr {\n height: 64px;\n\n & > th {\n background: hsla(156, 13%, 92%, 0.5);\n border-top: 1px solid\n ", ";\n border-bottom: 1px solid\n ", ";\n padding-left: 16px;\n padding-right: 16px;\n text-align: left;\n
|
|
20
|
+
return (0, _react.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n border-spacing: 0px;\n\n & > thead {\n & > tr {\n height: 64px;\n\n & > th {\n background: hsla(156, 13%, 92%, 0.5);\n border-top: 1px solid\n ", ";\n border-bottom: 1px solid\n ", ";\n padding-left: 16px;\n padding-right: 16px;\n text-align: left;\n\n &:first-of-type {\n border-left: 1px solid\n ", ";\n border-radius: 8px 0px 0px 0px;\n }\n\n &:last-child {\n border-right: 1px solid\n ", ";\n border-radius: 0px 8px 0px 0px;\n }\n }\n }\n }\n\n & > tbody {\n tr {\n height: 64px;\n &:nth-child(even) {\n background: hsla(150, 16%, 97%, 0.75);\n }\n &:not(:last-child) {\n & > td {\n border-bottom: 1px solid\n ", ";\n }\n }\n\n &:hover {\n & > td {\n background: ", ";\n\n &:first-of-type {\n border-radius: 4px 0px 0px 4px;\n }\n\n &:last-child {\n border-radius: 0px 4px 4px 0px;\n }\n }\n }\n\n &:focus {\n outline: 2px solid ", ";\n border-radius: 4px;\n }\n\n &[data-selected='true'] {\n & > td {\n background: ", ";\n }\n }\n\n & > td {\n padding-left: 16px;\n padding-right: 16px;\n\n text-align: left;\n\n color: ", ";\n }\n }\n }\n "])), {
|
|
21
21
|
dark: theme.colors.neutral.neutral5,
|
|
22
22
|
light: theme.colors.neutral.neutral2
|
|
23
23
|
}[theme.colorMode], {
|
|
24
24
|
dark: theme.colors.neutral.neutral5,
|
|
25
25
|
light: theme.colors.neutral.neutral2
|
|
26
|
-
}[theme.colorMode],
|
|
26
|
+
}[theme.colorMode], {
|
|
27
27
|
dark: theme.colors.neutral.neutral5,
|
|
28
28
|
light: theme.colors.neutral.neutral2
|
|
29
29
|
}[theme.colorMode], {
|
|
@@ -31,7 +31,7 @@ var StyledTable = _styled.default.table(function (props) {
|
|
|
31
31
|
light: theme.colors.neutral.neutral2
|
|
32
32
|
}[theme.colorMode], {
|
|
33
33
|
dark: theme.colors.neutral.neutral5,
|
|
34
|
-
light: theme.colors.neutral.
|
|
34
|
+
light: theme.colors.neutral.neutral1
|
|
35
35
|
}[theme.colorMode], {
|
|
36
36
|
dark: theme.colors.neutral.neutral6,
|
|
37
37
|
light: theme.colors.neutral.neutral1
|
|
@@ -49,7 +49,7 @@ exports.SelectedHeader = SelectedHeader;
|
|
|
49
49
|
|
|
50
50
|
var ActionsButton = _styled.default.button(function (props) {
|
|
51
51
|
var theme = props.theme;
|
|
52
|
-
return (0, _react.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n appearance: none;\n font-family: inherit;\n\n display: flex;\n align-items: center;\n gap: 8px;\n\n margin: 0px -2px 0px 0px;\n outline: none;\n border: 2px solid\n ", ";\n padding: 0px 24px;\n
|
|
52
|
+
return (0, _react.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n appearance: none;\n font-family: inherit;\n\n display: flex;\n align-items: center;\n gap: 8px;\n\n margin: 0px -2px 0px 0px;\n outline: none;\n border: 2px solid\n ", ";\n padding: 0px 24px;\n height: 44px;\n\n white-space: nowrap;\n\n color: ", ";\n background: ", ";\n\n transition: background-color linear ", ";\n\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n\n &:first-of-type {\n color: ", ";\n border-radius: 8px 0px 0px 8px;\n }\n\n &:last-of-type {\n border-radius: 0px 8px 8px 0px;\n }\n\n &:only-child {\n border-radius: 8px;\n }\n\n &:hover,\n &:focus {\n z-index: 1;\n\n border-color: ", ";\n background: ", ";\n }\n\n &:active {\n background: ", ";\n }\n "])), {
|
|
53
53
|
dark: theme.colors.neutral.neutral4,
|
|
54
54
|
light: theme.colors.neutral.neutral2
|
|
55
55
|
}[theme.colorMode], theme.colors.neutral.neutral5, {
|
|
@@ -85,10 +85,7 @@ var MenuItemContainer = _styled.default.div(_templateObject6 || (_templateObject
|
|
|
85
85
|
return props.isOpen ? 'block' : 'none';
|
|
86
86
|
}, function (_ref) {
|
|
87
87
|
var theme = _ref.theme;
|
|
88
|
-
return
|
|
89
|
-
dark: theme.colors.neutral.neutral6,
|
|
90
|
-
light: theme.colors.neutral.neutral1
|
|
91
|
-
}[theme.colorMode];
|
|
88
|
+
return theme.colors.neutral.white;
|
|
92
89
|
}, function (props) {
|
|
93
90
|
return props.posRight ? props.posRight : 0;
|
|
94
91
|
}, function (props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../../src/components/Toast/components/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAa,MAAM,OAAO,CAAC;AAOtC,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,UAAU,CAAC;AAEhD,QAAA,MAAM,KAAK,EAAE,EAAE,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../../src/components/Toast/components/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAa,MAAM,OAAO,CAAC;AAOtC,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,UAAU,CAAC;AAEhD,QAAA,MAAM,KAAK,EAAE,EAAE,CAAC,WAAW,CAyE1B,CAAC;AAEF,eAAe,KAAK,CAAC"}
|