@wireapp/react-ui-kit 9.18.0 → 9.18.1
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/lib/Form/Button.js +1 -15
- package/lib/Form/Button.styles.js +157 -110
- package/lib/Form/ButtonLink.d.ts.map +1 -1
- package/lib/Form/ButtonLink.js +5 -16
- package/lib/Form/Checkbox.js +75 -45
- package/lib/Form/CodeInput.js +17 -6
- package/lib/Form/DropFileInput.js +5 -14
- package/lib/Form/ErrorMessage.js +8 -19
- package/lib/Form/Form.d.ts.map +1 -1
- package/lib/Form/Form.js +2 -2
- package/lib/Form/IndicatorRangeInput.js +6 -19
- package/lib/Form/IndicatorRangeInput.styles.js +36 -6
- package/lib/Form/Input.js +21 -18
- package/lib/Form/InputBlock.d.ts +1 -1
- package/lib/Form/InputBlock.d.ts.map +1 -1
- package/lib/Form/InputBlock.js +1 -1
- package/lib/Form/InputLabel.js +6 -20
- package/lib/Form/InputSubmitCombo.js +22 -25
- package/lib/Form/RangeInput.d.ts +0 -1
- package/lib/Form/RangeInput.d.ts.map +1 -1
- package/lib/Form/RangeInput.js +2 -14
- package/lib/Form/RangeInput.styles.js +26 -14
- package/lib/Form/RoundIconButton.js +14 -16
- package/lib/Form/Select.d.ts.map +1 -1
- package/lib/Form/Select.js +9 -16
- package/lib/Form/SelectComponents.d.ts.map +1 -1
- package/lib/Form/SelectComponents.js +21 -35
- package/lib/Form/SelectStyles.js +164 -82
- package/lib/Form/TextArea.js +11 -4
- package/lib/Form/Tooltip.js +2 -14
- package/lib/GlobalStyle.d.ts +0 -1
- package/lib/GlobalStyle.d.ts.map +1 -1
- package/lib/GlobalStyle.js +17 -3
- package/lib/Icon/AddPeopleIcon.js +1 -15
- package/lib/Icon/ArchiveIcon.js +1 -1
- package/lib/Icon/ArrowDown.js +1 -15
- package/lib/Icon/ArrowIcon.js +1 -15
- package/lib/Icon/AttachmentIcon.js +1 -1
- package/lib/Icon/AudioVideoIcon.js +1 -1
- package/lib/Icon/BlockIcon.js +1 -1
- package/lib/Icon/Brand/AndroidIcon.js +1 -1
- package/lib/Icon/Brand/AppleIcon.js +1 -1
- package/lib/Icon/Brand/ChromeIcon.js +1 -1
- package/lib/Icon/Brand/FacebookIcon.js +1 -1
- package/lib/Icon/Brand/GitHubIcon.js +1 -1
- package/lib/Icon/Brand/LinkedInIcon.js +1 -1
- package/lib/Icon/Brand/LinuxIcon.js +1 -1
- package/lib/Icon/Brand/MicrosoftIcon.js +1 -1
- package/lib/Icon/Brand/TwitterIcon.js +1 -1
- package/lib/Icon/CallIcon.js +1 -1
- package/lib/Icon/CamIcon.js +1 -1
- package/lib/Icon/CameraIcon.js +1 -15
- package/lib/Icon/CertificateExpired.js +1 -1
- package/lib/Icon/CertificateRevoked.js +1 -1
- package/lib/Icon/CheckIcon.js +1 -1
- package/lib/Icon/CheckRoundIcon.js +1 -1
- package/lib/Icon/ChevronIcon.js +1 -15
- package/lib/Icon/CircleCloseIcon.js +1 -1
- package/lib/Icon/CloseIcon.js +1 -1
- package/lib/Icon/CopyIcon.js +1 -1
- package/lib/Icon/DeviceIcon.js +1 -1
- package/lib/Icon/DownloadIcon.js +1 -1
- package/lib/Icon/EditDocumentIcon.js +1 -15
- package/lib/Icon/EditIcon.js +1 -1
- package/lib/Icon/EnterIcon.js +1 -1
- package/lib/Icon/ErrorIcon.js +1 -1
- package/lib/Icon/ExpiresSoon.js +1 -1
- package/lib/Icon/FileIcon.js +1 -1
- package/lib/Icon/GifIcon.js +1 -1
- package/lib/Icon/GridIcon.js +1 -15
- package/lib/Icon/GroupIcon.js +1 -1
- package/lib/Icon/HangupIcon.js +1 -1
- package/lib/Icon/HideIcon.js +1 -1
- package/lib/Icon/ImageIcon.js +1 -1
- package/lib/Icon/InfoIcon.js +1 -1
- package/lib/Icon/InviteIcon.js +1 -1
- package/lib/Icon/LeaveIcon.js +1 -1
- package/lib/Icon/LinkIcon.js +1 -15
- package/lib/Icon/ListIcon.js +1 -1
- package/lib/Icon/LockIcon.js +1 -1
- package/lib/Icon/MLSVerified.js +1 -1
- package/lib/Icon/MessageIcon.js +1 -1
- package/lib/Icon/MinusIcon.js +1 -1
- package/lib/Icon/MoreIcon.js +1 -1
- package/lib/Icon/MuteIcon.js +1 -1
- package/lib/Icon/NotificationIcon.js +1 -1
- package/lib/Icon/NotificationOffIcon.js +1 -1
- package/lib/Icon/OptionsIcon.js +1 -1
- package/lib/Icon/OutlineCheck.js +1 -1
- package/lib/Icon/PeopleIcon.js +1 -15
- package/lib/Icon/PingIcon.js +1 -1
- package/lib/Icon/PlaneIcon.js +1 -1
- package/lib/Icon/PlusIcon.js +1 -1
- package/lib/Icon/ProfileIcon.js +1 -1
- package/lib/Icon/ProteusVerified.js +1 -1
- package/lib/Icon/RecordBoldIcon.js +4 -18
- package/lib/Icon/RecordIcon.js +1 -1
- package/lib/Icon/RecordPendingIcon.js +1 -1
- package/lib/Icon/ReloadIcon.js +1 -1
- package/lib/Icon/SVGIcon.js +2 -14
- package/lib/Icon/ScreenshareIcon.js +1 -1
- package/lib/Icon/SearchIcon.js +1 -1
- package/lib/Icon/ServicesIcon.js +1 -1
- package/lib/Icon/SettingsIcon.js +1 -1
- package/lib/Icon/ShowIcon.js +1 -1
- package/lib/Icon/SignIcon.js +1 -1
- package/lib/Icon/SpeakerIcon.js +1 -1
- package/lib/Icon/StarIcon.js +1 -1
- package/lib/Icon/SupportIcon.js +1 -1
- package/lib/Icon/TeamIcon.js +1 -1
- package/lib/Icon/TimedIcon.js +1 -1
- package/lib/Icon/TrashCrossIcon.js +1 -1
- package/lib/Icon/TrashIcon.js +1 -1
- package/lib/Icon/TriangleIcon.js +1 -15
- package/lib/Icon/UploadIcon.js +1 -1
- package/lib/Icon/VerificationShieldIcon.js +1 -4
- package/lib/Icon/WireIcon.js +1 -1
- package/lib/Identity/Animation.js +62 -88
- package/lib/Identity/Avatar.js +2 -2
- package/lib/Identity/AvatarGrid.js +4 -16
- package/lib/Identity/Logo.js +1 -15
- package/lib/Identity/colors-v2.js +25 -3
- package/lib/Identity/colors.js +11 -2
- package/lib/Layout/Box.d.ts +1 -1
- package/lib/Layout/Box.d.ts.map +1 -1
- package/lib/Layout/Box.js +1 -1
- package/lib/Layout/Column.d.ts +1 -1
- package/lib/Layout/Column.d.ts.map +1 -1
- package/lib/Layout/Column.js +2 -2
- package/lib/Layout/Container.js +6 -20
- package/lib/Layout/Content.d.ts +1 -1
- package/lib/Layout/Content.d.ts.map +1 -1
- package/lib/Layout/Content.js +1 -1
- package/lib/Layout/FlexBox.js +1 -1
- package/lib/Layout/Footer.d.ts.map +1 -1
- package/lib/Layout/Footer.js +1 -1
- package/lib/Layout/Header.d.ts +1 -1
- package/lib/Layout/Header.d.ts.map +1 -1
- package/lib/Layout/Header.js +1 -1
- package/lib/Layout/MatchMedia.js +8 -8
- package/lib/Layout/Spacer.js +1 -2
- package/lib/Layout/StyledApp.js +2 -16
- package/lib/Layout/headerMenu/HeaderMenu.js +2 -14
- package/lib/Layout/headerMenu/HeaderSubMenu.d.ts +1 -1
- package/lib/Layout/headerMenu/HeaderSubMenu.d.ts.map +1 -1
- package/lib/Layout/headerMenu/HeaderSubMenu.js +4 -16
- package/lib/Layout/headerMenu/MenuContent.js +14 -2
- package/lib/Layout/headerMenu/MenuItems.js +1 -1
- package/lib/Layout/headerMenu/MenuLink.js +28 -35
- package/lib/Layout/headerMenu/MenuOpenButton.js +1 -1
- package/lib/Layout/headerMenu/MenuScrollableItems.js +1 -1
- package/lib/Layout/headerMenu/MenuSubLink.js +15 -5
- package/lib/Menu/MenuModal.d.ts.map +1 -1
- package/lib/Menu/MenuModal.js +28 -35
- package/lib/Menu/TabBar.d.ts +1 -1
- package/lib/Menu/TabBar.d.ts.map +1 -1
- package/lib/Menu/TabBar.js +13 -22
- package/lib/Misc/ButtonGroup.js +38 -35
- package/lib/Misc/IconButton.js +63 -50
- package/lib/Misc/IsInViewport.js +2 -14
- package/lib/Misc/Loading.js +3 -15
- package/lib/Misc/Pagination.js +2 -14
- package/lib/Misc/Pill.js +1 -1
- package/lib/Misc/childrenWithDefaultProps.d.ts.map +1 -1
- package/lib/Misc/childrenWithDefaultProps.js +1 -1
- package/lib/Modal/Modal.js +11 -22
- package/lib/Modal/Overlay.d.ts +2 -2
- package/lib/Modal/Overlay.d.ts.map +1 -1
- package/lib/Modal/Overlay.js +5 -19
- package/lib/Text/Heading.js +49 -45
- package/lib/Text/Label.d.ts.map +1 -1
- package/lib/Text/Label.js +13 -23
- package/lib/Text/Line.js +1 -1
- package/lib/Text/Link.js +26 -31
- package/lib/Text/Paragraph.js +15 -23
- package/lib/Text/Text.js +6 -6
- package/lib/Text/TextLink.d.ts.map +1 -1
- package/lib/Text/TextLink.js +4 -16
- package/lib/Text/Title.js +5 -16
- package/lib/Theme/Theme.js +1 -1
- package/lib/mediaQueries.js +1 -1
- package/lib/util.js +1 -1
- package/package.json +3 -3
package/lib/Form/ErrorMessage.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.ErrorMessage = exports.filterErrorMessageProps = exports.errorMessageStyle = void 0;
|
|
15
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
@@ -17,17 +6,17 @@ const Identity_1 = require("../Identity");
|
|
|
17
6
|
const Layout_1 = require("../Layout");
|
|
18
7
|
const Text_1 = require("../Text");
|
|
19
8
|
const util_1 = require("../util");
|
|
20
|
-
const errorMessageStyle = (theme,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
9
|
+
const errorMessageStyle = (theme, { justify = 'flex-start', align = 'center', ...props }) => ({
|
|
10
|
+
...(0, Layout_1.flexBoxStyle)({ align, justify, ...props }),
|
|
11
|
+
a: {
|
|
12
|
+
...(0, Text_1.linkStyle)(theme, { bold: false, fontSize: theme.fontSizes.small, textTransform: 'none', ...props }),
|
|
13
|
+
},
|
|
14
|
+
marginBottom: '12px',
|
|
15
|
+
});
|
|
24
16
|
exports.errorMessageStyle = errorMessageStyle;
|
|
25
17
|
const filterErrorMessageProps = (props) => {
|
|
26
18
|
return (0, util_1.filterProps)((0, Layout_1.filterFlexBoxProps)(props), []);
|
|
27
19
|
};
|
|
28
20
|
exports.filterErrorMessageProps = filterErrorMessageProps;
|
|
29
|
-
const ErrorMessage = (
|
|
30
|
-
var { children } = _a, props = __rest(_a, ["children"]);
|
|
31
|
-
return ((0, jsx_runtime_1.jsx)(Layout_1.FlexBox, Object.assign({ css: (theme) => (0, exports.errorMessageStyle)(theme, props) }, props, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { color: Identity_1.COLOR_V2.RED_LIGHT_500, fontSize: '12px', css: { fontWeight: 400 }, children: children }) })));
|
|
32
|
-
};
|
|
21
|
+
const ErrorMessage = ({ children, ...props }) => ((0, jsx_runtime_1.jsx)(Layout_1.FlexBox, { css: (theme) => (0, exports.errorMessageStyle)(theme, props), ...props, children: (0, jsx_runtime_1.jsx)(Text_1.Text, { color: Identity_1.COLOR_V2.RED_LIGHT_500, fontSize: '12px', css: { fontWeight: 400 }, children: children }) }));
|
|
33
22
|
exports.ErrorMessage = ErrorMessage;
|
package/lib/Form/Form.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../src/Form/Form.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,eAAO,MAAM,IAAI,UAAW,
|
|
1
|
+
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../src/Form/Form.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,eAAO,MAAM,IAAI,UAAW,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,qDAW3D,CAAC"}
|
package/lib/Form/Form.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Form = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
-
const Form = (props) => ((0, jsx_runtime_1.jsx)("form",
|
|
5
|
+
const Form = (props) => ((0, jsx_runtime_1.jsx)("form", { css: {
|
|
6
6
|
display: 'flex',
|
|
7
7
|
flexDirection: 'column',
|
|
8
8
|
justifyContent: 'space-between',
|
|
9
9
|
marginBottom: 0,
|
|
10
10
|
width: '100%',
|
|
11
|
-
}
|
|
11
|
+
}, ...props }));
|
|
12
12
|
exports.Form = Form;
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.IndicatorRangeInput = void 0;
|
|
15
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
@@ -34,9 +23,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
34
23
|
const react_1 = require("react");
|
|
35
24
|
const IndicatorRangeInput_styles_1 = require("./IndicatorRangeInput.styles");
|
|
36
25
|
const InputLabel_1 = require("./InputLabel");
|
|
37
|
-
exports.IndicatorRangeInput = (0, react_1.forwardRef)((
|
|
38
|
-
var _b;
|
|
39
|
-
var { id = Math.random().toString(), label, min = '0', max = '100', value = '0', onChange, onOptionClick, wrapperCSS, dataListOptions = [] } = _a, inputProps = __rest(_a, ["id", "label", "min", "max", "value", "onChange", "onOptionClick", "wrapperCSS", "dataListOptions"]);
|
|
26
|
+
exports.IndicatorRangeInput = (0, react_1.forwardRef)(({ id = Math.random().toString(), label, min = '0', max = '100', value = '0', onChange, onOptionClick, wrapperCSS, dataListOptions = [], ...inputProps }, ref) => {
|
|
40
27
|
const minNum = Number(min);
|
|
41
28
|
const isCustomSlider = !!dataListOptions.length;
|
|
42
29
|
const listLength = dataListOptions.length - 1;
|
|
@@ -49,15 +36,15 @@ exports.IndicatorRangeInput = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
49
36
|
}
|
|
50
37
|
return `${((valueNum - minNum) * 100) / (maxNum - minNum)}% 100%`;
|
|
51
38
|
}, [isCustomSlider, valueNum, minNum, maxNum, listLength]);
|
|
52
|
-
const valueText =
|
|
39
|
+
const valueText = dataListOptions[valueNum]?.heading
|
|
53
40
|
? `${dataListOptions[valueNum].label} (${dataListOptions[valueNum].heading})`
|
|
54
41
|
: dataListOptions[valueNum].label;
|
|
55
42
|
return ((0, jsx_runtime_1.jsxs)("div", { css: { wrapperCSS, width: '100%' }, children: [label && ((0, jsx_runtime_1.jsx)(InputLabel_1.InputLabel, { css: (theme) => ({ fontSize: theme.fontSizes.base }), htmlFor: id, children: label })), (0, jsx_runtime_1.jsxs)("div", { css: IndicatorRangeInput_styles_1.containerStyles, children: [isCustomSlider && ((0, jsx_runtime_1.jsx)("div", { css: { position: 'relative', display: 'flex', marginBottom: '20px' }, children: dataListOptions.map((dataListOption, index) => ((0, jsx_runtime_1.jsx)("div", { css: (theme) => (0, IndicatorRangeInput_styles_1.headingStyle)(listLength, theme), onClick: () => {
|
|
56
|
-
if (dataListOption
|
|
43
|
+
if (dataListOption?.heading) {
|
|
57
44
|
onOptionClick(index);
|
|
58
45
|
}
|
|
59
|
-
}, children: dataListOption
|
|
60
|
-
|
|
61
|
-
|
|
46
|
+
}, children: dataListOption?.heading }, dataListOption.value))) })), (0, jsx_runtime_1.jsx)("input", { ref: ref, css: (theme) => (0, IndicatorRangeInput_styles_1.rangeStyles)(backgroundSize, valueNum, listLength, isCustomSlider, theme), id: id, name: id, min: minNum, max: maxNum, value: value, onChange: onChange, type: "range", list: "tickMarks", ...(isCustomSlider && {
|
|
47
|
+
'aria-valuetext': valueText,
|
|
48
|
+
}), ...inputProps }), isCustomSlider && ((0, jsx_runtime_1.jsx)("datalist", { id: "tickMarks", css: (theme) => (0, IndicatorRangeInput_styles_1.dataListOption)(listLength, theme), children: dataListOptions.map((dataListOption, index) => ((0, jsx_runtime_1.jsx)("option", { value: dataListOption.value, label: dataListOption.label, onClick: () => onOptionClick(index) }, index))) }))] })] }));
|
|
62
49
|
});
|
|
63
50
|
exports.IndicatorRangeInput.displayName = 'IndicatorRangeInput';
|
|
@@ -27,13 +27,43 @@ const rangeStyles = (backgroundSize, value, listLength, isCustomSlider, theme) =
|
|
|
27
27
|
const lastOptionThumbPosition = `calc(((100% - 12px) / (${listLength} * 2) - 6px) / 2)`;
|
|
28
28
|
const isFirstOption = value === 0;
|
|
29
29
|
const isLastOption = value === listLength;
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
boxShadow: 'none',
|
|
33
|
-
background: 'transparent',
|
|
34
|
-
height: '8px',
|
|
30
|
+
return {
|
|
31
|
+
appearance: 'none',
|
|
35
32
|
width: '100%',
|
|
36
|
-
|
|
33
|
+
height: '8px',
|
|
34
|
+
backgroundImage: `linear-gradient(${theme.general.primaryColor}, ${theme.general.primaryColor})`,
|
|
35
|
+
backgroundColor: theme.IndicatorRangeInput.trackBg,
|
|
36
|
+
backgroundSize: backgroundSize || '0% 100%',
|
|
37
|
+
backgroundRepeat: 'no-repeat',
|
|
38
|
+
display: 'flex',
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
borderRadius: '8px',
|
|
41
|
+
marginBlock: '10px',
|
|
42
|
+
zIndex: '1',
|
|
43
|
+
position: 'relative',
|
|
44
|
+
...(0, util_1.manySelectors)(thumbSelectors, {
|
|
45
|
+
'-webkit-appearance': 'none',
|
|
46
|
+
height: '28px',
|
|
47
|
+
width: '10px',
|
|
48
|
+
borderRadius: '4px',
|
|
49
|
+
background: theme.IndicatorRangeInput.thumb,
|
|
50
|
+
cursor: 'pointer',
|
|
51
|
+
border: 'none',
|
|
52
|
+
boxShadow: '0px 2px 2px rgba(0, 0, 0, 0.25);',
|
|
53
|
+
position: 'relative',
|
|
54
|
+
top: '-9px',
|
|
55
|
+
zIndex: '2',
|
|
56
|
+
...(isCustomSlider && isFirstOption && { left: firstOptionThumbPosition }),
|
|
57
|
+
...(isCustomSlider && isLastOption && { right: lastOptionThumbPosition }),
|
|
58
|
+
}),
|
|
59
|
+
...(0, util_1.manySelectors)(sliderSelectors, {
|
|
60
|
+
'-webkit-appearance': 'none',
|
|
61
|
+
boxShadow: 'none',
|
|
62
|
+
background: 'transparent',
|
|
63
|
+
height: '8px',
|
|
64
|
+
width: '100%',
|
|
65
|
+
}),
|
|
66
|
+
};
|
|
37
67
|
};
|
|
38
68
|
exports.rangeStyles = rangeStyles;
|
|
39
69
|
const headingStyle = (listLength, theme) => {
|
package/lib/Form/Input.js
CHANGED
|
@@ -22,17 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
-
var t = {};
|
|
27
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
-
t[p] = s[p];
|
|
29
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
-
t[p[i]] = s[p[i]];
|
|
33
|
-
}
|
|
34
|
-
return t;
|
|
35
|
-
};
|
|
36
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
26
|
exports.Input = exports.INPUT_GROUP = exports.INPUT_CLASSNAME = exports.inputStyle = void 0;
|
|
38
27
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
@@ -66,9 +55,16 @@ const inputStyle = (theme, { markInvalid = false, placeholderTextTransform = 'no
|
|
|
66
55
|
textTransform: placeholderTextTransform,
|
|
67
56
|
};
|
|
68
57
|
return {
|
|
69
|
-
'&::-moz-placeholder':
|
|
70
|
-
|
|
71
|
-
|
|
58
|
+
'&::-moz-placeholder': {
|
|
59
|
+
...placeholderStyle,
|
|
60
|
+
opacity: 1,
|
|
61
|
+
},
|
|
62
|
+
'&::-ms-input-placeholder': {
|
|
63
|
+
...placeholderStyle,
|
|
64
|
+
},
|
|
65
|
+
'&::-webkit-input-placeholder': {
|
|
66
|
+
...placeholderStyle,
|
|
67
|
+
},
|
|
72
68
|
'&:hover': {
|
|
73
69
|
boxShadow: !disabled && `0 0 0 1px ${theme.Input.borderHover}`,
|
|
74
70
|
},
|
|
@@ -104,16 +100,23 @@ const centerInputAction = {
|
|
|
104
100
|
top: '50%',
|
|
105
101
|
transform: 'translateY(-50%)',
|
|
106
102
|
};
|
|
107
|
-
exports.Input = React.forwardRef((
|
|
108
|
-
var { type, label, error, helperText, startContent = null, endContent = null, inputCSS = {}, wrapperCSS = {}, className = '' } = _a, props = __rest(_a, ["type", "label", "error", "helperText", "startContent", "endContent", "inputCSS", "wrapperCSS", "className"]);
|
|
103
|
+
exports.Input = React.forwardRef(({ type, label, error, helperText, startContent = null, endContent = null, inputCSS = {}, wrapperCSS = {}, className = '', ...props }, ref) => {
|
|
109
104
|
const [togglePassword, setTogglePassword] = (0, react_1.useState)(false);
|
|
110
105
|
const hasError = !!error;
|
|
111
106
|
const isPasswordInput = type === 'password';
|
|
112
107
|
const toggledPasswordType = togglePassword ? 'text' : 'password';
|
|
113
108
|
const toggleSetPassword = () => setTogglePassword(prevState => !prevState);
|
|
114
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: exports.INPUT_GROUP, css: (theme) => (
|
|
109
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: exports.INPUT_GROUP, css: (theme) => ({
|
|
110
|
+
marginBottom: hasError ? '2px' : '20px',
|
|
111
|
+
width: '100%',
|
|
112
|
+
'&:focus-within label': {
|
|
115
113
|
color: theme.general.primaryColor,
|
|
116
|
-
}
|
|
114
|
+
},
|
|
115
|
+
...wrapperCSS,
|
|
116
|
+
}), children: [label && ((0, jsx_runtime_1.jsx)(InputLabel_1.InputLabel, { htmlFor: props.id, isRequired: props.required, markInvalid: props.markInvalid, children: label })), (0, jsx_runtime_1.jsxs)("div", { css: { marginBottom: hasError && '8px', position: 'relative' }, children: [startContent, (0, jsx_runtime_1.jsx)("input", { className: exports.INPUT_CLASSNAME, css: (theme) => ({
|
|
117
|
+
...(0, exports.inputStyle)(theme, props, hasError),
|
|
118
|
+
...inputCSS,
|
|
119
|
+
}), ref: ref, type: isPasswordInput ? toggledPasswordType : type, "aria-required": props.required, ...filterInputProps(props) }), endContent, hasError && !isPasswordInput && ((0, jsx_runtime_1.jsx)(Icon_1.ErrorIcon, { css: centerInputAction, width: 16, height: 16, "aria-hidden": "true" })), isPasswordInput && ((0, jsx_runtime_1.jsx)("button", { type: "button", "data-uie-name": !togglePassword ? 'do-show-password' : 'do-hide-password', css: { ...centerInputAction, background: 'transparent', border: 'none', cursor: 'pointer', padding: 0 }, onClick: toggleSetPassword, title: "Toggle password visibility", "aria-controls": props.id, "aria-expanded": togglePassword, children: togglePassword ? (0, jsx_runtime_1.jsx)(Icon_1.HideIcon, {}) : (0, jsx_runtime_1.jsx)(Icon_1.ShowIcon, {}) }))] }), !hasError && helperText && ((0, jsx_runtime_1.jsx)("p", { css: (theme) => ({
|
|
117
120
|
fontSize: theme.fontSizes.small,
|
|
118
121
|
fontWeight: 400,
|
|
119
122
|
color: theme.Input.placeholderColor,
|
package/lib/Form/InputBlock.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export type InputBlockProps<T = HTMLDivElement> = React.HTMLProps<T>;
|
|
3
|
-
export declare const InputBlock: (props: InputBlockProps
|
|
3
|
+
export declare const InputBlock: (props: InputBlockProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=InputBlock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputBlock.d.ts","sourceRoot":"","sources":["../../src/Form/InputBlock.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,cAAc,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAgBrE,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"InputBlock.d.ts","sourceRoot":"","sources":["../../src/Form/InputBlock.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,cAAc,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAgBrE,eAAO,MAAM,UAAU,UAAW,eAAe,qDAAoD,CAAC"}
|
package/lib/Form/InputBlock.js
CHANGED
|
@@ -18,5 +18,5 @@ const inputBlockStyle = _ => ({
|
|
|
18
18
|
marginBottom: 0,
|
|
19
19
|
},
|
|
20
20
|
});
|
|
21
|
-
const InputBlock = (props) => (0, jsx_runtime_1.jsx)("div",
|
|
21
|
+
const InputBlock = (props) => (0, jsx_runtime_1.jsx)("div", { css: inputBlockStyle(props), ...props });
|
|
22
22
|
exports.InputBlock = InputBlock;
|
package/lib/Form/InputLabel.js
CHANGED
|
@@ -1,26 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.InputLabel = void 0;
|
|
15
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
16
5
|
const Identity_1 = require("../Identity");
|
|
17
|
-
const InputLabel = (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
color: markInvalid ? Identity_1.COLOR_V2.RED_LIGHT_500 : theme.Input.labelColor,
|
|
24
|
-
}) }, props, { children: [children, isRequired && ((0, jsx_runtime_1.jsx)("span", { css: (theme) => ({ fontSize: theme.fontSizes.base, marginLeft: '4px', color: Identity_1.COLOR_V2.RED_LIGHT_500 }), children: "*" }))] })));
|
|
25
|
-
};
|
|
6
|
+
const InputLabel = ({ htmlFor, markInvalid, isRequired, children, ...props }) => ((0, jsx_runtime_1.jsxs)("label", { htmlFor: htmlFor, css: (theme) => ({
|
|
7
|
+
fontSize: theme.fontSizes.medium,
|
|
8
|
+
fontWeight: 400,
|
|
9
|
+
lineHeight: '1rem',
|
|
10
|
+
color: markInvalid ? Identity_1.COLOR_V2.RED_LIGHT_500 : theme.Input.labelColor,
|
|
11
|
+
}), ...props, children: [children, isRequired && ((0, jsx_runtime_1.jsx)("span", { css: (theme) => ({ fontSize: theme.fontSizes.base, marginLeft: '4px', color: Identity_1.COLOR_V2.RED_LIGHT_500 }), children: "*" }))] }));
|
|
26
12
|
exports.InputLabel = InputLabel;
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.InputSubmitCombo = exports.INPUT_SUBMIT_COMBO_CLASSNAME = void 0;
|
|
15
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
@@ -34,19 +23,27 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
34
23
|
const Input_1 = require("./Input");
|
|
35
24
|
const Identity_1 = require("../Identity");
|
|
36
25
|
exports.INPUT_SUBMIT_COMBO_CLASSNAME = 'inputSubmitCombo';
|
|
37
|
-
const InputSubmitCombo = (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
26
|
+
const InputSubmitCombo = ({ children, ...props }) => ((0, jsx_runtime_1.jsx)("div", { className: exports.INPUT_SUBMIT_COMBO_CLASSNAME, css: (theme) => ({
|
|
27
|
+
...(0, Input_1.inputStyle)(theme, props),
|
|
28
|
+
'&:focus-within': {
|
|
29
|
+
boxShadow: `0 0 0 1px ${Identity_1.COLOR_V2.BLUE}`,
|
|
30
|
+
},
|
|
31
|
+
[`.${Input_1.INPUT_GROUP}`]: {
|
|
32
|
+
flexGrow: 1,
|
|
33
|
+
},
|
|
34
|
+
[`.${Input_1.INPUT_CLASSNAME}`]: {
|
|
35
|
+
'&:focus, &:invalid:not(:focus)': {
|
|
47
36
|
boxShadow: 'none',
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
37
|
+
},
|
|
38
|
+
boxShadow: 'none',
|
|
39
|
+
margin: '0 8px 0 0',
|
|
40
|
+
padding: '0 0 0 16px',
|
|
41
|
+
},
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
display: 'flex',
|
|
44
|
+
height: '49px', // needs a bit more space to not overlap with the `boxShadow` from `:focus`
|
|
45
|
+
justifyContent: 'space-between',
|
|
46
|
+
marginBottom: '4px',
|
|
47
|
+
paddingLeft: 0,
|
|
48
|
+
}), ...props, children: children }));
|
|
52
49
|
exports.InputSubmitCombo = InputSubmitCombo;
|
package/lib/Form/RangeInput.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RangeInput.d.ts","sourceRoot":"","sources":["../../src/Form/RangeInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RangeInput.d.ts","sourceRoot":"","sources":["../../src/Form/RangeInput.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAWzC,OAAO,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAElC,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,gBAAgB,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED,eAAO,MAAM,UAAU,6IAgDtB,CAAC"}
|
package/lib/Form/RangeInput.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.RangeInput = void 0;
|
|
15
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
@@ -34,12 +23,11 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
34
23
|
const react_1 = require("react");
|
|
35
24
|
const InputLabel_1 = require("./InputLabel");
|
|
36
25
|
const RangeInput_styles_1 = require("./RangeInput.styles");
|
|
37
|
-
exports.RangeInput = (0, react_1.forwardRef)((
|
|
38
|
-
var { id = Math.random().toString(), label, minValueLabel, maxValueLabel, min = '0', max = '100', value = '0', onChange, wrapperCSS } = _a, inputProps = __rest(_a, ["id", "label", "minValueLabel", "maxValueLabel", "min", "max", "value", "onChange", "wrapperCSS"]);
|
|
26
|
+
exports.RangeInput = (0, react_1.forwardRef)(({ id = Math.random().toString(), label, minValueLabel, maxValueLabel, min = '0', max = '100', value = '0', onChange, wrapperCSS, ...inputProps }, ref) => {
|
|
39
27
|
const minNum = Number(min);
|
|
40
28
|
const maxNum = Number(max);
|
|
41
29
|
const valueNum = Number(value);
|
|
42
30
|
const backgroundSize = `${((valueNum - minNum) * 100) / (maxNum - minNum)}% 100%`;
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: wrapperCSS, children: [label && (0, jsx_runtime_1.jsx)(InputLabel_1.InputLabel, { htmlFor: id, children: label }), (0, jsx_runtime_1.jsxs)("div", { css: RangeInput_styles_1.rangeInputWrapperStyles, children: [minValueLabel && ((0, jsx_runtime_1.jsx)("span", { css: (theme) => (0, RangeInput_styles_1.getValueLabelStyles)(theme, RangeInput_styles_1.ValueLabelPosition.LEFT), children: minValueLabel })), maxValueLabel && ((0, jsx_runtime_1.jsx)("span", { css: (theme) => (0, RangeInput_styles_1.getValueLabelStyles)(theme, RangeInput_styles_1.ValueLabelPosition.RIGHT), children: maxValueLabel })), (0, jsx_runtime_1.jsx)("input",
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: wrapperCSS, children: [label && (0, jsx_runtime_1.jsx)(InputLabel_1.InputLabel, { htmlFor: id, children: label }), (0, jsx_runtime_1.jsxs)("div", { css: RangeInput_styles_1.rangeInputWrapperStyles, children: [minValueLabel && ((0, jsx_runtime_1.jsx)("span", { css: (theme) => (0, RangeInput_styles_1.getValueLabelStyles)(theme, RangeInput_styles_1.ValueLabelPosition.LEFT), children: minValueLabel })), maxValueLabel && ((0, jsx_runtime_1.jsx)("span", { css: (theme) => (0, RangeInput_styles_1.getValueLabelStyles)(theme, RangeInput_styles_1.ValueLabelPosition.RIGHT), children: maxValueLabel })), (0, jsx_runtime_1.jsx)("input", { ref: ref, css: (theme) => (0, RangeInput_styles_1.getImageCropZoomInputStyles)(theme, backgroundSize), id: id, name: id, min: min, max: max, value: value, onChange: onChange, type: "range", ...inputProps })] })] }));
|
|
44
32
|
});
|
|
45
33
|
exports.RangeInput.displayName = 'RangeInput';
|
|
@@ -27,21 +27,33 @@ exports.rangeInputWrapperStyles = {
|
|
|
27
27
|
};
|
|
28
28
|
const thumbSelectors = ['&::-webkit-slider-thumb', '&::-moz-range-thumb', '&::-ms-thumb'];
|
|
29
29
|
const sliderSelectors = ['&::-webkit-slider-runnable-track', '&::-moz-range-track', '&::-ms-track'];
|
|
30
|
-
const getImageCropZoomInputStyles = (theme, backgroundSize) => (
|
|
30
|
+
const getImageCropZoomInputStyles = (theme, backgroundSize) => ({
|
|
31
|
+
display: 'block',
|
|
31
32
|
'-webkit-appearance': 'none',
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
width: '100%',
|
|
34
|
+
height: '8px',
|
|
35
|
+
background: Identity_1.COLOR_V2.GRAY_60,
|
|
36
|
+
borderRadius: '4px',
|
|
37
|
+
backgroundImage: `linear-gradient(${theme.general.primaryColor}, ${theme.general.primaryColor})`,
|
|
38
|
+
backgroundSize: backgroundSize || '0% 100%',
|
|
39
|
+
backgroundRepeat: 'no-repeat',
|
|
40
|
+
...(0, util_1.manySelectors)(thumbSelectors, {
|
|
41
|
+
'-webkit-appearance': 'none',
|
|
42
|
+
height: '18px',
|
|
43
|
+
width: '18px',
|
|
44
|
+
borderRadius: '50%',
|
|
45
|
+
background: Identity_1.COLOR_V2.GRAY_80,
|
|
46
|
+
cursor: 'pointer',
|
|
47
|
+
border: 'none',
|
|
48
|
+
boxShadow: 'none',
|
|
49
|
+
}),
|
|
50
|
+
...(0, util_1.manySelectors)(sliderSelectors, {
|
|
51
|
+
'-webkit-appearance': 'none',
|
|
52
|
+
boxShadow: 'none',
|
|
53
|
+
border: 'none',
|
|
54
|
+
background: 'transparent',
|
|
55
|
+
}),
|
|
56
|
+
});
|
|
45
57
|
exports.getImageCropZoomInputStyles = getImageCropZoomInputStyles;
|
|
46
58
|
var ValueLabelPosition;
|
|
47
59
|
(function (ValueLabelPosition) {
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.RoundIconButton = exports.roundIconButtonStyle = void 0;
|
|
15
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
@@ -17,12 +6,21 @@ const Button_1 = require("./Button");
|
|
|
17
6
|
const Button_styles_1 = require("./Button.styles");
|
|
18
7
|
const Identity_1 = require("../Identity");
|
|
19
8
|
const Misc_1 = require("../Misc/");
|
|
20
|
-
const roundIconButtonStyle = (theme, props) => (
|
|
9
|
+
const roundIconButtonStyle = (theme, props) => ({
|
|
10
|
+
...(0, Button_styles_1.buttonStyle)(theme, props),
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
borderRadius: '50%',
|
|
13
|
+
display: 'flex',
|
|
14
|
+
height: `${props.size}px`,
|
|
15
|
+
justifyContent: 'center',
|
|
16
|
+
lineHeight: 'initial',
|
|
17
|
+
margin: '0 auto',
|
|
18
|
+
minWidth: `${props.size}px`,
|
|
19
|
+
padding: 0,
|
|
20
|
+
width: `${props.size}px`,
|
|
21
|
+
});
|
|
21
22
|
exports.roundIconButtonStyle = roundIconButtonStyle;
|
|
22
|
-
const RoundIconButton = (
|
|
23
|
-
var { children } = _a, props = __rest(_a, ["children"]);
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)("button", Object.assign({ css: (theme) => (0, exports.roundIconButtonStyle)(theme, props) }, (0, Button_1.filterButtonProps)(props), { children: (0, Misc_1.childrenWithDefaultProps)({ children, defaultProps: { color: Identity_1.COLOR.WHITE } }) })));
|
|
25
|
-
};
|
|
23
|
+
const RoundIconButton = ({ children, ...props }) => ((0, jsx_runtime_1.jsx)("button", { css: (theme) => (0, exports.roundIconButtonStyle)(theme, props), ...(0, Button_1.filterButtonProps)(props), children: (0, Misc_1.childrenWithDefaultProps)({ children, defaultProps: { color: Identity_1.COLOR.WHITE } }) }));
|
|
26
24
|
exports.RoundIconButton = RoundIconButton;
|
|
27
25
|
exports.RoundIconButton.defaultProps = {
|
|
28
26
|
backgroundColor: Identity_1.COLOR.BLUE,
|
package/lib/Form/Select.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/Form/Select.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAC,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAC,SAAS,EAAW,MAAM,gBAAgB,CAAC;AACnD,OAAoB,EAAC,SAAS,EAAe,MAAM,cAAc,CAAC;AAClE,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,iDAAiD,CAAC;AAiBvF,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,UAAU,WAAW,CAAC,OAAO,SAAS,OAAO,EAAE,KAAK,SAAS,SAAS,CAAC,MAAM,CAAC,CAC5E,SAAQ,iBAAiB,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC;IACjD,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/Form/Select.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAC,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAC,SAAS,EAAW,MAAM,gBAAgB,CAAC;AACnD,OAAoB,EAAC,SAAS,EAAe,MAAM,cAAc,CAAC;AAClE,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,iDAAiD,CAAC;AAiBvF,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,UAAU,WAAW,CAAC,OAAO,SAAS,OAAO,EAAE,KAAK,SAAS,SAAS,CAAC,MAAM,CAAC,CAC5E,SAAQ,iBAAiB,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC;IACjD,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,MAAM,GAAI,OAAO,SAAS,OAAO,UAAU,KAAK,SAAS,SAAS,CAAC,MAAM,CAAC,yKAepF,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,qDAoE7B,CAAC"}
|
package/lib/Form/Select.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
@@ -22,15 +11,19 @@ const InputLabel_1 = require("./InputLabel");
|
|
|
22
11
|
const SelectComponents_1 = require("./SelectComponents");
|
|
23
12
|
const SelectStyles_1 = require("./SelectStyles");
|
|
24
13
|
const enums_1 = require("../types/enums");
|
|
25
|
-
const Select = (
|
|
26
|
-
var { id, label, error, helperText, disabled = false, dataUieName, options, isMulti, wrapperCSS = {}, markInvalid = false, required = false, isSearchable = false, overlayMenu = true } = _a, props = __rest(_a, ["id", "label", "error", "helperText", "disabled", "dataUieName", "options", "isMulti", "wrapperCSS", "markInvalid", "required", "isSearchable", "overlayMenu"]);
|
|
14
|
+
const Select = ({ id, label, error, helperText, disabled = false, dataUieName, options, isMulti, wrapperCSS = {}, markInvalid = false, required = false, isSearchable = false, overlayMenu = true, ...props }) => {
|
|
27
15
|
const theme = (0, react_1.useTheme)();
|
|
28
16
|
const hasError = !!error;
|
|
29
17
|
return ((0, jsx_runtime_1.jsxs)("div", {
|
|
30
18
|
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
31
|
-
autoFocus: (0, SelectComponents_1.isGroup)(options), css: (theme) => (
|
|
19
|
+
autoFocus: (0, SelectComponents_1.isGroup)(options), css: (theme) => ({
|
|
20
|
+
marginBottom: markInvalid ? '2px' : '20px',
|
|
21
|
+
width: '100%',
|
|
22
|
+
'&:focus-within label': {
|
|
32
23
|
color: theme.general.primaryColor,
|
|
33
|
-
}
|
|
24
|
+
},
|
|
25
|
+
...wrapperCSS,
|
|
26
|
+
}), "data-uie-name": dataUieName, children: [label && ((0, jsx_runtime_1.jsx)(InputLabel_1.InputLabel, { htmlFor: id, markInvalid: markInvalid, isRequired: required, children: label })), (0, jsx_runtime_1.jsx)(react_select_1.default, { id: id, styles: (0, SelectStyles_1.customStyles)({
|
|
34
27
|
theme: theme,
|
|
35
28
|
markInvalid,
|
|
36
29
|
menuPosition: overlayMenu ? 'absolute' : 'relative',
|
|
@@ -41,7 +34,7 @@ const Select = (_a) => {
|
|
|
41
34
|
Menu: (0, SelectComponents_1.Menu)(dataUieName),
|
|
42
35
|
ValueContainer: SelectComponents_1.ValueContainer,
|
|
43
36
|
IndicatorsContainer: SelectComponents_1.IndicatorsContainer,
|
|
44
|
-
}, tabIndex: enums_1.TabIndex.UNFOCUSABLE, isDisabled: disabled, hideSelectedOptions: false, isSearchable: isSearchable, isClearable: false, closeMenuOnSelect: !isMulti, isMulti: isMulti, options: options
|
|
37
|
+
}, tabIndex: enums_1.TabIndex.UNFOCUSABLE, isDisabled: disabled, hideSelectedOptions: false, isSearchable: isSearchable, isClearable: false, closeMenuOnSelect: !isMulti, isMulti: isMulti, options: options, ...props }), !hasError && helperText && ((0, jsx_runtime_1.jsx)("p", { css: (theme) => ({
|
|
45
38
|
fontSize: theme.fontSizes.small,
|
|
46
39
|
fontWeight: 400,
|
|
47
40
|
color: theme.Input.labelColor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectComponents.d.ts","sourceRoot":"","sources":["../../src/Form/SelectComponents.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAEL,cAAc,EACd,sBAAsB,EACtB,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,SAAS,EACT,SAAS,EACT,eAAe,EAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAOhC,eAAO,MAAM,eAAe,UAAW,cAAc,qDAMpD,CAAC;AAEF,eAAO,MAAM,OAAO,YAAa,
|
|
1
|
+
{"version":3,"file":"SelectComponents.d.ts","sourceRoot":"","sources":["../../src/Form/SelectComponents.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAEL,cAAc,EACd,sBAAsB,EACtB,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,SAAS,EACT,SAAS,EACT,eAAe,EAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAOhC,eAAO,MAAM,eAAe,UAAW,cAAc,qDAMpD,CAAC;AAEF,eAAO,MAAM,OAAO,YAAa,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,KAAG,OAAO,IAAI,SAAS,CAAC,MAAM,CAAC,EAEzG,CAAC;AAEF,eAAO,MAAM,iBAAiB,UAAW,sBAAsB,qDAS9D,CAAC;AAGF,eAAO,MAAM,YAAY,gBAAiB,MAAM,aAAa,WAAW,CAAC,MAAM,CAAC,qDAsD/E,CAAC;AAGF,eAAO,MAAM,IAAI,gBAAiB,MAAM,aAAa,SAAS,qDAc7D,CAAC;AAEF,eAAO,MAAM,WAAW,qBAqBvB,CAAC;AAEF,eAAO,MAAM,cAAc,+BAA8B,mBAAmB,CAAC,MAAM,CAAC,qDAInF,CAAC;AAEF,eAAO,MAAM,mBAAmB,+BAA8B,wBAAwB,CAAC,MAAM,CAAC,qDAW7F,CAAC"}
|