@lumx/react 3.3.2-alpha-thumbnail-aspect-ratio.7 → 3.3.2-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +10 -2
- package/index.js +145 -70
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/autocomplete/Autocomplete.stories.tsx +7 -1
- package/src/components/side-navigation/SideNavigationItem.test.tsx +32 -2
- package/src/components/side-navigation/SideNavigationItem.tsx +19 -5
- package/src/components/text-field/TextField.tsx +7 -2
- package/src/components/uploader/Uploader.stories.tsx +100 -0
- package/src/components/uploader/Uploader.test.tsx +36 -14
- package/src/components/uploader/Uploader.tsx +51 -15
- package/src/utils/renderButtonOrLink.tsx +16 -0
- package/src/utils/renderLink.tsx +1 -1
package/index.d.ts
CHANGED
|
@@ -2779,6 +2779,12 @@ declare type UploaderVariant = ValueOf<typeof UploaderVariant>;
|
|
|
2779
2779
|
* Uploader sizes.
|
|
2780
2780
|
*/
|
|
2781
2781
|
declare type UploaderSize = Extract<Size, 'xl' | 'xxl'>;
|
|
2782
|
+
/**
|
|
2783
|
+
* Extend native HTML input props with specialized `onChange` providing the a `File` array.
|
|
2784
|
+
*/
|
|
2785
|
+
interface FileInputProps extends Omit<React.ComponentProps<'input'>, 'onChange'> {
|
|
2786
|
+
onChange(files: File[], evt: React.ChangeEvent<HTMLInputElement>): void;
|
|
2787
|
+
}
|
|
2782
2788
|
/**
|
|
2783
2789
|
* Defines the props of the component.
|
|
2784
2790
|
*/
|
|
@@ -2794,7 +2800,9 @@ interface UploaderProps extends GenericProps, HasTheme {
|
|
|
2794
2800
|
/** Variant. */
|
|
2795
2801
|
variant?: UploaderVariant;
|
|
2796
2802
|
/** On click callback. */
|
|
2797
|
-
onClick?: MouseEventHandler
|
|
2803
|
+
onClick?: MouseEventHandler;
|
|
2804
|
+
/** Handle file selection with a native input file. */
|
|
2805
|
+
fileInputProps?: FileInputProps;
|
|
2798
2806
|
}
|
|
2799
2807
|
/**
|
|
2800
2808
|
* Uploader component.
|
|
@@ -2803,7 +2811,7 @@ interface UploaderProps extends GenericProps, HasTheme {
|
|
|
2803
2811
|
* @param ref Component ref.
|
|
2804
2812
|
* @return React element.
|
|
2805
2813
|
*/
|
|
2806
|
-
declare const Uploader: Comp<UploaderProps
|
|
2814
|
+
declare const Uploader: Comp<UploaderProps>;
|
|
2807
2815
|
|
|
2808
2816
|
/**
|
|
2809
2817
|
* User block sizes.
|
package/index.js
CHANGED
|
@@ -9872,7 +9872,26 @@ const SideNavigation = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
9872
9872
|
SideNavigation.displayName = COMPONENT_NAME$Z;
|
|
9873
9873
|
SideNavigation.className = CLASSNAME$W;
|
|
9874
9874
|
|
|
9875
|
-
const _excluded$10 = ["
|
|
9875
|
+
const _excluded$10 = ["linkAs", "href"];
|
|
9876
|
+
/**
|
|
9877
|
+
* Render <button> HTML component, fallbacks to `<a>` when a `href` is provided or a custom component with `linkAs`.
|
|
9878
|
+
*/
|
|
9879
|
+
const renderButtonOrLink = function (props) {
|
|
9880
|
+
const {
|
|
9881
|
+
linkAs,
|
|
9882
|
+
href
|
|
9883
|
+
} = props,
|
|
9884
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$10);
|
|
9885
|
+
for (var _len = arguments.length, children = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
9886
|
+
children[_key - 1] = arguments[_key];
|
|
9887
|
+
}
|
|
9888
|
+
if (linkAs || href) return renderLink(props, ...children);
|
|
9889
|
+
return /*#__PURE__*/React.createElement('button', _objectSpread2({
|
|
9890
|
+
type: 'button'
|
|
9891
|
+
}, forwardedProps), ...children);
|
|
9892
|
+
};
|
|
9893
|
+
|
|
9894
|
+
const _excluded$11 = ["children", "className", "emphasis", "icon", "isOpen", "isSelected", "label", "linkAs", "linkProps", "onActionClick", "onClick", "toggleButtonProps", "closeMode"];
|
|
9876
9895
|
|
|
9877
9896
|
/**
|
|
9878
9897
|
* Defines the props of the component.
|
|
@@ -9919,11 +9938,18 @@ const SideNavigationItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
9919
9938
|
toggleButtonProps,
|
|
9920
9939
|
closeMode = 'unmount'
|
|
9921
9940
|
} = props,
|
|
9922
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
9941
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$11);
|
|
9923
9942
|
const content = children && Children.toArray(children).filter(isComponent(SideNavigationItem));
|
|
9924
9943
|
const hasContent = !isEmpty(content);
|
|
9925
9944
|
const shouldSplitActions = Boolean(onActionClick);
|
|
9926
9945
|
const showChildren = hasContent && isOpen;
|
|
9946
|
+
const contentId = React.useMemo(uid, []);
|
|
9947
|
+
const ariaProps = {};
|
|
9948
|
+
if (hasContent) {
|
|
9949
|
+
ariaProps['aria-expanded'] = !!showChildren;
|
|
9950
|
+
// Associate with content ID only if in DOM (shown or hidden and not unmounted)
|
|
9951
|
+
ariaProps['aria-controls'] = showChildren || closeMode === 'hide' ? contentId : undefined;
|
|
9952
|
+
}
|
|
9927
9953
|
return /*#__PURE__*/React.createElement("li", _extends({
|
|
9928
9954
|
ref: ref
|
|
9929
9955
|
}, forwardedProps, {
|
|
@@ -9951,14 +9977,13 @@ const SideNavigationItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
9951
9977
|
size: Size.m,
|
|
9952
9978
|
emphasis: Emphasis.low,
|
|
9953
9979
|
onClick: onActionClick
|
|
9954
|
-
}))) :
|
|
9980
|
+
}, ariaProps))) : renderButtonOrLink(_objectSpread2(_objectSpread2({
|
|
9955
9981
|
linkAs
|
|
9956
9982
|
}, linkProps), {}, {
|
|
9957
9983
|
className: `${CLASSNAME$X}__link`,
|
|
9958
9984
|
tabIndex: 0,
|
|
9959
|
-
onClick
|
|
9960
|
-
|
|
9961
|
-
}), icon && /*#__PURE__*/React.createElement(Icon, {
|
|
9985
|
+
onClick
|
|
9986
|
+
}, ariaProps), icon && /*#__PURE__*/React.createElement(Icon, {
|
|
9962
9987
|
className: `${CLASSNAME$X}__icon`,
|
|
9963
9988
|
icon: icon,
|
|
9964
9989
|
size: Size.xs
|
|
@@ -9967,14 +9992,15 @@ const SideNavigationItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
9967
9992
|
icon: isOpen ? mdiChevronUp : mdiChevronDown,
|
|
9968
9993
|
size: Size.xs
|
|
9969
9994
|
})), (closeMode === 'hide' || showChildren) && /*#__PURE__*/React.createElement("ul", {
|
|
9970
|
-
className: `${CLASSNAME$X}__children
|
|
9995
|
+
className: `${CLASSNAME$X}__children`,
|
|
9996
|
+
id: contentId
|
|
9971
9997
|
}, content));
|
|
9972
9998
|
});
|
|
9973
9999
|
SideNavigationItem.displayName = COMPONENT_NAME$_;
|
|
9974
10000
|
SideNavigationItem.className = CLASSNAME$X;
|
|
9975
10001
|
SideNavigationItem.defaultProps = DEFAULT_PROPS$K;
|
|
9976
10002
|
|
|
9977
|
-
const _excluded$
|
|
10003
|
+
const _excluded$12 = ["className", "size", "color", "theme"];
|
|
9978
10004
|
|
|
9979
10005
|
/**
|
|
9980
10006
|
* Defines the props of the component.
|
|
@@ -10008,7 +10034,7 @@ const SkeletonCircle = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
10008
10034
|
color,
|
|
10009
10035
|
theme
|
|
10010
10036
|
} = props,
|
|
10011
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
10037
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$12);
|
|
10012
10038
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
10013
10039
|
ref: ref
|
|
10014
10040
|
}, forwardedProps, {
|
|
@@ -10024,7 +10050,7 @@ SkeletonCircle.displayName = COMPONENT_NAME$$;
|
|
|
10024
10050
|
SkeletonCircle.defaultProps = DEFAULT_PROPS$L;
|
|
10025
10051
|
SkeletonCircle.className = CLASSNAME$Y;
|
|
10026
10052
|
|
|
10027
|
-
const _excluded$
|
|
10053
|
+
const _excluded$13 = ["aspectRatio", "className", "height", "theme", "variant", "width", "color"];
|
|
10028
10054
|
|
|
10029
10055
|
/**
|
|
10030
10056
|
* Skeleton variants.
|
|
@@ -10071,7 +10097,7 @@ const SkeletonRectangle = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
10071
10097
|
width,
|
|
10072
10098
|
color
|
|
10073
10099
|
} = props,
|
|
10074
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
10100
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$13);
|
|
10075
10101
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
10076
10102
|
ref: ref
|
|
10077
10103
|
}, forwardedProps, {
|
|
@@ -10092,7 +10118,7 @@ SkeletonRectangle.displayName = COMPONENT_NAME$10;
|
|
|
10092
10118
|
SkeletonRectangle.className = CLASSNAME$Z;
|
|
10093
10119
|
SkeletonRectangle.defaultProps = DEFAULT_PROPS$M;
|
|
10094
10120
|
|
|
10095
|
-
const _excluded$
|
|
10121
|
+
const _excluded$14 = ["className", "theme", "typography", "width", "color"];
|
|
10096
10122
|
|
|
10097
10123
|
/**
|
|
10098
10124
|
* Defines the props of the component.
|
|
@@ -10127,7 +10153,7 @@ const SkeletonTypography = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
10127
10153
|
width,
|
|
10128
10154
|
color
|
|
10129
10155
|
} = props,
|
|
10130
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
10156
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$14);
|
|
10131
10157
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
10132
10158
|
ref: ref
|
|
10133
10159
|
}, forwardedProps, {
|
|
@@ -10182,7 +10208,7 @@ const clamp = (value, min, max) => {
|
|
|
10182
10208
|
return value;
|
|
10183
10209
|
};
|
|
10184
10210
|
|
|
10185
|
-
const _excluded$
|
|
10211
|
+
const _excluded$15 = ["className", "disabled", "helper", "hideMinMaxLabel", "id", "isDisabled", "label", "max", "min", "name", "onChange", "onMouseDown", "precision", "steps", "theme", "value"];
|
|
10186
10212
|
|
|
10187
10213
|
/**
|
|
10188
10214
|
* Defines the props of the component.
|
|
@@ -10257,7 +10283,7 @@ const Slider = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
10257
10283
|
theme,
|
|
10258
10284
|
value
|
|
10259
10285
|
} = props,
|
|
10260
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
10286
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$15);
|
|
10261
10287
|
const sliderId = useMemo(() => id || `slider-${uid()}`, [id]);
|
|
10262
10288
|
const sliderLabelId = useMemo(() => `label-${sliderId}`, [sliderId]);
|
|
10263
10289
|
const sliderRef = useRef(null);
|
|
@@ -10738,7 +10764,7 @@ const useSlideFocusManagement = _ref => {
|
|
|
10738
10764
|
}, [isSlideDisplayed, slideRef]);
|
|
10739
10765
|
};
|
|
10740
10766
|
|
|
10741
|
-
const _excluded$
|
|
10767
|
+
const _excluded$16 = ["className", "children", "role", "label", "isDisplayed"];
|
|
10742
10768
|
|
|
10743
10769
|
/**
|
|
10744
10770
|
* Defines the props of the component.
|
|
@@ -10770,7 +10796,7 @@ const SlideshowItemGroup = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
10770
10796
|
label,
|
|
10771
10797
|
isDisplayed
|
|
10772
10798
|
} = props,
|
|
10773
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
10799
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$16);
|
|
10774
10800
|
const groupRef = React.useRef(null);
|
|
10775
10801
|
useSlideFocusManagement({
|
|
10776
10802
|
isSlideDisplayed: isDisplayed,
|
|
@@ -10789,7 +10815,7 @@ const SlideshowItemGroup = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
10789
10815
|
SlideshowItemGroup.displayName = COMPONENT_NAME$13;
|
|
10790
10816
|
SlideshowItemGroup.className = CLASSNAME$10;
|
|
10791
10817
|
|
|
10792
|
-
const _excluded$
|
|
10818
|
+
const _excluded$17 = ["activeIndex", "autoPlay", "children", "className", "fillHeight", "groupBy", "interval", "onChange", "slideshowControlsProps", "theme", "id", "slidesId", "slideGroupLabel"];
|
|
10793
10819
|
|
|
10794
10820
|
/**
|
|
10795
10821
|
* Defines the props of the component.
|
|
@@ -10825,7 +10851,7 @@ const Slideshow = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
10825
10851
|
slidesId,
|
|
10826
10852
|
slideGroupLabel
|
|
10827
10853
|
} = props,
|
|
10828
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
10854
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$17);
|
|
10829
10855
|
// Number of slideshow items.
|
|
10830
10856
|
const itemsCount = React.Children.count(children);
|
|
10831
10857
|
const {
|
|
@@ -10907,7 +10933,7 @@ const Slideshow = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
10907
10933
|
Slideshow.displayName = 'Slideshow';
|
|
10908
10934
|
Slideshow.defaultProps = DEFAULT_PROPS$P;
|
|
10909
10935
|
|
|
10910
|
-
const _excluded$
|
|
10936
|
+
const _excluded$18 = ["className", "children"];
|
|
10911
10937
|
|
|
10912
10938
|
/**
|
|
10913
10939
|
* Defines the props of the component.
|
|
@@ -10935,7 +10961,7 @@ const SlideshowItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
10935
10961
|
className,
|
|
10936
10962
|
children
|
|
10937
10963
|
} = props,
|
|
10938
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
10964
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$18);
|
|
10939
10965
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
10940
10966
|
ref: ref,
|
|
10941
10967
|
className: classnames(className, handleBasicClasses({
|
|
@@ -11003,7 +11029,7 @@ function usePaginationVisibleRange(activeIndex, slideCount) {
|
|
|
11003
11029
|
}, [activeIndex, slideCount]);
|
|
11004
11030
|
}
|
|
11005
11031
|
|
|
11006
|
-
const _excluded$
|
|
11032
|
+
const _excluded$19 = ["activeIndex", "className", "nextButtonProps", "onNextClick", "onPaginationClick", "onPreviousClick", "parentRef", "previousButtonProps", "paginationProps", "slidesCount", "theme", "isAutoPlaying", "playButtonProps", "paginationItemLabel", "paginationItemProps"],
|
|
11007
11033
|
_excluded2$2 = ["className", "label"];
|
|
11008
11034
|
|
|
11009
11035
|
/**
|
|
@@ -11053,7 +11079,7 @@ const InternalSlideshowControls = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
11053
11079
|
paginationItemLabel,
|
|
11054
11080
|
paginationItemProps
|
|
11055
11081
|
} = props,
|
|
11056
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
11082
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$19);
|
|
11057
11083
|
let parent;
|
|
11058
11084
|
if (WINDOW) {
|
|
11059
11085
|
// Checking window object to avoid errors in SSR.
|
|
@@ -11155,7 +11181,7 @@ const SlideshowControls = Object.assign(InternalSlideshowControls, {
|
|
|
11155
11181
|
useSlideshowControlsDefaultOptions: DEFAULT_OPTIONS$1
|
|
11156
11182
|
});
|
|
11157
11183
|
|
|
11158
|
-
const _excluded$
|
|
11184
|
+
const _excluded$1a = ["activeIndex", "id", "className", "theme", "fillHeight", "groupBy", "isAutoPlaying", "toggleAutoPlay", "slidesId", "children", "afterSlides", "hasControls", "slideGroupLabel"];
|
|
11159
11185
|
/**
|
|
11160
11186
|
* Component display name.
|
|
11161
11187
|
*/
|
|
@@ -11189,7 +11215,7 @@ const Slides = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
11189
11215
|
hasControls,
|
|
11190
11216
|
slideGroupLabel
|
|
11191
11217
|
} = props,
|
|
11192
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
11218
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1a);
|
|
11193
11219
|
const wrapperRef = React.useRef(null);
|
|
11194
11220
|
const startIndexVisible = activeIndex;
|
|
11195
11221
|
const endIndexVisible = startIndexVisible + 1;
|
|
@@ -11235,7 +11261,7 @@ const Slides = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
11235
11261
|
Slides.displayName = COMPONENT_NAME$16;
|
|
11236
11262
|
Slides.className = CLASSNAME$13;
|
|
11237
11263
|
|
|
11238
|
-
const _excluded$
|
|
11264
|
+
const _excluded$1b = ["checked", "children", "className", "disabled", "helper", "id", "isChecked", "isDisabled", "name", "onChange", "position", "theme", "value", "inputProps"];
|
|
11239
11265
|
|
|
11240
11266
|
/**
|
|
11241
11267
|
* Defines the props of the component.
|
|
@@ -11283,7 +11309,7 @@ const Switch = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
11283
11309
|
value,
|
|
11284
11310
|
inputProps = {}
|
|
11285
11311
|
} = props,
|
|
11286
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
11312
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1b);
|
|
11287
11313
|
const inputId = useMemo(() => id || `switch-${uid()}`, [id]);
|
|
11288
11314
|
const handleChange = event => {
|
|
11289
11315
|
if (onChange) {
|
|
@@ -11338,7 +11364,7 @@ Switch.displayName = COMPONENT_NAME$17;
|
|
|
11338
11364
|
Switch.className = CLASSNAME$14;
|
|
11339
11365
|
Switch.defaultProps = DEFAULT_PROPS$R;
|
|
11340
11366
|
|
|
11341
|
-
const _excluded$
|
|
11367
|
+
const _excluded$1c = ["children", "className", "hasBefore", "hasDividers", "theme"];
|
|
11342
11368
|
|
|
11343
11369
|
/**
|
|
11344
11370
|
* Defines the props of the component.
|
|
@@ -11376,7 +11402,7 @@ const Table = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
11376
11402
|
hasDividers,
|
|
11377
11403
|
theme
|
|
11378
11404
|
} = props,
|
|
11379
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
11405
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1c);
|
|
11380
11406
|
return /*#__PURE__*/React.createElement("table", _extends({
|
|
11381
11407
|
ref: ref
|
|
11382
11408
|
}, forwardedProps, {
|
|
@@ -11392,7 +11418,7 @@ Table.displayName = COMPONENT_NAME$18;
|
|
|
11392
11418
|
Table.className = CLASSNAME$15;
|
|
11393
11419
|
Table.defaultProps = DEFAULT_PROPS$S;
|
|
11394
11420
|
|
|
11395
|
-
const _excluded$
|
|
11421
|
+
const _excluded$1d = ["children", "className"];
|
|
11396
11422
|
|
|
11397
11423
|
/**
|
|
11398
11424
|
* Defines the props of the component.
|
|
@@ -11420,7 +11446,7 @@ const TableBody = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
11420
11446
|
children,
|
|
11421
11447
|
className
|
|
11422
11448
|
} = props,
|
|
11423
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
11449
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1d);
|
|
11424
11450
|
return /*#__PURE__*/React.createElement("tbody", _extends({
|
|
11425
11451
|
ref: ref
|
|
11426
11452
|
}, forwardedProps, {
|
|
@@ -11432,7 +11458,7 @@ const TableBody = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
11432
11458
|
TableBody.displayName = COMPONENT_NAME$19;
|
|
11433
11459
|
TableBody.className = CLASSNAME$16;
|
|
11434
11460
|
|
|
11435
|
-
const _excluded$
|
|
11461
|
+
const _excluded$1e = ["children", "className", "icon", "isSortable", "onHeaderClick", "sortOrder", "variant"];
|
|
11436
11462
|
|
|
11437
11463
|
/**
|
|
11438
11464
|
* Table head cell sort order.
|
|
@@ -11487,7 +11513,7 @@ const TableCell = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
11487
11513
|
sortOrder,
|
|
11488
11514
|
variant
|
|
11489
11515
|
} = props,
|
|
11490
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
11516
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1e);
|
|
11491
11517
|
|
|
11492
11518
|
// Use button if clickable
|
|
11493
11519
|
const Wrapper = onHeaderClick ? 'button' : 'div';
|
|
@@ -11540,7 +11566,7 @@ TableCell.displayName = COMPONENT_NAME$1a;
|
|
|
11540
11566
|
TableCell.className = CLASSNAME$17;
|
|
11541
11567
|
TableCell.defaultProps = DEFAULT_PROPS$T;
|
|
11542
11568
|
|
|
11543
|
-
const _excluded$
|
|
11569
|
+
const _excluded$1f = ["children", "className"];
|
|
11544
11570
|
|
|
11545
11571
|
/**
|
|
11546
11572
|
* Defines the props of the component.
|
|
@@ -11573,7 +11599,7 @@ const TableHeader = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
11573
11599
|
children,
|
|
11574
11600
|
className
|
|
11575
11601
|
} = props,
|
|
11576
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
11602
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1f);
|
|
11577
11603
|
return /*#__PURE__*/React.createElement("thead", _extends({
|
|
11578
11604
|
ref: ref
|
|
11579
11605
|
}, forwardedProps, {
|
|
@@ -11586,7 +11612,7 @@ TableHeader.displayName = COMPONENT_NAME$1b;
|
|
|
11586
11612
|
TableHeader.className = CLASSNAME$18;
|
|
11587
11613
|
TableHeader.defaultProps = DEFAULT_PROPS$U;
|
|
11588
11614
|
|
|
11589
|
-
const _excluded$
|
|
11615
|
+
const _excluded$1g = ["children", "className", "disabled", "isClickable", "isDisabled", "isSelected"];
|
|
11590
11616
|
|
|
11591
11617
|
/**
|
|
11592
11618
|
* Defines the props of the component.
|
|
@@ -11623,7 +11649,7 @@ const TableRow = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
11623
11649
|
isDisabled = disabled,
|
|
11624
11650
|
isSelected
|
|
11625
11651
|
} = props,
|
|
11626
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
11652
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1g);
|
|
11627
11653
|
return /*#__PURE__*/React.createElement("tr", _extends({
|
|
11628
11654
|
ref: ref,
|
|
11629
11655
|
tabIndex: isClickable && !isDisabled ? 0 : -1
|
|
@@ -11641,7 +11667,7 @@ TableRow.displayName = COMPONENT_NAME$1c;
|
|
|
11641
11667
|
TableRow.className = CLASSNAME$19;
|
|
11642
11668
|
TableRow.defaultProps = DEFAULT_PROPS$V;
|
|
11643
11669
|
|
|
11644
|
-
const _excluded$
|
|
11670
|
+
const _excluded$1h = ["children", "onChange"];
|
|
11645
11671
|
const DEFAULT_PROPS$W = {
|
|
11646
11672
|
isLazy: INIT_STATE.isLazy,
|
|
11647
11673
|
shouldActivateOnFocus: INIT_STATE.shouldActivateOnFocus
|
|
@@ -11661,7 +11687,7 @@ const TabProvider = props => {
|
|
|
11661
11687
|
children,
|
|
11662
11688
|
onChange
|
|
11663
11689
|
} = props,
|
|
11664
|
-
propState = _objectWithoutProperties(props, _excluded$
|
|
11690
|
+
propState = _objectWithoutProperties(props, _excluded$1h);
|
|
11665
11691
|
const [state, dispatch] = useReducer(reducer, INIT_STATE);
|
|
11666
11692
|
|
|
11667
11693
|
// On prop state change => dispatch update.
|
|
@@ -11689,7 +11715,7 @@ const TabProvider = props => {
|
|
|
11689
11715
|
};
|
|
11690
11716
|
TabProvider.defaultProps = DEFAULT_PROPS$W;
|
|
11691
11717
|
|
|
11692
|
-
const _excluded$
|
|
11718
|
+
const _excluded$1i = ["aria-label", "children", "className", "layout", "position", "theme"];
|
|
11693
11719
|
let TabListLayout;
|
|
11694
11720
|
|
|
11695
11721
|
/**
|
|
@@ -11736,7 +11762,7 @@ const TabList = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
11736
11762
|
position,
|
|
11737
11763
|
theme
|
|
11738
11764
|
} = props,
|
|
11739
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
11765
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1i);
|
|
11740
11766
|
const tabListRef = React.useRef(null);
|
|
11741
11767
|
useRovingTabIndex({
|
|
11742
11768
|
parentRef: tabListRef,
|
|
@@ -11763,7 +11789,7 @@ TabList.displayName = COMPONENT_NAME$1d;
|
|
|
11763
11789
|
TabList.className = CLASSNAME$1a;
|
|
11764
11790
|
TabList.defaultProps = DEFAULT_PROPS$X;
|
|
11765
11791
|
|
|
11766
|
-
const _excluded$
|
|
11792
|
+
const _excluded$1j = ["className", "disabled", "icon", "id", "isActive", "isDisabled", "label", "onFocus", "onKeyPress", "tabIndex"];
|
|
11767
11793
|
|
|
11768
11794
|
/**
|
|
11769
11795
|
* Defines the props of the component.
|
|
@@ -11806,7 +11832,7 @@ const Tab = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
11806
11832
|
onKeyPress,
|
|
11807
11833
|
tabIndex = -1
|
|
11808
11834
|
} = props,
|
|
11809
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
11835
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1j);
|
|
11810
11836
|
const state = useTabProviderContext('tab', id);
|
|
11811
11837
|
const isActive = propIsActive || (state === null || state === void 0 ? void 0 : state.isActive);
|
|
11812
11838
|
const changeToCurrentTab = useCallback(() => {
|
|
@@ -11855,7 +11881,7 @@ Tab.displayName = COMPONENT_NAME$1e;
|
|
|
11855
11881
|
Tab.className = CLASSNAME$1b;
|
|
11856
11882
|
Tab.defaultProps = DEFAULT_PROPS$Y;
|
|
11857
11883
|
|
|
11858
|
-
const _excluded$
|
|
11884
|
+
const _excluded$1k = ["children", "id", "className", "isActive"];
|
|
11859
11885
|
|
|
11860
11886
|
/**
|
|
11861
11887
|
* Defines the props of the component.
|
|
@@ -11892,7 +11918,7 @@ const TabPanel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
11892
11918
|
className,
|
|
11893
11919
|
isActive: propIsActive
|
|
11894
11920
|
} = props,
|
|
11895
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
11921
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1k);
|
|
11896
11922
|
const state = useTabProviderContext('tabPanel', id);
|
|
11897
11923
|
const isActive = propIsActive || (state === null || state === void 0 ? void 0 : state.isActive);
|
|
11898
11924
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
@@ -11912,7 +11938,7 @@ TabPanel.displayName = COMPONENT_NAME$1f;
|
|
|
11912
11938
|
TabPanel.className = CLASSNAME$1c;
|
|
11913
11939
|
TabPanel.defaultProps = DEFAULT_PROPS$Z;
|
|
11914
11940
|
|
|
11915
|
-
const _excluded$
|
|
11941
|
+
const _excluded$1l = ["id", "isDisabled", "isRequired", "placeholder", "multiline", "value", "setFocus", "onChange", "onFocus", "onBlur", "inputRef", "rows", "recomputeNumberOfRows", "type", "name", "hasError", "describedById"],
|
|
11916
11942
|
_excluded2$3 = ["chips", "className", "clearButtonProps", "disabled", "error", "forceFocusStyle", "hasError", "helper", "icon", "id", "inputRef", "isDisabled", "isRequired", "isValid", "label", "maxLength", "minimumRows", "multiline", "name", "onBlur", "onChange", "onClear", "onFocus", "placeholder", "textFieldRef", "theme", "type", "value", "afterElement"];
|
|
11917
11943
|
|
|
11918
11944
|
/**
|
|
@@ -11997,7 +12023,7 @@ const renderInputNative = props => {
|
|
|
11997
12023
|
hasError,
|
|
11998
12024
|
describedById
|
|
11999
12025
|
} = props,
|
|
12000
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
12026
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1l);
|
|
12001
12027
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
12002
12028
|
const ref = useRef(null);
|
|
12003
12029
|
|
|
@@ -12062,7 +12088,7 @@ const TextField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
12062
12088
|
helper,
|
|
12063
12089
|
icon,
|
|
12064
12090
|
id,
|
|
12065
|
-
inputRef,
|
|
12091
|
+
inputRef: inputRefProps,
|
|
12066
12092
|
isDisabled = disabled,
|
|
12067
12093
|
isRequired,
|
|
12068
12094
|
isValid,
|
|
@@ -12084,6 +12110,10 @@ const TextField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
12084
12110
|
} = props,
|
|
12085
12111
|
forwardedProps = _objectWithoutProperties(props, _excluded2$3);
|
|
12086
12112
|
const textFieldId = useMemo(() => id || `text-field-${uid()}`, [id]);
|
|
12113
|
+
/** Keep a clean local input ref to manage focus */
|
|
12114
|
+
const localInputRef = useRef(null);
|
|
12115
|
+
/** Merge prop input ref and local input ref */
|
|
12116
|
+
const inputRef = mergeRefs(localInputRef, inputRefProps);
|
|
12087
12117
|
/**
|
|
12088
12118
|
* Generate unique ids for both the helper and error texts, in order to
|
|
12089
12119
|
* later on add them to the input native as aria-describedby. If both the error and the helper are present,
|
|
@@ -12116,7 +12146,9 @@ const TextField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
12116
12146
|
if (onClear) {
|
|
12117
12147
|
onClear(evt);
|
|
12118
12148
|
}
|
|
12119
|
-
|
|
12149
|
+
|
|
12150
|
+
/** Use local inputRef in case the prop input ref is a `mergeRefs` function. */
|
|
12151
|
+
const inputElement = localInputRef;
|
|
12120
12152
|
if (inputElement && inputElement.current) {
|
|
12121
12153
|
inputElement.current.focus();
|
|
12122
12154
|
}
|
|
@@ -12373,7 +12405,7 @@ const useFocusPointStyle = (_ref2, element, isLoaded) => {
|
|
|
12373
12405
|
return style;
|
|
12374
12406
|
};
|
|
12375
12407
|
|
|
12376
|
-
const _excluded$
|
|
12408
|
+
const _excluded$1m = ["align", "alt", "aspectRatio", "badge", "className", "crossOrigin", "fallback", "fillHeight", "focusPoint", "image", "imgProps", "imgRef", "isLoading", "loading", "size", "theme", "variant", "linkProps", "linkAs"];
|
|
12377
12409
|
|
|
12378
12410
|
/**
|
|
12379
12411
|
* Defines the props of the component.
|
|
@@ -12429,7 +12461,7 @@ const Thumbnail = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
12429
12461
|
linkProps,
|
|
12430
12462
|
linkAs
|
|
12431
12463
|
} = props,
|
|
12432
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
12464
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1m);
|
|
12433
12465
|
const [imgElement, setImgElement] = useState();
|
|
12434
12466
|
|
|
12435
12467
|
// Image loading state.
|
|
@@ -12535,7 +12567,7 @@ const ThumbnailVariant = {
|
|
|
12535
12567
|
rounded: 'rounded'
|
|
12536
12568
|
};
|
|
12537
12569
|
|
|
12538
|
-
const _excluded$
|
|
12570
|
+
const _excluded$1n = ["after", "before", "className", "label"];
|
|
12539
12571
|
|
|
12540
12572
|
/**
|
|
12541
12573
|
* Defines the props of the component.
|
|
@@ -12570,7 +12602,7 @@ const Toolbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
12570
12602
|
className,
|
|
12571
12603
|
label
|
|
12572
12604
|
} = props,
|
|
12573
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
12605
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1n);
|
|
12574
12606
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
12575
12607
|
ref: ref
|
|
12576
12608
|
}, forwardedProps, {
|
|
@@ -12726,7 +12758,7 @@ function useTooltipOpen(delay, anchorElement) {
|
|
|
12726
12758
|
return isOpen;
|
|
12727
12759
|
}
|
|
12728
12760
|
|
|
12729
|
-
const _excluded$
|
|
12761
|
+
const _excluded$1o = ["label", "children", "className", "delay", "placement", "forceOpen"];
|
|
12730
12762
|
|
|
12731
12763
|
/** Position of the tooltip relative to the anchor element. */
|
|
12732
12764
|
|
|
@@ -12773,7 +12805,7 @@ const Tooltip = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
12773
12805
|
placement,
|
|
12774
12806
|
forceOpen
|
|
12775
12807
|
} = props,
|
|
12776
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
12808
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1o);
|
|
12777
12809
|
// Disable in SSR or without a label.
|
|
12778
12810
|
if (!DOCUMENT || !label) {
|
|
12779
12811
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
@@ -12819,7 +12851,15 @@ Tooltip.displayName = COMPONENT_NAME$1j;
|
|
|
12819
12851
|
Tooltip.className = CLASSNAME$1g;
|
|
12820
12852
|
Tooltip.defaultProps = DEFAULT_PROPS$11;
|
|
12821
12853
|
|
|
12822
|
-
const
|
|
12854
|
+
const useBooleanState = defaultValue => {
|
|
12855
|
+
const [booleanValue, setBoolean] = useState(defaultValue);
|
|
12856
|
+
const setToFalse = useCallback(() => setBoolean(false), []);
|
|
12857
|
+
const setToTrue = useCallback(() => setBoolean(true), []);
|
|
12858
|
+
const toggleBoolean = useCallback(() => setBoolean(previousValue => !previousValue), []);
|
|
12859
|
+
return [booleanValue, setToFalse, setToTrue, toggleBoolean];
|
|
12860
|
+
};
|
|
12861
|
+
|
|
12862
|
+
const _excluded$1p = ["aspectRatio", "className", "label", "icon", "size", "theme", "variant", "fileInputProps"];
|
|
12823
12863
|
|
|
12824
12864
|
/**
|
|
12825
12865
|
* Uploader variants.
|
|
@@ -12834,6 +12874,10 @@ const UploaderVariant = {
|
|
|
12834
12874
|
* Uploader sizes.
|
|
12835
12875
|
*/
|
|
12836
12876
|
|
|
12877
|
+
/**
|
|
12878
|
+
* Extend native HTML input props with specialized `onChange` providing the a `File` array.
|
|
12879
|
+
*/
|
|
12880
|
+
|
|
12837
12881
|
/**
|
|
12838
12882
|
* Defines the props of the component.
|
|
12839
12883
|
*/
|
|
@@ -12873,39 +12917,70 @@ const Uploader = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
12873
12917
|
icon,
|
|
12874
12918
|
size,
|
|
12875
12919
|
theme,
|
|
12876
|
-
variant
|
|
12920
|
+
variant,
|
|
12921
|
+
fileInputProps
|
|
12877
12922
|
} = props,
|
|
12878
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
12923
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1p);
|
|
12879
12924
|
// Adjust to square aspect ratio when using circle variants.
|
|
12880
12925
|
const adjustedAspectRatio = variant === UploaderVariant.circle ? AspectRatio.square : aspectRatio;
|
|
12881
|
-
|
|
12926
|
+
const inputId = React.useMemo(() => (fileInputProps === null || fileInputProps === void 0 ? void 0 : fileInputProps.id) || uniqueId('uploader-input-'), [fileInputProps === null || fileInputProps === void 0 ? void 0 : fileInputProps.id]);
|
|
12927
|
+
const [isDragHovering, unsetDragHovering, setDragHovering] = useBooleanState(false);
|
|
12928
|
+
const wrapper = fileInputProps ? {
|
|
12929
|
+
Component: 'label',
|
|
12930
|
+
props: {
|
|
12931
|
+
htmlFor: inputId
|
|
12932
|
+
}
|
|
12933
|
+
} : {
|
|
12934
|
+
Component: 'button',
|
|
12935
|
+
props: {
|
|
12936
|
+
type: 'button'
|
|
12937
|
+
}
|
|
12938
|
+
};
|
|
12939
|
+
const onChange = React.useMemo(() => {
|
|
12940
|
+
if (!(fileInputProps !== null && fileInputProps !== void 0 && fileInputProps.onChange)) return undefined;
|
|
12941
|
+
return evt => {
|
|
12942
|
+
const fileList = evt.target.files;
|
|
12943
|
+
const files = fileList ? Array.from(fileList) : [];
|
|
12944
|
+
fileInputProps.onChange(files, evt);
|
|
12945
|
+
};
|
|
12946
|
+
}, [fileInputProps]);
|
|
12947
|
+
return /*#__PURE__*/React.createElement(wrapper.Component, _extends({
|
|
12882
12948
|
ref: ref
|
|
12883
|
-
}, forwardedProps, {
|
|
12949
|
+
}, wrapper.props, forwardedProps, {
|
|
12884
12950
|
className: classnames(className, handleBasicClasses({
|
|
12885
12951
|
aspectRatio: adjustedAspectRatio,
|
|
12886
12952
|
prefix: CLASSNAME$1h,
|
|
12887
12953
|
size,
|
|
12888
12954
|
theme,
|
|
12889
|
-
variant
|
|
12955
|
+
variant,
|
|
12956
|
+
isDragHovering
|
|
12890
12957
|
}))
|
|
12891
|
-
}), /*#__PURE__*/React.createElement("
|
|
12958
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
12892
12959
|
className: `${CLASSNAME$1h}__background`
|
|
12893
|
-
}), /*#__PURE__*/React.createElement("
|
|
12960
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
12894
12961
|
className: `${CLASSNAME$1h}__wrapper`
|
|
12895
|
-
}, icon && /*#__PURE__*/React.createElement(
|
|
12896
|
-
className: `${CLASSNAME$1h}__icon
|
|
12897
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
12962
|
+
}, icon && /*#__PURE__*/React.createElement(Icon, {
|
|
12963
|
+
className: `${CLASSNAME$1h}__icon`,
|
|
12898
12964
|
icon: icon,
|
|
12899
12965
|
size: Size.s
|
|
12900
|
-
})
|
|
12966
|
+
}), label && /*#__PURE__*/React.createElement("span", {
|
|
12901
12967
|
className: `${CLASSNAME$1h}__label`
|
|
12902
|
-
}, label))
|
|
12968
|
+
}, label)), fileInputProps && /*#__PURE__*/React.createElement("input", _extends({
|
|
12969
|
+
type: "file",
|
|
12970
|
+
id: inputId,
|
|
12971
|
+
className: `${CLASSNAME$1h}__input`
|
|
12972
|
+
}, fileInputProps, {
|
|
12973
|
+
onChange: onChange,
|
|
12974
|
+
onDragEnter: setDragHovering,
|
|
12975
|
+
onDragLeave: unsetDragHovering,
|
|
12976
|
+
onDrop: unsetDragHovering
|
|
12977
|
+
})));
|
|
12903
12978
|
});
|
|
12904
12979
|
Uploader.displayName = COMPONENT_NAME$1k;
|
|
12905
12980
|
Uploader.className = CLASSNAME$1h;
|
|
12906
12981
|
Uploader.defaultProps = DEFAULT_PROPS$12;
|
|
12907
12982
|
|
|
12908
|
-
const _excluded$
|
|
12983
|
+
const _excluded$1q = ["avatarProps", "className", "fields", "linkProps", "linkAs", "multipleActions", "name", "nameProps", "onClick", "onMouseEnter", "onMouseLeave", "orientation", "simpleAction", "size", "theme"];
|
|
12909
12984
|
|
|
12910
12985
|
/**
|
|
12911
12986
|
* User block sizes.
|
|
@@ -12959,7 +13034,7 @@ const UserBlock = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
12959
13034
|
size,
|
|
12960
13035
|
theme
|
|
12961
13036
|
} = props,
|
|
12962
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
13037
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1q);
|
|
12963
13038
|
let componentSize = size;
|
|
12964
13039
|
|
|
12965
13040
|
// Special case - When using vertical orientation force the size to be Sizes.l.
|