colibri-ui 0.7.68 → 0.7.69
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/Chip/Chip.module.css +1 -1
- package/Input/index.js +3 -1
- package/Input/index.props.d.ts +1 -0
- package/RadioGroup/index.d.ts +0 -1
- package/RadioGroup/index.js +2 -5
- package/Select/index.d.ts +1 -1
- package/Select/index.js +2 -0
- package/Select/index.props.d.ts +1 -0
- package/base/FormField/FormField.module.css +6 -0
- package/base/FormField/index.js +9 -4
- package/base/FormField/index.props.d.ts +1 -0
- package/esm/Chip/Chip.module.css +1 -1
- package/esm/Input/index.js +3 -1
- package/esm/Input/index.props.d.ts +1 -0
- package/esm/RadioGroup/index.d.ts +0 -1
- package/esm/RadioGroup/index.js +2 -5
- package/esm/Select/index.d.ts +1 -1
- package/esm/Select/index.js +2 -0
- package/esm/Select/index.props.d.ts +1 -0
- package/esm/base/FormField/FormField.module.css +6 -0
- package/esm/base/FormField/index.js +9 -4
- package/esm/base/FormField/index.props.d.ts +1 -0
- package/package.json +1 -1
package/Chip/Chip.module.css
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.inner {
|
|
7
|
-
place-items: stretch flex-start;
|
|
8
7
|
box-sizing: border-box;
|
|
9
8
|
display: flex;
|
|
10
9
|
font-family: Roboto, Arial, sans-serif;
|
|
11
10
|
-webkit-font-smoothing: antialiased;
|
|
12
11
|
-moz-osx-font-smoothing: grayscale;
|
|
13
12
|
min-width: 0;
|
|
13
|
+
place-items: stretch flex-start;
|
|
14
14
|
transition-duration: 0.3s;
|
|
15
15
|
transition-property: background, box-shadow, transform;
|
|
16
16
|
transition-timing-function: ease;
|
package/Input/index.js
CHANGED
|
@@ -21,15 +21,17 @@ var Input = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
21
21
|
label = _a.label,
|
|
22
22
|
hint = _a.hint,
|
|
23
23
|
error = _a.error,
|
|
24
|
+
required = _a.required,
|
|
24
25
|
onChange = _a.onChange,
|
|
25
26
|
_b = _a.variant,
|
|
26
27
|
variant = _b === void 0 ? "primary" : _b,
|
|
27
28
|
_c = _a.size,
|
|
28
29
|
size = _c === void 0 ? "m" : _c,
|
|
29
|
-
props = tslib.__rest(_a, ["className", "startIcon", "endIcon", "label", "hint", "error", "onChange", "variant", "size"]);
|
|
30
|
+
props = tslib.__rest(_a, ["className", "startIcon", "endIcon", "label", "hint", "error", "required", "onChange", "variant", "size"]);
|
|
30
31
|
return /*#__PURE__*/React__default.default.createElement(index.default, {
|
|
31
32
|
className: classNames__default.default(className),
|
|
32
33
|
label: label,
|
|
34
|
+
required: required,
|
|
33
35
|
hint: hint,
|
|
34
36
|
error: error
|
|
35
37
|
}, /*#__PURE__*/React__default.default.createElement(index$1.default, {
|
package/Input/index.props.d.ts
CHANGED
package/RadioGroup/index.d.ts
CHANGED
package/RadioGroup/index.js
CHANGED
|
@@ -25,14 +25,11 @@ var RadioGroup = /*#__PURE__*/React.memo(function (_a) {
|
|
|
25
25
|
wrapped = _c === void 0 ? false : _c,
|
|
26
26
|
className = _a.className,
|
|
27
27
|
_d = _a.disabled,
|
|
28
|
-
disabled = _d === void 0 ? false : _d
|
|
29
|
-
_e = _a.hasError,
|
|
30
|
-
hasError = _e === void 0 ? false : _e;
|
|
28
|
+
disabled = _d === void 0 ? false : _d;
|
|
31
29
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
32
30
|
className: clx(styles__default.default.group, {
|
|
33
31
|
column: column,
|
|
34
|
-
wrapped: wrapped
|
|
35
|
-
hasError: hasError
|
|
32
|
+
wrapped: wrapped
|
|
36
33
|
}, className)
|
|
37
34
|
}, options.map(function (option) {
|
|
38
35
|
var id = option.id,
|
package/Select/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { SelectProps } from "./index.props";
|
|
3
|
-
declare const Select: <T extends string>({ options, value, zIndex, label, hint, error, placeholder, disabled, fullWidth, onChange, }: SelectProps<T>) => React.JSX.Element;
|
|
3
|
+
declare const Select: <T extends string>({ options, value, zIndex, label, hint, error, required, placeholder, disabled, fullWidth, onChange, }: SelectProps<T>) => React.JSX.Element;
|
|
4
4
|
export default Select;
|
package/Select/index.js
CHANGED
|
@@ -26,6 +26,7 @@ var Select = function Select(_a) {
|
|
|
26
26
|
label = _a.label,
|
|
27
27
|
hint = _a.hint,
|
|
28
28
|
error = _a.error,
|
|
29
|
+
required = _a.required,
|
|
29
30
|
placeholder = _a.placeholder,
|
|
30
31
|
disabled = _a.disabled,
|
|
31
32
|
_c = _a.fullWidth,
|
|
@@ -56,6 +57,7 @@ var Select = function Select(_a) {
|
|
|
56
57
|
className: clx(styles__default.default["form-field"], {
|
|
57
58
|
"form-field_fullWidth": fullWidth ? 1 : 0
|
|
58
59
|
}),
|
|
60
|
+
required: required,
|
|
59
61
|
label: label,
|
|
60
62
|
hint: hint,
|
|
61
63
|
error: error
|
package/Select/index.props.d.ts
CHANGED
package/base/FormField/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var classNames = require('classnames');
|
|
6
|
+
var classNames = require('classnames/bind');
|
|
7
7
|
var index = require('../../Typography/index.js');
|
|
8
8
|
var styles = require('./FormField.module.css');
|
|
9
9
|
|
|
@@ -13,18 +13,23 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
13
13
|
var classNames__default = /*#__PURE__*/_interopDefault(classNames);
|
|
14
14
|
var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
15
15
|
|
|
16
|
+
var clx = classNames__default.default.bind(styles__default.default);
|
|
16
17
|
var FormField = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
17
18
|
var label = _a.label,
|
|
18
19
|
hint = _a.hint,
|
|
19
20
|
children = _a.children,
|
|
20
21
|
error = _a.error,
|
|
22
|
+
required = _a.required,
|
|
21
23
|
className = _a.className;
|
|
22
24
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
23
|
-
className:
|
|
25
|
+
className: clx(styles__default.default.container, className),
|
|
24
26
|
ref: ref
|
|
25
|
-
}, label && /*#__PURE__*/React__default.default.createElement(index.default, {
|
|
27
|
+
}, label && ( /*#__PURE__*/React__default.default.createElement(index.default, {
|
|
28
|
+
className: clx(styles__default.default.label, {
|
|
29
|
+
label_required: !!required
|
|
30
|
+
}),
|
|
26
31
|
tag: "label"
|
|
27
|
-
}, label), children, hint && ( /*#__PURE__*/React__default.default.createElement(index.default, {
|
|
32
|
+
}, label)), children, hint && ( /*#__PURE__*/React__default.default.createElement(index.default, {
|
|
28
33
|
variant: error ? "alert" : "secondary",
|
|
29
34
|
tag: "span"
|
|
30
35
|
}, hint)));
|
package/esm/Chip/Chip.module.css
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.inner {
|
|
7
|
-
place-items: stretch flex-start;
|
|
8
7
|
box-sizing: border-box;
|
|
9
8
|
display: flex;
|
|
10
9
|
font-family: Roboto, Arial, sans-serif;
|
|
11
10
|
-webkit-font-smoothing: antialiased;
|
|
12
11
|
-moz-osx-font-smoothing: grayscale;
|
|
13
12
|
min-width: 0;
|
|
13
|
+
place-items: stretch flex-start;
|
|
14
14
|
transition-duration: 0.3s;
|
|
15
15
|
transition-property: background, box-shadow, transform;
|
|
16
16
|
transition-timing-function: ease;
|
package/esm/Input/index.js
CHANGED
|
@@ -12,15 +12,17 @@ var Input = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
12
12
|
label = _a.label,
|
|
13
13
|
hint = _a.hint,
|
|
14
14
|
error = _a.error,
|
|
15
|
+
required = _a.required,
|
|
15
16
|
onChange = _a.onChange,
|
|
16
17
|
_b = _a.variant,
|
|
17
18
|
variant = _b === void 0 ? "primary" : _b,
|
|
18
19
|
_c = _a.size,
|
|
19
20
|
size = _c === void 0 ? "m" : _c,
|
|
20
|
-
props = __rest(_a, ["className", "startIcon", "endIcon", "label", "hint", "error", "onChange", "variant", "size"]);
|
|
21
|
+
props = __rest(_a, ["className", "startIcon", "endIcon", "label", "hint", "error", "required", "onChange", "variant", "size"]);
|
|
21
22
|
return /*#__PURE__*/React__default.createElement(FormField, {
|
|
22
23
|
className: classNames(className),
|
|
23
24
|
label: label,
|
|
25
|
+
required: required,
|
|
24
26
|
hint: hint,
|
|
25
27
|
error: error
|
|
26
28
|
}, /*#__PURE__*/React__default.createElement(InputRoot, {
|
package/esm/RadioGroup/index.js
CHANGED
|
@@ -15,14 +15,11 @@ var RadioGroup = /*#__PURE__*/memo(function (_a) {
|
|
|
15
15
|
wrapped = _c === void 0 ? false : _c,
|
|
16
16
|
className = _a.className,
|
|
17
17
|
_d = _a.disabled,
|
|
18
|
-
disabled = _d === void 0 ? false : _d
|
|
19
|
-
_e = _a.hasError,
|
|
20
|
-
hasError = _e === void 0 ? false : _e;
|
|
18
|
+
disabled = _d === void 0 ? false : _d;
|
|
21
19
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
22
20
|
className: clx(styles.group, {
|
|
23
21
|
column: column,
|
|
24
|
-
wrapped: wrapped
|
|
25
|
-
hasError: hasError
|
|
22
|
+
wrapped: wrapped
|
|
26
23
|
}, className)
|
|
27
24
|
}, options.map(function (option) {
|
|
28
25
|
var id = option.id,
|
package/esm/Select/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { SelectProps } from "./index.props";
|
|
3
|
-
declare const Select: <T extends string>({ options, value, zIndex, label, hint, error, placeholder, disabled, fullWidth, onChange, }: SelectProps<T>) => React.JSX.Element;
|
|
3
|
+
declare const Select: <T extends string>({ options, value, zIndex, label, hint, error, required, placeholder, disabled, fullWidth, onChange, }: SelectProps<T>) => React.JSX.Element;
|
|
4
4
|
export default Select;
|
package/esm/Select/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var Select = function Select(_a) {
|
|
|
16
16
|
label = _a.label,
|
|
17
17
|
hint = _a.hint,
|
|
18
18
|
error = _a.error,
|
|
19
|
+
required = _a.required,
|
|
19
20
|
placeholder = _a.placeholder,
|
|
20
21
|
disabled = _a.disabled,
|
|
21
22
|
_c = _a.fullWidth,
|
|
@@ -46,6 +47,7 @@ var Select = function Select(_a) {
|
|
|
46
47
|
className: clx(styles["form-field"], {
|
|
47
48
|
"form-field_fullWidth": fullWidth ? 1 : 0
|
|
48
49
|
}),
|
|
50
|
+
required: required,
|
|
49
51
|
label: label,
|
|
50
52
|
hint: hint,
|
|
51
53
|
error: error
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import React__default, { forwardRef } from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
2
|
+
import classNames from 'classnames/bind';
|
|
3
3
|
import Typography from '../../Typography/index.js';
|
|
4
4
|
import styles from './FormField.module.css';
|
|
5
5
|
|
|
6
|
+
var clx = classNames.bind(styles);
|
|
6
7
|
var FormField = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
7
8
|
var label = _a.label,
|
|
8
9
|
hint = _a.hint,
|
|
9
10
|
children = _a.children,
|
|
10
11
|
error = _a.error,
|
|
12
|
+
required = _a.required,
|
|
11
13
|
className = _a.className;
|
|
12
14
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
13
|
-
className:
|
|
15
|
+
className: clx(styles.container, className),
|
|
14
16
|
ref: ref
|
|
15
|
-
}, label && /*#__PURE__*/React__default.createElement(Typography, {
|
|
17
|
+
}, label && ( /*#__PURE__*/React__default.createElement(Typography, {
|
|
18
|
+
className: clx(styles.label, {
|
|
19
|
+
label_required: !!required
|
|
20
|
+
}),
|
|
16
21
|
tag: "label"
|
|
17
|
-
}, label), children, hint && ( /*#__PURE__*/React__default.createElement(Typography, {
|
|
22
|
+
}, label)), children, hint && ( /*#__PURE__*/React__default.createElement(Typography, {
|
|
18
23
|
variant: error ? "alert" : "secondary",
|
|
19
24
|
tag: "span"
|
|
20
25
|
}, hint)));
|