@lumx/react 3.0.2-alpha-react-utils.2 → 3.0.2-alpha-react-utils.3
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/_internal/{6340c129.js → ClickAwayProvider.js} +107 -2
- package/_internal/ClickAwayProvider.js.map +1 -0
- package/_internal/{eca6d4dc.d.ts → types.d.ts} +1 -1
- package/index.d.ts +2627 -56
- package/index.js +12438 -56
- package/index.js.map +1 -1
- package/package.json +4 -4
- package/utils/index.d.ts +1 -1
- package/utils/index.js +1 -1
- package/_internal/0062d1bc.js +0 -220
- package/_internal/0062d1bc.js.map +0 -1
- package/_internal/03e8323d.d.ts +0 -118
- package/_internal/0402f9bc.d.ts +0 -183
- package/_internal/0b370acc.js +0 -796
- package/_internal/0b370acc.js.map +0 -1
- package/_internal/0d154d73.d.ts +0 -67
- package/_internal/113e3b40.d.ts +0 -31
- package/_internal/12ab39e4.js +0 -58
- package/_internal/12ab39e4.js.map +0 -1
- package/_internal/13e759f3.js +0 -343
- package/_internal/13e759f3.js.map +0 -1
- package/_internal/158b46d5.js +0 -151
- package/_internal/158b46d5.js.map +0 -1
- package/_internal/17b74e16.d.ts +0 -31
- package/_internal/1b1530a4.d.ts +0 -43
- package/_internal/20976405.js +0 -87
- package/_internal/20976405.js.map +0 -1
- package/_internal/20b0e9a5.d.ts +0 -77
- package/_internal/26cd9c63.js +0 -118
- package/_internal/26cd9c63.js.map +0 -1
- package/_internal/27f21164.js +0 -79
- package/_internal/27f21164.js.map +0 -1
- package/_internal/288dfd0f.js +0 -13
- package/_internal/288dfd0f.js.map +0 -1
- package/_internal/28aaf23a.d.ts +0 -41
- package/_internal/2c829c0b.d.ts +0 -57
- package/_internal/2cc0aec5.js +0 -86
- package/_internal/2cc0aec5.js.map +0 -1
- package/_internal/2d0a5b28.js +0 -23
- package/_internal/2d0a5b28.js.map +0 -1
- package/_internal/2d4b5a5e.d.ts +0 -92
- package/_internal/2d770113.d.ts +0 -38
- package/_internal/2fe97f00.js +0 -291
- package/_internal/2fe97f00.js.map +0 -1
- package/_internal/31c16fa0.d.ts +0 -37
- package/_internal/329a01d3.js +0 -25
- package/_internal/329a01d3.js.map +0 -1
- package/_internal/3326e990.js +0 -168
- package/_internal/3326e990.js.map +0 -1
- package/_internal/377b2f44.js +0 -70
- package/_internal/377b2f44.js.map +0 -1
- package/_internal/3b8d2a6e.js +0 -124
- package/_internal/3b8d2a6e.js.map +0 -1
- package/_internal/3bd3186e.d.ts +0 -57
- package/_internal/48e40868.js +0 -101
- package/_internal/48e40868.js.map +0 -1
- package/_internal/490ec1da.js +0 -322
- package/_internal/490ec1da.js.map +0 -1
- package/_internal/49127d69.d.ts +0 -52
- package/_internal/4dcd87cb.js +0 -78
- package/_internal/4dcd87cb.js.map +0 -1
- package/_internal/4f44d848.js +0 -157
- package/_internal/4f44d848.js.map +0 -1
- package/_internal/4fc64a2e.js +0 -27
- package/_internal/4fc64a2e.js.map +0 -1
- package/_internal/53a831be.js +0 -108
- package/_internal/53a831be.js.map +0 -1
- package/_internal/55271fa1.d.ts +0 -34
- package/_internal/55d30377.d.ts +0 -22
- package/_internal/56385b04.js +0 -116
- package/_internal/56385b04.js.map +0 -1
- package/_internal/599e250a.d.ts +0 -88
- package/_internal/5a054691.d.ts +0 -33
- package/_internal/5a127b58.js +0 -82
- package/_internal/5a127b58.js.map +0 -1
- package/_internal/5a1c0db4.js +0 -156
- package/_internal/5a1c0db4.js.map +0 -1
- package/_internal/5babcc39.js +0 -147
- package/_internal/5babcc39.js.map +0 -1
- package/_internal/5c1bf4d4.d.ts +0 -81
- package/_internal/5d8ed4ee.js +0 -113
- package/_internal/5d8ed4ee.js.map +0 -1
- package/_internal/616f2912.js +0 -301
- package/_internal/616f2912.js.map +0 -1
- package/_internal/61f915de.d.ts +0 -49
- package/_internal/620081fa.js +0 -122
- package/_internal/620081fa.js.map +0 -1
- package/_internal/6340c129.js.map +0 -1
- package/_internal/6581c863.d.ts +0 -34
- package/_internal/66de4d45.d.ts +0 -32
- package/_internal/6735c5c8.d.ts +0 -62
- package/_internal/69dd1472.js +0 -112
- package/_internal/69dd1472.js.map +0 -1
- package/_internal/6a0e1c77.js +0 -327
- package/_internal/6a0e1c77.js.map +0 -1
- package/_internal/701c20b0.d.ts +0 -24
- package/_internal/7391188a.js +0 -81
- package/_internal/7391188a.js.map +0 -1
- package/_internal/74cb6c26.js +0 -136
- package/_internal/74cb6c26.js.map +0 -1
- package/_internal/761031bf.js +0 -314
- package/_internal/761031bf.js.map +0 -1
- package/_internal/76fed69d.js +0 -50
- package/_internal/76fed69d.js.map +0 -1
- package/_internal/78ef8e34.js +0 -40
- package/_internal/78ef8e34.js.map +0 -1
- package/_internal/7b906e16.d.ts +0 -17
- package/_internal/7be11ddc.d.ts +0 -35
- package/_internal/7d39705e.d.ts +0 -20
- package/_internal/7e03266f.js +0 -47
- package/_internal/7e03266f.js.map +0 -1
- package/_internal/7e8d0ac5.js +0 -84
- package/_internal/7e8d0ac5.js.map +0 -1
- package/_internal/7ffa45f6.js +0 -48
- package/_internal/7ffa45f6.js.map +0 -1
- package/_internal/84c1ec44.js +0 -257
- package/_internal/84c1ec44.js.map +0 -1
- package/_internal/8518279f.js +0 -96
- package/_internal/8518279f.js.map +0 -1
- package/_internal/853713cd.js +0 -25
- package/_internal/853713cd.js.map +0 -1
- package/_internal/86566d75.d.ts +0 -27
- package/_internal/86d22dde.d.ts +0 -57
- package/_internal/8e755ded.d.ts +0 -101
- package/_internal/901471f5.d.ts +0 -37
- package/_internal/935ce959.d.ts +0 -49
- package/_internal/97089888.d.ts +0 -16
- package/_internal/97cc728c.d.ts +0 -26
- package/_internal/9ab3c637.js +0 -2474
- package/_internal/9ab3c637.js.map +0 -1
- package/_internal/9ca3f59c.js +0 -60
- package/_internal/9ca3f59c.js.map +0 -1
- package/_internal/9e95ea38.d.ts +0 -43
- package/_internal/a0108f92.js +0 -84
- package/_internal/a0108f92.js.map +0 -1
- package/_internal/a493a193.d.ts +0 -65
- package/_internal/a521723d.js +0 -120
- package/_internal/a521723d.js.map +0 -1
- package/_internal/a6fad025.d.ts +0 -107
- package/_internal/a8fa525f.js +0 -124
- package/_internal/a8fa525f.js.map +0 -1
- package/_internal/aca2ecf5.js +0 -141
- package/_internal/aca2ecf5.js.map +0 -1
- package/_internal/aef2ef1c.js +0 -53
- package/_internal/aef2ef1c.js.map +0 -1
- package/_internal/af048b0c.js +0 -89
- package/_internal/af048b0c.js.map +0 -1
- package/_internal/af2cd0cd.d.ts +0 -17
- package/_internal/afec6b62.js +0 -864
- package/_internal/afec6b62.js.map +0 -1
- package/_internal/b0eb3a30.js +0 -72
- package/_internal/b0eb3a30.js.map +0 -1
- package/_internal/b89517ea.js +0 -275
- package/_internal/b89517ea.js.map +0 -1
- package/_internal/bafa6fcc.js +0 -116
- package/_internal/bafa6fcc.js.map +0 -1
- package/_internal/bbbeb49e.js +0 -47
- package/_internal/bbbeb49e.js.map +0 -1
- package/_internal/c11f6162.d.ts +0 -52
- package/_internal/c723dab4.js +0 -133
- package/_internal/c723dab4.js.map +0 -1
- package/_internal/c87cc857.d.ts +0 -42
- package/_internal/c97f8d04.js +0 -424
- package/_internal/c97f8d04.js.map +0 -1
- package/_internal/cbb373ea.d.ts +0 -6
- package/_internal/cbef23b6.d.ts +0 -104
- package/_internal/cdf77f06.d.ts +0 -88
- package/_internal/d350f2ff.js +0 -105
- package/_internal/d350f2ff.js.map +0 -1
- package/_internal/d71a8cf7.js +0 -54
- package/_internal/d71a8cf7.js.map +0 -1
- package/_internal/d9337952.js +0 -96
- package/_internal/d9337952.js.map +0 -1
- package/_internal/def14e1a.d.ts +0 -24
- package/_internal/e0cd29c7.d.ts +0 -35
- package/_internal/e354228f.js +0 -145
- package/_internal/e354228f.js.map +0 -1
- package/_internal/e3922a05.d.ts +0 -22
- package/_internal/e3cb6177.d.ts +0 -75
- package/_internal/e810c841.d.ts +0 -182
- package/_internal/ea700b01.d.ts +0 -43
- package/_internal/eed07003.js +0 -122
- package/_internal/eed07003.js.map +0 -1
- package/_internal/f1c9b334.d.ts +0 -22
- package/_internal/f3c3a674.js +0 -281
- package/_internal/f3c3a674.js.map +0 -1
- package/_internal/f571cdcd.js +0 -132
- package/_internal/f571cdcd.js.map +0 -1
- package/_internal/f5bdff7e.js +0 -282
- package/_internal/f5bdff7e.js.map +0 -1
- package/_internal/f851fc00.d.ts +0 -34
- package/_internal/f859b007.d.ts +0 -49
- package/_internal/fb384b79.d.ts +0 -38
- package/_internal/fc4c034b.js +0 -63
- package/_internal/fc4c034b.js.map +0 -1
- package/_internal/fc608bd9.js +0 -16
- package/_internal/fc608bd9.js.map +0 -1
- package/_internal/fd1f4d68.d.ts +0 -36
- package/_internal/fd867c9d.js +0 -346
- package/_internal/fd867c9d.js.map +0 -1
- package/_internal/ff8081e5.js +0 -57
- package/_internal/ff8081e5.js.map +0 -1
- package/_internal/ffd1bfe3.js +0 -123
- package/_internal/ffd1bfe3.js.map +0 -1
- package/components/alert-dialog.d.ts +0 -6
- package/components/alert-dialog.js +0 -2
- package/components/alert-dialog.js.map +0 -1
- package/components/autocomplete.d.ts +0 -8
- package/components/autocomplete.js +0 -2
- package/components/autocomplete.js.map +0 -1
- package/components/avatar.d.ts +0 -4
- package/components/avatar.js +0 -2
- package/components/avatar.js.map +0 -1
- package/components/badge.d.ts +0 -3
- package/components/badge.js +0 -2
- package/components/badge.js.map +0 -1
- package/components/button.d.ts +0 -8
- package/components/button.js +0 -4
- package/components/button.js.map +0 -1
- package/components/checkbox.d.ts +0 -3
- package/components/checkbox.js +0 -2
- package/components/checkbox.js.map +0 -1
- package/components/chip.d.ts +0 -3
- package/components/chip.js +0 -3
- package/components/chip.js.map +0 -1
- package/components/comment-block.d.ts +0 -5
- package/components/comment-block.js +0 -2
- package/components/comment-block.js.map +0 -1
- package/components/date-picker.d.ts +0 -7
- package/components/date-picker.js +0 -2
- package/components/date-picker.js.map +0 -1
- package/components/dialog.d.ts +0 -3
- package/components/dialog.js +0 -2
- package/components/dialog.js.map +0 -1
- package/components/divider.d.ts +0 -3
- package/components/divider.js +0 -2
- package/components/divider.js.map +0 -1
- package/components/drag-handle.d.ts +0 -3
- package/components/drag-handle.js +0 -2
- package/components/drag-handle.js.map +0 -1
- package/components/dropdown.d.ts +0 -4
- package/components/dropdown.js +0 -2
- package/components/dropdown.js.map +0 -1
- package/components/expansion-panel.d.ts +0 -7
- package/components/expansion-panel.js +0 -2
- package/components/expansion-panel.js.map +0 -1
- package/components/flag.d.ts +0 -3
- package/components/flag.js +0 -2
- package/components/flag.js.map +0 -1
- package/components/flex-box.d.ts +0 -3
- package/components/flex-box.js +0 -2
- package/components/flex-box.js.map +0 -1
- package/components/generic-block.d.ts +0 -4
- package/components/generic-block.js +0 -2
- package/components/generic-block.js.map +0 -1
- package/components/grid.d.ts +0 -3
- package/components/grid.js +0 -2
- package/components/grid.js.map +0 -1
- package/components/heading.d.ts +0 -4
- package/components/heading.js +0 -2
- package/components/heading.js.map +0 -1
- package/components/icon.d.ts +0 -3
- package/components/icon.js +0 -2
- package/components/icon.js.map +0 -1
- package/components/image-block.d.ts +0 -4
- package/components/image-block.js +0 -2
- package/components/image-block.js.map +0 -1
- package/components/input-helper.d.ts +0 -3
- package/components/input-helper.js +0 -2
- package/components/input-helper.js.map +0 -1
- package/components/input-label.d.ts +0 -3
- package/components/input-label.js +0 -2
- package/components/input-label.js.map +0 -1
- package/components/lightbox.d.ts +0 -7
- package/components/lightbox.js +0 -2
- package/components/lightbox.js.map +0 -1
- package/components/link-preview.d.ts +0 -5
- package/components/link-preview.js +0 -2
- package/components/link-preview.js.map +0 -1
- package/components/link.d.ts +0 -3
- package/components/link.js +0 -2
- package/components/link.js.map +0 -1
- package/components/list.d.ts +0 -3
- package/components/list.js +0 -3
- package/components/list.js.map +0 -1
- package/components/message.d.ts +0 -3
- package/components/message.js +0 -2
- package/components/message.js.map +0 -1
- package/components/mosaic.d.ts +0 -4
- package/components/mosaic.js +0 -2
- package/components/mosaic.js.map +0 -1
- package/components/notification.d.ts +0 -3
- package/components/notification.js +0 -2
- package/components/notification.js.map +0 -1
- package/components/popover.d.ts +0 -3
- package/components/popover.js +0 -2
- package/components/popover.js.map +0 -1
- package/components/post-block.d.ts +0 -4
- package/components/post-block.js +0 -2
- package/components/post-block.js.map +0 -1
- package/components/progress-tracker.d.ts +0 -3
- package/components/progress-tracker.js +0 -2
- package/components/progress-tracker.js.map +0 -1
- package/components/progress.d.ts +0 -3
- package/components/progress.js +0 -2
- package/components/progress.js.map +0 -1
- package/components/radio-button.d.ts +0 -3
- package/components/radio-button.js +0 -2
- package/components/radio-button.js.map +0 -1
- package/components/select.d.ts +0 -7
- package/components/select.js +0 -2
- package/components/select.js.map +0 -1
- package/components/side-navigation.d.ts +0 -7
- package/components/side-navigation.js +0 -2
- package/components/side-navigation.js.map +0 -1
- package/components/skeleton.d.ts +0 -3
- package/components/skeleton.js +0 -2
- package/components/skeleton.js.map +0 -1
- package/components/slider.d.ts +0 -3
- package/components/slider.js +0 -2
- package/components/slider.js.map +0 -1
- package/components/slideshow.d.ts +0 -7
- package/components/slideshow.js +0 -2
- package/components/slideshow.js.map +0 -1
- package/components/switch.d.ts +0 -3
- package/components/switch.js +0 -2
- package/components/switch.js.map +0 -1
- package/components/table.d.ts +0 -3
- package/components/table.js +0 -2
- package/components/table.js.map +0 -1
- package/components/tabs.d.ts +0 -4
- package/components/tabs.js +0 -2
- package/components/tabs.js.map +0 -1
- package/components/text-field.d.ts +0 -7
- package/components/text-field.js +0 -2
- package/components/text-field.js.map +0 -1
- package/components/text.d.ts +0 -3
- package/components/text.js +0 -2
- package/components/text.js.map +0 -1
- package/components/thumbnail.d.ts +0 -4
- package/components/thumbnail.js +0 -3
- package/components/thumbnail.js.map +0 -1
- package/components/toolbar.d.ts +0 -3
- package/components/toolbar.js +0 -2
- package/components/toolbar.js.map +0 -1
- package/components/tooltip.d.ts +0 -4
- package/components/tooltip.js +0 -2
- package/components/tooltip.js.map +0 -1
- package/components/uploader.d.ts +0 -3
- package/components/uploader.js +0 -2
- package/components/uploader.js.map +0 -1
- package/components/user-block.d.ts +0 -5
- package/components/user-block.js +0 -2
- package/components/user-block.js.map +0 -1
- package/components.d.ts +0 -2
- package/components.js +0 -156
- package/components.js.map +0 -1
package/_internal/2fe97f00.js
DELETED
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
import { b as _objectWithoutProperties, c as _extends, a as _defineProperty } from './6340c129.js';
|
|
2
|
-
import { Theme, Size } from '../components.js';
|
|
3
|
-
import React, { forwardRef, useCallback } from 'react';
|
|
4
|
-
import { g as getRootClassName, c as classnames, h as handleBasicClasses, o as onEnterPressed } from './fd867c9d.js';
|
|
5
|
-
import { I as Icon, r as mdiArrowUp, s as mdiArrowDown } from './a521723d.js';
|
|
6
|
-
import isFunction from 'lodash/isFunction';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Defines the props of the component.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Component display name.
|
|
14
|
-
*/
|
|
15
|
-
var COMPONENT_NAME = 'Table';
|
|
16
|
-
/**
|
|
17
|
-
* Component default class name and class prefix.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
var CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
21
|
-
/**
|
|
22
|
-
* Component default props.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
var DEFAULT_PROPS = {
|
|
26
|
-
theme: Theme.light
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Table component.
|
|
30
|
-
*
|
|
31
|
-
* @param props Component props.
|
|
32
|
-
* @param ref Component ref.
|
|
33
|
-
* @return React element.
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
var Table = forwardRef(function (props, ref) {
|
|
37
|
-
var children = props.children,
|
|
38
|
-
className = props.className,
|
|
39
|
-
hasBefore = props.hasBefore,
|
|
40
|
-
hasDividers = props.hasDividers,
|
|
41
|
-
theme = props.theme,
|
|
42
|
-
forwardedProps = _objectWithoutProperties(props, ["children", "className", "hasBefore", "hasDividers", "theme"]);
|
|
43
|
-
|
|
44
|
-
return React.createElement("table", _extends({
|
|
45
|
-
ref: ref
|
|
46
|
-
}, forwardedProps, {
|
|
47
|
-
className: classnames(className, handleBasicClasses({
|
|
48
|
-
prefix: CLASSNAME,
|
|
49
|
-
hasBefore: hasBefore,
|
|
50
|
-
hasDividers: hasDividers,
|
|
51
|
-
theme: theme
|
|
52
|
-
}))
|
|
53
|
-
}), children);
|
|
54
|
-
});
|
|
55
|
-
Table.displayName = COMPONENT_NAME;
|
|
56
|
-
Table.className = CLASSNAME;
|
|
57
|
-
Table.defaultProps = DEFAULT_PROPS;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Defines the props of the component.
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Component display name.
|
|
65
|
-
*/
|
|
66
|
-
var COMPONENT_NAME$1 = 'TableBody';
|
|
67
|
-
/**
|
|
68
|
-
* Component default class name and class prefix.
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
|
-
var CLASSNAME$1 = getRootClassName(COMPONENT_NAME$1, true);
|
|
72
|
-
/**
|
|
73
|
-
* TableBody component.
|
|
74
|
-
*
|
|
75
|
-
* @param props Component props.
|
|
76
|
-
* @param ref Component ref.
|
|
77
|
-
* @return React element.
|
|
78
|
-
*/
|
|
79
|
-
|
|
80
|
-
var TableBody = forwardRef(function (props, ref) {
|
|
81
|
-
var children = props.children,
|
|
82
|
-
className = props.className,
|
|
83
|
-
forwardedProps = _objectWithoutProperties(props, ["children", "className"]);
|
|
84
|
-
|
|
85
|
-
return React.createElement("tbody", _extends({
|
|
86
|
-
ref: ref
|
|
87
|
-
}, forwardedProps, {
|
|
88
|
-
className: classnames(className, handleBasicClasses({
|
|
89
|
-
prefix: CLASSNAME$1
|
|
90
|
-
}))
|
|
91
|
-
}), children);
|
|
92
|
-
});
|
|
93
|
-
TableBody.displayName = COMPONENT_NAME$1;
|
|
94
|
-
TableBody.className = CLASSNAME$1;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Table head cell sort order.
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
|
-
var ThOrder = {
|
|
101
|
-
asc: 'asc',
|
|
102
|
-
desc: 'desc'
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Table cell variants.
|
|
107
|
-
*/
|
|
108
|
-
var TableCellVariant = {
|
|
109
|
-
body: 'body',
|
|
110
|
-
head: 'head'
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Component display name.
|
|
115
|
-
*/
|
|
116
|
-
var COMPONENT_NAME$2 = 'TableCell';
|
|
117
|
-
/**
|
|
118
|
-
* Component default class name and class prefix.
|
|
119
|
-
*/
|
|
120
|
-
|
|
121
|
-
var CLASSNAME$2 = getRootClassName(COMPONENT_NAME$2, true);
|
|
122
|
-
/**
|
|
123
|
-
* Component default props.
|
|
124
|
-
*/
|
|
125
|
-
|
|
126
|
-
var DEFAULT_PROPS$1 = {
|
|
127
|
-
variant: TableCellVariant.body
|
|
128
|
-
};
|
|
129
|
-
/**
|
|
130
|
-
* TableCell component.
|
|
131
|
-
*
|
|
132
|
-
* @param props Component props.
|
|
133
|
-
* @param ref Component ref.
|
|
134
|
-
* @return React element.
|
|
135
|
-
*/
|
|
136
|
-
|
|
137
|
-
var TableCell = forwardRef(function (props, ref) {
|
|
138
|
-
var children = props.children,
|
|
139
|
-
className = props.className,
|
|
140
|
-
icon = props.icon,
|
|
141
|
-
isSortable = props.isSortable,
|
|
142
|
-
onHeaderClick = props.onHeaderClick,
|
|
143
|
-
sortOrder = props.sortOrder,
|
|
144
|
-
variant = props.variant,
|
|
145
|
-
forwardedProps = _objectWithoutProperties(props, ["children", "className", "icon", "isSortable", "onHeaderClick", "sortOrder", "variant"]);
|
|
146
|
-
/**
|
|
147
|
-
* Handle click on the ordered thead.
|
|
148
|
-
*/
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
var handleOnHeaderClick = useCallback(function () {
|
|
152
|
-
if (isFunction(onHeaderClick)) {
|
|
153
|
-
onHeaderClick();
|
|
154
|
-
}
|
|
155
|
-
}, [onHeaderClick]);
|
|
156
|
-
return React.createElement(React.Fragment, null, variant === TableCellVariant.head && React.createElement("th", _extends({
|
|
157
|
-
ref: ref
|
|
158
|
-
}, forwardedProps, {
|
|
159
|
-
className: classnames(handleBasicClasses({
|
|
160
|
-
prefix: CLASSNAME$2,
|
|
161
|
-
isSortable: isSortable
|
|
162
|
-
}), className, "".concat(CLASSNAME$2, "--head"), _defineProperty({}, "".concat(CLASSNAME$2, "--is-sorted"), isSortable && sortOrder)),
|
|
163
|
-
tabIndex: isSortable && isFunction(onHeaderClick) ? 0 : -1,
|
|
164
|
-
onClick: handleOnHeaderClick,
|
|
165
|
-
onKeyDown: onEnterPressed(handleOnHeaderClick)
|
|
166
|
-
}), React.createElement("div", {
|
|
167
|
-
className: "".concat(CLASSNAME$2, "-wrapper")
|
|
168
|
-
}, icon && !isSortable && React.createElement(Icon, {
|
|
169
|
-
className: "".concat(CLASSNAME$2, "-icon"),
|
|
170
|
-
icon: icon,
|
|
171
|
-
size: Size.xxs
|
|
172
|
-
}), isSortable && sortOrder === ThOrder.asc && React.createElement(Icon, {
|
|
173
|
-
className: "".concat(CLASSNAME$2, "-icon"),
|
|
174
|
-
icon: mdiArrowUp,
|
|
175
|
-
size: Size.xxs
|
|
176
|
-
}), isSortable && sortOrder === ThOrder.desc && React.createElement(Icon, {
|
|
177
|
-
className: "".concat(CLASSNAME$2, "-icon"),
|
|
178
|
-
icon: mdiArrowDown,
|
|
179
|
-
size: Size.xxs
|
|
180
|
-
}), React.createElement("div", {
|
|
181
|
-
className: "".concat(CLASSNAME$2, "-content")
|
|
182
|
-
}, children))), variant === TableCellVariant.body && React.createElement("td", _extends({}, forwardedProps, {
|
|
183
|
-
className: classnames(className, handleBasicClasses({
|
|
184
|
-
prefix: CLASSNAME$2
|
|
185
|
-
}), "".concat(CLASSNAME$2, "--body"))
|
|
186
|
-
}), React.createElement("div", {
|
|
187
|
-
className: "".concat(CLASSNAME$2, "-content")
|
|
188
|
-
}, children)));
|
|
189
|
-
});
|
|
190
|
-
TableCell.displayName = COMPONENT_NAME$2;
|
|
191
|
-
TableCell.className = CLASSNAME$2;
|
|
192
|
-
TableCell.defaultProps = DEFAULT_PROPS$1;
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Defines the props of the component.
|
|
196
|
-
*/
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* Component display name.
|
|
200
|
-
*/
|
|
201
|
-
var COMPONENT_NAME$3 = 'TableHeader';
|
|
202
|
-
/**
|
|
203
|
-
* Component default class name and class prefix.
|
|
204
|
-
*/
|
|
205
|
-
|
|
206
|
-
var CLASSNAME$3 = getRootClassName(COMPONENT_NAME$3, true);
|
|
207
|
-
/**
|
|
208
|
-
* Component default props.
|
|
209
|
-
*/
|
|
210
|
-
|
|
211
|
-
var DEFAULT_PROPS$2 = {};
|
|
212
|
-
/**
|
|
213
|
-
* TableHeader component.
|
|
214
|
-
*
|
|
215
|
-
* @param props Component props.
|
|
216
|
-
* @param ref Component ref.
|
|
217
|
-
* @return React element.
|
|
218
|
-
*/
|
|
219
|
-
|
|
220
|
-
var TableHeader = forwardRef(function (props, ref) {
|
|
221
|
-
var children = props.children,
|
|
222
|
-
className = props.className,
|
|
223
|
-
forwardedProps = _objectWithoutProperties(props, ["children", "className"]);
|
|
224
|
-
|
|
225
|
-
return React.createElement("thead", _extends({
|
|
226
|
-
ref: ref
|
|
227
|
-
}, forwardedProps, {
|
|
228
|
-
className: classnames(className, handleBasicClasses({
|
|
229
|
-
prefix: CLASSNAME$3
|
|
230
|
-
}))
|
|
231
|
-
}), children);
|
|
232
|
-
});
|
|
233
|
-
TableHeader.displayName = COMPONENT_NAME$3;
|
|
234
|
-
TableHeader.className = CLASSNAME$3;
|
|
235
|
-
TableHeader.defaultProps = DEFAULT_PROPS$2;
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Defines the props of the component.
|
|
239
|
-
*/
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Component display name.
|
|
243
|
-
*/
|
|
244
|
-
var COMPONENT_NAME$4 = 'TableRow';
|
|
245
|
-
/**
|
|
246
|
-
* Component default class name and class prefix.
|
|
247
|
-
*/
|
|
248
|
-
|
|
249
|
-
var CLASSNAME$4 = getRootClassName(COMPONENT_NAME$4, true);
|
|
250
|
-
/**
|
|
251
|
-
* Component default props.
|
|
252
|
-
*/
|
|
253
|
-
|
|
254
|
-
var DEFAULT_PROPS$3 = {};
|
|
255
|
-
/**
|
|
256
|
-
* TableRow component.
|
|
257
|
-
*
|
|
258
|
-
* @param props Component props.
|
|
259
|
-
* @param ref Component ref.
|
|
260
|
-
* @return React element.
|
|
261
|
-
*/
|
|
262
|
-
|
|
263
|
-
var TableRow = forwardRef(function (props, ref) {
|
|
264
|
-
var children = props.children,
|
|
265
|
-
className = props.className,
|
|
266
|
-
disabled = props.disabled,
|
|
267
|
-
isClickable = props.isClickable,
|
|
268
|
-
_props$isDisabled = props.isDisabled,
|
|
269
|
-
isDisabled = _props$isDisabled === void 0 ? disabled : _props$isDisabled,
|
|
270
|
-
isSelected = props.isSelected,
|
|
271
|
-
forwardedProps = _objectWithoutProperties(props, ["children", "className", "disabled", "isClickable", "isDisabled", "isSelected"]);
|
|
272
|
-
|
|
273
|
-
return React.createElement("tr", _extends({
|
|
274
|
-
ref: ref,
|
|
275
|
-
tabIndex: isClickable && !isDisabled ? 0 : -1
|
|
276
|
-
}, forwardedProps, {
|
|
277
|
-
className: classnames(className, handleBasicClasses({
|
|
278
|
-
isClickable: isClickable && !isDisabled,
|
|
279
|
-
isDisabled: isDisabled,
|
|
280
|
-
isSelected: isSelected && !isDisabled,
|
|
281
|
-
prefix: CLASSNAME$4
|
|
282
|
-
})),
|
|
283
|
-
"aria-disabled": isDisabled
|
|
284
|
-
}), children);
|
|
285
|
-
});
|
|
286
|
-
TableRow.displayName = COMPONENT_NAME$4;
|
|
287
|
-
TableRow.className = CLASSNAME$4;
|
|
288
|
-
TableRow.defaultProps = DEFAULT_PROPS$3;
|
|
289
|
-
|
|
290
|
-
export { Table as T, TableBody as a, ThOrder as b, TableCellVariant as c, TableCell as d, TableHeader as e, TableRow as f };
|
|
291
|
-
//# sourceMappingURL=2fe97f00.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"2fe97f00.js","sources":["../../src/components/table/Table.tsx","../../src/components/table/TableBody.tsx","../../src/components/table/TableCell.tsx","../../src/components/table/TableHeader.tsx","../../src/components/table/TableRow.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { Theme } from '@lumx/react';\n\nimport { Comp, GenericProps, HasTheme } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';\n\n/**\n * Defines the props of the component.\n */\nexport interface TableProps extends GenericProps, HasTheme {\n /** Whether the table has checkbox or thumbnail on first cell or not. */\n hasBefore?: boolean;\n /** Whether the table has dividers or not. */\n hasDividers?: boolean;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'Table';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<TableProps> = {\n theme: Theme.light,\n};\n\n/**\n * Table component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const Table: Comp<TableProps, HTMLTableElement> = forwardRef((props, ref) => {\n const { children, className, hasBefore, hasDividers, theme, ...forwardedProps } = props;\n\n return (\n <table\n ref={ref}\n {...forwardedProps}\n className={classNames(className, handleBasicClasses({ prefix: CLASSNAME, hasBefore, hasDividers, theme }))}\n >\n {children}\n </table>\n );\n});\nTable.displayName = COMPONENT_NAME;\nTable.className = CLASSNAME;\nTable.defaultProps = DEFAULT_PROPS;\n","import React, { forwardRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { Comp, GenericProps } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';\n\n/**\n * Defines the props of the component.\n */\nexport type TableBodyProps = GenericProps;\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'TableBody';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME, true);\n\n/**\n * TableBody component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const TableBody: Comp<TableBodyProps, HTMLTableSectionElement> = forwardRef((props, ref) => {\n const { children, className, ...forwardedProps } = props;\n\n return (\n <tbody\n ref={ref}\n {...forwardedProps}\n className={classNames(className, handleBasicClasses({ prefix: CLASSNAME }))}\n >\n {children}\n </tbody>\n );\n});\nTableBody.displayName = COMPONENT_NAME;\nTableBody.className = CLASSNAME;\n","import React, { forwardRef, useCallback } from 'react';\n\nimport classNames from 'classnames';\n\nimport { Icon, Size } from '@lumx/react';\nimport { Comp, GenericProps, ValueOf } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';\nimport { onEnterPressed } from '@lumx/react/utils/event';\n\nimport { mdiArrowDown, mdiArrowUp } from '@lumx/icons';\n\nimport isFunction from 'lodash/isFunction';\n\n/**\n * Table head cell sort order.\n */\nexport const ThOrder = { asc: 'asc', desc: 'desc' } as const;\nexport type ThOrder = ValueOf<typeof ThOrder>;\n\n/**\n * Table cell variants.\n */\nexport const TableCellVariant = { body: 'body', head: 'head' } as const;\nexport type TableCellVariant = ValueOf<typeof TableCellVariant>;\n\n/**\n * Defines the props of the component.\n */\nexport interface TableCellProps extends GenericProps {\n /** Icon (SVG path).(thead only). */\n icon?: string;\n /** Whether the column is sortable or not (thead only). */\n isSortable?: boolean;\n /** Sort order displayed as icon (sortable thead only). */\n sortOrder?: ThOrder;\n /** Variant. */\n variant?: TableCellVariant;\n /** On header cell click callback. */\n onHeaderClick?(): void;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'TableCell';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME, true);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<TableCellProps> = {\n variant: TableCellVariant.body,\n};\n\n/**\n * TableCell component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const TableCell: Comp<TableCellProps, HTMLTableCellElement> = forwardRef((props, ref) => {\n const { children, className, icon, isSortable, onHeaderClick, sortOrder, variant, ...forwardedProps } = props;\n\n /**\n * Handle click on the ordered thead.\n */\n const handleOnHeaderClick = useCallback(() => {\n if (isFunction(onHeaderClick)) {\n onHeaderClick();\n }\n }, [onHeaderClick]);\n\n return (\n <>\n {variant === TableCellVariant.head && (\n <th\n ref={ref}\n {...forwardedProps}\n className={classNames(\n handleBasicClasses({ prefix: CLASSNAME, isSortable }),\n className,\n `${CLASSNAME}--head`,\n {\n [`${CLASSNAME}--is-sorted`]: isSortable && sortOrder,\n },\n )}\n tabIndex={isSortable && isFunction(onHeaderClick) ? 0 : -1}\n onClick={handleOnHeaderClick}\n onKeyDown={onEnterPressed(handleOnHeaderClick)}\n >\n <div className={`${CLASSNAME}-wrapper`}>\n {icon && !isSortable && <Icon className={`${CLASSNAME}-icon`} icon={icon} size={Size.xxs} />}\n\n {isSortable && sortOrder === ThOrder.asc && (\n <Icon className={`${CLASSNAME}-icon`} icon={mdiArrowUp} size={Size.xxs} />\n )}\n\n {isSortable && sortOrder === ThOrder.desc && (\n <Icon className={`${CLASSNAME}-icon`} icon={mdiArrowDown} size={Size.xxs} />\n )}\n\n <div className={`${CLASSNAME}-content`}>{children}</div>\n </div>\n </th>\n )}\n\n {variant === TableCellVariant.body && (\n <td\n {...forwardedProps}\n className={classNames(className, handleBasicClasses({ prefix: CLASSNAME }), `${CLASSNAME}--body`)}\n >\n <div className={`${CLASSNAME}-content`}>{children}</div>\n </td>\n )}\n </>\n );\n});\nTableCell.displayName = COMPONENT_NAME;\nTableCell.className = CLASSNAME;\nTableCell.defaultProps = DEFAULT_PROPS;\n","import React, { forwardRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { Comp, GenericProps } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';\n\n/**\n * Defines the props of the component.\n */\nexport type TableHeaderProps = GenericProps;\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'TableHeader';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME, true);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<TableHeaderProps> = {};\n\n/**\n * TableHeader component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const TableHeader: Comp<TableHeaderProps, HTMLTableSectionElement> = forwardRef((props, ref) => {\n const { children, className, ...forwardedProps } = props;\n\n return (\n <thead\n ref={ref}\n {...forwardedProps}\n className={classNames(className, handleBasicClasses({ prefix: CLASSNAME }))}\n >\n {children}\n </thead>\n );\n});\nTableHeader.displayName = COMPONENT_NAME;\nTableHeader.className = CLASSNAME;\nTableHeader.defaultProps = DEFAULT_PROPS;\n","import React, { forwardRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { Comp, GenericProps } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';\n\n/**\n * Defines the props of the component.\n */\nexport interface TableRowProps extends GenericProps {\n /** Whether the component is clickable or not. */\n isClickable?: boolean;\n /** Whether the component is disabled or not. */\n isDisabled?: boolean;\n /** Whether the component is selected or not. */\n isSelected?: boolean;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'TableRow';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME, true);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<TableRowProps> = {};\n\n/**\n * TableRow component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const TableRow: Comp<TableRowProps, HTMLTableRowElement> = forwardRef((props, ref) => {\n const { children, className, disabled, isClickable, isDisabled = disabled, isSelected, ...forwardedProps } = props;\n\n return (\n <tr\n ref={ref}\n tabIndex={isClickable && !isDisabled ? 0 : -1}\n {...forwardedProps}\n className={classNames(\n className,\n handleBasicClasses({\n isClickable: isClickable && !isDisabled,\n isDisabled,\n isSelected: isSelected && !isDisabled,\n prefix: CLASSNAME,\n }),\n )}\n aria-disabled={isDisabled}\n >\n {children}\n </tr>\n );\n});\n\nTableRow.displayName = COMPONENT_NAME;\nTableRow.className = CLASSNAME;\nTableRow.defaultProps = DEFAULT_PROPS;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","theme","Theme","light","Table","forwardRef","props","ref","children","className","hasBefore","hasDividers","forwardedProps","classNames","handleBasicClasses","prefix","displayName","defaultProps","TableBody","ThOrder","asc","desc","TableCellVariant","body","head","variant","TableCell","icon","isSortable","onHeaderClick","sortOrder","handleOnHeaderClick","useCallback","isFunction","onEnterPressed","Size","xxs","mdiArrowUp","mdiArrowDown","TableHeader","TableRow","disabled","isClickable","isDisabled","isSelected"],"mappings":";;;;;;;AASA;;;;AAUA;;;AAGA,IAAMA,cAAc,GAAG,OAAvB;AAEA;;;;AAGA,IAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAD,CAAlC;AAEA;;;;AAGA,IAAMG,aAAkC,GAAG;AACvCC,EAAAA,KAAK,EAAEC,KAAK,CAACC;AAD0B,CAA3C;AAIA;;;;;;;;IAOaC,KAAyC,GAAGC,UAAU,CAAC,UAACC,KAAD,EAAQC,GAAR,EAAgB;AAAA,MACxEC,QADwE,GACEF,KADF,CACxEE,QADwE;AAAA,MAC9DC,SAD8D,GACEH,KADF,CAC9DG,SAD8D;AAAA,MACnDC,SADmD,GACEJ,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F;AAAA,MACvEC,SADuE,GACoBH,KADpB,CACvEG,SADuE;AAAA,MAC5DgC,QAD4D,GACoBnC,KADpB,CAC5DmC,QAD4D;AAAA,MAClDC,WADkD,GACoBpC,KADpB,CAClDoC,WADkD;AAAA,0BACoBpC,KADpB,CACrCqC,UADqC;AAAA,MACrCA,UADqC,kCACxBF,QADwB;AAAA,MACdG,UADc,GACoBtC,KADpB,CACdsC,UADc;AAAA,MACChC,cADD,4BACoBN,KADpB;;AAGzF,SACI;AACI,IAAA,GAAG,EAAEC,GADT;AAEI,IAAA,QAAQ,EAAEmC,WAAW,IAAI,CAACC,UAAhB,GAA6B,CAA7B,GAAiC,CAAC;AAFhD,KAGQ/B,cAHR;AAII,IAAA,SAAS,EAAEC,UAAU,CACjBJ,SADiB,EAEjBK,kBAAkB,CAAC;AACf4B,MAAAA,WAAW,EAAEA,WAAW,IAAI,CAACC,UADd;AAEfA,MAAAA,UAAU,EAAVA,UAFe;AAGfC,MAAAA,UAAU,EAAEA,UAAU,IAAI,CAACD,UAHZ;AAIf5B,MAAAA,MAAM,EAAEjB;AAJO,KAAD,CAFD,CAJzB;AAaI,qBAAe6C;AAbnB,MAeKnC,QAfL,CADJ;AAmBH,CAtB2E;AAwB5EgC,QAAQ,CAACxB,WAAT,GAAuBnB,gBAAvB;AACA2C,QAAQ,CAAC/B,SAAT,GAAqBX,WAArB;AACA0C,QAAQ,CAACvB,YAAT,GAAwBjB,eAAxB;;;;"}
|
package/_internal/31c16fa0.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { l as GenericProps, a as Color, b as ColorVariant, f as Typography, k as Comp } from './eca6d4dc.js';
|
|
3
|
-
|
|
4
|
-
declare type HTMLAnchorProps = React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
|
|
5
|
-
/**
|
|
6
|
-
* Defines the props of the component.
|
|
7
|
-
*/
|
|
8
|
-
interface LinkProps extends GenericProps {
|
|
9
|
-
/** Color variant. */
|
|
10
|
-
color?: Color;
|
|
11
|
-
/** Lightened or darkened variant of the selected icon color. */
|
|
12
|
-
colorVariant?: ColorVariant;
|
|
13
|
-
/** Link href. */
|
|
14
|
-
href?: HTMLAnchorProps['href'];
|
|
15
|
-
/** Whether the component is disabled or not. */
|
|
16
|
-
isDisabled?: boolean;
|
|
17
|
-
/** Left icon (SVG path). */
|
|
18
|
-
leftIcon?: string;
|
|
19
|
-
/** Custom react component for the link (can be used to inject react router Link). */
|
|
20
|
-
linkAs?: 'a' | any;
|
|
21
|
-
/** Right icon (SVG path). */
|
|
22
|
-
rightIcon?: string;
|
|
23
|
-
/** Link target. */
|
|
24
|
-
target?: HTMLAnchorProps['target'];
|
|
25
|
-
/** Typography variant. */
|
|
26
|
-
typography?: Typography;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Link component.
|
|
30
|
-
*
|
|
31
|
-
* @param props Component props.
|
|
32
|
-
* @param ref Component ref.
|
|
33
|
-
* @return React element.
|
|
34
|
-
*/
|
|
35
|
-
declare const Link: Comp<LinkProps, HTMLAnchorElement | HTMLButtonElement>;
|
|
36
|
-
|
|
37
|
-
export { LinkProps as L, Link as a };
|
package/_internal/329a01d3.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { b as _objectWithoutProperties } from './6340c129.js';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Render link with default <a> HTML component or a custom one provided by `linkAs`.
|
|
6
|
-
*
|
|
7
|
-
* Can be used to inject the `Link` component from `react-router` and provide better a11y on LumX components.
|
|
8
|
-
*
|
|
9
|
-
* @param linkAs Custom link component.
|
|
10
|
-
* @param children Link children.
|
|
11
|
-
* @return A link.
|
|
12
|
-
*/
|
|
13
|
-
var renderLink = function renderLink(_ref) {
|
|
14
|
-
var linkAs = _ref.linkAs,
|
|
15
|
-
forwardedProps = _objectWithoutProperties(_ref, ["linkAs"]);
|
|
16
|
-
|
|
17
|
-
for (var _len = arguments.length, children = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
18
|
-
children[_key - 1] = arguments[_key];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return React.createElement.apply(React, [linkAs || 'a', forwardedProps].concat(children));
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export { renderLink as r };
|
|
25
|
-
//# sourceMappingURL=329a01d3.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"329a01d3.js","sources":["../../src/utils/renderLink.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react';\n\ninterface Props {\n linkAs: any;\n}\n\n/**\n * Render link with default <a> HTML component or a custom one provided by `linkAs`.\n *\n * Can be used to inject the `Link` component from `react-router` and provide better a11y on LumX components.\n *\n * @param linkAs Custom link component.\n * @param children Link children.\n * @return A link.\n */\nexport const renderLink = <P extends Props>({ linkAs, ...forwardedProps }: P, ...children: ReactNode[]): ReactElement =>\n React.createElement(linkAs || 'a', forwardedProps, ...children);\n"],"names":["renderLink","linkAs","forwardedProps","children","React","createElement"],"mappings":";;;AAMA;;;;;;;;;IASaA,UAAU,GAAG,SAAbA,UAAa;AAAA,MAAoBC,MAApB,QAAoBA,MAApB;AAAA,MAA+BC,cAA/B;;AAAA,oCAAuDC,QAAvD;AAAuDA,IAAAA,QAAvD;AAAA;;AAAA,SACtBC,KAAK,CAACC,aAAN,OAAAD,KAAK,GAAeH,MAAM,IAAI,GAAzB,EAA8BC,cAA9B,SAAiDC,QAAjD,EADiB;AAAA;;;;"}
|
package/_internal/3326e990.js
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { b as _objectWithoutProperties, c as _extends, _ as _objectSpread2 } from './6340c129.js';
|
|
2
|
-
import { Theme } from '../components.js';
|
|
3
|
-
import React, { forwardRef } from 'react';
|
|
4
|
-
import { g as getRootClassName, c as classnames, h as handleBasicClasses } from './fd867c9d.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Defines the props of the component.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var DEFAULT_PROPS = {
|
|
11
|
-
theme: Theme.light
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Component display name.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
var COMPONENT_NAME = 'SkeletonCircle';
|
|
18
|
-
/**
|
|
19
|
-
* Component default class name and class prefix.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
var CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
23
|
-
/**
|
|
24
|
-
* SkeletonCircle component.
|
|
25
|
-
*
|
|
26
|
-
* @param props Component props.
|
|
27
|
-
* @param ref Component ref.
|
|
28
|
-
* @return React element.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
var SkeletonCircle = forwardRef(function (props, ref) {
|
|
32
|
-
var className = props.className,
|
|
33
|
-
size = props.size,
|
|
34
|
-
color = props.color,
|
|
35
|
-
theme = props.theme,
|
|
36
|
-
forwardedProps = _objectWithoutProperties(props, ["className", "size", "color", "theme"]);
|
|
37
|
-
|
|
38
|
-
return React.createElement("div", _extends({
|
|
39
|
-
ref: ref
|
|
40
|
-
}, forwardedProps, {
|
|
41
|
-
className: classnames(className, handleBasicClasses({
|
|
42
|
-
prefix: CLASSNAME,
|
|
43
|
-
size: size,
|
|
44
|
-
color: color,
|
|
45
|
-
theme: theme
|
|
46
|
-
}))
|
|
47
|
-
}));
|
|
48
|
-
});
|
|
49
|
-
SkeletonCircle.displayName = COMPONENT_NAME;
|
|
50
|
-
SkeletonCircle.defaultProps = DEFAULT_PROPS;
|
|
51
|
-
SkeletonCircle.className = CLASSNAME;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Skeleton variants.
|
|
55
|
-
*/
|
|
56
|
-
|
|
57
|
-
var SkeletonRectangleVariant = {
|
|
58
|
-
squared: 'squared',
|
|
59
|
-
rounded: 'rounded',
|
|
60
|
-
pill: 'pill'
|
|
61
|
-
};
|
|
62
|
-
var DEFAULT_PROPS$1 = {
|
|
63
|
-
theme: Theme.light,
|
|
64
|
-
variant: SkeletonRectangleVariant.squared
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Component display name.
|
|
68
|
-
*/
|
|
69
|
-
|
|
70
|
-
var COMPONENT_NAME$1 = 'SkeletonRectangle';
|
|
71
|
-
/**
|
|
72
|
-
* Component default class name and class prefix.
|
|
73
|
-
*/
|
|
74
|
-
|
|
75
|
-
var CLASSNAME$1 = getRootClassName(COMPONENT_NAME$1);
|
|
76
|
-
/**
|
|
77
|
-
* SkeletonRectangle component.
|
|
78
|
-
*
|
|
79
|
-
* @param props Component props.
|
|
80
|
-
* @param ref Component ref.
|
|
81
|
-
* @return React element.
|
|
82
|
-
*/
|
|
83
|
-
|
|
84
|
-
var SkeletonRectangle = forwardRef(function (props, ref) {
|
|
85
|
-
var aspectRatio = props.aspectRatio,
|
|
86
|
-
className = props.className,
|
|
87
|
-
height = props.height,
|
|
88
|
-
theme = props.theme,
|
|
89
|
-
variant = props.variant,
|
|
90
|
-
width = props.width,
|
|
91
|
-
color = props.color,
|
|
92
|
-
forwardedProps = _objectWithoutProperties(props, ["aspectRatio", "className", "height", "theme", "variant", "width", "color"]);
|
|
93
|
-
|
|
94
|
-
return React.createElement("div", _extends({
|
|
95
|
-
ref: ref
|
|
96
|
-
}, forwardedProps, {
|
|
97
|
-
className: classnames(className, handleBasicClasses({
|
|
98
|
-
prefix: CLASSNAME$1,
|
|
99
|
-
aspectRatio: aspectRatio,
|
|
100
|
-
height: aspectRatio ? undefined : height,
|
|
101
|
-
theme: theme,
|
|
102
|
-
variant: variant,
|
|
103
|
-
width: width,
|
|
104
|
-
color: color
|
|
105
|
-
}))
|
|
106
|
-
}), React.createElement("div", {
|
|
107
|
-
className: "".concat(CLASSNAME$1, "__inner")
|
|
108
|
-
}));
|
|
109
|
-
});
|
|
110
|
-
SkeletonRectangle.displayName = COMPONENT_NAME$1;
|
|
111
|
-
SkeletonRectangle.className = CLASSNAME$1;
|
|
112
|
-
SkeletonRectangle.defaultProps = DEFAULT_PROPS$1;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Defines the props of the component.
|
|
116
|
-
*/
|
|
117
|
-
|
|
118
|
-
var DEFAULT_PROPS$2 = {
|
|
119
|
-
theme: Theme.light
|
|
120
|
-
};
|
|
121
|
-
/**
|
|
122
|
-
* Component display name.
|
|
123
|
-
*/
|
|
124
|
-
|
|
125
|
-
var COMPONENT_NAME$2 = 'SkeletonTypography';
|
|
126
|
-
/**
|
|
127
|
-
* Component default class name and class prefix.
|
|
128
|
-
*/
|
|
129
|
-
|
|
130
|
-
var CLASSNAME$2 = getRootClassName(COMPONENT_NAME$2);
|
|
131
|
-
/**
|
|
132
|
-
* SkeletonTypography component.
|
|
133
|
-
*
|
|
134
|
-
* @param props Component props.
|
|
135
|
-
* @param ref Component ref.
|
|
136
|
-
* @return React element.
|
|
137
|
-
*/
|
|
138
|
-
|
|
139
|
-
var SkeletonTypography = forwardRef(function (props, ref) {
|
|
140
|
-
var className = props.className,
|
|
141
|
-
theme = props.theme,
|
|
142
|
-
typography = props.typography,
|
|
143
|
-
width = props.width,
|
|
144
|
-
color = props.color,
|
|
145
|
-
forwardedProps = _objectWithoutProperties(props, ["className", "theme", "typography", "width", "color"]);
|
|
146
|
-
|
|
147
|
-
return React.createElement("div", _extends({
|
|
148
|
-
ref: ref
|
|
149
|
-
}, forwardedProps, {
|
|
150
|
-
className: classnames(className, handleBasicClasses({
|
|
151
|
-
prefix: CLASSNAME$2,
|
|
152
|
-
theme: theme,
|
|
153
|
-
typography: typography,
|
|
154
|
-
color: color
|
|
155
|
-
})),
|
|
156
|
-
style: _objectSpread2({}, forwardedProps.style, {
|
|
157
|
-
width: width
|
|
158
|
-
})
|
|
159
|
-
}), React.createElement("div", {
|
|
160
|
-
className: "".concat(CLASSNAME$2, "__inner")
|
|
161
|
-
}));
|
|
162
|
-
});
|
|
163
|
-
SkeletonTypography.displayName = COMPONENT_NAME$2;
|
|
164
|
-
SkeletonTypography.defaultProps = DEFAULT_PROPS$2;
|
|
165
|
-
SkeletonTypography.className = CLASSNAME$2;
|
|
166
|
-
|
|
167
|
-
export { SkeletonCircle as S, SkeletonRectangleVariant as a, SkeletonRectangle as b, SkeletonTypography as c };
|
|
168
|
-
//# sourceMappingURL=3326e990.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"3326e990.js","sources":["../../src/components/skeleton/SkeletonCircle.tsx","../../src/components/skeleton/SkeletonRectangle.tsx","../../src/components/skeleton/SkeletonTypography.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport React, { forwardRef } from 'react';\n\nimport { GlobalSize, Theme, ColorPalette } from '@lumx/react';\nimport { Comp, GenericProps, HasTheme } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';\n\n/**\n * Defines the props of the component.\n */\nexport interface SkeletonCircleProps extends GenericProps, HasTheme {\n /** Size variant. */\n size: GlobalSize;\n /** The color of the skeleton. */\n color?: ColorPalette;\n}\n\nconst DEFAULT_PROPS: Partial<SkeletonCircleProps> = {\n theme: Theme.light,\n};\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'SkeletonCircle';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * SkeletonCircle component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const SkeletonCircle: Comp<SkeletonCircleProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { className, size, color, theme, ...forwardedProps } = props;\n\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(className, handleBasicClasses({ prefix: CLASSNAME, size, color, theme }))}\n />\n );\n});\nSkeletonCircle.displayName = COMPONENT_NAME;\nSkeletonCircle.defaultProps = DEFAULT_PROPS;\nSkeletonCircle.className = CLASSNAME;\n","import classNames from 'classnames';\nimport React, { forwardRef } from 'react';\n\nimport { AspectRatio, GlobalSize, Theme, ColorPalette } from '@lumx/react';\nimport { Comp, GenericProps, HasTheme, ValueOf } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';\n\n/**\n * Skeleton variants.\n */\nexport const SkeletonRectangleVariant = { squared: 'squared', rounded: 'rounded', pill: 'pill' } as const;\nexport type SkeletonRectangleVariant = ValueOf<typeof SkeletonRectangleVariant>;\n\n/**\n * Defines the props of the component.\n */\nexport interface SkeletonRectangleProps extends GenericProps, HasTheme {\n /** Aspect ratio (use with width and not height). */\n aspectRatio?: Extract<AspectRatio, 'square' | 'horizontal' | 'vertical' | 'wide'>;\n /** Height size. */\n height?: GlobalSize;\n /** Border variant. */\n variant?: SkeletonRectangleVariant;\n /** Width size. */\n width?: GlobalSize;\n /** The color of the skeleton. */\n color?: ColorPalette;\n}\n\nconst DEFAULT_PROPS: Partial<SkeletonRectangleProps> = {\n theme: Theme.light,\n variant: SkeletonRectangleVariant.squared,\n};\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'SkeletonRectangle';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * SkeletonRectangle component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const SkeletonRectangle: Comp<SkeletonRectangleProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { aspectRatio, className, height, theme, variant, width, color, ...forwardedProps } = props;\n\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(\n className,\n handleBasicClasses({\n prefix: CLASSNAME,\n aspectRatio,\n height: aspectRatio ? undefined : height,\n theme,\n variant,\n width,\n color,\n }),\n )}\n >\n <div className={`${CLASSNAME}__inner`} />\n </div>\n );\n});\nSkeletonRectangle.displayName = COMPONENT_NAME;\nSkeletonRectangle.className = CLASSNAME;\nSkeletonRectangle.defaultProps = DEFAULT_PROPS;\n","import classNames from 'classnames';\nimport React, { CSSProperties, forwardRef } from 'react';\n\nimport { Theme, TypographyInterface, ColorPalette } from '@lumx/react';\nimport { Comp, GenericProps, HasTheme } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';\n\n/**\n * Defines the props of the component.\n */\nexport interface SkeletonTypographyProps extends GenericProps, HasTheme {\n /** Typography variant. */\n typography: TypographyInterface;\n /** Width CSS property. */\n width?: CSSProperties['width'];\n /** The color of the skeleton. */\n color?: ColorPalette;\n}\n\nconst DEFAULT_PROPS: Partial<SkeletonTypographyProps> = {\n theme: Theme.light,\n};\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'SkeletonTypography';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * SkeletonTypography component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const SkeletonTypography: Comp<SkeletonTypographyProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { className, theme, typography, width, color, ...forwardedProps } = props;\n\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(className, handleBasicClasses({ prefix: CLASSNAME, theme, typography, color }))}\n style={{ ...forwardedProps.style, width }}\n >\n <div className={`${CLASSNAME}__inner`} />\n </div>\n );\n});\nSkeletonTypography.displayName = COMPONENT_NAME;\nSkeletonTypography.defaultProps = DEFAULT_PROPS;\nSkeletonTypography.className = CLASSNAME;\n"],"names":["DEFAULT_PROPS","theme","Theme","light","COMPONENT_NAME","CLASSNAME","getRootClassName","SkeletonCircle","forwardRef","props","ref","className","size","color","forwardedProps","classNames","handleBasicClasses","prefix","displayName","defaultProps","SkeletonRectangleVariant","squared","rounded","pill","variant","SkeletonRectangle","aspectRatio","height","width","undefined","SkeletonTypography","typography","style"],"mappings":";;;;;AAOA;;;;AAUA,IAAMA,aAA2C,GAAG;AAChDC,EAAAA,KAAK,EAAEC,KAAK,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S,GAAGC,gBAAgB,CAACF,gBAAD,CAAlC;AAEA;;;;;;;;IAOa0B,kBAAiE,GAAGtB,UAAU,CAAC,UAACC,KAAD,EAAQC,GAAR,EAAgB;AAAA,MAChGC,SADgG,GAC9BF,KAD8B,CAChGE,SADgG;AAAA,MACrFV,KADqF,GAC9BQ,KAD8B,CACrFR,KADqF;AAAA,MAC9E8B,UAD8E,GAC9BtB,KAD8B,CAC9EsB,UAD8E;AAAA,MAClEH,KADkE,GAC9BnB,KAD8B,CAClEmB,KADkE;AAAA,MAC3Df,KAD2D,GAC9BJ,KAD8B,CAC3DI,KAD2D;AAAA,MACjDC,cADiD,4BAC9BL,KAD8B;;AAGxG,SACI;AACI,IAAA,GAAG,EAAEC;AADT,KAEQI,cAFR;AAGI,IAAA,SAAS,EAAEC,UAAU,CAACJ,SAAD,EAAYK,kBAAkB,CAAC;AAAEC,MAAAA,MAAM,EAAEZ,WAAV;AAAqBJ,MAAAA,KAAK,EAALA,KAArB;AAA4B8B,MAAAA,UAAU,EAAVA,UAA5B;AAAwClB,MAAAA,KAAK,EAALA;AAAxC,KAAD,CAA9B,CAHzB;AAII,IAAA,KAAK,qBAAOC,cAAc,CAACkB,KAAtB;AAA6BJ,MAAAA,KAAK,EAALA;AAA7B;AAJT,MAMI;AAAK,IAAA,SAAS,YAAKvB,WAAL;AAAd,IANJ,CADJ;AAUH,CAb0F;AAc3FyB,kBAAkB,CAACZ,WAAnB,GAAiCd,gBAAjC;AACA0B,kBAAkB,CAACX,YAAnB,GAAkCnB,eAAlC;AACA8B,kBAAkB,CAACnB,SAAnB,GAA+BN,WAA/B;;;;"}
|
package/_internal/377b2f44.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { b as _objectWithoutProperties, c as _extends, _ as _objectSpread2 } from './6340c129.js';
|
|
2
|
-
import { Emphasis, Size, Theme } from '../components.js';
|
|
3
|
-
import React, { forwardRef } from 'react';
|
|
4
|
-
import { g as getRootClassName } from './fd867c9d.js';
|
|
5
|
-
import { I as Icon } from './a521723d.js';
|
|
6
|
-
import { B as ButtonRoot } from './74cb6c26.js';
|
|
7
|
-
import { T as Tooltip } from './f5bdff7e.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Component display name.
|
|
11
|
-
*/
|
|
12
|
-
var COMPONENT_NAME = 'IconButton';
|
|
13
|
-
/**
|
|
14
|
-
* Component default class name and class prefix.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
var CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
18
|
-
/**
|
|
19
|
-
* Component default props.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
var DEFAULT_PROPS = {
|
|
23
|
-
emphasis: Emphasis.high,
|
|
24
|
-
size: Size.m,
|
|
25
|
-
theme: Theme.light
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* IconButton component.
|
|
29
|
-
*
|
|
30
|
-
* @param props Component props.
|
|
31
|
-
* @param ref Component ref.
|
|
32
|
-
* @return React element.
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
var IconButton = forwardRef(function (props, ref) {
|
|
36
|
-
var emphasis = props.emphasis,
|
|
37
|
-
image = props.image,
|
|
38
|
-
icon = props.icon,
|
|
39
|
-
label = props.label,
|
|
40
|
-
size = props.size,
|
|
41
|
-
theme = props.theme,
|
|
42
|
-
tooltipProps = props.tooltipProps,
|
|
43
|
-
hideTooltip = props.hideTooltip,
|
|
44
|
-
forwardedProps = _objectWithoutProperties(props, ["emphasis", "image", "icon", "label", "size", "theme", "tooltipProps", "hideTooltip"]);
|
|
45
|
-
|
|
46
|
-
return React.createElement(Tooltip, _extends({
|
|
47
|
-
label: hideTooltip ? '' : label
|
|
48
|
-
}, tooltipProps), React.createElement(ButtonRoot, _extends({
|
|
49
|
-
ref: ref
|
|
50
|
-
}, _objectSpread2({
|
|
51
|
-
emphasis: emphasis,
|
|
52
|
-
size: size,
|
|
53
|
-
theme: theme
|
|
54
|
-
}, forwardedProps), {
|
|
55
|
-
"aria-label": label,
|
|
56
|
-
variant: "icon"
|
|
57
|
-
}), image ? React.createElement("img", {
|
|
58
|
-
// no need to set alt as an aria-label is already set on the button
|
|
59
|
-
alt: "",
|
|
60
|
-
src: image
|
|
61
|
-
}) : React.createElement(Icon, {
|
|
62
|
-
icon: icon
|
|
63
|
-
})));
|
|
64
|
-
});
|
|
65
|
-
IconButton.displayName = COMPONENT_NAME;
|
|
66
|
-
IconButton.className = CLASSNAME;
|
|
67
|
-
IconButton.defaultProps = DEFAULT_PROPS;
|
|
68
|
-
|
|
69
|
-
export { IconButton as I };
|
|
70
|
-
//# sourceMappingURL=377b2f44.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"377b2f44.js","sources":["../../src/components/button/IconButton.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { Emphasis, Icon, Size, Theme, Tooltip, TooltipProps } from '@lumx/react';\nimport { BaseButtonProps, ButtonRoot } from '@lumx/react/components/button/ButtonRoot';\nimport { Comp } from '@lumx/react/utils/type';\nimport { getRootClassName } from '@lumx/react/utils/className';\n\nexport interface IconButtonProps extends BaseButtonProps {\n /**\n * Icon (SVG path).\n * If `image` is also set, `image` will be used instead.\n */\n icon?: string;\n /**\n * Image (image url).\n * Has priority over `icon`.\n */\n image?: string;\n /**\n * Label text (required for a11y purpose).\n * If you really don't want an aria-label, you can set an empty label (this is not recommended).\n */\n label: string;\n /**\n * Props to pass to the tooltip.\n * If undefined or if tooltipProps.label is undefined, the label prop will be used as tooltip label.\n * */\n tooltipProps?: Partial<TooltipProps>;\n /** Whether the tooltip should be hidden or not. */\n hideTooltip?: boolean;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'IconButton';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<IconButtonProps> = {\n emphasis: Emphasis.high,\n size: Size.m,\n theme: Theme.light,\n};\n\n/**\n * IconButton component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const IconButton: Comp<IconButtonProps, HTMLButtonElement> = forwardRef((props, ref) => {\n const { emphasis, image, icon, label, size, theme, tooltipProps, hideTooltip, ...forwardedProps } = props;\n\n return (\n <Tooltip label={hideTooltip ? '' : label} {...tooltipProps}>\n <ButtonRoot ref={ref} {...{ emphasis, size, theme, ...forwardedProps }} aria-label={label} variant=\"icon\">\n {image ? (\n <img\n // no need to set alt as an aria-label is already set on the button\n alt=\"\"\n src={image}\n />\n ) : (\n <Icon icon={icon as string} />\n )}\n </ButtonRoot>\n </Tooltip>\n );\n});\nIconButton.displayName = COMPONENT_NAME;\nIconButton.className = CLASSNAME;\nIconButton.defaultProps = DEFAULT_PROPS;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","emphasis","Emphasis","high","size","Size","m","theme","Theme","light","IconButton","forwardRef","props","ref","image","icon","label","tooltipProps","hideTooltip","forwardedProps","displayName","className","defaultProps"],"mappings":";;;;;;;;AAgCA;;;AAGA,IAAMA,cAAc,GAAG,YAAvB;AAEA;;;;AAGA,IAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAD,CAAlC;AAEA;;;;AAGA,IAAMG,aAAuC,GAAG;AAC5CC,EAAAA,QAAQ,EAAEC,QAAQ,CAACC,IADyB;AAE5CC,EAAAA,IAAI,EAAEC,IAAI,CAACC,CAFiC;AAG5CC,EAAAA,KAAK,EAAEC,KAAK,CAACC;AAH+B,CAAhD;AAMA;;;;;;;;IAOaC,UAAoD,GAAGC,UAAU,CAAC,UAACC,KAAD,EAAQC,GAAR,EAAgB;AAAA,MACnFZ,QADmF,GACSW,KADT,CACnFX,QADmF;AAAA,MACzEa,KADyE,GACSF,KADT,CACzEE,KADyE;AAAA,MAClEC,IADkE,GACSH,KADT,CAClEG,IADkE;AAAA,MAC5DC,KAD4D,GACSJ,KADT,CAC5DI,K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