@enact/limestone 1.9.3 → 1.10.1

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 (120) hide show
  1. package/.github/workflows/ci-reusable.yml +2 -2
  2. package/ActionGuide/ActionGuide.module.css +4 -0
  3. package/Alert/Alert.d.ts +9 -0
  4. package/Alert/Alert.js +35 -4
  5. package/Alert/Alert.module.css +12 -1
  6. package/Alert/tests/Alert-specs.js +91 -0
  7. package/BodyText/BodyText.module.css +21 -0
  8. package/Button/Button.module.css +72 -40
  9. package/Button/tests/Button-specs.js +26 -0
  10. package/CHANGELOG.md +74 -0
  11. package/Card/Card.d.ts +4 -4
  12. package/Card/Card.js +10 -8
  13. package/Card/Card.module.css +31 -7
  14. package/Card/tests/Card-specs.js +39 -5
  15. package/Checkbox/Checkbox.module.css +4 -0
  16. package/CheckboxItem/CheckboxItem.js +6 -4
  17. package/Chips/Chip.js +12 -6
  18. package/Chips/Chip.module.css +3 -0
  19. package/Chips/Chips.js +12 -6
  20. package/Chips/tests/Chip-specs.js +25 -5
  21. package/Chips/tests/Chips-specs.js +12 -2
  22. package/ColorPicker/ColorPicker.js +27 -25
  23. package/ContextualPopupDecorator/ContextualPopupDecorator.js +32 -22
  24. package/DayPicker/DaySelectorDecorator.js +12 -7
  25. package/Dropdown/Dropdown.module.css +4 -0
  26. package/Dropdown/DropdownList.js +74 -53
  27. package/FlexiblePopupPanels/useNavButtonFocus.js +7 -10
  28. package/Heading/Heading.d.ts +1 -1
  29. package/Heading/Heading.js +2 -2
  30. package/Heading/Heading.module.css +16 -0
  31. package/Icon/Icon.d.ts +1 -0
  32. package/Icon/Icon.js +1 -0
  33. package/Icon/Icon.module.css +12 -0
  34. package/Icon/IconList.js +2 -0
  35. package/IconItem/IconItem.module.css +19 -3
  36. package/IconItem/tests/IconItem-specs.js +30 -1
  37. package/Image/Image.js +6 -4
  38. package/ImageItem/ImageItem.module.css +17 -0
  39. package/Input/Input.js +12 -1
  40. package/Input/Input.module.css +25 -9
  41. package/Input/InputField.js +75 -24
  42. package/Input/InputField.module.css +280 -45
  43. package/Input/InputFieldDecoratorIcon.js +1 -0
  44. package/Input/InputFieldSpotlightDecorator.js +53 -8
  45. package/Input/index.d.ts +105 -93
  46. package/Input/tests/Input-specs.js +26 -0
  47. package/Input/tests/InputField-specs.js +149 -3
  48. package/Input/tests/InputPopup-specs.js +1 -1
  49. package/Item/Item.module.css +2 -1
  50. package/KeyGuide/KeyGuide.js +29 -27
  51. package/KeyGuide/KeyGuide.module.css +10 -0
  52. package/MediaOverlay/MediaOverlay.module.css +16 -4
  53. package/MediaOverlay/tests/MediaOverlay-specs.js +29 -0
  54. package/MediaPlayer/MediaControls.module.css +3 -0
  55. package/MediaPlayer/Times.module.css +4 -0
  56. package/MediaPlayer/tests/util-specs.js +4 -1
  57. package/PageViews/PageViews.js +134 -69
  58. package/PageViews/PageViews.module.css +7 -0
  59. package/PageViews/PageViewsRouter.js +91 -42
  60. package/PageViews/tests/PageViews-specs.js +87 -0
  61. package/Panels/Header.js +6 -4
  62. package/Panels/Header.module.css +37 -31
  63. package/Popup/Popup.js +5 -4
  64. package/PopupTabLayout/PopupTabLayout.js +11 -9
  65. package/PopupTabLayout/PopupTabLayout.module.css +18 -0
  66. package/RadioItem/RadioItem.js +7 -5
  67. package/RadioItem/RadioItem.module.css +5 -0
  68. package/Scroller/EditableWrapper.js +19 -15
  69. package/Scroller/Scroller.js +11 -10
  70. package/Scroller/Scroller.module.css +10 -0
  71. package/Scroller/tests/Scroller-specs.js +91 -2
  72. package/Scroller/useThemeScroller.js +6 -3
  73. package/Slider/Slider.d.ts +4 -0
  74. package/Slider/Slider.js +40 -16
  75. package/Slider/Slider.module.css +150 -3
  76. package/Slider/SliderBehaviorDecorator.js +16 -14
  77. package/Slider/tests/Slider-specs.js +51 -0
  78. package/Slider/utils.js +23 -7
  79. package/Spinner/Spinner.js +10 -8
  80. package/Steps/Steps.module.css +3 -0
  81. package/Switch/Switch.module.css +15 -1
  82. package/TabLayout/RefocusDecorator.js +14 -12
  83. package/TabLayout/TabGroup.module.css +1 -1
  84. package/TabLayout/tests/TabGroup-specs.js +1 -1
  85. package/ThemeDecorator/AccessibilityDecorator.js +12 -11
  86. package/ThemeDecorator/I18nFontDecorator.js +6 -4
  87. package/ThemeDecorator/ThemeDecorator.d.ts +7 -0
  88. package/ThemeDecorator/ThemeDecorator.js +24 -9
  89. package/TimePicker/TimePicker.module.css +3 -0
  90. package/TimePicker/TimePickerBase.js +5 -3
  91. package/TooltipDecorator/Tooltip.module.css +4 -0
  92. package/TooltipDecorator/TooltipDecorator.js +12 -7
  93. package/TooltipDecorator/tests/useTooltip-specs.js +5 -2
  94. package/VideoPlayer/Feedback.module.css +3 -0
  95. package/VideoPlayer/FeedbackTooltip.module.css +7 -0
  96. package/VideoPlayer/MediaTitle.module.css +8 -0
  97. package/VideoPlayer/VideoPlayer.js +25 -24
  98. package/VirtualList/VirtualList.js +20 -18
  99. package/VirtualList/useSpotlight.js +1 -1
  100. package/fonts/Limestone_Icons.ttf +0 -0
  101. package/internal/AsyncRenderChildren/AsyncRenderChildren.js +9 -5
  102. package/internal/AsyncRenderChildren/tests/AsyncRenderChildren-specs.js +4 -1
  103. package/internal/DateTime/DateTime.module.css +3 -0
  104. package/internal/DateTime/DateTimeDecorator.js +5 -4
  105. package/internal/Panels/PanelsRouter.js +35 -29
  106. package/internal/Panels/useAutoFocus.js +10 -6
  107. package/internal/Panels/useFocusOnTransition.js +4 -3
  108. package/internal/Picker/Picker.js +7 -5
  109. package/internal/Picker/Picker.module.css +22 -0
  110. package/internal/Picker/SpottablePicker.js +15 -13
  111. package/internal/SharedStateDecorator/SharedStateDecorator.js +6 -4
  112. package/package.json +15 -12
  113. package/styles/colors.less +1 -0
  114. package/styles/variables.less +118 -26
  115. package/useScroll/HoverToScroll.js +15 -12
  116. package/useScroll/Scrollbar.js +14 -10
  117. package/useScroll/ScrollbarPlaceholder.js +4 -1
  118. package/useScroll/ScrollbarTrack.js +7 -5
  119. package/useScroll/useEvent.js +7 -2
  120. package/useScroll/useScroll.js +10 -2
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = exports.KeyGuideDecorator = exports.KeyGuideBase = exports.KeyGuide = void 0;
7
7
  var _kind = _interopRequireDefault(require("@enact/core/kind"));
8
8
  var _propTypes = _interopRequireDefault(require("@enact/core/internal/prop-types"));
9
+ var _util = require("@enact/core/util");
9
10
  var _FloatingLayer = _interopRequireDefault(require("@enact/ui/FloatingLayer"));
10
11
  var _Pure = _interopRequireDefault(require("@enact/ui/internal/Pure"));
11
12
  var _Layout = require("@enact/ui/Layout");
@@ -50,9 +51,10 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
50
51
  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; }
51
52
  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; }
52
53
  var colorKeys = ['red', 'green', 'yellow', 'blue'];
53
- var ImageItemBase = function ImageItemBase(_ref) {
54
- var children = _ref.children,
55
- imageSrc = _ref.imageSrc;
54
+ var _ImageItemBase = function ImageItemBase(props) {
55
+ (0, _util.checkPropTypes)(_ImageItemBase, props);
56
+ var children = props.children,
57
+ imageSrc = props.imageSrc;
56
58
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Layout.Row, {
57
59
  className: _KeyGuideModule["default"].imageItem,
58
60
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
@@ -70,7 +72,7 @@ var ImageItemBase = function ImageItemBase(_ref) {
70
72
  })]
71
73
  });
72
74
  };
73
- ImageItemBase.propTypes = {
75
+ _ImageItemBase.propTypes = {
74
76
  children: _propTypes2["default"].node,
75
77
  imageSrc: _propTypes2["default"].string
76
78
  };
@@ -112,14 +114,14 @@ var KeyGuideBase = exports.KeyGuideBase = (0, _kind["default"])({
112
114
  * @type {Array.<{children: (String|Component), key: (Number|String), icon: (String|Object|'red'|'green'|'yellow'|'blue')}>|Object.<{children: (String|Component), imageSrc: (String|Object)}>}
113
115
  * @public
114
116
  */
115
- children: _propTypes2["default"].arrayOf(_propTypes2["default"].shape({
117
+ children: _propTypes2["default"].oneOfType([_propTypes2["default"].arrayOf(_propTypes2["default"].shape({
116
118
  children: _propTypes["default"].renderable.isRequired,
117
119
  key: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].number]).isRequired,
118
120
  icon: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].object])
119
- })) || _propTypes2["default"].shape({
121
+ })), _propTypes2["default"].shape({
120
122
  children: _propTypes["default"].renderable.isRequired,
121
123
  imageSrc: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].object]).isRequired
122
- }),
124
+ })]),
123
125
  /**
124
126
  * Customizes the component by mapping the supplied collection of CSS class names to the
125
127
  * corresponding internal elements and states of this component.
@@ -145,15 +147,15 @@ var KeyGuideBase = exports.KeyGuideBase = (0, _kind["default"])({
145
147
  arrowPosition: 'none'
146
148
  },
147
149
  computed: {
148
- children: function children(_ref2) {
149
- var _children = _ref2.children,
150
- css = _ref2.css;
150
+ children: function children(_ref) {
151
+ var _children = _ref.children,
152
+ css = _ref.css;
151
153
  if (_children !== null && _children !== void 0 && _children.imageSrc) {
152
154
  return _children;
153
155
  } else {
154
- return _children ? _children.map(function (_ref3) {
155
- var icon = _ref3.icon,
156
- child = _objectWithoutProperties(_ref3, _excluded);
156
+ return _children ? _children.map(function (_ref2) {
157
+ var icon = _ref2.icon,
158
+ child = _objectWithoutProperties(_ref2, _excluded);
157
159
  var isColorKey = colorKeys.includes(icon);
158
160
  return _objectSpread(_objectSpread({}, child), {}, {
159
161
  slotBefore: isColorKey ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -167,15 +169,15 @@ var KeyGuideBase = exports.KeyGuideBase = (0, _kind["default"])({
167
169
  }) : [];
168
170
  }
169
171
  },
170
- className: function className(_ref4) {
171
- var arrowPosition = _ref4.arrowPosition,
172
- children = _ref4.children,
173
- styler = _ref4.styler;
172
+ className: function className(_ref3) {
173
+ var arrowPosition = _ref3.arrowPosition,
174
+ children = _ref3.children,
175
+ styler = _ref3.styler;
174
176
  return styler.append(Array.isArray(children) ? 'iconGuide' : 'imageGuide', arrowPosition === 'none' || Array.isArray(children) ? 'noArrow' : "".concat(arrowPosition, "Arrow"));
175
177
  },
176
- open: function open(_ref5) {
177
- var children = _ref5.children,
178
- _open = _ref5.open;
178
+ open: function open(_ref4) {
179
+ var children = _ref4.children,
180
+ _open = _ref4.open;
179
181
  return children && (children.imageSrc || children.length > 0) && _open;
180
182
  }
181
183
  },
@@ -184,12 +186,12 @@ var KeyGuideBase = exports.KeyGuideBase = (0, _kind["default"])({
184
186
  className: 'keyGuide',
185
187
  publicClassNames: ['keyGuide', 'imageGuide']
186
188
  },
187
- render: function render(_ref6) {
188
- var className = _ref6.className,
189
- css = _ref6.css,
190
- children = _ref6.children,
191
- open = _ref6.open,
192
- rest = _objectWithoutProperties(_ref6, _excluded2);
189
+ render: function render(_ref5) {
190
+ var className = _ref5.className,
191
+ css = _ref5.css,
192
+ children = _ref5.children,
193
+ open = _ref5.open,
194
+ rest = _objectWithoutProperties(_ref5, _excluded2);
193
195
  delete rest.arrowPosition;
194
196
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_FloatingLayer["default"], {
195
197
  noAutoDismiss: true,
@@ -206,7 +208,7 @@ var KeyGuideBase = exports.KeyGuideBase = (0, _kind["default"])({
206
208
  children: children
207
209
  })) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({}, rest), {}, {
208
210
  className: className,
209
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ImageItemBase, _objectSpread({}, children))
211
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageItemBase, _objectSpread({}, children))
210
212
  }))
211
213
  });
212
214
  }
@@ -62,6 +62,16 @@
62
62
  .keyGuide .imageItem .text .bodyText {
63
63
  margin: 0;
64
64
  }
65
+ .keyGuide:global(.largeText) .item {
66
+ font-size: var(--primitive-font-size-72);
67
+ }
68
+ .keyGuide:global(.largeText) .item .slotBefore .red,
69
+ .keyGuide:global(.largeText) .item .slotBefore .green,
70
+ .keyGuide:global(.largeText) .item .slotBefore .yellow,
71
+ .keyGuide:global(.largeText) .item .slotBefore .blue {
72
+ width: calc(1.25rem * 1.2);
73
+ height: calc(0.25rem * 1.2);
74
+ }
65
75
  .keyGuide:global(.neutral) {
66
76
  background: var(--semantic-color-surface-overlay-default);
67
77
  outline-color: transparent;
@@ -157,13 +157,13 @@ Motion Mixins
157
157
  .mediaOverlay .text {
158
158
  font-family: "Limestone";
159
159
  font-size: var(--primitive-font-size-48);
160
- line-height: 1.3em;
160
+ line-height: 1.25rem;
161
161
  margin-bottom: var(--primitive-spacing-36);
162
162
  }
163
163
  :global(.enact-locale-non-latin) .mediaOverlay .text {
164
164
  font-family: "Limestone";
165
165
  font-size: var(--primitive-font-size-48);
166
- line-height: 1.3em;
166
+ line-height: 1.25rem;
167
167
  }
168
168
  .mediaOverlay .progressBar {
169
169
  position: absolute;
@@ -195,12 +195,24 @@ Motion Mixins
195
195
  .mediaOverlay .subtitle {
196
196
  font-family: "Limestone";
197
197
  font-size: var(--primitive-font-size-48);
198
- line-height: 1.3em;
198
+ line-height: 1.25rem;
199
199
  }
200
200
  :global(.enact-locale-non-latin) .mediaOverlay .subtitle {
201
201
  font-family: "Limestone";
202
202
  font-size: var(--primitive-font-size-48);
203
- line-height: 1.3em;
203
+ line-height: 1.25rem;
204
+ }
205
+ .mediaOverlay:global(.largeText) .text {
206
+ font-size: var(--primitive-font-size-60);
207
+ line-height: 1.45833rem;
208
+ }
209
+ .mediaOverlay:global(.largeText) .caption,
210
+ .mediaOverlay:global(.largeText) .title {
211
+ font-size: var(--primitive-font-size-72);
212
+ }
213
+ .mediaOverlay:global(.largeText) .subtitle {
214
+ font-size: var(--primitive-font-size-58);
215
+ line-height: 1.45833rem;
204
216
  }
205
217
  .mediaOverlay:global(.neutral) .bg {
206
218
  opacity: 0;
@@ -124,4 +124,33 @@ describe('MediaOverlay', function () {
124
124
  var actual = _react.screen.getByTestId('mediaOverlay');
125
125
  expect(actual).toBe(expected);
126
126
  });
127
+ test('should be pressed when selected', function () {
128
+ (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_MediaOverlay["default"], {
129
+ "data-testid": "mediaOverlay",
130
+ source: "abc.mp4"
131
+ }));
132
+ var mediaOverlay = _react.screen.getByTestId('mediaOverlay');
133
+
134
+ // Select by key
135
+ _react.fireEvent.keyDown(mediaOverlay, {
136
+ key: 'Enter',
137
+ code: 'Enter',
138
+ keyCode: 13,
139
+ which: 13
140
+ });
141
+ expect(mediaOverlay).toHaveClass('pressed');
142
+ _react.fireEvent.keyUp(mediaOverlay, {
143
+ key: 'Enter',
144
+ code: 'Enter',
145
+ keyCode: 13,
146
+ which: 13
147
+ });
148
+ expect(mediaOverlay).not.toHaveClass('pressed');
149
+
150
+ // Select by pointer
151
+ _react.fireEvent.mouseDown(mediaOverlay);
152
+ expect(mediaOverlay).toHaveClass('pressed');
153
+ _react.fireEvent.mouseUp(mediaOverlay);
154
+ expect(mediaOverlay).not.toHaveClass('pressed');
155
+ });
127
156
  });
@@ -24,6 +24,9 @@
24
24
  .controlsFrame .mediaControls .button .icon {
25
25
  --icon-size: 2.25rem;
26
26
  }
27
+ .controlsFrame .mediaControls .button:global(.largeText) .icon {
28
+ --icon-size: 2.70833rem;
29
+ }
27
30
  .controlsFrame .actionGuide {
28
31
  height: 3.5rem;
29
32
  padding-bottom: 0;
@@ -23,6 +23,10 @@
23
23
  :global(.enact-locale-vi) .times {
24
24
  line-height: 1.7em;
25
25
  }
26
+ :global(.largeText) .times {
27
+ font-size: var(--primitive-font-size-58);
28
+ line-height: 1.45833rem;
29
+ }
26
30
  .times > * {
27
31
  display: inline-block;
28
32
  }
@@ -3,6 +3,7 @@
3
3
  var _util = require("@enact/core/util");
4
4
  var _DurationFmt = _interopRequireDefault(require("ilib/lib/DurationFmt"));
5
5
  var _react = require("@testing-library/react");
6
+ var _react2 = require("react");
6
7
  var _util2 = require("../util");
7
8
  var _jsxRuntime = require("react/jsx-runtime");
8
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
@@ -25,7 +26,9 @@ describe('util', function () {
25
26
  var actual;
26
27
  var Parent = function Parent(_ref) {
27
28
  var children = _ref.children;
28
- actual = (0, _util2.countReactChildren)(children);
29
+ (0, _react2.useEffect)(function () {
30
+ actual = (0, _util2.countReactChildren)(children);
31
+ }, [children]);
29
32
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
30
33
  children: children
31
34
  });
@@ -28,7 +28,7 @@ var _Steps = _interopRequireDefault(require("../Steps"));
28
28
  var _PageViewsRouter = require("./PageViewsRouter");
29
29
  var _PageViewsModule = _interopRequireDefault(require("./PageViews.module.css"));
30
30
  var _jsxRuntime = require("react/jsx-runtime");
31
- var _excluded = ["css", "componentRef", "fullContents", "index", "pageIndicatorPosition", "pageIndicatorType", "renderNextButton", "renderPrevButton", "renderViewManager", "stepHintAriaLabel", "steps", "uniqueId"];
31
+ var _excluded = ["css", "componentRef", "fullContents", "index", "pageIndicatorPosition", "pageIndicatorType", "renderFooterButtons", "renderNextButton", "renderPrevButton", "renderViewManager", "stepHintAriaLabel", "steps", "uniqueId"];
32
32
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
33
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); }
34
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; }
@@ -88,6 +88,7 @@ var PageViewsBase = (0, _kind["default"])({
88
88
  arranger: _ViewManager.shape,
89
89
  /**
90
90
  * When `true`, disables Spotlight outside the container and enables 5-way navigation between panels.
91
+ * Footer buttons are hidden when bannerMode is true.
91
92
  *
92
93
  * @type {Boolean}
93
94
  * @public
@@ -115,6 +116,7 @@ var PageViewsBase = (0, _kind["default"])({
115
116
  *
116
117
  * * `pageViews` - The root component class
117
118
  * * `contentsArea` - The contentsArea component class
119
+ * * `footerButtons` - The footerButtons component class
118
120
  * * `navButton` - The navButton component class
119
121
  * * `navButtonContainer` - Applied to the container containing navButtons in fullContents mode
120
122
  * * `stepsRow` - The step component class
@@ -123,6 +125,14 @@ var PageViewsBase = (0, _kind["default"])({
123
125
  * @public
124
126
  */
125
127
  css: _propTypes2["default"].object,
128
+ /**
129
+ * The label of the footer Close button.
130
+ *
131
+ * @type {String}
132
+ * @default 'Close'
133
+ * @public
134
+ */
135
+ footerCloseLabel: _propTypes2["default"].string,
126
136
  /**
127
137
  * When `true`, maximize its contents area.
128
138
  *
@@ -146,6 +156,13 @@ var PageViewsBase = (0, _kind["default"])({
146
156
  * @public
147
157
  */
148
158
  noAnimation: _propTypes2["default"].bool,
159
+ /**
160
+ * Called when the footer Close button is clicked.
161
+ *
162
+ * @type {Function}
163
+ * @public
164
+ */
165
+ onFooterCloseClick: _propTypes2["default"].func,
149
166
  /**
150
167
  * Called when a transition completes.
151
168
  *
@@ -188,6 +205,15 @@ var PageViewsBase = (0, _kind["default"])({
188
205
  * @private
189
206
  */
190
207
  reverseTransition: _propTypes2["default"].bool,
208
+ /**
209
+ * When `true`, renders footer Close and Next buttons below the page content.
210
+ * Footer buttons are hidden when `bannerMode` is true.
211
+ *
212
+ * @type {Boolean}
213
+ * @default false
214
+ * @public
215
+ */
216
+ showFooterButtons: _propTypes2["default"].bool,
191
217
  /**
192
218
  * The total number of pages.
193
219
  *
@@ -206,7 +232,8 @@ var PageViewsBase = (0, _kind["default"])({
206
232
  defaultProps: {
207
233
  arranger: _Panels.BasicArranger,
208
234
  pageIndicatorPosition: 'bottom',
209
- pageIndicatorType: 'dot'
235
+ pageIndicatorType: 'dot',
236
+ showFooterButtons: false
210
237
  },
211
238
  styles: {
212
239
  css: _PageViewsModule["default"],
@@ -237,25 +264,31 @@ var PageViewsBase = (0, _kind["default"])({
237
264
  navigableFilter: null
238
265
  });
239
266
  }),
240
- onNextClick: (0, _handle["default"])((0, _handle.forwardCustomWithPrevent)('onNextClick'), function (ev, _ref3) {
267
+ onFooterNextClick: (0, _handle["default"])((0, _handle.forwardCustomWithPrevent)('onFooterNextClick'), function (ev, _ref3) {
241
268
  var index = _ref3.index,
242
269
  onChange = _ref3.onChange,
243
270
  totalIndex = _ref3.totalIndex;
244
271
  handlePageChange(index, onChange, totalIndex);
245
272
  }),
246
- onPrevClick: (0, _handle["default"])((0, _handle.forwardCustomWithPrevent)('onPrevClick'), function (ev, _ref4) {
273
+ onNextClick: (0, _handle["default"])((0, _handle.forwardCustomWithPrevent)('onNextClick'), function (ev, _ref4) {
247
274
  var index = _ref4.index,
248
- onChange = _ref4.onChange;
275
+ onChange = _ref4.onChange,
276
+ totalIndex = _ref4.totalIndex;
277
+ handlePageChange(index, onChange, totalIndex);
278
+ }),
279
+ onPrevClick: (0, _handle["default"])((0, _handle.forwardCustomWithPrevent)('onPrevClick'), function (ev, _ref5) {
280
+ var index = _ref5.index,
281
+ onChange = _ref5.onChange;
249
282
  handlePageChange(index, onChange);
250
283
  }),
251
- onPointerOver: (0, _handle["default"])((0, _handle.forProp)('bannerMode', true), function (ev, _ref5) {
252
- var uniqueId = _ref5.uniqueId;
284
+ onPointerOver: (0, _handle["default"])((0, _handle.forProp)('bannerMode', true), function (ev, _ref6) {
285
+ var uniqueId = _ref6.uniqueId;
253
286
  return _spotlight["default"].set('banner-container' + uniqueId, {
254
287
  navigableFilter: null
255
288
  });
256
289
  }),
257
- onStepsClick: (0, _handle["default"])((0, _handle.forProp)('bannerMode', true), (0, _handle.forwardCustomWithPrevent)('onStepsClick'), function (ev, _ref6) {
258
- var onChange = _ref6.onChange;
290
+ onStepsClick: (0, _handle["default"])((0, _handle.forProp)('bannerMode', true), (0, _handle.forwardCustomWithPrevent)('onStepsClick'), function (ev, _ref7) {
291
+ var onChange = _ref7.onChange;
259
292
  var node = ev.target;
260
293
  var index = parseInt(node.getAttribute('data-index'));
261
294
  if (node.children.length) return;
@@ -264,10 +297,10 @@ var PageViewsBase = (0, _kind["default"])({
264
297
  index: index
265
298
  });
266
299
  }),
267
- onTransition: function onTransition(ev, _ref7) {
268
- var index = _ref7.index,
269
- _onTransition = _ref7.onTransition,
270
- uniqueId = _ref7.uniqueId;
300
+ onTransition: function onTransition(ev, _ref8) {
301
+ var index = _ref8.index,
302
+ _onTransition = _ref8.onTransition,
303
+ uniqueId = _ref8.uniqueId;
271
304
  _spotlight["default"].focus('banner-view-manager' + uniqueId);
272
305
  _spotlight["default"].resume();
273
306
  if (_onTransition) {
@@ -277,9 +310,9 @@ var PageViewsBase = (0, _kind["default"])({
277
310
  });
278
311
  }
279
312
  },
280
- onWillTransition: function onWillTransition(ev, _ref8) {
281
- var index = _ref8.index,
282
- _onWillTransition = _ref8.onWillTransition;
313
+ onWillTransition: function onWillTransition(ev, _ref9) {
314
+ var index = _ref9.index,
315
+ _onWillTransition = _ref9.onWillTransition;
283
316
  _spotlight["default"].pause();
284
317
  if (_onWillTransition) {
285
318
  _onWillTransition({
@@ -290,20 +323,47 @@ var PageViewsBase = (0, _kind["default"])({
290
323
  }
291
324
  },
292
325
  computed: {
293
- className: function className(_ref9) {
294
- var fullContents = _ref9.fullContents,
295
- pageIndicatorPosition = _ref9.pageIndicatorPosition,
296
- pageIndicatorType = _ref9.pageIndicatorType,
297
- styler = _ref9.styler;
326
+ className: function className(_ref0) {
327
+ var fullContents = _ref0.fullContents,
328
+ pageIndicatorPosition = _ref0.pageIndicatorPosition,
329
+ pageIndicatorType = _ref0.pageIndicatorType,
330
+ styler = _ref0.styler;
298
331
  return styler.append({
299
332
  fullContents: fullContents
300
333
  }, "indicator".concat((0, _util.cap)(pageIndicatorPosition)), pageIndicatorType);
301
334
  },
302
- renderNextButton: function renderNextButton(_ref0) {
303
- var css = _ref0.css,
304
- onNextClick = _ref0.onNextClick,
305
- index = _ref0.index,
306
- totalIndex = _ref0.totalIndex;
335
+ renderFooterButtons: function renderFooterButtons(_ref1) {
336
+ var bannerMode = _ref1.bannerMode,
337
+ css = _ref1.css,
338
+ footerCloseLabel = _ref1.footerCloseLabel,
339
+ index = _ref1.index,
340
+ onFooterCloseClick = _ref1.onFooterCloseClick,
341
+ onFooterNextClick = _ref1.onFooterNextClick,
342
+ showFooterButtons = _ref1.showFooterButtons,
343
+ totalIndex = _ref1.totalIndex,
344
+ uniqueId = _ref1.uniqueId;
345
+ if (!showFooterButtons || bannerMode) return null;
346
+ var isLastPage = index >= totalIndex - 1;
347
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Layout.Row, {
348
+ className: css.footerButtons,
349
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
350
+ className: isLastPage ? _SpotlightContainerDecorator.spotlightDefaultClass : null,
351
+ spotlightId: "PageViews-footer-close" + uniqueId,
352
+ onClick: onFooterCloseClick,
353
+ children: footerCloseLabel || (0, _$L["default"])('Close')
354
+ }), !isLastPage ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
355
+ className: _SpotlightContainerDecorator.spotlightDefaultClass,
356
+ spotlightId: "PageViews-footer-next" + uniqueId,
357
+ onClick: onFooterNextClick,
358
+ children: (0, _$L["default"])('Next')
359
+ }) : null]
360
+ });
361
+ },
362
+ renderNextButton: function renderNextButton(_ref10) {
363
+ var css = _ref10.css,
364
+ onNextClick = _ref10.onNextClick,
365
+ index = _ref10.index,
366
+ totalIndex = _ref10.totalIndex;
307
367
  var isNextButtonVisible = index < totalIndex - 1;
308
368
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
309
369
  className: css.navButtonCell,
@@ -318,10 +378,10 @@ var PageViewsBase = (0, _kind["default"])({
318
378
  }) : null
319
379
  });
320
380
  },
321
- renderPrevButton: function renderPrevButton(_ref1) {
322
- var css = _ref1.css,
323
- index = _ref1.index,
324
- onPrevClick = _ref1.onPrevClick;
381
+ renderPrevButton: function renderPrevButton(_ref11) {
382
+ var css = _ref11.css,
383
+ index = _ref11.index,
384
+ onPrevClick = _ref11.onPrevClick;
325
385
  var isPrevButtonVisible = index !== 0;
326
386
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
327
387
  className: css.navButtonCell,
@@ -336,17 +396,17 @@ var PageViewsBase = (0, _kind["default"])({
336
396
  }) : null
337
397
  });
338
398
  },
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;
399
+ renderViewManager: function renderViewManager(_ref12) {
400
+ var arranger = _ref12.arranger,
401
+ bannerMode = _ref12.bannerMode,
402
+ css = _ref12.css,
403
+ index = _ref12.index,
404
+ noAnimation = _ref12.noAnimation,
405
+ onTransition = _ref12.onTransition,
406
+ onWillTransition = _ref12.onWillTransition,
407
+ reverseTransition = _ref12.reverseTransition,
408
+ uniqueId = _ref12.uniqueId,
409
+ children = _ref12.children;
350
410
  var CellComponent = bannerMode ? SpottableCell : _Layout.Cell;
351
411
  var props = {};
352
412
  if (bannerMode) props.spotlightId = "banner-view-manager" + uniqueId;
@@ -364,26 +424,26 @@ var PageViewsBase = (0, _kind["default"])({
364
424
  children: children
365
425
  }));
366
426
  },
367
- stepHintAriaLabel: function stepHintAriaLabel(_ref11) {
427
+ stepHintAriaLabel: function stepHintAriaLabel(_ref13) {
368
428
  var _children$index;
369
- var children = _ref11.children,
370
- index = _ref11.index,
371
- totalIndex = _ref11.totalIndex;
429
+ var children = _ref13.children,
430
+ index = _ref13.index,
431
+ totalIndex = _ref13.totalIndex;
372
432
  var pageHint = new _IString["default"]((0, _$L["default"])('Page {current} out of {total}')).format({
373
433
  current: index + 1,
374
434
  total: totalIndex
375
435
  });
376
436
  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']) || '');
377
437
  },
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;
438
+ steps: function steps(_ref14) {
439
+ var bannerMode = _ref14.bannerMode,
440
+ css = _ref14.css,
441
+ index = _ref14.index,
442
+ onNextClick = _ref14.onNextClick,
443
+ onPrevClick = _ref14.onPrevClick,
444
+ onStepsClick = _ref14.onStepsClick,
445
+ pageIndicatorType = _ref14.pageIndicatorType,
446
+ totalIndex = _ref14.totalIndex;
387
447
  var isPrevButtonVisible = index !== 0;
388
448
  var isNextButtonVisible = index < totalIndex - 1;
389
449
  var isStepVisible = totalIndex !== 1;
@@ -436,24 +496,28 @@ var PageViewsBase = (0, _kind["default"])({
436
496
  });
437
497
  }
438
498
  },
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);
499
+ render: function render(_ref15) {
500
+ var css = _ref15.css,
501
+ componentRef = _ref15.componentRef,
502
+ fullContents = _ref15.fullContents,
503
+ index = _ref15.index,
504
+ pageIndicatorPosition = _ref15.pageIndicatorPosition,
505
+ pageIndicatorType = _ref15.pageIndicatorType,
506
+ renderFooterButtons = _ref15.renderFooterButtons,
507
+ renderNextButton = _ref15.renderNextButton,
508
+ renderPrevButton = _ref15.renderPrevButton,
509
+ renderViewManager = _ref15.renderViewManager,
510
+ stepHintAriaLabel = _ref15.stepHintAriaLabel,
511
+ steps = _ref15.steps,
512
+ uniqueId = _ref15.uniqueId,
513
+ rest = _objectWithoutProperties(_ref15, _excluded);
453
514
  delete rest.arranger;
454
515
  delete rest.bannerMode;
455
516
  delete rest.children;
517
+ delete rest.footerCloseLabel;
456
518
  delete rest.noAnimation;
519
+ delete rest.onFooterCloseClick;
520
+ delete rest.onFooterNextClick;
457
521
  delete rest.onNextClick;
458
522
  delete rest.onStepsClick;
459
523
  delete rest.onPrevClick;
@@ -461,6 +525,7 @@ var PageViewsBase = (0, _kind["default"])({
461
525
  delete rest.onWillTransition;
462
526
  delete rest.reverseTransition;
463
527
  delete rest.rtl;
528
+ delete rest.showFooterButtons;
464
529
  delete rest.totalIndex;
465
530
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({
466
531
  role: "region",
@@ -484,7 +549,7 @@ var PageViewsBase = (0, _kind["default"])({
484
549
  className: css.horizontalLayout,
485
550
  children: [pageIndicatorType === 'dot' ? renderPrevButton : null, renderViewManager, pageIndicatorType === 'dot' ? renderNextButton : null]
486
551
  })
487
- }), !fullContents && pageIndicatorPosition === 'bottom' ? steps : null]
552
+ }), !fullContents && pageIndicatorPosition === 'bottom' ? steps : null, renderFooterButtons]
488
553
  }));
489
554
  }
490
555
  });
@@ -50,6 +50,10 @@
50
50
  justify-content: space-evenly;
51
51
  padding: 0 var(--primitive-spacing-36);
52
52
  width: 3.5rem;
53
+ font-size: var(--primitive-font-size-60);
54
+ }
55
+ :global(.largeText) .pageViews.number .stepsRow .pageNumber {
56
+ font-size: var(--primitive-font-size-72);
53
57
  }
54
58
  .pageViews.number .stepsRow .pageNumber .separator {
55
59
  width: 0.6875rem;
@@ -100,6 +104,9 @@
100
104
  .pageViews .horizontalLayout {
101
105
  height: 100%;
102
106
  }
107
+ .pageViews .footerButtons {
108
+ justify-content: center;
109
+ }
103
110
  .pageViews:global(.neutral) .viewManager {
104
111
  background-color: color(from var(--semantic-color-surface-default-group) srgb r g b / 0.1);
105
112
  }