@citygross/components_v2 0.0.19 → 0.0.21
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/components/BoxArrow/BoxArrow.js +2 -1
- package/dist/components/Header/Header.css.ts.vanilla.css +20 -0
- package/dist/components/Header/Header.css.vanilla.js +3 -1
- package/dist/components/Header/Header.js +11 -5
- package/dist/components/Modal/Modal.css.ts.vanilla.css +69 -0
- package/dist/components/Modal/Modal.css.vanilla.js +13 -0
- package/dist/components/Modal/Modal.d.ts +18 -0
- package/dist/components/Modal/Modal.js +54 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +3 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Icons } from '@citygross/icons_v2';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { boxArrowContainer } from './BoxArrow.css.vanilla.js';
|
|
4
|
+
import { palette } from '@citygross/design-tokens_v2';
|
|
4
5
|
|
|
5
6
|
const BoxArrow = ({
|
|
6
7
|
arrowPlacement,
|
|
@@ -16,7 +17,7 @@ const BoxArrow = ({
|
|
|
16
17
|
offsetRight: arrowPlacement === "right" ? arrowSpacing : void 0
|
|
17
18
|
})
|
|
18
19
|
},
|
|
19
|
-
/* @__PURE__ */ React.createElement(Icons.BoxArrow, { width: 17, height: 8, color: background })
|
|
20
|
+
/* @__PURE__ */ React.createElement(Icons.BoxArrow, { width: 17, height: 8, color: palette[background] })
|
|
20
21
|
);
|
|
21
22
|
};
|
|
22
23
|
|
|
@@ -26,8 +26,28 @@
|
|
|
26
26
|
justify-content: space-between;
|
|
27
27
|
padding: 12px;
|
|
28
28
|
}
|
|
29
|
+
.Header_desktopLogo__11gdejs5 {
|
|
30
|
+
display: none;
|
|
31
|
+
visibility: hidden;
|
|
32
|
+
}
|
|
33
|
+
.Header_mobileLogo__11gdejs6 {
|
|
34
|
+
display: block;
|
|
35
|
+
visibility: visible;
|
|
36
|
+
}
|
|
29
37
|
@media screen and (min-width: 960px) {
|
|
30
38
|
.Header_headerWrapper__11gdejs1 {
|
|
31
39
|
padding: 20px 24px;
|
|
32
40
|
}
|
|
41
|
+
.Header_menuIconContainer__11gdejs3 {
|
|
42
|
+
display: none;
|
|
43
|
+
visibility: visible;
|
|
44
|
+
}
|
|
45
|
+
.Header_desktopLogo__11gdejs5 {
|
|
46
|
+
display: block;
|
|
47
|
+
visibility: visible;
|
|
48
|
+
}
|
|
49
|
+
.Header_mobileLogo__11gdejs6 {
|
|
50
|
+
display: none;
|
|
51
|
+
visibility: hidden;
|
|
52
|
+
}
|
|
33
53
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import './Header.css.ts.vanilla.css';
|
|
2
2
|
|
|
3
|
+
var desktopLogo = "Header_desktopLogo__11gdejs5";
|
|
3
4
|
var headerContainer = "Header_headerContainer__11gdejs2";
|
|
4
5
|
var headerWrapper = "Header_headerWrapper__11gdejs1";
|
|
5
6
|
var menuIconContainer = "Header_menuIconContainer__11gdejs3";
|
|
7
|
+
var mobileLogo = "Header_mobileLogo__11gdejs6";
|
|
6
8
|
var wrapper = "Header_wrapper__11gdejs0";
|
|
7
9
|
|
|
8
|
-
export { headerContainer, headerWrapper, menuIconContainer, wrapper };
|
|
10
|
+
export { desktopLogo, headerContainer, headerWrapper, menuIconContainer, mobileLogo, wrapper };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button } from '../Button/Button.js';
|
|
3
3
|
import { Icons } from '@citygross/icons_v2';
|
|
4
|
-
import { wrapper, headerWrapper, headerContainer, menuIconContainer } from './Header.css.vanilla.js';
|
|
5
|
-
import { breakpoints } from '@citygross/design-tokens_v2';
|
|
4
|
+
import { wrapper, headerWrapper, headerContainer, mobileLogo, desktopLogo, menuIconContainer } from './Header.css.vanilla.js';
|
|
6
5
|
|
|
7
6
|
const Header = ({
|
|
8
7
|
btnLabel,
|
|
@@ -11,15 +10,22 @@ const Header = ({
|
|
|
11
10
|
sideModal,
|
|
12
11
|
headerLink
|
|
13
12
|
}) => {
|
|
14
|
-
|
|
15
|
-
return /* @__PURE__ */ React.createElement("div", { className: wrapper }, headerLink && headerLink, /* @__PURE__ */ React.createElement("div", { className: headerWrapper }, /* @__PURE__ */ React.createElement("div", { className: headerContainer }, isMobile ? /* @__PURE__ */ React.createElement(Icons.LogoFlat, null) : /* @__PURE__ */ React.createElement(Icons.Logo, null), isMobile ? /* @__PURE__ */ React.createElement(
|
|
13
|
+
return /* @__PURE__ */ React.createElement("div", { className: wrapper }, headerLink && headerLink, /* @__PURE__ */ React.createElement("div", { className: headerWrapper }, /* @__PURE__ */ React.createElement("div", { className: headerContainer }, /* @__PURE__ */ React.createElement("span", { className: mobileLogo }, /* @__PURE__ */ React.createElement(Icons.LogoFlat, null)), /* @__PURE__ */ React.createElement("span", { className: desktopLogo }, /* @__PURE__ */ React.createElement(Icons.Logo, null)), /* @__PURE__ */ React.createElement(
|
|
16
14
|
"div",
|
|
17
15
|
{
|
|
18
16
|
className: menuIconContainer,
|
|
19
17
|
onClick: () => onMenuClick && onMenuClick()
|
|
20
18
|
},
|
|
21
19
|
/* @__PURE__ */ React.createElement(Icons.Menu, null)
|
|
22
|
-
)
|
|
20
|
+
), btnLabel && /* @__PURE__ */ React.createElement(
|
|
21
|
+
Button,
|
|
22
|
+
{
|
|
23
|
+
className: desktopLogo,
|
|
24
|
+
onClick: btnOnClick,
|
|
25
|
+
variant: "secondary"
|
|
26
|
+
},
|
|
27
|
+
btnLabel
|
|
28
|
+
))), sideModal);
|
|
23
29
|
};
|
|
24
30
|
|
|
25
31
|
export { Header };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
.Modal_modalOverlay__mwif0x0 {
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 0;
|
|
4
|
+
bottom: 0;
|
|
5
|
+
left: 0;
|
|
6
|
+
right: 0;
|
|
7
|
+
height: 100%;
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
align-items: center;
|
|
11
|
+
padding: 8px;
|
|
12
|
+
z-index: 5;
|
|
13
|
+
background: rgba(0, 0, 0, 0.6);
|
|
14
|
+
}
|
|
15
|
+
.Modal_modalContainer__mwif0x1 {
|
|
16
|
+
overflow: auto;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
padding: 24px;
|
|
20
|
+
max-height: 100vh;
|
|
21
|
+
max-width: 100%;
|
|
22
|
+
border-radius: 5px;
|
|
23
|
+
}
|
|
24
|
+
.Modal_modalContainer_maxWidth_confirm__mwif0x1d {
|
|
25
|
+
max-width: 480px;
|
|
26
|
+
}
|
|
27
|
+
.Modal_modalContainer_maxWidth_regular__mwif0x1e {
|
|
28
|
+
max-width: 615px;
|
|
29
|
+
}
|
|
30
|
+
.Modal_modalHeaderContainer__mwif0x1f {
|
|
31
|
+
padding-bottom: 24px;
|
|
32
|
+
}
|
|
33
|
+
.Modal_modalHeader__mwif0x1g {
|
|
34
|
+
display: flex;
|
|
35
|
+
justify-content: space-between;
|
|
36
|
+
padding-bottom: 16px;
|
|
37
|
+
align-items: center;
|
|
38
|
+
}
|
|
39
|
+
.Modal_closeButtonWrapper__mwif0x1h {
|
|
40
|
+
display: flex;
|
|
41
|
+
justify-content: space-between;
|
|
42
|
+
align-items: center;
|
|
43
|
+
padding-bottom: 16px;
|
|
44
|
+
}
|
|
45
|
+
.Modal_childrenWrapper__mwif0x1i {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
min-height: 64px;
|
|
49
|
+
gap: 24px;
|
|
50
|
+
}
|
|
51
|
+
.Modal_footerWrapper__mwif0x1j {
|
|
52
|
+
display: flex;
|
|
53
|
+
gap: 8px;
|
|
54
|
+
}
|
|
55
|
+
@media (min-width: 8px) {
|
|
56
|
+
.Modal_modalOverlay__mwif0x0 {
|
|
57
|
+
padding: 32px;
|
|
58
|
+
}
|
|
59
|
+
.Modal_modalContainer__mwif0x1 {
|
|
60
|
+
padding: 32px;
|
|
61
|
+
width: 100%;
|
|
62
|
+
max-height: 90vh;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
@media (min-width: 16px) {
|
|
66
|
+
.Modal_modalHeaderContainer__mwif0x1f {
|
|
67
|
+
padding-top: 8px;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import './../../cssUtils/color.css.ts.vanilla.css';
|
|
2
|
+
import './Modal.css.ts.vanilla.css';
|
|
3
|
+
import { createRuntimeFn } from '@vanilla-extract/recipes/createRuntimeFn';
|
|
4
|
+
|
|
5
|
+
var childrenWrapper = "Modal_childrenWrapper__mwif0x1i";
|
|
6
|
+
var closeButtonWrapper = "Modal_closeButtonWrapper__mwif0x1h";
|
|
7
|
+
var footerWrapper = "Modal_footerWrapper__mwif0x1j";
|
|
8
|
+
var modalContainer = createRuntimeFn({ defaultClassName: "Modal_modalContainer__mwif0x1", variantClassNames: { backgroundColor: { primary: "color_backgroundColor_primary__13rr0b21b", secondary: "color_backgroundColor_secondary__13rr0b21c", brandYellow: "color_backgroundColor_brandYellow__13rr0b21d", brandBlue: "color_backgroundColor_brandBlue__13rr0b21e", brandPurple: "color_backgroundColor_brandPurple__13rr0b21f", brandPrio: "color_backgroundColor_brandPrio__13rr0b21g", yellowLighter: "color_backgroundColor_yellowLighter__13rr0b21h", yellowLight: "color_backgroundColor_yellowLight__13rr0b21i", blueLight: "color_backgroundColor_blueLight__13rr0b21j", blueLighter: "color_backgroundColor_blueLighter__13rr0b21k", blueMedium: "color_backgroundColor_blueMedium__13rr0b21l", greenLight: "color_backgroundColor_greenLight__13rr0b21m", greenMedium: "color_backgroundColor_greenMedium__13rr0b21n", redLight: "color_backgroundColor_redLight__13rr0b21o", recipeVego: "color_backgroundColor_recipeVego__13rr0b21p", recipeLactose: "color_backgroundColor_recipeLactose__13rr0b21q", recipeGluten: "color_backgroundColor_recipeGluten__13rr0b21r", link: "color_backgroundColor_link__13rr0b21s", white: "color_backgroundColor_white__13rr0b21t", black: "color_backgroundColor_black__13rr0b21u", lightest: "color_backgroundColor_lightest__13rr0b21v", lighter: "color_backgroundColor_lighter__13rr0b21w", light: "color_backgroundColor_light__13rr0b21x", medium: "color_backgroundColor_medium__13rr0b21y", mediumDark: "color_backgroundColor_mediumDark__13rr0b21z", dark: "color_backgroundColor_dark__13rr0b220", darker: "color_backgroundColor_darker__13rr0b221", darkest: "color_backgroundColor_darkest__13rr0b222", buttonGray: "color_backgroundColor_buttonGray__13rr0b223", disabledGray: "color_backgroundColor_disabledGray__13rr0b224", disabledDarkGray: "color_backgroundColor_disabledDarkGray__13rr0b225", placeholder: "color_backgroundColor_placeholder__13rr0b226", border: "color_backgroundColor_border__13rr0b227", boxShadow: "color_backgroundColor_boxShadow__13rr0b228", boxShadowActive: "color_backgroundColor_boxShadowActive__13rr0b229", alertRed: "color_backgroundColor_alertRed__13rr0b22a", alertBlue: "color_backgroundColor_alertBlue__13rr0b22b", alertGreen: "color_backgroundColor_alertGreen__13rr0b22c", darkOverlay: "color_backgroundColor_darkOverlay__13rr0b22d", transparent: "color_backgroundColor_transparent__13rr0b22e", brandBlueHover: "color_backgroundColor_brandBlueHover__13rr0b22f", brandYellowHover: "color_backgroundColor_brandYellowHover__13rr0b22g", brandPrioHover: "color_backgroundColor_brandPrioHover__13rr0b22h", brandBlueActive: "color_backgroundColor_brandBlueActive__13rr0b22i", brandYellowActive: "color_backgroundColor_brandYellowActive__13rr0b22j", brandPrioActive: "color_backgroundColor_brandPrioActive__13rr0b22k", none: "color_backgroundColor_none__13rr0b22l" }, maxWidth: { confirm: "Modal_modalContainer_maxWidth_confirm__mwif0x1d", regular: "Modal_modalContainer_maxWidth_regular__mwif0x1e" } }, defaultVariants: {}, compoundVariants: [] });
|
|
9
|
+
var modalHeader = "Modal_modalHeader__mwif0x1g";
|
|
10
|
+
var modalHeaderContainer = "Modal_modalHeaderContainer__mwif0x1f";
|
|
11
|
+
var modalOverlay = "Modal_modalOverlay__mwif0x0";
|
|
12
|
+
|
|
13
|
+
export { childrenWrapper, closeButtonWrapper, footerWrapper, modalContainer, modalHeader, modalHeaderContainer, modalOverlay };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TPaletteKeys } from '@citygross/design-tokens_v2';
|
|
3
|
+
|
|
4
|
+
declare type TModal = {
|
|
5
|
+
onBackdropClick?: () => void;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
title?: string;
|
|
8
|
+
subTitle?: string;
|
|
9
|
+
hideCancel?: boolean;
|
|
10
|
+
querySelector?: string;
|
|
11
|
+
footer?: JSX.Element;
|
|
12
|
+
background?: TPaletteKeys;
|
|
13
|
+
isConfirm?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
declare const Modal: ({ onBackdropClick, children, title, subTitle, hideCancel, isConfirm, background, querySelector, footer, className }: TModal) => React.ReactPortal;
|
|
17
|
+
|
|
18
|
+
export { Modal, TModal };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createPortal } from 'react-dom';
|
|
3
|
+
import { Icons } from '@citygross/icons_v2';
|
|
4
|
+
import { Spacer } from '../Spacer/Spacer.js';
|
|
5
|
+
import { modalOverlay, modalContainer, modalHeaderContainer, modalHeader, closeButtonWrapper, childrenWrapper, footerWrapper } from './Modal.css.vanilla.js';
|
|
6
|
+
import { H2 } from '../../typography/H2/H2.js';
|
|
7
|
+
import { BodyText } from '../../typography/BodyText/BodyText.js';
|
|
8
|
+
|
|
9
|
+
const Modal = ({
|
|
10
|
+
onBackdropClick,
|
|
11
|
+
children,
|
|
12
|
+
title,
|
|
13
|
+
subTitle,
|
|
14
|
+
hideCancel = true,
|
|
15
|
+
isConfirm,
|
|
16
|
+
background = "white",
|
|
17
|
+
querySelector = "#root",
|
|
18
|
+
footer,
|
|
19
|
+
className
|
|
20
|
+
}) => {
|
|
21
|
+
const domSafe = typeof document !== "undefined";
|
|
22
|
+
return domSafe ? createPortal(
|
|
23
|
+
/* @__PURE__ */ React.createElement(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: modalOverlay,
|
|
27
|
+
onClick: () => onBackdropClick && onBackdropClick()
|
|
28
|
+
},
|
|
29
|
+
/* @__PURE__ */ React.createElement(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: `${modalContainer({
|
|
33
|
+
backgroundColor: background,
|
|
34
|
+
maxWidth: isConfirm ? "confirm" : "regular"
|
|
35
|
+
})} ${className}`,
|
|
36
|
+
onClick: (e) => e.stopPropagation()
|
|
37
|
+
},
|
|
38
|
+
title && /* @__PURE__ */ React.createElement("div", { className: modalHeaderContainer }, /* @__PURE__ */ React.createElement("div", { className: modalHeader }, /* @__PURE__ */ React.createElement(H2, null, title), !hideCancel && /* @__PURE__ */ React.createElement(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
className: closeButtonWrapper,
|
|
42
|
+
onClick: () => onBackdropClick && onBackdropClick()
|
|
43
|
+
},
|
|
44
|
+
/* @__PURE__ */ React.createElement(Icons.Cross, null)
|
|
45
|
+
)), /* @__PURE__ */ React.createElement(BodyText, null, subTitle)),
|
|
46
|
+
children && /* @__PURE__ */ React.createElement("div", { className: childrenWrapper }, children),
|
|
47
|
+
footer && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Spacer, null), /* @__PURE__ */ React.createElement("div", { className: footerWrapper }, footer))
|
|
48
|
+
)
|
|
49
|
+
),
|
|
50
|
+
document.querySelector(querySelector) || document.body
|
|
51
|
+
) : null;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { Modal };
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { FormControl, TFormControl, TScreenWidth } from './components/FormContro
|
|
|
10
10
|
export { Header, THeader } from './components/Header/Header.js';
|
|
11
11
|
export { Input, TInput } from './components/Input/Input.js';
|
|
12
12
|
export { EListItemAlignment, ListItem, TItem, TListItem } from './components/ListItem/ListItem.js';
|
|
13
|
+
export { Modal, TModal } from './components/Modal/Modal.js';
|
|
13
14
|
export { BorderPosition, borderStyle, orderTable, orderTd, orderTh, orderThead, orderTr } from './components/OrderTable/OrderTable.css.js';
|
|
14
15
|
export { MobileOrderLine } from './components/OrderTableMobile/OrderTableMobile.js';
|
|
15
16
|
export { Pagination, TPagination } from './components/Pagination/Pagination.js';
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export { FormControl, TScreenWidth } from './components/FormControl/FormControl.
|
|
|
10
10
|
export { Header } from './components/Header/Header.js';
|
|
11
11
|
export { Input } from './components/Input/Input.js';
|
|
12
12
|
export { EListItemAlignment, ListItem } from './components/ListItem/ListItem.js';
|
|
13
|
+
export { Modal } from './components/Modal/Modal.js';
|
|
13
14
|
export { BorderPosition, borderStyle, orderTable, orderTd, orderTh, orderThead, orderTr } from './components/OrderTable/OrderTable.css.vanilla.js';
|
|
14
15
|
export { MobileOrderLine } from './components/OrderTableMobile/OrderTableMobile.js';
|
|
15
16
|
export { Pagination } from './components/Pagination/Pagination.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citygross/components_v2",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@citygross/design-tokens_v2": "^0.0.4",
|
|
69
|
-
"@citygross/icons_v2": "^0.0.
|
|
69
|
+
"@citygross/icons_v2": "^0.0.2",
|
|
70
70
|
"@citygross/react-use-bg-wizard": "^0.0.8",
|
|
71
71
|
"@citygross/typography": "^0.0.89",
|
|
72
72
|
"@citygross/utils": "^0.0.39",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"react-slick": "^0.30.1",
|
|
80
80
|
"slick-carousel": "^1.8.1"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "82e0858adcb2ec5d714a568a3cfa71ee75e4a022"
|
|
83
83
|
}
|