@appquality/unguess-design-system 3.1.104 → 3.1.105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/build/index.js +6 -5
- package/build/stories/profile-modal/_types.d.ts +3 -2
- package/build/stories/profile-modal/items/languageMenuItem.d.ts +2 -1
- package/build/stories/profile-modal/items/settingsMenuItem.d.ts +2 -2
- package/build/stories/theme/colors.stories.d.ts +20 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
# v3.1.105 (Mon Sep 23 2024)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- release new version [#407](https://github.com/AppQuality/unguess-design-system/pull/407) ([@Kariamos](https://github.com/Kariamos) [@d-beezee](https://github.com/d-beezee) [@iacopolea](https://github.com/iacopolea))
|
|
6
|
+
- hide language selector [#405](https://github.com/AppQuality/unguess-design-system/pull/405) ([@Kariamos](https://github.com/Kariamos))
|
|
7
|
+
- fix: Update settingValue type to string in UserMenuArgs and SettingsP… [#404](https://github.com/AppQuality/unguess-design-system/pull/404) ([@Kariamos](https://github.com/Kariamos))
|
|
8
|
+
- feat: Add hue colors docs [#406](https://github.com/AppQuality/unguess-design-system/pull/406) ([@d-beezee](https://github.com/d-beezee))
|
|
9
|
+
|
|
10
|
+
#### Authors: 3
|
|
11
|
+
|
|
12
|
+
- [@d-beezee](https://github.com/d-beezee)
|
|
13
|
+
- Iacopo Leardini ([@iacopolea](https://github.com/iacopolea))
|
|
14
|
+
- Marco ([@Kariamos](https://github.com/Kariamos))
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
1
18
|
# v3.1.104 (Tue Jul 02 2024)
|
|
2
19
|
|
|
3
20
|
#### 🐛 Bug Fix
|
package/build/index.js
CHANGED
|
@@ -6845,14 +6845,14 @@ const StyledBody$2 = styled__default["default"].div `
|
|
|
6845
6845
|
`;
|
|
6846
6846
|
const StyledButtonContainer = styled__default["default"].div `
|
|
6847
6847
|
${flexStart}
|
|
6848
|
-
& button {
|
|
6848
|
+
& button {
|
|
6849
6849
|
justify-content: flex-start;
|
|
6850
6850
|
}
|
|
6851
6851
|
`;
|
|
6852
6852
|
const LanguageItem = (props) => {
|
|
6853
6853
|
var _a;
|
|
6854
6854
|
const content = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(PreviousButton, Object.assign({ onClick: () => props.setActive(""), isBasic: true }, { children: props.title })), jsxRuntime.jsx(Separator, {}), jsxRuntime.jsx(StyledBody$2, { children: jsxRuntime.jsx(StyledButtonContainer, { children: Object.keys(props.languages).map((key) => (jsxRuntime.jsxs(Button, Object.assign({ isBasic: true, isStretched: true, value: key, onClick: () => props.onSelectLanguage(key) }, { children: [jsxRuntime.jsx(Button.StartIcon, { children: props.currentLanguage === key ? jsxRuntime.jsx(SvgCheckLg, {}) : jsxRuntime.jsx(SvgEmpty, {}) }), jsxRuntime.jsx(Span, Object.assign({ isBold: props.currentLanguage === key }, { children: props.languages[key].label }))] })))) }) })] }));
|
|
6855
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(MenuItem, Object.assign({ content: content, value: props.value, selectedItem: props.selectedItem, setActive: props.setActive, icon: jsxRuntime.jsx(SvgTranslationExists, { fill: theme.palette.blue[600] }) }, { children: jsxRuntime.jsxs(MenuItemBody, { children: [props.title, jsxRuntime.jsxs(MD, Object.assign({ style: { color: theme.palette.grey[600] } }, { children: [(_a = props.currentLanguageLabel) !== null && _a !== void 0 ? _a : "Now:", " " + props.languages[props.currentLanguage].label] }))] }) })) }));
|
|
6855
|
+
return props.disabled ? null : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(MenuItem, Object.assign({ content: content, value: props.value, selectedItem: props.selectedItem, setActive: props.setActive, icon: jsxRuntime.jsx(SvgTranslationExists, { fill: theme.palette.blue[600] }) }, { children: jsxRuntime.jsxs(MenuItemBody, { children: [props.title, jsxRuntime.jsxs(MD, Object.assign({ style: { color: theme.palette.grey[600] } }, { children: [(_a = props.currentLanguageLabel) !== null && _a !== void 0 ? _a : "Now:", " " + props.languages[props.currentLanguage].label] }))] }) })) }));
|
|
6856
6856
|
};
|
|
6857
6857
|
|
|
6858
6858
|
const ProfileContainer = styled__default["default"].div `
|
|
@@ -6909,12 +6909,12 @@ const SettingsOutroText = styled__default["default"](reactNotifications.Paragrap
|
|
|
6909
6909
|
`;
|
|
6910
6910
|
const SettingsItem = (props) => {
|
|
6911
6911
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
6912
|
-
const [value, setValue] = React.useState(props.settingValue || 0);
|
|
6912
|
+
const [value, setValue] = React.useState(props.settingValue || "0");
|
|
6913
6913
|
const onToggleSettings = (value) => {
|
|
6914
6914
|
setValue(value);
|
|
6915
6915
|
props.onSetSettings && props.onSetSettings(value);
|
|
6916
6916
|
};
|
|
6917
|
-
const content = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(PreviousButton, Object.assign({ onClick: () => props.setActive(""), isBasic: true }, { children: (_a = props.i18n) === null || _a === void 0 ? void 0 : _a.settingsTitle })), jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledBody$1, { children: [props.i18n && props.i18n.settingsIntroText && (jsxRuntime.jsx(SettingsIntroText, { children: jsxRuntime.jsx(SM, { children: props.i18n.settingsIntroText }) })), jsxRuntime.jsxs(Field, { children: [jsxRuntime.jsx(TriggerTitle, Object.assign({ isBold: true }, { children: (_c = (_b = props.i18n) === null || _b === void 0 ? void 0 : _b.settingsToggle) === null || _c === void 0 ? void 0 : _c.title })), jsxRuntime.jsx(Toggle, Object.assign({ checked: value === 1, onChange: () => onToggleSettings(value === 1 ? 0 : 1) }, { children: jsxRuntime.jsx(Label, { children: value === 1
|
|
6917
|
+
const content = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(PreviousButton, Object.assign({ onClick: () => props.setActive(""), isBasic: true }, { children: (_a = props.i18n) === null || _a === void 0 ? void 0 : _a.settingsTitle })), jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledBody$1, { children: [props.i18n && props.i18n.settingsIntroText && (jsxRuntime.jsx(SettingsIntroText, { children: jsxRuntime.jsx(SM, { children: props.i18n.settingsIntroText }) })), jsxRuntime.jsxs(Field, { children: [jsxRuntime.jsx(TriggerTitle, Object.assign({ isBold: true }, { children: (_c = (_b = props.i18n) === null || _b === void 0 ? void 0 : _b.settingsToggle) === null || _c === void 0 ? void 0 : _c.title })), jsxRuntime.jsx(Toggle, Object.assign({ checked: value === "1", onChange: () => onToggleSettings(value === "1" ? "0" : "1") }, { children: jsxRuntime.jsx(Label, { children: value === "1"
|
|
6918
6918
|
? (_e = (_d = props.i18n) === null || _d === void 0 ? void 0 : _d.settingsToggle) === null || _e === void 0 ? void 0 : _e.on
|
|
6919
6919
|
: (_g = (_f = props.i18n) === null || _f === void 0 ? void 0 : _f.settingsToggle) === null || _g === void 0 ? void 0 : _g.off }) }))] }), props.i18n && props.i18n.settingsOutroText && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(SettingsOutroText, { children: [jsxRuntime.jsx(SM, { children: props.i18n.settingsOutroText.paragraph_1 }), jsxRuntime.jsx(SM, { children: props.i18n.settingsOutroText.paragraph_2 })] }), jsxRuntime.jsx(SettingsOutroText, { children: jsxRuntime.jsx(SM, { children: props.i18n.settingsOutroText.paragraph_3 }) })] }))] })] }));
|
|
6920
6920
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(MenuItem, Object.assign({ content: content, value: props.value, selectedItem: props.selectedItem, setActive: props.setActive, icon: jsxRuntime.jsx(SvgGearFill, { color: theme.palette.blue[600] }) }, { children: (_h = props.i18n) === null || _h === void 0 ? void 0 : _h.settingsTitle })) }));
|
|
@@ -6927,6 +6927,7 @@ const StyledList = styled__default["default"].ul `
|
|
|
6927
6927
|
const UserMenu = (props) => {
|
|
6928
6928
|
var _a, _b, _c, _d, _e, _f;
|
|
6929
6929
|
const [item, setActiveItem] = React.useState("");
|
|
6930
|
+
const disableMenuLanguageSettings = props.disableMenuLanguageSettings || false;
|
|
6930
6931
|
const toggleItem = (item) => {
|
|
6931
6932
|
setActiveItem(item);
|
|
6932
6933
|
};
|
|
@@ -6937,7 +6938,7 @@ const UserMenu = (props) => {
|
|
|
6937
6938
|
settingsIntroText: (_c = props.i18n) === null || _c === void 0 ? void 0 : _c.settingsIntroText,
|
|
6938
6939
|
settingsOutroText: (_d = props.i18n) === null || _d === void 0 ? void 0 : _d.settingsOutroText,
|
|
6939
6940
|
settingsToggle: (_e = props.i18n) === null || _e === void 0 ? void 0 : _e.settingsToggle,
|
|
6940
|
-
}, onSetSettings: props.onSetSettings }), jsxRuntime.jsx(LanguageItem, { title: props.languageTitle || "Change Language", value: "language-selector", selectedItem: item, setActive: (i) => toggleItem(i), languages: props.languages, currentLanguage: props.currentLanguage, currentLanguageLabel: props.currentLanguageLabel, onSelectLanguage: (lang) => props.onSelectLanguage(lang) }), jsxRuntime.jsx(MenuItem, Object.assign({ selectedItem: item, icon: jsxRuntime.jsx(SvgLockLockedFill, { color: theme.palette.blue[600] }), setActive: () => {
|
|
6941
|
+
}, onSetSettings: props.onSetSettings }), jsxRuntime.jsx(LanguageItem, { disabled: disableMenuLanguageSettings, title: props.languageTitle || "Change Language", value: "language-selector", selectedItem: item, setActive: (i) => toggleItem(i), languages: props.languages, currentLanguage: props.currentLanguage, currentLanguageLabel: props.currentLanguageLabel, onSelectLanguage: (lang) => props.onSelectLanguage(lang) }), jsxRuntime.jsx(MenuItem, Object.assign({ selectedItem: item, icon: jsxRuntime.jsx(SvgLockLockedFill, { color: theme.palette.blue[600] }), setActive: () => {
|
|
6941
6942
|
if (document.querySelector(".iubenda-cs-preferences-link")) {
|
|
6942
6943
|
const iubendaBtn = document.querySelector(".iubenda-cs-preferences-link");
|
|
6943
6944
|
if (iubendaBtn) {
|
|
@@ -36,6 +36,7 @@ export interface UserMenuArgs extends LiHTMLAttributes<HTMLLIElement> {
|
|
|
36
36
|
};
|
|
37
37
|
currentLanguage: string;
|
|
38
38
|
logoutTitle?: string;
|
|
39
|
+
disableMenuLanguageSettings?: boolean;
|
|
39
40
|
privacy: {
|
|
40
41
|
title?: string;
|
|
41
42
|
url?: string;
|
|
@@ -47,7 +48,7 @@ export interface UserMenuArgs extends LiHTMLAttributes<HTMLLIElement> {
|
|
|
47
48
|
onLogout: () => void;
|
|
48
49
|
onCopyEmail?: () => void;
|
|
49
50
|
chatSupport?: boolean;
|
|
50
|
-
settingValue?:
|
|
51
|
+
settingValue?: string;
|
|
51
52
|
i18n?: {
|
|
52
53
|
settingsTitle?: string;
|
|
53
54
|
settingsIntroText?: string;
|
|
@@ -62,5 +63,5 @@ export interface UserMenuArgs extends LiHTMLAttributes<HTMLLIElement> {
|
|
|
62
63
|
off: string;
|
|
63
64
|
};
|
|
64
65
|
};
|
|
65
|
-
onSetSettings: (value:
|
|
66
|
+
onSetSettings: (value: string) => void;
|
|
66
67
|
}
|
|
@@ -8,6 +8,7 @@ interface LanguagesProps extends MenuItemProps {
|
|
|
8
8
|
currentLanguage: string;
|
|
9
9
|
currentLanguageLabel?: string;
|
|
10
10
|
onSelectLanguage: (lang: string) => void;
|
|
11
|
+
disabled?: boolean;
|
|
11
12
|
}
|
|
12
|
-
export declare const LanguageItem: (props: LanguagesProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const LanguageItem: (props: LanguagesProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
14
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MenuItemProps } from "../_types";
|
|
2
2
|
interface SettingsProps extends MenuItemProps {
|
|
3
|
-
settingValue?:
|
|
4
|
-
onSetSettings?: (value:
|
|
3
|
+
settingValue?: string;
|
|
4
|
+
onSetSettings?: (value: string) => void;
|
|
5
5
|
i18n?: {
|
|
6
6
|
settingsTitle?: string;
|
|
7
7
|
settingsIntroText?: string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
interface ColorProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
}
|
|
4
|
+
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, ColorProps>;
|
|
5
|
+
declare const _default: {
|
|
6
|
+
title: string;
|
|
7
|
+
argTypes: {
|
|
8
|
+
cards: {
|
|
9
|
+
table: {
|
|
10
|
+
disable: boolean;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
parameters: {
|
|
15
|
+
chromatic: {
|
|
16
|
+
delay: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|