@clayui/badge 3.106.1 → 3.107.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -5,14 +5,24 @@
5
5
  import React from 'react';
6
6
  declare type DisplayType = 'primary' | 'secondary' | 'info' | 'danger' | 'success' | 'warning' | 'beta' | 'beta-dark';
7
7
  interface IProps extends React.HTMLAttributes<HTMLSpanElement> {
8
+ /**
9
+ * Flag to indicate if the badge should use the clay-dark variant.
10
+ */
11
+ dark?: boolean;
8
12
  /**
9
13
  * Determines the color of the badge.
14
+ * The values `beta` and `beta-dark` are deprecated since v3.100.0 - use
15
+ * `translucent` and `dark` instead.
10
16
  */
11
17
  displayType?: DisplayType;
12
18
  /**
13
19
  * Info that is shown inside of the badge itself.
14
20
  */
15
21
  label?: string | number;
22
+ /**
23
+ * Flag to indicate if the badge should use the translucent variant.
24
+ */
25
+ translucent?: boolean;
16
26
  }
17
27
  declare const ClayBadge: React.ForwardRefExoticComponent<IProps & React.RefAttributes<HTMLSpanElement>>;
18
28
  export default ClayBadge;
package/lib/index.js CHANGED
@@ -9,7 +9,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
9
9
 
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
 
12
- var _excluded = ["className", "displayType", "label"];
12
+ var _excluded = ["className", "dark", "displayType", "label", "translucent"];
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
@@ -21,13 +21,27 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
21
21
 
22
22
  var ClayBadge = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
23
23
  var className = _ref.className,
24
+ dark = _ref.dark,
24
25
  _ref$displayType = _ref.displayType,
25
26
  displayType = _ref$displayType === void 0 ? 'primary' : _ref$displayType,
26
27
  label = _ref.label,
28
+ translucent = _ref.translucent,
27
29
  otherProps = _objectWithoutProperties(_ref, _excluded);
28
30
 
31
+ if (displayType === 'beta') {
32
+ displayType = 'info';
33
+ translucent = true;
34
+ } else if (displayType === 'beta-dark') {
35
+ dark = true;
36
+ displayType = 'info';
37
+ translucent = true;
38
+ }
39
+
29
40
  return /*#__PURE__*/_react.default.createElement("span", _extends({}, otherProps, {
30
- className: (0, _classnames.default)('badge', "badge-".concat(displayType), className),
41
+ className: (0, _classnames.default)('badge', "badge-".concat(displayType), className, {
42
+ 'badge-translucent': translucent,
43
+ 'clay-dark': dark
44
+ }),
31
45
  ref: ref
32
46
  }), /*#__PURE__*/_react.default.createElement("span", {
33
47
  className: "badge-item badge-item-expand"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clayui/badge",
3
- "version": "3.106.1",
3
+ "version": "3.107.0",
4
4
  "description": "ClayBadge component",
5
5
  "license": "BSD-3-Clause",
6
6
  "repository": "https://github.com/liferay/clay",
@@ -35,5 +35,5 @@
35
35
  "browserslist": [
36
36
  "extends browserslist-config-clay"
37
37
  ],
38
- "gitHead": "b5345687d03988ed7d2409305d394434b9800b34"
38
+ "gitHead": "4b538e1e0b456006e2472ae6b7ec1e6b4bb096cb"
39
39
  }
package/CHANGELOG.md DELETED
@@ -1,75 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [3.106.1](https://github.com/liferay/clay/compare/v3.106.0...v3.106.1) (2023-10-26)
7
-
8
- **Note:** Version bump only for package @clayui/badge
9
-
10
- # [3.106.0](https://github.com/liferay/clay/compare/v3.105.0...v3.106.0) (2023-10-25)
11
-
12
- ### Bug Fixes
13
-
14
- - remove 'src' dir from being packaged with npm ([9383e8d](https://github.com/liferay/clay/commit/9383e8d8abb25ca3396e7c6e4dfa53bbc72691c5))
15
- - use package's directory for baseDir when generating type ([0a5c710](https://github.com/liferay/clay/commit/0a5c710092f36243bc8d5487f70e831295715072))
16
-
17
- # [3.100.0](https://github.com/liferay/clay/compare/v3.99.4...v3.100.0) (2023-07-13)
18
-
19
- ### Features
20
-
21
- - **@clayui/badge:** Adds display type beta-dark ([2f53849](https://github.com/liferay/clay/commit/2f5384940aff5909753adeecd8a2f9c12d3dab89))
22
-
23
- # [3.92.0](https://github.com/liferay/clay/compare/v3.91.0...v3.92.0) (2023-04-06)
24
-
25
- **Note:** Version bump only for package @clayui/badge
26
-
27
- # [3.56.0](https://github.com/liferay/clay/compare/v3.55.0...v3.56.0) (2022-05-09)
28
-
29
- **Note:** Version bump only for package @clayui/badge
30
-
31
- # [3.40.0](https://github.com/liferay/clay/compare/v3.39.0...v3.40.0) (2021-11-17)
32
-
33
- **Note:** Version bump only for package @clayui/badge
34
-
35
- # [3.39.0](https://github.com/liferay/clay/compare/v3.38.0...v3.39.0) (2021-10-29)
36
-
37
- **Note:** Version bump only for package @clayui/badge
38
-
39
- # [3.38.0](https://github.com/liferay/clay/compare/v3.37.0...v3.38.0) (2021-10-22)
40
-
41
- **Note:** Version bump only for package @clayui/badge
42
-
43
- # [3.37.0](https://github.com/liferay/clay/compare/v3.36.0...v3.37.0) (2021-10-06)
44
-
45
- **Note:** Version bump only for package @clayui/badge
46
-
47
- # [3.32.0](https://github.com/liferay/clay/compare/v3.31.0...v3.32.0) (2021-07-28)
48
-
49
- **Note:** Version bump only for package @clayui/badge
50
-
51
- # [3.2.0](https://github.com/liferay/clay/compare/@clayui/badge@3.1.0...@clayui/badge@3.2.0) (2020-10-01)
52
-
53
- ### Features
54
-
55
- - **clayui.com:** Add JSP code example to Badge ([caa9ecc](https://github.com/liferay/clay/commit/caa9ecc))
56
- - **clayui.com:** Move API tables to new files and update document tabs, rename files to use singular naming instead of plural, change mainTabURL of pagination-bar to a proper one ([d812ee9](https://github.com/liferay/clay/commit/d812ee9))
57
- - add displayName for all components ([cc3211d](https://github.com/liferay/clay/commit/cc3211d))
58
-
59
- # [3.1.0](https://github.com/liferay/clay/compare/@clayui/badge@3.0.2...@clayui/badge@3.1.0) (2020-05-21)
60
-
61
- ### Features
62
-
63
- - **clayui.com:** Improve component docs by updating content - Badge, Breadcrumb, Dual List Box, Loading Indicator, Localized Input & Multi Step Nav ([c4ad126](https://github.com/liferay/clay/commit/c4ad126))
64
-
65
- ## [3.0.2](https://github.com/liferay/clay/compare/@clayui/badge@3.0.1...@clayui/badge@3.0.2) (2020-04-24)
66
-
67
- **Note:** Version bump only for package @clayui/badge
68
-
69
- ## 3.0.1 (2020-02-28)
70
-
71
- ### Bug Fixes
72
-
73
- - update components to include 'types' and 'ts:main' package keys ([9e24b59](https://github.com/liferay/clay/commit/9e24b59))
74
- - **@clayui/badge:** Forward ClayBadge refs ([98576ab](https://github.com/liferay/clay/commit/98576ab))
75
- - **@clayui/badge:** improve types ([683d776](https://github.com/liferay/clay/commit/683d776))