@bodynarf/react.components 1.4.6 → 1.4.8
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/components/anchor/anchor.scss +2 -2
- package/components/anchor/components/anchorWithIcon/index.d.ts +0 -1
- package/components/anchor/components/anchorWithIcon/index.d.ts.map +1 -1
- package/components/anchor/components/anchorWithIcon/index.js +2 -2
- package/components/anchor/index.d.ts.map +1 -1
- package/components/anchor/index.js +6 -4
- package/components/button/button.scss +1 -1
- package/components/button/components/buttonWithIcon/index.d.ts +0 -1
- package/components/button/components/buttonWithIcon/index.d.ts.map +1 -1
- package/components/button/components/buttonWithIcon/index.js +3 -3
- package/components/button/index.d.ts.map +1 -1
- package/components/button/index.js +3 -1
- package/components/icon/icon.scss +1 -1
- package/components/icon/index.js +1 -1
- package/components/primitives/password/components/withLabel/index.d.ts +4 -0
- package/components/primitives/password/components/withLabel/index.d.ts.map +1 -0
- package/components/primitives/password/components/withLabel/index.js +51 -0
- package/components/primitives/password/components/withoutLabel/index.d.ts +4 -0
- package/components/primitives/password/components/withoutLabel/index.d.ts.map +1 -0
- package/components/primitives/password/components/withoutLabel/index.js +32 -0
- package/components/primitives/password/index.d.ts +14 -0
- package/components/primitives/password/index.d.ts.map +1 -0
- package/components/primitives/password/index.js +13 -0
- package/components/primitives/password/style.scss +16 -0
- package/components/search/index.d.ts.map +1 -1
- package/components/search/index.js +4 -2
- package/components/search/search.scss +1 -1
- package/package.json +1 -1
- package/readme.md +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/anchor/components/anchorWithIcon/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/anchor/components/anchorWithIcon/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,iCAAiC;AACjC,eAAO,MAAM,cAAc,+DAAgE,mBAAmB,KAAG,WAqChH,CAAC"}
|
|
@@ -7,8 +7,8 @@ export const AnchorWithIcon = ({ href, className, onClick, caption, title, targe
|
|
|
7
7
|
const iconClassName = isNullOrEmpty(caption)
|
|
8
8
|
? icon.className
|
|
9
9
|
: iconPosition === 'left'
|
|
10
|
-
? `${icon.className}
|
|
11
|
-
: `${icon.className}
|
|
10
|
+
? `${icon.className} bbr-icon--left`
|
|
11
|
+
: `${icon.className} bbr-icon--right`;
|
|
12
12
|
if (iconPosition === 'left') {
|
|
13
13
|
return (_jsxs("a", { href: href, className: className, title: title, target: target, onClick: onClick, children: [_jsx(Icon, { ...icon, className: iconClassName }), caption] }));
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/anchor/index.tsx"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAKvC,oBAAY,WAAW,GAAG;IACtB,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,kCAAkC;IAClC,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,wCAAwC;IACxC,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAE3B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,8CAA8C;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,uBAAuB;AACvB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/anchor/index.tsx"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAKvC,oBAAY,WAAW,GAAG;IACtB,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,kCAAkC;IAClC,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,wCAAwC;IACxC,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAE3B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,8CAA8C;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,uBAAuB;AACvB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CA6B9D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { isNullOrUndefined, isNullOrEmpty } from '@bodynarf/utils';
|
|
2
|
+
import { isNullOrUndefined, isNullOrEmpty, getClassName } from '@bodynarf/utils';
|
|
3
3
|
import './anchor.scss';
|
|
4
4
|
import { SimpleAnchor } from './components/simpleAnchor';
|
|
5
5
|
import { AnchorWithIcon } from './components/anchorWithIcon';
|
|
@@ -8,9 +8,11 @@ export default function Anchor(props) {
|
|
|
8
8
|
if (isNullOrUndefined(props.caption) && isNullOrUndefined(props.icon)) {
|
|
9
9
|
throw new Error("No anchor content provided");
|
|
10
10
|
}
|
|
11
|
-
const className =
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const className = getClassName([
|
|
12
|
+
'bbr-anchor',
|
|
13
|
+
!isNullOrEmpty(props.className) ? ` ${props.className}` : '',
|
|
14
|
+
props.disableHovering === true ? ' bbr-anchor--unhoverable' : ''
|
|
15
|
+
]);
|
|
14
16
|
if (isNullOrUndefined(props.icon)) {
|
|
15
17
|
return (_jsx(SimpleAnchor, { ...props, className: className, onClick: props.onClick }));
|
|
16
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/button/components/buttonWithIcon/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/button/components/buttonWithIcon/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,iCAAiC;AACjC,eAAO,MAAM,cAAc,2DAA4D,mBAAmB,KAAG,WAsC5G,CAAC"}
|
|
@@ -7,10 +7,10 @@ export const ButtonWithIcon = ({ className, disabled, onClick, caption, title, i
|
|
|
7
7
|
const iconClassName = isNullOrEmpty(caption)
|
|
8
8
|
? icon.className
|
|
9
9
|
: iconPosition === 'left'
|
|
10
|
-
? `${icon.className}
|
|
11
|
-
: `${icon.className}
|
|
10
|
+
? `${icon.className} bbr-icon--left`
|
|
11
|
+
: `${icon.className} bbr-icon--right`;
|
|
12
12
|
className = isNullOrEmpty(caption)
|
|
13
|
-
? `${className} button--icon-only`
|
|
13
|
+
? `${className} bbr-button--icon-only`
|
|
14
14
|
: className;
|
|
15
15
|
if (iconPosition === 'left') {
|
|
16
16
|
return (_jsxs("button", { className: className, disabled: disabled, onClick: onClick, title: title, children: [_jsx(Icon, { ...icon, className: iconClassName }), caption] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/button/index.tsx"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,C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AAK,CAAC,EAAE,MAAM,CAAC;IAEf,6CAA6C;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,wCAAwC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAkC9D"}
|
|
@@ -12,7 +12,9 @@ export default function Button(props) {
|
|
|
12
12
|
throw new Error("No button content provided.");
|
|
13
13
|
}
|
|
14
14
|
const className = getClassName([
|
|
15
|
-
|
|
15
|
+
"button",
|
|
16
|
+
"bbr-button",
|
|
17
|
+
`is-${props.type}`,
|
|
16
18
|
props.light === true ? 'is-light' : '',
|
|
17
19
|
!isNullOrUndefined(props.size) ? `is-${props.size}` : '',
|
|
18
20
|
props.outlined === true ? 'is-outlined' : '',
|
package/components/icon/index.js
CHANGED
|
@@ -11,7 +11,7 @@ const sizeToClassMap = new Map([
|
|
|
11
11
|
*/
|
|
12
12
|
export default function Icon({ size = 'medium', name, className }) {
|
|
13
13
|
const classNames = getClassName([
|
|
14
|
-
"
|
|
14
|
+
"bbr-icon",
|
|
15
15
|
"bi",
|
|
16
16
|
`bi-${name}`,
|
|
17
17
|
sizeToClassMap.has(size) ? sizeToClassMap.get(size) : "",
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PasswordProps } from "../..";
|
|
2
|
+
declare const PasswordWithLabel: ({ onValueChange, disabled, validationState, name, className, size, style, rounded, loading, label, placeholder, canShowPassword, }: PasswordProps) => JSX.Element;
|
|
3
|
+
export default PasswordWithLabel;
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withLabel/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,QAAA,MAAM,iBAAiB,uIAMpB,aAAa,KAAG,WA8HlB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
4
|
+
import Icon from "../../../../icon";
|
|
5
|
+
import { getValidationValues } from "../../../../../utils";
|
|
6
|
+
import { InputSize } from "../../../";
|
|
7
|
+
const PasswordWithLabel = ({ onValueChange, disabled, validationState, name, className, size, style, rounded, loading, label, placeholder, canShowPassword, }) => {
|
|
8
|
+
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
|
+
const [contentIsHidden, setContentIsHidden] = useState(true);
|
|
10
|
+
const onIconClick = useCallback(() => setContentIsHidden(state => !state), [setContentIsHidden]);
|
|
11
|
+
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
12
|
+
const elSizeClassName = "is-{0}".format(getValueOrDefault(size, InputSize.Normal));
|
|
13
|
+
const id = name || generateGuid();
|
|
14
|
+
const elClassName = getClassName([
|
|
15
|
+
className,
|
|
16
|
+
elSizeClassName,
|
|
17
|
+
rounded === true ? "is-rounded" : "",
|
|
18
|
+
styleClassName,
|
|
19
|
+
"bbr-password",
|
|
20
|
+
"input",
|
|
21
|
+
]);
|
|
22
|
+
const inputContainerClassName = getClassName([
|
|
23
|
+
"control",
|
|
24
|
+
loading === true ? "is-loading" : "",
|
|
25
|
+
canShowPassword ? "has-icons-right" : "",
|
|
26
|
+
"bbr-password__wrapper",
|
|
27
|
+
]);
|
|
28
|
+
const labelClassName = getClassName([
|
|
29
|
+
"label",
|
|
30
|
+
!label.horizontal ? elSizeClassName : "",
|
|
31
|
+
label.className
|
|
32
|
+
]);
|
|
33
|
+
if (label.horizontal) {
|
|
34
|
+
const labelContainerClassName = getClassName([
|
|
35
|
+
"field-label",
|
|
36
|
+
elSizeClassName,
|
|
37
|
+
label.horizontalContainerClassName
|
|
38
|
+
]);
|
|
39
|
+
const fieldContainerClassName = getClassName([
|
|
40
|
+
"field-body",
|
|
41
|
+
label.horizontalFieldContainerClassName
|
|
42
|
+
]);
|
|
43
|
+
return (_jsxs("div", { className: "bbr-input field is-horizontal", children: [_jsx("div", { className: labelContainerClassName, children: _jsx("label", { className: labelClassName, htmlFor: id, children: label.caption }) }), _jsx("div", { className: fieldContainerClassName, children: _jsxs("div", { className: "field", children: [_jsxs("div", { className: inputContainerClassName, children: [_jsx("input", { type: contentIsHidden ? "password" : "text", className: elClassName, placeholder: placeholder, disabled: disabled, onChange: onChange, name: id, id: id }), canShowPassword && !loading &&
|
|
44
|
+
_jsx("span", { className: `icon is-right ${elSizeClassName}`, onMouseEnter: onIconClick, onMouseLeave: onIconClick, title: "Show password", children: _jsx(Icon, { name: contentIsHidden ? "eye" : "eye-slash" }) })] }), isValidationDefined && validationMessages.length > 0 &&
|
|
45
|
+
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }) })] }));
|
|
46
|
+
}
|
|
47
|
+
return (_jsxs("div", { className: "field", children: [_jsx("label", { className: labelClassName, htmlFor: id, children: label.caption }), _jsxs("div", { className: inputContainerClassName, children: [_jsx("input", { type: contentIsHidden ? "password" : "text", className: elClassName, placeholder: placeholder, disabled: disabled, onChange: onChange, name: id, id: id }), canShowPassword && !loading &&
|
|
48
|
+
_jsx("span", { className: `icon is-right ${elSizeClassName}`, onMouseEnter: onIconClick, onMouseLeave: onIconClick, children: _jsx(Icon, { name: contentIsHidden ? "eye" : "eye-slash" }) })] }), isValidationDefined && validationMessages.length > 0 &&
|
|
49
|
+
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
|
|
50
|
+
};
|
|
51
|
+
export default PasswordWithLabel;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PasswordProps } from "../..";
|
|
2
|
+
declare const PasswordWithoutLabel: ({ onValueChange, disabled, validationState, name, className, size, style, rounded, loading, placeholder, canShowPassword, }: PasswordProps) => JSX.Element;
|
|
3
|
+
export default PasswordWithoutLabel;
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withoutLabel/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,QAAA,MAAM,oBAAoB,gIAMvB,aAAa,KAAG,WA0DlB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
4
|
+
import Icon from "../../../../icon";
|
|
5
|
+
import { InputSize } from "../../../types";
|
|
6
|
+
import { getValidationValues } from "../../../../../utils";
|
|
7
|
+
const PasswordWithoutLabel = ({ onValueChange, disabled, validationState, name, className, size, style, rounded, loading, placeholder, canShowPassword, }) => {
|
|
8
|
+
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
|
+
const [contentIsHidden, setContentIsHidden] = useState(true);
|
|
10
|
+
const onIconClick = useCallback(() => setContentIsHidden(state => !state), [setContentIsHidden]);
|
|
11
|
+
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
12
|
+
const elSizeClassName = "is-{0}".format(getValueOrDefault(size, InputSize.Normal));
|
|
13
|
+
const id = name || generateGuid();
|
|
14
|
+
const elClassName = getClassName([
|
|
15
|
+
className,
|
|
16
|
+
elSizeClassName,
|
|
17
|
+
rounded === true ? "is-rounded" : "",
|
|
18
|
+
styleClassName,
|
|
19
|
+
"bbr-password",
|
|
20
|
+
"input",
|
|
21
|
+
]);
|
|
22
|
+
const containerClassName = getClassName([
|
|
23
|
+
"control",
|
|
24
|
+
loading === true ? "is-loading" : "",
|
|
25
|
+
canShowPassword ? "has-icons-right" : "",
|
|
26
|
+
"bbr-password__wrapper",
|
|
27
|
+
]);
|
|
28
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: containerClassName, children: [_jsx("input", { type: contentIsHidden ? "password" : "text", className: elClassName, placeholder: placeholder, disabled: disabled, onChange: onChange, name: id, id: id }), canShowPassword && !loading &&
|
|
29
|
+
_jsx("span", { className: `icon is-right ${elSizeClassName}`, onMouseEnter: onIconClick, onMouseLeave: onIconClick, children: _jsx(Icon, { name: contentIsHidden ? "eye" : "eye-slash" }) })] }), isValidationDefined && validationMessages.length > 0 &&
|
|
30
|
+
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
|
|
31
|
+
};
|
|
32
|
+
export default PasswordWithoutLabel;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./style.scss";
|
|
2
|
+
import { BaseInputElementProps } from "../types";
|
|
3
|
+
/** Password component props type */
|
|
4
|
+
export interface PasswordProps extends Omit<BaseInputElementProps<string>, 'defaultValue' | 'readonly'> {
|
|
5
|
+
/**
|
|
6
|
+
* Is icon "Show password" visible.
|
|
7
|
+
* Will show password on click
|
|
8
|
+
*/
|
|
9
|
+
canShowPassword: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Password input component */
|
|
12
|
+
declare const Password: (props: PasswordProps) => JSX.Element;
|
|
13
|
+
export default Password;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/password/index.tsx"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAKjD,oCAAoC;AACpC,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC;IACnG;;;MAGE;IACF,eAAe,EAAE,OAAO,CAAC;CAC5B;AAED,+BAA+B;AAC/B,QAAA,MAAM,QAAQ,UAAW,aAAa,KAAG,WAMxC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isNullOrUndefined } from "@bodynarf/utils";
|
|
3
|
+
import "./style.scss";
|
|
4
|
+
import PasswordWithLabel from "./components/withLabel";
|
|
5
|
+
import PasswordWithoutLabel from "./components/withoutLabel";
|
|
6
|
+
/** Password input component */
|
|
7
|
+
const Password = (props) => {
|
|
8
|
+
if (isNullOrUndefined(props.label)) {
|
|
9
|
+
return _jsx(PasswordWithoutLabel, { ...props });
|
|
10
|
+
}
|
|
11
|
+
return _jsx(PasswordWithLabel, { ...props });
|
|
12
|
+
};
|
|
13
|
+
export default Password;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/search/index.tsx"],"names":[],"mappings":";AAIA,OAAO,eAAe,CAAC;AAGvB,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,oBAAY,WAAW,GAAG;IACtB;;;;MAIE;IACF,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC;IAEpC,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAEhB,qBAAqB;IACrB,QAAQ,EAAE,CAAC,aAAa,EAAE,MAAM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vB,CAAC;AAEF,uBAAuB;AACvB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC3B,UAAU,EAAE,QAAQ,EAAE,OAAO,EAC7B,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,GACrC,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAwE3B"}
|
|
@@ -16,13 +16,15 @@ export default function Search({ searchType, onSearch, caption, name, defaultVal
|
|
|
16
16
|
}, [onSearch, searchType]);
|
|
17
17
|
const onSearchButtonClick = useCallback(() => onSearch(searchValue), [onSearch, searchValue]);
|
|
18
18
|
const className = getClassName([
|
|
19
|
-
|
|
19
|
+
"bbr-search",
|
|
20
|
+
"control",
|
|
20
21
|
`is-${(size || 'normal')}`,
|
|
21
22
|
isLoading === true ? 'is-loading' : '',
|
|
22
23
|
searchType === 'byButton' ? 'is-expanded' : '',
|
|
23
24
|
]);
|
|
24
25
|
const inputClassName = getClassName([
|
|
25
|
-
|
|
26
|
+
"input",
|
|
27
|
+
"is-unselectable",
|
|
26
28
|
`is-${(size || 'normal')}`,
|
|
27
29
|
rounded === true ? 'is-rounded' : '',
|
|
28
30
|
]);
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -23,6 +23,8 @@ Simple react components based on html elements.
|
|
|
23
23
|
- **Text**- single line text input;
|
|
24
24
|
- **Anchor**
|
|
25
25
|
- **Button**
|
|
26
|
+
- **Number**
|
|
27
|
+
- **Password** - single line password input (requires icon, see *p.4*)
|
|
26
28
|
- **Icon** - *see p.4 of installation*
|
|
27
29
|
- **Dropdown** - custom dropdown component, based on html div elements & css. Allows to use icon in elements
|
|
28
30
|
- **Checkbox** - (*see p.5 of installation*) Checkbox component based on [bulma-checkradio](https://wikiki.github.io/form/checkradio)
|