@wireapp/react-ui-kit 9.18.0 → 9.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/ExternalLinkIcon.d.ts +3 -0
- package/lib/Icon/ExternalLinkIcon.d.ts.map +1 -0
- package/lib/Icon/ExternalLinkIcon.js +25 -0
- 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/Icon/index.d.ts +1 -0
- package/lib/Icon/index.d.ts.map +1 -1
- package/lib/Icon/index.js +1 -0
- 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/Button.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.filterButtonProps = exports.Button = exports.ButtonVariant = void 0;
|
|
15
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
@@ -45,10 +34,7 @@ var ButtonVariant;
|
|
|
45
34
|
ButtonVariant["SEND"] = "send";
|
|
46
35
|
ButtonVariant["CANCEL"] = "cancel";
|
|
47
36
|
})(ButtonVariant || (exports.ButtonVariant = ButtonVariant = {}));
|
|
48
|
-
const Button = (
|
|
49
|
-
var { showLoading, children, loadingColor = Identity_1.COLOR.WHITE } = _a, props = __rest(_a, ["showLoading", "children", "loadingColor"]);
|
|
50
|
-
return ((0, jsx_runtime_1.jsx)("button", Object.assign({ css: (theme) => (0, Button_styles_1.buttonStyle)(theme, props) }, (0, exports.filterButtonProps)(props), { children: showLoading ? (0, jsx_runtime_1.jsx)(Misc_1.Loading, { size: 30, color: loadingColor, style: { display: 'flex', margin: 'auto' } }) : children })));
|
|
51
|
-
};
|
|
37
|
+
const Button = ({ showLoading, children, loadingColor = Identity_1.COLOR.WHITE, ...props }) => ((0, jsx_runtime_1.jsx)("button", { css: (theme) => (0, Button_styles_1.buttonStyle)(theme, props), ...(0, exports.filterButtonProps)(props), children: showLoading ? (0, jsx_runtime_1.jsx)(Misc_1.Loading, { size: 30, color: loadingColor, style: { display: 'flex', margin: 'auto' } }) : children }));
|
|
52
38
|
exports.Button = Button;
|
|
53
39
|
const filterButtonProps = (props) => {
|
|
54
40
|
return (0, util_1.filterProps)((0, Text_1.filterTextProps)(props), ['backgroundColor', 'noCapital']);
|
|
@@ -17,17 +17,6 @@
|
|
|
17
17
|
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
21
|
-
var t = {};
|
|
22
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
23
|
-
t[p] = s[p];
|
|
24
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
25
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
26
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
27
|
-
t[p[i]] = s[p[i]];
|
|
28
|
-
}
|
|
29
|
-
return t;
|
|
30
|
-
};
|
|
31
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
21
|
exports.buttonStyle = void 0;
|
|
33
22
|
const Button_1 = require("./Button");
|
|
@@ -40,20 +29,23 @@ const buttonPrimaryStyles = (theme, { backgroundColor, disabled, isActive }) =>
|
|
|
40
29
|
border: `1px solid ${theme.Button.primaryActiveBorder}`,
|
|
41
30
|
color: Identity_1.COLOR.WHITE,
|
|
42
31
|
};
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
32
|
+
return {
|
|
33
|
+
...(isActive
|
|
34
|
+
? activeStyles
|
|
35
|
+
: {
|
|
36
|
+
color: disabled ? theme.Button.primaryDisabledText : theme.general.contrastColor,
|
|
37
|
+
backgroundColor: backgroundColor || disabled ? theme.Button.primaryDisabledBg : theme.Button.primaryBg,
|
|
38
|
+
}),
|
|
39
|
+
...(!disabled && {
|
|
40
|
+
'&:hover, &:focus': {
|
|
41
|
+
backgroundColor: theme.Button.primaryHoverBg,
|
|
42
|
+
},
|
|
43
|
+
'&:focus': {
|
|
44
|
+
border: `1px solid ${theme.Button.primaryFocusBorder}`,
|
|
45
|
+
},
|
|
46
|
+
'&:active': activeStyles,
|
|
47
|
+
}),
|
|
48
|
+
};
|
|
57
49
|
};
|
|
58
50
|
const buttonSecondaryStyles = (theme, { backgroundColor, disabled, isActive }) => {
|
|
59
51
|
const activeStyles = {
|
|
@@ -61,20 +53,24 @@ const buttonSecondaryStyles = (theme, { backgroundColor, disabled, isActive }) =
|
|
|
61
53
|
border: `1px solid ${theme.Button.secondaryActiveBorder}`,
|
|
62
54
|
color: theme.general.primaryColor,
|
|
63
55
|
};
|
|
64
|
-
return
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
56
|
+
return {
|
|
57
|
+
border: `1px solid ${theme.IconButton.primaryBorderColor}`,
|
|
58
|
+
...(isActive
|
|
59
|
+
? activeStyles
|
|
60
|
+
: {
|
|
61
|
+
color: disabled ? theme.Input.placeholderColor : theme.general.color,
|
|
62
|
+
backgroundColor: backgroundColor || disabled ? theme.IconButton.primaryDisabledBgColor : theme.IconButton.primaryBgColor,
|
|
63
|
+
}),
|
|
64
|
+
...(!disabled && {
|
|
65
|
+
'&:hover, &:focus': {
|
|
66
|
+
border: `1px solid ${theme.Button.secondaryHoverBorder}`,
|
|
67
|
+
},
|
|
68
|
+
'&:focus': {
|
|
69
|
+
color: theme.IconButton.primaryActiveFillColor,
|
|
70
|
+
},
|
|
71
|
+
'&:active': activeStyles,
|
|
72
|
+
}),
|
|
73
|
+
};
|
|
78
74
|
};
|
|
79
75
|
const buttonTertiaryStyles = (theme, { backgroundColor, disabled, isActive }) => {
|
|
80
76
|
const activeStyles = {
|
|
@@ -84,95 +80,146 @@ const buttonTertiaryStyles = (theme, { backgroundColor, disabled, isActive }) =>
|
|
|
84
80
|
fill: theme.IconButton.primaryActiveFillColor,
|
|
85
81
|
},
|
|
86
82
|
};
|
|
87
|
-
return
|
|
83
|
+
return {
|
|
84
|
+
border: disabled ? `1px solid ${theme.Button.tertiaryDisabledBorder}` : `1px solid ${theme.Button.tertiaryBorder}`,
|
|
85
|
+
borderRadius: '12px',
|
|
86
|
+
fontSize: theme.fontSizes.medium,
|
|
87
|
+
fontWeight: 700,
|
|
88
|
+
lineHeight: '1.5rem',
|
|
89
|
+
padding: '4px 8px',
|
|
90
|
+
'& > svg > path': {
|
|
88
91
|
fill: disabled ? theme.Input.placeholderColor : theme.general.color,
|
|
89
|
-
} }, (isActive
|
|
90
|
-
? activeStyles
|
|
91
|
-
: {
|
|
92
|
-
color: disabled ? theme.Input.placeholderColor : theme.general.color,
|
|
93
|
-
backgroundColor: backgroundColor || disabled ? theme.Button.tertiarydisabledBg : theme.Button.tertiaryBg,
|
|
94
|
-
})), (!disabled && {
|
|
95
|
-
'&:hover, &:focus': {
|
|
96
|
-
backgroundColor: theme.Button.tertiaryHoverBg,
|
|
97
|
-
border: `1px solid ${theme.Button.tertiaryHoverBorder}`,
|
|
98
92
|
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
93
|
+
...(isActive
|
|
94
|
+
? activeStyles
|
|
95
|
+
: {
|
|
96
|
+
color: disabled ? theme.Input.placeholderColor : theme.general.color,
|
|
97
|
+
backgroundColor: backgroundColor || disabled ? theme.Button.tertiarydisabledBg : theme.Button.tertiaryBg,
|
|
98
|
+
}),
|
|
99
|
+
...(!disabled && {
|
|
100
|
+
'&:hover, &:focus': {
|
|
101
|
+
backgroundColor: theme.Button.tertiaryHoverBg,
|
|
102
|
+
border: `1px solid ${theme.Button.tertiaryHoverBorder}`,
|
|
103
|
+
},
|
|
104
|
+
'&:focus': {
|
|
105
|
+
border: `1px solid ${theme.general.focusColor}`,
|
|
106
|
+
},
|
|
107
|
+
'&:active': activeStyles,
|
|
108
|
+
}),
|
|
109
|
+
};
|
|
104
110
|
};
|
|
105
111
|
const buttonQuaternaryStyles = ({ backgroundColor, disabled, isActive }) => {
|
|
106
112
|
const activeStyles = {
|
|
107
113
|
backgroundColor: Identity_1.COLOR_V2.GREEN_LIGHT_700,
|
|
108
114
|
};
|
|
109
|
-
return
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
115
|
+
return {
|
|
116
|
+
lineHeight: '1.5rem',
|
|
117
|
+
...(isActive
|
|
118
|
+
? activeStyles
|
|
119
|
+
: {
|
|
120
|
+
color: disabled ? Identity_1.COLOR_V2.GRAY_80 : Identity_1.COLOR_V2.WHITE,
|
|
121
|
+
backgroundColor: backgroundColor || disabled ? Identity_1.COLOR_V2.GRAY_50 : Identity_1.COLOR_V2.GREEN,
|
|
122
|
+
}),
|
|
123
|
+
...(!disabled && {
|
|
124
|
+
'&:hover, &:focus': {
|
|
125
|
+
backgroundColor: Identity_1.COLOR_V2.GREEN_LIGHT_600,
|
|
126
|
+
},
|
|
127
|
+
'&:focus': {
|
|
128
|
+
border: `1px solid ${Identity_1.COLOR_V2.GREEN_LIGHT_700}`,
|
|
129
|
+
},
|
|
130
|
+
'&:active': activeStyles,
|
|
131
|
+
}),
|
|
132
|
+
};
|
|
123
133
|
};
|
|
124
134
|
const buttonCancelStyles = ({ backgroundColor, disabled, isActive }) => {
|
|
125
135
|
const activeStyles = {
|
|
126
136
|
backgroundColor: Identity_1.COLOR_V2.RED_LIGHT_700,
|
|
127
137
|
};
|
|
128
|
-
return
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
138
|
+
return {
|
|
139
|
+
lineHeight: '1.5rem',
|
|
140
|
+
...(isActive
|
|
141
|
+
? activeStyles
|
|
142
|
+
: {
|
|
143
|
+
color: disabled ? Identity_1.COLOR_V2.GRAY_80 : Identity_1.COLOR_V2.WHITE,
|
|
144
|
+
backgroundColor: backgroundColor || disabled ? Identity_1.COLOR_V2.GRAY_50 : Identity_1.COLOR_V2.RED,
|
|
145
|
+
}),
|
|
146
|
+
...(!disabled && {
|
|
147
|
+
'&:hover, &:focus': {
|
|
148
|
+
backgroundColor: Identity_1.COLOR_V2.RED_LIGHT_600,
|
|
149
|
+
},
|
|
150
|
+
'&:focus': {
|
|
151
|
+
border: `1px solid ${Identity_1.COLOR_V2.RED_LIGHT_700}`,
|
|
152
|
+
},
|
|
153
|
+
'&:active': activeStyles,
|
|
154
|
+
}),
|
|
155
|
+
};
|
|
142
156
|
};
|
|
143
157
|
const buttonSendStyles = ({ backgroundColor, disabled, isActive }) => {
|
|
144
158
|
const activeStyles = {
|
|
145
159
|
backgroundColor: Identity_1.COLOR_V2.BLUE_LIGHT_700,
|
|
146
160
|
};
|
|
147
|
-
return
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
161
|
+
return {
|
|
162
|
+
width: '40px',
|
|
163
|
+
...(isActive
|
|
164
|
+
? activeStyles
|
|
165
|
+
: {
|
|
166
|
+
backgroundColor: backgroundColor || disabled ? Identity_1.COLOR_V2.GRAY_70 : Identity_1.COLOR_V2.BLUE,
|
|
167
|
+
}),
|
|
168
|
+
...(!disabled && {
|
|
169
|
+
'&:hover, &:focus': {
|
|
170
|
+
backgroundColor: Identity_1.COLOR_V2.BLUE_LIGHT_600,
|
|
171
|
+
},
|
|
172
|
+
'&:focus': {
|
|
173
|
+
border: `1px solid ${Identity_1.COLOR_V2.BLUE_LIGHT_800}`,
|
|
174
|
+
},
|
|
175
|
+
'&:active': activeStyles,
|
|
176
|
+
}),
|
|
177
|
+
};
|
|
160
178
|
};
|
|
161
|
-
const buttonStyle = (theme,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
179
|
+
const buttonStyle = (theme, { variant = Button_1.ButtonVariant.PRIMARY, backgroundColor, block = false, disabled = false, noCapital = false, bold = true, center = true, color = Identity_1.COLOR.WHITE, fontSize = theme.fontSizes.base, noWrap = true, textTransform = 'none', truncate = true, ...props }) => {
|
|
180
|
+
return {
|
|
181
|
+
...(0, Text_1.textStyle)(theme, {
|
|
182
|
+
block,
|
|
183
|
+
bold,
|
|
184
|
+
center,
|
|
185
|
+
disabled,
|
|
186
|
+
fontSize,
|
|
187
|
+
noWrap,
|
|
188
|
+
textTransform,
|
|
189
|
+
truncate,
|
|
190
|
+
...props,
|
|
191
|
+
}),
|
|
192
|
+
border: 0,
|
|
193
|
+
cursor: disabled ? 'default' : 'pointer',
|
|
194
|
+
display: 'flex',
|
|
195
|
+
alignItems: 'center',
|
|
196
|
+
justifyContent: 'center',
|
|
197
|
+
marginBottom: '16px',
|
|
198
|
+
padding: 0,
|
|
199
|
+
outline: 'none',
|
|
200
|
+
textDecoration: 'none',
|
|
201
|
+
touchAction: 'manipulation',
|
|
202
|
+
transition: motions_1.defaultTransition,
|
|
203
|
+
width: block ? '100%' : 'auto',
|
|
204
|
+
'&:hover, &:focus': {
|
|
171
205
|
textDecoration: 'none',
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
206
|
+
},
|
|
207
|
+
...(variant !== Button_1.ButtonVariant.TERTIARY && {
|
|
208
|
+
borderRadius: variant === Button_1.ButtonVariant.SEND ? '100%' : '16px',
|
|
209
|
+
height: variant === Button_1.ButtonVariant.SEND ? '40px' : '48px',
|
|
210
|
+
lineHeight: variant === Button_1.ButtonVariant.SEND ? '40px' : '48px',
|
|
211
|
+
...(variant !== Button_1.ButtonVariant.SEND && {
|
|
212
|
+
maxWidth: '100%',
|
|
213
|
+
minWidth: '125px',
|
|
214
|
+
padding: '0 16px',
|
|
215
|
+
}),
|
|
216
|
+
}),
|
|
217
|
+
...(variant === Button_1.ButtonVariant.PRIMARY && buttonPrimaryStyles(theme, props)),
|
|
218
|
+
...(variant === Button_1.ButtonVariant.SECONDARY && buttonSecondaryStyles(theme, props)),
|
|
219
|
+
...(variant === Button_1.ButtonVariant.TERTIARY && buttonTertiaryStyles(theme, props)),
|
|
220
|
+
...(variant === Button_1.ButtonVariant.QUATERNARY && buttonQuaternaryStyles(props)),
|
|
221
|
+
...(variant === Button_1.ButtonVariant.CANCEL && buttonCancelStyles(props)),
|
|
222
|
+
...(variant === Button_1.ButtonVariant.SEND && buttonSendStyles(props)),
|
|
223
|
+
};
|
|
177
224
|
};
|
|
178
225
|
exports.buttonStyle = buttonStyle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonLink.d.ts","sourceRoot":"","sources":["../../src/Form/ButtonLink.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAIrC,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAKhC,eAAO,MAAM,eAAe,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,iBAAiB,CAAC,KAAK,SAGrF,CAAC;AAUH,eAAO,MAAM,UAAU,sDAKpB,
|
|
1
|
+
{"version":3,"file":"ButtonLink.d.ts","sourceRoot":"","sources":["../../src/Form/ButtonLink.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAIrC,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAKhC,eAAO,MAAM,eAAe,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,iBAAiB,CAAC,KAAK,SAGrF,CAAC;AAUH,eAAO,MAAM,UAAU,sDAKpB,WAAW,CAAC,iBAAiB,CAAC,qDAIhC,CAAC"}
|
package/lib/Form/ButtonLink.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.ButtonLink = exports.buttonLinkStyle = void 0;
|
|
15
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
@@ -18,7 +7,10 @@ const Identity_1 = require("../Identity");
|
|
|
18
7
|
const Misc_1 = require("../Misc");
|
|
19
8
|
const Text_1 = require("../Text");
|
|
20
9
|
const util_1 = require("../util");
|
|
21
|
-
const buttonLinkStyle = (theme, props) => (
|
|
10
|
+
const buttonLinkStyle = (theme, props) => ({
|
|
11
|
+
...(0, Button_styles_1.buttonStyle)(theme, props),
|
|
12
|
+
display: 'inline-flex !important',
|
|
13
|
+
});
|
|
22
14
|
exports.buttonLinkStyle = buttonLinkStyle;
|
|
23
15
|
const filterButtonLinkProps = (props) => {
|
|
24
16
|
return (0, util_1.filterProps)((0, Text_1.filterTextProps)(props), [
|
|
@@ -27,8 +19,5 @@ const filterButtonLinkProps = (props) => {
|
|
|
27
19
|
'noCapital',
|
|
28
20
|
]);
|
|
29
21
|
};
|
|
30
|
-
const ButtonLink = (
|
|
31
|
-
var { children, showLoading, loadingColor = Identity_1.COLOR.WHITE } = _a, props = __rest(_a, ["children", "showLoading", "loadingColor"]);
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)("a", Object.assign({ css: (theme) => (0, exports.buttonLinkStyle)(theme, props) }, filterButtonLinkProps(props), { children: showLoading ? (0, jsx_runtime_1.jsx)(Misc_1.Loading, { size: 30, color: loadingColor, style: { display: 'flex', margin: 'auto' } }) : children })));
|
|
33
|
-
};
|
|
22
|
+
const ButtonLink = ({ children, showLoading, loadingColor = Identity_1.COLOR.WHITE, ...props }) => ((0, jsx_runtime_1.jsx)("a", { css: (theme) => (0, exports.buttonLinkStyle)(theme, props), ...filterButtonLinkProps(props), children: showLoading ? (0, jsx_runtime_1.jsx)(Misc_1.Loading, { size: 30, color: loadingColor, style: { display: 'flex', margin: 'auto' } }) : children }));
|
|
34
23
|
exports.ButtonLink = ButtonLink;
|
package/lib/Form/Checkbox.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.CheckboxLabel = exports.Checkbox = void 0;
|
|
38
27
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
@@ -58,53 +47,94 @@ const react_1 = require("react");
|
|
|
58
47
|
const React = __importStar(require("react"));
|
|
59
48
|
const Input_1 = require("./Input");
|
|
60
49
|
const Text_1 = require("../Text");
|
|
61
|
-
const StyledLabel = (
|
|
62
|
-
|
|
63
|
-
|
|
50
|
+
const StyledLabel = ({ disabled, markInvalid, aligncenter = false, labelBeforeCheckbox = false, children, ...props }) => {
|
|
51
|
+
return ((0, jsx_runtime_1.jsxs)("label", { css: (theme) => ({
|
|
52
|
+
[`.${Input_1.INPUT_CLASSNAME}:checked + &::before`]: {
|
|
64
53
|
background: `${disabled ? theme.Checkbox.disablecheckedBgColor : theme.general.primaryColor}`,
|
|
65
54
|
borderColor: theme.general.primaryColor,
|
|
66
|
-
},
|
|
55
|
+
},
|
|
56
|
+
[`.${Input_1.INPUT_CLASSNAME}:checked + & > svg`]: {
|
|
67
57
|
fill: theme.general.backgroundColor,
|
|
68
|
-
}, [`.${Input_1.INPUT_CLASSNAME} + & > svg`]: Object.assign({ fill: 'none', position: 'absolute', top: '50%', transform: 'translateY(-50%)' }, (labelBeforeCheckbox
|
|
69
|
-
? {
|
|
70
|
-
right: '11px',
|
|
71
|
-
}
|
|
72
|
-
: {
|
|
73
|
-
left: '4px',
|
|
74
|
-
})) }, (!disabled && {
|
|
75
|
-
[`.${Input_1.INPUT_CLASSNAME}:hover + &::before`]: {
|
|
76
|
-
borderColor: theme.general.primaryColor,
|
|
77
58
|
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
59
|
+
[`.${Input_1.INPUT_CLASSNAME} + & > svg`]: {
|
|
60
|
+
fill: 'none',
|
|
61
|
+
position: 'absolute',
|
|
62
|
+
top: '50%',
|
|
63
|
+
transform: 'translateY(-50%)',
|
|
64
|
+
...(labelBeforeCheckbox
|
|
65
|
+
? {
|
|
66
|
+
right: '11px',
|
|
67
|
+
}
|
|
68
|
+
: {
|
|
69
|
+
left: '4px',
|
|
70
|
+
}),
|
|
71
|
+
},
|
|
72
|
+
...(!disabled && {
|
|
73
|
+
[`.${Input_1.INPUT_CLASSNAME}:hover + &::before`]: {
|
|
74
|
+
borderColor: theme.general.primaryColor,
|
|
75
|
+
},
|
|
76
|
+
}),
|
|
77
|
+
[`.${Input_1.INPUT_CLASSNAME} + &::before`]: {
|
|
78
|
+
background: disabled ? theme.Checkbox.disableBgColor : theme.Checkbox.background,
|
|
79
|
+
...(!disabled
|
|
80
|
+
? {
|
|
81
|
+
border: markInvalid
|
|
82
|
+
? `2px solid ${theme.Checkbox.invalidBorderColor}`
|
|
83
|
+
: `2px solid ${theme.Checkbox.border}`,
|
|
84
|
+
}
|
|
85
|
+
: {
|
|
86
|
+
border: `2px solid ${theme.Checkbox.disableBorderColor}`,
|
|
87
|
+
}),
|
|
88
|
+
borderRadius: '3px',
|
|
89
|
+
boxSizing: 'border-box',
|
|
90
|
+
content: '""',
|
|
91
|
+
display: 'inline-block',
|
|
92
|
+
minWidth: '22px',
|
|
93
|
+
height: '22px',
|
|
94
|
+
lineHeight: '1.4rem',
|
|
95
|
+
margin: '0 8px 0 0px',
|
|
96
|
+
color: theme.general.color,
|
|
97
|
+
},
|
|
98
|
+
...(labelBeforeCheckbox && {
|
|
99
|
+
flexDirection: 'row-reverse',
|
|
100
|
+
justifyContent: 'space-between',
|
|
101
|
+
}),
|
|
102
|
+
alignItems: 'center',
|
|
103
|
+
position: 'relative',
|
|
104
|
+
margin: '0 0 0 -16px',
|
|
105
|
+
width: aligncenter ? 'auto' : '100%',
|
|
106
|
+
lineHeight: '1.4rem',
|
|
107
|
+
display: 'flex',
|
|
108
|
+
opacity: disabled ? 0.56 : 1,
|
|
109
|
+
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
110
|
+
borderRadius: '4px',
|
|
111
|
+
}), ...props, children: [children, (0, jsx_runtime_1.jsx)("svg", { width: "15", height: "13", viewBox: "0 0 16 13", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M5.65685 12.0711L15.9842 1.62738L14.57 0.213167L5.65685 9.24264L1.41421 5L0 6.41421L5.65685 12.0711Z" }) })] }));
|
|
90
112
|
};
|
|
91
|
-
exports.Checkbox = React.forwardRef((
|
|
92
|
-
var { id, children, style, disabled, wrapperCSS = {}, markInvalid, aligncenter, labelBeforeCheckbox, outlineOffset = '0.4rem' } = _a, props = __rest(_a, ["id", "children", "style", "disabled", "wrapperCSS", "markInvalid", "aligncenter", "labelBeforeCheckbox", "outlineOffset"]);
|
|
113
|
+
exports.Checkbox = React.forwardRef(({ id, children, style, disabled, wrapperCSS = {}, markInvalid, aligncenter, labelBeforeCheckbox, outlineOffset = '0.4rem', ...props }, ref) => {
|
|
93
114
|
const inputId = (0, react_1.useId)();
|
|
94
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: (theme) => (
|
|
115
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: (theme) => ({
|
|
116
|
+
alignItems: 'center',
|
|
117
|
+
display: 'flex',
|
|
118
|
+
justifyContent: 'flex-start',
|
|
119
|
+
position: 'relative',
|
|
120
|
+
left: '-0.3rem',
|
|
121
|
+
[`.${Input_1.INPUT_CLASSNAME}:focus-visible + label`]: {
|
|
95
122
|
outline: `1px solid ${theme.general.primaryColor}`,
|
|
96
123
|
outlineOffset: outlineOffset,
|
|
97
|
-
}
|
|
124
|
+
},
|
|
125
|
+
...wrapperCSS,
|
|
126
|
+
}), style: style, children: [(0, jsx_runtime_1.jsx)("input", { type: "checkbox", id: id ?? inputId, style: {
|
|
98
127
|
height: '22px',
|
|
99
128
|
marginBottom: '0',
|
|
100
129
|
opacity: 0,
|
|
101
130
|
width: '22px',
|
|
102
131
|
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
103
|
-
}, disabled: disabled, ref: ref, className: Input_1.INPUT_CLASSNAME
|
|
132
|
+
}, disabled: disabled, ref: ref, className: Input_1.INPUT_CLASSNAME, ...props }), (0, jsx_runtime_1.jsx)(StyledLabel, { htmlFor: id ?? inputId, disabled: disabled, markInvalid: markInvalid, aligncenter: aligncenter, labelBeforeCheckbox: labelBeforeCheckbox, children: children })] }));
|
|
104
133
|
});
|
|
105
134
|
exports.Checkbox.displayName = 'Checkbox';
|
|
106
|
-
const CheckboxLabel = (
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
135
|
+
const CheckboxLabel = ({ ...props }) => ((0, jsx_runtime_1.jsx)(Text_1.Text, { css: (theme) => ({
|
|
136
|
+
...(0, Text_1.textStyle)(theme, {
|
|
137
|
+
...props,
|
|
138
|
+
}),
|
|
139
|
+
}), ...props }));
|
|
110
140
|
exports.CheckboxLabel = CheckboxLabel;
|
package/lib/Form/CodeInput.js
CHANGED
|
@@ -48,16 +48,27 @@ const React = __importStar(require("react"));
|
|
|
48
48
|
const Input_1 = require("./Input");
|
|
49
49
|
const Identity_1 = require("../Identity");
|
|
50
50
|
const util_1 = require("../util");
|
|
51
|
-
const CodeInputWrapper = (props) => ((0, jsx_runtime_1.jsx)("div",
|
|
51
|
+
const CodeInputWrapper = (props) => ((0, jsx_runtime_1.jsx)("div", { css: {
|
|
52
52
|
display: 'flex',
|
|
53
53
|
justifyContent: 'center',
|
|
54
|
-
}
|
|
55
|
-
const digitInputStyle = (theme, props) => (
|
|
54
|
+
}, ...props }));
|
|
55
|
+
const digitInputStyle = (theme, props) => ({
|
|
56
|
+
...(0, Input_1.inputStyle)(theme, props),
|
|
57
|
+
'& + &': {
|
|
56
58
|
marginLeft: 'min(19px, 2vw)',
|
|
57
|
-
},
|
|
59
|
+
},
|
|
60
|
+
'&:hover': {
|
|
58
61
|
boxShadow: `0 0 0 1px ${Identity_1.COLOR_V2.GRAY_60}`,
|
|
59
|
-
},
|
|
60
|
-
|
|
62
|
+
},
|
|
63
|
+
fontSize: theme.fontSizes.extraLarge,
|
|
64
|
+
lineHeight: '1.75rem',
|
|
65
|
+
borderRadius: '12px',
|
|
66
|
+
padding: 0,
|
|
67
|
+
textAlign: 'center',
|
|
68
|
+
width: 'min(48px, 13vw)',
|
|
69
|
+
height: '56px',
|
|
70
|
+
});
|
|
71
|
+
const DigitInput = React.forwardRef((props, ref) => ((0, jsx_runtime_1.jsx)("input", { ref: ref, css: (theme) => digitInputStyle(theme, props), ...props, type: "tel" })));
|
|
61
72
|
DigitInput.displayName = 'DigitInput';
|
|
62
73
|
const CodeInput = ({ style, digits = 6, autoFocus = false, markInvalid, onCodeComplete = util_1.noop, disabled, }) => {
|
|
63
74
|
const [values, setValues] = (0, react_1.useState)(Array(digits).fill(''));
|
|
@@ -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.DropFileInput = exports.dropFileZonDescriptionStyle = exports.dropFileZoneHeadingStyle = exports.dropFileZoneLabelStyle = exports.dropFileZoneWrapperStyle = exports.dropFileWrapperStyle = void 0;
|
|
15
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
@@ -84,8 +73,7 @@ exports.dropFileZonDescriptionStyle = {
|
|
|
84
73
|
color: Identity_1.COLOR.GRAY,
|
|
85
74
|
whiteSpace: 'pre-line',
|
|
86
75
|
};
|
|
87
|
-
exports.DropFileInput = (0, react_1.forwardRef)((
|
|
88
|
-
var { onFilesUploaded, onInvalidFilesDropError, dropFileZoneWrapperCSS, labelText, headingText, description, accept, multiple } = _a, inputProps = __rest(_a, ["onFilesUploaded", "onInvalidFilesDropError", "dropFileZoneWrapperCSS", "labelText", "headingText", "description", "accept", "multiple"]);
|
|
76
|
+
exports.DropFileInput = (0, react_1.forwardRef)(({ onFilesUploaded, onInvalidFilesDropError, dropFileZoneWrapperCSS, labelText, headingText, description, accept, multiple, ...inputProps }, ref) => {
|
|
89
77
|
const [isDraggedOver, setIsDraggedOver] = (0, react_1.useState)(false);
|
|
90
78
|
const resetDraggedOver = () => setIsDraggedOver(false);
|
|
91
79
|
const handleDragOver = (event) => {
|
|
@@ -124,6 +112,9 @@ exports.DropFileInput = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
124
112
|
}
|
|
125
113
|
onFilesUploaded(Array.from(files));
|
|
126
114
|
};
|
|
127
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: exports.dropFileWrapperStyle, children: [(0, jsx_runtime_1.jsx)("div", { css: (theme) => (
|
|
115
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: exports.dropFileWrapperStyle, children: [(0, jsx_runtime_1.jsx)("div", { css: (theme) => ({
|
|
116
|
+
...(0, exports.dropFileZoneWrapperStyle)(theme, isDraggedOver),
|
|
117
|
+
...dropFileZoneWrapperCSS,
|
|
118
|
+
}), "data-testid": "dropzone", onDragOver: handleDragOver, onDragLeave: resetDraggedOver, onDrop: handleDrop, children: (0, jsx_runtime_1.jsxs)(Layout_1.FlexBox, { align: "center", justify: "center", flexWrap: "wrap", css: { maxWidth: '280px', margin: '0 auto' }, children: [(0, jsx_runtime_1.jsx)(Icon_1.UploadIcon, { css: { margin: '12px 0' } }), (0, jsx_runtime_1.jsxs)("div", { css: { maxWidth: '160px', margin: '0 25px' }, children: [(0, jsx_runtime_1.jsx)("span", { css: exports.dropFileZoneHeadingStyle, children: headingText }), (0, jsx_runtime_1.jsxs)("label", { "aria-label": `${headingText} ${labelText} (${description})`, css: (theme) => (0, exports.dropFileZoneLabelStyle)(theme), children: [(0, jsx_runtime_1.jsx)("span", { children: labelText }), (0, jsx_runtime_1.jsx)("input", { "data-testid": "file-input", ref: ref, accept: accept, multiple: multiple, css: visuallyHiddenStyles, onChange: handleChange, type: "file", ...inputProps })] })] })] }) }), description && (0, jsx_runtime_1.jsx)("p", { css: exports.dropFileZonDescriptionStyle, children: description })] }));
|
|
128
119
|
});
|
|
129
120
|
exports.DropFileInput.displayName = 'DropFileInput';
|