@mmb-digital/ds-lilly 0.10.64 → 0.10.65
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/ds-lilly.js
CHANGED
|
@@ -93075,7 +93075,7 @@ __webpack_require__.d(__webpack_exports__, "Dropdown2Item", function() { return
|
|
|
93075
93075
|
__webpack_require__.d(__webpack_exports__, "Icon", function() { return /* reexport */ Icon; });
|
|
93076
93076
|
__webpack_require__.d(__webpack_exports__, "IconList", function() { return /* reexport */ IconList; });
|
|
93077
93077
|
__webpack_require__.d(__webpack_exports__, "IconListItem", function() { return /* reexport */ IconListItem; });
|
|
93078
|
-
__webpack_require__.d(__webpack_exports__, "Image", function() { return /* reexport */
|
|
93078
|
+
__webpack_require__.d(__webpack_exports__, "Image", function() { return /* reexport */ Image_Image; });
|
|
93079
93079
|
__webpack_require__.d(__webpack_exports__, "Link", function() { return /* reexport */ Link; });
|
|
93080
93080
|
__webpack_require__.d(__webpack_exports__, "List", function() { return /* reexport */ List; });
|
|
93081
93081
|
__webpack_require__.d(__webpack_exports__, "ListItem", function() { return /* reexport */ ListItem; });
|
|
@@ -99878,7 +99878,7 @@ var Alert = function (_a) {
|
|
|
99878
99878
|
// CONCATENATED MODULE: ./src/components/Components/Image/Image.tsx
|
|
99879
99879
|
|
|
99880
99880
|
|
|
99881
|
-
var
|
|
99881
|
+
var Image_Image = function (_a) {
|
|
99882
99882
|
var alt = _a.alt, isAriaHidden = _a.isAriaHidden, isCover = _a.isCover, src = _a.src, testId = _a.testId, theme = _a.theme;
|
|
99883
99883
|
return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("img", { alt: alt, "aria-hidden": isAriaHidden && 'true', className: classBinder_cx('c-image', { 'c-image--cover': isCover }, theme), "data-testid": testId, role: !alt ? 'presentation' : undefined, src: src }));
|
|
99884
99884
|
};
|
|
@@ -99900,7 +99900,7 @@ var Avatar = function (_a) {
|
|
|
99900
99900
|
return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: componentClassName, "data-testid": testId, style: { background: backgroundCustom, borderColor: borderColorCustom } },
|
|
99901
99901
|
text && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("span", { "aria-hidden": "true", className: "c-avatar__text" }, text)),
|
|
99902
99902
|
iconName && external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Icon, { name: iconName }),
|
|
99903
|
-
imageUrl && external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(
|
|
99903
|
+
imageUrl && external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Image_Image, { alt: "", src: imageUrl })));
|
|
99904
99904
|
};
|
|
99905
99905
|
|
|
99906
99906
|
// CONCATENATED MODULE: ./src/components/Components/Avatar/index.ts
|
|
@@ -109051,6 +109051,26 @@ var slick_theme = __webpack_require__(1062);
|
|
|
109051
109051
|
var lib = __webpack_require__(1038);
|
|
109052
109052
|
var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
|
|
109053
109053
|
|
|
109054
|
+
// EXTERNAL MODULE: ./src/components/Components/Icon/_parts_/Logo.js
|
|
109055
|
+
var Logo = __webpack_require__(64);
|
|
109056
|
+
|
|
109057
|
+
// CONCATENATED MODULE: ./src/components/Components/Loader/Loader.tsx
|
|
109058
|
+
|
|
109059
|
+
|
|
109060
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
109061
|
+
// @ts-ignore
|
|
109062
|
+
|
|
109063
|
+
var Loader = function (_a) {
|
|
109064
|
+
var _b, _c;
|
|
109065
|
+
var children = _a.children, isContentPulsing = _a.isContentPulsing, size = _a.size, testId = _a.testId, theme = _a.theme;
|
|
109066
|
+
var isSizeSmall = size === 'small';
|
|
109067
|
+
return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-loader', (_b = {}, _b['c-loader--small'] = isSizeSmall, _b), theme), "data-testid": testId },
|
|
109068
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-loader__sonar1') }),
|
|
109069
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-loader__sonar2') }),
|
|
109070
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-loader__sonar3') }),
|
|
109071
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-loader__content', (_c = {}, _c['c-loader__content--pulse'] = isContentPulsing, _c)) }, children || external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Logo["default"], { className: classBinder_cx('c-loader__image') }))));
|
|
109072
|
+
};
|
|
109073
|
+
|
|
109054
109074
|
// CONCATENATED MODULE: ./src/components/Components/Carousel/Carousel.tsx
|
|
109055
109075
|
var Carousel_assign = (undefined && undefined.__assign) || function () {
|
|
109056
109076
|
Carousel_assign = Object.assign || function(t) {
|
|
@@ -109082,21 +109102,31 @@ var Carousel_rest = (undefined && undefined.__rest) || function (s, e) {
|
|
|
109082
109102
|
|
|
109083
109103
|
|
|
109084
109104
|
|
|
109105
|
+
|
|
109085
109106
|
var MIN_IMG_WIDTH = 200;
|
|
109086
109107
|
var MAX_IMG_WIDTH = 300;
|
|
109108
|
+
var cacheImage = function (src) {
|
|
109109
|
+
return new Promise(function (resolve, reject) {
|
|
109110
|
+
var img = new Image();
|
|
109111
|
+
img.onload = function () { return resolve(null); };
|
|
109112
|
+
img.onerror = function () { return reject(); };
|
|
109113
|
+
img.src = src;
|
|
109114
|
+
});
|
|
109115
|
+
};
|
|
109087
109116
|
var Arrow = function (_a) {
|
|
109088
|
-
var direction = _a.direction, isSwiping = _a.isSwiping, messages = _a.messages, _b = _a.show, show = _b === void 0 ? true : _b, slideWidth = _a.slideWidth, slider = _a.slider, width = _a.width;
|
|
109117
|
+
var direction = _a.direction, isSwiping = _a.isSwiping, messages = _a.messages, _b = _a.show, show = _b === void 0 ? true : _b, slideWidth = _a.slideWidth, slider = _a.slider, testId = _a.testId, width = _a.width;
|
|
109089
109118
|
var arrowPosition = width && (width - slideWidth) / 2;
|
|
109090
109119
|
return show && slider && arrowPosition ? (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("span", { className: classBinder_cx('c-carousel__arrow', "c-carousel__arrow_" + direction, { 'c-carousel__arrow--swiping': isSwiping }), style: direction === 'left' ? { left: arrowPosition } : { right: arrowPosition } },
|
|
109091
|
-
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Button, { isRounded: true, isSmall: true, allowEventPropagation: false, ariaLabel: messages[direction === 'left' ? 'back' : 'next'], onlyIconName: direction === 'left' ? 'arrowLeftFill' : 'arrowRightFill', type: "filled", onClick: direction === 'left' ? slider.slickPrev : slider.slickNext }))) : null;
|
|
109120
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Button, { isRounded: true, isSmall: true, allowEventPropagation: false, ariaLabel: messages[direction === 'left' ? 'back' : 'next'], onlyIconName: direction === 'left' ? 'arrowLeftFill' : 'arrowRightFill', testId: testId + "-arrow-" + direction, type: "filled", onClick: direction === 'left' ? slider.slickPrev : slider.slickNext }))) : null;
|
|
109092
109121
|
};
|
|
109093
109122
|
var Carousel = function (_a) {
|
|
109094
|
-
var _b = _a.hasPreview, hasPreview = _b === void 0 ? true : _b, messages = _a.messages, onChange = _a.onChange, slides = _a.slides, theme = _a.theme, props = Carousel_rest(_a, ["hasPreview", "messages", "onChange", "slides", "theme"]);
|
|
109123
|
+
var _b = _a.hasPreview, hasPreview = _b === void 0 ? true : _b, messages = _a.messages, onChange = _a.onChange, slides = _a.slides, testId = _a.testId, theme = _a.theme, props = Carousel_rest(_a, ["hasPreview", "messages", "onChange", "slides", "testId", "theme"]);
|
|
109095
109124
|
var _c = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(props.initialSlide || 0), nextSlide = _c[0], setNextSlide = _c[1];
|
|
109096
109125
|
var _d = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(), width = _d[0], setWidth = _d[1];
|
|
109097
109126
|
var _e = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(false), isSwiping = _e[0], setSwiping = _e[1];
|
|
109098
109127
|
var sliderRef = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useRef"])(null);
|
|
109099
109128
|
var wrapperRef = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useRef"])();
|
|
109129
|
+
var _f = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(false), imagesLoaded = _f[0], setImagesLoaded = _f[1];
|
|
109100
109130
|
var resizeListener = function () {
|
|
109101
109131
|
var _a;
|
|
109102
109132
|
((_a = wrapperRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) && setWidth(wrapperRef.current.clientWidth);
|
|
@@ -109110,25 +109140,38 @@ var Carousel = function (_a) {
|
|
|
109110
109140
|
Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useEffect"])(function () {
|
|
109111
109141
|
onChange === null || onChange === void 0 ? void 0 : onChange(nextSlide);
|
|
109112
109142
|
}, [onChange, nextSlide]);
|
|
109143
|
+
Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useEffect"])(function () {
|
|
109144
|
+
Promise.all(slides.map(function (_a) {
|
|
109145
|
+
var src = _a.src;
|
|
109146
|
+
return cacheImage(src);
|
|
109147
|
+
})).then(function () { return setImagesLoaded(true); });
|
|
109148
|
+
}, [slides]);
|
|
109113
109149
|
var slideWidth = width ? Math.min(Math.max(MIN_IMG_WIDTH, width / 3), MAX_IMG_WIDTH) : MIN_IMG_WIDTH;
|
|
109150
|
+
var hasNextSlide = props.infinite === false ? nextSlide < slides.length - 1 : true;
|
|
109151
|
+
var hasPreviousSlide = props.infinite === false ? nextSlide > 0 : true;
|
|
109114
109152
|
var config = Carousel_assign(Carousel_assign({ beforeChange: function (_, next) {
|
|
109115
109153
|
setNextSlide(next);
|
|
109116
109154
|
}, swipeEvent: function () {
|
|
109117
|
-
// TODO: try enable later
|
|
109118
109155
|
setSwiping(false);
|
|
109119
|
-
}, arrows: true, centerMode: true, draggable: true, infinite:
|
|
109120
|
-
|
|
109121
|
-
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-
|
|
109156
|
+
}, arrows: true, centerMode: true, draggable: true, infinite: true, swipe: true, initialSlide: props.initialSlide || 0, slidesToShow: 1, variableWidth: true, useTransform: false, nextArrow: (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Arrow, { direction: "right", isSwiping: isSwiping, messages: messages, show: hasNextSlide, slideWidth: slideWidth, slider: sliderRef.current, width: width })), prevArrow: (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Arrow, { direction: "left", isSwiping: isSwiping, messages: messages, show: hasPreviousSlide, slideWidth: slideWidth, slider: sliderRef.current, width: width })) }, props), { dots: !hasPreview });
|
|
109157
|
+
if (!imagesLoaded)
|
|
109158
|
+
return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-carousel__loader'), "data-testid": testId },
|
|
109159
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Loader, null)));
|
|
109160
|
+
return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { ref: function (ref) { return setWidth(ref === null || ref === void 0 ? void 0 : ref.clientWidth); }, className: classBinder_cx('c-carousel', theme), "data-testid": testId },
|
|
109161
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-carousel__wrapper', {
|
|
109162
|
+
'c-carousel__wrapper--not-infinite--first': !hasPreviousSlide,
|
|
109163
|
+
'c-carousel__wrapper--not-infinite--last': !hasNextSlide
|
|
109164
|
+
}) },
|
|
109122
109165
|
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(lib_default.a, Carousel_assign({}, config, { ref: function (ref) { return (sliderRef.current = ref); } }), slides.map(function (_a, key) {
|
|
109123
109166
|
var alt = _a.alt, src = _a.src;
|
|
109124
109167
|
return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { key: key, className: "c-carousel__slide", style: { width: slideWidth } },
|
|
109125
|
-
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(
|
|
109168
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Image_Image, { alt: alt, src: src })));
|
|
109126
109169
|
}))),
|
|
109127
109170
|
hasPreview && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-carousel__dots') }, slides.map(function (_a, key) {
|
|
109128
109171
|
var alt = _a.alt, src = _a.src;
|
|
109129
|
-
return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("a", { "aria-pressed": nextSlide === key, className: classBinder_cx('c-carousel__dot', "c-carousel__dot--" + (nextSlide === key ? 'active' : 'disabled')), role: "button", tabIndex: 0, onClick: function () { var _a; return (_a = sliderRef.current) === null || _a === void 0 ? void 0 : _a.slickGoTo(key); } },
|
|
109130
|
-
|
|
109131
|
-
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(
|
|
109172
|
+
return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("a", { "aria-pressed": nextSlide === key, className: classBinder_cx('c-carousel__dot', "c-carousel__dot--" + (nextSlide === key ? 'active' : 'disabled')), "data-testid": testId + "-preview-" + key, role: "button", tabIndex: 0, onClick: function () { var _a; return (_a = sliderRef.current) === null || _a === void 0 ? void 0 : _a.slickGoTo(key); } },
|
|
109173
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Image_Image, { alt: alt, src: src }),
|
|
109174
|
+
nextSlide === key && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Icon, { backgroundColor: "greenNormal", name: "tick", size: "small", theme: classBinder_cx('c-carousel__dot__activeIcon') }))));
|
|
109132
109175
|
})))));
|
|
109133
109176
|
};
|
|
109134
109177
|
|
|
@@ -110248,26 +110291,6 @@ var ListItem = function (_a) {
|
|
|
110248
110291
|
|
|
110249
110292
|
|
|
110250
110293
|
|
|
110251
|
-
// EXTERNAL MODULE: ./src/components/Components/Icon/_parts_/Logo.js
|
|
110252
|
-
var Logo = __webpack_require__(64);
|
|
110253
|
-
|
|
110254
|
-
// CONCATENATED MODULE: ./src/components/Components/Loader/Loader.tsx
|
|
110255
|
-
|
|
110256
|
-
|
|
110257
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
110258
|
-
// @ts-ignore
|
|
110259
|
-
|
|
110260
|
-
var Loader = function (_a) {
|
|
110261
|
-
var _b, _c;
|
|
110262
|
-
var children = _a.children, isContentPulsing = _a.isContentPulsing, size = _a.size, testId = _a.testId, theme = _a.theme;
|
|
110263
|
-
var isSizeSmall = size === 'small';
|
|
110264
|
-
return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-loader', (_b = {}, _b['c-loader--small'] = isSizeSmall, _b), theme), "data-testid": testId },
|
|
110265
|
-
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-loader__sonar1') }),
|
|
110266
|
-
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-loader__sonar2') }),
|
|
110267
|
-
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-loader__sonar3') }),
|
|
110268
|
-
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-loader__content', (_c = {}, _c['c-loader__content--pulse'] = isContentPulsing, _c)) }, children || external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Logo["default"], { className: classBinder_cx('c-loader__image') }))));
|
|
110269
|
-
};
|
|
110270
|
-
|
|
110271
110294
|
// CONCATENATED MODULE: ./src/components/Components/Loader/index.ts
|
|
110272
110295
|
|
|
110273
110296
|
|
|
@@ -6,15 +6,17 @@ declare type Messages = {
|
|
|
6
6
|
next: string;
|
|
7
7
|
back: string;
|
|
8
8
|
};
|
|
9
|
+
declare type Slide = {
|
|
10
|
+
src: string;
|
|
11
|
+
alt: string;
|
|
12
|
+
};
|
|
13
|
+
declare type Slides = Array<Slide>;
|
|
9
14
|
interface Props extends ComponentPropsType, Partial<Settings> {
|
|
10
|
-
slides:
|
|
11
|
-
src: string;
|
|
12
|
-
alt: string;
|
|
13
|
-
}>;
|
|
15
|
+
slides: Slides;
|
|
14
16
|
onChange?: (index: number) => void;
|
|
15
17
|
hasPreview?: boolean;
|
|
16
18
|
messages: Messages;
|
|
17
19
|
}
|
|
18
|
-
export declare const Carousel: ({ hasPreview, messages, onChange, slides, theme, ...props }: Props) => JSX.Element;
|
|
20
|
+
export declare const Carousel: ({ hasPreview, messages, onChange, slides, testId, theme, ...props }: Props) => JSX.Element;
|
|
19
21
|
export {};
|
|
20
22
|
//# sourceMappingURL=Carousel.d.ts.map
|