@enact/limestone 1.3.0 → 1.9.4

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 (166) hide show
  1. package/.github/workflows/ci-branch.yml +21 -0
  2. package/.github/workflows/ci-pull-request.yml +16 -0
  3. package/.github/workflows/ci-reusable.yml +73 -0
  4. package/ActionGuide/ActionGuide.d.ts +5 -4
  5. package/ActionGuide/ActionGuide.module.css +1 -1
  6. package/Alert/Alert.d.ts +4 -2
  7. package/Alert/Alert.js +4 -1
  8. package/Alert/Alert.module.css +36 -0
  9. package/BodyText/BodyText.d.ts +5 -4
  10. package/BodyText/BodyText.module.css +7 -7
  11. package/Button/Button.d.ts +17 -12
  12. package/Button/Button.js +1 -1
  13. package/Button/Button.module.css +195 -268
  14. package/CHANGELOG.md +226 -0
  15. package/Card/Card.d.ts +36 -8
  16. package/Card/Card.js +157 -20
  17. package/Card/Card.module.css +277 -58
  18. package/Card/tests/Card-specs.js +30 -0
  19. package/Checkbox/Checkbox.d.ts +8 -7
  20. package/Checkbox/Checkbox.js +3 -1
  21. package/Checkbox/Checkbox.module.css +213 -120
  22. package/Checkbox/tests/Checkbox-specs.js +1 -1
  23. package/CheckboxItem/CheckboxItem.d.ts +22 -7
  24. package/CheckboxItem/CheckboxItem.js +69 -4
  25. package/Chips/Chip.js +60 -7
  26. package/Chips/Chip.module.css +3 -3
  27. package/Chips/Chips.js +26 -12
  28. package/Chips/Chips.module.css +1 -1
  29. package/Chips/tests/Chip-specs.js +19 -9
  30. package/Chips/tests/Chips-specs.js +19 -19
  31. package/ContextualMenuDecorator/ContextualMenuDecorator.d.ts +4 -5
  32. package/ContextualPopupDecorator/ContextualPopup.module.css +34 -34
  33. package/ContextualPopupDecorator/ContextualPopupDecorator.js +557 -549
  34. package/DatePicker/DatePicker.d.ts +4 -5
  35. package/DayPicker/DayPicker.d.ts +8 -7
  36. package/Dropdown/Dropdown.d.ts +11 -13
  37. package/Dropdown/Dropdown.module.css +9 -9
  38. package/Dropdown/DropdownList.js +16 -11
  39. package/FixedPopupPanels/FixedPopupPanels.d.ts +4 -2
  40. package/FixedPopupPanels/FixedPopupPanels.module.css +18 -18
  41. package/FlexiblePopupPanels/FlexiblePopupPanels.module.css +23 -23
  42. package/FormCheckboxItem/FormCheckboxItem.d.ts +5 -4
  43. package/Heading/Heading.d.ts +8 -7
  44. package/Heading/Heading.module.css +5 -5
  45. package/Icon/Icon.d.ts +14 -4
  46. package/Icon/Icon.js +48 -2
  47. package/Icon/Icon.module.css +1 -1
  48. package/Icon/IconList.js +25 -1
  49. package/IconItem/IconItem.d.ts +13 -12
  50. package/IconItem/IconItem.js +15 -0
  51. package/IconItem/IconItem.module.css +107 -1
  52. package/Image/Image.d.ts +5 -4
  53. package/ImageItem/ImageItem.d.ts +11 -10
  54. package/ImageItem/ImageItem.js +37 -31
  55. package/ImageItem/ImageItem.module.css +30 -30
  56. package/ImageItem/tests/ImageItem-specs.js +3 -10
  57. package/Input/Input.js +9 -2
  58. package/Input/Input.module.css +37 -8
  59. package/Input/InputField.js +5 -1
  60. package/Input/InputField.module.css +17 -2
  61. package/Input/InputFieldSpotlightDecorator.js +213 -229
  62. package/Input/index.d.ts +15 -18
  63. package/Input/tests/InputField-specs.js +21 -0
  64. package/Item/Item.d.ts +16 -9
  65. package/Item/Item.js +20 -2
  66. package/Item/Item.module.css +1 -1
  67. package/KeyGuide/KeyGuide.d.ts +8 -7
  68. package/KeyGuide/KeyGuide.module.css +25 -1
  69. package/Marquee/Marquee.d.ts +2 -4
  70. package/MediaOverlay/MediaOverlay.d.ts +12 -11
  71. package/MediaOverlay/MediaOverlay.js +43 -21
  72. package/MediaOverlay/MediaOverlay.module.css +114 -15
  73. package/MediaPlayer/MediaControls.js +195 -13
  74. package/MediaPlayer/MediaControls.module.css +3 -2
  75. package/MediaPlayer/MediaSlider.module.css +7 -20
  76. package/MediaPlayer/index.d.ts +59 -7
  77. package/PageViews/PageViews.js +165 -80
  78. package/PageViews/PageViewsRouter.js +9 -0
  79. package/PageViews/tests/PageViews-specs.js +84 -0
  80. package/Panels/Header.js +48 -30
  81. package/Panels/Header.module.css +83 -31
  82. package/Panels/Panel.module.css +1 -1
  83. package/Panels/index.d.ts +7 -8
  84. package/Picker/Picker.d.ts +4 -5
  85. package/Picker/Picker.module.css +2 -2
  86. package/Popup/Popup.js +242 -240
  87. package/Popup/Popup.module.css +24 -24
  88. package/PopupTabLayout/PopupTabLayout.d.ts +5 -7
  89. package/PopupTabLayout/PopupTabLayout.js +15 -9
  90. package/PopupTabLayout/PopupTabLayout.module.css +53 -16
  91. package/PopupTabLayout/PopupTabLayoutStateContext.js +8 -0
  92. package/ProgressBar/ProgressBar.d.ts +5 -4
  93. package/ProgressBar/ProgressBarTooltip.module.css +12 -12
  94. package/ProgressButton/ProgressButton.d.ts +4 -5
  95. package/QuickGuidePanels/QuickGuidePanels.module.css +2 -2
  96. package/RadioItem/RadioItem.d.ts +18 -5
  97. package/RadioItem/RadioItem.js +67 -2
  98. package/RadioItem/RadioItem.module.css +36 -36
  99. package/RangePicker/RangePicker.module.css +2 -2
  100. package/Scroller/EditableWrapper.js +11 -4
  101. package/Scroller/Scroller.d.ts +20 -16
  102. package/Scroller/Scroller.js +9 -3
  103. package/Scroller/Scroller.module.css +4 -4
  104. package/Slider/Slider.d.ts +16 -14
  105. package/Slider/Slider.js +37 -4
  106. package/Slider/Slider.module.css +314 -91
  107. package/Slider/tests/Slider-specs.js +2 -1
  108. package/Spinner/Spinner.d.ts +5 -4
  109. package/Spinner/Spinner.module.css +9 -9
  110. package/Steps/Steps.d.ts +5 -4
  111. package/Steps/Steps.js +9 -5
  112. package/Switch/Switch.d.ts +8 -7
  113. package/Switch/Switch.module.css +100 -13
  114. package/SwitchItem/SwitchItem.d.ts +9 -6
  115. package/TabLayout/RefocusDecorator.js +15 -9
  116. package/TabLayout/TabGroup.js +3 -2
  117. package/TabLayout/TabGroup.module.css +2 -2
  118. package/TabLayout/TabLayout.d.ts +6 -0
  119. package/TabLayout/TabLayout.js +11 -1
  120. package/TabLayout/TabLayout.module.css +18 -0
  121. package/TabLayout/tests/TabLayout-specs.js +52 -0
  122. package/ThemeDecorator/ThemeDecorator.d.ts +9 -10
  123. package/ThemeDecorator/fontGenerator.js +1 -1
  124. package/ThemeDecorator/screenTypes.json +1 -0
  125. package/TimePicker/TimePicker.module.css +1 -1
  126. package/TooltipDecorator/Tooltip.module.css +1 -2
  127. package/TooltipDecorator/tests/util-specs.js +12 -0
  128. package/TooltipDecorator/useTooltip.js +1 -1
  129. package/TooltipDecorator/util.js +18 -11
  130. package/VideoPlayer/Feedback.js +3 -0
  131. package/VideoPlayer/Feedback.module.css +5 -9
  132. package/VideoPlayer/FeedbackIcons.js +1 -1
  133. package/VideoPlayer/FeedbackTooltip.module.css +55 -11
  134. package/VideoPlayer/VideoPlayer.d.ts +44 -18
  135. package/VideoPlayer/VideoPlayer.js +128 -23
  136. package/VideoPlayer/VideoPlayer.module.css +28 -11
  137. package/VirtualList/VirtualList.d.ts +9 -2
  138. package/VirtualList/VirtualList.js +31 -6
  139. package/VirtualList/tests/VirtualGridList-translate-specs.js +3 -0
  140. package/VirtualList/tests/VirtualList-specs.js +28 -1
  141. package/VirtualList/tests/VirtualList-translate-specs.js +4 -1
  142. package/VirtualList/tests/useEvent-specs.js +39 -0
  143. package/VirtualList/useEvent.js +45 -10
  144. package/VirtualList/useThemeVirtualList.js +3 -0
  145. package/WizardPanels/WizardPanels.module.css +2 -2
  146. package/WizardPanels/index.d.ts +4 -2
  147. package/fonts/Limestone_Icons.ttf +0 -0
  148. package/internal/$L/$L.js +3 -3
  149. package/internal/DateComponentPicker/DateComponentPicker.module.css +2 -2
  150. package/internal/DateTime/DateTime.module.css +1 -0
  151. package/internal/Panels/PanelsRouter.js +16 -5
  152. package/internal/Picker/Picker.module.css +2 -2
  153. package/internal/SharedStateDecorator/SharedStateDecorator.js +76 -99
  154. package/internal/validators/validators.js +21 -2
  155. package/package.json +14 -14
  156. package/styles/colors-highcontrast.less +9 -1
  157. package/styles/colors.less +11 -7
  158. package/styles/motion-mixins.less +66 -0
  159. package/styles/motions.less +78 -0
  160. package/styles/variables.less +176 -150
  161. package/useScroll/HoverToScroll.js +8 -5
  162. package/useScroll/ScrollbarTrack.module.css +8 -8
  163. package/useScroll/useEvent.js +7 -1
  164. package/useScroll/useScroll.js +2 -0
  165. package/useScroll/useScroll.module.css +6 -6
  166. package/.travis.yml +0 -40
@@ -6,10 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = exports.PageViews = void 0;
7
7
  var _handle = _interopRequireWildcard(require("@enact/core/handle"));
8
8
  var _propTypes = _interopRequireDefault(require("@enact/core/internal/prop-types"));
9
+ var _keymap = require("@enact/core/keymap");
9
10
  var _kind = _interopRequireDefault(require("@enact/core/kind"));
10
11
  var _util = require("@enact/core/util");
11
12
  var _I18nDecorator = require("@enact/i18n/I18nDecorator");
13
+ var _spotlight = _interopRequireDefault(require("@enact/spotlight"));
12
14
  var _SpotlightContainerDecorator = _interopRequireWildcard(require("@enact/spotlight/SpotlightContainerDecorator"));
15
+ var _Spottable = _interopRequireDefault(require("@enact/spotlight/Spottable"));
13
16
  var _Changeable = _interopRequireDefault(require("@enact/ui/Changeable"));
14
17
  var _Layout = require("@enact/ui/Layout");
15
18
  var _ViewManager = _interopRequireWildcard(require("@enact/ui/ViewManager"));
@@ -25,16 +28,37 @@ var _Steps = _interopRequireDefault(require("../Steps"));
25
28
  var _PageViewsRouter = require("./PageViewsRouter");
26
29
  var _PageViewsModule = _interopRequireDefault(require("./PageViews.module.css"));
27
30
  var _jsxRuntime = require("react/jsx-runtime");
28
- var _excluded = ["css", "componentRef", "fullContents", "index", "pageIndicatorPosition", "pageIndicatorType", "renderNextButton", "renderPrevButton", "renderViewManager", "stepHintAriaLabel", "steps"];
31
+ var _excluded = ["css", "componentRef", "fullContents", "index", "pageIndicatorPosition", "pageIndicatorType", "renderNextButton", "renderPrevButton", "renderViewManager", "stepHintAriaLabel", "steps", "uniqueId"];
29
32
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
30
33
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
31
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
32
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
33
34
  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; }
34
35
  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; }
36
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
37
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
35
38
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
36
39
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
37
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
40
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
41
+ var isLeft = (0, _keymap.is)('left');
42
+ var isRight = (0, _keymap.is)('right');
43
+ var handlePageChange = function handlePageChange(index, onChange, totalIndex) {
44
+ if (onChange && index !== totalIndex && totalIndex) {
45
+ var nextIndex = index < totalIndex - 1 ? index + 1 : index;
46
+ onChange({
47
+ type: 'onChange',
48
+ index: nextIndex
49
+ });
50
+ } else if (onChange && index !== 0) {
51
+ var prevIndex = index > 0 ? index - 1 : index;
52
+ onChange({
53
+ type: 'onChange',
54
+ index: prevIndex
55
+ });
56
+ }
57
+ };
58
+ var SpottableCell = (0, _Spottable["default"])(_Layout.Cell);
59
+ var SpottableColumn = (0, _SpotlightContainerDecorator["default"])(_Layout.Column);
60
+
61
+ /**
38
62
  * A PageViews that has page indicator with corresponding pages.
39
63
  *
40
64
  * @example
@@ -62,6 +86,13 @@ var PageViewsBase = (0, _kind["default"])({
62
86
  * @private
63
87
  */
64
88
  arranger: _ViewManager.shape,
89
+ /**
90
+ * When `true`, disables Spotlight outside the container and enables 5-way navigation between panels.
91
+ *
92
+ * @type {Boolean}
93
+ * @public
94
+ */
95
+ bannerMode: _propTypes2["default"].bool,
65
96
  /**
66
97
  * {@link limestone/PageViews.Page|Page} to be rendered.
67
98
  *
@@ -163,7 +194,14 @@ var PageViewsBase = (0, _kind["default"])({
163
194
  * @type {Number}
164
195
  * @private
165
196
  */
166
- totalIndex: _propTypes2["default"].number
197
+ totalIndex: _propTypes2["default"].number,
198
+ /**
199
+ * A unique identifier for each PageViews component.
200
+ *
201
+ * @type {String}
202
+ * @private
203
+ */
204
+ uniqueId: _propTypes2["default"].string
167
205
  },
168
206
  defaultProps: {
169
207
  arranger: _Panels.BasicArranger,
@@ -176,32 +214,62 @@ var PageViewsBase = (0, _kind["default"])({
176
214
  publicClassNames: true
177
215
  },
178
216
  handlers: {
179
- onNextClick: (0, _handle["default"])((0, _handle.forwardCustomWithPrevent)('onNextClick'), function (ev, _ref) {
217
+ onKeyDown: (0, _handle["default"])((0, _handle.forProp)('bannerMode', true), function (ev, _ref) {
180
218
  var index = _ref.index,
181
219
  onChange = _ref.onChange,
182
- totalIndex = _ref.totalIndex;
183
- if (onChange && index !== totalIndex) {
184
- var nextIndex = index < totalIndex - 1 ? index + 1 : index;
185
- onChange({
186
- type: 'onChange',
187
- index: nextIndex
188
- });
220
+ rtl = _ref.rtl,
221
+ totalIndex = _ref.totalIndex,
222
+ uniqueId = _ref.uniqueId;
223
+ _spotlight["default"].set('banner-container' + uniqueId, {
224
+ navigableFilter: function navigableFilter(node) {
225
+ return node.classList.contains(_PageViewsModule["default"].viewManager);
226
+ }
227
+ });
228
+ if (!rtl && isRight(ev.keyCode) || rtl && isLeft(ev.keyCode)) {
229
+ handlePageChange(index, onChange, totalIndex);
230
+ } else if (!rtl && isLeft(ev.keyCode) || rtl && isRight(ev.keyCode)) {
231
+ handlePageChange(index, onChange);
189
232
  }
190
233
  }),
191
- onPrevClick: (0, _handle["default"])((0, _handle.forwardCustomWithPrevent)('onPrevClick'), function (ev, _ref2) {
192
- var index = _ref2.index,
193
- onChange = _ref2.onChange;
194
- if (onChange && index !== 0) {
195
- var prevIndex = index > 0 ? index - 1 : index;
196
- onChange({
197
- type: 'onChange',
198
- index: prevIndex
199
- });
200
- }
234
+ onMouseOver: (0, _handle["default"])((0, _handle.forProp)('bannerMode', true), function (ev, _ref2) {
235
+ var uniqueId = _ref2.uniqueId;
236
+ return _spotlight["default"].set('banner-container' + uniqueId, {
237
+ navigableFilter: null
238
+ });
201
239
  }),
202
- onTransition: function onTransition(ev, _ref3) {
240
+ onNextClick: (0, _handle["default"])((0, _handle.forwardCustomWithPrevent)('onNextClick'), function (ev, _ref3) {
203
241
  var index = _ref3.index,
204
- _onTransition = _ref3.onTransition;
242
+ onChange = _ref3.onChange,
243
+ totalIndex = _ref3.totalIndex;
244
+ handlePageChange(index, onChange, totalIndex);
245
+ }),
246
+ onPrevClick: (0, _handle["default"])((0, _handle.forwardCustomWithPrevent)('onPrevClick'), function (ev, _ref4) {
247
+ var index = _ref4.index,
248
+ onChange = _ref4.onChange;
249
+ handlePageChange(index, onChange);
250
+ }),
251
+ onPointerOver: (0, _handle["default"])((0, _handle.forProp)('bannerMode', true), function (ev, _ref5) {
252
+ var uniqueId = _ref5.uniqueId;
253
+ return _spotlight["default"].set('banner-container' + uniqueId, {
254
+ navigableFilter: null
255
+ });
256
+ }),
257
+ onStepsClick: (0, _handle["default"])((0, _handle.forProp)('bannerMode', true), (0, _handle.forwardCustomWithPrevent)('onStepsClick'), function (ev, _ref6) {
258
+ var onChange = _ref6.onChange;
259
+ var node = ev.target;
260
+ var index = parseInt(node.getAttribute('data-index'));
261
+ if (node.children.length) return;
262
+ onChange({
263
+ type: 'onChange',
264
+ index: index
265
+ });
266
+ }),
267
+ onTransition: function onTransition(ev, _ref7) {
268
+ var index = _ref7.index,
269
+ _onTransition = _ref7.onTransition,
270
+ uniqueId = _ref7.uniqueId;
271
+ _spotlight["default"].focus('banner-view-manager' + uniqueId);
272
+ _spotlight["default"].resume();
205
273
  if (_onTransition) {
206
274
  _onTransition({
207
275
  type: 'onTransition',
@@ -209,9 +277,10 @@ var PageViewsBase = (0, _kind["default"])({
209
277
  });
210
278
  }
211
279
  },
212
- onWillTransition: function onWillTransition(ev, _ref4) {
213
- var index = _ref4.index,
214
- _onWillTransition = _ref4.onWillTransition;
280
+ onWillTransition: function onWillTransition(ev, _ref8) {
281
+ var index = _ref8.index,
282
+ _onWillTransition = _ref8.onWillTransition;
283
+ _spotlight["default"].pause();
215
284
  if (_onWillTransition) {
216
285
  _onWillTransition({
217
286
  type: 'onWillTransition',
@@ -221,20 +290,20 @@ var PageViewsBase = (0, _kind["default"])({
221
290
  }
222
291
  },
223
292
  computed: {
224
- className: function className(_ref5) {
225
- var fullContents = _ref5.fullContents,
226
- pageIndicatorPosition = _ref5.pageIndicatorPosition,
227
- pageIndicatorType = _ref5.pageIndicatorType,
228
- styler = _ref5.styler;
293
+ className: function className(_ref9) {
294
+ var fullContents = _ref9.fullContents,
295
+ pageIndicatorPosition = _ref9.pageIndicatorPosition,
296
+ pageIndicatorType = _ref9.pageIndicatorType,
297
+ styler = _ref9.styler;
229
298
  return styler.append({
230
299
  fullContents: fullContents
231
300
  }, "indicator".concat((0, _util.cap)(pageIndicatorPosition)), pageIndicatorType);
232
301
  },
233
- renderNextButton: function renderNextButton(_ref6) {
234
- var css = _ref6.css,
235
- onNextClick = _ref6.onNextClick,
236
- index = _ref6.index,
237
- totalIndex = _ref6.totalIndex;
302
+ renderNextButton: function renderNextButton(_ref0) {
303
+ var css = _ref0.css,
304
+ onNextClick = _ref0.onNextClick,
305
+ index = _ref0.index,
306
+ totalIndex = _ref0.totalIndex;
238
307
  var isNextButtonVisible = index < totalIndex - 1;
239
308
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
240
309
  className: css.navButtonCell,
@@ -249,10 +318,10 @@ var PageViewsBase = (0, _kind["default"])({
249
318
  }) : null
250
319
  });
251
320
  },
252
- renderPrevButton: function renderPrevButton(_ref7) {
253
- var css = _ref7.css,
254
- index = _ref7.index,
255
- onPrevClick = _ref7.onPrevClick;
321
+ renderPrevButton: function renderPrevButton(_ref1) {
322
+ var css = _ref1.css,
323
+ index = _ref1.index,
324
+ onPrevClick = _ref1.onPrevClick;
256
325
  var isPrevButtonVisible = index !== 0;
257
326
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
258
327
  className: css.navButtonCell,
@@ -267,16 +336,21 @@ var PageViewsBase = (0, _kind["default"])({
267
336
  }) : null
268
337
  });
269
338
  },
270
- renderViewManager: function renderViewManager(_ref8) {
271
- var arranger = _ref8.arranger,
272
- css = _ref8.css,
273
- index = _ref8.index,
274
- noAnimation = _ref8.noAnimation,
275
- onTransition = _ref8.onTransition,
276
- onWillTransition = _ref8.onWillTransition,
277
- reverseTransition = _ref8.reverseTransition,
278
- children = _ref8.children;
279
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
339
+ renderViewManager: function renderViewManager(_ref10) {
340
+ var arranger = _ref10.arranger,
341
+ bannerMode = _ref10.bannerMode,
342
+ css = _ref10.css,
343
+ index = _ref10.index,
344
+ noAnimation = _ref10.noAnimation,
345
+ onTransition = _ref10.onTransition,
346
+ onWillTransition = _ref10.onWillTransition,
347
+ reverseTransition = _ref10.reverseTransition,
348
+ uniqueId = _ref10.uniqueId,
349
+ children = _ref10.children;
350
+ var CellComponent = bannerMode ? SpottableCell : _Layout.Cell;
351
+ var props = {};
352
+ if (bannerMode) props.spotlightId = "banner-view-manager" + uniqueId;
353
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(CellComponent, _objectSpread(_objectSpread({
280
354
  arranger: arranger,
281
355
  className: css.viewManager,
282
356
  component: _ViewManager["default"],
@@ -285,28 +359,31 @@ var PageViewsBase = (0, _kind["default"])({
285
359
  noAnimation: typeof ENACT_PACK_NO_ANIMATION !== 'undefined' && ENACT_PACK_NO_ANIMATION || noAnimation,
286
360
  onTransition: onTransition,
287
361
  onWillTransition: onWillTransition,
288
- reverseTransition: reverseTransition,
362
+ reverseTransition: reverseTransition
363
+ }, props), {}, {
289
364
  children: children
290
- });
365
+ }));
291
366
  },
292
- stepHintAriaLabel: function stepHintAriaLabel(_ref9) {
367
+ stepHintAriaLabel: function stepHintAriaLabel(_ref11) {
293
368
  var _children$index;
294
- var children = _ref9.children,
295
- index = _ref9.index,
296
- totalIndex = _ref9.totalIndex;
369
+ var children = _ref11.children,
370
+ index = _ref11.index,
371
+ totalIndex = _ref11.totalIndex;
297
372
  var pageHint = new _IString["default"]((0, _$L["default"])('Page {current} out of {total}')).format({
298
373
  current: index + 1,
299
374
  total: totalIndex
300
375
  });
301
376
  return "".concat(pageHint, " ").concat((children === null || children === void 0 || (_children$index = children[index]) === null || _children$index === void 0 ? void 0 : _children$index.props['aria-label']) || '');
302
377
  },
303
- steps: function steps(_ref0) {
304
- var css = _ref0.css,
305
- index = _ref0.index,
306
- onNextClick = _ref0.onNextClick,
307
- onPrevClick = _ref0.onPrevClick,
308
- pageIndicatorType = _ref0.pageIndicatorType,
309
- totalIndex = _ref0.totalIndex;
378
+ steps: function steps(_ref12) {
379
+ var bannerMode = _ref12.bannerMode,
380
+ css = _ref12.css,
381
+ index = _ref12.index,
382
+ onNextClick = _ref12.onNextClick,
383
+ onPrevClick = _ref12.onPrevClick,
384
+ onStepsClick = _ref12.onStepsClick,
385
+ pageIndicatorType = _ref12.pageIndicatorType,
386
+ totalIndex = _ref12.totalIndex;
310
387
  var isPrevButtonVisible = index !== 0;
311
388
  var isNextButtonVisible = index < totalIndex - 1;
312
389
  var isStepVisible = totalIndex !== 1;
@@ -317,6 +394,7 @@ var PageViewsBase = (0, _kind["default"])({
317
394
  css: css,
318
395
  current: index + 1,
319
396
  highlightCurrentOnly: true,
397
+ onClick: onStepsClick,
320
398
  total: totalIndex
321
399
  })
322
400
  }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Layout.Row, {
@@ -325,6 +403,7 @@ var PageViewsBase = (0, _kind["default"])({
325
403
  className: css.navButtonCell,
326
404
  shrink: true,
327
405
  children: isPrevButtonVisible ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
406
+ spotlightDisabled: bannerMode,
328
407
  "aria-label": (0, _$L["default"])('Previous'),
329
408
  className: css.navButton,
330
409
  icon: "arrowlargeleft",
@@ -344,6 +423,7 @@ var PageViewsBase = (0, _kind["default"])({
344
423
  className: css.navButtonCell,
345
424
  shrink: true,
346
425
  children: isNextButtonVisible ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
426
+ spotlightDisabled: bannerMode,
347
427
  "aria-label": (0, _$L["default"])('Next'),
348
428
  className: css.navButton,
349
429
  icon: "arrowlargeright",
@@ -356,37 +436,42 @@ var PageViewsBase = (0, _kind["default"])({
356
436
  });
357
437
  }
358
438
  },
359
- render: function render(_ref1) {
360
- var css = _ref1.css,
361
- componentRef = _ref1.componentRef,
362
- fullContents = _ref1.fullContents,
363
- index = _ref1.index,
364
- pageIndicatorPosition = _ref1.pageIndicatorPosition,
365
- pageIndicatorType = _ref1.pageIndicatorType,
366
- renderNextButton = _ref1.renderNextButton,
367
- renderPrevButton = _ref1.renderPrevButton,
368
- renderViewManager = _ref1.renderViewManager,
369
- stepHintAriaLabel = _ref1.stepHintAriaLabel,
370
- steps = _ref1.steps,
371
- rest = _objectWithoutProperties(_ref1, _excluded);
439
+ render: function render(_ref13) {
440
+ var css = _ref13.css,
441
+ componentRef = _ref13.componentRef,
442
+ fullContents = _ref13.fullContents,
443
+ index = _ref13.index,
444
+ pageIndicatorPosition = _ref13.pageIndicatorPosition,
445
+ pageIndicatorType = _ref13.pageIndicatorType,
446
+ renderNextButton = _ref13.renderNextButton,
447
+ renderPrevButton = _ref13.renderPrevButton,
448
+ renderViewManager = _ref13.renderViewManager,
449
+ stepHintAriaLabel = _ref13.stepHintAriaLabel,
450
+ steps = _ref13.steps,
451
+ uniqueId = _ref13.uniqueId,
452
+ rest = _objectWithoutProperties(_ref13, _excluded);
372
453
  delete rest.arranger;
454
+ delete rest.bannerMode;
373
455
  delete rest.children;
374
456
  delete rest.noAnimation;
375
- delete rest.onTransition;
376
457
  delete rest.onNextClick;
458
+ delete rest.onStepsClick;
377
459
  delete rest.onPrevClick;
460
+ delete rest.onTransition;
378
461
  delete rest.onWillTransition;
379
462
  delete rest.reverseTransition;
463
+ delete rest.rtl;
380
464
  delete rest.totalIndex;
381
465
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({
382
466
  role: "region",
383
467
  "aria-labelledby": "pageViews_index_".concat(index),
384
468
  ref: componentRef
385
469
  }, rest), {}, {
386
- children: [!fullContents && pageIndicatorPosition === 'top' ? steps : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Column, {
470
+ children: [!fullContents && pageIndicatorPosition === 'top' ? steps : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(SpottableColumn, {
387
471
  "aria-label": stepHintAriaLabel,
388
472
  className: css.contentsArea,
389
473
  id: "pageViews_index_".concat(index),
474
+ spotlightId: "banner-container" + uniqueId,
390
475
  children: fullContents ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
391
476
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Row, {
392
477
  className: css.horizontalLayout,
@@ -7,6 +7,7 @@ exports.PageViewsRouter = PageViewsRouter;
7
7
  exports["default"] = void 0;
8
8
  var _propTypes = _interopRequireDefault(require("@enact/core/internal/prop-types"));
9
9
  var _useChainRefs = _interopRequireDefault(require("@enact/core/useChainRefs"));
10
+ var _spotlight = _interopRequireDefault(require("@enact/spotlight"));
10
11
  var _propTypes2 = _interopRequireDefault(require("prop-types"));
11
12
  var _react = require("react");
12
13
  var _Panels = require("../internal/Panels");
@@ -53,6 +54,7 @@ function PageViewsRouter(Wrapped) {
53
54
  onWillTransition = _ref.onWillTransition,
54
55
  rtl = _ref.rtl,
55
56
  rest = _objectWithoutProperties(_ref, _excluded);
57
+ var uniqueId = (0, _react.useId)();
56
58
  var totalIndex = _react.Children.count(children);
57
59
  var _useToggleRole = (0, _Panels.useToggleRole)(),
58
60
  a11yRef = _useToggleRole.ref,
@@ -74,6 +76,11 @@ function PageViewsRouter(Wrapped) {
74
76
  focusOnWillTransition(ev);
75
77
  a11yOnWillTransition(ev);
76
78
  }, [a11yOnWillTransition, focusOnWillTransition]);
79
+ (0, _react.useEffect)(function () {
80
+ return function () {
81
+ _spotlight["default"].resume();
82
+ };
83
+ }, []);
77
84
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapped, _objectSpread(_objectSpread(_objectSpread({}, rest), transition), {}, {
78
85
  componentRef: ref,
79
86
  "data-spotlight-id": spotlightId,
@@ -81,6 +88,8 @@ function PageViewsRouter(Wrapped) {
81
88
  totalIndex: totalIndex,
82
89
  onWillTransition: handleWillTransition,
83
90
  reverseTransition: reverseTransition,
91
+ rtl: rtl,
92
+ uniqueId: uniqueId,
84
93
  children: children
85
94
  }));
86
95
  };
@@ -189,4 +189,88 @@ describe('PageViews Specs', function () {
189
189
  expect(actual).toMatchObject(expected);
190
190
  });
191
191
  }));
192
+ test('should render accept `fullContents` prop', function () {
193
+ (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_.PageViews, {
194
+ fullContents: true,
195
+ pageIndicatorType: "number",
196
+ index: 1,
197
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {
198
+ children: "I got contents"
199
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {
200
+ children: "I got contents"
201
+ })]
202
+ }));
203
+ var panel = _react.screen.getByRole('region');
204
+ var expected = 'fullContents';
205
+ expect(panel).toHaveClass(expected);
206
+ });
207
+ test('should navigate on Page Indicator click when `bannerMode` is true', /*#__PURE__*/_asyncToGenerator(function* () {
208
+ var handleChange = jest.fn();
209
+ var handleStepsClick = jest.fn();
210
+ var user = _userEvent["default"].setup();
211
+ (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_.PageViews, {
212
+ bannerMode: true,
213
+ index: 2,
214
+ onChange: handleChange,
215
+ onStepsClick: handleStepsClick,
216
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {})]
217
+ }));
218
+ var indicatorDot = _react.screen.getByRole('list').children[1];
219
+ var expected = {
220
+ type: 'onStepsClick'
221
+ };
222
+ yield user.click(indicatorDot);
223
+ yield (0, _react.waitFor)(function () {
224
+ expect(handleChange).toHaveBeenCalledWith({
225
+ index: 1,
226
+ type: 'onChange'
227
+ });
228
+ });
229
+ yield (0, _react.waitFor)(function () {
230
+ var actual = handleStepsClick.mock.calls.length && handleStepsClick.mock.calls[0][0];
231
+ expect(actual).toMatchObject(expected);
232
+ });
233
+ }));
234
+ test('should navigate via 5-way left key when `bannerMode` is true', /*#__PURE__*/_asyncToGenerator(function* () {
235
+ var handleChange = jest.fn();
236
+ (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_.PageViews, {
237
+ bannerMode: true,
238
+ index: 1,
239
+ onChange: handleChange,
240
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {})]
241
+ }));
242
+ var pageViews = _react.screen.getByRole('region').children[0];
243
+ yield _react.fireEvent.keyDown(pageViews, {
244
+ which: 37,
245
+ keyCode: 37,
246
+ code: 37
247
+ });
248
+ yield (0, _react.waitFor)(function () {
249
+ expect(handleChange).toHaveBeenCalledWith({
250
+ index: 0,
251
+ type: 'onChange'
252
+ });
253
+ });
254
+ }));
255
+ test('should navigate via 5-way right key when `bannerMode` is true', /*#__PURE__*/_asyncToGenerator(function* () {
256
+ var handleChange = jest.fn();
257
+ (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_.PageViews, {
258
+ bannerMode: true,
259
+ index: 1,
260
+ onChange: handleChange,
261
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {})]
262
+ }));
263
+ var pageViews = _react.screen.getByRole('region').children[0];
264
+ yield _react.fireEvent.keyDown(pageViews, {
265
+ which: 39,
266
+ keyCode: 39,
267
+ code: 39
268
+ });
269
+ yield (0, _react.waitFor)(function () {
270
+ expect(handleChange).toHaveBeenCalledWith({
271
+ index: 2,
272
+ type: 'onChange'
273
+ });
274
+ });
275
+ }));
192
276
  });