@clayui/badge 3.157.0 → 3.159.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.
Files changed (2) hide show
  1. package/package.json +13 -3
  2. package/src/index.tsx +0 -88
package/package.json CHANGED
@@ -14,10 +14,10 @@
14
14
  "react"
15
15
  ],
16
16
  "license": "BSD-3-Clause",
17
- "main": "src/index.tsx",
17
+ "main": "lib/cjs/index.js",
18
18
  "name": "@clayui/badge",
19
19
  "peerDependencies": {
20
- "@clayui/css": "^3.157.0",
20
+ "@clayui/css": "^3.159.0",
21
21
  "react": "^16.0.0 || ^17.0.0 || ^18.0.0",
22
22
  "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0"
23
23
  },
@@ -29,5 +29,15 @@
29
29
  "buildTypes": "cross-env NODE_ENV=production tsc --project ./tsconfig.declarations.json",
30
30
  "test": "jest --config ../../jest.config.js"
31
31
  },
32
- "version": "3.157.0"
32
+ "version": "3.159.0",
33
+ "module": "lib/esm/index.js",
34
+ "exports": {
35
+ ".": {
36
+ "types": "./lib/index.d.ts",
37
+ "import": "./lib/esm/index.js",
38
+ "require": "./lib/cjs/index.js"
39
+ }
40
+ },
41
+ "types": "lib/index.d.ts",
42
+ "ts:main": "src/index.tsx"
33
43
  }
package/src/index.tsx DELETED
@@ -1,88 +0,0 @@
1
- /**
2
- * SPDX-FileCopyrightText: (c) 2026 Liferay, Inc. https://liferay.com
3
- * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
4
- */
5
-
6
- import classNames from 'classnames';
7
- import React from 'react';
8
-
9
- type DisplayType =
10
- | 'primary'
11
- | 'secondary'
12
- | 'info'
13
- | 'danger'
14
- | 'success'
15
- | 'warning'
16
- | 'beta'
17
- | 'beta-dark';
18
-
19
- interface IProps extends React.HTMLAttributes<HTMLSpanElement> {
20
-
21
- /**
22
- * Flag to indicate if the badge should use the clay-dark variant.
23
- */
24
- dark?: boolean;
25
-
26
- /**
27
- * Determines the color of the badge.
28
- * The values `beta` and `beta-dark` are deprecated since v3.100.0 - use
29
- * `translucent` and `dark` instead.
30
- */
31
- displayType?: DisplayType;
32
-
33
- /**
34
- * Info that is shown inside of the badge itself.
35
- */
36
- label?: string | number;
37
-
38
- /**
39
- * Flag to indicate if the badge should use the translucent variant.
40
- */
41
- translucent?: boolean;
42
- }
43
-
44
- const Badge = React.forwardRef<HTMLSpanElement, IProps>(
45
- (
46
- {
47
- className,
48
- dark,
49
- displayType = 'primary',
50
- label,
51
- translucent,
52
- ...otherProps
53
- }: IProps,
54
- ref
55
- ) => {
56
- if (displayType === 'beta') {
57
- displayType = 'info';
58
- translucent = true;
59
- }
60
- else if (displayType === 'beta-dark') {
61
- dark = true;
62
- displayType = 'info';
63
- translucent = true;
64
- }
65
-
66
- return (
67
- <span
68
- {...otherProps}
69
- className={classNames(
70
- 'badge',
71
- `badge-${displayType}`,
72
- className,
73
- {
74
- 'badge-translucent': translucent,
75
- 'clay-dark': dark,
76
- }
77
- )}
78
- ref={ref}
79
- >
80
- <span className="badge-item badge-item-expand">{label}</span>
81
- </span>
82
- );
83
- }
84
- );
85
-
86
- Badge.displayName = 'ClayBadge';
87
-
88
- export default Badge;