@clayui/badge 3.111.0 → 3.141.1-alpha.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.
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _classnames = _interopRequireDefault(require("classnames"));
8
+ var _react = _interopRequireDefault(require("react"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /**
11
+ * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
12
+ * SPDX-License-Identifier: BSD-3-Clause
13
+ */
14
+ const Badge = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
15
+ let {
16
+ className,
17
+ dark,
18
+ displayType = 'primary',
19
+ label,
20
+ translucent,
21
+ ...otherProps
22
+ } = _ref;
23
+ if (displayType === 'beta') {
24
+ displayType = 'info';
25
+ translucent = true;
26
+ } else if (displayType === 'beta-dark') {
27
+ dark = true;
28
+ displayType = 'info';
29
+ translucent = true;
30
+ }
31
+ return /*#__PURE__*/_react.default.createElement("span", _extends({}, otherProps, {
32
+ className: (0, _classnames.default)('badge', `badge-${displayType}`, className, {
33
+ 'badge-translucent': translucent,
34
+ 'clay-dark': dark
35
+ }),
36
+ ref: ref
37
+ }), /*#__PURE__*/_react.default.createElement("span", {
38
+ className: "badge-item badge-item-expand"
39
+ }, label));
40
+ });
41
+ Badge.displayName = 'ClayBadge';
42
+ var _default = exports.default = Badge;
@@ -0,0 +1,37 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ /**
3
+ * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+
7
+ import classNames from 'classnames';
8
+ import React from 'react';
9
+ const Badge = /*#__PURE__*/React.forwardRef((_ref, ref) => {
10
+ let {
11
+ className,
12
+ dark,
13
+ displayType = 'primary',
14
+ label,
15
+ translucent,
16
+ ...otherProps
17
+ } = _ref;
18
+ if (displayType === 'beta') {
19
+ displayType = 'info';
20
+ translucent = true;
21
+ } else if (displayType === 'beta-dark') {
22
+ dark = true;
23
+ displayType = 'info';
24
+ translucent = true;
25
+ }
26
+ return /*#__PURE__*/React.createElement("span", _extends({}, otherProps, {
27
+ className: classNames('badge', `badge-${displayType}`, className, {
28
+ 'badge-translucent': translucent,
29
+ 'clay-dark': dark
30
+ }),
31
+ ref: ref
32
+ }), /*#__PURE__*/React.createElement("span", {
33
+ className: "badge-item badge-item-expand"
34
+ }, label));
35
+ });
36
+ Badge.displayName = 'ClayBadge';
37
+ export default Badge;
package/lib/index.d.ts CHANGED
@@ -24,5 +24,5 @@ interface IProps extends React.HTMLAttributes<HTMLSpanElement> {
24
24
  */
25
25
  translucent?: boolean;
26
26
  }
27
- declare const ClayBadge: React.ForwardRefExoticComponent<IProps & React.RefAttributes<HTMLSpanElement>>;
28
- export default ClayBadge;
27
+ declare const Badge: React.ForwardRefExoticComponent<IProps & React.RefAttributes<HTMLSpanElement>>;
28
+ export default Badge;
package/package.json CHANGED
@@ -1,21 +1,24 @@
1
1
  {
2
2
  "name": "@clayui/badge",
3
- "version": "3.111.0",
3
+ "version": "3.141.1-alpha.0",
4
4
  "description": "ClayBadge component",
5
5
  "license": "BSD-3-Clause",
6
6
  "repository": "https://github.com/liferay/clay",
7
- "engines": {
8
- "node": ">=0.12.0",
9
- "npm": ">=3.0.0"
7
+ "main": "lib/cjs/index.js",
8
+ "module": "lib/esm/index.js",
9
+ "exports": {
10
+ "import": "./lib/esm/index.js",
11
+ "require": "./lib/cjs/index.js"
10
12
  },
11
- "main": "lib/index.js",
12
13
  "types": "lib/index.d.ts",
13
14
  "ts:main": "src/index.tsx",
14
15
  "files": [
15
16
  "lib"
16
17
  ],
17
18
  "scripts": {
18
- "build": "cross-env NODE_ENV=production babel src --root-mode upward --out-dir lib --extensions .ts,.tsx",
19
+ "build": "yarn build:cjs && yarn build:esm",
20
+ "build:cjs": "cross-env NODE_ENV=production babel src --root-mode upward --out-dir lib/cjs --extensions .ts,.tsx",
21
+ "build:esm": "cross-env NODE_ENV=production babel src --root-mode upward --out-dir lib/esm --extensions .ts,.tsx --env-name esm",
19
22
  "buildTypes": "cross-env NODE_ENV=production tsc --project ./tsconfig.declarations.json",
20
23
  "test": "jest --config ../../jest.config.js"
21
24
  },
@@ -34,5 +37,5 @@
34
37
  "browserslist": [
35
38
  "extends browserslist-config-clay"
36
39
  ],
37
- "gitHead": "7dae7b1ba2f61516876e5799dc95045a5adb2c18"
40
+ "gitHead": "24cb57a568c2d1a1658b2f721a93ddfad48feb99"
38
41
  }
package/CHANGELOG.md DELETED
@@ -1,85 +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.111.0](https://github.com/liferay/clay/compare/v3.110.0...v3.111.0) (2024-02-15)
7
-
8
- **Note:** Version bump only for package @clayui/badge
9
-
10
- # [3.107.0](https://github.com/liferay/clay/compare/v3.106.1...v3.107.0) (2023-11-27)
11
-
12
- ### Features
13
-
14
- - **@clayui/badge:** Adds attributes translucent and dark ([77162ef](https://github.com/liferay/clay/commit/77162efe62cd3822f4a64e23b3469e46cee5c530))
15
-
16
- ## [3.106.1](https://github.com/liferay/clay/compare/v3.106.0...v3.106.1) (2023-10-26)
17
-
18
- **Note:** Version bump only for package @clayui/badge
19
-
20
- # [3.106.0](https://github.com/liferay/clay/compare/v3.105.0...v3.106.0) (2023-10-25)
21
-
22
- ### Bug Fixes
23
-
24
- - remove 'src' dir from being packaged with npm ([9383e8d](https://github.com/liferay/clay/commit/9383e8d8abb25ca3396e7c6e4dfa53bbc72691c5))
25
- - use package's directory for baseDir when generating type ([0a5c710](https://github.com/liferay/clay/commit/0a5c710092f36243bc8d5487f70e831295715072))
26
-
27
- # [3.100.0](https://github.com/liferay/clay/compare/v3.99.4...v3.100.0) (2023-07-13)
28
-
29
- ### Features
30
-
31
- - **@clayui/badge:** Adds display type beta-dark ([2f53849](https://github.com/liferay/clay/commit/2f5384940aff5909753adeecd8a2f9c12d3dab89))
32
-
33
- # [3.92.0](https://github.com/liferay/clay/compare/v3.91.0...v3.92.0) (2023-04-06)
34
-
35
- **Note:** Version bump only for package @clayui/badge
36
-
37
- # [3.56.0](https://github.com/liferay/clay/compare/v3.55.0...v3.56.0) (2022-05-09)
38
-
39
- **Note:** Version bump only for package @clayui/badge
40
-
41
- # [3.40.0](https://github.com/liferay/clay/compare/v3.39.0...v3.40.0) (2021-11-17)
42
-
43
- **Note:** Version bump only for package @clayui/badge
44
-
45
- # [3.39.0](https://github.com/liferay/clay/compare/v3.38.0...v3.39.0) (2021-10-29)
46
-
47
- **Note:** Version bump only for package @clayui/badge
48
-
49
- # [3.38.0](https://github.com/liferay/clay/compare/v3.37.0...v3.38.0) (2021-10-22)
50
-
51
- **Note:** Version bump only for package @clayui/badge
52
-
53
- # [3.37.0](https://github.com/liferay/clay/compare/v3.36.0...v3.37.0) (2021-10-06)
54
-
55
- **Note:** Version bump only for package @clayui/badge
56
-
57
- # [3.32.0](https://github.com/liferay/clay/compare/v3.31.0...v3.32.0) (2021-07-28)
58
-
59
- **Note:** Version bump only for package @clayui/badge
60
-
61
- # [3.2.0](https://github.com/liferay/clay/compare/@clayui/badge@3.1.0...@clayui/badge@3.2.0) (2020-10-01)
62
-
63
- ### Features
64
-
65
- - **clayui.com:** Add JSP code example to Badge ([caa9ecc](https://github.com/liferay/clay/commit/caa9ecc))
66
- - **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))
67
- - add displayName for all components ([cc3211d](https://github.com/liferay/clay/commit/cc3211d))
68
-
69
- # [3.1.0](https://github.com/liferay/clay/compare/@clayui/badge@3.0.2...@clayui/badge@3.1.0) (2020-05-21)
70
-
71
- ### Features
72
-
73
- - **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))
74
-
75
- ## [3.0.2](https://github.com/liferay/clay/compare/@clayui/badge@3.0.1...@clayui/badge@3.0.2) (2020-04-24)
76
-
77
- **Note:** Version bump only for package @clayui/badge
78
-
79
- ## 3.0.1 (2020-02-28)
80
-
81
- ### Bug Fixes
82
-
83
- - update components to include 'types' and 'ts:main' package keys ([9e24b59](https://github.com/liferay/clay/commit/9e24b59))
84
- - **@clayui/badge:** Forward ClayBadge refs ([98576ab](https://github.com/liferay/clay/commit/98576ab))
85
- - **@clayui/badge:** improve types ([683d776](https://github.com/liferay/clay/commit/683d776))
package/lib/index.js DELETED
@@ -1,53 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _classnames = _interopRequireDefault(require("classnames"));
9
-
10
- var _react = _interopRequireDefault(require("react"));
11
-
12
- var _excluded = ["className", "dark", "displayType", "label", "translucent"];
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
-
18
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
19
-
20
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
21
-
22
- var ClayBadge = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
23
- var className = _ref.className,
24
- dark = _ref.dark,
25
- _ref$displayType = _ref.displayType,
26
- displayType = _ref$displayType === void 0 ? 'primary' : _ref$displayType,
27
- label = _ref.label,
28
- translucent = _ref.translucent,
29
- otherProps = _objectWithoutProperties(_ref, _excluded);
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
-
40
- return /*#__PURE__*/_react.default.createElement("span", _extends({}, otherProps, {
41
- className: (0, _classnames.default)('badge', "badge-".concat(displayType), className, {
42
- 'badge-translucent': translucent,
43
- 'clay-dark': dark
44
- }),
45
- ref: ref
46
- }), /*#__PURE__*/_react.default.createElement("span", {
47
- className: "badge-item badge-item-expand"
48
- }, label));
49
- });
50
-
51
- ClayBadge.displayName = 'ClayBadge';
52
- var _default = ClayBadge;
53
- exports.default = _default;