@wireapp/react-ui-kit 9.52.0 → 9.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Form/Button.d.ts +1 -1
- package/lib/Form/Button.d.ts.map +1 -1
- package/lib/Form/Button.js +3 -2
- package/lib/Form/Button.stories.d.ts +1 -1
- package/lib/Misc/ButtonGroup.d.ts +1 -1
- package/lib/Misc/ButtonGroup.d.ts.map +1 -1
- package/lib/Misc/ButtonGroup.js +23 -3
- package/lib/Misc/IconButton.d.ts +1 -1
- package/lib/Misc/IconButton.d.ts.map +1 -1
- package/lib/Misc/IconButton.js +21 -2
- package/lib/Modal/DropdownMenu/DropdownMenu.js +1 -1
- package/lib/Modal/DropdownMenu/DropdownMenu.stories.d.ts +2 -1
- package/lib/Modal/DropdownMenu/DropdownMenu.stories.d.ts.map +1 -1
- package/lib/Modal/DropdownMenu/DropdownMenu.stories.js +8 -6
- package/package.json +2 -2
package/lib/Form/Button.d.ts
CHANGED
|
@@ -16,6 +16,6 @@ export interface ButtonProps<T = HTMLButtonElement> extends TextProps<T> {
|
|
|
16
16
|
showLoading?: boolean;
|
|
17
17
|
isActive?: boolean;
|
|
18
18
|
}
|
|
19
|
-
export declare const Button: (
|
|
19
|
+
export declare const Button: import("react").ForwardRefExoticComponent<Omit<ButtonProps<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
20
20
|
export declare const filterButtonProps: (props: ButtonProps) => Object;
|
|
21
21
|
//# sourceMappingURL=Button.d.ts.map
|
package/lib/Form/Button.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Form/Button.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Form/Button.tsx"],"names":[],"mappings":"AA0BA,OAAO,EAAC,SAAS,EAAkB,MAAM,SAAS,CAAC;AAGnD,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,UAAU,eAAe;IACzB,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,iBAAiB,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,MAAM,2IAMlB,CAAC;AAIF,eAAO,MAAM,iBAAiB,UAAW,WAAW,WAEnD,CAAC"}
|
package/lib/Form/Button.js
CHANGED
|
@@ -20,6 +20,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
20
20
|
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
+
const react_1 = require("react");
|
|
23
24
|
const Button_styles_1 = require("./Button.styles");
|
|
24
25
|
const Identity_1 = require("../Identity");
|
|
25
26
|
const Misc_1 = require("../Misc");
|
|
@@ -34,8 +35,8 @@ var ButtonVariant;
|
|
|
34
35
|
ButtonVariant["SEND"] = "send";
|
|
35
36
|
ButtonVariant["CANCEL"] = "cancel";
|
|
36
37
|
})(ButtonVariant || (exports.ButtonVariant = ButtonVariant = {}));
|
|
37
|
-
|
|
38
|
-
exports.Button = Button;
|
|
38
|
+
exports.Button = (0, react_1.forwardRef)(({ showLoading, children, loadingColor = Identity_1.COLOR.WHITE, ...props }, ref) => ((0, jsx_runtime_1.jsx)("button", { ref: ref, css: (theme) => (0, Button_styles_1.buttonStyle)(theme, props), ...(0, exports.filterButtonProps)(props), children: showLoading ? (0, jsx_runtime_1.jsx)(Misc_1.Loading, { size: 30, color: loadingColor, style: { display: 'flex', margin: 'auto' } }) : children })));
|
|
39
|
+
exports.Button.displayName = 'Button';
|
|
39
40
|
const filterButtonProps = (props) => {
|
|
40
41
|
return (0, util_1.filterProps)((0, Text_1.filterTextProps)(props), ['backgroundColor', 'noCapital']);
|
|
41
42
|
};
|
|
@@ -2,7 +2,7 @@ import type { StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { ButtonVariant } from './Button';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: (
|
|
5
|
+
component: import("react").ForwardRefExoticComponent<Omit<import("./Button").ButtonProps<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: string;
|
|
8
8
|
};
|
|
@@ -8,7 +8,7 @@ interface ButtonGroupProps {
|
|
|
8
8
|
}
|
|
9
9
|
declare const ButtonGroup: {
|
|
10
10
|
({ children }: ButtonGroupProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
|
-
Button: (
|
|
11
|
+
Button: import("react").ForwardRefExoticComponent<GroupButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
12
12
|
};
|
|
13
13
|
export { ButtonGroup };
|
|
14
14
|
//# sourceMappingURL=ButtonGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../src/Misc/ButtonGroup.tsx"],"names":[],"mappings":"AAmBA,OAAO,
|
|
1
|
+
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../src/Misc/ButtonGroup.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAa,SAAS,EAAC,MAAM,OAAO,CAAC;AA0D5C,UAAU,gBAAgB;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,UAAU,gBAAgB;IACxB,QAAQ,EAAE,SAAS,CAAC;CACrB;AACD,QAAA,MAAM,WAAW;mBAAgB,gBAAgB;;CAIhD,CAAC;AA2BF,OAAO,EAAC,WAAW,EAAC,CAAC"}
|
package/lib/Misc/ButtonGroup.js
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ButtonGroup = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
+
/*
|
|
6
|
+
* Wire
|
|
7
|
+
* Copyright (C) 2022 Wire Swiss GmbH
|
|
8
|
+
*
|
|
9
|
+
* This program is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
const react_1 = require("react");
|
|
5
24
|
const Identity_1 = require("../Identity");
|
|
6
25
|
const buttonGroupStyle = () => ({
|
|
7
26
|
display: 'flex',
|
|
@@ -52,13 +71,14 @@ const buttonStyle = (_, { disabled = false }) => ({
|
|
|
52
71
|
});
|
|
53
72
|
const ButtonGroup = ({ children }) => ((0, jsx_runtime_1.jsx)("div", { css: (theme) => buttonGroupStyle(theme), role: "group", "aria-label": "Button Group", children: children }));
|
|
54
73
|
exports.ButtonGroup = ButtonGroup;
|
|
55
|
-
const Button = ({ children, icon, ...props }) => {
|
|
56
|
-
return ((0, jsx_runtime_1.jsxs)("button", { css: (theme) => buttonStyle(theme, props), ...props, children: [icon, children && ((0, jsx_runtime_1.jsx)("span", { css: (theme) => ({
|
|
74
|
+
const Button = (0, react_1.forwardRef)(({ children, icon, ...props }, ref) => {
|
|
75
|
+
return ((0, jsx_runtime_1.jsxs)("button", { ref: ref, css: (theme) => buttonStyle(theme, props), ...props, children: [icon, children && ((0, jsx_runtime_1.jsx)("span", { css: (theme) => ({
|
|
57
76
|
marginLeft: !!icon && '6px',
|
|
58
77
|
fontSize: theme.fontSizes.small,
|
|
59
78
|
fontWeight: 'bold',
|
|
60
79
|
lineHeight: '0.875rem',
|
|
61
80
|
letterSpacing: '0.25px',
|
|
62
81
|
}), children: children }))] }));
|
|
63
|
-
};
|
|
82
|
+
});
|
|
83
|
+
Button.displayName = 'Button';
|
|
64
84
|
ButtonGroup.Button = Button;
|
package/lib/Misc/IconButton.d.ts
CHANGED
|
@@ -11,5 +11,5 @@ export interface IconButtonProps<T = HTMLButtonElement> extends TextProps<T> {
|
|
|
11
11
|
backgroundColor?: string;
|
|
12
12
|
}
|
|
13
13
|
export declare const iconButtonStyle: <T>(theme: Theme, props: IconButtonProps<T>) => CSSObject;
|
|
14
|
-
export declare const IconButton: (
|
|
14
|
+
export declare const IconButton: import("react").ForwardRefExoticComponent<Omit<IconButtonProps<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
15
15
|
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../src/Misc/IconButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../src/Misc/IconButton.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAGzC,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAChC,OAAO,EAAC,SAAS,EAAkB,MAAM,SAAS,CAAC;AAGnD,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,SAAS,cAAc;CACxB;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,iBAAiB,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAC1E,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,SAoF5E,CAAC;AAEH,eAAO,MAAM,UAAU,+IAIrB,CAAC"}
|
package/lib/Misc/IconButton.js
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IconButton = exports.iconButtonStyle = exports.IconButtonVariant = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
+
/*
|
|
6
|
+
* Wire
|
|
7
|
+
* Copyright (C) 2022 Wire Swiss GmbH
|
|
8
|
+
*
|
|
9
|
+
* This program is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
const react_1 = require("react");
|
|
5
24
|
const motions_1 = require("../Identity/motions");
|
|
6
25
|
const Text_1 = require("../Text");
|
|
7
26
|
const util_1 = require("../util");
|
|
@@ -91,8 +110,8 @@ const iconButtonStyle = (theme, { variant = IconButtonVariant.PRIMARY, group = f
|
|
|
91
110
|
}),
|
|
92
111
|
});
|
|
93
112
|
exports.iconButtonStyle = iconButtonStyle;
|
|
94
|
-
|
|
95
|
-
exports.IconButton = IconButton;
|
|
113
|
+
exports.IconButton = (0, react_1.forwardRef)(({ children, ...props }, ref) => ((0, jsx_runtime_1.jsx)("button", { ref: ref, css: (theme) => (0, exports.iconButtonStyle)(theme, props), ...filterButtonProps(props), children: children })));
|
|
114
|
+
exports.IconButton.displayName = 'IconButton';
|
|
96
115
|
const filterButtonProps = (props) => {
|
|
97
116
|
return (0, util_1.filterProps)((0, Text_1.filterTextProps)(props), ['backgroundColor']);
|
|
98
117
|
};
|
|
@@ -64,7 +64,7 @@ const DropdownMenu = ({ children }) => {
|
|
|
64
64
|
};
|
|
65
65
|
exports.DropdownMenu = DropdownMenu;
|
|
66
66
|
const DropdownMenuTrigger = ({ children, asChild = false, cssObj, }) => {
|
|
67
|
-
return ((0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.Trigger, { asChild: asChild, css: { ...DropdownMenu_styles_1.triggerStyles, ...cssObj }, children: children }));
|
|
67
|
+
return ((0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.Trigger, { asChild: asChild, css: !asChild && { ...DropdownMenu_styles_1.triggerStyles, ...cssObj }, children: children }));
|
|
68
68
|
};
|
|
69
69
|
exports.DropdownMenu.Trigger = DropdownMenuTrigger;
|
|
70
70
|
const DropdownMenuContent = ({ children }) => {
|
|
@@ -5,5 +5,6 @@ export default meta;
|
|
|
5
5
|
type Story = StoryObj<typeof DropdownMenu>;
|
|
6
6
|
export declare const Default: Story;
|
|
7
7
|
export declare const WithLongItems: Story;
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const WithCustomButton: Story;
|
|
9
|
+
export declare const WithCustomIconButton: Story;
|
|
9
10
|
//# sourceMappingURL=DropdownMenu.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.stories.d.ts","sourceRoot":"","sources":["../../../src/Modal/DropdownMenu/DropdownMenu.stories.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"DropdownMenu.stories.d.ts","sourceRoot":"","sources":["../../../src/Modal/DropdownMenu/DropdownMenu.stories.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAM5C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAMnC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAC;AAE3C,eAAO,MAAM,OAAO,EAAE,KAarB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAa3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAa9B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAelC,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.WithCustomIconButton = exports.WithCustomButton = exports.WithLongItems = exports.Default = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const DropdownMenu_1 = require("./DropdownMenu");
|
|
6
|
+
const Form_1 = require("../../Form");
|
|
6
7
|
const Icon_1 = require("../../Icon");
|
|
8
|
+
const Misc_1 = require("../../Misc");
|
|
7
9
|
const meta = {
|
|
8
10
|
component: DropdownMenu_1.DropdownMenu,
|
|
9
11
|
title: 'Modal/DropdownMenu',
|
|
@@ -18,9 +20,9 @@ exports.Default = {
|
|
|
18
20
|
exports.WithLongItems = {
|
|
19
21
|
render: () => ((0, jsx_runtime_1.jsxs)(DropdownMenu_1.DropdownMenu, { children: [(0, jsx_runtime_1.jsx)(DropdownMenu_1.DropdownMenu.Trigger, { cssObj: { width: '40px', height: '40px' }, children: (0, jsx_runtime_1.jsx)(Icon_1.PlusIcon, {}) }), (0, jsx_runtime_1.jsxs)(DropdownMenu_1.DropdownMenu.Content, { children: [(0, jsx_runtime_1.jsx)(DropdownMenu_1.DropdownMenu.Item, { onClick: () => { }, children: "Copy the detail of this message" }), (0, jsx_runtime_1.jsx)(DropdownMenu_1.DropdownMenu.Item, { onClick: () => { }, children: "Contact the sender" }), (0, jsx_runtime_1.jsx)(DropdownMenu_1.DropdownMenu.Item, { onClick: () => { }, children: "Delete this message (works only if you are the owner)" })] })] })),
|
|
20
22
|
};
|
|
21
|
-
exports.
|
|
22
|
-
render: () => ((0, jsx_runtime_1.jsxs)(DropdownMenu_1.DropdownMenu, { children: [(0, jsx_runtime_1.jsx)(DropdownMenu_1.DropdownMenu.Trigger, { asChild: true, children: (0, jsx_runtime_1.jsx)("
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
exports.WithCustomButton = {
|
|
24
|
+
render: () => ((0, jsx_runtime_1.jsxs)(DropdownMenu_1.DropdownMenu, { children: [(0, jsx_runtime_1.jsx)(DropdownMenu_1.DropdownMenu.Trigger, { asChild: true, children: (0, jsx_runtime_1.jsx)(Form_1.Button, { variant: Form_1.ButtonVariant.PRIMARY, children: "Open menu" }) }), (0, jsx_runtime_1.jsxs)(DropdownMenu_1.DropdownMenu.Content, { children: [(0, jsx_runtime_1.jsx)(DropdownMenu_1.DropdownMenu.Item, { onClick: () => { }, children: "Copy" }), (0, jsx_runtime_1.jsx)(DropdownMenu_1.DropdownMenu.Item, { onClick: () => { }, children: "Details" }), (0, jsx_runtime_1.jsx)(DropdownMenu_1.DropdownMenu.Item, { onClick: () => { }, children: "Delete for me" })] })] })),
|
|
25
|
+
};
|
|
26
|
+
exports.WithCustomIconButton = {
|
|
27
|
+
render: () => ((0, jsx_runtime_1.jsxs)(DropdownMenu_1.DropdownMenu, { children: [(0, jsx_runtime_1.jsx)(DropdownMenu_1.DropdownMenu.Trigger, { asChild: true, children: (0, jsx_runtime_1.jsx)(Misc_1.IconButton, { variant: Misc_1.IconButtonVariant.PRIMARY, children: (0, jsx_runtime_1.jsx)(Icon_1.PlusIcon, {}) }) }), (0, jsx_runtime_1.jsxs)(DropdownMenu_1.DropdownMenu.Content, { children: [(0, jsx_runtime_1.jsx)(DropdownMenu_1.DropdownMenu.Item, { onClick: () => { }, children: "Copy" }), (0, jsx_runtime_1.jsx)(DropdownMenu_1.DropdownMenu.Item, { onClick: () => { }, children: "Details" }), (0, jsx_runtime_1.jsx)(DropdownMenu_1.DropdownMenu.Item, { onClick: () => { }, children: "Delete for me" })] })] })),
|
|
26
28
|
};
|
package/package.json
CHANGED