@enact/limestone 1.3.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) 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 +13 -2
  7. package/Alert/Alert.js +39 -5
  8. package/Alert/Alert.module.css +48 -1
  9. package/Alert/tests/Alert-specs.js +91 -0
  10. package/BodyText/BodyText.d.ts +5 -4
  11. package/BodyText/BodyText.module.css +7 -7
  12. package/Button/Button.d.ts +17 -12
  13. package/Button/Button.js +1 -1
  14. package/Button/Button.module.css +195 -268
  15. package/Button/tests/Button-specs.js +26 -0
  16. package/CHANGELOG.md +254 -0
  17. package/Card/Card.d.ts +40 -12
  18. package/Card/Card.js +164 -28
  19. package/Card/Card.module.css +277 -58
  20. package/Card/tests/Card-specs.js +67 -3
  21. package/Checkbox/Checkbox.d.ts +8 -7
  22. package/Checkbox/Checkbox.js +3 -1
  23. package/Checkbox/Checkbox.module.css +213 -120
  24. package/Checkbox/tests/Checkbox-specs.js +1 -1
  25. package/CheckboxItem/CheckboxItem.d.ts +22 -7
  26. package/CheckboxItem/CheckboxItem.js +71 -4
  27. package/Chips/Chip.js +72 -13
  28. package/Chips/Chip.module.css +3 -3
  29. package/Chips/Chips.js +37 -17
  30. package/Chips/Chips.module.css +1 -1
  31. package/Chips/tests/Chip-specs.js +43 -13
  32. package/Chips/tests/Chips-specs.js +31 -21
  33. package/ColorPicker/ColorPicker.js +27 -25
  34. package/ContextualMenuDecorator/ContextualMenuDecorator.d.ts +4 -5
  35. package/ContextualPopupDecorator/ContextualPopup.module.css +34 -34
  36. package/ContextualPopupDecorator/ContextualPopupDecorator.js +567 -549
  37. package/DatePicker/DatePicker.d.ts +4 -5
  38. package/DayPicker/DayPicker.d.ts +8 -7
  39. package/DayPicker/DaySelectorDecorator.js +12 -7
  40. package/Dropdown/Dropdown.d.ts +11 -13
  41. package/Dropdown/Dropdown.module.css +13 -9
  42. package/Dropdown/DropdownList.js +80 -54
  43. package/FixedPopupPanels/FixedPopupPanels.d.ts +4 -2
  44. package/FixedPopupPanels/FixedPopupPanels.module.css +18 -18
  45. package/FlexiblePopupPanels/FlexiblePopupPanels.module.css +23 -23
  46. package/FlexiblePopupPanels/useNavButtonFocus.js +7 -10
  47. package/FormCheckboxItem/FormCheckboxItem.d.ts +5 -4
  48. package/Heading/Heading.d.ts +9 -8
  49. package/Heading/Heading.js +2 -2
  50. package/Heading/Heading.module.css +5 -5
  51. package/Icon/Icon.d.ts +15 -4
  52. package/Icon/Icon.js +49 -2
  53. package/Icon/Icon.module.css +1 -1
  54. package/Icon/IconList.js +27 -1
  55. package/IconItem/IconItem.d.ts +13 -12
  56. package/IconItem/IconItem.js +15 -0
  57. package/IconItem/IconItem.module.css +107 -1
  58. package/IconItem/tests/IconItem-specs.js +30 -1
  59. package/Image/Image.d.ts +5 -4
  60. package/Image/Image.js +6 -4
  61. package/ImageItem/ImageItem.d.ts +11 -10
  62. package/ImageItem/ImageItem.js +37 -31
  63. package/ImageItem/ImageItem.module.css +30 -30
  64. package/ImageItem/tests/ImageItem-specs.js +3 -10
  65. package/Input/Input.js +21 -3
  66. package/Input/Input.module.css +37 -8
  67. package/Input/InputField.js +79 -24
  68. package/Input/InputField.module.css +273 -41
  69. package/Input/InputFieldDecoratorIcon.js +1 -0
  70. package/Input/InputFieldSpotlightDecorator.js +257 -228
  71. package/Input/index.d.ts +120 -111
  72. package/Input/tests/Input-specs.js +26 -0
  73. package/Input/tests/InputField-specs.js +170 -3
  74. package/Input/tests/InputPopup-specs.js +1 -1
  75. package/Item/Item.d.ts +16 -9
  76. package/Item/Item.js +20 -2
  77. package/Item/Item.module.css +1 -1
  78. package/KeyGuide/KeyGuide.d.ts +8 -7
  79. package/KeyGuide/KeyGuide.js +29 -27
  80. package/KeyGuide/KeyGuide.module.css +25 -1
  81. package/Marquee/Marquee.d.ts +2 -4
  82. package/MediaOverlay/MediaOverlay.d.ts +12 -11
  83. package/MediaOverlay/MediaOverlay.js +43 -21
  84. package/MediaOverlay/MediaOverlay.module.css +114 -15
  85. package/MediaOverlay/tests/MediaOverlay-specs.js +29 -0
  86. package/MediaPlayer/MediaControls.js +195 -13
  87. package/MediaPlayer/MediaControls.module.css +3 -2
  88. package/MediaPlayer/MediaSlider.module.css +7 -20
  89. package/MediaPlayer/index.d.ts +59 -7
  90. package/MediaPlayer/tests/util-specs.js +4 -1
  91. package/PageViews/PageViews.js +232 -82
  92. package/PageViews/PageViews.module.css +3 -0
  93. package/PageViews/PageViewsRouter.js +100 -42
  94. package/PageViews/tests/PageViews-specs.js +171 -0
  95. package/Panels/Header.js +54 -34
  96. package/Panels/Header.module.css +83 -31
  97. package/Panels/Panel.module.css +1 -1
  98. package/Panels/index.d.ts +7 -8
  99. package/Picker/Picker.d.ts +4 -5
  100. package/Picker/Picker.module.css +2 -2
  101. package/Popup/Popup.js +245 -242
  102. package/Popup/Popup.module.css +24 -24
  103. package/PopupTabLayout/PopupTabLayout.d.ts +5 -7
  104. package/PopupTabLayout/PopupTabLayout.js +26 -18
  105. package/PopupTabLayout/PopupTabLayout.module.css +53 -16
  106. package/PopupTabLayout/PopupTabLayoutStateContext.js +8 -0
  107. package/ProgressBar/ProgressBar.d.ts +5 -4
  108. package/ProgressBar/ProgressBarTooltip.module.css +12 -12
  109. package/ProgressButton/ProgressButton.d.ts +4 -5
  110. package/QuickGuidePanels/QuickGuidePanels.module.css +2 -2
  111. package/RadioItem/RadioItem.d.ts +18 -5
  112. package/RadioItem/RadioItem.js +69 -2
  113. package/RadioItem/RadioItem.module.css +36 -36
  114. package/RangePicker/RangePicker.module.css +2 -2
  115. package/Scroller/EditableWrapper.js +28 -18
  116. package/Scroller/Scroller.d.ts +20 -16
  117. package/Scroller/Scroller.js +20 -13
  118. package/Scroller/Scroller.module.css +4 -4
  119. package/Scroller/useThemeScroller.js +3 -3
  120. package/Slider/Slider.d.ts +20 -14
  121. package/Slider/Slider.js +71 -14
  122. package/Slider/Slider.module.css +464 -91
  123. package/Slider/SliderBehaviorDecorator.js +16 -14
  124. package/Slider/tests/Slider-specs.js +53 -1
  125. package/Slider/utils.js +23 -7
  126. package/Spinner/Spinner.d.ts +5 -4
  127. package/Spinner/Spinner.js +10 -8
  128. package/Spinner/Spinner.module.css +9 -9
  129. package/Steps/Steps.d.ts +5 -4
  130. package/Steps/Steps.js +9 -5
  131. package/Switch/Switch.d.ts +8 -7
  132. package/Switch/Switch.module.css +100 -13
  133. package/SwitchItem/SwitchItem.d.ts +9 -6
  134. package/TabLayout/RefocusDecorator.js +26 -18
  135. package/TabLayout/TabGroup.js +3 -2
  136. package/TabLayout/TabGroup.module.css +2 -2
  137. package/TabLayout/TabLayout.d.ts +6 -0
  138. package/TabLayout/TabLayout.js +11 -1
  139. package/TabLayout/TabLayout.module.css +18 -0
  140. package/TabLayout/tests/TabGroup-specs.js +1 -1
  141. package/TabLayout/tests/TabLayout-specs.js +52 -0
  142. package/ThemeDecorator/AccessibilityDecorator.js +12 -11
  143. package/ThemeDecorator/I18nFontDecorator.js +6 -4
  144. package/ThemeDecorator/ThemeDecorator.d.ts +16 -10
  145. package/ThemeDecorator/ThemeDecorator.js +24 -9
  146. package/ThemeDecorator/fontGenerator.js +1 -1
  147. package/ThemeDecorator/screenTypes.json +1 -0
  148. package/TimePicker/TimePicker.module.css +1 -1
  149. package/TimePicker/TimePickerBase.js +5 -3
  150. package/TooltipDecorator/Tooltip.module.css +1 -2
  151. package/TooltipDecorator/TooltipDecorator.js +12 -7
  152. package/TooltipDecorator/tests/useTooltip-specs.js +5 -2
  153. package/TooltipDecorator/tests/util-specs.js +12 -0
  154. package/TooltipDecorator/useTooltip.js +1 -1
  155. package/TooltipDecorator/util.js +18 -11
  156. package/VideoPlayer/Feedback.js +3 -0
  157. package/VideoPlayer/Feedback.module.css +5 -9
  158. package/VideoPlayer/FeedbackIcons.js +1 -1
  159. package/VideoPlayer/FeedbackTooltip.module.css +55 -11
  160. package/VideoPlayer/VideoPlayer.d.ts +44 -18
  161. package/VideoPlayer/VideoPlayer.js +153 -47
  162. package/VideoPlayer/VideoPlayer.module.css +28 -11
  163. package/VirtualList/VirtualList.d.ts +9 -2
  164. package/VirtualList/VirtualList.js +51 -24
  165. package/VirtualList/tests/VirtualGridList-translate-specs.js +3 -0
  166. package/VirtualList/tests/VirtualList-specs.js +28 -1
  167. package/VirtualList/tests/VirtualList-translate-specs.js +4 -1
  168. package/VirtualList/useSpotlight.js +1 -1
  169. package/WizardPanels/WizardPanels.module.css +2 -2
  170. package/WizardPanels/index.d.ts +4 -2
  171. package/fonts/Limestone_Icons.ttf +0 -0
  172. package/internal/$L/$L.js +3 -3
  173. package/internal/AsyncRenderChildren/AsyncRenderChildren.js +9 -5
  174. package/internal/AsyncRenderChildren/tests/AsyncRenderChildren-specs.js +4 -1
  175. package/internal/DateComponentPicker/DateComponentPicker.module.css +2 -2
  176. package/internal/DateTime/DateTime.module.css +1 -0
  177. package/internal/DateTime/DateTimeDecorator.js +5 -4
  178. package/internal/Panels/PanelsRouter.js +48 -31
  179. package/internal/Panels/useAutoFocus.js +10 -6
  180. package/internal/Panels/useFocusOnTransition.js +4 -3
  181. package/internal/Picker/Picker.js +7 -5
  182. package/internal/Picker/Picker.module.css +2 -2
  183. package/internal/Picker/SpottablePicker.js +15 -13
  184. package/internal/SharedStateDecorator/SharedStateDecorator.js +78 -99
  185. package/internal/validators/validators.js +21 -2
  186. package/package.json +18 -15
  187. package/styles/colors-highcontrast.less +9 -1
  188. package/styles/colors.less +12 -7
  189. package/styles/motion-mixins.less +66 -0
  190. package/styles/motions.less +78 -0
  191. package/styles/variables.less +176 -150
  192. package/useScroll/HoverToScroll.js +23 -17
  193. package/useScroll/Scrollbar.js +14 -10
  194. package/useScroll/ScrollbarPlaceholder.js +3 -5
  195. package/useScroll/ScrollbarTrack.js +7 -5
  196. package/useScroll/ScrollbarTrack.module.css +8 -8
  197. package/useScroll/useEvent.js +14 -3
  198. package/useScroll/useScroll.js +12 -2
  199. package/useScroll/useScroll.module.css +6 -6
  200. package/.travis.yml +0 -40
@@ -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
  }
@@ -7,7 +7,7 @@
7
7
  flex-direction: column;
8
8
  width: 15.625rem;
9
9
  right: 3.125rem;
10
- bottom: 2.5rem;
10
+ bottom: var(--primitive-spacing-120);
11
11
  padding: var(--primitive-spacing-48);
12
12
  gap: var(--primitive-spacing-42);
13
13
  }
@@ -64,6 +64,10 @@
64
64
  }
65
65
  .keyGuide:global(.neutral) {
66
66
  background: var(--semantic-color-surface-overlay-default);
67
+ outline-color: transparent;
68
+ outline-width: 0.063rem;
69
+ outline-style: solid;
70
+ outline-offset: -0.063rem;
67
71
  }
68
72
  .keyGuide:global(.neutral) .red {
69
73
  background-color: #ff6d78;
@@ -124,6 +128,10 @@
124
128
  }
125
129
  :global(.enact-a11y-high-contrast) .keyGuide:global(.neutral):global(.highContrast) {
126
130
  background: var(--semantic-color-surface-overlay-default);
131
+ outline-color: var(--semantic-color-stroke-main);
132
+ outline-width: 0.063rem;
133
+ outline-style: solid;
134
+ outline-offset: -0.063rem;
127
135
  }
128
136
  :global(.enact-a11y-high-contrast) .keyGuide:global(.neutral):global(.highContrast) .red {
129
137
  background-color: #ff6d78;
@@ -184,6 +192,10 @@
184
192
  }
185
193
  .keyGuide:global(.light) {
186
194
  background: var(--semantic-color-surface-overlay-default);
195
+ outline-color: transparent;
196
+ outline-width: 0.063rem;
197
+ outline-style: solid;
198
+ outline-offset: -0.063rem;
187
199
  }
188
200
  .keyGuide:global(.light) .red {
189
201
  background-color: #ff6d78;
@@ -247,6 +259,10 @@
247
259
  --semantic-color-surface-default-focused: #6d2fa1;
248
260
  --semantic-color-on-surface-main-focused: #e6e6e6;
249
261
  background: var(--semantic-color-surface-overlay-default);
262
+ outline-color: transparent;
263
+ outline-width: 0.063rem;
264
+ outline-style: solid;
265
+ outline-offset: -0.063rem;
250
266
  }
251
267
  .keyGuide:global(.game) .red {
252
268
  background-color: #ff6d78;
@@ -309,6 +325,10 @@
309
325
  --semantic-color-surface-default: #1F2C24;
310
326
  --semantic-color-surface-default-focused: #3ea07d;
311
327
  background: var(--semantic-color-surface-overlay-default);
328
+ outline-color: transparent;
329
+ outline-width: 0.063rem;
330
+ outline-style: solid;
331
+ outline-offset: -0.063rem;
312
332
  }
313
333
  :global(.green) .keyGuide:global(.game) .red {
314
334
  background-color: #ff6d78;
@@ -371,6 +391,10 @@
371
391
  --semantic-color-surface-default: #422923;
372
392
  --semantic-color-surface-default-focused: #b85f23;
373
393
  background: var(--semantic-color-surface-overlay-default);
394
+ outline-color: transparent;
395
+ outline-width: 0.063rem;
396
+ outline-style: solid;
397
+ outline-offset: -0.063rem;
374
398
  }
375
399
  :global(.orange) .keyGuide:global(.game) .red {
376
400
  background-color: #ff6d78;
@@ -27,14 +27,12 @@ export class MarqueeBase extends React.Component<
27
27
  Merge<React.HTMLProps<HTMLElement>, MarqueeBaseProps>
28
28
  > {}
29
29
 
30
- export interface MarqueeControllerProps
31
- extends ui_Marquee_MarqueeControllerProps {}
30
+ export interface MarqueeControllerProps extends ui_Marquee_MarqueeControllerProps {}
32
31
  export function MarqueeController<P>(
33
32
  Component: React.ComponentType<P> | string,
34
33
  ): React.ComponentType<P & MarqueeControllerProps>;
35
34
 
36
- export interface MarqueeDecoratorProps
37
- extends ui_Marquee_MarqueeDecoratorProps {}
35
+ export interface MarqueeDecoratorProps extends ui_Marquee_MarqueeDecoratorProps {}
38
36
  export function MarqueeDecorator<P>(
39
37
  Component: React.ComponentType<P> | string,
40
38
  ): React.ComponentType<P & MarqueeDecoratorProps>;
@@ -99,23 +99,24 @@ export class MediaOverlayBase extends React.Component<
99
99
  Merge<React.HTMLProps<HTMLElement>, MediaOverlayBaseProps>
100
100
  > {}
101
101
 
102
- export interface MediaOverlayDecoratorProps
103
- extends Merge<
102
+ export interface MediaOverlayDecoratorProps extends Merge<
103
+ Merge<
104
104
  Merge<
105
- Merge<
106
- limestone_Marquee_MarqueeControllerProps,
107
- spotlight_Spottable_SpottableProps
108
- >,
109
- ui_Slottable_SlottableProps
105
+ limestone_Marquee_MarqueeControllerProps,
106
+ spotlight_Spottable_SpottableProps
110
107
  >,
111
- limestone_Skinnable_SkinnableProps
112
- > {}
108
+ ui_Slottable_SlottableProps
109
+ >,
110
+ limestone_Skinnable_SkinnableProps
111
+ > {}
113
112
  export function MediaOverlayDecorator<P>(
114
113
  Component: React.ComponentType<P> | string,
115
114
  ): React.ComponentType<P & MediaOverlayDecoratorProps>;
116
115
 
117
- export interface MediaOverlayProps
118
- extends Merge<MediaOverlayBaseProps, MediaOverlayDecoratorProps> {}
116
+ export interface MediaOverlayProps extends Merge<
117
+ MediaOverlayBaseProps,
118
+ MediaOverlayDecoratorProps
119
+ > {}
119
120
  /**
120
121
  * A Limestone-styled `Media` component.
121
122
  *
@@ -4,11 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = exports.MediaOverlayDecorator = exports.MediaOverlayBase = exports.MediaOverlay = void 0;
7
+ var _propTypes = _interopRequireDefault(require("@enact/core/internal/prop-types"));
7
8
  var _kind = _interopRequireDefault(require("@enact/core/kind"));
8
9
  var _Spottable = _interopRequireDefault(require("@enact/spotlight/Spottable"));
9
10
  var _Layout = require("@enact/ui/Layout");
10
11
  var _Media = _interopRequireDefault(require("@enact/ui/Media"));
11
- var _propTypes = _interopRequireDefault(require("@enact/core/internal/prop-types"));
12
+ var _Touchable = _interopRequireDefault(require("@enact/ui/Touchable"));
12
13
  var _Pure = _interopRequireDefault(require("@enact/ui/internal/Pure"));
13
14
  var _Slottable = _interopRequireDefault(require("@enact/ui/Slottable"));
14
15
  var _propTypes2 = _interopRequireDefault(require("prop-types"));
@@ -138,6 +139,14 @@ var MediaOverlayBase = exports.MediaOverlayBase = (0, _kind["default"])({
138
139
  * @public
139
140
  */
140
141
  placeholder: _propTypes2["default"].string,
142
+ /**
143
+ * Indicates if the component is pressed.
144
+ *
145
+ * @type {Boolean}
146
+ * @default false
147
+ * @private
148
+ */
149
+ pressed: _propTypes2["default"].bool,
141
150
  /**
142
151
  * A number between `0` and `1` indicating the proportion of the filled portion of the bar.
143
152
  *
@@ -187,32 +196,43 @@ var MediaOverlayBase = exports.MediaOverlayBase = (0, _kind["default"])({
187
196
  },
188
197
  defaultProps: {
189
198
  mediaComponent: 'video',
199
+ pressed: false,
190
200
  progress: 0,
191
201
  textAlign: 'end'
192
202
  },
193
203
  styles: {
194
204
  css: _MediaOverlayModule["default"],
195
205
  className: 'mediaOverlay',
196
- publicClassNames: ['mediaOverlay', 'image', 'text']
206
+ publicClassNames: ['mediaOverlay', 'image', 'pressed', 'text']
207
+ },
208
+ computed: {
209
+ className: function className(_ref) {
210
+ var pressed = _ref.pressed,
211
+ styler = _ref.styler;
212
+ return styler.append({
213
+ pressed: pressed
214
+ });
215
+ }
197
216
  },
198
- render: function render(_ref) {
199
- var caption = _ref.caption,
200
- css = _ref.css,
201
- imageOverlay = _ref.imageOverlay,
202
- loop = _ref.loop,
203
- marqueeOn = _ref.marqueeOn,
204
- mediaComponent = _ref.mediaComponent,
205
- muted = _ref.muted,
206
- noAutoPlay = _ref.noAutoPlay,
207
- placeholder = _ref.placeholder,
208
- progress = _ref.progress,
209
- showProgress = _ref.showProgress,
210
- source = _ref.source,
211
- title = _ref.title,
212
- subtitle = _ref.subtitle,
213
- text = _ref.text,
214
- textAlign = _ref.textAlign,
215
- rest = _objectWithoutProperties(_ref, _excluded);
217
+ render: function render(_ref2) {
218
+ var caption = _ref2.caption,
219
+ css = _ref2.css,
220
+ imageOverlay = _ref2.imageOverlay,
221
+ loop = _ref2.loop,
222
+ marqueeOn = _ref2.marqueeOn,
223
+ mediaComponent = _ref2.mediaComponent,
224
+ muted = _ref2.muted,
225
+ noAutoPlay = _ref2.noAutoPlay,
226
+ placeholder = _ref2.placeholder,
227
+ progress = _ref2.progress,
228
+ showProgress = _ref2.showProgress,
229
+ source = _ref2.source,
230
+ title = _ref2.title,
231
+ subtitle = _ref2.subtitle,
232
+ text = _ref2.text,
233
+ textAlign = _ref2.textAlign,
234
+ rest = _objectWithoutProperties(_ref2, _excluded);
235
+ delete rest.pressed;
216
236
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({}, rest), {}, {
217
237
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
218
238
  className: css.bg
@@ -279,7 +299,9 @@ var MediaOverlayBase = exports.MediaOverlayBase = (0, _kind["default"])({
279
299
  */
280
300
  var MediaOverlayDecorator = exports.MediaOverlayDecorator = (0, _compose["default"])((0, _Marquee.MarqueeController)({
281
301
  marqueeOnFocus: true
282
- }), _Pure["default"], _Spottable["default"], (0, _Slottable["default"])({
302
+ }), _Pure["default"], (0, _Touchable["default"])({
303
+ activeProp: 'pressed'
304
+ }), _Spottable["default"], (0, _Slottable["default"])({
283
305
  slots: ['source']
284
306
  }), _Skinnable["default"]);
285
307
 
@@ -1,3 +1,86 @@
1
+ /* ---------------------------------------
2
+ Animations
3
+ ------------------------------------------ */
4
+ :root {
5
+ /* Bounce
6
+ ------------------------------------------ */
7
+ --lime-bounce-motion: var(--lime-bounce-animation-name) var(--lime-bounce-motion-duration) var(--lime-bounce-motion-easing-function);
8
+ --lime-check-motion: var(--lime-check-animation-name) var(--lime-check-motion-duration) forwards;
9
+ }
10
+ /* ---------------------------------------
11
+ Animations properties
12
+ ------------------------------------------ */
13
+ :root {
14
+ /* ---------------------------------------
15
+ Durations
16
+ ------------------------------------------ */
17
+ --lime-motion-default-duration: 200ms;
18
+ --lime-motion-medium1-duration: 250ms;
19
+ --lime-motion-medium2-duration: 300ms;
20
+ --lime-motion-medium4-duration: 400ms;
21
+ --lime-motion-long2-duration: 500ms;
22
+ --lime-bounce-motion-duration: var(--lime-motion-medium2-duration);
23
+ --lime-check-motion-duration: var(--lime-motion-medium4-duration);
24
+ --lime-focus-in-motion-duration: var(--lime-motion-medium2-duration);
25
+ --lime-focus-out-motion-duration: var(--lime-motion-long2-duration);
26
+ --lime-press-motion-duration: var(--lime-motion-medium1-duration);
27
+ --lime-release-motion-duration: var(--lime-motion-medium2-duration);
28
+ /* ---------------------------------------
29
+ Easing functions
30
+ ------------------------------------------ */
31
+ --lime-default-motion-easing-function: ease-out;
32
+ --lime-EIO-motion-easing-function: cubic-bezier(0.2, 0, 0.05, 1);
33
+ --lime-EO-motion-easing-function: cubic-bezier(0.1, 0.6, 0.15, 1);
34
+ --lime-bounce-motion-easing-function: var(--lime-default-motion-easing-function);
35
+ --lime-focus-in-motion-easing-function: var(--lime-EIO-motion-easing-function);
36
+ --lime-focus-out-motion-easing-function: var(--lime-EO-motion-easing-function);
37
+ --lime-press-motion-easing-function: var(--lime-EIO-motion-easing-function);
38
+ --lime-release-motion-easing-function: var(--lime-EO-motion-easing-function);
39
+ /* ---------------------------------------
40
+ Keyframes names
41
+ ------------------------------------------ */
42
+ --lime-bounce-animation-name: bounce-motion;
43
+ --lime-check-animation-name: check-motion;
44
+ /* ---------------------------------------
45
+ Keyframes values
46
+ ------------------------------------------ */
47
+ --lime-bounce-motion-offset-default-value: 0.125rem;
48
+ }
49
+ /* ---------------------------------------
50
+ Keyframes
51
+ ------------------------------------------ */
52
+ /* Bounce
53
+ ------------------------------------------ */
54
+ @keyframes bounce-motion {
55
+ 0% {
56
+ transform: translateX(0);
57
+ }
58
+ 50% {
59
+ transform: translateX(var(--lime-bounce-motion-offset-value, --lime-bounce-motion-offset-default-value));
60
+ }
61
+ 80% {
62
+ transform: translateX(calc(var(--lime-bounce-motion-offset-value, --lime-bounce-motion-offset-default-value) / -2));
63
+ }
64
+ 100% {
65
+ transform: translateX(0);
66
+ }
67
+ }
68
+ /* Check
69
+ ------------------------------------------ */
70
+ @keyframes check-motion {
71
+ 0% {
72
+ transform: translateX(0);
73
+ }
74
+ 100% {
75
+ transform: translateX(100%);
76
+ }
77
+ }
78
+ /* ---------------------------------------
79
+ Motion Variables
80
+ ------------------------------------------ */
81
+ /* ---------------------------------------
82
+ Motion Mixins
83
+ ------------------------------------------ */
1
84
  .mediaOverlay {
2
85
  display: block;
3
86
  position: relative;
@@ -16,6 +99,37 @@
16
99
  }
17
100
  .mediaOverlay .mediaContainer {
18
101
  position: relative;
102
+ transition: transform var(--lime-focus-out-motion-duration) var(--lime-focus-out-motion-easing-function);
103
+ }
104
+ :global(.spotlight-input-key) .mediaOverlay:global(.spottable):focus .mediaContainer,
105
+ :global(.spotlight-input-mouse) .mediaOverlay:global(.spottable):focus .mediaContainer {
106
+ transform: scale(1.1);
107
+ transition: transform var(--lime-focus-in-motion-duration) var(--lime-focus-in-motion-easing-function);
108
+ }
109
+ :global(.spotlight-input-touch) .mediaOverlay:global(.spottable):active .mediaContainer {
110
+ transform: scale(1.1);
111
+ transition: transform var(--lime-focus-in-motion-duration) var(--lime-focus-in-motion-easing-function);
112
+ }
113
+ :global(.spotlight-input-key) .mediaOverlay:not([disabled]):global(.spottable):focus.pressed .mediaContainer,
114
+ :global(.spotlight-input-mouse) .mediaOverlay:not([disabled]):global(.spottable):focus.pressed .mediaContainer,
115
+ :global(.spotlight-input-key) .mediaOverlay:not([disabled]):global(.spottable):focus:active .mediaContainer,
116
+ :global(.spotlight-input-mouse) .mediaOverlay:not([disabled]):global(.spottable):focus:active .mediaContainer {
117
+ transform: scale(1.05);
118
+ transition: transform var(--lime-press-motion-duration) var(--lime-press-motion-easing-function);
119
+ }
120
+ :global(.spotlight-input-key) .mediaOverlay:not([disabled]):global(.spottable):focus:not(.pressed) .mediaContainer,
121
+ :global(.spotlight-input-mouse) .mediaOverlay:not([disabled]):global(.spottable):focus:not(.pressed) .mediaContainer {
122
+ transform: scale(1.1);
123
+ transition: transform var(--lime-release-motion-duration) var(--lime-release-motion-easing-function);
124
+ }
125
+ :global(.spotlight-input-touch) .mediaOverlay:not([disabled]):global(.spottable):active.pressed .mediaContainer,
126
+ :global(.spotlight-input-touch) .mediaOverlay:not([disabled]):global(.spottable):active:active .mediaContainer {
127
+ transform: scale(1.05);
128
+ transition: transform var(--lime-press-motion-duration) var(--lime-press-motion-easing-function);
129
+ }
130
+ :global(.spotlight-input-touch) .mediaOverlay:not([disabled]):global(.spottable):active:not(.pressed) .mediaContainer {
131
+ transform: scale(1.1);
132
+ transition: transform var(--lime-release-motion-duration) var(--lime-release-motion-easing-function);
19
133
  }
20
134
  .mediaOverlay .media {
21
135
  display: block;
@@ -88,21 +202,6 @@
88
202
  font-size: var(--primitive-font-size-48);
89
203
  line-height: 1.3em;
90
204
  }
91
- :global(.spotlight-input-key) .mediaOverlay:global(.spottable):focus .image,
92
- :global(.spotlight-input-mouse) .mediaOverlay:global(.spottable):focus .image,
93
- :global(.spotlight-input-key) .mediaOverlay:global(.spottable):focus .media,
94
- :global(.spotlight-input-mouse) .mediaOverlay:global(.spottable):focus .media,
95
- :global(.spotlight-input-key) .mediaOverlay:global(.spottable):focus .progressBar,
96
- :global(.spotlight-input-mouse) .mediaOverlay:global(.spottable):focus .progressBar {
97
- transform: scale(1.1);
98
- transition: transform 200ms ease-in-out;
99
- }
100
- :global(.spotlight-input-touch) .mediaOverlay:global(.spottable):active .image,
101
- :global(.spotlight-input-touch) .mediaOverlay:global(.spottable):active .media,
102
- :global(.spotlight-input-touch) .mediaOverlay:global(.spottable):active .progressBar {
103
- transform: scale(1.1);
104
- transition: transform 200ms ease-in-out;
105
- }
106
205
  .mediaOverlay:global(.neutral) .bg {
107
206
  opacity: 0;
108
207
  background-color: var(--semantic-color-surface-default-focused);
@@ -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
  });