@wireapp/react-ui-kit 9.69.0 → 9.69.5
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/Inputs/CodeInput/CodeInput.d.ts +3 -1
- package/lib/Inputs/CodeInput/CodeInput.d.ts.map +1 -1
- package/lib/Inputs/CodeInput/CodeInput.js +22 -7
- package/lib/Inputs/CodeInput/CodeInput.stories.d.ts +1 -1
- package/lib/Inputs/Input/Input.d.ts +2 -0
- package/lib/Inputs/Input/Input.d.ts.map +1 -1
- package/lib/Inputs/Input/Input.js +4 -3
- package/lib/Layout/HeaderMenu/HeaderMenu.d.ts +2 -0
- package/lib/Layout/HeaderMenu/HeaderMenu.d.ts.map +1 -1
- package/lib/Layout/HeaderMenu/HeaderMenu.js +7 -1
- package/lib/Layout/HeaderMenu/MenuItems.js +1 -1
- package/lib/Layout/HeaderMenu/MenuOpenButton.d.ts +3 -1
- package/lib/Layout/HeaderMenu/MenuOpenButton.d.ts.map +1 -1
- package/lib/Layout/HeaderMenu/MenuOpenButton.js +15 -1
- package/lib/Typography/ActionLink/ActionLink.d.ts +17 -0
- package/lib/Typography/ActionLink/ActionLink.d.ts.map +1 -0
- package/lib/Typography/ActionLink/ActionLink.js +37 -0
- package/lib/Typography/ActionLink/ActionLinkButton.style.d.ts +12 -0
- package/lib/Typography/ActionLink/ActionLinkButton.style.d.ts.map +1 -0
- package/lib/Typography/ActionLink/ActionLinkButton.style.js +54 -0
- package/lib/Typography/ActionLink/index.d.ts +2 -0
- package/lib/Typography/ActionLink/index.d.ts.map +1 -0
- package/lib/Typography/ActionLink/index.js +35 -0
- package/lib/Typography/index.d.ts +1 -0
- package/lib/Typography/index.d.ts.map +1 -1
- package/lib/Typography/index.js +1 -0
- package/package.json +2 -2
|
@@ -5,6 +5,8 @@ export interface CodeInputProps<T = HTMLInputElement> extends InputProps<T> {
|
|
|
5
5
|
digits?: number;
|
|
6
6
|
markInvalid?: boolean;
|
|
7
7
|
onCodeComplete?: (completeCode?: string) => void;
|
|
8
|
+
codeInputLabel?: string;
|
|
9
|
+
codePlaceholder?: string;
|
|
8
10
|
}
|
|
9
|
-
export declare const CodeInput: ({ style, digits,
|
|
11
|
+
export declare const CodeInput: ({ style, digits, markInvalid, onCodeComplete, disabled, codeInputLabel, codePlaceholder, }: CodeInputProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
10
12
|
//# sourceMappingURL=CodeInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeInput.d.ts","sourceRoot":"","sources":["../../../src/Inputs/CodeInput/CodeInput.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAC,UAAU,EAAa,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"CodeInput.d.ts","sourceRoot":"","sources":["../../../src/Inputs/CodeInput/CodeInput.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAC,UAAU,EAAa,MAAM,UAAU,CAAC;AAwBhD,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,gBAAgB,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;AAuBlE,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,gBAAgB,CAAE,SAAQ,UAAU,CAAC,CAAC,CAAC;IACzE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,SAAS,+FAQnB,cAAc,qDAwHhB,CAAC"}
|
|
@@ -51,7 +51,18 @@ const Input_1 = require("../Input");
|
|
|
51
51
|
const CodeInputWrapper = (props) => ((0, jsx_runtime_1.jsx)("div", { css: {
|
|
52
52
|
display: 'flex',
|
|
53
53
|
justifyContent: 'center',
|
|
54
|
+
flexDirection: 'column',
|
|
54
55
|
}, ...props }));
|
|
56
|
+
const codeInputLabelStyle = theme => ({
|
|
57
|
+
color: Identity_1.COLOR_V2.GRAY_70,
|
|
58
|
+
textAlign: 'center',
|
|
59
|
+
marginBottom: '0.5rem',
|
|
60
|
+
fontSize: theme.fontSizes.base,
|
|
61
|
+
fontStyle: 'normal',
|
|
62
|
+
fontWeight: 400,
|
|
63
|
+
lineHeight: '1.5rem',
|
|
64
|
+
letterSpacing: '0.003rem',
|
|
65
|
+
});
|
|
55
66
|
const digitInputStyle = (theme, props) => ({
|
|
56
67
|
...(0, Input_1.inputStyle)(theme, props),
|
|
57
68
|
'& + &': {
|
|
@@ -68,9 +79,9 @@ const digitInputStyle = (theme, props) => ({
|
|
|
68
79
|
width: 'min(48px, 13vw)',
|
|
69
80
|
height: '56px',
|
|
70
81
|
});
|
|
71
|
-
const DigitInput = React.forwardRef((props, ref) => ((0, jsx_runtime_1.jsx)("input", { ref: ref, css: (theme) => digitInputStyle(theme, props), ...props
|
|
82
|
+
const DigitInput = React.forwardRef((props, ref) => ((0, jsx_runtime_1.jsx)("input", { ref: ref, css: (theme) => digitInputStyle(theme, props), ...props })));
|
|
72
83
|
DigitInput.displayName = 'DigitInput';
|
|
73
|
-
const CodeInput = ({ style, digits = 6,
|
|
84
|
+
const CodeInput = ({ style, digits = 6, markInvalid, onCodeComplete = util_1.noop, disabled, codeInputLabel, codePlaceholder, }) => {
|
|
74
85
|
const [values, setValues] = (0, react_1.useState)(Array(digits).fill(''));
|
|
75
86
|
const inputs = Array(digits);
|
|
76
87
|
const forceSelection = (event) => {
|
|
@@ -132,10 +143,14 @@ const CodeInput = ({ style, digits = 6, autoFocus = false, markInvalid, onCodeCo
|
|
|
132
143
|
onCodeComplete(completeCode);
|
|
133
144
|
}
|
|
134
145
|
}, [values]);
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
146
|
+
const labelId = React.useId();
|
|
147
|
+
const getDigitAriaLabel = (value) => (value ? `${codePlaceholder}, ${value}` : `${codePlaceholder}`);
|
|
148
|
+
return ((0, jsx_runtime_1.jsxs)(CodeInputWrapper, { role: "group", "aria-labelledby": labelId, style: style, children: [(0, jsx_runtime_1.jsx)("span", { id: labelId, css: codeInputLabelStyle, children: codeInputLabel }), (0, jsx_runtime_1.jsx)("div", { css: {
|
|
149
|
+
display: 'flex',
|
|
150
|
+
alignItems: 'center',
|
|
151
|
+
justifyContent: 'center',
|
|
152
|
+
flexWrap: 'nowrap',
|
|
153
|
+
width: '100%',
|
|
154
|
+
}, children: Array.from({ length: digits }, (_, index) => ((0, jsx_runtime_1.jsx)(DigitInput, { onPaste: event => handlePaste(index, event), onFocus: forceSelection, onMouseDown: forceSelectionPreventDefault, onTouchStart: forceSelectionPreventDefault, onKeyDown: event => handleKeyDown(index, event), onKeyUp: forceSelection, markInvalid: markInvalid, ref: node => (inputs[index] = node), value: values[index], disabled: disabled, id: `code-input-digit-${index}`, inputMode: "numeric", pattern: "[0-9]*", autoComplete: "one-time-code", "aria-label": getDigitAriaLabel(values[index]), "aria-describedby": labelId }, index))) })] }));
|
|
140
155
|
};
|
|
141
156
|
exports.CodeInput = CodeInput;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ style, digits,
|
|
4
|
+
component: ({ style, digits, markInvalid, onCodeComplete, disabled, codeInputLabel, codePlaceholder, }: import("./CodeInput").CodeInputProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
5
5
|
parameters: {
|
|
6
6
|
layout: string;
|
|
7
7
|
};
|
|
@@ -14,6 +14,8 @@ export interface InputProps<T = HTMLInputElement> extends TextProps<T> {
|
|
|
14
14
|
inputCSS?: CSSObject;
|
|
15
15
|
startContent?: React.ReactNode;
|
|
16
16
|
endContent?: React.ReactNode;
|
|
17
|
+
showTogglePasswordLabel?: string;
|
|
18
|
+
hideTogglePasswordLabel?: string;
|
|
17
19
|
}
|
|
18
20
|
export declare const inputStyle: <T>(theme: Theme, props: InputProps<T>, hasError?: boolean) => CSSObject;
|
|
19
21
|
export declare const INPUT_CLASSNAME = "wireinput";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/Inputs/Input/Input.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAW,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAGtC,OAAO,EAAC,KAAK,EAAC,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAI3C,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,gBAAgB,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wBAAwB,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC;IAClD,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/Inputs/Input/Input.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAW,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAGtC,OAAO,EAAC,KAAK,EAAC,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAI3C,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,gBAAgB,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wBAAwB,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC;IAClD,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,eAAO,MAAM,UAAU,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,SAmEvF,CAAC;AAEF,eAAO,MAAM,eAAe,cAAc,CAAC;AAC3C,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAWzC,eAAO,MAAM,KAAK,oHAkGjB,CAAC"}
|
|
@@ -122,11 +122,12 @@ const centerInputAction = {
|
|
|
122
122
|
transform: 'translateY(-50%)',
|
|
123
123
|
};
|
|
124
124
|
exports.Input = React.forwardRef(({ type, label, error, helperText, startContent = null, endContent = null, inputCSS = {}, wrapperCSS = {}, className = '', ...props }, ref) => {
|
|
125
|
-
const [
|
|
125
|
+
const [isPasswordVisible, setTogglePassword] = (0, react_1.useState)(false);
|
|
126
126
|
const hasError = !!error;
|
|
127
127
|
const isPasswordInput = type === 'password';
|
|
128
|
-
const toggledPasswordType =
|
|
128
|
+
const toggledPasswordType = isPasswordVisible ? 'text' : 'password';
|
|
129
129
|
const toggleSetPassword = () => setTogglePassword(prevState => !prevState);
|
|
130
|
+
const togglepasswordLabel = isPasswordVisible ? props.hideTogglePasswordLabel : props.showTogglePasswordLabel;
|
|
130
131
|
return ((0, jsx_runtime_1.jsxs)("div", { className: exports.INPUT_GROUP, css: (theme) => ({
|
|
131
132
|
marginBottom: hasError ? '2px' : '20px',
|
|
132
133
|
width: '100%',
|
|
@@ -137,7 +138,7 @@ exports.Input = React.forwardRef(({ type, label, error, helperText, startContent
|
|
|
137
138
|
}), children: [label && ((0, jsx_runtime_1.jsx)(InputLabel_1.InputLabel, { htmlFor: props.id, isRequired: props.required, markInvalid: props.markInvalid, children: label })), (0, jsx_runtime_1.jsxs)("div", { css: { marginBottom: hasError && '8px', position: 'relative' }, children: [startContent, (0, jsx_runtime_1.jsx)("input", { className: exports.INPUT_CLASSNAME, css: (theme) => ({
|
|
138
139
|
...(0, exports.inputStyle)(theme, props, hasError),
|
|
139
140
|
...inputCSS,
|
|
140
|
-
}), ref: ref, type: isPasswordInput ? toggledPasswordType : type, "aria-required": props.required, ...filterInputProps(props) }), endContent, hasError && !isPasswordInput && ((0, jsx_runtime_1.jsx)(Icon_1.ErrorIcon, { css: centerInputAction, width: 16, height: 16, "aria-hidden": "true" })), isPasswordInput && ((0, jsx_runtime_1.jsx)("button", { type: "button", "data-uie-name": !
|
|
141
|
+
}), ref: ref, type: isPasswordInput ? toggledPasswordType : type, "aria-required": props.required, ...filterInputProps(props) }), endContent, hasError && !isPasswordInput && ((0, jsx_runtime_1.jsx)(Icon_1.ErrorIcon, { css: centerInputAction, width: 16, height: 16, "aria-hidden": "true" })), isPasswordInput && ((0, jsx_runtime_1.jsx)("button", { type: "button", "data-uie-name": !isPasswordVisible ? 'do-show-password' : 'do-hide-password', css: { ...centerInputAction, background: 'transparent', border: 'none', cursor: 'pointer', padding: 0 }, onClick: toggleSetPassword, title: togglepasswordLabel, "aria-label": togglepasswordLabel, "aria-controls": props.id, "aria-expanded": isPasswordVisible, children: isPasswordVisible ? (0, jsx_runtime_1.jsx)(Icon_1.ShowIcon, {}) : (0, jsx_runtime_1.jsx)(Icon_1.HideIcon, {}) }))] }), !hasError && helperText && ((0, jsx_runtime_1.jsx)("p", { css: (theme) => ({
|
|
141
142
|
fontSize: theme.fontSizes.small,
|
|
142
143
|
fontWeight: 400,
|
|
143
144
|
color: theme.Input.placeholderColor,
|
|
@@ -2,6 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
export interface HeaderMenuProps<T = HTMLDivElement> extends React.HTMLProps<T> {
|
|
3
3
|
centerElement?: React.ReactNode;
|
|
4
4
|
logoElement?: React.ReactNode;
|
|
5
|
+
openMenuLabel?: string;
|
|
6
|
+
closeMenuLabel?: string;
|
|
5
7
|
}
|
|
6
8
|
export declare const HeaderMenu: ({ children, logoElement, centerElement, ...props }: HeaderMenuProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
9
|
//# sourceMappingURL=HeaderMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderMenu.d.ts","sourceRoot":"","sources":["../../../src/Layout/HeaderMenu/HeaderMenu.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,cAAc,CAAE,SAAQ,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IAC7E,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"HeaderMenu.d.ts","sourceRoot":"","sources":["../../../src/Layout/HeaderMenu/HeaderMenu.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,cAAc,CAAE,SAAQ,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IAC7E,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,UAAU,uDAAoE,eAAe,qDAyCzG,CAAC"}
|
|
@@ -34,6 +34,12 @@ const HeaderMenu = ({ children, logoElement = null, centerElement = null, ...pro
|
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
const closeMenu = () => setIsOpen(false);
|
|
37
|
-
|
|
37
|
+
const onKeyDown = e => {
|
|
38
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
toggleMenu();
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
return ((0, jsx_runtime_1.jsx)("div", { css: { height: '64px' }, ...props, "data-uie-name": "element-header-menu", children: (0, jsx_runtime_1.jsxs)(MenuContent_1.MenuContent, { open: isOpen, children: [(0, jsx_runtime_1.jsx)("div", { css: { alignSelf: 'center', display: 'flex', zIndex: 2 }, onClick: closeMenu, children: logoElement }), (0, jsx_runtime_1.jsx)("div", { css: { alignSelf: 'center', display: 'flex' }, children: centerElement }), (0, jsx_runtime_1.jsx)(MenuOpenButton_1.MenuOpenButton, { onClick: toggleMenu, onKeyDown: onKeyDown, open: isOpen, openMenuLabel: props.openMenuLabel, closeMenuLabel: props.closeMenuLabel, style: { justifySelf: 'end', position: isOpen ? 'fixed' : undefined, right: '16px', top: '21px' }, "data-uie-name": "do-toggle-header-menu" }), (0, jsx_runtime_1.jsx)(MenuItems_1.MenuItems, { onClick: closeMenu, open: isOpen, children: (0, jsx_runtime_1.jsx)(MenuScrollableItems_1.MenuScrollableItems, { children: children }) })] }) }));
|
|
38
44
|
};
|
|
39
45
|
exports.HeaderMenu = HeaderMenu;
|
|
@@ -6,7 +6,7 @@ const utils_1 = require("../../utils");
|
|
|
6
6
|
const menuItemsStyle = (theme, props) => ({
|
|
7
7
|
alignSelf: 'center',
|
|
8
8
|
display: 'flex',
|
|
9
|
-
justifySelf: '
|
|
9
|
+
justifySelf: 'stretch',
|
|
10
10
|
[utils_1.media[utils_1.QueryKeys.TABLET_DOWN]]: {
|
|
11
11
|
backgroundColor: theme.general.backgroundColor,
|
|
12
12
|
bottom: 0,
|
|
@@ -3,7 +3,9 @@ import { CSSObject } from '@emotion/react';
|
|
|
3
3
|
import { Theme } from '../../Identity';
|
|
4
4
|
export interface MenuOpenButtonProps<T = HTMLDivElement> extends React.HTMLProps<T> {
|
|
5
5
|
open?: boolean;
|
|
6
|
+
openMenuLabel?: string;
|
|
7
|
+
closeMenuLabel?: string;
|
|
6
8
|
}
|
|
7
9
|
export declare const menuOpenButtonStyle: <T>(theme: Theme, props: MenuOpenButtonProps<T>) => CSSObject;
|
|
8
|
-
export declare const MenuOpenButton: (
|
|
10
|
+
export declare const MenuOpenButton: ({ open, onClick, onKeyDown, openMenuLabel, closeMenuLabel, ...menuBtnProps }: MenuOpenButtonProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
9
11
|
//# sourceMappingURL=MenuOpenButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuOpenButton.d.ts","sourceRoot":"","sources":["../../../src/Layout/HeaderMenu/MenuOpenButton.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"MenuOpenButton.d.ts","sourceRoot":"","sources":["../../../src/Layout/HeaderMenu/MenuOpenButton.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;AAIrC,MAAM,WAAW,mBAAmB,CAAC,CAAC,GAAG,cAAc,CAAE,SAAQ,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IACjF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,mBAAmB,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,SAmCpF,CAAC;AAIH,eAAO,MAAM,cAAc,iFAOxB,mBAAmB,qDAkBrB,CAAC"}
|
|
@@ -2,9 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MenuOpenButton = exports.menuOpenButtonStyle = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
+
const colors_v2_1 = require("../../Identity/colors-v2/colors-v2");
|
|
5
6
|
const utils_1 = require("../../utils");
|
|
6
7
|
const menuOpenButtonStyle = (theme, { open }) => ({
|
|
7
8
|
display: 'block',
|
|
9
|
+
cursor: 'pointer',
|
|
10
|
+
width: 40,
|
|
11
|
+
height: 32,
|
|
12
|
+
padding: '5px 8px',
|
|
13
|
+
'&:focus-visible': {
|
|
14
|
+
background: theme.Button?.secondaryActiveBg ?? colors_v2_1.COLOR_V2.BLUE_LIGHT_50,
|
|
15
|
+
border: `1px solid ${theme.Button?.secondaryActiveBorder ?? colors_v2_1.COLOR_V2.BLUE_LIGHT_300}`,
|
|
16
|
+
borderRadius: 12,
|
|
17
|
+
boxShadow: `0 0 0 2px ${theme.general?.focusColor ?? colors_v2_1.COLOR_V2.BLUE_LIGHT_300}`,
|
|
18
|
+
outline: 'none',
|
|
19
|
+
},
|
|
8
20
|
div: {
|
|
9
21
|
backgroundColor: theme.general.color,
|
|
10
22
|
height: '2px',
|
|
@@ -29,5 +41,7 @@ const menuOpenButtonStyle = (theme, { open }) => ({
|
|
|
29
41
|
});
|
|
30
42
|
exports.menuOpenButtonStyle = menuOpenButtonStyle;
|
|
31
43
|
const filterMenuOpenButtonProps = (props) => (0, utils_1.filterProps)(props, ['open']);
|
|
32
|
-
const MenuOpenButton = (
|
|
44
|
+
const MenuOpenButton = ({ open, onClick, onKeyDown, openMenuLabel, closeMenuLabel, ...menuBtnProps }) => {
|
|
45
|
+
return ((0, jsx_runtime_1.jsxs)("div", { role: "button", tabIndex: 0, "aria-haspopup": "menu", "aria-expanded": open, "aria-label": open ? closeMenuLabel : openMenuLabel, css: (theme) => (0, exports.menuOpenButtonStyle)(theme, menuBtnProps), onKeyDown: onKeyDown, onClick: onClick, ...filterMenuOpenButtonProps(menuBtnProps), children: [(0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)("div", {})] }));
|
|
46
|
+
};
|
|
33
47
|
exports.MenuOpenButton = MenuOpenButton;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { LinkProps } from '../Link';
|
|
3
|
+
type VisualProps = Pick<LinkProps, 'bold' | 'color' | 'fontSize' | 'textTransform'> & {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
type AnchorVariant = Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children' | 'disabled'> & {
|
|
8
|
+
href: string;
|
|
9
|
+
};
|
|
10
|
+
type ButtonVariant = {
|
|
11
|
+
onClick: React.MouseEventHandler<HTMLButtonElement>;
|
|
12
|
+
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children'>;
|
|
13
|
+
export type ActionLinkButtonProps = VisualProps & (AnchorVariant | ButtonVariant);
|
|
14
|
+
export type LinkStyleProps<T = HTMLAnchorElement> = LinkProps<T>;
|
|
15
|
+
export declare const ActionLinkButton: React.ForwardRefExoticComponent<ActionLinkButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=ActionLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionLink.d.ts","sourceRoot":"","sources":["../../../src/Typography/ActionLink/ActionLink.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,EAAC,SAAS,EAA6B,MAAM,SAAS,CAAC;AAE9D,KAAK,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,eAAe,CAAC,GAAG;IACpF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,KAAK,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,GAAG;IAClG,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CACrD,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,CAAC;AAEpE,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG,CAAC,aAAa,GAAG,aAAa,CAAC,CAAC;AAElF,MAAM,MAAM,cAAc,CAAC,CAAC,GAAG,iBAAiB,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC;AAEjE,eAAO,MAAM,gBAAgB,qHAoE5B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActionLinkButton = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const ActionLinkButton_style_1 = require("./ActionLinkButton.style");
|
|
7
|
+
const colors_v2_1 = require("../../Identity/colors-v2/colors-v2");
|
|
8
|
+
const Link_1 = require("../Link");
|
|
9
|
+
exports.ActionLinkButton = (0, react_1.forwardRef)((props, ref) => {
|
|
10
|
+
const { bold = false, color = colors_v2_1.COLOR_V2.BLACK, fontSize, textTransform = 'none', disabled, children, ...restProps } = props;
|
|
11
|
+
const baseCss = (theme) => ({
|
|
12
|
+
...(0, Link_1.linkStyle)(theme, {
|
|
13
|
+
bold,
|
|
14
|
+
color,
|
|
15
|
+
fontSize: fontSize ?? theme.fontSizes.base,
|
|
16
|
+
textTransform,
|
|
17
|
+
}),
|
|
18
|
+
...ActionLinkButton_style_1.styles.link.base,
|
|
19
|
+
...(disabled ? ActionLinkButton_style_1.styles.link.disabled : ActionLinkButton_style_1.styles.link.enabled),
|
|
20
|
+
});
|
|
21
|
+
if ('href' in restProps && restProps.href) {
|
|
22
|
+
const { href, target, onClick, ...anchorProps } = restProps;
|
|
23
|
+
const linkProps = (0, Link_1.filterLinkProps)(anchorProps);
|
|
24
|
+
const handleAnchorClick = e => {
|
|
25
|
+
if (disabled) {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
e.stopPropagation();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
onClick?.(e);
|
|
31
|
+
};
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)("a", { ref: ref, href: href, css: (theme) => baseCss(theme), target: target, rel: target === '_blank' ? 'noopener noreferrer' : undefined, "aria-disabled": disabled || undefined, tabIndex: disabled ? -1 : undefined, onClick: handleAnchorClick, ...linkProps, children: children }));
|
|
33
|
+
}
|
|
34
|
+
const { onClick, ...btnProps } = props;
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)("button", { ref: ref, type: "button", disabled: disabled || btnProps.disabled, onClick: onClick, css: (theme) => [ActionLinkButton_style_1.styles.buttonReset, baseCss(theme)], ...btnProps, children: children }));
|
|
36
|
+
});
|
|
37
|
+
exports.ActionLinkButton.displayName = 'ActionLinkButton';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CSSObject } from '@emotion/react';
|
|
2
|
+
type LinkStateStyles = {
|
|
3
|
+
base: CSSObject;
|
|
4
|
+
enabled: CSSObject;
|
|
5
|
+
disabled: CSSObject;
|
|
6
|
+
};
|
|
7
|
+
export declare const styles: {
|
|
8
|
+
buttonReset: CSSObject;
|
|
9
|
+
link: LinkStateStyles;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=ActionLinkButton.style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionLinkButton.style.d.ts","sourceRoot":"","sources":["../../../src/Typography/ActionLink/ActionLinkButton.style.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAIzC,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE;IACnB,WAAW,EAAE,SAAS,CAAC;IACvB,IAAI,EAAE,eAAe,CAAC;CAgCvB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Wire
|
|
4
|
+
* Copyright (C) 2025 Wire Swiss GmbH
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
* (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* This program is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
* GNU General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU General Public License
|
|
17
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.styles = void 0;
|
|
22
|
+
const colors_v2_1 = require("../../Identity/colors-v2/colors-v2");
|
|
23
|
+
exports.styles = {
|
|
24
|
+
buttonReset: {
|
|
25
|
+
background: 'none',
|
|
26
|
+
border: 'none',
|
|
27
|
+
padding: 0,
|
|
28
|
+
margin: 0,
|
|
29
|
+
},
|
|
30
|
+
link: {
|
|
31
|
+
base: {
|
|
32
|
+
textDecoration: 'underline',
|
|
33
|
+
},
|
|
34
|
+
enabled: {
|
|
35
|
+
color: colors_v2_1.COLOR_V2.BLACK,
|
|
36
|
+
cursor: 'pointer',
|
|
37
|
+
'&:hover': {
|
|
38
|
+
color: colors_v2_1.COLOR_V2.BLUE,
|
|
39
|
+
textDecorationThickness: '2px',
|
|
40
|
+
},
|
|
41
|
+
'&:focus-visible': {
|
|
42
|
+
color: colors_v2_1.COLOR_V2.BLUE,
|
|
43
|
+
background: 'rgba(255, 255, 255, 0.01)',
|
|
44
|
+
borderRadius: 4,
|
|
45
|
+
outline: '2px solid transparent',
|
|
46
|
+
boxShadow: `0 0 0 2px ${colors_v2_1.COLOR_V2.BLUE_LIGHT_300}`,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
disabled: {
|
|
50
|
+
color: colors_v2_1.COLOR_V2.GRAY_80,
|
|
51
|
+
cursor: 'default',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Typography/ActionLink/index.ts"],"names":[],"mappings":"AAmBA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Wire
|
|
4
|
+
* Copyright (C) 2025 Wire Swiss GmbH
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
* (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* This program is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
* GNU General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU General Public License
|
|
17
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
23
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
24
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
25
|
+
}
|
|
26
|
+
Object.defineProperty(o, k2, desc);
|
|
27
|
+
}) : (function(o, m, k, k2) {
|
|
28
|
+
if (k2 === undefined) k2 = k;
|
|
29
|
+
o[k2] = m[k];
|
|
30
|
+
}));
|
|
31
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
32
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
__exportStar(require("./ActionLink"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Typography/index.ts"],"names":[],"mappings":"AAmBA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Typography/index.ts"],"names":[],"mappings":"AAmBA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
package/lib/Typography/index.js
CHANGED
|
@@ -39,4 +39,5 @@ __exportStar(require("./Link"), exports);
|
|
|
39
39
|
__exportStar(require("./Paragraph"), exports);
|
|
40
40
|
__exportStar(require("./Text"), exports);
|
|
41
41
|
__exportStar(require("./TextLink"), exports);
|
|
42
|
+
__exportStar(require("./ActionLink"), exports);
|
|
42
43
|
__exportStar(require("./Title"), exports);
|
package/package.json
CHANGED