@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.
Files changed (117) hide show
  1. package/common.scss +7 -0
  2. package/components/accordion/component/index.d.ts +0 -1
  3. package/components/accordion/component/index.d.ts.map +1 -1
  4. package/components/accordion/component/index.js +5 -5
  5. package/components/anchor/component/style.scss +15 -0
  6. package/components/anchor/components/anchorWithIcon/index.d.ts +0 -1
  7. package/components/anchor/components/anchorWithIcon/index.d.ts.map +1 -1
  8. package/components/anchor/components/simpleAnchor/index.d.ts +0 -1
  9. package/components/anchor/components/simpleAnchor/index.d.ts.map +1 -1
  10. package/components/anchor/types.d.ts +1 -11
  11. package/components/anchor/types.d.ts.map +1 -1
  12. package/components/button/component/index.d.ts.map +1 -1
  13. package/components/button/component/index.js +6 -5
  14. package/components/button/component/style.scss +12 -0
  15. package/components/button/components/buttonWithIcon/index.d.ts +0 -1
  16. package/components/button/components/buttonWithIcon/index.d.ts.map +1 -1
  17. package/components/button/components/simpleButton/index.d.ts +0 -1
  18. package/components/button/components/simpleButton/index.d.ts.map +1 -1
  19. package/components/button/types.d.ts +2 -1
  20. package/components/button/types.d.ts.map +1 -1
  21. package/components/dropdown/component/index.d.ts +0 -1
  22. package/components/dropdown/component/index.d.ts.map +1 -1
  23. package/components/dropdown/component/style.scss +120 -0
  24. package/components/dropdown/components/compact/index.d.ts +1 -2
  25. package/components/dropdown/components/compact/index.d.ts.map +1 -1
  26. package/components/dropdown/components/compact/index.js +14 -11
  27. package/components/dropdown/components/withLabel/index.d.ts +1 -2
  28. package/components/dropdown/components/withLabel/index.d.ts.map +1 -1
  29. package/components/dropdown/components/withLabel/index.js +6 -6
  30. package/components/icon/component/style.scss +21 -0
  31. package/components/paginator/component/index.d.ts +1 -1
  32. package/components/paginator/component/index.d.ts.map +1 -1
  33. package/components/paginator/component/index.js +3 -3
  34. package/components/primitives/checkbox/component/index.d.ts +1 -2
  35. package/components/primitives/checkbox/component/index.d.ts.map +1 -1
  36. package/components/primitives/checkbox/component/index.js +7 -7
  37. package/components/primitives/checkbox/component/style.scss +10 -0
  38. package/components/primitives/checkbox/types.d.ts +1 -1
  39. package/components/primitives/checkbox/types.d.ts.map +1 -1
  40. package/components/primitives/color/component/index.d.ts +6 -0
  41. package/components/primitives/color/component/index.d.ts.map +1 -0
  42. package/components/primitives/color/component/index.js +10 -0
  43. package/components/primitives/color/component/style.scss +21 -0
  44. package/components/primitives/color/components/picker/index.d.ts +37 -0
  45. package/components/primitives/color/components/picker/index.d.ts.map +1 -0
  46. package/components/primitives/color/components/picker/index.js +16 -0
  47. package/components/primitives/color/components/withLabel/index.d.ts +6 -0
  48. package/components/primitives/color/components/withLabel/index.d.ts.map +1 -0
  49. package/components/primitives/color/components/withLabel/index.js +48 -0
  50. package/components/primitives/color/components/withoutLabel/index.d.ts +6 -0
  51. package/components/primitives/color/components/withoutLabel/index.d.ts.map +1 -0
  52. package/components/primitives/color/components/withoutLabel/index.js +35 -0
  53. package/components/primitives/color/index.d.ts +3 -0
  54. package/components/primitives/color/index.d.ts.map +1 -0
  55. package/components/primitives/color/index.js +2 -0
  56. package/components/primitives/color/types.d.ts +19 -0
  57. package/components/primitives/color/types.d.ts.map +1 -0
  58. package/components/primitives/color/types.js +1 -0
  59. package/components/primitives/date/component/index.d.ts +0 -1
  60. package/components/primitives/date/component/index.d.ts.map +1 -1
  61. package/components/primitives/date/component/index.js +6 -6
  62. package/components/primitives/index.d.ts +1 -0
  63. package/components/primitives/index.d.ts.map +1 -1
  64. package/components/primitives/index.js +1 -0
  65. package/components/primitives/multiline/component/index.d.ts +0 -1
  66. package/components/primitives/multiline/component/index.d.ts.map +1 -1
  67. package/components/primitives/multiline/components/multilineWithLabel/index.d.ts +1 -2
  68. package/components/primitives/multiline/components/multilineWithLabel/index.d.ts.map +1 -1
  69. package/components/primitives/multiline/components/multilineWithLabel/index.js +3 -4
  70. package/components/primitives/multiline/components/multilineWithoutLabel/index.d.ts +1 -2
  71. package/components/primitives/multiline/components/multilineWithoutLabel/index.d.ts.map +1 -1
  72. package/components/primitives/multiline/components/multilineWithoutLabel/index.js +3 -4
  73. package/components/primitives/multiline/types.d.ts +1 -1
  74. package/components/primitives/multiline/types.d.ts.map +1 -1
  75. package/components/primitives/number/component/index.d.ts +0 -1
  76. package/components/primitives/number/component/index.d.ts.map +1 -1
  77. package/components/primitives/number/components/withLabel/index.d.ts +0 -1
  78. package/components/primitives/number/components/withLabel/index.d.ts.map +1 -1
  79. package/components/primitives/number/components/withLabel/index.js +5 -5
  80. package/components/primitives/number/components/withoutLabel/index.d.ts +0 -1
  81. package/components/primitives/number/components/withoutLabel/index.d.ts.map +1 -1
  82. package/components/primitives/number/components/withoutLabel/index.js +4 -4
  83. package/components/primitives/password/component/index.d.ts +0 -1
  84. package/components/primitives/password/component/index.d.ts.map +1 -1
  85. package/components/primitives/password/component/style.scss +16 -0
  86. package/components/primitives/password/components/withLabel/index.d.ts +0 -1
  87. package/components/primitives/password/components/withLabel/index.d.ts.map +1 -1
  88. package/components/primitives/password/components/withLabel/index.js +3 -3
  89. package/components/primitives/password/components/withoutLabel/index.d.ts +0 -1
  90. package/components/primitives/password/components/withoutLabel/index.d.ts.map +1 -1
  91. package/components/primitives/password/components/withoutLabel/index.js +3 -3
  92. package/components/primitives/password/types.d.ts +2 -2
  93. package/components/primitives/password/types.d.ts.map +1 -1
  94. package/components/primitives/text/component/index.d.ts +0 -1
  95. package/components/primitives/text/component/index.d.ts.map +1 -1
  96. package/components/primitives/text/components/textWithLabel/index.d.ts +0 -1
  97. package/components/primitives/text/components/textWithLabel/index.d.ts.map +1 -1
  98. package/components/primitives/text/components/textWithLabel/index.js +3 -3
  99. package/components/primitives/text/components/textWithoutLabel/index.d.ts +0 -1
  100. package/components/primitives/text/components/textWithoutLabel/index.d.ts.map +1 -1
  101. package/components/primitives/text/components/textWithoutLabel/index.js +3 -3
  102. package/components/search/component/index.d.ts.map +1 -1
  103. package/components/search/component/index.js +4 -4
  104. package/components/search/component/style.scss +24 -0
  105. package/components/tabs/component/index.d.ts +0 -1
  106. package/components/tabs/component/index.d.ts.map +1 -1
  107. package/components/tabs/component/index.js +5 -5
  108. package/components/tabs/component/style.scss +12 -0
  109. package/components/tabs/components/item/index.d.ts +0 -1
  110. package/components/tabs/components/item/index.d.ts.map +1 -1
  111. package/components/tag/component/index.d.ts +0 -1
  112. package/components/tag/component/index.d.ts.map +1 -1
  113. package/components/tag/component/index.js +3 -5
  114. package/components/tag/component/style.scss +27 -0
  115. package/package.json +7 -4
  116. package/readme.md +23 -13
  117. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,6 @@
1
+ import "./style.scss";
2
+ import { ColorPickerProps } from "..";
3
+ /** Color picker component */
4
+ declare const ColorPicker: (props: ColorPickerProps) => JSX.Element;
5
+ export default ColorPicker;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/color/component/index.tsx"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;AAKtC,6BAA6B;AAC7B,QAAA,MAAM,WAAW,UAAW,gBAAgB,KAAG,WAGF,CACxC;AAEL,eAAe,WAAW,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { isNullOrUndefined } from "@bodynarf/utils";
3
+ import "./style.scss";
4
+ import ColorPickerWithoutLabel from "../components/withoutLabel";
5
+ import ColorPickerWithLabel from "../components/withLabel";
6
+ /** Color picker component */
7
+ const ColorPicker = (props) => isNullOrUndefined(props.label)
8
+ ? _jsx(ColorPickerWithoutLabel, { ...props })
9
+ : _jsx(ColorPickerWithLabel, { ...props });
10
+ export default ColorPicker;
@@ -0,0 +1,21 @@
1
+ .bbr-color-picker {
2
+ input[type="color"]:not([disabled]) {
3
+ cursor: pointer;
4
+ }
5
+
6
+ &__preview {
7
+ --color-picker__background-color: transparent;
8
+ --color-picker__color: black;
9
+
10
+ transition: 0.15s ease-in-out;
11
+ transition-property: background-color, color;
12
+
13
+ background-color: var(--color-picker__background-color) !important;
14
+ color: var(--color-picker__color) !important;
15
+
16
+ &:focus {
17
+ box-shadow: none !important;
18
+ border-color: hsl(0, 0%, 86%) !important;
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,37 @@
1
+ import { ChangeEvent } from "react";
2
+ /** Color picker control container props */
3
+ export interface ColorPickerControlProps {
4
+ /** Class names of control container */
5
+ containerClassName: string;
6
+ /** Class names of control */
7
+ className: string;
8
+ /** Default value for color control */
9
+ defaultColor: string;
10
+ /** Handler of control value change*/
11
+ onValueChange: (event: ChangeEvent<HTMLInputElement>) => void;
12
+ /** Control unique identifier */
13
+ id: string;
14
+ /** Extra data-* attributes */
15
+ dataAttributes?: object;
16
+ /** Is validation should be displayed */
17
+ isValidationDefined: boolean;
18
+ /** Validation messages */
19
+ validationMessages: Array<string>;
20
+ /** Validation style class name */
21
+ styleClassName: string;
22
+ /** Current color value */
23
+ value: string;
24
+ /** Should be component disabled. Selecting is not allowed */
25
+ disabled?: boolean;
26
+ /**
27
+ * Show text with color preview.
28
+ * If set - outlined button-like element on the right will be rendered
29
+ */
30
+ showPreview?: boolean;
31
+ /** Title */
32
+ title?: string;
33
+ }
34
+ /** Color picker container component */
35
+ declare const ColorPickerControl: ({ containerClassName, className, disabled, showPreview, defaultColor, onValueChange, value, id, title, dataAttributes, isValidationDefined, validationMessages, styleClassName, }: ColorPickerControlProps) => JSX.Element;
36
+ export default ColorPickerControl;
37
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/color/components/picker/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAMpC,2CAA2C;AAC3C,MAAM,WAAW,uBAAuB;IACpC,uCAAuC;IACvC,kBAAkB,EAAE,MAAM,CAAC;IAE3B,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAElB,sCAAsC;IACtC,YAAY,EAAE,MAAM,CAAC;IAErB,qCAAqC;IACrC,aAAa,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE9D,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC;IAEX,8BAA8B;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,wCAAwC;IACxC,mBAAmB,EAAE,OAAO,CAAC;IAE7B,0BAA0B;IAC1B,kBAAkB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAElC,kCAAkC;IAClC,cAAc,EAAE,MAAM,CAAC;IAEvB,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IAEd,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,YAAY;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,uCAAuC;AACvC,QAAA,MAAM,kBAAkB,sLAOrB,uBAAuB,KAAG,WAyD5B,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { getFontColorFromString } from "@bodynarf/utils";
3
+ /** Color picker container component */
4
+ const ColorPickerControl = ({ containerClassName, className, disabled, showPreview, defaultColor, onValueChange, value, id, title, dataAttributes, isValidationDefined, validationMessages, styleClassName, }) => {
5
+ const color = getFontColorFromString(value);
6
+ if (showPreview) {
7
+ return (_jsxs("div", { className: "columns", children: [_jsx("div", { className: containerClassName, children: _jsx("input", { type: "color", className: className, disabled: disabled, defaultValue: defaultColor, onChange: onValueChange, name: id, id: id, title: title, ...dataAttributes }) }), _jsx("div", { className: "column is-2", children: _jsx("button", { className: "bbr-color-picker__preview button is-outlined", style: {
8
+ "--color-picker__background-color": value,
9
+ "--color-picker__color": color,
10
+ }, children: value }) }), isValidationDefined && validationMessages.length > 0 &&
11
+ _jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
12
+ }
13
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: containerClassName, children: _jsx("input", { type: "color", className: className, disabled: disabled, defaultValue: defaultColor, onChange: onValueChange, name: id, id: id, title: title, ...dataAttributes }) }), isValidationDefined && validationMessages.length > 0 &&
14
+ _jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
15
+ };
16
+ export default ColorPickerControl;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { ColorPickerProps } from "../..";
3
+ /** Color picker component with form label */
4
+ declare function ColorPickerWithLabel({ className, title, showPreview, name, defaultValue, validationState, onValueChange, data, disabled, rounded, label, }: ColorPickerProps): JSX.Element;
5
+ export default ColorPickerWithLabel;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/color/components/withLabel/index.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAGzC,6CAA6C;AAC7C,iBAAS,oBAAoB,CAAC,EAC1B,SAAS,EAAE,KAAK,EAChB,WAAW,EACX,IAAI,EACJ,YAAY,EAAE,eAAe,EAC7B,aAAa,EACb,IAAI,EACJ,QAAgB,EAAE,OAAe,EACjC,KAAK,GACR,EAAE,gBAAgB,eAiHlB;AAED,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useState } from "react";
3
+ import { generateGuid, getClassName, hexToRgb, isNullOrUndefined, rgbToHex, whiteHex } from "@bodynarf/utils";
4
+ import { getValidationValues, mapDataAttributes } from "../../../../..";
5
+ import ColorPickerControl from "../picker";
6
+ /** Color picker component with form label */
7
+ function ColorPickerWithLabel({ className, title, showPreview, name, defaultValue, validationState, onValueChange, data, disabled = false, rounded = false, label, }) {
8
+ const defaultColor = isNullOrUndefined(defaultValue)
9
+ ? whiteHex
10
+ : rgbToHex(defaultValue);
11
+ const [value, setValue] = useState(defaultColor);
12
+ const onChange = useCallback((event) => setValue(event.target.value), [setValue]);
13
+ useEffect(() => onValueChange?.call(undefined, hexToRgb(value)), [onValueChange, value]);
14
+ const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(undefined, validationState);
15
+ const elClassName = getClassName([
16
+ className,
17
+ styleClassName,
18
+ rounded ? "is-rounded" : "",
19
+ "input",
20
+ ]);
21
+ const inputContainerClassName = getClassName([
22
+ "control",
23
+ "bbr-input",
24
+ showPreview ? "column" : "",
25
+ ]);
26
+ const dataAttributes = isNullOrUndefined(data)
27
+ ? undefined
28
+ : mapDataAttributes(data);
29
+ const id = name || generateGuid();
30
+ const labelClassName = getClassName([
31
+ "label",
32
+ label.className
33
+ ]);
34
+ if (label.horizontal) {
35
+ const labelContainerClassName = getClassName([
36
+ "field-label",
37
+ "is-normal",
38
+ label.horizontalContainerClassName
39
+ ]);
40
+ const fieldContainerClassName = getClassName([
41
+ "field-body",
42
+ label.horizontalFieldContainerClassName
43
+ ]);
44
+ return (_jsxs("div", { className: "bbr-color-picker 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: _jsx("div", { className: "field", children: _jsx(ColorPickerControl, { containerClassName: inputContainerClassName, className: elClassName, disabled: disabled, showPreview: showPreview, defaultColor: defaultColor, onValueChange: onChange, value: value, id: id, title: title, dataAttributes: dataAttributes, isValidationDefined: isValidationDefined, validationMessages: validationMessages, styleClassName: styleClassName }) }) })] }));
45
+ }
46
+ return (_jsxs("div", { className: "bbr-color-picker bbr-input field", children: [_jsx("label", { className: labelClassName, htmlFor: id, children: label.caption }), _jsx(ColorPickerControl, { containerClassName: inputContainerClassName, className: elClassName, disabled: disabled, showPreview: showPreview, defaultColor: defaultColor, onValueChange: onChange, value: value, id: id, title: title, dataAttributes: dataAttributes, isValidationDefined: isValidationDefined, validationMessages: validationMessages, styleClassName: styleClassName })] }));
47
+ }
48
+ export default ColorPickerWithLabel;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { ColorPickerProps } from "../..";
3
+ /** Color picker component without form label */
4
+ declare function ColorPickerWithoutLabel({ className, title, showPreview, name, defaultValue, validationState, onValueChange, data, disabled, rounded, }: ColorPickerProps): JSX.Element;
5
+ export default ColorPickerWithoutLabel;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/color/components/withoutLabel/index.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAGzC,gDAAgD;AAChD,iBAAS,uBAAuB,CAAC,EAC7B,SAAS,EAAE,KAAK,EAChB,WAAW,EACX,IAAI,EACJ,YAAY,EAAE,eAAe,EAC7B,aAAa,EACb,IAAI,EACJ,QAAgB,EAAE,OAAe,GACpC,EAAE,gBAAgB,eA+ElB;AAED,eAAe,uBAAuB,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useState } from "react";
3
+ import { generateGuid, getClassName, hexToRgb, isNullOrUndefined, rgbToHex, whiteHex } from "@bodynarf/utils";
4
+ import { getValidationValues, mapDataAttributes } from "../../../../..";
5
+ import ColorPickerControl from "../picker";
6
+ /** Color picker component without form label */
7
+ function ColorPickerWithoutLabel({ className, title, showPreview, name, defaultValue, validationState, onValueChange, data, disabled = false, rounded = false, }) {
8
+ const defaultColor = isNullOrUndefined(defaultValue)
9
+ ? whiteHex
10
+ : rgbToHex(defaultValue);
11
+ const [value, setValue] = useState(defaultColor);
12
+ const onChange = useCallback((event) => setValue(event.target.value), [setValue]);
13
+ useEffect(() => onValueChange?.call(undefined, hexToRgb(value)), [onValueChange, value]);
14
+ const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(undefined, validationState);
15
+ const elClassName = getClassName([
16
+ className,
17
+ styleClassName,
18
+ rounded ? "is-rounded" : "",
19
+ "input",
20
+ ]);
21
+ const containerClassName = getClassName([
22
+ "control",
23
+ "bbr-input",
24
+ showPreview ? "column" : "",
25
+ ]);
26
+ const dataAttributes = isNullOrUndefined(data)
27
+ ? undefined
28
+ : mapDataAttributes(data);
29
+ const id = name || generateGuid();
30
+ if (showPreview) {
31
+ return (_jsx("div", { className: "bbr-color-picker", children: _jsx(ColorPickerControl, { containerClassName: containerClassName, className: elClassName, disabled: disabled, showPreview: showPreview, defaultColor: defaultColor, onValueChange: onChange, value: value, id: id, title: title, dataAttributes: dataAttributes, isValidationDefined: isValidationDefined, validationMessages: validationMessages, styleClassName: styleClassName }) }));
32
+ }
33
+ return (_jsx("div", { className: "bbr-color-picker", children: _jsx(ColorPickerControl, { containerClassName: containerClassName, className: elClassName, disabled: disabled, showPreview: showPreview, defaultColor: defaultColor, onValueChange: onChange, value: value, id: id, title: title, dataAttributes: dataAttributes, isValidationDefined: isValidationDefined, validationMessages: validationMessages, styleClassName: styleClassName }) }));
34
+ }
35
+ export default ColorPickerWithoutLabel;
@@ -0,0 +1,3 @@
1
+ export { default } from "./component";
2
+ export * from "./types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/color/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from "./component";
2
+ export * from "./types";
@@ -0,0 +1,19 @@
1
+ import { CSSProperties } from "react";
2
+ import { Color } from "@bodynarf/utils";
3
+ import { BaseInputElementProps } from "../../..";
4
+ /** Color picker props type */
5
+ export interface ColorPickerProps extends Omit<BaseInputElementProps<Color>, "style" | "loading" | "size" | "readonly" | "placeholder"> {
6
+ /**
7
+ * Show text with color preview.
8
+ * If set - outlined button-like element on the right will be rendered
9
+ */
10
+ showPreview?: boolean;
11
+ }
12
+ /** Color picker custom css properties */
13
+ export interface ColorPickerCssProperties extends CSSProperties {
14
+ /** Selected color to use as background color */
15
+ "--color-picker__background-color": string;
16
+ /** Color of text to contrast with background color */
17
+ "--color-picker__color": string;
18
+ }
19
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/color/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,OAAO,EAAE,qBAAqB,EAAE,MAAM,MAAM,CAAC;AAE7C,8BAA8B;AAC9B,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,EACvE,OAAO,GAAG,SAAS,GACjB,MAAM,GAAG,UAAU,GAAG,aAAa,CACxC;IACG;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,yCAAyC;AACzC,MAAM,WAAW,wBAAyB,SAAQ,aAAa;IAC3D,gDAAgD;IAChD,kCAAkC,EAAE,MAAM,CAAC;IAE3C,sDAAsD;IACtD,uBAAuB,EAAE,MAAM,CAAC;CACnC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "../../../../common.scss";
3
2
  import { DateProps } from "../../date";
4
3
  /** Date input component */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/date/component/index.tsx"],"names":[],"mappings":";AAIA,OAAO,yBAAyB,CAAC;AAKjC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,2BAA2B;AAC3B,QAAA,MAAM,UAAU,wIAMb,SAAS,KAAG,WA4Gd,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/date/component/index.tsx"],"names":[],"mappings":"AAIA,OAAO,yBAAyB,CAAC;AAKjC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,2BAA2B;AAC3B,QAAA,MAAM,UAAU,wIAMb,SAAS,KAAG,WA4Gd,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -5,7 +5,7 @@ import "../../../../common.scss";
5
5
  import { ElementSize } from "../../..";
6
6
  import { getValidationValues } from "../../../../utils";
7
7
  /** Date input component */
8
- const DatePicker = ({ defaultValue, onValueChange, readonly, disabled, validationState, name, size, className, rounded, loading, style, label, onBlur }) => {
8
+ const DatePicker = ({ defaultValue, onValueChange, readonly, disabled, validationState, name, size, className, rounded = false, loading = false, style, label, onBlur }) => {
9
9
  const onChange = useCallback((event) => onValueChange(isStringEmpty(event.target.value)
10
10
  ? undefined
11
11
  : new Date(event.target.value)), [onValueChange]);
@@ -16,14 +16,14 @@ const DatePicker = ({ defaultValue, onValueChange, readonly, disabled, validatio
16
16
  className,
17
17
  elSizeClassName,
18
18
  styleClassName,
19
- rounded === true ? "is-rounded" : "",
19
+ rounded ? "is-rounded" : "",
20
20
  "input",
21
21
  ]);
22
22
  const inputContainerClassName = getClassName([
23
23
  "control",
24
- loading === true ? "is-loading" : "",
24
+ loading ? "is-loading" : "",
25
25
  ]);
26
- const stingifiedDefValue = defaultValue?.toISOString().split("T")[0];
26
+ const stringifiedDefValue = defaultValue?.toISOString().split("T")[0];
27
27
  const labelClassName = getClassName([
28
28
  "label",
29
29
  !label.horizontal ? elSizeClassName : "",
@@ -39,10 +39,10 @@ const DatePicker = ({ defaultValue, onValueChange, readonly, disabled, validatio
39
39
  "field-body",
40
40
  label.horizontalFieldContainerClassName
41
41
  ]);
42
- 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: [_jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "date", className: elClassName, readOnly: readonly, disabled: disabled, defaultValue: stingifiedDefValue, onChange: onChange, onBlur: onBlur, name: id, id: id }) }), isValidationDefined && validationMessages.length > 0 &&
42
+ 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: [_jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "date", className: elClassName, readOnly: readonly, disabled: disabled, defaultValue: stringifiedDefValue, onChange: onChange, onBlur: onBlur, name: id, id: id }) }), isValidationDefined && validationMessages.length > 0 &&
43
43
  _jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }) })] }));
44
44
  }
45
- return (_jsxs("div", { className: "bbr-input field", children: [_jsx("label", { className: labelClassName, htmlFor: id, children: label.caption }), _jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "date", className: elClassName, readOnly: readonly, disabled: disabled, defaultValue: stingifiedDefValue, onChange: onChange, onBlur: onBlur, name: id, id: id }) }), isValidationDefined && validationMessages.length > 0 &&
45
+ return (_jsxs("div", { className: "bbr-input field", children: [_jsx("label", { className: labelClassName, htmlFor: id, children: label.caption }), _jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "date", className: elClassName, readOnly: readonly, disabled: disabled, defaultValue: stringifiedDefValue, onChange: onChange, onBlur: onBlur, name: id, id: id }) }), isValidationDefined && validationMessages.length > 0 &&
46
46
  _jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
47
47
  };
48
48
  export default DatePicker;
@@ -1,4 +1,5 @@
1
1
  export * from "./checkbox";
2
+ export * from "./color";
2
3
  export * from "./date";
3
4
  export * from "./multiline";
4
5
  export * from "./number";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from "./checkbox";
2
+ export * from "./color";
2
3
  export * from "./date";
3
4
  export * from "./multiline";
4
5
  export * from "./number";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "../../../../common.scss";
3
2
  import { MultilineProps } from "../../multiline";
4
3
  /** Multiline textual input component */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/multiline/component/index.tsx"],"names":[],"mappings":";AAEA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAI3D,wCAAwC;AACxC,QAAA,MAAM,SAAS,UAAW,cAAc,KAAG,WAQ1C,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/multiline/component/index.tsx"],"names":[],"mappings":"AAEA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAI3D,wCAAwC;AACxC,QAAA,MAAM,SAAS,UAAW,cAAc,KAAG,WAQ1C,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { MultilineProps } from "../../../multiline";
3
2
  /** Multiline textual input component with describing label */
4
- declare const MultilineWithLabel: ({ defaultValue, onValueChange, validationState, readonly, disabled, name, className, size, style, rounded, loading, label, placeholder, fixed, rows, onBlur }: MultilineProps) => JSX.Element;
3
+ declare const MultilineWithLabel: ({ defaultValue, onValueChange, validationState, readonly, disabled, name, className, size, style, loading, label, placeholder, fixed, rows, onBlur }: MultilineProps) => JSX.Element;
5
4
  export default MultilineWithLabel;
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/multiline/components/multilineWithLabel/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,8DAA8D;AAC9D,QAAA,MAAM,kBAAkB,kKAOrB,cAAc,KAAG,WAyGnB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/multiline/components/multilineWithLabel/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,8DAA8D;AAC9D,QAAA,MAAM,kBAAkB,yJAOrB,cAAc,KAAG,WAwGnB,CAAC;AAEF,eAAe,kBAAkB,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
  /** Multiline textual input component with describing label */
7
- const MultilineWithLabel = ({ defaultValue, onValueChange, validationState, readonly, disabled, name, className, size, style, rounded, loading, label, placeholder, fixed, rows, onBlur }) => {
7
+ const MultilineWithLabel = ({ defaultValue, onValueChange, validationState, readonly, disabled, name, className, size, style, loading = false, label, placeholder, fixed = false, rows, 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,14 +12,13 @@ const MultilineWithLabel = ({ defaultValue, onValueChange, validationState, read
12
12
  const elClassName = getClassName([
13
13
  className,
14
14
  elSizeClassName,
15
- rounded === true ? "is-rounded" : "",
16
15
  styleClassName,
17
16
  "textarea",
18
- fixed === true ? "has-fixed-size" : "",
17
+ fixed ? "has-fixed-size" : "",
19
18
  ]);
20
19
  const inputContainerClassName = getClassName([
21
20
  "control",
22
- loading === true ? "is-loading" : "",
21
+ loading ? "is-loading" : "",
23
22
  ]);
24
23
  const labelClassName = getClassName([
25
24
  "label",
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { MultilineProps } from "../../../multiline";
3
2
  /** Multiline textual input component without describing label*/
4
- declare const MultilineWithoutLabel: ({ onValueChange, defaultValue, validationState, name, placeholder, onBlur, className, size, style, rounded, loading, fixed, rows, }: MultilineProps) => JSX.Element;
3
+ declare const MultilineWithoutLabel: ({ onValueChange, defaultValue, validationState, name, placeholder, onBlur, className, size, style, loading, fixed, rows, }: MultilineProps) => JSX.Element;
5
4
  export default MultilineWithoutLabel;
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/multiline/components/multilineWithoutLabel/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,gEAAgE;AAChE,QAAA,MAAM,qBAAqB,wIAMxB,cAAc,KAAG,WA2CnB,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/multiline/components/multilineWithoutLabel/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,gEAAgE;AAChE,QAAA,MAAM,qBAAqB,+HAMxB,cAAc,KAAG,WA0CnB,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -4,22 +4,21 @@ import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
4
4
  import { ElementSize } from "../../../..";
5
5
  import { getValidationValues } from "../../../../../utils";
6
6
  /** Multiline textual input component without describing label*/
7
- const MultilineWithoutLabel = ({ onValueChange, defaultValue, validationState, name, placeholder, onBlur, className, size, style, rounded, loading, fixed, rows, }) => {
7
+ const MultilineWithoutLabel = ({ onValueChange, defaultValue, validationState, name, placeholder, onBlur, className, size, style, loading = false, fixed = false, rows, }) => {
8
8
  const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
9
9
  const id = name || generateGuid();
10
10
  const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
11
11
  const elClassName = getClassName([
12
12
  className,
13
13
  "is-{0}".format(getValueOrDefault(size, ElementSize.Normal)),
14
- rounded === true ? "is-rounded" : "",
15
14
  styleClassName,
16
15
  "textarea",
17
- fixed === true ? "has-fixed-size" : "",
16
+ fixed ? "has-fixed-size" : "",
18
17
  ]);
19
18
  const inputContainerClassName = getClassName([
20
19
  "control",
21
20
  "bbr-input",
22
- loading === true ? "is-loading" : "",
21
+ loading ? "is-loading" : "",
23
22
  ]);
24
23
  return (_jsxs("div", { className: "field", children: [_jsx("div", { className: inputContainerClassName, children: _jsx("textarea", { className: elClassName, placeholder: placeholder, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, id: id, name: id, rows: rows }) }), isValidationDefined && validationMessages.length > 0 &&
25
24
  _jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
@@ -1,6 +1,6 @@
1
1
  import { BaseInputElementProps } from "../..";
2
2
  /** Multiline textual input component props type */
3
- export interface MultilineProps extends BaseInputElementProps<string> {
3
+ export interface MultilineProps extends Omit<BaseInputElementProps<string>, "rounded"> {
4
4
  /** Is input should be resizable */
5
5
  fixed?: boolean;
6
6
  /** Number of initial rows count */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/multiline/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,mDAAmD;AACnD,MAAM,WAAW,cAAe,SAAQ,qBAAqB,CAAC,MAAM,CAAC;IACjE,mCAAmC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/multiline/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,mDAAmD;AACnD,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAClF,mCAAmC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { NumberProps } from "../../number";
3
2
  /** Number input component */
4
3
  declare const Number: (props: NumberProps) => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/number/component/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD,6BAA6B;AAC7B,QAAA,MAAM,MAAM,UAAW,WAAW,KAAG,WAOpC,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/number/component/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD,6BAA6B;AAC7B,QAAA,MAAM,MAAM,UAAW,WAAW,KAAG,WAOpC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { NumberProps } from "../../../number";
3
2
  /** Number component with label */
4
3
  declare const NumberWithLabel: ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, label, placeholder, onBlur, step, }: NumberProps) => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/number/components/withLabel/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,kCAAkC;AAClC,QAAA,MAAM,eAAe,4JAOlB,WAAW,KAAG,WA2GhB,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/number/components/withLabel/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,kCAAkC;AAClC,QAAA,MAAM,eAAe,4JAOlB,WAAW,KAAG,WA2GhB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -4,7 +4,7 @@ import { generateGuid, getClassName, getValueOrDefault, isStringEmpty } from "@b
4
4
  import { ElementSize } from "../../../..";
5
5
  import { getValidationValues } from "../../../../../utils";
6
6
  /** Number component with label */
7
- const NumberWithLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, label, placeholder, onBlur, step, }) => {
7
+ const NumberWithLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded = false, loading = false, label, placeholder, onBlur, step = 1, }) => {
8
8
  const onChange = useCallback((event) => onValueChange(isStringEmpty(event.target.value) ? undefined : +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 NumberWithLabel = ({ onValueChange, readonly, disabled, defaultValue, vali
12
12
  const elClassName = getClassName([
13
13
  className,
14
14
  elSizeClassName,
15
- rounded === true ? "is-rounded" : "",
15
+ rounded ? "is-rounded" : "",
16
16
  styleClassName,
17
17
  "input",
18
18
  ]);
19
19
  const inputContainerClassName = getClassName([
20
20
  "control",
21
- loading === true ? "is-loading" : "",
21
+ loading ? "is-loading" : "",
22
22
  ]);
23
23
  const labelClassName = getClassName([
24
24
  "label",
@@ -35,10 +35,10 @@ const NumberWithLabel = ({ onValueChange, readonly, disabled, defaultValue, vali
35
35
  "field-body",
36
36
  label.horizontalFieldContainerClassName
37
37
  ]);
38
- 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: [_jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "number", className: elClassName, placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id, step: step ?? 1 }) }), isValidationDefined && validationMessages.length > 0 &&
38
+ 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: [_jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "number", className: elClassName, placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id, step: step }) }), isValidationDefined && validationMessages.length > 0 &&
39
39
  _jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }) })] }));
40
40
  }
41
- return (_jsxs("div", { className: "bbr-input field", children: [_jsx("label", { className: labelClassName, htmlFor: id, children: label.caption }), _jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "number", className: elClassName, placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id, step: step ?? 1 }) }), isValidationDefined && validationMessages.length > 0 &&
41
+ return (_jsxs("div", { className: "bbr-input field", children: [_jsx("label", { className: labelClassName, htmlFor: id, children: label.caption }), _jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "number", className: elClassName, placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id, step: step }) }), isValidationDefined && validationMessages.length > 0 &&
42
42
  _jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
43
43
  };
44
44
  export default NumberWithLabel;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { NumberProps } from "../../../number";
3
2
  /** Number component without label */
4
3
  declare const NumberWithoutLabel: ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, placeholder, onBlur, step, }: NumberProps) => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/number/components/withoutLabel/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,qCAAqC;AACrC,QAAA,MAAM,kBAAkB,qJAOrB,WAAW,KAAG,WA8ChB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/number/components/withoutLabel/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,qCAAqC;AACrC,QAAA,MAAM,kBAAkB,qJAOrB,WAAW,KAAG,WA8ChB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -4,23 +4,23 @@ import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
4
4
  import { ElementSize } from "../../../..";
5
5
  import { getValidationValues } from "../../../../../utils";
6
6
  /** Number component without label */
7
- const NumberWithoutLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, placeholder, onBlur, step, }) => {
7
+ const NumberWithoutLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded = false, loading = false, placeholder, onBlur, step = 1, }) => {
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 === true ? "is-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 === true ? "is-loading" : "",
20
+ loading ? "is-loading" : "",
21
21
  ]);
22
22
  const id = name || generateGuid();
23
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: containerClassName, children: _jsx("input", { type: "number", className: elClassName, placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id, step: step ?? 1 }) }), isValidationDefined && validationMessages.length > 0 &&
23
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: containerClassName, children: _jsx("input", { type: "number", className: elClassName, placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id, step: step }) }), isValidationDefined && validationMessages.length > 0 &&
24
24
  _jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
25
25
  };
26
26
  export default NumberWithoutLabel;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./style.scss";
3
2
  import { PasswordProps } from "../../password";
4
3
  /** Password input component */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/password/component/index.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAKzD,+BAA+B;AAC/B,QAAA,MAAM,QAAQ,UAAW,aAAa,KAAG,WAMxC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/password/component/index.tsx"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAKzD,+BAA+B;AAC/B,QAAA,MAAM,QAAQ,UAAW,aAAa,KAAG,WAMxC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,16 @@
1
+ .bbr-password {
2
+ &:focus ~ .icon:not(:hover) {
3
+ color: rgb(219, 219, 219) !important;
4
+ }
5
+
6
+ &__wrapper {
7
+ .icon {
8
+ pointer-events: inherit !important;
9
+ cursor: pointer;
10
+
11
+ &:hover {
12
+ color: rgb(74, 74, 74);
13
+ }
14
+ }
15
+ }
16
+ }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PasswordProps } from "../../../password";
3
2
  declare const PasswordWithLabel: ({ onValueChange, disabled, validationState, name, className, size, style, rounded, loading, label, placeholder, canShowPassword, }: PasswordProps) => JSX.Element;
4
3
  export default PasswordWithLabel;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withLabel/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,QAAA,MAAM,iBAAiB,uIAMpB,aAAa,KAAG,WAgIlB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withLabel/index.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,QAAA,MAAM,iBAAiB,uIAOpB,aAAa,KAAG,WAgIlB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}