@4alldigital/foundation-ui--gamma 1.29.0 → 1.30.0

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/index.js CHANGED
@@ -3,6 +3,8 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var cx = require('classnames');
5
5
  var react = require('@iconify/react');
6
+ var Image$1 = require('next/image');
7
+ var HoverVideoPlayer = require('react-hover-video-player');
6
8
  var React = require('react');
7
9
  var reactHookForm = require('react-hook-form');
8
10
 
@@ -13,79 +15,6 @@ var Blockquote = function (_a) {
13
15
  };
14
16
  Blockquote.displayName = 'Blockquote';
15
17
 
16
- exports.BTN_TYPES = void 0;
17
- (function (BTN_TYPES) {
18
- BTN_TYPES["SUBMIT"] = "submit";
19
- BTN_TYPES["RESET"] = "reset";
20
- BTN_TYPES["BUTTON"] = "button";
21
- })(exports.BTN_TYPES || (exports.BTN_TYPES = {}));
22
- exports.BTN_VARIANTS = void 0;
23
- (function (BTN_VARIANTS) {
24
- BTN_VARIANTS["PRIMARY"] = "primary";
25
- BTN_VARIANTS["SECONDARY"] = "secondary";
26
- BTN_VARIANTS["TERTIARY"] = "tertiary";
27
- })(exports.BTN_VARIANTS || (exports.BTN_VARIANTS = {}));
28
- exports.BTN_SIZES = void 0;
29
- (function (BTN_SIZES) {
30
- BTN_SIZES["SMALL"] = "small";
31
- BTN_SIZES["MEDIUM"] = "medium";
32
- BTN_SIZES["LARGE"] = "large";
33
- })(exports.BTN_SIZES || (exports.BTN_SIZES = {}));
34
-
35
- /**
36
- * Icon component
37
- * List of supported icons can be found at https://icon-sets.iconify.design.
38
- */
39
- var Icon = function (_a) {
40
- var name = _a.name, _b = _a.size, size = _b === void 0 ? 24 : _b, color = _a.color, id = _a.id, className = _a.className, testID = _a.testID;
41
- if (color) {
42
- return (jsxRuntime.jsx(react.Icon, { "data-testid": testID || id || 'Icon', icon: name, width: size, height: size, color: color, className: className, fill: color || 'currentColor' }));
43
- }
44
- return (jsxRuntime.jsx(react.Icon, { "data-testid": testID || id || 'Icon', icon: name, width: size, height: size }));
45
- };
46
- Icon.displayName = 'Icon';
47
-
48
- var Loader = function (_a) {
49
- var color = _a.color, _b = _a.size, size = _b === void 0 ? 8 : _b, _c = _a.thickness, thickness = _c === void 0 ? 4 : _c;
50
- var sizeClass = size ? "w-".concat(size, " h-").concat(size) : 'w-8 h-8';
51
- return (jsxRuntime.jsx("div", { "data-testid": "Loader", className: 'mr-3 flex items-center justify-center', children: jsxRuntime.jsxs("div", { role: "status", className: 'flex items-center', children: [jsxRuntime.jsxs("svg", { className: "animate-spin ".concat(sizeClass, " text-white"), xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [jsxRuntime.jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: color || 'currentColor', strokeWidth: thickness }), jsxRuntime.jsx("path", { className: "opacity-75", fill: color || 'currentColor', d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] }), jsxRuntime.jsx("span", { className: "sr-only", children: "Loading..." })] }) }));
52
- };
53
- Loader.displayName = 'Loader';
54
-
55
- var Button = function (_a) {
56
- var _b = _a.variant, variant = _b === void 0 ? exports.BTN_VARIANTS.PRIMARY : _b, _c = _a.size, size = _c === void 0 ? exports.BTN_SIZES.MEDIUM : _c, _d = _a.type, type = _d === void 0 ? exports.BTN_TYPES.BUTTON : _d, _e = _a.wide, wide = _e === void 0 ? true : _e, _f = _a.rounded, rounded = _f === void 0 ? true : _f, _g = _a.raised, raised = _g === void 0 ? true : _g, uppercase = _a.uppercase, children = _a.children, id = _a.id, disabled = _a.disabled, ariaLabel = _a.ariaLabel, onClick = _a.onClick, icon = _a.icon, external = _a.external, iconFirst = _a.iconFirst, outline = _a.outline, testID = _a.testID, className = _a.className, isLoading = _a.isLoading;
57
- var smallX = wide ? 'px-5' : 'px-3';
58
- var mediumX = wide ? 'px-8' : 'px-4';
59
- var largeX = wide ? 'px-11' : 'px-5';
60
- var sizes = {
61
- small: {
62
- x: children ? smallX : 'px-1',
63
- y: 'py-1',
64
- space: 'space-x-2',
65
- text: 'text-sm',
66
- icon: 'w-4 h-4',
67
- },
68
- medium: {
69
- x: children ? mediumX : 'px-2',
70
- y: 'py-2',
71
- space: 'space-x-3',
72
- text: 'text-base',
73
- icon: 'w-5 h-5',
74
- },
75
- large: {
76
- x: children ? largeX : 'px-3',
77
- y: 'py-3',
78
- space: 'space-x-4',
79
- text: 'text-lg',
80
- icon: 'w-6 h-6',
81
- },
82
- };
83
- var classes = cx('appearance-none font-body flex items-center transition-all duration-200 transform active:scale-95 justify-around border-solid border rounded cursor-pointer outline-none focus:outline-none focus-visible:outline-none', { 'text-white border-primary hover:bg-primary-darker': variant === 'primary' }, { 'text-white border-secondary hover:bg-secondary-darker': variant === 'secondary' }, { 'text-black border-tertiary hover:bg-tertiary-darker': variant === 'tertiary' }, { 'bg-primary': variant === 'primary' }, { 'bg-secondary': variant === 'secondary' }, { 'bg-tertiary': variant === 'tertiary' }, { 'border-primary300 dark:border-primary400 hover:border-primary400 dark:hover:border-primary500': outline }, { shadow: raised }, { uppercase: uppercase }, { 'auto-cols-auto grid-cols-2 gap-2': icon || external }, { 'rounded-full': rounded }, { 'flex-row-reverse': iconFirst }, { 'opacity-50 cursor-not-allowed': disabled }, "".concat(sizes[size].y, " ").concat(sizes[size].x, " ").concat(sizes[size].text), className);
84
- var iconClasses = cx(sizes[size].icon);
85
- return (jsxRuntime.jsx("button", { id: id, "data-testid": testID || id || 'Button', onClick: onClick, className: classes, type: type, disabled: disabled, "aria-label": ariaLabel, role: "button", children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [isLoading && (jsxRuntime.jsx("div", { className: "flex items-center", children: jsxRuntime.jsx(Loader, { size: 4 }) })), children, icon && !external && (jsxRuntime.jsx("span", { className: "flex items-center", children: jsxRuntime.jsx(Icon, { name: icon, className: iconClasses }) })), external && (jsxRuntime.jsx("span", { className: "flex items-center", children: jsxRuntime.jsx(Icon, { name: "carbon:launch", className: iconClasses }) }))] }) }));
86
- };
87
- Button.displayName = 'Button';
88
-
89
18
  exports.COPY_ALIGN = void 0;
90
19
  (function (COPY_ALIGN) {
91
20
  COPY_ALIGN["LEFT"] = "left";
@@ -163,26 +92,51 @@ var Heading = function (_a) {
163
92
  var fontSize = function () {
164
93
  switch (tag) {
165
94
  case 'h1':
166
- return 'text-5xl';
95
+ return 'text-5xl md:text-5xl lg:text-5xl';
167
96
  case 'h2':
168
- return 'text-4xl';
97
+ return 'text-4xl md:text-4xl lg:text-4xl';
169
98
  case 'h3':
170
- return 'text-3xl';
99
+ return 'text-3xl md:text-3xl lg:text-3xl';
171
100
  case 'h4':
172
- return 'text-2xl';
101
+ return 'text-2xl md:text-2xl lg:text-2xl';
173
102
  case 'h5':
174
- return 'text-xl';
103
+ return 'text-lg md:text-lg lg:text-lg';
175
104
  default:
176
- return 'text-2xl';
105
+ return 'text-2xl md:text-2xl lg:text-2xl';
177
106
  }
178
107
  };
179
108
  var size = fontSize();
180
109
  var Tag = tag;
181
- var classes = cx("m-0 p-0 font-heading font-bold mb-2 ".concat(size), (_b = {}, _b["text-".concat(align)] = align, _b), { 'm-0': flush }, { 'whitespace-nowrap text-ellipsis overflow-hidden': singleLine }, transform, className);
110
+ var classes = cx("m-0 p-0 font-heading font-bold ".concat(size), (_b = {}, _b["text-".concat(align)] = align, _b), { 'mb-2': !flush }, { 'm-0': flush }, { 'whitespace-nowrap text-ellipsis overflow-hidden': singleLine }, transform, className);
182
111
  return (jsxRuntime.jsx(Tag, { "data-testid": testID || id || 'Heading', className: classes, children: children }));
183
112
  };
184
113
  Heading.displayName = 'Heading';
185
114
 
115
+ /**
116
+ * Icon component
117
+ * List of supported icons can be found at https://icon-sets.iconify.design.
118
+ */
119
+ var Icon = function (_a) {
120
+ // if (color) {
121
+ // return (
122
+ // <IconifyIcon
123
+ // data-testid={testID || id || 'Icon'}
124
+ // icon={name}
125
+ // width={size}
126
+ // height={size}
127
+ // color={color}
128
+ // className={className}
129
+ // fill={color || 'currentColor'}
130
+ // />
131
+ // );
132
+ // }
133
+ var name = _a.name, _b = _a.size, size = _b === void 0 ? 24 : _b, color = _a.color, id = _a.id, className = _a.className, testID = _a.testID;
134
+ return (jsxRuntime.jsx(react.Icon, { "data-testid": testID || id || 'Icon', icon: name, width: size, height: size,
135
+ // color={color}
136
+ className: className, fill: color || 'currentColor' }));
137
+ };
138
+ Icon.displayName = 'Icon';
139
+
186
140
  var Image = function (_a) {
187
141
  var src = _a.src, alt = _a.alt, title = _a.title, caption = _a.caption, _b = _a.figure, figure = _b === void 0 ? false : _b, onLoad = _a.onLoad, id = _a.id, className = _a.className, testID = _a.testID;
188
142
  var figureClasses = cx('m-0');
@@ -258,6 +212,13 @@ var Notice = function (_a) {
258
212
  };
259
213
  Notice.displayName = 'Notice';
260
214
 
215
+ var Loader = function (_a) {
216
+ var color = _a.color, _b = _a.size, size = _b === void 0 ? 8 : _b, _c = _a.thickness, thickness = _c === void 0 ? 4 : _c;
217
+ var sizeClass = size ? "w-".concat(size, " h-").concat(size) : 'w-8 h-8';
218
+ return (jsxRuntime.jsx("div", { "data-testid": "Loader", className: 'mr-3 flex items-center justify-center', children: jsxRuntime.jsxs("div", { role: "status", className: 'flex items-center', children: [jsxRuntime.jsxs("svg", { className: "animate-spin ".concat(sizeClass, " text-white"), xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [jsxRuntime.jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: color || 'currentColor', strokeWidth: thickness }), jsxRuntime.jsx("path", { className: "opacity-75", fill: color || 'currentColor', d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] }), jsxRuntime.jsx("span", { className: "sr-only", children: "Loading..." })] }) }));
219
+ };
220
+ Loader.displayName = 'Loader';
221
+
261
222
  var Container = function (_a) {
262
223
  var children = _a.children, className = _a.className, spacing = _a.spacing, padded = _a.padded, isNarrow = _a.isNarrow, isCentered = _a.isCentered;
263
224
  var classes = cx('container', 'mx-auto', 'my-0', { 'px-4': padded }, { 'py-40': spacing === 'feature' }, { 'py-24': spacing === 'component' }, { 'py-16': spacing === 'module' }, { 'py-10': spacing === 'element' }, { 'py-4': spacing === 'atom' }, { 'py-0': spacing === 'none' }, { 'max-w-3xl': isNarrow }, { 'flex items-center justify-center flex-col': isCentered }, className);
@@ -301,6 +262,59 @@ var ContentRowsLayout = function (_a) {
301
262
  };
302
263
  ContentRowsLayout.displayName = 'ContentRowsLayout';
303
264
 
265
+ exports.BTN_TYPES = void 0;
266
+ (function (BTN_TYPES) {
267
+ BTN_TYPES["SUBMIT"] = "submit";
268
+ BTN_TYPES["RESET"] = "reset";
269
+ BTN_TYPES["BUTTON"] = "button";
270
+ })(exports.BTN_TYPES || (exports.BTN_TYPES = {}));
271
+ exports.BTN_VARIANTS = void 0;
272
+ (function (BTN_VARIANTS) {
273
+ BTN_VARIANTS["PRIMARY"] = "primary";
274
+ BTN_VARIANTS["SECONDARY"] = "secondary";
275
+ BTN_VARIANTS["TERTIARY"] = "tertiary";
276
+ })(exports.BTN_VARIANTS || (exports.BTN_VARIANTS = {}));
277
+ exports.BTN_SIZES = void 0;
278
+ (function (BTN_SIZES) {
279
+ BTN_SIZES["SMALL"] = "small";
280
+ BTN_SIZES["MEDIUM"] = "medium";
281
+ BTN_SIZES["LARGE"] = "large";
282
+ })(exports.BTN_SIZES || (exports.BTN_SIZES = {}));
283
+
284
+ var Button = function (_a) {
285
+ var _b = _a.variant, variant = _b === void 0 ? exports.BTN_VARIANTS.PRIMARY : _b, _c = _a.size, size = _c === void 0 ? exports.BTN_SIZES.MEDIUM : _c, _d = _a.type, type = _d === void 0 ? exports.BTN_TYPES.BUTTON : _d, _e = _a.wide, wide = _e === void 0 ? true : _e, _f = _a.rounded, rounded = _f === void 0 ? true : _f, _g = _a.raised, raised = _g === void 0 ? true : _g, uppercase = _a.uppercase, children = _a.children, id = _a.id, disabled = _a.disabled, ariaLabel = _a.ariaLabel, onClick = _a.onClick, icon = _a.icon, external = _a.external, iconFirst = _a.iconFirst, outline = _a.outline, testID = _a.testID, className = _a.className, isLoading = _a.isLoading;
286
+ var smallX = wide ? 'px-5' : 'px-3';
287
+ var mediumX = wide ? 'px-8' : 'px-4';
288
+ var largeX = wide ? 'px-11' : 'px-5';
289
+ var sizes = {
290
+ small: {
291
+ x: children ? smallX : 'px-1',
292
+ y: 'py-1',
293
+ space: 'space-x-2',
294
+ text: 'text-sm',
295
+ icon: 'w-3 h-3',
296
+ },
297
+ medium: {
298
+ x: children ? mediumX : 'px-2',
299
+ y: 'py-2',
300
+ space: 'space-x-3',
301
+ text: 'text-base',
302
+ icon: 'w-5 h-5',
303
+ },
304
+ large: {
305
+ x: children ? largeX : 'px-3',
306
+ y: 'py-3',
307
+ space: 'space-x-4',
308
+ text: 'text-lg',
309
+ icon: 'w-6 h-6',
310
+ },
311
+ };
312
+ var classes = cx('appearance-none font-body flex items-center transition-all duration-200 transform active:scale-95 justify-around border-solid border rounded cursor-pointer outline-none focus:outline-none focus-visible:outline-none', { 'text-white border-primary hover:bg-primary-darker': variant === 'primary' }, { 'text-white border-secondary hover:bg-secondary-darker': variant === 'secondary' }, { 'text-black border-tertiary hover:bg-tertiary-darker': variant === 'tertiary' }, { 'bg-primary': variant === 'primary' }, { 'bg-secondary': variant === 'secondary' }, { 'bg-tertiary': variant === 'tertiary' }, { 'border-primary300 dark:border-primary400 hover:border-primary400 dark:hover:border-primary500': outline }, { shadow: raised }, { uppercase: uppercase }, { 'auto-cols-auto grid-cols-2 gap-2': icon || external }, { 'rounded-full': rounded }, { 'flex-row-reverse': iconFirst }, { 'opacity-50 cursor-not-allowed': disabled }, "".concat(sizes[size].y, " ").concat(sizes[size].x, " ").concat(sizes[size].text), className);
313
+ var iconClasses = cx(sizes[size].icon);
314
+ return (jsxRuntime.jsx("button", { id: id, "data-testid": testID || id || 'Button', onClick: onClick, className: classes, type: type, disabled: disabled, "aria-label": ariaLabel, role: "button", children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [isLoading && (jsxRuntime.jsx("div", { className: "flex items-center", children: jsxRuntime.jsx(Loader, { size: 4 }) })), children, icon && !external && (jsxRuntime.jsx("span", { className: "flex items-center", children: jsxRuntime.jsx(Icon, { name: icon, className: iconClasses }) })), external && (jsxRuntime.jsx("span", { className: "flex items-center", children: jsxRuntime.jsx(Icon, { name: "carbon:launch", className: iconClasses }) }))] }) }));
315
+ };
316
+ Button.displayName = 'Button';
317
+
304
318
  /******************************************************************************
305
319
  Copyright (c) Microsoft Corporation.
306
320
 
@@ -346,6 +360,217 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
346
360
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
347
361
  };
348
362
 
363
+ var CardBasic = function (_a) {
364
+ var id = _a.id, title = _a.title, description = _a.description, image = _a.image, className = _a.className, metaData = _a.metaData, actions = _a.actions, _b = _a.onClick, onClick = _b === void 0 ? function () { } : _b;
365
+ return (jsxRuntime.jsxs("div", { id: id, "data-testid": "CardBasic", className: cx('relative rounded-lg overflow-hidden transition duration-300 ease-in-out cursor-pointer hover:scale-105 shadow hover:shadow-lg bg-primary-lighter hover:bg-primary hover:text-body-text-inverted', className), onClick: onClick, children: [image && (jsxRuntime.jsx("div", { className: "card-image relative w-full min-h-40", children: jsxRuntime.jsx(Image$1, { fill: true, src: image === null || image === void 0 ? void 0 : image.src, width: 0, height: 0, sizes: "100vh", alt: image === null || image === void 0 ? void 0 : image.alt, className: "object-cover" }) })), jsxRuntime.jsxs("div", { className: "w-full p-3 flex flex-col gap-1", children: [jsxRuntime.jsx("div", { children: title && (jsxRuntime.jsx(Heading, { tag: exports.HEADING_TAGS.H5, singleLine: true, flush: true, children: title })) }), jsxRuntime.jsx("div", { children: description && jsxRuntime.jsx(Copy, { children: description }) }), jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [metaData && (jsxRuntime.jsx("div", { className: "flex shrink-0", children: metaData.map(function (meta, index) {
366
+ if (index === 0) {
367
+ return (jsxRuntime.jsxs(Copy, { className: "text-xs", as: exports.COPY_TAG.SMALL, children: [meta, "\u00A0\u00B7"] }, meta));
368
+ }
369
+ if (index === metaData.length - 1) {
370
+ return (jsxRuntime.jsxs(Copy, { className: "text-xs", as: exports.COPY_TAG.SMALL, children: ["\u00A0", meta] }, meta));
371
+ }
372
+ return (jsxRuntime.jsxs(Copy, { className: "text-xs", as: exports.COPY_TAG.SMALL, children: ["\u00A0", meta, "\u00A0\u00B7"] }, meta));
373
+ }) })), actions && (jsxRuntime.jsxs("div", { className: "flex items-center gap-1 flex-wrap", children: [actions.like && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.like.isActive ? 'mdi:like' : 'mdi:like-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
374
+ var _a;
375
+ event.stopPropagation();
376
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.like) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.like.onClick === 'function') {
377
+ actions.like.onClick({ id: id });
378
+ }
379
+ } })), actions.share && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.share.isActive ? 'mdi:share' : 'mdi:share-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
380
+ var _a;
381
+ event.stopPropagation();
382
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.share) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.share.onClick === 'function') {
383
+ actions.share.onClick({ id: id });
384
+ }
385
+ } })), actions.save && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.save.isActive ? 'mdi:bookmark' : 'mdi:bookmark-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
386
+ var _a;
387
+ event.stopPropagation();
388
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.save) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.save.onClick === 'function') {
389
+ actions.save.onClick({ id: id });
390
+ }
391
+ } })), actions.comment && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.comment.isActive ? 'mdi:comment' : 'mdi:comment-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
392
+ var _a;
393
+ event.stopPropagation();
394
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.comment) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.comment.onClick === 'function') {
395
+ actions.comment.onClick({ id: id });
396
+ }
397
+ } })), actions.bookmark && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.bookmark.isActive ? 'mdi:bookmark' : 'mdi:bookmark-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
398
+ var _a;
399
+ event.stopPropagation();
400
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.bookmark) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.bookmark.onClick === 'function') {
401
+ actions.bookmark.onClick({ id: id });
402
+ }
403
+ } })), actions.report && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.report.isActive ? 'mdi:flag' : 'mdi:flag-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
404
+ var _a;
405
+ event.stopPropagation();
406
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.report) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.report.onClick === 'function') {
407
+ actions.report.onClick({ id: id });
408
+ }
409
+ } })), actions.follow && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.follow.isActive ? 'mdi:account-plus' : 'mdi:account-plus-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
410
+ var _a;
411
+ event.stopPropagation();
412
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.follow) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.follow.onClick === 'function') {
413
+ actions.follow.onClick({ id: id });
414
+ }
415
+ } })), actions.download && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.download.isActive ? 'mdi:download' : 'mdi:download-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
416
+ var _a;
417
+ event.stopPropagation();
418
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.download) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.download.onClick === 'function') {
419
+ actions.download.onClick({ id: id });
420
+ }
421
+ } })), actions.edit && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.edit.isActive ? 'mdi:pencil' : 'mdi:pencil-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
422
+ var _a;
423
+ event.stopPropagation();
424
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.edit) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.edit.onClick === 'function') {
425
+ actions.edit.onClick({ id: id });
426
+ }
427
+ } })), actions.delete && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.delete.isActive ? 'mdi:delete' : 'mdi:delete-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
428
+ var _a;
429
+ event.stopPropagation();
430
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.delete) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.delete.onClick === 'function') {
431
+ actions.delete.onClick({ id: id });
432
+ }
433
+ } }))] }))] })] })] }));
434
+ };
435
+ CardBasic.displayName = 'CardBasic';
436
+
437
+ var CardMedia = function (_a) {
438
+ var className = _a.className;
439
+ return (jsxRuntime.jsx("div", { "data-testid": "CardMedia", className: cx('relative', className), children: "CardMedia" }));
440
+ };
441
+ CardMedia.displayName = 'CardMedia';
442
+
443
+ // title,
444
+ // uuid,
445
+ // image,
446
+ // date,
447
+ // video,
448
+ // isMuted = false,
449
+ // withStyles = true,
450
+ // promoCards = false,
451
+ // isOriginal = false,
452
+ // customPath,
453
+ var CardVideo = function (_a) {
454
+ var video = _a.video, _b = _a.isMuted, isMuted = _b === void 0 ? true : _b, id = _a.id, title = _a.title, description = _a.description, image = _a.image, className = _a.className, metaData = _a.metaData, actions = _a.actions, _c = _a.onClick, onClick = _c === void 0 ? function () { } : _c;
455
+ // console.log('title', title);
456
+ console.log('isMuted', isMuted);
457
+ // console.log('image', image);
458
+ return (jsxRuntime.jsxs("div", { id: id, "data-testid": "CardBasic", className: cx('relative rounded-lg overflow-hidden transition duration-300 ease-in-out cursor-pointer hover:scale-105 shadow hover:shadow-lg bg-white text-black-lighter hover:bg-white-darker dark:bg-primary-lighter dark:hover:bg-primary-lighter dark:text-white-darker', className), onClick: onClick, children: [image && (jsxRuntime.jsx("div", { className: "card-image relative w-full min-h-40", children: jsxRuntime.jsx(HoverVideoPlayer, { videoId: "video--".concat(id),
459
+ // videoSrc={[
460
+ // {
461
+ // type: 'video/mp4',
462
+ // src: mp4Video,
463
+ // },
464
+ // ]}
465
+ playbackStartDelay: 1000, videoSrc: jsxRuntime.jsx("source", { src: video, type: "video/mp4" }), videoClassName: cx('hls-hover-video w-full min-h-40'), sizingMode: "overlay", preload: "none", loop: false, muted: isMuted, className: "w-full min-h-40", pausedOverlay:
466
+ // <FadeImage
467
+ // src={image || PLACEHOLDER_CARD_IMAGE_DARK}
468
+ // overlaySrc={PLACEHOLDER_CARD_IMAGE_DARK}
469
+ // alt={title || 'Image'}
470
+ // title={title || 'Image'}
471
+ // className={styles.cardMedia}
472
+ // />
473
+ jsxRuntime.jsx("div", { className: "w-full min-h-40", children: jsxRuntime.jsx(Image$1
474
+ // src={image?.src || ''}
475
+ // width={200}
476
+ // height={200}
477
+ // sizes="100vh"
478
+ // alt={image?.alt || ''}
479
+ // className="object-cover"
480
+ , {
481
+ // src={image?.src || ''}
482
+ // width={200}
483
+ // height={200}
484
+ // sizes="100vh"
485
+ // alt={image?.alt || ''}
486
+ // className="object-cover"
487
+ fill: true, src: image === null || image === void 0 ? void 0 : image.src, width: 0, height: 0, sizes: "100vh", alt: image === null || image === void 0 ? void 0 : image.alt, className: "object-cover" }) }), loadingOverlay: jsxRuntime.jsx("div", { className: "w-full min-h-40 flex items-center justify-center", children: jsxRuntime.jsx("div", { className: "", children: jsxRuntime.jsx(Loader, {}) }) }) }, "".concat(id, "--card")) })), jsxRuntime.jsxs("div", { className: "w-full p-3 flex flex-col gap-1", children: [jsxRuntime.jsx("div", { children: title && (jsxRuntime.jsx(Heading, { tag: exports.HEADING_TAGS.H5, singleLine: true, flush: true, children: title })) }), jsxRuntime.jsx("div", { children: description && jsxRuntime.jsx(Copy, { children: description }) }), jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [metaData && (jsxRuntime.jsx("div", { className: "flex shrink-0", children: metaData.map(function (meta, index) {
488
+ if (index === 0) {
489
+ return (jsxRuntime.jsxs(Copy, { className: "text-xs", as: exports.COPY_TAG.SMALL, children: [meta, "\u00A0\u00B7"] }, meta));
490
+ }
491
+ if (index === metaData.length - 1) {
492
+ return (jsxRuntime.jsxs(Copy, { className: "text-xs", as: exports.COPY_TAG.SMALL, children: ["\u00A0", meta] }, meta));
493
+ }
494
+ return (jsxRuntime.jsxs(Copy, { className: "text-xs", as: exports.COPY_TAG.SMALL, children: ["\u00A0", meta, "\u00A0\u00B7"] }, meta));
495
+ }) })), actions && (jsxRuntime.jsxs("div", { className: "flex items-center gap-1 flex-wrap", children: [actions.like && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.like.isActive ? 'mdi:like' : 'mdi:like-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
496
+ var _a;
497
+ event.stopPropagation();
498
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.like) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.like.onClick === 'function') {
499
+ actions.like.onClick({ id: id });
500
+ }
501
+ } })), actions.share && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.share.isActive ? 'mdi:share' : 'mdi:share-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
502
+ var _a;
503
+ event.stopPropagation();
504
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.share) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.share.onClick === 'function') {
505
+ actions.share.onClick({ id: id });
506
+ }
507
+ } })), actions.save && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.save.isActive ? 'mdi:bookmark' : 'mdi:bookmark-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
508
+ var _a;
509
+ event.stopPropagation();
510
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.save) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.save.onClick === 'function') {
511
+ actions.save.onClick({ id: id });
512
+ }
513
+ } })), actions.comment && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.comment.isActive ? 'mdi:comment' : 'mdi:comment-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
514
+ var _a;
515
+ event.stopPropagation();
516
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.comment) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.comment.onClick === 'function') {
517
+ actions.comment.onClick({ id: id });
518
+ }
519
+ } })), actions.bookmark && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.bookmark.isActive ? 'mdi:bookmark' : 'mdi:bookmark-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
520
+ var _a;
521
+ event.stopPropagation();
522
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.bookmark) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.bookmark.onClick === 'function') {
523
+ actions.bookmark.onClick({ id: id });
524
+ }
525
+ } })), actions.report && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.report.isActive ? 'mdi:flag' : 'mdi:flag-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
526
+ var _a;
527
+ event.stopPropagation();
528
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.report) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.report.onClick === 'function') {
529
+ actions.report.onClick({ id: id });
530
+ }
531
+ } })), actions.follow && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.follow.isActive ? 'mdi:account-plus' : 'mdi:account-plus-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
532
+ var _a;
533
+ event.stopPropagation();
534
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.follow) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.follow.onClick === 'function') {
535
+ actions.follow.onClick({ id: id });
536
+ }
537
+ } })), actions.download && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.download.isActive ? 'mdi:download' : 'mdi:download-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
538
+ var _a;
539
+ event.stopPropagation();
540
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.download) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.download.onClick === 'function') {
541
+ actions.download.onClick({ id: id });
542
+ }
543
+ } })), actions.edit && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.edit.isActive ? 'mdi:pencil' : 'mdi:pencil-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
544
+ var _a;
545
+ event.stopPropagation();
546
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.edit) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.edit.onClick === 'function') {
547
+ actions.edit.onClick({ id: id });
548
+ }
549
+ } })), actions.delete && (jsxRuntime.jsx(Button, { variant: exports.BTN_VARIANTS.PRIMARY, icon: actions.delete.isActive ? 'mdi:delete' : 'mdi:delete-outline', size: exports.BTN_SIZES.SMALL, onClick: function (event) {
550
+ var _a;
551
+ event.stopPropagation();
552
+ if (((_a = actions === null || actions === void 0 ? void 0 : actions.delete) === null || _a === void 0 ? void 0 : _a.onClick) && typeof actions.delete.onClick === 'function') {
553
+ actions.delete.onClick({ id: id });
554
+ }
555
+ } }))] }))] })] })] }));
556
+ };
557
+ CardVideo.displayName = 'CardVideo';
558
+
559
+ var Card = function (_a) {
560
+ var variant = _a.variant, className = _a.className, data = _a.data, rest = __rest(_a, ["variant", "className", "data"]);
561
+ switch (variant) {
562
+ case 'basic':
563
+ return jsxRuntime.jsx(CardBasic, __assign({ className: className }, data, rest));
564
+ case 'media':
565
+ return jsxRuntime.jsx(CardMedia, __assign({ className: className }, data, rest));
566
+ case 'video':
567
+ return jsxRuntime.jsx(CardVideo, __assign({ className: className }, data, rest));
568
+ default:
569
+ return jsxRuntime.jsx(CardBasic, __assign({ className: className }, data, rest));
570
+ }
571
+ };
572
+ Card.displayName = 'Card';
573
+
349
574
  var Form = function (_a) {
350
575
  var children = _a.children, className = _a.className, submit = _a.submit, _b = _a.onSubmit, onSubmit = _b === void 0 ? function () { } : _b, onChange = _a.onChange, hideSubmit = _a.hideSubmit, ariaSubmitLabel = _a.ariaSubmitLabel, submitID = _a.submitID, _c = _a.submitVariant, submitVariant = _c === void 0 ? exports.BTN_VARIANTS.PRIMARY : _c, _d = _a.initialValues, initialValues = _d === void 0 ? {} : _d, _e = _a.isBoxed, isBoxed = _e === void 0 ? false : _e;
351
576
  var methods = reactHookForm.useForm({
@@ -520,6 +745,7 @@ FormField.displayName = 'FormField';
520
745
 
521
746
  exports.Blockquote = Blockquote;
522
747
  exports.Button = Button;
748
+ exports.Card = Card;
523
749
  exports.Container = Container;
524
750
  exports.ContentPageLayout = ContentPageLayout;
525
751
  exports.ContentRowsLayout = ContentRowsLayout;
@@ -18,7 +18,7 @@ export interface Props {
18
18
  variant?: BTN_VARIANTS;
19
19
  size?: BTN_SIZES;
20
20
  uppercase?: boolean;
21
- children: React.ReactNode;
21
+ children?: React.ReactNode;
22
22
  type?: BTN_TYPES;
23
23
  disabled?: boolean;
24
24
  ariaLabel?: string;
@@ -10,6 +10,23 @@ export interface ImageData {
10
10
  width?: number;
11
11
  height?: number;
12
12
  }
13
+ type ActionItem = {
14
+ count?: number;
15
+ isActive: boolean;
16
+ onClick: (event: any) => void;
17
+ };
18
+ export interface Actions {
19
+ like?: ActionItem;
20
+ share?: ActionItem;
21
+ save?: ActionItem;
22
+ comment?: ActionItem;
23
+ bookmark?: ActionItem;
24
+ report?: ActionItem;
25
+ follow?: ActionItem;
26
+ download?: ActionItem;
27
+ edit?: ActionItem;
28
+ delete?: ActionItem;
29
+ }
13
30
  export interface CardData {
14
31
  id: string;
15
32
  title: string;
@@ -20,10 +37,12 @@ export interface CardData {
20
37
  tags?: string[];
21
38
  moreTitle?: string;
22
39
  metaData?: string[];
23
- onClick?: () => void;
40
+ actions?: Actions;
41
+ onClick?: (data: any) => void;
24
42
  }
25
43
  export interface Props {
26
44
  variant?: CardVariant;
27
45
  className?: string;
28
46
  data: CardData;
29
47
  }
48
+ export {};
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Props } from './CardBasic.types';
3
3
  declare const CardBasic: {
4
- ({ id, title, description, image, className, onClick }: Props): React.ReactElement;
4
+ ({ id, title, description, image, className, metaData, actions, onClick, }: Props): React.ReactElement;
5
5
  displayName: string;
6
6
  };
7
7
  export default CardBasic;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Props } from './CardVideo.types';
3
3
  declare const CardVideo: {
4
- ({ className }: Props): React.ReactElement;
4
+ ({ video, isMuted, id, title, description, image, className, metaData, actions, onClick, }: Props): React.ReactElement;
5
5
  displayName: string;
6
6
  };
7
7
  export default CardVideo;
@@ -1,4 +1,6 @@
1
1
  import { CardData } from '../../Card.types';
2
2
  export interface Props extends CardData {
3
3
  className?: string;
4
+ video?: string;
5
+ isMuted?: boolean;
4
6
  }
@@ -1,5 +1,4 @@
1
1
  export { default as Blockquote } from './Blockquote';
2
- export { default as Button } from './Button';
3
2
  export { default as Copy } from './Copy';
4
3
  export { default as Hr } from './Hr';
5
4
  export { default as Heading } from './Heading';
@@ -13,6 +12,8 @@ export { default as Loader } from './Loader';
13
12
  export { default as Container } from './Container';
14
13
  export { default as ContentPageLayout } from './ContentPageLayout';
15
14
  export { default as ContentRowsLayout } from './ContentRowsLayout';
15
+ export { default as Button } from './Button';
16
+ export { default as Card } from './Card';
16
17
  export { default as Form } from './Form';
17
18
  export { default as FormField } from './FormField';
18
19
  export type { Props as BlockquoteProps } from './Blockquote/Blockquote.types';
@@ -38,3 +39,4 @@ export { CRL_SIZE } from './ContentRowsLayout/ContentRowsLayout.types';
38
39
  export type { Props as FormProps } from './Form/Form.types';
39
40
  export type { Props as FormFieldProps } from './FormField/FormField.types';
40
41
  export { FIELD_TYPES } from './FormField/FormField.types';
42
+ export type { Props as CardProps } from './Card/Card.types';
@@ -2,4 +2,4 @@ import React from 'react';
2
2
  import '@elastic/eui/dist/eui_theme_light.css';
3
3
  import '@elastic/react-search-ui-views/lib/styles/styles.css';
4
4
  import { Props } from './Search.types';
5
- export default function Search({ showOptions, resultAs, ResultFieldMap, }: Props): React.ReactElement;
5
+ export default function Search({ showOptions, resultAs, ResultFieldMap, config, facetDisplay, noSidebar, }: Props): React.ReactElement;
@@ -1,12 +1,27 @@
1
- import { cardMap } from "./views/Result/Result.types";
1
+ /// <reference types="react" />
2
+ import { cardMap } from './views/Result/Result.types';
2
3
  export declare enum ResultAsTypes {
3
4
  cardBasic = "cardBasic",
4
5
  cardMedia = "cardMedia",
5
6
  cardVideo = "cardVideo"
6
7
  }
8
+ interface FacetDisplay {
9
+ field: string;
10
+ label: string;
11
+ view: React.FC<any>;
12
+ }
7
13
  export interface Props {
8
14
  custom: string;
9
15
  showOptions: number[];
10
16
  resultAs: ResultAsTypes;
11
17
  ResultFieldMap?: cardMap;
18
+ config: {
19
+ searchFields: any;
20
+ filters: any[];
21
+ facets: any;
22
+ resultsFields: any;
23
+ };
24
+ facetDisplay: FacetDisplay[];
25
+ noSidebar: boolean;
12
26
  }
27
+ export {};
@@ -7,4 +7,5 @@ export interface Props {
7
7
  bodyFooter?: React.ReactNode;
8
8
  bodyHeader?: React.ReactNode;
9
9
  sideContent?: React.ReactNode;
10
+ noSidebar?: boolean;
10
11
  }
@@ -1,5 +1,5 @@
1
1
  import { Props } from './Result.types';
2
- declare function Result({ className, result, onClickLink, as, cardMap, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
2
+ declare function Result({ className, result, as, cardMap, }: Props): import("react/jsx-runtime").JSX.Element;
3
3
  declare namespace Result {
4
4
  var displayName: string;
5
5
  }