@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/Menu/MenuModal.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.MenuItem = exports.MenuModal = void 0;
|
|
15
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
@@ -18,9 +7,16 @@ const motions_1 = require("../Identity/motions");
|
|
|
18
7
|
const mediaQueries_1 = require("../mediaQueries");
|
|
19
8
|
const Overlay_1 = require("../Modal/Overlay");
|
|
20
9
|
const util_1 = require("../util");
|
|
21
|
-
const menuModalWrapperStyle = props => (
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
const menuModalWrapperStyle = props => ({
|
|
11
|
+
...(0, Overlay_1.overlayBackgroundStyle)(props),
|
|
12
|
+
alignItems: 'flex-end',
|
|
13
|
+
alignSelf: 'flex-end',
|
|
14
|
+
display: 'flex',
|
|
15
|
+
overflowY: 'hidden',
|
|
16
|
+
padding: 0,
|
|
17
|
+
});
|
|
18
|
+
const MenuModalWrapper = (props) => (0, jsx_runtime_1.jsx)("div", { css: menuModalWrapperStyle, ...props });
|
|
19
|
+
const MenuModalBody = (props) => ((0, jsx_runtime_1.jsx)("div", { css: (theme) => ({
|
|
24
20
|
animation: `${motions_1.ANIMATION.bottomUpMovement} ${motions_1.DURATION.DEFAULT}ms ${motions_1.EASE.EXPONENTIAL}`,
|
|
25
21
|
backgroundColor: Identity_1.COLOR.tint(theme.general.backgroundColor, 0.16),
|
|
26
22
|
boxShadow: '0 16px 64px 0 rgba(0, 0, 0, 0.16)',
|
|
@@ -36,8 +32,8 @@ const MenuModalBody = (props) => ((0, jsx_runtime_1.jsx)("div", Object.assign({
|
|
|
36
32
|
[mediaQueries_1.media[mediaQueries_1.QueryKeys.TABLET_DOWN]]: {
|
|
37
33
|
width: '100%',
|
|
38
34
|
},
|
|
39
|
-
})
|
|
40
|
-
const MenuModalContent = (props) => ((0, jsx_runtime_1.jsx)("ul",
|
|
35
|
+
}), ...props }));
|
|
36
|
+
const MenuModalContent = (props) => ((0, jsx_runtime_1.jsx)("ul", { css: {
|
|
41
37
|
li: {
|
|
42
38
|
borderBottom: `1px solid ${Identity_1.COLOR.GRAY_LIGHTEN_72}`,
|
|
43
39
|
},
|
|
@@ -48,24 +44,21 @@ const MenuModalContent = (props) => ((0, jsx_runtime_1.jsx)("ul", Object.assign(
|
|
|
48
44
|
maxWidth: '100%',
|
|
49
45
|
minWidth: '100%',
|
|
50
46
|
padding: 0,
|
|
51
|
-
}
|
|
52
|
-
const modalBackgroundStyle = props => (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
};
|
|
47
|
+
}, ...props }));
|
|
48
|
+
const modalBackgroundStyle = props => ({
|
|
49
|
+
...(0, Overlay_1.overlayBackgroundStyle)(props),
|
|
50
|
+
background: 'rgba(50, 54, 57, 0.4)',
|
|
51
|
+
});
|
|
52
|
+
const MenuModalBackground = (props) => (0, jsx_runtime_1.jsx)("div", { css: modalBackgroundStyle, ...props });
|
|
53
|
+
const MenuModal = ({ children = null, onBackgroundClick = util_1.noop, ...props }) => ((0, jsx_runtime_1.jsxs)(MenuModalWrapper, { ...props, children: [(0, jsx_runtime_1.jsx)(MenuModalBody, { children: (0, jsx_runtime_1.jsx)(MenuModalContent, { children: children }) }), (0, jsx_runtime_1.jsx)(MenuModalBackground, { onClick: onBackgroundClick, "data-uie-name": "menu-background" })] }));
|
|
58
54
|
exports.MenuModal = MenuModal;
|
|
59
|
-
const MenuItem = (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
maxWidth: '100%',
|
|
69
|
-
}) }, props, { children: children })));
|
|
70
|
-
};
|
|
55
|
+
const MenuItem = ({ children = null, ...props }) => ((0, jsx_runtime_1.jsx)("li", { css: (theme) => ({
|
|
56
|
+
alignItems: 'center',
|
|
57
|
+
color: theme.general.color,
|
|
58
|
+
cursor: 'pointer',
|
|
59
|
+
display: 'flex',
|
|
60
|
+
height: '56px',
|
|
61
|
+
listStyleType: 'none',
|
|
62
|
+
maxWidth: '100%',
|
|
63
|
+
}), ...props, children: children }));
|
|
71
64
|
exports.MenuItem = MenuItem;
|
package/lib/Menu/TabBar.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { TextProps } from '../Text';
|
|
3
3
|
export type TabBarProps<T = HTMLDivElement> = React.HTMLProps<T>;
|
|
4
|
-
export declare const TabBar: ({ children, ...props }: TabBarProps
|
|
4
|
+
export declare const TabBar: ({ children, ...props }: TabBarProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
5
5
|
export interface TabBarItemProps<T = HTMLSpanElement> extends TextProps<T> {
|
|
6
6
|
active: boolean;
|
|
7
7
|
}
|
package/lib/Menu/TabBar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBar.d.ts","sourceRoot":"","sources":["../../src/Menu/TabBar.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAC,SAAS,EAAY,MAAM,SAAS,CAAC;AAG7C,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,cAAc,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAWjE,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"TabBar.d.ts","sourceRoot":"","sources":["../../src/Menu/TabBar.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAC,SAAS,EAAY,MAAM,SAAS,CAAC;AAG7C,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,cAAc,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAWjE,eAAO,MAAM,MAAM,2BAAiC,WAAW,qDAI9D,CAAC;AAEF,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,eAAe,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IACxE,MAAM,EAAE,OAAO,CAAC;CACjB;AA2BD,eAAO,MAAM,UAAU,2BAAiC,eAAe,qDAItE,CAAC"}
|
package/lib/Menu/TabBar.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.TabBarItem = exports.TabBar = void 0;
|
|
15
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
@@ -23,17 +12,19 @@ const tabBarStyle = ({}) => {
|
|
|
23
12
|
};
|
|
24
13
|
};
|
|
25
14
|
const filteredTabBarProps = (props) => (0, util_1.filterProps)(props, []);
|
|
26
|
-
const TabBar = (
|
|
27
|
-
var { children = null } = _a, props = __rest(_a, ["children"]);
|
|
28
|
-
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ css: tabBarStyle(props) }, filteredTabBarProps(props), { children: children })));
|
|
29
|
-
};
|
|
15
|
+
const TabBar = ({ children = null, ...props }) => ((0, jsx_runtime_1.jsx)("div", { css: tabBarStyle(props), ...filteredTabBarProps(props), children: children }));
|
|
30
16
|
exports.TabBar = TabBar;
|
|
31
|
-
const tabBarItemStyle = (theme,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
17
|
+
const tabBarItemStyle = (theme, { block = true, center = true, color = theme.general.color, bold = true, active = false, fontSize = theme.fontSizes.extraSmall, textTransform = 'uppercase', ...props }) => {
|
|
18
|
+
return {
|
|
19
|
+
...(0, Text_1.textStyle)(theme, { block, bold, center, color, fontSize, textTransform, ...props }),
|
|
20
|
+
borderBottom: active ? `1px solid ${Identity_1.COLOR.GRAY_DARKEN_48}` : `1px solid ${Identity_1.COLOR.GRAY_LIGHTEN_40}`,
|
|
21
|
+
cursor: 'pointer',
|
|
22
|
+
display: 'flex',
|
|
23
|
+
flexGrow: 1,
|
|
24
|
+
justifyContent: 'center',
|
|
25
|
+
opacity: active ? 1 : 0.56,
|
|
26
|
+
padding: '8px 0',
|
|
27
|
+
};
|
|
38
28
|
};
|
|
29
|
+
const TabBarItem = ({ children = null, ...props }) => ((0, jsx_runtime_1.jsx)("span", { css: (theme) => tabBarItemStyle(theme, props), ...props, children: children }));
|
|
39
30
|
exports.TabBarItem = TabBarItem;
|
package/lib/Misc/ButtonGroup.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.ButtonGroup = void 0;
|
|
15
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
@@ -18,44 +7,58 @@ const buttonGroupStyle = () => ({
|
|
|
18
7
|
display: 'flex',
|
|
19
8
|
alignItems: 'center',
|
|
20
9
|
});
|
|
21
|
-
const buttonStyle = (_, { disabled = false }) => (
|
|
10
|
+
const buttonStyle = (_, { disabled = false }) => ({
|
|
11
|
+
height: '32px',
|
|
12
|
+
borderRadius: '12px',
|
|
13
|
+
padding: '0 12px',
|
|
14
|
+
background: Identity_1.COLOR_V2.WHITE,
|
|
15
|
+
border: `1px solid ${Identity_1.COLOR_V2.GRAY_40}`,
|
|
16
|
+
cursor: 'pointer',
|
|
17
|
+
display: 'flex',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
backgroundColor: disabled ? Identity_1.COLOR_V2.GRAY_20 : Identity_1.COLOR_V2.WHITE,
|
|
20
|
+
svg: {
|
|
22
21
|
fill: disabled ? Identity_1.COLOR_V2.GRAY_70 : Identity_1.COLOR_V2.BLACK,
|
|
23
|
-
},
|
|
22
|
+
},
|
|
23
|
+
'&:not(:last-child)': {
|
|
24
24
|
borderTopRightRadius: '0',
|
|
25
25
|
borderBottomRightRadius: '0',
|
|
26
|
-
},
|
|
26
|
+
},
|
|
27
|
+
'&:not(:first-child)': {
|
|
27
28
|
borderTopLeftRadius: '0',
|
|
28
29
|
borderBottomLeftRadius: '0',
|
|
29
|
-
}, '&:first-child:last-child': {
|
|
30
|
-
borderRadius: '0',
|
|
31
|
-
} }, (!disabled && {
|
|
32
|
-
'&:hover, &:focus': {
|
|
33
|
-
backgroundColor: Identity_1.COLOR_V2.GRAY_20,
|
|
34
|
-
},
|
|
35
|
-
'&:hover': {
|
|
36
|
-
borderColor: Identity_1.COLOR_V2.GRAY_50,
|
|
37
30
|
},
|
|
38
|
-
'&:
|
|
39
|
-
|
|
31
|
+
'&:first-child:last-child': {
|
|
32
|
+
borderRadius: '0',
|
|
40
33
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
svg: {
|
|
45
|
-
fill: Identity_1.COLOR_V2.BLUE,
|
|
34
|
+
...(!disabled && {
|
|
35
|
+
'&:hover, &:focus': {
|
|
36
|
+
backgroundColor: Identity_1.COLOR_V2.GRAY_20,
|
|
46
37
|
},
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
'&:hover': {
|
|
39
|
+
borderColor: Identity_1.COLOR_V2.GRAY_50,
|
|
40
|
+
},
|
|
41
|
+
'&:focus': {
|
|
42
|
+
borderColor: Identity_1.COLOR_V2.GRAY_60,
|
|
43
|
+
},
|
|
44
|
+
'&:active': {
|
|
45
|
+
backgroundColor: Identity_1.COLOR_V2.BLUE_LIGHT_50,
|
|
46
|
+
borderColor: Identity_1.COLOR_V2.BLUE_LIGHT_300,
|
|
47
|
+
svg: {
|
|
48
|
+
fill: Identity_1.COLOR_V2.BLUE,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
}),
|
|
52
|
+
});
|
|
49
53
|
const ButtonGroup = ({ children }) => ((0, jsx_runtime_1.jsx)("div", { css: (theme) => buttonGroupStyle(theme), role: "group", "aria-label": "Button Group", children: children }));
|
|
50
54
|
exports.ButtonGroup = ButtonGroup;
|
|
51
|
-
const Button = (
|
|
52
|
-
|
|
53
|
-
return ((0, jsx_runtime_1.jsxs)("button", Object.assign({ css: (theme) => buttonStyle(theme, props) }, props, { children: [icon, children && ((0, jsx_runtime_1.jsx)("span", { css: (theme) => ({
|
|
55
|
+
const Button = ({ children, icon, ...props }) => {
|
|
56
|
+
return ((0, jsx_runtime_1.jsxs)("button", { css: (theme) => buttonStyle(theme, props), ...props, children: [icon, children && ((0, jsx_runtime_1.jsx)("span", { css: (theme) => ({
|
|
54
57
|
marginLeft: !!icon && '6px',
|
|
55
58
|
fontSize: theme.fontSizes.small,
|
|
56
59
|
fontWeight: 'bold',
|
|
57
60
|
lineHeight: '0.875rem',
|
|
58
61
|
letterSpacing: '0.25px',
|
|
59
|
-
}), children: children }))] }))
|
|
62
|
+
}), children: children }))] }));
|
|
60
63
|
};
|
|
61
64
|
ButtonGroup.Button = Button;
|
package/lib/Misc/IconButton.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.IconButton = exports.iconButtonStyle = exports.IconButtonVariant = void 0;
|
|
15
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
@@ -21,52 +10,76 @@ var IconButtonVariant;
|
|
|
21
10
|
IconButtonVariant["PRIMARY"] = "primary";
|
|
22
11
|
IconButtonVariant["SECONDARY"] = "secondary";
|
|
23
12
|
})(IconButtonVariant || (exports.IconButtonVariant = IconButtonVariant = {}));
|
|
24
|
-
const iconButtonStyle = (theme, { variant = IconButtonVariant.PRIMARY, backgroundColor, disabled = false }) => (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
13
|
+
const iconButtonStyle = (theme, { variant = IconButtonVariant.PRIMARY, backgroundColor, disabled = false }) => ({
|
|
14
|
+
border: 0,
|
|
15
|
+
borderRadius: '12px',
|
|
16
|
+
cursor: disabled ? 'default' : 'pointer',
|
|
17
|
+
display: 'flex',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
justifyContent: 'center',
|
|
20
|
+
marginBottom: '16px',
|
|
21
|
+
padding: 0,
|
|
22
|
+
outline: 'none',
|
|
23
|
+
textDecoration: 'none',
|
|
24
|
+
touchAction: 'manipulation',
|
|
25
|
+
transition: motions_1.defaultTransition,
|
|
26
|
+
width: '40px',
|
|
27
|
+
height: '32px',
|
|
33
28
|
'&:hover, &:focus': {
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
'&:hover': {
|
|
37
|
-
borderColor: theme.IconButton.primaryHoverBorderColor,
|
|
38
|
-
},
|
|
39
|
-
'&:focus': {
|
|
40
|
-
borderColor: theme.IconButton.focusBorderColor,
|
|
29
|
+
textDecoration: 'none',
|
|
41
30
|
},
|
|
42
|
-
|
|
43
|
-
backgroundColor:
|
|
44
|
-
|
|
31
|
+
...(variant === IconButtonVariant.PRIMARY && {
|
|
32
|
+
backgroundColor: disabled
|
|
33
|
+
? theme.IconButton.primaryDisabledBgColor
|
|
34
|
+
: backgroundColor || theme.IconButton.primaryBgColor,
|
|
35
|
+
border: disabled
|
|
36
|
+
? `1px solid ${theme.IconButton.primaryDisabledBorderColor}`
|
|
37
|
+
: `1px solid ${theme.IconButton.primaryBorderColor}`,
|
|
45
38
|
svg: {
|
|
46
|
-
fill: theme.general.
|
|
39
|
+
fill: disabled ? theme.Input.placeholderColor : theme.general.color,
|
|
47
40
|
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
...(!disabled && {
|
|
42
|
+
'&:hover, &:focus': {
|
|
43
|
+
backgroundColor: theme.IconButton.hoverPrimaryBgColor,
|
|
44
|
+
},
|
|
45
|
+
'&:hover': {
|
|
46
|
+
borderColor: theme.IconButton.primaryHoverBorderColor,
|
|
47
|
+
},
|
|
48
|
+
'&:focus': {
|
|
49
|
+
borderColor: theme.IconButton.focusBorderColor,
|
|
50
|
+
},
|
|
51
|
+
'&:active': {
|
|
52
|
+
backgroundColor: theme.IconButton.activePrimaryBgColor,
|
|
53
|
+
borderColor: theme.IconButton.focusBorderColor,
|
|
54
|
+
svg: {
|
|
55
|
+
fill: theme.general.primaryColor,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
}),
|
|
59
|
+
}),
|
|
60
|
+
...(variant === IconButtonVariant.SECONDARY && {
|
|
61
|
+
backgroundColor: 'inherit',
|
|
53
62
|
svg: {
|
|
54
|
-
fill: theme.general.
|
|
63
|
+
fill: disabled ? theme.Input.placeholderColor : theme.general.color,
|
|
55
64
|
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
+
...(!disabled && {
|
|
66
|
+
'&:hover, &:focus, &:active': {
|
|
67
|
+
svg: {
|
|
68
|
+
fill: theme.general.primaryColor,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
'&:focus': {
|
|
72
|
+
border: `1px solid ${theme.IconButton.focusBorderColor}`,
|
|
73
|
+
},
|
|
74
|
+
'&:active': {
|
|
75
|
+
border: `1px solid ${theme.IconButton.secondaryActiveBorderColor}`,
|
|
76
|
+
backgroundColor: theme.Input.backgroundColor,
|
|
77
|
+
},
|
|
78
|
+
}),
|
|
79
|
+
}),
|
|
80
|
+
});
|
|
65
81
|
exports.iconButtonStyle = iconButtonStyle;
|
|
66
|
-
const IconButton = (
|
|
67
|
-
var { children } = _a, props = __rest(_a, ["children"]);
|
|
68
|
-
return ((0, jsx_runtime_1.jsx)("button", Object.assign({ css: (theme) => (0, exports.iconButtonStyle)(theme, props) }, filterButtonProps(props), { children: children })));
|
|
69
|
-
};
|
|
82
|
+
const IconButton = ({ children, ...props }) => ((0, jsx_runtime_1.jsx)("button", { css: (theme) => (0, exports.iconButtonStyle)(theme, props), ...filterButtonProps(props), children: children }));
|
|
70
83
|
exports.IconButton = IconButton;
|
|
71
84
|
const filterButtonProps = (props) => {
|
|
72
85
|
return (0, util_1.filterProps)((0, Text_1.filterTextProps)(props), ['backgroundColor']);
|
package/lib/Misc/IsInViewport.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.IsInViewport = void 0;
|
|
15
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
@@ -32,8 +21,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
32
21
|
*
|
|
33
22
|
*/
|
|
34
23
|
const react_1 = require("react");
|
|
35
|
-
const IsInViewport = (
|
|
36
|
-
var { onEnterViewport, disabled = false, checkViewportOnce = false } = _a, props = __rest(_a, ["onEnterViewport", "disabled", "checkViewportOnce"]);
|
|
24
|
+
const IsInViewport = ({ onEnterViewport, disabled = false, checkViewportOnce = false, ...props }) => {
|
|
37
25
|
const element = (0, react_1.useRef)();
|
|
38
26
|
(0, react_1.useEffect)(() => {
|
|
39
27
|
let observer = undefined;
|
|
@@ -56,6 +44,6 @@ const IsInViewport = (_a) => {
|
|
|
56
44
|
}
|
|
57
45
|
};
|
|
58
46
|
}, [onEnterViewport]);
|
|
59
|
-
return (0, jsx_runtime_1.jsx)("div",
|
|
47
|
+
return (0, jsx_runtime_1.jsx)("div", { ref: element, ...props });
|
|
60
48
|
};
|
|
61
49
|
exports.IsInViewport = IsInViewport;
|
package/lib/Misc/Loading.js
CHANGED
|
@@ -1,23 +1,11 @@
|
|
|
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.Loading = void 0;
|
|
15
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
16
5
|
const react_1 = require("@emotion/react");
|
|
17
6
|
const Identity_1 = require("../Identity");
|
|
18
7
|
const motions_1 = require("../Identity/motions");
|
|
19
|
-
const Loading = (
|
|
20
|
-
var { progress = undefined, size = 43, color = '#218fd1' } = _a, props = __rest(_a, ["progress", "size", "color"]);
|
|
8
|
+
const Loading = ({ progress = undefined, size = 43, color = '#218fd1', ...props }) => {
|
|
21
9
|
const pathLength = 125.68;
|
|
22
10
|
const rotationOffset = -0.75;
|
|
23
11
|
const rotationDelay = motions_1.DURATION.EXTRA_LONG * rotationOffset;
|
|
@@ -29,12 +17,12 @@ const Loading = (_a) => {
|
|
|
29
17
|
stroke-dashoffset: 0;
|
|
30
18
|
}
|
|
31
19
|
`;
|
|
32
|
-
return ((0, jsx_runtime_1.jsxs)("svg",
|
|
20
|
+
return ((0, jsx_runtime_1.jsxs)("svg", { width: size, height: size, viewBox: "0 0 43 43", strokeWidth: "3", fill: "none", ...props, children: [(0, jsx_runtime_1.jsx)("circle", { cx: "21.5", cy: "21.5", r: "20", stroke: Identity_1.COLOR.opaque(color, 0.08) }), (0, jsx_runtime_1.jsx)("circle", { css: !progress && {
|
|
33
21
|
animation: `${fillAnimation} ${motions_1.DURATION.EXTRA_LONG}ms ease-in-out infinite,
|
|
34
22
|
${motions_1.ANIMATION.rotate} ${motions_1.DURATION.EXTRA_LONG}ms linear ${rotationDelay}ms infinite`,
|
|
35
23
|
strokeDasharray: pathLength,
|
|
36
24
|
transformOrigin: '50% 50%',
|
|
37
|
-
}, cx: "21.5", cy: "21.5", r: "20", stroke: color, strokeLinecap: "round", strokeDasharray: pathLength, strokeDashoffset: progress && `${pathLength - pathLength * progress}` })] }))
|
|
25
|
+
}, cx: "21.5", cy: "21.5", r: "20", stroke: color, strokeLinecap: "round", strokeDasharray: pathLength, strokeDashoffset: progress && `${pathLength - pathLength * progress}` })] }));
|
|
38
26
|
};
|
|
39
27
|
exports.Loading = Loading;
|
|
40
28
|
exports.Loading.defaultProps = {
|
package/lib/Misc/Pagination.js
CHANGED
|
@@ -1,23 +1,11 @@
|
|
|
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.Pagination = void 0;
|
|
15
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
16
5
|
const Identity_1 = require("../Identity");
|
|
17
6
|
const Layout_1 = require("../Layout");
|
|
18
7
|
const Text_1 = require("../Text");
|
|
19
|
-
const Pagination = (
|
|
20
|
-
var { currentPage = 0, numberOfPages = 1, goPage, previousPageComponent: PreviousPageComponent = () => '<', nextPageComponent: NextPageComponent = () => '>' } = _a, props = __rest(_a, ["currentPage", "numberOfPages", "goPage", "previousPageComponent", "nextPageComponent"]);
|
|
8
|
+
const Pagination = ({ currentPage = 0, numberOfPages = 1, goPage, previousPageComponent: PreviousPageComponent = () => '<', nextPageComponent: NextPageComponent = () => '>', ...props }) => {
|
|
21
9
|
const isLastPage = currentPage === numberOfPages - 1;
|
|
22
10
|
const isFirstPage = currentPage === 0;
|
|
23
11
|
const renderPageList = () => {
|
|
@@ -40,6 +28,6 @@ const Pagination = (_a) => {
|
|
|
40
28
|
}
|
|
41
29
|
return pages;
|
|
42
30
|
};
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)(Layout_1.FlexBox,
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)(Layout_1.FlexBox, { align: "flex-end", "data-uie-name": "element-pagination", ...props, children: [(0, jsx_runtime_1.jsx)("div", { css: { flexBasis: 100 }, children: !isFirstPage && ((0, jsx_runtime_1.jsx)(Text_1.Link, { block: true, onClick: () => goPage(currentPage - 1), "data-uie-name": "go-previous-page", children: (0, jsx_runtime_1.jsx)(PreviousPageComponent, {}) })) }), (0, jsx_runtime_1.jsx)("div", { css: { alignItems: 'flex-end', display: 'flex', flexDirection: 'row', margin: '0 auto' }, "data-uie-name": "list-pages", children: renderPageList() }), (0, jsx_runtime_1.jsx)("div", { css: { display: 'flex', flexBasis: 100, justifyContent: 'flex-end' }, children: !isLastPage && ((0, jsx_runtime_1.jsx)(Text_1.Link, { block: true, onClick: () => goPage(currentPage + 1), "data-uie-name": "go-next-page", children: (0, jsx_runtime_1.jsx)(NextPageComponent, {}) })) })] }));
|
|
44
32
|
};
|
|
45
33
|
exports.Pagination = Pagination;
|
package/lib/Misc/Pill.js
CHANGED
|
@@ -52,5 +52,5 @@ const pillStyle = (theme, { active = false, type = null }) => {
|
|
|
52
52
|
exports.pillStyle = pillStyle;
|
|
53
53
|
const filterPillProps = (props) => (0, util_1.filterProps)(props, ['active']);
|
|
54
54
|
exports.filterPillProps = filterPillProps;
|
|
55
|
-
const Pill = (props) => ((0, jsx_runtime_1.jsx)("span",
|
|
55
|
+
const Pill = (props) => ((0, jsx_runtime_1.jsx)("span", { css: (theme) => (0, exports.pillStyle)(theme, props), "data-uie-name": "element-pill", "data-uie-status": props.type, ...(0, exports.filterPillProps)(props) }));
|
|
56
56
|
exports.Pill = Pill;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"childrenWithDefaultProps.d.ts","sourceRoot":"","sources":["../../src/Misc/childrenWithDefaultProps.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IAC5E,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,EAAE,CAAC,CAAC;CACjB;AAED,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"childrenWithDefaultProps.d.ts","sourceRoot":"","sources":["../../src/Misc/childrenWithDefaultProps.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IAC5E,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,EAAE,CAAC,CAAC;CACjB;AAED,eAAO,MAAM,wBAAwB,GAAI,CAAC,SAAS,OAAO,EAAE,CAAC,yBAAqB,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,6IAYjG,CAAC"}
|
|
@@ -52,6 +52,6 @@ const childrenWithDefaultProps = (props) => React.Children.map(props.children, n
|
|
|
52
52
|
return node;
|
|
53
53
|
}
|
|
54
54
|
const elementChild = node;
|
|
55
|
-
return React.cloneElement(elementChild,
|
|
55
|
+
return React.cloneElement(elementChild, { ...props.defaultProps, ...elementChild.props });
|
|
56
56
|
});
|
|
57
57
|
exports.childrenWithDefaultProps = childrenWithDefaultProps;
|
package/lib/Modal/Modal.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
|
};
|
|
@@ -43,8 +32,8 @@ const modalBodyStyle = (theme, { fullscreen = false }) => ({
|
|
|
43
32
|
},
|
|
44
33
|
});
|
|
45
34
|
const filterModalBodyProps = (props) => (0, util_1.filterProps)(props, ['fullscreen']);
|
|
46
|
-
const ModalBody = (props) => ((0, jsx_runtime_1.jsx)("div",
|
|
47
|
-
const ModalClose = (props) => ((0, jsx_runtime_1.jsx)(Icon_1.CloseIcon,
|
|
35
|
+
const ModalBody = (props) => ((0, jsx_runtime_1.jsx)("div", { css: (theme) => modalBodyStyle(theme, props), ...filterModalBodyProps(props) }));
|
|
36
|
+
const ModalClose = (props) => ((0, jsx_runtime_1.jsx)(Icon_1.CloseIcon, { width: 16, height: 16, css: {
|
|
48
37
|
alignItems: 'center',
|
|
49
38
|
cursor: 'pointer',
|
|
50
39
|
display: 'flex',
|
|
@@ -52,14 +41,17 @@ const ModalClose = (props) => ((0, jsx_runtime_1.jsx)(Icon_1.CloseIcon, Object.a
|
|
|
52
41
|
position: 'absolute',
|
|
53
42
|
right: 16,
|
|
54
43
|
top: 16,
|
|
55
|
-
}
|
|
56
|
-
const ModalContent = props => ((0, jsx_runtime_1.jsx)("div",
|
|
44
|
+
}, ...props }));
|
|
45
|
+
const ModalContent = props => ((0, jsx_runtime_1.jsx)("div", { css: {
|
|
57
46
|
maxWidth: '100%',
|
|
58
47
|
overflowY: 'auto',
|
|
59
48
|
padding: '40px',
|
|
60
|
-
}
|
|
61
|
-
const modalBackgroundStyle = props => (
|
|
62
|
-
|
|
49
|
+
}, ...props }));
|
|
50
|
+
const modalBackgroundStyle = props => ({
|
|
51
|
+
...(0, Overlay_1.overlayBackgroundStyle)(props),
|
|
52
|
+
backgroundColor: 'rgba(50, 54, 57, 0.4)',
|
|
53
|
+
});
|
|
54
|
+
const ModalBackground = (props) => (0, jsx_runtime_1.jsx)("div", { css: modalBackgroundStyle(props), ...props });
|
|
63
55
|
const modalActionsWrapperStyles = () => ({
|
|
64
56
|
borderTop: `1px solid ${Identity_1.COLOR.GRAY_LIGHTEN_72}`,
|
|
65
57
|
bottom: 0,
|
|
@@ -96,10 +88,7 @@ const modalActionStyles = ({ bold }) => ({
|
|
|
96
88
|
padding: '8px 0',
|
|
97
89
|
});
|
|
98
90
|
const ModalActions = ({ actions }) => ((0, jsx_runtime_1.jsx)("div", { css: modalActionsWrapperStyles(), children: actions.map(action => ((0, jsx_runtime_1.jsx)("div", { onClick: action.onClick, css: modalActionStyles({ bold: action.bold }), "data-uie-name": action.dataUieName, children: action.title }, action.title))) }));
|
|
99
|
-
const Modal = (
|
|
100
|
-
var { actions = [], children, bodyStyle, fullscreen, onClose, onBackgroundClick } = _a, props = __rest(_a, ["actions", "children", "bodyStyle", "fullscreen", "onClose", "onBackgroundClick"]);
|
|
101
|
-
return ((0, jsx_runtime_1.jsxs)(Overlay_1.OverlayWrapper, Object.assign({}, props, { "data-uie-name": "modal", children: [(0, jsx_runtime_1.jsxs)(ModalBody, { fullscreen: fullscreen, style: bodyStyle, children: [(0, jsx_runtime_1.jsx)(ModalContent, { children: children }), onClose !== util_1.noop && (0, jsx_runtime_1.jsx)(ModalClose, { onClick: onClose, "data-uie-name": "do-close" }), actions.length > 0 && (0, jsx_runtime_1.jsx)(ModalActions, { actions: actions, "data-uie-name": "modal-actions" })] }), !fullscreen && ((0, jsx_runtime_1.jsx)(ModalBackground, { onClick: onBackgroundClick === util_1.noop ? onClose : onBackgroundClick, "data-uie-name": "modal-background" }))] })));
|
|
102
|
-
};
|
|
91
|
+
const Modal = ({ actions = [], children, bodyStyle, fullscreen, onClose, onBackgroundClick, ...props }) => ((0, jsx_runtime_1.jsxs)(Overlay_1.OverlayWrapper, { ...props, "data-uie-name": "modal", children: [(0, jsx_runtime_1.jsxs)(ModalBody, { fullscreen: fullscreen, style: bodyStyle, children: [(0, jsx_runtime_1.jsx)(ModalContent, { children: children }), onClose !== util_1.noop && (0, jsx_runtime_1.jsx)(ModalClose, { onClick: onClose, "data-uie-name": "do-close" }), actions.length > 0 && (0, jsx_runtime_1.jsx)(ModalActions, { actions: actions, "data-uie-name": "modal-actions" })] }), !fullscreen && ((0, jsx_runtime_1.jsx)(ModalBackground, { onClick: onBackgroundClick === util_1.noop ? onClose : onBackgroundClick, "data-uie-name": "modal-background" }))] }));
|
|
103
92
|
exports.Modal = Modal;
|
|
104
93
|
exports.Modal.defaultProps = {
|
|
105
94
|
actions: [],
|
package/lib/Modal/Overlay.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ import * as React from 'react';
|
|
|
2
2
|
import { CSSObject } from '@emotion/react';
|
|
3
3
|
export type OverlayWrapperProps<T = HTMLDivElement> = React.HTMLProps<T>;
|
|
4
4
|
export declare const overlayWrapperStyle: <T>(props: OverlayWrapperProps<T>) => CSSObject;
|
|
5
|
-
export declare const OverlayWrapper: (props: OverlayWrapperProps
|
|
5
|
+
export declare const OverlayWrapper: (props: OverlayWrapperProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const OverlayContent: (props: React.HTMLProps<HTMLDivElement>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
7
|
export type OverlayBackgroundProps<T = HTMLDivElement> = React.HTMLProps<T>;
|
|
8
8
|
export declare const overlayBackgroundStyle: <T>(props: OverlayBackgroundProps<T>) => CSSObject;
|
|
9
|
-
export declare const OverlayBackground: (props: OverlayBackgroundProps
|
|
9
|
+
export declare const OverlayBackground: (props: OverlayBackgroundProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
10
10
|
export interface OverlayProps<T = HTMLDivElement> extends React.HTMLProps<T> {
|
|
11
11
|
onBackgroundClick?: () => void;
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../src/Modal/Overlay.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAOzC,MAAM,MAAM,mBAAmB,CAAC,CAAC,GAAG,cAAc,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAEzE,eAAO,MAAM,mBAAmB,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,SAUtE,CAAC;AAEH,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../src/Modal/Overlay.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAOzC,MAAM,MAAM,mBAAmB,CAAC,CAAC,GAAG,cAAc,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAEzE,eAAO,MAAM,mBAAmB,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,SAUtE,CAAC;AAEH,eAAO,MAAM,cAAc,UAAW,mBAAmB,qDAAiD,CAAC;AAE3G,eAAO,MAAM,cAAc,UAAW,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,qDAsBpE,CAAC;AAEF,MAAM,MAAM,sBAAsB,CAAC,CAAC,GAAG,cAAc,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAE5E,eAAO,MAAM,sBAAsB,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,sBAAsB,CAAC,CAAC,CAAC,KAAK,SAS5E,CAAC;AAEH,eAAO,MAAM,iBAAiB,UAAW,sBAAsB,qDAAoD,CAAC;AAEpH,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,cAAc,CAAE,SAAQ,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IAC1E,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC;AAED,eAAO,MAAM,OAAO,8CAA2D,YAAY,qDAK1F,CAAC"}
|