@elliemae/ds-notification-badge 2.3.0-next.0 → 2.3.0-next.4

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,26 +2,42 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
5
6
  var _jsx = require('@babel/runtime/helpers/jsx');
6
7
  require('core-js/modules/web.dom-collections.iterator.js');
8
+ require('core-js/modules/esnext.async-iterator.filter.js');
9
+ require('core-js/modules/esnext.iterator.constructor.js');
10
+ require('core-js/modules/esnext.iterator.filter.js');
11
+ require('core-js/modules/esnext.async-iterator.for-each.js');
12
+ require('core-js/modules/esnext.iterator.for-each.js');
7
13
  var react = require('react');
8
- var reactDesc = require('react-desc');
9
- var propTypes = require('./prop-types.js');
14
+ var dsPropsHelpers = require('@elliemae/ds-props-helpers');
15
+ var reactDescPropTypes = require('./react-desc-prop-types.js');
10
16
  var style = require('./style.js');
17
+ var jsxRuntime = require('react/jsx-runtime');
11
18
 
12
19
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
20
 
21
+ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
14
22
  var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
15
23
 
16
- const NotificationBadge = _ref => {
17
- let {
24
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
25
+
26
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
27
+
28
+ const NotificationBadge = props => {
29
+ const propsWithDefaults = dsPropsHelpers.useMemoMergePropsWithDefault(props, reactDescPropTypes.defaultProps);
30
+ dsPropsHelpers.useValidateTypescriptPropTypes(propsWithDefaults, reactDescPropTypes.NotificationBadgePropTypes);
31
+ const globalAttributes = dsPropsHelpers.useGetGlobalAttributes(propsWithDefaults);
32
+ const {
18
33
  type,
34
+ color,
19
35
  value,
20
36
  size,
21
37
  disabled,
22
38
  position,
23
39
  Component
24
- } = _ref;
40
+ } = propsWithDefaults;
25
41
  const Badge = type === 'number' ? style.NumericBadge : style.DotBadge;
26
42
  const relatedComponentRef = react.useRef(null);
27
43
  const renderBadge = (relatedComponentRef === null || relatedComponentRef === void 0 ? void 0 : relatedComponentRef.current) || !Component;
@@ -29,34 +45,32 @@ const NotificationBadge = _ref => {
29
45
  const [relatedComponentWidth, setRelatedComponentWidth] = react.useState(0);
30
46
  react.useEffect(() => {
31
47
  const relatedComponent = relatedComponentRef === null || relatedComponentRef === void 0 ? void 0 : relatedComponentRef.current;
32
- setRelatedComponentHeight(relatedComponent === null || relatedComponent === void 0 ? void 0 : relatedComponent.offsetHeight);
33
- setRelatedComponentWidth(relatedComponent === null || relatedComponent === void 0 ? void 0 : relatedComponent.offsetWidth);
48
+ setRelatedComponentHeight((relatedComponent === null || relatedComponent === void 0 ? void 0 : relatedComponent.offsetHeight) || 0);
49
+ setRelatedComponentWidth((relatedComponent === null || relatedComponent === void 0 ? void 0 : relatedComponent.offsetWidth) || 0);
34
50
  }, [relatedComponentRef]);
35
- let top;
36
- let right;
37
- let left;
38
-
39
- if (Component) {
40
- if (position === 'right') left = relatedComponentWidth / 2;
41
- if (position === 'left') right = relatedComponentWidth / 2;
42
- top = relatedComponentHeight / 2;
43
- }
44
-
45
- return /*#__PURE__*/_jsx__default["default"](style.Wrapper, {}, void 0, renderBadge && /*#__PURE__*/_jsx__default["default"](Badge, {
46
- size: size,
47
- value: value,
48
- disabled: disabled,
49
- top: top,
50
- left: left,
51
- right: right
52
- }, void 0, type === 'number' && value), Component && /*#__PURE__*/_jsx__default["default"](Component, {
53
- innerRef: relatedComponentRef
51
+ let top = 0;
52
+ let right = 0;
53
+ let left = 0;
54
+ if (position === 'right') left = relatedComponentWidth / 2;
55
+ if (position === 'left') right = relatedComponentWidth / 2;
56
+ top = relatedComponentHeight / 2;
57
+ return /*#__PURE__*/jsxRuntime.jsxs(style.Wrapper, _objectSpread(_objectSpread({}, globalAttributes), {}, {
58
+ children: [renderBadge && /*#__PURE__*/_jsx__default["default"](Badge, {
59
+ color: color,
60
+ size: size,
61
+ value: value,
62
+ disabled: disabled,
63
+ top: top,
64
+ left: left,
65
+ right: right
66
+ }, void 0, type === 'number' && value), Component && /*#__PURE__*/_jsx__default["default"](Component, {
67
+ innerRef: relatedComponentRef
68
+ })]
54
69
  }));
55
70
  };
56
71
 
57
- NotificationBadge.defaultProps = propTypes.defaultProps;
58
- const NotificationBadgeWithSchema = reactDesc.describe(NotificationBadge);
59
- NotificationBadgeWithSchema.propTypes = propTypes.notificationBadgeProps;
72
+ const NotificationBadgeWithSchema = dsPropsHelpers.describe(NotificationBadge);
73
+ NotificationBadgeWithSchema.propTypes = reactDescPropTypes.NotificationBadgePropTypes;
60
74
 
61
75
  exports.NotificationBadge = NotificationBadge;
62
76
  exports.NotificationBadgeWithSchema = NotificationBadgeWithSchema;
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ require('core-js/modules/esnext.async-iterator.filter.js');
6
+ require('core-js/modules/esnext.iterator.constructor.js');
7
+ require('core-js/modules/esnext.iterator.filter.js');
8
+ require('core-js/modules/esnext.async-iterator.for-each.js');
9
+ require('core-js/modules/esnext.iterator.for-each.js');
10
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
11
+ var dsPropsHelpers = require('@elliemae/ds-props-helpers');
12
+
13
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
+
15
+ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
16
+
17
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
18
+
19
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
20
+ const defaultProps = {
21
+ type: 'number',
22
+ size: 's',
23
+ disabled: false,
24
+ position: 'right',
25
+ color: undefined,
26
+ Component: undefined,
27
+ value: undefined
28
+ };
29
+ const NotificationBadgePropTypes = _objectSpread(_objectSpread({}, dsPropsHelpers.globalAttributesPropTypes), {}, {
30
+ type: dsPropsHelpers.PropTypes.oneOf(['number', 'dot']).description('type of badge: number or dot'),
31
+ value: dsPropsHelpers.PropTypes.number.description('value of the numeric badge'),
32
+ size: dsPropsHelpers.PropTypes.oneOf(['s', 'l']).description('size of the badge: s or l'),
33
+ disabled: dsPropsHelpers.PropTypes.bool.description('whether the badge is disabled'),
34
+ position: dsPropsHelpers.PropTypes.oneOf(['left', 'right']).description('position of the badge with the related component'),
35
+ Component: dsPropsHelpers.PropTypes.func.description('Related component'),
36
+ color: dsPropsHelpers.PropTypes.string.description('Badge background color value')
37
+ });
38
+
39
+ exports.NotificationBadgePropTypes = NotificationBadgePropTypes;
40
+ exports.defaultProps = defaultProps;
package/cjs/style.js CHANGED
@@ -35,18 +35,19 @@ const NumericBadge = /*#__PURE__*/styled__default["default"](GenericBadge).withC
35
35
  let {
36
36
  value
37
37
  } = _ref4;
38
- return value > 9 ? '0 5px' : '0';
38
+ return value && value > 9 ? '0 5px' : '0';
39
39
  }, _ref5 => {
40
40
  let {
41
41
  disabled,
42
+ color,
42
43
  theme
43
44
  } = _ref5;
44
- return disabled ? theme.colors.neutral[500] : theme.colors.danger[900];
45
+ return disabled ? theme.colors.neutral['500'] : color || theme.colors.danger['900'];
45
46
  }, _ref6 => {
46
47
  let {
47
48
  value
48
49
  } = _ref6;
49
- return value > 9 ? '10px' : '50%';
50
+ return value && value > 9 ? '10px' : '50%';
50
51
  }, _ref7 => {
51
52
  let {
52
53
  size
@@ -67,19 +68,20 @@ const NumericBadge = /*#__PURE__*/styled__default["default"](GenericBadge).withC
67
68
  size,
68
69
  value
69
70
  } = _ref10;
70
- if (size === 'l' && value > 9) return '30px';
71
- if (size === 'l' && value <= 9) return '21px';
72
- if (size === 's' && value > 9) return '21px';
73
- if (size === 's' && value <= 9) return '15px';
71
+ if (size === 'l' && value && value > 9) return '30px';
72
+ if (size === 'l' && value && value <= 9) return '21px';
73
+ if (size === 's' && value && value > 9) return '21px';
74
+ return '15px';
74
75
  });
75
76
  const DotBadge = /*#__PURE__*/styled__default["default"](GenericBadge).withConfig({
76
77
  componentId: "sc-lsxuo6-3"
77
78
  })(["background-color:", ";width:", ";height:", ";border-radius:100%;"], _ref11 => {
78
79
  let {
79
80
  disabled,
80
- theme
81
+ theme,
82
+ color
81
83
  } = _ref11;
82
- return disabled ? theme.colors.neutral[500] : theme.colors.brand[500];
84
+ return disabled ? theme.colors.neutral['500'] : color || theme.colors.danger['900'];
83
85
  }, _ref12 => {
84
86
  let {
85
87
  size
@@ -1,19 +1,34 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
6
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
1
7
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
8
  import 'core-js/modules/web.dom-collections.iterator.js';
3
9
  import { useRef, useState, useEffect } from 'react';
4
- import { describe } from 'react-desc';
5
- import { notificationBadgeProps, defaultProps } from './prop-types.js';
10
+ import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, useGetGlobalAttributes } from '@elliemae/ds-props-helpers';
11
+ import { NotificationBadgePropTypes, defaultProps } from './react-desc-prop-types.js';
6
12
  import { Wrapper, NumericBadge, DotBadge } from './style.js';
13
+ import { jsxs } from 'react/jsx-runtime';
7
14
 
8
- const NotificationBadge = _ref => {
9
- let {
15
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16
+
17
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18
+
19
+ const NotificationBadge = props => {
20
+ const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps);
21
+ useValidateTypescriptPropTypes(propsWithDefaults, NotificationBadgePropTypes);
22
+ const globalAttributes = useGetGlobalAttributes(propsWithDefaults);
23
+ const {
10
24
  type,
25
+ color,
11
26
  value,
12
27
  size,
13
28
  disabled,
14
29
  position,
15
30
  Component
16
- } = _ref;
31
+ } = propsWithDefaults;
17
32
  const Badge = type === 'number' ? NumericBadge : DotBadge;
18
33
  const relatedComponentRef = useRef(null);
19
34
  const renderBadge = (relatedComponentRef === null || relatedComponentRef === void 0 ? void 0 : relatedComponentRef.current) || !Component;
@@ -21,33 +36,31 @@ const NotificationBadge = _ref => {
21
36
  const [relatedComponentWidth, setRelatedComponentWidth] = useState(0);
22
37
  useEffect(() => {
23
38
  const relatedComponent = relatedComponentRef === null || relatedComponentRef === void 0 ? void 0 : relatedComponentRef.current;
24
- setRelatedComponentHeight(relatedComponent === null || relatedComponent === void 0 ? void 0 : relatedComponent.offsetHeight);
25
- setRelatedComponentWidth(relatedComponent === null || relatedComponent === void 0 ? void 0 : relatedComponent.offsetWidth);
39
+ setRelatedComponentHeight((relatedComponent === null || relatedComponent === void 0 ? void 0 : relatedComponent.offsetHeight) || 0);
40
+ setRelatedComponentWidth((relatedComponent === null || relatedComponent === void 0 ? void 0 : relatedComponent.offsetWidth) || 0);
26
41
  }, [relatedComponentRef]);
27
- let top;
28
- let right;
29
- let left;
30
-
31
- if (Component) {
32
- if (position === 'right') left = relatedComponentWidth / 2;
33
- if (position === 'left') right = relatedComponentWidth / 2;
34
- top = relatedComponentHeight / 2;
35
- }
36
-
37
- return /*#__PURE__*/_jsx(Wrapper, {}, void 0, renderBadge && /*#__PURE__*/_jsx(Badge, {
38
- size: size,
39
- value: value,
40
- disabled: disabled,
41
- top: top,
42
- left: left,
43
- right: right
44
- }, void 0, type === 'number' && value), Component && /*#__PURE__*/_jsx(Component, {
45
- innerRef: relatedComponentRef
42
+ let top = 0;
43
+ let right = 0;
44
+ let left = 0;
45
+ if (position === 'right') left = relatedComponentWidth / 2;
46
+ if (position === 'left') right = relatedComponentWidth / 2;
47
+ top = relatedComponentHeight / 2;
48
+ return /*#__PURE__*/jsxs(Wrapper, _objectSpread(_objectSpread({}, globalAttributes), {}, {
49
+ children: [renderBadge && /*#__PURE__*/_jsx(Badge, {
50
+ color: color,
51
+ size: size,
52
+ value: value,
53
+ disabled: disabled,
54
+ top: top,
55
+ left: left,
56
+ right: right
57
+ }, void 0, type === 'number' && value), Component && /*#__PURE__*/_jsx(Component, {
58
+ innerRef: relatedComponentRef
59
+ })]
46
60
  }));
47
61
  };
48
62
 
49
- NotificationBadge.defaultProps = defaultProps;
50
63
  const NotificationBadgeWithSchema = describe(NotificationBadge);
51
- NotificationBadgeWithSchema.propTypes = notificationBadgeProps;
64
+ NotificationBadgeWithSchema.propTypes = NotificationBadgePropTypes;
52
65
 
53
66
  export { NotificationBadge, NotificationBadgeWithSchema };
@@ -0,0 +1,31 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
6
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
7
+ import { PropTypes, globalAttributesPropTypes } from '@elliemae/ds-props-helpers';
8
+
9
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
+
11
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
12
+ const defaultProps = {
13
+ type: 'number',
14
+ size: 's',
15
+ disabled: false,
16
+ position: 'right',
17
+ color: undefined,
18
+ Component: undefined,
19
+ value: undefined
20
+ };
21
+ const NotificationBadgePropTypes = _objectSpread(_objectSpread({}, globalAttributesPropTypes), {}, {
22
+ type: PropTypes.oneOf(['number', 'dot']).description('type of badge: number or dot'),
23
+ value: PropTypes.number.description('value of the numeric badge'),
24
+ size: PropTypes.oneOf(['s', 'l']).description('size of the badge: s or l'),
25
+ disabled: PropTypes.bool.description('whether the badge is disabled'),
26
+ position: PropTypes.oneOf(['left', 'right']).description('position of the badge with the related component'),
27
+ Component: PropTypes.func.description('Related component'),
28
+ color: PropTypes.string.description('Badge background color value')
29
+ });
30
+
31
+ export { NotificationBadgePropTypes, defaultProps };
package/esm/style.js CHANGED
@@ -27,18 +27,19 @@ const NumericBadge = /*#__PURE__*/styled(GenericBadge).withConfig({
27
27
  let {
28
28
  value
29
29
  } = _ref4;
30
- return value > 9 ? '0 5px' : '0';
30
+ return value && value > 9 ? '0 5px' : '0';
31
31
  }, _ref5 => {
32
32
  let {
33
33
  disabled,
34
+ color,
34
35
  theme
35
36
  } = _ref5;
36
- return disabled ? theme.colors.neutral[500] : theme.colors.danger[900];
37
+ return disabled ? theme.colors.neutral['500'] : color || theme.colors.danger['900'];
37
38
  }, _ref6 => {
38
39
  let {
39
40
  value
40
41
  } = _ref6;
41
- return value > 9 ? '10px' : '50%';
42
+ return value && value > 9 ? '10px' : '50%';
42
43
  }, _ref7 => {
43
44
  let {
44
45
  size
@@ -59,19 +60,20 @@ const NumericBadge = /*#__PURE__*/styled(GenericBadge).withConfig({
59
60
  size,
60
61
  value
61
62
  } = _ref10;
62
- if (size === 'l' && value > 9) return '30px';
63
- if (size === 'l' && value <= 9) return '21px';
64
- if (size === 's' && value > 9) return '21px';
65
- if (size === 's' && value <= 9) return '15px';
63
+ if (size === 'l' && value && value > 9) return '30px';
64
+ if (size === 'l' && value && value <= 9) return '21px';
65
+ if (size === 's' && value && value > 9) return '21px';
66
+ return '15px';
66
67
  });
67
68
  const DotBadge = /*#__PURE__*/styled(GenericBadge).withConfig({
68
69
  componentId: "sc-lsxuo6-3"
69
70
  })(["background-color:", ";width:", ";height:", ";border-radius:100%;"], _ref11 => {
70
71
  let {
71
72
  disabled,
72
- theme
73
+ theme,
74
+ color
73
75
  } = _ref11;
74
- return disabled ? theme.colors.neutral[500] : theme.colors.brand[500];
76
+ return disabled ? theme.colors.neutral['500'] : color || theme.colors.danger['900'];
75
77
  }, _ref12 => {
76
78
  let {
77
79
  size
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-notification-badge",
3
- "version": "2.3.0-next.0",
3
+ "version": "2.3.0-next.4",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Notification Badge",
6
6
  "module": "./esm/index.js",
@@ -15,9 +15,9 @@
15
15
  "import": "./esm/style.js",
16
16
  "require": "./cjs/style.js"
17
17
  },
18
- "./prop-types": {
19
- "import": "./esm/prop-types.js",
20
- "require": "./cjs/prop-types.js"
18
+ "./react-desc-prop-types": {
19
+ "import": "./esm/react-desc-prop-types.js",
20
+ "require": "./cjs/react-desc-prop-types.js"
21
21
  },
22
22
  "./NotificationBadge": {
23
23
  "import": "./esm/NotificationBadge.js",
@@ -1,56 +1,5 @@
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
- };
1
+ import React from 'react';
2
+ import { DSNotificationBadgeT } from './react-desc-prop-types';
3
+ declare const NotificationBadge: React.ComponentType<DSNotificationBadgeT.Props>;
4
+ declare const NotificationBadgeWithSchema: import("@elliemae/ds-props-helpers/types/propTypes/types").DocumentedReactComponent<DSNotificationBadgeT.Props>;
56
5
  export { NotificationBadge, NotificationBadgeWithSchema };
@@ -0,0 +1,382 @@
1
+ /// <reference types="react" />
2
+ export declare namespace DSNotificationBadgeT {
3
+ interface ComponentT {
4
+ innerRef: React.RefObject<HTMLSpanElement>;
5
+ }
6
+ interface Props {
7
+ [property: string]: unknown;
8
+ type?: string;
9
+ value?: number;
10
+ size?: string;
11
+ disabled?: boolean;
12
+ position?: string;
13
+ Component?: (propsT: ComponentT) => JSX.Element;
14
+ color?: string;
15
+ }
16
+ }
17
+ export declare const defaultProps: DSNotificationBadgeT.Props;
18
+ export declare const NotificationBadgePropTypes: {
19
+ type: import("@elliemae/ds-props-helpers/types/propTypes/types").ReactDescT;
20
+ value: import("@elliemae/ds-props-helpers/types/propTypes/types").ReactDescT;
21
+ size: import("@elliemae/ds-props-helpers/types/propTypes/types").ReactDescT;
22
+ disabled: import("@elliemae/ds-props-helpers/types/propTypes/types").ReactDescT;
23
+ position: import("@elliemae/ds-props-helpers/types/propTypes/types").ReactDescT;
24
+ Component: import("@elliemae/ds-props-helpers/types/propTypes/types").ReactDescT;
25
+ color: import("@elliemae/ds-props-helpers/types/propTypes/types").ReactDescT;
26
+ 'aria-*': any;
27
+ 'on-*': any;
28
+ 'data-*': any;
29
+ 'all HTML attributes': any;
30
+ about: any;
31
+ accept: any;
32
+ acceptCharset: any;
33
+ accessKey: any;
34
+ action: any;
35
+ allowFullScreen: any;
36
+ allowTransparency: any;
37
+ alt: any;
38
+ 'aria-activedescendant': any;
39
+ 'aria-atomic': any;
40
+ 'aria-autocomplete': any;
41
+ 'aria-busy': any;
42
+ 'aria-checked': any;
43
+ 'aria-colcount': any;
44
+ 'aria-colindex': any;
45
+ 'aria-colspan': any;
46
+ 'aria-controls': any;
47
+ 'aria-current': any;
48
+ 'aria-describedby': any;
49
+ 'aria-details': any;
50
+ 'aria-disabled': any;
51
+ 'aria-dropeffect': any;
52
+ 'aria-errormessage': any;
53
+ 'aria-expanded': any;
54
+ 'aria-flowto': any;
55
+ 'aria-grabbed': any;
56
+ 'aria-haspopup': any;
57
+ 'aria-hidden': any;
58
+ 'aria-invalid': any;
59
+ 'aria-keyshortcuts': any;
60
+ 'aria-label': any;
61
+ 'aria-labelledby': any;
62
+ 'aria-level': any;
63
+ 'aria-live': any;
64
+ 'aria-modal': any;
65
+ 'aria-multiline': any;
66
+ 'aria-multiselectable': any;
67
+ 'aria-orientation': any;
68
+ 'aria-owns': any;
69
+ 'aria-placeholder': any;
70
+ 'aria-posinset': any;
71
+ 'aria-pressed': any;
72
+ 'aria-readonly': any;
73
+ 'aria-relevant': any;
74
+ 'aria-required': any;
75
+ 'aria-roledescription': any;
76
+ 'aria-rowcount': any;
77
+ 'aria-rowindex': any;
78
+ 'aria-rowspan': any;
79
+ 'aria-selected': any;
80
+ 'aria-setsize': any;
81
+ 'aria-sort': any;
82
+ 'aria-valuemax': any;
83
+ 'aria-valuemin': any;
84
+ 'aria-valuenow': any;
85
+ 'aria-valuetext': any;
86
+ as: any;
87
+ async: any;
88
+ autoCapitalize: any;
89
+ autoComplete: any;
90
+ autoCorrect: any;
91
+ autoFocus: any;
92
+ autoPlay: any;
93
+ autoSave: any;
94
+ capture: any;
95
+ cellPadding: any;
96
+ cellSpacing: any;
97
+ challenge: any;
98
+ charSet: any;
99
+ checked: any;
100
+ cite: any;
101
+ classID: any;
102
+ className: any;
103
+ cols: any;
104
+ colSpan: any;
105
+ content: any;
106
+ contentEditable: any;
107
+ contextMenu: any;
108
+ controls: any;
109
+ coords: any;
110
+ crossOrigin: any;
111
+ data: any;
112
+ datatype: any;
113
+ dateTime: any;
114
+ default: any;
115
+ defaultChecked: any;
116
+ defaultValue: any;
117
+ defer: any;
118
+ dir: any;
119
+ download: any;
120
+ draggable: any;
121
+ encType: any;
122
+ form: any;
123
+ formAction: any;
124
+ formEncType: any;
125
+ formMethod: any;
126
+ formNoValidate: any;
127
+ formTarget: any;
128
+ frameBorder: any;
129
+ headers: any;
130
+ height: any;
131
+ hidden: any;
132
+ high: any;
133
+ href: any;
134
+ hrefLang: any;
135
+ htmlFor: any;
136
+ httpEquiv: any;
137
+ id: any;
138
+ inlist: any;
139
+ inputMode: any;
140
+ integrity: any;
141
+ is: any;
142
+ itemID: any;
143
+ itemProp: any;
144
+ itemRef: any;
145
+ itemScope: any;
146
+ itemType: any;
147
+ keyParams: any;
148
+ keyType: any;
149
+ kind: any;
150
+ label: any;
151
+ lang: any;
152
+ list: any;
153
+ loop: any;
154
+ low: any;
155
+ manifest: any;
156
+ marginHeight: any;
157
+ marginWidth: any;
158
+ max: any;
159
+ maxLength: any;
160
+ media: any;
161
+ mediaGroup: any;
162
+ method: any;
163
+ min: any;
164
+ minLength: any;
165
+ multiple: any;
166
+ muted: any;
167
+ name: any;
168
+ nonce: any;
169
+ noValidate: any;
170
+ onAbort: any;
171
+ onAbortCapture: any;
172
+ onAnimationEnd: any;
173
+ onAnimationEndCapture: any;
174
+ onAnimationIteration: any;
175
+ onAnimationIterationCapture: any;
176
+ onAnimationStart: any;
177
+ onAnimationStartCapture: any;
178
+ onAuxClick: any;
179
+ onAuxClickCapture: any;
180
+ onBeforeInput: any;
181
+ onBeforeInputCapture: any;
182
+ onBlur: any;
183
+ onBlurCapture: any;
184
+ onCanPlay: any;
185
+ onCanPlayCapture: any;
186
+ onCanPlayThrough: any;
187
+ onCanPlayThroughCapture: any;
188
+ onChange: any;
189
+ onChangeCapture: any;
190
+ onClick: any;
191
+ onClickCapture: any;
192
+ onCompositionEnd: any;
193
+ onCompositionEndCapture: any;
194
+ onCompositionStart: any;
195
+ onCompositionStartCapture: any;
196
+ onCompositionUpdate: any;
197
+ onCompositionUpdateCapture: any;
198
+ onContextMenu: any;
199
+ onContextMenuCapture: any;
200
+ onCopy: any;
201
+ onCopyCapture: any;
202
+ onCut: any;
203
+ onCutCapture: any;
204
+ onDoubleClick: any;
205
+ onDoubleClickCapture: any;
206
+ onDrag: any;
207
+ onDragCapture: any;
208
+ onDragEnd: any;
209
+ onDragEndCapture: any;
210
+ onDragEnter: any;
211
+ onDragEnterCapture: any;
212
+ onDragExit: any;
213
+ onDragExitCapture: any;
214
+ onDragLeave: any;
215
+ onDragLeaveCapture: any;
216
+ onDragOver: any;
217
+ onDragOverCapture: any;
218
+ onDragStart: any;
219
+ onDragStartCapture: any;
220
+ onDrop: any;
221
+ onDropCapture: any;
222
+ onDurationChange: any;
223
+ onDurationChangeCapture: any;
224
+ onEmptied: any;
225
+ onEmptiedCapture: any;
226
+ onEncrypted: any;
227
+ onEncryptedCapture: any;
228
+ onEnded: any;
229
+ onEndedCapture: any;
230
+ onError: any;
231
+ onErrorCapture: any;
232
+ onFocus: any;
233
+ onFocusCapture: any;
234
+ onGotPointerCapture: any;
235
+ onGotPointerCaptureCapture: any;
236
+ onInput: any;
237
+ onInputCapture: any;
238
+ onInvalid: any;
239
+ onInvalidCapture: any;
240
+ onKeyDown: any;
241
+ onKeyDownCapture: any;
242
+ onKeyPress: any;
243
+ onKeyPressCapture: any;
244
+ onKeyUp: any;
245
+ onKeyUpCapture: any;
246
+ onLoad: any;
247
+ onLoadCapture: any;
248
+ onLoadedData: any;
249
+ onLoadedDataCapture: any;
250
+ onLoadedMetadata: any;
251
+ onLoadedMetadataCapture: any;
252
+ onLoadStart: any;
253
+ onLoadStartCapture: any;
254
+ onLostPointerCapture: any;
255
+ onLostPointerCaptureCapture: any;
256
+ onMouseDown: any;
257
+ onMouseDownCapture: any;
258
+ onMouseEnter: any;
259
+ onMouseLeave: any;
260
+ onMouseMove: any;
261
+ onMouseMoveCapture: any;
262
+ onMouseOut: any;
263
+ onMouseOutCapture: any;
264
+ onMouseOver: any;
265
+ onMouseOverCapture: any;
266
+ onMouseUp: any;
267
+ onMouseUpCapture: any;
268
+ onPaste: any;
269
+ onPasteCapture: any;
270
+ onPause: any;
271
+ onPauseCapture: any;
272
+ onPlay: any;
273
+ onPlayCapture: any;
274
+ onPlaying: any;
275
+ onPlayingCapture: any;
276
+ onPointerCancel: any;
277
+ onPointerCancelCapture: any;
278
+ onPointerDown: any;
279
+ onPointerDownCapture: any;
280
+ onPointerEnter: any;
281
+ onPointerEnterCapture: any;
282
+ onPointerLeave: any;
283
+ onPointerLeaveCapture: any;
284
+ onPointerMove: any;
285
+ onPointerMoveCapture: any;
286
+ onPointerOut: any;
287
+ onPointerOutCapture: any;
288
+ onPointerOver: any;
289
+ onPointerOverCapture: any;
290
+ onPointerUp: any;
291
+ onPointerUpCapture: any;
292
+ onProgress: any;
293
+ onProgressCapture: any;
294
+ onRateChange: any;
295
+ onRateChangeCapture: any;
296
+ onReset: any;
297
+ onResetCapture: any;
298
+ onScroll: any;
299
+ onScrollCapture: any;
300
+ onSeeked: any;
301
+ onSeekedCapture: any;
302
+ onSeeking: any;
303
+ onSeekingCapture: any;
304
+ onSelect: any;
305
+ onSelectCapture: any;
306
+ onStalled: any;
307
+ onStalledCapture: any;
308
+ onSubmit: any;
309
+ onSubmitCapture: any;
310
+ onSuspend: any;
311
+ onSuspendCapture: any;
312
+ onTimeUpdate: any;
313
+ onTimeUpdateCapture: any;
314
+ onTouchCancel: any;
315
+ onTouchCancelCapture: any;
316
+ onTouchEnd: any;
317
+ onTouchEndCapture: any;
318
+ onTouchMove: any;
319
+ onTouchMoveCapture: any;
320
+ onTouchStart: any;
321
+ onTouchStartCapture: any;
322
+ onTransitionEnd: any;
323
+ onTransitionEndCapture: any;
324
+ onVolumeChange: any;
325
+ onVolumeChangeCapture: any;
326
+ onWaiting: any;
327
+ onWaitingCapture: any;
328
+ onWheel: any;
329
+ onWheelCapture: any;
330
+ open: any;
331
+ optimum: any;
332
+ pattern: any;
333
+ placeholder: any;
334
+ playsInline: any;
335
+ poster: any;
336
+ prefix: any;
337
+ preload: any;
338
+ property: any;
339
+ radioGroup: any;
340
+ readOnly: any;
341
+ rel: any;
342
+ required: any;
343
+ resource: any;
344
+ results: any;
345
+ reversed: any;
346
+ role: any;
347
+ rows: any;
348
+ rowSpan: any;
349
+ sandbox: any;
350
+ scope: any;
351
+ scoped: any;
352
+ scrolling: any;
353
+ seamless: any;
354
+ security: any;
355
+ selected: any;
356
+ shape: any;
357
+ sizes: any;
358
+ slot: any;
359
+ span: any;
360
+ spellCheck: any;
361
+ src: any;
362
+ srcDoc: any;
363
+ srcLang: any;
364
+ srcSet: any;
365
+ start: any;
366
+ step: any;
367
+ style: any;
368
+ summary: any;
369
+ suppressContentEditableWarning: any;
370
+ suppressHydrationWarning: any;
371
+ tabIndex: any;
372
+ target: any;
373
+ title: any;
374
+ translate: any;
375
+ typeof: any;
376
+ unselectable: any;
377
+ useMap: any;
378
+ vocab: any;
379
+ width: any;
380
+ wmode: any;
381
+ wrap: any;
382
+ };
package/types/style.d.ts CHANGED
@@ -1,4 +1,19 @@
1
+ import { DSNotificationBadgeT } from './react-desc-prop-types';
2
+ interface StyledGenericBadgeT {
3
+ top: number;
4
+ left: number;
5
+ right: number;
6
+ }
1
7
  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>;
8
+ export declare const GenericBadge: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, DSNotificationBadgeT.Props & StyledGenericBadgeT, never>;
9
+ export declare const NumericBadge: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, DSNotificationBadgeT.Props & StyledGenericBadgeT & {
10
+ top: number;
11
+ left: number;
12
+ right: number;
13
+ size?: string | undefined;
14
+ disabled?: boolean | undefined;
15
+ value?: number | undefined;
16
+ color?: string | undefined;
17
+ }, never>;
18
+ export declare const DotBadge: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, DSNotificationBadgeT.Props & StyledGenericBadgeT, never>;
19
+ export {};
package/cjs/index.d.js DELETED
@@ -1,2 +0,0 @@
1
- 'use strict';
2
-
package/cjs/prop-types.js DELETED
@@ -1,23 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var reactDesc = require('react-desc');
6
-
7
- const notificationBadgeProps = {
8
- type: reactDesc.PropTypes.oneOf(['number', 'dot']).description('type of badge: number or dot'),
9
- value: reactDesc.PropTypes.number.description('value of the numeric badge'),
10
- size: reactDesc.PropTypes.oneOf(['s', 'l']).description('size of the badge: s or l'),
11
- disabled: reactDesc.PropTypes.bool.description('whether the badge is disabled'),
12
- position: reactDesc.PropTypes.oneOf(['left', 'right']).description('position of the badge with the related component'),
13
- Component: reactDesc.PropTypes.func.description('Related component')
14
- };
15
- const defaultProps = {
16
- type: 'number',
17
- size: 's',
18
- disabled: false,
19
- position: 'right'
20
- };
21
-
22
- exports.defaultProps = defaultProps;
23
- exports.notificationBadgeProps = notificationBadgeProps;
package/esm/index.d.js DELETED
@@ -1 +0,0 @@
1
-
package/esm/prop-types.js DELETED
@@ -1,18 +0,0 @@
1
- import { PropTypes } from 'react-desc';
2
-
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
-
18
- export { defaultProps, notificationBadgeProps };
@@ -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,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
- };