@sendoutcards/quantum-design-ui 1.7.56 → 1.7.57
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/dist/index.es.js
CHANGED
|
@@ -21290,6 +21290,7 @@ var PromotionWidget = function (_a) {
|
|
|
21290
21290
|
capsuleTitle = _a.capsuleTitle,
|
|
21291
21291
|
description = _a.description,
|
|
21292
21292
|
primaryAction = _a.primaryAction,
|
|
21293
|
+
secondaryAction = _a.secondaryAction,
|
|
21293
21294
|
_b = _a.minWidth,
|
|
21294
21295
|
minWidth = _b === void 0 ? '320px' : _b,
|
|
21295
21296
|
_c = _a.width,
|
|
@@ -21335,7 +21336,17 @@ var PromotionWidget = function (_a) {
|
|
|
21335
21336
|
onClick: function () {
|
|
21336
21337
|
return primaryAction.onClick();
|
|
21337
21338
|
}
|
|
21338
|
-
}, primaryAction.title),
|
|
21339
|
+
}, primaryAction.title), secondaryAction && jsx(Flex, {
|
|
21340
|
+
alignItems: "center",
|
|
21341
|
+
inset: {
|
|
21342
|
+
left: 'x3'
|
|
21343
|
+
}
|
|
21344
|
+
}, jsx(Anchor, {
|
|
21345
|
+
href: secondaryAction.href,
|
|
21346
|
+
title: secondaryAction.title,
|
|
21347
|
+
size: 'small',
|
|
21348
|
+
color: 'primaryBody'
|
|
21349
|
+
})), children)));
|
|
21339
21350
|
};
|
|
21340
21351
|
|
|
21341
21352
|
var FeatureAnnouncement = function (_a) {
|
|
@@ -22730,22 +22741,45 @@ var ComparisonItem = function (_a) {
|
|
|
22730
22741
|
var UploadButton = function (_a) {
|
|
22731
22742
|
var title = _a.title,
|
|
22732
22743
|
onUpload = _a.onUpload,
|
|
22733
|
-
_b = _a.hasUpload,
|
|
22734
|
-
hasUpload = _b === void 0 ? false : _b,
|
|
22735
22744
|
backgroundColor = _a.backgroundColor,
|
|
22736
|
-
|
|
22737
|
-
|
|
22738
|
-
|
|
22739
|
-
|
|
22740
|
-
|
|
22741
|
-
|
|
22742
|
-
|
|
22743
|
-
|
|
22744
|
-
|
|
22745
|
+
_b = _a.width,
|
|
22746
|
+
width = _b === void 0 ? '160px' : _b,
|
|
22747
|
+
_c = _a.height,
|
|
22748
|
+
height = _c === void 0 ? '40px' : _c,
|
|
22749
|
+
_d = _a.boxShadow,
|
|
22750
|
+
boxShadow = _d === void 0 ? 'mediumLight' : _d,
|
|
22751
|
+
_e = _a.borderRadius,
|
|
22752
|
+
borderRadius = _e === void 0 ? 'medium' : _e;
|
|
22753
|
+
var inputRef = useRef(null);
|
|
22754
|
+
|
|
22755
|
+
var _f = useState(),
|
|
22756
|
+
preview = _f[0],
|
|
22757
|
+
setPreview = _f[1];
|
|
22758
|
+
|
|
22759
|
+
var handleUpload = function (event) {
|
|
22760
|
+
event.preventDefault();
|
|
22761
|
+
|
|
22762
|
+
if (event.target.files == null) {
|
|
22763
|
+
return;
|
|
22764
|
+
}
|
|
22765
|
+
|
|
22766
|
+
var file = event.target.files[0];
|
|
22767
|
+
|
|
22768
|
+
if (!!onUpload) {
|
|
22769
|
+
onUpload(file);
|
|
22770
|
+
var reader_1 = new FileReader();
|
|
22771
|
+
|
|
22772
|
+
reader_1.onloadend = function () {
|
|
22773
|
+
setPreview(reader_1.result);
|
|
22774
|
+
};
|
|
22775
|
+
|
|
22776
|
+
reader_1.readAsDataURL(file);
|
|
22777
|
+
} else {
|
|
22778
|
+
setPreview(null);
|
|
22779
|
+
}
|
|
22780
|
+
};
|
|
22781
|
+
|
|
22745
22782
|
return jsx(Flex, {
|
|
22746
|
-
onClick: function () {
|
|
22747
|
-
return onUpload(hasUpload);
|
|
22748
|
-
},
|
|
22749
22783
|
backgroundColor: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : 'foreground',
|
|
22750
22784
|
boxShadow: boxShadow,
|
|
22751
22785
|
borderRadius: borderRadius,
|
|
@@ -22753,8 +22787,21 @@ var UploadButton = function (_a) {
|
|
|
22753
22787
|
height: height,
|
|
22754
22788
|
alignItems: "center",
|
|
22755
22789
|
inset: "x_5",
|
|
22756
|
-
cursor: "pointer"
|
|
22757
|
-
|
|
22790
|
+
cursor: "pointer",
|
|
22791
|
+
onClick: function () {
|
|
22792
|
+
var _a;
|
|
22793
|
+
|
|
22794
|
+
return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
22795
|
+
}
|
|
22796
|
+
}, jsx("input", {
|
|
22797
|
+
type: "file",
|
|
22798
|
+
accept: "image/*",
|
|
22799
|
+
style: {
|
|
22800
|
+
display: 'none'
|
|
22801
|
+
},
|
|
22802
|
+
ref: inputRef,
|
|
22803
|
+
onChange: handleUpload
|
|
22804
|
+
}), jsx(Div, {
|
|
22758
22805
|
width: "35px",
|
|
22759
22806
|
height: "35px",
|
|
22760
22807
|
display: "flex",
|
|
@@ -22765,14 +22812,22 @@ var UploadButton = function (_a) {
|
|
|
22765
22812
|
borderStyle: "solid",
|
|
22766
22813
|
borderColor: "gray",
|
|
22767
22814
|
borderWidth: "thin",
|
|
22768
|
-
inset: !
|
|
22769
|
-
}, !
|
|
22815
|
+
inset: !preview ? 'x_5' : 'x0'
|
|
22816
|
+
}, !preview ? jsx(Icon, {
|
|
22770
22817
|
name: "upload",
|
|
22771
22818
|
size: "xSmall",
|
|
22772
22819
|
primaryColor: "primaryHeadingText"
|
|
22773
|
-
}) :
|
|
22820
|
+
}) : jsx(Image$1, {
|
|
22821
|
+
width: "35px",
|
|
22822
|
+
height: "35px",
|
|
22823
|
+
isActive: true,
|
|
22824
|
+
image: {
|
|
22825
|
+
url: preview
|
|
22826
|
+
},
|
|
22827
|
+
backgroundSize: "cover"
|
|
22828
|
+
})), jsx(Text, {
|
|
22774
22829
|
type: "caption",
|
|
22775
|
-
content: !
|
|
22830
|
+
content: !preview ? title : 'Uploading...',
|
|
22776
22831
|
color: "primaryHeading",
|
|
22777
22832
|
inset: {
|
|
22778
22833
|
left: 'x1'
|
|
@@ -23117,6 +23172,10 @@ var AffiliateUpsalePromotionWidget = function (_a) {
|
|
|
23117
23172
|
title: getContent(type).buttonTitle,
|
|
23118
23173
|
onClick: getContent(type).buttonOnclick
|
|
23119
23174
|
},
|
|
23175
|
+
secondaryAction: {
|
|
23176
|
+
title: 'Learn More',
|
|
23177
|
+
href: 'https://streamvirtualassistant.com/'
|
|
23178
|
+
},
|
|
23120
23179
|
capsuleTitle: "New",
|
|
23121
23180
|
width: width,
|
|
23122
23181
|
minWidth: minWidth,
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
import { BackgroundColor, Width, Height, BorderRadius } from "../../helpers/hoc-types/hocBaseUnion";
|
|
3
3
|
import { Shadows } from "../../helpers/hoc-types/entityValueTypes";
|
|
4
4
|
export declare type UploadButtonProps = {
|
|
5
|
-
|
|
6
|
-
onUpload: (hasUpload: boolean) => void;
|
|
5
|
+
onUpload: (upload: File | null) => void;
|
|
7
6
|
title: string;
|
|
8
7
|
backgroundColor?: BackgroundColor;
|
|
9
|
-
indicator: React.ReactNode;
|
|
10
8
|
width?: Width;
|
|
11
9
|
height?: Height;
|
|
12
10
|
boxShadow?: Shadows;
|