@enact/limestone 1.10.1 → 1.10.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 (122) hide show
  1. package/.github/PULL_REQUEST_TEMPLATE.md +1 -0
  2. package/ActionGuide/ActionGuide.d.ts +1 -1
  3. package/ActionGuide/ActionGuide.module.css +3 -0
  4. package/Alert/Alert.d.ts +9 -0
  5. package/Alert/Alert.js +63 -21
  6. package/Alert/Alert.module.css +41 -9
  7. package/Alert/AlertImage.module.css +5 -1
  8. package/Alert/tests/Alert-specs.js +6 -2
  9. package/BodyText/BodyText.d.ts +1 -1
  10. package/BodyText/BodyText.js +14 -9
  11. package/BodyText/BodyText.module.css +1 -1
  12. package/Button/Button.d.ts +3 -3
  13. package/Button/Button.module.css +14 -28
  14. package/CHANGELOG.md +48 -1
  15. package/Card/Card.d.ts +81 -9
  16. package/Card/Card.js +321 -84
  17. package/Card/Card.module.css +171 -20
  18. package/Card/tests/Card-specs.js +100 -0
  19. package/Checkbox/Checkbox.d.ts +2 -2
  20. package/Checkbox/Checkbox.module.css +2 -9
  21. package/CheckboxItem/CheckboxItem.d.ts +8 -1
  22. package/CheckboxItem/CheckboxItem.js +39 -12
  23. package/CheckboxItem/CheckboxItem.module.css +228 -4
  24. package/Chips/Chip.module.css +2 -2
  25. package/ContextualMenuDecorator/ContextualMenuDecorator.d.ts +2 -2
  26. package/ContextualPopupDecorator/ContextualPopup.module.css +1 -1
  27. package/ContextualPopupDecorator/ContextualPopupDecorator.js +2 -4
  28. package/ContextualPopupDecorator/tests/ContextualPopupDecorator-specs.js +39 -2
  29. package/Dropdown/Dropdown.d.ts +2 -2
  30. package/Dropdown/Dropdown.module.css +7 -7
  31. package/FixedPopupPanels/FixedPopupPanels.d.ts +2 -2
  32. package/FlexiblePopupPanels/FlexiblePopupPanels.module.css +15 -3
  33. package/FlexiblePopupPanels/index.d.ts +2 -2
  34. package/FormCheckboxItem/FormCheckboxItem.d.ts +1 -1
  35. package/FormCheckboxItem/FormCheckboxItem.js +1 -0
  36. package/FormCheckboxItem/FormCheckboxItem.module.css +1 -1
  37. package/Heading/Heading.d.ts +2 -2
  38. package/Icon/Icon.d.ts +22 -1
  39. package/Icon/Icon.js +21 -0
  40. package/Icon/IconList.js +43 -1
  41. package/IconItem/IconItem.d.ts +2 -2
  42. package/IconItem/IconItem.module.css +11 -14
  43. package/Image/Image.d.ts +1 -1
  44. package/Image/Image.module.css +1 -1
  45. package/ImageItem/ImageItem.d.ts +2 -2
  46. package/ImageItem/ImageItem.js +3 -16
  47. package/ImageItem/ImageItem.module.css +105 -97
  48. package/ImageItem/tests/ImageItem-specs.js +6 -5
  49. package/Input/Input.module.css +8 -7
  50. package/Input/InputField.module.css +4 -4
  51. package/Input/index.d.ts +1 -1
  52. package/Input/tests/Input-specs.js +2 -2
  53. package/Input/tests/InputField-specs.js +1 -1
  54. package/Item/Item.d.ts +2 -2
  55. package/Item/Item.module.css +27 -15
  56. package/KeyGuide/KeyGuide.d.ts +2 -2
  57. package/MediaOverlay/MediaOverlay.d.ts +2 -2
  58. package/MediaOverlay/MediaOverlay.module.css +2 -5
  59. package/MediaPlayer/MediaSlider.module.css +1 -0
  60. package/MediaPlayer/Times.module.css +1 -1
  61. package/MediaPlayer/index.d.ts +2 -2
  62. package/PageViews/PageViews.module.css +2 -1
  63. package/Panels/Header.module.css +40 -28
  64. package/Panels/Panel.module.css +1 -1
  65. package/Panels/index.d.ts +1 -1
  66. package/Picker/Picker.d.ts +1 -1
  67. package/Popup/Popup.module.css +4 -1
  68. package/PopupTabLayout/PopupTabLayout.d.ts +6 -6
  69. package/PopupTabLayout/PopupTabLayout.module.css +6 -6
  70. package/ProgressBar/ProgressBar.d.ts +1 -1
  71. package/ProgressBar/ProgressBar.module.css +12 -12
  72. package/ProgressBar/ProgressBarTooltip.module.css +7 -7
  73. package/ProgressButton/ProgressButton.d.ts +2 -2
  74. package/QuickGuidePanels/QuickGuidePanels.module.css +1 -1
  75. package/RadioItem/RadioItem.d.ts +1 -1
  76. package/RadioItem/RadioItem.module.css +18 -20
  77. package/Scroller/Scroller.d.ts +12 -0
  78. package/Scroller/Scroller.js +15 -0
  79. package/Scroller/tests/Scroller-specs.js +29 -0
  80. package/Scroller/useThemeScroller.js +22 -2
  81. package/Slider/Slider.d.ts +1 -1
  82. package/Slider/Slider.module.css +539 -300
  83. package/Spinner/Spinner.d.ts +1 -1
  84. package/Spinner/Spinner.module.css +2 -2
  85. package/Steps/Steps.d.ts +1 -1
  86. package/Steps/Steps.js +12 -6
  87. package/Steps/Steps.module.css +16 -2
  88. package/Switch/Switch.module.css +2 -5
  89. package/SwitchItem/SwitchItem.d.ts +1 -1
  90. package/TabLayout/RefocusDecorator.js +1 -1
  91. package/TabLayout/TabGroup.module.css +12 -6
  92. package/TabLayout/TabLayout.js +4 -0
  93. package/ThemeDecorator/ThemeDecorator.d.ts +1 -1
  94. package/ThemeDecorator/ThemeDecorator.module.css +22 -1
  95. package/TooltipDecorator/Tooltip.js +68 -7
  96. package/TooltipDecorator/Tooltip.module.css +40 -23
  97. package/TooltipDecorator/TooltipDecorator.d.ts +52 -0
  98. package/TooltipDecorator/TooltipDecorator.js +42 -0
  99. package/TooltipDecorator/TooltipLabel.js +67 -14
  100. package/TooltipDecorator/tests/TooltipDecorator-specs.js +46 -0
  101. package/TooltipDecorator/useTooltip.js +14 -2
  102. package/VideoPlayer/MediaTitle.module.css +1 -1
  103. package/VirtualList/VirtualList.d.ts +24 -0
  104. package/VirtualList/VirtualList.js +30 -0
  105. package/VirtualList/tests/stickTo-specs.js +115 -0
  106. package/VirtualList/tests/useEvent-specs.js +39 -0
  107. package/VirtualList/useEvent.js +45 -10
  108. package/VirtualList/useThemeVirtualList.js +20 -2
  109. package/WizardPanels/WizardPanels.module.css +1 -1
  110. package/fonts/Limestone_Icons.ttf +0 -0
  111. package/internal/DateComponentPicker/DateComponentPicker.module.css +3 -3
  112. package/internal/Picker/Picker.js +8 -10
  113. package/internal/Picker/Picker.module.css +74 -141
  114. package/package.json +11 -14
  115. package/styles/color-mixins.less +4 -60
  116. package/styles/colors-game.less +5 -5
  117. package/styles/colors.less +9 -10
  118. package/styles/mixins.less +0 -46
  119. package/styles/motion-mixins.less +16 -7
  120. package/styles/motions.less +2 -2
  121. package/styles/variables.less +71 -46
  122. package/useScroll/useScroll.js +3 -1
package/Card/Card.js CHANGED
@@ -11,6 +11,7 @@ var _Card = require("@enact/ui/Card");
11
11
  var _Layout = require("@enact/ui/Layout");
12
12
  var _Touchable = _interopRequireDefault(require("@enact/ui/Touchable"));
13
13
  var _resolution = _interopRequireDefault(require("@enact/ui/resolution"));
14
+ var _react = require("react");
14
15
  var _propTypes = _interopRequireDefault(require("prop-types"));
15
16
  var _compose = _interopRequireDefault(require("ramda/src/compose"));
16
17
  var _Icon = _interopRequireDefault(require("../Icon"));
@@ -22,7 +23,7 @@ var _ProgressBar = _interopRequireDefault(require("../ProgressBar"));
22
23
  var _Skinnable = _interopRequireDefault(require("../Skinnable"));
23
24
  var _CardModule = _interopRequireDefault(require("./Card.module.css"));
24
25
  var _jsxRuntime = require("react/jsx-runtime");
25
- var _excluded = ["css", "disabled", "icon", "imageSize", "primaryBadgeSrc", "secondaryBadgeSrc", "style"];
26
+ var _excluded = ["captionImageSize", "css", "disabled", "icon", "imageSize", "primaryBadge", "primaryBadgeSize", "secondaryBadge", "secondaryBadgeSize", "showDuration", "duration", "progress", "showProgressBar", "style"];
26
27
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
27
28
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
28
29
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
@@ -46,6 +47,62 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
46
47
  * @exports CardBase
47
48
  * @exports CardDecorator
48
49
  */
50
+ var formatDuration = function formatDuration(duration) {
51
+ if (!duration || duration < 0) return '00:00';
52
+ var hours = Math.floor(duration / 3600);
53
+ var minutes = Math.floor(duration % 3600 / 60);
54
+ var seconds = duration % 60;
55
+ var mm = String(minutes).padStart(2, '0');
56
+ var ss = String(seconds).padStart(2, '0');
57
+ if (hours > 0) {
58
+ var hh = String(hours).padStart(2, '0');
59
+ return "".concat(hh, ":").concat(mm, ":").concat(ss);
60
+ }
61
+ return "".concat(mm, ":").concat(ss);
62
+ };
63
+ var getBadge = function getBadge(badge, size, className) {
64
+ var element = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
65
+ children: badge
66
+ });
67
+ var elementSize = {};
68
+ if (/*#__PURE__*/(0, _react.isValidElement)(badge)) element = badge;
69
+ if (size) {
70
+ elementSize = typeof size === 'object' ? {
71
+ width: _resolution["default"].scaleToRem(size.width),
72
+ height: _resolution["default"].scaleToRem(size.height)
73
+ } : {
74
+ fontSize: _resolution["default"].scaleToRem(size)
75
+ };
76
+ }
77
+ return /*#__PURE__*/(0, _react.cloneElement)(element, {
78
+ className: className,
79
+ style: _objectSpread({}, elementSize)
80
+ });
81
+ };
82
+ var getImageIcons = function getImageIcons(images, key, className) {
83
+ if (!images) return null;
84
+ var getCellElement = function getCellElement(src) {
85
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
86
+ className: className,
87
+ component: _Image["default"],
88
+ shrink: true,
89
+ src: src
90
+ });
91
+ };
92
+ if (Array.isArray(images)) {
93
+ return images.map(function (src, idx) {
94
+ return /*#__PURE__*/(0, _react.cloneElement)(getCellElement(src), {
95
+ key: "".concat(key).concat(idx)
96
+ });
97
+ });
98
+ }
99
+ if (/*#__PURE__*/(0, _react.isValidElement)(images)) {
100
+ return /*#__PURE__*/(0, _react.cloneElement)(images, {
101
+ className: className
102
+ });
103
+ }
104
+ return getCellElement(images);
105
+ };
49
106
  var getDefaultImageSize = function getDefaultImageSize(orientation) {
50
107
  var sizes = {
51
108
  vertical: {
@@ -59,6 +116,17 @@ var getDefaultImageSize = function getDefaultImageSize(orientation) {
59
116
  };
60
117
  return sizes[orientation];
61
118
  };
119
+ var getLabelIcons = function getLabelIcons(icons, key, className) {
120
+ if (!icons) return null;
121
+ return icons.map(function (labelIcon, index) {
122
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
123
+ shrink: true,
124
+ children: /*#__PURE__*/(0, _react.cloneElement)(labelIcon, {
125
+ className: className
126
+ })
127
+ }, "".concat(key).concat(index));
128
+ }) || null;
129
+ };
62
130
 
63
131
  /**
64
132
  * A Limestone styled base component for {@link limestone/Card.Card|Card}.
@@ -89,6 +157,47 @@ var CardBase = exports.CardBase = (0, _kind["default"])({
89
157
  * @public
90
158
  */
91
159
  'aria-label': _propTypes["default"].string,
160
+ /**
161
+ * Sources for the image icon.
162
+ *
163
+ * An array of String values or Objects of values used to determine which image will appear on
164
+ * a specific screenSize. This prop is only used when `orientation` is `'vertical'`.
165
+ *
166
+ * @type {String[]|Object[]}
167
+ * @public
168
+ */
169
+ captionImageIconsSrc: _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].object])),
170
+ /**
171
+ * The size of the caption images.
172
+ *
173
+ * The following properties should be provided:
174
+ * * `height` - The height of the image
175
+ * * `width` - The width of the image
176
+ *
177
+ * @type {Object}
178
+ * @default {height: 96, width: 96}
179
+ * @public
180
+ */
181
+ captionImageSize: _propTypes["default"].shape({
182
+ height: _propTypes["default"].number,
183
+ width: _propTypes["default"].number
184
+ }),
185
+ /**
186
+ * Determines whether the caption will overflow the card container or not.
187
+ * It only applies when `orientation` is `'vertical'` and `captionOverlay` and `captionOverlayOnFocus` is `false`.
188
+ *
189
+ * @type {Boolean}
190
+ * @public
191
+ */
192
+ captionOverflow: _propTypes["default"].bool,
193
+ /**
194
+ * Determines whether the caption will overflow the card container and show only on card focus.
195
+ * It only applies when `orientation` is `'vertical'` and `captionOverlay` and `captionOverlayOnFocus` is `false`.
196
+ *
197
+ * @type {Boolean}
198
+ * @public
199
+ */
200
+ captionOverflowOnFocus: _propTypes["default"].bool,
92
201
  /**
93
202
  * Determines whether the caption will be placed over the image or not.
94
203
  * It only applies when `orientation` is `'vertical'`.
@@ -112,6 +221,14 @@ var CardBase = exports.CardBase = (0, _kind["default"])({
112
221
  * @public
113
222
  */
114
223
  centered: _propTypes["default"].bool,
224
+ /**
225
+ * Centers the title and `imageIconSrc` horizontally and vertically.
226
+ * It only applies when `captionOverlay` or `captionOverlayOnFocus` is `true`.
227
+ *
228
+ * @type {Boolean}
229
+ * @public
230
+ */
231
+ centeredTitle: _propTypes["default"].bool,
115
232
  /**
116
233
  * The primary caption displayed with the image.
117
234
  *
@@ -141,6 +258,20 @@ var CardBase = exports.CardBase = (0, _kind["default"])({
141
258
  * @public
142
259
  */
143
260
  disabled: _propTypes["default"].bool,
261
+ /**
262
+ * Media's entire duration in seconds.
263
+ *
264
+ * @type {Number}
265
+ * @public
266
+ */
267
+ duration: _propTypes["default"].number,
268
+ /**
269
+ * Determines whether the `Duration` will be placed over the image or not.
270
+ *
271
+ * @type {Boolean}
272
+ * @public
273
+ */
274
+ durationOverlay: _propTypes["default"].bool,
144
275
  /**
145
276
  * Fits the image to its height and width and positions it on the center of the Card.
146
277
  *
@@ -167,20 +298,21 @@ var CardBase = exports.CardBase = (0, _kind["default"])({
167
298
  /**
168
299
  * Source for the image icon.
169
300
  *
170
- * String value or Object of values used to determine which image will appear on
171
- * a specific screenSize. This prop is only used when `orientation` is `'vertical'`.
301
+ * String value or element or Object of values used to determine which image will appear on
302
+ * a specific screenSize. This prop is only used when `orientation` is `'vertical'` or `centeredTitle` is `true`.
172
303
  *
173
- * @type {String|Object}
304
+ * @type {String|Object|Element}
174
305
  * @public
175
306
  */
176
- imageIconSrc: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].object]),
307
+ imageIconSrc: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].object, _propTypes["default"].element]),
177
308
  /**
178
309
  * The size of the image.
179
310
  *
180
311
  * The following properties should be provided:
181
312
  * * `height` - The height of the image
182
313
  * * `width` - The width of the image
183
- * @type {Object}
314
+ *
315
+ * @type {Object}
184
316
  * @default {height: 432, width: 768}
185
317
  * @public
186
318
  */
@@ -195,6 +327,15 @@ var CardBase = exports.CardBase = (0, _kind["default"])({
195
327
  * @public
196
328
  */
197
329
  label: _propTypes["default"].string,
330
+ /**
331
+ * Icons to be included with the secondary caption.
332
+ *
333
+ * Typically, up to 3 icons are used.
334
+ *
335
+ * @type {Element|Element[]}
336
+ * @public
337
+ */
338
+ labelIcons: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].arrayOf(_propTypes["default"].element)]),
198
339
  /**
199
340
  * The layout orientation of the component.
200
341
  *
@@ -219,12 +360,26 @@ var CardBase = exports.CardBase = (0, _kind["default"])({
219
360
  */
220
361
  pressed: _propTypes["default"].bool,
221
362
  /**
222
- * The primary badge image source.
363
+ * The primary badge.
223
364
  *
224
- * @type {String|Object}
365
+ * @type {Element|String}
225
366
  * @public
226
367
  */
227
- primaryBadgeSrc: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].object]),
368
+ primaryBadge: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].string]),
369
+ /**
370
+ * The size of the primary badge. Can be a number or an object with specific dimensions.
371
+ * The following properties should be provided for the object:
372
+ * * `height` - The height of the badge
373
+ * * `width` - The width of the badge
374
+ *
375
+ * @type {Object|Number}
376
+ * @default {width: 108, height: 108}
377
+ * @public
378
+ */
379
+ primaryBadgeSize: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].shape({
380
+ height: _propTypes["default"].number,
381
+ width: _propTypes["default"].number
382
+ })]),
228
383
  /**
229
384
  * The progress displayed inside the ProgressBar
230
385
  *
@@ -232,6 +387,13 @@ var CardBase = exports.CardBase = (0, _kind["default"])({
232
387
  * @public
233
388
  */
234
389
  progress: _propTypes["default"].number,
390
+ /**
391
+ * Determines whether the `ProgressBar` will be placed over the image or not.
392
+ *
393
+ * @type {Boolean}
394
+ * @public
395
+ */
396
+ progressBarOverlay: _propTypes["default"].bool,
235
397
  /**
236
398
  * Set to `true` to display the image with rounded corners.
237
399
  *
@@ -240,12 +402,26 @@ var CardBase = exports.CardBase = (0, _kind["default"])({
240
402
  */
241
403
  roundedImage: _propTypes["default"].bool,
242
404
  /**
243
- * The secondary badge image source.
405
+ * The secondary badge.
244
406
  *
245
- * @type {String|Object}
407
+ * @type {Element|String}
246
408
  * @public
247
409
  */
248
- secondaryBadgeSrc: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].object]),
410
+ secondaryBadge: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].string]),
411
+ /**
412
+ * The size of the secondary badge. Can be a number or an object with specific dimensions.
413
+ * The following properties should be provided for the object:
414
+ * * `height` - The height of the badge
415
+ * * `width` - The width of the badge
416
+ *
417
+ * @type {Object|Number}
418
+ * @default {width: 108, height: 108}
419
+ * @public
420
+ */
421
+ secondaryBadgeSize: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].shape({
422
+ height: _propTypes["default"].number,
423
+ width: _propTypes["default"].number
424
+ })]),
249
425
  /**
250
426
  * A ternary caption displayed with the image.
251
427
  *
@@ -253,6 +429,15 @@ var CardBase = exports.CardBase = (0, _kind["default"])({
253
429
  * @public
254
430
  */
255
431
  secondaryLabel: _propTypes["default"].string,
432
+ /**
433
+ * Icons to be included with the ternary caption.
434
+ *
435
+ * Typically, up to 3 icons are used.
436
+ *
437
+ * @type {Element|Element[]}
438
+ * @public
439
+ */
440
+ secondaryLabelIcons: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].arrayOf(_propTypes["default"].element)]),
256
441
  /**
257
442
  * Applies a selected visual effect to the image.
258
443
  *
@@ -260,6 +445,13 @@ var CardBase = exports.CardBase = (0, _kind["default"])({
260
445
  * @public
261
446
  */
262
447
  selected: _propTypes["default"].bool,
448
+ /**
449
+ * Activates the 'Duration'.
450
+ *
451
+ * @type {Boolean}
452
+ * @public
453
+ */
454
+ showDuration: _propTypes["default"].bool,
263
455
  /**
264
456
  * Activates the 'ProgressBar'.
265
457
  *
@@ -311,68 +503,75 @@ var CardBase = exports.CardBase = (0, _kind["default"])({
311
503
  return _captionOverlay || captionOverlayOnFocus;
312
504
  },
313
505
  children: function children(_ref3) {
314
- var captionOverlay = _ref3.captionOverlay,
506
+ var captionImageIconsSrc = _ref3.captionImageIconsSrc,
507
+ captionOverlay = _ref3.captionOverlay,
315
508
  captionOverlayOnFocus = _ref3.captionOverlayOnFocus,
316
509
  centered = _ref3.centered,
510
+ centeredTitle = _ref3.centeredTitle,
317
511
  _children = _ref3.children,
318
512
  css = _ref3.css,
513
+ duration = _ref3.duration,
514
+ durationOverlay = _ref3.durationOverlay,
319
515
  index = _ref3['data-index'],
320
516
  imageIconSrc = _ref3.imageIconSrc,
321
517
  label = _ref3.label,
518
+ labelIcons = _ref3.labelIcons,
322
519
  orientation = _ref3.orientation,
323
520
  progress = _ref3.progress,
521
+ progressBarOverlay = _ref3.progressBarOverlay,
324
522
  secondaryLabel = _ref3.secondaryLabel,
523
+ secondaryLabelIcons = _ref3.secondaryLabelIcons,
524
+ showDuration = _ref3.showDuration,
325
525
  showProgressBar = _ref3.showProgressBar,
326
526
  splitCaption = _ref3.splitCaption,
327
527
  withoutMarquee = _ref3.withoutMarquee;
528
+ var isCenteredTitle = (captionOverlay || captionOverlayOnFocus) && orientation === 'vertical' && centeredTitle;
328
529
  var hasImageIcon = imageIconSrc && orientation === 'vertical';
329
- var alignment = centered && !imageIconSrc ? {
530
+ var hasCaptionImageIcons = captionImageIconsSrc && captionImageIconsSrc.filter(Boolean).length && orientation === 'vertical';
531
+ var alignment = centered && !imageIconSrc || isCenteredTitle ? {
330
532
  alignment: 'center'
331
533
  } : null;
332
- var captions = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Layout.Row, {
534
+ var labelsProps = withoutMarquee ? {
535
+ style: {
536
+ textAlign: alignment === null || alignment === void 0 ? void 0 : alignment.alignment
537
+ }
538
+ } : _objectSpread({}, alignment);
539
+ var CaptionsComponent = isCenteredTitle ? _Layout.Column : _Layout.Row;
540
+ var LabelsComponent = withoutMarquee ? 'div' : _Marquee.Marquee;
541
+ var captions = /*#__PURE__*/(0, _jsxRuntime.jsxs)(CaptionsComponent, {
333
542
  className: css.captions,
334
- children: [hasImageIcon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
335
- className: css.imageIcon,
336
- component: _Image["default"],
337
- shrink: true,
338
- src: imageIconSrc
339
- }) : null, withoutMarquee ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Layout.Cell, {
340
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
341
- style: {
342
- textAlign: alignment === null || alignment === void 0 ? void 0 : alignment.alignment
343
- },
543
+ children: [hasImageIcon ? getImageIcons(imageIconSrc, null, css.imageIcon) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Layout.Cell, {
544
+ className: css.captionCell,
545
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(LabelsComponent, _objectSpread(_objectSpread({}, labelsProps), {}, {
344
546
  className: css.caption,
345
547
  children: _children
346
- }), typeof label !== 'undefined' ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
347
- style: {
348
- textAlign: alignment === null || alignment === void 0 ? void 0 : alignment.alignment
349
- },
350
- className: css.label,
351
- children: label
352
- }) : null, typeof secondaryLabel !== 'undefined' ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
353
- style: {
354
- textAlign: alignment === null || alignment === void 0 ? void 0 : alignment.alignment
355
- },
356
- className: css.label,
357
- children: secondaryLabel
358
- }) : null, showProgressBar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
359
- progress: progress
360
- }) : null]
361
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Layout.Cell, {
362
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Marquee.Marquee, _objectSpread(_objectSpread({}, alignment), {}, {
363
- className: css.caption,
364
- marqueeOn: "hover",
365
- children: _children
366
- })), typeof label !== 'undefined' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Marquee.Marquee, _objectSpread(_objectSpread({}, alignment), {}, {
367
- className: css.label,
368
- marqueeOn: "hover",
369
- children: label
370
- })) : null, typeof secondaryLabel !== 'undefined' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Marquee.Marquee, _objectSpread(_objectSpread({}, alignment), {}, {
371
- className: css.label,
372
- marqueeOn: "hover",
373
- children: secondaryLabel
374
- })) : null, showProgressBar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
548
+ })), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Layout.Column, {
549
+ className: css.labels,
550
+ children: [typeof label !== 'undefined' ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Layout.Row, {
551
+ className: css.labelContainer,
552
+ children: [getLabelIcons(labelIcons, 'labelIcons', css.labelIcon), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
553
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(LabelsComponent, _objectSpread(_objectSpread({}, labelsProps), {}, {
554
+ className: css.label,
555
+ children: label
556
+ }))
557
+ })]
558
+ }) : null, typeof secondaryLabel !== 'undefined' ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Layout.Row, {
559
+ className: css.labelContainer,
560
+ children: [getLabelIcons(secondaryLabelIcons, 'secondaryLabelIcons', css.labelIcon), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
561
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(LabelsComponent, _objectSpread(_objectSpread({}, labelsProps), {}, {
562
+ className: css.label,
563
+ children: secondaryLabel
564
+ }))
565
+ })]
566
+ }) : null, hasCaptionImageIcons ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Row, {
567
+ className: css.captionImageIconsContainer,
568
+ children: getImageIcons(captionImageIconsSrc, 'captionImageIcons', css.captionImageIcon)
569
+ }) : null]
570
+ }), showProgressBar && !progressBarOverlay && !isCenteredTitle ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
375
571
  progress: progress
572
+ }) : null, showDuration && !durationOverlay && !showProgressBar ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
573
+ className: css.duration,
574
+ children: formatDuration(duration)
376
575
  }) : null]
377
576
  })]
378
577
  });
@@ -415,53 +614,87 @@ var CardBase = exports.CardBase = (0, _kind["default"])({
415
614
  }) : selectedCaptions;
416
615
  },
417
616
  className: function className(_ref4) {
418
- var captionOverlay = _ref4.captionOverlay,
617
+ var captionOverflow = _ref4.captionOverflow,
618
+ captionOverflowOnFocus = _ref4.captionOverflowOnFocus,
619
+ captionOverlay = _ref4.captionOverlay,
419
620
  captionOverlayOnFocus = _ref4.captionOverlayOnFocus,
621
+ centeredTitle = _ref4.centeredTitle,
622
+ durationOverlay = _ref4.durationOverlay,
420
623
  icon = _ref4.icon,
421
624
  label = _ref4.label,
422
625
  pressed = _ref4.pressed,
626
+ progressBarOverlay = _ref4.progressBarOverlay,
423
627
  roundedImage = _ref4.roundedImage,
424
628
  hasContainer = _ref4.hasContainer,
425
629
  orientation = _ref4.orientation,
426
630
  secondaryLabel = _ref4.secondaryLabel,
427
631
  styler = _ref4.styler;
428
632
  return styler.append({
633
+ captionOverflow: captionOverflow && orientation === 'vertical' && !captionOverlay && !captionOverlayOnFocus,
634
+ captionOverflowOnFocus: !captionOverflow && captionOverflowOnFocus && orientation === 'vertical' && !captionOverlay && !captionOverlayOnFocus,
429
635
  captionOverlay: captionOverlay && orientation === 'vertical',
430
636
  captionOverlayOnFocus: !captionOverlay && captionOverlayOnFocus && orientation === 'vertical',
637
+ centeredTitle: centeredTitle,
638
+ durationOverlay: durationOverlay,
431
639
  pressed: pressed,
432
640
  roundedImage: roundedImage,
433
- hasContainer: orientation === 'horizontal' || hasContainer && !captionOverlay,
641
+ hasContainer: orientation === 'horizontal' || hasContainer && !captionOverlay && !captionOverlayOnFocus,
434
642
  hasLabel: orientation === 'vertical' && label && secondaryLabel,
435
- isCheckIcon: icon === 'check'
643
+ isCheckIcon: icon === 'check',
644
+ progressBarOverlay: progressBarOverlay
436
645
  });
437
646
  },
438
- splitCaption: function splitCaption(_ref5) {
439
- var captionOverlay = _ref5.captionOverlay,
440
- captionOverlayOnFocus = _ref5.captionOverlayOnFocus,
441
- _splitCaption = _ref5.splitCaption;
647
+ showDuration: function showDuration(_ref5) {
648
+ var _showDuration = _ref5.showDuration,
649
+ showProgressBar = _ref5.showProgressBar,
650
+ durationOverlay = _ref5.durationOverlay;
651
+ return _showDuration && durationOverlay && !showProgressBar;
652
+ },
653
+ showProgressBar: function showProgressBar(_ref6) {
654
+ var _showProgressBar = _ref6.showProgressBar,
655
+ progressBarOverlay = _ref6.progressBarOverlay;
656
+ return _showProgressBar && progressBarOverlay;
657
+ },
658
+ splitCaption: function splitCaption(_ref7) {
659
+ var captionOverlay = _ref7.captionOverlay,
660
+ captionOverlayOnFocus = _ref7.captionOverlayOnFocus,
661
+ _splitCaption = _ref7.splitCaption;
442
662
  return (captionOverlay || captionOverlayOnFocus) && _splitCaption;
443
663
  }
444
664
  },
445
- render: function render(_ref6) {
665
+ render: function render(_ref8) {
446
666
  var _imageSize$height, _imageSize$width;
447
- var css = _ref6.css,
448
- disabled = _ref6.disabled,
449
- icon = _ref6.icon,
450
- imageSize = _ref6.imageSize,
451
- primaryBadgeSrc = _ref6.primaryBadgeSrc,
452
- secondaryBadgeSrc = _ref6.secondaryBadgeSrc,
453
- style = _ref6.style,
454
- rest = _objectWithoutProperties(_ref6, _excluded);
667
+ var captionImageSize = _ref8.captionImageSize,
668
+ css = _ref8.css,
669
+ disabled = _ref8.disabled,
670
+ icon = _ref8.icon,
671
+ imageSize = _ref8.imageSize,
672
+ primaryBadge = _ref8.primaryBadge,
673
+ primaryBadgeSize = _ref8.primaryBadgeSize,
674
+ secondaryBadge = _ref8.secondaryBadge,
675
+ secondaryBadgeSize = _ref8.secondaryBadgeSize,
676
+ showDuration = _ref8.showDuration,
677
+ duration = _ref8.duration,
678
+ progress = _ref8.progress,
679
+ showProgressBar = _ref8.showProgressBar,
680
+ style = _ref8.style,
681
+ rest = _objectWithoutProperties(_ref8, _excluded);
682
+ delete rest.captionImageIconsSrc;
683
+ delete rest.captionOverflow;
684
+ delete rest.captionOverflowOnFocus;
455
685
  delete rest.captionOverlayOnFocus;
456
686
  delete rest.centered;
457
- delete rest.label;
458
- delete rest.progress;
459
- delete rest.secondaryLabel;
460
- delete rest.showProgressBar;
461
- delete rest.imageIconSrc;
687
+ delete rest.centeredTitle;
688
+ delete rest.durationOverlay;
462
689
  delete rest.hasContainer;
690
+ delete rest.imageIconSrc;
691
+ delete rest.label;
692
+ delete rest.labelIcons;
463
693
  delete rest.pressed;
694
+ delete rest.progressBarOverlay;
464
695
  delete rest.roundedImage;
696
+ delete rest.secondaryLabel;
697
+ delete rest.secondaryLabelIcons;
465
698
  delete rest.withoutMarquee;
466
699
  var defaultImageSize = getDefaultImageSize(rest.orientation);
467
700
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Card.Card, _objectSpread(_objectSpread({}, rest), {}, {
@@ -470,23 +703,27 @@ var CardBase = exports.CardBase = (0, _kind["default"])({
470
703
  "data-webos-voice-intent": "Select",
471
704
  disabled: disabled,
472
705
  imageComponent: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Image["default"], {
473
- children: [primaryBadgeSrc ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Image["default"], {
474
- className: css.primaryBadge,
475
- src: primaryBadgeSrc
476
- }) : null, secondaryBadgeSrc ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Image["default"], {
477
- className: css.secondaryBadge,
478
- src: secondaryBadgeSrc
479
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
706
+ children: [primaryBadge ? getBadge(primaryBadge, primaryBadgeSize, css.primaryBadge) : null, secondaryBadge ? getBadge(secondaryBadge, secondaryBadgeSize, css.secondaryBadge) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
480
707
  className: css.selectionContainer,
481
708
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon["default"], {
482
709
  className: css.selectionIcon,
483
710
  children: icon
484
711
  })
485
- })]
712
+ }), showDuration ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
713
+ className: css.duration,
714
+ children: formatDuration(duration)
715
+ }) : null, showProgressBar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
716
+ className: css.progress,
717
+ progress: progress
718
+ }) : null]
486
719
  }),
487
- style: _objectSpread(_objectSpread({}, style), {}, {
720
+ style: _objectSpread(_objectSpread(_objectSpread({}, style), {}, {
488
721
  '--card-image-height': _resolution["default"].scaleToRem((_imageSize$height = imageSize === null || imageSize === void 0 ? void 0 : imageSize.height) !== null && _imageSize$height !== void 0 ? _imageSize$height : defaultImageSize.height),
489
722
  '--card-image-width': _resolution["default"].scaleToRem((_imageSize$width = imageSize === null || imageSize === void 0 ? void 0 : imageSize.width) !== null && _imageSize$width !== void 0 ? _imageSize$width : defaultImageSize.width)
723
+ }, (captionImageSize === null || captionImageSize === void 0 ? void 0 : captionImageSize.height) && {
724
+ '--caption-image-height': _resolution["default"].scaleToRem(captionImageSize.height)
725
+ }), (captionImageSize === null || captionImageSize === void 0 ? void 0 : captionImageSize.width) && {
726
+ '--caption-image-width': _resolution["default"].scaleToRem(captionImageSize.width)
490
727
  })
491
728
  }));
492
729
  }