@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), children)));
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
- indicator = _a.indicator,
22737
- _c = _a.width,
22738
- width = _c === void 0 ? '160px' : _c,
22739
- _d = _a.height,
22740
- height = _d === void 0 ? '40px' : _d,
22741
- _e = _a.boxShadow,
22742
- boxShadow = _e === void 0 ? 'mediumLight' : _e,
22743
- _f = _a.borderRadius,
22744
- borderRadius = _f === void 0 ? 'medium' : _f;
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
- }, jsx(Div, {
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: !hasUpload ? 'x_5' : 'x0'
22769
- }, !hasUpload ? jsx(Icon, {
22815
+ inset: !preview ? 'x_5' : 'x0'
22816
+ }, !preview ? jsx(Icon, {
22770
22817
  name: "upload",
22771
22818
  size: "xSmall",
22772
22819
  primaryColor: "primaryHeadingText"
22773
- }) : indicator), jsx(Text, {
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: !hasUpload ? title : 'Uploading...',
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 React, { FC } from 'react';
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
- hasUpload: boolean;
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;
@@ -10,6 +10,10 @@ export declare type PromotionWidgetProps = {
10
10
  onClick: () => void;
11
11
  title: string;
12
12
  };
13
+ secondaryAction?: {
14
+ href: string;
15
+ title: string;
16
+ };
13
17
  minWidth?: string;
14
18
  width?: string;
15
19
  type: ThemeMode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendoutcards/quantum-design-ui",
3
- "version": "1.7.56",
3
+ "version": "1.7.57",
4
4
  "description": "UI component library for Quantum Design System",
5
5
  "module": "dist/index.es.js",
6
6
  "jsnext:main": "dist/index.es.js",