@wireapp/react-ui-kit 8.17.3 → 8.17.4
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/package.json +2 -7
- package/src/Form/Button.js +8 -8
- package/src/Form/Button.js.map +1 -1
- package/src/Form/ButtonLink.js +7 -7
- package/src/Form/ButtonLink.js.map +1 -1
- package/src/Form/Checkbox.js +19 -19
- package/src/Form/Checkbox.js.map +1 -1
- package/src/Form/CodeInput.js +13 -9
- package/src/Form/CodeInput.js.map +1 -1
- package/src/Form/DropFileInput.js +15 -10
- package/src/Form/DropFileInput.js.map +1 -1
- package/src/Form/ErrorMessage.js +8 -8
- package/src/Form/ErrorMessage.js.map +1 -1
- package/src/Form/Form.js +3 -3
- package/src/Form/Form.js.map +1 -1
- package/src/Form/Input.js +16 -10
- package/src/Form/Input.js.map +1 -1
- package/src/Form/InputBlock.js +6 -27
- package/src/Form/InputBlock.js.map +1 -1
- package/src/Form/InputLabel.js +6 -5
- package/src/Form/InputLabel.js.map +1 -1
- package/src/Form/InputSubmitCombo.js +10 -10
- package/src/Form/InputSubmitCombo.js.map +1 -1
- package/src/Form/RangeInput.js +7 -6
- package/src/Form/RangeInput.js.map +1 -1
- package/src/Form/RangeInput.styles.js +3 -4
- package/src/Form/RangeInput.styles.js.map +1 -1
- package/src/Form/RoundIconButton.js +8 -7
- package/src/Form/RoundIconButton.js.map +1 -1
- package/src/Form/Select.js +8 -7
- package/src/Form/Select.js.map +1 -1
- package/src/Form/SelectComponents.js +9 -8
- package/src/Form/SelectComponents.js.map +1 -1
- package/src/Form/SelectStyles.js +2 -3
- package/src/Form/SelectStyles.js.map +1 -1
- package/src/Form/ShakeBox.js +8 -25
- package/src/Form/ShakeBox.js.map +1 -1
- package/src/Form/Switch.js +6 -6
- package/src/Form/Switch.js.map +1 -1
- package/src/Form/TextArea.js +5 -5
- package/src/Form/TextArea.js.map +1 -1
- package/src/Form/Tooltip.js +6 -5
- package/src/Form/Tooltip.js.map +1 -1
- package/src/GlobalStyle.js +3 -3
- package/src/GlobalStyle.js.map +1 -1
- package/src/Icon/AddPeopleIcon.js +4 -26
- package/src/Icon/AddPeopleIcon.js.map +1 -1
- package/src/Icon/ArchiveIcon.js +2 -24
- package/src/Icon/ArchiveIcon.js.map +1 -1
- package/src/Icon/ArrowDown.js +5 -24
- package/src/Icon/ArrowDown.js.map +1 -1
- package/src/Icon/ArrowIcon.js +5 -5
- package/src/Icon/ArrowIcon.js.map +1 -1
- package/src/Icon/AttachmentIcon.js +2 -24
- package/src/Icon/AttachmentIcon.js.map +1 -1
- package/src/Icon/AudioVideoIcon.js +2 -24
- package/src/Icon/AudioVideoIcon.js.map +1 -1
- package/src/Icon/BlockIcon.js +2 -24
- package/src/Icon/BlockIcon.js.map +1 -1
- package/src/Icon/Brand/AndroidIcon.js +2 -24
- package/src/Icon/Brand/AndroidIcon.js.map +1 -1
- package/src/Icon/Brand/AppleIcon.js +2 -24
- package/src/Icon/Brand/AppleIcon.js.map +1 -1
- package/src/Icon/Brand/ChromeIcon.js +2 -24
- package/src/Icon/Brand/ChromeIcon.js.map +1 -1
- package/src/Icon/Brand/FacebookIcon.js +2 -24
- package/src/Icon/Brand/FacebookIcon.js.map +1 -1
- package/src/Icon/Brand/GitHubIcon.js +2 -24
- package/src/Icon/Brand/GitHubIcon.js.map +1 -1
- package/src/Icon/Brand/LinkedInIcon.js +2 -24
- package/src/Icon/Brand/LinkedInIcon.js.map +1 -1
- package/src/Icon/Brand/LinuxIcon.js +2 -24
- package/src/Icon/Brand/LinuxIcon.js.map +1 -1
- package/src/Icon/Brand/MicrosoftIcon.js +2 -24
- package/src/Icon/Brand/MicrosoftIcon.js.map +1 -1
- package/src/Icon/Brand/TwitterIcon.js +2 -24
- package/src/Icon/Brand/TwitterIcon.js.map +1 -1
- package/src/Icon/CallIcon.js +2 -24
- package/src/Icon/CallIcon.js.map +1 -1
- package/src/Icon/CamIcon.js +2 -24
- package/src/Icon/CamIcon.js.map +1 -1
- package/src/Icon/CameraIcon.js +4 -26
- package/src/Icon/CameraIcon.js.map +1 -1
- package/src/Icon/CheckIcon.js +2 -24
- package/src/Icon/CheckIcon.js.map +1 -1
- package/src/Icon/CheckRoundIcon.js +2 -24
- package/src/Icon/CheckRoundIcon.js.map +1 -1
- package/src/Icon/ChevronIcon.js +5 -5
- package/src/Icon/ChevronIcon.js.map +1 -1
- package/src/Icon/CloseIcon.js +2 -24
- package/src/Icon/CloseIcon.js.map +1 -1
- package/src/Icon/CopyIcon.js +2 -24
- package/src/Icon/CopyIcon.js.map +1 -1
- package/src/Icon/DeviceIcon.js +2 -24
- package/src/Icon/DeviceIcon.js.map +1 -1
- package/src/Icon/DownloadIcon.js +2 -24
- package/src/Icon/DownloadIcon.js.map +1 -1
- package/src/Icon/EditDocumentIcon.js +4 -26
- package/src/Icon/EditDocumentIcon.js.map +1 -1
- package/src/Icon/EditIcon.js +2 -24
- package/src/Icon/EditIcon.js.map +1 -1
- package/src/Icon/EnterIcon.js +2 -24
- package/src/Icon/EnterIcon.js.map +1 -1
- package/src/Icon/ErrorIcon.js +2 -24
- package/src/Icon/ErrorIcon.js.map +1 -1
- package/src/Icon/FileIcon.js +2 -24
- package/src/Icon/FileIcon.js.map +1 -1
- package/src/Icon/GifIcon.js +2 -24
- package/src/Icon/GifIcon.js.map +1 -1
- package/src/Icon/GridIcon.js +4 -26
- package/src/Icon/GridIcon.js.map +1 -1
- package/src/Icon/GroupIcon.js +2 -24
- package/src/Icon/GroupIcon.js.map +1 -1
- package/src/Icon/HangupIcon.js +2 -24
- package/src/Icon/HangupIcon.js.map +1 -1
- package/src/Icon/HideIcon.js +2 -24
- package/src/Icon/HideIcon.js.map +1 -1
- package/src/Icon/ImageIcon.js +2 -24
- package/src/Icon/ImageIcon.js.map +1 -1
- package/src/Icon/InfoIcon.js +2 -24
- package/src/Icon/InfoIcon.js.map +1 -1
- package/src/Icon/InviteIcon.js +2 -24
- package/src/Icon/InviteIcon.js.map +1 -1
- package/src/Icon/LeaveIcon.js +2 -24
- package/src/Icon/LeaveIcon.js.map +1 -1
- package/src/Icon/LinkIcon.js +4 -26
- package/src/Icon/LinkIcon.js.map +1 -1
- package/src/Icon/ListIcon.js +2 -24
- package/src/Icon/ListIcon.js.map +1 -1
- package/src/Icon/LockIcon.js +2 -24
- package/src/Icon/LockIcon.js.map +1 -1
- package/src/Icon/MessageIcon.js +2 -24
- package/src/Icon/MessageIcon.js.map +1 -1
- package/src/Icon/MinusIcon.js +2 -24
- package/src/Icon/MinusIcon.js.map +1 -1
- package/src/Icon/MoreIcon.js +2 -24
- package/src/Icon/MoreIcon.js.map +1 -1
- package/src/Icon/MuteIcon.js +2 -24
- package/src/Icon/MuteIcon.js.map +1 -1
- package/src/Icon/NotificationIcon.js +2 -24
- package/src/Icon/NotificationIcon.js.map +1 -1
- package/src/Icon/NotificationOffIcon.js +2 -24
- package/src/Icon/NotificationOffIcon.js.map +1 -1
- package/src/Icon/OptionsIcon.js +2 -24
- package/src/Icon/OptionsIcon.js.map +1 -1
- package/src/Icon/PeopleIcon.js +4 -26
- package/src/Icon/PeopleIcon.js.map +1 -1
- package/src/Icon/PingIcon.js +2 -24
- package/src/Icon/PingIcon.js.map +1 -1
- package/src/Icon/PlaneIcon.js +2 -24
- package/src/Icon/PlaneIcon.js.map +1 -1
- package/src/Icon/PlusIcon.js +2 -24
- package/src/Icon/PlusIcon.js.map +1 -1
- package/src/Icon/ProfileIcon.js +2 -24
- package/src/Icon/ProfileIcon.js.map +1 -1
- package/src/Icon/RecordBoldIcon.js +5 -5
- package/src/Icon/RecordBoldIcon.js.map +1 -1
- package/src/Icon/RecordIcon.js +2 -24
- package/src/Icon/RecordIcon.js.map +1 -1
- package/src/Icon/RecordPendingIcon.js +2 -24
- package/src/Icon/RecordPendingIcon.js.map +1 -1
- package/src/Icon/ReloadIcon.js +2 -24
- package/src/Icon/ReloadIcon.js.map +1 -1
- package/src/Icon/SVGIcon.js +6 -5
- package/src/Icon/SVGIcon.js.map +1 -1
- package/src/Icon/ScreenshareIcon.js +2 -24
- package/src/Icon/ScreenshareIcon.js.map +1 -1
- package/src/Icon/SearchIcon.js +2 -24
- package/src/Icon/SearchIcon.js.map +1 -1
- package/src/Icon/ServicesIcon.js +2 -24
- package/src/Icon/ServicesIcon.js.map +1 -1
- package/src/Icon/SettingsIcon.js +2 -24
- package/src/Icon/SettingsIcon.js.map +1 -1
- package/src/Icon/ShowIcon.js +2 -24
- package/src/Icon/ShowIcon.js.map +1 -1
- package/src/Icon/SignIcon.js +2 -24
- package/src/Icon/SignIcon.js.map +1 -1
- package/src/Icon/SpeakerIcon.js +2 -24
- package/src/Icon/SpeakerIcon.js.map +1 -1
- package/src/Icon/SupportIcon.js +2 -24
- package/src/Icon/SupportIcon.js.map +1 -1
- package/src/Icon/TeamIcon.js +2 -24
- package/src/Icon/TeamIcon.js.map +1 -1
- package/src/Icon/TimedIcon.js +2 -24
- package/src/Icon/TimedIcon.js.map +1 -1
- package/src/Icon/TrashCrossIcon.js +2 -24
- package/src/Icon/TrashCrossIcon.js.map +1 -1
- package/src/Icon/TrashIcon.js +2 -24
- package/src/Icon/TrashIcon.js.map +1 -1
- package/src/Icon/TriangleIcon.js +5 -5
- package/src/Icon/TriangleIcon.js.map +1 -1
- package/src/Icon/UploadIcon.js +2 -24
- package/src/Icon/UploadIcon.js.map +1 -1
- package/src/Icon/WireIcon.js +2 -24
- package/src/Icon/WireIcon.js.map +1 -1
- package/src/Identity/Animation.js +18 -17
- package/src/Identity/Animation.js.map +1 -1
- package/src/Identity/Avatar.js +10 -27
- package/src/Identity/Avatar.js.map +1 -1
- package/src/Identity/AvatarGrid.js +8 -7
- package/src/Identity/AvatarGrid.js.map +1 -1
- package/src/Identity/Logo.js +7 -7
- package/src/Identity/Logo.js.map +1 -1
- package/src/Identity/colors-v2.js +2 -3
- package/src/Identity/colors-v2.js.map +1 -1
- package/src/Identity/colors.js +11 -6
- package/src/Identity/colors.js.map +1 -1
- package/src/Identity/motions.js +6 -7
- package/src/Identity/motions.js.map +1 -1
- package/src/Layout/Box.js +3 -24
- package/src/Layout/Box.js.map +1 -1
- package/src/Layout/Column.js +6 -27
- package/src/Layout/Column.js.map +1 -1
- package/src/Layout/Container.js +10 -31
- package/src/Layout/Container.js.map +1 -1
- package/src/Layout/Content.js +3 -24
- package/src/Layout/Content.js.map +1 -1
- package/src/Layout/FlexBox.js +3 -24
- package/src/Layout/FlexBox.js.map +1 -1
- package/src/Layout/Footer.js +1 -1
- package/src/Layout/Footer.js.map +1 -1
- package/src/Layout/Header.js +3 -24
- package/src/Layout/Header.js.map +1 -1
- package/src/Layout/MatchMedia.js +17 -35
- package/src/Layout/MatchMedia.js.map +1 -1
- package/src/Layout/Spacer.js +1 -1
- package/src/Layout/Spacer.js.map +1 -1
- package/src/Layout/StyledApp.js +6 -5
- package/src/Layout/StyledApp.js.map +1 -1
- package/src/Layout/Theme.js +7 -7
- package/src/Layout/Theme.js.map +1 -1
- package/src/Layout/headerMenu/HeaderMenu.js +13 -8
- package/src/Layout/headerMenu/HeaderMenu.js.map +1 -1
- package/src/Layout/headerMenu/HeaderSubMenu.js +10 -9
- package/src/Layout/headerMenu/HeaderSubMenu.js.map +1 -1
- package/src/Layout/headerMenu/MenuContent.js +4 -5
- package/src/Layout/headerMenu/MenuContent.js.map +1 -1
- package/src/Layout/headerMenu/MenuItems.js +5 -26
- package/src/Layout/headerMenu/MenuItems.js.map +1 -1
- package/src/Layout/headerMenu/MenuLink.js +10 -10
- package/src/Layout/headerMenu/MenuLink.js.map +1 -1
- package/src/Layout/headerMenu/MenuOpenButton.js +6 -27
- package/src/Layout/headerMenu/MenuOpenButton.js.map +1 -1
- package/src/Layout/headerMenu/MenuScrollableItems.js +5 -26
- package/src/Layout/headerMenu/MenuScrollableItems.js.map +1 -1
- package/src/Layout/headerMenu/MenuSubLink.js +6 -7
- package/src/Layout/headerMenu/MenuSubLink.js.map +1 -1
- package/src/Menu/MenuModal.js +14 -13
- package/src/Menu/MenuModal.js.map +1 -1
- package/src/Menu/TabBar.js +13 -12
- package/src/Menu/TabBar.js.map +1 -1
- package/src/Misc/ButtonGroup.js +7 -7
- package/src/Misc/ButtonGroup.js.map +1 -1
- package/src/Misc/IconButton.js +7 -7
- package/src/Misc/IconButton.js.map +1 -1
- package/src/Misc/IsInViewport.js +13 -8
- package/src/Misc/IsInViewport.js.map +1 -1
- package/src/Misc/Loading.js +8 -7
- package/src/Misc/Loading.js.map +1 -1
- package/src/Misc/Pagination.js +6 -5
- package/src/Misc/Pagination.js.map +1 -1
- package/src/Misc/Pill.js +7 -7
- package/src/Misc/Pill.js.map +1 -1
- package/src/Misc/childrenWithDefaultProps.js +3 -3
- package/src/Misc/childrenWithDefaultProps.js.map +1 -1
- package/src/Misc/useTimeout.js +7 -22
- package/src/Misc/useTimeout.js.map +1 -1
- package/src/Modal/Modal.js +13 -12
- package/src/Modal/Modal.js.map +1 -1
- package/src/Modal/Overlay.js +11 -10
- package/src/Modal/Overlay.js.map +1 -1
- package/src/Text/Heading.js +16 -16
- package/src/Text/Heading.js.map +1 -1
- package/src/Text/Label.js +9 -9
- package/src/Text/Label.js.map +1 -1
- package/src/Text/Line.js +3 -24
- package/src/Text/Line.js.map +1 -1
- package/src/Text/Link.js +8 -8
- package/src/Text/Link.js.map +1 -1
- package/src/Text/Paragraph.js +10 -10
- package/src/Text/Paragraph.js.map +1 -1
- package/src/Text/Text.js +8 -29
- package/src/Text/Text.js.map +1 -1
- package/src/Text/TextLink.js +7 -7
- package/src/Text/TextLink.js.map +1 -1
- package/src/Text/Title.js +7 -7
- package/src/Text/Title.js.map +1 -1
- package/src/mediaQueries.js +11 -7
- package/src/mediaQueries.js.map +1 -1
- package/src/util.js +10 -6
- package/src/util.js.map +1 -1
package/src/Text/Text.js
CHANGED
|
@@ -1,36 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.textStyle = exports.filterTextProps = exports.Uppercase = exports.Text = exports.Small = exports.Muted = exports.Large = exports.Bold = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
7
|
var _react = require("@emotion/react");
|
|
10
8
|
var _react2 = _interopRequireDefault(require("react"));
|
|
11
9
|
var _util = require("../util");
|
|
12
10
|
var _Identity = require("../Identity");
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* Copyright (C) 2018 Wire Swiss GmbH
|
|
16
|
-
*
|
|
17
|
-
* This program is free software: you can redistribute it and/or modify
|
|
18
|
-
* it under the terms of the GNU General Public License as published by
|
|
19
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
20
|
-
* (at your option) any later version.
|
|
21
|
-
*
|
|
22
|
-
* This program is distributed in the hope that it will be useful,
|
|
23
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
24
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
25
|
-
* GNU General Public License for more details.
|
|
26
|
-
*
|
|
27
|
-
* You should have received a copy of the GNU General Public License
|
|
28
|
-
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
29
|
-
*
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
/** @jsx jsx */
|
|
33
|
-
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
34
13
|
var filterTextProps = function filterTextProps(props) {
|
|
35
14
|
return (0, _util.filterProps)(props, ['block', 'bold', 'center', 'color', 'fontSize', 'light', 'muted', 'noWrap', 'textTransform', 'truncate']);
|
|
36
15
|
};
|
|
@@ -70,7 +49,7 @@ var textStyle = function textStyle(theme, _ref) {
|
|
|
70
49
|
};
|
|
71
50
|
exports.textStyle = textStyle;
|
|
72
51
|
var Text = /*#__PURE__*/_react2["default"].forwardRef(function (props, ref) {
|
|
73
|
-
return (0, _react.jsx)("span", (
|
|
52
|
+
return (0, _react.jsx)("span", _extends({
|
|
74
53
|
ref: ref,
|
|
75
54
|
css: function css(theme) {
|
|
76
55
|
return textStyle(theme, props);
|
|
@@ -79,35 +58,35 @@ var Text = /*#__PURE__*/_react2["default"].forwardRef(function (props, ref) {
|
|
|
79
58
|
});
|
|
80
59
|
exports.Text = Text;
|
|
81
60
|
var Bold = /*#__PURE__*/_react2["default"].forwardRef(function (props, ref) {
|
|
82
|
-
return (0, _react.jsx)(Text, (
|
|
61
|
+
return (0, _react.jsx)(Text, _extends({
|
|
83
62
|
ref: ref,
|
|
84
63
|
bold: true
|
|
85
64
|
}, props));
|
|
86
65
|
});
|
|
87
66
|
exports.Bold = Bold;
|
|
88
67
|
var Small = /*#__PURE__*/_react2["default"].forwardRef(function (props, ref) {
|
|
89
|
-
return (0, _react.jsx)(Text, (
|
|
68
|
+
return (0, _react.jsx)(Text, _extends({
|
|
90
69
|
ref: ref,
|
|
91
70
|
fontSize: '12px'
|
|
92
71
|
}, props));
|
|
93
72
|
});
|
|
94
73
|
exports.Small = Small;
|
|
95
74
|
var Muted = /*#__PURE__*/_react2["default"].forwardRef(function (props, ref) {
|
|
96
|
-
return (0, _react.jsx)(Text, (
|
|
75
|
+
return (0, _react.jsx)(Text, _extends({
|
|
97
76
|
ref: ref,
|
|
98
77
|
muted: true
|
|
99
78
|
}, props));
|
|
100
79
|
});
|
|
101
80
|
exports.Muted = Muted;
|
|
102
81
|
var Uppercase = /*#__PURE__*/_react2["default"].forwardRef(function (props, ref) {
|
|
103
|
-
return (0, _react.jsx)(Text, (
|
|
82
|
+
return (0, _react.jsx)(Text, _extends({
|
|
104
83
|
ref: ref,
|
|
105
84
|
textTransform: 'uppercase'
|
|
106
85
|
}, props));
|
|
107
86
|
});
|
|
108
87
|
exports.Uppercase = Uppercase;
|
|
109
88
|
var Large = /*#__PURE__*/_react2["default"].forwardRef(function (props, ref) {
|
|
110
|
-
return (0, _react.jsx)(Text, (
|
|
89
|
+
return (0, _react.jsx)(Text, _extends({
|
|
111
90
|
ref: ref,
|
|
112
91
|
fontSize: '48px',
|
|
113
92
|
light: true
|
package/src/Text/Text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","names":["filterTextProps","props","filterProps","textStyle","theme","block","bold","center","color","general","fontSize","light","muted","noWrap","textTransform","truncate","COLOR","GRAY","display","fontWeight","overflow","undefined","textAlign","textOverflow","whiteSpace","Text","React","forwardRef","ref","Bold","Small","Muted","Uppercase","Large"],"sources":["Text.tsx"],"sourcesContent":["/*\n * Wire\n * Copyright (C) 2018 Wire Swiss GmbH\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see http://www.gnu.org/licenses/.\n *\n */\n\n/** @jsx jsx */\nimport {CSSObject, jsx} from '@emotion/react';\nimport React from 'react';\nimport {Property} from 'csstype';\n\nimport {Theme} from '../Layout';\nimport {filterProps} from '../util';\nimport {COLOR} from '../Identity';\n\nexport interface TextProps<T = HTMLSpanElement> extends React.PropsWithRef<React.HTMLProps<T>> {\n block?: boolean;\n bold?: boolean;\n center?: boolean;\n color?: string;\n fontSize?: string;\n light?: boolean;\n muted?: boolean;\n noWrap?: boolean;\n textTransform?: Property.TextTransform;\n truncate?: boolean;\n}\n\nexport const filterTextProps = (props: TextProps) => {\n return filterProps(props, [\n 'block',\n 'bold',\n 'center',\n 'color',\n 'fontSize',\n 'light',\n 'muted',\n 'noWrap',\n 'textTransform',\n 'truncate',\n ]);\n};\n\nexport const textStyle: <T>(theme: Theme, props: TextProps<T>) => CSSObject = (\n theme,\n {\n block = false,\n bold = false,\n center = false,\n color = theme.general.color,\n fontSize = '16px',\n light = false,\n muted = false,\n noWrap = false,\n textTransform = 'none',\n truncate = false,\n },\n) => ({\n color: muted ? COLOR.GRAY : color,\n display: block ? 'block' : 'inline',\n fontSize: fontSize,\n fontWeight: bold ? 600 : light ? 200 : 300,\n overflow: truncate ? 'hidden' : undefined,\n textAlign: center ? 'center' : 'left',\n textOverflow: truncate ? 'ellipsis' : undefined,\n textTransform: textTransform,\n whiteSpace: noWrap ? 'nowrap' : undefined,\n});\n\nexport const Text = React.forwardRef<HTMLSpanElement, TextProps<HTMLSpanElement>>((props, ref) => (\n <span ref={ref} css={(theme: Theme) => textStyle(theme, props)} {...filterTextProps(props)} />\n));\n\nexport const Bold = React.forwardRef<HTMLSpanElement, TextProps<HTMLSpanElement>>((props, ref) => (\n <Text ref={ref} bold {...props} />\n));\nexport const Small = React.forwardRef<HTMLSpanElement, TextProps<HTMLSpanElement>>((props, ref) => (\n <Text ref={ref} fontSize={'12px'} {...props} />\n));\nexport const Muted = React.forwardRef<HTMLSpanElement, TextProps<HTMLSpanElement>>((props, ref) => (\n <Text ref={ref} muted {...props} />\n));\nexport const Uppercase = React.forwardRef<HTMLSpanElement, TextProps<HTMLSpanElement>>((props, ref) => (\n <Text ref={ref} textTransform={'uppercase'} {...props} />\n));\nexport const Large = React.forwardRef<HTMLSpanElement, TextProps<HTMLSpanElement>>((props, ref) => (\n <Text ref={ref} fontSize={'48px'} light {...props} />\n));\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Text.js","names":["filterTextProps","props","filterProps","textStyle","theme","block","bold","center","color","general","fontSize","light","muted","noWrap","textTransform","truncate","COLOR","GRAY","display","fontWeight","overflow","undefined","textAlign","textOverflow","whiteSpace","Text","React","forwardRef","ref","Bold","Small","Muted","Uppercase","Large"],"sources":["Text.tsx"],"sourcesContent":["/*\n * Wire\n * Copyright (C) 2018 Wire Swiss GmbH\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see http://www.gnu.org/licenses/.\n *\n */\n\n/** @jsx jsx */\nimport {CSSObject, jsx} from '@emotion/react';\nimport React from 'react';\nimport {Property} from 'csstype';\n\nimport {Theme} from '../Layout';\nimport {filterProps} from '../util';\nimport {COLOR} from '../Identity';\n\nexport interface TextProps<T = HTMLSpanElement> extends React.PropsWithRef<React.HTMLProps<T>> {\n block?: boolean;\n bold?: boolean;\n center?: boolean;\n color?: string;\n fontSize?: string;\n light?: boolean;\n muted?: boolean;\n noWrap?: boolean;\n textTransform?: Property.TextTransform;\n truncate?: boolean;\n}\n\nexport const filterTextProps = (props: TextProps) => {\n return filterProps(props, [\n 'block',\n 'bold',\n 'center',\n 'color',\n 'fontSize',\n 'light',\n 'muted',\n 'noWrap',\n 'textTransform',\n 'truncate',\n ]);\n};\n\nexport const textStyle: <T>(theme: Theme, props: TextProps<T>) => CSSObject = (\n theme,\n {\n block = false,\n bold = false,\n center = false,\n color = theme.general.color,\n fontSize = '16px',\n light = false,\n muted = false,\n noWrap = false,\n textTransform = 'none',\n truncate = false,\n },\n) => ({\n color: muted ? COLOR.GRAY : color,\n display: block ? 'block' : 'inline',\n fontSize: fontSize,\n fontWeight: bold ? 600 : light ? 200 : 300,\n overflow: truncate ? 'hidden' : undefined,\n textAlign: center ? 'center' : 'left',\n textOverflow: truncate ? 'ellipsis' : undefined,\n textTransform: textTransform,\n whiteSpace: noWrap ? 'nowrap' : undefined,\n});\n\nexport const Text = React.forwardRef<HTMLSpanElement, TextProps<HTMLSpanElement>>((props, ref) => (\n <span ref={ref} css={(theme: Theme) => textStyle(theme, props)} {...filterTextProps(props)} />\n));\n\nexport const Bold = React.forwardRef<HTMLSpanElement, TextProps<HTMLSpanElement>>((props, ref) => (\n <Text ref={ref} bold {...props} />\n));\nexport const Small = React.forwardRef<HTMLSpanElement, TextProps<HTMLSpanElement>>((props, ref) => (\n <Text ref={ref} fontSize={'12px'} {...props} />\n));\nexport const Muted = React.forwardRef<HTMLSpanElement, TextProps<HTMLSpanElement>>((props, ref) => (\n <Text ref={ref} muted {...props} />\n));\nexport const Uppercase = React.forwardRef<HTMLSpanElement, TextProps<HTMLSpanElement>>((props, ref) => (\n <Text ref={ref} textTransform={'uppercase'} {...props} />\n));\nexport const Large = React.forwardRef<HTMLSpanElement, TextProps<HTMLSpanElement>>((props, ref) => (\n <Text ref={ref} fontSize={'48px'} light {...props} />\n));\n"],"mappings":";;;;;;AAoBA;AACA;AAIA;AACA;AAAkC;AAAA;AAe3B,IAAMA,eAAe,GAAG,SAAlBA,eAAe,CAAIC,KAAgB,EAAK;EACnD,OAAO,IAAAC,iBAAW,EAACD,KAAK,EAAE,CACxB,OAAO,EACP,MAAM,EACN,QAAQ,EACR,OAAO,EACP,UAAU,EACV,OAAO,EACP,OAAO,EACP,QAAQ,EACR,eAAe,EACf,UAAU,CACX,CAAC;AACJ,CAAC;AAAC;AAEK,IAAME,SAA8D,GAAG,SAAjEA,SAA8D,CACzEC,KAAK;EAAA,sBAEHC,KAAK;IAALA,KAAK,2BAAG,KAAK;IAAA,iBACbC,IAAI;IAAJA,IAAI,0BAAG,KAAK;IAAA,mBACZC,MAAM;IAANA,MAAM,4BAAG,KAAK;IAAA,kBACdC,KAAK;IAALA,KAAK,2BAAGJ,KAAK,CAACK,OAAO,CAACD,KAAK;IAAA,qBAC3BE,QAAQ;IAARA,QAAQ,8BAAG,MAAM;IAAA,kBACjBC,KAAK;IAALA,KAAK,2BAAG,KAAK;IAAA,kBACbC,KAAK;IAALA,KAAK,2BAAG,KAAK;IAAA,mBACbC,MAAM;IAANA,MAAM,4BAAG,KAAK;IAAA,0BACdC,aAAa;IAAbA,aAAa,mCAAG,MAAM;IAAA,qBACtBC,QAAQ;IAARA,QAAQ,8BAAG,KAAK;EAAA,OAEd;IACJP,KAAK,EAAEI,KAAK,GAAGI,eAAK,CAACC,IAAI,GAAGT,KAAK;IACjCU,OAAO,EAAEb,KAAK,GAAG,OAAO,GAAG,QAAQ;IACnCK,QAAQ,EAAEA,QAAQ;IAClBS,UAAU,EAAEb,IAAI,GAAG,GAAG,GAAGK,KAAK,GAAG,GAAG,GAAG,GAAG;IAC1CS,QAAQ,EAAEL,QAAQ,GAAG,QAAQ,GAAGM,SAAS;IACzCC,SAAS,EAAEf,MAAM,GAAG,QAAQ,GAAG,MAAM;IACrCgB,YAAY,EAAER,QAAQ,GAAG,UAAU,GAAGM,SAAS;IAC/CP,aAAa,EAAEA,aAAa;IAC5BU,UAAU,EAAEX,MAAM,GAAG,QAAQ,GAAGQ;EAClC,CAAC;AAAA,CAAC;AAAC;AAEI,IAAMI,IAAI,gBAAGC,kBAAK,CAACC,UAAU,CAA8C,UAAC1B,KAAK,EAAE2B,GAAG;EAAA,OAC3F;IAAM,GAAG,EAAEA,GAAI;IAAC,GAAG,EAAE,aAACxB,KAAY;MAAA,OAAKD,SAAS,CAACC,KAAK,EAAEH,KAAK,CAAC;IAAA;EAAC,GAAKD,eAAe,CAACC,KAAK,CAAC,EAAI;AAAA,CAC/F,CAAC;AAAC;AAEI,IAAM4B,IAAI,gBAAGH,kBAAK,CAACC,UAAU,CAA8C,UAAC1B,KAAK,EAAE2B,GAAG;EAAA,OAC3F,gBAAC,IAAI;IAAC,GAAG,EAAEA,GAAI;IAAC,IAAI;EAAA,GAAK3B,KAAK,EAAI;AAAA,CACnC,CAAC;AAAC;AACI,IAAM6B,KAAK,gBAAGJ,kBAAK,CAACC,UAAU,CAA8C,UAAC1B,KAAK,EAAE2B,GAAG;EAAA,OAC5F,gBAAC,IAAI;IAAC,GAAG,EAAEA,GAAI;IAAC,QAAQ,EAAE;EAAO,GAAK3B,KAAK,EAAI;AAAA,CAChD,CAAC;AAAC;AACI,IAAM8B,KAAK,gBAAGL,kBAAK,CAACC,UAAU,CAA8C,UAAC1B,KAAK,EAAE2B,GAAG;EAAA,OAC5F,gBAAC,IAAI;IAAC,GAAG,EAAEA,GAAI;IAAC,KAAK;EAAA,GAAK3B,KAAK,EAAI;AAAA,CACpC,CAAC;AAAC;AACI,IAAM+B,SAAS,gBAAGN,kBAAK,CAACC,UAAU,CAA8C,UAAC1B,KAAK,EAAE2B,GAAG;EAAA,OAChG,gBAAC,IAAI;IAAC,GAAG,EAAEA,GAAI;IAAC,aAAa,EAAE;EAAY,GAAK3B,KAAK,EAAI;AAAA,CAC1D,CAAC;AAAC;AACI,IAAMgC,KAAK,gBAAGP,kBAAK,CAACC,UAAU,CAA8C,UAAC1B,KAAK,EAAE2B,GAAG;EAAA,OAC5F,gBAAC,IAAI;IAAC,GAAG,EAAEA,GAAI;IAAC,QAAQ,EAAE,MAAO;IAAC,KAAK;EAAA,GAAK3B,KAAK,EAAI;AAAA,CACtD,CAAC;AAAC"}
|
package/src/Text/TextLink.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.textLinkStyle = exports.TextLink = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
7
|
var _react = require("@emotion/react");
|
|
12
8
|
var _colorsV = require("../Identity/colors-v2");
|
|
13
9
|
var _Link = require("./Link");
|
|
14
10
|
var _excluded = ["color", "fontSize", "bold", "textTransform"];
|
|
11
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
12
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (
|
|
13
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
14
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
16
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
17
17
|
var textLinkStyle = function textLinkStyle(theme, _ref) {
|
|
18
18
|
var _ref$color = _ref.color,
|
|
19
19
|
color = _ref$color === void 0 ? _colorsV.COLOR_V2.BLUE : _ref$color,
|
|
@@ -23,7 +23,7 @@ var textLinkStyle = function textLinkStyle(theme, _ref) {
|
|
|
23
23
|
bold = _ref$bold === void 0 ? false : _ref$bold,
|
|
24
24
|
_ref$textTransform = _ref.textTransform,
|
|
25
25
|
textTransform = _ref$textTransform === void 0 ? 'none' : _ref$textTransform,
|
|
26
|
-
props = (
|
|
26
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
27
27
|
return _objectSpread({}, (0, _Link.linkStyle)(theme, _objectSpread({
|
|
28
28
|
bold: bold,
|
|
29
29
|
color: color,
|
|
@@ -33,7 +33,7 @@ var textLinkStyle = function textLinkStyle(theme, _ref) {
|
|
|
33
33
|
};
|
|
34
34
|
exports.textLinkStyle = textLinkStyle;
|
|
35
35
|
var TextLink = function TextLink(props) {
|
|
36
|
-
return (0, _react.jsx)("a", (
|
|
36
|
+
return (0, _react.jsx)("a", _extends({
|
|
37
37
|
css: function css(theme) {
|
|
38
38
|
return textLinkStyle(theme, props);
|
|
39
39
|
},
|
package/src/Text/TextLink.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextLink.js","names":["textLinkStyle","theme","color","COLOR_V2","BLUE","fontSize","bold","textTransform","props","linkStyle","TextLink","filterLinkProps"],"sources":["TextLink.tsx"],"sourcesContent":["/*\n * Wire\n * Copyright (C) 2019 Wire Swiss GmbH\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see http://www.gnu.org/licenses/.\n *\n */\n\n/** @jsx jsx */\nimport {CSSObject, jsx} from '@emotion/react';\n\nimport {COLOR_V2} from '../Identity/colors-v2';\nimport {Theme} from '../Layout';\nimport {LinkProps, filterLinkProps, linkStyle} from './Link';\n\nexport type TextLinkProps<T = HTMLAnchorElement> = LinkProps<T>;\n\nexport const textLinkStyle: <T>(theme: Theme, props: TextLinkProps<T>) => CSSObject = (\n theme,\n {color = COLOR_V2.BLUE, fontSize = '16px', bold = false, textTransform = 'none', ...props},\n) => ({\n ...linkStyle(theme, {bold, color, fontSize, textTransform, ...props}),\n});\n\nexport const TextLink = (props: TextLinkProps<HTMLAnchorElement>) => (\n <a css={(theme: Theme) => textLinkStyle(theme, props)} rel=\"noopener noreferrer\" {...filterLinkProps(props)} />\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextLink.js","names":["textLinkStyle","theme","color","COLOR_V2","BLUE","fontSize","bold","textTransform","props","linkStyle","TextLink","filterLinkProps"],"sources":["TextLink.tsx"],"sourcesContent":["/*\n * Wire\n * Copyright (C) 2019 Wire Swiss GmbH\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see http://www.gnu.org/licenses/.\n *\n */\n\n/** @jsx jsx */\nimport {CSSObject, jsx} from '@emotion/react';\n\nimport {COLOR_V2} from '../Identity/colors-v2';\nimport {Theme} from '../Layout';\nimport {LinkProps, filterLinkProps, linkStyle} from './Link';\n\nexport type TextLinkProps<T = HTMLAnchorElement> = LinkProps<T>;\n\nexport const textLinkStyle: <T>(theme: Theme, props: TextLinkProps<T>) => CSSObject = (\n theme,\n {color = COLOR_V2.BLUE, fontSize = '16px', bold = false, textTransform = 'none', ...props},\n) => ({\n ...linkStyle(theme, {bold, color, fontSize, textTransform, ...props}),\n});\n\nexport const TextLink = (props: TextLinkProps<HTMLAnchorElement>) => (\n <a css={(theme: Theme) => textLinkStyle(theme, props)} rel=\"noopener noreferrer\" {...filterLinkProps(props)} />\n);\n"],"mappings":";;;;;;AAoBA;AAEA;AAEA;AAA6D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAItD,IAAMA,aAAsE,GAAG,SAAzEA,aAAsE,CACjFC,KAAK;EAAA,sBACJC,KAAK;IAALA,KAAK,2BAAGC,iBAAQ,CAACC,IAAI;IAAA,qBAAEC,QAAQ;IAARA,QAAQ,8BAAG,MAAM;IAAA,iBAAEC,IAAI;IAAJA,IAAI,0BAAG,KAAK;IAAA,0BAAEC,aAAa;IAAbA,aAAa,mCAAG,MAAM;IAAKC,KAAK;EAAA,yBAEtF,IAAAC,eAAS,EAACR,KAAK;IAAGK,IAAI,EAAJA,IAAI;IAAEJ,KAAK,EAALA,KAAK;IAAEG,QAAQ,EAARA,QAAQ;IAAEE,aAAa,EAAbA;EAAa,GAAKC,KAAK,EAAE;AAAA,CACrE;AAAC;AAEI,IAAME,QAAQ,GAAG,SAAXA,QAAQ,CAAIF,KAAuC;EAAA,OAC9D;IAAG,GAAG,EAAE,aAACP,KAAY;MAAA,OAAKD,aAAa,CAACC,KAAK,EAAEO,KAAK,CAAC;IAAA,CAAC;IAAC,GAAG,EAAC;EAAqB,GAAK,IAAAG,qBAAe,EAACH,KAAK,CAAC,EAAI;AAAA,CAChH;AAAC"}
|
package/src/Text/Title.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.Title = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
7
|
var _react = require("@emotion/react");
|
|
12
8
|
var _Identity = require("../Identity");
|
|
13
9
|
var _Text = require("./Text");
|
|
14
10
|
var _excluded = ["block", "center", "fontSize", "color", "bold"];
|
|
11
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
12
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (
|
|
13
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
14
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
16
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
17
17
|
var titleStyle = function titleStyle(theme, _ref) {
|
|
18
18
|
var _ref$block = _ref.block,
|
|
19
19
|
block = _ref$block === void 0 ? true : _ref$block,
|
|
@@ -25,7 +25,7 @@ var titleStyle = function titleStyle(theme, _ref) {
|
|
|
25
25
|
color = _ref$color === void 0 ? _Identity.COLOR.GRAY : _ref$color,
|
|
26
26
|
_ref$bold = _ref.bold,
|
|
27
27
|
bold = _ref$bold === void 0 ? true : _ref$bold,
|
|
28
|
-
props = (
|
|
28
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
29
29
|
return _objectSpread(_objectSpread({}, (0, _Text.textStyle)(theme, _objectSpread({
|
|
30
30
|
block: block,
|
|
31
31
|
bold: bold,
|
|
@@ -37,7 +37,7 @@ var titleStyle = function titleStyle(theme, _ref) {
|
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
39
|
var Title = function Title(props) {
|
|
40
|
-
return (0, _react.jsx)("div", (
|
|
40
|
+
return (0, _react.jsx)("div", _extends({
|
|
41
41
|
css: function css(theme) {
|
|
42
42
|
return titleStyle(theme, props);
|
|
43
43
|
}
|
package/src/Text/Title.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Title.js","names":["titleStyle","theme","block","center","fontSize","color","COLOR","GRAY","bold","props","textStyle","marginBottom","Title","filterTextProps"],"sources":["Title.tsx"],"sourcesContent":["/*\n * Wire\n * Copyright (C) 2018 Wire Swiss GmbH\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see http://www.gnu.org/licenses/.\n *\n */\n\n/** @jsx jsx */\nimport {CSSObject, jsx} from '@emotion/react';\n\nimport {COLOR} from '../Identity';\nimport {Theme} from '../Layout';\nimport {TextProps, filterTextProps, textStyle} from './Text';\n\nexport type TitleProps<T = HTMLDivElement> = TextProps<T>;\n\nconst titleStyle: <T>(theme: Theme, props: TitleProps<T>) => CSSObject = (\n theme,\n {block = true, center = true, fontSize = '32px', color = COLOR.GRAY, bold = true, ...props},\n) => ({\n ...textStyle(theme, {block, bold, center, color, fontSize, ...props}),\n marginBottom: '8px',\n});\n\nexport const Title = (props: TitleProps) => (\n <div css={(theme: Theme) => titleStyle(theme, props)} {...filterTextProps(props)} />\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Title.js","names":["titleStyle","theme","block","center","fontSize","color","COLOR","GRAY","bold","props","textStyle","marginBottom","Title","filterTextProps"],"sources":["Title.tsx"],"sourcesContent":["/*\n * Wire\n * Copyright (C) 2018 Wire Swiss GmbH\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see http://www.gnu.org/licenses/.\n *\n */\n\n/** @jsx jsx */\nimport {CSSObject, jsx} from '@emotion/react';\n\nimport {COLOR} from '../Identity';\nimport {Theme} from '../Layout';\nimport {TextProps, filterTextProps, textStyle} from './Text';\n\nexport type TitleProps<T = HTMLDivElement> = TextProps<T>;\n\nconst titleStyle: <T>(theme: Theme, props: TitleProps<T>) => CSSObject = (\n theme,\n {block = true, center = true, fontSize = '32px', color = COLOR.GRAY, bold = true, ...props},\n) => ({\n ...textStyle(theme, {block, bold, center, color, fontSize, ...props}),\n marginBottom: '8px',\n});\n\nexport const Title = (props: TitleProps) => (\n <div css={(theme: Theme) => titleStyle(theme, props)} {...filterTextProps(props)} />\n);\n"],"mappings":";;;;;;AAoBA;AAEA;AAEA;AAA6D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAI7D,IAAMA,UAAgE,GAAG,SAAnEA,UAAgE,CACpEC,KAAK;EAAA,sBACJC,KAAK;IAALA,KAAK,2BAAG,IAAI;IAAA,mBAAEC,MAAM;IAANA,MAAM,4BAAG,IAAI;IAAA,qBAAEC,QAAQ;IAARA,QAAQ,8BAAG,MAAM;IAAA,kBAAEC,KAAK;IAALA,KAAK,2BAAGC,eAAK,CAACC,IAAI;IAAA,iBAAEC,IAAI;IAAJA,IAAI,0BAAG,IAAI;IAAKC,KAAK;EAAA,uCAEvF,IAAAC,eAAS,EAACT,KAAK;IAAGC,KAAK,EAALA,KAAK;IAAEM,IAAI,EAAJA,IAAI;IAAEL,MAAM,EAANA,MAAM;IAAEE,KAAK,EAALA,KAAK;IAAED,QAAQ,EAARA;EAAQ,GAAKK,KAAK,EAAE;IACrEE,YAAY,EAAE;EAAK;AAAA,CACnB;AAEK,IAAMC,KAAK,GAAG,SAARA,KAAK,CAAIH,KAAiB;EAAA,OACrC;IAAK,GAAG,EAAE,aAACR,KAAY;MAAA,OAAKD,UAAU,CAACC,KAAK,EAAEQ,KAAK,CAAC;IAAA;EAAC,GAAK,IAAAI,qBAAe,EAACJ,KAAK,CAAC,EAAI;AAAA,CACrF;AAAC"}
|
package/src/mediaQueries.js
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.media = exports.QueryKeys = exports.QUERY = void 0;
|
|
8
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
7
|
var _sizes = require("./Layout/sizes");
|
|
11
8
|
var _QUERY;
|
|
12
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (
|
|
10
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
15
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
18
|
var QueryKeys;
|
|
15
19
|
exports.QueryKeys = QueryKeys;
|
|
16
20
|
(function (QueryKeys) {
|
|
@@ -23,13 +27,13 @@ exports.QueryKeys = QueryKeys;
|
|
|
23
27
|
QueryKeys["TABLET_DOWN"] = "tabletDown";
|
|
24
28
|
QueryKeys["TABLET_UP"] = "tabletUp";
|
|
25
29
|
})(QueryKeys || (exports.QueryKeys = QueryKeys = {}));
|
|
26
|
-
var QUERY = (_QUERY = {}, (
|
|
30
|
+
var QUERY = (_QUERY = {}, _defineProperty(_QUERY, QueryKeys.DESKTOP, "min-width: ".concat(_sizes.WIDTH.DESKTOP_MIN, "px")), _defineProperty(_QUERY, QueryKeys.DESKTOP_XL, "min-width: ".concat(_sizes.WIDTH.DESKTOP_XL_MIN, "px")), _defineProperty(_QUERY, QueryKeys.MOBILE, "max-width: ".concat(_sizes.WIDTH.MOBILE_MAX, "px")), _defineProperty(_QUERY, QueryKeys.MOBILE_DOWN, "max-width: ".concat(_sizes.WIDTH.MOBILE_MAX, "px")), _defineProperty(_QUERY, QueryKeys.MOBILE_UP, "min-width: ".concat(_sizes.WIDTH.MOBILE, "px")), _defineProperty(_QUERY, QueryKeys.TABLET, "min-width: ".concat(_sizes.WIDTH.TABLET_MIN, "px) and (max-width: ").concat(_sizes.WIDTH.TABLET_MAX, "px")), _defineProperty(_QUERY, QueryKeys.TABLET_DOWN, "max-width: ".concat(_sizes.WIDTH.TABLET_MAX, "px")), _defineProperty(_QUERY, QueryKeys.TABLET_UP, "min-width: ".concat(_sizes.WIDTH.TABLET_MIN, "px")), _QUERY);
|
|
27
31
|
exports.QUERY = QUERY;
|
|
28
32
|
var media = Object.entries(QUERY).reduce(function (accumulator, _ref) {
|
|
29
|
-
var _ref2 = (
|
|
33
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
30
34
|
key = _ref2[0],
|
|
31
35
|
value = _ref2[1];
|
|
32
|
-
return _objectSpread(_objectSpread({}, accumulator), {}, (
|
|
36
|
+
return _objectSpread(_objectSpread({}, accumulator), {}, _defineProperty({}, key, "@media (".concat(value, ")")));
|
|
33
37
|
}, {});
|
|
34
38
|
exports.media = media;
|
|
35
39
|
//# sourceMappingURL=mediaQueries.js.map
|
package/src/mediaQueries.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mediaQueries.js","names":["QueryKeys","QUERY","DESKTOP","WIDTH","DESKTOP_MIN","DESKTOP_XL","DESKTOP_XL_MIN","MOBILE","MOBILE_MAX","MOBILE_DOWN","MOBILE_UP","TABLET","TABLET_MIN","TABLET_MAX","TABLET_DOWN","TABLET_UP","media","Object","entries","reduce","accumulator","key","value"],"sources":["mediaQueries.ts"],"sourcesContent":["/*\n * Wire\n * Copyright (C) 2018 Wire Swiss GmbH\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {WIDTH} from './Layout/sizes';\n\nexport enum QueryKeys {\n DESKTOP = 'desktop',\n DESKTOP_XL = 'desktopXL',\n MOBILE = 'mobile',\n MOBILE_DOWN = 'mobileDown',\n MOBILE_UP = 'mobileUp',\n TABLET = 'tablet',\n TABLET_DOWN = 'tabletDown',\n TABLET_UP = 'tabletUp',\n}\n\nexport type QueryMap = Record<QueryKeys, string>;\n\nexport const QUERY: QueryMap = {\n [QueryKeys.DESKTOP]: `min-width: ${WIDTH.DESKTOP_MIN}px`,\n [QueryKeys.DESKTOP_XL]: `min-width: ${WIDTH.DESKTOP_XL_MIN}px`,\n [QueryKeys.MOBILE]: `max-width: ${WIDTH.MOBILE_MAX}px`,\n [QueryKeys.MOBILE_DOWN]: `max-width: ${WIDTH.MOBILE_MAX}px`,\n [QueryKeys.MOBILE_UP]: `min-width: ${WIDTH.MOBILE}px`,\n [QueryKeys.TABLET]: `min-width: ${WIDTH.TABLET_MIN}px) and (max-width: ${WIDTH.TABLET_MAX}px`,\n [QueryKeys.TABLET_DOWN]: `max-width: ${WIDTH.TABLET_MAX}px`,\n [QueryKeys.TABLET_UP]: `min-width: ${WIDTH.TABLET_MIN}px`,\n};\n\nexport const media = Object.entries(QUERY).reduce<QueryMap | {}>(\n (accumulator, [key, value]) => ({...accumulator, [key]: `@media (${value})`}),\n {},\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"mediaQueries.js","names":["QueryKeys","QUERY","DESKTOP","WIDTH","DESKTOP_MIN","DESKTOP_XL","DESKTOP_XL_MIN","MOBILE","MOBILE_MAX","MOBILE_DOWN","MOBILE_UP","TABLET","TABLET_MIN","TABLET_MAX","TABLET_DOWN","TABLET_UP","media","Object","entries","reduce","accumulator","key","value"],"sources":["mediaQueries.ts"],"sourcesContent":["/*\n * Wire\n * Copyright (C) 2018 Wire Swiss GmbH\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {WIDTH} from './Layout/sizes';\n\nexport enum QueryKeys {\n DESKTOP = 'desktop',\n DESKTOP_XL = 'desktopXL',\n MOBILE = 'mobile',\n MOBILE_DOWN = 'mobileDown',\n MOBILE_UP = 'mobileUp',\n TABLET = 'tablet',\n TABLET_DOWN = 'tabletDown',\n TABLET_UP = 'tabletUp',\n}\n\nexport type QueryMap = Record<QueryKeys, string>;\n\nexport const QUERY: QueryMap = {\n [QueryKeys.DESKTOP]: `min-width: ${WIDTH.DESKTOP_MIN}px`,\n [QueryKeys.DESKTOP_XL]: `min-width: ${WIDTH.DESKTOP_XL_MIN}px`,\n [QueryKeys.MOBILE]: `max-width: ${WIDTH.MOBILE_MAX}px`,\n [QueryKeys.MOBILE_DOWN]: `max-width: ${WIDTH.MOBILE_MAX}px`,\n [QueryKeys.MOBILE_UP]: `min-width: ${WIDTH.MOBILE}px`,\n [QueryKeys.TABLET]: `min-width: ${WIDTH.TABLET_MIN}px) and (max-width: ${WIDTH.TABLET_MAX}px`,\n [QueryKeys.TABLET_DOWN]: `max-width: ${WIDTH.TABLET_MAX}px`,\n [QueryKeys.TABLET_UP]: `min-width: ${WIDTH.TABLET_MIN}px`,\n};\n\nexport const media = Object.entries(QUERY).reduce<QueryMap | {}>(\n (accumulator, [key, value]) => ({...accumulator, [key]: `@media (${value})`}),\n {},\n);\n"],"mappings":";;;;;;AAmBA;AAAqC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAEzBA,SAAS;AAAA;AAAA,WAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;AAAA,GAATA,SAAS,yBAATA,SAAS;AAad,IAAMC,KAAe,yCACzBD,SAAS,CAACE,OAAO,uBAAiBC,YAAK,CAACC,WAAW,kCACnDJ,SAAS,CAACK,UAAU,uBAAiBF,YAAK,CAACG,cAAc,kCACzDN,SAAS,CAACO,MAAM,uBAAiBJ,YAAK,CAACK,UAAU,kCACjDR,SAAS,CAACS,WAAW,uBAAiBN,YAAK,CAACK,UAAU,kCACtDR,SAAS,CAACU,SAAS,uBAAiBP,YAAK,CAACI,MAAM,kCAChDP,SAAS,CAACW,MAAM,uBAAiBR,YAAK,CAACS,UAAU,iCAAuBT,YAAK,CAACU,UAAU,kCACxFb,SAAS,CAACc,WAAW,uBAAiBX,YAAK,CAACU,UAAU,kCACtDb,SAAS,CAACe,SAAS,uBAAiBZ,YAAK,CAACS,UAAU,iBACtD;AAAC;AAEK,IAAMI,KAAK,GAAGC,MAAM,CAACC,OAAO,CAACjB,KAAK,CAAC,CAACkB,MAAM,CAC/C,UAACC,WAAW;EAAA;IAAGC,GAAG;IAAEC,KAAK;EAAA,uCAAWF,WAAW,2BAAGC,GAAG,oBAAcC,KAAK;AAAA,CAAK,EAC7E,CAAC,CAAC,CACH;AAAC"}
|
package/src/util.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.noop = exports.manySelectors = exports.inlineSVG = exports.filterProps = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (
|
|
8
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
14
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
16
|
/*
|
|
13
17
|
* Wire
|
|
14
18
|
* Copyright (C) 2019 Wire Swiss GmbH
|
|
@@ -36,10 +40,10 @@ var inlineSVG = function inlineSVG(svg) {
|
|
|
36
40
|
exports.inlineSVG = inlineSVG;
|
|
37
41
|
var filterProps = function filterProps(props, propsToFilter) {
|
|
38
42
|
return Object.entries(props).reduce(function (accumulator, _ref) {
|
|
39
|
-
var _ref2 = (
|
|
43
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
40
44
|
key = _ref2[0],
|
|
41
45
|
value = _ref2[1];
|
|
42
|
-
return !propsToFilter.includes(key) ? _objectSpread(_objectSpread({}, accumulator), {}, (
|
|
46
|
+
return !propsToFilter.includes(key) ? _objectSpread(_objectSpread({}, accumulator), {}, _defineProperty({}, key, value)) : accumulator;
|
|
43
47
|
}, {});
|
|
44
48
|
};
|
|
45
49
|
exports.filterProps = filterProps;
|
package/src/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","names":["noop","inlineSVG","svg","encodeURIComponent","filterProps","props","propsToFilter","Object","entries","reduce","accumulator","key","value","includes","manySelectors","selectors","css","acc","selector"],"sources":["util.ts"],"sourcesContent":["/*\n * Wire\n * Copyright (C) 2019 Wire Swiss GmbH\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {CSSObject} from '@emotion/react';\n\nexport const noop = () => {};\n\nexport const inlineSVG = (svg: string) => `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;\n\nexport const filterProps: <T extends Record<string, any>>(props: T, propsToFilter: (keyof T)[]) => Object = (\n props,\n propsToFilter,\n) => {\n return Object.entries(props).reduce<Object>(\n (accumulator, [key, value]) => (!propsToFilter.includes(key) ? {...accumulator, [key]: value} : accumulator),\n {},\n );\n};\n\nexport const manySelectors = (selectors: string[], css: CSSObject) =>\n selectors.reduce((acc, selector) => {\n acc[selector] = css;\n return acc;\n }, {});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.js","names":["noop","inlineSVG","svg","encodeURIComponent","filterProps","props","propsToFilter","Object","entries","reduce","accumulator","key","value","includes","manySelectors","selectors","css","acc","selector"],"sources":["util.ts"],"sourcesContent":["/*\n * Wire\n * Copyright (C) 2019 Wire Swiss GmbH\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see http://www.gnu.org/licenses/.\n *\n */\n\nimport {CSSObject} from '@emotion/react';\n\nexport const noop = () => {};\n\nexport const inlineSVG = (svg: string) => `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;\n\nexport const filterProps: <T extends Record<string, any>>(props: T, propsToFilter: (keyof T)[]) => Object = (\n props,\n propsToFilter,\n) => {\n return Object.entries(props).reduce<Object>(\n (accumulator, [key, value]) => (!propsToFilter.includes(key) ? {...accumulator, [key]: value} : accumulator),\n {},\n );\n};\n\nexport const manySelectors = (selectors: string[], css: CSSObject) =>\n selectors.reduce((acc, selector) => {\n acc[selector] = css;\n return acc;\n }, {});\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIO,IAAMA,IAAI,GAAG,SAAPA,IAAI,GAAS,CAAC,CAAC;AAAC;AAEtB,IAAMC,SAAS,GAAG,SAAZA,SAAS,CAAIC,GAAW;EAAA,yCAAgCC,kBAAkB,CAACD,GAAG,CAAC;AAAA,CAAE;AAAC;AAExF,IAAME,WAA4F,GAAG,SAA/FA,WAA4F,CACvGC,KAAK,EACLC,aAAa,EACV;EACH,OAAOC,MAAM,CAACC,OAAO,CAACH,KAAK,CAAC,CAACI,MAAM,CACjC,UAACC,WAAW;IAAA;MAAGC,GAAG;MAAEC,KAAK;IAAA,OAAO,CAACN,aAAa,CAACO,QAAQ,CAACF,GAAG,CAAC,mCAAOD,WAAW,2BAAGC,GAAG,EAAGC,KAAK,KAAIF,WAAW;EAAA,CAAC,EAC5G,CAAC,CAAC,CACH;AACH,CAAC;AAAC;AAEK,IAAMI,aAAa,GAAG,SAAhBA,aAAa,CAAIC,SAAmB,EAAEC,GAAc;EAAA,OAC/DD,SAAS,CAACN,MAAM,CAAC,UAACQ,GAAG,EAAEC,QAAQ,EAAK;IAClCD,GAAG,CAACC,QAAQ,CAAC,GAAGF,GAAG;IACnB,OAAOC,GAAG;EACZ,CAAC,EAAE,CAAC,CAAC,CAAC;AAAA;AAAC"}
|