@commercetools-uikit/field-label 12.2.1 → 12.2.5
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/README.md +0 -1
- package/dist/commercetools-uikit-field-label.cjs.dev.js +67 -51
- package/dist/commercetools-uikit-field-label.cjs.prod.js +55 -40
- package/dist/commercetools-uikit-field-label.esm.js +55 -39
- package/dist/declarations/src/export-types.d.ts +2 -0
- package/dist/declarations/src/field-label.d.ts +22 -22
- package/dist/declarations/src/index.d.ts +3 -4
- package/dist/declarations/src/version.d.ts +2 -2
- package/package.json +20 -17
package/README.md
CHANGED
|
@@ -30,7 +30,6 @@ npm --save install react
|
|
|
30
30
|
## Usage
|
|
31
31
|
|
|
32
32
|
```jsx
|
|
33
|
-
import React from 'react';
|
|
34
33
|
import { defineMessage, FormattedMessage } from 'react-intl';
|
|
35
34
|
import FlatButton from '@commercetools-uikit/flat-button';
|
|
36
35
|
import FieldLabel from '@commercetools-uikit/field-label';
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _pt = require('prop-types');
|
|
6
|
-
var
|
|
6
|
+
var react = require('react');
|
|
7
7
|
var utils = require('@commercetools-uikit/utils');
|
|
8
|
-
|
|
8
|
+
require('@emotion/react');
|
|
9
9
|
var IconButton = require('@commercetools-uikit/icon-button');
|
|
10
10
|
var icons = require('@commercetools-uikit/icons');
|
|
11
11
|
var Text = require('@commercetools-uikit/text');
|
|
@@ -13,11 +13,11 @@ var Constraints = require('@commercetools-uikit/constraints');
|
|
|
13
13
|
var Stack = require('@commercetools-uikit/spacings-stack');
|
|
14
14
|
var Inline = require('@commercetools-uikit/spacings-inline');
|
|
15
15
|
var Label = require('@commercetools-uikit/label');
|
|
16
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
16
17
|
|
|
17
18
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
18
19
|
|
|
19
20
|
var _pt__default = /*#__PURE__*/_interopDefault(_pt);
|
|
20
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
21
21
|
var IconButton__default = /*#__PURE__*/_interopDefault(IconButton);
|
|
22
22
|
var Text__default = /*#__PURE__*/_interopDefault(Text);
|
|
23
23
|
var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
|
|
@@ -33,6 +33,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
33
33
|
} : {
|
|
34
34
|
name: "pfzph7-FieldLabel",
|
|
35
35
|
styles: "display:flex;justify-content:flex-end;label:FieldLabel;",
|
|
36
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZpZWxkLWxhYmVsLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFnSm9CIiwiZmlsZSI6ImZpZWxkLWxhYmVsLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7XG4gIGNsb25lRWxlbWVudCxcbiAgTW91c2VFdmVudCxcbiAgS2V5Ym9hcmRFdmVudCxcbiAgUmVhY3RFbGVtZW50LFxuICBSZWFjdE5vZGUsXG59IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7IHdhcm5pbmcgfSBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC91dGlscyc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgSWNvbkJ1dHRvbiBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC9pY29uLWJ1dHRvbic7XG5pbXBvcnQgeyBJbmZvcm1hdGlvbkljb24gfSBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC9pY29ucyc7XG5pbXBvcnQgVGV4dCBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC90ZXh0JztcbmltcG9ydCBDb25zdHJhaW50cyBmcm9tICdAY29tbWVyY2V0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pbnR9PlxuICAgICAgPFN0YWNrIHNjYWxlPVwieHNcIj5cbiAgICAgICAgPElubGluZSBhbGlnbkl0ZW1zPVwiZmxleFN0YXJ0XCIgc2NhbGU9XCJ4c1wiPlxuICAgICAgICAgIDxUZXh0LldyYXA+XG4gICAgICAgICAgICA8TGFiZWxcbiAgICAgICAgICAgICAgaXNCb2xkPXt0cnVlfVxuICAgICAgICAgICAgICBpc1JlcXVpcmVkSW5kaWNhdG9yVmlzaWJsZT17cHJvcHMuaGFzUmVxdWlyZWRJbmRpY2F0b3J9XG4gICAgICAgICAgICAgIHRvbmU9e3Byb3BzLnRvbmV9XG4gICAgICAgICAgICAgIGlkPXtwcm9wcy5pZH1cbiAgICAgICAgICAgICAgaHRtbEZvcj17cHJvcHMuaHRtbEZvcn1cbiAgICAgICAgICAgID5cbiAgICAgICAgICAgICAge3Byb3BzLnRpdGxlfVxuICAgICAgICAgICAgPC9MYWJlbD5cbiAgICAgICAgICA8L1RleHQuV3JhcD5cbiAgICAgICAgICB7cHJvcHMub25JbmZvQnV0dG9uQ2xpY2sgJiYgKFxuICAgICAgICAgICAgPEljb25CdXR0b25cbiAgICAgICAgICAgICAgbGFiZWw9XCJNb3JlIEluZm9cIlxuICAgICAgICAgICAgICBpY29uPXs8SW5mb3JtYXRpb25JY29uIHNpemU9XCJtZWRpdW1cIiAvPn1cbiAgICAgICAgICAgICAgc2l6ZT1cInNtYWxsXCJcbiAgICAgICAgICAgICAgb25DbGljaz17cHJvcHMub25JbmZvQnV0dG9uQ2xpY2t9XG4gICAgICAgICAgICAvPlxuICAgICAgICAgICl9XG4gICAgICAgIDwvSW5saW5lPlxuXG4gICAgICAgIHtwcm9wcy5oaW50ICYmIChcbiAgICAgICAgICA8SW5saW5lIGFsaWduSXRlbXM9XCJmbGV4U3RhcnRcIiBzY2FsZT1cInhzXCI+XG4gICAgICAgICAgICB7cHJvcHMuaGludEljb24gJiYgKFxuICAgICAgICAgICAgICA8SW5saW5lPlxuICAgICAgICAgICAgICAgIHtjbG9uZUVsZW1lbnQocHJvcHMuaGludEljb24sIHtcbiAgICAgICAgICAgICAgICAgIC8vIEZJWE1FOiBhZGQgcHJvcGVyIHRvbmUgd2hlbiB0b25lcyBhcmUgcmVmYWN0b3JlZFxuICAgICAgICAgICAgICAgICAgc2l6ZTogJ21lZGl1bScsXG4gICAgICAgICAgICAgICAgICBjb2xvcjogcHJvcHMuaGludEljb24ucHJvcHMuY29sb3IgfHwgJ3dhcm5pbmcnLFxuICAgICAgICAgICAgICAgIH0pfVxuICAgICAgICAgICAgICA8L0lubGluZT5cbiAgICAgICAgICAgICl9XG4gICAgICAgICAgICB7cHJvcHMuaGludCAmJiAoXG4gICAgICAgICAgICAgIDxUZXh0LkRldGFpbCB0b25lPXtwcm9wcy50b25lfT57cHJvcHMuaGludH08L1RleHQuRGV0YWlsPlxuICAgICAgICAgICAgKX1cbiAgICAgICAgICA8L0lubGluZT5cbiAgICAgICAgKX1cbiAgICAgICAge3Byb3BzLmRlc2NyaXB0aW9uICYmIChcbiAgICAgICAgICA8VGV4dC5XcmFwPlxuICAgICAgICAgICAgPFRleHQuRGV0YWlsIHRvbmU9e3Byb3BzLnRvbmV9Pntwcm9wcy5kZXNjcmlwdGlvbn08L1RleHQuRGV0YWlsPlxuICAgICAgICAgIDwvVGV4dC5XcmFwPlxuICAgICAgICApfVxuXG4gICAgICAgIHtwcm9wcy5iYWRnZSAmJiAoXG4gICAgICAgICAgPGRpdlxuICAgICAgICAgICAgY3NzPXtjc3NgXG4gICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgICAgICAgICAgIGp1c3RpZnktY29udGVudDogZmxleC1lbmQ7XG4gICAgICAgICAgICBgfVxuICAgICAgICAgID5cbiAgICAgICAgICAgIHtwcm9wcy5iYWRnZX1cbiAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgKX1cbiAgICAgIDwvU3RhY2s+XG4gICAgPC9Db25zdHJhaW50cy5Ib3Jpem9udGFsPlxuICApO1xufTtcblxuRmllbGRMYWJlbC5kaXNwbGF5TmFtZSA9ICdGaWVsZExhYmVsJztcbkZpZWxkTGFiZWwuZGVmYXVsdFByb3BzID0ge1xuICBob3Jpem9udGFsQ29uc3RyYWludDogJ3NjYWxlJyxcbn07XG5cbmV4cG9ydCBkZWZhdWx0IEZpZWxkTGFiZWw7XG4iXX0= */",
|
|
36
37
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
37
38
|
};
|
|
38
39
|
|
|
@@ -42,62 +43,77 @@ var FieldLabel = function FieldLabel(props) {
|
|
|
42
43
|
process.env.NODE_ENV !== "production" ? utils.warning(Boolean(props.hint), 'ui-kit/FieldLabel: `hint` is required when `hintIcon` is provided') : void 0;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
return
|
|
46
|
-
max: props.horizontalConstraint
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
46
|
+
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
47
|
+
max: props.horizontalConstraint,
|
|
48
|
+
children: jsxRuntime.jsxs(Stack__default["default"], {
|
|
49
|
+
scale: "xs",
|
|
50
|
+
children: [jsxRuntime.jsxs(Inline__default["default"], {
|
|
51
|
+
alignItems: "flexStart",
|
|
52
|
+
scale: "xs",
|
|
53
|
+
children: [jsxRuntime.jsx(Text__default["default"].Wrap, {
|
|
54
|
+
children: jsxRuntime.jsx(Label__default["default"], {
|
|
55
|
+
isBold: true,
|
|
56
|
+
isRequiredIndicatorVisible: props.hasRequiredIndicator,
|
|
57
|
+
tone: props.tone,
|
|
58
|
+
id: props.id,
|
|
59
|
+
htmlFor: props.htmlFor,
|
|
60
|
+
children: props.title
|
|
61
|
+
})
|
|
62
|
+
}), props.onInfoButtonClick && jsxRuntime.jsx(IconButton__default["default"], {
|
|
63
|
+
label: "More Info",
|
|
64
|
+
icon: jsxRuntime.jsx(icons.InformationIcon, {
|
|
65
|
+
size: "medium"
|
|
66
|
+
}),
|
|
67
|
+
size: "small",
|
|
68
|
+
onClick: props.onInfoButtonClick
|
|
69
|
+
})]
|
|
70
|
+
}), props.hint && jsxRuntime.jsxs(Inline__default["default"], {
|
|
71
|
+
alignItems: "flexStart",
|
|
72
|
+
scale: "xs",
|
|
73
|
+
children: [props.hintIcon && jsxRuntime.jsx(Inline__default["default"], {
|
|
74
|
+
children: /*#__PURE__*/react.cloneElement(props.hintIcon, {
|
|
75
|
+
// FIXME: add proper tone when tones are refactored
|
|
76
|
+
size: 'medium',
|
|
77
|
+
color: props.hintIcon.props.color || 'warning'
|
|
78
|
+
})
|
|
79
|
+
}), props.hint && jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
80
|
+
tone: props.tone,
|
|
81
|
+
children: props.hint
|
|
82
|
+
})]
|
|
83
|
+
}), props.description && jsxRuntime.jsx(Text__default["default"].Wrap, {
|
|
84
|
+
children: jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
85
|
+
tone: props.tone,
|
|
86
|
+
children: props.description
|
|
87
|
+
})
|
|
88
|
+
}), props.badge && jsxRuntime.jsx("div", {
|
|
89
|
+
css: _ref,
|
|
90
|
+
children: props.badge
|
|
91
|
+
})]
|
|
92
|
+
})
|
|
93
|
+
});
|
|
79
94
|
};
|
|
80
95
|
|
|
81
96
|
FieldLabel.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
82
|
-
title: _pt__default[
|
|
83
|
-
hint: _pt__default[
|
|
84
|
-
description: _pt__default[
|
|
85
|
-
onInfoButtonClick: _pt__default[
|
|
86
|
-
tone: _pt__default[
|
|
87
|
-
hintIcon: _pt__default[
|
|
88
|
-
badge: _pt__default[
|
|
89
|
-
hasRequiredIndicator: _pt__default[
|
|
90
|
-
htmlFor: _pt__default[
|
|
91
|
-
id: _pt__default[
|
|
92
|
-
horizontalConstraint: _pt__default[
|
|
97
|
+
title: _pt__default["default"].oneOfType([_pt__default["default"].string, _pt__default["default"].node]).isRequired,
|
|
98
|
+
hint: _pt__default["default"].oneOfType([_pt__default["default"].string, _pt__default["default"].node]),
|
|
99
|
+
description: _pt__default["default"].oneOfType([_pt__default["default"].string, _pt__default["default"].node]),
|
|
100
|
+
onInfoButtonClick: _pt__default["default"].func,
|
|
101
|
+
tone: _pt__default["default"].oneOf(['primary', 'inverted']),
|
|
102
|
+
hintIcon: _pt__default["default"].element,
|
|
103
|
+
badge: _pt__default["default"].node,
|
|
104
|
+
hasRequiredIndicator: _pt__default["default"].bool,
|
|
105
|
+
htmlFor: _pt__default["default"].string,
|
|
106
|
+
id: _pt__default["default"].string,
|
|
107
|
+
horizontalConstraint: _pt__default["default"].oneOf([3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto'])
|
|
93
108
|
} : {};
|
|
94
109
|
FieldLabel.displayName = 'FieldLabel';
|
|
95
110
|
FieldLabel.defaultProps = {
|
|
96
111
|
horizontalConstraint: 'scale'
|
|
97
112
|
};
|
|
113
|
+
var FieldLabel$1 = FieldLabel;
|
|
98
114
|
|
|
99
|
-
// NOTE: This string will be replaced
|
|
100
|
-
var version =
|
|
115
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
116
|
+
var version = "12.2.5";
|
|
101
117
|
|
|
102
|
-
exports
|
|
118
|
+
exports["default"] = FieldLabel$1;
|
|
103
119
|
exports.version = version;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('prop-types');
|
|
6
|
-
var
|
|
6
|
+
var react = require('react');
|
|
7
7
|
require('@commercetools-uikit/utils');
|
|
8
|
-
|
|
8
|
+
require('@emotion/react');
|
|
9
9
|
var IconButton = require('@commercetools-uikit/icon-button');
|
|
10
10
|
var icons = require('@commercetools-uikit/icons');
|
|
11
11
|
var Text = require('@commercetools-uikit/text');
|
|
@@ -13,10 +13,10 @@ var Constraints = require('@commercetools-uikit/constraints');
|
|
|
13
13
|
var Stack = require('@commercetools-uikit/spacings-stack');
|
|
14
14
|
var Inline = require('@commercetools-uikit/spacings-inline');
|
|
15
15
|
var Label = require('@commercetools-uikit/label');
|
|
16
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
16
17
|
|
|
17
18
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
18
19
|
|
|
19
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
20
20
|
var IconButton__default = /*#__PURE__*/_interopDefault(IconButton);
|
|
21
21
|
var Text__default = /*#__PURE__*/_interopDefault(Text);
|
|
22
22
|
var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
|
|
@@ -32,40 +32,54 @@ var _ref = {
|
|
|
32
32
|
var FieldLabel = function FieldLabel(props) {
|
|
33
33
|
if (props.hintIcon) ;
|
|
34
34
|
|
|
35
|
-
return
|
|
36
|
-
max: props.horizontalConstraint
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
35
|
+
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
36
|
+
max: props.horizontalConstraint,
|
|
37
|
+
children: jsxRuntime.jsxs(Stack__default["default"], {
|
|
38
|
+
scale: "xs",
|
|
39
|
+
children: [jsxRuntime.jsxs(Inline__default["default"], {
|
|
40
|
+
alignItems: "flexStart",
|
|
41
|
+
scale: "xs",
|
|
42
|
+
children: [jsxRuntime.jsx(Text__default["default"].Wrap, {
|
|
43
|
+
children: jsxRuntime.jsx(Label__default["default"], {
|
|
44
|
+
isBold: true,
|
|
45
|
+
isRequiredIndicatorVisible: props.hasRequiredIndicator,
|
|
46
|
+
tone: props.tone,
|
|
47
|
+
id: props.id,
|
|
48
|
+
htmlFor: props.htmlFor,
|
|
49
|
+
children: props.title
|
|
50
|
+
})
|
|
51
|
+
}), props.onInfoButtonClick && jsxRuntime.jsx(IconButton__default["default"], {
|
|
52
|
+
label: "More Info",
|
|
53
|
+
icon: jsxRuntime.jsx(icons.InformationIcon, {
|
|
54
|
+
size: "medium"
|
|
55
|
+
}),
|
|
56
|
+
size: "small",
|
|
57
|
+
onClick: props.onInfoButtonClick
|
|
58
|
+
})]
|
|
59
|
+
}), props.hint && jsxRuntime.jsxs(Inline__default["default"], {
|
|
60
|
+
alignItems: "flexStart",
|
|
61
|
+
scale: "xs",
|
|
62
|
+
children: [props.hintIcon && jsxRuntime.jsx(Inline__default["default"], {
|
|
63
|
+
children: /*#__PURE__*/react.cloneElement(props.hintIcon, {
|
|
64
|
+
// FIXME: add proper tone when tones are refactored
|
|
65
|
+
size: 'medium',
|
|
66
|
+
color: props.hintIcon.props.color || 'warning'
|
|
67
|
+
})
|
|
68
|
+
}), props.hint && jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
69
|
+
tone: props.tone,
|
|
70
|
+
children: props.hint
|
|
71
|
+
})]
|
|
72
|
+
}), props.description && jsxRuntime.jsx(Text__default["default"].Wrap, {
|
|
73
|
+
children: jsxRuntime.jsx(Text__default["default"].Detail, {
|
|
74
|
+
tone: props.tone,
|
|
75
|
+
children: props.description
|
|
76
|
+
})
|
|
77
|
+
}), props.badge && jsxRuntime.jsx("div", {
|
|
78
|
+
css: _ref,
|
|
79
|
+
children: props.badge
|
|
80
|
+
})]
|
|
81
|
+
})
|
|
82
|
+
});
|
|
69
83
|
};
|
|
70
84
|
|
|
71
85
|
FieldLabel.propTypes = {};
|
|
@@ -73,9 +87,10 @@ FieldLabel.displayName = 'FieldLabel';
|
|
|
73
87
|
FieldLabel.defaultProps = {
|
|
74
88
|
horizontalConstraint: 'scale'
|
|
75
89
|
};
|
|
90
|
+
var FieldLabel$1 = FieldLabel;
|
|
76
91
|
|
|
77
|
-
// NOTE: This string will be replaced
|
|
78
|
-
var version =
|
|
92
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
93
|
+
var version = "12.2.5";
|
|
79
94
|
|
|
80
|
-
exports
|
|
95
|
+
exports["default"] = FieldLabel$1;
|
|
81
96
|
exports.version = version;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _pt from 'prop-types';
|
|
2
|
-
import
|
|
2
|
+
import { cloneElement } from 'react';
|
|
3
3
|
import { warning } from '@commercetools-uikit/utils';
|
|
4
|
-
import
|
|
4
|
+
import '@emotion/react';
|
|
5
5
|
import IconButton from '@commercetools-uikit/icon-button';
|
|
6
6
|
import { InformationIcon } from '@commercetools-uikit/icons';
|
|
7
7
|
import Text from '@commercetools-uikit/text';
|
|
@@ -9,6 +9,7 @@ import Constraints from '@commercetools-uikit/constraints';
|
|
|
9
9
|
import Stack from '@commercetools-uikit/spacings-stack';
|
|
10
10
|
import Inline from '@commercetools-uikit/spacings-inline';
|
|
11
11
|
import Label from '@commercetools-uikit/label';
|
|
12
|
+
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
12
13
|
|
|
13
14
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
14
15
|
|
|
@@ -18,6 +19,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
18
19
|
} : {
|
|
19
20
|
name: "pfzph7-FieldLabel",
|
|
20
21
|
styles: "display:flex;justify-content:flex-end;label:FieldLabel;",
|
|
22
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZpZWxkLWxhYmVsLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFnSm9CIiwiZmlsZSI6ImZpZWxkLWxhYmVsLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7XG4gIGNsb25lRWxlbWVudCxcbiAgTW91c2VFdmVudCxcbiAgS2V5Ym9hcmRFdmVudCxcbiAgUmVhY3RFbGVtZW50LFxuICBSZWFjdE5vZGUsXG59IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7IHdhcm5pbmcgfSBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC91dGlscyc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgSWNvbkJ1dHRvbiBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC9pY29uLWJ1dHRvbic7XG5pbXBvcnQgeyBJbmZvcm1hdGlvbkljb24gfSBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC9pY29ucyc7XG5pbXBvcnQgVGV4dCBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC90ZXh0JztcbmltcG9ydCBDb25zdHJhaW50cyBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC9jb25zdHJhaW50cyc7XG5pbXBvcnQgU3RhY2sgZnJvbSAnQGNvbW1lcmNldG9vbHMtdWlraXQvc3BhY2luZ3Mtc3RhY2snO1xuaW1wb3J0IElubGluZSBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC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gICA8TGFiZWxcbiAgICAgICAgICAgICAgaXNCb2xkPXt0cnVlfVxuICAgICAgICAgICAgICBpc1JlcXVpcmVkSW5kaWNhdG9yVmlzaWJsZT17cHJvcHMuaGFzUmVxdWlyZWRJbmRpY2F0b3J9XG4gICAgICAgICAgICAgIHRvbmU9e3Byb3BzLnRvbmV9XG4gICAgICAgICAgICAgIGlkPXtwcm9wcy5pZH1cbiAgICAgICAgICAgICAgaHRtbEZvcj17cHJvcHMuaHRtbEZvcn1cbiAgICAgICAgICAgID5cbiAgICAgICAgICAgICAge3Byb3BzLnRpdGxlfVxuICAgICAgICAgICAgPC9MYWJlbD5cbiAgICAgICAgICA8L1RleHQuV3JhcD5cbiAgICAgICAgICB7cHJvcHMub25JbmZvQnV0dG9uQ2xpY2sgJiYgKFxuICAgICAgICAgICAgPEljb25CdXR0b25cbiAgICAgICAgICAgICAgbGFiZWw9XCJNb3JlIEluZm9cIlxuICAgICAgICAgICAgICBpY29uPXs8SW5mb3JtYXRpb25JY29uIHNpemU9XCJtZWRpdW1cIiAvPn1cbiAgICAgICAgICAgICAgc2l6ZT1cInNtYWxsXCJcbiAgICAgICAgICAgICAgb25DbGljaz17cHJvcHMub25JbmZvQnV0dG9uQ2xpY2t9XG4gICAgICAgICAgICAvPlxuICAgICAgICAgICl9XG4gICAgICAgIDwvSW5saW5lPlxuXG4gICAgICAgIHtwcm9wcy5oaW50ICYmIChcbiAgICAgICAgICA8SW5saW5lIGFsaWduSXRlbXM9XCJmbGV4U3RhcnRcIiBzY2FsZT1cInhzXCI+XG4gICAgICAgICAgICB7cHJvcHMuaGludEljb24gJiYgKFxuICAgICAgICAgICAgICA8SW5saW5lPlxuICAgICAgICAgICAgICAgIHtjbG9uZUVsZW1lbnQocHJvcHMuaGludEljb24sIHtcbiAgICAgICAgICAgICAgICAgIC8vIEZJWE1FOiBhZGQgcHJvcGVyIHRvbmUgd2hlbiB0b25lcyBhcmUgcmVmYWN0b3JlZFxuICAgICAgICAgICAgICAgICAgc2l6ZTogJ21lZGl1bScsXG4gICAgICAgICAgICAgICAgICBjb2xvcjogcHJvcHMuaGludEljb24ucHJvcHMuY29sb3IgfHwgJ3dhcm5pbmcnLFxuICAgICAgICAgICAgICAgIH0pfVxuICAgICAgICAgICAgICA8L0lubGluZT5cbiAgICAgICAgICAgICl9XG4gICAgICAgICAgICB7cHJvcHMuaGludCAmJiAoXG4gICAgICAgICAgICAgIDxUZXh0LkRldGFpbCB0b25lPXtwcm9wcy50b25lfT57cHJvcHMuaGludH08L1RleHQuRGV0YWlsPlxuICAgICAgICAgICAgKX1cbiAgICAgICAgICA8L0lubGluZT5cbiAgICAgICAgKX1cbiAgICAgICAge3Byb3BzLmRlc2NyaXB0aW9uICYmIChcbiAgICAgICAgICA8VGV4dC5XcmFwPlxuICAgICAgICAgICAgPFRleHQuRGV0YWlsIHRvbmU9e3Byb3BzLnRvbmV9Pntwcm9wcy5kZXNjcmlwdGlvbn08L1RleHQuRGV0YWlsPlxuICAgICAgICAgIDwvVGV4dC5XcmFwPlxuICAgICAgICApfVxuXG4gICAgICAgIHtwcm9wcy5iYWRnZSAmJiAoXG4gICAgICAgICAgPGRpdlxuICAgICAgICAgICAgY3NzPXtjc3NgXG4gICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgICAgICAgICAgIGp1c3RpZnktY29udGVudDogZmxleC1lbmQ7XG4gICAgICAgICAgICBgfVxuICAgICAgICAgID5cbiAgICAgICAgICAgIHtwcm9wcy5iYWRnZX1cbiAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgKX1cbiAgICAgIDwvU3RhY2s+XG4gICAgPC9Db25zdHJhaW50cy5Ib3Jpem9udGFsPlxuICApO1xufTtcblxuRmllbGRMYWJlbC5kaXNwbGF5TmFtZSA9ICdGaWVsZExhYmVsJztcbkZpZWxkTGFiZWwuZGVmYXVsdFByb3BzID0ge1xuICBob3Jpem9udGFsQ29uc3RyYWludDogJ3NjYWxlJyxcbn07XG5cbmV4cG9ydCBkZWZhdWx0IEZpZWxkTGFiZWw7XG4iXX0= */",
|
|
21
23
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
22
24
|
};
|
|
23
25
|
|
|
@@ -28,39 +30,53 @@ var FieldLabel = function FieldLabel(props) {
|
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
return jsx(Constraints.Horizontal, {
|
|
31
|
-
max: props.horizontalConstraint
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
33
|
+
max: props.horizontalConstraint,
|
|
34
|
+
children: jsxs(Stack, {
|
|
35
|
+
scale: "xs",
|
|
36
|
+
children: [jsxs(Inline, {
|
|
37
|
+
alignItems: "flexStart",
|
|
38
|
+
scale: "xs",
|
|
39
|
+
children: [jsx(Text.Wrap, {
|
|
40
|
+
children: jsx(Label, {
|
|
41
|
+
isBold: true,
|
|
42
|
+
isRequiredIndicatorVisible: props.hasRequiredIndicator,
|
|
43
|
+
tone: props.tone,
|
|
44
|
+
id: props.id,
|
|
45
|
+
htmlFor: props.htmlFor,
|
|
46
|
+
children: props.title
|
|
47
|
+
})
|
|
48
|
+
}), props.onInfoButtonClick && jsx(IconButton, {
|
|
49
|
+
label: "More Info",
|
|
50
|
+
icon: jsx(InformationIcon, {
|
|
51
|
+
size: "medium"
|
|
52
|
+
}),
|
|
53
|
+
size: "small",
|
|
54
|
+
onClick: props.onInfoButtonClick
|
|
55
|
+
})]
|
|
56
|
+
}), props.hint && jsxs(Inline, {
|
|
57
|
+
alignItems: "flexStart",
|
|
58
|
+
scale: "xs",
|
|
59
|
+
children: [props.hintIcon && jsx(Inline, {
|
|
60
|
+
children: /*#__PURE__*/cloneElement(props.hintIcon, {
|
|
61
|
+
// FIXME: add proper tone when tones are refactored
|
|
62
|
+
size: 'medium',
|
|
63
|
+
color: props.hintIcon.props.color || 'warning'
|
|
64
|
+
})
|
|
65
|
+
}), props.hint && jsx(Text.Detail, {
|
|
66
|
+
tone: props.tone,
|
|
67
|
+
children: props.hint
|
|
68
|
+
})]
|
|
69
|
+
}), props.description && jsx(Text.Wrap, {
|
|
70
|
+
children: jsx(Text.Detail, {
|
|
71
|
+
tone: props.tone,
|
|
72
|
+
children: props.description
|
|
73
|
+
})
|
|
74
|
+
}), props.badge && jsx("div", {
|
|
75
|
+
css: _ref,
|
|
76
|
+
children: props.badge
|
|
77
|
+
})]
|
|
78
|
+
})
|
|
79
|
+
});
|
|
64
80
|
};
|
|
65
81
|
|
|
66
82
|
FieldLabel.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -80,9 +96,9 @@ FieldLabel.displayName = 'FieldLabel';
|
|
|
80
96
|
FieldLabel.defaultProps = {
|
|
81
97
|
horizontalConstraint: 'scale'
|
|
82
98
|
};
|
|
99
|
+
var FieldLabel$1 = FieldLabel;
|
|
83
100
|
|
|
84
|
-
// NOTE: This string will be replaced
|
|
85
|
-
var version =
|
|
101
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
102
|
+
var version = "12.2.5";
|
|
86
103
|
|
|
87
|
-
export default
|
|
88
|
-
export { version };
|
|
104
|
+
export { FieldLabel$1 as default, version };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { MouseEvent, KeyboardEvent, ReactElement, ReactNode } from 'react';
|
|
2
|
-
export declare type TFieldLabelProps = {
|
|
3
|
-
title: string | ReactNode;
|
|
4
|
-
hint?: string | ReactNode;
|
|
5
|
-
description?: string | ReactNode;
|
|
6
|
-
onInfoButtonClick?: (event: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>) => void;
|
|
7
|
-
tone?: 'primary' | 'inverted';
|
|
8
|
-
hintIcon?: ReactElement;
|
|
9
|
-
badge?: ReactNode;
|
|
10
|
-
hasRequiredIndicator?: boolean;
|
|
11
|
-
htmlFor?: string;
|
|
12
|
-
id?: string;
|
|
13
|
-
horizontalConstraint?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
|
|
14
|
-
};
|
|
15
|
-
declare const FieldLabel: {
|
|
16
|
-
(props: TFieldLabelProps): JSX.Element;
|
|
17
|
-
displayName: string;
|
|
18
|
-
defaultProps: {
|
|
19
|
-
horizontalConstraint: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export default FieldLabel;
|
|
1
|
+
import { MouseEvent, KeyboardEvent, ReactElement, ReactNode } from 'react';
|
|
2
|
+
export declare type TFieldLabelProps = {
|
|
3
|
+
title: string | ReactNode;
|
|
4
|
+
hint?: string | ReactNode;
|
|
5
|
+
description?: string | ReactNode;
|
|
6
|
+
onInfoButtonClick?: (event: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>) => void;
|
|
7
|
+
tone?: 'primary' | 'inverted';
|
|
8
|
+
hintIcon?: ReactElement;
|
|
9
|
+
badge?: ReactNode;
|
|
10
|
+
hasRequiredIndicator?: boolean;
|
|
11
|
+
htmlFor?: string;
|
|
12
|
+
id?: string;
|
|
13
|
+
horizontalConstraint?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
|
|
14
|
+
};
|
|
15
|
+
declare const FieldLabel: {
|
|
16
|
+
(props: TFieldLabelProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
defaultProps: {
|
|
19
|
+
horizontalConstraint: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export default FieldLabel;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export { default } from './
|
|
3
|
-
export
|
|
4
|
-
export declare type TFieldLabelProps = FieldLabelProps;
|
|
1
|
+
export { default } from './field-label';
|
|
2
|
+
export { default as version } from './version';
|
|
3
|
+
export * from './export-types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "
|
|
2
|
-
export default _default;
|
|
1
|
+
declare const _default: "__@UI_KIT_PACKAGE/VERSION_OF_RELEASE__";
|
|
2
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/field-label",
|
|
3
3
|
"description": "The FieldLabel component represents the label for a field in a form.",
|
|
4
|
-
"version": "12.2.
|
|
4
|
+
"version": "12.2.5",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -9,30 +9,33 @@
|
|
|
9
9
|
"directory": "packages/components/field-label"
|
|
10
10
|
},
|
|
11
11
|
"homepage": "https://uikit.commercetools.com",
|
|
12
|
-
"keywords": [
|
|
12
|
+
"keywords": [
|
|
13
|
+
"javascript",
|
|
14
|
+
"design system",
|
|
15
|
+
"react",
|
|
16
|
+
"uikit"
|
|
17
|
+
],
|
|
13
18
|
"license": "MIT",
|
|
14
|
-
"private": false,
|
|
15
19
|
"publishConfig": {
|
|
16
20
|
"access": "public"
|
|
17
21
|
},
|
|
18
22
|
"sideEffects": false,
|
|
19
23
|
"main": "dist/commercetools-uikit-field-label.cjs.js",
|
|
20
24
|
"module": "dist/commercetools-uikit-field-label.esm.js",
|
|
21
|
-
"files": [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
25
28
|
"dependencies": {
|
|
26
|
-
"@babel/runtime": "7.
|
|
27
|
-
"@babel/runtime-corejs3": "7.
|
|
28
|
-
"@commercetools-uikit/constraints": "12.2.
|
|
29
|
-
"@commercetools-uikit/icon-button": "12.2.
|
|
30
|
-
"@commercetools-uikit/icons": "12.2.
|
|
31
|
-
"@commercetools-uikit/label": "12.2.
|
|
32
|
-
"@commercetools-uikit/spacings-inline": "12.2.
|
|
33
|
-
"@commercetools-uikit/spacings-stack": "12.2.
|
|
34
|
-
"@commercetools-uikit/text": "12.2.
|
|
35
|
-
"@commercetools-uikit/utils": "12.2.
|
|
29
|
+
"@babel/runtime": "7.16.3",
|
|
30
|
+
"@babel/runtime-corejs3": "7.16.3",
|
|
31
|
+
"@commercetools-uikit/constraints": "12.2.5",
|
|
32
|
+
"@commercetools-uikit/icon-button": "12.2.5",
|
|
33
|
+
"@commercetools-uikit/icons": "12.2.5",
|
|
34
|
+
"@commercetools-uikit/label": "12.2.5",
|
|
35
|
+
"@commercetools-uikit/spacings-inline": "12.2.5",
|
|
36
|
+
"@commercetools-uikit/spacings-stack": "12.2.5",
|
|
37
|
+
"@commercetools-uikit/text": "12.2.5",
|
|
38
|
+
"@commercetools-uikit/utils": "12.2.5",
|
|
36
39
|
"@emotion/react": "^11.4.0",
|
|
37
40
|
"@emotion/styled": "^11.3.0",
|
|
38
41
|
"prop-types": "15.7.2",
|