pallote-react 0.3.1 → 0.3.3
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/dist/components/Checkbox.js +4 -4
- package/dist/components/Checkboxes.js +4 -4
- package/dist/components/Divider.js +2 -2
- package/dist/components/Input.js +5 -4
- package/dist/components/List.js +1 -1
- package/dist/components/ListItem.js +4 -4
- package/dist/components/Radio.js +4 -6
- package/dist/components/RadioButtons.js +4 -4
- package/dist/components/Select.js +5 -5
- package/dist/components/Status.js +2 -2
- package/dist/components/Switch.js +6 -6
- package/dist/components/Tag.js +2 -2
- package/dist/components/Textarea.js +5 -4
- package/package.json +2 -2
|
@@ -8,7 +8,7 @@ exports.Checkbox = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
const _excluded = ["id", "value", "label", "checked", "disabled", "
|
|
11
|
+
const _excluded = ["id", "value", "label", "checked", "disabled", "optional", "className"];
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
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); }
|
|
14
14
|
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; }
|
|
@@ -20,7 +20,7 @@ const Checkbox = _ref => {
|
|
|
20
20
|
label,
|
|
21
21
|
checked,
|
|
22
22
|
disabled,
|
|
23
|
-
|
|
23
|
+
optional,
|
|
24
24
|
className
|
|
25
25
|
} = _ref,
|
|
26
26
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -37,7 +37,7 @@ const Checkbox = _ref => {
|
|
|
37
37
|
checked: checked,
|
|
38
38
|
"aria-checked": checked,
|
|
39
39
|
disabled: disabled,
|
|
40
|
-
required:
|
|
40
|
+
required: !(disabled || optional)
|
|
41
41
|
}, props)), /*#__PURE__*/_react.default.createElement("label", {
|
|
42
42
|
className: (0, _classnames.default)('checkbox_label'),
|
|
43
43
|
htmlFor: id
|
|
@@ -50,6 +50,6 @@ Checkbox.propTypes = {
|
|
|
50
50
|
label: _propTypes.default.string,
|
|
51
51
|
checked: _propTypes.default.bool,
|
|
52
52
|
disabled: _propTypes.default.bool,
|
|
53
|
-
|
|
53
|
+
optional: _propTypes.default.bool,
|
|
54
54
|
className: _propTypes.default.node
|
|
55
55
|
};
|
|
@@ -16,7 +16,7 @@ const Checkboxes = _ref => {
|
|
|
16
16
|
hint,
|
|
17
17
|
error,
|
|
18
18
|
disabled,
|
|
19
|
-
|
|
19
|
+
optional,
|
|
20
20
|
direction,
|
|
21
21
|
children,
|
|
22
22
|
className
|
|
@@ -25,7 +25,7 @@ const Checkboxes = _ref => {
|
|
|
25
25
|
className: (0, _classnames.default)(['input', {
|
|
26
26
|
'js-error': error,
|
|
27
27
|
'input-disabled': disabled,
|
|
28
|
-
'input-
|
|
28
|
+
'input-optional': optional
|
|
29
29
|
}, className]),
|
|
30
30
|
onChange: onChange,
|
|
31
31
|
"aria-description": hint
|
|
@@ -39,7 +39,7 @@ const Checkboxes = _ref => {
|
|
|
39
39
|
["radios-".concat(direction)]: direction
|
|
40
40
|
}])
|
|
41
41
|
}, _react.default.Children.map(children, child => /*#__PURE__*/_react.default.isValidElement(child) ? /*#__PURE__*/_react.default.cloneElement(child, {
|
|
42
|
-
|
|
42
|
+
optional,
|
|
43
43
|
disabled
|
|
44
44
|
}) : child)));
|
|
45
45
|
};
|
|
@@ -51,7 +51,7 @@ Checkboxes.propTypes = {
|
|
|
51
51
|
hint: _propTypes.default.string,
|
|
52
52
|
error: _propTypes.default.bool,
|
|
53
53
|
disabled: _propTypes.default.bool,
|
|
54
|
-
|
|
54
|
+
optional: _propTypes.default.bool,
|
|
55
55
|
direction: _propTypes.default.oneOf(['portrait', 'landscape']),
|
|
56
56
|
children: _propTypes.default.node,
|
|
57
57
|
className: _propTypes.default.node
|
|
@@ -22,8 +22,8 @@ const Divider = _ref => {
|
|
|
22
22
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
23
23
|
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
24
24
|
className: (0, _classnames.default)(['divider', {
|
|
25
|
-
["divider
|
|
26
|
-
["divider
|
|
25
|
+
["divider-".concat(direction)]: direction,
|
|
26
|
+
["divider-".concat(size)]: size
|
|
27
27
|
}, className])
|
|
28
28
|
}, props));
|
|
29
29
|
};
|
package/dist/components/Input.js
CHANGED
|
@@ -11,7 +11,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _react2 = require("@phosphor-icons/react");
|
|
14
|
-
const _excluded = ["onChange", "type", "id", "placeholder", "label", "icon", "isFocused", "error", "disabled", "
|
|
14
|
+
const _excluded = ["onChange", "type", "id", "placeholder", "label", "icon", "isFocused", "error", "disabled", "optional", "hint", "className"];
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -29,7 +29,7 @@ const Input = _ref => {
|
|
|
29
29
|
isFocused,
|
|
30
30
|
error,
|
|
31
31
|
disabled,
|
|
32
|
-
|
|
32
|
+
optional,
|
|
33
33
|
hint,
|
|
34
34
|
className
|
|
35
35
|
} = _ref,
|
|
@@ -45,7 +45,7 @@ const Input = _ref => {
|
|
|
45
45
|
className: (0, _classnames.default)(['input', {
|
|
46
46
|
'js-error': error,
|
|
47
47
|
'input-disabled': disabled,
|
|
48
|
-
'input-
|
|
48
|
+
'input-optional': optional,
|
|
49
49
|
'input-withIcon': icon
|
|
50
50
|
}, className]),
|
|
51
51
|
onChange: onChange
|
|
@@ -64,6 +64,7 @@ const Input = _ref => {
|
|
|
64
64
|
id: id,
|
|
65
65
|
placeholder: placeholder,
|
|
66
66
|
disabled: disabled,
|
|
67
|
+
required: !(disabled || optional),
|
|
67
68
|
"aria-description": hint
|
|
68
69
|
}, props)));
|
|
69
70
|
};
|
|
@@ -78,7 +79,7 @@ Input.propTypes = {
|
|
|
78
79
|
isFocused: _propTypes.default.bool,
|
|
79
80
|
error: _propTypes.default.bool,
|
|
80
81
|
disabled: _propTypes.default.bool,
|
|
81
|
-
|
|
82
|
+
optional: _propTypes.default.bool,
|
|
82
83
|
hint: _propTypes.default.string,
|
|
83
84
|
className: _propTypes.default.node
|
|
84
85
|
};
|
package/dist/components/List.js
CHANGED
|
@@ -22,7 +22,7 @@ const List = _ref => {
|
|
|
22
22
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
23
23
|
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
24
24
|
className: (0, _classnames.default)(['list', {
|
|
25
|
-
'list
|
|
25
|
+
'list-dense': dense
|
|
26
26
|
}, className])
|
|
27
27
|
}, props), children);
|
|
28
28
|
};
|
|
@@ -24,12 +24,12 @@ const ListItem = _ref => {
|
|
|
24
24
|
} = _ref,
|
|
25
25
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
26
|
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
27
|
-
className: (0, _classnames.default)(['
|
|
28
|
-
'
|
|
29
|
-
'
|
|
27
|
+
className: (0, _classnames.default)(['list_item', {
|
|
28
|
+
'list_item-dense': dense,
|
|
29
|
+
'list_item-bold': bold
|
|
30
30
|
}, className])
|
|
31
31
|
}, props), icon ? /*#__PURE__*/_react.default.createElement("div", {
|
|
32
|
-
className: '
|
|
32
|
+
className: 'list_itemIcon'
|
|
33
33
|
}, icon) : null, /*#__PURE__*/_react.default.createElement(_Text.Text, {
|
|
34
34
|
weight: bold === true ? 'bold' : ''
|
|
35
35
|
}, children));
|
package/dist/components/Radio.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.Radio = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
const _excluded = ["id", "name", "value", "label", "checked", "disabled", "
|
|
11
|
+
const _excluded = ["id", "name", "value", "label", "checked", "disabled", "optional", "className"];
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
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); }
|
|
14
14
|
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; }
|
|
@@ -21,15 +21,13 @@ const Radio = _ref => {
|
|
|
21
21
|
label,
|
|
22
22
|
checked,
|
|
23
23
|
disabled,
|
|
24
|
-
|
|
24
|
+
optional,
|
|
25
25
|
className
|
|
26
26
|
} = _ref,
|
|
27
27
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
28
28
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
29
29
|
className: (0, _classnames.default)(['radio', {
|
|
30
30
|
'radio-disabled': disabled
|
|
31
|
-
}, {
|
|
32
|
-
'radio-required': required
|
|
33
31
|
}, className])
|
|
34
32
|
}, /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
35
33
|
className: (0, _classnames.default)('radio_control'),
|
|
@@ -40,7 +38,7 @@ const Radio = _ref => {
|
|
|
40
38
|
checked: checked,
|
|
41
39
|
"aria-checked": checked,
|
|
42
40
|
disabled: disabled,
|
|
43
|
-
required:
|
|
41
|
+
required: !(disabled || optional)
|
|
44
42
|
}, props)), /*#__PURE__*/_react.default.createElement("label", {
|
|
45
43
|
className: (0, _classnames.default)('radio_label'),
|
|
46
44
|
htmlFor: id
|
|
@@ -54,6 +52,6 @@ Radio.propTypes = {
|
|
|
54
52
|
label: _propTypes.default.string,
|
|
55
53
|
checked: _propTypes.default.bool,
|
|
56
54
|
disabled: _propTypes.default.bool,
|
|
57
|
-
|
|
55
|
+
optional: _propTypes.default.bool,
|
|
58
56
|
className: _propTypes.default.node
|
|
59
57
|
};
|
|
@@ -16,7 +16,7 @@ const RadioButtons = _ref => {
|
|
|
16
16
|
hint,
|
|
17
17
|
error,
|
|
18
18
|
disabled,
|
|
19
|
-
|
|
19
|
+
optional,
|
|
20
20
|
direction,
|
|
21
21
|
children,
|
|
22
22
|
className
|
|
@@ -25,7 +25,7 @@ const RadioButtons = _ref => {
|
|
|
25
25
|
className: (0, _classnames.default)(['input', {
|
|
26
26
|
'js-error': error,
|
|
27
27
|
'input-disabled': disabled,
|
|
28
|
-
'input-
|
|
28
|
+
'input-optional': optional
|
|
29
29
|
}, className]),
|
|
30
30
|
onChange: onChange,
|
|
31
31
|
"aria-description": hint
|
|
@@ -39,7 +39,7 @@ const RadioButtons = _ref => {
|
|
|
39
39
|
["radios-".concat(direction)]: direction
|
|
40
40
|
}])
|
|
41
41
|
}, _react.default.Children.map(children, child => /*#__PURE__*/_react.default.isValidElement(child) ? /*#__PURE__*/_react.default.cloneElement(child, {
|
|
42
|
-
|
|
42
|
+
optional,
|
|
43
43
|
disabled
|
|
44
44
|
}) : child)));
|
|
45
45
|
};
|
|
@@ -51,7 +51,7 @@ RadioButtons.propTypes = {
|
|
|
51
51
|
direction: _propTypes.default.oneOf(['portrait', 'landscape']),
|
|
52
52
|
error: _propTypes.default.bool,
|
|
53
53
|
disabled: _propTypes.default.bool,
|
|
54
|
-
|
|
54
|
+
optional: _propTypes.default.bool,
|
|
55
55
|
hint: _propTypes.default.string,
|
|
56
56
|
children: _propTypes.default.node,
|
|
57
57
|
className: _propTypes.default.node
|
|
@@ -10,7 +10,7 @@ exports.Select = void 0;
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
const _excluded = ["onChange", "id", "label", "isFocused", "error", "disabled", "
|
|
13
|
+
const _excluded = ["onChange", "id", "label", "isFocused", "error", "disabled", "optional", "hint", "children", "className"];
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -25,7 +25,7 @@ const Select = _ref => {
|
|
|
25
25
|
isFocused,
|
|
26
26
|
error,
|
|
27
27
|
disabled,
|
|
28
|
-
|
|
28
|
+
optional,
|
|
29
29
|
hint,
|
|
30
30
|
children,
|
|
31
31
|
className
|
|
@@ -42,7 +42,7 @@ const Select = _ref => {
|
|
|
42
42
|
'input-focused': isFocused,
|
|
43
43
|
'js-error': error,
|
|
44
44
|
'input-disabled': disabled,
|
|
45
|
-
'input-
|
|
45
|
+
'input-optional': optional
|
|
46
46
|
}, className]),
|
|
47
47
|
onChange: onChange
|
|
48
48
|
}, label && /*#__PURE__*/_react.default.createElement("label", {
|
|
@@ -56,7 +56,7 @@ const Select = _ref => {
|
|
|
56
56
|
name: id,
|
|
57
57
|
id: id,
|
|
58
58
|
disabled: disabled,
|
|
59
|
-
required:
|
|
59
|
+
required: !(disabled || optional),
|
|
60
60
|
"aria-description": hint
|
|
61
61
|
}, props), children));
|
|
62
62
|
};
|
|
@@ -68,7 +68,7 @@ Select.propTypes = {
|
|
|
68
68
|
isFocused: _propTypes.default.bool,
|
|
69
69
|
error: _propTypes.default.bool,
|
|
70
70
|
disabled: _propTypes.default.bool,
|
|
71
|
-
|
|
71
|
+
optional: _propTypes.default.bool,
|
|
72
72
|
hint: _propTypes.default.string,
|
|
73
73
|
children: _propTypes.default.any,
|
|
74
74
|
className: _propTypes.default.node
|
|
@@ -24,8 +24,8 @@ const Status = _ref => {
|
|
|
24
24
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
25
25
|
return /*#__PURE__*/_react.default.createElement(_Text.Text, _extends({
|
|
26
26
|
className: (0, _classnames.default)(['status', {
|
|
27
|
-
["status
|
|
28
|
-
'status
|
|
27
|
+
["status-".concat(color)]: color,
|
|
28
|
+
'status-dense': dense
|
|
29
29
|
}, className])
|
|
30
30
|
}, props), children);
|
|
31
31
|
};
|
|
@@ -25,24 +25,24 @@ const Switch = _ref => {
|
|
|
25
25
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
26
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
27
27
|
className: (0, _classnames.default)(['switch', {
|
|
28
|
-
'switch
|
|
28
|
+
'switch-disabled': disabled
|
|
29
29
|
}, className])
|
|
30
30
|
}, startLabel ? /*#__PURE__*/_react.default.createElement(_Text.Text, {
|
|
31
|
-
className: (0, _classnames.default)('
|
|
31
|
+
className: (0, _classnames.default)('switch_label'),
|
|
32
32
|
variant: "body"
|
|
33
33
|
}, startLabel) : null, /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
34
|
-
className: (0, _classnames.default)('
|
|
34
|
+
className: (0, _classnames.default)('switch_input'),
|
|
35
35
|
type: "checkbox",
|
|
36
36
|
name: id,
|
|
37
37
|
id: id,
|
|
38
38
|
disabled: disabled
|
|
39
39
|
}, props)), /*#__PURE__*/_react.default.createElement("label", {
|
|
40
|
-
className: (0, _classnames.default)('
|
|
40
|
+
className: (0, _classnames.default)('switch_switch'),
|
|
41
41
|
htmlFor: id
|
|
42
42
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
43
|
-
className: (0, _classnames.default)('
|
|
43
|
+
className: (0, _classnames.default)('switch_toggle')
|
|
44
44
|
})), endLabel ? /*#__PURE__*/_react.default.createElement(_Text.Text, {
|
|
45
|
-
className: (0, _classnames.default)('
|
|
45
|
+
className: (0, _classnames.default)('switch_label'),
|
|
46
46
|
variant: "body"
|
|
47
47
|
}, endLabel) : null);
|
|
48
48
|
};
|
package/dist/components/Tag.js
CHANGED
|
@@ -24,8 +24,8 @@ const Tag = _ref => {
|
|
|
24
24
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
25
25
|
return /*#__PURE__*/_react.default.createElement(_Text.Text, _extends({
|
|
26
26
|
className: (0, _classnames.default)(['tag', {
|
|
27
|
-
["tag
|
|
28
|
-
'tag
|
|
27
|
+
["tag-".concat(color)]: color,
|
|
28
|
+
'tag-dense': dense
|
|
29
29
|
}, className])
|
|
30
30
|
}, props), children);
|
|
31
31
|
};
|
|
@@ -10,7 +10,7 @@ exports.Textarea = void 0;
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
const _excluded = ["onChange", "id", "placeholder", "label", "isFocused", "error", "disabled", "
|
|
13
|
+
const _excluded = ["onChange", "id", "placeholder", "label", "isFocused", "error", "disabled", "optional", "hint", "className"];
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -26,7 +26,7 @@ const Textarea = _ref => {
|
|
|
26
26
|
isFocused,
|
|
27
27
|
error,
|
|
28
28
|
disabled,
|
|
29
|
-
|
|
29
|
+
optional,
|
|
30
30
|
hint,
|
|
31
31
|
className
|
|
32
32
|
} = _ref,
|
|
@@ -41,7 +41,7 @@ const Textarea = _ref => {
|
|
|
41
41
|
className: (0, _classnames.default)(['input', {
|
|
42
42
|
'js-error': error,
|
|
43
43
|
'input-disabled': disabled,
|
|
44
|
-
'input-
|
|
44
|
+
'input-optional': optional
|
|
45
45
|
}, className]),
|
|
46
46
|
onChange: onChange
|
|
47
47
|
}, label && /*#__PURE__*/_react.default.createElement("label", {
|
|
@@ -56,6 +56,7 @@ const Textarea = _ref => {
|
|
|
56
56
|
id: id,
|
|
57
57
|
placeholder: placeholder,
|
|
58
58
|
disabled: disabled,
|
|
59
|
+
required: !(disabled || optional),
|
|
59
60
|
rows: 4,
|
|
60
61
|
"aria-description": hint
|
|
61
62
|
}, props)));
|
|
@@ -69,7 +70,7 @@ Textarea.propTypes = {
|
|
|
69
70
|
isFocused: _propTypes.default.bool,
|
|
70
71
|
error: _propTypes.default.bool,
|
|
71
72
|
disabled: _propTypes.default.bool,
|
|
72
|
-
|
|
73
|
+
optional: _propTypes.default.bool,
|
|
73
74
|
hint: _propTypes.default.string,
|
|
74
75
|
className: _propTypes.default.node
|
|
75
76
|
};
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "arnymax"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.3.
|
|
7
|
+
"version": "0.3.3",
|
|
8
8
|
"private": false,
|
|
9
9
|
"keywords": [
|
|
10
10
|
"react",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@testing-library/user-event": "^13.5.0",
|
|
31
31
|
"classnames": "^2.3.2",
|
|
32
32
|
"eslint": "^8.48.0",
|
|
33
|
-
"pallote-css": "^0.3.
|
|
33
|
+
"pallote-css": "^0.3.5",
|
|
34
34
|
"react": "^18.2.0",
|
|
35
35
|
"react-dom": "^18.2.0",
|
|
36
36
|
"react-router-dom": "^6.15.0",
|