@omniumretail/component-library 1.1.15 → 1.1.16
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/dist/bundle.js +1 -1
- package/dist/main.css +1 -0
- package/dist/types/components/DropdownButton/index.d.ts +1 -1
- package/dist/types/components/Navigation/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/DropdownButton/index.tsx +3 -2
- package/src/components/DropdownButton/styles.module.scss +3 -0
- package/src/components/Navigation/index.tsx +11 -11
package/dist/main.css
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
.lCPh1mJwiXUUOgmbv_mk{padding:12px 24px;border-radius:4px;min-width:170px;display:inline-flex;align-items:center;justify-content:center;align-self:flex-start;text-decoration:none;border:none;font-size:14px;line-height:16.8px;font-weight:700;font-family:"Silka",sans-serif;background-color:var(--button-default-background);color:var(--button-default-text-color)}@media(max-width: 767px){.lCPh1mJwiXUUOgmbv_mk{min-width:0px}}.lCPh1mJwiXUUOgmbv_mk:hover{background-color:var(--button-default-background-hover-color);color:var(--button-default-text-hover-color) !important}.lCPh1mJwiXUUOgmbv_mk:focus,.lCPh1mJwiXUUOgmbv_mk:active,.lCPh1mJwiXUUOgmbv_mk:focus:active{background-color:var(--button-default-background-focus-color);color:var(--button-default-text-focus-color)}.lCPh1mJwiXUUOgmbv_mk:disabled,.lCPh1mJwiXUUOgmbv_mk.vwrGv_jOJcIvImjzKZNv{background-color:var(--button-disabled-background-color);color:var(--button-disabled-default-text-color);pointer-events:none}.PYUelyvKNnKRxaBMgCyk{flex-direction:row-reverse;gap:5px}.edzSVcT9ajLWxd6QfVI1{background-color:var(--button-style-1-background);color:var(--button-style-1-text-color)}.edzSVcT9ajLWxd6QfVI1:hover{background-color:var(--button-style-1-background-hover-color);color:var(--button-style-1-text-hover-color) !important}.edzSVcT9ajLWxd6QfVI1:focus,.edzSVcT9ajLWxd6QfVI1:active,.edzSVcT9ajLWxd6QfVI1:focus:active{background-color:var(--button-style-1-background-focus-color);color:var(--button-style-1-text-focus-color)}.edzSVcT9ajLWxd6QfVI1:disabled,.edzSVcT9ajLWxd6QfVI1.vwrGv_jOJcIvImjzKZNv{background-color:var(--button-disabled-background-color);color:var(--button-disabled-default-text-color);pointer-events:none}
|
|
2
2
|
.UxfXOleP69PjM5rFOMTD{display:grid !important;grid-template-columns:repeat(3, 1fr) !important;justify-items:center !important;align-items:center !important;height:75px !important;gap:0 24px !important;position:relative !important;padding:0px !important}@media(max-width: 767px){.UxfXOleP69PjM5rFOMTD .UxfXOleP69PjM5rFOMTD{grid-template-columns:1fr}.UxfXOleP69PjM5rFOMTD .UK3esJZjnri5Jb9Jxcca,.UxfXOleP69PjM5rFOMTD .U5tZ7kRlrIHUKsuduD1S{justify-self:center}.UxfXOleP69PjM5rFOMTD .LzcTbjk0fp70tXlKd3eS{text-align:center}.UxfXOleP69PjM5rFOMTD .DhO9jcXNunsWq22jXuJJ{text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}.UxfXOleP69PjM5rFOMTD .LzcTbjk0fp70tXlKd3eS{font-size:var(--font-size-body-3);font-weight:var(--font-weight-semibold);text-transform:uppercase}@media(min-width: 768px){.UxfXOleP69PjM5rFOMTD .LzcTbjk0fp70tXlKd3eS{font-size:var(--font-size-body-4)}}.UxfXOleP69PjM5rFOMTD .gn06XRZhFG00HaVjAqNc{align-self:center}@media(max-width: 768px){.UxfXOleP69PjM5rFOMTD .gn06XRZhFG00HaVjAqNc{position:unset !important;top:unset !important;margin:unset !important;left:unset !important;right:unset !important;text-align:unset !important}}.UxfXOleP69PjM5rFOMTD .UK3esJZjnri5Jb9Jxcca{justify-self:start}.UxfXOleP69PjM5rFOMTD .SP4eLTEZBzKjo_LdsNw2{justify-self:end}@media(max-width: 460px){.UxfXOleP69PjM5rFOMTD .SP4eLTEZBzKjo_LdsNw2{width:80px}}@media(max-width: 460px){.UxfXOleP69PjM5rFOMTD .SP4eLTEZBzKjo_LdsNw2 :where(.css-dev-only-do-not-override-fpg3f5).ant-btn.ant-btn-icon-only{padding-inline-start:40px}}.UxfXOleP69PjM5rFOMTD .nt_yaN_SHYobZ6zexnfY{justify-self:end}@media(max-width: 460px){.UxfXOleP69PjM5rFOMTD .nt_yaN_SHYobZ6zexnfY{width:60px}}@media(max-width: 460px){.UxfXOleP69PjM5rFOMTD .nt_yaN_SHYobZ6zexnfY :where(.css-dev-only-do-not-override-fpg3f5).ant-btn.ant-btn-icon-only{padding-inline-start:22px}}
|
|
3
3
|
.ii1Ag3GTfp8unGCe48A0{display:inline-flex;text-decoration:none;height:auto;color:var(--color-black);font-size:var(--font-size-body-3);line-height:100%;font-weight:300;font-style:var(--font-style-italic)}.L9ncGwaItcjHJBLuwrKb{color:var(--color-orange);font-style:var(--font-style-normal)}.Yrb4eAglcF7FedoEB9AH span:nth-child(2){margin-inline-end:8px;margin-inline-start:0;order:-1}
|
|
4
|
+
.dr2zFJ8bDffg5CjjPq2c{color:var(--color-black)}
|
|
4
5
|
.GhX1oPovx60SBqLAcIRO{border-color:rgba(var(--color-black-rgb), 0.5);height:50px;font-size:var(--font-size-body-3);line-height:100%;color:var(--color-black);border-radius:5px}
|
|
5
6
|
._ox_QPqUHev1INeaUhs7 .ant-select-selector{border-color:rgba(var(--color-black-rgb), 0.5) !important;height:50px !important;display:flex;align-items:center}._ox_QPqUHev1INeaUhs7 .ant-select-arrow{color:var(--color-black)}
|
|
6
7
|
.bisuiYUGnAaj47TMXXcY{display:flex !important}
|
package/package.json
CHANGED
|
@@ -2,9 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import { Menu, Dropdown, DropdownProps } from 'antd';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { Button } from '../Button';
|
|
5
|
+
import styles from './styles.module.scss';
|
|
5
6
|
|
|
6
7
|
export interface DropdownButtonProps extends DropdownProps {
|
|
7
|
-
options
|
|
8
|
+
options?: { label: string, action: () => void }[];
|
|
8
9
|
buttonText: string;
|
|
9
10
|
buttonClass?: string;
|
|
10
11
|
customButton?: React.ReactNode;
|
|
@@ -21,7 +22,7 @@ export const DropdownButton = ({ options, buttonText, buttonClass, customButton,
|
|
|
21
22
|
|
|
22
23
|
const linkClasses = classNames({
|
|
23
24
|
[`${buttonClass}`]: buttonClass,
|
|
24
|
-
}, []);
|
|
25
|
+
}, [styles.dropdown]);
|
|
25
26
|
|
|
26
27
|
return (
|
|
27
28
|
<Dropdown overlay={menu} trigger={['click']}>
|
|
@@ -14,34 +14,34 @@ export interface NavigationProps {
|
|
|
14
14
|
loginOnClickFunction?: () => void;
|
|
15
15
|
backLinkOnClickFunction?: () => void;
|
|
16
16
|
homeOnClickFunction?: () => void;
|
|
17
|
-
options
|
|
17
|
+
options?: { label: string, action: () => void }[];
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const
|
|
20
|
+
const PHONE_MAX_WIDTH = 768;
|
|
21
21
|
|
|
22
22
|
export const Navigation = (props: NavigationProps) => {
|
|
23
23
|
const { userName, backLink, title, homeLink, loginOnClickFunction, loginLink, backLinkOnClickFunction, homeOnClickFunction } = props;
|
|
24
24
|
const { t } = useTranslation();
|
|
25
25
|
|
|
26
|
-
const [
|
|
26
|
+
const [isPhone, setIsPhone] = useState(false);
|
|
27
27
|
const [showDropdown, setShowDropdown] = useState(false);
|
|
28
28
|
|
|
29
29
|
const checkMediaQuery = () => {
|
|
30
|
-
const isPhoneWidth = window.innerWidth <
|
|
31
|
-
|
|
30
|
+
const isPhoneWidth = window.innerWidth < PHONE_MAX_WIDTH;
|
|
31
|
+
setIsPhone(isPhoneWidth);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
useEffect(() => {
|
|
35
35
|
checkMediaQuery();
|
|
36
36
|
window.addEventListener('resize', checkMediaQuery);
|
|
37
37
|
return () => window.removeEventListener('resize', checkMediaQuery);
|
|
38
|
-
}, [
|
|
38
|
+
}, [isPhone]);
|
|
39
39
|
|
|
40
40
|
const getInitials = (name: string) => {
|
|
41
41
|
const words = name.split(' ');
|
|
42
42
|
let initials = '';
|
|
43
43
|
|
|
44
|
-
if (
|
|
44
|
+
if (isPhone) {
|
|
45
45
|
if (words.length === 1) {
|
|
46
46
|
initials = words[0].charAt(0);
|
|
47
47
|
} else if (words.length > 1) {
|
|
@@ -55,13 +55,13 @@ export const Navigation = (props: NavigationProps) => {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
return
|
|
58
|
+
return isPhone ? initials.toUpperCase() : initials;
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
return (
|
|
62
62
|
<div className={styles.navigation}>
|
|
63
63
|
<div className={styles.columnLeft}>
|
|
64
|
-
{backLink && <Link href="#" icon={<ArrowLeftOutlined />} linkSecondary onClick={backLinkOnClickFunction}> {!
|
|
64
|
+
{backLink && <Link href="#" icon={<ArrowLeftOutlined />} linkSecondary onClick={backLinkOnClickFunction}> {!isPhone && t('navigation.back')} </Link>}
|
|
65
65
|
</div>
|
|
66
66
|
<div className={styles.columnCenter}>
|
|
67
67
|
<h1 className={`${styles.title} ${styles.titleMobile}`}>{title}</h1>
|
|
@@ -83,8 +83,8 @@ export const Navigation = (props: NavigationProps) => {
|
|
|
83
83
|
)}
|
|
84
84
|
/>
|
|
85
85
|
)}
|
|
86
|
-
{homeLink && <Link icon={<HomeOutlined />} linkSecondary iconAlignRight onClick={homeOnClickFunction}> {!
|
|
87
|
-
{loginLink && <Link href="#" onClick={loginOnClickFunction} icon={<LogoutOutlined />} linkSecondary iconAlignRight>{!
|
|
86
|
+
{homeLink && <Link icon={<HomeOutlined />} linkSecondary iconAlignRight onClick={homeOnClickFunction}> {!isPhone && t('navigation.home')} </Link>}
|
|
87
|
+
{loginLink && <Link href="#" onClick={loginOnClickFunction} icon={<LogoutOutlined />} linkSecondary iconAlignRight>{!isPhone && t('navigation.logout')}</Link>}
|
|
88
88
|
</div>
|
|
89
89
|
</div>
|
|
90
90
|
)
|