@enact/limestone 1.3.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci-branch.yml +21 -0
- package/.github/workflows/ci-pull-request.yml +16 -0
- package/.github/workflows/ci-reusable.yml +73 -0
- package/ActionGuide/ActionGuide.d.ts +5 -4
- package/ActionGuide/ActionGuide.module.css +1 -1
- package/Alert/Alert.d.ts +13 -2
- package/Alert/Alert.js +39 -5
- package/Alert/Alert.module.css +48 -1
- package/Alert/tests/Alert-specs.js +91 -0
- package/BodyText/BodyText.d.ts +5 -4
- package/BodyText/BodyText.module.css +7 -7
- package/Button/Button.d.ts +17 -12
- package/Button/Button.js +1 -1
- package/Button/Button.module.css +195 -268
- package/Button/tests/Button-specs.js +26 -0
- package/CHANGELOG.md +254 -0
- package/Card/Card.d.ts +40 -12
- package/Card/Card.js +164 -28
- package/Card/Card.module.css +277 -58
- package/Card/tests/Card-specs.js +67 -3
- package/Checkbox/Checkbox.d.ts +8 -7
- package/Checkbox/Checkbox.js +3 -1
- package/Checkbox/Checkbox.module.css +213 -120
- package/Checkbox/tests/Checkbox-specs.js +1 -1
- package/CheckboxItem/CheckboxItem.d.ts +22 -7
- package/CheckboxItem/CheckboxItem.js +71 -4
- package/Chips/Chip.js +72 -13
- package/Chips/Chip.module.css +3 -3
- package/Chips/Chips.js +37 -17
- package/Chips/Chips.module.css +1 -1
- package/Chips/tests/Chip-specs.js +43 -13
- package/Chips/tests/Chips-specs.js +31 -21
- package/ColorPicker/ColorPicker.js +27 -25
- package/ContextualMenuDecorator/ContextualMenuDecorator.d.ts +4 -5
- package/ContextualPopupDecorator/ContextualPopup.module.css +34 -34
- package/ContextualPopupDecorator/ContextualPopupDecorator.js +567 -549
- package/DatePicker/DatePicker.d.ts +4 -5
- package/DayPicker/DayPicker.d.ts +8 -7
- package/DayPicker/DaySelectorDecorator.js +12 -7
- package/Dropdown/Dropdown.d.ts +11 -13
- package/Dropdown/Dropdown.module.css +13 -9
- package/Dropdown/DropdownList.js +80 -54
- package/FixedPopupPanels/FixedPopupPanels.d.ts +4 -2
- package/FixedPopupPanels/FixedPopupPanels.module.css +18 -18
- package/FlexiblePopupPanels/FlexiblePopupPanels.module.css +23 -23
- package/FlexiblePopupPanels/useNavButtonFocus.js +7 -10
- package/FormCheckboxItem/FormCheckboxItem.d.ts +5 -4
- package/Heading/Heading.d.ts +9 -8
- package/Heading/Heading.js +2 -2
- package/Heading/Heading.module.css +5 -5
- package/Icon/Icon.d.ts +15 -4
- package/Icon/Icon.js +49 -2
- package/Icon/Icon.module.css +1 -1
- package/Icon/IconList.js +27 -1
- package/IconItem/IconItem.d.ts +13 -12
- package/IconItem/IconItem.js +15 -0
- package/IconItem/IconItem.module.css +107 -1
- package/IconItem/tests/IconItem-specs.js +30 -1
- package/Image/Image.d.ts +5 -4
- package/Image/Image.js +6 -4
- package/ImageItem/ImageItem.d.ts +11 -10
- package/ImageItem/ImageItem.js +37 -31
- package/ImageItem/ImageItem.module.css +30 -30
- package/ImageItem/tests/ImageItem-specs.js +3 -10
- package/Input/Input.js +21 -3
- package/Input/Input.module.css +37 -8
- package/Input/InputField.js +79 -24
- package/Input/InputField.module.css +273 -41
- package/Input/InputFieldDecoratorIcon.js +1 -0
- package/Input/InputFieldSpotlightDecorator.js +257 -228
- package/Input/index.d.ts +120 -111
- package/Input/tests/Input-specs.js +26 -0
- package/Input/tests/InputField-specs.js +170 -3
- package/Input/tests/InputPopup-specs.js +1 -1
- package/Item/Item.d.ts +16 -9
- package/Item/Item.js +20 -2
- package/Item/Item.module.css +1 -1
- package/KeyGuide/KeyGuide.d.ts +8 -7
- package/KeyGuide/KeyGuide.js +29 -27
- package/KeyGuide/KeyGuide.module.css +25 -1
- package/Marquee/Marquee.d.ts +2 -4
- package/MediaOverlay/MediaOverlay.d.ts +12 -11
- package/MediaOverlay/MediaOverlay.js +43 -21
- package/MediaOverlay/MediaOverlay.module.css +114 -15
- package/MediaOverlay/tests/MediaOverlay-specs.js +29 -0
- package/MediaPlayer/MediaControls.js +195 -13
- package/MediaPlayer/MediaControls.module.css +3 -2
- package/MediaPlayer/MediaSlider.module.css +7 -20
- package/MediaPlayer/index.d.ts +59 -7
- package/MediaPlayer/tests/util-specs.js +4 -1
- package/PageViews/PageViews.js +232 -82
- package/PageViews/PageViews.module.css +3 -0
- package/PageViews/PageViewsRouter.js +100 -42
- package/PageViews/tests/PageViews-specs.js +171 -0
- package/Panels/Header.js +54 -34
- package/Panels/Header.module.css +83 -31
- package/Panels/Panel.module.css +1 -1
- package/Panels/index.d.ts +7 -8
- package/Picker/Picker.d.ts +4 -5
- package/Picker/Picker.module.css +2 -2
- package/Popup/Popup.js +245 -242
- package/Popup/Popup.module.css +24 -24
- package/PopupTabLayout/PopupTabLayout.d.ts +5 -7
- package/PopupTabLayout/PopupTabLayout.js +26 -18
- package/PopupTabLayout/PopupTabLayout.module.css +53 -16
- package/PopupTabLayout/PopupTabLayoutStateContext.js +8 -0
- package/ProgressBar/ProgressBar.d.ts +5 -4
- package/ProgressBar/ProgressBarTooltip.module.css +12 -12
- package/ProgressButton/ProgressButton.d.ts +4 -5
- package/QuickGuidePanels/QuickGuidePanels.module.css +2 -2
- package/RadioItem/RadioItem.d.ts +18 -5
- package/RadioItem/RadioItem.js +69 -2
- package/RadioItem/RadioItem.module.css +36 -36
- package/RangePicker/RangePicker.module.css +2 -2
- package/Scroller/EditableWrapper.js +28 -18
- package/Scroller/Scroller.d.ts +20 -16
- package/Scroller/Scroller.js +20 -13
- package/Scroller/Scroller.module.css +4 -4
- package/Scroller/useThemeScroller.js +3 -3
- package/Slider/Slider.d.ts +20 -14
- package/Slider/Slider.js +71 -14
- package/Slider/Slider.module.css +464 -91
- package/Slider/SliderBehaviorDecorator.js +16 -14
- package/Slider/tests/Slider-specs.js +53 -1
- package/Slider/utils.js +23 -7
- package/Spinner/Spinner.d.ts +5 -4
- package/Spinner/Spinner.js +10 -8
- package/Spinner/Spinner.module.css +9 -9
- package/Steps/Steps.d.ts +5 -4
- package/Steps/Steps.js +9 -5
- package/Switch/Switch.d.ts +8 -7
- package/Switch/Switch.module.css +100 -13
- package/SwitchItem/SwitchItem.d.ts +9 -6
- package/TabLayout/RefocusDecorator.js +26 -18
- package/TabLayout/TabGroup.js +3 -2
- package/TabLayout/TabGroup.module.css +2 -2
- package/TabLayout/TabLayout.d.ts +6 -0
- package/TabLayout/TabLayout.js +11 -1
- package/TabLayout/TabLayout.module.css +18 -0
- package/TabLayout/tests/TabGroup-specs.js +1 -1
- package/TabLayout/tests/TabLayout-specs.js +52 -0
- package/ThemeDecorator/AccessibilityDecorator.js +12 -11
- package/ThemeDecorator/I18nFontDecorator.js +6 -4
- package/ThemeDecorator/ThemeDecorator.d.ts +16 -10
- package/ThemeDecorator/ThemeDecorator.js +24 -9
- package/ThemeDecorator/fontGenerator.js +1 -1
- package/ThemeDecorator/screenTypes.json +1 -0
- package/TimePicker/TimePicker.module.css +1 -1
- package/TimePicker/TimePickerBase.js +5 -3
- package/TooltipDecorator/Tooltip.module.css +1 -2
- package/TooltipDecorator/TooltipDecorator.js +12 -7
- package/TooltipDecorator/tests/useTooltip-specs.js +5 -2
- package/TooltipDecorator/tests/util-specs.js +12 -0
- package/TooltipDecorator/useTooltip.js +1 -1
- package/TooltipDecorator/util.js +18 -11
- package/VideoPlayer/Feedback.js +3 -0
- package/VideoPlayer/Feedback.module.css +5 -9
- package/VideoPlayer/FeedbackIcons.js +1 -1
- package/VideoPlayer/FeedbackTooltip.module.css +55 -11
- package/VideoPlayer/VideoPlayer.d.ts +44 -18
- package/VideoPlayer/VideoPlayer.js +153 -47
- package/VideoPlayer/VideoPlayer.module.css +28 -11
- package/VirtualList/VirtualList.d.ts +9 -2
- package/VirtualList/VirtualList.js +51 -24
- package/VirtualList/tests/VirtualGridList-translate-specs.js +3 -0
- package/VirtualList/tests/VirtualList-specs.js +28 -1
- package/VirtualList/tests/VirtualList-translate-specs.js +4 -1
- package/VirtualList/useSpotlight.js +1 -1
- package/WizardPanels/WizardPanels.module.css +2 -2
- package/WizardPanels/index.d.ts +4 -2
- package/fonts/Limestone_Icons.ttf +0 -0
- package/internal/$L/$L.js +3 -3
- package/internal/AsyncRenderChildren/AsyncRenderChildren.js +9 -5
- package/internal/AsyncRenderChildren/tests/AsyncRenderChildren-specs.js +4 -1
- package/internal/DateComponentPicker/DateComponentPicker.module.css +2 -2
- package/internal/DateTime/DateTime.module.css +1 -0
- package/internal/DateTime/DateTimeDecorator.js +5 -4
- package/internal/Panels/PanelsRouter.js +48 -31
- 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 +2 -2
- package/internal/Picker/SpottablePicker.js +15 -13
- package/internal/SharedStateDecorator/SharedStateDecorator.js +78 -99
- package/internal/validators/validators.js +21 -2
- package/package.json +18 -15
- package/styles/colors-highcontrast.less +9 -1
- package/styles/colors.less +12 -7
- package/styles/motion-mixins.less +66 -0
- package/styles/motions.less +78 -0
- package/styles/variables.less +176 -150
- package/useScroll/HoverToScroll.js +23 -17
- package/useScroll/Scrollbar.js +14 -10
- package/useScroll/ScrollbarPlaceholder.js +3 -5
- package/useScroll/ScrollbarTrack.js +7 -5
- package/useScroll/ScrollbarTrack.module.css +8 -8
- package/useScroll/useEvent.js +14 -3
- package/useScroll/useScroll.js +12 -2
- package/useScroll/useScroll.module.css +6 -6
- package/.travis.yml +0 -40
package/Card/tests/Card-specs.js
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
require("@testing-library/jest-dom");
|
|
4
4
|
var _react = require("@testing-library/react");
|
|
5
|
-
var _Card = require("../Card");
|
|
5
|
+
var _Card = _interopRequireWildcard(require("../Card"));
|
|
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
|
var src = {
|
|
8
9
|
'hd': 'https://placehold.co/200x200/000000/ffffff/png',
|
|
9
10
|
'fhd': 'https://placehold.co/300x300/000000/ffffff/png',
|
|
@@ -46,7 +47,8 @@ describe('Card', function () {
|
|
|
46
47
|
var imageIconSrc = 'imageIconSrc';
|
|
47
48
|
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Card.CardBase, {
|
|
48
49
|
imageIconSrc: imageIconSrc,
|
|
49
|
-
orientation: "vertical"
|
|
50
|
+
orientation: "vertical",
|
|
51
|
+
src: src
|
|
50
52
|
}));
|
|
51
53
|
var expected = imageIconSrc;
|
|
52
54
|
var actual = _react.screen.getAllByRole('img')[2].children.item(0);
|
|
@@ -56,10 +58,72 @@ describe('Card', function () {
|
|
|
56
58
|
var imageIconSrc = 'imageIconSrc';
|
|
57
59
|
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Card.CardBase, {
|
|
58
60
|
imageIconSrc: imageIconSrc,
|
|
59
|
-
orientation: "horizontal"
|
|
61
|
+
orientation: "horizontal",
|
|
62
|
+
src: src
|
|
60
63
|
}));
|
|
61
64
|
var expected = 2;
|
|
62
65
|
var actual = _react.screen.getAllByRole('img').length;
|
|
63
66
|
expect(actual).toBe(expected);
|
|
64
67
|
});
|
|
68
|
+
test('should apply prop `fitImage`', function () {
|
|
69
|
+
var imageIconSrc = 'imageIconSrc';
|
|
70
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Card.CardBase, {
|
|
71
|
+
"data-testid": "card",
|
|
72
|
+
fitImage: true,
|
|
73
|
+
imageIconSrc: imageIconSrc,
|
|
74
|
+
src: src
|
|
75
|
+
}));
|
|
76
|
+
var expected = 'fitImage';
|
|
77
|
+
var actual = _react.screen.getByTestId('card');
|
|
78
|
+
expect(actual).toHaveClass(expected);
|
|
79
|
+
});
|
|
80
|
+
test('should have "Select" voice intent', function () {
|
|
81
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Card.CardBase, {
|
|
82
|
+
"data-testid": "card",
|
|
83
|
+
src: src
|
|
84
|
+
}));
|
|
85
|
+
var card = _react.screen.getByTestId('card');
|
|
86
|
+
expect(card).toHaveAttribute('data-webos-voice-intent', 'Select');
|
|
87
|
+
});
|
|
88
|
+
test('should not have styles for marquee when `withoutMarquee` is true', function () {
|
|
89
|
+
var children = 'children';
|
|
90
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Card.CardBase, {
|
|
91
|
+
"data-testid": "card",
|
|
92
|
+
withoutMarquee: true,
|
|
93
|
+
src: src,
|
|
94
|
+
children: children
|
|
95
|
+
}));
|
|
96
|
+
var expected = 'style';
|
|
97
|
+
var actual = _react.screen.getByText('children');
|
|
98
|
+
expect(actual).not.toHaveAttribute(expected);
|
|
99
|
+
});
|
|
100
|
+
test('should be pressed when selected', function () {
|
|
101
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Card["default"], {
|
|
102
|
+
"data-testid": "card",
|
|
103
|
+
src: src
|
|
104
|
+
}));
|
|
105
|
+
var card = _react.screen.getByTestId('card');
|
|
106
|
+
|
|
107
|
+
// Select by key
|
|
108
|
+
_react.fireEvent.keyDown(card, {
|
|
109
|
+
key: 'Enter',
|
|
110
|
+
code: 'Enter',
|
|
111
|
+
keyCode: 13,
|
|
112
|
+
which: 13
|
|
113
|
+
});
|
|
114
|
+
expect(card).toHaveClass('pressed');
|
|
115
|
+
_react.fireEvent.keyUp(card, {
|
|
116
|
+
key: 'Enter',
|
|
117
|
+
code: 'Enter',
|
|
118
|
+
keyCode: 13,
|
|
119
|
+
which: 13
|
|
120
|
+
});
|
|
121
|
+
expect(card).not.toHaveClass('pressed');
|
|
122
|
+
|
|
123
|
+
// Select by pointer
|
|
124
|
+
_react.fireEvent.mouseDown(card);
|
|
125
|
+
expect(card).toHaveClass('pressed');
|
|
126
|
+
_react.fireEvent.mouseUp(card);
|
|
127
|
+
expect(card).not.toHaveClass('pressed');
|
|
128
|
+
});
|
|
65
129
|
});
|
package/Checkbox/Checkbox.d.ts
CHANGED
|
@@ -74,17 +74,18 @@ export class CheckboxBase extends React.Component<
|
|
|
74
74
|
Merge<React.HTMLProps<HTMLElement>, CheckboxBaseProps>
|
|
75
75
|
> {}
|
|
76
76
|
|
|
77
|
-
export interface CheckboxDecoratorProps
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
> {}
|
|
77
|
+
export interface CheckboxDecoratorProps extends Merge<
|
|
78
|
+
Merge<ui_Toggleable_ToggleableProps, limestone_Skinnable_SkinnableProps>,
|
|
79
|
+
spotlight_Spottable_SpottableProps
|
|
80
|
+
> {}
|
|
82
81
|
export function CheckboxDecorator<P>(
|
|
83
82
|
Component: React.ComponentType<P> | string,
|
|
84
83
|
): React.ComponentType<P & CheckboxDecoratorProps>;
|
|
85
84
|
|
|
86
|
-
export interface CheckboxProps
|
|
87
|
-
|
|
85
|
+
export interface CheckboxProps extends Merge<
|
|
86
|
+
CheckboxBaseProps,
|
|
87
|
+
CheckboxDecoratorProps
|
|
88
|
+
> {}
|
|
88
89
|
/**
|
|
89
90
|
* A Limestone-styled checkbox component.
|
|
90
91
|
*
|
package/Checkbox/Checkbox.js
CHANGED
|
@@ -148,11 +148,13 @@ var CheckboxBase = exports.CheckboxBase = (0, _kind["default"])({
|
|
|
148
148
|
},
|
|
149
149
|
computed: {
|
|
150
150
|
className: function className(_ref) {
|
|
151
|
-
var
|
|
151
|
+
var children = _ref.children,
|
|
152
|
+
indeterminate = _ref.indeterminate,
|
|
152
153
|
selected = _ref.selected,
|
|
153
154
|
standalone = _ref.standalone,
|
|
154
155
|
styler = _ref.styler;
|
|
155
156
|
return styler.append({
|
|
157
|
+
checkmark: children === 'checkmark',
|
|
156
158
|
selected: selected,
|
|
157
159
|
standalone: standalone,
|
|
158
160
|
indeterminate: indeterminate
|