@bodynarf/react.components 1.7.632 → 1.8.1

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 (109) hide show
  1. package/common.scss +4 -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/components/anchorWithIcon/index.d.ts +0 -1
  6. package/components/anchor/components/anchorWithIcon/index.d.ts.map +1 -1
  7. package/components/anchor/components/simpleAnchor/index.d.ts +0 -1
  8. package/components/anchor/components/simpleAnchor/index.d.ts.map +1 -1
  9. package/components/anchor/types.d.ts +1 -11
  10. package/components/anchor/types.d.ts.map +1 -1
  11. package/components/button/component/index.d.ts.map +1 -1
  12. package/components/button/component/index.js +6 -5
  13. package/components/button/components/buttonWithIcon/index.d.ts +0 -1
  14. package/components/button/components/buttonWithIcon/index.d.ts.map +1 -1
  15. package/components/button/components/simpleButton/index.d.ts +0 -1
  16. package/components/button/components/simpleButton/index.d.ts.map +1 -1
  17. package/components/button/types.d.ts +2 -1
  18. package/components/button/types.d.ts.map +1 -1
  19. package/components/dropdown/component/index.d.ts +0 -1
  20. package/components/dropdown/component/index.d.ts.map +1 -1
  21. package/components/dropdown/component/style.scss +3 -3
  22. package/components/dropdown/components/compact/index.d.ts +1 -2
  23. package/components/dropdown/components/compact/index.d.ts.map +1 -1
  24. package/components/dropdown/components/compact/index.js +14 -11
  25. package/components/dropdown/components/withLabel/index.d.ts +1 -2
  26. package/components/dropdown/components/withLabel/index.d.ts.map +1 -1
  27. package/components/dropdown/components/withLabel/index.js +6 -6
  28. package/components/paginator/component/index.d.ts +1 -1
  29. package/components/paginator/component/index.d.ts.map +1 -1
  30. package/components/paginator/component/index.js +3 -3
  31. package/components/primitives/checkbox/component/index.d.ts +1 -2
  32. package/components/primitives/checkbox/component/index.d.ts.map +1 -1
  33. package/components/primitives/checkbox/component/index.js +7 -7
  34. package/components/primitives/checkbox/types.d.ts +1 -1
  35. package/components/primitives/checkbox/types.d.ts.map +1 -1
  36. package/components/primitives/color/component/index.d.ts +6 -0
  37. package/components/primitives/color/component/index.d.ts.map +1 -0
  38. package/components/primitives/color/component/index.js +10 -0
  39. package/components/primitives/color/component/style.scss +21 -0
  40. package/components/primitives/color/components/picker/index.d.ts +37 -0
  41. package/components/primitives/color/components/picker/index.d.ts.map +1 -0
  42. package/components/primitives/color/components/picker/index.js +16 -0
  43. package/components/primitives/color/components/withLabel/index.d.ts +6 -0
  44. package/components/primitives/color/components/withLabel/index.d.ts.map +1 -0
  45. package/components/primitives/color/components/withLabel/index.js +48 -0
  46. package/components/primitives/color/components/withoutLabel/index.d.ts +6 -0
  47. package/components/primitives/color/components/withoutLabel/index.d.ts.map +1 -0
  48. package/components/primitives/color/components/withoutLabel/index.js +35 -0
  49. package/components/primitives/color/index.d.ts +3 -0
  50. package/components/primitives/color/index.d.ts.map +1 -0
  51. package/components/primitives/color/index.js +2 -0
  52. package/components/primitives/color/types.d.ts +19 -0
  53. package/components/primitives/color/types.d.ts.map +1 -0
  54. package/components/primitives/color/types.js +1 -0
  55. package/components/primitives/date/component/index.d.ts +0 -1
  56. package/components/primitives/date/component/index.d.ts.map +1 -1
  57. package/components/primitives/date/component/index.js +6 -6
  58. package/components/primitives/index.d.ts +1 -0
  59. package/components/primitives/index.d.ts.map +1 -1
  60. package/components/primitives/index.js +1 -0
  61. package/components/primitives/multiline/component/index.d.ts +0 -1
  62. package/components/primitives/multiline/component/index.d.ts.map +1 -1
  63. package/components/primitives/multiline/components/multilineWithLabel/index.d.ts +1 -2
  64. package/components/primitives/multiline/components/multilineWithLabel/index.d.ts.map +1 -1
  65. package/components/primitives/multiline/components/multilineWithLabel/index.js +3 -4
  66. package/components/primitives/multiline/components/multilineWithoutLabel/index.d.ts +1 -2
  67. package/components/primitives/multiline/components/multilineWithoutLabel/index.d.ts.map +1 -1
  68. package/components/primitives/multiline/components/multilineWithoutLabel/index.js +3 -4
  69. package/components/primitives/multiline/types.d.ts +1 -1
  70. package/components/primitives/multiline/types.d.ts.map +1 -1
  71. package/components/primitives/number/component/index.d.ts +0 -1
  72. package/components/primitives/number/component/index.d.ts.map +1 -1
  73. package/components/primitives/number/components/withLabel/index.d.ts +0 -1
  74. package/components/primitives/number/components/withLabel/index.d.ts.map +1 -1
  75. package/components/primitives/number/components/withLabel/index.js +5 -5
  76. package/components/primitives/number/components/withoutLabel/index.d.ts +0 -1
  77. package/components/primitives/number/components/withoutLabel/index.d.ts.map +1 -1
  78. package/components/primitives/number/components/withoutLabel/index.js +4 -4
  79. package/components/primitives/password/component/index.d.ts +0 -1
  80. package/components/primitives/password/component/index.d.ts.map +1 -1
  81. package/components/primitives/password/components/withLabel/index.d.ts +0 -1
  82. package/components/primitives/password/components/withLabel/index.d.ts.map +1 -1
  83. package/components/primitives/password/components/withLabel/index.js +3 -3
  84. package/components/primitives/password/components/withoutLabel/index.d.ts +0 -1
  85. package/components/primitives/password/components/withoutLabel/index.d.ts.map +1 -1
  86. package/components/primitives/password/components/withoutLabel/index.js +3 -3
  87. package/components/primitives/password/types.d.ts +2 -2
  88. package/components/primitives/password/types.d.ts.map +1 -1
  89. package/components/primitives/text/component/index.d.ts +0 -1
  90. package/components/primitives/text/component/index.d.ts.map +1 -1
  91. package/components/primitives/text/components/textWithLabel/index.d.ts +0 -1
  92. package/components/primitives/text/components/textWithLabel/index.d.ts.map +1 -1
  93. package/components/primitives/text/components/textWithLabel/index.js +3 -3
  94. package/components/primitives/text/components/textWithoutLabel/index.d.ts +0 -1
  95. package/components/primitives/text/components/textWithoutLabel/index.d.ts.map +1 -1
  96. package/components/primitives/text/components/textWithoutLabel/index.js +3 -3
  97. package/components/search/component/index.d.ts.map +1 -1
  98. package/components/search/component/index.js +4 -4
  99. package/components/tabs/component/index.d.ts +0 -1
  100. package/components/tabs/component/index.d.ts.map +1 -1
  101. package/components/tabs/component/index.js +5 -5
  102. package/components/tabs/components/item/index.d.ts +0 -1
  103. package/components/tabs/components/item/index.d.ts.map +1 -1
  104. package/components/tag/component/index.d.ts +0 -1
  105. package/components/tag/component/index.d.ts.map +1 -1
  106. package/components/tag/component/index.js +3 -5
  107. package/package.json +7 -4
  108. package/readme.md +22 -12
  109. package/tsconfig.tsbuildinfo +1 -1
package/common.scss CHANGED
@@ -1,3 +1,7 @@
1
1
  .help.m-help {
2
2
  white-space: pre-line;
3
+ }
4
+
5
+ .control.is-loading input[type="date"]::-webkit-calendar-picker-indicator {
6
+ display: none;
3
7
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./style.scss";
3
2
  import { AccordionProps } from "../../accordion";
4
3
  /** Accordion panel */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/component/index.tsx"],"names":[],"mappings":";AAIA,OAAO,cAAc,CAAC;AAOtB,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,sBAAsB;AACtB,QAAA,MAAM,SAAS,2FAKZ,cAAc,KAAG,WA8DnB,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/component/index.tsx"],"names":[],"mappings":"AAIA,OAAO,cAAc,CAAC;AAOtB,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,sBAAsB;AACtB,QAAA,MAAM,SAAS,2FAMZ,cAAc,KAAG,WA8DnB,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -6,13 +6,13 @@ import { ElementSize } from "../..";
6
6
  import Icon from "../../icon";
7
7
  import { mapDataAttributes } from "../../../utils";
8
8
  /** Accordion panel */
9
- const Accordion = ({ children, caption, style, size, defaultExpanded, onToggle, className, data, title, }) => {
9
+ const Accordion = ({ children, caption, style, size = ElementSize.Normal, defaultExpanded = false, onToggle, className, data, title, }) => {
10
10
  const expandablePanelRef = useRef(null);
11
- const [isExpanded, setIsExpanded] = useState(defaultExpanded ?? false);
12
- const [maxHeight, setMaxHeight] = useState(defaultExpanded === true ? undefined : 0);
11
+ const [isExpanded, setIsExpanded] = useState(defaultExpanded);
12
+ const [maxHeight, setMaxHeight] = useState(defaultExpanded ? undefined : 0);
13
13
  const toggleCollapse = useCallback(() => setMaxHeight(isExpanded ? 0 : expandablePanelRef.current.scrollHeight), [isExpanded]);
14
14
  useEffect(() => {
15
- if (defaultExpanded === true && !isNullOrUndefined(expandablePanelRef.current)) {
15
+ if (defaultExpanded && !isNullOrUndefined(expandablePanelRef.current)) {
16
16
  setMaxHeight(expandablePanelRef.current.scrollHeight);
17
17
  }
18
18
  }, [defaultExpanded]);
@@ -30,6 +30,6 @@ const Accordion = ({ children, caption, style, size, defaultExpanded, onToggle,
30
30
  const dataAttributes = isNullOrUndefined(data)
31
31
  ? undefined
32
32
  : mapDataAttributes(data);
33
- return (_jsxs("article", { className: elClassName, "aria-expanded": isExpanded, ...dataAttributes, children: [_jsxs("div", { className: "message-header is-unselectable", onClick: toggleCollapse, children: [_jsx("span", { title: title, children: caption }), _jsx(Icon, { name: "arrow-down", size: size ?? ElementSize.Medium })] }), _jsx("div", { className: "message-body", ref: expandablePanelRef, style: { maxHeight: `${maxHeight}px` }, children: _jsx("div", { className: "message-body__content", children: children }) })] }));
33
+ return (_jsxs("article", { className: elClassName, "aria-expanded": isExpanded, ...dataAttributes, children: [_jsxs("div", { className: "message-header is-unselectable", onClick: toggleCollapse, children: [_jsx("span", { title: title, children: caption }), _jsx(Icon, { name: "arrow-down", size: size })] }), _jsx("div", { className: "message-body", ref: expandablePanelRef, style: { maxHeight: `${maxHeight}px` }, children: _jsx("div", { className: "message-body__content", children: children }) })] }));
34
34
  };
35
35
  export default Accordion;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { AnchorWithIconProps } from "../../../anchor";
3
2
  /** Anchor with icon component */
4
3
  export declare const AnchorWithIcon: ({ href, className, onClick, caption, title, target, icon }: AnchorWithIconProps) => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/anchor/components/anchorWithIcon/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,iCAAiC;AACjC,eAAO,MAAM,cAAc,+DAAgE,mBAAmB,KAAG,WAqChH,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/anchor/components/anchorWithIcon/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,iCAAiC;AACjC,eAAO,MAAM,cAAc,+DAAgE,mBAAmB,KAAG,WAqChH,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SimpleAnchorProps } from "../../../anchor";
3
2
  /** Simple anchor component, without icon */
4
3
  export declare const SimpleAnchor: ({ href, className, onClick, caption, title, target }: SimpleAnchorProps) => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/anchor/components/simpleAnchor/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,4CAA4C;AAC5C,eAAO,MAAM,YAAY,yDAA0D,iBAAiB,KAAG,WAYtG,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/anchor/components/simpleAnchor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,4CAA4C;AAC5C,eAAO,MAAM,YAAY,yDAA0D,iBAAiB,KAAG,WAYtG,CAAC"}
@@ -1,18 +1,8 @@
1
1
  import { ElementIcon } from "..";
2
2
  /** Anchor component props type */
3
- export interface AnchorProps {
4
- /** Link destination */
5
- href?: string;
6
- /** Link caption */
7
- caption?: string;
8
- /** Click handler */
9
- onClick?: () => void;
3
+ export interface AnchorProps extends Omit<SimpleAnchorProps, "className"> {
10
4
  /** Configuration od inner icon */
11
5
  icon?: ElementIcon;
12
- /** Title of anchor */
13
- title?: string;
14
- /** Where to open the linked document */
15
- target?: "_blank" | "_top";
16
6
  /** Additional class names */
17
7
  className?: string;
18
8
  /** Should css hovering effects be disabled */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/anchor/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,kCAAkC;AAClC,MAAM,WAAW,WAAW;IACxB,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;AAED,MAAM,WAAW,iBAAiB;IAC9B,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,kBAAkB;IAClB,SAAS,EAAE,MAAM,CAAC;IAElB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,wCAAwC;IACxC,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC1D,4BAA4B;IAC5B,IAAI,EAAE,WAAW,CAAC;CACrB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/anchor/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,kCAAkC;AAClC,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,iBAAiB,EAAE,WAAW,CAAC;IACrE,kCAAkC;IAClC,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,8CAA8C;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAC9B,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,kBAAkB;IAClB,SAAS,EAAE,MAAM,CAAC;IAElB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,wCAAwC;IACxC,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC1D,4BAA4B;IAC5B,IAAI,EAAE,WAAW,CAAC;CACrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/button/component/index.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,WAAW,EAAe,MAAM,iBAAiB,CAAC;AAO3D;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CA0C9D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/button/component/index.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,WAAW,EAAe,MAAM,iBAAiB,CAAC;AAO3D;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAkD9D"}
@@ -12,17 +12,18 @@ export default function Button(props) {
12
12
  if (isNullOrEmpty(props.caption) && isNullOrUndefined(props.icon)) {
13
13
  throw new Error("No button content provided.");
14
14
  }
15
+ const { light = false, outlined = false, rounded = false, isLoading = false, static: isStatic = false } = props;
15
16
  const className = getClassName([
16
17
  "button",
17
18
  "bbr-button",
18
19
  props.className,
19
20
  `is-${props.type}`,
20
- props.light === true ? "is-light" : "",
21
+ light ? "is-light" : "",
21
22
  !isNullOrUndefined(props.size) ? `is-${props.size}` : "",
22
- props.outlined === true ? "is-outlined" : "",
23
- props.rounded === true ? "is-rounded" : "",
24
- props.isLoading === true ? "is-loading" : "",
25
- props.static === true ? "is-static" : "",
23
+ outlined ? "is-outlined" : "",
24
+ rounded ? "is-rounded" : "",
25
+ isLoading ? "is-loading" : "",
26
+ isStatic ? "is-static" : "",
26
27
  ]);
27
28
  const data = isNullOrUndefined(props.data)
28
29
  ? undefined
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ButtonWithIconProps } from "../../../button";
3
2
  /** Button with icon component */
4
3
  export declare const ButtonWithIcon: ({ className, disabled, onClick, caption, title, icon, data, }: ButtonWithIconProps) => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/button/components/buttonWithIcon/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,iCAAiC;AACjC,eAAO,MAAM,cAAc,kEAKxB,mBAAmB,KAAG,WAwCxB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/button/components/buttonWithIcon/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,iCAAiC;AACjC,eAAO,MAAM,cAAc,kEAKxB,mBAAmB,KAAG,WAwCxB,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SimpleButtonProps } from "../../../button";
3
2
  /** Simple button component, without icon */
4
3
  export declare const SimpleButton: ({ className, disabled, onClick, caption, title, data }: SimpleButtonProps) => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/button/components/simpleButton/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,4CAA4C;AAC5C,eAAO,MAAM,YAAY,2DAKtB,iBAAiB,KAAG,WAYtB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/button/components/simpleButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,4CAA4C;AAC5C,eAAO,MAAM,YAAY,2DAKtB,iBAAiB,KAAG,WAYtB,CAAC"}
@@ -24,7 +24,8 @@ export interface ButtonProps extends BaseElementProps {
24
24
  onClick?: () => void;
25
25
  }
26
26
  /** Button types according to Bulma framework */
27
- export declare type ButtonType = "default" /** color: transparent */ | "primary" /** color: sea-wave green */ | "link" /** color: blue-violet */ | "info" /** color: sky-blue */ | "success" /** color: green */ | "warning" /** color: yellow */ | "danger" /** color: red */ | "white" /** color: white */ | "light" /** color: light-gray */ | "dark" /** color: dark-gray */ | "black" /** color: black */ | "text" /** Underline text with color: gray */ | "ghost" /** Blue underline text with color: transparent */;
27
+ export declare type ButtonType = // TODO: to enum
28
+ "default" /** color: transparent */ | "primary" /** color: sea-wave green */ | "link" /** color: blue-violet */ | "info" /** color: sky-blue */ | "success" /** color: green */ | "warning" /** color: yellow */ | "danger" /** color: red */ | "white" /** color: white */ | "light" /** color: light-gray */ | "dark" /** color: dark-gray */ | "black" /** color: black */ | "text" /** Underline text with color: gray */ | "ghost" /** Blue underline text with color: transparent */;
28
29
  /** Simple button props type */
29
30
  export interface SimpleButtonProps extends Omit<ButtonProps, 'className'> {
30
31
  /** Button class name*/
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE7E,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACjD,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,8BAA8B;IAC9B,IAAI,EAAE,UAAU,CAAC;IAEjB,kCAAkC;IAClC,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,mBAAmB;IACnB,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,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,gCAAgC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,gDAAgD;AAChD,oBAAY,UAAU,GAClB,SAAS,CAAC,yBAAyB,GACjC,SAAS,CAAC,4BAA4B,GACtC,MAAM,CAAC,yBAAyB,GAChC,MAAM,CAAC,sBAAsB,GAC7B,SAAS,CAAC,mBAAmB,GAC7B,SAAS,CAAC,oBAAoB,GAC9B,QAAQ,CAAC,iBAAiB,GAC1B,OAAO,CAAC,mBAAmB,GAC3B,OAAO,CAAC,wBAAwB,GAChC,MAAM,CAAC,uBAAuB,GAC9B,OAAO,CAAC,mBAAmB,GAC3B,MAAM,CAAC,sCAAsC,GAC7C,OAAO,CAAC,kDAAkD,CAC3D;AAEL,+BAA+B;AAC/B,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC;IACrE,uBAAuB;IACvB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC1D,yBAAyB;IACzB,IAAI,EAAE,WAAW,CAAC;CACrB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE7E,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACjD,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,8BAA8B;IAC9B,IAAI,EAAE,UAAU,CAAC;IAEjB,kCAAkC;IAClC,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,mBAAmB;IACnB,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,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,gCAAgC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,gDAAgD;AAChD,oBAAY,UAAU,GAClB,AADqB,gBAAgB;AACrC,SAAS,CAAC,yBAAyB,GACjC,SAAS,CAAC,4BAA4B,GACtC,MAAM,CAAC,yBAAyB,GAChC,MAAM,CAAC,sBAAsB,GAC7B,SAAS,CAAC,mBAAmB,GAC7B,SAAS,CAAC,oBAAoB,GAC9B,QAAQ,CAAC,iBAAiB,GAC1B,OAAO,CAAC,mBAAmB,GAC3B,OAAO,CAAC,wBAAwB,GAChC,MAAM,CAAC,uBAAuB,GAC9B,OAAO,CAAC,mBAAmB,GAC3B,MAAM,CAAC,sCAAsC,GAC7C,OAAO,CAAC,kDAAkD,CAC3D;AAEL,+BAA+B;AAC/B,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC;IACrE,uBAAuB;IACvB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC1D,yBAAyB;IACzB,IAAI,EAAE,WAAW,CAAC;CACrB"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./style.scss";
3
2
  import { DropdownProps } from "../../dropdown";
4
3
  /** Dropdown component */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/dropdown/component/index.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAKtB,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,yBAAyB;AACzB,QAAA,MAAM,QAAQ,UAAW,aAAa,KAAG,WAMxC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/dropdown/component/index.tsx"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAC;AAKtB,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,yBAAyB;AACzB,QAAA,MAAM,QAAQ,UAAW,aAAa,KAAG,WAMxC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -17,7 +17,7 @@
17
17
  }
18
18
  }
19
19
 
20
- &__label {
20
+ label#{&}__label {
21
21
  cursor: pointer;
22
22
  user-select: none;
23
23
  display: flex;
@@ -84,7 +84,7 @@
84
84
  }
85
85
 
86
86
  &.is-active {
87
- .bbr-dropdown__label .bbr-icon.bi-arrow-down::before {
87
+ label.bbr-dropdown__label .bbr-icon.bi-arrow-down::before {
88
88
  transform: rotate(180deg);
89
89
  }
90
90
  }
@@ -104,7 +104,7 @@
104
104
  }
105
105
 
106
106
  &--disabled {
107
- .bbr-dropdown__label {
107
+ label.bbr-dropdown__label {
108
108
  background-color: hsl(0deg, 0%, 96%);
109
109
  border-color: hsl(0deg, 0%, 96%);
110
110
  box-shadow: none;
@@ -1,5 +1,4 @@
1
- /// <reference types="react" />
2
1
  import { DropdownProps } from "../../../dropdown";
3
- declare const DropdownCompact: ({ items, value, onSelect, deselectable, className, hideOnOuterClick, listMaxHeight, placeholder, compact, disabled, }: DropdownProps) => JSX.Element;
2
+ declare const DropdownCompact: ({ items, value, onSelect, deselectable, className, hideOnOuterClick, listMaxHeight, placeholder, compact, disabled, validationState, }: DropdownProps) => JSX.Element;
4
3
  export default DropdownCompact;
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/dropdown/components/compact/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAIzD,QAAA,MAAM,eAAe,0HAMlB,aAAa,KAAG,WAsGlB,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/dropdown/components/compact/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAIzD,QAAA,MAAM,eAAe,2IAOlB,aAAa,KAAG,WA8GlB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,14 +1,15 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useCallback, useId, useState } from "react";
3
3
  import { getClassName, isNullOrEmpty, isNullOrUndefined } from "@bodynarf/utils";
4
+ import { getValidationValues } from "../../../../utils";
4
5
  import { useComponentOutsideClick } from "../../../../hooks";
5
6
  import DropdownItem from "../../../dropdown/components/item";
6
7
  import DropdownLabel from "../../../dropdown/components/label";
7
- const DropdownCompact = ({ items, value, onSelect, deselectable, className, hideOnOuterClick, listMaxHeight, placeholder, compact, disabled, }) => {
8
+ const DropdownCompact = ({ items, value, onSelect, deselectable = false, className, hideOnOuterClick, listMaxHeight, placeholder, compact = false, disabled = false, validationState, }) => {
8
9
  const id = useId();
9
10
  const [isListVisible, setListVisible] = useState(false);
10
11
  const onItemClick = useCallback((event) => {
11
- if (disabled ?? false) {
12
+ if (disabled) {
12
13
  return;
13
14
  }
14
15
  const target = event.target;
@@ -16,7 +17,7 @@ const DropdownCompact = ({ items, value, onSelect, deselectable, className, hide
16
17
  return;
17
18
  }
18
19
  const dataValue = target.dataset["dropdownItemValue"];
19
- if (isNullOrEmpty(dataValue)) {
20
+ if (isNullOrUndefined(dataValue)) {
20
21
  return;
21
22
  }
22
23
  const item = items.find(x => x.value === dataValue);
@@ -31,7 +32,7 @@ const DropdownCompact = ({ items, value, onSelect, deselectable, className, hide
31
32
  setListVisible(false);
32
33
  }, [setListVisible, value, items, onSelect, disabled]);
33
34
  const onLabelClick = useCallback((event) => {
34
- if (disabled ?? false) {
35
+ if (disabled) {
35
36
  return;
36
37
  }
37
38
  const target = event.target;
@@ -46,17 +47,19 @@ const DropdownCompact = ({ items, value, onSelect, deselectable, className, hide
46
47
  }
47
48
  }, [onSelect, setListVisible, disabled]);
48
49
  useComponentOutsideClick(`[data-dropdown-id="${id}"]`, isListVisible, () => setListVisible(false), hideOnOuterClick);
50
+ const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(undefined, validationState);
49
51
  const classNames = getClassName([
50
52
  "bbr-dropdown",
51
- (disabled ?? false) ? "bbr-dropdown--disabled" : "",
52
- (compact ?? false) ? "bbr-dropdown--compact" : "",
53
+ disabled ? "bbr-dropdown--disabled" : "",
54
+ compact ? "bbr-dropdown--compact" : "",
53
55
  isListVisible ? "is-active" : "",
54
56
  isNullOrEmpty(listMaxHeight) ? "bbr-dropdown--height-default" : "",
55
57
  className,
56
- "dropdown"
58
+ "dropdown",
57
59
  ]);
58
- return (_jsxs("div", { className: classNames, "data-dropdown-id": id, children: [_jsx(DropdownLabel, { caption: placeholder, deselectable: deselectable === true, selectedItem: value, onClick: onLabelClick }), _jsx("div", { className: "dropdown-menu", children: items.length > 0
59
- ? _jsx("ul", { className: "dropdown-content", style: { maxHeight: listMaxHeight }, children: items.map(item => _jsx(DropdownItem, { item: item, selected: value?.value === item.value, onClick: onItemClick }, item.id)) })
60
- : _jsx("span", { className: "dropdown-content dropdown-item", children: "No items found" }) })] }, id));
60
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: classNames, "data-dropdown-id": id, children: [_jsx(DropdownLabel, { selectedItem: value, caption: placeholder, onClick: onLabelClick, className: styleClassName, deselectable: deselectable }), _jsx("div", { className: "dropdown-menu", children: items.length > 0
61
+ ? _jsx("ul", { className: "dropdown-content", style: { maxHeight: listMaxHeight }, children: items.map(item => _jsx(DropdownItem, { item: item, onClick: onItemClick, selected: value?.value === item.value }, item.id)) })
62
+ : _jsx("span", { className: "dropdown-content dropdown-item", children: "No items found" }) })] }, id), isValidationDefined && validationMessages.length > 0 &&
63
+ _jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
61
64
  };
62
65
  export default DropdownCompact;
@@ -1,5 +1,4 @@
1
- /// <reference types="react" />
2
1
  import { DropdownProps } from "../../../dropdown";
3
- declare const DropdownWithLabel: ({ items, value, onSelect, validationState, deselectable, className, hideOnOuterClick, listMaxHeight, label, placeholder, disabled }: DropdownProps) => JSX.Element;
2
+ declare const DropdownWithLabel: ({ items, value, onSelect, validationState, deselectable, className, hideOnOuterClick, listMaxHeight, label, placeholder, disabled, }: DropdownProps) => JSX.Element;
4
3
  export default DropdownWithLabel;
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/dropdown/components/withLabel/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAIzD,QAAA,MAAM,iBAAiB,wIAOpB,aAAa,KAAG,WAoLlB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/dropdown/components/withLabel/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAIzD,QAAA,MAAM,iBAAiB,yIAOpB,aAAa,KAAG,WAoLlB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -5,12 +5,12 @@ import { getValidationValues } from "../../../../utils";
5
5
  import { useComponentOutsideClick } from "../../../../hooks";
6
6
  import DropdownItem from "../../../dropdown/components/item";
7
7
  import DropdownLabel from "../../../dropdown/components/label";
8
- const DropdownWithLabel = ({ items, value, onSelect, validationState, deselectable, className, hideOnOuterClick, listMaxHeight, label, placeholder, disabled }) => {
8
+ const DropdownWithLabel = ({ items, value, onSelect, validationState, deselectable = false, className, hideOnOuterClick, listMaxHeight, label, placeholder, disabled = false, }) => {
9
9
  const id = useId();
10
10
  const [isListVisible, setListVisible] = useState(false);
11
11
  const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(undefined, validationState);
12
12
  const onItemClick = useCallback((event) => {
13
- if (disabled ?? false) {
13
+ if (disabled) {
14
14
  return;
15
15
  }
16
16
  const target = event.target;
@@ -33,7 +33,7 @@ const DropdownWithLabel = ({ items, value, onSelect, validationState, deselectab
33
33
  setListVisible(false);
34
34
  }, [setListVisible, value, items, onSelect, disabled]);
35
35
  const onLabelClick = useCallback((event) => {
36
- if (disabled ?? false) {
36
+ if (disabled) {
37
37
  return;
38
38
  }
39
39
  const target = event.target;
@@ -50,7 +50,7 @@ const DropdownWithLabel = ({ items, value, onSelect, validationState, deselectab
50
50
  useComponentOutsideClick(`[data-dropdown-id="${id}"]`, isListVisible, () => setListVisible(false), hideOnOuterClick);
51
51
  const classNames = getClassName([
52
52
  "bbr-dropdown",
53
- (disabled ?? false) ? "bbr-dropdown--disabled" : "",
53
+ disabled ? "bbr-dropdown--disabled" : "",
54
54
  isListVisible ? "is-active" : "",
55
55
  isNullOrEmpty(listMaxHeight) ? "bbr-dropdown--height-default" : "",
56
56
  className,
@@ -70,12 +70,12 @@ const DropdownWithLabel = ({ items, value, onSelect, validationState, deselectab
70
70
  "field-body",
71
71
  label.horizontalFieldContainerClassName
72
72
  ]);
73
- return (_jsxs("div", { className: "bbr-dropdown__root-container--with-label 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: classNames, "data-dropdown-id": id, children: [_jsx(DropdownLabel, { className: styleClassName, caption: placeholder, deselectable: deselectable === true, selectedItem: value, onClick: onLabelClick }), _jsx("div", { className: "dropdown-menu", children: items.length > 0
73
+ return (_jsxs("div", { className: "bbr-dropdown__root-container--with-label 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: classNames, "data-dropdown-id": id, children: [_jsx(DropdownLabel, { className: styleClassName, caption: placeholder, deselectable: deselectable, selectedItem: value, onClick: onLabelClick }), _jsx("div", { className: "dropdown-menu", children: items.length > 0
74
74
  ? _jsx("ul", { className: "dropdown-content", style: { maxHeight: listMaxHeight }, children: items.map(item => _jsx(DropdownItem, { item: item, selected: value?.value === item.value, onClick: onItemClick }, item.id)) })
75
75
  : _jsx("span", { className: "dropdown-content dropdown-item", children: "No items found" }) })] }, id), isValidationDefined && validationMessages.length > 0 &&
76
76
  _jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }) })] }));
77
77
  }
78
- return (_jsxs("div", { className: "field", children: [_jsx("label", { className: labelClassName, htmlFor: id, children: label.caption }), _jsxs("div", { className: classNames, "data-dropdown-id": id, children: [_jsx(DropdownLabel, { className: styleClassName, caption: placeholder, deselectable: deselectable === true, selectedItem: value, onClick: onLabelClick }), _jsx("div", { className: "dropdown-menu", children: items.length > 0
78
+ return (_jsxs("div", { className: "field", children: [_jsx("label", { className: labelClassName, htmlFor: id, children: label.caption }), _jsxs("div", { className: classNames, "data-dropdown-id": id, children: [_jsx(DropdownLabel, { className: styleClassName, caption: placeholder, deselectable: deselectable, selectedItem: value, onClick: onLabelClick }), _jsx("div", { className: "dropdown-menu", children: items.length > 0
79
79
  ? _jsx("ul", { className: "dropdown-content", style: { maxHeight: listMaxHeight }, children: items.map(item => _jsx(DropdownItem, { item: item, selected: value?.value === item.value, onClick: onItemClick }, item.id)) })
80
80
  : _jsx("span", { className: "dropdown-content dropdown-item", children: "No items found" }) })] }, id), isValidationDefined && validationMessages.length > 0 &&
81
81
  _jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
@@ -4,5 +4,5 @@ import { PaginatorProps } from "../../paginator";
4
4
  * Paginator component.
5
5
  * Used for visualization of paging configuration
6
6
  */
7
- export default function Paginator({ count, onPageChange, currentPage, position, rounded, size, className, showNextButtons, nearPagesCount }: PaginatorProps): JSX.Element;
7
+ export default function Paginator({ count, onPageChange, currentPage, position, size, className, rounded, showNextButtons, nearPagesCount }: PaginatorProps): JSX.Element;
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/paginator/component/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAuB,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhF;;;EAGE;AACF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAC9B,KAAK,EAAE,YAAY,EAAE,WAAW,EAChC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAClC,eAAe,EAAE,cAAc,EAClC,EAAE,cAAc,GAAG,GAAG,CAAC,OAAO,CA4G9B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/paginator/component/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAuB,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhF;;;EAGE;AACF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAC9B,KAAK,EAAE,YAAY,EAAE,WAAW,EAChC,QAAQ,EACR,IAAI,EAAE,SAAS,EACf,OAAe,EAAE,eAAuB,EACxC,cAAc,EACjB,EAAE,cAAc,GAAG,GAAG,CAAC,OAAO,CA4G9B"}
@@ -6,7 +6,7 @@ import { generatePageNumbers } from "../../paginator";
6
6
  * Paginator component.
7
7
  * Used for visualization of paging configuration
8
8
  */
9
- export default function Paginator({ count, onPageChange, currentPage, position, rounded, size, className, showNextButtons, nearPagesCount }) {
9
+ export default function Paginator({ count, onPageChange, currentPage, position, size, className, rounded = false, showNextButtons = false, nearPagesCount }) {
10
10
  const page = currentPage || 0;
11
11
  const pageChange = useCallback((event) => {
12
12
  const target = event.target;
@@ -29,11 +29,11 @@ export default function Paginator({ count, onPageChange, currentPage, position,
29
29
  "bbr-paginator",
30
30
  "pagination",
31
31
  paginationPositionToClassMap.has(position || "") ? paginationPositionToClassMap.get(position || "") : "",
32
- rounded == true ? "is-rounded" : "",
32
+ rounded ? "is-rounded" : "",
33
33
  isNullOrEmpty(size) ? "" : `is-${size}`,
34
34
  className
35
35
  ]);
36
- return (_jsxs("nav", { className: classNames, role: "navigation", "aria-label": "pagination", children: [showNextButtons === true &&
36
+ return (_jsxs("nav", { className: classNames, role: "navigation", "aria-label": "pagination", children: [showNextButtons &&
37
37
  _jsxs(_Fragment, { children: [_jsx("a", { className: `pagination-previous${canGoBack ? "" : " is-disabled"}`, "data-page": page - 1, onClick: pageChange, children: "Previous" }), _jsx("a", { className: `pagination-next${canGoForward ? "" : " is-disabled"}`, "data-page": page + 1, onClick: pageChange, children: "Next page" })] }), _jsxs("ul", { className: "pagination-list", children: [page !== 1 && !pageNumbers.includes(1) &&
38
38
  _jsxs(_Fragment, { children: [_jsx("li", { children: _jsx("a", { className: "pagination-link", "aria-label": "Goto page 1", "data-page": 1, onClick: pageChange, children: "1" }) }), _jsx("li", { children: _jsx("span", { className: "pagination-ellipsis", children: "\u2026" }) })] }), pageNumbers.map(x => _jsx("li", { children: _jsx("a", { className: `pagination-link${page === x ? " is-current" : ""}`, "aria-label": `Goto page ${x}`, "data-page": x, onClick: pageChange, children: x }) }, x)), page != count && !pageNumbers.includes(count) &&
39
39
  _jsxs(_Fragment, { children: [_jsx("li", { children: _jsx("span", { className: "pagination-ellipsis", children: "\u2026" }) }), _jsx("li", { children: _jsx("a", { className: "pagination-link", "aria-label": `Goto page ${count}`, "data-page": count, onClick: pageChange, children: count }) })] })] })] }));
@@ -1,7 +1,6 @@
1
- /// <reference types="react" />
2
1
  import "./style.scss";
3
2
  import { CheckBoxProps } from "../../checkbox";
4
3
  /** Boolean input component */
5
- declare const CheckBox: ({ label, onValueChange, defaultValue, name, disabled, rounded, size, style, block, withoutBorder, hasBackgroundColor, fixBackgroundColor, isFormLabel, }: CheckBoxProps) => JSX.Element;
4
+ declare const CheckBox: ({ label, onValueChange, defaultValue, name, disabled, size, style, rounded, block, withoutBorder, hasBackgroundColor, fixBackgroundColor, isFormLabel, }: CheckBoxProps) => JSX.Element;
6
5
  export default CheckBox;
7
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/checkbox/component/index.tsx"],"names":[],"mappings":";AAIA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,8BAA8B;AAC9B,QAAA,MAAM,QAAQ,6JAMX,aAAa,KAAG,WAoFlB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/checkbox/component/index.tsx"],"names":[],"mappings":"AAIA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,8BAA8B;AAC9B,QAAA,MAAM,QAAQ,6JAOX,aAAa,KAAG,WAoFlB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -3,21 +3,21 @@ import { useCallback } from "react";
3
3
  import { generateGuid, getClassName, isNullOrUndefined } from "@bodynarf/utils";
4
4
  import "./style.scss";
5
5
  /** Boolean input component */
6
- const CheckBox = ({ label, onValueChange, defaultValue, name, disabled, rounded, size, style, block, withoutBorder, hasBackgroundColor, fixBackgroundColor, isFormLabel, }) => {
6
+ const CheckBox = ({ label, onValueChange, defaultValue, name, disabled, size, style, rounded = false, block = false, withoutBorder = false, hasBackgroundColor = false, fixBackgroundColor = false, isFormLabel = false, }) => {
7
7
  const onChecked = useCallback((event) => onValueChange(event.target.checked), [onValueChange]);
8
8
  const id = name || generateGuid();
9
9
  const className = getClassName([
10
10
  "is-checkradio",
11
11
  "m-check-radio",
12
- (hasBackgroundColor ?? false) ? "has-background-color" : "",
13
- (fixBackgroundColor ?? false) && (hasBackgroundColor ?? false) ? "m-has-background-color" : "",
12
+ hasBackgroundColor ? "has-background-color" : "",
13
+ fixBackgroundColor && hasBackgroundColor ? "m-has-background-color" : "",
14
14
  isNullOrUndefined(size) ? "" : size === "normal" ? "" : `is-${size}`,
15
- (rounded ?? false) ? "is-circle" : "",
15
+ rounded ? "is-circle" : "",
16
16
  isNullOrUndefined(style) ? "" : `is-${style}`,
17
- (block ?? false) ? "is-block" : "",
18
- (withoutBorder ?? false) ? "has-no-border" : "",
17
+ block ? "is-block" : "",
18
+ withoutBorder ? "has-no-border" : "",
19
19
  ]);
20
- if (!isNullOrUndefined(label) && isFormLabel === true) {
20
+ if (!isNullOrUndefined(label) && isFormLabel) {
21
21
  const labelClassName = getClassName([
22
22
  "label",
23
23
  label.className
@@ -1,6 +1,6 @@
1
1
  import { BaseInputElementProps } from "../..";
2
2
  /** Checkbox component props type */
3
- export interface CheckBoxProps extends BaseInputElementProps<boolean> {
3
+ export interface CheckBoxProps extends Omit<BaseInputElementProps<boolean>, "readonly" | "validationState" | "loading" | "placeholder"> {
4
4
  /** Is full colored checkbox */
5
5
  block?: boolean;
6
6
  /** Remove the checkbox border */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/checkbox/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,oCAAoC;AACpC,MAAM,WAAW,aAAc,SAAQ,qBAAqB,CAAC,OAAO,CAAC;IACjE,+BAA+B;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,iCAAiC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;MAGE;IACF,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;MAIE;IACF,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/checkbox/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,oCAAoC;AACpC,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EACtE,UAAU,GAAG,iBAAiB,GAC5B,SAAS,GAAG,aAAa,CAC9B;IACG,+BAA+B;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,iCAAiC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;MAGE;IACF,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;MAIE;IACF,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB"}
@@ -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"}