@wireapp/react-ui-kit 8.0.1 → 8.3.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/package.json +4 -4
  3. package/src/Form/Button.d.js +4 -0
  4. package/src/Form/Button.d.ts +8 -0
  5. package/src/Form/Button.js +83 -20
  6. package/src/Form/Button.js.map +1 -1
  7. package/src/Form/Button.md +61 -2
  8. package/src/Form/Checkbox.js +44 -22
  9. package/src/Form/Checkbox.js.map +1 -1
  10. package/src/Form/ErrorMessage.js +18 -12
  11. package/src/Form/ErrorMessage.js.map +1 -1
  12. package/src/Form/Form.md +23 -0
  13. package/src/Form/Input.d.ts +7 -2
  14. package/src/Form/Input.js +109 -16
  15. package/src/Form/Input.js.map +1 -1
  16. package/src/Form/InputBlock.js +7 -3
  17. package/src/Form/InputBlock.js.map +1 -1
  18. package/src/Form/InputSubmitCombo.js +5 -4
  19. package/src/Form/InputSubmitCombo.js.map +1 -1
  20. package/src/Form/TextArea.js +1 -1
  21. package/src/Form/TextArea.js.map +1 -1
  22. package/src/Icon/HideIcon.js +1 -1
  23. package/src/Icon/HideIcon.js.map +1 -1
  24. package/src/Icon/ShowIcon.js +1 -1
  25. package/src/Icon/ShowIcon.js.map +1 -1
  26. package/src/Identity/colors-v2.d.js +2 -0
  27. package/src/Identity/colors-v2.d.js.map +1 -0
  28. package/src/Identity/colors-v2.d.ts +3 -0
  29. package/src/Identity/colors-v2.js +221 -0
  30. package/src/Identity/colors-v2.js.map +1 -0
  31. package/src/Identity/colors-v2.md +111 -0
  32. package/src/Identity/index.d.js +13 -0
  33. package/src/Identity/index.d.js.map +1 -1
  34. package/src/Identity/index.d.ts +1 -0
  35. package/src/Identity/index.js +13 -0
  36. package/src/Identity/index.js.map +1 -1
  37. package/src/Layout/headerMenu/MenuOpenButton.js +3 -3
  38. package/src/Layout/headerMenu/MenuOpenButton.js.map +1 -1
  39. package/src/Layout/headerMenu/MenuSubLink.js +1 -1
  40. package/src/Layout/headerMenu/MenuSubLink.js.map +1 -1
  41. package/src/Misc/ButtonGroup.d.js +2 -0
  42. package/src/Misc/ButtonGroup.d.js.map +1 -0
  43. package/src/Misc/ButtonGroup.d.ts +14 -0
  44. package/src/Misc/ButtonGroup.js +113 -0
  45. package/src/Misc/ButtonGroup.js.map +1 -0
  46. package/src/Misc/ButtonGroup.md +27 -0
  47. package/src/Misc/IconButton.d.js +6 -0
  48. package/src/Misc/IconButton.d.js.map +1 -0
  49. package/src/Misc/IconButton.d.ts +15 -0
  50. package/src/Misc/IconButton.js +122 -0
  51. package/src/Misc/IconButton.js.map +1 -0
  52. package/src/Misc/IconButton.md +43 -0
  53. package/src/Misc/childrenWithDefaultProps.d.ts +1 -1
  54. package/src/Misc/index.d.js +26 -0
  55. package/src/Misc/index.d.js.map +1 -1
  56. package/src/Misc/index.d.ts +2 -0
  57. package/src/Misc/index.js +26 -0
  58. package/src/Misc/index.js.map +1 -1
  59. package/src/Text/TextLink.js +2 -2
  60. package/src/Text/TextLink.js.map +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["ButtonGroup.tsx"],"names":["buttonGroupStyle","display","alignItems","buttonStyle","theme","disabled","height","borderRadius","padding","background","COLOR_V2","WHITE","border","GRAY_40","cursor","backgroundColor","GRAY_20","svg","fill","GRAY_70","BLACK","borderTopRightRadius","borderBottomRightRadius","borderTopLeftRadius","borderBottomLeftRadius","borderColor","GRAY_50","GRAY_60","BLUE_LIGHT_50","BLUE_LIGHT_300","BLUE","ButtonGroup","children","Button","icon","props","marginLeft","fontSize","fontWeight","lineHeight","letterSpacing"],"mappings":";;;;;;;;;;;AAoBA;;;;;;AAGA;;;;;;;;AAIA,IAAMA,gBAAgD,GAAG,SAAnDA,gBAAmD;AAAA,SAAO;AAC9DC,IAAAA,OAAO,EAAE,MADqD;AAE9DC,IAAAA,UAAU,EAAE;AAFkD,GAAP;AAAA,CAAzD;;AAKA,IAAMC,WAAsE,GAAG,SAAzEA,WAAyE,CAACC,KAAD;AAAA,2BAASC,QAAT;AAAA,MAASA,QAAT,8BAAoB,KAApB;AAAA;AAC7EC,IAAAA,MAAM,EAAE,MADqE;AAE7EC,IAAAA,YAAY,EAAE,MAF+D;AAG7EC,IAAAA,OAAO,EAAE,QAHoE;AAI7EC,IAAAA,UAAU,EAAEC,mBAASC,KAJwD;AAK7EC,IAAAA,MAAM,sBAAeF,mBAASG,OAAxB,CALuE;AAM7EC,IAAAA,MAAM,EAAE,SANqE;AAO7Eb,IAAAA,OAAO,EAAE,MAPoE;AAQ7EC,IAAAA,UAAU,EAAE,QARiE;AAS7Ea,IAAAA,eAAe,EAAEV,QAAQ,GAAGK,mBAASM,OAAZ,GAAsBN,mBAASC,KATqB;AAU7EM,IAAAA,GAAG,EAAE;AACHC,MAAAA,IAAI,EAAEb,QAAQ,GAAGK,mBAASS,OAAZ,GAAsBT,mBAASU;AAD1C,KAVwE;AAa7E,0BAAsB;AACpBC,MAAAA,oBAAoB,EAAE,GADF;AAEpBC,MAAAA,uBAAuB,EAAE;AAFL,KAbuD;AAiB7E,2BAAuB;AACrBC,MAAAA,mBAAmB,EAAE,GADA;AAErBC,MAAAA,sBAAsB,EAAE;AAFH,KAjBsD;AAqB7E,gCAA4B;AAC1BjB,MAAAA,YAAY,EAAE;AADY;AArBiD,KAwBzE,CAACF,QAAD,IAAa;AACf,wBAAoB;AAClBU,MAAAA,eAAe,EAAEL,mBAASM;AADR,KADL;AAIf,eAAW;AACTS,MAAAA,WAAW,EAAEf,mBAASgB;AADb,KAJI;AAOf,eAAW;AACTD,MAAAA,WAAW,EAAEf,mBAASiB;AADb,KAPI;AAUf,gBAAY;AACVZ,MAAAA,eAAe,EAAEL,mBAASkB,aADhB;AAEVH,MAAAA,WAAW,EAAEf,mBAASmB,cAFZ;AAGVZ,MAAAA,GAAG,EAAE;AACHC,QAAAA,IAAI,EAAER,mBAASoB;AADZ;AAHK;AAVG,GAxB4D;AAAA,CAA/E;;AAiDA,IAAMC,WAAW,GAAG,SAAdA,WAAc;AAAA,MAAEC,QAAF,SAAEA,QAAF;AAAA,SAClB;AAAK,IAAA,GAAG,EAAE,aAAC5B,KAAD;AAAA,aAAkBJ,gBAAgB,CAACI,KAAD,CAAlC;AAAA,KAAV;AAAqD,IAAA,IAAI,EAAC,OAA1D;AAAkE,kBAAW;AAA7E,KACG4B,QADH,CADkB;AAAA,CAApB;;;;AAMA,IAAMC,MAAM,GAAG,SAATA,MAAS,QAAkD;AAAA,MAAhDD,QAAgD,SAAhDA,QAAgD;AAAA,MAAtCE,IAAsC,SAAtCA,IAAsC;AAAA,MAA7BC,KAA6B;AAC/D,SACE;AAAQ,IAAA,GAAG,EAAE,aAAC/B,KAAD;AAAA,aAAkBD,WAAW,CAACC,KAAD,EAAQ+B,KAAR,CAA7B;AAAA;AAAb,KAA8DA,KAA9D,GACGD,IADH,EAEGF,QAAQ,IACP;AACE,IAAA,GAAG,+BAAE;AACHI,MAAAA,UAAU,EAAE,CAAC,CAACF,IAAF,IAAU,KADnB;AAEHG,MAAAA,QAAQ,EAAE,MAFP;AAGHC,MAAAA,UAAU,EAAE,MAHT;AAIHC,MAAAA,UAAU,EAAE,MAJT;AAKHC,MAAAA,aAAa,EAAE;AALZ,KAAF;AADL,KASGR,QATH,CAHJ,CADF;AAkBD,CAnBD;;AAqBAD,WAAW,CAACE,MAAZ,GAAqBA,MAArB","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 {CSSObject, jsx} from '@emotion/react';\nimport {ReactElement} from 'react';\n\nimport {COLOR_V2} from '../Identity';\nimport type {Theme} from '../Layout';\nimport {IconButtonProps} from './IconButton';\n\nconst buttonGroupStyle: <T>(theme: Theme) => CSSObject = () => ({\n display: 'flex',\n alignItems: 'center',\n});\n\nconst buttonStyle: <T>(theme: Theme, props: IconButtonProps<T>) => CSSObject = (theme, {disabled = false}) => ({\n height: '32px',\n borderRadius: '12px',\n padding: '0 12px',\n background: COLOR_V2.WHITE,\n border: `1px solid ${COLOR_V2.GRAY_40}`,\n cursor: 'pointer',\n display: 'flex',\n alignItems: 'center',\n backgroundColor: disabled ? COLOR_V2.GRAY_20 : COLOR_V2.WHITE,\n svg: {\n fill: disabled ? COLOR_V2.GRAY_70 : COLOR_V2.BLACK,\n },\n '&:not(:last-child)': {\n borderTopRightRadius: '0',\n borderBottomRightRadius: '0',\n },\n '&:not(:first-child)': {\n borderTopLeftRadius: '0',\n borderBottomLeftRadius: '0',\n },\n '&:first-child:last-child': {\n borderRadius: '0',\n },\n ...(!disabled && {\n '&:hover, &:focus': {\n backgroundColor: COLOR_V2.GRAY_20,\n },\n '&:hover': {\n borderColor: COLOR_V2.GRAY_50,\n },\n '&:focus': {\n borderColor: COLOR_V2.GRAY_60,\n },\n '&:active': {\n backgroundColor: COLOR_V2.BLUE_LIGHT_50,\n borderColor: COLOR_V2.BLUE_LIGHT_300,\n svg: {\n fill: COLOR_V2.BLUE,\n },\n },\n }),\n});\n\ninterface GroupButtonProps<T = HTMLButtonElement> {\n children?: ReactElement | string;\n icon?: ReactElement;\n}\n\nconst ButtonGroup = ({children}) => (\n <div css={(theme: Theme) => buttonGroupStyle(theme)} role=\"group\" aria-label=\"Button Group\">\n {children}\n </div>\n);\n\nconst Button = ({children, icon, ...props}: GroupButtonProps) => {\n return (\n <button css={(theme: Theme) => buttonStyle(theme, props)} {...props}>\n {icon}\n {children && (\n <span\n css={{\n marginLeft: !!icon && '6px',\n fontSize: '12px',\n fontWeight: 'bold',\n lineHeight: '14px',\n letterSpacing: '0.25px',\n }}\n >\n {children}\n </span>\n )}\n </button>\n );\n};\n\nButtonGroup.Button = Button;\n\nexport {ButtonGroup};\n"],"file":"ButtonGroup.js"}
@@ -0,0 +1,27 @@
1
+ Demo:
2
+
3
+ ```js
4
+ import {Button, Container, Columns, Column, H2, PlusIcon} from '@wireapp/react-ui-kit';
5
+
6
+ <Container>
7
+ <H2>Button Group</H2>
8
+
9
+ <div style={{marginBottom: '20px'}}>
10
+ <ButtonGroup>
11
+ <ButtonGroup.Button icon={<PlusIcon height={12} width={12} />} />
12
+
13
+ <ButtonGroup.Button icon={<PlusIcon height={12} width={12} />}>Button</ButtonGroup.Button>
14
+
15
+ <ButtonGroup.Button>Text only</ButtonGroup.Button>
16
+ </ButtonGroup>
17
+ </div>
18
+
19
+ <ButtonGroup>
20
+ <ButtonGroup.Button>Text only</ButtonGroup.Button>
21
+ </ButtonGroup>
22
+
23
+ <ButtonGroup>
24
+ <ButtonGroup.Button icon={<PlusIcon height={12} width={12} />} disabled />
25
+ </ButtonGroup>
26
+ </Container>;
27
+ ```
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=IconButton.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"IconButton.d.js"}
@@ -0,0 +1,15 @@
1
+ /** @jsx jsx */
2
+ import { CSSObject, jsx } from '@emotion/react';
3
+ import type { Theme } from '../Layout';
4
+ import { TextProps } from '../Text';
5
+ declare enum IconButtonVariant {
6
+ PRIMARY = "primary",
7
+ SECONDARY = "secondary"
8
+ }
9
+ export interface IconButtonProps<T = HTMLButtonElement> extends TextProps<T> {
10
+ variant?: IconButtonVariant;
11
+ backgroundColor?: string;
12
+ }
13
+ export declare const iconButtonStyle: <T>(theme: Theme, props: IconButtonProps<T>) => CSSObject;
14
+ export declare const IconButton: ({ children, ...props }: IconButtonProps) => jsx.JSX.Element;
15
+ export {};
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.IconButton = exports.iconButtonStyle = void 0;
9
+
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+
12
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
+
14
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
+
16
+ var _react = require("@emotion/react");
17
+
18
+ var _Identity = require("../Identity");
19
+
20
+ var _motions = require("../Identity/motions");
21
+
22
+ var _Text = require("../Text");
23
+
24
+ var _util = require("../util");
25
+
26
+ var _excluded = ["children"];
27
+
28
+ 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; }
29
+
30
+ 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; }
31
+
32
+ var IconButtonVariant;
33
+
34
+ (function (IconButtonVariant) {
35
+ IconButtonVariant["PRIMARY"] = "primary";
36
+ IconButtonVariant["SECONDARY"] = "secondary";
37
+ })(IconButtonVariant || (IconButtonVariant = {}));
38
+
39
+ var iconButtonStyle = function iconButtonStyle(theme, _ref) {
40
+ var _ref$variant = _ref.variant,
41
+ variant = _ref$variant === void 0 ? IconButtonVariant.PRIMARY : _ref$variant,
42
+ backgroundColor = _ref.backgroundColor,
43
+ _ref$disabled = _ref.disabled,
44
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled;
45
+ return _objectSpread(_objectSpread({
46
+ border: 0,
47
+ borderRadius: '12px',
48
+ cursor: disabled ? 'default' : 'pointer',
49
+ display: 'flex',
50
+ alignItems: 'center',
51
+ justifyContent: 'center',
52
+ marginBottom: '16px',
53
+ padding: 0,
54
+ outline: 'none',
55
+ textDecoration: 'none',
56
+ touchAction: 'manipulation',
57
+ transition: _motions.defaultTransition,
58
+ width: '40px',
59
+ height: '32px',
60
+ '&:hover, &:focus': {
61
+ textDecoration: 'none'
62
+ }
63
+ }, variant === IconButtonVariant.PRIMARY && _objectSpread({
64
+ backgroundColor: disabled ? _Identity.COLOR_V2.GRAY_20 : backgroundColor || _Identity.COLOR_V2.WHITE,
65
+ border: "1px solid ".concat(_Identity.COLOR_V2.GRAY_40),
66
+ svg: {
67
+ fill: disabled ? _Identity.COLOR_V2.GRAY_70 : _Identity.COLOR_V2.BLACK
68
+ }
69
+ }, !disabled && {
70
+ '&:hover, &:focus': {
71
+ backgroundColor: _Identity.COLOR_V2.GRAY_20
72
+ },
73
+ '&:hover': {
74
+ borderColor: _Identity.COLOR_V2.GRAY_50
75
+ },
76
+ '&:focus': {
77
+ borderColor: _Identity.COLOR_V2.GRAY_60
78
+ },
79
+ '&:active': {
80
+ backgroundColor: _Identity.COLOR_V2.BLUE_LIGHT_50,
81
+ borderColor: _Identity.COLOR_V2.BLUE_LIGHT_300,
82
+ svg: {
83
+ fill: _Identity.COLOR_V2.BLUE
84
+ }
85
+ }
86
+ })), variant === IconButtonVariant.SECONDARY && _objectSpread({
87
+ svg: {
88
+ fill: disabled ? _Identity.COLOR_V2.GRAY_60 : _Identity.COLOR_V2.BLACK
89
+ }
90
+ }, !disabled && {
91
+ '&:hover, &:focus, &:active': {
92
+ svg: {
93
+ fill: _Identity.COLOR_V2.BLUE
94
+ }
95
+ },
96
+ '&:focus': {
97
+ border: "1px solid ".concat(_Identity.COLOR_V2.BLUE_LIGHT_300)
98
+ },
99
+ '&:active': {
100
+ backgroundColor: _Identity.COLOR_V2.GRAY_10
101
+ }
102
+ }));
103
+ };
104
+
105
+ exports.iconButtonStyle = iconButtonStyle;
106
+
107
+ var IconButton = function IconButton(_ref2) {
108
+ var children = _ref2.children,
109
+ props = (0, _objectWithoutProperties2["default"])(_ref2, _excluded);
110
+ return (0, _react.jsx)("button", (0, _extends2["default"])({
111
+ css: function css(theme) {
112
+ return iconButtonStyle(theme, props);
113
+ }
114
+ }, filterButtonProps(props)), children);
115
+ };
116
+
117
+ exports.IconButton = IconButton;
118
+
119
+ var filterButtonProps = function filterButtonProps(props) {
120
+ return (0, _util.filterProps)((0, _Text.filterTextProps)(props), ['backgroundColor']);
121
+ };
122
+ //# sourceMappingURL=IconButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["IconButton.tsx"],"names":["IconButtonVariant","iconButtonStyle","theme","variant","PRIMARY","backgroundColor","disabled","border","borderRadius","cursor","display","alignItems","justifyContent","marginBottom","padding","outline","textDecoration","touchAction","transition","defaultTransition","width","height","COLOR_V2","GRAY_20","WHITE","GRAY_40","svg","fill","GRAY_70","BLACK","borderColor","GRAY_50","GRAY_60","BLUE_LIGHT_50","BLUE_LIGHT_300","BLUE","SECONDARY","GRAY_10","IconButton","children","props","filterButtonProps"],"mappings":"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","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 {CSSObject, jsx} from '@emotion/react';\n\nimport {COLOR_V2} from '../Identity';\nimport {defaultTransition} from '../Identity/motions';\nimport type {Theme} from '../Layout';\nimport {TextProps, filterTextProps} from '../Text';\nimport {filterProps} from '../util';\n\nenum IconButtonVariant {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n}\n\nexport interface IconButtonProps<T = HTMLButtonElement> extends TextProps<T> {\n variant?: IconButtonVariant;\n backgroundColor?: string;\n}\n\nexport const iconButtonStyle: <T>(theme: Theme, props: IconButtonProps<T>) => CSSObject = (\n theme,\n {variant = IconButtonVariant.PRIMARY, backgroundColor, disabled = false},\n) => ({\n border: 0,\n borderRadius: '12px',\n cursor: disabled ? 'default' : 'pointer',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n marginBottom: '16px',\n padding: 0,\n outline: 'none',\n textDecoration: 'none',\n touchAction: 'manipulation',\n transition: defaultTransition,\n width: '40px',\n height: '32px',\n '&:hover, &:focus': {\n textDecoration: 'none',\n },\n ...(variant === IconButtonVariant.PRIMARY && {\n backgroundColor: disabled ? COLOR_V2.GRAY_20 : backgroundColor || COLOR_V2.WHITE,\n border: `1px solid ${COLOR_V2.GRAY_40}`,\n svg: {\n fill: disabled ? COLOR_V2.GRAY_70 : COLOR_V2.BLACK,\n },\n ...(!disabled && {\n '&:hover, &:focus': {\n backgroundColor: COLOR_V2.GRAY_20,\n },\n '&:hover': {\n borderColor: COLOR_V2.GRAY_50,\n },\n '&:focus': {\n borderColor: COLOR_V2.GRAY_60,\n },\n '&:active': {\n backgroundColor: COLOR_V2.BLUE_LIGHT_50,\n borderColor: COLOR_V2.BLUE_LIGHT_300,\n svg: {\n fill: COLOR_V2.BLUE,\n },\n },\n }),\n }),\n ...(variant === IconButtonVariant.SECONDARY && {\n svg: {\n fill: disabled ? COLOR_V2.GRAY_60 : COLOR_V2.BLACK,\n },\n ...(!disabled && {\n '&:hover, &:focus, &:active': {\n svg: {\n fill: COLOR_V2.BLUE,\n },\n },\n '&:focus': {\n border: `1px solid ${COLOR_V2.BLUE_LIGHT_300}`,\n },\n '&:active': {\n backgroundColor: COLOR_V2.GRAY_10,\n },\n }),\n }),\n});\n\nexport const IconButton = ({children, ...props}: IconButtonProps) => (\n <button css={(theme: Theme) => iconButtonStyle(theme, props)} {...filterButtonProps(props)}>\n {children}\n </button>\n);\n\nconst filterButtonProps = (props: IconButtonProps) => {\n return filterProps(filterTextProps(props) as IconButtonProps, ['backgroundColor']);\n};\n"],"file":"IconButton.js"}
@@ -0,0 +1,43 @@
1
+ Demo:
2
+
3
+ ```js
4
+ import {IconButton, Container, Columns, Column, H2, InfoIcon} from '@wireapp/react-ui-kit';
5
+
6
+ <Container>
7
+ <H2>Primary</H2>
8
+ <Columns>
9
+ <Column>Enabled</Column>
10
+ <Column>
11
+ <IconButton>
12
+ <InfoIcon />
13
+ </IconButton>
14
+ </Column>
15
+ </Columns>
16
+ <Columns>
17
+ <Column>Disabled</Column>
18
+ <Column>
19
+ <IconButton disabled onClick={() => alert('This should not work')}>
20
+ <InfoIcon />
21
+ </IconButton>
22
+ </Column>
23
+ </Columns>
24
+
25
+ <H2>Secondary</H2>
26
+ <Columns>
27
+ <Column>Enabled</Column>
28
+ <Column>
29
+ <IconButton variant="secondary">
30
+ <InfoIcon />
31
+ </IconButton>
32
+ </Column>
33
+ </Columns>
34
+ <Columns>
35
+ <Column>Disabled</Column>
36
+ <Column>
37
+ <IconButton variant="secondary" disabled onClick={() => alert('This should not work')}>
38
+ <InfoIcon />
39
+ </IconButton>
40
+ </Column>
41
+ </Columns>
42
+ </Container>;
43
+ ```
@@ -3,4 +3,4 @@ export interface ChildrenProps<T extends Element, P extends React.HTMLProps<T>>
3
3
  children: React.ReactNode;
4
4
  defaultProps: P;
5
5
  }
6
- export declare const childrenWithDefaultProps: <E extends Element, P extends unknown>(props: ChildrenProps<E, P>) => (React.ReactChild | React.ReactFragment | React.ReactPortal)[];
6
+ export declare const childrenWithDefaultProps: <E extends Element, P extends unknown>(props: ChildrenProps<E, P>) => (string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | React.ReactPortal)[];
@@ -4,6 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
+ var _ButtonGroup = require("./ButtonGroup");
8
+
9
+ Object.keys(_ButtonGroup).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _ButtonGroup[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _ButtonGroup[key];
16
+ }
17
+ });
18
+ });
19
+
7
20
  var _childrenWithDefaultProps = require("./childrenWithDefaultProps");
8
21
 
9
22
  Object.keys(_childrenWithDefaultProps).forEach(function (key) {
@@ -17,6 +30,19 @@ Object.keys(_childrenWithDefaultProps).forEach(function (key) {
17
30
  });
18
31
  });
19
32
 
33
+ var _IconButton = require("./IconButton");
34
+
35
+ Object.keys(_IconButton).forEach(function (key) {
36
+ if (key === "default" || key === "__esModule") return;
37
+ if (key in exports && exports[key] === _IconButton[key]) return;
38
+ Object.defineProperty(exports, key, {
39
+ enumerable: true,
40
+ get: function get() {
41
+ return _IconButton[key];
42
+ }
43
+ });
44
+ });
45
+
20
46
  var _IsInViewport = require("./IsInViewport");
21
47
 
22
48
  Object.keys(_IsInViewport).forEach(function (key) {
@@ -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","sourcesContent":["export * from './childrenWithDefaultProps';\nexport * from './IsInViewport';\nexport * from './Loading';\nexport * from './Pagination';\nexport * from './Pill';\nexport * from './useLongTouch';\nexport * from './useTimeout';\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","sourcesContent":["export * from './ButtonGroup';\nexport * from './childrenWithDefaultProps';\nexport * from './IconButton';\nexport * from './IsInViewport';\nexport * from './Loading';\nexport * from './Pagination';\nexport * from './Pill';\nexport * from './useLongTouch';\nexport * from './useTimeout';\n"],"file":"index.d.js"}
@@ -1,4 +1,6 @@
1
+ export * from './ButtonGroup';
1
2
  export * from './childrenWithDefaultProps';
3
+ export * from './IconButton';
2
4
  export * from './IsInViewport';
3
5
  export * from './Loading';
4
6
  export * from './Pagination';
package/src/Misc/index.js CHANGED
@@ -4,6 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
+ var _ButtonGroup = require("./ButtonGroup");
8
+
9
+ Object.keys(_ButtonGroup).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _ButtonGroup[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _ButtonGroup[key];
16
+ }
17
+ });
18
+ });
19
+
7
20
  var _childrenWithDefaultProps = require("./childrenWithDefaultProps");
8
21
 
9
22
  Object.keys(_childrenWithDefaultProps).forEach(function (key) {
@@ -17,6 +30,19 @@ Object.keys(_childrenWithDefaultProps).forEach(function (key) {
17
30
  });
18
31
  });
19
32
 
33
+ var _IconButton = require("./IconButton");
34
+
35
+ Object.keys(_IconButton).forEach(function (key) {
36
+ if (key === "default" || key === "__esModule") return;
37
+ if (key in exports && exports[key] === _IconButton[key]) return;
38
+ Object.defineProperty(exports, key, {
39
+ enumerable: true,
40
+ get: function get() {
41
+ return _IconButton[key];
42
+ }
43
+ });
44
+ });
45
+
20
46
  var _IsInViewport = require("./IsInViewport");
21
47
 
22
48
  Object.keys(_IsInViewport).forEach(function (key) {
@@ -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","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 './childrenWithDefaultProps';\nexport * from './IsInViewport';\nexport * from './Loading';\nexport * from './Pagination';\nexport * from './Pill';\nexport * from './useLongTouch';\nexport * from './useTimeout';\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","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 './ButtonGroup';\nexport * from './childrenWithDefaultProps';\nexport * from './IconButton';\nexport * from './IsInViewport';\nexport * from './Loading';\nexport * from './Pagination';\nexport * from './Pill';\nexport * from './useLongTouch';\nexport * from './useTimeout';\n"],"file":"index.js"}
@@ -15,7 +15,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
15
15
 
16
16
  var _react = require("@emotion/react");
17
17
 
18
- var _colors = require("../Identity/colors");
18
+ var _colorsV = require("../Identity/colors-v2");
19
19
 
20
20
  var _Link = require("./Link");
21
21
 
@@ -27,7 +27,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
27
27
 
28
28
  var textLinkStyle = function textLinkStyle(theme, _ref) {
29
29
  var _ref$color = _ref.color,
30
- color = _ref$color === void 0 ? _colors.COLOR.BLUE : _ref$color,
30
+ color = _ref$color === void 0 ? _colorsV.COLOR_V2.BLUE : _ref$color,
31
31
  _ref$fontSize = _ref.fontSize,
32
32
  fontSize = _ref$fontSize === void 0 ? '16px' : _ref$fontSize,
33
33
  _ref$bold = _ref.bold,
@@ -1 +1 @@
1
- {"version":3,"sources":["TextLink.tsx"],"names":["textLinkStyle","theme","color","COLOR","BLUE","fontSize","bold","textTransform","props","TextLink"],"mappings":";;;;;;;;;;;;;;;AAoBA;;AAEA;;AAEA;;;;;;;;AAIO,IAAMA,aAAsE,GAAG,SAAzEA,aAAyE,CACpFC,KADoF;AAAA,wBAEnFC,KAFmF;AAAA,MAEnFA,KAFmF,2BAE3EC,cAAMC,IAFqE;AAAA,2BAE/DC,QAF+D;AAAA,MAE/DA,QAF+D,8BAEpD,MAFoD;AAAA,uBAE5CC,IAF4C;AAAA,MAE5CA,IAF4C,0BAErC,KAFqC;AAAA,gCAE9BC,aAF8B;AAAA,MAE9BA,aAF8B,mCAEd,MAFc;AAAA,MAEHC,KAFG;AAAA,2BAIjF,qBAAUP,KAAV;AAAkBK,IAAAA,IAAI,EAAJA,IAAlB;AAAwBJ,IAAAA,KAAK,EAALA,KAAxB;AAA+BG,IAAAA,QAAQ,EAARA,QAA/B;AAAyCE,IAAAA,aAAa,EAAbA;AAAzC,KAA2DC,KAA3D,EAJiF;AAAA,CAA/E;;;;AAOA,IAAMC,QAAQ,GAAG,SAAXA,QAAW,CAACD,KAAD;AAAA,SACtB;AAAG,IAAA,GAAG,EAAE,aAACP,KAAD;AAAA,aAAkBD,aAAa,CAACC,KAAD,EAAQO,KAAR,CAA/B;AAAA,KAAR;AAAuD,IAAA,GAAG,EAAC;AAA3D,KAAqF,2BAAgBA,KAAhB,CAArF,EADsB;AAAA,CAAjB","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} from '../Identity/colors';\nimport type {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.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"],"file":"TextLink.js"}
1
+ {"version":3,"sources":["TextLink.tsx"],"names":["textLinkStyle","theme","color","COLOR_V2","BLUE","fontSize","bold","textTransform","props","TextLink"],"mappings":";;;;;;;;;;;;;;;AAoBA;;AAEA;;AAEA;;;;;;;;AAIO,IAAMA,aAAsE,GAAG,SAAzEA,aAAyE,CACpFC,KADoF;AAAA,wBAEnFC,KAFmF;AAAA,MAEnFA,KAFmF,2BAE3EC,kBAASC,IAFkE;AAAA,2BAE5DC,QAF4D;AAAA,MAE5DA,QAF4D,8BAEjD,MAFiD;AAAA,uBAEzCC,IAFyC;AAAA,MAEzCA,IAFyC,0BAElC,KAFkC;AAAA,gCAE3BC,aAF2B;AAAA,MAE3BA,aAF2B,mCAEX,MAFW;AAAA,MAEAC,KAFA;AAAA,2BAIjF,qBAAUP,KAAV;AAAkBK,IAAAA,IAAI,EAAJA,IAAlB;AAAwBJ,IAAAA,KAAK,EAALA,KAAxB;AAA+BG,IAAAA,QAAQ,EAARA,QAA/B;AAAyCE,IAAAA,aAAa,EAAbA;AAAzC,KAA2DC,KAA3D,EAJiF;AAAA,CAA/E;;;;AAOA,IAAMC,QAAQ,GAAG,SAAXA,QAAW,CAACD,KAAD;AAAA,SACtB;AAAG,IAAA,GAAG,EAAE,aAACP,KAAD;AAAA,aAAkBD,aAAa,CAACC,KAAD,EAAQO,KAAR,CAA/B;AAAA,KAAR;AAAuD,IAAA,GAAG,EAAC;AAA3D,KAAqF,2BAAgBA,KAAhB,CAArF,EADsB;AAAA,CAAjB","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 type {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"],"file":"TextLink.js"}