@bodynarf/react.components 1.7.631 → 1.8.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/common.scss +7 -0
- package/components/accordion/component/index.d.ts +0 -1
- package/components/accordion/component/index.d.ts.map +1 -1
- package/components/accordion/component/index.js +5 -5
- package/components/anchor/component/style.scss +15 -0
- 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/simpleAnchor/index.d.ts +0 -1
- package/components/anchor/components/simpleAnchor/index.d.ts.map +1 -1
- package/components/anchor/types.d.ts +1 -11
- package/components/anchor/types.d.ts.map +1 -1
- package/components/button/component/index.d.ts.map +1 -1
- package/components/button/component/index.js +6 -5
- package/components/button/component/style.scss +12 -0
- 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/simpleButton/index.d.ts +0 -1
- package/components/button/components/simpleButton/index.d.ts.map +1 -1
- package/components/button/types.d.ts +2 -1
- package/components/button/types.d.ts.map +1 -1
- package/components/dropdown/component/index.d.ts +0 -1
- package/components/dropdown/component/index.d.ts.map +1 -1
- package/components/dropdown/component/style.scss +120 -0
- package/components/dropdown/components/compact/index.d.ts +1 -2
- package/components/dropdown/components/compact/index.d.ts.map +1 -1
- package/components/dropdown/components/compact/index.js +14 -11
- package/components/dropdown/components/withLabel/index.d.ts +1 -2
- package/components/dropdown/components/withLabel/index.d.ts.map +1 -1
- package/components/dropdown/components/withLabel/index.js +6 -6
- package/components/icon/component/style.scss +21 -0
- package/components/paginator/component/index.d.ts +1 -1
- package/components/paginator/component/index.d.ts.map +1 -1
- package/components/paginator/component/index.js +3 -3
- package/components/primitives/checkbox/component/index.d.ts +1 -2
- package/components/primitives/checkbox/component/index.d.ts.map +1 -1
- package/components/primitives/checkbox/component/index.js +7 -7
- package/components/primitives/checkbox/component/style.scss +10 -0
- package/components/primitives/checkbox/types.d.ts +1 -1
- package/components/primitives/checkbox/types.d.ts.map +1 -1
- package/components/primitives/color/component/index.d.ts +6 -0
- package/components/primitives/color/component/index.d.ts.map +1 -0
- package/components/primitives/color/component/index.js +10 -0
- package/components/primitives/color/component/style.scss +21 -0
- package/components/primitives/color/components/picker/index.d.ts +37 -0
- package/components/primitives/color/components/picker/index.d.ts.map +1 -0
- package/components/primitives/color/components/picker/index.js +16 -0
- package/components/primitives/color/components/withLabel/index.d.ts +6 -0
- package/components/primitives/color/components/withLabel/index.d.ts.map +1 -0
- package/components/primitives/color/components/withLabel/index.js +48 -0
- package/components/primitives/color/components/withoutLabel/index.d.ts +6 -0
- package/components/primitives/color/components/withoutLabel/index.d.ts.map +1 -0
- package/components/primitives/color/components/withoutLabel/index.js +35 -0
- package/components/primitives/color/index.d.ts +3 -0
- package/components/primitives/color/index.d.ts.map +1 -0
- package/components/primitives/color/index.js +2 -0
- package/components/primitives/color/types.d.ts +19 -0
- package/components/primitives/color/types.d.ts.map +1 -0
- package/components/primitives/color/types.js +1 -0
- package/components/primitives/date/component/index.d.ts +0 -1
- package/components/primitives/date/component/index.d.ts.map +1 -1
- package/components/primitives/date/component/index.js +6 -6
- package/components/primitives/index.d.ts +1 -0
- package/components/primitives/index.d.ts.map +1 -1
- package/components/primitives/index.js +1 -0
- package/components/primitives/multiline/component/index.d.ts +0 -1
- package/components/primitives/multiline/component/index.d.ts.map +1 -1
- package/components/primitives/multiline/components/multilineWithLabel/index.d.ts +1 -2
- package/components/primitives/multiline/components/multilineWithLabel/index.d.ts.map +1 -1
- package/components/primitives/multiline/components/multilineWithLabel/index.js +3 -4
- package/components/primitives/multiline/components/multilineWithoutLabel/index.d.ts +1 -2
- package/components/primitives/multiline/components/multilineWithoutLabel/index.d.ts.map +1 -1
- package/components/primitives/multiline/components/multilineWithoutLabel/index.js +3 -4
- package/components/primitives/multiline/types.d.ts +1 -1
- package/components/primitives/multiline/types.d.ts.map +1 -1
- package/components/primitives/number/component/index.d.ts +0 -1
- package/components/primitives/number/component/index.d.ts.map +1 -1
- package/components/primitives/number/components/withLabel/index.d.ts +0 -1
- package/components/primitives/number/components/withLabel/index.d.ts.map +1 -1
- package/components/primitives/number/components/withLabel/index.js +5 -5
- package/components/primitives/number/components/withoutLabel/index.d.ts +0 -1
- package/components/primitives/number/components/withoutLabel/index.d.ts.map +1 -1
- package/components/primitives/number/components/withoutLabel/index.js +4 -4
- package/components/primitives/password/component/index.d.ts +0 -1
- package/components/primitives/password/component/index.d.ts.map +1 -1
- package/components/primitives/password/component/style.scss +16 -0
- package/components/primitives/password/components/withLabel/index.d.ts +0 -1
- package/components/primitives/password/components/withLabel/index.d.ts.map +1 -1
- package/components/primitives/password/components/withLabel/index.js +3 -3
- package/components/primitives/password/components/withoutLabel/index.d.ts +0 -1
- package/components/primitives/password/components/withoutLabel/index.d.ts.map +1 -1
- package/components/primitives/password/components/withoutLabel/index.js +3 -3
- package/components/primitives/password/types.d.ts +2 -2
- package/components/primitives/password/types.d.ts.map +1 -1
- package/components/primitives/text/component/index.d.ts +0 -1
- package/components/primitives/text/component/index.d.ts.map +1 -1
- package/components/primitives/text/components/textWithLabel/index.d.ts +0 -1
- package/components/primitives/text/components/textWithLabel/index.d.ts.map +1 -1
- package/components/primitives/text/components/textWithLabel/index.js +3 -3
- package/components/primitives/text/components/textWithoutLabel/index.d.ts +0 -1
- package/components/primitives/text/components/textWithoutLabel/index.d.ts.map +1 -1
- package/components/primitives/text/components/textWithoutLabel/index.js +3 -3
- package/components/search/component/index.d.ts.map +1 -1
- package/components/search/component/index.js +4 -4
- package/components/search/component/style.scss +24 -0
- package/components/tabs/component/index.d.ts +0 -1
- package/components/tabs/component/index.d.ts.map +1 -1
- package/components/tabs/component/index.js +5 -5
- package/components/tabs/component/style.scss +12 -0
- package/components/tabs/components/item/index.d.ts +0 -1
- package/components/tabs/components/item/index.d.ts.map +1 -1
- package/components/tag/component/index.d.ts +0 -1
- package/components/tag/component/index.d.ts.map +1 -1
- package/components/tag/component/index.js +3 -5
- package/components/tag/component/style.scss +27 -0
- package/package.json +7 -4
- package/readme.md +23 -13
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -4,7 +4,7 @@ import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
|
4
4
|
import { getValidationValues } from "../../../../../utils";
|
|
5
5
|
import { ElementSize } from "../../../..";
|
|
6
6
|
import Icon from "../../../../icon";
|
|
7
|
-
const PasswordWithLabel = ({ onValueChange, disabled, validationState, name, className, size, style, rounded, loading, label, placeholder, canShowPassword, }) => {
|
|
7
|
+
const PasswordWithLabel = ({ onValueChange, disabled, validationState, name, className, size, style, rounded = false, loading = false, label, placeholder, canShowPassword = false, }) => {
|
|
8
8
|
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
9
|
const [contentIsHidden, setContentIsHidden] = useState(true);
|
|
10
10
|
const onIconClick = useCallback(() => setContentIsHidden(state => !state), [setContentIsHidden]);
|
|
@@ -14,14 +14,14 @@ const PasswordWithLabel = ({ onValueChange, disabled, validationState, name, cla
|
|
|
14
14
|
const elClassName = getClassName([
|
|
15
15
|
className,
|
|
16
16
|
elSizeClassName,
|
|
17
|
-
rounded
|
|
17
|
+
rounded ? "is-rounded" : "",
|
|
18
18
|
styleClassName,
|
|
19
19
|
"bbr-password",
|
|
20
20
|
"input",
|
|
21
21
|
]);
|
|
22
22
|
const inputContainerClassName = getClassName([
|
|
23
23
|
"control",
|
|
24
|
-
loading
|
|
24
|
+
loading ? "is-loading" : "",
|
|
25
25
|
canShowPassword ? "has-icons-right" : "",
|
|
26
26
|
"bbr-password__wrapper",
|
|
27
27
|
]);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { PasswordProps } from "../../../password";
|
|
3
2
|
declare const PasswordWithoutLabel: ({ onValueChange, disabled, validationState, name, className, size, style, rounded, loading, placeholder, canShowPassword, }: PasswordProps) => JSX.Element;
|
|
4
3
|
export default PasswordWithoutLabel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withoutLabel/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withoutLabel/index.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,QAAA,MAAM,oBAAoB,gIAOvB,aAAa,KAAG,WA4DlB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
|
4
4
|
import { ElementSize } from "../../../..";
|
|
5
5
|
import { getValidationValues } from "../../../../../utils";
|
|
6
6
|
import Icon from "../../../../icon";
|
|
7
|
-
const PasswordWithoutLabel = ({ onValueChange, disabled, validationState, name, className, size, style, rounded, loading, placeholder, canShowPassword, }) => {
|
|
7
|
+
const PasswordWithoutLabel = ({ onValueChange, disabled, validationState, name, className, size, style, rounded = false, loading = false, placeholder, canShowPassword = false, }) => {
|
|
8
8
|
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
9
|
const [contentIsHidden, setContentIsHidden] = useState(true);
|
|
10
10
|
const onIconClick = useCallback(() => setContentIsHidden(state => !state), [setContentIsHidden]);
|
|
@@ -14,7 +14,7 @@ const PasswordWithoutLabel = ({ onValueChange, disabled, validationState, name,
|
|
|
14
14
|
const elClassName = getClassName([
|
|
15
15
|
className,
|
|
16
16
|
elSizeClassName,
|
|
17
|
-
rounded
|
|
17
|
+
rounded ? "is-rounded" : "",
|
|
18
18
|
styleClassName,
|
|
19
19
|
"bbr-password",
|
|
20
20
|
"input",
|
|
@@ -22,7 +22,7 @@ const PasswordWithoutLabel = ({ onValueChange, disabled, validationState, name,
|
|
|
22
22
|
const containerClassName = getClassName([
|
|
23
23
|
"control",
|
|
24
24
|
"bbr-input",
|
|
25
|
-
loading
|
|
25
|
+
loading ? "is-loading" : "",
|
|
26
26
|
canShowPassword ? "has-icons-right" : "",
|
|
27
27
|
"bbr-password__wrapper",
|
|
28
28
|
]);
|
|
@@ -2,9 +2,9 @@ import { BaseInputElementProps } from "../..";
|
|
|
2
2
|
/** Password component props type */
|
|
3
3
|
export interface PasswordProps extends Omit<BaseInputElementProps<string>, "defaultValue" | "readonly"> {
|
|
4
4
|
/**
|
|
5
|
-
* Is icon "Show password" visible.
|
|
5
|
+
* Is clickable icon "Show password" visible.
|
|
6
6
|
* Will show password on click
|
|
7
7
|
*/
|
|
8
|
-
canShowPassword
|
|
8
|
+
canShowPassword?: boolean;
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/password/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,oCAAoC;AACpC,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC;IACnG;;;MAGE;IACF,eAAe,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/password/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,oCAAoC;AACpC,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC;IACnG;;;MAGE;IACF,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/text/component/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/text/component/index.tsx"],"names":[],"mappings":"AAEA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5C,8BAA8B;AAC9B,QAAA,MAAM,IAAI,UAAW,SAAS,KAAG,WAOhC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TextProps } from "../../../text";
|
|
3
2
|
/** Textual input with describing label */
|
|
4
3
|
declare const TextWithLabel: ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, label, placeholder, onBlur, }: TextProps) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/text/components/textWithLabel/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/text/components/textWithLabel/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,0CAA0C;AAC1C,QAAA,MAAM,aAAa,sJAOhB,SAAS,KAAG,WAwGd,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { generateGuid, getClassName, getValueOrDefault, } from "@bodynarf/utils"
|
|
|
4
4
|
import { ElementSize } from "../../../..";
|
|
5
5
|
import { getValidationValues } from "../../../../../utils";
|
|
6
6
|
/** Textual input with describing label */
|
|
7
|
-
const TextWithLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, label, placeholder, onBlur, }) => {
|
|
7
|
+
const TextWithLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded = false, loading = false, label, placeholder, onBlur, }) => {
|
|
8
8
|
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
9
|
const id = name || generateGuid();
|
|
10
10
|
const elSizeClassName = "is-{0}".format(getValueOrDefault(size, ElementSize.Normal));
|
|
@@ -12,13 +12,13 @@ const TextWithLabel = ({ onValueChange, readonly, disabled, defaultValue, valida
|
|
|
12
12
|
const elClassName = getClassName([
|
|
13
13
|
className,
|
|
14
14
|
elSizeClassName,
|
|
15
|
-
rounded
|
|
15
|
+
rounded ? "is-rounded" : "",
|
|
16
16
|
styleClassName,
|
|
17
17
|
"input",
|
|
18
18
|
]);
|
|
19
19
|
const inputContainerClassName = getClassName([
|
|
20
20
|
"control",
|
|
21
|
-
loading
|
|
21
|
+
loading ? "is-loading" : "",
|
|
22
22
|
]);
|
|
23
23
|
const labelClassName = getClassName([
|
|
24
24
|
"label",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TextProps } from "../../../text";
|
|
3
2
|
/** Textual input without describing label */
|
|
4
3
|
declare const TextWithoutLabel: ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, placeholder, onBlur, }: TextProps) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/text/components/textWithoutLabel/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/text/components/textWithoutLabel/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,6CAA6C;AAC7C,QAAA,MAAM,gBAAgB,+IAOnB,SAAS,KAAG,WA6Cd,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -4,20 +4,20 @@ import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
|
4
4
|
import { ElementSize } from "../../../..";
|
|
5
5
|
import { getValidationValues } from "../../../../../utils";
|
|
6
6
|
/** Textual input without describing label */
|
|
7
|
-
const TextWithoutLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, placeholder, onBlur, }) => {
|
|
7
|
+
const TextWithoutLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded = false, loading = false, placeholder, onBlur, }) => {
|
|
8
8
|
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
9
|
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
10
10
|
const elClassName = getClassName([
|
|
11
11
|
className,
|
|
12
12
|
"is-{0}".format(getValueOrDefault(size, ElementSize.Normal)),
|
|
13
|
-
rounded
|
|
13
|
+
rounded ? "is-rounded" : "",
|
|
14
14
|
styleClassName,
|
|
15
15
|
"input",
|
|
16
16
|
]);
|
|
17
17
|
const containerClassName = getClassName([
|
|
18
18
|
"control",
|
|
19
19
|
"bbr-input",
|
|
20
|
-
loading
|
|
20
|
+
loading ? "is-loading" : "",
|
|
21
21
|
]);
|
|
22
22
|
const id = name || generateGuid();
|
|
23
23
|
return (_jsxs(_Fragment, { children: [_jsx("div", { className: containerClassName, children: _jsx("input", { className: elClassName, type: "text", placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id }) }), isValidationDefined && validationMessages.length > 0 &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/search/component/index.tsx"],"names":[],"mappings":";AAIA,OAAO,cAAc,CAAC;AAItB,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,uBAAuB;AACvB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC3B,UAAU,EAAE,QAAQ,EAAE,OAAO,EAC7B,IAAI,EAAE,YAAY,EAClB,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/search/component/index.tsx"],"names":[],"mappings":";AAIA,OAAO,cAAc,CAAC;AAItB,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,uBAAuB;AACvB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC3B,UAAU,EAAE,QAAQ,EAAE,OAAO,EAC7B,IAAI,EAAE,YAAY,EAClB,IAAI,EACJ,SAAiB,EAAE,OAAe,EAAE,QAAQ,GAC/C,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAyE3B"}
|
|
@@ -4,7 +4,7 @@ import { generateGuid, getClassName } from "@bodynarf/utils";
|
|
|
4
4
|
import "./style.scss";
|
|
5
5
|
import Button from "../../button";
|
|
6
6
|
/** Search component */
|
|
7
|
-
export default function Search({ searchType, onSearch, caption, name, defaultValue, size, isLoading, rounded, disabled, }) {
|
|
7
|
+
export default function Search({ searchType, onSearch, caption, name, defaultValue, size, isLoading = false, rounded = false, disabled, }) {
|
|
8
8
|
const [elementName] = useState(name || generateGuid());
|
|
9
9
|
const [searchValue, setSearchValue] = useState(defaultValue || "");
|
|
10
10
|
const onChange = useCallback((event) => {
|
|
@@ -19,17 +19,17 @@ export default function Search({ searchType, onSearch, caption, name, defaultVal
|
|
|
19
19
|
"bbr-search",
|
|
20
20
|
"control",
|
|
21
21
|
`is-${(size || "normal")}`,
|
|
22
|
-
isLoading
|
|
22
|
+
isLoading ? "is-loading" : "",
|
|
23
23
|
searchType === "byButton" ? "is-expanded" : "",
|
|
24
24
|
]);
|
|
25
25
|
const inputClassName = getClassName([
|
|
26
26
|
"input",
|
|
27
27
|
"is-unselectable",
|
|
28
28
|
`is-${(size || "normal")}`,
|
|
29
|
-
rounded
|
|
29
|
+
rounded ? "is-rounded" : "",
|
|
30
30
|
]);
|
|
31
31
|
if (searchType === "byButton") {
|
|
32
|
-
return (_jsxs("div", { className: "field has-addons", children: [_jsx("div", { className: className, children: _jsx("input", { type: "search", name: elementName, defaultValue: searchValue, className: inputClassName, disabled: disabled, onChange: onChange, placeholder: caption }) }), _jsx("div", { className: "control", children: _jsx(Button, { caption: "Search", type: "info", onClick: onSearchButtonClick, isLoading: isLoading }) })] }));
|
|
32
|
+
return (_jsxs("div", { className: "field has-addons", children: [_jsx("div", { className: className, children: _jsx("input", { type: "search", name: elementName, defaultValue: searchValue, className: inputClassName, disabled: disabled, onChange: onChange, placeholder: caption }) }), _jsx("div", { className: "control", children: _jsx(Button, { caption: "Search", type: "info", onClick: onSearchButtonClick, isLoading: isLoading, size: size }) })] }));
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
35
|
return (_jsx("div", { className: className, children: _jsx("input", { type: "search", name: elementName, defaultValue: searchValue, className: inputClassName, disabled: disabled, onChange: onChange, placeholder: caption }) }));
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.bbr-search {
|
|
2
|
+
input[type="search"] {
|
|
3
|
+
transition: 0.15s ease-out;
|
|
4
|
+
transition-property: border-color, color, background-color;
|
|
5
|
+
|
|
6
|
+
&::placeholder {
|
|
7
|
+
user-select: none;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&::-webkit-input-placeholder {
|
|
11
|
+
transition: 0.15s ease-out color;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&::-webkit-search-cancel-button {
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
font-size: 1.25rem;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&.is-loading::after {
|
|
21
|
+
right: 1rem;
|
|
22
|
+
top: 0.725rem;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tabs/component/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tabs/component/index.tsx"],"names":[],"mappings":"AAIA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGhE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGxE,gCAAgC;AAChC,MAAM,WAAW,SAAU,SAAQ,gBAAgB;IAC/C,WAAW;IACX,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAEtB,8CAA8C;IAC9C,kBAAkB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAE5C;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,YAAY,CAAC;IAExB,sBAAsB;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,QAAA,MAAM,IAAI,4GAMP,SAAS,KAAG,WA6Ed,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -10,11 +10,11 @@ import TabItemComponent from "../../tabs/components/item";
|
|
|
10
10
|
* Tabs panel
|
|
11
11
|
* @throws Items are empty
|
|
12
12
|
*/
|
|
13
|
-
const Tabs = ({ items, onActiveItemChange, defaultActive, size, position, style, fullWidth, className, title, data, }) => {
|
|
13
|
+
const Tabs = ({ items, onActiveItemChange, defaultActive = items[0], size, position = TabsPosition.left, style = TabsStyle.default, fullWidth = false, className, title, data, }) => {
|
|
14
14
|
if (items.length === 0) {
|
|
15
15
|
throw new Error("Invalid configuration. Tab items must be defined");
|
|
16
16
|
}
|
|
17
|
-
const [activeItem, setActiveItem] = useState(defaultActive
|
|
17
|
+
const [activeItem, setActiveItem] = useState(defaultActive);
|
|
18
18
|
const isFirstRun = useRef(true);
|
|
19
19
|
const onTabsClick = useCallback((container) => {
|
|
20
20
|
const closestTab = container.target.closest(".bbr-tabs__tab");
|
|
@@ -41,10 +41,10 @@ const Tabs = ({ items, onActiveItemChange, defaultActive, size, position, style,
|
|
|
41
41
|
const elClassName = getClassName([
|
|
42
42
|
"bbr-tabs",
|
|
43
43
|
"tabs",
|
|
44
|
-
position
|
|
44
|
+
position,
|
|
45
45
|
getSizeClassName(size, [ElementSize.Normal]),
|
|
46
|
-
style
|
|
47
|
-
fullWidth
|
|
46
|
+
style,
|
|
47
|
+
fullWidth ? "is-fullwidth" : "",
|
|
48
48
|
className,
|
|
49
49
|
]);
|
|
50
50
|
const dataAttributes = isNullOrUndefined(data)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/tabs/components/item/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/tabs/components/item/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAEvD,sDAAsD;AACtD,MAAM,WAAW,YAAY;IACzB,eAAe;IACf,IAAI,EAAE,IAAI,CAAC;IAEX,6BAA6B;IAC7B,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,2CAA2C;AAC3C,QAAA,MAAM,OAAO,yBAEV,YAAY,KAAG,WAqBjB,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tag/component/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tag/component/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,cAAc,CAAC;AAEtB,sBAAsB;AACtB,QAAA,MAAM,GAAG,2FAQN,QAAQ,KAAG,WA+Bb,CAAC;AAEF,eAAe,GAAG,CAAC"}
|
|
@@ -3,9 +3,7 @@ import { getClassName, isNullOrUndefined } from "@bodynarf/utils";
|
|
|
3
3
|
import { ElementColor, ElementSize } from "../..";
|
|
4
4
|
import "./style.scss";
|
|
5
5
|
/** Single tag item */
|
|
6
|
-
const Tag = ({ content, size, style, rounded, lightColor, customColor, onClick, className, title, }) => {
|
|
7
|
-
size ??= ElementSize.Normal;
|
|
8
|
-
style ??= ElementColor.Default;
|
|
6
|
+
const Tag = ({ content, size = ElementSize.Normal, style = ElementColor.Default, rounded = false, lightColor = false, customColor, onClick, className, title, }) => {
|
|
9
7
|
if (!isNullOrUndefined(customColor)) {
|
|
10
8
|
style = ElementColor.Default;
|
|
11
9
|
}
|
|
@@ -14,8 +12,8 @@ const Tag = ({ content, size, style, rounded, lightColor, customColor, onClick,
|
|
|
14
12
|
"tag",
|
|
15
13
|
style === ElementColor.Default ? "" : `is-${style}`,
|
|
16
14
|
!isNullOrUndefined(customColor) ? "bbr-tag--custom" : "",
|
|
17
|
-
lightColor
|
|
18
|
-
rounded
|
|
15
|
+
lightColor && isNullOrUndefined(customColor) ? "is-light" : "",
|
|
16
|
+
rounded ? "is-rounded" : "",
|
|
19
17
|
size === ElementSize.Normal || size === ElementSize.Small ? "" : `is-${size}`,
|
|
20
18
|
isNullOrUndefined(onClick) ? "" : "bbr-tag--clickable",
|
|
21
19
|
className,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.bbr-tag {
|
|
2
|
+
border: 1px solid transparent;
|
|
3
|
+
transition: border-color 0.15s ease-in-out;
|
|
4
|
+
|
|
5
|
+
&--clickable {
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
|
|
8
|
+
&.is-light {
|
|
9
|
+
&:hover {
|
|
10
|
+
border-color: rgba(0, 0, 0, 0.25);
|
|
11
|
+
}
|
|
12
|
+
&:focus,
|
|
13
|
+
&:active {
|
|
14
|
+
border-color: rgba(0, 0, 0, 0.5);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
&:not(.is-light) {
|
|
18
|
+
&:hover {
|
|
19
|
+
border-color: rgba(0, 0, 0, 0.35);
|
|
20
|
+
}
|
|
21
|
+
&:focus,
|
|
22
|
+
&:active {
|
|
23
|
+
border-color: rgba(0, 0, 0, 0.75);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bodynarf/react.components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Artem",
|
|
6
6
|
"email": "bodynar@gmail.com"
|
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build": "npx tsc && tsc-alias -p tsconfig.json",
|
|
25
|
-
"
|
|
25
|
+
"copy_styles": "copyfiles -u 1 src/**/*.scss dist",
|
|
26
|
+
"copy_main" : "copyfiles package.json readme.md dist",
|
|
27
|
+
"transfer": "npm run copy_styles && npm run copy_main",
|
|
26
28
|
"build_transfer": "npm run build && npm run transfer",
|
|
27
29
|
"prepublish": "npm run build_transfer && cd dist && npm pack --dry-run",
|
|
28
30
|
"publish_pkg": "npm run build_transfer && cd dist && npm publish --access=public"
|
|
@@ -30,13 +32,14 @@
|
|
|
30
32
|
"devDependencies": {
|
|
31
33
|
"@types/react": "^18.0.11",
|
|
32
34
|
"@types/react-dom": "^18.0.5",
|
|
35
|
+
"copyfiles": "^2.4.1",
|
|
33
36
|
"tsc-alias": "^1.8.6",
|
|
34
37
|
"typescript": "^4.7.3"
|
|
35
38
|
},
|
|
36
39
|
"peerDependencies": {
|
|
37
|
-
"@bodynarf/utils": "^1.1.
|
|
40
|
+
"@bodynarf/utils": "^1.1.9",
|
|
38
41
|
"bulma": "^0.9.4",
|
|
39
42
|
"react": "^18.1.0",
|
|
40
43
|
"react-dom": "^18.1.0"
|
|
41
44
|
}
|
|
42
|
-
}
|
|
45
|
+
}
|
package/readme.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
****# About
|
|
2
2
|
Small library with react components based on Bulma CSS framework <a href="https://bulma.io" title="Bulma css framework">
|
|
3
3
|
<img
|
|
4
4
|
src="https://bulma.io/images/made-with-bulma.png"
|
|
@@ -14,26 +14,34 @@ Small library with react components based on Bulma CSS framework <a href="
|
|
|
14
14
|
4. *(Optional)* To use **Icon** component - install [Bootstrap Icons](https://icons.getbootstrap.com/) and make sure you imported these styles in parent container
|
|
15
15
|
5. *(Optional)* To use **Checkbox** component - install [bulma-checkradio](https://www.npmjs.com/package/bulma-checkradio) and make sure you imported these styles in parent container
|
|
16
16
|
|
|
17
|
+
|
|
18
|
+
## Demo
|
|
19
|
+
Demo of using all components can be found on https://bodynar.github.io/bodynarf.react-components/ (or open latest build in github repository)
|
|
17
20
|
## Description
|
|
21
|
+
Mostly all components have root css class with `bbr-` prefix. BBR - Bodynarf Bulma React
|
|
18
22
|
|
|
19
|
-
Mostly all components have root class with `bbr-` prefix. BBR - Bodynarf Bulma React
|
|
20
23
|
### Simple components
|
|
21
24
|
Simple react components based on html elements.
|
|
22
25
|
|
|
23
|
-
|
|
24
|
-
- **Multiline** - multiline text input;
|
|
25
|
-
- **Text**- single line text input;
|
|
26
|
-
- **Anchor**
|
|
27
|
-
- **Button**
|
|
28
|
-
- **Number**
|
|
29
|
-
- **Password** - single line password input (requires icon, see *p.4*)
|
|
30
|
-
- **Icon** - *see p.4 of installation*
|
|
31
|
-
- **Dropdown** - custom dropdown component, based on html div elements & css. Allows to use icon in elements
|
|
26
|
+
#### Controls
|
|
32
27
|
- **Checkbox** - (*see p.5 of installation*) Checkbox component based on [bulma-checkradio](https://wikiki.github.io/form/checkradio)
|
|
28
|
+
- **ColorPicker** - control that allows picking color (with preview option)
|
|
29
|
+
- **Date** - date input
|
|
30
|
+
- **Multiline** - multiline text input
|
|
31
|
+
- **Number** - number input with step
|
|
32
|
+
- **Password** - single line password input (requires icon, see icon component description)
|
|
33
|
+
- **Text** - single line text input;
|
|
34
|
+
|
|
35
|
+
#### Components
|
|
36
|
+
- **Anchor** - simple anchor (link) component
|
|
37
|
+
- **Button** - button that allows user to interact with system by clicking it _(assume everyone knows what is button)_
|
|
38
|
+
- **Icon** - *see p.4 of installation*
|
|
39
|
+
- **Tag** - small component stands for tag visualization
|
|
33
40
|
|
|
34
41
|
### Complex components
|
|
35
42
|
Complex components is set of components built via combining simple components or represent complex logical component
|
|
36
|
-
- **
|
|
43
|
+
- **Accordion** - Collapsible container that can hide some content inside
|
|
44
|
+
- **Dropdown** - custom dropdown component, based on html div elements & css (requires icon, see icon component description)
|
|
37
45
|
- **Paginator** - Pagination elements to navigate through paged list
|
|
38
46
|
|
|
39
47
|
Example:
|
|
@@ -49,8 +57,10 @@ Complex components is set of components built via combining simple components or
|
|
|
49
57
|
onPageChange={onPageChange}
|
|
50
58
|
/>
|
|
51
59
|
```
|
|
60
|
+
- **Search** - Search bar with optional button to perform search
|
|
61
|
+
- **Tabs** - Container for multi-content with option of switching displaying content without refreshing\scrolling page
|
|
52
62
|
|
|
53
63
|
### Hooks
|
|
54
64
|
|
|
55
|
-
- **useComponentOutsideClick** - Attach watcher for mouse clicks and
|
|
65
|
+
- **useComponentOutsideClick** - Attach watcher for mouse clicks and emit event when click was outside of component
|
|
56
66
|
- **usePagination** - Create a pagination config to easily manipulate with Paginator component
|