@elliemae/ds-notification-badge 3.0.0-alpha.0 → 3.0.0-alpha.1

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.
@@ -2,8 +2,22 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
6
  var __getProtoOf = Object.getPrototypeOf;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
+ var __spreadValues = (a, b) => {
11
+ for (var prop in b || (b = {}))
12
+ if (__hasOwnProp.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ if (__getOwnPropSymbols)
15
+ for (var prop of __getOwnPropSymbols(b)) {
16
+ if (__propIsEnum.call(b, prop))
17
+ __defNormalProp(a, prop, b[prop]);
18
+ }
19
+ return a;
20
+ };
7
21
  var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
22
  var __export = (target, all) => {
9
23
  for (var name in all)
@@ -32,17 +46,14 @@ __export(NotificationBadge_exports, {
32
46
  });
33
47
  var React = __toESM(require("react"));
34
48
  var import_react = __toESM(require("react"));
35
- var import_react_desc = require("react-desc");
36
- var import_prop_types = require("./prop-types");
49
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
50
+ var import_react_desc_prop_types = require("./react-desc-prop-types");
37
51
  var import_style = require("./style");
38
- const NotificationBadge = ({
39
- type,
40
- value,
41
- size,
42
- disabled,
43
- position,
44
- Component
45
- }) => {
52
+ const NotificationBadge = (props) => {
53
+ const propsWithDefaults = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultProps);
54
+ (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefaults, import_react_desc_prop_types.NotificationBadgePropTypes);
55
+ const globalAttributes = (0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefaults);
56
+ const { type, color, value, size, disabled, position, Component } = propsWithDefaults;
46
57
  const Badge = type === "number" ? import_style.NumericBadge : import_style.DotBadge;
47
58
  const relatedComponentRef = (0, import_react.useRef)(null);
48
59
  const renderBadge = relatedComponentRef?.current || !Component;
@@ -50,20 +61,19 @@ const NotificationBadge = ({
50
61
  const [relatedComponentWidth, setRelatedComponentWidth] = (0, import_react.useState)(0);
51
62
  (0, import_react.useEffect)(() => {
52
63
  const relatedComponent = relatedComponentRef?.current;
53
- setRelatedComponentHeight(relatedComponent?.offsetHeight);
54
- setRelatedComponentWidth(relatedComponent?.offsetWidth);
64
+ setRelatedComponentHeight(relatedComponent?.offsetHeight || 0);
65
+ setRelatedComponentWidth(relatedComponent?.offsetWidth || 0);
55
66
  }, [relatedComponentRef]);
56
- let top;
57
- let right;
58
- let left;
59
- if (Component) {
60
- if (position === "right")
61
- left = relatedComponentWidth / 2;
62
- if (position === "left")
63
- right = relatedComponentWidth / 2;
64
- top = relatedComponentHeight / 2;
65
- }
66
- return /* @__PURE__ */ import_react.default.createElement(import_style.Wrapper, null, renderBadge && /* @__PURE__ */ import_react.default.createElement(Badge, {
67
+ let top = 0;
68
+ let right = 0;
69
+ let left = 0;
70
+ if (position === "right")
71
+ left = relatedComponentWidth / 2;
72
+ if (position === "left")
73
+ right = relatedComponentWidth / 2;
74
+ top = relatedComponentHeight / 2;
75
+ return /* @__PURE__ */ import_react.default.createElement(import_style.Wrapper, __spreadValues({}, globalAttributes), renderBadge && /* @__PURE__ */ import_react.default.createElement(Badge, {
76
+ color,
67
77
  size,
68
78
  value,
69
79
  disabled,
@@ -74,9 +84,8 @@ const NotificationBadge = ({
74
84
  innerRef: relatedComponentRef
75
85
  }));
76
86
  };
77
- NotificationBadge.defaultProps = import_prop_types.defaultProps;
78
- NotificationBadge.propTypes = import_prop_types.notificationBadgeProps;
79
- const NotificationBadgeWithSchema = (0, import_react_desc.describe)(NotificationBadge);
80
- NotificationBadgeWithSchema.propTypes = import_prop_types.notificationBadgeProps;
87
+ NotificationBadge.propTypes = import_react_desc_prop_types.NotificationBadgePropTypes;
88
+ const NotificationBadgeWithSchema = (0, import_ds_props_helpers.describe)(NotificationBadge);
89
+ NotificationBadgeWithSchema.propTypes = import_react_desc_prop_types.NotificationBadgePropTypes;
81
90
  module.exports = __toCommonJS(NotificationBadge_exports);
82
91
  //# sourceMappingURL=NotificationBadge.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/NotificationBadge.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { useState, useEffect, useRef } from 'react';\nimport { describe } from 'react-desc';\nimport { notificationBadgeProps, defaultProps } from './prop-types';\nimport { NotificactionBadge as props } from './index.d';\nimport { Wrapper, NumericBadge, DotBadge } from './style';\n\nconst NotificationBadge = ({\n type,\n value,\n size,\n disabled,\n position,\n Component,\n}: props): JSX.Element => {\n const Badge = type === 'number' ? NumericBadge : DotBadge;\n const relatedComponentRef = useRef(null);\n const renderBadge = relatedComponentRef?.current || !Component;\n const [relatedComponentHeight, setRelatedComponentHeight] = useState(0);\n const [relatedComponentWidth, setRelatedComponentWidth] = useState(0);\n\n useEffect(() => {\n const relatedComponent = relatedComponentRef?.current;\n setRelatedComponentHeight(relatedComponent?.offsetHeight);\n setRelatedComponentWidth(relatedComponent?.offsetWidth);\n }, [relatedComponentRef]);\n\n let top;\n let right;\n let left;\n\n if (Component) {\n if (position === 'right') left = relatedComponentWidth / 2;\n if (position === 'left') right = relatedComponentWidth / 2;\n top = relatedComponentHeight / 2;\n }\n\n return (\n <Wrapper>\n {renderBadge && (\n <Badge\n size={size}\n value={value}\n disabled={disabled}\n top={top}\n left={left}\n right={right}\n >\n {type === 'number' && value}\n </Badge>\n )}\n {Component && <Component innerRef={relatedComponentRef} />}\n </Wrapper>\n );\n};\n\nNotificationBadge.defaultProps = defaultProps;\nNotificationBadge.propTypes = notificationBadgeProps;\nconst NotificationBadgeWithSchema = describe(NotificationBadge);\nNotificationBadgeWithSchema.propTypes = notificationBadgeProps;\n\nexport { NotificationBadge, NotificationBadgeWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAmD;AACnD,wBAAyB;AACzB,wBAAqD;AAErD,mBAAgD;AAEhD,MAAM,oBAAoB,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MACwB;AACxB,QAAM,QAAQ,SAAS,WAAW,4BAAe;AACjD,QAAM,sBAAsB,yBAAO;AACnC,QAAM,cAAc,qBAAqB,WAAW,CAAC;AACrD,QAAM,CAAC,wBAAwB,6BAA6B,2BAAS;AACrE,QAAM,CAAC,uBAAuB,4BAA4B,2BAAS;AAEnE,8BAAU,MAAM;AACd,UAAM,mBAAmB,qBAAqB;AAC9C,8BAA0B,kBAAkB;AAC5C,6BAAyB,kBAAkB;AAAA,KAC1C,CAAC;AAEJ,MAAI;AACJ,MAAI;AACJ,MAAI;AAEJ,MAAI,WAAW;AACb,QAAI,aAAa;AAAS,aAAO,wBAAwB;AACzD,QAAI,aAAa;AAAQ,cAAQ,wBAAwB;AACzD,UAAM,yBAAyB;AAAA;AAGjC,SACE,mDAAC,sBAAD,MACG,eACC,mDAAC,OAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,KAEC,SAAS,YAAY,QAGzB,aAAa,mDAAC,WAAD;AAAA,IAAW,UAAU;AAAA;AAAA;AAKzC,kBAAkB,eAAe;AACjC,kBAAkB,YAAY;AAC9B,MAAM,8BAA8B,gCAAS;AAC7C,4BAA4B,YAAY;",
4
+ "sourcesContent": ["import React, { useState, useEffect, useRef, WeakValidationMap } from 'react';\nimport {\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n describe,\n useGetGlobalAttributes,\n} from '@elliemae/ds-props-helpers';\n\nimport { NotificationBadgePropTypes, DSNotificationBadgeT, defaultProps } from './react-desc-prop-types';\nimport { Wrapper, NumericBadge, DotBadge } from './style';\n\nconst NotificationBadge: React.ComponentType<DSNotificationBadgeT.Props> = (props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps);\n useValidateTypescriptPropTypes<DSNotificationBadgeT.Props>(propsWithDefaults, NotificationBadgePropTypes);\n const globalAttributes = useGetGlobalAttributes(propsWithDefaults);\n\n const { type, color, value, size, disabled, position, Component } = propsWithDefaults;\n\n const Badge = type === 'number' ? NumericBadge : DotBadge;\n const relatedComponentRef = useRef<HTMLSpanElement>(null);\n const renderBadge = relatedComponentRef?.current || !Component;\n const [relatedComponentHeight, setRelatedComponentHeight] = useState(0);\n const [relatedComponentWidth, setRelatedComponentWidth] = useState(0);\n\n useEffect(() => {\n const relatedComponent = relatedComponentRef?.current;\n setRelatedComponentHeight(relatedComponent?.offsetHeight || 0);\n setRelatedComponentWidth(relatedComponent?.offsetWidth || 0);\n }, [relatedComponentRef]);\n\n let top = 0;\n let right = 0;\n let left = 0;\n\n if (position === 'right') left = relatedComponentWidth / 2;\n if (position === 'left') right = relatedComponentWidth / 2;\n top = relatedComponentHeight / 2;\n\n return (\n <Wrapper {...globalAttributes}>\n {renderBadge && (\n <Badge color={color} size={size} value={value} disabled={disabled} top={top} left={left} right={right}>\n {type === 'number' && value}\n </Badge>\n )}\n {Component && <Component innerRef={relatedComponentRef} />}\n </Wrapper>\n );\n};\n\nNotificationBadge.propTypes = NotificationBadgePropTypes as WeakValidationMap<unknown>;\nconst NotificationBadgeWithSchema = describe(NotificationBadge);\nNotificationBadgeWithSchema.propTypes = NotificationBadgePropTypes as WeakValidationMap<unknown>;\n\nexport { NotificationBadge, NotificationBadgeWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAsE;AACtE,8BAKO;AAEP,mCAA+E;AAC/E,mBAAgD;AAEhD,MAAM,oBAAqE,CAAC,UAAU;AACpF,QAAM,oBAAoB,0DAA6B,OAAO;AAC9D,8DAA2D,mBAAmB;AAC9E,QAAM,mBAAmB,oDAAuB;AAEhD,QAAM,EAAE,MAAM,OAAO,OAAO,MAAM,UAAU,UAAU,cAAc;AAEpE,QAAM,QAAQ,SAAS,WAAW,4BAAe;AACjD,QAAM,sBAAsB,yBAAwB;AACpD,QAAM,cAAc,qBAAqB,WAAW,CAAC;AACrD,QAAM,CAAC,wBAAwB,6BAA6B,2BAAS;AACrE,QAAM,CAAC,uBAAuB,4BAA4B,2BAAS;AAEnE,8BAAU,MAAM;AACd,UAAM,mBAAmB,qBAAqB;AAC9C,8BAA0B,kBAAkB,gBAAgB;AAC5D,6BAAyB,kBAAkB,eAAe;AAAA,KACzD,CAAC;AAEJ,MAAI,MAAM;AACV,MAAI,QAAQ;AACZ,MAAI,OAAO;AAEX,MAAI,aAAa;AAAS,WAAO,wBAAwB;AACzD,MAAI,aAAa;AAAQ,YAAQ,wBAAwB;AACzD,QAAM,yBAAyB;AAE/B,SACE,mDAAC,sBAAD,mBAAa,mBACV,eACC,mDAAC,OAAD;AAAA,IAAO;AAAA,IAAc;AAAA,IAAY;AAAA,IAAc;AAAA,IAAoB;AAAA,IAAU;AAAA,IAAY;AAAA,KACtF,SAAS,YAAY,QAGzB,aAAa,mDAAC,WAAD;AAAA,IAAW,UAAU;AAAA;AAAA;AAKzC,kBAAkB,YAAY;AAC9B,MAAM,8BAA8B,sCAAS;AAC7C,4BAA4B,YAAY;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,71 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
25
+ var __export = (target, all) => {
26
+ for (var name in all)
27
+ __defProp(target, name, { get: all[name], enumerable: true });
28
+ };
29
+ var __reExport = (target, module2, copyDefault, desc) => {
30
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
31
+ for (let key of __getOwnPropNames(module2))
32
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
33
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
34
+ }
35
+ return target;
36
+ };
37
+ var __toESM = (module2, isNodeMode) => {
38
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
39
+ };
40
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
41
+ return (module2, temp) => {
42
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
43
+ };
44
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
45
+ var react_desc_prop_types_exports = {};
46
+ __export(react_desc_prop_types_exports, {
47
+ NotificationBadgePropTypes: () => NotificationBadgePropTypes,
48
+ defaultProps: () => defaultProps
49
+ });
50
+ var React = __toESM(require("react"));
51
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
52
+ const defaultProps = {
53
+ type: "number",
54
+ size: "s",
55
+ disabled: false,
56
+ position: "right",
57
+ color: void 0,
58
+ Component: void 0,
59
+ value: void 0
60
+ };
61
+ const NotificationBadgePropTypes = __spreadProps(__spreadValues({}, import_ds_props_helpers.globalAttributesPropTypes), {
62
+ type: import_ds_props_helpers.PropTypes.oneOf(["number", "dot"]).description("type of badge: number or dot"),
63
+ value: import_ds_props_helpers.PropTypes.number.description("value of the numeric badge"),
64
+ size: import_ds_props_helpers.PropTypes.oneOf(["s", "l"]).description("size of the badge: s or l"),
65
+ disabled: import_ds_props_helpers.PropTypes.bool.description("whether the badge is disabled"),
66
+ position: import_ds_props_helpers.PropTypes.oneOf(["left", "right"]).description("position of the badge with the related component"),
67
+ Component: import_ds_props_helpers.PropTypes.func.description("Related component"),
68
+ color: import_ds_props_helpers.PropTypes.string.description("Badge background color value")
69
+ });
70
+ module.exports = __toCommonJS(react_desc_prop_types_exports);
71
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/react-desc-prop-types.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { PropTypes, globalAttributesPropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSNotificationBadgeT {\n interface ComponentT {\n innerRef: React.RefObject<HTMLSpanElement>;\n }\n\n export interface Props {\n [property: string]: unknown;\n type?: string;\n value?: number;\n size?: string;\n disabled?: boolean;\n position?: string;\n Component?: (propsT: ComponentT) => JSX.Element;\n color?: string;\n }\n}\n\nexport const defaultProps: DSNotificationBadgeT.Props = {\n type: 'number',\n size: 's',\n disabled: false,\n position: 'right',\n color: undefined,\n Component: undefined,\n value: undefined,\n};\n\nexport const NotificationBadgePropTypes = {\n ...globalAttributesPropTypes,\n type: PropTypes.oneOf(['number', 'dot']).description('type of badge: number or dot'),\n value: PropTypes.number.description('value of the numeric badge'),\n size: PropTypes.oneOf(['s', 'l']).description('size of the badge: s or l'),\n disabled: PropTypes.bool.description('whether the badge is disabled'),\n position: PropTypes.oneOf(['left', 'right']).description('position of the badge with the related component'),\n Component: PropTypes.func.description('Related component'),\n color: PropTypes.string.description('Badge background color value'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAqD;AAmB9C,MAAM,eAA2C;AAAA,EACtD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AAAA,EACV,OAAO;AAAA,EACP,WAAW;AAAA,EACX,OAAO;AAAA;AAGF,MAAM,6BAA6B,iCACrC,oDADqC;AAAA,EAExC,MAAM,kCAAU,MAAM,CAAC,UAAU,QAAQ,YAAY;AAAA,EACrD,OAAO,kCAAU,OAAO,YAAY;AAAA,EACpC,MAAM,kCAAU,MAAM,CAAC,KAAK,MAAM,YAAY;AAAA,EAC9C,UAAU,kCAAU,KAAK,YAAY;AAAA,EACrC,UAAU,kCAAU,MAAM,CAAC,QAAQ,UAAU,YAAY;AAAA,EACzD,WAAW,kCAAU,KAAK,YAAY;AAAA,EACtC,OAAO,kCAAU,OAAO,YAAY;AAAA;",
6
+ "names": []
7
+ }
package/dist/cjs/style.js CHANGED
@@ -53,26 +53,25 @@ const NumericBadge = (0, import_styled_components.default)(GenericBadge)`
53
53
  align-items: center;
54
54
  width: fit-content;
55
55
  color: #fff;
56
- padding: ${({ value }) => value > 9 ? "0 5px" : "0"};
56
+ padding: ${({ value }) => value && value > 9 ? "0 5px" : "0"};
57
57
  padding-top: 2px;
58
- background-color: ${({ disabled, theme }) => disabled ? theme.colors.neutral[500] : theme.colors.danger[900]};
59
- border-radius: ${({ value }) => value > 9 ? "10px" : "50%"};
58
+ background-color: ${({ disabled, color, theme }) => disabled ? theme.colors.neutral["500"] : color || theme.colors.danger["900"]};
59
+ border-radius: ${({ value }) => value && value > 9 ? "10px" : "50%"};
60
60
  font-size: ${({ size }) => size === "l" ? "16px" : "12px"};
61
61
  font-weight: ${({ size }) => size === "l" ? "400" : "600"};
62
62
  height: ${({ size }) => size === "l" ? "21px" : "15px"};
63
63
  min-width: ${({ size, value }) => {
64
- if (size === "l" && value > 9)
64
+ if (size === "l" && value && value > 9)
65
65
  return "30px";
66
- if (size === "l" && value <= 9)
66
+ if (size === "l" && value && value <= 9)
67
67
  return "21px";
68
- if (size === "s" && value > 9)
68
+ if (size === "s" && value && value > 9)
69
69
  return "21px";
70
- if (size === "s" && value <= 9)
71
- return "15px";
70
+ return "15px";
72
71
  }};
73
72
  `;
74
73
  const DotBadge = (0, import_styled_components.default)(GenericBadge)`
75
- background-color: ${({ disabled, theme }) => disabled ? theme.colors.neutral[500] : theme.colors.brand[500]};
74
+ background-color: ${({ disabled, theme, color }) => disabled ? theme.colors.neutral["500"] : color || theme.colors.brand[500]};
76
75
  width: ${({ size }) => size === "l" ? "15px" : "10px"};
77
76
  height: ${({ size }) => size === "l" ? "15px" : "10px"};
78
77
  border-radius: 100%;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/style.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import styled from 'styled-components';\n\nexport const Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: fit-content;\n`;\n\nexport const GenericBadge = styled.span`\n position: relative;\n top: ${({ top }) => (top ? `${top}px` : 'unset')};\n left: ${({ left }) => (left ? `${left}px` : 'unset')};\n right: ${({ right }) => (right ? `${right}px` : 'unset')};\n`;\n\nexport const NumericBadge = styled(GenericBadge)`\n display: flex;\n justify-content: center;\n align-items: center;\n width: fit-content;\n color: #fff;\n padding: ${({ value }) => (value > 9 ? '0 5px' : '0')};\n padding-top: 2px;\n background-color: ${({ disabled, theme }) =>\n disabled ? theme.colors.neutral[500] : theme.colors.danger[900]};\n border-radius: ${({ value }) => (value > 9 ? '10px' : '50%')};\n font-size: ${({ size }) => (size === 'l' ? '16px' : '12px')};\n font-weight: ${({ size }) => (size === 'l' ? '400' : '600')};\n height: ${({ size }) => (size === 'l' ? '21px' : '15px')};\n min-width: ${({ size, value }) => {\n if (size === 'l' && value > 9) return '30px';\n if (size === 'l' && value <= 9) return '21px';\n if (size === 's' && value > 9) return '21px';\n if (size === 's' && value <= 9) return '15px';\n }};\n`;\n\nexport const DotBadge = styled(GenericBadge)`\n background-color: ${({ disabled, theme }) =>\n disabled ? theme.colors.neutral[500] : theme.colors.brand[500]};\n width: ${({ size }) => (size === 'l' ? '15px' : '10px')};\n height: ${({ size }) => (size === 'l' ? '15px' : '10px')};\n border-radius: 100%;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAmB;AAEZ,MAAM,UAAU,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQvB,MAAM,eAAe,iCAAO;AAAA;AAAA,SAE1B,CAAC,EAAE,UAAW,MAAM,GAAG,UAAU;AAAA,UAChC,CAAC,EAAE,WAAY,OAAO,GAAG,WAAW;AAAA,WACnC,CAAC,EAAE,YAAa,QAAQ,GAAG,YAAY;AAAA;AAG3C,MAAM,eAAe,sCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAMtB,CAAC,EAAE,YAAa,QAAQ,IAAI,UAAU;AAAA;AAAA,sBAE7B,CAAC,EAAE,UAAU,YAC/B,WAAW,MAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,OAAO;AAAA,mBAC5C,CAAC,EAAE,YAAa,QAAQ,IAAI,SAAS;AAAA,eACzC,CAAC,EAAE,WAAY,SAAS,MAAM,SAAS;AAAA,iBACrC,CAAC,EAAE,WAAY,SAAS,MAAM,QAAQ;AAAA,YAC3C,CAAC,EAAE,WAAY,SAAS,MAAM,SAAS;AAAA,eACpC,CAAC,EAAE,MAAM,YAAY;AAChC,MAAI,SAAS,OAAO,QAAQ;AAAG,WAAO;AACtC,MAAI,SAAS,OAAO,SAAS;AAAG,WAAO;AACvC,MAAI,SAAS,OAAO,QAAQ;AAAG,WAAO;AACtC,MAAI,SAAS,OAAO,SAAS;AAAG,WAAO;AAAA;AAAA;AAIpC,MAAM,WAAW,sCAAO;AAAA,sBACT,CAAC,EAAE,UAAU,YAC/B,WAAW,MAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,MAAM;AAAA,WACnD,CAAC,EAAE,WAAY,SAAS,MAAM,SAAS;AAAA,YACtC,CAAC,EAAE,WAAY,SAAS,MAAM,SAAS;AAAA;AAAA;",
4
+ "sourcesContent": ["import styled from 'styled-components';\nimport { DSNotificationBadgeT } from './react-desc-prop-types';\n\ninterface StyledGenericBadgeT {\n top: number;\n left: number;\n right: number;\n}\n\nexport const Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: fit-content;\n`;\n\nexport const GenericBadge = styled.span<DSNotificationBadgeT.Props & StyledGenericBadgeT>`\n position: relative;\n top: ${({ top }) => (top ? `${top}px` : 'unset')};\n left: ${({ left }) => (left ? `${left}px` : 'unset')};\n right: ${({ right }) => (right ? `${right}px` : 'unset')};\n`;\n\nexport const NumericBadge = styled(GenericBadge)<{\n top: number;\n left: number;\n right: number;\n size?: string;\n disabled?: boolean;\n value?: number;\n color?: string;\n}>`\n display: flex;\n justify-content: center;\n align-items: center;\n width: fit-content;\n color: #fff;\n padding: ${({ value }) => (value && value > 9 ? '0 5px' : '0')};\n padding-top: 2px;\n background-color: ${({ disabled, color, theme }) =>\n disabled ? theme.colors.neutral['500'] : color || theme.colors.danger['900']};\n border-radius: ${({ value }) => (value && value > 9 ? '10px' : '50%')};\n font-size: ${({ size }) => (size === 'l' ? '16px' : '12px')};\n font-weight: ${({ size }) => (size === 'l' ? '400' : '600')};\n height: ${({ size }) => (size === 'l' ? '21px' : '15px')};\n min-width: ${({ size, value }) => {\n if (size === 'l' && value && value > 9) return '30px';\n if (size === 'l' && value && value <= 9) return '21px';\n if (size === 's' && value && value > 9) return '21px';\n return '15px';\n }};\n`;\n\nexport const DotBadge = styled(GenericBadge)<DSNotificationBadgeT.Props>`\n background-color: ${({ disabled, theme, color }) =>\n disabled ? theme.colors.neutral['500'] : color || theme.colors.brand[500]};\n width: ${({ size }) => (size === 'l' ? '15px' : '10px')};\n height: ${({ size }) => (size === 'l' ? '15px' : '10px')};\n border-radius: 100%;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAmB;AASZ,MAAM,UAAU,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQvB,MAAM,eAAe,iCAAO;AAAA;AAAA,SAE1B,CAAC,EAAE,UAAW,MAAM,GAAG,UAAU;AAAA,UAChC,CAAC,EAAE,WAAY,OAAO,GAAG,WAAW;AAAA,WACnC,CAAC,EAAE,YAAa,QAAQ,GAAG,YAAY;AAAA;AAG3C,MAAM,eAAe,sCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aActB,CAAC,EAAE,YAAa,SAAS,QAAQ,IAAI,UAAU;AAAA;AAAA,sBAEtC,CAAC,EAAE,UAAU,OAAO,YACtC,WAAW,MAAM,OAAO,QAAQ,SAAS,SAAS,MAAM,OAAO,OAAO;AAAA,mBACvD,CAAC,EAAE,YAAa,SAAS,QAAQ,IAAI,SAAS;AAAA,eAClD,CAAC,EAAE,WAAY,SAAS,MAAM,SAAS;AAAA,iBACrC,CAAC,EAAE,WAAY,SAAS,MAAM,QAAQ;AAAA,YAC3C,CAAC,EAAE,WAAY,SAAS,MAAM,SAAS;AAAA,eACpC,CAAC,EAAE,MAAM,YAAY;AAChC,MAAI,SAAS,OAAO,SAAS,QAAQ;AAAG,WAAO;AAC/C,MAAI,SAAS,OAAO,SAAS,SAAS;AAAG,WAAO;AAChD,MAAI,SAAS,OAAO,SAAS,QAAQ;AAAG,WAAO;AAC/C,SAAO;AAAA;AAAA;AAIJ,MAAM,WAAW,sCAAO;AAAA,sBACT,CAAC,EAAE,UAAU,OAAO,YACtC,WAAW,MAAM,OAAO,QAAQ,SAAS,SAAS,MAAM,OAAO,MAAM;AAAA,WAC9D,CAAC,EAAE,WAAY,SAAS,MAAM,SAAS;AAAA,YACtC,CAAC,EAAE,WAAY,SAAS,MAAM,SAAS;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1,16 +1,34 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
1
17
  import * as React from "react";
2
18
  import React2, { useState, useEffect, useRef } from "react";
3
- import { describe } from "react-desc";
4
- import { notificationBadgeProps, defaultProps } from "./prop-types";
19
+ import {
20
+ useMemoMergePropsWithDefault,
21
+ useValidateTypescriptPropTypes,
22
+ describe,
23
+ useGetGlobalAttributes
24
+ } from "@elliemae/ds-props-helpers";
25
+ import { NotificationBadgePropTypes, defaultProps } from "./react-desc-prop-types";
5
26
  import { Wrapper, NumericBadge, DotBadge } from "./style";
6
- const NotificationBadge = ({
7
- type,
8
- value,
9
- size,
10
- disabled,
11
- position,
12
- Component
13
- }) => {
27
+ const NotificationBadge = (props) => {
28
+ const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps);
29
+ useValidateTypescriptPropTypes(propsWithDefaults, NotificationBadgePropTypes);
30
+ const globalAttributes = useGetGlobalAttributes(propsWithDefaults);
31
+ const { type, color, value, size, disabled, position, Component } = propsWithDefaults;
14
32
  const Badge = type === "number" ? NumericBadge : DotBadge;
15
33
  const relatedComponentRef = useRef(null);
16
34
  const renderBadge = relatedComponentRef?.current || !Component;
@@ -18,20 +36,19 @@ const NotificationBadge = ({
18
36
  const [relatedComponentWidth, setRelatedComponentWidth] = useState(0);
19
37
  useEffect(() => {
20
38
  const relatedComponent = relatedComponentRef?.current;
21
- setRelatedComponentHeight(relatedComponent?.offsetHeight);
22
- setRelatedComponentWidth(relatedComponent?.offsetWidth);
39
+ setRelatedComponentHeight(relatedComponent?.offsetHeight || 0);
40
+ setRelatedComponentWidth(relatedComponent?.offsetWidth || 0);
23
41
  }, [relatedComponentRef]);
24
- let top;
25
- let right;
26
- let left;
27
- if (Component) {
28
- if (position === "right")
29
- left = relatedComponentWidth / 2;
30
- if (position === "left")
31
- right = relatedComponentWidth / 2;
32
- top = relatedComponentHeight / 2;
33
- }
34
- return /* @__PURE__ */ React2.createElement(Wrapper, null, renderBadge && /* @__PURE__ */ React2.createElement(Badge, {
42
+ let top = 0;
43
+ let right = 0;
44
+ let left = 0;
45
+ if (position === "right")
46
+ left = relatedComponentWidth / 2;
47
+ if (position === "left")
48
+ right = relatedComponentWidth / 2;
49
+ top = relatedComponentHeight / 2;
50
+ return /* @__PURE__ */ React2.createElement(Wrapper, __spreadValues({}, globalAttributes), renderBadge && /* @__PURE__ */ React2.createElement(Badge, {
51
+ color,
35
52
  size,
36
53
  value,
37
54
  disabled,
@@ -42,10 +59,9 @@ const NotificationBadge = ({
42
59
  innerRef: relatedComponentRef
43
60
  }));
44
61
  };
45
- NotificationBadge.defaultProps = defaultProps;
46
- NotificationBadge.propTypes = notificationBadgeProps;
62
+ NotificationBadge.propTypes = NotificationBadgePropTypes;
47
63
  const NotificationBadgeWithSchema = describe(NotificationBadge);
48
- NotificationBadgeWithSchema.propTypes = notificationBadgeProps;
64
+ NotificationBadgeWithSchema.propTypes = NotificationBadgePropTypes;
49
65
  export {
50
66
  NotificationBadge,
51
67
  NotificationBadgeWithSchema
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/NotificationBadge.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useState, useEffect, useRef } from 'react';\nimport { describe } from 'react-desc';\nimport { notificationBadgeProps, defaultProps } from './prop-types';\nimport { NotificactionBadge as props } from './index.d';\nimport { Wrapper, NumericBadge, DotBadge } from './style';\n\nconst NotificationBadge = ({\n type,\n value,\n size,\n disabled,\n position,\n Component,\n}: props): JSX.Element => {\n const Badge = type === 'number' ? NumericBadge : DotBadge;\n const relatedComponentRef = useRef(null);\n const renderBadge = relatedComponentRef?.current || !Component;\n const [relatedComponentHeight, setRelatedComponentHeight] = useState(0);\n const [relatedComponentWidth, setRelatedComponentWidth] = useState(0);\n\n useEffect(() => {\n const relatedComponent = relatedComponentRef?.current;\n setRelatedComponentHeight(relatedComponent?.offsetHeight);\n setRelatedComponentWidth(relatedComponent?.offsetWidth);\n }, [relatedComponentRef]);\n\n let top;\n let right;\n let left;\n\n if (Component) {\n if (position === 'right') left = relatedComponentWidth / 2;\n if (position === 'left') right = relatedComponentWidth / 2;\n top = relatedComponentHeight / 2;\n }\n\n return (\n <Wrapper>\n {renderBadge && (\n <Badge\n size={size}\n value={value}\n disabled={disabled}\n top={top}\n left={left}\n right={right}\n >\n {type === 'number' && value}\n </Badge>\n )}\n {Component && <Component innerRef={relatedComponentRef} />}\n </Wrapper>\n );\n};\n\nNotificationBadge.defaultProps = defaultProps;\nNotificationBadge.propTypes = notificationBadgeProps;\nconst NotificationBadgeWithSchema = describe(NotificationBadge);\nNotificationBadgeWithSchema.propTypes = notificationBadgeProps;\n\nexport { NotificationBadge, NotificationBadgeWithSchema };\n"],
5
- "mappings": "AAAA;ACAA;AACA;AACA;AAEA;AAEA,MAAM,oBAAoB,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MACwB;AACxB,QAAM,QAAQ,SAAS,WAAW,eAAe;AACjD,QAAM,sBAAsB,OAAO;AACnC,QAAM,cAAc,qBAAqB,WAAW,CAAC;AACrD,QAAM,CAAC,wBAAwB,6BAA6B,SAAS;AACrE,QAAM,CAAC,uBAAuB,4BAA4B,SAAS;AAEnE,YAAU,MAAM;AACd,UAAM,mBAAmB,qBAAqB;AAC9C,8BAA0B,kBAAkB;AAC5C,6BAAyB,kBAAkB;AAAA,KAC1C,CAAC;AAEJ,MAAI;AACJ,MAAI;AACJ,MAAI;AAEJ,MAAI,WAAW;AACb,QAAI,aAAa;AAAS,aAAO,wBAAwB;AACzD,QAAI,aAAa;AAAQ,cAAQ,wBAAwB;AACzD,UAAM,yBAAyB;AAAA;AAGjC,SACE,qCAAC,SAAD,MACG,eACC,qCAAC,OAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,KAEC,SAAS,YAAY,QAGzB,aAAa,qCAAC,WAAD;AAAA,IAAW,UAAU;AAAA;AAAA;AAKzC,kBAAkB,eAAe;AACjC,kBAAkB,YAAY;AAC9B,MAAM,8BAA8B,SAAS;AAC7C,4BAA4B,YAAY;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useState, useEffect, useRef, WeakValidationMap } from 'react';\nimport {\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n describe,\n useGetGlobalAttributes,\n} from '@elliemae/ds-props-helpers';\n\nimport { NotificationBadgePropTypes, DSNotificationBadgeT, defaultProps } from './react-desc-prop-types';\nimport { Wrapper, NumericBadge, DotBadge } from './style';\n\nconst NotificationBadge: React.ComponentType<DSNotificationBadgeT.Props> = (props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps);\n useValidateTypescriptPropTypes<DSNotificationBadgeT.Props>(propsWithDefaults, NotificationBadgePropTypes);\n const globalAttributes = useGetGlobalAttributes(propsWithDefaults);\n\n const { type, color, value, size, disabled, position, Component } = propsWithDefaults;\n\n const Badge = type === 'number' ? NumericBadge : DotBadge;\n const relatedComponentRef = useRef<HTMLSpanElement>(null);\n const renderBadge = relatedComponentRef?.current || !Component;\n const [relatedComponentHeight, setRelatedComponentHeight] = useState(0);\n const [relatedComponentWidth, setRelatedComponentWidth] = useState(0);\n\n useEffect(() => {\n const relatedComponent = relatedComponentRef?.current;\n setRelatedComponentHeight(relatedComponent?.offsetHeight || 0);\n setRelatedComponentWidth(relatedComponent?.offsetWidth || 0);\n }, [relatedComponentRef]);\n\n let top = 0;\n let right = 0;\n let left = 0;\n\n if (position === 'right') left = relatedComponentWidth / 2;\n if (position === 'left') right = relatedComponentWidth / 2;\n top = relatedComponentHeight / 2;\n\n return (\n <Wrapper {...globalAttributes}>\n {renderBadge && (\n <Badge color={color} size={size} value={value} disabled={disabled} top={top} left={left} right={right}>\n {type === 'number' && value}\n </Badge>\n )}\n {Component && <Component innerRef={relatedComponentRef} />}\n </Wrapper>\n );\n};\n\nNotificationBadge.propTypes = NotificationBadgePropTypes as WeakValidationMap<unknown>;\nconst NotificationBadgeWithSchema = describe(NotificationBadge);\nNotificationBadgeWithSchema.propTypes = NotificationBadgePropTypes as WeakValidationMap<unknown>;\n\nexport { NotificationBadge, NotificationBadgeWithSchema };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AACA;AAEA,MAAM,oBAAqE,CAAC,UAAU;AACpF,QAAM,oBAAoB,6BAA6B,OAAO;AAC9D,iCAA2D,mBAAmB;AAC9E,QAAM,mBAAmB,uBAAuB;AAEhD,QAAM,EAAE,MAAM,OAAO,OAAO,MAAM,UAAU,UAAU,cAAc;AAEpE,QAAM,QAAQ,SAAS,WAAW,eAAe;AACjD,QAAM,sBAAsB,OAAwB;AACpD,QAAM,cAAc,qBAAqB,WAAW,CAAC;AACrD,QAAM,CAAC,wBAAwB,6BAA6B,SAAS;AACrE,QAAM,CAAC,uBAAuB,4BAA4B,SAAS;AAEnE,YAAU,MAAM;AACd,UAAM,mBAAmB,qBAAqB;AAC9C,8BAA0B,kBAAkB,gBAAgB;AAC5D,6BAAyB,kBAAkB,eAAe;AAAA,KACzD,CAAC;AAEJ,MAAI,MAAM;AACV,MAAI,QAAQ;AACZ,MAAI,OAAO;AAEX,MAAI,aAAa;AAAS,WAAO,wBAAwB;AACzD,MAAI,aAAa;AAAQ,YAAQ,wBAAwB;AACzD,QAAM,yBAAyB;AAE/B,SACE,qCAAC,SAAD,mBAAa,mBACV,eACC,qCAAC,OAAD;AAAA,IAAO;AAAA,IAAc;AAAA,IAAY;AAAA,IAAc;AAAA,IAAoB;AAAA,IAAU;AAAA,IAAY;AAAA,KACtF,SAAS,YAAY,QAGzB,aAAa,qCAAC,WAAD;AAAA,IAAW,UAAU;AAAA;AAAA;AAKzC,kBAAkB,YAAY;AAC9B,MAAM,8BAA8B,SAAS;AAC7C,4BAA4B,YAAY;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,44 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import * as React from "react";
21
+ import { PropTypes, globalAttributesPropTypes } from "@elliemae/ds-props-helpers";
22
+ const defaultProps = {
23
+ type: "number",
24
+ size: "s",
25
+ disabled: false,
26
+ position: "right",
27
+ color: void 0,
28
+ Component: void 0,
29
+ value: void 0
30
+ };
31
+ const NotificationBadgePropTypes = __spreadProps(__spreadValues({}, globalAttributesPropTypes), {
32
+ type: PropTypes.oneOf(["number", "dot"]).description("type of badge: number or dot"),
33
+ value: PropTypes.number.description("value of the numeric badge"),
34
+ size: PropTypes.oneOf(["s", "l"]).description("size of the badge: s or l"),
35
+ disabled: PropTypes.bool.description("whether the badge is disabled"),
36
+ position: PropTypes.oneOf(["left", "right"]).description("position of the badge with the related component"),
37
+ Component: PropTypes.func.description("Related component"),
38
+ color: PropTypes.string.description("Badge background color value")
39
+ });
40
+ export {
41
+ NotificationBadgePropTypes,
42
+ defaultProps
43
+ };
44
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes, globalAttributesPropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSNotificationBadgeT {\n interface ComponentT {\n innerRef: React.RefObject<HTMLSpanElement>;\n }\n\n export interface Props {\n [property: string]: unknown;\n type?: string;\n value?: number;\n size?: string;\n disabled?: boolean;\n position?: string;\n Component?: (propsT: ComponentT) => JSX.Element;\n color?: string;\n }\n}\n\nexport const defaultProps: DSNotificationBadgeT.Props = {\n type: 'number',\n size: 's',\n disabled: false,\n position: 'right',\n color: undefined,\n Component: undefined,\n value: undefined,\n};\n\nexport const NotificationBadgePropTypes = {\n ...globalAttributesPropTypes,\n type: PropTypes.oneOf(['number', 'dot']).description('type of badge: number or dot'),\n value: PropTypes.number.description('value of the numeric badge'),\n size: PropTypes.oneOf(['s', 'l']).description('size of the badge: s or l'),\n disabled: PropTypes.bool.description('whether the badge is disabled'),\n position: PropTypes.oneOf(['left', 'right']).description('position of the badge with the related component'),\n Component: PropTypes.func.description('Related component'),\n color: PropTypes.string.description('Badge background color value'),\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACAA;AAmBO,MAAM,eAA2C;AAAA,EACtD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AAAA,EACV,OAAO;AAAA,EACP,WAAW;AAAA,EACX,OAAO;AAAA;AAGF,MAAM,6BAA6B,iCACrC,4BADqC;AAAA,EAExC,MAAM,UAAU,MAAM,CAAC,UAAU,QAAQ,YAAY;AAAA,EACrD,OAAO,UAAU,OAAO,YAAY;AAAA,EACpC,MAAM,UAAU,MAAM,CAAC,KAAK,MAAM,YAAY;AAAA,EAC9C,UAAU,UAAU,KAAK,YAAY;AAAA,EACrC,UAAU,UAAU,MAAM,CAAC,QAAQ,UAAU,YAAY;AAAA,EACzD,WAAW,UAAU,KAAK,YAAY;AAAA,EACtC,OAAO,UAAU,OAAO,YAAY;AAAA;",
6
+ "names": []
7
+ }
package/dist/esm/style.js CHANGED
@@ -19,26 +19,25 @@ const NumericBadge = styled(GenericBadge)`
19
19
  align-items: center;
20
20
  width: fit-content;
21
21
  color: #fff;
22
- padding: ${({ value }) => value > 9 ? "0 5px" : "0"};
22
+ padding: ${({ value }) => value && value > 9 ? "0 5px" : "0"};
23
23
  padding-top: 2px;
24
- background-color: ${({ disabled, theme }) => disabled ? theme.colors.neutral[500] : theme.colors.danger[900]};
25
- border-radius: ${({ value }) => value > 9 ? "10px" : "50%"};
24
+ background-color: ${({ disabled, color, theme }) => disabled ? theme.colors.neutral["500"] : color || theme.colors.danger["900"]};
25
+ border-radius: ${({ value }) => value && value > 9 ? "10px" : "50%"};
26
26
  font-size: ${({ size }) => size === "l" ? "16px" : "12px"};
27
27
  font-weight: ${({ size }) => size === "l" ? "400" : "600"};
28
28
  height: ${({ size }) => size === "l" ? "21px" : "15px"};
29
29
  min-width: ${({ size, value }) => {
30
- if (size === "l" && value > 9)
30
+ if (size === "l" && value && value > 9)
31
31
  return "30px";
32
- if (size === "l" && value <= 9)
32
+ if (size === "l" && value && value <= 9)
33
33
  return "21px";
34
- if (size === "s" && value > 9)
34
+ if (size === "s" && value && value > 9)
35
35
  return "21px";
36
- if (size === "s" && value <= 9)
37
- return "15px";
36
+ return "15px";
38
37
  }};
39
38
  `;
40
39
  const DotBadge = styled(GenericBadge)`
41
- background-color: ${({ disabled, theme }) => disabled ? theme.colors.neutral[500] : theme.colors.brand[500]};
40
+ background-color: ${({ disabled, theme, color }) => disabled ? theme.colors.neutral["500"] : color || theme.colors.brand[500]};
42
41
  width: ${({ size }) => size === "l" ? "15px" : "10px"};
43
42
  height: ${({ size }) => size === "l" ? "15px" : "10px"};
44
43
  border-radius: 100%;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/style.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import styled from 'styled-components';\n\nexport const Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: fit-content;\n`;\n\nexport const GenericBadge = styled.span`\n position: relative;\n top: ${({ top }) => (top ? `${top}px` : 'unset')};\n left: ${({ left }) => (left ? `${left}px` : 'unset')};\n right: ${({ right }) => (right ? `${right}px` : 'unset')};\n`;\n\nexport const NumericBadge = styled(GenericBadge)`\n display: flex;\n justify-content: center;\n align-items: center;\n width: fit-content;\n color: #fff;\n padding: ${({ value }) => (value > 9 ? '0 5px' : '0')};\n padding-top: 2px;\n background-color: ${({ disabled, theme }) =>\n disabled ? theme.colors.neutral[500] : theme.colors.danger[900]};\n border-radius: ${({ value }) => (value > 9 ? '10px' : '50%')};\n font-size: ${({ size }) => (size === 'l' ? '16px' : '12px')};\n font-weight: ${({ size }) => (size === 'l' ? '400' : '600')};\n height: ${({ size }) => (size === 'l' ? '21px' : '15px')};\n min-width: ${({ size, value }) => {\n if (size === 'l' && value > 9) return '30px';\n if (size === 'l' && value <= 9) return '21px';\n if (size === 's' && value > 9) return '21px';\n if (size === 's' && value <= 9) return '15px';\n }};\n`;\n\nexport const DotBadge = styled(GenericBadge)`\n background-color: ${({ disabled, theme }) =>\n disabled ? theme.colors.neutral[500] : theme.colors.brand[500]};\n width: ${({ size }) => (size === 'l' ? '15px' : '10px')};\n height: ${({ size }) => (size === 'l' ? '15px' : '10px')};\n border-radius: 100%;\n`;\n"],
5
- "mappings": "AAAA;ACAA;AAEO,MAAM,UAAU,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQvB,MAAM,eAAe,OAAO;AAAA;AAAA,SAE1B,CAAC,EAAE,UAAW,MAAM,GAAG,UAAU;AAAA,UAChC,CAAC,EAAE,WAAY,OAAO,GAAG,WAAW;AAAA,WACnC,CAAC,EAAE,YAAa,QAAQ,GAAG,YAAY;AAAA;AAG3C,MAAM,eAAe,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAMtB,CAAC,EAAE,YAAa,QAAQ,IAAI,UAAU;AAAA;AAAA,sBAE7B,CAAC,EAAE,UAAU,YAC/B,WAAW,MAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,OAAO;AAAA,mBAC5C,CAAC,EAAE,YAAa,QAAQ,IAAI,SAAS;AAAA,eACzC,CAAC,EAAE,WAAY,SAAS,MAAM,SAAS;AAAA,iBACrC,CAAC,EAAE,WAAY,SAAS,MAAM,QAAQ;AAAA,YAC3C,CAAC,EAAE,WAAY,SAAS,MAAM,SAAS;AAAA,eACpC,CAAC,EAAE,MAAM,YAAY;AAChC,MAAI,SAAS,OAAO,QAAQ;AAAG,WAAO;AACtC,MAAI,SAAS,OAAO,SAAS;AAAG,WAAO;AACvC,MAAI,SAAS,OAAO,QAAQ;AAAG,WAAO;AACtC,MAAI,SAAS,OAAO,SAAS;AAAG,WAAO;AAAA;AAAA;AAIpC,MAAM,WAAW,OAAO;AAAA,sBACT,CAAC,EAAE,UAAU,YAC/B,WAAW,MAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,MAAM;AAAA,WACnD,CAAC,EAAE,WAAY,SAAS,MAAM,SAAS;AAAA,YACtC,CAAC,EAAE,WAAY,SAAS,MAAM,SAAS;AAAA;AAAA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import styled from 'styled-components';\nimport { DSNotificationBadgeT } from './react-desc-prop-types';\n\ninterface StyledGenericBadgeT {\n top: number;\n left: number;\n right: number;\n}\n\nexport const Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: fit-content;\n`;\n\nexport const GenericBadge = styled.span<DSNotificationBadgeT.Props & StyledGenericBadgeT>`\n position: relative;\n top: ${({ top }) => (top ? `${top}px` : 'unset')};\n left: ${({ left }) => (left ? `${left}px` : 'unset')};\n right: ${({ right }) => (right ? `${right}px` : 'unset')};\n`;\n\nexport const NumericBadge = styled(GenericBadge)<{\n top: number;\n left: number;\n right: number;\n size?: string;\n disabled?: boolean;\n value?: number;\n color?: string;\n}>`\n display: flex;\n justify-content: center;\n align-items: center;\n width: fit-content;\n color: #fff;\n padding: ${({ value }) => (value && value > 9 ? '0 5px' : '0')};\n padding-top: 2px;\n background-color: ${({ disabled, color, theme }) =>\n disabled ? theme.colors.neutral['500'] : color || theme.colors.danger['900']};\n border-radius: ${({ value }) => (value && value > 9 ? '10px' : '50%')};\n font-size: ${({ size }) => (size === 'l' ? '16px' : '12px')};\n font-weight: ${({ size }) => (size === 'l' ? '400' : '600')};\n height: ${({ size }) => (size === 'l' ? '21px' : '15px')};\n min-width: ${({ size, value }) => {\n if (size === 'l' && value && value > 9) return '30px';\n if (size === 'l' && value && value <= 9) return '21px';\n if (size === 's' && value && value > 9) return '21px';\n return '15px';\n }};\n`;\n\nexport const DotBadge = styled(GenericBadge)<DSNotificationBadgeT.Props>`\n background-color: ${({ disabled, theme, color }) =>\n disabled ? theme.colors.neutral['500'] : color || theme.colors.brand[500]};\n width: ${({ size }) => (size === 'l' ? '15px' : '10px')};\n height: ${({ size }) => (size === 'l' ? '15px' : '10px')};\n border-radius: 100%;\n`;\n"],
5
+ "mappings": "AAAA;ACAA;AASO,MAAM,UAAU,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQvB,MAAM,eAAe,OAAO;AAAA;AAAA,SAE1B,CAAC,EAAE,UAAW,MAAM,GAAG,UAAU;AAAA,UAChC,CAAC,EAAE,WAAY,OAAO,GAAG,WAAW;AAAA,WACnC,CAAC,EAAE,YAAa,QAAQ,GAAG,YAAY;AAAA;AAG3C,MAAM,eAAe,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aActB,CAAC,EAAE,YAAa,SAAS,QAAQ,IAAI,UAAU;AAAA;AAAA,sBAEtC,CAAC,EAAE,UAAU,OAAO,YACtC,WAAW,MAAM,OAAO,QAAQ,SAAS,SAAS,MAAM,OAAO,OAAO;AAAA,mBACvD,CAAC,EAAE,YAAa,SAAS,QAAQ,IAAI,SAAS;AAAA,eAClD,CAAC,EAAE,WAAY,SAAS,MAAM,SAAS;AAAA,iBACrC,CAAC,EAAE,WAAY,SAAS,MAAM,QAAQ;AAAA,YAC3C,CAAC,EAAE,WAAY,SAAS,MAAM,SAAS;AAAA,eACpC,CAAC,EAAE,MAAM,YAAY;AAChC,MAAI,SAAS,OAAO,SAAS,QAAQ;AAAG,WAAO;AAC/C,MAAI,SAAS,OAAO,SAAS,SAAS;AAAG,WAAO;AAChD,MAAI,SAAS,OAAO,SAAS,QAAQ;AAAG,WAAO;AAC/C,SAAO;AAAA;AAAA;AAIJ,MAAM,WAAW,OAAO;AAAA,sBACT,CAAC,EAAE,UAAU,OAAO,YACtC,WAAW,MAAM,OAAO,QAAQ,SAAS,SAAS,MAAM,OAAO,MAAM;AAAA,WAC9D,CAAC,EAAE,WAAY,SAAS,MAAM,SAAS;AAAA,YACtC,CAAC,EAAE,WAAY,SAAS,MAAM,SAAS;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-notification-badge",
3
- "version": "3.0.0-alpha.0",
3
+ "version": "3.0.0-alpha.1",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Notification Badge",
6
6
  "files": [
@@ -47,6 +47,7 @@
47
47
  "indent": 4
48
48
  },
49
49
  "dependencies": {
50
+ "@elliemae/ds-props-helpers": "3.0.0-alpha.1",
50
51
  "react-desc": "~4.1.3"
51
52
  },
52
53
  "devDependencies": {
@@ -65,6 +66,7 @@
65
66
  "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
66
67
  "test": "node ../../scripts/testing/test.mjs",
67
68
  "lint": "node ../../scripts/lint.mjs",
69
+ "dts": "node ../../scripts/dts.mjs",
68
70
  "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
69
71
  }
70
72
  }
@@ -1,27 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __reExport = (target, module2, copyDefault, desc) => {
9
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
10
- for (let key of __getOwnPropNames(module2))
11
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
12
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
13
- }
14
- return target;
15
- };
16
- var __toESM = (module2, isNodeMode) => {
17
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
18
- };
19
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
- return (module2, temp) => {
21
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
22
- };
23
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
24
- var index_d_exports = {};
25
- var React = __toESM(require("react"));
26
- module.exports = __toCommonJS(index_d_exports);
27
- //# sourceMappingURL=index.d.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.d.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export interface NotificactionBadge {\n type?: string;\n value?: number;\n size?: string;\n disabled?: boolean;\n position?: string;\n Component?: () => JSX.Element;\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA,YAAuB;",
6
- "names": []
7
- }
@@ -1,50 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var prop_types_exports = {};
29
- __export(prop_types_exports, {
30
- defaultProps: () => defaultProps,
31
- notificationBadgeProps: () => notificationBadgeProps
32
- });
33
- var React = __toESM(require("react"));
34
- var import_react_desc = require("react-desc");
35
- const notificationBadgeProps = {
36
- type: import_react_desc.PropTypes.oneOf(["number", "dot"]).description("type of badge: number or dot"),
37
- value: import_react_desc.PropTypes.number.description("value of the numeric badge"),
38
- size: import_react_desc.PropTypes.oneOf(["s", "l"]).description("size of the badge: s or l"),
39
- disabled: import_react_desc.PropTypes.bool.description("whether the badge is disabled"),
40
- position: import_react_desc.PropTypes.oneOf(["left", "right"]).description("position of the badge with the related component"),
41
- Component: import_react_desc.PropTypes.func.description("Related component")
42
- };
43
- const defaultProps = {
44
- type: "number",
45
- size: "s",
46
- disabled: false,
47
- position: "right"
48
- };
49
- module.exports = __toCommonJS(prop_types_exports);
50
- //# sourceMappingURL=prop-types.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/prop-types.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { PropTypes } from 'react-desc';\n\nexport const notificationBadgeProps = {\n type: PropTypes.oneOf(['number', 'dot']).description(\n 'type of badge: number or dot',\n ),\n value: PropTypes.number.description('value of the numeric badge'),\n size: PropTypes.oneOf(['s', 'l']).description('size of the badge: s or l'),\n disabled: PropTypes.bool.description('whether the badge is disabled'),\n position: PropTypes.oneOf(['left', 'right']).description(\n 'position of the badge with the related component',\n ),\n Component: PropTypes.func.description('Related component'),\n};\n\nexport const defaultProps = {\n type: 'number',\n size: 's',\n disabled: false,\n position: 'right',\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAA0B;AAEnB,MAAM,yBAAyB;AAAA,EACpC,MAAM,4BAAU,MAAM,CAAC,UAAU,QAAQ,YACvC;AAAA,EAEF,OAAO,4BAAU,OAAO,YAAY;AAAA,EACpC,MAAM,4BAAU,MAAM,CAAC,KAAK,MAAM,YAAY;AAAA,EAC9C,UAAU,4BAAU,KAAK,YAAY;AAAA,EACrC,UAAU,4BAAU,MAAM,CAAC,QAAQ,UAAU,YAC3C;AAAA,EAEF,WAAW,4BAAU,KAAK,YAAY;AAAA;AAGjC,MAAM,eAAe;AAAA,EAC1B,MAAM;AAAA,EACN,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AAAA;",
6
- "names": []
7
- }
@@ -1,2 +0,0 @@
1
- import * as React from "react";
2
- //# sourceMappingURL=index.d.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n"],
5
- "mappings": "AAAA;",
6
- "names": []
7
- }
@@ -1,21 +0,0 @@
1
- import * as React from "react";
2
- import { PropTypes } from "react-desc";
3
- const notificationBadgeProps = {
4
- type: PropTypes.oneOf(["number", "dot"]).description("type of badge: number or dot"),
5
- value: PropTypes.number.description("value of the numeric badge"),
6
- size: PropTypes.oneOf(["s", "l"]).description("size of the badge: s or l"),
7
- disabled: PropTypes.bool.description("whether the badge is disabled"),
8
- position: PropTypes.oneOf(["left", "right"]).description("position of the badge with the related component"),
9
- Component: PropTypes.func.description("Related component")
10
- };
11
- const defaultProps = {
12
- type: "number",
13
- size: "s",
14
- disabled: false,
15
- position: "right"
16
- };
17
- export {
18
- defaultProps,
19
- notificationBadgeProps
20
- };
21
- //# sourceMappingURL=prop-types.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/prop-types.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from 'react-desc';\n\nexport const notificationBadgeProps = {\n type: PropTypes.oneOf(['number', 'dot']).description(\n 'type of badge: number or dot',\n ),\n value: PropTypes.number.description('value of the numeric badge'),\n size: PropTypes.oneOf(['s', 'l']).description('size of the badge: s or l'),\n disabled: PropTypes.bool.description('whether the badge is disabled'),\n position: PropTypes.oneOf(['left', 'right']).description(\n 'position of the badge with the related component',\n ),\n Component: PropTypes.func.description('Related component'),\n};\n\nexport const defaultProps = {\n type: 'number',\n size: 's',\n disabled: false,\n position: 'right',\n};\n"],
5
- "mappings": "AAAA;ACAA;AAEO,MAAM,yBAAyB;AAAA,EACpC,MAAM,UAAU,MAAM,CAAC,UAAU,QAAQ,YACvC;AAAA,EAEF,OAAO,UAAU,OAAO,YAAY;AAAA,EACpC,MAAM,UAAU,MAAM,CAAC,KAAK,MAAM,YAAY;AAAA,EAC9C,UAAU,UAAU,KAAK,YAAY;AAAA,EACrC,UAAU,UAAU,MAAM,CAAC,QAAQ,UAAU,YAC3C;AAAA,EAEF,WAAW,UAAU,KAAK,YAAY;AAAA;AAGjC,MAAM,eAAe;AAAA,EAC1B,MAAM;AAAA,EACN,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AAAA;",
6
- "names": []
7
- }
@@ -1,56 +0,0 @@
1
- /// <reference path="../../../../shared/typings/react-desc.d.ts" />
2
- /// <reference types="react" />
3
- import { NotificactionBadge as props } from './index.d';
4
- declare const NotificationBadge: {
5
- ({ type, value, size, disabled, position, Component, }: props): JSX.Element;
6
- defaultProps: {
7
- type: string;
8
- size: string;
9
- disabled: boolean;
10
- position: string;
11
- };
12
- propTypes: {
13
- type: {
14
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
15
- deprecated: import("react-desc").PropTypesDescValidator;
16
- };
17
- isRequired: import("react-desc").PropTypesDescValue;
18
- };
19
- value: {
20
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
21
- deprecated: import("react-desc").PropTypesDescValidator;
22
- };
23
- isRequired: import("react-desc").PropTypesDescValue;
24
- };
25
- size: {
26
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
27
- deprecated: import("react-desc").PropTypesDescValidator;
28
- };
29
- isRequired: import("react-desc").PropTypesDescValue;
30
- };
31
- disabled: {
32
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
33
- deprecated: import("react-desc").PropTypesDescValidator;
34
- };
35
- isRequired: import("react-desc").PropTypesDescValue;
36
- };
37
- position: {
38
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
39
- deprecated: import("react-desc").PropTypesDescValidator;
40
- };
41
- isRequired: import("react-desc").PropTypesDescValue;
42
- };
43
- Component: {
44
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
45
- deprecated: import("react-desc").PropTypesDescValidator;
46
- };
47
- isRequired: import("react-desc").PropTypesDescValue;
48
- };
49
- };
50
- };
51
- declare const NotificationBadgeWithSchema: {
52
- (props?: unknown): JSX.Element;
53
- propTypes: unknown;
54
- toTypescript: () => import("react-desc").TypescriptSchema;
55
- };
56
- export { NotificationBadge, NotificationBadgeWithSchema };
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- export interface NotificactionBadge {
3
- type?: string;
4
- value?: number;
5
- size?: string;
6
- disabled?: boolean;
7
- position?: string;
8
- Component?: () => JSX.Element;
9
- }
@@ -1,2 +0,0 @@
1
- export * from './NotificationBadge';
2
- export { NotificationBadge as default } from './NotificationBadge';
@@ -1,45 +0,0 @@
1
- /// <reference path="../../../../shared/typings/react-desc.d.ts" />
2
- export declare const notificationBadgeProps: {
3
- type: {
4
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
5
- deprecated: import("react-desc").PropTypesDescValidator;
6
- };
7
- isRequired: import("react-desc").PropTypesDescValue;
8
- };
9
- value: {
10
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
11
- deprecated: import("react-desc").PropTypesDescValidator;
12
- };
13
- isRequired: import("react-desc").PropTypesDescValue;
14
- };
15
- size: {
16
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
17
- deprecated: import("react-desc").PropTypesDescValidator;
18
- };
19
- isRequired: import("react-desc").PropTypesDescValue;
20
- };
21
- disabled: {
22
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
23
- deprecated: import("react-desc").PropTypesDescValidator;
24
- };
25
- isRequired: import("react-desc").PropTypesDescValue;
26
- };
27
- position: {
28
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
29
- deprecated: import("react-desc").PropTypesDescValidator;
30
- };
31
- isRequired: import("react-desc").PropTypesDescValue;
32
- };
33
- Component: {
34
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
35
- deprecated: import("react-desc").PropTypesDescValidator;
36
- };
37
- isRequired: import("react-desc").PropTypesDescValue;
38
- };
39
- };
40
- export declare const defaultProps: {
41
- type: string;
42
- size: string;
43
- disabled: boolean;
44
- position: string;
45
- };
@@ -1,4 +0,0 @@
1
- export declare const Wrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
- export declare const GenericBadge: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
3
- export declare const NumericBadge: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
4
- export declare const DotBadge: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;