@lumx/react 3.20.1-alpha.36 → 3.20.1-alpha.38
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 +4 -15
- package/index.js +13966 -64
- package/index.js.map +1 -0
- package/package.json +3 -3
- package/utils/index.js +159 -3
- package/utils/index.js.map +1 -0
- package/_internal/035c132d.js +0 -314
- package/_internal/0b9c76cb.js +0 -5
- package/_internal/0ea95af1.js +0 -819
- package/_internal/230173a8.js +0 -12
- package/_internal/2a3d237c.js +0 -11
- package/_internal/2c2b6a89.js +0 -51
- package/_internal/3181f000.js +0 -13
- package/_internal/36bd7352.js +0 -218
- package/_internal/3864a6c1.js +0 -436
- package/_internal/3a1facc0.js +0 -17
- package/_internal/49bbeed3.js +0 -5
- package/_internal/4daccdd5.js +0 -24
- package/_internal/4f4c0582.js +0 -2169
- package/_internal/5cef5e8c.js +0 -74
- package/_internal/6a60381c.js +0 -117
- package/_internal/6f084a40.js +0 -111
- package/_internal/76ddefd4.js +0 -61
- package/_internal/78df9309.js +0 -19
- package/_internal/7ad474e4.js +0 -98
- package/_internal/7b293665.js +0 -19
- package/_internal/7daf0f24.js +0 -76
- package/_internal/825ac334.js +0 -129
- package/_internal/827b804a.js +0 -5
- package/_internal/8bce732e.js +0 -8
- package/_internal/9d1336a1.js +0 -18
- package/_internal/a38bdcd0.js +0 -49
- package/_internal/b326655a.js +0 -682
- package/_internal/b83e864b.js +0 -76
- package/_internal/bace1bf1.js +0 -103
- package/_internal/c57190eb.js +0 -146
- package/_internal/components/alert-dialog/index-284fed80.js +0 -163
- package/_internal/components/autocomplete/__mockData__/index-96fc7ea7.js +0 -27
- package/_internal/components/autocomplete/index-27a49d5d.js +0 -261
- package/_internal/components/avatar/index-b8bc3cae.js +0 -83
- package/_internal/components/badge/index-9880f056.js +0 -81
- package/_internal/components/button/index-d919f96d.js +0 -47
- package/_internal/components/checkbox/index-dd478de9.js +0 -143
- package/_internal/components/chip/index-7f84cdbd.js +0 -102
- package/_internal/components/comment-block/index-e942de30.js +0 -138
- package/_internal/components/date-picker/index-a258d3ce.js +0 -596
- package/_internal/components/dialog/index-c7066813.js +0 -238
- package/_internal/components/divider/index-b6934baf.js +0 -50
- package/_internal/components/drag-handle/index-80e5af6c.js +0 -52
- package/_internal/components/dropdown/index-cebfc268.js +0 -147
- package/_internal/components/expansion-panel/index-9d45a211.js +0 -167
- package/_internal/components/flag/index-33e9d909.js +0 -59
- package/_internal/components/flex-box/index-0d6b6b43.js +0 -56
- package/_internal/components/generic-block/index-836c4352.js +0 -124
- package/_internal/components/grid/index-8c16a4f1.js +0 -104
- package/_internal/components/grid-column/index-4a2f56bb.js +0 -59
- package/_internal/components/heading/index-fd558a9a.js +0 -53
- package/_internal/components/icon/index-e7b9b40e.js +0 -1
- package/_internal/components/image-block/index-7021c2f1.js +0 -110
- package/_internal/components/image-lightbox/index-27017547.js +0 -759
- package/_internal/components/inline-list/index-52efec7f.js +0 -74
- package/_internal/components/input-helper/index-5a837e7c.js +0 -71
- package/_internal/components/input-label/index-0113f382.js +0 -59
- package/_internal/components/lightbox/index-fad5a9f2.js +0 -155
- package/_internal/components/link/index-008bae4b.js +0 -72
- package/_internal/components/link-preview/index-3e9c32f2.js +0 -117
- package/_internal/components/list/index-da88c6e9.js +0 -71
- package/_internal/components/message/index-17b568f2.js +0 -98
- package/_internal/components/mosaic/index-2d40e01c.js +0 -95
- package/_internal/components/navigation/index-dc17c639.js +0 -225
- package/_internal/components/notification/index-a1101015.js +0 -146
- package/_internal/components/popover/index-dbca63f1.js +0 -2
- package/_internal/components/popover-dialog/index-654d2abc.js +0 -66
- package/_internal/components/post-block/index-4b6b4dcb.js +0 -109
- package/_internal/components/progress/index-6f578c31.js +0 -182
- package/_internal/components/progress-tracker/index-700bc4c2.js +0 -309
- package/_internal/components/radio-button/index-89b725af.js +0 -149
- package/_internal/components/select/index-2755aa32.js +0 -458
- package/_internal/components/side-navigation/index-0bbe1fdd.js +0 -165
- package/_internal/components/skeleton/index-b2f8501c.js +0 -166
- package/_internal/components/slider/index-4f9b891b.js +0 -311
- package/_internal/components/slideshow/index-d4604589.js +0 -150
- package/_internal/components/switch/index-58fe0f0c.js +0 -122
- package/_internal/components/table/index-d541aa88.js +0 -297
- package/_internal/components/tabs/index-af1538d6.js +0 -298
- package/_internal/components/text/index-5bfc6d5e.js +0 -1
- package/_internal/components/text-field/index-47c98d09.js +0 -360
- package/_internal/components/thumbnail/index-71545d95.js +0 -41
- package/_internal/components/toolbar/index-7041a5a6.js +0 -61
- package/_internal/components/tooltip/index-8bb97e60.js +0 -327
- package/_internal/components/uploader/index-8f6f55de.js +0 -153
- package/_internal/components/user-block/index-70d4ce8f.js +0 -145
- package/_internal/d0e3f49e.js +0 -23
- package/_internal/de24f857.js +0 -3
- package/_internal/e806b848.js +0 -8
- package/_internal/e913a3af.js +0 -117
- package/_internal/ea04260d.js +0 -28
- package/_internal/eaf6c45a.js +0 -3
- package/_internal/ebdcb0c7.js +0 -60
- package/_internal/ef5d1aac.js +0 -3
- package/_internal/f0d7d6ea.js +0 -29
- package/_internal/utils/ClickAwayProvider/index-1234ce76.js +0 -94
- package/_internal/utils/MaterialThemeSwitcher/index-8d22de5a.js +0 -48
- package/_internal/utils/Portal/index-6e0a7404.js +0 -44
- package/_internal/utils/disabled/index-075b99c3.js +0 -36
- package/_internal/utils/type/index-ea9fc197.js +0 -2
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { Children, isValidElement } from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { getRootClassName, getTypographyClassName, fontColorClass } from '@lumx/core/js/utils/className';
|
|
4
|
-
import { f as forwardRef } from '../../8bce732e.js';
|
|
5
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Component display name.
|
|
9
|
-
*/
|
|
10
|
-
const COMPONENT_NAME = 'InlineList';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Component default class name and class prefix.
|
|
14
|
-
*/
|
|
15
|
-
const CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Component default props.
|
|
19
|
-
*/
|
|
20
|
-
const DEFAULT_PROPS = {};
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* InlineList component.
|
|
24
|
-
*
|
|
25
|
-
* @param props Component props.
|
|
26
|
-
* @param ref Component ref.
|
|
27
|
-
* @return React element.
|
|
28
|
-
*/
|
|
29
|
-
const InlineList = forwardRef((props, ref) => {
|
|
30
|
-
const {
|
|
31
|
-
className,
|
|
32
|
-
color,
|
|
33
|
-
colorVariant,
|
|
34
|
-
typography,
|
|
35
|
-
children,
|
|
36
|
-
wrap,
|
|
37
|
-
...forwardedProps
|
|
38
|
-
} = props;
|
|
39
|
-
const typographyClassName = typography && getTypographyClassName(typography);
|
|
40
|
-
return (
|
|
41
|
-
/*#__PURE__*/
|
|
42
|
-
// eslint-disable-next-line jsx-a11y/no-redundant-roles
|
|
43
|
-
jsx("ul", {
|
|
44
|
-
...forwardedProps,
|
|
45
|
-
ref: ref,
|
|
46
|
-
className: classNames(className, CLASSNAME, wrap && `${CLASSNAME}--wrap`, fontColorClass(color, colorVariant), typographyClassName)
|
|
47
|
-
// Lists with removed bullet style can lose their a11y list role on some browsers
|
|
48
|
-
,
|
|
49
|
-
role: "list",
|
|
50
|
-
children: Children.toArray(children).map((child, index) => {
|
|
51
|
-
const key = /*#__PURE__*/isValidElement(child) && child.key || index;
|
|
52
|
-
return (
|
|
53
|
-
/*#__PURE__*/
|
|
54
|
-
// We need to item is set as display: contents which removes the semantic.
|
|
55
|
-
// eslint-disable-next-line jsx-a11y/no-redundant-roles
|
|
56
|
-
jsxs("li", {
|
|
57
|
-
role: "listitem",
|
|
58
|
-
className: `${CLASSNAME}__item`,
|
|
59
|
-
children: [index !== 0 && /*#__PURE__*/jsx("span", {
|
|
60
|
-
className: `${CLASSNAME}__item-separator`,
|
|
61
|
-
"aria-hidden": "true",
|
|
62
|
-
children: '\u00A0•\u00A0'
|
|
63
|
-
}), child]
|
|
64
|
-
}, key)
|
|
65
|
-
);
|
|
66
|
-
})
|
|
67
|
-
})
|
|
68
|
-
);
|
|
69
|
-
});
|
|
70
|
-
InlineList.displayName = COMPONENT_NAME;
|
|
71
|
-
InlineList.className = CLASSNAME;
|
|
72
|
-
InlineList.defaultProps = DEFAULT_PROPS;
|
|
73
|
-
|
|
74
|
-
export { InlineList };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
import { getRootClassName, handleBasicClasses } from '@lumx/core/js/utils/className';
|
|
3
|
-
import { f as forwardRef } from '../../8bce732e.js';
|
|
4
|
-
import { u as useTheme } from '../../3181f000.js';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
import { Kind, Theme } from '@lumx/core/js/constants';
|
|
7
|
-
|
|
8
|
-
const INPUT_HELPER_CONFIGURATION = {
|
|
9
|
-
error: {
|
|
10
|
-
color: 'red'
|
|
11
|
-
},
|
|
12
|
-
success: {
|
|
13
|
-
color: 'green'
|
|
14
|
-
},
|
|
15
|
-
warning: {
|
|
16
|
-
color: 'yellow'
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Component display name.
|
|
22
|
-
*/
|
|
23
|
-
const COMPONENT_NAME = 'InputHelper';
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Component default class name and class prefix.
|
|
27
|
-
*/
|
|
28
|
-
const CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Component default props.
|
|
32
|
-
*/
|
|
33
|
-
const DEFAULT_PROPS = {
|
|
34
|
-
kind: Kind.info
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* InputHelper component.
|
|
39
|
-
*
|
|
40
|
-
* @param props Component props.
|
|
41
|
-
* @param ref Component ref.
|
|
42
|
-
* @return React element.
|
|
43
|
-
*/
|
|
44
|
-
const InputHelper = forwardRef((props, ref) => {
|
|
45
|
-
const defaultTheme = useTheme() || Theme.light;
|
|
46
|
-
const {
|
|
47
|
-
children,
|
|
48
|
-
className,
|
|
49
|
-
kind = DEFAULT_PROPS.kind,
|
|
50
|
-
theme = defaultTheme,
|
|
51
|
-
...forwardedProps
|
|
52
|
-
} = props;
|
|
53
|
-
const {
|
|
54
|
-
color
|
|
55
|
-
} = INPUT_HELPER_CONFIGURATION[kind] || {};
|
|
56
|
-
return /*#__PURE__*/jsx("p", {
|
|
57
|
-
ref: ref,
|
|
58
|
-
...forwardedProps,
|
|
59
|
-
className: classNames(className, handleBasicClasses({
|
|
60
|
-
prefix: CLASSNAME,
|
|
61
|
-
color,
|
|
62
|
-
theme
|
|
63
|
-
})),
|
|
64
|
-
children: children
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
InputHelper.displayName = COMPONENT_NAME;
|
|
68
|
-
InputHelper.className = CLASSNAME;
|
|
69
|
-
InputHelper.defaultProps = DEFAULT_PROPS;
|
|
70
|
-
|
|
71
|
-
export { InputHelper };
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
import { getRootClassName, getTypographyClassName, handleBasicClasses } from '@lumx/core/js/utils/className';
|
|
3
|
-
import { f as forwardRef } from '../../8bce732e.js';
|
|
4
|
-
import { u as useTheme } from '../../3181f000.js';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
import { Theme } from '@lumx/core/js/constants';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Component display name.
|
|
10
|
-
*/
|
|
11
|
-
const COMPONENT_NAME = 'InputLabel';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Component default class name and class prefix.
|
|
15
|
-
*/
|
|
16
|
-
const CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Component default props.
|
|
20
|
-
*/
|
|
21
|
-
const DEFAULT_PROPS = {};
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* InputLabel component.
|
|
25
|
-
*
|
|
26
|
-
* @param props Component props.
|
|
27
|
-
* @param ref Component ref.
|
|
28
|
-
* @return React element.
|
|
29
|
-
*/
|
|
30
|
-
const InputLabel = forwardRef((props, ref) => {
|
|
31
|
-
const defaultTheme = useTheme() || Theme.light;
|
|
32
|
-
const {
|
|
33
|
-
children,
|
|
34
|
-
className,
|
|
35
|
-
htmlFor,
|
|
36
|
-
isRequired,
|
|
37
|
-
theme = defaultTheme,
|
|
38
|
-
typography,
|
|
39
|
-
...forwardedProps
|
|
40
|
-
} = props;
|
|
41
|
-
const typographyClass = typography && getTypographyClassName(typography);
|
|
42
|
-
return /*#__PURE__*/jsx("label", {
|
|
43
|
-
ref: ref,
|
|
44
|
-
...forwardedProps,
|
|
45
|
-
htmlFor: htmlFor,
|
|
46
|
-
className: classNames(className, handleBasicClasses({
|
|
47
|
-
prefix: CLASSNAME,
|
|
48
|
-
isRequired,
|
|
49
|
-
theme,
|
|
50
|
-
hasCustomTypography: Boolean(typography)
|
|
51
|
-
}), typographyClass),
|
|
52
|
-
children: children
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
InputLabel.displayName = COMPONENT_NAME;
|
|
56
|
-
InputLabel.className = CLASSNAME;
|
|
57
|
-
InputLabel.defaultProps = DEFAULT_PROPS;
|
|
58
|
-
|
|
59
|
-
export { InputLabel };
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import { useRef, useEffect } from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { D as DOCUMENT } from '../../d0e3f49e.js';
|
|
4
|
-
import { getRootClassName, handleBasicClasses } from '@lumx/core/js/utils/className';
|
|
5
|
-
import { u as useFocusTrap } from '../../6f084a40.js';
|
|
6
|
-
import { u as useDisableBodyScroll } from '../../36bd7352.js';
|
|
7
|
-
import { m as mergeRefs } from '../../f0d7d6ea.js';
|
|
8
|
-
import { u as useCallbackOnEscape } from '../../76ddefd4.js';
|
|
9
|
-
import { u as useTransitionVisibility } from '../../a38bdcd0.js';
|
|
10
|
-
import { T as ThemeProvider } from '../../3181f000.js';
|
|
11
|
-
import { f as forwardRef } from '../../8bce732e.js';
|
|
12
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
|
-
import { Portal } from '../../utils/Portal/index-6e0a7404.js';
|
|
14
|
-
import { I as IconButton } from '../../b83e864b.js';
|
|
15
|
-
import { m as mdiClose } from '../../eaf6c45a.js';
|
|
16
|
-
import { H as HeadingLevelProvider } from '../../ebdcb0c7.js';
|
|
17
|
-
import { ClickAwayProvider } from '../../utils/ClickAwayProvider/index-1234ce76.js';
|
|
18
|
-
import { DIALOG_TRANSITION_DURATION } from '@lumx/core/js/constants';
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Component display name.
|
|
22
|
-
*/
|
|
23
|
-
const COMPONENT_NAME = 'Lightbox';
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Component default class name and class prefix.
|
|
27
|
-
*/
|
|
28
|
-
const CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Lightbox component.
|
|
32
|
-
*
|
|
33
|
-
* @param props Component props.
|
|
34
|
-
* @param ref Component ref.
|
|
35
|
-
* @return React element.
|
|
36
|
-
*/
|
|
37
|
-
const Lightbox = forwardRef((props, ref) => {
|
|
38
|
-
const {
|
|
39
|
-
'aria-labelledby': propAriaLabelledBy,
|
|
40
|
-
ariaLabelledBy = propAriaLabelledBy,
|
|
41
|
-
'aria-label': propAriaLabel,
|
|
42
|
-
ariaLabel = propAriaLabel,
|
|
43
|
-
children,
|
|
44
|
-
className,
|
|
45
|
-
closeButtonProps,
|
|
46
|
-
isOpen,
|
|
47
|
-
onClose,
|
|
48
|
-
parentElement,
|
|
49
|
-
focusElement,
|
|
50
|
-
preventAutoClose,
|
|
51
|
-
theme,
|
|
52
|
-
zIndex,
|
|
53
|
-
...forwardedProps
|
|
54
|
-
} = props;
|
|
55
|
-
if (!DOCUMENT) {
|
|
56
|
-
// Can't render in SSR.
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
61
|
-
const childrenRef = useRef(null);
|
|
62
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
63
|
-
const wrapperRef = useRef(null);
|
|
64
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
65
|
-
const closeButtonRef = useRef(null);
|
|
66
|
-
|
|
67
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
68
|
-
useDisableBodyScroll(isOpen && wrapperRef.current);
|
|
69
|
-
|
|
70
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
71
|
-
const isVisible = useTransitionVisibility(wrapperRef, !!isOpen, DIALOG_TRANSITION_DURATION);
|
|
72
|
-
|
|
73
|
-
// Handle focus trap.
|
|
74
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
75
|
-
useFocusTrap(
|
|
76
|
-
// Focus trap zone
|
|
77
|
-
isOpen && wrapperRef.current,
|
|
78
|
-
// Focus element (fallback on close button and then on the dialog)
|
|
79
|
-
focusElement?.current || closeButtonRef.current || wrapperRef.current);
|
|
80
|
-
|
|
81
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
82
|
-
const previousOpen = useRef(isOpen);
|
|
83
|
-
|
|
84
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
if (isOpen !== previousOpen.current) {
|
|
87
|
-
previousOpen.current = isOpen;
|
|
88
|
-
|
|
89
|
-
// Focus the parent element on close.
|
|
90
|
-
if (!isOpen && parentElement && parentElement.current) {
|
|
91
|
-
parentElement.current.focus();
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}, [isOpen, parentElement]);
|
|
95
|
-
|
|
96
|
-
// Close lightbox on escape key pressed.
|
|
97
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
98
|
-
useCallbackOnEscape(onClose);
|
|
99
|
-
|
|
100
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
101
|
-
const clickAwayRefs = useRef([wrapperRef]);
|
|
102
|
-
if (!isOpen && !isVisible) return null;
|
|
103
|
-
return /*#__PURE__*/jsx(Portal, {
|
|
104
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
105
|
-
ref: mergeRefs(ref, wrapperRef),
|
|
106
|
-
...forwardedProps,
|
|
107
|
-
"aria-label": ariaLabel,
|
|
108
|
-
"aria-labelledby": ariaLabelledBy,
|
|
109
|
-
"aria-modal": "true",
|
|
110
|
-
role: "dialog",
|
|
111
|
-
tabIndex: -1,
|
|
112
|
-
className: classNames(className, handleBasicClasses({
|
|
113
|
-
prefix: CLASSNAME,
|
|
114
|
-
isHidden: !isOpen,
|
|
115
|
-
isShown: isOpen || isVisible,
|
|
116
|
-
theme
|
|
117
|
-
})),
|
|
118
|
-
style: {
|
|
119
|
-
zIndex
|
|
120
|
-
},
|
|
121
|
-
children: [closeButtonProps && /*#__PURE__*/jsx("div", {
|
|
122
|
-
className: `${CLASSNAME}__close`,
|
|
123
|
-
children: /*#__PURE__*/jsx(IconButton, {
|
|
124
|
-
...closeButtonProps,
|
|
125
|
-
ref: closeButtonRef,
|
|
126
|
-
emphasis: "low",
|
|
127
|
-
hasBackground: true,
|
|
128
|
-
icon: mdiClose,
|
|
129
|
-
theme: "dark",
|
|
130
|
-
type: "button",
|
|
131
|
-
onClick: onClose
|
|
132
|
-
})
|
|
133
|
-
}), /*#__PURE__*/jsx(HeadingLevelProvider, {
|
|
134
|
-
level: 2,
|
|
135
|
-
children: /*#__PURE__*/jsx(ThemeProvider, {
|
|
136
|
-
value: undefined,
|
|
137
|
-
children: /*#__PURE__*/jsx(ClickAwayProvider, {
|
|
138
|
-
callback: !preventAutoClose && onClose,
|
|
139
|
-
childrenRefs: clickAwayRefs,
|
|
140
|
-
children: /*#__PURE__*/jsx("div", {
|
|
141
|
-
ref: childrenRef,
|
|
142
|
-
className: `${CLASSNAME}__wrapper`,
|
|
143
|
-
role: "presentation",
|
|
144
|
-
children: children
|
|
145
|
-
})
|
|
146
|
-
})
|
|
147
|
-
})
|
|
148
|
-
})]
|
|
149
|
-
})
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
Lightbox.displayName = COMPONENT_NAME;
|
|
153
|
-
Lightbox.className = CLASSNAME;
|
|
154
|
-
|
|
155
|
-
export { Lightbox };
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
import { getRootClassName, resolveColorWithVariants, handleBasicClasses, getTypographyClassName } from '@lumx/core/js/utils/className';
|
|
3
|
-
import { f as forwardRef } from '../../8bce732e.js';
|
|
4
|
-
import { w as wrapChildrenIconWithSpaces } from '../../7b293665.js';
|
|
5
|
-
import { R as RawClickable } from '../../2c2b6a89.js';
|
|
6
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
|
-
import { useDisableStateProps } from '../../utils/disabled/index-075b99c3.js';
|
|
8
|
-
import { I as Icon } from '../../bace1bf1.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Component display name.
|
|
12
|
-
*/
|
|
13
|
-
const COMPONENT_NAME = 'Link';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Component default class name and class prefix.
|
|
17
|
-
*/
|
|
18
|
-
const CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Link component.
|
|
22
|
-
*
|
|
23
|
-
* @param props Component props.
|
|
24
|
-
* @param ref Component ref.
|
|
25
|
-
* @return React element.
|
|
26
|
-
*/
|
|
27
|
-
const Link = forwardRef((props, ref) => {
|
|
28
|
-
const {
|
|
29
|
-
disabledStateProps,
|
|
30
|
-
otherProps
|
|
31
|
-
} = useDisableStateProps(props);
|
|
32
|
-
const {
|
|
33
|
-
children,
|
|
34
|
-
className,
|
|
35
|
-
color: propColor,
|
|
36
|
-
colorVariant: propColorVariant,
|
|
37
|
-
leftIcon,
|
|
38
|
-
rightIcon,
|
|
39
|
-
typography,
|
|
40
|
-
linkAs,
|
|
41
|
-
...forwardedProps
|
|
42
|
-
} = otherProps;
|
|
43
|
-
const [color, colorVariant] = resolveColorWithVariants(propColor, propColorVariant);
|
|
44
|
-
return /*#__PURE__*/jsx(RawClickable, {
|
|
45
|
-
ref: ref,
|
|
46
|
-
as: linkAs || (forwardedProps.href ? 'a' : 'button'),
|
|
47
|
-
...forwardedProps,
|
|
48
|
-
...disabledStateProps,
|
|
49
|
-
className: classNames(className, handleBasicClasses({
|
|
50
|
-
prefix: CLASSNAME,
|
|
51
|
-
color,
|
|
52
|
-
colorVariant,
|
|
53
|
-
hasTypography: !!typography
|
|
54
|
-
}), typography && getTypographyClassName(typography)),
|
|
55
|
-
children: wrapChildrenIconWithSpaces(/*#__PURE__*/jsxs(Fragment, {
|
|
56
|
-
children: [leftIcon && /*#__PURE__*/jsx(Icon, {
|
|
57
|
-
icon: leftIcon,
|
|
58
|
-
className: `${CLASSNAME}__left-icon`
|
|
59
|
-
}), children && /*#__PURE__*/jsx("span", {
|
|
60
|
-
className: `${CLASSNAME}__content`,
|
|
61
|
-
children: children
|
|
62
|
-
}), rightIcon && /*#__PURE__*/jsx(Icon, {
|
|
63
|
-
icon: rightIcon,
|
|
64
|
-
className: `${CLASSNAME}__right-icon`
|
|
65
|
-
})]
|
|
66
|
-
}))
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
Link.displayName = COMPONENT_NAME;
|
|
70
|
-
Link.className = CLASSNAME;
|
|
71
|
-
|
|
72
|
-
export { Link };
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
import { getRootClassName, handleBasicClasses } from '@lumx/core/js/utils/className';
|
|
3
|
-
import { u as useTheme } from '../../3181f000.js';
|
|
4
|
-
import { f as forwardRef } from '../../8bce732e.js';
|
|
5
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
-
import { Link } from '../link/index-008bae4b.js';
|
|
7
|
-
import { Size, Theme, AspectRatio, ColorPalette, ColorVariant } from '@lumx/core/js/constants';
|
|
8
|
-
import { T as Thumbnail } from '../../035c132d.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Component display name.
|
|
12
|
-
*/
|
|
13
|
-
const COMPONENT_NAME = 'LinkPreview';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Component default class name and class prefix.
|
|
17
|
-
*/
|
|
18
|
-
const CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Component default props.
|
|
22
|
-
*/
|
|
23
|
-
const DEFAULT_PROPS = {
|
|
24
|
-
size: Size.regular,
|
|
25
|
-
titleHeading: 'h2'
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* LinkPreview component.
|
|
30
|
-
*
|
|
31
|
-
* @param props Component props.
|
|
32
|
-
* @param ref Component ref.
|
|
33
|
-
* @return React element.
|
|
34
|
-
*/
|
|
35
|
-
const LinkPreview = forwardRef((props, ref) => {
|
|
36
|
-
const defaultTheme = useTheme() || Theme.light;
|
|
37
|
-
const {
|
|
38
|
-
className,
|
|
39
|
-
description,
|
|
40
|
-
link,
|
|
41
|
-
linkAs,
|
|
42
|
-
linkProps,
|
|
43
|
-
size = DEFAULT_PROPS.size,
|
|
44
|
-
theme = defaultTheme,
|
|
45
|
-
thumbnailProps,
|
|
46
|
-
title,
|
|
47
|
-
titleHeading = DEFAULT_PROPS.titleHeading,
|
|
48
|
-
...forwardedProps
|
|
49
|
-
} = props;
|
|
50
|
-
// Use title heading as title wrapper (see DEFAULT_PROPS for the default value).
|
|
51
|
-
const TitleHeading = titleHeading;
|
|
52
|
-
return /*#__PURE__*/jsx("article", {
|
|
53
|
-
ref: ref,
|
|
54
|
-
...forwardedProps,
|
|
55
|
-
className: classNames(className, handleBasicClasses({
|
|
56
|
-
prefix: CLASSNAME,
|
|
57
|
-
size: size === Size.big && thumbnailProps ? Size.big : Size.regular,
|
|
58
|
-
theme
|
|
59
|
-
})),
|
|
60
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
61
|
-
className: `${CLASSNAME}__wrapper`,
|
|
62
|
-
children: [thumbnailProps && /*#__PURE__*/jsx("div", {
|
|
63
|
-
className: `${CLASSNAME}__thumbnail`,
|
|
64
|
-
children: /*#__PURE__*/jsx(Thumbnail, {
|
|
65
|
-
...thumbnailProps,
|
|
66
|
-
linkAs: linkAs,
|
|
67
|
-
linkProps: {
|
|
68
|
-
...linkProps,
|
|
69
|
-
href: link,
|
|
70
|
-
target: '_blank',
|
|
71
|
-
// Avoid redundant links in focus order
|
|
72
|
-
tabIndex: -1
|
|
73
|
-
},
|
|
74
|
-
aspectRatio: AspectRatio.free,
|
|
75
|
-
fillHeight: true
|
|
76
|
-
})
|
|
77
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
78
|
-
className: `${CLASSNAME}__container`,
|
|
79
|
-
children: [title && /*#__PURE__*/jsx(TitleHeading, {
|
|
80
|
-
className: `${CLASSNAME}__title`,
|
|
81
|
-
children: /*#__PURE__*/jsx(Link, {
|
|
82
|
-
...linkProps,
|
|
83
|
-
linkAs: linkAs,
|
|
84
|
-
target: "_blank",
|
|
85
|
-
href: link,
|
|
86
|
-
color: theme === Theme.light ? ColorPalette.dark : ColorPalette.light,
|
|
87
|
-
colorVariant: ColorVariant.N,
|
|
88
|
-
children: title
|
|
89
|
-
})
|
|
90
|
-
}), description && /*#__PURE__*/jsx("p", {
|
|
91
|
-
className: `${CLASSNAME}__description`,
|
|
92
|
-
children: description
|
|
93
|
-
}), /*#__PURE__*/jsx("div", {
|
|
94
|
-
className: `${CLASSNAME}__link`,
|
|
95
|
-
children: /*#__PURE__*/jsx(Link, {
|
|
96
|
-
...linkProps,
|
|
97
|
-
linkAs: linkAs,
|
|
98
|
-
className: classNames(`${CLASSNAME}__link`, linkProps?.className),
|
|
99
|
-
target: "_blank",
|
|
100
|
-
href: link,
|
|
101
|
-
color: theme === Theme.light ? ColorPalette.primary : ColorPalette.light,
|
|
102
|
-
colorVariant: ColorVariant.N
|
|
103
|
-
// Avoid redundant links in focus order
|
|
104
|
-
,
|
|
105
|
-
tabIndex: title ? '-1' : undefined,
|
|
106
|
-
children: link
|
|
107
|
-
})
|
|
108
|
-
})]
|
|
109
|
-
})]
|
|
110
|
-
})
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
LinkPreview.displayName = COMPONENT_NAME;
|
|
114
|
-
LinkPreview.className = CLASSNAME;
|
|
115
|
-
LinkPreview.defaultProps = DEFAULT_PROPS;
|
|
116
|
-
|
|
117
|
-
export { LinkPreview };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
export { L as List, a as ListItem, i as isClickable } from '../../0ea95af1.js';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { getRootClassName } from '@lumx/core/js/utils/className';
|
|
4
|
-
import { f as forwardRef } from '../../8bce732e.js';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Component display name.
|
|
9
|
-
*/
|
|
10
|
-
const COMPONENT_NAME$1 = 'ListDivider';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Component default class name and class prefix.
|
|
14
|
-
*/
|
|
15
|
-
const CLASSNAME$1 = getRootClassName(COMPONENT_NAME$1);
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* ListDivider component.
|
|
19
|
-
*
|
|
20
|
-
* @param props Component props.
|
|
21
|
-
* @param ref Component ref.
|
|
22
|
-
* @return React element.
|
|
23
|
-
*/
|
|
24
|
-
const ListDivider = forwardRef((props, ref) => {
|
|
25
|
-
const {
|
|
26
|
-
className,
|
|
27
|
-
...forwardedProps
|
|
28
|
-
} = props;
|
|
29
|
-
return /*#__PURE__*/jsx("li", {
|
|
30
|
-
ref: ref,
|
|
31
|
-
...forwardedProps,
|
|
32
|
-
className: classNames(className, CLASSNAME$1)
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
ListDivider.displayName = COMPONENT_NAME$1;
|
|
36
|
-
ListDivider.className = CLASSNAME$1;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Component display name.
|
|
40
|
-
*/
|
|
41
|
-
const COMPONENT_NAME = 'ListSubheader';
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Component default class name and class prefix.
|
|
45
|
-
*/
|
|
46
|
-
const CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* ListSubheader component.
|
|
50
|
-
*
|
|
51
|
-
* @param props Component props.
|
|
52
|
-
* @param ref Component ref.
|
|
53
|
-
* @return React element.
|
|
54
|
-
*/
|
|
55
|
-
const ListSubheader = forwardRef((props, ref) => {
|
|
56
|
-
const {
|
|
57
|
-
children,
|
|
58
|
-
className,
|
|
59
|
-
...forwardedProps
|
|
60
|
-
} = props;
|
|
61
|
-
return /*#__PURE__*/jsx("li", {
|
|
62
|
-
ref: ref,
|
|
63
|
-
...forwardedProps,
|
|
64
|
-
className: classNames(className, CLASSNAME),
|
|
65
|
-
children: children
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
ListSubheader.displayName = COMPONENT_NAME;
|
|
69
|
-
ListSubheader.className = CLASSNAME;
|
|
70
|
-
|
|
71
|
-
export { ListDivider, ListSubheader };
|