@clayui/label 3.37.0 → 3.38.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.js +11 -5
- package/package.json +4 -4
- package/src/__tests__/index.tsx +9 -9
- package/CHANGELOG.md +0 -73
package/lib/index.js
CHANGED
|
@@ -13,6 +13,12 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
13
13
|
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
|
|
16
|
+
var _excluded = ["children", "className"],
|
|
17
|
+
_excluded2 = ["children", "className"],
|
|
18
|
+
_excluded3 = ["children", "className", "href"],
|
|
19
|
+
_excluded4 = ["children", "className", "dismissible", "displayType", "large"],
|
|
20
|
+
_excluded5 = ["children", "closeButtonProps", "href", "innerElementProps", "withClose", "spritemap"];
|
|
21
|
+
|
|
16
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
23
|
|
|
18
24
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -26,7 +32,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
26
32
|
var ClayLabelItemAfter = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
27
33
|
var children = _ref.children,
|
|
28
34
|
className = _ref.className,
|
|
29
|
-
otherProps = _objectWithoutProperties(_ref,
|
|
35
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
30
36
|
|
|
31
37
|
return /*#__PURE__*/_react.default.createElement("span", _extends({}, otherProps, {
|
|
32
38
|
className: (0, _classnames.default)(className, 'label-item label-item-after'),
|
|
@@ -39,7 +45,7 @@ ClayLabelItemAfter.displayName = 'ClayLabelItemAfter';
|
|
|
39
45
|
var ClayLabelItemBefore = /*#__PURE__*/_react.default.forwardRef(function (_ref2, ref) {
|
|
40
46
|
var children = _ref2.children,
|
|
41
47
|
className = _ref2.className,
|
|
42
|
-
otherProps = _objectWithoutProperties(_ref2,
|
|
48
|
+
otherProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
43
49
|
|
|
44
50
|
return /*#__PURE__*/_react.default.createElement("span", _extends({}, otherProps, {
|
|
45
51
|
className: (0, _classnames.default)(className, 'label-item label-item-before'),
|
|
@@ -53,7 +59,7 @@ var ClayLabelItemExpand = /*#__PURE__*/_react.default.forwardRef(function (_ref3
|
|
|
53
59
|
var children = _ref3.children,
|
|
54
60
|
className = _ref3.className,
|
|
55
61
|
href = _ref3.href,
|
|
56
|
-
otherProps = _objectWithoutProperties(_ref3,
|
|
62
|
+
otherProps = _objectWithoutProperties(_ref3, _excluded3);
|
|
57
63
|
|
|
58
64
|
var TagName = href ? _link.default : 'span';
|
|
59
65
|
return /*#__PURE__*/_react.default.createElement(TagName, _extends({}, otherProps, {
|
|
@@ -73,7 +79,7 @@ var ClayLabel = /*#__PURE__*/_react.default.forwardRef(function (_ref4, ref) {
|
|
|
73
79
|
displayType = _ref4$displayType === void 0 ? 'secondary' : _ref4$displayType,
|
|
74
80
|
_ref4$large = _ref4.large,
|
|
75
81
|
large = _ref4$large === void 0 ? false : _ref4$large,
|
|
76
|
-
otherProps = _objectWithoutProperties(_ref4,
|
|
82
|
+
otherProps = _objectWithoutProperties(_ref4, _excluded4);
|
|
77
83
|
|
|
78
84
|
return /*#__PURE__*/_react.default.createElement("span", _extends({}, otherProps, {
|
|
79
85
|
className: (0, _classnames.default)('label', className, _defineProperty({
|
|
@@ -95,7 +101,7 @@ var ClayLabelHybrid = /*#__PURE__*/_react.default.forwardRef(function (_ref5, re
|
|
|
95
101
|
_ref5$withClose = _ref5.withClose,
|
|
96
102
|
withClose = _ref5$withClose === void 0 ? true : _ref5$withClose,
|
|
97
103
|
spritemap = _ref5.spritemap,
|
|
98
|
-
otherProps = _objectWithoutProperties(_ref5,
|
|
104
|
+
otherProps = _objectWithoutProperties(_ref5, _excluded5);
|
|
99
105
|
|
|
100
106
|
return /*#__PURE__*/_react.default.createElement(ClayLabel, _extends({
|
|
101
107
|
dismissible: withClose && !!closeButtonProps
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clayui/label",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.38.0",
|
|
4
4
|
"description": "ClayLabel component",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"repository": "https://github.com/liferay/clay",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"react"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@clayui/icon": "^3.
|
|
30
|
-
"@clayui/link": "^3.
|
|
29
|
+
"@clayui/icon": "^3.38.0",
|
|
30
|
+
"@clayui/link": "^3.38.0",
|
|
31
31
|
"classnames": "^2.2.6"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"browserslist": [
|
|
39
39
|
"extends browserslist-config-clay"
|
|
40
40
|
],
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "7bd99c6d432b6973d76b7003e64ed72e42879a8b"
|
|
42
42
|
}
|
package/src/__tests__/index.tsx
CHANGED
|
@@ -13,7 +13,7 @@ const spritemap = 'path/to/spritemap';
|
|
|
13
13
|
describe('Rendering', () => {
|
|
14
14
|
it('default', () => {
|
|
15
15
|
const testRenderer = TestRenderer.create(
|
|
16
|
-
<ClayLabel>
|
|
16
|
+
<ClayLabel>Default Label</ClayLabel>
|
|
17
17
|
);
|
|
18
18
|
|
|
19
19
|
expect(testRenderer.toJSON()).toMatchSnapshot();
|
|
@@ -21,7 +21,7 @@ describe('Rendering', () => {
|
|
|
21
21
|
|
|
22
22
|
it('with a different displayType ', () => {
|
|
23
23
|
const testRenderer = TestRenderer.create(
|
|
24
|
-
<ClayLabel displayType="success">
|
|
24
|
+
<ClayLabel displayType="success">Success Label</ClayLabel>
|
|
25
25
|
);
|
|
26
26
|
|
|
27
27
|
expect(testRenderer.toJSON()).toMatchSnapshot();
|
|
@@ -29,7 +29,7 @@ describe('Rendering', () => {
|
|
|
29
29
|
|
|
30
30
|
it('as a link ', () => {
|
|
31
31
|
const testRenderer = TestRenderer.create(
|
|
32
|
-
<ClayLabel href="#/foo/bar">
|
|
32
|
+
<ClayLabel href="#/foo/bar">Label w/ link</ClayLabel>
|
|
33
33
|
);
|
|
34
34
|
|
|
35
35
|
expect(testRenderer.toJSON()).toMatchSnapshot();
|
|
@@ -43,7 +43,7 @@ describe('Rendering', () => {
|
|
|
43
43
|
}}
|
|
44
44
|
spritemap={spritemap}
|
|
45
45
|
>
|
|
46
|
-
|
|
46
|
+
Label Closable
|
|
47
47
|
</ClayLabel>
|
|
48
48
|
);
|
|
49
49
|
|
|
@@ -59,7 +59,7 @@ describe('Rendering', () => {
|
|
|
59
59
|
href="#/foo/bar"
|
|
60
60
|
spritemap={spritemap}
|
|
61
61
|
>
|
|
62
|
-
|
|
62
|
+
Label Closable
|
|
63
63
|
</ClayLabel>
|
|
64
64
|
);
|
|
65
65
|
|
|
@@ -69,8 +69,8 @@ describe('Rendering', () => {
|
|
|
69
69
|
it('renders with ItemBefore', () => {
|
|
70
70
|
const testRenderer = TestRenderer.create(
|
|
71
71
|
<ClayLabel withClose={false}>
|
|
72
|
-
<ClayLabel.ItemBefore>
|
|
73
|
-
<ClayLabel.ItemExpand>
|
|
72
|
+
<ClayLabel.ItemBefore>Content before</ClayLabel.ItemBefore>
|
|
73
|
+
<ClayLabel.ItemExpand>Label</ClayLabel.ItemExpand>
|
|
74
74
|
</ClayLabel>
|
|
75
75
|
);
|
|
76
76
|
|
|
@@ -80,8 +80,8 @@ describe('Rendering', () => {
|
|
|
80
80
|
it('renders with ItemAfter', () => {
|
|
81
81
|
const testRenderer = TestRenderer.create(
|
|
82
82
|
<ClayLabel withClose={false}>
|
|
83
|
-
<ClayLabel.ItemExpand>
|
|
84
|
-
<ClayLabel.ItemAfter>
|
|
83
|
+
<ClayLabel.ItemExpand>Label</ClayLabel.ItemExpand>
|
|
84
|
+
<ClayLabel.ItemAfter>Content after</ClayLabel.ItemAfter>
|
|
85
85
|
</ClayLabel>
|
|
86
86
|
);
|
|
87
87
|
|
package/CHANGELOG.md
DELETED
|
@@ -1,73 +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.37.0](https://github.com/liferay/clay/compare/v3.36.0...v3.37.0) (2021-10-06)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @clayui/label
|
|
9
|
-
|
|
10
|
-
# [3.32.0](https://github.com/liferay/clay/compare/v3.31.0...v3.32.0) (2021-07-28)
|
|
11
|
-
|
|
12
|
-
**Note:** Version bump only for package @clayui/label
|
|
13
|
-
|
|
14
|
-
## [3.4.1](https://github.com/liferay/clay/compare/@clayui/label@3.4.0...@clayui/label@3.4.1) (2021-01-13)
|
|
15
|
-
|
|
16
|
-
### Bug Fixes
|
|
17
|
-
|
|
18
|
-
- **@clayui/label:** close icon should be times-small ([5181335](https://github.com/liferay/clay/commit/5181335))
|
|
19
|
-
|
|
20
|
-
# [3.4.0](https://github.com/liferay/clay/compare/@clayui/label@3.3.1...@clayui/label@3.4.0) (2020-10-01)
|
|
21
|
-
|
|
22
|
-
### Features
|
|
23
|
-
|
|
24
|
-
- **clayui.com:** Add JSP code example to Label ([e90068e](https://github.com/liferay/clay/commit/e90068e))
|
|
25
|
-
- **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))
|
|
26
|
-
- add displayName for all components ([cc3211d](https://github.com/liferay/clay/commit/cc3211d))
|
|
27
|
-
|
|
28
|
-
## [3.3.1](https://github.com/liferay/clay/compare/@clayui/label@3.3.0...@clayui/label@3.3.1) (2020-06-18)
|
|
29
|
-
|
|
30
|
-
**Note:** Version bump only for package @clayui/label
|
|
31
|
-
|
|
32
|
-
# [3.3.0](https://github.com/liferay/clay/compare/@clayui/label@3.2.0...@clayui/label@3.3.0) (2020-04-24)
|
|
33
|
-
|
|
34
|
-
### Features
|
|
35
|
-
|
|
36
|
-
- **@clayui/label:** Attempt at ClayLabel contentBefore prop ([cd634e2](https://github.com/liferay/clay/commit/cd634e2))
|
|
37
|
-
- **@clayui/label:** use a hybrid API appraoch to expose low-level components ([deffd0e](https://github.com/liferay/clay/commit/deffd0e))
|
|
38
|
-
|
|
39
|
-
# [3.2.0](https://github.com/liferay/clay/tree/master/packages/clay-label/compare/@clayui/label@3.1.1...@clayui/label@3.2.0) (2020-03-26)
|
|
40
|
-
|
|
41
|
-
### Features
|
|
42
|
-
|
|
43
|
-
- **@clayui/label:** add prop for inner element attributes ([2d1f489](https://github.com/liferay/clay/commit/2d1f489))
|
|
44
|
-
|
|
45
|
-
## [3.1.1](https://github.com/liferay/clay/tree/master/packages/clay-label/compare/@clayui/label@3.1.0...@clayui/label@3.1.1) (2020-03-12)
|
|
46
|
-
|
|
47
|
-
### Bug Fixes
|
|
48
|
-
|
|
49
|
-
- **@clayui/label:** use ClayLink over anchor tag ([746487f](https://github.com/liferay/clay/commit/746487f))
|
|
50
|
-
|
|
51
|
-
# 3.1.0 (2020-02-28)
|
|
52
|
-
|
|
53
|
-
### Bug Fixes
|
|
54
|
-
|
|
55
|
-
- update components to include 'types' and 'ts:main' package keys ([9e24b59](https://github.com/liferay/clay/commit/9e24b59))
|
|
56
|
-
|
|
57
|
-
### Features
|
|
58
|
-
|
|
59
|
-
- **clay-form:** create high-level multi-select component ([feb3abc](https://github.com/liferay/clay/commit/feb3abc))
|
|
60
|
-
- added template demos ([c2f1064](https://github.com/liferay/clay/commit/c2f1064))
|
|
61
|
-
- update react-testing-library to be @testing-library/react ([bd78145](https://github.com/liferay/clay/commit/bd78145))
|
|
62
|
-
|
|
63
|
-
## [3.0.3](https://github.com/liferay/clay/tree/master/packages/clay-label/compare/@clayui/label@3.0.1...@clayui/label@3.0.3) (2020-01-31)
|
|
64
|
-
|
|
65
|
-
**Note:** Version bump only for package @clayui/label
|
|
66
|
-
|
|
67
|
-
## [3.0.2](https://github.com/liferay/clay/tree/master/packages/clay-label/compare/@clayui/label@3.0.1...@clayui/label@3.0.2) (2020-01-20)
|
|
68
|
-
|
|
69
|
-
**Note:** Version bump only for package @clayui/label
|
|
70
|
-
|
|
71
|
-
## [3.0.1](https://github.com/liferay/clay/tree/master/packages/clay-label/compare/@clayui/label@3.0.0...@clayui/label@3.0.1) (2019-10-28)
|
|
72
|
-
|
|
73
|
-
**Note:** Version bump only for package @clayui/label
|