@wireapp/react-ui-kit 8.1.0 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -3
- package/package.json +4 -4
- package/src/Form/Button.d.js +4 -0
- package/src/Form/Button.d.ts +8 -0
- package/src/Form/Button.js +83 -20
- package/src/Form/Button.js.map +1 -1
- package/src/Form/Button.md +61 -2
- package/src/Form/Checkbox.js +44 -22
- package/src/Form/Checkbox.js.map +1 -1
- package/src/Form/CodeInput.js +10 -4
- package/src/Form/CodeInput.js.map +1 -1
- package/src/Form/CodeInput.md +9 -1
- package/src/Form/ErrorMessage.js +18 -12
- package/src/Form/ErrorMessage.js.map +1 -1
- package/src/Form/Form.md +23 -0
- package/src/Form/Input.d.ts +6 -2
- package/src/Form/Input.js +101 -16
- package/src/Form/Input.js.map +1 -1
- package/src/Form/InputBlock.js +7 -3
- package/src/Form/InputBlock.js.map +1 -1
- package/src/Form/InputLabel.d.js +2 -0
- package/src/Form/InputLabel.d.js.map +1 -0
- package/src/Form/InputLabel.d.ts +9 -0
- package/src/Form/InputLabel.js +47 -0
- package/src/Form/InputLabel.js.map +1 -0
- package/src/Form/InputLabel.md +33 -0
- package/src/Form/InputSubmitCombo.js +5 -4
- package/src/Form/InputSubmitCombo.js.map +1 -1
- package/src/Form/Select.d.ts +6 -2
- package/src/Form/Select.js +57 -12
- package/src/Form/Select.js.map +1 -1
- package/src/Form/Select.md +25 -4
- package/src/Form/TextArea.js +1 -1
- package/src/Form/TextArea.js.map +1 -1
- package/src/Form/index.d.js +13 -0
- package/src/Form/index.d.js.map +1 -1
- package/src/Form/index.d.ts +1 -0
- package/src/Form/index.js +13 -0
- package/src/Form/index.js.map +1 -1
- package/src/Icon/HideIcon.js +1 -1
- package/src/Icon/HideIcon.js.map +1 -1
- package/src/Icon/ShowIcon.js +1 -1
- package/src/Icon/ShowIcon.js.map +1 -1
- package/src/Identity/colors-v2.d.ts +1 -1
- package/src/Identity/colors-v2.js +3 -3
- package/src/Identity/colors-v2.js.map +1 -1
- package/src/Identity/colors-v2.md +1 -1
- package/src/Identity/index.d.js +13 -0
- package/src/Identity/index.d.js.map +1 -1
- package/src/Identity/index.d.ts +1 -0
- package/src/Identity/index.js +13 -0
- package/src/Identity/index.js.map +1 -1
- package/src/Layout/Theme.js +3 -1
- package/src/Layout/Theme.js.map +1 -1
- package/src/Misc/ButtonGroup.d.js +2 -0
- package/src/Misc/ButtonGroup.d.js.map +1 -0
- package/src/Misc/ButtonGroup.d.ts +14 -0
- package/src/Misc/ButtonGroup.js +113 -0
- package/src/Misc/ButtonGroup.js.map +1 -0
- package/src/Misc/ButtonGroup.md +27 -0
- package/src/Misc/IconButton.d.js +6 -0
- package/src/Misc/IconButton.d.js.map +1 -0
- package/src/Misc/IconButton.d.ts +15 -0
- package/src/Misc/IconButton.js +122 -0
- package/src/Misc/IconButton.js.map +1 -0
- package/src/Misc/IconButton.md +43 -0
- package/src/Misc/childrenWithDefaultProps.d.ts +1 -1
- package/src/Misc/index.d.js +26 -0
- package/src/Misc/index.d.js.map +1 -1
- package/src/Misc/index.d.ts +2 -0
- package/src/Misc/index.js +26 -0
- package/src/Misc/index.js.map +1 -1
- package/src/Text/Label.md +18 -18
- package/src/Text/TextLink.js +2 -2
- package/src/Text/TextLink.js.map +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _react = require("@emotion/react");
|
|
13
|
+
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
|
+
|
|
16
|
+
var _Identity = require("../Identity");
|
|
17
|
+
|
|
18
|
+
var _react2 = _interopRequireDefault(require("react"));
|
|
19
|
+
|
|
20
|
+
var _excluded = ["htmlFor", "markInvalid", "isRequired", "children"];
|
|
21
|
+
|
|
22
|
+
var InputLabel = function InputLabel(_ref) {
|
|
23
|
+
var htmlFor = _ref.htmlFor,
|
|
24
|
+
markInvalid = _ref.markInvalid,
|
|
25
|
+
isRequired = _ref.isRequired,
|
|
26
|
+
children = _ref.children,
|
|
27
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
28
|
+
return (0, _react.jsx)("label", (0, _extends2["default"])({
|
|
29
|
+
htmlFor: htmlFor,
|
|
30
|
+
css: /*#__PURE__*/(0, _react.css)({
|
|
31
|
+
fontSize: '14px',
|
|
32
|
+
fontWeight: 400,
|
|
33
|
+
lineHeight: '16px',
|
|
34
|
+
color: markInvalid ? _Identity.COLOR_V2.RED_LIGHT_500 : _Identity.COLOR_V2.GRAY_80
|
|
35
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:InputLabel;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIklucHV0TGFiZWwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWtDSSIsImZpbGUiOiJJbnB1dExhYmVsLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBXaXJlXG4gKiBDb3B5cmlnaHQgKEMpIDIwMjIgV2lyZSBTd2lzcyBHbWJIXG4gKlxuICogVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU6IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vciBtb2RpZnlcbiAqIGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMgcHVibGl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zogYm9vbGVhbjtcbn1cblxuY29uc3QgSW5wdXRMYWJlbDogRkM8SW5wdXRMYWJlbFByb3BzPiA9ICh7aHRtbEZvciwgbWFya0ludmFsaWQsIGlzUmVxdWlyZWQsIGNoaWxkcmVuLCAuLi5wcm9wc30pID0+IChcbiAgPGxhYmVsXG4gICAgaHRtbEZvcj17aHRtbEZvcn1cbiAgICBjc3M9e3tcbiAgICAgIGZvbnRTaXplOiAnMTRweCcsXG4gICAgICBmb250V2VpZ2h0OiA0MDAsXG4gICAgICBsaW5lSGVpZ2h0OiAnMTZweCcsXG4gICAgICBjb2xvcjogbWFya0ludmFsaWQgPyBDT0xPUl9WMi5SRURfTElHSFRfNTAwIDogQ09MT1JfVjIuR1JBWV84MCxcbiAgICB9fVxuICAgIHsuLi5wcm9wc31cbiAgPlxuICAgIHtjaGlsZHJlbn1cblxuICAgIHtpc1JlcXVpcmVkICYmIDxzcGFuIGNzcz17e2ZvbnRTaXplOiAnMTZweCcsIG1hcmdpbkxlZnQ6ICc0cHgnLCBjb2xvcjogQ09MT1JfVjIuUkVEX0xJR0hUXzUwMH19Pio8L3NwYW4+fVxuICA8L2xhYmVsPlxuKTtcblxuZXhwb3J0IGRlZmF1bHQgSW5wdXRMYWJlbDtcbiJdfQ== */")
|
|
36
|
+
}, props), children, isRequired && (0, _react.jsx)("span", {
|
|
37
|
+
css: /*#__PURE__*/(0, _react.css)({
|
|
38
|
+
fontSize: '16px',
|
|
39
|
+
marginLeft: '4px',
|
|
40
|
+
color: _Identity.COLOR_V2.RED_LIGHT_500
|
|
41
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:InputLabel;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIklucHV0TGFiZWwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTRDeUIiLCJmaWxlIjoiSW5wdXRMYWJlbC50c3giLCJzb3Vy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MappingURL=InputLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["InputLabel.tsx"],"names":["InputLabel","htmlFor","markInvalid","isRequired","children","props","fontSize","fontWeight","lineHeight","color","COLOR_V2","RED_LIGHT_500","GRAY_80","marginLeft"],"mappings":";;;;;;;;;;;AAoBA;;;;AACA;;AACA;;;;AASA,IAAMA,UAA+B,GAAG,SAAlCA,UAAkC;AAAA,MAAEC,OAAF,QAAEA,OAAF;AAAA,MAAWC,WAAX,QAAWA,WAAX;AAAA,MAAwBC,UAAxB,QAAwBA,UAAxB;AAAA,MAAoCC,QAApC,QAAoCA,QAApC;AAAA,MAAiDC,KAAjD;AAAA,SACtC;AACE,IAAA,OAAO,EAAEJ,OADX;AAEE,IAAA,GAAG,+BAAE;AACHK,MAAAA,QAAQ,EAAE,MADP;AAEHC,MAAAA,UAAU,EAAE,GAFT;AAGHC,MAAAA,UAAU,EAAE,MAHT;AAIHC,MAAAA,KAAK,EAAEP,WAAW,GAAGQ,mBAASC,aAAZ,GAA4BD,mBAASE;AAJpD,KAAF;AAFL,KAQMP,KARN,GAUGD,QAVH,EAYGD,UAAU,IAAI;AAAM,IAAA,GAAG,+BAAE;AAACG,MAAAA,QAAQ,EAAE,MAAX;AAAmBO,MAAAA,UAAU,EAAE,KAA/B;AAAsCJ,MAAAA,KAAK,EAAEC,mBAASC;AAAtD,KAAF;AAAT,SAZjB,CADsC;AAAA,CAAxC;;eAiBeX,U","sourcesContent":["/*\n * Wire\n * Copyright (C) 2022 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 {jsx} from '@emotion/react';\nimport {COLOR_V2} from '../Identity';\nimport React, {FC, ReactNode} from 'react';\n\nexport interface InputLabelProps {\n children: ReactNode | string;\n htmlFor?: string;\n markInvalid?: boolean;\n isRequired?: boolean;\n}\n\nconst InputLabel: FC<InputLabelProps> = ({htmlFor, markInvalid, isRequired, children, ...props}) => (\n <label\n htmlFor={htmlFor}\n css={{\n fontSize: '14px',\n fontWeight: 400,\n lineHeight: '16px',\n color: markInvalid ? COLOR_V2.RED_LIGHT_500 : COLOR_V2.GRAY_80,\n }}\n {...props}\n >\n {children}\n\n {isRequired && <span css={{fontSize: '16px', marginLeft: '4px', color: COLOR_V2.RED_LIGHT_500}}>*</span>}\n </label>\n);\n\nexport default InputLabel;\n"],"file":"InputLabel.js"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Demo:
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
import {Fragment} from 'react';
|
|
5
|
+
import {Columns, Column} from '@wireapp/react-ui-kit';
|
|
6
|
+
import InputLabel from './InputLabel';
|
|
7
|
+
|
|
8
|
+
<Fragment>
|
|
9
|
+
<Columns>
|
|
10
|
+
<Column>InputLabel Default</Column>
|
|
11
|
+
|
|
12
|
+
<Column>
|
|
13
|
+
<InputLabel>InputLabel</InputLabel>
|
|
14
|
+
</Column>
|
|
15
|
+
</Columns>
|
|
16
|
+
|
|
17
|
+
<Columns>
|
|
18
|
+
<Column>InputLabel - Mandatory</Column>
|
|
19
|
+
|
|
20
|
+
<Column>
|
|
21
|
+
<InputLabel isRequired>InputLabel</InputLabel>
|
|
22
|
+
</Column>
|
|
23
|
+
</Columns>
|
|
24
|
+
|
|
25
|
+
<Columns>
|
|
26
|
+
<Column>InputLabel - Invalid</Column>
|
|
27
|
+
|
|
28
|
+
<Column>
|
|
29
|
+
<InputLabel markInvalid>InputLabel</InputLabel>
|
|
30
|
+
</Column>
|
|
31
|
+
</Columns>
|
|
32
|
+
</Fragment>;
|
|
33
|
+
```
|
|
@@ -38,17 +38,18 @@ var InputSubmitCombo = function InputSubmitCombo(_ref) {
|
|
|
38
38
|
|
|
39
39
|
return _objectSpread(_objectSpread({}, (0, _Input.inputStyle)(theme, props)), {}, (_objectSpread2 = {
|
|
40
40
|
'&:focus-within': {
|
|
41
|
-
boxShadow: "0 0 0 1px ".concat(_Identity.
|
|
41
|
+
boxShadow: "0 0 0 1px ".concat(_Identity.COLOR_V2.BLUE)
|
|
42
42
|
}
|
|
43
|
-
}, (0, _defineProperty2["default"])(_objectSpread2, ".".concat(_Input.
|
|
43
|
+
}, (0, _defineProperty2["default"])(_objectSpread2, ".".concat(_Input.INPUT_GROUP), {
|
|
44
|
+
flexGrow: 1
|
|
45
|
+
}), (0, _defineProperty2["default"])(_objectSpread2, ".".concat(_Input.INPUT_CLASSNAME), {
|
|
44
46
|
'&:focus, &:invalid:not(:focus)': {
|
|
45
47
|
boxShadow: 'none'
|
|
46
48
|
},
|
|
47
49
|
boxShadow: 'none',
|
|
48
|
-
flexGrow: 1,
|
|
49
50
|
margin: '0 8px 0 0',
|
|
50
51
|
padding: '0 0 0 16px'
|
|
51
|
-
}), (0, _defineProperty2["default"])(_objectSpread2, "alignItems", 'center'), (0, _defineProperty2["default"])(_objectSpread2, "display", 'flex'), (0, _defineProperty2["default"])(_objectSpread2, "height", '
|
|
52
|
+
}), (0, _defineProperty2["default"])(_objectSpread2, "alignItems", 'center'), (0, _defineProperty2["default"])(_objectSpread2, "display", 'flex'), (0, _defineProperty2["default"])(_objectSpread2, "height", '49px'), (0, _defineProperty2["default"])(_objectSpread2, "justifyContent", 'space-between'), (0, _defineProperty2["default"])(_objectSpread2, "marginBottom", '4px'), (0, _defineProperty2["default"])(_objectSpread2, "paddingLeft", 0), _objectSpread2));
|
|
52
53
|
}
|
|
53
54
|
}, props), children);
|
|
54
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["InputSubmitCombo.tsx"],"names":["INPUT_SUBMIT_COMBO_CLASSNAME","InputSubmitCombo","children","props","theme","boxShadow","
|
|
1
|
+
{"version":3,"sources":["InputSubmitCombo.tsx"],"names":["INPUT_SUBMIT_COMBO_CLASSNAME","InputSubmitCombo","children","props","theme","boxShadow","COLOR_V2","BLUE","INPUT_GROUP","flexGrow","INPUT_CLASSNAME","margin","padding"],"mappings":";;;;;;;;;;;;;;;AAoBA;;AAEA;;AACA;;;;;;;;AAKO,IAAMA,4BAA4B,GAAG,kBAArC;;;AAEA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB;AAAA,MAAEC,QAAF,QAAEA,QAAF;AAAA,MAAeC,KAAf;AAAA,SAC9B;AACE,IAAA,SAAS,EAAEH,4BADb;AAEE,IAAA,GAAG,EAAE,aAACI,KAAD;AAAA;;AAAA,6CACA,uBAAWA,KAAX,EAAkBD,KAAlB,CADA;AAEH,0BAAkB;AAChBE,UAAAA,SAAS,sBAAeC,mBAASC,IAAxB;AADO;AAFf,qEAKEC,kBALF,GAKkB;AACnBC,QAAAA,QAAQ,EAAE;AADS,OALlB,+DAQEC,sBARF,GAQsB;AACvB,0CAAkC;AAChCL,UAAAA,SAAS,EAAE;AADqB,SADX;AAIvBA,QAAAA,SAAS,EAAE,MAJY;AAKvBM,QAAAA,MAAM,EAAE,WALe;AAMvBC,QAAAA,OAAO,EAAE;AANc,OARtB,kEAgBS,QAhBT,+DAiBM,MAjBN,8DAkBK,MAlBL,sEAmBa,eAnBb,oEAoBW,KApBX,mEAqBU,CArBV;AAAA;AAFP,KAyBMT,KAzBN,GA2BGD,QA3BH,CAD8B;AAAA,CAAzB","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 {jsx} from '@emotion/react';\n\nimport {INPUT_CLASSNAME, INPUT_GROUP, InputProps, inputStyle} from './Input';\nimport {COLOR_V2} from '../Identity';\nimport {Theme} from '../Layout';\n\nexport type InputSubmitComboProps<T = HTMLDivElement> = InputProps<T>;\n\nexport const INPUT_SUBMIT_COMBO_CLASSNAME = 'inputSubmitCombo';\n\nexport const InputSubmitCombo = ({children, ...props}: InputSubmitComboProps) => (\n <div\n className={INPUT_SUBMIT_COMBO_CLASSNAME}\n css={(theme: Theme) => ({\n ...inputStyle(theme, props),\n '&:focus-within': {\n boxShadow: `0 0 0 1px ${COLOR_V2.BLUE}`,\n },\n [`.${INPUT_GROUP}`]: {\n flexGrow: 1,\n },\n [`.${INPUT_CLASSNAME}`]: {\n '&:focus, &:invalid:not(:focus)': {\n boxShadow: 'none',\n },\n boxShadow: 'none',\n margin: '0 8px 0 0',\n padding: '0 0 0 16px',\n },\n alignItems: 'center',\n display: 'flex',\n height: '49px', // needs a bit more space to not overlap with the `boxShadow` from `:focus`\n justifyContent: 'space-between',\n marginBottom: '4px',\n paddingLeft: 0,\n })}\n {...props}\n >\n {children}\n </div>\n);\n"],"file":"InputSubmitCombo.js"}
|
package/src/Form/Select.d.ts
CHANGED
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
import { CSSObject, jsx } from '@emotion/react';
|
|
3
3
|
import type { Theme } from '../Layout';
|
|
4
4
|
import { InputProps } from './Input';
|
|
5
|
+
import { ReactElement } from 'react';
|
|
5
6
|
export interface SelectProps<T = HTMLSelectElement> extends InputProps<T> {
|
|
7
|
+
helperText?: string;
|
|
8
|
+
label?: string;
|
|
6
9
|
disabled?: boolean;
|
|
7
10
|
markInvalid?: boolean;
|
|
11
|
+
error?: ReactElement;
|
|
8
12
|
}
|
|
9
|
-
export declare const selectStyle: <T>(theme: Theme, props: SelectProps<T
|
|
10
|
-
export declare const Select: (props: SelectProps) => jsx.JSX.Element;
|
|
13
|
+
export declare const selectStyle: <T>(theme: Theme, props: SelectProps<T>, error?: boolean) => CSSObject;
|
|
14
|
+
export declare const Select: ({ label, children, error, helperText, ...props }: SelectProps) => jsx.JSX.Element;
|
package/src/Form/Select.js
CHANGED
|
@@ -9,26 +9,31 @@ exports.Select = exports.selectStyle = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
12
|
+
var _react = require("@emotion/react");
|
|
13
|
+
|
|
12
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
15
|
|
|
14
16
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
17
|
|
|
16
|
-
var _react = require("@emotion/react");
|
|
17
|
-
|
|
18
18
|
var _Identity = require("../Identity");
|
|
19
19
|
|
|
20
20
|
var _util = require("../util");
|
|
21
21
|
|
|
22
22
|
var _Input = require("./Input");
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _react2 = _interopRequireDefault(require("react"));
|
|
25
|
+
|
|
26
|
+
var _InputLabel = _interopRequireDefault(require("./InputLabel"));
|
|
27
|
+
|
|
28
|
+
var _excluded = ["disabled", "markInvalid"],
|
|
29
|
+
_excluded2 = ["label", "children", "error", "helperText"];
|
|
25
30
|
|
|
26
31
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
27
32
|
|
|
28
33
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
29
34
|
|
|
30
35
|
var ArrowDown = function ArrowDown(theme) {
|
|
31
|
-
return "\n
|
|
36
|
+
return "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\">\n <path fill=\"".concat(theme.general.color, "\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M7.99963 12.5711L15.6565 4.91421L14.2423 3.5L7.99963 9.74264L1.75699 3.5L0.342773 4.91421L7.99963 12.5711Z\"/>\n </svg>\n");
|
|
32
37
|
};
|
|
33
38
|
|
|
34
39
|
var selectStyle = function selectStyle(theme, _ref) {
|
|
@@ -36,21 +41,33 @@ var selectStyle = function selectStyle(theme, _ref) {
|
|
|
36
41
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
37
42
|
markInvalid = _ref.markInvalid,
|
|
38
43
|
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
44
|
+
var error = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
39
45
|
return _objectSpread(_objectSpread({}, (0, _Input.inputStyle)(theme, props)), {}, {
|
|
40
46
|
'&:-moz-focusring': {
|
|
41
47
|
color: 'transparent',
|
|
42
48
|
textShadow: '0 0 0 #000'
|
|
43
49
|
},
|
|
44
50
|
'&:disabled': {
|
|
45
|
-
color: _Identity.
|
|
51
|
+
color: _Identity.COLOR_V2.GRAY
|
|
46
52
|
},
|
|
47
53
|
appearance: 'none',
|
|
48
|
-
background: disabled ? theme.Input.backgroundColorDisabled : "".concat(theme.Input.backgroundColor, " center right 16px no-repeat url(\"").concat((0, _util.inlineSVG)(ArrowDown(theme)), "\")"),
|
|
49
|
-
boxShadow: markInvalid ? "0 0 0 1px ".concat(_Identity.
|
|
54
|
+
background: disabled ? "".concat(theme.Input.backgroundColorDisabled, " center right 16px no-repeat url(\"").concat((0, _util.inlineSVG)(ArrowDown(theme)), "\")") : "".concat(theme.Input.backgroundColor, " center right 16px no-repeat url(\"").concat((0, _util.inlineSVG)(ArrowDown(theme)), "\")"),
|
|
55
|
+
boxShadow: markInvalid ? "0 0 0 1px ".concat(_Identity.COLOR_V2.RED) : "0 0 0 1px ".concat(_Identity.COLOR_V2.GRAY_40),
|
|
50
56
|
cursor: disabled ? 'normal' : 'pointer',
|
|
51
57
|
fontSize: '16px',
|
|
52
58
|
fontWeight: 300,
|
|
53
|
-
paddingRight: '30px'
|
|
59
|
+
paddingRight: '30px',
|
|
60
|
+
marginBottom: error && '8px',
|
|
61
|
+
'&:invalid, option:first-of-type': {
|
|
62
|
+
color: _Identity.COLOR_V2.RED
|
|
63
|
+
}
|
|
64
|
+
}, !disabled && {
|
|
65
|
+
'&:hover': {
|
|
66
|
+
boxShadow: "0 0 0 1px ".concat(_Identity.COLOR_V2.GRAY_60)
|
|
67
|
+
},
|
|
68
|
+
'&:focus, &:active': {
|
|
69
|
+
boxShadow: "0 0 0 1px ".concat(_Identity.COLOR_V2.BLUE)
|
|
70
|
+
}
|
|
54
71
|
});
|
|
55
72
|
};
|
|
56
73
|
|
|
@@ -60,12 +77,40 @@ var filterSelectProps = function filterSelectProps(props) {
|
|
|
60
77
|
return (0, _util.filterProps)(props, ['markInvalid']);
|
|
61
78
|
};
|
|
62
79
|
|
|
63
|
-
var Select = function Select(
|
|
64
|
-
|
|
80
|
+
var Select = function Select(_ref2) {
|
|
81
|
+
var label = _ref2.label,
|
|
82
|
+
children = _ref2.children,
|
|
83
|
+
error = _ref2.error,
|
|
84
|
+
helperText = _ref2.helperText,
|
|
85
|
+
props = (0, _objectWithoutProperties2["default"])(_ref2, _excluded2);
|
|
86
|
+
var hasError = !!error;
|
|
87
|
+
return (0, _react.jsx)("div", {
|
|
88
|
+
css: /*#__PURE__*/(0, _react.css)({
|
|
89
|
+
marginBottom: props.markInvalid ? '2px' : '20px',
|
|
90
|
+
'&:focus-within label': {
|
|
91
|
+
color: _Identity.COLOR_V2.BLUE
|
|
92
|
+
}
|
|
93
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:Select;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNlbGVjdC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBcUZNIiwiZmlsZSI6IlNlbGVjdC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICogV2lyZVxuICogQ29weXJpZ2h0IChDKSAyMDE4IFdpcmUgU3dpc3MgR21iSFxuICpcbiAqIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOiB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5XG4gKiBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzIHB1Ymxpc2hlZCBieVxuICogdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbiwgZWl0aGVyIHZlcnNpb24gMyBvZiB0aGUgTGljZW5zZSwgb3JcbiAqIChhdCB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uXG4gKlxuICogVGhpcyBwcm9ncmFtIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRoYXQgaXQgd2lsbCBiZSB1c2VmdWwsXG4gKiBidXQgV0lUSE9VVCBBTlkgV0FSUkFOVFk7IHdpdGhvdXQgZXZlbiB0aGUgaW1wbGllZCB3YXJyYW50eSBvZlxuICogTUVSQ0hBTlRBQklMSVRZIG9yIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFLiBTZWU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1xuIl19 */")
|
|
94
|
+
}, label && (0, _react.jsx)(_InputLabel["default"], {
|
|
95
|
+
htmlFor: props.id,
|
|
96
|
+
isRequired: props.required,
|
|
97
|
+
markInvalid: props.markInvalid
|
|
98
|
+
}, label), (0, _react.jsx)("select", (0, _extends2["default"])({
|
|
65
99
|
css: function css(theme) {
|
|
66
|
-
return selectStyle(theme, props);
|
|
100
|
+
return selectStyle(theme, props, hasError);
|
|
67
101
|
}
|
|
68
|
-
}, filterSelectProps(props)))
|
|
102
|
+
}, filterSelectProps(props)), (0, _react.jsx)("option", {
|
|
103
|
+
disabled: true,
|
|
104
|
+
selected: true,
|
|
105
|
+
hidden: true
|
|
106
|
+
}, "- Please select -"), children), !hasError && helperText && (0, _react.jsx)("p", {
|
|
107
|
+
css: /*#__PURE__*/(0, _react.css)({
|
|
108
|
+
fontSize: '12px',
|
|
109
|
+
fontWeight: 400,
|
|
110
|
+
color: _Identity.COLOR_V2.GRAY_80,
|
|
111
|
+
marginTop: 8
|
|
112
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:Select;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNlbGVjdC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBMkdXIiwiZmlsZSI6IlNlbGVjdC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICogV2lyZVxuICogQ29weXJpZ2h0IChDKSAyMDE4IFdpcmUgU3dpc3MgR21iSFxuICpcbiAqIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOiB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5XG4gKiBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzIHB1Ymxpc2hlZCBieVxuICogdGhlIEZyZWUgU29mdHdh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VsZWN0ZWQgaGlkZGVuPlxuICAgICAgICAgIC0gUGxlYXNlIHNlbGVjdCAtXG4gICAgICAgIDwvb3B0aW9uPlxuXG4gICAgICAgIHtjaGlsZHJlbn1cbiAgICAgIDwvc2VsZWN0PlxuXG4gICAgICB7IWhhc0Vycm9yICYmIGhlbHBlclRleHQgJiYgKFxuICAgICAgICA8cCBjc3M9e3tmb250U2l6ZTogJzEycHgnLCBmb250V2VpZ2h0OiA0MDAsIGNvbG9yOiBDT0xPUl9WMi5HUkFZXzgwLCBtYXJnaW5Ub3A6IDh9fT57aGVscGVyVGV4dH08L3A+XG4gICAgICApfVxuXG4gICAgICB7ZXJyb3J9XG4gICAgPC9kaXY+XG4gICk7XG59O1xuIl19 */")
|
|
113
|
+
}, helperText), error);
|
|
69
114
|
};
|
|
70
115
|
|
|
71
116
|
exports.Select = Select;
|
package/src/Form/Select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Select.tsx"],"names":["ArrowDown","theme","general","color","selectStyle","disabled","markInvalid","props","textShadow","
|
|
1
|
+
{"version":3,"sources":["Select.tsx"],"names":["ArrowDown","theme","general","color","selectStyle","disabled","markInvalid","props","error","textShadow","COLOR_V2","GRAY","appearance","background","Input","backgroundColorDisabled","backgroundColor","boxShadow","RED","GRAY_40","cursor","fontSize","fontWeight","paddingRight","marginBottom","GRAY_60","BLUE","filterSelectProps","Select","label","children","helperText","hasError","id","required","GRAY_80","marginTop"],"mappings":";;;;;;;;;;;AAoBA;;;;;;AAEA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;AAUA,IAAMA,SAAS,GAAG,SAAZA,SAAY,CAACC,KAAD;AAAA,2IAEIA,KAAK,CAACC,OAAN,CAAcC,KAFlB;AAAA,CAAlB;;AAKO,IAAMC,WAAmF,GAAG,SAAtFA,WAAsF,CACjGH,KADiG;AAAA,2BAEhGI,QAFgG;AAAA,MAEhGA,QAFgG,8BAErF,KAFqF;AAAA,MAE9EC,WAF8E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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_V2} from '../Identity';\nimport type {Theme} from '../Layout';\nimport {filterProps, inlineSVG} from '../util';\nimport {InputProps, inputStyle} from './Input';\nimport React, {ReactElement} from 'react';\nimport InputLabel from './InputLabel';\n\nexport interface SelectProps<T = HTMLSelectElement> extends InputProps<T> {\n helperText?: string;\n label?: string;\n disabled?: boolean;\n markInvalid?: boolean;\n error?: ReactElement;\n}\n\nconst ArrowDown = (theme: Theme) => `\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\">\n <path fill=\"${theme.general.color}\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M7.99963 12.5711L15.6565 4.91421L14.2423 3.5L7.99963 9.74264L1.75699 3.5L0.342773 4.91421L7.99963 12.5711Z\"/>\n </svg>\n`;\nexport const selectStyle: <T>(theme: Theme, props: SelectProps<T>, error?: boolean) => CSSObject = (\n theme,\n {disabled = false, markInvalid, ...props},\n error = false,\n) => ({\n ...inputStyle(theme, props),\n '&:-moz-focusring': {\n color: 'transparent',\n textShadow: '0 0 0 #000',\n },\n '&:disabled': {\n color: COLOR_V2.GRAY,\n },\n appearance: 'none',\n background: disabled\n ? `${theme.Input.backgroundColorDisabled} center right 16px no-repeat url(\"${inlineSVG(ArrowDown(theme))}\")`\n : `${theme.Input.backgroundColor} center right 16px no-repeat url(\"${inlineSVG(ArrowDown(theme))}\")`,\n boxShadow: markInvalid ? `0 0 0 1px ${COLOR_V2.RED}` : `0 0 0 1px ${COLOR_V2.GRAY_40}`,\n cursor: disabled ? 'normal' : 'pointer',\n fontSize: '16px',\n fontWeight: 300,\n paddingRight: '30px',\n marginBottom: error && '8px',\n '&:invalid, option:first-of-type': {\n color: COLOR_V2.RED,\n },\n ...(!disabled && {\n '&:hover': {\n boxShadow: `0 0 0 1px ${COLOR_V2.GRAY_60}`,\n },\n '&:focus, &:active': {\n boxShadow: `0 0 0 1px ${COLOR_V2.BLUE}`,\n },\n }),\n});\n\nconst filterSelectProps = (props: SelectProps) => filterProps(props, ['markInvalid']);\n\nexport const Select = ({label, children, error, helperText, ...props}: SelectProps) => {\n const hasError = !!error;\n\n return (\n <div\n css={{\n marginBottom: props.markInvalid ? '2px' : '20px',\n '&:focus-within label': {\n color: COLOR_V2.BLUE,\n },\n }}\n >\n {label && (\n <InputLabel htmlFor={props.id} isRequired={props.required} markInvalid={props.markInvalid}>\n {label}\n </InputLabel>\n )}\n\n <select css={(theme: Theme) => selectStyle(theme, props, hasError)} {...filterSelectProps(props)}>\n <option disabled selected hidden>\n - Please select -\n </option>\n\n {children}\n </select>\n\n {!hasError && helperText && (\n <p css={{fontSize: '12px', fontWeight: 400, color: COLOR_V2.GRAY_80, marginTop: 8}}>{helperText}</p>\n )}\n\n {error}\n </div>\n );\n};\n"],"file":"Select.js"}
|
package/src/Form/Select.md
CHANGED
|
@@ -2,13 +2,14 @@ Demo:
|
|
|
2
2
|
|
|
3
3
|
```js
|
|
4
4
|
import {Fragment} from 'react';
|
|
5
|
-
import {Columns, Column, Select} from '@wireapp/react-ui-kit';
|
|
5
|
+
import {Columns, Column, ErrorMessage, Select} from '@wireapp/react-ui-kit';
|
|
6
6
|
|
|
7
7
|
<Fragment>
|
|
8
8
|
<Columns>
|
|
9
9
|
<Column>Select</Column>
|
|
10
|
+
|
|
10
11
|
<Column>
|
|
11
|
-
<Select>
|
|
12
|
+
<Select label="Select" id="firstSelect">
|
|
12
13
|
<option>a</option>
|
|
13
14
|
<option>b</option>
|
|
14
15
|
<option>c</option>
|
|
@@ -16,18 +17,38 @@ import {Columns, Column, Select} from '@wireapp/react-ui-kit';
|
|
|
16
17
|
</Select>
|
|
17
18
|
</Column>
|
|
18
19
|
</Columns>
|
|
20
|
+
|
|
19
21
|
<Columns>
|
|
20
22
|
<Column>Disabled Select</Column>
|
|
23
|
+
|
|
21
24
|
<Column>
|
|
22
|
-
<Select disabled>
|
|
25
|
+
<Select disabled label="Disabled select" id="disabledSelect">
|
|
23
26
|
<option>a</option>
|
|
24
27
|
</Select>
|
|
25
28
|
</Column>
|
|
26
29
|
</Columns>
|
|
30
|
+
|
|
31
|
+
<Columns>
|
|
32
|
+
<Column>Required Select</Column>
|
|
33
|
+
|
|
34
|
+
<Column>
|
|
35
|
+
<Select label="Required select" required id="requiredSelect">
|
|
36
|
+
<option>a</option>
|
|
37
|
+
</Select>
|
|
38
|
+
</Column>
|
|
39
|
+
</Columns>
|
|
40
|
+
|
|
27
41
|
<Columns>
|
|
28
42
|
<Column>Invalid Select</Column>
|
|
43
|
+
|
|
29
44
|
<Column>
|
|
30
|
-
<Select
|
|
45
|
+
<Select
|
|
46
|
+
markInvalid
|
|
47
|
+
label="InputLabel"
|
|
48
|
+
id="invalidSelect"
|
|
49
|
+
required
|
|
50
|
+
error={<ErrorMessage>Error message</ErrorMessage>}
|
|
51
|
+
>
|
|
31
52
|
<option>a</option>
|
|
32
53
|
</Select>
|
|
33
54
|
</Column>
|
package/src/Form/TextArea.js
CHANGED
|
@@ -32,7 +32,7 @@ var textAreaStyle = function textAreaStyle(theme, _ref) {
|
|
|
32
32
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
|
33
33
|
var placeholderStyle = {
|
|
34
34
|
color: theme.Input.placeholderColor,
|
|
35
|
-
fontSize: '
|
|
35
|
+
fontSize: '16px',
|
|
36
36
|
textTransform: placeholderTextTransform
|
|
37
37
|
};
|
|
38
38
|
return {
|
package/src/Form/TextArea.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["TextArea.tsx"],"names":["textAreaStyle","theme","markInvalid","placeholderTextTransform","disabled","placeholderStyle","color","Input","placeholderColor","fontSize","textTransform","opacity","boxShadow","COLOR","BLUE","GRAY","background","backgroundColorDisabled","backgroundColor","border","borderRadius","RED","caretColor","general","fontWeight","lineHeight","margin","outline","padding","resize","width","TEXTAREA_CLASSNAME","filterTextAreaProps","props","TextArea","React","forwardRef","ref"],"mappings":";;;;;;;;;;;;;AAoBA;;AAEA;;AAEA;;AAGA;;;;;;AAOO,IAAMA,aAAsE,GAAG,SAAzEA,aAAyE,CACpFC,KADoF,QAGjF;AAAA,8BADFC,WACE;AAAA,MADFA,WACE,iCADY,KACZ;AAAA,mCADmBC,wBACnB;AAAA,MADmBA,wBACnB,sCAD8C,MAC9C;AAAA,2BADsDC,QACtD;AAAA,MADsDA,QACtD,8BADiE,KACjE;AACH,MAAMC,gBAAgB,GAAG;AACvBC,IAAAA,KAAK,EAAEL,KAAK,CAACM,KAAN,CAAYC,gBADI;AAEvBC,IAAAA,QAAQ,EAAE,MAFa;AAGvBC,IAAAA,aAAa,EAAEP;AAHQ,GAAzB;AAMA,SAAO;AACL,2DACKE,gBADL;AAEEM,MAAAA,OAAO,EAAE;AAFX,MADK;AAKL,kDACKN,gBADL,CALK;AAQL,sDACKA,gBADL,CARK;AAWL,eAAW;AACTO,MAAAA,SAAS,sBAAeC,gBAAMC,IAArB;AADA,KAXN;AAcL,iBAAa,CAACZ,WAAD,GACT;AACEU,MAAAA,SAAS,sBAAeC,gBAAME,IAArB;AADX,KADS,GAIT,EAlBC;AAmBLC,IAAAA,UAAU,EAAEZ,QAAQ,GAAGH,KAAK,CAACM,KAAN,CAAYU,uBAAf,GAAyChB,KAAK,CAACM,KAAN,CAAYW,eAnBpE;AAoBLC,IAAAA,MAAM,EAAE,MApBH;AAqBLC,IAAAA,YAAY,EAAE,KArBT;AAsBLR,IAAAA,SAAS,EAAEV,WAAW,uBAAgBW,gBAAMQ,GAAtB,wBAA2CR,gBAAME,IAAjD,CAtBjB;AAuBLO,IAAAA,UAAU,EAAET,gBAAMC,IAvBb;AAwBLR,IAAAA,KAAK,EAAEL,KAAK,CAACsB,OAAN,CAAcjB,KAxBhB;AAyBLkB,IAAAA,UAAU,EAAE,GAzBP;AA0BLC,IAAAA,UAAU,EAAE,MA1BP;AA2BLC,IAAAA,MAAM,EAAE,UA3BH;AA4BLC,IAAAA,OAAO,EAAE,MA5BJ;AA6BLC,IAAAA,OAAO,EAAE,WA7BJ;AA8BLC,IAAAA,MAAM,EAAE,MA9BH;AA+BLC,IAAAA,KAAK,EAAE;AA/BF,GAAP;AAiCD,CA3CM;;;AA6CA,IAAMC,kBAAkB,GAAG,UAA3B;;;AACP,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAsB,CAACC,KAAD;AAAA,SAA0B,uBAAYA,KAAZ,EAAmB,CAAC,aAAD,EAAgB,0BAAhB,CAAnB,CAA1B;AAAA,CAA5B;;AAEO,IAAMC,QAAsD,gBAAGC,mBAAMC,UAAN,CAGpE,UAACH,KAAD,EAAQI,GAAR;AAAA,SACA;AACE,IAAA,SAAS,EAAEN,kBADb;AAEE,IAAA,GAAG,EAAE,aAAC9B,KAAD;AAAA,aAAkBD,aAAa,CAACC,KAAD,EAAQgC,KAAR,CAA/B;AAAA,KAFP;AAGE,IAAA,GAAG,EAAEI;AAHP,KAIML,mBAAmB,CAACC,KAAD,CAJzB,EADA;AAAA,CAHoE,CAA/D","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 type {Property} from 'csstype';\nimport React from 'react';\n\nimport {COLOR} from '../Identity';\nimport type {Theme} from '../Layout';\nimport type {TextProps} from '../Text';\nimport {filterProps} from '../util';\n\nexport interface TextAreaProps<T = HTMLTextAreaElement> extends TextProps<T> {\n markInvalid?: boolean;\n placeholderTextTransform?: Property.TextTransform;\n}\n\nexport const textAreaStyle: <T>(theme: Theme, props: TextAreaProps<T>) => CSSObject = (\n theme,\n {markInvalid = false, placeholderTextTransform = 'none', disabled = false},\n) => {\n const placeholderStyle = {\n color: theme.Input.placeholderColor,\n fontSize: '
|
|
1
|
+
{"version":3,"sources":["TextArea.tsx"],"names":["textAreaStyle","theme","markInvalid","placeholderTextTransform","disabled","placeholderStyle","color","Input","placeholderColor","fontSize","textTransform","opacity","boxShadow","COLOR","BLUE","GRAY","background","backgroundColorDisabled","backgroundColor","border","borderRadius","RED","caretColor","general","fontWeight","lineHeight","margin","outline","padding","resize","width","TEXTAREA_CLASSNAME","filterTextAreaProps","props","TextArea","React","forwardRef","ref"],"mappings":";;;;;;;;;;;;;AAoBA;;AAEA;;AAEA;;AAGA;;;;;;AAOO,IAAMA,aAAsE,GAAG,SAAzEA,aAAyE,CACpFC,KADoF,QAGjF;AAAA,8BADFC,WACE;AAAA,MADFA,WACE,iCADY,KACZ;AAAA,mCADmBC,wBACnB;AAAA,MADmBA,wBACnB,sCAD8C,MAC9C;AAAA,2BADsDC,QACtD;AAAA,MADsDA,QACtD,8BADiE,KACjE;AACH,MAAMC,gBAAgB,GAAG;AACvBC,IAAAA,KAAK,EAAEL,KAAK,CAACM,KAAN,CAAYC,gBADI;AAEvBC,IAAAA,QAAQ,EAAE,MAFa;AAGvBC,IAAAA,aAAa,EAAEP;AAHQ,GAAzB;AAMA,SAAO;AACL,2DACKE,gBADL;AAEEM,MAAA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D;AAAA,aAAkBD,aAAa,CAACC,KAAD,EAAQgC,KAAR,CAA/B;AAAA,KAFP;AAGE,IAAA,GAAG,EAAEI;AAHP,KAIML,mBAAmB,CAACC,KAAD,CAJzB,EADA;AAAA,CAHoE,CAA/D","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 type {Property} from 'csstype';\nimport React from 'react';\n\nimport {COLOR} from '../Identity';\nimport type {Theme} from '../Layout';\nimport type {TextProps} from '../Text';\nimport {filterProps} from '../util';\n\nexport interface TextAreaProps<T = HTMLTextAreaElement> extends TextProps<T> {\n markInvalid?: boolean;\n placeholderTextTransform?: Property.TextTransform;\n}\n\nexport const textAreaStyle: <T>(theme: Theme, props: TextAreaProps<T>) => CSSObject = (\n theme,\n {markInvalid = false, placeholderTextTransform = 'none', disabled = false},\n) => {\n const placeholderStyle = {\n color: theme.Input.placeholderColor,\n fontSize: '16px',\n textTransform: placeholderTextTransform,\n };\n\n return {\n '&::-moz-placeholder': {\n ...placeholderStyle,\n opacity: 1,\n },\n '&::-ms-input-placeholder': {\n ...placeholderStyle,\n },\n '&::-webkit-input-placeholder': {\n ...placeholderStyle,\n },\n '&:focus': {\n boxShadow: `0 0 0 1px ${COLOR.BLUE}`,\n },\n '&:invalid': !markInvalid\n ? {\n boxShadow: `0 0 0 1px ${COLOR.GRAY}`,\n }\n : {},\n background: disabled ? theme.Input.backgroundColorDisabled : theme.Input.backgroundColor,\n border: 'none',\n borderRadius: '4px',\n boxShadow: markInvalid ? `0 0 0 1px ${COLOR.RED}` : `0 0 0 1px ${COLOR.GRAY}`,\n caretColor: COLOR.BLUE,\n color: theme.general.color,\n fontWeight: 300,\n lineHeight: '24px',\n margin: '0 0 16px',\n outline: 'none',\n padding: '16px 16px',\n resize: 'none',\n width: '100%',\n };\n};\n\nexport const TEXTAREA_CLASSNAME = 'textarea';\nconst filterTextAreaProps = (props: TextAreaProps) => filterProps(props, ['markInvalid', 'placeholderTextTransform']);\n\nexport const TextArea: React.FC<TextAreaProps<HTMLTextAreaElement>> = React.forwardRef<\n HTMLTextAreaElement,\n TextAreaProps<HTMLTextAreaElement>\n>((props, ref) => (\n <textarea\n className={TEXTAREA_CLASSNAME}\n css={(theme: Theme) => textAreaStyle(theme, props)}\n ref={ref}\n {...filterTextAreaProps(props)}\n />\n));\n"],"file":"TextArea.js"}
|
package/src/Form/index.d.js
CHANGED
|
@@ -198,4 +198,17 @@ Object.keys(_Tooltip).forEach(function (key) {
|
|
|
198
198
|
}
|
|
199
199
|
});
|
|
200
200
|
});
|
|
201
|
+
|
|
202
|
+
var _InputLabel = require("./InputLabel");
|
|
203
|
+
|
|
204
|
+
Object.keys(_InputLabel).forEach(function (key) {
|
|
205
|
+
if (key === "default" || key === "__esModule") return;
|
|
206
|
+
if (key in exports && exports[key] === _InputLabel[key]) return;
|
|
207
|
+
Object.defineProperty(exports, key, {
|
|
208
|
+
enumerable: true,
|
|
209
|
+
get: function get() {
|
|
210
|
+
return _InputLabel[key];
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
});
|
|
201
214
|
//# sourceMappingURL=index.d.js.map
|
package/src/Form/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.d.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './Button';\nexport * from './ButtonLink';\nexport * from './Checkbox';\nexport * from './CodeInput';\nexport * from './ErrorMessage';\nexport * from './Form';\nexport * from './Input';\nexport * from './InputBlock';\nexport * from './InputSubmitCombo';\nexport * from './RoundIconButton';\nexport * from './Select';\nexport * from './ShakeBox';\nexport * from './Switch';\nexport * from './TextArea';\nexport * from './Tooltip';\n"],"file":"index.d.js"}
|
|
1
|
+
{"version":3,"sources":["index.d.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './Button';\nexport * from './ButtonLink';\nexport * from './Checkbox';\nexport * from './CodeInput';\nexport * from './ErrorMessage';\nexport * from './Form';\nexport * from './Input';\nexport * from './InputBlock';\nexport * from './InputSubmitCombo';\nexport * from './RoundIconButton';\nexport * from './Select';\nexport * from './ShakeBox';\nexport * from './Switch';\nexport * from './TextArea';\nexport * from './Tooltip';\nexport * from './InputLabel';\n"],"file":"index.d.js"}
|
package/src/Form/index.d.ts
CHANGED
package/src/Form/index.js
CHANGED
|
@@ -198,4 +198,17 @@ Object.keys(_Tooltip).forEach(function (key) {
|
|
|
198
198
|
}
|
|
199
199
|
});
|
|
200
200
|
});
|
|
201
|
+
|
|
202
|
+
var _InputLabel = require("./InputLabel");
|
|
203
|
+
|
|
204
|
+
Object.keys(_InputLabel).forEach(function (key) {
|
|
205
|
+
if (key === "default" || key === "__esModule") return;
|
|
206
|
+
if (key in exports && exports[key] === _InputLabel[key]) return;
|
|
207
|
+
Object.defineProperty(exports, key, {
|
|
208
|
+
enumerable: true,
|
|
209
|
+
get: function get() {
|
|
210
|
+
return _InputLabel[key];
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
});
|
|
201
214
|
//# sourceMappingURL=index.js.map
|
package/src/Form/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAmBA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","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\nexport * from './Button';\nexport * from './ButtonLink';\nexport * from './Checkbox';\nexport * from './CodeInput';\nexport * from './ErrorMessage';\nexport * from './Form';\nexport * from './Input';\nexport * from './InputBlock';\nexport * from './InputSubmitCombo';\nexport * from './RoundIconButton';\nexport * from './Select';\nexport * from './ShakeBox';\nexport * from './Switch';\nexport * from './TextArea';\nexport * from './Tooltip';\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAmBA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","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\nexport * from './Button';\nexport * from './ButtonLink';\nexport * from './Checkbox';\nexport * from './CodeInput';\nexport * from './ErrorMessage';\nexport * from './Form';\nexport * from './Input';\nexport * from './InputBlock';\nexport * from './InputSubmitCombo';\nexport * from './RoundIconButton';\nexport * from './Select';\nexport * from './ShakeBox';\nexport * from './Switch';\nexport * from './TextArea';\nexport * from './Tooltip';\nexport * from './InputLabel';\n"],"file":"index.js"}
|
package/src/Icon/HideIcon.js
CHANGED
|
@@ -36,7 +36,7 @@ var _SVGIcon = require("./SVGIcon");
|
|
|
36
36
|
var HideIcon = function HideIcon(props) {
|
|
37
37
|
return (0, _react.jsx)(_SVGIcon.SVGIcon, (0, _extends2["default"])({
|
|
38
38
|
realWidth: 16,
|
|
39
|
-
realHeight:
|
|
39
|
+
realHeight: 11
|
|
40
40
|
}, props), (0, _react.jsx)("path", {
|
|
41
41
|
d: "M8 2.667A3.334 3.334 0 0111.333 6c0 .433-.086.84-.24 1.22l1.947 1.947A7.88 7.88 0 0015.327 6c-1.154-2.927-4-5-7.334-5-.933 0-1.826.167-2.653.467l1.44 1.44c.38-.154.787-.24 1.22-.24zM1.333.847l1.52 1.52.307.306A7.867 7.867 0 00.667 6c1.153 2.927 4 5 7.333 5 1.033 0 2.02-.2 2.92-.56l.28.28 1.953 1.947.847-.847L2.18 0l-.847.847zM5.02 4.533l1.033 1.034C6.02 5.707 6 5.853 6 6c0 1.107.893 2 2 2 .147 0 .293-.02.433-.053L9.467 8.98c-.447.22-.94.353-1.467.353A3.334 3.334 0 014.667 6c0-.527.133-1.02.353-1.467zm2.873-.52l2.1 2.1.014-.106c0-1.107-.894-2-2-2l-.114.006z"
|
|
42
42
|
}));
|
package/src/Icon/HideIcon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["HideIcon.tsx"],"names":["HideIcon","props"],"mappings":";;;;;;;;;;;AAoBA;;AAEA;;AAtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AAKO,IAAMA,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD;AAAA,SACtB,gBAAC,gBAAD;AAAS,IAAA,SAAS,EAAE,EAApB;AAAwB,IAAA,UAAU,EAAE;AAApC,KAA4CA,KAA5C,GACE;AAAM,IAAA,CAAC,EAAC;AAAR,IADF,CADsB;AAAA,CAAjB","sourcesContent":["/*\n * Wire\n * Copyright (C) 2020 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 {jsx} from '@emotion/react';\n\nimport {SVGIcon, SVGIconProps} from './SVGIcon';\n\nexport const HideIcon = (props: SVGIconProps) => (\n <SVGIcon realWidth={16} realHeight={
|
|
1
|
+
{"version":3,"sources":["HideIcon.tsx"],"names":["HideIcon","props"],"mappings":";;;;;;;;;;;AAoBA;;AAEA;;AAtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AAKO,IAAMA,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD;AAAA,SACtB,gBAAC,gBAAD;AAAS,IAAA,SAAS,EAAE,EAApB;AAAwB,IAAA,UAAU,EAAE;AAApC,KAA4CA,KAA5C,GACE;AAAM,IAAA,CAAC,EAAC;AAAR,IADF,CADsB;AAAA,CAAjB","sourcesContent":["/*\n * Wire\n * Copyright (C) 2020 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 {jsx} from '@emotion/react';\n\nimport {SVGIcon, SVGIconProps} from './SVGIcon';\n\nexport const HideIcon = (props: SVGIconProps) => (\n <SVGIcon realWidth={16} realHeight={11} {...props}>\n <path d=\"M8 2.667A3.334 3.334 0 0111.333 6c0 .433-.086.84-.24 1.22l1.947 1.947A7.88 7.88 0 0015.327 6c-1.154-2.927-4-5-7.334-5-.933 0-1.826.167-2.653.467l1.44 1.44c.38-.154.787-.24 1.22-.24zM1.333.847l1.52 1.52.307.306A7.867 7.867 0 00.667 6c1.153 2.927 4 5 7.333 5 1.033 0 2.02-.2 2.92-.56l.28.28 1.953 1.947.847-.847L2.18 0l-.847.847zM5.02 4.533l1.033 1.034C6.02 5.707 6 5.853 6 6c0 1.107.893 2 2 2 .147 0 .293-.02.433-.053L9.467 8.98c-.447.22-.94.353-1.467.353A3.334 3.334 0 014.667 6c0-.527.133-1.02.353-1.467zm2.873-.52l2.1 2.1.014-.106c0-1.107-.894-2-2-2l-.114.006z\" />\n </SVGIcon>\n);\n"],"file":"HideIcon.js"}
|
package/src/Icon/ShowIcon.js
CHANGED
|
@@ -36,7 +36,7 @@ var _SVGIcon = require("./SVGIcon");
|
|
|
36
36
|
var ShowIcon = function ShowIcon(props) {
|
|
37
37
|
return (0, _react.jsx)(_SVGIcon.SVGIcon, (0, _extends2["default"])({
|
|
38
38
|
realWidth: 16,
|
|
39
|
-
realHeight:
|
|
39
|
+
realHeight: 10
|
|
40
40
|
}, props), (0, _react.jsx)("path", {
|
|
41
41
|
d: "M8 0C4.667 0 1.82 2.073.667 5c1.153 2.927 4 5 7.333 5s6.18-2.073 7.333-5c-1.153-2.927-4-5-7.333-5zm0 8.333a3.334 3.334 0 010-6.666 3.334 3.334 0 010 6.666zM8 3c-1.107 0-2 .893-2 2s.893 2 2 2 2-.893 2-2-.893-2-2-2z"
|
|
42
42
|
}));
|
package/src/Icon/ShowIcon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ShowIcon.tsx"],"names":["ShowIcon","props"],"mappings":";;;;;;;;;;;AAoBA;;AAEA;;AAtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AAKO,IAAMA,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD;AAAA,SACtB,gBAAC,gBAAD;AAAS,IAAA,SAAS,EAAE,EAApB;AAAwB,IAAA,UAAU,EAAE;AAApC,KAA4CA,KAA5C,GACE;AAAM,IAAA,CAAC,EAAC;AAAR,IADF,CADsB;AAAA,CAAjB","sourcesContent":["/*\n * Wire\n * Copyright (C) 2020 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 {jsx} from '@emotion/react';\n\nimport {SVGIcon, SVGIconProps} from './SVGIcon';\n\nexport const ShowIcon = (props: SVGIconProps) => (\n <SVGIcon realWidth={16} realHeight={
|
|
1
|
+
{"version":3,"sources":["ShowIcon.tsx"],"names":["ShowIcon","props"],"mappings":";;;;;;;;;;;AAoBA;;AAEA;;AAtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AAKO,IAAMA,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD;AAAA,SACtB,gBAAC,gBAAD;AAAS,IAAA,SAAS,EAAE,EAApB;AAAwB,IAAA,UAAU,EAAE;AAApC,KAA4CA,KAA5C,GACE;AAAM,IAAA,CAAC,EAAC;AAAR,IADF,CADsB;AAAA,CAAjB","sourcesContent":["/*\n * Wire\n * Copyright (C) 2020 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 {jsx} from '@emotion/react';\n\nimport {SVGIcon, SVGIconProps} from './SVGIcon';\n\nexport const ShowIcon = (props: SVGIconProps) => (\n <SVGIcon realWidth={16} realHeight={10} {...props}>\n <path d=\"M8 0C4.667 0 1.82 2.073.667 5c1.153 2.927 4 5 7.333 5s6.18-2.073 7.333-5c-1.153-2.927-4-5-7.333-5zm0 8.333a3.334 3.334 0 010-6.666 3.334 3.334 0 010 6.666zM8 3c-1.107 0-2 .893-2 2s.893 2 2 2 2-.893 2-2-.893-2-2-2z\" />\n </SVGIcon>\n);\n"],"file":"ShowIcon.js"}
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.COLOR_V2 = exports.BASE_DARK_COLOR = exports.BASE_LIGHT_COLOR = void 0;
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
@@ -212,10 +212,10 @@ var GRAYS = {
|
|
|
212
212
|
GRAY_100: '#17181a'
|
|
213
213
|
};
|
|
214
214
|
|
|
215
|
-
var
|
|
215
|
+
var COLOR_V2 = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, BASE_DARK_COLOR), BASE_LIGHT_COLOR), DARK), LIGHT), GRAYS), {}, {
|
|
216
216
|
BLACK: '#000',
|
|
217
217
|
WHITE: '#fff'
|
|
218
218
|
});
|
|
219
219
|
|
|
220
|
-
exports.
|
|
220
|
+
exports.COLOR_V2 = COLOR_V2;
|
|
221
221
|
//# sourceMappingURL=colors-v2.js.map
|