@lumx/react 3.0.3 → 3.0.4-alpha.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/index.d.ts +8 -0
- package/index.js +17 -11
- package/index.js.map +1 -1
- package/package.json +17 -23
- package/src/components/alert-dialog/__snapshots__/AlertDialog.test.tsx.snap +23 -23
- package/src/components/autocomplete/Autocomplete.tsx +8 -0
- package/src/components/autocomplete/__snapshots__/Autocomplete.test.tsx.snap +4 -4
- package/src/components/autocomplete/__snapshots__/AutocompleteMultiple.test.tsx.snap +1 -1
- package/src/components/avatar/__snapshots__/Avatar.test.tsx.snap +6 -6
- package/src/components/button/__snapshots__/ButtonRoot.test.tsx.snap +1 -1
- package/src/components/date-picker/__snapshots__/DatePicker.test.tsx.snap +2 -2
- package/src/components/date-picker/__snapshots__/DatePickerField.test.tsx.snap +2 -2
- package/src/components/dialog/__snapshots__/Dialog.test.tsx.snap +22 -22
- package/src/components/dropdown/Dropdown.tsx +2 -0
- package/src/components/dropdown/__snapshots__/Dropdown.test.tsx.snap +2 -2
- package/src/components/flag/__snapshots__/Flag.test.tsx.snap +1 -1
- package/src/components/flex-box/__snapshots__/FlexBox.test.tsx.snap +31 -31
- package/src/components/heading/Heading.test.tsx +32 -27
- package/src/components/icon/__snapshots__/Icon.test.tsx.snap +2 -2
- package/src/components/image-block/__snapshots__/ImageBlock.test.tsx.snap +1 -1
- package/src/components/inline-list/InlineList.tsx +3 -1
- package/src/components/lightbox/__snapshots__/Lightbox.test.tsx.snap +7 -7
- package/src/components/list/__snapshots__/List.test.tsx.snap +13 -13
- package/src/components/notification/__snapshots__/Notification.test.tsx.snap +1 -1
- package/src/components/popover/__snapshots__/Popover.test.tsx.snap +52 -52
- package/src/components/post-block/__snapshots__/PostBlock.test.tsx.snap +4 -4
- package/src/components/progress-tracker/__snapshots__/ProgressTracker.test.tsx.snap +2 -2
- package/src/components/select/__snapshots__/Select.test.tsx.snap +2 -2
- package/src/components/select/__snapshots__/SelectMultiple.test.tsx.snap +6 -6
- package/src/components/skeleton/__snapshots__/SkeletonCircle.test.tsx.snap +1 -1
- package/src/components/skeleton/__snapshots__/SkeletonRectangle.test.tsx.snap +1 -1
- package/src/components/skeleton/__snapshots__/SkeletonTypography.test.tsx.snap +15 -15
- package/src/components/slider/__snapshots__/Slider.test.tsx.snap +4 -4
- package/src/components/slideshow/__snapshots__/Slideshow.test.tsx.snap +10 -10
- package/src/components/table/__snapshots__/Table.test.tsx.snap +1 -1
- package/src/components/text/Text.test.tsx +67 -35
- package/src/components/text/Text.tsx +8 -7
- package/src/components/text-field/TextField.test.tsx +75 -117
- package/src/components/text-field/__snapshots__/TextField.test.tsx.snap +12 -17
- package/src/components/thumbnail/__snapshots__/Thumbnail.test.tsx.snap +6 -6
- package/src/components/tooltip/__snapshots__/Tooltip.test.tsx.snap +6 -6
- package/src/components/user-block/__snapshots__/UserBlock.test.tsx.snap +11 -11
- package/src/stories/generated/Dropdown/Demos.stories.tsx +1 -0
- package/src/testing/utils/commonTestsSuiteRTL.ts +55 -0
- package/src/testing/utils/index.ts +1 -0
- package/src/testing/utils/queries.ts +19 -0
- package/src/utils/focus/getFocusableElements.test.ts +12 -12
- package/types.d.ts +0 -2847
package/index.d.ts
CHANGED
|
@@ -177,6 +177,12 @@ interface AutocompleteProps extends GenericProps, HasTheme {
|
|
|
177
177
|
* @see {@link DropdownProps#onInfiniteScroll}
|
|
178
178
|
*/
|
|
179
179
|
onInfiniteScroll?(): void;
|
|
180
|
+
/**
|
|
181
|
+
* Props forwarded to the underlying TextField component.
|
|
182
|
+
* Only the props not managed by the Autocomplete can be set.
|
|
183
|
+
* @see {@link TextFieldProps}
|
|
184
|
+
*/
|
|
185
|
+
textFieldProps?: TextFieldProps;
|
|
180
186
|
}
|
|
181
187
|
/**
|
|
182
188
|
* Autocomplete component.
|
|
@@ -813,6 +819,8 @@ interface DropdownProps extends GenericProps {
|
|
|
813
819
|
placement?: Placement;
|
|
814
820
|
/** Whether the focus should be set on the list when the dropdown is open or not. */
|
|
815
821
|
shouldFocusOnOpen?: boolean;
|
|
822
|
+
/** Whether the dropdown should be rendered into a DOM node that exists outside the DOM hierarchy of the parent component. */
|
|
823
|
+
usePortal?: boolean;
|
|
816
824
|
/** Whether the focus should go back on the anchor when dropdown closes and focus is within. */
|
|
817
825
|
focusAnchorOnClose?: boolean;
|
|
818
826
|
/**
|
package/index.js
CHANGED
|
@@ -820,7 +820,9 @@ var Autocomplete = forwardRef(function (props, ref) {
|
|
|
820
820
|
shouldFocusOnClose = props.shouldFocusOnClose,
|
|
821
821
|
theme = props.theme,
|
|
822
822
|
value = props.value,
|
|
823
|
-
|
|
823
|
+
_props$textFieldProps = props.textFieldProps,
|
|
824
|
+
textFieldProps = _props$textFieldProps === void 0 ? {} : _props$textFieldProps,
|
|
825
|
+
forwardedProps = _objectWithoutProperties(props, ["anchorToInput", "children", "chips", "className", "closeOnClick", "closeOnClickAway", "closeOnEscape", "disabled", "error", "fitToAnchorWidth", "hasError", "helper", "icon", "inputRef", "clearButtonProps", "isDisabled", "isRequired", "isOpen", "isValid", "label", "name", "offset", "onBlur", "onChange", "onClose", "onFocus", "onInfiniteScroll", "placeholder", "placement", "shouldFocusOnClose", "theme", "value", "textFieldProps"]);
|
|
824
826
|
|
|
825
827
|
var inputAnchorRef = useRef(null);
|
|
826
828
|
var textFieldRef = useRef(null);
|
|
@@ -831,7 +833,7 @@ var Autocomplete = forwardRef(function (props, ref) {
|
|
|
831
833
|
className: classnames(className, handleBasicClasses({
|
|
832
834
|
prefix: CLASSNAME$1
|
|
833
835
|
}))
|
|
834
|
-
}), React.createElement(TextField, {
|
|
836
|
+
}), React.createElement(TextField, _extends({}, textFieldProps, {
|
|
835
837
|
chips: chips,
|
|
836
838
|
error: error,
|
|
837
839
|
hasError: hasError,
|
|
@@ -851,7 +853,7 @@ var Autocomplete = forwardRef(function (props, ref) {
|
|
|
851
853
|
textFieldRef: textFieldRef,
|
|
852
854
|
theme: theme,
|
|
853
855
|
value: value
|
|
854
|
-
}), React.createElement(Dropdown, {
|
|
856
|
+
})), React.createElement(Dropdown, {
|
|
855
857
|
anchorRef: anchorToInput ? inputAnchorRef : textFieldRef,
|
|
856
858
|
closeOnClick: closeOnClick,
|
|
857
859
|
closeOnClickAway: closeOnClickAway,
|
|
@@ -6824,7 +6826,7 @@ var Text = forwardRef(function (props, ref) {
|
|
|
6824
6826
|
isTruncatedMultiline: isTruncatedMultiline
|
|
6825
6827
|
}), typographyClass, colorClass, noWrap && "".concat(CLASSNAME$o, "--no-wrap")),
|
|
6826
6828
|
style: _objectSpread2({}, truncateLinesStyle, {}, style)
|
|
6827
|
-
}, forwardedProps), Children.toArray(children).map(function (child, index) {
|
|
6829
|
+
}, forwardedProps), children && Children.toArray(children).map(function (child, index) {
|
|
6828
6830
|
// Force wrap spaces around icons to make sure they are never stuck against text.
|
|
6829
6831
|
if (isComponent(Icon)(child)) {
|
|
6830
6832
|
return React.createElement(Fragment$1, {
|
|
@@ -7259,13 +7261,17 @@ var InlineList = forwardRef(function (props, ref) {
|
|
|
7259
7261
|
role: "list"
|
|
7260
7262
|
}), Children.toArray(children).map(function (child, index) {
|
|
7261
7263
|
var key = isValidElement(child) && child.key || index;
|
|
7262
|
-
return
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7264
|
+
return (// We need to item is set as display: contents which removes the semantic.
|
|
7265
|
+
// eslint-disable-next-line jsx-a11y/no-redundant-roles
|
|
7266
|
+
React.createElement("li", {
|
|
7267
|
+
key: key,
|
|
7268
|
+
role: "listitem",
|
|
7269
|
+
className: "".concat(CLASSNAME$u, "__item")
|
|
7270
|
+
}, index !== 0 && React.createElement("span", {
|
|
7271
|
+
className: "".concat(CLASSNAME$u, "__item-separator"),
|
|
7272
|
+
"aria-hidden": "true"
|
|
7273
|
+
}, "\xA0\u2022\xA0"), child)
|
|
7274
|
+
);
|
|
7269
7275
|
}))
|
|
7270
7276
|
);
|
|
7271
7277
|
});
|