pds-dev-kit-web-test 0.2.0 → 0.2.2

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.
Files changed (33) hide show
  1. package/dist/src/sub/DynamicLayout/components/Box.d.ts +13 -0
  2. package/dist/src/sub/DynamicLayout/components/Box.js +73 -0
  3. package/dist/src/sub/DynamicLayout/components/desktop/common/Carousel.d.ts +2 -1
  4. package/dist/src/sub/DynamicLayout/components/desktop/common/Carousel.js +6 -6
  5. package/dist/src/sub/DynamicLayout/components/index.d.ts +1 -0
  6. package/dist/src/sub/DynamicLayout/components/index.js +6 -1
  7. package/dist/src/sub/DynamicLayout/custonSectionSampleData.d.ts +161 -0
  8. package/dist/src/sub/DynamicLayout/custonSectionSampleData.js +161 -0
  9. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/BlockMatcher.js +21 -0
  10. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/Accordion.d.ts +12 -0
  11. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/Accordion.js +46 -0
  12. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/AccordionBody.d.ts +8 -0
  13. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/AccordionBody.js +74 -0
  14. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/AccordionCore.d.ts +13 -0
  15. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/AccordionCore.js +25 -0
  16. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/AccordionHeader.d.ts +7 -0
  17. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/AccordionHeader.js +49 -0
  18. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/AccordionItem.d.ts +7 -0
  19. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/AccordionItem.js +19 -0
  20. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/index.d.ts +4 -0
  21. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/AccordionCore/index.js +14 -0
  22. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/ContentsCarousel/CardItem.d.ts +9 -0
  23. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/ContentsCarousel/CardItem.js +34 -0
  24. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/ContentsCarousel/ContentsCarousel.d.ts +28 -0
  25. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/ContentsCarousel/ContentsCarousel.js +53 -0
  26. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/ImageCarousel/ImageCarousel.d.ts +16 -0
  27. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/ImageCarousel/ImageCarousel.js +41 -0
  28. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/index.d.ts +1 -0
  29. package/dist/src/sub/DynamicLayout/sections/CustomSection/BlockMatcher/blocks/index.js +3 -1
  30. package/dist/src/sub/DynamicLayout/sections/CustomSection/types.d.ts +28 -1
  31. package/dist/src/sub/DynamicLayout/sections/CustomSection/types.js +4 -1
  32. package/package.json +2 -1
  33. package/release-note.md +4 -3
@@ -0,0 +1,13 @@
1
+ import type { CSSProperties } from 'react';
2
+ declare type Props = {
3
+ direction?: 'vertical' | 'horizontal';
4
+ children: React.ReactNode;
5
+ relative?: boolean;
6
+ justifyContent?: boolean;
7
+ alignItems?: boolean;
8
+ flex?: boolean;
9
+ style?: CSSProperties;
10
+ className?: string;
11
+ };
12
+ declare function Box({ direction, children, relative, justifyContent, alignItems, flex, style, className }: Props): JSX.Element;
13
+ export default Box;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ var jsx_runtime_1 = require("react/jsx-runtime");
38
+ var styled_components_1 = __importStar(require("styled-components"));
39
+ function Box(_a) {
40
+ var _b = _a.direction, direction = _b === void 0 ? 'horizontal' : _b, children = _a.children, relative = _a.relative, justifyContent = _a.justifyContent, alignItems = _a.alignItems, flex = _a.flex, style = _a.style, className = _a.className;
41
+ if (direction === 'horizontal') {
42
+ return ((0, jsx_runtime_1.jsx)(Row, __assign({ style: style, relative: relative, justifyContent: justifyContent, alignItems: alignItems, flex: flex, className: className }, { children: children }), void 0));
43
+ }
44
+ return ((0, jsx_runtime_1.jsx)(Col, __assign({ style: style, relative: relative, justifyContent: justifyContent, alignItems: alignItems, flex: flex, className: className }, { children: children }), void 0));
45
+ }
46
+ exports.default = Box;
47
+ var Col = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n\n ", ";\n\n ", ";\n\n ", ";\n\n ", ";\n"], ["\n display: flex;\n flex-direction: column;\n\n ", ";\n\n ", ";\n\n ", ";\n\n ", ";\n"])), function (_a) {
48
+ var relative = _a.relative;
49
+ return relative && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n "], ["\n position: relative;\n "])));
50
+ }, function (_a) {
51
+ var justifyContent = _a.justifyContent;
52
+ return justifyContent && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n justify-content: center;\n "], ["\n justify-content: center;\n "])));
53
+ }, function (_a) {
54
+ var alignItems = _a.alignItems;
55
+ return alignItems && (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n align-items: center;\n "], ["\n align-items: center;\n "])));
56
+ }, function (_a) {
57
+ var flex = _a.flex;
58
+ return flex && (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex: 1;\n "], ["\n flex: 1;\n "])));
59
+ });
60
+ var Row = styled_components_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n\n ", ";\n\n ", ";\n\n ", ";\n\n ", ";\n"], ["\n display: flex;\n flex-direction: row;\n\n ", ";\n\n ", ";\n\n ", ";\n\n ", ";\n"])), function (_a) {
61
+ var relative = _a.relative;
62
+ return relative && (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n position: relative;\n "], ["\n position: relative;\n "])));
63
+ }, function (_a) {
64
+ var justifyContent = _a.justifyContent;
65
+ return justifyContent && (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n justify-content: center;\n "], ["\n justify-content: center;\n "])));
66
+ }, function (_a) {
67
+ var alignItems = _a.alignItems;
68
+ return alignItems && (0, styled_components_1.css)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n align-items: center;\n "], ["\n align-items: center;\n "])));
69
+ }, function (_a) {
70
+ var flex = _a.flex;
71
+ return flex && (0, styled_components_1.css)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n flex: 1;\n "], ["\n flex: 1;\n "])));
72
+ });
73
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
@@ -11,6 +11,7 @@ interface Carousel {
11
11
  mode?: 'normal' | 'loop' | 'autoplay';
12
12
  autoplayDelay?: number;
13
13
  buttonSpacing?: string;
14
+ allowTouchMove?: boolean;
14
15
  }
15
- declare function Carousel({ children, spaceBetween, slidesPerView, slidesPerGroup, breakpoints, mode, autoplayDelay, buttonSpacing }: Carousel): JSX.Element;
16
+ declare function Carousel({ children, spaceBetween, slidesPerView, slidesPerGroup, breakpoints, mode, autoplayDelay, buttonSpacing, allowTouchMove }: Carousel): JSX.Element;
16
17
  export default Carousel;
@@ -45,12 +45,12 @@ var styled_components_1 = __importDefault(require("styled-components"));
45
45
  var pdsOriginal_1 = require("../../pdsOriginal");
46
46
  var swiper_style_1 = __importDefault(require("./swiper.style"));
47
47
  function Carousel(_a) {
48
- var children = _a.children, spaceBetween = _a.spaceBetween, slidesPerView = _a.slidesPerView, slidesPerGroup = _a.slidesPerGroup, breakpoints = _a.breakpoints, _b = _a.mode, mode = _b === void 0 ? 'normal' : _b, _c = _a.autoplayDelay, autoplayDelay = _c === void 0 ? 3 : _c, buttonSpacing = _a.buttonSpacing;
48
+ var children = _a.children, spaceBetween = _a.spaceBetween, slidesPerView = _a.slidesPerView, slidesPerGroup = _a.slidesPerGroup, breakpoints = _a.breakpoints, _b = _a.mode, mode = _b === void 0 ? 'normal' : _b, _c = _a.autoplayDelay, autoplayDelay = _c === void 0 ? 3 : _c, buttonSpacing = _a.buttonSpacing, _d = _a.allowTouchMove, allowTouchMove = _d === void 0 ? true : _d;
49
49
  var swiperRef = (0, react_1.useRef)(null);
50
- var _d = (0, react_1.useState)(true), isBeginning = _d[0], setIsBeginning = _d[1];
51
- var _e = (0, react_1.useState)(true), isEnd = _e[0], setIsEnd = _e[1];
52
- var _f = (0, react_1.useState)(true), isLocked = _f[0], setIsLocked = _f[1];
53
- var _g = (0, react_1.useState)(mode), targetMode = _g[0], setTargetMode = _g[1];
50
+ var _e = (0, react_1.useState)(true), isBeginning = _e[0], setIsBeginning = _e[1];
51
+ var _f = (0, react_1.useState)(true), isEnd = _f[0], setIsEnd = _f[1];
52
+ var _g = (0, react_1.useState)(true), isLocked = _g[0], setIsLocked = _g[1];
53
+ var _h = (0, react_1.useState)(mode), targetMode = _h[0], setTargetMode = _h[1];
54
54
  /**
55
55
  * @when : 캐러셀이 처음 화면에 렌더링될 때
56
56
  * @expected
@@ -66,7 +66,7 @@ function Carousel(_a) {
66
66
  }
67
67
  setTargetMode(mode);
68
68
  }, [slidesPerView, mode, children]);
69
- return ((0, jsx_runtime_1.jsxs)(S_Carousel, { children: [(0, jsx_runtime_1.jsx)(S_SwiperStyleWrapper, { children: (0, jsx_runtime_1.jsx)(react_2.Swiper, __assign({ modules: [swiper_1.Navigation, swiper_1.Autoplay], centerInsufficientSlides: true, spaceBetween: spaceBetween, slidesPerView: slidesPerView, slidesPerGroup: slidesPerGroup, breakpoints: breakpoints, loop: targetMode === 'loop' || targetMode === 'autoplay', autoplay: targetMode === 'autoplay'
69
+ return ((0, jsx_runtime_1.jsxs)(S_Carousel, { children: [(0, jsx_runtime_1.jsx)(S_SwiperStyleWrapper, { children: (0, jsx_runtime_1.jsx)(react_2.Swiper, __assign({ allowTouchMove: allowTouchMove, modules: [swiper_1.Navigation, swiper_1.Autoplay], centerInsufficientSlides: true, spaceBetween: spaceBetween, slidesPerView: slidesPerView, slidesPerGroup: slidesPerGroup, breakpoints: breakpoints, loop: targetMode === 'loop' || targetMode === 'autoplay', autoplay: targetMode === 'autoplay'
70
70
  ? { delay: autoplayDelay * 1000, disableOnInteraction: false }
71
71
  : undefined, onSwiper: function (swiper) {
72
72
  swiperRef.current = swiper;
@@ -1,2 +1,3 @@
1
1
  export * from './pdsOriginal';
2
2
  export { Section } from './Section';
3
+ export { default as Box } from './Box';
@@ -9,8 +9,13 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
9
9
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
+ var __importDefault = (this && this.__importDefault) || function (mod) {
13
+ return (mod && mod.__esModule) ? mod : { "default": mod };
14
+ };
12
15
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.Section = void 0;
16
+ exports.Box = exports.Section = void 0;
14
17
  __exportStar(require("./pdsOriginal"), exports);
15
18
  var Section_1 = require("./Section");
16
19
  Object.defineProperty(exports, "Section", { enumerable: true, get: function () { return Section_1.Section; } });
20
+ var Box_1 = require("./Box");
21
+ Object.defineProperty(exports, "Box", { enumerable: true, get: function () { return __importDefault(Box_1).default; } });
@@ -18,6 +18,11 @@ export declare const customsectionMock: ({
18
18
  accountId?: undefined;
19
19
  startAt?: undefined;
20
20
  endAt?: undefined;
21
+ accordionItems?: undefined;
22
+ openedItemId?: undefined;
23
+ carouselSettings?: undefined;
24
+ contentsCarouselItems?: undefined;
25
+ imgCarouselItems?: undefined;
21
26
  };
22
27
  };
23
28
  };
@@ -50,6 +55,11 @@ export declare const customsectionMock: ({
50
55
  accountId?: undefined;
51
56
  startAt?: undefined;
52
57
  endAt?: undefined;
58
+ accordionItems?: undefined;
59
+ openedItemId?: undefined;
60
+ carouselSettings?: undefined;
61
+ contentsCarouselItems?: undefined;
62
+ imgCarouselItems?: undefined;
53
63
  };
54
64
  };
55
65
  };
@@ -78,6 +88,11 @@ export declare const customsectionMock: ({
78
88
  accountId?: undefined;
79
89
  startAt?: undefined;
80
90
  endAt?: undefined;
91
+ accordionItems?: undefined;
92
+ openedItemId?: undefined;
93
+ carouselSettings?: undefined;
94
+ contentsCarouselItems?: undefined;
95
+ imgCarouselItems?: undefined;
81
96
  };
82
97
  };
83
98
  };
@@ -106,6 +121,11 @@ export declare const customsectionMock: ({
106
121
  accountId?: undefined;
107
122
  startAt?: undefined;
108
123
  endAt?: undefined;
124
+ accordionItems?: undefined;
125
+ openedItemId?: undefined;
126
+ carouselSettings?: undefined;
127
+ contentsCarouselItems?: undefined;
128
+ imgCarouselItems?: undefined;
109
129
  };
110
130
  };
111
131
  };
@@ -134,6 +154,11 @@ export declare const customsectionMock: ({
134
154
  alt?: undefined;
135
155
  startAt?: undefined;
136
156
  endAt?: undefined;
157
+ accordionItems?: undefined;
158
+ openedItemId?: undefined;
159
+ carouselSettings?: undefined;
160
+ contentsCarouselItems?: undefined;
161
+ imgCarouselItems?: undefined;
137
162
  };
138
163
  };
139
164
  };
@@ -162,6 +187,142 @@ export declare const customsectionMock: ({
162
187
  size?: undefined;
163
188
  alt?: undefined;
164
189
  accountId?: undefined;
190
+ accordionItems?: undefined;
191
+ openedItemId?: undefined;
192
+ carouselSettings?: undefined;
193
+ contentsCarouselItems?: undefined;
194
+ imgCarouselItems?: undefined;
195
+ };
196
+ };
197
+ };
198
+ style: {
199
+ backgroundColor: string;
200
+ };
201
+ layout: {};
202
+ hoverStyle?: undefined;
203
+ } | {
204
+ type: string;
205
+ gridItemData: {
206
+ x: number;
207
+ y: number;
208
+ w: number;
209
+ h: number;
210
+ i: string;
211
+ };
212
+ content: {
213
+ data: {
214
+ type: string;
215
+ value: {
216
+ accordionItems: {
217
+ title: string;
218
+ description: string;
219
+ }[];
220
+ openedItemId: string;
221
+ text?: undefined;
222
+ size?: undefined;
223
+ src?: undefined;
224
+ alt?: undefined;
225
+ accountId?: undefined;
226
+ startAt?: undefined;
227
+ endAt?: undefined;
228
+ carouselSettings?: undefined;
229
+ contentsCarouselItems?: undefined;
230
+ imgCarouselItems?: undefined;
231
+ };
232
+ };
233
+ };
234
+ style: {
235
+ backgroundColor: string;
236
+ };
237
+ layout: {};
238
+ hoverStyle?: undefined;
239
+ } | {
240
+ type: string;
241
+ gridItemData: {
242
+ x: number;
243
+ y: number;
244
+ w: number;
245
+ h: number;
246
+ i: string;
247
+ };
248
+ content: {
249
+ data: {
250
+ type: string;
251
+ value: {
252
+ carouselSettings: {
253
+ mode: string;
254
+ carouselAutoplayTime: number;
255
+ spaceBetween: number;
256
+ slidesPerView: number;
257
+ sliderPerGroup: number;
258
+ buttonSpacing: string;
259
+ effect?: undefined;
260
+ };
261
+ contentsCarouselItems: {
262
+ title: string;
263
+ description: string;
264
+ imageSrc: string;
265
+ linkSrc: string;
266
+ linkType: string;
267
+ buttonLabel: string;
268
+ id: string;
269
+ }[];
270
+ text?: undefined;
271
+ size?: undefined;
272
+ src?: undefined;
273
+ alt?: undefined;
274
+ accountId?: undefined;
275
+ startAt?: undefined;
276
+ endAt?: undefined;
277
+ accordionItems?: undefined;
278
+ openedItemId?: undefined;
279
+ imgCarouselItems?: undefined;
280
+ };
281
+ };
282
+ };
283
+ style: {
284
+ backgroundColor: string;
285
+ };
286
+ layout: {};
287
+ hoverStyle?: undefined;
288
+ } | {
289
+ type: string;
290
+ gridItemData: {
291
+ x: number;
292
+ y: number;
293
+ w: number;
294
+ h: number;
295
+ i: string;
296
+ };
297
+ content: {
298
+ data: {
299
+ type: string;
300
+ value: {
301
+ carouselSettings: {
302
+ mode: string;
303
+ carouselAutoplayTime: number;
304
+ spaceBetween: number;
305
+ slidesPerView: number;
306
+ sliderPerGroup: number;
307
+ effect: string;
308
+ buttonSpacing?: undefined;
309
+ };
310
+ imgCarouselItems: {
311
+ title: string;
312
+ description: string;
313
+ imageSrc: string;
314
+ id: string;
315
+ }[];
316
+ text?: undefined;
317
+ size?: undefined;
318
+ src?: undefined;
319
+ alt?: undefined;
320
+ accountId?: undefined;
321
+ startAt?: undefined;
322
+ endAt?: undefined;
323
+ accordionItems?: undefined;
324
+ openedItemId?: undefined;
325
+ contentsCarouselItems?: undefined;
165
326
  };
166
327
  };
167
328
  };
@@ -163,5 +163,166 @@ exports.customsectionMock = [
163
163
  backgroundColor: 'yellow'
164
164
  },
165
165
  layout: {}
166
+ },
167
+ {
168
+ type: 'ACCORDION',
169
+ gridItemData: {
170
+ x: 5,
171
+ y: 5,
172
+ w: 6,
173
+ h: 10,
174
+ i: '8'
175
+ },
176
+ content: {
177
+ data: {
178
+ type: 'ACCORDION',
179
+ value: {
180
+ accordionItems: [
181
+ { title: 'title1', description: 'description1' },
182
+ { title: 'title2', description: 'description2' },
183
+ { title: 'title3', description: 'description3' }
184
+ ],
185
+ openedItemId: '0'
186
+ }
187
+ }
188
+ },
189
+ style: {
190
+ backgroundColor: 'white'
191
+ // display: 'flex',
192
+ // flexDirection: 'column',
193
+ // justifyContent: 'center',
194
+ // alignItems: 'center'
195
+ },
196
+ layout: {}
197
+ },
198
+ {
199
+ type: 'CONTENTS_CAROUSEL',
200
+ gridItemData: {
201
+ x: 5,
202
+ y: 5,
203
+ w: 10,
204
+ h: 10,
205
+ i: '9'
206
+ },
207
+ content: {
208
+ data: {
209
+ type: 'CONTENTS_CAROUSEL',
210
+ value: {
211
+ carouselSettings: {
212
+ mode: 'normal',
213
+ carouselAutoplayTime: 1,
214
+ spaceBetween: 10,
215
+ slidesPerView: 3,
216
+ sliderPerGroup: 1,
217
+ buttonSpacing: '10px'
218
+ },
219
+ contentsCarouselItems: [
220
+ {
221
+ title: 'im 1 carousel item',
222
+ description: 'im 1 carousel item',
223
+ imageSrc: 'https://cdn.dev.publishingkit.net/d474e86e-9df7-44dd-999e-0bc2a7c9b267.jpg',
224
+ linkSrc: 'im 1 carousel item',
225
+ linkType: 'NONE',
226
+ buttonLabel: 'im 1 carousel item',
227
+ id: '1'
228
+ },
229
+ {
230
+ title: 'im 2 carousel item',
231
+ description: 'im 2 carousel item',
232
+ imageSrc: 'https://cdn.dev.publishingkit.net/5cbc7c88-9566-4ce1-9dc8-0845259aa6a1.jpg',
233
+ linkSrc: 'im 2 carousel item',
234
+ linkType: 'NONE',
235
+ buttonLabel: 'im 2 carousel item',
236
+ id: '2'
237
+ },
238
+ {
239
+ title: 'im 3 carousel item',
240
+ description: 'im 3 carousel item',
241
+ imageSrc: 'https://cdn.dev.publishingkit.net/172b5a98-fd4b-4b2e-bdca-928d182c1548.jpg',
242
+ linkSrc: 'im 3 carousel item',
243
+ linkType: 'NONE',
244
+ buttonLabel: 'im 3 carousel item',
245
+ id: '3'
246
+ },
247
+ {
248
+ title: 'im 4 carousel item',
249
+ description: 'im 4 carousel item',
250
+ imageSrc: 'https://cdn.dev.publishingkit.net/30ddd804-841a-416f-88a6-fbcb84924036.jpg',
251
+ linkSrc: 'im 4 carousel item',
252
+ linkType: 'NONE',
253
+ buttonLabel: 'im 4 carousel item',
254
+ id: '4'
255
+ }
256
+ ]
257
+ }
258
+ }
259
+ },
260
+ style: {
261
+ backgroundColor: 'white'
262
+ // display: 'flex',
263
+ // flexDirection: 'column',
264
+ // justifyContent: 'center',
265
+ // alignItems: 'center'
266
+ },
267
+ layout: {}
268
+ },
269
+ {
270
+ type: 'IMAGE_CAROUSEL',
271
+ gridItemData: {
272
+ x: 5,
273
+ y: 5,
274
+ w: 10,
275
+ h: 10,
276
+ i: '10'
277
+ },
278
+ content: {
279
+ data: {
280
+ type: 'IMAGE_CAROUSEL',
281
+ value: {
282
+ carouselSettings: {
283
+ mode: 'normal',
284
+ carouselAutoplayTime: 1,
285
+ spaceBetween: 10,
286
+ slidesPerView: 1,
287
+ sliderPerGroup: 1,
288
+ effect: 'fade'
289
+ },
290
+ imgCarouselItems: [
291
+ {
292
+ title: 'im 1 carousel item',
293
+ description: 'im 1 carousel item',
294
+ imageSrc: 'https://cdn.dev.publishingkit.net/d474e86e-9df7-44dd-999e-0bc2a7c9b267.jpg',
295
+ id: '1'
296
+ },
297
+ {
298
+ title: 'im 2 carousel item',
299
+ description: 'im 2 carousel item',
300
+ imageSrc: 'https://cdn.dev.publishingkit.net/5cbc7c88-9566-4ce1-9dc8-0845259aa6a1.jpg',
301
+ id: '2'
302
+ },
303
+ {
304
+ title: 'im 3 carousel item',
305
+ description: 'im 3 carousel item',
306
+ imageSrc: 'https://cdn.dev.publishingkit.net/172b5a98-fd4b-4b2e-bdca-928d182c1548.jpg',
307
+ id: '3'
308
+ },
309
+ {
310
+ title: 'im 4 carousel item',
311
+ description: 'im 4 carousel item',
312
+ imageSrc: 'https://cdn.dev.publishingkit.net/30ddd804-841a-416f-88a6-fbcb84924036.jpg',
313
+ id: '4'
314
+ }
315
+ ]
316
+ }
317
+ }
318
+ },
319
+ style: {
320
+ backgroundColor: 'white'
321
+ // display: 'flex',
322
+ // flexDirection: 'column',
323
+ // justifyContent: 'center',
324
+ // alignItems: 'center'
325
+ },
326
+ layout: {}
166
327
  }
167
328
  ];
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  var jsx_runtime_1 = require("react/jsx-runtime");
7
7
  var blocks_1 = require("./blocks");
8
8
  var Button_1 = __importDefault(require("./blocks/Button"));
9
+ var ContentsCarousel_1 = __importDefault(require("./blocks/ContentsCarousel/ContentsCarousel"));
10
+ var ImageCarousel_1 = __importDefault(require("./blocks/ImageCarousel/ImageCarousel"));
9
11
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
10
12
  function BlockMatcher(_a) {
11
13
  var type = _a.type, content = _a.content, style = _a.style, layout = _a.layout, hoverStyle = _a.hoverStyle;
@@ -57,6 +59,25 @@ function BlockMatcher(_a) {
57
59
  }
58
60
  return (0, jsx_runtime_1.jsx)("div", { children: "Error" }, void 0);
59
61
  }
62
+ case 'ACCORDION': {
63
+ if ('accordionItems' in value && 'openedItemId' in value) {
64
+ return ((0, jsx_runtime_1.jsx)(blocks_1.Accordion, { accordionItems: value.accordionItems, openedItemId: value.openedItemId, style: style }, void 0));
65
+ }
66
+ return (0, jsx_runtime_1.jsx)("div", { children: "Error" }, void 0);
67
+ }
68
+ case 'CONTENTS_CAROUSEL': {
69
+ if ('contentsCarouselItems' in value && 'carouselSettings' in value) {
70
+ return ((0, jsx_runtime_1.jsx)(ContentsCarousel_1.default, { contentsCarouselItems: value.contentsCarouselItems, carouselSettings: value.carouselSettings,
71
+ // openedItemId={value.openedItemId}
72
+ style: style }, void 0));
73
+ }
74
+ return (0, jsx_runtime_1.jsx)("div", { children: "Error" }, void 0);
75
+ }
76
+ case 'IMAGE_CAROUSEL': {
77
+ if ('imgCarouselItems' in value && 'carouselSettings' in value) {
78
+ return ((0, jsx_runtime_1.jsx)(ImageCarousel_1.default, { imgStyle: { objectFit: 'fill' }, imgCarouselItems: value.imgCarouselItems, carouselSettings: value.carouselSettings, style: {} }, void 0));
79
+ }
80
+ }
60
81
  // eslint-disable-next-line no-fallthrough
61
82
  default:
62
83
  return (0, jsx_runtime_1.jsx)("div", { children: "Error" }, void 0);
@@ -0,0 +1,12 @@
1
+ import type React from 'react';
2
+ export declare type AccordionItem = {
3
+ title: string;
4
+ description: string;
5
+ };
6
+ export declare type AccordionProps = {
7
+ accordionItems: AccordionItem[];
8
+ openedItemId?: string;
9
+ style: React.CSSProperties;
10
+ };
11
+ declare function Accordion({ accordionItems, openedItemId, style }: AccordionProps): JSX.Element;
12
+ export default Accordion;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ var jsx_runtime_1 = require("react/jsx-runtime");
22
+ var react_1 = require("react");
23
+ var index_1 = require("../../../../../../desktop/index");
24
+ var components_1 = require("../../../../../../hybrid/components");
25
+ var components_2 = require("../../../../../DynamicLayout/components");
26
+ var styled_components_1 = __importDefault(require("styled-components"));
27
+ var AccordionCore_1 = require("./AccordionCore");
28
+ function Accordion(_a) {
29
+ var accordionItems = _a.accordionItems, openedItemId = _a.openedItemId, style = _a.style;
30
+ var _b = (0, react_1.useState)(''), openedId = _b[0], setOpen = _b[1];
31
+ (0, react_1.useLayoutEffect)(function () {
32
+ setOpen(openedItemId !== null && openedItemId !== void 0 ? openedItemId : '');
33
+ }, [openedItemId]);
34
+ var toggleAccordion = function (id) {
35
+ if (openedId === id) {
36
+ setOpen('');
37
+ return;
38
+ }
39
+ setOpen(id);
40
+ };
41
+ return ((0, jsx_runtime_1.jsx)(S_AccordionBox, __assign({ style: style }, { children: (0, jsx_runtime_1.jsx)(AccordionCore_1.AccordionCore, __assign({ openedId: openedId, toggle: toggleAccordion }, { children: accordionItems.map(function (each, index) { return ((0, jsx_runtime_1.jsxs)(AccordionCore_1.AccordionItem, __assign({ style: { backgroundColor: style.backgroundColor } }, { children: [(0, jsx_runtime_1.jsx)(AccordionCore_1.AccordionHeader, { targetId: index.toString(), text: each.title }, void 0), (0, jsx_runtime_1.jsxs)(AccordionCore_1.AccordionBody, __assign({ targetId: index.toString() }, { children: [(0, jsx_runtime_1.jsxs)(components_2.Box, __assign({ direction: "horizontal" }, { children: [(0, jsx_runtime_1.jsx)(components_1.Spacing, { size: "spacing_e", spacingType: "width" }, void 0), (0, jsx_runtime_1.jsx)(index_1.D_TextLabel, { text: each.description, styleTheme: "caption1Regular", colorTheme: "sysTextSecondary" }, void 0)] }), void 0), (0, jsx_runtime_1.jsx)(components_1.Spacing, { size: "spacing_e" }, void 0)] }), void 0), (0, jsx_runtime_1.jsx)(S_Divider, {}, void 0)] }), index.toString())); }) }), void 0) }), void 0));
42
+ }
43
+ var S_Divider = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: #dfdfdf;\n height: 1px;\n width: 100%;\n"], ["\n background-color: #dfdfdf;\n height: 1px;\n width: 100%;\n"])));
44
+ var S_AccordionBox = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 100%;\n\n * {\n color: black;\n }\n"], ["\n height: 100%;\n\n * {\n color: black;\n }\n"])));
45
+ exports.default = Accordion;
46
+ var templateObject_1, templateObject_2;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { AccordionItemIdType } from './AccordionCore';
3
+ declare type Props = {
4
+ children: React.ReactNode;
5
+ targetId: AccordionItemIdType;
6
+ };
7
+ declare function AccordionBody({ children, targetId }: Props): JSX.Element;
8
+ export default AccordionBody;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ var jsx_runtime_1 = require("react/jsx-runtime");
38
+ var react_1 = require("react");
39
+ var styled_components_1 = __importStar(require("styled-components"));
40
+ var AccordionCore_1 = require("./AccordionCore");
41
+ function AccordionBody(_a) {
42
+ var children = _a.children, targetId = _a.targetId;
43
+ var _b = (0, react_1.useState)('SHOW'), state = _b[0], setState = _b[1];
44
+ var _c = (0, react_1.useState)(0), height = _c[0], setHeight = _c[1];
45
+ var openedId = (0, react_1.useContext)(AccordionCore_1.AccordionContext).openedId;
46
+ var childrenRef = (0, react_1.useRef)(null);
47
+ (0, react_1.useEffect)(function () {
48
+ if (!childrenRef.current) {
49
+ return;
50
+ }
51
+ var off = childrenRef.current.offsetHeight;
52
+ setHeight(off);
53
+ }, [children]);
54
+ (0, react_1.useLayoutEffect)(function () {
55
+ if (openedId !== targetId) {
56
+ setState('COLLAPSE');
57
+ return;
58
+ }
59
+ setState('SHOW');
60
+ }, [openedId]);
61
+ return ((0, jsx_runtime_1.jsx)(S_AccordionBody, __assign({ state: state, height: height }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ ref: childrenRef }, { children: children }), void 0) }), void 0));
62
+ }
63
+ var S_AccordionBody = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: ", ";\n overflow: hidden;\n\n ", ";\n\n ", ";\n\n transition: height 0.35s ease;\n"], ["\n height: ", ";\n overflow: hidden;\n\n ", ";\n\n ", ";\n\n transition: height 0.35s ease;\n"])), function (_a) {
64
+ var height = _a.height;
65
+ return height + "px";
66
+ }, function (_a) {
67
+ var state = _a.state, height = _a.height;
68
+ return state === 'SHOW' && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: ", " + 'px';\n "], ["\n height: ", " + 'px';\n "])), height);
69
+ }, function (_a) {
70
+ var state = _a.state;
71
+ return state === 'COLLAPSE' && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 0;\n "], ["\n height: 0;\n "])));
72
+ });
73
+ exports.default = AccordionBody;
74
+ var templateObject_1, templateObject_2, templateObject_3;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ export declare type AccordionItemIdType = string | number;
3
+ declare type Props = {
4
+ openedId: AccordionItemIdType;
5
+ toggle: (id: AccordionItemIdType) => void;
6
+ children: React.ReactNode;
7
+ };
8
+ export declare const AccordionContext: React.Context<{
9
+ openedId: AccordionItemIdType;
10
+ toggle: (id: AccordionItemIdType) => void;
11
+ }>;
12
+ declare function AccordionCore({ openedId, children, toggle }: Props): JSX.Element;
13
+ export default AccordionCore;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.AccordionContext = void 0;
15
+ var jsx_runtime_1 = require("react/jsx-runtime");
16
+ var react_1 = require("react");
17
+ exports.AccordionContext = (0, react_1.createContext)({
18
+ openedId: '',
19
+ toggle: function () { return null; }
20
+ });
21
+ function AccordionCore(_a) {
22
+ var openedId = _a.openedId, children = _a.children, toggle = _a.toggle;
23
+ return ((0, jsx_runtime_1.jsx)(exports.AccordionContext.Provider, __assign({ value: { openedId: openedId, toggle: toggle } }, { children: children }), void 0));
24
+ }
25
+ exports.default = AccordionCore;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ declare type Props = {
3
+ text: string;
4
+ targetId: any;
5
+ };
6
+ declare function AccordionHeader({ text, targetId }: Props): JSX.Element;
7
+ export default AccordionHeader;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ var jsx_runtime_1 = require("react/jsx-runtime");
22
+ var react_1 = require("react");
23
+ var components_1 = require("../../../../../../DynamicLayout/components");
24
+ var styled_components_1 = __importDefault(require("styled-components"));
25
+ var AccordionCore_1 = require("./AccordionCore");
26
+ function AccordionHeader(_a) {
27
+ var text = _a.text, targetId = _a.targetId;
28
+ var _b = (0, react_1.useContext)(AccordionCore_1.AccordionContext), openedId = _b.openedId, toggle = _b.toggle;
29
+ var onClickToggle = function () {
30
+ toggle(targetId);
31
+ };
32
+ return ((0, jsx_runtime_1.jsxs)(S_Box, __assign({ alignItems: true }, { children: [(0, jsx_runtime_1.jsx)(components_1.D_TextLabel, { text: text }, void 0), (0, jsx_runtime_1.jsx)(D_IconWrapper, __assign({ isOpened: openedId === targetId }, { children: (0, jsx_runtime_1.jsx)(components_1.D_IconButton, { iconSize: 20, baseSize: "large", iconName: "ic_arrow_down", iconColorKey: "ui_cpnt_icon_sys_grey_02", baseColorKey: "ui_cpnt_button_fill_base_transparent", onClick: onClickToggle }, void 0) }), void 0)] }), void 0));
33
+ }
34
+ var S_Box = (0, styled_components_1.default)(components_1.Box)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n justify-content: space-between;\n padding-left: ", ";\n"], ["\n justify-content: space-between;\n padding-left: ", ";\n"])), function (_a) {
35
+ var theme = _a.theme;
36
+ return theme.spacing.spacingE;
37
+ });
38
+ var D_IconWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: fit-content;\n padding-left: ", ";\n padding-right: ", ";\n\n & > button {\n transform: ", ";\n transition: transform 0.2s ease-in-out;\n }\n"], ["\n height: fit-content;\n padding-left: ", ";\n padding-right: ", ";\n\n & > button {\n transform: ", ";\n transition: transform 0.2s ease-in-out;\n }\n"])), function (_a) {
39
+ var theme = _a.theme;
40
+ return theme.spacing.spacingD;
41
+ }, function (_a) {
42
+ var theme = _a.theme;
43
+ return theme.spacing.spacingC;
44
+ }, function (_a) {
45
+ var isOpened = _a.isOpened;
46
+ return (isOpened ? 'rotate(-180deg)' : ' rotate(0deg)');
47
+ });
48
+ exports.default = AccordionHeader;
49
+ var templateObject_1, templateObject_2;
@@ -0,0 +1,7 @@
1
+ import type React from 'react';
2
+ declare type Props = {
3
+ children: React.ReactNode;
4
+ style: React.CSSProperties;
5
+ };
6
+ declare function AccordionItem({ children, style }: Props): JSX.Element;
7
+ export default AccordionItem;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ var jsx_runtime_1 = require("react/jsx-runtime");
15
+ function AccordionItem(_a) {
16
+ var children = _a.children, style = _a.style;
17
+ return (0, jsx_runtime_1.jsx)("div", __assign({ style: style }, { children: children }), void 0);
18
+ }
19
+ exports.default = AccordionItem;
@@ -0,0 +1,4 @@
1
+ export { default as AccordionCore } from './AccordionCore';
2
+ export { default as AccordionBody } from './AccordionBody';
3
+ export { default as AccordionHeader } from './AccordionHeader';
4
+ export { default as AccordionItem } from './AccordionItem';
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AccordionItem = exports.AccordionHeader = exports.AccordionBody = exports.AccordionCore = void 0;
7
+ var AccordionCore_1 = require("./AccordionCore");
8
+ Object.defineProperty(exports, "AccordionCore", { enumerable: true, get: function () { return __importDefault(AccordionCore_1).default; } });
9
+ var AccordionBody_1 = require("./AccordionBody");
10
+ Object.defineProperty(exports, "AccordionBody", { enumerable: true, get: function () { return __importDefault(AccordionBody_1).default; } });
11
+ var AccordionHeader_1 = require("./AccordionHeader");
12
+ Object.defineProperty(exports, "AccordionHeader", { enumerable: true, get: function () { return __importDefault(AccordionHeader_1).default; } });
13
+ var AccordionItem_1 = require("./AccordionItem");
14
+ Object.defineProperty(exports, "AccordionItem", { enumerable: true, get: function () { return __importDefault(AccordionItem_1).default; } });
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ declare type Props = {
3
+ imgSrc: string;
4
+ title: string;
5
+ description: string;
6
+ isImgOverlay: boolean;
7
+ };
8
+ declare function CardItem({ imgSrc, title, description, isImgOverlay }: Props): JSX.Element;
9
+ export default CardItem;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ var jsx_runtime_1 = require("react/jsx-runtime");
22
+ require("react");
23
+ var reactstrap_1 = require("reactstrap");
24
+ var styled_components_1 = __importDefault(require("styled-components"));
25
+ function CardItem(_a) {
26
+ var imgSrc = _a.imgSrc, title = _a.title, description = _a.description, isImgOverlay = _a.isImgOverlay;
27
+ if (isImgOverlay) {
28
+ (0, jsx_runtime_1.jsxs)(reactstrap_1.Card, { children: [(0, jsx_runtime_1.jsx)(reactstrap_1.CardImg, { src: imgSrc, width: "100%" }, void 0), (0, jsx_runtime_1.jsx)(reactstrap_1.CardImgOverlay, { children: (0, jsx_runtime_1.jsxs)(reactstrap_1.CardBody, { children: [(0, jsx_runtime_1.jsx)(reactstrap_1.CardTitle, __assign({ tag: "h5" }, { children: title }), void 0), (0, jsx_runtime_1.jsx)(reactstrap_1.CardSubtitle, __assign({ className: "mb-2 text-muted", tag: "h6" }, { children: description }), void 0), (0, jsx_runtime_1.jsx)(reactstrap_1.CardText, { children: "\uCD94\uAC00\uB85C \uCE74\uB4DC \uD14D\uC2A4\uD2B8\uB97C \uB123\uB294 \uACF3" }, void 0), (0, jsx_runtime_1.jsx)(reactstrap_1.Button, { children: "Button" }, void 0)] }, void 0) }, void 0)] }, void 0);
29
+ }
30
+ return ((0, jsx_runtime_1.jsxs)(reactstrap_1.Card, __assign({ style: { height: '100%' } }, { children: [(0, jsx_runtime_1.jsx)(S_CardImgBox, { children: (0, jsx_runtime_1.jsx)(reactstrap_1.CardImg, { src: imgSrc, width: "100%", top: true, style: { aspectRatio: '16/9' } }, void 0) }, void 0), (0, jsx_runtime_1.jsxs)(reactstrap_1.CardBody, __assign({ style: { flex: '1 1 auto' } }, { children: [(0, jsx_runtime_1.jsx)(reactstrap_1.CardTitle, __assign({ tag: "h5" }, { children: title }), void 0), (0, jsx_runtime_1.jsx)(reactstrap_1.CardSubtitle, __assign({ className: "mb-2 text-muted", tag: "h6" }, { children: description }), void 0), (0, jsx_runtime_1.jsx)(reactstrap_1.CardText, { children: "\uCD94\uAC00\uB85C \uCE74\uB4DC \uD14D\uC2A4\uD2B8\uB97C \uB123\uB294 \uACF3" }, void 0), (0, jsx_runtime_1.jsx)(reactstrap_1.Button, { children: "Button" }, void 0)] }), void 0)] }), void 0));
31
+ }
32
+ var S_CardImgBox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 50%;\n max-height: 50%;\n"], ["\n height: 50%;\n max-height: 50%;\n"])));
33
+ exports.default = CardItem;
34
+ var templateObject_1;
@@ -0,0 +1,28 @@
1
+ import type { TypeOfItemLinkType } from '../../../../../../DynamicLayout/types';
2
+ import type React from 'react';
3
+ export declare type ContentsCarouselItem = {
4
+ title: string;
5
+ description: string;
6
+ imageSrc: string;
7
+ linkSrc: string;
8
+ linkType: TypeOfItemLinkType;
9
+ buttonLabel: string;
10
+ id: string;
11
+ };
12
+ export declare type EffectTypes = 'none' | 'fade';
13
+ export declare type CarouselSettings = {
14
+ mode: 'normal' | 'loop' | 'autoplay';
15
+ carouselAutoplayTime: number;
16
+ spaceBetween: number;
17
+ slidesPerView: number;
18
+ sliderPerGroup: number;
19
+ buttonSpacing: string;
20
+ effect: EffectTypes;
21
+ };
22
+ export declare type ContentsCarouselProps = {
23
+ contentsCarouselItems: ContentsCarouselItem[];
24
+ carouselSettings: CarouselSettings;
25
+ style: React.CSSProperties;
26
+ };
27
+ declare function ContentsCarousel({ contentsCarouselItems, style, carouselSettings }: ContentsCarouselProps): JSX.Element;
28
+ export default ContentsCarousel;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ var jsx_runtime_1 = require("react/jsx-runtime");
22
+ var desktop_1 = require("../../../../../../DynamicLayout/components/desktop");
23
+ var styled_components_1 = __importDefault(require("styled-components"));
24
+ var CardItem_1 = __importDefault(require("./CardItem"));
25
+ function ContentsCarousel(_a) {
26
+ var contentsCarouselItems = _a.contentsCarouselItems, style = _a.style, carouselSettings = _a.carouselSettings;
27
+ var mode = carouselSettings.mode, carouselAutoplayTime = carouselSettings.carouselAutoplayTime, spaceBetween = carouselSettings.spaceBetween, slidesPerView = carouselSettings.slidesPerView, sliderPerGroup = carouselSettings.sliderPerGroup, buttonSpacing = carouselSettings.buttonSpacing;
28
+ return ((0, jsx_runtime_1.jsx)(S_CarouselBox, __assign({ style: style }, { children: (0, jsx_runtime_1.jsx)(desktop_1.Carousel, __assign({ spaceBetween: spaceBetween, slidesPerView: slidesPerView, slidesPerGroup: sliderPerGroup,
29
+ // NOTE: when edit mode
30
+ allowTouchMove: false,
31
+ // breakpoints={{
32
+ // 1301: {
33
+ // slidesPerView: 4
34
+ // },
35
+ // 1601: {
36
+ // slidesPerView: 5
37
+ // }
38
+ // }}
39
+ mode: mode, autoplayDelay: carouselAutoplayTime, buttonSpacing: buttonSpacing }, { children: contentsCarouselItems.map(function (item) {
40
+ var itemTitle = item.title, itemDescription = item.description, itemImageSrc = item.imageSrc,
41
+ // linkSrc: itemLinkSrc,
42
+ // linkType: itemLinkType,
43
+ // buttonLabel: itemButtonLabel,
44
+ id = item.id;
45
+ return ((0, jsx_runtime_1.jsx)(CardItem_1.default, { imgSrc: itemImageSrc, title: itemTitle, description: itemDescription, isImgOverlay: false }, id));
46
+ }) }), void 0) }), void 0));
47
+ }
48
+ var S_CarouselBox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n /* NOTE: \uBCC0\uACBD\uD544\uC694 */\n height: 100%;\n max-height: 100%;\n\n /* & > div {\n height: 100%;\n & > div {\n height: 100%;\n & > .swiper {\n height: 100%;\n }\n }\n } */\n /* margin: ", " 0; */\n"], ["\n /* NOTE: \uBCC0\uACBD\uD544\uC694 */\n height: 100%;\n max-height: 100%;\n\n /* & > div {\n height: 100%;\n & > div {\n height: 100%;\n & > .swiper {\n height: 100%;\n }\n }\n } */\n /* margin: ", " 0; */\n"])), function (_a) {
49
+ var theme = _a.theme;
50
+ return theme.spacing.spacingH;
51
+ });
52
+ exports.default = ContentsCarousel;
53
+ var templateObject_1;
@@ -0,0 +1,16 @@
1
+ import type { CarouselSettings } from '../ContentsCarousel/ContentsCarousel';
2
+ import type React from 'react';
3
+ export declare type ImgCarouselItem = {
4
+ title: string;
5
+ description: string;
6
+ imageSrc: string;
7
+ id: string;
8
+ };
9
+ export declare type ImgCarouselProps = {
10
+ imgCarouselItems: ImgCarouselItem[];
11
+ carouselSettings: CarouselSettings;
12
+ style: React.CSSProperties;
13
+ imgStyle: React.CSSProperties;
14
+ };
15
+ declare function ImageCarousel({ imgStyle, imgCarouselItems, carouselSettings, style }: ImgCarouselProps): JSX.Element;
16
+ export default ImageCarousel;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ var jsx_runtime_1 = require("react/jsx-runtime");
22
+ var reactstrap_1 = require("reactstrap");
23
+ var swiper_1 = require("swiper");
24
+ var react_1 = require("swiper/react");
25
+ var swiper_style_1 = __importDefault(require("../../../../../../DynamicLayout/components/desktop/common/swiper.style"));
26
+ var styled_components_1 = __importDefault(require("styled-components"));
27
+ function ImageCarousel(_a) {
28
+ var imgStyle = _a.imgStyle, imgCarouselItems = _a.imgCarouselItems, carouselSettings = _a.carouselSettings, style = _a.style;
29
+ return ((0, jsx_runtime_1.jsx)(S_SwiperStyleWrapper, __assign({ style: style }, { children: (0, jsx_runtime_1.jsx)(react_1.Swiper, __assign({ spaceBetween: carouselSettings.spaceBetween, effect: carouselSettings.effect === 'none' ? undefined : carouselSettings.effect, navigation: true, pagination: {
30
+ clickable: true
31
+ },
32
+ // NOTE: when edit mode
33
+ allowTouchMove: false, modules: [swiper_1.EffectFade, swiper_1.Navigation, reactstrap_1.Pagination], className: "mySwiper" }, { children: imgCarouselItems.map(function (item) { return ((0, jsx_runtime_1.jsxs)(react_1.SwiperSlide, { children: [(0, jsx_runtime_1.jsx)(S_Img, { style: imgStyle, src: item.imageSrc }, void 0), (0, jsx_runtime_1.jsxs)(S_Overlay, { children: [(0, jsx_runtime_1.jsx)(S_Title, { children: item.title }, void 0), (0, jsx_runtime_1.jsx)(S_Desc, { children: item.description }, void 0)] }, void 0)] }, item.id)); }) }), void 0) }), void 0));
34
+ }
35
+ var S_Overlay = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n bottom: 20px;\n left: 20px;\n position: absolute;\n"], ["\n bottom: 20px;\n left: 20px;\n position: absolute;\n"])));
36
+ var S_Title = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n color: white;\n font-size: 20px;\n margin-bottom: 8px;\n"], ["\n color: white;\n font-size: 20px;\n margin-bottom: 8px;\n"])));
37
+ var S_Desc = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: #d2d2d2;\n font-size: 16px;\n"], ["\n color: #d2d2d2;\n font-size: 16px;\n"])));
38
+ var S_Img = styled_components_1.default.img(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 100%;\n object-position: 50% 50%;\n width: 100%;\n"], ["\n height: 100%;\n object-position: 50% 50%;\n width: 100%;\n"])));
39
+ var S_SwiperStyleWrapper = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n /** NOTE: Swiper\uAC00 \uC81C\uACF5\uD558\uB294 css \uD30C\uC77C\uC744 webpack \uC774\uC288\uB85C import\uD558\uC9C0 \uBABB\uD574\uC11C \uC784\uC2DC\uB85C \uB9CC\uB4E0 css wrapper\uC785\uB2C8\uB2E4.\n * \uCC28\uD6C4 Webpack 5\uB85C \uB9C8\uC774\uADF8\uB808\uC774\uC158 \uB418\uB294 \uACBD\uC6B0 swiper \uD648\uD398\uC774\uC9C0\uC5D0\uC11C \uCD94\uCC9C\uD558\uB294 \uC0AC\uC6A9\uBC95\uC73C\uB85C \uC218\uC815\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.\n */\n\n ", "\n height: 100%;\n\n .swiper {\n height: 100%;\n }\n\n * {\n pointer-events: 'none';\n }\n"], ["\n /** NOTE: Swiper\uAC00 \uC81C\uACF5\uD558\uB294 css \uD30C\uC77C\uC744 webpack \uC774\uC288\uB85C import\uD558\uC9C0 \uBABB\uD574\uC11C \uC784\uC2DC\uB85C \uB9CC\uB4E0 css wrapper\uC785\uB2C8\uB2E4.\n * \uCC28\uD6C4 Webpack 5\uB85C \uB9C8\uC774\uADF8\uB808\uC774\uC158 \uB418\uB294 \uACBD\uC6B0 swiper \uD648\uD398\uC774\uC9C0\uC5D0\uC11C \uCD94\uCC9C\uD558\uB294 \uC0AC\uC6A9\uBC95\uC73C\uB85C \uC218\uC815\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.\n */\n\n ", "\n height: 100%;\n\n .swiper {\n height: 100%;\n }\n\n * {\n pointer-events: 'none';\n }\n"])), swiper_style_1.default);
40
+ exports.default = ImageCarousel;
41
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
@@ -6,3 +6,4 @@ export { default as Instagram } from './Instagram';
6
6
  export { default as Twitter } from './Twitter';
7
7
  export { default as Divider } from './Divider';
8
8
  export { default as Youtube } from './Youtube';
9
+ export { default as Accordion } from './Accordion';
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Youtube = exports.Divider = exports.Twitter = exports.Instagram = exports.Button = exports.RichText = exports.Image = exports.Text = void 0;
6
+ exports.Accordion = exports.Youtube = exports.Divider = exports.Twitter = exports.Instagram = exports.Button = exports.RichText = exports.Image = exports.Text = void 0;
7
7
  var Text_1 = require("./Text");
8
8
  Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return __importDefault(Text_1).default; } });
9
9
  var Image_1 = require("./Image");
@@ -20,3 +20,5 @@ var Divider_1 = require("./Divider");
20
20
  Object.defineProperty(exports, "Divider", { enumerable: true, get: function () { return __importDefault(Divider_1).default; } });
21
21
  var Youtube_1 = require("./Youtube");
22
22
  Object.defineProperty(exports, "Youtube", { enumerable: true, get: function () { return __importDefault(Youtube_1).default; } });
23
+ var Accordion_1 = require("./Accordion");
24
+ Object.defineProperty(exports, "Accordion", { enumerable: true, get: function () { return __importDefault(Accordion_1).default; } });
@@ -1,3 +1,6 @@
1
+ import type { AccordionItem } from './BlockMatcher/blocks/Accordion';
2
+ import type { CarouselSettings, ContentsCarouselItem } from './BlockMatcher/blocks/ContentsCarousel/ContentsCarousel';
3
+ import type { ImgCarouselItem } from './BlockMatcher/blocks/ImageCarousel/ImageCarousel';
1
4
  import type React from 'react';
2
5
  export declare const ComponentNames: {
3
6
  TEXT: string;
@@ -8,6 +11,9 @@ export declare const ComponentNames: {
8
11
  YOUTUBE: string;
9
12
  TWITTER: string;
10
13
  INSTAGRAM: string;
14
+ ACCORDION: string;
15
+ CONTENTS_CAROUSEL: string;
16
+ IMAGE_CAROUSEL: string;
11
17
  };
12
18
  export declare type BlockComponents = typeof ComponentNames;
13
19
  export declare type BlockNames = keyof BlockComponents;
@@ -62,7 +68,28 @@ export declare type YoutubeComponentDataType = {
62
68
  endAt: number;
63
69
  };
64
70
  };
65
- export declare type ComponentDataPairType = TextComponentDataType | ImageComponentDataType | TwitterComponentDataType | RichTextComponentDataType | ButtonComponentDataType | DividerComponentDataType | YoutubeComponentDataType;
71
+ export declare type AccordionComponentDataType = {
72
+ type: BlockComponents['ACCORDION'];
73
+ value: {
74
+ accordionItems: AccordionItem[];
75
+ openedItemId?: string;
76
+ };
77
+ };
78
+ export declare type ContentsCarouselDataType = {
79
+ type: BlockComponents['ACCORDION'];
80
+ value: {
81
+ contentsCarouselItems: ContentsCarouselItem[];
82
+ carouselSettings: CarouselSettings;
83
+ };
84
+ };
85
+ export declare type ImgCarouselDataType = {
86
+ type: BlockComponents['IMAGE_CAROUSEL'];
87
+ value: {
88
+ imgCarouselItems: ImgCarouselItem[];
89
+ carouselSettings: CarouselSettings;
90
+ };
91
+ };
92
+ export declare type ComponentDataPairType = TextComponentDataType | ImageComponentDataType | TwitterComponentDataType | RichTextComponentDataType | ButtonComponentDataType | DividerComponentDataType | YoutubeComponentDataType | AccordionComponentDataType | ContentsCarouselDataType | ImgCarouselDataType;
66
93
  export declare type ContentType = {
67
94
  data: ComponentDataPairType;
68
95
  link?: LinkContentType;
@@ -9,5 +9,8 @@ exports.ComponentNames = {
9
9
  DIVIDER: 'DIVIDER',
10
10
  YOUTUBE: 'YOUTUBE',
11
11
  TWITTER: 'TWITTER',
12
- INSTAGRAM: 'INSTAGRAM'
12
+ INSTAGRAM: 'INSTAGRAM',
13
+ ACCORDION: 'ACCORDION',
14
+ CONTENTS_CAROUSEL: 'CONTENTS_CAROUSEL',
15
+ IMAGE_CAROUSEL: 'IMAGE_CAROUSEL'
13
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -27,6 +27,7 @@
27
27
  "react-i18next": "^11.12.0",
28
28
  "react-router-dom": "^5.2.0",
29
29
  "react-scripts": "4.0.3",
30
+ "reactstrap": "^9.2.0",
30
31
  "smoothscroll-polyfill": "^0.4.4",
31
32
  "styled-components": "^5.2.1",
32
33
  "swiper": "^8.4.5",
package/release-note.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # pds-dev-kit-web-test Release Notes
2
- ## [v0.2.0]
2
+ ## [v0.2.2]
3
3
  ## 기준 pds-dev-kit-web 버전 @2.0.14
4
4
  ### sub
5
- * DynamicLayout
6
- * custom section 추가
5
+ * DynamicLayout - custom section
6
+ * ImageCarousel 추가
7
+ * ContentsCarousel 추가