@sendoutcards/quantum-design-ui 1.6.5 → 1.6.6

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
@@ -16215,22 +16215,37 @@ var QuantitySlider = function (_a) {
16215
16215
  }));
16216
16216
  };
16217
16217
 
16218
+ var convertTextColorToIconColor = function (textColor) {
16219
+ switch (textColor) {
16220
+ case 'primaryBody':
16221
+ return 'primaryBodyText';
16222
+
16223
+ case 'primaryHeading':
16224
+ return 'primaryHeadingText';
16225
+
16226
+ case 'inverseBody':
16227
+ return 'inverseBodyText';
16228
+
16229
+ case 'inverseHeading':
16230
+ return 'inverseHeadingText';
16231
+
16232
+ default:
16233
+ return textColor;
16234
+ }
16235
+ };
16236
+
16218
16237
  var FeatureBadge = function (_a) {
16219
16238
  var title = _a.title,
16220
- backgroundColor = _a.backgroundColor,
16221
- iconColor = _a.iconColor,
16222
- textColor = _a.textColor,
16239
+ _b = _a.backgroundColor,
16240
+ backgroundColor = _b === void 0 ? 'success' : _b,
16241
+ _c = _a.color,
16242
+ color = _c === void 0 ? 'inverseBody' : _c,
16223
16243
  size = _a.size,
16224
16244
  icon = _a.icon,
16225
16245
  onClick = _a.onClick;
16246
+ var hocs = useEntities().hocs;
16226
16247
  return jsx(Flex, {
16227
- backgroundColor: backgroundColor ? {
16228
- swatch: backgroundColor,
16229
- shade: 'base'
16230
- } : {
16231
- swatch: 'success',
16232
- shade: 'base'
16233
- },
16248
+ backgroundColor: hocs.colors.swatches[backgroundColor].base,
16234
16249
  inset: icon ? {
16235
16250
  left: 'x1',
16236
16251
  vertical: 'x1',
@@ -16254,7 +16269,7 @@ var FeatureBadge = function (_a) {
16254
16269
  }
16255
16270
  }, jsx(Icon, {
16256
16271
  name: icon,
16257
- primaryColor: iconColor !== null && iconColor !== void 0 ? iconColor : 'inverseHeadingText',
16272
+ primaryColor: convertTextColorToIconColor(color),
16258
16273
  size: size !== null && size !== void 0 ? size : 'small'
16259
16274
  })), jsx(Text, {
16260
16275
  style: {
@@ -16262,7 +16277,7 @@ var FeatureBadge = function (_a) {
16262
16277
  letterSpacing: 0.5
16263
16278
  },
16264
16279
  type: "caption",
16265
- color: textColor !== null && textColor !== void 0 ? textColor : 'inverseHeading',
16280
+ color: color,
16266
16281
  weight: "bold"
16267
16282
  }, title));
16268
16283
  };
@@ -20184,14 +20199,16 @@ var PromotionWidget = function (_a) {
20184
20199
  _c = _a.width,
20185
20200
  width = _c === void 0 ? '100%' : _c,
20186
20201
  type = _a.type,
20187
- buttonSize = _a.buttonSize;
20202
+ children = _a.children,
20203
+ _d = _a.backgroundColor,
20204
+ backgroundColor = _d === void 0 ? 'background' : _d;
20188
20205
  var widget = useEntities().widget;
20189
20206
  var widgetProperties = widget[type];
20190
20207
  return jsx(Card, {
20191
20208
  display: "flex",
20192
20209
  justifyItems: "start",
20193
20210
  borderRadius: "default",
20194
- backgroundColor: "background",
20211
+ backgroundColor: backgroundColor,
20195
20212
  inset: "x4",
20196
20213
  width: width,
20197
20214
  minWidth: minWidth
@@ -20217,13 +20234,12 @@ var PromotionWidget = function (_a) {
20217
20234
  type: "caption"
20218
20235
  }, description)), jsx(Flex, {
20219
20236
  justifyContent: "flex-start"
20220
- }, jsx(Button, {
20221
- type: type,
20237
+ }, primaryAction && jsx(Button, {
20238
+ type: "success",
20222
20239
  onClick: function () {
20223
20240
  return primaryAction.onClick();
20224
- },
20225
- size: buttonSize
20226
- }, primaryAction.title))));
20241
+ }
20242
+ }, primaryAction.title), children)));
20227
20243
  };
20228
20244
 
20229
20245
  var _emotionSourceMap = process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHd0IiLCJmaWxlIjoic3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgX19tYWtlVGVtcGxhdGVPYmplY3QgfSBmcm9tIFwidHNsaWJcIjtcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vY29yZSc7XHJcbmV4cG9ydCBkZWZhdWx0IHtcclxuICAgIHRodW1ibmFpbENvbnRhaW5lcjogY3NzKHRlbXBsYXRlT2JqZWN0XzEgfHwgKHRlbXBsYXRlT2JqZWN0XzEgPSBfX21ha2VUZW1wbGF0ZU9iamVjdChbXCJcIl0sIFtcIlwiXSkpKSxcclxufTtcclxudmFyIHRlbXBsYXRlT2JqZWN0XzE7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXN0eWxlcy5qcy5tYXAiXX0= */";
@@ -20578,10 +20594,7 @@ var AffiliateShareWidget = function (_a) {
20578
20594
  title: "Share the $97 Postcard Program",
20579
20595
  type: "secondary",
20580
20596
  description: "",
20581
- primaryAction: {
20582
- onClick: function () {},
20583
- title: 'Action Title'
20584
- }
20597
+ backgroundColor: "foreground"
20585
20598
  }, jsx(Clipboard, {
20586
20599
  copyText: shareLink
20587
20600
  }));
@@ -0,0 +1,3 @@
1
+ import { TextColor } from "../../atoms/typography/text";
2
+ import { IconColors } from "../../exports/atoms";
3
+ export declare const convertTextColorToIconColor: (textColor: TextColor) => IconColors;
@@ -1,14 +1,13 @@
1
1
  import { FC } from 'react';
2
2
  import { TextColor } from "../../atoms/typography/text";
3
3
  import { SizeType } from "../../types/global";
4
- import { IconColors, IconType } from "../../exports/atoms";
4
+ import { IconType } from "../../exports/atoms";
5
5
  import { HOCSwatchColorKeys } from "../../helpers/hoc-types/entityValueTypes";
6
6
  export declare type FeatureBadgeProps = {
7
7
  title: string;
8
8
  backgroundColor?: HOCSwatchColorKeys;
9
9
  icon?: IconType;
10
- iconColor?: IconColors;
11
- textColor?: TextColor;
10
+ color?: TextColor;
12
11
  size?: SizeType;
13
12
  onClick?: () => void;
14
13
  };
@@ -1,10 +1,12 @@
1
1
  import { FC } from 'react';
2
2
  import { SizeType, ThemeMode } from "../../types/global";
3
+ import { BackgroundColor } from "../../helpers/hoc-types/hocBaseUnion";
3
4
  export declare type PromotionWidgetProps = {
4
5
  title: string;
5
6
  description: string;
6
7
  capsuleTitle: string;
7
- primaryAction: {
8
+ backgroundColor?: BackgroundColor;
9
+ primaryAction?: {
8
10
  onClick: () => void;
9
11
  title: string;
10
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendoutcards/quantum-design-ui",
3
- "version": "1.6.5",
3
+ "version": "1.6.6",
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",