@enact/limestone 1.10.1 → 1.10.2
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.
- package/.github/PULL_REQUEST_TEMPLATE.md +1 -0
- package/ActionGuide/ActionGuide.d.ts +1 -1
- package/ActionGuide/ActionGuide.module.css +3 -0
- package/Alert/Alert.d.ts +9 -0
- package/Alert/Alert.js +63 -21
- package/Alert/Alert.module.css +41 -9
- package/Alert/AlertImage.module.css +5 -1
- package/Alert/tests/Alert-specs.js +6 -2
- package/BodyText/BodyText.d.ts +1 -1
- package/BodyText/BodyText.js +14 -9
- package/BodyText/BodyText.module.css +1 -1
- package/Button/Button.d.ts +3 -3
- package/Button/Button.module.css +14 -28
- package/CHANGELOG.md +48 -1
- package/Card/Card.d.ts +81 -9
- package/Card/Card.js +321 -84
- package/Card/Card.module.css +171 -20
- package/Card/tests/Card-specs.js +100 -0
- package/Checkbox/Checkbox.d.ts +2 -2
- package/Checkbox/Checkbox.module.css +2 -9
- package/CheckboxItem/CheckboxItem.d.ts +8 -1
- package/CheckboxItem/CheckboxItem.js +39 -12
- package/CheckboxItem/CheckboxItem.module.css +228 -4
- package/Chips/Chip.module.css +2 -2
- package/ContextualMenuDecorator/ContextualMenuDecorator.d.ts +2 -2
- package/ContextualPopupDecorator/ContextualPopup.module.css +1 -1
- package/ContextualPopupDecorator/ContextualPopupDecorator.js +2 -4
- package/ContextualPopupDecorator/tests/ContextualPopupDecorator-specs.js +39 -2
- package/Dropdown/Dropdown.d.ts +2 -2
- package/Dropdown/Dropdown.module.css +7 -7
- package/FixedPopupPanels/FixedPopupPanels.d.ts +2 -2
- package/FlexiblePopupPanels/FlexiblePopupPanels.module.css +15 -3
- package/FlexiblePopupPanels/index.d.ts +2 -2
- package/FormCheckboxItem/FormCheckboxItem.d.ts +1 -1
- package/FormCheckboxItem/FormCheckboxItem.js +1 -0
- package/FormCheckboxItem/FormCheckboxItem.module.css +1 -1
- package/Heading/Heading.d.ts +2 -2
- package/Icon/Icon.d.ts +22 -1
- package/Icon/Icon.js +21 -0
- package/Icon/IconList.js +43 -1
- package/IconItem/IconItem.d.ts +2 -2
- package/IconItem/IconItem.module.css +11 -14
- package/Image/Image.d.ts +1 -1
- package/Image/Image.module.css +1 -1
- package/ImageItem/ImageItem.d.ts +2 -2
- package/ImageItem/ImageItem.js +3 -16
- package/ImageItem/ImageItem.module.css +105 -97
- package/ImageItem/tests/ImageItem-specs.js +6 -5
- package/Input/Input.module.css +8 -7
- package/Input/InputField.module.css +4 -4
- package/Input/index.d.ts +1 -1
- package/Input/tests/Input-specs.js +2 -2
- package/Input/tests/InputField-specs.js +1 -1
- package/Item/Item.d.ts +2 -2
- package/Item/Item.module.css +27 -15
- package/KeyGuide/KeyGuide.d.ts +2 -2
- package/MediaOverlay/MediaOverlay.d.ts +2 -2
- package/MediaOverlay/MediaOverlay.module.css +2 -5
- package/MediaPlayer/MediaSlider.module.css +1 -0
- package/MediaPlayer/Times.module.css +1 -1
- package/MediaPlayer/index.d.ts +2 -2
- package/PageViews/PageViews.module.css +2 -1
- package/Panels/Header.module.css +40 -28
- package/Panels/Panel.module.css +1 -1
- package/Panels/index.d.ts +1 -1
- package/Picker/Picker.d.ts +1 -1
- package/Popup/Popup.module.css +4 -1
- package/PopupTabLayout/PopupTabLayout.d.ts +6 -6
- package/PopupTabLayout/PopupTabLayout.module.css +6 -6
- package/ProgressBar/ProgressBar.d.ts +1 -1
- package/ProgressBar/ProgressBar.module.css +12 -12
- package/ProgressBar/ProgressBarTooltip.module.css +7 -7
- package/ProgressButton/ProgressButton.d.ts +2 -2
- package/QuickGuidePanels/QuickGuidePanels.module.css +1 -1
- package/RadioItem/RadioItem.d.ts +1 -1
- package/RadioItem/RadioItem.module.css +18 -20
- package/Scroller/Scroller.d.ts +12 -0
- package/Scroller/Scroller.js +15 -0
- package/Scroller/tests/Scroller-specs.js +29 -0
- package/Scroller/useThemeScroller.js +22 -2
- package/Slider/Slider.d.ts +1 -1
- package/Slider/Slider.module.css +539 -300
- package/Spinner/Spinner.d.ts +1 -1
- package/Spinner/Spinner.module.css +2 -2
- package/Steps/Steps.d.ts +1 -1
- package/Steps/Steps.js +12 -6
- package/Steps/Steps.module.css +16 -2
- package/Switch/Switch.module.css +2 -5
- package/SwitchItem/SwitchItem.d.ts +1 -1
- package/TabLayout/RefocusDecorator.js +1 -1
- package/TabLayout/TabGroup.module.css +12 -6
- package/TabLayout/TabLayout.js +4 -0
- package/ThemeDecorator/ThemeDecorator.d.ts +1 -1
- package/ThemeDecorator/ThemeDecorator.module.css +22 -1
- package/TooltipDecorator/Tooltip.js +68 -7
- package/TooltipDecorator/Tooltip.module.css +40 -23
- package/TooltipDecorator/TooltipDecorator.d.ts +52 -0
- package/TooltipDecorator/TooltipDecorator.js +42 -0
- package/TooltipDecorator/TooltipLabel.js +67 -14
- package/TooltipDecorator/tests/TooltipDecorator-specs.js +46 -0
- package/TooltipDecorator/useTooltip.js +14 -2
- package/VideoPlayer/MediaTitle.module.css +1 -1
- package/VirtualList/VirtualList.d.ts +24 -0
- package/VirtualList/VirtualList.js +30 -0
- package/VirtualList/tests/stickTo-specs.js +115 -0
- package/VirtualList/tests/useEvent-specs.js +39 -0
- package/VirtualList/useEvent.js +45 -10
- package/VirtualList/useThemeVirtualList.js +20 -2
- package/WizardPanels/WizardPanels.module.css +1 -1
- package/fonts/Limestone_Icons.ttf +0 -0
- package/internal/DateComponentPicker/DateComponentPicker.module.css +3 -3
- package/internal/Picker/Picker.js +8 -10
- package/internal/Picker/Picker.module.css +74 -141
- package/package.json +11 -14
- package/styles/color-mixins.less +4 -60
- package/styles/colors-game.less +5 -5
- package/styles/colors.less +9 -10
- package/styles/mixins.less +0 -46
- package/styles/motion-mixins.less +16 -7
- package/styles/motions.less +2 -2
- package/styles/variables.less +71 -46
- package/useScroll/useScroll.js +3 -1
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
background-color: color(from var(--semantic-color-surface-default-track) srgb r g b / 0.7);
|
|
56
56
|
}
|
|
57
57
|
.progressBar:global(.neutral) .fill {
|
|
58
|
-
background-color: var(--semantic-color-surface-
|
|
58
|
+
background-color: var(--semantic-color-surface-white);
|
|
59
59
|
}
|
|
60
60
|
.progressBar:global(.neutral) .load {
|
|
61
61
|
background-color: color(from var(--semantic-color-surface-white) srgb r g b / 0.5);
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
border-color: color(from var(--semantic-color-surface-default-track) srgb r g b / 0.7);
|
|
70
70
|
}
|
|
71
71
|
.progressBar:global(.neutral).radial .fill {
|
|
72
|
-
border-color: var(--semantic-color-surface-
|
|
72
|
+
border-color: var(--semantic-color-surface-white);
|
|
73
73
|
}
|
|
74
74
|
.progressBar:global(.neutral).radial .load {
|
|
75
75
|
border-color: color(from var(--semantic-color-surface-white) srgb r g b / 0.5);
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
background-color: color(from var(--semantic-color-surface-default-track) srgb r g b / 0.7);
|
|
89
89
|
}
|
|
90
90
|
:global(.enact-a11y-high-contrast) .progressBar:global(.neutral):global(.highContrast) .fill {
|
|
91
|
-
background-color: var(--semantic-color-surface-
|
|
91
|
+
background-color: var(--semantic-color-surface-white);
|
|
92
92
|
}
|
|
93
93
|
:global(.enact-a11y-high-contrast) .progressBar:global(.neutral):global(.highContrast) .load {
|
|
94
94
|
background-color: color(from var(--semantic-color-surface-white) srgb r g b / 0.5);
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
border-color: color(from var(--semantic-color-surface-default-track) srgb r g b / 0.7);
|
|
103
103
|
}
|
|
104
104
|
:global(.enact-a11y-high-contrast) .progressBar:global(.neutral):global(.highContrast).radial .fill {
|
|
105
|
-
border-color: var(--semantic-color-surface-
|
|
105
|
+
border-color: var(--semantic-color-surface-white);
|
|
106
106
|
}
|
|
107
107
|
:global(.enact-a11y-high-contrast) .progressBar:global(.neutral):global(.highContrast).radial .load {
|
|
108
108
|
border-color: color(from var(--semantic-color-surface-white) srgb r g b / 0.5);
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
background-color: color(from var(--semantic-color-surface-default-track) srgb r g b / 0.7);
|
|
122
122
|
}
|
|
123
123
|
.progressBar:global(.light) .fill {
|
|
124
|
-
background-color: var(--semantic-color-surface-
|
|
124
|
+
background-color: var(--semantic-color-surface-white);
|
|
125
125
|
}
|
|
126
126
|
.progressBar:global(.light) .load {
|
|
127
127
|
background-color: color(from var(--semantic-color-surface-white) srgb r g b / 0.5);
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
border-color: color(from var(--semantic-color-surface-default-track) srgb r g b / 0.7);
|
|
136
136
|
}
|
|
137
137
|
.progressBar:global(.light).radial .fill {
|
|
138
|
-
border-color: var(--semantic-color-surface-
|
|
138
|
+
border-color: var(--semantic-color-surface-white);
|
|
139
139
|
}
|
|
140
140
|
.progressBar:global(.light).radial .load {
|
|
141
141
|
border-color: color(from var(--semantic-color-surface-white) srgb r g b / 0.5);
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
background-color: color(from var(--semantic-color-surface-default-track) srgb r g b / 0.7);
|
|
160
160
|
}
|
|
161
161
|
.progressBar:global(.game) .fill {
|
|
162
|
-
background-color: var(--semantic-color-surface-
|
|
162
|
+
background-color: var(--semantic-color-surface-white);
|
|
163
163
|
}
|
|
164
164
|
.progressBar:global(.game) .load {
|
|
165
165
|
background-color: color(from var(--semantic-color-surface-white) srgb r g b / 0.5);
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
border-color: color(from var(--semantic-color-surface-default-track) srgb r g b / 0.7);
|
|
174
174
|
}
|
|
175
175
|
.progressBar:global(.game).radial .fill {
|
|
176
|
-
border-color: var(--semantic-color-surface-
|
|
176
|
+
border-color: var(--semantic-color-surface-white);
|
|
177
177
|
}
|
|
178
178
|
.progressBar:global(.game).radial .load {
|
|
179
179
|
border-color: color(from var(--semantic-color-surface-white) srgb r g b / 0.5);
|
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
background-color: color(from var(--semantic-color-surface-default-track) srgb r g b / 0.7);
|
|
197
197
|
}
|
|
198
198
|
:global(.green) .progressBar:global(.game) .fill {
|
|
199
|
-
background-color: var(--semantic-color-surface-
|
|
199
|
+
background-color: var(--semantic-color-surface-white);
|
|
200
200
|
}
|
|
201
201
|
:global(.green) .progressBar:global(.game) .load {
|
|
202
202
|
background-color: color(from var(--semantic-color-surface-white) srgb r g b / 0.5);
|
|
@@ -210,7 +210,7 @@
|
|
|
210
210
|
border-color: color(from var(--semantic-color-surface-default-track) srgb r g b / 0.7);
|
|
211
211
|
}
|
|
212
212
|
:global(.green) .progressBar:global(.game).radial .fill {
|
|
213
|
-
border-color: var(--semantic-color-surface-
|
|
213
|
+
border-color: var(--semantic-color-surface-white);
|
|
214
214
|
}
|
|
215
215
|
:global(.green) .progressBar:global(.game).radial .load {
|
|
216
216
|
border-color: color(from var(--semantic-color-surface-white) srgb r g b / 0.5);
|
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
background-color: color(from var(--semantic-color-surface-default-track) srgb r g b / 0.7);
|
|
234
234
|
}
|
|
235
235
|
:global(.orange) .progressBar:global(.game) .fill {
|
|
236
|
-
background-color: var(--semantic-color-surface-
|
|
236
|
+
background-color: var(--semantic-color-surface-white);
|
|
237
237
|
}
|
|
238
238
|
:global(.orange) .progressBar:global(.game) .load {
|
|
239
239
|
background-color: color(from var(--semantic-color-surface-white) srgb r g b / 0.5);
|
|
@@ -247,7 +247,7 @@
|
|
|
247
247
|
border-color: color(from var(--semantic-color-surface-default-track) srgb r g b / 0.7);
|
|
248
248
|
}
|
|
249
249
|
:global(.orange) .progressBar:global(.game).radial .fill {
|
|
250
|
-
border-color: var(--semantic-color-surface-
|
|
250
|
+
border-color: var(--semantic-color-surface-white);
|
|
251
251
|
}
|
|
252
252
|
:global(.orange) .progressBar:global(.game).radial .load {
|
|
253
253
|
border-color: color(from var(--semantic-color-surface-white) srgb r g b / 0.5);
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
left: 50%;
|
|
50
50
|
}
|
|
51
51
|
.tooltip.radial.center.above {
|
|
52
|
-
bottom: calc(100% +
|
|
52
|
+
bottom: calc(100% + calc(var(--primitive-spacing-12) + 12px) );
|
|
53
53
|
}
|
|
54
54
|
.tooltip.radial.center.below {
|
|
55
|
-
top: calc(100% +
|
|
55
|
+
top: calc(100% + calc(var(--primitive-spacing-12) + 12px) );
|
|
56
56
|
}
|
|
57
57
|
.tooltip.radial.left,
|
|
58
58
|
.tooltip.radial.before,
|
|
@@ -62,25 +62,25 @@
|
|
|
62
62
|
.tooltip.radial.left.above,
|
|
63
63
|
.tooltip.radial.before.above,
|
|
64
64
|
:global(.enact-locale-right-to-left) .tooltip.radial.after.above {
|
|
65
|
-
bottom: calc(100% +
|
|
65
|
+
bottom: calc(100% + calc(var(--primitive-spacing-12) + 12px) );
|
|
66
66
|
}
|
|
67
67
|
.tooltip.radial.left.below,
|
|
68
68
|
.tooltip.radial.before.below,
|
|
69
69
|
:global(.enact-locale-right-to-left) .tooltip.radial.after.below {
|
|
70
|
-
top: calc(100% +
|
|
70
|
+
top: calc(100% + calc(var(--primitive-spacing-12) + 12px) );
|
|
71
71
|
}
|
|
72
72
|
.tooltip.radial.right,
|
|
73
73
|
.tooltip.radial.after,
|
|
74
74
|
:global(.enact-locale-right-to-left) .tooltip.radial.before {
|
|
75
|
-
left: calc(100% +
|
|
75
|
+
left: calc(100% + calc(var(--primitive-spacing-12) + 12px) );
|
|
76
76
|
}
|
|
77
77
|
.tooltip.radial.right.above,
|
|
78
78
|
.tooltip.radial.after.above,
|
|
79
79
|
:global(.enact-locale-right-to-left) .tooltip.radial.before.above {
|
|
80
|
-
bottom: calc(100% +
|
|
80
|
+
bottom: calc(100% + calc(var(--primitive-spacing-12) + 12px) );
|
|
81
81
|
}
|
|
82
82
|
.tooltip.radial.right.below,
|
|
83
83
|
.tooltip.radial.after.below,
|
|
84
84
|
:global(.enact-locale-right-to-left) .tooltip.radial.before.below {
|
|
85
|
-
top: calc(100% +
|
|
85
|
+
top: calc(100% + calc(var(--primitive-spacing-12) + 12px) );
|
|
86
86
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Type definitions for limestone/ProgressButton
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { ButtonBaseProps as limestone_Button_ButtonBaseProps } from "limestone/Button";
|
|
5
|
-
import { ProgressBarProps as limestone_ProgressBar_ProgressBarProps } from "limestone/ProgressBar";
|
|
4
|
+
import { ButtonBaseProps as limestone_Button_ButtonBaseProps } from "@enact/limestone/Button";
|
|
5
|
+
import { ProgressBarProps as limestone_ProgressBar_ProgressBarProps } from "@enact/limestone/ProgressBar";
|
|
6
6
|
|
|
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;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
.quickGuidePanels .navigationButtonContainer {
|
|
19
19
|
align-items: center;
|
|
20
20
|
height: 2.75rem;
|
|
21
|
-
margin-top: calc(100vh / 2 -
|
|
21
|
+
margin-top: calc(100vh / 2 - 1.375rem );
|
|
22
22
|
z-index: 10;
|
|
23
23
|
}
|
|
24
24
|
.quickGuidePanels .navigationButtonContainer .navigationButton {
|
package/RadioItem/RadioItem.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { ToggleableProps as ui_Toggleable_ToggleableProps } from "@enact/ui/Toggleable";
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import { ItemProps as limestone_Item_ItemProps } from "limestone/Item";
|
|
5
|
+
import { ItemProps as limestone_Item_ItemProps } from "@enact/limestone/Item";
|
|
6
6
|
|
|
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;
|
|
@@ -7,11 +7,9 @@
|
|
|
7
7
|
.radioItem .icon {
|
|
8
8
|
border-radius: var(--semantic-radius-full);
|
|
9
9
|
font-size: var(--primitive-font-size-48);
|
|
10
|
-
--icon-size: 1.25rem;
|
|
11
10
|
}
|
|
12
11
|
.radioItem .icon:global(.largeText) {
|
|
13
12
|
font-size: var(--primitive-font-size-56);
|
|
14
|
-
--icon-size: 1.5rem;
|
|
15
13
|
}
|
|
16
14
|
.radioItem:global(.neutral) .icon {
|
|
17
15
|
color: transparent;
|
|
@@ -130,8 +128,8 @@
|
|
|
130
128
|
}
|
|
131
129
|
.radioItem:global(.game).selected .icon {
|
|
132
130
|
color: var(--semantic-color-on-surface-main-selected);
|
|
133
|
-
background-color:
|
|
134
|
-
box-shadow: 0 0 0 0.08333rem
|
|
131
|
+
background-color: #8b31d7;
|
|
132
|
+
box-shadow: 0 0 0 0.08333rem #8b31d7;
|
|
135
133
|
}
|
|
136
134
|
.radioItem:global(.game).selected .bg {
|
|
137
135
|
background-color: transparent;
|
|
@@ -145,8 +143,8 @@
|
|
|
145
143
|
:global(.spotlight-input-key) .radioItem:global(.game):global(.spottable):focus.selected .icon,
|
|
146
144
|
:global(.spotlight-input-mouse) .radioItem:global(.game):global(.spottable):focus.selected .icon {
|
|
147
145
|
color: var(--semantic-color-on-surface-main-selected);
|
|
148
|
-
background-color:
|
|
149
|
-
box-shadow: 0 0 0 0.08333rem
|
|
146
|
+
background-color: #8b31d7;
|
|
147
|
+
box-shadow: 0 0 0 0.08333rem #8b31d7;
|
|
150
148
|
}
|
|
151
149
|
:global(.spotlight-input-touch) .radioItem:global(.game):global(.spottable):active .icon {
|
|
152
150
|
color: transparent;
|
|
@@ -155,8 +153,8 @@
|
|
|
155
153
|
}
|
|
156
154
|
:global(.spotlight-input-touch) .radioItem:global(.game):global(.spottable):active.selected .icon {
|
|
157
155
|
color: var(--semantic-color-on-surface-main-selected);
|
|
158
|
-
background-color:
|
|
159
|
-
box-shadow: 0 0 0 0.08333rem
|
|
156
|
+
background-color: #8b31d7;
|
|
157
|
+
box-shadow: 0 0 0 0.08333rem #8b31d7;
|
|
160
158
|
}
|
|
161
159
|
:global(.green) .radioItem:global(.game) {
|
|
162
160
|
--semantic-color-surface-default: #1F2C24;
|
|
@@ -169,8 +167,8 @@
|
|
|
169
167
|
}
|
|
170
168
|
:global(.green) .radioItem:global(.game).selected .icon {
|
|
171
169
|
color: var(--semantic-color-on-surface-main-selected);
|
|
172
|
-
background-color:
|
|
173
|
-
box-shadow: 0 0 0 0.08333rem
|
|
170
|
+
background-color: #45c194;
|
|
171
|
+
box-shadow: 0 0 0 0.08333rem #45c194;
|
|
174
172
|
}
|
|
175
173
|
:global(.green) .radioItem:global(.game).selected .bg {
|
|
176
174
|
background-color: transparent;
|
|
@@ -184,8 +182,8 @@
|
|
|
184
182
|
:global(.spotlight-input-key) :global(.green) .radioItem:global(.game):global(.spottable):focus.selected .icon,
|
|
185
183
|
:global(.spotlight-input-mouse) :global(.green) .radioItem:global(.game):global(.spottable):focus.selected .icon {
|
|
186
184
|
color: var(--semantic-color-on-surface-main-selected);
|
|
187
|
-
background-color:
|
|
188
|
-
box-shadow: 0 0 0 0.08333rem
|
|
185
|
+
background-color: #45c194;
|
|
186
|
+
box-shadow: 0 0 0 0.08333rem #45c194;
|
|
189
187
|
}
|
|
190
188
|
:global(.spotlight-input-touch) :global(.green) .radioItem:global(.game):global(.spottable):active .icon {
|
|
191
189
|
color: transparent;
|
|
@@ -194,8 +192,8 @@
|
|
|
194
192
|
}
|
|
195
193
|
:global(.spotlight-input-touch) :global(.green) .radioItem:global(.game):global(.spottable):active.selected .icon {
|
|
196
194
|
color: var(--semantic-color-on-surface-main-selected);
|
|
197
|
-
background-color:
|
|
198
|
-
box-shadow: 0 0 0 0.08333rem
|
|
195
|
+
background-color: #45c194;
|
|
196
|
+
box-shadow: 0 0 0 0.08333rem #45c194;
|
|
199
197
|
}
|
|
200
198
|
:global(.orange) .radioItem:global(.game) {
|
|
201
199
|
--semantic-color-surface-default: #422923;
|
|
@@ -208,8 +206,8 @@
|
|
|
208
206
|
}
|
|
209
207
|
:global(.orange) .radioItem:global(.game).selected .icon {
|
|
210
208
|
color: var(--semantic-color-on-surface-main-selected);
|
|
211
|
-
background-color:
|
|
212
|
-
box-shadow: 0 0 0 0.08333rem
|
|
209
|
+
background-color: #d75431;
|
|
210
|
+
box-shadow: 0 0 0 0.08333rem #d75431;
|
|
213
211
|
}
|
|
214
212
|
:global(.orange) .radioItem:global(.game).selected .bg {
|
|
215
213
|
background-color: transparent;
|
|
@@ -223,8 +221,8 @@
|
|
|
223
221
|
:global(.spotlight-input-key) :global(.orange) .radioItem:global(.game):global(.spottable):focus.selected .icon,
|
|
224
222
|
:global(.spotlight-input-mouse) :global(.orange) .radioItem:global(.game):global(.spottable):focus.selected .icon {
|
|
225
223
|
color: var(--semantic-color-on-surface-main-selected);
|
|
226
|
-
background-color:
|
|
227
|
-
box-shadow: 0 0 0 0.08333rem
|
|
224
|
+
background-color: #d75431;
|
|
225
|
+
box-shadow: 0 0 0 0.08333rem #d75431;
|
|
228
226
|
}
|
|
229
227
|
:global(.spotlight-input-touch) :global(.orange) .radioItem:global(.game):global(.spottable):active .icon {
|
|
230
228
|
color: transparent;
|
|
@@ -233,6 +231,6 @@
|
|
|
233
231
|
}
|
|
234
232
|
:global(.spotlight-input-touch) :global(.orange) .radioItem:global(.game):global(.spottable):active.selected .icon {
|
|
235
233
|
color: var(--semantic-color-on-surface-main-selected);
|
|
236
|
-
background-color:
|
|
237
|
-
box-shadow: 0 0 0 0.08333rem
|
|
234
|
+
background-color: #d75431;
|
|
235
|
+
box-shadow: 0 0 0 0.08333rem #d75431;
|
|
238
236
|
}
|
package/Scroller/Scroller.d.ts
CHANGED
|
@@ -221,6 +221,18 @@ corresponding internal elements and states of this component.
|
|
|
221
221
|
* Scrolls to the container created by when descendants get focused.
|
|
222
222
|
*/
|
|
223
223
|
scrollToContentContainerOnFocus?: boolean;
|
|
224
|
+
/**
|
|
225
|
+
* Anchors the focused item to a fixed "focus position" while the content scrolls beneath it.
|
|
226
|
+
*
|
|
227
|
+
* When set to `'start'` and `direction` is `'horizontal'` , moving focus with 5-way keys keeps
|
|
228
|
+
the focus indicator at a fixed slot near the start (left in LTR, right in RTL) edge of the
|
|
229
|
+
scroller and scrolls the list so the newly focused item lands in that slot. At the end of the
|
|
230
|
+
list, when the item can no longer reach the fixed slot, the list scrolls only to its last
|
|
231
|
+
position so the focused item (including its full width) stays visible.
|
|
232
|
+
*
|
|
233
|
+
* By default ( `undefined` ), the scroller scrolls just enough to bring the focused item into view.
|
|
234
|
+
*/
|
|
235
|
+
stickTo?: "start";
|
|
224
236
|
/**
|
|
225
237
|
* Specifies how to show vertical scrollbar.
|
|
226
238
|
*/
|
package/Scroller/Scroller.js
CHANGED
|
@@ -448,6 +448,21 @@ _Scroller.propTypes = /** @lends limestone/Scroller.Scroller.prototype */{
|
|
|
448
448
|
* @public
|
|
449
449
|
*/
|
|
450
450
|
scrollToContentContainerOnFocus: _propTypes["default"].bool,
|
|
451
|
+
/**
|
|
452
|
+
* Anchors the focused item to a fixed "focus position" while the content scrolls beneath it.
|
|
453
|
+
*
|
|
454
|
+
* When set to `'start'` and `direction` is `'horizontal'`, moving focus with 5-way keys keeps
|
|
455
|
+
* the focus indicator at a fixed slot near the start (left in LTR, right in RTL) edge of the
|
|
456
|
+
* scroller and scrolls the list so the newly focused item lands in that slot. At the end of the
|
|
457
|
+
* list, when the item can no longer reach the fixed slot, the list scrolls only to its last
|
|
458
|
+
* position so the focused item (including its full width) stays visible.
|
|
459
|
+
*
|
|
460
|
+
* By default (`undefined`), the scroller scrolls just enough to bring the focused item into view.
|
|
461
|
+
*
|
|
462
|
+
* @type {('start')}
|
|
463
|
+
* @public
|
|
464
|
+
*/
|
|
465
|
+
stickTo: _propTypes["default"].oneOf(['start']),
|
|
451
466
|
/**
|
|
452
467
|
* Specifies how to show vertical scrollbar.
|
|
453
468
|
*
|
|
@@ -245,4 +245,33 @@ describe('Scroller', function () {
|
|
|
245
245
|
expect(verticalScrollbar).toHaveClass('vertical');
|
|
246
246
|
});
|
|
247
247
|
});
|
|
248
|
+
describe('stickTo', function () {
|
|
249
|
+
test('should compute a stick-to-start scroll position when a contained item is focused', function () {
|
|
250
|
+
var scrollToFn = global.Element.prototype.scrollTo;
|
|
251
|
+
global.Element.prototype.scrollTo = jest.fn();
|
|
252
|
+
var pointerSpy = jest.spyOn(_spotlight["default"], 'getPointerMode').mockReturnValue(false);
|
|
253
|
+
var currentSpy = jest.spyOn(_spotlight["default"], 'getCurrent');
|
|
254
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Scroller["default"], {
|
|
255
|
+
direction: "horizontal",
|
|
256
|
+
scrollToContentContainerOnFocus: false,
|
|
257
|
+
stickTo: "start",
|
|
258
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
259
|
+
style: {
|
|
260
|
+
width: '4000px'
|
|
261
|
+
},
|
|
262
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
263
|
+
"data-testid": "stick-target",
|
|
264
|
+
children: "Target"
|
|
265
|
+
})
|
|
266
|
+
})
|
|
267
|
+
}));
|
|
268
|
+
var target = _react.screen.getByTestId('stick-target');
|
|
269
|
+
currentSpy.mockReturnValue(target);
|
|
270
|
+
_react.fireEvent.focusIn(target);
|
|
271
|
+
expect(target).toBeInTheDocument();
|
|
272
|
+
currentSpy.mockRestore();
|
|
273
|
+
pointerSpy.mockRestore();
|
|
274
|
+
global.Element.prototype.scrollTo = scrollToFn;
|
|
275
|
+
});
|
|
276
|
+
});
|
|
248
277
|
});
|
|
@@ -284,8 +284,11 @@ var useSpottable = function useSpottable(props, instances) {
|
|
|
284
284
|
itemLeft = _getFocusedItemBounds.left,
|
|
285
285
|
itemWidth = _getFocusedItemBounds.width;
|
|
286
286
|
var rtl = props.rtl,
|
|
287
|
+
stickTo = props.stickTo,
|
|
287
288
|
coordinateCoefficient = rtl && !(_platform["default"].chrome < 85) ? -1 : 1,
|
|
288
|
-
|
|
289
|
+
_scrollContentHandle$ = scrollContentHandle.current.scrollBounds,
|
|
290
|
+
clientWidth = _scrollContentHandle$.clientWidth,
|
|
291
|
+
maxLeft = _scrollContentHandle$.maxLeft,
|
|
289
292
|
rtlDirection = rtl ? -1 : 1,
|
|
290
293
|
_scrollContentNode$ge = scrollContentNode.getBoundingClientRect(),
|
|
291
294
|
containerLeft = _scrollContentNode$ge.left,
|
|
@@ -293,6 +296,18 @@ var useSpottable = function useSpottable(props, instances) {
|
|
|
293
296
|
currentScrollLeft = rtl && coordinateCoefficient === 1 ? scrollContentHandle.current.scrollBounds.maxLeft - scrollLastPosition : scrollLastPosition,
|
|
294
297
|
newItemLeft = coordinateCoefficient * scrollContentNode.scrollLeft + (itemLeft - containerLeft);
|
|
295
298
|
var nextScrollLeft = scrollContentHandle.current.scrollPos.left;
|
|
299
|
+
if (stickTo === 'start') {
|
|
300
|
+
// Anchor the focused item to a fixed "focus position" near the start edge so the focus
|
|
301
|
+
// indicator stays put while the list scrolls beneath it. The offset matches the in-view
|
|
302
|
+
// threshold (`affordanceSize`) used by `calculatePositionOnFocus`.
|
|
303
|
+
var affordanceLeft = _resolution["default"].scale(_useScroll.affordanceSize);
|
|
304
|
+
|
|
305
|
+
// Position the item at the fixed slot, then clamp to the scroll bounds. Clamping handles
|
|
306
|
+
// the end of the list: the item can no longer reach the slot, so the list scrolls only to
|
|
307
|
+
// its last position while the focused item (including its full width) stays visible.
|
|
308
|
+
nextScrollLeft += rtlDirection * (newItemLeft - currentScrollLeft - affordanceLeft);
|
|
309
|
+
return Math.max(0, Math.min(nextScrollLeft, maxLeft));
|
|
310
|
+
}
|
|
296
311
|
if (newItemLeft + itemWidth > clientWidth + currentScrollLeft && itemWidth < clientWidth) {
|
|
297
312
|
// If focus is moved to an element outside of view area (to the right), scroller will move
|
|
298
313
|
// to the right just enough to show the current `focusedItem`. This does not apply to
|
|
@@ -325,7 +340,11 @@ var useSpottable = function useSpottable(props, instances) {
|
|
|
325
340
|
}
|
|
326
341
|
var containerRect = (0, _utils.getRect)(containerNode);
|
|
327
342
|
var itemRect = (0, _utils.getRect)(item);
|
|
328
|
-
|
|
343
|
+
|
|
344
|
+
// When anchoring focus to a fixed slot, always recompute the scroll position so each newly
|
|
345
|
+
// focused item is pulled to the slot rather than only when it falls outside the view.
|
|
346
|
+
var stickToStart = props.stickTo === 'start';
|
|
347
|
+
if (horizontal && (stickToStart || !(itemRect.left >= containerRect.left + _resolution["default"].scale(_useScroll.affordanceSize) && itemRect.right <= containerRect.right - _resolution["default"].scale(_useScroll.affordanceSize)))) {
|
|
329
348
|
scrollContentHandle.current.scrollPos.left = calculateScrollLeft(item, scrollPosition);
|
|
330
349
|
}
|
|
331
350
|
if (vertical && !(itemRect.top >= containerRect.top && itemRect.bottom <= containerRect.bottom - _resolution["default"].scale(_useScroll.affordanceSize))) {
|
|
@@ -363,6 +382,7 @@ var useThemeScroller = exports.useThemeScroller = function useThemeScroller(prop
|
|
|
363
382
|
delete rest.scrollContentHandle;
|
|
364
383
|
delete rest.setThemeScrollContentHandle;
|
|
365
384
|
delete rest.spotlightId;
|
|
385
|
+
delete rest.stickTo;
|
|
366
386
|
|
|
367
387
|
// Hooks
|
|
368
388
|
var isScrollbarVisible = isHorizontalScrollbarVisible || isVerticalScrollbarVisible;
|
package/Slider/Slider.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { ChangeableProps as ui_Changeable_ChangeableProps } from "@enact/ui/Changeable";
|
|
4
4
|
import { SpottableProps as spotlight_Spottable_SpottableProps } from "@enact/spotlight/Spottable";
|
|
5
|
-
import { SkinnableProps as limestone_Skinnable_SkinnableProps } from "limestone/Skinnable";
|
|
5
|
+
import { SkinnableProps as limestone_Skinnable_SkinnableProps } from "@enact/limestone/Skinnable";
|
|
6
6
|
import { SlottableProps as ui_Slottable_SlottableProps } from "@enact/ui/Slottable";
|
|
7
7
|
import { SliderDecoratorProps as ui_Slider_SliderDecoratorProps } from "@enact/ui/Slider";
|
|
8
8
|
import * as React from "react";
|