@mailstep/design-system 0.1.25-beta.16 → 0.1.25-beta.18
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/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageList.js","sources":["../../../../packages/ui/Blocks/ImageList/ImageList.tsx"],"sourcesContent":["import { __assign } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useRef } from 'react';\nimport { useDraggable } from 'react-use-draggable-scroll';\nimport
|
|
1
|
+
{"version":3,"file":"ImageList.js","sources":["../../../../packages/ui/Blocks/ImageList/ImageList.tsx"],"sourcesContent":["import { __assign } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useRef } from 'react';\nimport { useDraggable } from 'react-use-draggable-scroll';\nimport LightBox, { useLightBox } from '../LightBox';\nimport { AddPhoto } from './components/AddPhoto';\nimport { ImageElement } from './components/ImageElement';\nimport { x } from '@xstyled/styled-components';\nimport { ImageListContainer } from './styles';\nexport var ImageList = function (_a) {\n var onImageUpload = _a.onImageUpload, onImageRemove = _a.onImageRemove, lightBoxAction = _a.lightBoxAction, lightBoxActionTitle = _a.lightBoxActionTitle, images = _a.images, isDisabled = _a.isDisabled;\n var ref = useRef();\n var events = useDraggable(ref, { isMounted: !!(images === null || images === void 0 ? void 0 : images.length) }).events;\n var _b = useLightBox(), isLightBoxOpen = _b.isLightBoxOpen, onCloseLightBox = _b.onCloseLightBox, onOpenLightBox = _b.onOpenLightBox, lightBoxData = _b.lightBoxData;\n return (_jsxs(x.div, { display: \"flex\", alignItems: \"flex-end\", children: [_jsx(AddPhoto, { onImageUpload: onImageUpload, isDisabled: isDisabled }), images && (_jsx(ImageListContainer, __assign({ ref: ref }, events, { children: images.map(function (item, index) {\n var _a, _b;\n return (_jsx(ImageElement, { imageUrl: (_a = item.smallUrl) !== null && _a !== void 0 ? _a : item.url, onImageRemove: onImageRemove === null || onImageRemove === void 0 ? void 0 : onImageRemove(item.id), onOpenLightBox: onOpenLightBox(index), isDisabled: isDisabled }, (_b = item.id) !== null && _b !== void 0 ? _b : index));\n }) }))), _jsx(LightBox, { initialSlide: lightBoxData === null || lightBoxData === void 0 ? void 0 : lightBoxData.initialSlide, isLightBoxOpen: isLightBoxOpen, onCloseLightBox: onCloseLightBox, lightBoxAction: lightBoxAction, lightBoxActionTitle: lightBoxActionTitle, images: images })] }));\n};\n//# sourceMappingURL=ImageList.js.map"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;AASU,IAAC,SAAS,GAAG,UAAU,EAAE,EAAE;AACrC,IAAI,IAAI,aAAa,GAAG,EAAE,CAAC,aAAa,EAAE,aAAa,GAAG,EAAE,CAAC,aAAa,EAAE,cAAc,GAAG,EAAE,CAAC,cAAc,EAAE,mBAAmB,GAAG,EAAE,CAAC,mBAAmB,EAAE,MAAM,GAAG,EAAE,CAAC,MAAM,EAAE,UAAU,GAAG,EAAE,CAAC,UAAU,CAAC;AAC7M,IAAI,IAAI,GAAG,GAAG,MAAM,EAAE,CAAC;AACvB,IAAI,IAAI,MAAM,GAAG,YAAY,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC;AAC5H,IAAI,IAAI,EAAE,GAAG,WAAW,EAAE,EAAE,cAAc,GAAG,EAAE,CAAC,cAAc,EAAE,eAAe,GAAG,EAAE,CAAC,eAAe,EAAE,cAAc,GAAG,EAAE,CAAC,cAAc,EAAE,YAAY,GAAG,EAAE,CAAC,YAAY,CAAC;AACzK,IAAI,QAAQA,IAAK,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE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1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import Button from '../../Elements/Button/Button.js';
|
|
3
|
+
import { Modal } from '../Modal/Modal.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import { Swiper, SwiperSlide } from 'swiper/react';
|
|
6
|
+
import { Container, Image, ButtonContainer } from './styles.js';
|
|
2
7
|
|
|
3
|
-
// import { Button } from '../../Elements/Button'
|
|
4
|
-
// import Modal from '../Modal'
|
|
5
|
-
// import 'swiper/css'
|
|
6
|
-
// import { Swiper, SwiperSlide } from 'swiper/react'
|
|
7
|
-
// import { Container, Image, ButtonContainer } from './styles'
|
|
8
8
|
var LightBox = function (_a) {
|
|
9
|
-
_a.isLightBoxOpen
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// {images.map((item) => (
|
|
17
|
-
// <SwiperSlide key={item.id}>
|
|
18
|
-
// <Container>
|
|
19
|
-
// <Image src={item.originalUrl ?? item.url} loading="lazy" alt="" />
|
|
20
|
-
// {!!item.withLightBoxAction && lightBoxAction && lightBoxActionTitle && (
|
|
21
|
-
// <ButtonContainer>
|
|
22
|
-
// <Button onClick={lightBoxAction(item.id)} appearance="primaryLight">
|
|
23
|
-
// {lightBoxActionTitle}
|
|
24
|
-
// </Button>
|
|
25
|
-
// </ButtonContainer>
|
|
26
|
-
// )}
|
|
27
|
-
// </Container>
|
|
28
|
-
// </SwiperSlide>
|
|
29
|
-
// ))}
|
|
30
|
-
// </Swiper>
|
|
31
|
-
// </Modal>
|
|
32
|
-
// )
|
|
9
|
+
var isLightBoxOpen = _a.isLightBoxOpen, onCloseLightBox = _a.onCloseLightBox, lightBoxAction = _a.lightBoxAction, lightBoxActionTitle = _a.lightBoxActionTitle, images = _a.images, _b = _a.initialSlide, initialSlide = _b === void 0 ? 0 : _b;
|
|
10
|
+
if (!(images === null || images === void 0 ? void 0 : images.length))
|
|
11
|
+
return null;
|
|
12
|
+
return (jsx(Modal, { isShown: isLightBoxOpen, onClose: onCloseLightBox, mobileFullscreen: true, miniCloseBtn: true, withCloseIcon: true, children: jsx(Swiper, { initialSlide: initialSlide, slidesPerView: 1, autoHeight: true, children: images.map(function (item) {
|
|
13
|
+
var _a;
|
|
14
|
+
return (jsx(SwiperSlide, { children: jsxs(Container, { children: [jsx(Image, { src: (_a = item.originalUrl) !== null && _a !== void 0 ? _a : item.url, loading: "lazy", alt: "" }), !!item.withLightBoxAction && lightBoxAction && lightBoxActionTitle && (jsx(ButtonContainer, { children: jsx(Button, { onClick: lightBoxAction(item.id), appearance: "primaryLight", children: lightBoxActionTitle }) }))] }) }, item.id));
|
|
15
|
+
}) }) }));
|
|
33
16
|
};
|
|
34
17
|
|
|
35
18
|
export { LightBox };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LightBox.js","sources":["../../../../packages/ui/Blocks/LightBox/LightBox.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"LightBox.js","sources":["../../../../packages/ui/Blocks/LightBox/LightBox.tsx"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Button } from '../../Elements/Button';\nimport Modal from '../Modal';\nimport { Swiper, SwiperSlide } from 'swiper/react';\nimport { Container, Image, ButtonContainer } from './styles';\nexport var LightBox = function (_a) {\n var isLightBoxOpen = _a.isLightBoxOpen, onCloseLightBox = _a.onCloseLightBox, lightBoxAction = _a.lightBoxAction, lightBoxActionTitle = _a.lightBoxActionTitle, images = _a.images, _b = _a.initialSlide, initialSlide = _b === void 0 ? 0 : _b;\n if (!(images === null || images === void 0 ? void 0 : images.length))\n return null;\n return (_jsx(Modal, { isShown: isLightBoxOpen, onClose: onCloseLightBox, mobileFullscreen: true, miniCloseBtn: true, withCloseIcon: true, children: _jsx(Swiper, { initialSlide: initialSlide, slidesPerView: 1, autoHeight: true, children: images.map(function (item) {\n var _a;\n return (_jsx(SwiperSlide, { children: _jsxs(Container, { children: [_jsx(Image, { src: (_a = item.originalUrl) !== null && _a !== void 0 ? _a : item.url, loading: \"lazy\", alt: \"\" }), !!item.withLightBoxAction && lightBoxAction && lightBoxActionTitle && (_jsx(ButtonContainer, { children: _jsx(Button, { onClick: lightBoxAction(item.id), appearance: \"primaryLight\", children: lightBoxActionTitle }) }))] }) }, item.id));\n }) }) }));\n};\n//# sourceMappingURL=LightBox.js.map"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;AAKU,IAAC,QAAQ,GAAG,UAAU,EAAE,EAAE;AACpC,IAAI,IAAI,cAAc,GAAG,EAAE,CAAC,cAAc,EAAE,eAAe,GAAG,EAAE,CAAC,eAAe,EAAE,cAAc,GAAG,EAAE,CAAC,cAAc,EAAE,mBAAmB,GAAG,EAAE,CAAC,mBAAmB,EAAE,MAAM,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,YAAY,EAAE,YAAY,GAAG,EAAE,KAAK,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;AACpP,IAAI,IAAI,EAAE,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;AACxE,QAAQ,OAAO,IAAI,CAAC;AACpB,IAAI,QAAQA,GAAI,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAEA,GAAI,CAAC,MAAM,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE;AAC5Q,gBAAgB,IAAI,EAAE,CAAC;AACvB,gBAAgB,QAAQA,GAAI,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAEC,IAAK,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,CAACD,GAAI,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,WAAW,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,kBAAkB,IAAI,cAAc,IAAI,mBAAmB,KAAKA,GAAI,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAEA,GAAI,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE;AACnb,aAAa,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AACtB;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __makeTemplateObject } from 'tslib';
|
|
2
|
+
import styled from '@xstyled/styled-components';
|
|
3
|
+
|
|
4
|
+
var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n position: relative;\n"], ["\n width: 100%;\n height: 100%;\n position: relative;\n"])));
|
|
5
|
+
var Image = styled.img(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n"], ["\n width: 100%;\n height: 100%;\n"])));
|
|
6
|
+
var ButtonContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 100%;\n display: flex;\n justify-content: center;\n position: absolute;\n bottom: -60px;\n"], ["\n width: 100%;\n display: flex;\n justify-content: center;\n position: absolute;\n bottom: -60px;\n"])));
|
|
7
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
8
|
+
|
|
9
|
+
export { ButtonContainer, Container, Image };
|
|
10
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../packages/ui/Blocks/LightBox/styles.ts"],"sourcesContent":["import { __makeTemplateObject } from \"tslib\";\nimport styled from '@xstyled/styled-components';\nexport var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n width: 100%;\\n height: 100%;\\n position: relative;\\n\"], [\"\\n width: 100%;\\n height: 100%;\\n position: relative;\\n\"])));\nexport var Image = styled.img(templateObject_2 || (templateObject_2 = __makeTemplateObject([\"\\n width: 100%;\\n height: 100%;\\n\"], [\"\\n width: 100%;\\n height: 100%;\\n\"])));\nexport var ButtonContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject([\"\\n width: 100%;\\n display: flex;\\n justify-content: center;\\n position: absolute;\\n bottom: -60px;\\n\"], [\"\\n width: 100%;\\n display: flex;\\n justify-content: center;\\n position: absolute;\\n bottom: -60px;\\n\"])));\nvar templateObject_1, templateObject_2, templateObject_3;\n//# sourceMappingURL=styles.js.map"],"names":[],"mappings":";;;AAEU,IAAC,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,4DAA4D,CAAC,EAAE,CAAC,4DAA4D,CAAC,CAAC,CAAC,EAAE;AACvN,IAAC,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,qCAAqC,CAAC,EAAE,CAAC,qCAAqC,CAAC,CAAC,CAAC,EAAE;AACrK,IAAC,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,2GAA2G,CAAC,EAAE,CAAC,2GAA2G,CAAC,CAAC,CAAC,EAAE;AACrU,IAAI,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB;;;;"}
|