@enact/limestone 1.9.3 → 1.10.1
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/workflows/ci-reusable.yml +2 -2
- package/ActionGuide/ActionGuide.module.css +4 -0
- package/Alert/Alert.d.ts +9 -0
- package/Alert/Alert.js +35 -4
- package/Alert/Alert.module.css +12 -1
- package/Alert/tests/Alert-specs.js +91 -0
- package/BodyText/BodyText.module.css +21 -0
- package/Button/Button.module.css +72 -40
- package/Button/tests/Button-specs.js +26 -0
- package/CHANGELOG.md +74 -0
- package/Card/Card.d.ts +4 -4
- package/Card/Card.js +10 -8
- package/Card/Card.module.css +31 -7
- package/Card/tests/Card-specs.js +39 -5
- package/Checkbox/Checkbox.module.css +4 -0
- package/CheckboxItem/CheckboxItem.js +6 -4
- package/Chips/Chip.js +12 -6
- package/Chips/Chip.module.css +3 -0
- package/Chips/Chips.js +12 -6
- package/Chips/tests/Chip-specs.js +25 -5
- package/Chips/tests/Chips-specs.js +12 -2
- package/ColorPicker/ColorPicker.js +27 -25
- package/ContextualPopupDecorator/ContextualPopupDecorator.js +32 -22
- package/DayPicker/DaySelectorDecorator.js +12 -7
- package/Dropdown/Dropdown.module.css +4 -0
- package/Dropdown/DropdownList.js +74 -53
- package/FlexiblePopupPanels/useNavButtonFocus.js +7 -10
- package/Heading/Heading.d.ts +1 -1
- package/Heading/Heading.js +2 -2
- package/Heading/Heading.module.css +16 -0
- package/Icon/Icon.d.ts +1 -0
- package/Icon/Icon.js +1 -0
- package/Icon/Icon.module.css +12 -0
- package/Icon/IconList.js +2 -0
- package/IconItem/IconItem.module.css +19 -3
- package/IconItem/tests/IconItem-specs.js +30 -1
- package/Image/Image.js +6 -4
- package/ImageItem/ImageItem.module.css +17 -0
- package/Input/Input.js +12 -1
- package/Input/Input.module.css +25 -9
- package/Input/InputField.js +75 -24
- package/Input/InputField.module.css +280 -45
- package/Input/InputFieldDecoratorIcon.js +1 -0
- package/Input/InputFieldSpotlightDecorator.js +53 -8
- package/Input/index.d.ts +105 -93
- package/Input/tests/Input-specs.js +26 -0
- package/Input/tests/InputField-specs.js +149 -3
- package/Input/tests/InputPopup-specs.js +1 -1
- package/Item/Item.module.css +2 -1
- package/KeyGuide/KeyGuide.js +29 -27
- package/KeyGuide/KeyGuide.module.css +10 -0
- package/MediaOverlay/MediaOverlay.module.css +16 -4
- package/MediaOverlay/tests/MediaOverlay-specs.js +29 -0
- package/MediaPlayer/MediaControls.module.css +3 -0
- package/MediaPlayer/Times.module.css +4 -0
- package/MediaPlayer/tests/util-specs.js +4 -1
- package/PageViews/PageViews.js +134 -69
- package/PageViews/PageViews.module.css +7 -0
- package/PageViews/PageViewsRouter.js +91 -42
- package/PageViews/tests/PageViews-specs.js +87 -0
- package/Panels/Header.js +6 -4
- package/Panels/Header.module.css +37 -31
- package/Popup/Popup.js +5 -4
- package/PopupTabLayout/PopupTabLayout.js +11 -9
- package/PopupTabLayout/PopupTabLayout.module.css +18 -0
- package/RadioItem/RadioItem.js +7 -5
- package/RadioItem/RadioItem.module.css +5 -0
- package/Scroller/EditableWrapper.js +19 -15
- package/Scroller/Scroller.js +11 -10
- package/Scroller/Scroller.module.css +10 -0
- package/Scroller/tests/Scroller-specs.js +91 -2
- package/Scroller/useThemeScroller.js +6 -3
- package/Slider/Slider.d.ts +4 -0
- package/Slider/Slider.js +40 -16
- package/Slider/Slider.module.css +150 -3
- package/Slider/SliderBehaviorDecorator.js +16 -14
- package/Slider/tests/Slider-specs.js +51 -0
- package/Slider/utils.js +23 -7
- package/Spinner/Spinner.js +10 -8
- package/Steps/Steps.module.css +3 -0
- package/Switch/Switch.module.css +15 -1
- package/TabLayout/RefocusDecorator.js +14 -12
- package/TabLayout/TabGroup.module.css +1 -1
- package/TabLayout/tests/TabGroup-specs.js +1 -1
- package/ThemeDecorator/AccessibilityDecorator.js +12 -11
- package/ThemeDecorator/I18nFontDecorator.js +6 -4
- package/ThemeDecorator/ThemeDecorator.d.ts +7 -0
- package/ThemeDecorator/ThemeDecorator.js +24 -9
- package/TimePicker/TimePicker.module.css +3 -0
- package/TimePicker/TimePickerBase.js +5 -3
- package/TooltipDecorator/Tooltip.module.css +4 -0
- package/TooltipDecorator/TooltipDecorator.js +12 -7
- package/TooltipDecorator/tests/useTooltip-specs.js +5 -2
- package/VideoPlayer/Feedback.module.css +3 -0
- package/VideoPlayer/FeedbackTooltip.module.css +7 -0
- package/VideoPlayer/MediaTitle.module.css +8 -0
- package/VideoPlayer/VideoPlayer.js +25 -24
- package/VirtualList/VirtualList.js +20 -18
- package/VirtualList/useSpotlight.js +1 -1
- package/fonts/Limestone_Icons.ttf +0 -0
- package/internal/AsyncRenderChildren/AsyncRenderChildren.js +9 -5
- package/internal/AsyncRenderChildren/tests/AsyncRenderChildren-specs.js +4 -1
- package/internal/DateTime/DateTime.module.css +3 -0
- package/internal/DateTime/DateTimeDecorator.js +5 -4
- package/internal/Panels/PanelsRouter.js +35 -29
- package/internal/Panels/useAutoFocus.js +10 -6
- package/internal/Panels/useFocusOnTransition.js +4 -3
- package/internal/Picker/Picker.js +7 -5
- package/internal/Picker/Picker.module.css +22 -0
- package/internal/Picker/SpottablePicker.js +15 -13
- package/internal/SharedStateDecorator/SharedStateDecorator.js +6 -4
- package/package.json +15 -12
- package/styles/colors.less +1 -0
- package/styles/variables.less +118 -26
- package/useScroll/HoverToScroll.js +15 -12
- package/useScroll/Scrollbar.js +14 -10
- package/useScroll/ScrollbarPlaceholder.js +4 -1
- package/useScroll/ScrollbarTrack.js +7 -5
- package/useScroll/useEvent.js +7 -2
- package/useScroll/useScroll.js +10 -2
|
@@ -170,8 +170,8 @@ Motion Mixins
|
|
|
170
170
|
transform: scale(1.05);
|
|
171
171
|
transition: transform var(--lime-press-motion-duration) var(--lime-press-motion-easing-function);
|
|
172
172
|
}
|
|
173
|
-
:global(.spotlight-input-key) .iconItem:not([disabled]):global(.spottable):focus:not(
|
|
174
|
-
:global(.spotlight-input-mouse) .iconItem:not([disabled]):global(.spottable):focus:not(
|
|
173
|
+
:global(.spotlight-input-key) .iconItem:not([disabled]):global(.spottable):focus:not(:pressed),
|
|
174
|
+
:global(.spotlight-input-mouse) .iconItem:not([disabled]):global(.spottable):focus:not(:pressed) {
|
|
175
175
|
transform: scale(1.1);
|
|
176
176
|
transition: transform var(--lime-release-motion-duration) var(--lime-release-motion-easing-function);
|
|
177
177
|
}
|
|
@@ -180,13 +180,29 @@ Motion Mixins
|
|
|
180
180
|
transform: scale(1.05);
|
|
181
181
|
transition: transform var(--lime-press-motion-duration) var(--lime-press-motion-easing-function);
|
|
182
182
|
}
|
|
183
|
-
:global(.spotlight-input-touch) .iconItem:not([disabled]):global(.spottable):active:not(
|
|
183
|
+
:global(.spotlight-input-touch) .iconItem:not([disabled]):global(.spottable):active:not(:pressed) {
|
|
184
184
|
transform: scale(1.1);
|
|
185
185
|
transition: transform var(--lime-release-motion-duration) var(--lime-release-motion-easing-function);
|
|
186
186
|
}
|
|
187
187
|
:global(.noAnimation) .iconItem {
|
|
188
188
|
transition: none;
|
|
189
189
|
}
|
|
190
|
+
.iconItem:global(.largeText).hasTitle {
|
|
191
|
+
height: calc( 5.33333rem + 1.45833rem + 24px);
|
|
192
|
+
}
|
|
193
|
+
.iconItem:global(.largeText) .icon {
|
|
194
|
+
height: 3.04167rem;
|
|
195
|
+
width: 3.04167rem;
|
|
196
|
+
line-height: 3.04167rem;
|
|
197
|
+
}
|
|
198
|
+
.iconItem:global(.largeText) .label {
|
|
199
|
+
font-size: var(--primitive-font-size-50);
|
|
200
|
+
line-height: 1.33333rem;
|
|
201
|
+
}
|
|
202
|
+
.iconItem:global(.largeText) .title {
|
|
203
|
+
font-size: var(--primitive-font-size-58);
|
|
204
|
+
line-height: 1.45833rem;
|
|
205
|
+
}
|
|
190
206
|
.iconItem:global(.neutral).bordered .content {
|
|
191
207
|
border-color: var(--semantic-color-stroke-white);
|
|
192
208
|
}
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
require("@testing-library/jest-dom");
|
|
4
4
|
var _react = require("@testing-library/react");
|
|
5
|
-
var _IconItem = require("../IconItem");
|
|
5
|
+
var _IconItem = _interopRequireWildcard(require("../IconItem"));
|
|
6
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
7
8
|
describe('IconItem', function () {
|
|
8
9
|
test('should support `background` prop', function () {
|
|
9
10
|
var background = '#ffffff';
|
|
@@ -103,4 +104,32 @@ describe('IconItem', function () {
|
|
|
103
104
|
var actual = _react.screen.getByTestId('iconitem');
|
|
104
105
|
expect(actual).toHaveClass(expected);
|
|
105
106
|
});
|
|
107
|
+
test('should be pressed when selected', function () {
|
|
108
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_IconItem["default"], {
|
|
109
|
+
"data-testid": "iconitem"
|
|
110
|
+
}));
|
|
111
|
+
var iconItem = _react.screen.getByTestId('iconitem');
|
|
112
|
+
|
|
113
|
+
// Select by key
|
|
114
|
+
_react.fireEvent.keyDown(iconItem, {
|
|
115
|
+
key: 'Enter',
|
|
116
|
+
code: 'Enter',
|
|
117
|
+
keyCode: 13,
|
|
118
|
+
which: 13
|
|
119
|
+
});
|
|
120
|
+
expect(iconItem).toHaveClass('pressed');
|
|
121
|
+
_react.fireEvent.keyUp(iconItem, {
|
|
122
|
+
key: 'Enter',
|
|
123
|
+
code: 'Enter',
|
|
124
|
+
keyCode: 13,
|
|
125
|
+
which: 13
|
|
126
|
+
});
|
|
127
|
+
expect(iconItem).not.toHaveClass('pressed');
|
|
128
|
+
|
|
129
|
+
// Select by pointer
|
|
130
|
+
_react.fireEvent.mouseDown(iconItem);
|
|
131
|
+
expect(iconItem).toHaveClass('pressed');
|
|
132
|
+
_react.fireEvent.mouseUp(iconItem);
|
|
133
|
+
expect(iconItem).not.toHaveClass('pressed');
|
|
134
|
+
});
|
|
106
135
|
});
|
package/Image/Image.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = exports.ImageDecorator = exports.ImageBase = exports.Image = void 0;
|
|
7
7
|
var _kind = _interopRequireDefault(require("@enact/core/kind"));
|
|
8
8
|
var _hoc = _interopRequireDefault(require("@enact/core/hoc"));
|
|
9
|
+
var _util = require("@enact/core/util");
|
|
9
10
|
var _Image = require("@enact/ui/Image");
|
|
10
11
|
var _propTypes = _interopRequireDefault(require("@enact/core/internal/prop-types"));
|
|
11
12
|
var _ForwardRef = _interopRequireDefault(require("@enact/ui/ForwardRef"));
|
|
@@ -106,7 +107,8 @@ var ImageBase = exports.ImageBase = (0, _kind["default"])({
|
|
|
106
107
|
// another time. -B 2018-05-01
|
|
107
108
|
var ResponsiveImageDecorator = (0, _hoc["default"])(function (config, Wrapped) {
|
|
108
109
|
// eslint-disable-next-line no-shadow
|
|
109
|
-
var
|
|
110
|
+
var _ResponsiveImageDecorator = function ResponsiveImageDecorator(props) {
|
|
111
|
+
(0, _util.checkPropTypes)(_ResponsiveImageDecorator, props);
|
|
110
112
|
var _useState = (0, _react.useState)((0, _resolution.selectSrc)(props.src)),
|
|
111
113
|
_useState2 = _slicedToArray(_useState, 2),
|
|
112
114
|
setSrc = _useState2[1];
|
|
@@ -122,11 +124,11 @@ var ResponsiveImageDecorator = (0, _hoc["default"])(function (config, Wrapped) {
|
|
|
122
124
|
|
|
123
125
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapped, _objectSpread({}, props));
|
|
124
126
|
};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
_ResponsiveImageDecorator.displayName = 'ResponsiveImageDecorator';
|
|
128
|
+
_ResponsiveImageDecorator.propTypes = {
|
|
127
129
|
src: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].object])
|
|
128
130
|
};
|
|
129
|
-
return
|
|
131
|
+
return _ResponsiveImageDecorator;
|
|
130
132
|
});
|
|
131
133
|
|
|
132
134
|
/**
|
|
@@ -48,6 +48,23 @@
|
|
|
48
48
|
:global(.enact-locale-vi) .imageItem .label {
|
|
49
49
|
font-size: var(--primitive-font-size-36);
|
|
50
50
|
}
|
|
51
|
+
.imageItem:global(.largeText) .caption {
|
|
52
|
+
font-size: var(--primitive-font-size-72);
|
|
53
|
+
line-height: 2.08333rem;
|
|
54
|
+
}
|
|
55
|
+
.imageItem:global(.largeText) .label {
|
|
56
|
+
font-size: var(--primitive-font-size-58);
|
|
57
|
+
line-height: 1.45833rem;
|
|
58
|
+
}
|
|
59
|
+
.imageItem:global(.largeText).vertical .selectionContainer .selectionIcon {
|
|
60
|
+
width: 3rem;
|
|
61
|
+
height: 3rem;
|
|
62
|
+
line-height: 3rem;
|
|
63
|
+
}
|
|
64
|
+
.imageItem:global(.largeText).vertical .imageIcon {
|
|
65
|
+
width: 3.3rem;
|
|
66
|
+
height: 3.3rem;
|
|
67
|
+
}
|
|
51
68
|
.imageItem.vertical.fullImage {
|
|
52
69
|
border-radius: 0;
|
|
53
70
|
padding: var(--primitive-spacing-60);
|
package/Input/Input.js
CHANGED
|
@@ -29,7 +29,7 @@ var _InputField = _interopRequireDefault(require("./InputField"));
|
|
|
29
29
|
var _util2 = require("./util");
|
|
30
30
|
var _InputModule = _interopRequireDefault(require("./Input.module.css"));
|
|
31
31
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
32
|
-
var _excluded = ["announce", "backButtonAriaLabel", "buttons", "children", "css", "defaultValue", "disabled", "inputAreaClassName", "inputFieldSpotlightId", "noBackButton", "noSubmitButton", "numberInputField", "onBeforeChange", "onClose", "onNumberComplete", "onInputKeyDown", "onShow", "open", "placeholder", "popupAriaLabel", "popupClassName", "popupType", "size", "subtitle", "title", "type", "maxLength", "minLength"],
|
|
32
|
+
var _excluded = ["announce", "backButtonAriaLabel", "buttons", "children", "css", "defaultValue", "disabled", "inputAreaClassName", "inputFieldSpotlightId", "marqueeInputField", "noBackButton", "noSubmitButton", "numberInputField", "onBeforeChange", "onClose", "onNumberComplete", "onInputKeyDown", "onShow", "open", "placeholder", "popupAriaLabel", "popupClassName", "popupType", "size", "subtitle", "title", "type", "maxLength", "minLength"],
|
|
33
33
|
_excluded2 = ["value"],
|
|
34
34
|
_excluded3 = ["announce", "buttonAriaLabel", "buttonLabel", "type", "size", "disabled", "value", "placeholder", "onClick", "className", "style"];
|
|
35
35
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -148,6 +148,14 @@ var InputPopupBase = exports.InputPopupBase = (0, _kind["default"])({
|
|
|
148
148
|
* @public
|
|
149
149
|
*/
|
|
150
150
|
length: _propTypes["default"].number,
|
|
151
|
+
/**
|
|
152
|
+
* Wraps the `InputField`'s value display in a marquee.
|
|
153
|
+
*
|
|
154
|
+
* @type {Boolean}
|
|
155
|
+
* @default false
|
|
156
|
+
* @public
|
|
157
|
+
*/
|
|
158
|
+
marqueeInputField: _propTypes["default"].bool,
|
|
151
159
|
/**
|
|
152
160
|
* The maximum length of number input fields.
|
|
153
161
|
*
|
|
@@ -298,6 +306,7 @@ var InputPopupBase = exports.InputPopupBase = (0, _kind["default"])({
|
|
|
298
306
|
},
|
|
299
307
|
defaultProps: {
|
|
300
308
|
defaultValue: '',
|
|
309
|
+
marqueeInputField: false,
|
|
301
310
|
popupType: 'fullscreen',
|
|
302
311
|
numberInputField: 'auto',
|
|
303
312
|
size: 'small',
|
|
@@ -384,6 +393,7 @@ var InputPopupBase = exports.InputPopupBase = (0, _kind["default"])({
|
|
|
384
393
|
disabled = _ref8.disabled,
|
|
385
394
|
inputAreaClassName = _ref8.inputAreaClassName,
|
|
386
395
|
inputFieldSpotlightId = _ref8.inputFieldSpotlightId,
|
|
396
|
+
marqueeInputField = _ref8.marqueeInputField,
|
|
387
397
|
noBackButton = _ref8.noBackButton,
|
|
388
398
|
noSubmitButton = _ref8.noSubmitButton,
|
|
389
399
|
numberInputField = _ref8.numberInputField,
|
|
@@ -485,6 +495,7 @@ var InputPopupBase = exports.InputPopupBase = (0, _kind["default"])({
|
|
|
485
495
|
css: css,
|
|
486
496
|
maxLength: maxLength,
|
|
487
497
|
minLength: minLength,
|
|
498
|
+
marqueeContent: marqueeInputField,
|
|
488
499
|
size: size,
|
|
489
500
|
autoFocus: true,
|
|
490
501
|
type: type,
|
package/Input/Input.module.css
CHANGED
|
@@ -80,6 +80,10 @@
|
|
|
80
80
|
.inputPopup .inputArea .contentArea {
|
|
81
81
|
/* Available for customization */
|
|
82
82
|
}
|
|
83
|
+
.inputPopup:global(.largeText) .tooltip .tooltipLabel {
|
|
84
|
+
font-size: var(--primitive-font-size-58);
|
|
85
|
+
line-height: 1.45833rem;
|
|
86
|
+
}
|
|
83
87
|
:global(.enact-locale-right-to-left) .inputPopup .keypad {
|
|
84
88
|
direction: ltr;
|
|
85
89
|
}
|
|
@@ -92,6 +96,9 @@
|
|
|
92
96
|
.inputPopup .keypad .key .icon {
|
|
93
97
|
font-size: var(--primitive-font-size-90);
|
|
94
98
|
}
|
|
99
|
+
.inputPopup .keypad .key .icon:global(.largeText) {
|
|
100
|
+
font-size: var(--primitive-font-size-108);
|
|
101
|
+
}
|
|
95
102
|
.inputPopup.fullscreen .back {
|
|
96
103
|
top: var(--primitive-spacing-108);
|
|
97
104
|
left: var(--primitive-spacing-132);
|
|
@@ -152,9 +159,6 @@
|
|
|
152
159
|
:global(.enact-orientation-portrait) .inputPopup.fullscreen .keypad {
|
|
153
160
|
margin: var(--primitive-spacing-132) auto 0 auto;
|
|
154
161
|
}
|
|
155
|
-
:global(.enact-text-large) .inputPopup.fullscreen .keypad .key {
|
|
156
|
-
height: 4rem;
|
|
157
|
-
}
|
|
158
162
|
.inputPopup.fullscreen .buttonArea {
|
|
159
163
|
margin: 0;
|
|
160
164
|
display: flex;
|
|
@@ -241,12 +245,6 @@
|
|
|
241
245
|
justify-content: flex-end;
|
|
242
246
|
column-gap: var(--primitive-spacing-60);
|
|
243
247
|
}
|
|
244
|
-
:global(.enact-text-large) .inputPopup.overlay .keypad {
|
|
245
|
-
width: 14.5rem;
|
|
246
|
-
}
|
|
247
|
-
:global(.enact-text-large) .inputPopup.overlay .keypad .key {
|
|
248
|
-
height: 4rem;
|
|
249
|
-
}
|
|
250
248
|
.inputPopup.overlay .buttonArea {
|
|
251
249
|
align-items: center;
|
|
252
250
|
display: flex;
|
|
@@ -257,6 +255,24 @@
|
|
|
257
255
|
.inputPopup.overlay .tooltip .tooltipLabel {
|
|
258
256
|
max-width: 15.375rem;
|
|
259
257
|
}
|
|
258
|
+
.inputPopup:global(.largeText).fullscreen .numberCell.password {
|
|
259
|
+
font-size: var(--primitive-font-size-56);
|
|
260
|
+
}
|
|
261
|
+
.inputPopup:global(.largeText).fullscreen .joined {
|
|
262
|
+
font-size: var(--primitive-font-size-94);
|
|
263
|
+
}
|
|
264
|
+
.inputPopup:global(.largeText).fullscreen .joined.password {
|
|
265
|
+
font-size: var(--primitive-font-size-56);
|
|
266
|
+
}
|
|
267
|
+
.inputPopup:global(.largeText).overlay .numberCell.password {
|
|
268
|
+
font-size: var(--primitive-font-size-48);
|
|
269
|
+
}
|
|
270
|
+
.inputPopup:global(.largeText).overlay .joined {
|
|
271
|
+
font-size: var(--primitive-font-size-94);
|
|
272
|
+
}
|
|
273
|
+
.inputPopup:global(.largeText).overlay .joined.password {
|
|
274
|
+
font-size: var(--primitive-font-size-48);
|
|
275
|
+
}
|
|
260
276
|
.inputPopup:global(.neutral) {
|
|
261
277
|
background-color: var(--semantic-color-background-full-default);
|
|
262
278
|
}
|
package/Input/InputField.js
CHANGED
|
@@ -13,11 +13,12 @@ var _AnnounceDecorator = require("@enact/ui/AnnounceDecorator");
|
|
|
13
13
|
var _Changeable = _interopRequireDefault(require("@enact/ui/Changeable"));
|
|
14
14
|
var _Pure = _interopRequireDefault(require("@enact/ui/internal/Pure"));
|
|
15
15
|
var _speech = require("@enact/webos/speech");
|
|
16
|
-
var
|
|
16
|
+
var _classnames3 = _interopRequireDefault(require("classnames"));
|
|
17
17
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
18
18
|
var _compose = _interopRequireDefault(require("ramda/src/compose"));
|
|
19
19
|
var _react = require("react");
|
|
20
20
|
var _$L = _interopRequireDefault(require("../internal/$L"));
|
|
21
|
+
var _Marquee = require("../Marquee");
|
|
21
22
|
var _Skinnable = _interopRequireDefault(require("../Skinnable"));
|
|
22
23
|
var _Tooltip = _interopRequireDefault(require("../TooltipDecorator/Tooltip"));
|
|
23
24
|
var _util2 = require("../internal/util");
|
|
@@ -26,7 +27,23 @@ var _InputFieldSpotlightDecorator = _interopRequireDefault(require("./InputField
|
|
|
26
27
|
var _util3 = require("./util");
|
|
27
28
|
var _InputFieldModule = _interopRequireDefault(require("./InputField.module.css"));
|
|
28
29
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
|
-
var _excluded = ["css", "dir", "disabled", "iconAfter", "iconBefore", "invalidTooltip", "onChange", "placeholder", "type", "value"];
|
|
30
|
+
var _excluded = ["css", "dir", "disabled", "iconAfter", "iconBefore", "invalidTooltip", "marqueeContent", "onChange", "placeholder", "type", "value"];
|
|
31
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
32
|
+
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; }
|
|
33
|
+
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; }
|
|
34
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
35
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
36
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
37
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
38
|
+
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; }
|
|
39
|
+
var MarqueeText = (0, _Marquee.MarqueeDecorator)({
|
|
40
|
+
css: {
|
|
41
|
+
text: _InputFieldModule["default"].marqueeTextInner,
|
|
42
|
+
animate: _InputFieldModule["default"].marqueeTextAnimate,
|
|
43
|
+
willAnimate: _InputFieldModule["default"].marqueeTextWillAnimate
|
|
44
|
+
}
|
|
45
|
+
}, 'div');
|
|
46
|
+
|
|
30
47
|
/**
|
|
31
48
|
* A Limestone styled input component.
|
|
32
49
|
*
|
|
@@ -38,17 +55,16 @@ var _excluded = ["css", "dir", "disabled", "iconAfter", "iconBefore", "invalidTo
|
|
|
38
55
|
* @ui
|
|
39
56
|
* @public
|
|
40
57
|
*/
|
|
41
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
42
|
-
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; }
|
|
43
|
-
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; }
|
|
44
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
45
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
46
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
47
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
48
|
-
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; }
|
|
49
58
|
var InputFieldBase = exports.InputFieldBase = (0, _kind["default"])({
|
|
50
59
|
name: 'InputField',
|
|
51
60
|
propTypes: /** @lends limestone/Input.InputFieldBase.prototype */{
|
|
61
|
+
/**
|
|
62
|
+
* Indicates the input is currently active/focused for editing
|
|
63
|
+
*
|
|
64
|
+
* @type {Boolean}
|
|
65
|
+
* @private
|
|
66
|
+
*/
|
|
67
|
+
active: _propTypes["default"].bool,
|
|
52
68
|
/**
|
|
53
69
|
* Passed by AnnounceDecorator for accessibility.
|
|
54
70
|
*
|
|
@@ -56,6 +72,14 @@ var InputFieldBase = exports.InputFieldBase = (0, _kind["default"])({
|
|
|
56
72
|
* @public
|
|
57
73
|
*/
|
|
58
74
|
announce: _propTypes["default"].func,
|
|
75
|
+
/**
|
|
76
|
+
* Moves the caret to the end of the text when the input receives focus.
|
|
77
|
+
*
|
|
78
|
+
* @type {Boolean}
|
|
79
|
+
* @default false
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
82
|
+
caretToEndOnFocus: _propTypes["default"].bool,
|
|
59
83
|
/**
|
|
60
84
|
* Customizes the component by mapping the supplied collection of CSS class names to the
|
|
61
85
|
* corresponding internal elements and states of this component.
|
|
@@ -128,6 +152,14 @@ var InputFieldBase = exports.InputFieldBase = (0, _kind["default"])({
|
|
|
128
152
|
* @public
|
|
129
153
|
*/
|
|
130
154
|
invalidMessage: _propTypes["default"].string,
|
|
155
|
+
/**
|
|
156
|
+
* Wraps the input's value/placeholder display in a marquee.
|
|
157
|
+
*
|
|
158
|
+
* @type {Boolean}
|
|
159
|
+
* @default false
|
|
160
|
+
* @public
|
|
161
|
+
*/
|
|
162
|
+
marqueeContent: _propTypes["default"].bool,
|
|
131
163
|
/**
|
|
132
164
|
* Called before the input value is changed.
|
|
133
165
|
*
|
|
@@ -224,9 +256,12 @@ var InputFieldBase = exports.InputFieldBase = (0, _kind["default"])({
|
|
|
224
256
|
value: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number])
|
|
225
257
|
},
|
|
226
258
|
defaultProps: {
|
|
259
|
+
active: false,
|
|
260
|
+
caretToEndOnFocus: false,
|
|
227
261
|
disabled: false,
|
|
228
262
|
dismissOnEnter: false,
|
|
229
263
|
invalid: false,
|
|
264
|
+
marqueeContent: false,
|
|
230
265
|
placeholder: '',
|
|
231
266
|
size: 'small',
|
|
232
267
|
type: 'text'
|
|
@@ -234,7 +269,7 @@ var InputFieldBase = exports.InputFieldBase = (0, _kind["default"])({
|
|
|
234
269
|
styles: {
|
|
235
270
|
css: _InputFieldModule["default"],
|
|
236
271
|
className: 'inputField',
|
|
237
|
-
publicClassNames: ['bg', 'inputField', 'input', 'inputHighlight', 'tooltip', 'tooltipLabel']
|
|
272
|
+
publicClassNames: ['bg', 'inputField', 'input', 'inputHighlight', 'inputWrapper', 'marqueeText', 'placeholderText', 'tooltip', 'tooltipLabel']
|
|
238
273
|
},
|
|
239
274
|
handlers: {
|
|
240
275
|
onChange: (0, _handle.handle)((0, _handle.forwardCustomWithPrevent)('onBeforeChange', function (ev) {
|
|
@@ -266,14 +301,18 @@ var InputFieldBase = exports.InputFieldBase = (0, _kind["default"])({
|
|
|
266
301
|
return (0, _util3.calcAriaLabel)(title, type, value);
|
|
267
302
|
},
|
|
268
303
|
className: function className(_ref3) {
|
|
269
|
-
var
|
|
304
|
+
var active = _ref3.active,
|
|
305
|
+
iconAfter = _ref3.iconAfter,
|
|
270
306
|
iconBefore = _ref3.iconBefore,
|
|
271
307
|
invalid = _ref3.invalid,
|
|
308
|
+
marqueeContent = _ref3.marqueeContent,
|
|
272
309
|
size = _ref3.size,
|
|
273
310
|
styler = _ref3.styler;
|
|
274
311
|
return styler.append({
|
|
312
|
+
active: active,
|
|
275
313
|
hasIconAfter: iconAfter,
|
|
276
314
|
hasIconBefore: iconBefore,
|
|
315
|
+
hasMarquee: marqueeContent,
|
|
277
316
|
invalid: invalid
|
|
278
317
|
}, size);
|
|
279
318
|
},
|
|
@@ -310,6 +349,7 @@ var InputFieldBase = exports.InputFieldBase = (0, _kind["default"])({
|
|
|
310
349
|
iconAfter = _ref7.iconAfter,
|
|
311
350
|
iconBefore = _ref7.iconBefore,
|
|
312
351
|
invalidTooltip = _ref7.invalidTooltip,
|
|
352
|
+
marqueeContent = _ref7.marqueeContent,
|
|
313
353
|
onChange = _ref7.onChange,
|
|
314
354
|
placeholder = _ref7.placeholder,
|
|
315
355
|
type = _ref7.type,
|
|
@@ -321,7 +361,9 @@ var InputFieldBase = exports.InputFieldBase = (0, _kind["default"])({
|
|
|
321
361
|
if (type === 'password' || type === 'passwordtel') {
|
|
322
362
|
inputProps.spellCheck = false;
|
|
323
363
|
}
|
|
364
|
+
delete rest.active;
|
|
324
365
|
delete rest.announce;
|
|
366
|
+
delete rest.caretToEndOnFocus;
|
|
325
367
|
delete rest.dismissOnEnter;
|
|
326
368
|
delete rest.invalid;
|
|
327
369
|
delete rest.invalidMessage;
|
|
@@ -341,17 +383,24 @@ var InputFieldBase = exports.InputFieldBase = (0, _kind["default"])({
|
|
|
341
383
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
342
384
|
className: css.inputHighlight,
|
|
343
385
|
children: value ? value : placeholder
|
|
344
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
386
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
387
|
+
className: css.inputWrapper,
|
|
388
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", _objectSpread(_objectSpread(_objectSpread({}, inputProps), voiceProps), {}, {
|
|
389
|
+
"aria-hidden": isPasswordtel,
|
|
390
|
+
className: (0, _classnames3["default"])(css.input, _defineProperty({}, css.passwordtel, isPasswordtel)),
|
|
391
|
+
dir: dir,
|
|
392
|
+
disabled: disabled,
|
|
393
|
+
onChange: onChange,
|
|
394
|
+
placeholder: placeholder,
|
|
395
|
+
tabIndex: -1,
|
|
396
|
+
type: isPasswordtel ? 'tel' : type,
|
|
397
|
+
value: value
|
|
398
|
+
})), marqueeContent ? /*#__PURE__*/(0, _jsxRuntime.jsx)(MarqueeText, {
|
|
399
|
+
className: (0, _classnames3["default"])(css.marqueeText, _defineProperty(_defineProperty({}, css.passwordtel, isPasswordtel || type === 'password'), css.placeholderText, value === '')),
|
|
400
|
+
disabled: disabled,
|
|
401
|
+
children: value !== '' ? value : placeholder
|
|
402
|
+
}) : null]
|
|
403
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputFieldDecoratorIcon["default"], {
|
|
355
404
|
className: css.iconAfter,
|
|
356
405
|
position: "after",
|
|
357
406
|
size: "large",
|
|
@@ -387,7 +436,9 @@ var AnnounceDecorator = function AnnounceDecorator(Wrapped) {
|
|
|
387
436
|
*/
|
|
388
437
|
var InputFieldDecorator = exports.InputFieldDecorator = (0, _compose["default"])(_Pure["default"], (0, _I18nDecorator.I18nContextDecorator)({
|
|
389
438
|
rtlProp: 'rtl'
|
|
390
|
-
}), _Changeable["default"], _InputFieldSpotlightDecorator["default"], AnnounceDecorator,
|
|
439
|
+
}), _Changeable["default"], _InputFieldSpotlightDecorator["default"], AnnounceDecorator, (0, _Marquee.MarqueeController)({
|
|
440
|
+
marqueeOnFocus: true
|
|
441
|
+
}), _Skinnable["default"]);
|
|
391
442
|
|
|
392
443
|
/**
|
|
393
444
|
* A Spottable, Limestone styled input component with embedded icon support.
|