@lumx/react 3.20.1-alpha.2 → 3.20.1-alpha.21
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/CONTRIBUTING.md +1 -5
- package/README.md +0 -2
- package/_internal/index.js +20 -13
- package/_internal/index.js.map +1 -1
- package/index.d.ts +35 -35
- package/index.js +2407 -2447
- package/index.js.map +1 -1
- package/package.json +10 -13
- package/src/components/alert-dialog/AlertDialog.stories.tsx +1 -1
- package/src/components/alert-dialog/AlertDialog.test.tsx +3 -4
- package/src/components/autocomplete/Autocomplete.stories.tsx +1 -1
- package/src/components/autocomplete/Autocomplete.test.tsx +3 -5
- package/src/components/autocomplete/Autocomplete.tsx +1 -1
- package/src/components/autocomplete/AutocompleteMultiple.stories.tsx +1 -1
- package/src/components/autocomplete/AutocompleteMultiple.test.tsx +0 -2
- package/src/components/autocomplete/AutocompleteMultiple.tsx +1 -1
- package/src/components/avatar/Avatar.stories.tsx +0 -2
- package/src/components/avatar/Avatar.test.tsx +0 -2
- package/src/components/avatar/Avatar.tsx +1 -1
- package/src/components/badge/Badge.stories.tsx +0 -1
- package/src/components/badge/Badge.test.tsx +0 -2
- package/src/components/badge/Badge.tsx +1 -1
- package/src/components/badge/BadgeWrapper.stories.tsx +0 -1
- package/src/components/badge/BadgeWrapper.test.tsx +0 -2
- package/src/components/badge/BadgeWrapper.tsx +1 -1
- package/src/components/button/Button.stories.tsx +0 -1
- package/src/components/button/Button.test.tsx +9 -11
- package/src/components/button/Button.tsx +0 -2
- package/src/components/button/ButtonGroup.stories.tsx +0 -2
- package/src/components/button/ButtonGroup.test.tsx +0 -2
- package/src/components/button/ButtonGroup.tsx +0 -2
- package/src/components/button/ButtonRoot.tsx +7 -37
- package/src/components/button/IconButton.test.tsx +0 -2
- package/src/components/button/IconButton.tsx +0 -2
- package/src/components/checkbox/Checkbox.test.tsx +3 -5
- package/src/components/chip/Chip.stories.tsx +0 -2
- package/src/components/chip/Chip.test.tsx +19 -19
- package/src/components/chip/Chip.tsx +1 -1
- package/src/components/chip/ChipGroup.stories.tsx +0 -2
- package/src/components/chip/ChipGroup.test.tsx +0 -2
- package/src/components/chip/ChipGroup.tsx +1 -1
- package/src/components/comment-block/CommentBlock.stories.tsx +0 -1
- package/src/components/comment-block/CommentBlock.test.tsx +0 -1
- package/src/components/comment-block/CommentBlock.tsx +1 -1
- package/src/components/date-picker/DatePicker.test.tsx +3 -5
- package/src/components/date-picker/DatePicker.tsx +1 -1
- package/src/components/date-picker/DatePickerControlled.test.tsx +6 -8
- package/src/components/date-picker/DatePickerField.test.tsx +3 -5
- package/src/components/dialog/Dialog.test.tsx +4 -6
- package/src/components/divider/Divider.test.tsx +0 -2
- package/src/components/divider/Divider.tsx +0 -2
- package/src/components/drag-handle/DragHandle.test.tsx +0 -2
- package/src/components/drag-handle/DragHandle.tsx +0 -2
- package/src/components/dropdown/Dropdown.stories.tsx +1 -1
- package/src/components/dropdown/Dropdown.test.tsx +3 -3
- package/src/components/dropdown/Dropdown.tsx +1 -1
- package/src/components/expansion-panel/ExpansionPanel.test.tsx +6 -7
- package/src/components/flag/Flag.test.tsx +0 -2
- package/src/components/flag/Flag.tsx +0 -2
- package/src/components/flex-box/FlexBox.stories.tsx +0 -2
- package/src/components/flex-box/FlexBox.test.tsx +0 -1
- package/src/components/flex-box/FlexBox.tsx +1 -1
- package/src/components/generic-block/GenericBlock.test.tsx +1 -1
- package/src/components/grid/Grid.tsx +0 -2
- package/src/components/grid/GridItem.tsx +0 -2
- package/src/components/grid-column/GridColumn.stories.tsx +0 -1
- package/src/components/grid-column/GridColumn.test.jsx +0 -2
- package/src/components/grid-column/GridColumn.tsx +1 -1
- package/src/components/heading/Heading.stories.tsx +0 -1
- package/src/components/heading/Heading.test.tsx +0 -2
- package/src/components/heading/Heading.tsx +0 -2
- package/src/components/heading/HeadingLevelProvider.tsx +1 -1
- package/src/components/icon/Icon.stories.tsx +30 -4
- package/src/components/icon/Icon.test.tsx +85 -4
- package/src/components/icon/Icon.tsx +118 -9
- package/src/components/image-block/ImageBlock.stories.tsx +0 -2
- package/src/components/image-block/ImageBlock.test.tsx +0 -1
- package/src/components/image-block/ImageBlock.tsx +1 -1
- package/src/components/image-block/ImageCaption.tsx +1 -1
- package/src/components/image-lightbox/ImageLightbox.stories.tsx +0 -1
- package/src/components/image-lightbox/ImageLightbox.test.tsx +11 -9
- package/src/components/image-lightbox/types.ts +0 -2
- package/src/components/inline-list/InlineList.stories.tsx +0 -1
- package/src/components/inline-list/InlineList.test.tsx +0 -2
- package/src/components/inline-list/InlineList.tsx +1 -1
- package/src/components/input-helper/InputHelper.test.tsx +0 -2
- package/src/components/input-helper/InputHelper.tsx +1 -1
- package/src/components/input-label/InputLabel.stories.tsx +0 -2
- package/src/components/input-label/InputLabel.test.tsx +0 -2
- package/src/components/input-label/InputLabel.tsx +1 -1
- package/src/components/lightbox/Lightbox.test.tsx +0 -2
- package/src/components/lightbox/Lightbox.tsx +1 -1
- package/src/components/link/Link.stories.tsx +0 -1
- package/src/components/link/Link.test.tsx +13 -13
- package/src/components/link/Link.tsx +9 -22
- package/src/components/link-preview/LinkPreview.test.tsx +0 -2
- package/src/components/link-preview/LinkPreview.tsx +0 -2
- package/src/components/list/List.stories.tsx +1 -1
- package/src/components/list/List.test.tsx +0 -2
- package/src/components/list/List.tsx +1 -1
- package/src/components/list/ListDivider.test.tsx +0 -2
- package/src/components/list/ListDivider.tsx +0 -2
- package/src/components/list/ListItem.test.tsx +5 -7
- package/src/components/list/ListItem.tsx +1 -1
- package/src/components/list/ListSubheader.test.tsx +0 -2
- package/src/components/list/ListSubheader.tsx +1 -1
- package/src/components/message/Message.test.tsx +1 -2
- package/src/components/message/Message.tsx +1 -1
- package/src/components/mosaic/Mosaic.test.tsx +3 -5
- package/src/components/mosaic/Mosaic.tsx +1 -1
- package/src/components/navigation/Navigation.stories.tsx +0 -2
- package/src/components/navigation/Navigation.test.tsx +0 -2
- package/src/components/navigation/Navigation.tsx +0 -2
- package/src/components/navigation/NavigationItem.test.tsx +0 -2
- package/src/components/navigation/NavigationItem.tsx +7 -11
- package/src/components/navigation/NavigationSection.test.tsx +0 -2
- package/src/components/navigation/NavigationSection.tsx +5 -4
- package/src/components/notification/Notification.test.tsx +4 -5
- package/src/components/notification/Notification.tsx +1 -1
- package/src/components/popover/Popover.test.tsx +0 -2
- package/src/components/popover/Popover.tsx +1 -1
- package/src/components/popover/usePopoverStyle.tsx +1 -1
- package/src/components/popover-dialog/PopoverDialog.test.tsx +1 -2
- package/src/components/popover-dialog/PopoverDialog.tsx +0 -2
- package/src/components/post-block/PostBlock.test.tsx +0 -2
- package/src/components/post-block/PostBlock.tsx +1 -1
- package/src/components/progress/Progress.tsx +0 -2
- package/src/components/progress/ProgressCircular.stories.tsx +0 -1
- package/src/components/progress/ProgressCircular.test.tsx +0 -2
- package/src/components/progress/ProgressCircular.tsx +0 -2
- package/src/components/progress/ProgressLinear.test.tsx +0 -2
- package/src/components/progress/ProgressLinear.tsx +0 -2
- package/src/components/progress-tracker/ProgressTracker.stories.tsx +1 -1
- package/src/components/progress-tracker/ProgressTracker.test.tsx +0 -2
- package/src/components/progress-tracker/ProgressTrackerProvider.test.tsx +0 -2
- package/src/components/progress-tracker/ProgressTrackerProvider.tsx +1 -1
- package/src/components/progress-tracker/ProgressTrackerStep.test.tsx +0 -2
- package/src/components/progress-tracker/ProgressTrackerStep.tsx +1 -1
- package/src/components/progress-tracker/ProgressTrackerStepPanel.test.tsx +0 -2
- package/src/components/progress-tracker/ProgressTrackerStepPanel.tsx +0 -2
- package/src/components/radio-button/RadioButton.test.tsx +3 -5
- package/src/components/radio-button/RadioButton.tsx +1 -1
- package/src/components/radio-button/RadioGroup.stories.tsx +1 -1
- package/src/components/radio-button/RadioGroup.test.tsx +0 -2
- package/src/components/radio-button/RadioGroup.tsx +1 -1
- package/src/components/select/Select.stories.tsx +1 -1
- package/src/components/select/Select.test.tsx +8 -9
- package/src/components/select/Select.tsx +1 -1
- package/src/components/select/SelectMultiple.stories.tsx +1 -1
- package/src/components/select/SelectMultiple.test.tsx +5 -7
- package/src/components/select/SelectMultiple.tsx +1 -1
- package/src/components/select/WithSelectContext.tsx +1 -1
- package/src/components/select/constants.ts +1 -1
- package/src/components/side-navigation/SideNavigation.test.tsx +0 -2
- package/src/components/side-navigation/SideNavigation.tsx +1 -1
- package/src/components/side-navigation/SideNavigationItem.test.tsx +2 -4
- package/src/components/side-navigation/SideNavigationItem.tsx +23 -28
- package/src/components/skeleton/SkeletonCircle.test.tsx +0 -2
- package/src/components/skeleton/SkeletonCircle.tsx +0 -2
- package/src/components/skeleton/SkeletonRectangle.test.tsx +0 -2
- package/src/components/skeleton/SkeletonRectangle.tsx +0 -2
- package/src/components/skeleton/SkeletonTypography.stories.tsx +0 -2
- package/src/components/skeleton/SkeletonTypography.test.tsx +0 -2
- package/src/components/skeleton/SkeletonTypography.tsx +1 -1
- package/src/components/slider/Slider.test.tsx +1 -3
- package/src/components/slider/Slider.tsx +1 -1
- package/src/components/slideshow/Slideshow.stories.tsx +0 -1
- package/src/components/slideshow/Slideshow.test.tsx +0 -2
- package/src/components/slideshow/SlideshowControls.stories.tsx +0 -2
- package/src/components/slideshow/SlideshowItem.tsx +0 -2
- package/src/components/slideshow/useSlideFocusManagement.tsx +1 -1
- package/src/components/switch/Switch.test.tsx +5 -7
- package/src/components/switch/Switch.tsx +1 -1
- package/src/components/table/Table.test.tsx +0 -2
- package/src/components/table/Table.tsx +0 -2
- package/src/components/table/TableBody.test.tsx +0 -2
- package/src/components/table/TableBody.tsx +0 -2
- package/src/components/table/TableCell.test.tsx +1 -3
- package/src/components/table/TableCell.tsx +0 -2
- package/src/components/table/TableHeader.test.tsx +0 -2
- package/src/components/table/TableHeader.tsx +0 -2
- package/src/components/table/TableRow.test.tsx +0 -2
- package/src/components/table/TableRow.tsx +0 -2
- package/src/components/tabs/Tab.test.tsx +0 -2
- package/src/components/tabs/Tab.tsx +1 -1
- package/src/components/tabs/TabList.test.tsx +0 -2
- package/src/components/tabs/TabPanel.test.tsx +0 -2
- package/src/components/tabs/TabPanel.tsx +0 -2
- package/src/components/tabs/TabProvider.test.tsx +0 -2
- package/src/components/tabs/TabProvider.tsx +1 -1
- package/src/components/tabs/Tabs.stories.tsx +1 -1
- package/src/components/text/Text.stories.tsx +1 -1
- package/src/components/text/Text.test.tsx +0 -2
- package/src/components/text/Text.tsx +0 -2
- package/src/components/text-field/TextField.test.tsx +9 -10
- package/src/components/text-field/TextField.tsx +1 -1
- package/src/components/thumbnail/Thumbnail.test.tsx +29 -7
- package/src/components/thumbnail/Thumbnail.tsx +11 -11
- package/src/components/toolbar/Toolbar.tsx +1 -1
- package/src/components/tooltip/Tooltip.stories.tsx +2 -1
- package/src/components/tooltip/Tooltip.test.tsx +14 -8
- package/src/components/uploader/Uploader.test.tsx +2 -4
- package/src/components/user-block/UserBlock.stories.tsx +0 -2
- package/src/components/user-block/UserBlock.test.tsx +1 -3
- package/src/hooks/useId.test.tsx +0 -1
- package/src/hooks/useInfiniteScroll.tsx +1 -1
- package/src/hooks/usePreviousValue.ts +0 -1
- package/src/stories/decorators/withChromaticForceScreenSize.tsx +0 -1
- package/src/stories/decorators/withNestedProps.tsx +0 -1
- package/src/stories/decorators/withThemedBackground.tsx +0 -2
- package/src/stories/decorators/withWrapper.tsx +0 -2
- package/src/stories/utils/CustomLink.tsx +0 -1
- package/src/testing/utils/ThemeSentinel.tsx +0 -1
- package/src/untypped-modules.d.ts +4 -0
- package/src/utils/ClickAwayProvider/ClickAwayProvider.stories.jsx +1 -1
- package/src/utils/ClickAwayProvider/ClickAwayProvider.tsx +1 -1
- package/src/utils/MaterialThemeSwitcher/MaterialThemeSwitcher.tsx +1 -1
- package/src/utils/Portal/Portal.test.tsx +0 -1
- package/src/utils/Portal/PortalProvider.stories.jsx +0 -1
- package/src/utils/Portal/PortalProvider.test.tsx +1 -2
- package/src/utils/date/getYearDisplayName.test.ts +1 -1
- package/src/utils/disabled/DisabledStateProvider.stories.tsx +0 -2
- package/src/utils/disabled/useDisableStateProps.test.tsx +2 -2
- package/src/utils/react/OnBeforeUnmount.tsx +1 -1
- package/src/utils/react/RawClickable.test.tsx +153 -0
- package/src/utils/react/RawClickable.tsx +65 -0
- package/src/utils/react/skipRender.tsx +2 -2
- package/src/utils/react/wrapChildrenIconWithSpaces.test.tsx +1 -1
- package/src/utils/type/HasPolymorphicAs.ts +0 -2
- package/src/utils/type/HasRequiredLinkHref.ts +1 -0
- package/src/utils/type/index.ts +1 -0
- package/utils/index.d.ts +6 -6
- package/utils/index.js +1 -1
- package/src/utils/react/renderButtonOrLink.tsx +0 -16
package/CONTRIBUTING.md
CHANGED
|
@@ -4,7 +4,7 @@ We'd love for you to contribute to our source code and to make it even better th
|
|
|
4
4
|
|
|
5
5
|
## Getting the source code
|
|
6
6
|
|
|
7
|
-
To be able to contribute, you will have to use the global LumX package from our [GitHub repository](https://github.com/lumapps/design-system). You won't be able to contribute from the distributed packages
|
|
7
|
+
To be able to contribute, you will have to use the global LumX package from our [GitHub repository](https://github.com/lumapps/design-system). You won't be able to contribute from the distributed packages, so be sure to clone the repository before starting contributing:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
git clone git@github.com:lumapps/design-system.git
|
|
@@ -25,10 +25,6 @@ Here are the guidelines we'd like you to follow.
|
|
|
25
25
|
- [Coding rules](#coding-rules)
|
|
26
26
|
- [Git commit guidelines](#git-commit-guidelines)
|
|
27
27
|
|
|
28
|
-
## <a name="code-of-conduct"></a> Code of Conduct
|
|
29
|
-
|
|
30
|
-
As heavy users of [AngularJS](https://github.com/angular/angular.js) and [React](https://github.com/facebook/react/), we encourage you to read and follow the [AngularJS Code of Conduct](https://github.com/angular/code-of-conduct/blob/master/CODE_OF_CONDUCT.md) and the [React Code of Conduct](https://github.com/facebook/react/blob/master/CODE_OF_CONDUCT.md).
|
|
31
|
-
|
|
32
28
|
## <a name="got-a-question-or-a-problem-"></a> Got a question or a problem?
|
|
33
29
|
|
|
34
30
|
If you have questions about how to use LumX, please direct these to [StackOverflow](http://stackoverflow.com/questions/tagged/LumX).
|
package/README.md
CHANGED
|
@@ -30,9 +30,7 @@ Please refer to our [contributing guidelines](CONTRIBUTING.md).
|
|
|
30
30
|
|
|
31
31
|
Code and documentation copyright 2019 LumApps. Code released under the [MIT license](LICENSE.md).
|
|
32
32
|
|
|
33
|
-
[angularjs]: https://angularjs.org/
|
|
34
33
|
[react]: https://react.org/
|
|
35
34
|
[material]: http://www.google.com/design/spec/material-design/introduction.html
|
|
36
|
-
[angularjs-release]: https://www.npmjs.com/package/@lumx/angularjs
|
|
37
35
|
[react-release]: https://www.npmjs.com/package/@lumx/react
|
|
38
36
|
[webpack]: https://webpack.js.org/
|
package/_internal/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React__default, { useContext, useEffect, useMemo, useRef, createContext } from 'react';
|
|
2
2
|
import isEmpty from 'lodash/isEmpty';
|
|
3
|
-
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
4
3
|
import { createPortal } from 'react-dom';
|
|
5
4
|
|
|
6
5
|
function _defineProperty(e, r, t) {
|
|
@@ -11,6 +10,15 @@ function _defineProperty(e, r, t) {
|
|
|
11
10
|
writable: !0
|
|
12
11
|
}) : e[r] = t, e;
|
|
13
12
|
}
|
|
13
|
+
function _extends() {
|
|
14
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
15
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
16
|
+
var t = arguments[e];
|
|
17
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
18
|
+
}
|
|
19
|
+
return n;
|
|
20
|
+
}, _extends.apply(null, arguments);
|
|
21
|
+
}
|
|
14
22
|
function ownKeys(e, r) {
|
|
15
23
|
var t = Object.keys(e);
|
|
16
24
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -68,6 +76,9 @@ function _toPropertyKey(t) {
|
|
|
68
76
|
}
|
|
69
77
|
|
|
70
78
|
const _excluded = ["children"];
|
|
79
|
+
|
|
80
|
+
/** Disable state */
|
|
81
|
+
|
|
71
82
|
const DisabledStateContext = /*#__PURE__*/React__default.createContext({
|
|
72
83
|
state: null
|
|
73
84
|
});
|
|
@@ -80,10 +91,9 @@ function DisabledStateProvider(_ref) {
|
|
|
80
91
|
children
|
|
81
92
|
} = _ref,
|
|
82
93
|
value = _objectWithoutProperties(_ref, _excluded);
|
|
83
|
-
return /*#__PURE__*/
|
|
84
|
-
value: value
|
|
85
|
-
|
|
86
|
-
});
|
|
94
|
+
return /*#__PURE__*/React__default.createElement(DisabledStateContext.Provider, {
|
|
95
|
+
value: value
|
|
96
|
+
}, children);
|
|
87
97
|
}
|
|
88
98
|
|
|
89
99
|
/**
|
|
@@ -179,10 +189,9 @@ const ClickAwayProvider = ({
|
|
|
179
189
|
callback,
|
|
180
190
|
childrenRefs: useRef(currentContext.childrenRefs)
|
|
181
191
|
});
|
|
182
|
-
return /*#__PURE__*/
|
|
183
|
-
value: currentContext
|
|
184
|
-
|
|
185
|
-
});
|
|
192
|
+
return /*#__PURE__*/React.createElement(ClickAwayAncestorContext.Provider, {
|
|
193
|
+
value: currentContext
|
|
194
|
+
}, children);
|
|
186
195
|
};
|
|
187
196
|
ClickAwayProvider.displayName = 'ClickAwayProvider';
|
|
188
197
|
|
|
@@ -218,12 +227,10 @@ const Portal = ({
|
|
|
218
227
|
return context === null || context === void 0 ? void 0 : context.teardown;
|
|
219
228
|
}, [context === null || context === void 0 ? void 0 : context.teardown, enabled]);
|
|
220
229
|
if (!(context !== null && context !== void 0 && context.container)) {
|
|
221
|
-
return /*#__PURE__*/
|
|
222
|
-
children: children
|
|
223
|
-
});
|
|
230
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, children);
|
|
224
231
|
}
|
|
225
232
|
return /*#__PURE__*/createPortal(children, context.container);
|
|
226
233
|
};
|
|
227
234
|
|
|
228
|
-
export { ClickAwayProvider as C, DisabledStateProvider as D, Portal as P, _objectSpread2 as _, _objectWithoutProperties as a,
|
|
235
|
+
export { ClickAwayProvider as C, DisabledStateProvider as D, Portal as P, _objectSpread2 as _, _objectWithoutProperties as a, _extends as b, PortalProvider as c, useDisabledStateContext as u };
|
|
229
236
|
//# sourceMappingURL=index.js.map
|
package/_internal/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/utils/disabled/DisabledStateContext.tsx","../../src/hooks/useClickAway.tsx","../../src/utils/ClickAwayProvider/ClickAwayProvider.tsx","../../src/utils/Portal/PortalProvider.tsx","../../src/utils/Portal/Portal.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\n/** Disable state */\ntype DisabledStateContextValue =\n | {\n state: 'disabled';\n }\n | { state: undefined | null };\n\nexport const DisabledStateContext = React.createContext<DisabledStateContextValue>({ state: null });\n\nexport type DisabledStateProviderProps = DisabledStateContextValue & {\n children: React.ReactNode;\n};\n\n/**\n * Disabled state provider.\n * All nested LumX Design System components inherit this disabled state.\n */\nexport function DisabledStateProvider({ children, ...value }: DisabledStateProviderProps) {\n return <DisabledStateContext.Provider value={value}>{children}</DisabledStateContext.Provider>;\n}\n\n/**\n * Get DisabledState context value\n */\nexport function useDisabledStateContext(): DisabledStateContextValue {\n return useContext(DisabledStateContext);\n}\n","import { RefObject, useEffect } from 'react';\n\nimport { Falsy } from '@lumx/react/utils/type';\n\nimport isEmpty from 'lodash/isEmpty';\n\nconst EVENT_TYPES = ['mousedown', 'touchstart'];\n\nfunction isClickAway(targets: HTMLElement[], refs: Array<RefObject<HTMLElement>>): boolean {\n // The targets elements are not contained in any of the listed element references.\n return !refs.some((ref) => targets.some((target) => ref?.current?.contains(target)));\n}\n\nexport interface ClickAwayParameters {\n /**\n * A callback function to call when the user clicks away from the elements.\n */\n callback: EventListener | Falsy;\n /**\n * Elements considered within the click away context (clicking outside them will trigger the click away callback).\n */\n childrenRefs: RefObject<Array<RefObject<HTMLElement>>>;\n}\n\n/**\n * Listen to clicks away from the given elements and callback the passed in function.\n *\n * Warning: If you need to detect click away on nested React portals, please use the `ClickAwayProvider` component.\n */\nexport function useClickAway({ callback, childrenRefs }: ClickAwayParameters): void {\n useEffect(() => {\n const { current: currentRefs } = childrenRefs;\n if (!callback || !currentRefs || isEmpty(currentRefs)) {\n return undefined;\n }\n const listener: EventListener = (evt) => {\n const targets = [evt.composedPath?.()[0], evt.target] as HTMLElement[];\n if (isClickAway(targets, currentRefs)) {\n callback(evt);\n }\n };\n\n EVENT_TYPES.forEach((evtType) => document.addEventListener(evtType, listener));\n return () => {\n EVENT_TYPES.forEach((evtType) => document.removeEventListener(evtType, listener));\n };\n }, [callback, childrenRefs]);\n}\n","import React, { createContext, RefObject, useContext, useEffect, useMemo, useRef } from 'react';\nimport { ClickAwayParameters, useClickAway } from '@lumx/react/hooks/useClickAway';\n\ninterface ContextValue {\n childrenRefs: Array<RefObject<HTMLElement>>;\n addRefs(...newChildrenRefs: Array<RefObject<HTMLElement>>): void;\n}\n\nconst ClickAwayAncestorContext = createContext<ContextValue | null>(null);\n\ninterface ClickAwayProviderProps extends ClickAwayParameters {\n /**\n * (Optional) Element that should be considered as part of the parent\n */\n parentRef?: RefObject<HTMLElement>;\n /**\n * Children\n */\n children?: React.ReactNode;\n}\n\n/**\n * Component combining the `useClickAway` hook with a React context to hook into the React component tree and make sure\n * we take into account both the DOM tree and the React tree to detect click away.\n *\n * @return the react component.\n */\nexport const ClickAwayProvider: React.FC<ClickAwayProviderProps> = ({\n children,\n callback,\n childrenRefs,\n parentRef,\n}) => {\n const parentContext = useContext(ClickAwayAncestorContext);\n const currentContext = useMemo(() => {\n const context: ContextValue = {\n childrenRefs: [],\n /**\n * Add element refs to the current context and propagate to the parent context.\n */\n addRefs(...newChildrenRefs) {\n // Add element refs that should be considered as inside the click away context.\n context.childrenRefs.push(...newChildrenRefs);\n\n if (parentContext) {\n // Also add then to the parent context\n parentContext.addRefs(...newChildrenRefs);\n if (parentRef) {\n // The parent element is also considered as inside the parent click away context but not inside the current context\n parentContext.addRefs(parentRef);\n }\n }\n },\n };\n return context;\n }, [parentContext, parentRef]);\n\n useEffect(() => {\n const { current: currentRefs } = childrenRefs;\n if (!currentRefs) {\n return;\n }\n currentContext.addRefs(...currentRefs);\n }, [currentContext, childrenRefs]);\n\n useClickAway({ callback, childrenRefs: useRef(currentContext.childrenRefs) });\n return <ClickAwayAncestorContext.Provider value={currentContext}>{children}</ClickAwayAncestorContext.Provider>;\n};\nClickAwayProvider.displayName = 'ClickAwayProvider';\n","import React from 'react';\n\ntype Container = DocumentFragment | Element;\n\n/**\n * Portal initializing function.\n * If it does not provide a container, the Portal children will render in classic React tree and not in a portal.\n */\nexport type PortalInit = () => {\n container?: Container;\n teardown?: () => void;\n};\n\nexport const PortalContext = React.createContext<PortalInit>(() => ({ container: document.body }));\n\nexport interface PortalProviderProps {\n children?: React.ReactNode;\n value: PortalInit;\n}\n\n/**\n * Customize where <Portal> wrapped elements render (tooltip, popover, dialog, etc.)\n */\nexport const PortalProvider: React.FC<PortalProviderProps> = PortalContext.Provider;\n","import React from 'react';\nimport { createPortal } from 'react-dom';\nimport { PortalContext } from './PortalProvider';\n\nexport interface PortalProps {\n enabled?: boolean;\n children: React.ReactNode;\n}\n\n/**\n * Render children in a portal outside the current DOM position\n * (defaults to `document.body` but can be customized with the PortalContextProvider)\n */\nexport const Portal: React.FC<PortalProps> = ({ children, enabled = true }) => {\n const init = React.useContext(PortalContext);\n const context = React.useMemo(\n () => {\n return enabled ? init() : null;\n },\n // Only update on 'enabled'\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [enabled],\n );\n\n React.useLayoutEffect(() => {\n return context?.teardown;\n }, [context?.teardown, enabled]);\n\n if (!context?.container) {\n return <>{children}</>;\n }\n return createPortal(children, context.container);\n};\n"],"names":["DisabledStateContext","React","createContext","state","DisabledStateProvider","_ref","children","value","_objectWithoutProperties","_excluded","_jsx","Provider","useDisabledStateContext","useContext","EVENT_TYPES","isClickAway","targets","refs","some","ref","target","_ref$current","current","contains","useClickAway","callback","childrenRefs","useEffect","currentRefs","isEmpty","undefined","listener","evt","_evt$composedPath","composedPath","call","forEach","evtType","document","addEventListener","removeEventListener","ClickAwayAncestorContext","ClickAwayProvider","parentRef","parentContext","currentContext","useMemo","context","addRefs","newChildrenRefs","push","useRef","displayName","PortalContext","container","body","PortalProvider","Portal","enabled","init","useLayoutEffect","teardown","_Fragment","createPortal"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASO,MAAMA,oBAAoB,gBAAGC,cAAK,CAACC,aAAa,CAA4B;AAAEC,EAAAA,KAAK,EAAE,IAAA;AAAK,CAAC,CAAC,CAAA;AAMnG;AACA;AACA;AACA;AACO,SAASC,qBAAqBA,CAAAC,IAAA,EAAqD;EAAA,IAApD;AAAEC,MAAAA,QAAAA;AAA+C,KAAC,GAAAD,IAAA;AAAnCE,IAAAA,KAAK,GAAAC,wBAAA,CAAAH,IAAA,EAAAI,SAAA,CAAA,CAAA;AACtD,EAAA,oBAAOC,GAAA,CAACV,oBAAoB,CAACW,QAAQ,EAAA;AAACJ,IAAAA,KAAK,EAAEA,KAAM;AAAAD,IAAAA,QAAA,EAAEA,QAAAA;AAAQ,GAAgC,CAAC,CAAA;AAClG,CAAA;;AAEA;AACA;AACA;AACO,SAASM,uBAAuBA,GAA8B;EACjE,OAAOC,UAAU,CAACb,oBAAoB,CAAC,CAAA;AAC3C;;ACtBA,MAAMc,WAAW,GAAG,CAAC,WAAW,EAAE,YAAY,CAAC,CAAA;AAE/C,SAASC,WAAWA,CAACC,OAAsB,EAAEC,IAAmC,EAAW;AACvF;EACA,OAAO,CAACA,IAAI,CAACC,IAAI,CAAEC,GAAG,IAAKH,OAAO,CAACE,IAAI,CAAEE,MAAM,IAAA;AAAA,IAAA,IAAAC,YAAA,CAAA;AAAA,IAAA,OAAKF,GAAG,KAAHA,IAAAA,IAAAA,GAAG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CAACd,OAAO,KAAA,IAAA,IAAPA,OAAO,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAPA,OAAO,CAAEc,QAAQ,EAAEH,OAAO,CAAC,CAAC,CAAA;EAEhC,IAAI,EAACX,OAAO,KAAPA,IAAAA,IAAAA,OAAO,eAAPA,OAAO,CAAEO,SAAS,CAAE,EAAA;IACrB,oBAAO5C,GAAA,CAAAoD,QAAA,EAAA;AAAAxD,MAAAA,QAAA,EAAGA,QAAAA;AAAQ,KAAG,CAAC,CAAA;AAC1B,GAAA;AACA,EAAA,oBAAOyD,YAAY,CAACzD,QAAQ,EAAEyC,OAAO,CAACO,SAAS,CAAC,CAAA;AACpD;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/utils/disabled/DisabledStateContext.tsx","../../src/hooks/useClickAway.tsx","../../src/utils/ClickAwayProvider/ClickAwayProvider.tsx","../../src/utils/Portal/PortalProvider.tsx","../../src/utils/Portal/Portal.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\n/** Disable state */\ntype DisabledStateContextValue =\n | {\n state: 'disabled';\n }\n | { state: undefined | null };\n\nexport const DisabledStateContext = React.createContext<DisabledStateContextValue>({ state: null });\n\nexport type DisabledStateProviderProps = DisabledStateContextValue & {\n children: React.ReactNode;\n};\n\n/**\n * Disabled state provider.\n * All nested LumX Design System components inherit this disabled state.\n */\nexport function DisabledStateProvider({ children, ...value }: DisabledStateProviderProps) {\n return <DisabledStateContext.Provider value={value}>{children}</DisabledStateContext.Provider>;\n}\n\n/**\n * Get DisabledState context value\n */\nexport function useDisabledStateContext(): DisabledStateContextValue {\n return useContext(DisabledStateContext);\n}\n","import { RefObject, useEffect } from 'react';\n\nimport { Falsy } from '@lumx/react/utils/type';\n\nimport isEmpty from 'lodash/isEmpty';\n\nconst EVENT_TYPES = ['mousedown', 'touchstart'];\n\nfunction isClickAway(targets: HTMLElement[], refs: Array<RefObject<HTMLElement>>): boolean {\n // The targets elements are not contained in any of the listed element references.\n return !refs.some((ref) => targets.some((target) => ref?.current?.contains(target)));\n}\n\nexport interface ClickAwayParameters {\n /**\n * A callback function to call when the user clicks away from the elements.\n */\n callback: EventListener | Falsy;\n /**\n * Elements considered within the click away context (clicking outside them will trigger the click away callback).\n */\n childrenRefs: RefObject<Array<RefObject<HTMLElement>>>;\n}\n\n/**\n * Listen to clicks away from the given elements and callback the passed in function.\n *\n * Warning: If you need to detect click away on nested React portals, please use the `ClickAwayProvider` component.\n */\nexport function useClickAway({ callback, childrenRefs }: ClickAwayParameters): void {\n useEffect(() => {\n const { current: currentRefs } = childrenRefs;\n if (!callback || !currentRefs || isEmpty(currentRefs)) {\n return undefined;\n }\n const listener: EventListener = (evt) => {\n const targets = [evt.composedPath?.()[0], evt.target] as HTMLElement[];\n if (isClickAway(targets, currentRefs)) {\n callback(evt);\n }\n };\n\n EVENT_TYPES.forEach((evtType) => document.addEventListener(evtType, listener));\n return () => {\n EVENT_TYPES.forEach((evtType) => document.removeEventListener(evtType, listener));\n };\n }, [callback, childrenRefs]);\n}\n","import { createContext, RefObject, useContext, useEffect, useMemo, useRef } from 'react';\nimport { ClickAwayParameters, useClickAway } from '@lumx/react/hooks/useClickAway';\n\ninterface ContextValue {\n childrenRefs: Array<RefObject<HTMLElement>>;\n addRefs(...newChildrenRefs: Array<RefObject<HTMLElement>>): void;\n}\n\nconst ClickAwayAncestorContext = createContext<ContextValue | null>(null);\n\ninterface ClickAwayProviderProps extends ClickAwayParameters {\n /**\n * (Optional) Element that should be considered as part of the parent\n */\n parentRef?: RefObject<HTMLElement>;\n /**\n * Children\n */\n children?: React.ReactNode;\n}\n\n/**\n * Component combining the `useClickAway` hook with a React context to hook into the React component tree and make sure\n * we take into account both the DOM tree and the React tree to detect click away.\n *\n * @return the react component.\n */\nexport const ClickAwayProvider: React.FC<ClickAwayProviderProps> = ({\n children,\n callback,\n childrenRefs,\n parentRef,\n}) => {\n const parentContext = useContext(ClickAwayAncestorContext);\n const currentContext = useMemo(() => {\n const context: ContextValue = {\n childrenRefs: [],\n /**\n * Add element refs to the current context and propagate to the parent context.\n */\n addRefs(...newChildrenRefs) {\n // Add element refs that should be considered as inside the click away context.\n context.childrenRefs.push(...newChildrenRefs);\n\n if (parentContext) {\n // Also add then to the parent context\n parentContext.addRefs(...newChildrenRefs);\n if (parentRef) {\n // The parent element is also considered as inside the parent click away context but not inside the current context\n parentContext.addRefs(parentRef);\n }\n }\n },\n };\n return context;\n }, [parentContext, parentRef]);\n\n useEffect(() => {\n const { current: currentRefs } = childrenRefs;\n if (!currentRefs) {\n return;\n }\n currentContext.addRefs(...currentRefs);\n }, [currentContext, childrenRefs]);\n\n useClickAway({ callback, childrenRefs: useRef(currentContext.childrenRefs) });\n return <ClickAwayAncestorContext.Provider value={currentContext}>{children}</ClickAwayAncestorContext.Provider>;\n};\nClickAwayProvider.displayName = 'ClickAwayProvider';\n","import React from 'react';\n\ntype Container = DocumentFragment | Element;\n\n/**\n * Portal initializing function.\n * If it does not provide a container, the Portal children will render in classic React tree and not in a portal.\n */\nexport type PortalInit = () => {\n container?: Container;\n teardown?: () => void;\n};\n\nexport const PortalContext = React.createContext<PortalInit>(() => ({ container: document.body }));\n\nexport interface PortalProviderProps {\n children?: React.ReactNode;\n value: PortalInit;\n}\n\n/**\n * Customize where <Portal> wrapped elements render (tooltip, popover, dialog, etc.)\n */\nexport const PortalProvider: React.FC<PortalProviderProps> = PortalContext.Provider;\n","import React from 'react';\nimport { createPortal } from 'react-dom';\nimport { PortalContext } from './PortalProvider';\n\nexport interface PortalProps {\n enabled?: boolean;\n children: React.ReactNode;\n}\n\n/**\n * Render children in a portal outside the current DOM position\n * (defaults to `document.body` but can be customized with the PortalContextProvider)\n */\nexport const Portal: React.FC<PortalProps> = ({ children, enabled = true }) => {\n const init = React.useContext(PortalContext);\n const context = React.useMemo(\n () => {\n return enabled ? init() : null;\n },\n // Only update on 'enabled'\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [enabled],\n );\n\n React.useLayoutEffect(() => {\n return context?.teardown;\n }, [context?.teardown, enabled]);\n\n if (!context?.container) {\n return <>{children}</>;\n }\n return createPortal(children, context.container);\n};\n"],"names":["DisabledStateContext","React","createContext","state","DisabledStateProvider","_ref","children","value","_objectWithoutProperties","_excluded","createElement","Provider","useDisabledStateContext","useContext","EVENT_TYPES","isClickAway","targets","refs","some","ref","target","_ref$current","current","contains","useClickAway","callback","childrenRefs","useEffect","currentRefs","isEmpty","undefined","listener","evt","_evt$composedPath","composedPath","call","forEach","evtType","document","addEventListener","removeEventListener","ClickAwayAncestorContext","ClickAwayProvider","parentRef","parentContext","currentContext","useMemo","context","addRefs","newChildrenRefs","push","useRef","displayName","PortalContext","container","body","PortalProvider","Portal","enabled","init","useLayoutEffect","teardown","Fragment","createPortal"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;AAOO,MAAMA,oBAAoB,gBAAGC,cAAK,CAACC,aAAa,CAA4B;AAAEC,EAAAA,KAAK,EAAE,IAAA;AAAK,CAAC,CAAC,CAAA;AAMnG;AACA;AACA;AACA;AACO,SAASC,qBAAqBA,CAAAC,IAAA,EAAqD;EAAA,IAApD;AAAEC,MAAAA,QAAAA;AAA+C,KAAC,GAAAD,IAAA;AAAnCE,IAAAA,KAAK,GAAAC,wBAAA,CAAAH,IAAA,EAAAI,SAAA,CAAA,CAAA;AACtD,EAAA,oBAAOR,cAAA,CAAAS,aAAA,CAACV,oBAAoB,CAACW,QAAQ,EAAA;AAACJ,IAAAA,KAAK,EAAEA,KAAAA;AAAM,GAAA,EAAED,QAAwC,CAAC,CAAA;AAClG,CAAA;;AAEA;AACA;AACA;AACO,SAASM,uBAAuBA,GAA8B;EACjE,OAAOC,UAAU,CAACb,oBAAoB,CAAC,CAAA;AAC3C;;ACtBA,MAAMc,WAAW,GAAG,CAAC,WAAW,EAAE,YAAY,CAAC,CAAA;AAE/C,SAASC,WAAWA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CACZ,CAAC,CAAA;EAEDzD,cAAK,CAAC2D,eAAe,CAAC,MAAM;AACxB,IAAA,OAAOb,OAAO,KAAPA,IAAAA,IAAAA,OAAO,KAAPA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,OAAO,CAAEc,QAAQ,CAAA;AAC5B,GAAC,EAAE,CAACd,OAAO,KAAA,IAAA,IAAPA,OAAO,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAPA,OAAO,CAAEc,QAAQ,EAAEH,OAAO,CAAC,CAAC,CAAA;EAEhC,IAAI,EAACX,OAAO,KAAPA,IAAAA,IAAAA,OAAO,eAAPA,OAAO,CAAEO,SAAS,CAAE,EAAA;IACrB,oBAAOrD,cAAA,CAAAS,aAAA,CAAAT,cAAA,CAAA6D,QAAA,EAAGxD,IAAAA,EAAAA,QAAW,CAAC,CAAA;AAC1B,GAAA;AACA,EAAA,oBAAOyD,YAAY,CAACzD,QAAQ,EAAEyC,OAAO,CAACO,SAAS,CAAC,CAAA;AACpD;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { F as Falsy } from './_internal/Falsy.js';
|
|
2
|
-
import
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
|
+
import React__default, { Ref, ReactElement, ReactNode, SyntheticEvent, MouseEventHandler, KeyboardEventHandler, AriaAttributes, DetailedHTMLProps, ButtonHTMLAttributes, InputHTMLAttributes, RefObject, ImgHTMLAttributes, CSSProperties, SetStateAction, Key, ElementType } from 'react';
|
|
3
4
|
|
|
4
5
|
/** Get types of the values of a record. */
|
|
5
6
|
type ValueOf<T extends Record<any, any>> = T[keyof T];
|
|
@@ -371,10 +372,14 @@ type Comp<P, T = HTMLElement> = {
|
|
|
371
372
|
* @example ComponentRef<'div'> => React.Ref<HTMLDivElement>
|
|
372
373
|
* @example ComponentRef<Button> => React.Ref<HTMLButtonElement
|
|
373
374
|
*/
|
|
374
|
-
type ComponentRef<C> = C extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[C]['ref'] : C extends Comp<any, infer T> ?
|
|
375
|
+
type ComponentRef<C> = C extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[C]['ref'] : C extends Comp<any, infer T> ? React__default.Ref<T> : C extends React__default.JSXElementConstructor<{
|
|
375
376
|
ref?: infer R;
|
|
376
377
|
}> ? R : never;
|
|
377
378
|
|
|
379
|
+
type HasRequiredLinkHref<E> = E extends 'a' ? {
|
|
380
|
+
href: string;
|
|
381
|
+
} : Record<string, unknown>;
|
|
382
|
+
|
|
378
383
|
interface AlertDialogProps extends Omit<DialogProps, 'header' | 'footer'> {
|
|
379
384
|
/** Message variant. */
|
|
380
385
|
kind?: Kind;
|
|
@@ -396,7 +401,7 @@ interface AlertDialogProps extends Omit<DialogProps, 'header' | 'footer'> {
|
|
|
396
401
|
/**
|
|
397
402
|
* Children
|
|
398
403
|
*/
|
|
399
|
-
children?:
|
|
404
|
+
children?: React__default.ReactNode;
|
|
400
405
|
}
|
|
401
406
|
/**
|
|
402
407
|
* AlertDialog component.
|
|
@@ -788,7 +793,7 @@ interface CheckboxProps extends GenericProps, HasTheme, HasAriaDisabled {
|
|
|
788
793
|
/** Native input id property. */
|
|
789
794
|
id?: string;
|
|
790
795
|
/** Native input ref. */
|
|
791
|
-
inputRef?:
|
|
796
|
+
inputRef?: React__default.Ref<HTMLInputElement>;
|
|
792
797
|
/** Whether it is checked or not or intermediate. */
|
|
793
798
|
isChecked?: boolean | 'intermediate';
|
|
794
799
|
/** Whether the component is disabled or not. */
|
|
@@ -1066,7 +1071,7 @@ interface DialogProps extends GenericProps {
|
|
|
1066
1071
|
/** whether to disable the scroll on the body or not */
|
|
1067
1072
|
disableBodyScroll?: boolean;
|
|
1068
1073
|
/** Children */
|
|
1069
|
-
children?:
|
|
1074
|
+
children?: React__default.ReactNode;
|
|
1070
1075
|
}
|
|
1071
1076
|
type DialogSizes = Extract<Size, 'tiny' | 'regular' | 'big' | 'huge'>;
|
|
1072
1077
|
/**
|
|
@@ -1305,15 +1310,15 @@ interface ExpansionPanelProps extends GenericProps, HasCloseMode, HasTheme {
|
|
|
1305
1310
|
/** Label text (overwritten if a `<header>` is provided in the children). */
|
|
1306
1311
|
label?: string;
|
|
1307
1312
|
/** On open callback. */
|
|
1308
|
-
onOpen?: (event:
|
|
1313
|
+
onOpen?: (event: React__default.MouseEvent) => void;
|
|
1309
1314
|
/** On close callback. */
|
|
1310
|
-
onClose?: (event:
|
|
1315
|
+
onClose?: (event: React__default.MouseEvent) => void;
|
|
1311
1316
|
/** Props to pass to the toggle button (minus those already set by the ExpansionPanel props). */
|
|
1312
1317
|
toggleButtonProps: Pick<IconButtonProps, 'label'> & Omit<IconButtonProps, 'label' | 'onClick' | 'icon' | 'emphasis' | 'color'>;
|
|
1313
1318
|
/** On toggle open or close callback. */
|
|
1314
|
-
onToggleOpen?(shouldOpen: boolean, event:
|
|
1319
|
+
onToggleOpen?(shouldOpen: boolean, event: React__default.MouseEvent): void;
|
|
1315
1320
|
/** Children */
|
|
1316
|
-
children?:
|
|
1321
|
+
children?: React__default.ReactNode;
|
|
1317
1322
|
}
|
|
1318
1323
|
/**
|
|
1319
1324
|
* ExpansionPanel component.
|
|
@@ -1670,7 +1675,6 @@ interface IconProps extends GenericProps, HasTheme {
|
|
|
1670
1675
|
/** Sets an alternative text on the svg. Will set an `img` role to the svg. */
|
|
1671
1676
|
alt?: string;
|
|
1672
1677
|
}
|
|
1673
|
-
|
|
1674
1678
|
/**
|
|
1675
1679
|
* Icon component.
|
|
1676
1680
|
*
|
|
@@ -1693,7 +1697,7 @@ type FocusPoint = {
|
|
|
1693
1697
|
* https://github.com/typescript-cheatsheets/react-typescript-cheatsheet/blob/master/ADVANCED.md#adding-non-standard-attributes
|
|
1694
1698
|
*/
|
|
1695
1699
|
declare module 'react' {
|
|
1696
|
-
interface ImgHTMLAttributes<T> extends
|
|
1700
|
+
interface ImgHTMLAttributes<T> extends React__default.HTMLAttributes<T> {
|
|
1697
1701
|
loading?: 'eager' | 'lazy';
|
|
1698
1702
|
}
|
|
1699
1703
|
}
|
|
@@ -1759,7 +1763,7 @@ interface ThumbnailProps extends GenericProps, HasTheme {
|
|
|
1759
1763
|
/** Image loading mode. */
|
|
1760
1764
|
loading?: ImgHTMLProps['loading'];
|
|
1761
1765
|
/** Ref of an existing placeholder image to display while loading. */
|
|
1762
|
-
loadingPlaceholderImageRef?:
|
|
1766
|
+
loadingPlaceholderImageRef?: React__default.RefObject<HTMLImageElement>;
|
|
1763
1767
|
/** On click callback. */
|
|
1764
1768
|
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
1765
1769
|
/** On key press callback. */
|
|
@@ -1767,7 +1771,7 @@ interface ThumbnailProps extends GenericProps, HasTheme {
|
|
|
1767
1771
|
/** Variant of the component. */
|
|
1768
1772
|
variant?: ThumbnailVariant;
|
|
1769
1773
|
/** Props to pass to the link wrapping the thumbnail. */
|
|
1770
|
-
linkProps?:
|
|
1774
|
+
linkProps?: React__default.DetailedHTMLProps<React__default.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
|
|
1771
1775
|
/** Custom react component for the link (can be used to inject react router Link). */
|
|
1772
1776
|
linkAs?: 'a' | any;
|
|
1773
1777
|
}
|
|
@@ -1884,8 +1888,8 @@ declare function useImageLightbox<P extends Partial<ImageLightboxProps>>(props:
|
|
|
1884
1888
|
* @param index Provide an index to choose which image to display when the image lightbox opens.
|
|
1885
1889
|
* */
|
|
1886
1890
|
getTriggerProps: (options?: TriggerOptions) => {
|
|
1887
|
-
onClick:
|
|
1888
|
-
ref:
|
|
1891
|
+
onClick: React__default.MouseEventHandler;
|
|
1892
|
+
ref: React__default.Ref<any>;
|
|
1889
1893
|
};
|
|
1890
1894
|
/** Props to forward to the ImageLightbox */
|
|
1891
1895
|
imageLightboxProps: ManagedProps & P;
|
|
@@ -2260,15 +2264,11 @@ type BaseNavigationItemProps = {
|
|
|
2260
2264
|
/** Mark as the current page link */
|
|
2261
2265
|
isCurrentPage?: boolean;
|
|
2262
2266
|
};
|
|
2263
|
-
|
|
2264
|
-
type RequiredLinkHref<E> = E extends 'a' ? {
|
|
2265
|
-
href: string;
|
|
2266
|
-
} : Record<string, unknown>;
|
|
2267
|
-
declare const NavigationItem: (<E extends React.ElementType = "a">(props: React.PropsWithoutRef<React.ComponentProps<E>> & {
|
|
2267
|
+
declare const NavigationItem: (<E extends ElementType = "a">(props: React$1.PropsWithoutRef<React$1.ComponentProps<E>> & {
|
|
2268
2268
|
as?: E | undefined;
|
|
2269
|
-
} & HasTheme & HasClassName & BaseNavigationItemProps &
|
|
2269
|
+
} & HasTheme & HasClassName & BaseNavigationItemProps & HasRequiredLinkHref<E> & React$1.ComponentProps<E> & {
|
|
2270
2270
|
ref?: ComponentRef<E> | undefined;
|
|
2271
|
-
}) => React.JSX.Element) & {
|
|
2271
|
+
}) => React$1.JSX.Element) & {
|
|
2272
2272
|
displayName: string;
|
|
2273
2273
|
className: string;
|
|
2274
2274
|
};
|
|
@@ -2845,7 +2845,7 @@ interface SlideshowProps extends GenericProps, Pick<SlidesProps, 'autoPlay' | 's
|
|
|
2845
2845
|
/** Callback when slide changes */
|
|
2846
2846
|
onChange?(index: number): void;
|
|
2847
2847
|
/** Children */
|
|
2848
|
-
children?:
|
|
2848
|
+
children?: React__default.ReactNode;
|
|
2849
2849
|
}
|
|
2850
2850
|
/**
|
|
2851
2851
|
* Slideshow component.
|
|
@@ -2948,7 +2948,7 @@ interface SlideshowControlsProps extends GenericProps, HasTheme {
|
|
|
2948
2948
|
/** Props to pass to the previous button (minus those already set by the SlideshowControls props). */
|
|
2949
2949
|
previousButtonProps: Pick<IconButtonProps, 'label'> & Omit<IconButtonProps, 'label' | 'onClick' | 'icon' | 'emphasis' | 'color'>;
|
|
2950
2950
|
/** Props to pass to the pagination wrapper */
|
|
2951
|
-
paginationProps?: Omit<
|
|
2951
|
+
paginationProps?: Omit<React__default.HTMLAttributes<HTMLDivElement>, 'className' | 'style' | 'role'>;
|
|
2952
2952
|
/** Number of slides. */
|
|
2953
2953
|
slidesCount: number;
|
|
2954
2954
|
/** On next button click callback. */
|
|
@@ -2967,7 +2967,7 @@ interface SlideshowControlsProps extends GenericProps, HasTheme {
|
|
|
2967
2967
|
/**
|
|
2968
2968
|
* function to be executed in order to retrieve the props for a pagination item.
|
|
2969
2969
|
*/
|
|
2970
|
-
paginationItemProps?: (itemIndex: number) =>
|
|
2970
|
+
paginationItemProps?: (itemIndex: number) => React__default.HTMLAttributes<HTMLButtonElement> & {
|
|
2971
2971
|
label?: string;
|
|
2972
2972
|
};
|
|
2973
2973
|
/** Props to pass to the lay button (minus those already set by the SlideshowControls props). */
|
|
@@ -3000,7 +3000,7 @@ interface SlidesProps extends GenericProps, HasTheme {
|
|
|
3000
3000
|
/** callback to change whether the slideshow is playing or not */
|
|
3001
3001
|
toggleAutoPlay: () => void;
|
|
3002
3002
|
/** component to be rendered after the slides */
|
|
3003
|
-
afterSlides?:
|
|
3003
|
+
afterSlides?: React__default.ReactNode;
|
|
3004
3004
|
/** Whether the slides have controls linked */
|
|
3005
3005
|
hasControls?: boolean;
|
|
3006
3006
|
/**
|
|
@@ -3009,7 +3009,7 @@ interface SlidesProps extends GenericProps, HasTheme {
|
|
|
3009
3009
|
* */
|
|
3010
3010
|
slideGroupLabel?: (groupPosition: number, groupTotal: number) => string;
|
|
3011
3011
|
/** Children */
|
|
3012
|
-
children?:
|
|
3012
|
+
children?: React__default.ReactNode;
|
|
3013
3013
|
}
|
|
3014
3014
|
/**
|
|
3015
3015
|
* Slides component.
|
|
@@ -3407,8 +3407,8 @@ type UploaderSize = Extract<Size, 'xl' | 'xxl'>;
|
|
|
3407
3407
|
/**
|
|
3408
3408
|
* Extend native HTML input props with specialized `onChange` providing the a `File` array.
|
|
3409
3409
|
*/
|
|
3410
|
-
interface FileInputProps extends Omit<
|
|
3411
|
-
onChange(files: File[], evt:
|
|
3410
|
+
interface FileInputProps extends Omit<React__default.ComponentProps<'input'>, 'onChange'> {
|
|
3411
|
+
onChange(files: File[], evt: React__default.ChangeEvent<HTMLInputElement>): void;
|
|
3412
3412
|
}
|
|
3413
3413
|
/**
|
|
3414
3414
|
* Defines the props of the component.
|
|
@@ -3453,13 +3453,13 @@ interface UserBlockProps extends GenericProps, HasTheme {
|
|
|
3453
3453
|
/** Additional fields used to describe the user. */
|
|
3454
3454
|
fields?: string[];
|
|
3455
3455
|
/** Props to pass to the link wrapping the avatar thumbnail. */
|
|
3456
|
-
linkProps?:
|
|
3456
|
+
linkProps?: React__default.DetailedHTMLProps<React__default.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
|
|
3457
3457
|
/** Custom react component for the link (can be used to inject react router Link). */
|
|
3458
3458
|
linkAs?: 'a' | any;
|
|
3459
3459
|
/** Multiple action toolbar content. */
|
|
3460
3460
|
multipleActions?: ReactNode;
|
|
3461
3461
|
/** User name. */
|
|
3462
|
-
name?:
|
|
3462
|
+
name?: React__default.ReactNode;
|
|
3463
3463
|
/** Props to pass to the name block. */
|
|
3464
3464
|
nameProps?: GenericProps;
|
|
3465
3465
|
/** Orientation. */
|
|
@@ -3475,9 +3475,9 @@ interface UserBlockProps extends GenericProps, HasTheme {
|
|
|
3475
3475
|
/** On mouse leave callback. */
|
|
3476
3476
|
onMouseLeave?(): void;
|
|
3477
3477
|
/** Display additional fields below the original name and fields */
|
|
3478
|
-
additionalFields?:
|
|
3478
|
+
additionalFields?: React__default.ReactNode;
|
|
3479
3479
|
/** Display an additional element after the entire component. (to the right if orientation is horizontal, at the bottom if orientation is vertical) */
|
|
3480
|
-
after?:
|
|
3480
|
+
after?: React__default.ReactNode;
|
|
3481
3481
|
}
|
|
3482
3482
|
/**
|
|
3483
3483
|
* UserBlock component.
|
|
@@ -3490,9 +3490,9 @@ declare const UserBlock: Comp<UserBlockProps, HTMLDivElement>;
|
|
|
3490
3490
|
|
|
3491
3491
|
type ThemeContextValue = Theme | undefined;
|
|
3492
3492
|
/** Provide a theme context to all children. */
|
|
3493
|
-
declare const ThemeProvider:
|
|
3493
|
+
declare const ThemeProvider: React__default.FC<{
|
|
3494
3494
|
value: ThemeContextValue;
|
|
3495
|
-
children?:
|
|
3495
|
+
children?: React__default.ReactNode;
|
|
3496
3496
|
}>;
|
|
3497
3497
|
/** Get the theme in the current context. */
|
|
3498
3498
|
declare function useTheme(): ThemeContextValue;
|