@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
@@ -1,6 +1,89 @@
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
  .iconItem {
2
85
  position: relative;
3
- transition: transform 200ms ease-in-out;
86
+ transition: transform var(--lime-focus-out-motion-duration) var(--lime-focus-out-motion-easing-function);
4
87
  will-change: transform;
5
88
  height: 5.33333rem;
6
89
  width: 6.95833rem;
@@ -57,6 +140,7 @@
57
140
  :global(.spotlight-input-key) .iconItem:global(.spottable):focus,
58
141
  :global(.spotlight-input-mouse) .iconItem:global(.spottable):focus {
59
142
  transform: scale(1.1);
143
+ transition: transform var(--lime-focus-in-motion-duration) var(--lime-focus-in-motion-easing-function);
60
144
  }
61
145
  :global(.spotlight-input-key) .iconItem:global(.spottable):focus.labelOnFocus .label,
62
146
  :global(.spotlight-input-mouse) .iconItem:global(.spottable):focus.labelOnFocus .label,
@@ -70,6 +154,7 @@
70
154
  }
71
155
  :global(.spotlight-input-touch) .iconItem:global(.spottable):active {
72
156
  transform: scale(1.1);
157
+ transition: transform var(--lime-focus-in-motion-duration) var(--lime-focus-in-motion-easing-function);
73
158
  }
74
159
  :global(.spotlight-input-touch) .iconItem:global(.spottable):active.labelOnFocus .label,
75
160
  :global(.spotlight-input-touch) .iconItem:global(.spottable):active.labelOnFocus .labelContainer {
@@ -78,6 +163,27 @@
78
163
  :global(.spotlight-input-touch) .iconItem:global(.spottable):active.titleOnFocus .title {
79
164
  visibility: visible;
80
165
  }
166
+ :global(.spotlight-input-key) .iconItem:not([disabled]):global(.spottable):focus.pressed,
167
+ :global(.spotlight-input-mouse) .iconItem:not([disabled]):global(.spottable):focus.pressed,
168
+ :global(.spotlight-input-key) .iconItem:not([disabled]):global(.spottable):focus:active,
169
+ :global(.spotlight-input-mouse) .iconItem:not([disabled]):global(.spottable):focus:active {
170
+ transform: scale(1.05);
171
+ transition: transform var(--lime-press-motion-duration) var(--lime-press-motion-easing-function);
172
+ }
173
+ :global(.spotlight-input-key) .iconItem:not([disabled]):global(.spottable):focus:not(:pressed),
174
+ :global(.spotlight-input-mouse) .iconItem:not([disabled]):global(.spottable):focus:not(:pressed) {
175
+ transform: scale(1.1);
176
+ transition: transform var(--lime-release-motion-duration) var(--lime-release-motion-easing-function);
177
+ }
178
+ :global(.spotlight-input-touch) .iconItem:not([disabled]):global(.spottable):active.pressed,
179
+ :global(.spotlight-input-touch) .iconItem:not([disabled]):global(.spottable):active:active {
180
+ transform: scale(1.05);
181
+ transition: transform var(--lime-press-motion-duration) var(--lime-press-motion-easing-function);
182
+ }
183
+ :global(.spotlight-input-touch) .iconItem:not([disabled]):global(.spottable):active:not(:pressed) {
184
+ transform: scale(1.1);
185
+ transition: transform var(--lime-release-motion-duration) var(--lime-release-motion-easing-function);
186
+ }
81
187
  :global(.noAnimation) .iconItem {
82
188
  transition: none;
83
189
  }
@@ -2,8 +2,9 @@
2
2
 
3
3
  require("@testing-library/jest-dom");
4
4
  var _react = require("@testing-library/react");
5
- var _IconItem = require("../IconItem");
5
+ var _IconItem = _interopRequireWildcard(require("../IconItem"));
6
6
  var _jsxRuntime = require("react/jsx-runtime");
7
+ 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); }
7
8
  describe('IconItem', function () {
8
9
  test('should support `background` prop', function () {
9
10
  var background = '#ffffff';
@@ -103,4 +104,32 @@ describe('IconItem', function () {
103
104
  var actual = _react.screen.getByTestId('iconitem');
104
105
  expect(actual).toHaveClass(expected);
105
106
  });
107
+ test('should be pressed when selected', function () {
108
+ (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_IconItem["default"], {
109
+ "data-testid": "iconitem"
110
+ }));
111
+ var iconItem = _react.screen.getByTestId('iconitem');
112
+
113
+ // Select by key
114
+ _react.fireEvent.keyDown(iconItem, {
115
+ key: 'Enter',
116
+ code: 'Enter',
117
+ keyCode: 13,
118
+ which: 13
119
+ });
120
+ expect(iconItem).toHaveClass('pressed');
121
+ _react.fireEvent.keyUp(iconItem, {
122
+ key: 'Enter',
123
+ code: 'Enter',
124
+ keyCode: 13,
125
+ which: 13
126
+ });
127
+ expect(iconItem).not.toHaveClass('pressed');
128
+
129
+ // Select by pointer
130
+ _react.fireEvent.mouseDown(iconItem);
131
+ expect(iconItem).toHaveClass('pressed');
132
+ _react.fireEvent.mouseUp(iconItem);
133
+ expect(iconItem).not.toHaveClass('pressed');
134
+ });
106
135
  });
package/Image/Image.d.ts CHANGED
@@ -32,14 +32,15 @@ export class ImageBase extends React.Component<
32
32
  Merge<React.HTMLProps<HTMLElement>, ImageBaseProps>
33
33
  > {}
34
34
 
35
- export interface ImageDecoratorProps
36
- extends limestone_Skinnable_SkinnableProps {}
35
+ export interface ImageDecoratorProps extends limestone_Skinnable_SkinnableProps {}
37
36
  export function ImageDecorator<P>(
38
37
  Component: React.ComponentType<P> | string,
39
38
  ): React.ComponentType<P & ImageDecoratorProps>;
40
39
 
41
- export interface ImageProps
42
- extends Merge<ImageBaseProps, ImageDecoratorProps> {}
40
+ export interface ImageProps extends Merge<
41
+ ImageBaseProps,
42
+ ImageDecoratorProps
43
+ > {}
43
44
  /**
44
45
  * A Limestone-styled image component
45
46
  * ```
package/Image/Image.js CHANGED
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = exports.ImageDecorator = exports.ImageBase = exports.Image = void 0;
7
7
  var _kind = _interopRequireDefault(require("@enact/core/kind"));
8
8
  var _hoc = _interopRequireDefault(require("@enact/core/hoc"));
9
+ var _util = require("@enact/core/util");
9
10
  var _Image = require("@enact/ui/Image");
10
11
  var _propTypes = _interopRequireDefault(require("@enact/core/internal/prop-types"));
11
12
  var _ForwardRef = _interopRequireDefault(require("@enact/ui/ForwardRef"));
@@ -106,7 +107,8 @@ var ImageBase = exports.ImageBase = (0, _kind["default"])({
106
107
  // another time. -B 2018-05-01
107
108
  var ResponsiveImageDecorator = (0, _hoc["default"])(function (config, Wrapped) {
108
109
  // eslint-disable-next-line no-shadow
109
- var ResponsiveImageDecorator = function ResponsiveImageDecorator(props) {
110
+ var _ResponsiveImageDecorator = function ResponsiveImageDecorator(props) {
111
+ (0, _util.checkPropTypes)(_ResponsiveImageDecorator, props);
110
112
  var _useState = (0, _react.useState)((0, _resolution.selectSrc)(props.src)),
111
113
  _useState2 = _slicedToArray(_useState, 2),
112
114
  setSrc = _useState2[1];
@@ -122,11 +124,11 @@ var ResponsiveImageDecorator = (0, _hoc["default"])(function (config, Wrapped) {
122
124
 
123
125
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapped, _objectSpread({}, props));
124
126
  };
125
- ResponsiveImageDecorator.displayName = 'ResponsiveImageDecorator';
126
- ResponsiveImageDecorator.propTypes = {
127
+ _ResponsiveImageDecorator.displayName = 'ResponsiveImageDecorator';
128
+ _ResponsiveImageDecorator.propTypes = {
127
129
  src: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].object])
128
130
  };
129
- return ResponsiveImageDecorator;
131
+ return _ResponsiveImageDecorator;
130
132
  });
131
133
 
132
134
  /**
@@ -99,20 +99,21 @@ export class ImageItemBase extends React.Component<
99
99
  Merge<React.HTMLProps<HTMLElement>, ImageItemBaseProps>
100
100
  > {}
101
101
 
102
- export interface ImageItemDecoratorProps
103
- extends Merge<
104
- Merge<
105
- limestone_Marquee_MarqueeControllerProps,
106
- spotlight_Spottable_SpottableProps
107
- >,
108
- limestone_Skinnable_SkinnableProps
109
- > {}
102
+ export interface ImageItemDecoratorProps extends Merge<
103
+ Merge<
104
+ limestone_Marquee_MarqueeControllerProps,
105
+ spotlight_Spottable_SpottableProps
106
+ >,
107
+ limestone_Skinnable_SkinnableProps
108
+ > {}
110
109
  export function ImageItemDecorator<P>(
111
110
  Component: React.ComponentType<P> | string,
112
111
  ): React.ComponentType<P & ImageItemDecoratorProps>;
113
112
 
114
- export interface ImageItemProps
115
- extends Merge<ImageItemBaseProps, ImageItemDecoratorProps> {}
113
+ export interface ImageItemProps extends Merge<
114
+ ImageItemBaseProps,
115
+ ImageItemDecoratorProps
116
+ > {}
116
117
  /**
117
118
  * A limestone-styled image item, Marquee and Spottable applied.
118
119
  *
@@ -11,6 +11,7 @@ var _ImageItem = require("@enact/ui/ImageItem");
11
11
  var _Layout = require("@enact/ui/Layout");
12
12
  var _propTypes2 = _interopRequireDefault(require("prop-types"));
13
13
  var _compose = _interopRequireDefault(require("ramda/src/compose"));
14
+ var _$L = _interopRequireDefault(require("../internal/$L"));
14
15
  var _Checkbox = require("../Checkbox");
15
16
  var _Icon = _interopRequireDefault(require("../Icon"));
16
17
  var _Image = _interopRequireDefault(require("../Image"));
@@ -225,15 +226,24 @@ var ImageItemBase = exports.ImageItemBase = (0, _kind["default"])({
225
226
  publicClassNames: ['imageItem', 'caption', 'fullImage', 'horizontal', 'image', 'imageIcon', 'label', 'selected', 'selectionIcon', 'vertical']
226
227
  },
227
228
  computed: {
228
- children: function children(_ref) {
229
- var centered = _ref.centered,
230
- _children = _ref.children,
231
- css = _ref.css,
232
- index = _ref['data-index'],
233
- imageIconComponent = _ref.imageIconComponent,
234
- imageIconSrc = _ref.imageIconSrc,
229
+ 'aria-label': function ariaLabel(_ref) {
230
+ var customAriaLabel = _ref['aria-label'],
231
+ children = _ref.children,
235
232
  label = _ref.label,
236
- orientation = _ref.orientation;
233
+ selected = _ref.selected,
234
+ showSelection = _ref.showSelection;
235
+ var defaultAriaLabel = "".concat(children || '').concat(label ? " ".concat(label) : '');
236
+ return "".concat(customAriaLabel || defaultAriaLabel).concat(selected && showSelection ? ' ' + (0, _$L["default"])('Selected') : '');
237
+ },
238
+ children: function children(_ref2) {
239
+ var centered = _ref2.centered,
240
+ _children = _ref2.children,
241
+ css = _ref2.css,
242
+ index = _ref2['data-index'],
243
+ imageIconComponent = _ref2.imageIconComponent,
244
+ imageIconSrc = _ref2.imageIconSrc,
245
+ label = _ref2.label,
246
+ orientation = _ref2.orientation;
237
247
  var hasImageIcon = imageIconSrc && orientation === 'vertical';
238
248
  if (!hasImageIcon && !_children && !label) return;
239
249
  var alignment = orientation === 'vertical' && centered ? {
@@ -270,23 +280,23 @@ var ImageItemBase = exports.ImageItemBase = (0, _kind["default"])({
270
280
  children: captions
271
281
  }) : captions;
272
282
  },
273
- className: function className(_ref2) {
274
- var children = _ref2.children,
275
- imageIconSrc = _ref2.imageIconSrc,
276
- label = _ref2.label,
277
- orientation = _ref2.orientation,
278
- styler = _ref2.styler,
279
- wideImage = _ref2.wideImage;
283
+ className: function className(_ref3) {
284
+ var children = _ref3.children,
285
+ imageIconSrc = _ref3.imageIconSrc,
286
+ label = _ref3.label,
287
+ orientation = _ref3.orientation,
288
+ styler = _ref3.styler,
289
+ wideImage = _ref3.wideImage;
280
290
  return styler.append({
281
291
  fullImage: orientation === 'vertical' && !children && !label && !imageIconSrc,
282
292
  wideImage: orientation === 'horizontal' && wideImage
283
293
  });
284
294
  },
285
- selectionComponent: function selectionComponent(_ref3) {
286
- var css = _ref3.css,
287
- orientation = _ref3.orientation,
288
- selected = _ref3.selected,
289
- SelectionComponent = _ref3.selectionComponent;
295
+ selectionComponent: function selectionComponent(_ref4) {
296
+ var css = _ref4.css,
297
+ orientation = _ref4.orientation,
298
+ selected = _ref4.selected,
299
+ SelectionComponent = _ref4.selectionComponent;
290
300
  if (SelectionComponent) {
291
301
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(SelectionComponent, {});
292
302
  } else if (orientation === 'vertical') {
@@ -303,23 +313,19 @@ var ImageItemBase = exports.ImageItemBase = (0, _kind["default"])({
303
313
  }
304
314
  }
305
315
  },
306
- render: function render(_ref4) {
307
- var css = _ref4.css,
308
- disabled = _ref4.disabled,
309
- orientation = _ref4.orientation,
310
- SelectionComponent = _ref4.selectionComponent,
311
- showSelection = _ref4.showSelection,
312
- rest = _objectWithoutProperties(_ref4, _excluded);
316
+ render: function render(_ref5) {
317
+ var css = _ref5.css,
318
+ disabled = _ref5.disabled,
319
+ orientation = _ref5.orientation,
320
+ SelectionComponent = _ref5.selectionComponent,
321
+ showSelection = _ref5.showSelection,
322
+ rest = _objectWithoutProperties(_ref5, _excluded);
313
323
  var isSlotBefore = orientation === 'horizontal' && showSelection;
314
324
  delete rest.centered;
315
325
  delete rest.imageIconComponent;
316
326
  delete rest.imageIconSrc;
317
327
  delete rest.label;
318
328
  delete rest.wideImage;
319
- if (showSelection) {
320
- rest['role'] = 'checkbox';
321
- rest['aria-checked'] = rest.selected;
322
- }
323
329
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageItem.ImageItem, _objectSpread(_objectSpread({}, rest), {}, {
324
330
  "aria-disabled": disabled,
325
331
  css: css,
@@ -20,16 +20,16 @@
20
20
  line-height: 1.75rem;
21
21
  }
22
22
  :global(.enact-locale-km) .imageItem .caption {
23
- font-size: 1.125rem;
23
+ font-size: var(--primitive-font-size-54);
24
24
  }
25
25
  :global(.enact-locale-si) .imageItem .caption {
26
- font-size: 1.125rem;
26
+ font-size: var(--primitive-font-size-54);
27
27
  }
28
28
  :global(.enact-locale-th) .imageItem .caption {
29
- font-size: 1.125rem;
29
+ font-size: var(--primitive-font-size-54);
30
30
  }
31
31
  :global(.enact-locale-vi) .imageItem .caption {
32
- font-size: 1.125rem;
32
+ font-size: var(--primitive-font-size-54);
33
33
  }
34
34
  .imageItem .label {
35
35
  font-size: var(--primitive-font-size-48);
@@ -37,20 +37,20 @@
37
37
  line-height: 1.25rem;
38
38
  }
39
39
  :global(.enact-locale-km) .imageItem .label {
40
- font-size: 0.75rem;
40
+ font-size: var(--primitive-font-size-36);
41
41
  }
42
42
  :global(.enact-locale-si) .imageItem .label {
43
- font-size: 0.75rem;
43
+ font-size: var(--primitive-font-size-36);
44
44
  }
45
45
  :global(.enact-locale-th) .imageItem .label {
46
- font-size: 0.75rem;
46
+ font-size: var(--primitive-font-size-36);
47
47
  }
48
48
  :global(.enact-locale-vi) .imageItem .label {
49
- font-size: 0.75rem;
49
+ font-size: var(--primitive-font-size-36);
50
50
  }
51
51
  .imageItem.vertical.fullImage {
52
52
  border-radius: 0;
53
- padding: 1.25rem;
53
+ padding: var(--primitive-spacing-60);
54
54
  }
55
55
  .imageItem.vertical.fullImage .image {
56
56
  transition: transform 200ms ease-in-out, box-shadow 200ms ease-in-out;
@@ -71,7 +71,7 @@
71
71
  }
72
72
  .imageItem.vertical:not(.fullImage) {
73
73
  padding: var(--primitive-spacing-24) var(--primitive-spacing-24) var(--primitive-spacing-30);
74
- margin: 0 0.75rem 0.625rem 0.75rem;
74
+ margin: 0 var(--primitive-spacing-36) var(--primitive-spacing-30) var(--primitive-spacing-36);
75
75
  }
76
76
  .imageItem.vertical .selectionContainer {
77
77
  background-color: transparent;
@@ -123,9 +123,9 @@
123
123
  height: 1.375rem;
124
124
  }
125
125
  .imageItem.horizontal {
126
- padding: 0.625rem 1rem;
126
+ padding: var(--primitive-spacing-30) 1rem;
127
127
  align-items: center;
128
- margin: 0 0.75rem 0.625rem 0.75rem;
128
+ margin: 0 var(--primitive-spacing-36) var(--primitive-spacing-30) var(--primitive-spacing-36);
129
129
  }
130
130
  .imageItem.horizontal .image {
131
131
  width: 3.75rem;
@@ -180,7 +180,7 @@
180
180
  border-color: color(from var(--semantic-color-on-surface-main-selected) srgb r g b / 0.7);
181
181
  }
182
182
  .imageItem:global(.neutral).selected.vertical .selectionIcon {
183
- background-color: var(--semantic-color-surface-accent);
183
+ background-color: var(--semantic-color-surface-highlight);
184
184
  color: var(--semantic-color-on-surface-white);
185
185
  }
186
186
  .imageItem:global(.neutral).vertical.fullImage .selectionContainer::after {
@@ -248,7 +248,7 @@
248
248
  }
249
249
  :global(.spotlight-input-key) .imageItem:global(.neutral):global(.spottable):focus.vertical.selected .selectionIcon,
250
250
  :global(.spotlight-input-mouse) .imageItem:global(.neutral):global(.spottable):focus.vertical.selected .selectionIcon {
251
- background-color: var(--semantic-color-surface-accent);
251
+ background-color: var(--semantic-color-surface-highlight);
252
252
  color: var(--semantic-color-on-surface-white);
253
253
  }
254
254
  :global(.spotlight-input-touch) .imageItem:global(.neutral):global(.spottable):active {
@@ -284,7 +284,7 @@
284
284
  box-shadow: 0 0.75rem 0.75rem color(from var(--semantic-color-on-background-black) srgb r g b / 0.35);
285
285
  }
286
286
  :global(.spotlight-input-touch) .imageItem:global(.neutral):global(.spottable):active.vertical.selected .selectionIcon {
287
- background-color: var(--semantic-color-surface-accent);
287
+ background-color: var(--semantic-color-surface-highlight);
288
288
  color: var(--semantic-color-on-surface-white);
289
289
  }
290
290
  :global(.noAnimation) .imageItem:global(.neutral).vertical.fullImage .image {
@@ -332,7 +332,7 @@
332
332
  border-color: color(from var(--semantic-color-on-surface-main-selected) srgb r g b / 0.7);
333
333
  }
334
334
  :global(.enact-a11y-high-contrast) .imageItem:global(.neutral):global(.highContrast).selected.vertical .selectionIcon {
335
- background-color: var(--semantic-color-surface-accent);
335
+ background-color: var(--semantic-color-surface-highlight);
336
336
  color: var(--semantic-color-on-surface-white);
337
337
  }
338
338
  :global(.enact-a11y-high-contrast) .imageItem:global(.neutral):global(.highContrast).vertical.fullImage .selectionContainer::after {
@@ -400,7 +400,7 @@
400
400
  }
401
401
  :global(.spotlight-input-key) :global(.enact-a11y-high-contrast) .imageItem:global(.neutral):global(.highContrast):global(.spottable):focus.vertical.selected .selectionIcon,
402
402
  :global(.spotlight-input-mouse) :global(.enact-a11y-high-contrast) .imageItem:global(.neutral):global(.highContrast):global(.spottable):focus.vertical.selected .selectionIcon {
403
- background-color: var(--semantic-color-surface-accent);
403
+ background-color: var(--semantic-color-surface-highlight);
404
404
  color: var(--semantic-color-on-surface-white);
405
405
  }
406
406
  :global(.spotlight-input-touch) :global(.enact-a11y-high-contrast) .imageItem:global(.neutral):global(.highContrast):global(.spottable):active {
@@ -436,7 +436,7 @@
436
436
  box-shadow: 0 0.75rem 0.75rem color(from var(--semantic-color-on-background-black) srgb r g b / 0.35);
437
437
  }
438
438
  :global(.spotlight-input-touch) :global(.enact-a11y-high-contrast) .imageItem:global(.neutral):global(.highContrast):global(.spottable):active.vertical.selected .selectionIcon {
439
- background-color: var(--semantic-color-surface-accent);
439
+ background-color: var(--semantic-color-surface-highlight);
440
440
  color: var(--semantic-color-on-surface-white);
441
441
  }
442
442
  :global(.noAnimation) :global(.enact-a11y-high-contrast) .imageItem:global(.neutral):global(.highContrast).vertical.fullImage .image {
@@ -484,7 +484,7 @@
484
484
  border-color: color(from var(--semantic-color-on-surface-main-selected) srgb r g b / 0.7);
485
485
  }
486
486
  .imageItem:global(.light).selected.vertical .selectionIcon {
487
- background-color: var(--semantic-color-surface-accent);
487
+ background-color: var(--semantic-color-surface-highlight);
488
488
  color: var(--semantic-color-on-surface-white);
489
489
  }
490
490
  .imageItem:global(.light).vertical.fullImage .selectionContainer::after {
@@ -552,7 +552,7 @@
552
552
  }
553
553
  :global(.spotlight-input-key) .imageItem:global(.light):global(.spottable):focus.vertical.selected .selectionIcon,
554
554
  :global(.spotlight-input-mouse) .imageItem:global(.light):global(.spottable):focus.vertical.selected .selectionIcon {
555
- background-color: var(--semantic-color-surface-accent);
555
+ background-color: var(--semantic-color-surface-highlight);
556
556
  color: var(--semantic-color-on-surface-white);
557
557
  }
558
558
  :global(.spotlight-input-touch) .imageItem:global(.light):global(.spottable):active {
@@ -588,7 +588,7 @@
588
588
  box-shadow: 0 0.75rem 0.75rem color(from var(--semantic-color-on-background-black) srgb r g b / 0.35);
589
589
  }
590
590
  :global(.spotlight-input-touch) .imageItem:global(.light):global(.spottable):active.vertical.selected .selectionIcon {
591
- background-color: var(--semantic-color-surface-accent);
591
+ background-color: var(--semantic-color-surface-highlight);
592
592
  color: var(--semantic-color-on-surface-white);
593
593
  }
594
594
  :global(.noAnimation) .imageItem:global(.light).vertical.fullImage .image {
@@ -641,7 +641,7 @@
641
641
  border-color: color(from var(--semantic-color-on-surface-main-selected) srgb r g b / 0.7);
642
642
  }
643
643
  .imageItem:global(.game).selected.vertical .selectionIcon {
644
- background-color: var(--semantic-color-surface-accent);
644
+ background-color: var(--semantic-color-surface-highlight);
645
645
  color: var(--semantic-color-on-surface-white);
646
646
  }
647
647
  .imageItem:global(.game).vertical.fullImage .selectionContainer::after {
@@ -709,7 +709,7 @@
709
709
  }
710
710
  :global(.spotlight-input-key) .imageItem:global(.game):global(.spottable):focus.vertical.selected .selectionIcon,
711
711
  :global(.spotlight-input-mouse) .imageItem:global(.game):global(.spottable):focus.vertical.selected .selectionIcon {
712
- background-color: var(--semantic-color-surface-accent);
712
+ background-color: var(--semantic-color-surface-highlight);
713
713
  color: var(--semantic-color-on-surface-white);
714
714
  }
715
715
  :global(.spotlight-input-touch) .imageItem:global(.game):global(.spottable):active {
@@ -745,7 +745,7 @@
745
745
  box-shadow: 0 0.75rem 0.75rem color(from var(--semantic-color-on-background-black) srgb r g b / 0.35);
746
746
  }
747
747
  :global(.spotlight-input-touch) .imageItem:global(.game):global(.spottable):active.vertical.selected .selectionIcon {
748
- background-color: var(--semantic-color-surface-accent);
748
+ background-color: var(--semantic-color-surface-highlight);
749
749
  color: var(--semantic-color-on-surface-white);
750
750
  }
751
751
  :global(.noAnimation) .imageItem:global(.game).vertical.fullImage .image {
@@ -797,7 +797,7 @@
797
797
  border-color: color(from var(--semantic-color-on-surface-main-selected) srgb r g b / 0.7);
798
798
  }
799
799
  :global(.green) .imageItem:global(.game).selected.vertical .selectionIcon {
800
- background-color: var(--semantic-color-surface-accent);
800
+ background-color: var(--semantic-color-surface-highlight);
801
801
  color: var(--semantic-color-on-surface-white);
802
802
  }
803
803
  :global(.green) .imageItem:global(.game).vertical.fullImage .selectionContainer::after {
@@ -865,7 +865,7 @@
865
865
  }
866
866
  :global(.spotlight-input-key) :global(.green) .imageItem:global(.game):global(.spottable):focus.vertical.selected .selectionIcon,
867
867
  :global(.spotlight-input-mouse) :global(.green) .imageItem:global(.game):global(.spottable):focus.vertical.selected .selectionIcon {
868
- background-color: var(--semantic-color-surface-accent);
868
+ background-color: var(--semantic-color-surface-highlight);
869
869
  color: var(--semantic-color-on-surface-white);
870
870
  }
871
871
  :global(.spotlight-input-touch) :global(.green) .imageItem:global(.game):global(.spottable):active {
@@ -901,7 +901,7 @@
901
901
  box-shadow: 0 0.75rem 0.75rem color(from var(--semantic-color-on-background-black) srgb r g b / 0.35);
902
902
  }
903
903
  :global(.spotlight-input-touch) :global(.green) .imageItem:global(.game):global(.spottable):active.vertical.selected .selectionIcon {
904
- background-color: var(--semantic-color-surface-accent);
904
+ background-color: var(--semantic-color-surface-highlight);
905
905
  color: var(--semantic-color-on-surface-white);
906
906
  }
907
907
  :global(.noAnimation) :global(.green) .imageItem:global(.game).vertical.fullImage .image {
@@ -953,7 +953,7 @@
953
953
  border-color: color(from var(--semantic-color-on-surface-main-selected) srgb r g b / 0.7);
954
954
  }
955
955
  :global(.orange) .imageItem:global(.game).selected.vertical .selectionIcon {
956
- background-color: var(--semantic-color-surface-accent);
956
+ background-color: var(--semantic-color-surface-highlight);
957
957
  color: var(--semantic-color-on-surface-white);
958
958
  }
959
959
  :global(.orange) .imageItem:global(.game).vertical.fullImage .selectionContainer::after {
@@ -1021,7 +1021,7 @@
1021
1021
  }
1022
1022
  :global(.spotlight-input-key) :global(.orange) .imageItem:global(.game):global(.spottable):focus.vertical.selected .selectionIcon,
1023
1023
  :global(.spotlight-input-mouse) :global(.orange) .imageItem:global(.game):global(.spottable):focus.vertical.selected .selectionIcon {
1024
- background-color: var(--semantic-color-surface-accent);
1024
+ background-color: var(--semantic-color-surface-highlight);
1025
1025
  color: var(--semantic-color-on-surface-white);
1026
1026
  }
1027
1027
  :global(.spotlight-input-touch) :global(.orange) .imageItem:global(.game):global(.spottable):active {
@@ -1057,7 +1057,7 @@
1057
1057
  box-shadow: 0 0.75rem 0.75rem color(from var(--semantic-color-on-background-black) srgb r g b / 0.35);
1058
1058
  }
1059
1059
  :global(.spotlight-input-touch) :global(.orange) .imageItem:global(.game):global(.spottable):active.vertical.selected .selectionIcon {
1060
- background-color: var(--semantic-color-surface-accent);
1060
+ background-color: var(--semantic-color-surface-highlight);
1061
1061
  color: var(--semantic-color-on-surface-white);
1062
1062
  }
1063
1063
  :global(.noAnimation) :global(.orange) .imageItem:global(.game).vertical.fullImage .image {
@@ -169,20 +169,13 @@ describe('ImageItem', function () {
169
169
  var actual = _react.screen.getAllByRole('img')[0].children.item(0);
170
170
  expect(actual).toHaveClass(expected);
171
171
  });
172
- test('should have `checkbox` role when `showSelection` is true', function () {
173
- (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageItem.ImageItemBase, {
174
- showSelection: true
175
- }));
176
- var actual = _react.screen.getByRole('checkbox');
177
- expect(actual).toBeInTheDocument();
178
- });
179
- test('should be `checked` when `showSelection` and `selected` props are true', function () {
172
+ test('should have "Selected" in `aria-label` when `showSelection` and `selected` is true', function () {
180
173
  (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageItem.ImageItemBase, {
181
174
  selected: true,
182
175
  showSelection: true
183
176
  }));
184
- var actual = _react.screen.getByRole('checkbox');
185
- expect(actual).toBeChecked();
177
+ var actual = _react.screen.getByLabelText('Selected');
178
+ expect(actual).toBeInTheDocument();
186
179
  });
187
180
  test('should support `wideImage` prop', function () {
188
181
  (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageItem.ImageItemBase, {