@enact/limestone 1.3.0 → 1.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/.github/workflows/ci-branch.yml +21 -0
  2. package/.github/workflows/ci-pull-request.yml +16 -0
  3. package/.github/workflows/ci-reusable.yml +73 -0
  4. package/ActionGuide/ActionGuide.d.ts +5 -4
  5. package/ActionGuide/ActionGuide.module.css +1 -1
  6. package/Alert/Alert.d.ts +4 -2
  7. package/Alert/Alert.js +4 -1
  8. package/Alert/Alert.module.css +36 -0
  9. package/BodyText/BodyText.d.ts +5 -4
  10. package/BodyText/BodyText.module.css +7 -7
  11. package/Button/Button.d.ts +17 -12
  12. package/Button/Button.js +1 -1
  13. package/Button/Button.module.css +195 -268
  14. package/CHANGELOG.md +226 -0
  15. package/Card/Card.d.ts +36 -8
  16. package/Card/Card.js +157 -20
  17. package/Card/Card.module.css +277 -58
  18. package/Card/tests/Card-specs.js +30 -0
  19. package/Checkbox/Checkbox.d.ts +8 -7
  20. package/Checkbox/Checkbox.js +3 -1
  21. package/Checkbox/Checkbox.module.css +213 -120
  22. package/Checkbox/tests/Checkbox-specs.js +1 -1
  23. package/CheckboxItem/CheckboxItem.d.ts +22 -7
  24. package/CheckboxItem/CheckboxItem.js +69 -4
  25. package/Chips/Chip.js +60 -7
  26. package/Chips/Chip.module.css +3 -3
  27. package/Chips/Chips.js +26 -12
  28. package/Chips/Chips.module.css +1 -1
  29. package/Chips/tests/Chip-specs.js +19 -9
  30. package/Chips/tests/Chips-specs.js +19 -19
  31. package/ContextualMenuDecorator/ContextualMenuDecorator.d.ts +4 -5
  32. package/ContextualPopupDecorator/ContextualPopup.module.css +34 -34
  33. package/ContextualPopupDecorator/ContextualPopupDecorator.js +557 -549
  34. package/DatePicker/DatePicker.d.ts +4 -5
  35. package/DayPicker/DayPicker.d.ts +8 -7
  36. package/Dropdown/Dropdown.d.ts +11 -13
  37. package/Dropdown/Dropdown.module.css +9 -9
  38. package/Dropdown/DropdownList.js +16 -11
  39. package/FixedPopupPanels/FixedPopupPanels.d.ts +4 -2
  40. package/FixedPopupPanels/FixedPopupPanels.module.css +18 -18
  41. package/FlexiblePopupPanels/FlexiblePopupPanels.module.css +23 -23
  42. package/FormCheckboxItem/FormCheckboxItem.d.ts +5 -4
  43. package/Heading/Heading.d.ts +8 -7
  44. package/Heading/Heading.module.css +5 -5
  45. package/Icon/Icon.d.ts +14 -4
  46. package/Icon/Icon.js +48 -2
  47. package/Icon/Icon.module.css +1 -1
  48. package/Icon/IconList.js +25 -1
  49. package/IconItem/IconItem.d.ts +13 -12
  50. package/IconItem/IconItem.js +15 -0
  51. package/IconItem/IconItem.module.css +107 -1
  52. package/Image/Image.d.ts +5 -4
  53. package/ImageItem/ImageItem.d.ts +11 -10
  54. package/ImageItem/ImageItem.js +37 -31
  55. package/ImageItem/ImageItem.module.css +30 -30
  56. package/ImageItem/tests/ImageItem-specs.js +3 -10
  57. package/Input/Input.js +9 -2
  58. package/Input/Input.module.css +37 -8
  59. package/Input/InputField.js +5 -1
  60. package/Input/InputField.module.css +17 -2
  61. package/Input/InputFieldSpotlightDecorator.js +213 -229
  62. package/Input/index.d.ts +15 -18
  63. package/Input/tests/InputField-specs.js +21 -0
  64. package/Item/Item.d.ts +16 -9
  65. package/Item/Item.js +20 -2
  66. package/Item/Item.module.css +1 -1
  67. package/KeyGuide/KeyGuide.d.ts +8 -7
  68. package/KeyGuide/KeyGuide.module.css +25 -1
  69. package/Marquee/Marquee.d.ts +2 -4
  70. package/MediaOverlay/MediaOverlay.d.ts +12 -11
  71. package/MediaOverlay/MediaOverlay.js +43 -21
  72. package/MediaOverlay/MediaOverlay.module.css +114 -15
  73. package/MediaPlayer/MediaControls.js +195 -13
  74. package/MediaPlayer/MediaControls.module.css +3 -2
  75. package/MediaPlayer/MediaSlider.module.css +7 -20
  76. package/MediaPlayer/index.d.ts +59 -7
  77. package/PageViews/PageViews.js +165 -80
  78. package/PageViews/PageViewsRouter.js +9 -0
  79. package/PageViews/tests/PageViews-specs.js +84 -0
  80. package/Panels/Header.js +48 -30
  81. package/Panels/Header.module.css +83 -31
  82. package/Panels/Panel.module.css +1 -1
  83. package/Panels/index.d.ts +7 -8
  84. package/Picker/Picker.d.ts +4 -5
  85. package/Picker/Picker.module.css +2 -2
  86. package/Popup/Popup.js +242 -240
  87. package/Popup/Popup.module.css +24 -24
  88. package/PopupTabLayout/PopupTabLayout.d.ts +5 -7
  89. package/PopupTabLayout/PopupTabLayout.js +15 -9
  90. package/PopupTabLayout/PopupTabLayout.module.css +53 -16
  91. package/PopupTabLayout/PopupTabLayoutStateContext.js +8 -0
  92. package/ProgressBar/ProgressBar.d.ts +5 -4
  93. package/ProgressBar/ProgressBarTooltip.module.css +12 -12
  94. package/ProgressButton/ProgressButton.d.ts +4 -5
  95. package/QuickGuidePanels/QuickGuidePanels.module.css +2 -2
  96. package/RadioItem/RadioItem.d.ts +18 -5
  97. package/RadioItem/RadioItem.js +67 -2
  98. package/RadioItem/RadioItem.module.css +36 -36
  99. package/RangePicker/RangePicker.module.css +2 -2
  100. package/Scroller/EditableWrapper.js +11 -4
  101. package/Scroller/Scroller.d.ts +20 -16
  102. package/Scroller/Scroller.js +9 -3
  103. package/Scroller/Scroller.module.css +4 -4
  104. package/Slider/Slider.d.ts +16 -14
  105. package/Slider/Slider.js +37 -4
  106. package/Slider/Slider.module.css +314 -91
  107. package/Slider/tests/Slider-specs.js +2 -1
  108. package/Spinner/Spinner.d.ts +5 -4
  109. package/Spinner/Spinner.module.css +9 -9
  110. package/Steps/Steps.d.ts +5 -4
  111. package/Steps/Steps.js +9 -5
  112. package/Switch/Switch.d.ts +8 -7
  113. package/Switch/Switch.module.css +100 -13
  114. package/SwitchItem/SwitchItem.d.ts +9 -6
  115. package/TabLayout/RefocusDecorator.js +15 -9
  116. package/TabLayout/TabGroup.js +3 -2
  117. package/TabLayout/TabGroup.module.css +2 -2
  118. package/TabLayout/TabLayout.d.ts +6 -0
  119. package/TabLayout/TabLayout.js +11 -1
  120. package/TabLayout/TabLayout.module.css +18 -0
  121. package/TabLayout/tests/TabLayout-specs.js +52 -0
  122. package/ThemeDecorator/ThemeDecorator.d.ts +9 -10
  123. package/ThemeDecorator/fontGenerator.js +1 -1
  124. package/ThemeDecorator/screenTypes.json +1 -0
  125. package/TimePicker/TimePicker.module.css +1 -1
  126. package/TooltipDecorator/Tooltip.module.css +1 -2
  127. package/TooltipDecorator/tests/util-specs.js +12 -0
  128. package/TooltipDecorator/useTooltip.js +1 -1
  129. package/TooltipDecorator/util.js +18 -11
  130. package/VideoPlayer/Feedback.js +3 -0
  131. package/VideoPlayer/Feedback.module.css +5 -9
  132. package/VideoPlayer/FeedbackIcons.js +1 -1
  133. package/VideoPlayer/FeedbackTooltip.module.css +55 -11
  134. package/VideoPlayer/VideoPlayer.d.ts +44 -18
  135. package/VideoPlayer/VideoPlayer.js +128 -23
  136. package/VideoPlayer/VideoPlayer.module.css +28 -11
  137. package/VirtualList/VirtualList.d.ts +9 -2
  138. package/VirtualList/VirtualList.js +31 -6
  139. package/VirtualList/tests/VirtualGridList-translate-specs.js +3 -0
  140. package/VirtualList/tests/VirtualList-specs.js +28 -1
  141. package/VirtualList/tests/VirtualList-translate-specs.js +4 -1
  142. package/VirtualList/tests/useEvent-specs.js +39 -0
  143. package/VirtualList/useEvent.js +45 -10
  144. package/VirtualList/useThemeVirtualList.js +3 -0
  145. package/WizardPanels/WizardPanels.module.css +2 -2
  146. package/WizardPanels/index.d.ts +4 -2
  147. package/fonts/Limestone_Icons.ttf +0 -0
  148. package/internal/$L/$L.js +3 -3
  149. package/internal/DateComponentPicker/DateComponentPicker.module.css +2 -2
  150. package/internal/DateTime/DateTime.module.css +1 -0
  151. package/internal/Panels/PanelsRouter.js +16 -5
  152. package/internal/Picker/Picker.module.css +2 -2
  153. package/internal/SharedStateDecorator/SharedStateDecorator.js +76 -99
  154. package/internal/validators/validators.js +21 -2
  155. package/package.json +14 -14
  156. package/styles/colors-highcontrast.less +9 -1
  157. package/styles/colors.less +11 -7
  158. package/styles/motion-mixins.less +66 -0
  159. package/styles/motions.less +78 -0
  160. package/styles/variables.less +176 -150
  161. package/useScroll/HoverToScroll.js +8 -5
  162. package/useScroll/ScrollbarTrack.module.css +8 -8
  163. package/useScroll/useEvent.js +7 -1
  164. package/useScroll/useScroll.js +2 -0
  165. package/useScroll/useScroll.module.css +6 -6
  166. package/.travis.yml +0 -40
@@ -101,7 +101,8 @@ describe('Slider', function () {
101
101
  });
102
102
  test('should set "aria-valuetext" to value when value is changed', function () {
103
103
  (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Slider["default"], {
104
- defaultValue: 10
104
+ defaultValue: 10,
105
+ showMinMax: true
105
106
  }));
106
107
  var slider = _react.screen.getByRole('slider');
107
108
  focus(slider);
@@ -37,8 +37,10 @@ export class SpinnerBase extends React.Component<
37
37
  Merge<React.HTMLProps<HTMLElement>, SpinnerBaseProps>
38
38
  > {}
39
39
 
40
- export interface SpinnerProps
41
- extends Merge<SpinnerBaseProps, SpinnerDecoratorProps> {
40
+ export interface SpinnerProps extends Merge<
41
+ SpinnerBaseProps,
42
+ SpinnerDecoratorProps
43
+ > {
42
44
  /**
43
45
  * Determines how far the click-blocking should extend.
44
46
  *
@@ -55,8 +57,7 @@ export class Spinner extends React.Component<
55
57
  Merge<React.HTMLProps<HTMLElement>, SpinnerProps>
56
58
  > {}
57
59
 
58
- export interface SpinnerDecoratorProps
59
- extends limestone_Skinnable_SkinnableProps {}
60
+ export interface SpinnerDecoratorProps extends limestone_Skinnable_SkinnableProps {}
60
61
  export function SpinnerDecorator<P>(
61
62
  Component: React.ComponentType<P> | string,
62
63
  ): React.ComponentType<P & SpinnerDecoratorProps>;
@@ -60,7 +60,7 @@
60
60
  border-radius: 20.8125rem;
61
61
  width: 2rem;
62
62
  height: 2rem;
63
- padding: 0.5rem;
63
+ padding: var(--primitive-spacing-24);
64
64
  margin-left: auto;
65
65
  margin-right: auto;
66
66
  }
@@ -135,7 +135,7 @@
135
135
  :global(.enact-locale-non-latin) .spinner .client {
136
136
  font-family: "Limestone";
137
137
  font-weight: var(--primitive-font-weight-light);
138
- font-size: 1.125rem;
138
+ font-size: var(--primitive-font-size-54);
139
139
  font-style: normal;
140
140
  }
141
141
  :global(.enact-locale-km) .spinner .client {
@@ -175,7 +175,7 @@
175
175
  height: 1rem;
176
176
  }
177
177
  .spinner.small .bg {
178
- padding: 0.25rem;
178
+ padding: var(--primitive-spacing-12);
179
179
  }
180
180
  .spinner.small .decorator {
181
181
  -webkit-mask-image: radial-gradient(transparent 0.35417rem, black 0.375rem);
@@ -206,7 +206,7 @@
206
206
  color: var(--semantic-color-on-background-sub);
207
207
  }
208
208
  .spinner:global(.neutral) .bg {
209
- background-color: var(--semantic-color-surface-default);
209
+ background-color: var(--semantic-color-surface-spinner);
210
210
  }
211
211
  .spinner:global(.neutral) .decorator {
212
212
  background: conic-gradient(color(from var(--semantic-color-on-background-main) srgb r g b / 0.2) 57.5%, var(--semantic-color-on-background-main) 100%);
@@ -227,7 +227,7 @@
227
227
  color: var(--semantic-color-on-background-sub);
228
228
  }
229
229
  :global(.enact-a11y-high-contrast) .spinner:global(.neutral):global(.highContrast) .bg {
230
- background-color: var(--semantic-color-surface-default);
230
+ background-color: var(--semantic-color-surface-spinner);
231
231
  }
232
232
  :global(.enact-a11y-high-contrast) .spinner:global(.neutral):global(.highContrast) .decorator {
233
233
  background: conic-gradient(color(from var(--semantic-color-on-background-main) srgb r g b / 0.2) 57.5%, var(--semantic-color-on-background-main) 100%);
@@ -248,7 +248,7 @@
248
248
  color: var(--semantic-color-on-background-sub);
249
249
  }
250
250
  .spinner:global(.light) .bg {
251
- background-color: var(--semantic-color-surface-default);
251
+ background-color: var(--semantic-color-surface-spinner);
252
252
  }
253
253
  .spinner:global(.light) .decorator {
254
254
  background: conic-gradient(color(from var(--semantic-color-on-background-main) srgb r g b / 0.2) 57.5%, var(--semantic-color-on-background-main) 100%);
@@ -272,7 +272,7 @@
272
272
  color: var(--semantic-color-on-background-sub);
273
273
  }
274
274
  .spinner:global(.game) .bg {
275
- background-color: var(--semantic-color-surface-default);
275
+ background-color: var(--semantic-color-surface-spinner);
276
276
  }
277
277
  .spinner:global(.game) .decorator {
278
278
  background: conic-gradient(color(from var(--semantic-color-on-background-main) srgb r g b / 0.2) 57.5%, var(--semantic-color-on-background-main) 100%);
@@ -295,7 +295,7 @@
295
295
  color: var(--semantic-color-on-background-sub);
296
296
  }
297
297
  :global(.green) .spinner:global(.game) .bg {
298
- background-color: var(--semantic-color-surface-default);
298
+ background-color: var(--semantic-color-surface-spinner);
299
299
  }
300
300
  :global(.green) .spinner:global(.game) .decorator {
301
301
  background: conic-gradient(color(from var(--semantic-color-on-background-main) srgb r g b / 0.2) 57.5%, var(--semantic-color-on-background-main) 100%);
@@ -318,7 +318,7 @@
318
318
  color: var(--semantic-color-on-background-sub);
319
319
  }
320
320
  :global(.orange) .spinner:global(.game) .bg {
321
- background-color: var(--semantic-color-surface-default);
321
+ background-color: var(--semantic-color-surface-spinner);
322
322
  }
323
323
  :global(.orange) .spinner:global(.game) .decorator {
324
324
  background: conic-gradient(color(from var(--semantic-color-on-background-main) srgb r g b / 0.2) 57.5%, var(--semantic-color-on-background-main) 100%);
package/Steps/Steps.d.ts CHANGED
@@ -100,14 +100,15 @@ export class StepsBase extends React.Component<
100
100
  Merge<React.HTMLProps<HTMLElement>, StepsBaseProps>
101
101
  > {}
102
102
 
103
- export interface StepsDecoratorProps
104
- extends limestone_Skinnable_SkinnableProps {}
103
+ export interface StepsDecoratorProps extends limestone_Skinnable_SkinnableProps {}
105
104
  export function StepsDecorator<P>(
106
105
  Component: React.ComponentType<P> | string,
107
106
  ): React.ComponentType<P & StepsDecoratorProps>;
108
107
 
109
- export interface StepsProps
110
- extends Merge<StepsBaseProps, StepsDecoratorProps> {}
108
+ export interface StepsProps extends Merge<
109
+ StepsBaseProps,
110
+ StepsDecoratorProps
111
+ > {}
111
112
  /**
112
113
  * A full-featured Limestone-styled step component.
113
114
  */
package/Steps/Steps.js CHANGED
@@ -15,7 +15,8 @@ var _Icon = _interopRequireDefault(require("../Icon"));
15
15
  var _Skinnable = _interopRequireDefault(require("../Skinnable"));
16
16
  var _StepsModule = _interopRequireDefault(require("./Steps.module.css"));
17
17
  var _jsxRuntime = require("react/jsx-runtime");
18
- var _excluded = ["css", "iconComponent", "size", "steps"];
18
+ var _excluded = ["className", "css"],
19
+ _excluded2 = ["css", "iconComponent", "size", "steps"];
19
20
  /**
20
21
  * Provides Limestone styled component to indicate progress along a continuum.
21
22
  *
@@ -40,11 +41,14 @@ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i
40
41
  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; }
41
42
  var PageIndicator = function PageIndicator(_ref) {
42
43
  var className = _ref.className,
43
- css = _ref.css;
44
+ css = _ref.css,
45
+ rest = _objectWithoutProperties(_ref, _excluded);
46
+ delete rest.children;
47
+ delete rest.size;
44
48
  var mergedClasses = (0, _classnames["default"])(css.pageIndicator, className);
45
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
49
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread({
46
50
  className: mergedClasses
47
- });
51
+ }, rest));
48
52
  };
49
53
 
50
54
  /**
@@ -258,7 +262,7 @@ var StepsBase = exports.StepsBase = (0, _kind["default"])({
258
262
  iconComponent = _ref4.iconComponent,
259
263
  size = _ref4.size,
260
264
  steps = _ref4.steps,
261
- rest = _objectWithoutProperties(_ref4, _excluded);
265
+ rest = _objectWithoutProperties(_ref4, _excluded2);
262
266
  delete rest.current;
263
267
  delete rest.currentIcon;
264
268
  delete rest.futureIcon;
@@ -29,17 +29,18 @@ export class SwitchBase extends React.Component<
29
29
  Merge<React.HTMLProps<HTMLElement>, SwitchBaseProps>
30
30
  > {}
31
31
 
32
- export interface SwitchDecoratorProps
33
- extends Merge<
34
- ui_Toggleable_ToggleableProps,
35
- spotlight_Spottable_SpottableProps
36
- > {}
32
+ export interface SwitchDecoratorProps extends Merge<
33
+ ui_Toggleable_ToggleableProps,
34
+ spotlight_Spottable_SpottableProps
35
+ > {}
37
36
  export function SwitchDecorator<P>(
38
37
  Component: React.ComponentType<P> | string,
39
38
  ): React.ComponentType<P & SwitchDecoratorProps>;
40
39
 
41
- export interface SwitchProps
42
- extends Merge<SwitchBaseProps, SwitchDecoratorProps> {}
40
+ export interface SwitchProps extends Merge<
41
+ SwitchBaseProps,
42
+ SwitchDecoratorProps
43
+ > {}
43
44
  /**
44
45
  * A Limestone-styled component that looks like a toggle switch.
45
46
  *
@@ -1,9 +1,92 @@
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
  .switch {
2
85
  display: inline-block;
3
86
  position: relative;
4
87
  }
5
88
  .switch .client {
6
- border-radius: 0.625rem;
89
+ border-radius: var(--primitive-radius-30);
7
90
  width: 2.5rem;
8
91
  height: 1.25rem;
9
92
  position: relative;
@@ -15,7 +98,7 @@
15
98
  visibility: visible;
16
99
  height: 1rem;
17
100
  width: 1rem;
18
- font-size: 1.75rem;
101
+ font-size: var(--primitive-font-size-84);
19
102
  line-height: 1.25rem;
20
103
  margin: 0;
21
104
  position: absolute;
@@ -32,15 +115,19 @@
32
115
  .switch.animated .icon {
33
116
  transition: left 200ms, background-color 200ms;
34
117
  }
118
+ .switch.animated.selected .icon {
119
+ animation: var(--lime-bounce-animation-name) var(--lime-bounce-motion-duration) var(--lime-bounce-motion-easing-function);
120
+ --lime-bounce-motion-offset-value: var(--lime-bounce-motion-offset-default-value);
121
+ }
35
122
  .switch:global(.spottable) {
36
- margin: 0.75rem;
123
+ margin: var(--primitive-spacing-36);
37
124
  }
38
125
  .switch:global(.spottable) .bg {
39
126
  position: absolute;
40
- top: -0.75rem;
41
- right: -0.75rem;
42
- bottom: -0.75rem;
43
- left: -0.75rem;
127
+ top: calc(var(--primitive-spacing-36) * -1);
128
+ right: calc(var(--primitive-spacing-36) * -1);
129
+ bottom: calc(var(--primitive-spacing-36) * -1);
130
+ left: calc(var(--primitive-spacing-36) * -1);
44
131
  z-index: -1;
45
132
  }
46
133
  .switch:global(.neutral) .client {
@@ -71,7 +158,7 @@
71
158
  border-radius: var(--semantic-radius-button);
72
159
  }
73
160
  .switch:global(.neutral):global(.spottable) .bg {
74
- border-radius: 0.5rem;
161
+ border-radius: var(--primitive-radius-24);
75
162
  will-change: box-shadow, box-shadow;
76
163
  opacity: 0;
77
164
  background-color: var(--semantic-color-surface-default-focused);
@@ -156,7 +243,7 @@
156
243
  border-radius: var(--semantic-radius-button);
157
244
  }
158
245
  :global(.enact-a11y-high-contrast) .switch:global(.neutral):global(.highContrast):global(.spottable) .bg {
159
- border-radius: 0.5rem;
246
+ border-radius: var(--primitive-radius-24);
160
247
  will-change: box-shadow, box-shadow;
161
248
  opacity: 0;
162
249
  background-color: var(--semantic-color-surface-default-focused);
@@ -241,7 +328,7 @@
241
328
  border-radius: var(--semantic-radius-button);
242
329
  }
243
330
  .switch:global(.light):global(.spottable) .bg {
244
- border-radius: 0.5rem;
331
+ border-radius: var(--primitive-radius-24);
245
332
  will-change: box-shadow, box-shadow;
246
333
  opacity: 0;
247
334
  background-color: var(--semantic-color-surface-default-focused);
@@ -331,7 +418,7 @@
331
418
  border-radius: 0;
332
419
  }
333
420
  .switch:global(.game):global(.spottable) .bg {
334
- border-radius: 0.5rem;
421
+ border-radius: var(--primitive-radius-24);
335
422
  will-change: box-shadow, box-shadow;
336
423
  opacity: 0;
337
424
  background-color: var(--semantic-color-surface-default-focused);
@@ -420,7 +507,7 @@
420
507
  border-radius: 0;
421
508
  }
422
509
  :global(.green) .switch:global(.game):global(.spottable) .bg {
423
- border-radius: 0.5rem;
510
+ border-radius: var(--primitive-radius-24);
424
511
  will-change: box-shadow, box-shadow;
425
512
  opacity: 0;
426
513
  background-color: var(--semantic-color-surface-default-focused);
@@ -509,7 +596,7 @@
509
596
  border-radius: 0;
510
597
  }
511
598
  :global(.orange) .switch:global(.game):global(.spottable) .bg {
512
- border-radius: 0.5rem;
599
+ border-radius: var(--primitive-radius-24);
513
600
  will-change: box-shadow, box-shadow;
514
601
  opacity: 0;
515
602
  background-color: var(--semantic-color-surface-default-focused);
@@ -7,8 +7,10 @@ import * as React from "react";
7
7
  type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
8
8
  type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
9
9
 
10
- export interface SwitchItemBaseProps
11
- extends Omit<limestone_Item_ItemProps, "iconComponent"> {
10
+ export interface SwitchItemBaseProps extends Omit<
11
+ limestone_Item_ItemProps,
12
+ "iconComponent"
13
+ > {
12
14
  /**
13
15
  * Customizes the component by mapping the supplied collection of CSS class names to the
14
16
  corresponding internal elements and states of this component.
@@ -34,14 +36,15 @@ export class SwitchItemBase extends React.Component<
34
36
  Merge<React.HTMLProps<HTMLElement>, SwitchItemBaseProps>
35
37
  > {}
36
38
 
37
- export interface SwitchItemDecoratorProps
38
- extends ui_Toggleable_ToggleableProps {}
39
+ export interface SwitchItemDecoratorProps extends ui_Toggleable_ToggleableProps {}
39
40
  export function SwitchItemDecorator<P>(
40
41
  Component: React.ComponentType<P> | string,
41
42
  ): React.ComponentType<P & SwitchItemDecoratorProps>;
42
43
 
43
- export interface SwitchItemProps
44
- extends Merge<SwitchItemBaseProps, SwitchItemDecoratorProps> {}
44
+ export interface SwitchItemProps extends Merge<
45
+ SwitchItemBaseProps,
46
+ SwitchItemDecoratorProps
47
+ > {}
45
48
  /**
46
49
  * A Limestone-styled item with a switch component.
47
50
  *
@@ -11,7 +11,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
  var _react = require("react");
12
12
  var _TabGroupModule = _interopRequireDefault(require("./TabGroup.module.css"));
13
13
  var _jsxRuntime = require("react/jsx-runtime");
14
- var _excluded = ["blockCollapseOnPortrait", "collapsed", "index", "onCollapse", "onTabAnimationEnd", "orientation", "spotlightId"];
14
+ var _excluded = ["blockCollapseOnPortrait", "blockExpandOnLandscape", "collapsed", "index", "onCollapse", "onExpand", "onTabAnimationEnd", "orientation", "spotlightId"];
15
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
16
16
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
17
17
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -62,9 +62,11 @@ var RefocusDecorator = exports.RefocusDecorator = function RefocusDecorator(Wrap
62
62
  // eslint-disable-next-line no-shadow
63
63
  function RefocusDecorator(_ref) {
64
64
  var blockCollapseOnPortrait = _ref.blockCollapseOnPortrait,
65
+ blockExpandOnLandscape = _ref.blockExpandOnLandscape,
65
66
  collapsed = _ref.collapsed,
66
67
  index = _ref.index,
67
68
  onCollapse = _ref.onCollapse,
69
+ onExpand = _ref.onExpand,
68
70
  onTabAnimationEnd = _ref.onTabAnimationEnd,
69
71
  orientation = _ref.orientation,
70
72
  spotlightId = _ref.spotlightId,
@@ -74,7 +76,7 @@ var RefocusDecorator = exports.RefocusDecorator = function RefocusDecorator(Wrap
74
76
  }),
75
77
  generateId = _useId.generateId;
76
78
  var screenOrientation = useScreenOrientation();
77
- var screenOrientationRef = (0, _react.useRef)(null);
79
+ var screenOrientationRef = (0, _react.useRef)('landscape');
78
80
 
79
81
  // generate an id for the component (and a derived id for the tabs) so we can refocus them
80
82
  // generating a different ID by orientation so swapping orientations doesn't clear container
@@ -97,18 +99,21 @@ var RefocusDecorator = exports.RefocusDecorator = function RefocusDecorator(Wrap
97
99
  });
98
100
  }, [collapsed, orientation, spotlightId]);
99
101
  (0, _react.useEffect)(function () {
100
- if (!blockCollapseOnPortrait && screenOrientationRef.current !== screenOrientation) {
101
- if (screenOrientation === 'portrait') {
102
- var currentFocusedElement = document.querySelector(':focus'),
103
- tabsSpotlightId = getTabsSpotlightId(spotlightId, false),
104
- tabsContainer = getContainerNode(tabsSpotlightId);
105
- if (tabsContainer && !tabsContainer.contains(currentFocusedElement)) {
102
+ if (screenOrientationRef.current !== screenOrientation) {
103
+ var currentFocusedElement = document.querySelector(':focus'),
104
+ tabsSpotlightId = getTabsSpotlightId(spotlightId, false),
105
+ tabsContainer = getContainerNode(tabsSpotlightId);
106
+ if (tabsContainer && !tabsContainer.contains(currentFocusedElement)) {
107
+ if (!blockCollapseOnPortrait && screenOrientation === 'portrait') {
106
108
  onCollapse();
107
109
  }
110
+ if (!blockExpandOnLandscape && screenOrientation === 'landscape') {
111
+ onExpand();
112
+ }
108
113
  }
109
114
  screenOrientationRef.current = screenOrientation;
110
115
  }
111
- }, [blockCollapseOnPortrait, onCollapse, screenOrientation, spotlightId]);
116
+ }, [blockCollapseOnPortrait, blockExpandOnLandscape, onCollapse, onExpand, screenOrientation, spotlightId]);
112
117
  var handleTabAnimationEnd = (0, _react.useCallback)(function (ev) {
113
118
  if (onTabAnimationEnd) {
114
119
  onTabAnimationEnd(ev);
@@ -125,6 +130,7 @@ var RefocusDecorator = exports.RefocusDecorator = function RefocusDecorator(Wrap
125
130
  collapsed: collapsed,
126
131
  index: index,
127
132
  onCollapse: onCollapse,
133
+ onExpand: onExpand,
128
134
  onTabAnimationEnd: handleTabAnimationEnd,
129
135
  orientation: orientation,
130
136
  spotlightId: spotlightId
@@ -59,7 +59,7 @@ var TabBase = (0, _kind["default"])({
59
59
  styles: {
60
60
  css: _TabGroupModule["default"],
61
61
  className: 'tab',
62
- publicClassNames: ['bg', 'button', 'client', 'selected', 'tab', 'vertical']
62
+ publicClassNames: ['bg', 'button', 'client', 'icon', 'selected', 'tab', 'vertical']
63
63
  },
64
64
  handlers: {
65
65
  onClick: (0, _handle["default"])((0, _handle.forward)('onClick'), (0, _handle.not)((0, _handle.forProp)('disabled', true)), (0, _handle.forwardCustom)('onTabClick', function (ev, _ref) {
@@ -196,7 +196,7 @@ var TabGroupBase = (0, _kind["default"])({
196
196
  styles: {
197
197
  css: _TabGroupModule["default"],
198
198
  className: 'tabGroup',
199
- publicClassNames: ['bg', 'button', 'client', 'selected', 'tab', 'tabGroup', 'vertical']
199
+ publicClassNames: ['bg', 'button', 'client', 'icon', 'selected', 'tab', 'tabGroup', 'vertical']
200
200
  },
201
201
  computed: {
202
202
  className: function className(_ref6) {
@@ -313,6 +313,7 @@ var TabGroupBase = (0, _kind["default"])({
313
313
  noScrollByWheel: collapsed,
314
314
  onScrollStop: onScrollStop,
315
315
  scrollbarTrackCss: _TabGroupModule["default"],
316
+ scrollToContentContainerOnFocus: false,
316
317
  spotlightDisabled: spotlightDisabled,
317
318
  spotlightId: spotlightId,
318
319
  verticalScrollbar: collapsed ? 'hidden' : 'auto'
@@ -132,8 +132,8 @@
132
132
  gap: var(--primitive-spacing-36);
133
133
  }
134
134
  .tabGroup.vertical .scrollbarTrack {
135
- margin-top: 0.75rem;
136
- margin-bottom: 0.75rem;
135
+ margin-top: var(--primitive-spacing-36);
136
+ margin-bottom: var(--primitive-spacing-36);
137
137
  height: calc(100% - 72px);
138
138
  }
139
139
  .tabGroup.vertical.collapsed:has(.noIcons) {
@@ -56,6 +56,12 @@ export interface TabLayoutProps {
56
56
  * Only applies to `orientation="vertical".
57
57
  */
58
58
  blockCollapseOnPortrait?: boolean;
59
+ /**
60
+ * Prevents the tab list from automatically expand when the screen orientation changes to landscape mode.
61
+ *
62
+ * Only applies to `orientation="vertical".
63
+ */
64
+ blockExpandOnLandscape?: boolean;
59
65
  /**
60
66
  * Collection of to render.
61
67
  */
@@ -130,6 +130,15 @@ var TabLayoutBase = exports.TabLayoutBase = (0, _kind["default"])({
130
130
  * @public
131
131
  */
132
132
  blockCollapseOnPortrait: _propTypes["default"].bool,
133
+ /**
134
+ * Prevents the tab list from automatically expand when the screen orientation changes to landscape mode.
135
+ *
136
+ * Only applies to `orientation="vertical".
137
+ *
138
+ * @type {Boolean}
139
+ * @public
140
+ */
141
+ blockExpandOnLandscape: _propTypes["default"].bool,
133
142
  /**
134
143
  * Collection of {@link limestone/TabLayout.Tab|Tabs} to render.
135
144
  *
@@ -331,7 +340,7 @@ var TabLayoutBase = exports.TabLayoutBase = (0, _kind["default"])({
331
340
  styles: {
332
341
  css: _TabLayoutModule["default"],
333
342
  className: 'tabLayout',
334
- publicClassNames: ['bg', 'button', 'client', 'collapsed', 'content', 'selected', 'tab', 'tabGroup', 'tabLayout', 'tabs', 'tabsExpanded', 'vertical']
343
+ publicClassNames: ['bg', 'button', 'client', 'collapsed', 'content', 'icon', 'selected', 'tab', 'tabGroup', 'tabLayout', 'tabs', 'tabsExpanded', 'vertical']
335
344
  },
336
345
  handlers: {
337
346
  onKeyDown: function onKeyDown(ev, props) {
@@ -559,6 +568,7 @@ var TabLayoutBase = exports.TabLayoutBase = (0, _kind["default"])({
559
568
  rest = _objectWithoutProperties(_ref12, _excluded);
560
569
  delete rest.anchorTo;
561
570
  delete rest.blockCollapseOnPortrait;
571
+ delete rest.blockExpandOnLandscape;
562
572
  delete rest.onExpand;
563
573
  delete rest.offset;
564
574
  delete rest.onTabAnimationEnd;
@@ -12,6 +12,10 @@
12
12
  .tabLayout.collapsed .tabGroup .tab.vertical.button.selected .bg {
13
13
  /* Override TabLayout */
14
14
  }
15
+ .tabLayout.collapsed .tabGroup .tab.vertical.button.selected .icon,
16
+ .tabLayout.collapsed .tabGroup .tab.vertical.button.selected .client {
17
+ /* Override TabLayout */
18
+ }
15
19
  .tabLayout.anchorEnd,
16
20
  .tabLayout.anchorRight {
17
21
  flex-direction: row-reverse;
@@ -92,10 +96,24 @@
92
96
  .tabLayout .tabGroup .tab.vertical.button.selected .bg {
93
97
  /* Override TabLayout */
94
98
  }
99
+ .tabLayout .tabGroup .tab.vertical.button.selected .icon,
100
+ .tabLayout .tabGroup .tab.vertical.button.selected .client {
101
+ /* Override TabLayout */
102
+ }
95
103
  :global(.spotlight-input-key) .tabLayout .tabGroup .tab.vertical.button:global(.spottable):focus .bg,
96
104
  :global(.spotlight-input-mouse) .tabLayout .tabGroup .tab.vertical.button:global(.spottable):focus .bg {
97
105
  /* Override TabLayout */
98
106
  }
107
+ :global(.spotlight-input-key) .tabLayout .tabGroup .tab.vertical.button:global(.spottable):focus .icon,
108
+ :global(.spotlight-input-mouse) .tabLayout .tabGroup .tab.vertical.button:global(.spottable):focus .icon,
109
+ :global(.spotlight-input-key) .tabLayout .tabGroup .tab.vertical.button:global(.spottable):focus .client,
110
+ :global(.spotlight-input-mouse) .tabLayout .tabGroup .tab.vertical.button:global(.spottable):focus .client {
111
+ /* Override TabLayout */
112
+ }
99
113
  :global(.spotlight-input-touch) .tabLayout .tabGroup .tab.vertical.button:global(.spottable):active .bg {
100
114
  /* Override TabLayout */
101
115
  }
116
+ :global(.spotlight-input-touch) .tabLayout .tabGroup .tab.vertical.button:global(.spottable):active .icon,
117
+ :global(.spotlight-input-touch) .tabLayout .tabGroup .tab.vertical.button:global(.spottable):active .client {
118
+ /* Override TabLayout */
119
+ }