@wireapp/react-ui-kit 8.3.0 → 8.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,34 +2,77 @@ 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
+
7
+ const options = [
8
+ {value: '1', label: 'Option 1'},
9
+ {value: '2', label: 'Option 2'},
10
+ {value: '3', label: 'Option 3'},
11
+ {value: '4', label: 'Option 4'},
12
+ {value: '5', label: 'Option 5'},
13
+ {value: '6', label: 'Option 6'},
14
+ ];
6
15
 
7
16
  <Fragment>
8
17
  <Columns>
9
18
  <Column>Select</Column>
19
+
10
20
  <Column>
11
- <Select>
12
- <option>a</option>
13
- <option>b</option>
14
- <option>c</option>
15
- <option>d</option>
16
- </Select>
21
+ <Select
22
+ label="Select"
23
+ id="firstSelect"
24
+ options={options}
25
+ value={options[0]}
26
+ onChange={selectedOption => console.log('Selected option', selectedOption)}
27
+ dataUieName="select"
28
+ />
17
29
  </Column>
18
30
  </Columns>
31
+
19
32
  <Columns>
20
33
  <Column>Disabled Select</Column>
34
+
35
+ <Column>
36
+ <Select
37
+ disabled
38
+ label="Disabled select"
39
+ id="disabledSelect"
40
+ options={options}
41
+ onChange={selectedOption => console.log('Selected option', selectedOption)}
42
+ dataUieName="disabled-select"
43
+ />
44
+ </Column>
45
+ </Columns>
46
+
47
+ <Columns>
48
+ <Column>Required Select</Column>
49
+
21
50
  <Column>
22
- <Select disabled>
23
- <option>a</option>
24
- </Select>
51
+ <Select
52
+ label="Required select"
53
+ required
54
+ id="requiredSelect"
55
+ options={options}
56
+ onChange={selectedOption => console.log('Selected option', selectedOption)}
57
+ dataUieName="required-select"
58
+ />
25
59
  </Column>
26
60
  </Columns>
61
+
27
62
  <Columns>
28
63
  <Column>Invalid Select</Column>
64
+
29
65
  <Column>
30
- <Select markInvalid>
31
- <option>a</option>
32
- </Select>
66
+ <Select
67
+ markInvalid
68
+ label="InputLabel"
69
+ id="invalidSelect"
70
+ required
71
+ error={<ErrorMessage>Error message</ErrorMessage>}
72
+ options={options}
73
+ onChange={selectedOption => console.log('Selected option', selectedOption)}
74
+ dataUieName="invalid-select"
75
+ />
33
76
  </Column>
34
77
  </Columns>
35
78
  </Fragment>;
@@ -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
@@ -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"}
@@ -13,3 +13,4 @@ export * from './ShakeBox';
13
13
  export * from './Switch';
14
14
  export * from './TextArea';
15
15
  export * from './Tooltip';
16
+ export * from './InputLabel';
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
@@ -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"}
@@ -17,6 +17,8 @@ var _react2 = _interopRequireDefault(require("react"));
17
17
 
18
18
  var _colors = require("../Identity/colors");
19
19
 
20
+ var _colorsV = require("../Identity/colors-v2");
21
+
20
22
  var _util = require("../util");
21
23
 
22
24
  var _themes;
@@ -32,7 +34,7 @@ exports.THEME_ID = THEME_ID;
32
34
  var themes = (_themes = {}, (0, _defineProperty2["default"])(_themes, THEME_ID.LIGHT, {
33
35
  Input: {
34
36
  backgroundColor: _colors.COLOR.WHITE,
35
- backgroundColorDisabled: _colors.COLOR.DISABLED,
37
+ backgroundColorDisabled: _colorsV.COLOR_V2.GRAY_20,
36
38
  placeholderColor: _colors.COLOR.GRAY_DARKEN_24
37
39
  },
38
40
  general: {
@@ -1 +1 @@
1
- {"version":3,"sources":["Theme.tsx"],"names":["THEME_ID","themes","LIGHT","Input","backgroundColor","COLOR","WHITE","backgroundColorDisabled","DISABLED","placeholderColor","GRAY_DARKEN_24","general","GRAY_LIGHTEN_88","color","TEXT","DARK","BLACK_LIGHTEN_24","BLACK","filterThemeProps","props","ThemeProvider","themeId"],"mappings":";;;;;;;;;;;;;AAoBA;;AACA;;AAEA;;AACA;;;;IAEYA,Q;;;WAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;GAAAA,Q,wBAAAA,Q;;AAiBL,IAAMC,MAAsC,4DAChDD,QAAQ,CAACE,KADuC,EAC/B;AAChBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,eAAe,EAAEC,cAAMC,KADlB;AAELC,IAAAA,uBAAuB,EAAEF,cAAMG,QAF1B;AAGLC,IAAAA,gBAAgB,EAAEJ,cAAMK;AAHnB,GADS;AAMhBC,EAAAA,OAAO,EAAE;AACPP,IAAAA,eAAe,EAAEC,cAAMO,eADhB;AAEPC,IAAAA,KAAK,EAAER,cAAMS;AAFN;AANO,CAD+B,6CAYhDd,QAAQ,CAACe,IAZuC,EAYhC;AACfZ,EAAAA,KAAK,EAAE;AACLC,IAAAA,eAAe,EAAEC,cAAMW,gBADlB;AAELT,IAAAA,uBAAuB,EAAEF,cAAMG,QAF1B;AAGLC,IAAAA,gBAAgB,EAAEJ,cAAMO;AAHnB,GADQ;AAMfD,EAAAA,OAAO,EAAE;AACPP,IAAAA,eAAe,EAAEC,cAAMY,KADhB;AAEPJ,IAAAA,KAAK,EAAER,cAAMC;AAFN;AANM,CAZgC,WAA5C;;;AA6BP,IAAMY,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD;AAAA,SAAuB,uBAAYA,KAAZ,EAAmB,CAAC,SAAD,CAAnB,CAAvB;AAAA,CAAzB;;AAEO,IAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAACD,KAAD;AAAA,SAC3B,gBAAC,oBAAD;AAAsB,IAAA,KAAK,EAAElB,MAAM,CAACkB,KAAK,CAACE,OAAP;AAAnC,KAAwDH,gBAAgB,CAACC,KAAD,CAAxE,EAD2B;AAAA,CAAtB","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 {jsx, ThemeProvider as EmotionThemeProvider} from '@emotion/react';\nimport React from 'react';\n\nimport {COLOR} from '../Identity/colors';\nimport {filterProps} from '../util';\n\nexport enum THEME_ID {\n DARK = 'THEME_DARK',\n LIGHT = 'THEME_LIGHT',\n}\n\nexport interface Theme {\n general: {\n backgroundColor: string;\n color: string;\n };\n Input: {\n backgroundColor: string;\n backgroundColorDisabled: string;\n placeholderColor: string;\n };\n}\n\nexport const themes: {[themeId in THEME_ID]: Theme} = {\n [THEME_ID.LIGHT]: {\n Input: {\n backgroundColor: COLOR.WHITE,\n backgroundColorDisabled: COLOR.DISABLED,\n placeholderColor: COLOR.GRAY_DARKEN_24,\n },\n general: {\n backgroundColor: COLOR.GRAY_LIGHTEN_88,\n color: COLOR.TEXT,\n },\n },\n [THEME_ID.DARK]: {\n Input: {\n backgroundColor: COLOR.BLACK_LIGHTEN_24,\n backgroundColorDisabled: COLOR.DISABLED,\n placeholderColor: COLOR.GRAY_LIGHTEN_88,\n },\n general: {\n backgroundColor: COLOR.BLACK,\n color: COLOR.WHITE,\n },\n },\n};\n\nexport interface ThemeProps<T = HTMLDivElement> extends React.HTMLProps<T> {\n themeId: THEME_ID;\n}\n\nconst filterThemeProps = (props: ThemeProps) => filterProps(props, ['themeId']);\n\nexport const ThemeProvider = (props: ThemeProps) => (\n <EmotionThemeProvider theme={themes[props.themeId]} {...filterThemeProps(props)} />\n);\n"],"file":"Theme.js"}
1
+ {"version":3,"sources":["Theme.tsx"],"names":["THEME_ID","themes","LIGHT","Input","backgroundColor","COLOR","WHITE","backgroundColorDisabled","COLOR_V2","GRAY_20","placeholderColor","GRAY_DARKEN_24","general","GRAY_LIGHTEN_88","color","TEXT","DARK","BLACK_LIGHTEN_24","DISABLED","BLACK","filterThemeProps","props","ThemeProvider","themeId"],"mappings":";;;;;;;;;;;;;AAoBA;;AACA;;AAEA;;AACA;;AACA;;;;IAEYA,Q;;;WAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;GAAAA,Q,wBAAAA,Q;;AAiBL,IAAMC,MAAsC,4DAChDD,QAAQ,CAACE,KADuC,EAC/B;AAChBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,eAAe,EAAEC,cAAMC,KADlB;AAELC,IAAAA,uBAAuB,EAAEC,kBAASC,OAF7B;AAGLC,IAAAA,gBAAgB,EAAEL,cAAMM;AAHnB,GADS;AAMhBC,EAAAA,OAAO,EAAE;AACPR,IAAAA,eAAe,EAAEC,cAAMQ,eADhB;AAEPC,IAAAA,KAAK,EAAET,cAAMU;AAFN;AANO,CAD+B,6CAYhDf,QAAQ,CAACgB,IAZuC,EAYhC;AACfb,EAAAA,KAAK,EAAE;AACLC,IAAAA,eAAe,EAAEC,cAAMY,gBADlB;AAELV,IAAAA,uBAAuB,EAAEF,cAAMa,QAF1B;AAGLR,IAAAA,gBAAgB,EAAEL,cAAMQ;AAHnB,GADQ;AAMfD,EAAAA,OAAO,EAAE;AACPR,IAAAA,eAAe,EAAEC,cAAMc,KADhB;AAEPL,IAAAA,KAAK,EAAET,cAAMC;AAFN;AANM,CAZgC,WAA5C;;;AA6BP,IAAMc,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD;AAAA,SAAuB,uBAAYA,KAAZ,EAAmB,CAAC,SAAD,CAAnB,CAAvB;AAAA,CAAzB;;AAEO,IAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAACD,KAAD;AAAA,SAC3B,gBAAC,oBAAD;AAAsB,IAAA,KAAK,EAAEpB,MAAM,CAACoB,KAAK,CAACE,OAAP;AAAnC,KAAwDH,gBAAgB,CAACC,KAAD,CAAxE,EAD2B;AAAA,CAAtB","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 {jsx, ThemeProvider as EmotionThemeProvider} from '@emotion/react';\nimport React from 'react';\n\nimport {COLOR} from '../Identity/colors';\nimport {COLOR_V2} from '../Identity/colors-v2';\nimport {filterProps} from '../util';\n\nexport enum THEME_ID {\n DARK = 'THEME_DARK',\n LIGHT = 'THEME_LIGHT',\n}\n\nexport interface Theme {\n general: {\n backgroundColor: string;\n color: string;\n };\n Input: {\n backgroundColor: string;\n backgroundColorDisabled: string;\n placeholderColor: string;\n };\n}\n\nexport const themes: {[themeId in THEME_ID]: Theme} = {\n [THEME_ID.LIGHT]: {\n Input: {\n backgroundColor: COLOR.WHITE,\n backgroundColorDisabled: COLOR_V2.GRAY_20,\n placeholderColor: COLOR.GRAY_DARKEN_24,\n },\n general: {\n backgroundColor: COLOR.GRAY_LIGHTEN_88,\n color: COLOR.TEXT,\n },\n },\n [THEME_ID.DARK]: {\n Input: {\n backgroundColor: COLOR.BLACK_LIGHTEN_24,\n backgroundColorDisabled: COLOR.DISABLED,\n placeholderColor: COLOR.GRAY_LIGHTEN_88,\n },\n general: {\n backgroundColor: COLOR.BLACK,\n color: COLOR.WHITE,\n },\n },\n};\n\nexport interface ThemeProps<T = HTMLDivElement> extends React.HTMLProps<T> {\n themeId: THEME_ID;\n}\n\nconst filterThemeProps = (props: ThemeProps) => filterProps(props, ['themeId']);\n\nexport const ThemeProvider = (props: ThemeProps) => (\n <EmotionThemeProvider theme={themes[props.themeId]} {...filterThemeProps(props)} />\n);\n"],"file":"Theme.js"}
package/src/Text/Label.md CHANGED
@@ -4,7 +4,7 @@ Demo:
4
4
  import React from 'react';
5
5
  import {
6
6
  Container,
7
- Label,
7
+ InputLabel,
8
8
  LabelLink,
9
9
  InputSubmitCombo,
10
10
  RoundIconButton,
@@ -16,48 +16,48 @@ import {
16
16
  } from '@wireapp/react-ui-kit';
17
17
 
18
18
  <Container>
19
- <Label>Label</Label>
19
+ <InputLabel>InputLabel</InputLabel>
20
20
  <LabelLink block>LabelLink</LabelLink>
21
21
 
22
22
  <Line />
23
- <Label>
23
+ <InputLabel>
24
24
  <div style={{marginLeft: '16px'}}>{"I'm a label!"}</div>
25
25
  <Input placeholder="Focus me!" />
26
- </Label>
27
- <Label markInvalid>
26
+ </InputLabel>
27
+ <InputLabel markInvalid>
28
28
  <div style={{marginLeft: '16px'}}>{'Uh error!'}</div>
29
29
  <Input placeholder="Error" markInvalid />
30
- </Label>
30
+ </InputLabel>
31
31
 
32
- <Label>
32
+ <InputLabel>
33
33
  <div style={{marginLeft: '16px'}}>{'TextArea!'}</div>
34
34
  <TextArea placeholder="Text" />
35
- </Label>
35
+ </InputLabel>
36
36
 
37
- <Label markInvalid>
37
+ <InputLabel markInvalid>
38
38
  <div style={{marginLeft: '16px'}}>{'Uh error!'}</div>
39
39
  <TextArea placeholder="Text" markInvalid />
40
- </Label>
40
+ </InputLabel>
41
41
 
42
- <Label>
42
+ <InputLabel>
43
43
  <div style={{marginLeft: '16px'}}>{'Select!'}</div>
44
44
  <Select>
45
45
  <option>a</option>
46
46
  <option>b</option>
47
47
  <option>c</option>
48
48
  </Select>
49
- </Label>
49
+ </InputLabel>
50
50
 
51
- <Label markInvalid>
51
+ <InputLabel markInvalid>
52
52
  <div style={{marginLeft: '16px'}}>{'Uh error!'}</div>
53
53
  <Select markInvalid>
54
54
  <option>a</option>
55
55
  <option>b</option>
56
56
  <option>c</option>
57
57
  </Select>
58
- </Label>
58
+ </InputLabel>
59
59
 
60
- <Label>
60
+ <InputLabel>
61
61
  <div style={{marginLeft: '16px'}}>{'SubmitCombo label'}</div>
62
62
  <InputSubmitCombo>
63
63
  <Input placeholder="Input submit Combo" name="password" />
@@ -65,9 +65,9 @@ import {
65
65
  <ArrowIcon />
66
66
  </RoundIconButton>
67
67
  </InputSubmitCombo>
68
- </Label>
68
+ </InputLabel>
69
69
 
70
- <Label markInvalid>
70
+ <InputLabel markInvalid>
71
71
  <div style={{marginLeft: '16px'}}>{'SubmitCombo label'}</div>
72
72
  <InputSubmitCombo markInvalid>
73
73
  <Input placeholder="Input submit Combo" name="password" />
@@ -75,6 +75,6 @@ import {
75
75
  <ArrowIcon />
76
76
  </RoundIconButton>
77
77
  </InputSubmitCombo>
78
- </Label>
78
+ </InputLabel>
79
79
  </Container>;
80
80
  ```