@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
@@ -0,0 +1,21 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - develop
7
+ - master
8
+ pull_request:
9
+ types: [opened, synchronize, reopened]
10
+ workflow_dispatch:
11
+
12
+ concurrency:
13
+ group: ci-branch-${{ github.event.pull_request.number || github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ branch:
18
+ uses: ./.github/workflows/ci-reusable.yml
19
+ with:
20
+ checkout-ref: ${{ github.event.pull_request.head.sha || github.sha }}
21
+ secrets: inherit
@@ -0,0 +1,16 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, synchronize, reopened]
6
+
7
+ concurrency:
8
+ group: ci-pr-${{ github.event.pull_request.number }}
9
+ cancel-in-progress: true
10
+
11
+ jobs:
12
+ pull-request:
13
+ uses: ./.github/workflows/ci-reusable.yml
14
+ with:
15
+ checkout-ref: ''
16
+ secrets: inherit
@@ -0,0 +1,73 @@
1
+ name: CI Pipeline
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ checkout-ref:
7
+ description: 'Git ref to checkout (empty for default merge commit)'
8
+ type: string
9
+ required: false
10
+ default: ''
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+
16
+ strategy:
17
+ matrix:
18
+ node-version: ['lts/*', 'node']
19
+
20
+ steps:
21
+ - name: Checkout code
22
+ uses: actions/checkout@v4
23
+ with:
24
+ ref: ${{ inputs.checkout-ref || github.ref }}
25
+
26
+ - name: Setup Node.js
27
+ uses: actions/setup-node@v4
28
+ with:
29
+ node-version: ${{ matrix.node-version }}
30
+
31
+ - name: Install system dependencies
32
+ run: |
33
+ sudo apt-get update
34
+ sudo apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
35
+
36
+ - name: Clone and setup Enact CLI
37
+ run: |
38
+ git clone --branch=develop --depth 1 https://github.com/enactjs/cli ../cli
39
+ pushd ../cli
40
+ npm install
41
+ npm link
42
+ popd
43
+
44
+ - name: Clone and setup Enact framework
45
+ run: |
46
+ git clone --branch=develop --depth 1 https://github.com/enactjs/enact ../enact
47
+ pushd ../enact
48
+ npm install
49
+ npm run lerna exec -- --ignore enact-sampler --concurrency 1 -- npm --no-package-lock install
50
+ npm run lerna exec -- --ignore enact-sampler --concurrency 1 -- npm --no-package-lock link
51
+ npm run interlink
52
+ popd
53
+
54
+ - name: Install project dependencies
55
+ run: |
56
+ rm -fr node_modules/@enact
57
+ npm install
58
+ enact link
59
+
60
+ - name: Run tests with coverage
61
+ run: npm test -- --runInBand --coverage
62
+
63
+ - name: Upload coverage to Codecov
64
+ uses: codecov/codecov-action@v5
65
+ with:
66
+ token: ${{ secrets.CODECOV_TOKEN }}
67
+ fail_ci_if_error: false
68
+
69
+ - name: Run ESLint
70
+ run: npm run lint -- -- --report-unused-disable-directives --max-warnings 0 .
71
+
72
+ - name: Validate documentation
73
+ run: npm run validate-docs
@@ -47,14 +47,15 @@ export class ActionGuideBase extends React.Component<
47
47
  Merge<React.HTMLProps<HTMLElement>, ActionGuideBaseProps>
48
48
  > {}
49
49
 
50
- export interface ActionGuideDecoratorProps
51
- extends limestone_Skinnable_SkinnableProps {}
50
+ export interface ActionGuideDecoratorProps extends limestone_Skinnable_SkinnableProps {}
52
51
  export function ActionGuideDecorator<P>(
53
52
  Component: React.ComponentType<P> | string,
54
53
  ): React.ComponentType<P & ActionGuideDecoratorProps>;
55
54
 
56
- export interface ActionGuideProps
57
- extends Merge<ActionGuideBaseProps, ActionGuideDecoratorProps> {}
55
+ export interface ActionGuideProps extends Merge<
56
+ ActionGuideBaseProps,
57
+ ActionGuideDecoratorProps
58
+ > {}
58
59
  /**
59
60
  * An Action Guide component, ready to use in Limestone applications.
60
61
  *
@@ -6,7 +6,7 @@
6
6
  padding: var(--primitive-spacing-12) 0 var(--primitive-spacing-36) 0;
7
7
  }
8
8
  .actionGuide .button {
9
- margin: 0 0 -0.25rem 0;
9
+ margin: 0 0 calc( var(--primitive-spacing-12) * -1) 0;
10
10
  height: 1.75rem;
11
11
  min-width: 1.75rem;
12
12
  width: 1.75rem;
package/Alert/Alert.d.ts CHANGED
@@ -32,6 +32,15 @@ export class AlertImage extends React.Component<
32
32
  > {}
33
33
 
34
34
  export interface AlertBaseProps {
35
+ /**
36
+ * Sets the buttons layout direction.
37
+ *
38
+ * In `auto` mode, button direction follows UX defaults:
39
+ * * `overlay` - horizontal when there are exactly 2 buttons
40
+ * * `fullscreen` - horizontal when there are less than 3 buttons
41
+ * * otherwise vertical
42
+ */
43
+ buttonDirection?: "auto" | "horizontal" | "vertical";
35
44
  /**
36
45
  * Buttons to be included under the component.
37
46
  *
@@ -119,8 +128,10 @@ export class AlertBase extends React.Component<
119
128
  Merge<React.HTMLProps<HTMLElement>, AlertBaseProps>
120
129
  > {}
121
130
 
122
- export interface AlertProps
123
- extends Merge<AlertBaseProps, ui_Slottable_SlottableProps> {}
131
+ export interface AlertProps extends Merge<
132
+ AlertBaseProps,
133
+ ui_Slottable_SlottableProps
134
+ > {}
124
135
  /**
125
136
  * A modal Alert component, ready to use in Limestone applications.
126
137
  *
package/Alert/Alert.js CHANGED
@@ -17,13 +17,14 @@ var _IdProvider = _interopRequireDefault(require("@enact/ui/internal/IdProvider"
17
17
  var _Layout = _interopRequireWildcard(require("@enact/ui/Layout"));
18
18
  var _Slottable = _interopRequireDefault(require("@enact/ui/Slottable"));
19
19
  var _propTypes = _interopRequireDefault(require("prop-types"));
20
+ var _react = require("react");
20
21
  var _BodyText = _interopRequireDefault(require("../BodyText"));
21
22
  var _Heading = _interopRequireDefault(require("../Heading"));
22
23
  var _Popup = _interopRequireDefault(require("../Popup"));
23
24
  var _AlertImage = _interopRequireDefault(require("./AlertImage"));
24
25
  var _AlertModule = _interopRequireDefault(require("./Alert.module.css"));
25
26
  var _jsxRuntime = require("react/jsx-runtime");
26
- var _excluded = ["buttons", "contentComponent", "children", "css", "id", "image", "overlayPosition", "title", "type"];
27
+ var _excluded = ["buttonDirection", "buttons", "contentComponent", "children", "css", "id", "image", "overlayPosition", "title", "type", "style"];
27
28
  /**
28
29
  * Limestone styled modal Alert components.
29
30
  *
@@ -55,6 +56,19 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
55
56
  var AlertBase = exports.AlertBase = (0, _kind["default"])({
56
57
  name: 'Alert',
57
58
  propTypes: /** @lends limestone/Alert.AlertBase.prototype */{
59
+ /**
60
+ * Sets the buttons layout direction.
61
+ *
62
+ * In `auto` mode, button direction follows UX defaults:
63
+ * * `overlay` - horizontal when there are exactly 2 buttons
64
+ * * `fullscreen` - horizontal when there are less than 3 buttons
65
+ * * otherwise vertical
66
+ *
67
+ * @type {('auto'|'horizontal'|'vertical')}
68
+ * @default 'auto'
69
+ * @public
70
+ */
71
+ buttonDirection: _propTypes["default"].oneOf(['auto', 'horizontal', 'vertical']),
58
72
  /**
59
73
  * Buttons to be included under the component.
60
74
  *
@@ -170,6 +184,7 @@ var AlertBase = exports.AlertBase = (0, _kind["default"])({
170
184
  type: _propTypes["default"].oneOf(['fullscreen', 'overlay'])
171
185
  },
172
186
  defaultProps: {
187
+ buttonDirection: 'auto',
173
188
  open: false,
174
189
  overlayPosition: 'center',
175
190
  type: 'fullscreen'
@@ -187,7 +202,9 @@ var AlertBase = exports.AlertBase = (0, _kind["default"])({
187
202
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
188
203
  className: css.buttonCell,
189
204
  shrink: true,
190
- children: button
205
+ children: /*#__PURE__*/(0, _react.cloneElement)(button, {
206
+ css: css
207
+ })
191
208
  }, "button".concat(index));
192
209
  }) || null;
193
210
  },
@@ -209,7 +226,8 @@ var AlertBase = exports.AlertBase = (0, _kind["default"])({
209
226
  }
210
227
  },
211
228
  render: function render(_ref4) {
212
- var buttons = _ref4.buttons,
229
+ var buttonDirection = _ref4.buttonDirection,
230
+ buttons = _ref4.buttons,
213
231
  contentComponent = _ref4.contentComponent,
214
232
  children = _ref4.children,
215
233
  css = _ref4.css,
@@ -218,10 +236,25 @@ var AlertBase = exports.AlertBase = (0, _kind["default"])({
218
236
  overlayPosition = _ref4.overlayPosition,
219
237
  title = _ref4.title,
220
238
  type = _ref4.type,
239
+ style = _ref4.style,
221
240
  rest = _objectWithoutProperties(_ref4, _excluded);
222
241
  var fullscreen = type === 'fullscreen';
223
242
  var position = type === 'overlay' ? overlayPosition : type;
224
243
  var showTitle = fullscreen && title;
244
+ var buttonCount = _react.Children.toArray(buttons).filter(Boolean).length;
245
+ var resolvedButtonDirection = buttonDirection;
246
+ if (buttonDirection === 'auto') {
247
+ var useHorizontal = type === 'overlay' && buttonCount === 2 || type === 'fullscreen' && buttonCount < 3;
248
+ resolvedButtonDirection = useHorizontal ? 'horizontal' : 'vertical';
249
+ }
250
+ var overlayHorizontalButtons = type === 'overlay' && resolvedButtonDirection === 'horizontal';
251
+ var popupStyle = style;
252
+ if (overlayHorizontalButtons) {
253
+ var overlayHorizontalButtonCount = Math.max(1, Math.min(buttonCount, 4));
254
+ popupStyle = _objectSpread(_objectSpread({}, style), {}, {
255
+ '--alert-overlay-horizontal-button-count': overlayHorizontalButtonCount
256
+ });
257
+ }
225
258
  var ariaLabelledBy = (showTitle ? "".concat(id, "_title ") : '') + "".concat(id, "_content ").concat(id, "_buttons");
226
259
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
227
260
  "aria-owns": id,
@@ -232,6 +265,7 @@ var AlertBase = exports.AlertBase = (0, _kind["default"])({
232
265
  "aria-labelledby": ariaLabelledBy,
233
266
  css: css,
234
267
  position: position,
268
+ style: popupStyle,
235
269
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Layout["default"], {
236
270
  align: "center center",
237
271
  orientation: "vertical",
@@ -259,8 +293,8 @@ var AlertBase = exports.AlertBase = (0, _kind["default"])({
259
293
  shrink: true,
260
294
  className: css.buttonContainer,
261
295
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout["default"], {
262
- align: "center",
263
- orientation: "vertical",
296
+ align: "center center",
297
+ orientation: resolvedButtonDirection,
264
298
  id: "".concat(id, "_buttons"),
265
299
  children: buttons
266
300
  })
@@ -40,6 +40,7 @@
40
40
  .alert.overlay .buttonContainer {
41
41
  box-sizing: border-box;
42
42
  margin-top: var(--primitive-spacing-36);
43
+ padding: 0 var(--primitive-spacing-84);
43
44
  }
44
45
  .alert.overlay .content {
45
46
  align-self: stretch;
@@ -52,6 +53,7 @@
52
53
  word-break: keep-all;
53
54
  padding: 0 var(--primitive-spacing-84);
54
55
  margin: 0;
56
+ max-width: var(--alert-overlay-content-max-width, 23.5rem);
55
57
  }
56
58
  :global(.enact-locale-non-latin) .alert.overlay .content {
57
59
  font-family: "Limestone";
@@ -77,7 +79,16 @@
77
79
  word-break: normal;
78
80
  }
79
81
  .popup.overlay {
80
- width: 23.5rem;
82
+ box-sizing: border-box;
83
+ --alert-overlay-horizontal-button-count: 1;
84
+ --alert-overlay-horizontal-button-width: NaNrem + (2 * var(--primitive-spacing-36)));
85
+ --alert-overlay-horizontal-buttons-total-width: calc(var(--alert-overlay-horizontal-button-width) * var(--alert-overlay-horizontal-button-count));
86
+ --alert-overlay-width: max(1128px, var(--alert-overlay-horizontal-buttons-total-width));
87
+ --alert-overlay-content-horizontal-padding: var(--primitive-spacing-84);
88
+ --alert-overlay-content-max-width: calc(var(--alert-overlay-width) - (2 * var(--alert-overlay-content-horizontal-padding)));
89
+ width: var(--alert-overlay-width);
90
+ min-width: 23.5rem;
91
+ max-width: calc(100vw - 2 * var(--primitive-spacing-60));
81
92
  margin-left: auto;
82
93
  margin-right: auto;
83
94
  }
@@ -101,6 +112,12 @@
101
112
  :global(.noAnimation) .popup:global(.neutral).overlay {
102
113
  box-shadow: none;
103
114
  }
115
+ :has(:global(.highContrast)) .popup:global(.neutral).overlay {
116
+ outline-style: solid;
117
+ }
118
+ .popup:global(.neutral).overlay .button .bg {
119
+ background-color: var(--semantic-color-surface-popup-default);
120
+ }
104
121
  :global(.enact-a11y-high-contrast) .popup:global(.neutral):global(.highContrast) {
105
122
  background-color: var(--semantic-color-background-full-default);
106
123
  }
@@ -117,6 +134,12 @@
117
134
  :global(.noAnimation) :global(.enact-a11y-high-contrast) .popup:global(.neutral):global(.highContrast).overlay {
118
135
  box-shadow: none;
119
136
  }
137
+ :has(:global(.highContrast)) :global(.enact-a11y-high-contrast) .popup:global(.neutral):global(.highContrast).overlay {
138
+ outline-style: solid;
139
+ }
140
+ :global(.enact-a11y-high-contrast) .popup:global(.neutral):global(.highContrast).overlay .button .bg {
141
+ background-color: var(--semantic-color-surface-popup-default);
142
+ }
120
143
  .popup:global(.light) {
121
144
  background-color: var(--semantic-color-background-full-default);
122
145
  }
@@ -133,6 +156,12 @@
133
156
  :global(.noAnimation) .popup:global(.light).overlay {
134
157
  box-shadow: none;
135
158
  }
159
+ :has(:global(.highContrast)) .popup:global(.light).overlay {
160
+ outline-style: solid;
161
+ }
162
+ .popup:global(.light).overlay .button .bg {
163
+ background-color: var(--semantic-color-surface-popup-default);
164
+ }
136
165
  .popup:global(.game) {
137
166
  --semantic-color-surface-default: #2d224c;
138
167
  --semantic-color-surface-default-focused: #6d2fa1;
@@ -152,6 +181,12 @@
152
181
  :global(.noAnimation) .popup:global(.game).overlay {
153
182
  box-shadow: none;
154
183
  }
184
+ :has(:global(.highContrast)) .popup:global(.game).overlay {
185
+ outline-style: solid;
186
+ }
187
+ .popup:global(.game).overlay .button .bg {
188
+ background-color: var(--semantic-color-surface-popup-default);
189
+ }
155
190
  :global(.green) .popup:global(.game) {
156
191
  --semantic-color-surface-default: #1F2C24;
157
192
  --semantic-color-surface-default-focused: #3ea07d;
@@ -170,6 +205,12 @@
170
205
  :global(.noAnimation) :global(.green) .popup:global(.game).overlay {
171
206
  box-shadow: none;
172
207
  }
208
+ :has(:global(.highContrast)) :global(.green) .popup:global(.game).overlay {
209
+ outline-style: solid;
210
+ }
211
+ :global(.green) .popup:global(.game).overlay .button .bg {
212
+ background-color: var(--semantic-color-surface-popup-default);
213
+ }
173
214
  :global(.orange) .popup:global(.game) {
174
215
  --semantic-color-surface-default: #422923;
175
216
  --semantic-color-surface-default-focused: #b85f23;
@@ -188,3 +229,9 @@
188
229
  :global(.noAnimation) :global(.orange) .popup:global(.game).overlay {
189
230
  box-shadow: none;
190
231
  }
232
+ :has(:global(.highContrast)) :global(.orange) .popup:global(.game).overlay {
233
+ outline-style: solid;
234
+ }
235
+ :global(.orange) .popup:global(.game).overlay .button .bg {
236
+ background-color: var(--semantic-color-surface-popup-default);
237
+ }
@@ -102,6 +102,60 @@ describe('Alert', function () {
102
102
  var expectedClass = 'thumbnail';
103
103
  expect(image).toHaveClass(expectedClass);
104
104
  });
105
+ test('should align buttons horizontally by default in fullscreen when button count is less than 3', function () {
106
+ (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(FloatingLayerController, {
107
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.Alert, {
108
+ open: true,
109
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("buttons", {
110
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
111
+ children: "yes"
112
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
113
+ children: "no"
114
+ })]
115
+ })
116
+ })
117
+ }));
118
+ var alert = _react.screen.getByRole('alert');
119
+ var buttonsLayout = alert.querySelector('[id$="_buttons"]');
120
+ expect(buttonsLayout).toHaveClass('horizontal');
121
+ });
122
+ test('should align buttons vertically by default in fullscreen when button count is 3', function () {
123
+ (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(FloatingLayerController, {
124
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.Alert, {
125
+ open: true,
126
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("buttons", {
127
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
128
+ children: "yes"
129
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
130
+ children: "no"
131
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
132
+ children: "later"
133
+ })]
134
+ })
135
+ })
136
+ }));
137
+ var alert = _react.screen.getByRole('alert');
138
+ var buttonsLayout = alert.querySelector('[id$="_buttons"]');
139
+ expect(buttonsLayout).toHaveClass('vertical');
140
+ });
141
+ test('should allow overriding button direction to vertical', function () {
142
+ (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(FloatingLayerController, {
143
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.Alert, {
144
+ open: true,
145
+ buttonDirection: "vertical",
146
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("buttons", {
147
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
148
+ children: "yes"
149
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
150
+ children: "no"
151
+ })]
152
+ })
153
+ })
154
+ }));
155
+ var alert = _react.screen.getByRole('alert');
156
+ var buttonsLayout = alert.querySelector('[id$="_buttons"]');
157
+ expect(buttonsLayout).toHaveClass('vertical');
158
+ });
105
159
  });
106
160
  describe('AlertOverlay specs', function () {
107
161
  test('should be rendered opened if open is set to true', function () {
@@ -201,4 +255,41 @@ describe('AlertOverlay specs', function () {
201
255
  var expectedClass = 'thumbnail';
202
256
  expect(image).toHaveClass(expectedClass);
203
257
  });
258
+ test('should align buttons horizontally by default in overlay when button count is 2', function () {
259
+ (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(FloatingLayerController, {
260
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.Alert, {
261
+ open: true,
262
+ type: "overlay",
263
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("buttons", {
264
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
265
+ size: "small",
266
+ children: "yes"
267
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
268
+ size: "small",
269
+ children: "no"
270
+ })]
271
+ })
272
+ })
273
+ }));
274
+ var alert = _react.screen.getByRole('alert');
275
+ var buttonsLayout = alert.querySelector('[id$="_buttons"]');
276
+ expect(buttonsLayout).toHaveClass('horizontal');
277
+ });
278
+ test('should align buttons vertically by default in overlay when button count is not 2', function () {
279
+ (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(FloatingLayerController, {
280
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.Alert, {
281
+ open: true,
282
+ type: "overlay",
283
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("buttons", {
284
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
285
+ size: "small",
286
+ children: "yes"
287
+ })
288
+ })
289
+ })
290
+ }));
291
+ var alert = _react.screen.getByRole('alert');
292
+ var buttonsLayout = alert.querySelector('[id$="_buttons"]');
293
+ expect(buttonsLayout).toHaveClass('vertical');
294
+ });
204
295
  });
@@ -45,14 +45,15 @@ export class BodyTextBase extends React.Component<
45
45
  Merge<React.HTMLProps<HTMLElement>, BodyTextBaseProps>
46
46
  > {}
47
47
 
48
- export interface BodyTextDecoratorProps
49
- extends limestone_Skinnable_SkinnableProps {}
48
+ export interface BodyTextDecoratorProps extends limestone_Skinnable_SkinnableProps {}
50
49
  export function BodyTextDecorator<P>(
51
50
  Component: React.ComponentType<P> | string,
52
51
  ): React.ComponentType<P & BodyTextDecoratorProps>;
53
52
 
54
- export interface BodyTextProps
55
- extends Merge<BodyTextBaseProps, BodyTextDecoratorProps> {}
53
+ export interface BodyTextProps extends Merge<
54
+ BodyTextBaseProps,
55
+ BodyTextDecoratorProps
56
+ > {}
56
57
  /**
57
58
  * A simple text block component, ready to use in Limestone applications.
58
59
  *
@@ -4,7 +4,7 @@
4
4
  font-style: normal;
5
5
  font-family: "Limestone";
6
6
  line-height: 1.4em;
7
- margin: 0 0.75rem var(--primitive-font-size-60) 0.75rem;
7
+ margin: 0 var(--primitive-spacing-36) var(--primitive-font-size-60) var(--primitive-spacing-36);
8
8
  padding: 0;
9
9
  white-space: normal;
10
10
  }
@@ -14,7 +14,7 @@
14
14
  :global(.enact-locale-non-latin) .bodyText {
15
15
  font-family: "Limestone";
16
16
  font-weight: var(--primitive-font-weight-light);
17
- font-size: 1.125rem;
17
+ font-size: var(--primitive-font-size-54);
18
18
  font-style: normal;
19
19
  }
20
20
  :global(.enact-locale-km) .bodyText {
@@ -65,19 +65,19 @@
65
65
  line-height: 1.7em;
66
66
  }
67
67
  :global(.enact-locale-km) .bodyText.small {
68
- font-size: 1rem;
68
+ font-size: var(--primitive-font-size-48);
69
69
  }
70
70
  :global(.enact-locale-si) .bodyText.small {
71
- font-size: 1rem;
71
+ font-size: var(--primitive-font-size-48);
72
72
  }
73
73
  :global(.enact-locale-th) .bodyText.small {
74
- font-size: 1rem;
74
+ font-size: var(--primitive-font-size-48);
75
75
  }
76
76
  :global(.enact-locale-vi) .bodyText.small {
77
- font-size: 1rem;
77
+ font-size: var(--primitive-font-size-48);
78
78
  }
79
79
  :global(.enact-locale-non-latin) .bodyText.small {
80
- font-size: 1rem;
80
+ font-size: var(--primitive-font-size-48);
81
81
  line-height: 1.375rem;
82
82
  }
83
83
  :global(.enact-locale-right-to-left) .bodyText {
@@ -53,6 +53,10 @@ corresponding internal elements and states of this component.
53
53
  * * `small` - Applied to a `size='small'` button
54
54
  */
55
55
  css?: object;
56
+ /**
57
+ * Set the visual effect applied to the button when focused.
58
+ */
59
+ focusEffect?: "expand" | "static";
56
60
  /**
57
61
  * Specifies on which side ( `'before'` or `'after'` ) of the text the icon appears.
58
62
  */
@@ -89,26 +93,27 @@ export class ButtonBase extends React.Component<
89
93
  Merge<React.HTMLProps<HTMLElement>, ButtonBaseProps>
90
94
  > {}
91
95
 
92
- export interface ButtonDecoratorProps
93
- extends Merge<
96
+ export interface ButtonDecoratorProps extends Merge<
97
+ Merge<
94
98
  Merge<
95
99
  Merge<
96
- Merge<
97
- limestone_TooltipDecorator_TooltipDecoratorProps,
98
- limestone_Marquee_MarqueeDecoratorProps
99
- >,
100
- ui_Button_ButtonDecoratorProps
100
+ limestone_TooltipDecorator_TooltipDecoratorProps,
101
+ limestone_Marquee_MarqueeDecoratorProps
101
102
  >,
102
- spotlight_Spottable_SpottableProps
103
+ ui_Button_ButtonDecoratorProps
103
104
  >,
104
- limestone_Skinnable_SkinnableProps
105
- > {}
105
+ spotlight_Spottable_SpottableProps
106
+ >,
107
+ limestone_Skinnable_SkinnableProps
108
+ > {}
106
109
  export function ButtonDecorator<P>(
107
110
  Component: React.ComponentType<P> | string,
108
111
  ): React.ComponentType<P & ButtonDecoratorProps>;
109
112
 
110
- export interface ButtonProps
111
- extends Merge<ButtonBaseProps, ButtonDecoratorProps> {}
113
+ export interface ButtonProps extends Merge<
114
+ ButtonBaseProps,
115
+ ButtonDecoratorProps
116
+ > {}
112
117
  /**
113
118
  * A button component, ready to use in Limestone applications.
114
119
  *
package/Button/Button.js CHANGED
@@ -148,7 +148,7 @@ var ButtonBase = exports.ButtonBase = (0, _kind["default"])({
148
148
  *
149
149
  * @type {('expand'|'static')}
150
150
  * @default 'expand'
151
- * @private
151
+ * @public
152
152
  */
153
153
  focusEffect: _propTypes2["default"].oneOf(['expand', 'static']),
154
154
  /**