@bodynarf/react.components 1.8.21 → 1.9.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 (256) hide show
  1. package/common.scss +3 -2
  2. package/components/accordion/component/index.d.ts +2 -2
  3. package/components/accordion/component/index.d.ts.map +1 -1
  4. package/components/accordion/component/index.js +4 -4
  5. package/components/accordion/types.d.ts +1 -1
  6. package/components/accordion/types.d.ts.map +1 -1
  7. package/components/anchor/component/index.d.ts +1 -1
  8. package/components/anchor/component/index.d.ts.map +1 -1
  9. package/components/anchor/component/index.js +6 -6
  10. package/components/anchor/components/anchorWithIcon/index.d.ts +3 -2
  11. package/components/anchor/components/anchorWithIcon/index.d.ts.map +1 -1
  12. package/components/anchor/components/anchorWithIcon/index.js +14 -9
  13. package/components/anchor/components/simpleAnchor/index.d.ts +3 -2
  14. package/components/anchor/components/simpleAnchor/index.d.ts.map +1 -1
  15. package/components/anchor/components/simpleAnchor/index.js +8 -2
  16. package/components/anchor/types.d.ts +2 -6
  17. package/components/anchor/types.d.ts.map +1 -1
  18. package/components/breadcrumbs/component/index.d.ts +34 -0
  19. package/components/breadcrumbs/component/index.d.ts.map +1 -0
  20. package/components/breadcrumbs/component/index.js +21 -0
  21. package/components/breadcrumbs/index.d.ts +3 -0
  22. package/components/breadcrumbs/index.d.ts.map +1 -0
  23. package/components/breadcrumbs/index.js +2 -0
  24. package/components/breadcrumbs/types.d.ts +13 -0
  25. package/components/breadcrumbs/types.d.ts.map +1 -0
  26. package/components/button/component/index.d.ts +1 -1
  27. package/components/button/component/index.d.ts.map +1 -1
  28. package/components/button/component/index.js +4 -8
  29. package/components/button/components/buttonWithIcon/index.d.ts +3 -2
  30. package/components/button/components/buttonWithIcon/index.d.ts.map +1 -1
  31. package/components/button/components/buttonWithIcon/index.js +14 -9
  32. package/components/button/components/simpleButton/index.d.ts +3 -2
  33. package/components/button/components/simpleButton/index.d.ts.map +1 -1
  34. package/components/button/components/simpleButton/index.js +8 -2
  35. package/components/button/types.d.ts +1 -1
  36. package/components/button/types.d.ts.map +1 -1
  37. package/components/button/types.js +0 -3
  38. package/components/dropdown/component/index.d.ts +1 -1
  39. package/components/dropdown/component/index.d.ts.map +1 -1
  40. package/components/dropdown/component/index.js +5 -8
  41. package/components/dropdown/component/style.scss +5 -1
  42. package/components/dropdown/components/compact/index.d.ts +2 -2
  43. package/components/dropdown/components/compact/index.d.ts.map +1 -1
  44. package/components/dropdown/components/compact/index.js +12 -9
  45. package/components/dropdown/components/item/index.d.ts +1 -1
  46. package/components/dropdown/components/item/index.d.ts.map +1 -1
  47. package/components/dropdown/components/item/index.js +34 -2
  48. package/components/dropdown/components/label/index.d.ts +1 -1
  49. package/components/dropdown/components/label/index.d.ts.map +1 -1
  50. package/components/dropdown/components/label/index.js +41 -9
  51. package/components/dropdown/components/withLabel/index.d.ts +2 -2
  52. package/components/dropdown/components/withLabel/index.d.ts.map +1 -1
  53. package/components/dropdown/components/withLabel/index.js +14 -12
  54. package/components/dropdown/types.d.ts +13 -2
  55. package/components/dropdown/types.d.ts.map +1 -1
  56. package/components/icon/component/index.d.ts +2 -2
  57. package/components/icon/component/index.d.ts.map +1 -1
  58. package/components/icon/component/index.js +9 -5
  59. package/components/icon/types.d.ts +2 -4
  60. package/components/icon/types.d.ts.map +1 -1
  61. package/components/index.d.ts +0 -1
  62. package/components/index.d.ts.map +1 -1
  63. package/components/index.js +0 -1
  64. package/components/paginator/component/index.d.ts +2 -2
  65. package/components/paginator/component/index.d.ts.map +1 -1
  66. package/components/paginator/component/index.js +19 -14
  67. package/components/paginator/types.d.ts +3 -5
  68. package/components/paginator/types.d.ts.map +1 -1
  69. package/components/primitives/checkbox/component/index.d.ts +2 -2
  70. package/components/primitives/checkbox/component/index.d.ts.map +1 -1
  71. package/components/primitives/checkbox/component/index.js +15 -17
  72. package/components/primitives/checkbox/types.d.ts +2 -2
  73. package/components/primitives/checkbox/types.d.ts.map +1 -1
  74. package/components/primitives/color/component/index.d.ts.map +1 -1
  75. package/components/primitives/color/components/picker/index.d.ts +11 -29
  76. package/components/primitives/color/components/picker/index.d.ts.map +1 -1
  77. package/components/primitives/color/components/picker/index.js +20 -17
  78. package/components/primitives/color/components/withLabel/index.d.ts +1 -1
  79. package/components/primitives/color/components/withLabel/index.d.ts.map +1 -1
  80. package/components/primitives/color/components/withLabel/index.js +8 -30
  81. package/components/primitives/color/components/withoutLabel/index.d.ts +1 -1
  82. package/components/primitives/color/components/withoutLabel/index.d.ts.map +1 -1
  83. package/components/primitives/color/components/withoutLabel/index.js +3 -13
  84. package/components/primitives/color/types.d.ts +1 -1
  85. package/components/primitives/color/types.d.ts.map +1 -1
  86. package/components/primitives/date/component/index.d.ts +2 -2
  87. package/components/primitives/date/component/index.d.ts.map +1 -1
  88. package/components/primitives/date/component/index.js +12 -27
  89. package/components/primitives/date/types.d.ts +2 -2
  90. package/components/primitives/date/types.d.ts.map +1 -1
  91. package/components/primitives/index.d.ts +0 -1
  92. package/components/primitives/index.d.ts.map +1 -1
  93. package/components/primitives/index.js +0 -1
  94. package/components/primitives/internal/componentWithLabel/index.d.ts +17 -0
  95. package/components/primitives/internal/componentWithLabel/index.d.ts.map +1 -0
  96. package/components/primitives/internal/componentWithLabel/index.js +26 -0
  97. package/components/primitives/internal/hint/index.d.ts +13 -0
  98. package/components/primitives/internal/hint/index.d.ts.map +1 -0
  99. package/components/primitives/internal/hint/index.js +47 -0
  100. package/components/primitives/multiline/component/index.d.ts +1 -1
  101. package/components/primitives/multiline/component/index.d.ts.map +1 -1
  102. package/components/primitives/multiline/component/index.js +5 -8
  103. package/components/primitives/multiline/components/withLabel/index.d.ts +6 -0
  104. package/components/primitives/multiline/components/withLabel/index.d.ts.map +1 -0
  105. package/components/primitives/multiline/components/withLabel/index.js +29 -0
  106. package/components/primitives/multiline/components/withoutLabel/index.d.ts +6 -0
  107. package/components/primitives/multiline/components/withoutLabel/index.d.ts.map +1 -0
  108. package/components/primitives/multiline/components/withoutLabel/index.js +28 -0
  109. package/components/primitives/multiline/types.d.ts +1 -1
  110. package/components/primitives/multiline/types.d.ts.map +1 -1
  111. package/components/primitives/number/component/index.d.ts +1 -1
  112. package/components/primitives/number/component/index.d.ts.map +1 -1
  113. package/components/primitives/number/component/index.js +5 -8
  114. package/components/primitives/number/components/withLabel/index.d.ts +2 -2
  115. package/components/primitives/number/components/withLabel/index.d.ts.map +1 -1
  116. package/components/primitives/number/components/withLabel/index.js +12 -27
  117. package/components/primitives/number/components/withoutLabel/index.d.ts +2 -2
  118. package/components/primitives/number/components/withoutLabel/index.d.ts.map +1 -1
  119. package/components/primitives/number/components/withoutLabel/index.js +11 -9
  120. package/components/primitives/number/types.d.ts +1 -1
  121. package/components/primitives/number/types.d.ts.map +1 -1
  122. package/components/primitives/password/component/index.d.ts +1 -1
  123. package/components/primitives/password/component/index.d.ts.map +1 -1
  124. package/components/primitives/password/component/index.js +5 -6
  125. package/components/primitives/password/components/withLabel/index.d.ts +2 -2
  126. package/components/primitives/password/components/withLabel/index.d.ts.map +1 -1
  127. package/components/primitives/password/components/withLabel/index.js +14 -30
  128. package/components/primitives/password/components/withoutLabel/index.d.ts +2 -2
  129. package/components/primitives/password/components/withoutLabel/index.d.ts.map +1 -1
  130. package/components/primitives/password/components/withoutLabel/index.js +13 -11
  131. package/components/primitives/password/types.d.ts +1 -1
  132. package/components/primitives/password/types.d.ts.map +1 -1
  133. package/components/primitives/text/component/index.d.ts +1 -1
  134. package/components/primitives/text/component/index.d.ts.map +1 -1
  135. package/components/primitives/text/component/index.js +5 -8
  136. package/components/primitives/text/components/withLabel/index.d.ts +6 -0
  137. package/components/primitives/text/components/withLabel/index.d.ts.map +1 -0
  138. package/components/primitives/text/components/withLabel/index.js +29 -0
  139. package/components/primitives/text/components/withoutLabel/index.d.ts +6 -0
  140. package/components/primitives/text/components/withoutLabel/index.d.ts.map +1 -0
  141. package/components/primitives/text/components/withoutLabel/index.js +28 -0
  142. package/components/primitives/text/types.d.ts +1 -1
  143. package/components/primitives/text/types.d.ts.map +1 -1
  144. package/components/search/component/index.d.ts +2 -2
  145. package/components/search/component/index.d.ts.map +1 -1
  146. package/components/search/component/index.js +16 -10
  147. package/components/search/types.d.ts +2 -2
  148. package/components/search/types.d.ts.map +1 -1
  149. package/components/table/component/index.d.ts +43 -0
  150. package/components/table/component/index.d.ts.map +1 -0
  151. package/components/table/component/index.js +27 -0
  152. package/components/table/components/heading/index.d.ts +13 -0
  153. package/components/table/components/heading/index.d.ts.map +1 -0
  154. package/components/table/components/heading/index.js +21 -0
  155. package/components/table/index.d.ts +3 -0
  156. package/components/table/index.d.ts.map +1 -0
  157. package/components/table/index.js +2 -0
  158. package/components/table/types.d.ts +18 -0
  159. package/components/table/types.d.ts.map +1 -0
  160. package/components/tabs/component/index.d.ts +3 -3
  161. package/components/tabs/component/index.d.ts.map +1 -1
  162. package/components/tabs/component/index.js +14 -8
  163. package/components/tabs/components/item/index.d.ts +1 -1
  164. package/components/tabs/components/item/index.d.ts.map +1 -1
  165. package/components/tabs/components/item/index.js +4 -3
  166. package/components/tabs/types.d.ts +1 -12
  167. package/components/tabs/types.d.ts.map +1 -1
  168. package/components/tabs/types.js +0 -12
  169. package/components/tag/component/index.d.ts +2 -2
  170. package/components/tag/component/index.d.ts.map +1 -1
  171. package/components/tag/component/index.js +13 -7
  172. package/components/tag/types.d.ts +1 -1
  173. package/components/tag/types.d.ts.map +1 -1
  174. package/hooks/usePagination.d.ts.map +1 -1
  175. package/hooks/usePagination.js +11 -2
  176. package/index.d.ts +1 -0
  177. package/index.d.ts.map +1 -1
  178. package/index.js +1 -0
  179. package/package.json +11 -4
  180. package/readme.md +2 -0
  181. package/tsconfig.tsbuildinfo +1 -1
  182. package/types/baseElementProps.d.ts +11 -0
  183. package/types/baseElementProps.d.ts.map +1 -0
  184. package/types/baseElementProps.js +1 -0
  185. package/{components/primitives/types/baseProps.d.ts → types/baseInputElementProps.d.ts} +10 -4
  186. package/types/baseInputElementProps.d.ts.map +1 -0
  187. package/types/baseInputElementProps.js +1 -0
  188. package/types/dataAttributes.d.ts +9 -0
  189. package/types/dataAttributes.d.ts.map +1 -0
  190. package/types/dataAttributes.js +1 -0
  191. package/types/elementColor.d.ts +18 -0
  192. package/types/elementColor.d.ts.map +1 -0
  193. package/types/elementColor.js +18 -0
  194. package/types/elementIcon.d.ts +22 -0
  195. package/types/elementIcon.d.ts.map +1 -0
  196. package/types/elementIcon.js +1 -0
  197. package/types/elementPosition.d.ts +12 -0
  198. package/types/elementPosition.d.ts.map +1 -0
  199. package/types/elementPosition.js +10 -0
  200. package/types/elementSize.d.ts +12 -0
  201. package/types/elementSize.d.ts.map +1 -0
  202. package/types/elementSize.js +12 -0
  203. package/types/hintConfiguration.d.ts +13 -0
  204. package/types/hintConfiguration.d.ts.map +1 -0
  205. package/types/hintConfiguration.js +1 -0
  206. package/types/index.d.ts +11 -0
  207. package/types/index.d.ts.map +1 -0
  208. package/types/index.js +10 -0
  209. package/{components/primitives/types/label.d.ts → types/labelConfiguration.d.ts} +3 -3
  210. package/types/labelConfiguration.d.ts.map +1 -0
  211. package/types/labelConfiguration.js +1 -0
  212. package/{components/primitives/types → types}/validation/index.d.ts +1 -1
  213. package/types/validation/index.d.ts.map +1 -0
  214. package/{components/primitives/types → types}/validation/index.js +1 -1
  215. package/{components/primitives/types → types}/validation/state.d.ts +2 -2
  216. package/types/validation/state.d.ts.map +1 -0
  217. package/{components/primitives/types → types}/validation/state.js +0 -1
  218. package/{components/primitives/types → types}/validation/status.d.ts +1 -1
  219. package/types/validation/status.d.ts.map +1 -0
  220. package/{components/primitives/types → types}/validation/status.js +1 -2
  221. package/utils/dataAttributes.d.ts +1 -1
  222. package/utils/dataAttributes.d.ts.map +1 -1
  223. package/utils/index.d.ts +1 -1
  224. package/utils/index.d.ts.map +1 -1
  225. package/utils/index.js +1 -1
  226. package/utils/validation.d.ts +11 -0
  227. package/utils/validation.d.ts.map +1 -0
  228. package/utils/validation.js +20 -0
  229. package/components/primitives/multiline/components/multilineWithLabel/index.d.ts +0 -6
  230. package/components/primitives/multiline/components/multilineWithLabel/index.d.ts.map +0 -1
  231. package/components/primitives/multiline/components/multilineWithLabel/index.js +0 -44
  232. package/components/primitives/multiline/components/multilineWithoutLabel/index.d.ts +0 -6
  233. package/components/primitives/multiline/components/multilineWithoutLabel/index.d.ts.map +0 -1
  234. package/components/primitives/multiline/components/multilineWithoutLabel/index.js +0 -26
  235. package/components/primitives/text/components/textWithLabel/index.d.ts +0 -6
  236. package/components/primitives/text/components/textWithLabel/index.d.ts.map +0 -1
  237. package/components/primitives/text/components/textWithLabel/index.js +0 -44
  238. package/components/primitives/text/components/textWithoutLabel/index.d.ts +0 -6
  239. package/components/primitives/text/components/textWithoutLabel/index.d.ts.map +0 -1
  240. package/components/primitives/text/components/textWithoutLabel/index.js +0 -26
  241. package/components/primitives/types/baseProps.d.ts.map +0 -1
  242. package/components/primitives/types/index.d.ts +0 -4
  243. package/components/primitives/types/index.d.ts.map +0 -1
  244. package/components/primitives/types/index.js +0 -3
  245. package/components/primitives/types/label.d.ts.map +0 -1
  246. package/components/primitives/types/validation/index.d.ts.map +0 -1
  247. package/components/primitives/types/validation/state.d.ts.map +0 -1
  248. package/components/primitives/types/validation/status.d.ts.map +0 -1
  249. package/components/types.d.ts +0 -78
  250. package/components/types.d.ts.map +0 -1
  251. package/components/types.js +0 -41
  252. package/utils/formValidation.d.ts +0 -16
  253. package/utils/formValidation.d.ts.map +0 -1
  254. package/utils/formValidation.js +0 -35
  255. /package/components/{primitives/types/baseProps.js → breadcrumbs/types.js} +0 -0
  256. /package/components/{primitives/types/label.js → table/types.js} +0 -0
package/common.scss CHANGED
@@ -1,7 +1,8 @@
1
- .help.m-help {
1
+ .bbr-hint {
2
2
  white-space: pre-line;
3
+ display: inline-flex;
3
4
  }
4
5
 
5
6
  .control.is-loading input[type="date"]::-webkit-calendar-picker-indicator {
6
7
  display: none;
7
- }
8
+ }
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import "./style.scss";
3
- import { AccordionProps } from "../../accordion";
3
+ import { AccordionProps } from "..";
4
4
  /** Accordion panel */
5
- declare const Accordion: ({ children, caption, style, size, defaultExpanded, onToggle, className, data, title, }: AccordionProps) => JSX.Element;
5
+ declare const Accordion: ({ children, caption, style, size, defaultExpanded, onToggle, className, title, data, }: AccordionProps) => JSX.Element;
6
6
  export default Accordion;
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -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,2FAMZ,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":";AAQA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEpC,sBAAsB;AACtB,QAAA,MAAM,SAAS,2FAOZ,cAAc,KAAG,WA+DnB,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useRef, useState } from "react";
3
3
  import { getClassName, isNullOrUndefined } from "@bodynarf/utils";
4
- import "./style.scss";
5
- import { ElementSize } from "../..";
6
- import Icon from "../../icon";
4
+ import { ElementSize } from "../../../types";
7
5
  import { mapDataAttributes } from "../../../utils";
6
+ import Icon from "../../icon";
7
+ import "./style.scss";
8
8
  /** Accordion panel */
9
- const Accordion = ({ children, caption, style, size = ElementSize.Normal, defaultExpanded = false, onToggle, className, data, title, }) => {
9
+ const Accordion = ({ children, caption, style, size = ElementSize.Normal, defaultExpanded = false, onToggle, className, title, data, }) => {
10
10
  const expandablePanelRef = useRef(null);
11
11
  const [isExpanded, setIsExpanded] = useState(defaultExpanded);
12
12
  const [maxHeight, setMaxHeight] = useState(defaultExpanded ? undefined : 0);
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { BaseElementProps, ElementColor, ElementSize } from "..";
2
+ import { BaseElementProps, ElementColor, ElementSize } from "../../types";
3
3
  /** Accordion panel props type */
4
4
  export interface AccordionProps extends BaseElementProps {
5
5
  /** Content that should be collapsed inside */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9E,iCAAiC;AACjC,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACpD,8CAA8C;IAC9C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAEhB,6BAA6B;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,iBAAiB;IACjB,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,YAAY;IACZ,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3C"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzE,iCAAiC;AACjC,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACpD,8CAA8C;IAC9C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAEhB,6BAA6B;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,iBAAiB;IACjB,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,YAAY;IACZ,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3C"}
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import "./style.scss";
3
- import { AnchorProps } from "../..";
3
+ import { AnchorProps } from "..";
4
4
  /** Anchor component */
5
5
  export default function Anchor(props: AnchorProps): JSX.Element;
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/anchor/component/index.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,WAAW,EAAe,MAAM,iBAAiB,CAAC;AAK3D,uBAAuB;AACvB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CA6B9D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/anchor/component/index.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAIjC,uBAAuB;AACvB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CA6B9D"}
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { isNullOrUndefined, isNullOrEmpty, getClassName } from "@bodynarf/utils";
2
+ import { isNullOrUndefined, getClassName } from "@bodynarf/utils";
3
3
  import "./style.scss";
4
- import { SimpleAnchor } from "../../anchor/components/simpleAnchor";
5
- import { AnchorWithIcon } from "../../anchor/components/anchorWithIcon";
4
+ import SimpleAnchor from "../components/simpleAnchor";
5
+ import AnchorWithIcon from "../components/anchorWithIcon";
6
6
  /** Anchor component */
7
7
  export default function Anchor(props) {
8
8
  if (isNullOrUndefined(props.caption) && isNullOrUndefined(props.icon)) {
@@ -10,11 +10,11 @@ export default function Anchor(props) {
10
10
  }
11
11
  const className = getClassName([
12
12
  "bbr-anchor",
13
- !isNullOrEmpty(props.className) ? ` ${props.className}` : "",
14
- props.disableHovering === true ? " bbr-anchor--unhoverable" : ""
13
+ props.className,
14
+ props.disableHovering === true ? "bbr-anchor--unhoverable" : ""
15
15
  ]);
16
16
  if (isNullOrUndefined(props.icon)) {
17
17
  return (_jsx(SimpleAnchor, { ...props, className: className, onClick: props.onClick }));
18
18
  }
19
- return (_jsx(AnchorWithIcon, { ...props, className: className, onClick: props.onClick, icon: props.icon }));
19
+ return (_jsx(AnchorWithIcon, { ...props, icon: props.icon, className: className, onClick: props.onClick }));
20
20
  }
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { AnchorWithIconProps } from "../../../anchor";
2
+ import { AnchorWithIconProps } from "../..";
3
3
  /** Anchor with icon component */
4
- export declare const AnchorWithIcon: ({ href, className, onClick, caption, title, target, icon }: AnchorWithIconProps) => JSX.Element;
4
+ declare const AnchorWithIcon: ({ href, className, onClick, caption, target, icon, title, data, }: AnchorWithIconProps) => JSX.Element;
5
+ export default AnchorWithIcon;
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -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":";AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAE5C,iCAAiC;AACjC,QAAA,MAAM,cAAc,sEAKjB,mBAAmB,KAAG,WA0CxB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,16 +1,21 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { isNullOrEmpty } from "@bodynarf/utils";
2
+ import { isNullOrEmpty, isNullOrUndefined } from "@bodynarf/utils";
3
+ import { ElementPosition } from "../../../../types";
4
+ import { mapDataAttributes } from "../../../../utils";
3
5
  import Icon from "../../../icon";
4
6
  /** Anchor with icon component */
5
- export const AnchorWithIcon = ({ href, className, onClick, caption, title, target, icon }) => {
6
- const iconPosition = icon.position || "left";
7
+ const AnchorWithIcon = ({ href, className, onClick, caption, target, icon, title, data, }) => {
7
8
  const iconClassName = isNullOrEmpty(caption)
8
9
  ? icon.className
9
- : iconPosition === "left"
10
- ? `${icon.className} bbr-icon--left`
11
- : `${icon.className} bbr-icon--right`;
12
- if (iconPosition === "left") {
13
- return (_jsxs("a", { href: href, className: className, title: title, target: target, onClick: onClick, children: [_jsx(Icon, { ...icon, className: iconClassName }), caption] }));
10
+ : icon.position === ElementPosition.Right
11
+ ? `${icon.className} bbr-icon--right`
12
+ : `${icon.className} bbr-icon--left`;
13
+ const dataAttributes = isNullOrUndefined(data)
14
+ ? undefined
15
+ : mapDataAttributes(data);
16
+ if (icon.position === ElementPosition.Right) {
17
+ return (_jsxs("a", { href: href, target: target, onClick: onClick, className: className, title: title, ...dataAttributes, children: [caption, _jsx(Icon, { ...icon, className: iconClassName })] }));
14
18
  }
15
- return (_jsxs("a", { href: href, className: className, title: title, target: target, onClick: onClick, children: [caption, _jsx(Icon, { ...icon, className: iconClassName })] }));
19
+ return (_jsxs("a", { href: href, className: className, target: target, onClick: onClick, title: title, ...dataAttributes, children: [_jsx(Icon, { ...icon, className: iconClassName }), caption] }));
16
20
  };
21
+ export default AnchorWithIcon;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { SimpleAnchorProps } from "../../../anchor";
2
+ import { SimpleAnchorProps } from "../..";
3
3
  /** Simple anchor component, without icon */
4
- export declare const SimpleAnchor: ({ href, className, onClick, caption, title, target }: SimpleAnchorProps) => JSX.Element;
4
+ declare const SimpleAnchor: ({ href, className, onClick, caption, target, title, data, }: SimpleAnchorProps) => JSX.Element;
5
+ export default SimpleAnchor;
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -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":";AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,4CAA4C;AAC5C,QAAA,MAAM,YAAY,gEAIf,iBAAiB,KAAG,WAkBtB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,5 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { isNullOrUndefined } from "@bodynarf/utils";
3
+ import { mapDataAttributes } from "../../../../utils";
2
4
  /** Simple anchor component, without icon */
3
- export const SimpleAnchor = ({ href, className, onClick, caption, title, target }) => {
4
- return (_jsx("a", { className: className, href: href, title: title, target: target, onClick: onClick, children: caption }));
5
+ const SimpleAnchor = ({ href, className, onClick, caption, target, title, data, }) => {
6
+ const dataAttributes = isNullOrUndefined(data)
7
+ ? undefined
8
+ : mapDataAttributes(data);
9
+ return (_jsx("a", { href: href, target: target, onClick: onClick, className: className, title: title, ...dataAttributes, children: caption }));
5
10
  };
11
+ export default SimpleAnchor;
@@ -1,4 +1,4 @@
1
- import { ElementIcon } from "..";
1
+ import { BaseElementProps, ElementIcon } from "../../types";
2
2
  /** Anchor component props type */
3
3
  export interface AnchorProps extends Omit<SimpleAnchorProps, "className"> {
4
4
  /** Configuration od inner icon */
@@ -8,17 +8,13 @@ export interface AnchorProps extends Omit<SimpleAnchorProps, "className"> {
8
8
  /** Should css hovering effects be disabled */
9
9
  disableHovering?: boolean;
10
10
  }
11
- export interface SimpleAnchorProps {
11
+ export interface SimpleAnchorProps extends BaseElementProps {
12
12
  /** Link destination */
13
13
  href?: string;
14
- /** Class names */
15
- className: string;
16
14
  /** Click handler */
17
15
  onClick?: () => void;
18
16
  /** Link caption */
19
17
  caption?: string;
20
- /** Title of anchor */
21
- title?: string;
22
18
  /** Where to open the linked document */
23
19
  target?: "_blank" | "_top";
24
20
  }
@@ -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,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
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/anchor/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE3D,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,iBAAkB,SAAQ,gBAAgB;IACvD,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,wCAAwC;IACxC,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC1D,4BAA4B;IAC5B,IAAI,EAAE,WAAW,CAAC;CACrB"}
@@ -0,0 +1,34 @@
1
+ /// <reference types="react" />
2
+ import { BaseElementProps, ElementSize } from "../../../types";
3
+ import { BreadCrumb } from "../types";
4
+ /** Breadcrumbs component props type */
5
+ export interface BreadcrumbsProps extends BaseElementProps {
6
+ /** Breadcrumbs items */
7
+ items: Array<BreadCrumb>;
8
+ /**
9
+ * Function that generates each element
10
+ * @example
11
+ * <Link to={breadCrumb.path}>
12
+ * {breadCrumb.icon &&
13
+ * <span>
14
+ * <Icon {...breadCrumb.icon} />
15
+ * </span>
16
+ * }
17
+ * <span>
18
+ * {breadCrumb.title}
19
+ * </span>
20
+ * </Link>
21
+ *
22
+ */
23
+ elementGenerator: (bc: BreadCrumb) => JSX.Element;
24
+ /** Panel size */
25
+ size?: ElementSize;
26
+ /** Items position */
27
+ position?: "centered" | "right";
28
+ /** Items separator. By default `arrow` */
29
+ separator?: "arrow" | "bullet" | "dot" | "succeeds";
30
+ }
31
+ /** Breadcrumbs navigation panel */
32
+ declare const BreadCrumbs: ({ items, size, position, separator, elementGenerator, className, title, data, }: BreadcrumbsProps) => JSX.Element;
33
+ export default BreadCrumbs;
34
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/breadcrumbs/component/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAG3D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,uCAAuC;AACvC,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACtD,wBAAwB;IACxB,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAEzB;;;;;;;;;;;;;;MAcE;IACF,gBAAgB,EAAE,CAAC,EAAE,EAAE,UAAU,KAAK,GAAG,CAAC,OAAO,CAAC;IAElD,iBAAiB;IACjB,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IAEhC,0CAA0C;IAC1C,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,UAAU,CAAC;CACvD;AAED,mCAAmC;AACnC,QAAA,MAAM,WAAW,oFAMd,gBAAgB,KAAG,WAsCrB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { getClassName, isNullOrUndefined } from "@bodynarf/utils";
3
+ import { mapDataAttributes } from "../../../utils";
4
+ /** Breadcrumbs navigation panel */
5
+ const BreadCrumbs = ({ items, size, position, separator = "arrow", elementGenerator, className, title, data, }) => {
6
+ if (items.length <= 1) {
7
+ return _jsx(_Fragment, {});
8
+ }
9
+ const elClassName = getClassName([
10
+ "breadcrumb",
11
+ className,
12
+ isNullOrUndefined(size) ? undefined : `is-${size}`,
13
+ `has-${separator}-separator`,
14
+ isNullOrUndefined(position) ? undefined : `is-${position}`,
15
+ ]);
16
+ const dataAttributes = isNullOrUndefined(data)
17
+ ? undefined
18
+ : mapDataAttributes(data);
19
+ return (_jsx("nav", { className: elClassName, "aria-label": "breadcrumbs", title: title, ...dataAttributes, children: _jsx("ul", { children: items.map(breadCrumb => _jsx("li", { className: breadCrumb.active ? "is-active" : undefined, "aria-current": breadCrumb.active ? "page" : undefined, children: elementGenerator(breadCrumb) }, breadCrumb.path)) }) }));
20
+ };
21
+ export default BreadCrumbs;
@@ -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/breadcrumbs/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,13 @@
1
+ import { ElementIcon } from "../../types";
2
+ /** Breadcrumb item */
3
+ export interface BreadCrumb {
4
+ /** Displayed text */
5
+ title: string;
6
+ /** Page address */
7
+ path: string;
8
+ /** Is current page. Will be not clickable */
9
+ active: boolean;
10
+ /** Bootstrap icon class name */
11
+ icon?: ElementIcon;
12
+ }
13
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumbs/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,sBAAsB;AACtB,MAAM,WAAW,UAAU;IACvB,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IAEd,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IAEb,6CAA6C;IAC7C,MAAM,EAAE,OAAO,CAAC;IAEhB,gCAAgC;IAChC,IAAI,CAAC,EAAE,WAAW,CAAC;CACtB"}
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import "./style.scss";
3
- import { ButtonProps } from "../..";
3
+ import { ButtonProps } from "..";
4
4
  /**
5
5
  * Button component
6
6
  * @throws Caption is not defined and icon configuration is not defined at the same time
@@ -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,CAkD9D"}
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,IAAI,CAAC;AAIjC;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CA4C9D"}
@@ -1,9 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { isNullOrEmpty, isNullOrUndefined, getClassName } from "@bodynarf/utils";
3
3
  import "./style.scss";
4
- import { mapDataAttributes } from "../../../utils";
5
- import { ButtonWithIcon } from "../../button/components/buttonWithIcon";
6
- import { SimpleButton } from "../../button/components/simpleButton";
4
+ import ButtonWithIcon from "../components/buttonWithIcon";
5
+ import SimpleButton from "../components/simpleButton";
7
6
  /**
8
7
  * Button component
9
8
  * @throws Caption is not defined and icon configuration is not defined at the same time
@@ -25,13 +24,10 @@ export default function Button(props) {
25
24
  isLoading ? "is-loading" : "",
26
25
  isStatic ? "is-static" : "",
27
26
  ]);
28
- const data = isNullOrUndefined(props.data)
29
- ? undefined
30
- : mapDataAttributes(props.data);
31
27
  if (!isNullOrUndefined(props.icon)) {
32
- return (_jsx(ButtonWithIcon, { ...props, className: className, onClick: props.onClick, icon: props.icon, data: data }));
28
+ return (_jsx(ButtonWithIcon, { ...props, className: className, onClick: props.onClick, icon: props.icon }));
33
29
  }
34
30
  else {
35
- return (_jsx(SimpleButton, { ...props, className: className, onClick: props.onClick, data: data }));
31
+ return (_jsx(SimpleButton, { ...props, className: className, onClick: props.onClick }));
36
32
  }
37
33
  }
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { ButtonWithIconProps } from "../../../button";
2
+ import { ButtonWithIconProps } from "../..";
3
3
  /** Button with icon component */
4
- export declare const ButtonWithIcon: ({ className, disabled, onClick, caption, title, icon, data, }: ButtonWithIconProps) => JSX.Element;
4
+ declare const ButtonWithIcon: ({ className, disabled, onClick, caption, icon, title, data, }: ButtonWithIconProps) => JSX.Element;
5
+ export default ButtonWithIcon;
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -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":";AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAE5C,iCAAiC;AACjC,QAAA,MAAM,cAAc,kEAMjB,mBAAmB,KAAG,WA4CxB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,19 +1,24 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { isNullOrEmpty } from "@bodynarf/utils";
2
+ import { isNullOrEmpty, isNullOrUndefined } from "@bodynarf/utils";
3
+ import { ElementPosition } from "../../../../types";
4
+ import { mapDataAttributes } from "../../../../utils";
3
5
  import Icon from "../../../icon";
4
6
  /** Button with icon component */
5
- export const ButtonWithIcon = ({ className, disabled, onClick, caption, title, icon, data, }) => {
6
- const iconPosition = icon.position || "left";
7
+ const ButtonWithIcon = ({ className, disabled, onClick, caption, icon, title, data, }) => {
7
8
  const iconClassName = isNullOrEmpty(caption)
8
9
  ? icon.className
9
- : iconPosition === "left"
10
- ? `${icon.className} bbr-icon--left`
11
- : `${icon.className} bbr-icon--right`;
10
+ : icon.position === ElementPosition.Right
11
+ ? `${icon.className} bbr-icon--right`
12
+ : `${icon.className} bbr-icon--left`;
12
13
  className = isNullOrEmpty(caption)
13
14
  ? `${className} bbr-button--icon-only`
14
15
  : className;
15
- if (iconPosition === "left") {
16
- return (_jsxs("button", { className: className, disabled: disabled, onClick: onClick, title: title, ...data, children: [_jsx(Icon, { ...icon, className: iconClassName }), caption] }));
16
+ const dataAttributes = isNullOrUndefined(data)
17
+ ? undefined
18
+ : mapDataAttributes(data);
19
+ if (icon.position === ElementPosition.Right) {
20
+ return (_jsxs("button", { onClick: onClick, disabled: disabled, className: className, title: title, ...dataAttributes, children: [caption, _jsx(Icon, { ...icon, className: iconClassName })] }));
17
21
  }
18
- return (_jsxs("button", { className: className, disabled: disabled, onClick: onClick, title: title, ...data, children: [caption, _jsx(Icon, { ...icon, className: iconClassName })] }));
22
+ return (_jsxs("button", { onClick: onClick, disabled: disabled, className: className, title: title, ...dataAttributes, children: [_jsx(Icon, { ...icon, className: iconClassName }), caption] }));
19
23
  };
24
+ export default ButtonWithIcon;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { SimpleButtonProps } from "../../../button";
2
+ import { SimpleButtonProps } from "../..";
3
3
  /** Simple button component, without icon */
4
- export declare const SimpleButton: ({ className, disabled, onClick, caption, title, data }: SimpleButtonProps) => JSX.Element;
4
+ declare const SimpleButton: ({ className, disabled, onClick, caption, title, data }: SimpleButtonProps) => JSX.Element;
5
+ export default SimpleButton;
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -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":";AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,4CAA4C;AAC5C,QAAA,MAAM,YAAY,2DAMf,iBAAiB,KAAG,WAiBtB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,5 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { isNullOrUndefined } from "@bodynarf/utils";
3
+ import { mapDataAttributes } from "../../../../utils";
2
4
  /** Simple button component, without icon */
3
- export const SimpleButton = ({ className, disabled, onClick, caption, title, data }) => {
4
- return (_jsx("button", { className: className, disabled: disabled, onClick: onClick, title: title, ...data, children: caption }));
5
+ const SimpleButton = ({ className, disabled, onClick, caption, title, data }) => {
6
+ const dataAttributes = isNullOrUndefined(data)
7
+ ? undefined
8
+ : mapDataAttributes(data);
9
+ return (_jsx("button", { onClick: onClick, disabled: disabled, className: className, title: title, ...dataAttributes, children: caption }));
5
10
  };
11
+ export default SimpleButton;
@@ -1,4 +1,4 @@
1
- import { BaseElementProps, ElementIcon, ElementSize } from "..";
1
+ import { BaseElementProps, ElementIcon, ElementSize } from "../../types";
2
2
  export interface ButtonProps extends BaseElementProps {
3
3
  /** Button displaying text */
4
4
  caption?: string;
@@ -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,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
+ {"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,YAAY,CAAC;AAExE,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 @@
1
- ;
2
- ;
3
- ;
4
1
  export {};
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import "./style.scss";
3
- import { DropdownProps } from "../../dropdown";
3
+ import { DropdownProps } from "..";
4
4
  /** Dropdown component */
5
5
  declare const Dropdown: (props: DropdownProps) => JSX.Element;
6
6
  export default Dropdown;
@@ -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;AAEtB,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAInC,yBAAyB;AACzB,QAAA,MAAM,QAAQ,UAAW,aAAa,KAAG,WAIxC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,15 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { isNullOrUndefined } from "@bodynarf/utils";
3
3
  import "./style.scss";
4
- import DropdownWithLabel from "../../dropdown/components/withLabel";
5
- import DropdownCompact from "../../dropdown/components/compact";
4
+ import DropdownWithLabel from "../components/withLabel";
5
+ import DropdownCompact from "../components/compact";
6
6
  /** Dropdown component */
7
7
  const Dropdown = (props) => {
8
- if (!isNullOrUndefined(props.label)) {
9
- return _jsx(DropdownWithLabel, { ...props });
10
- }
11
- else {
12
- return _jsx(DropdownCompact, { ...props });
13
- }
8
+ return isNullOrUndefined(props.label)
9
+ ? _jsx(DropdownCompact, { ...props })
10
+ : _jsx(DropdownWithLabel, { ...props });
14
11
  };
15
12
  export default Dropdown;
@@ -35,7 +35,7 @@
35
35
  font-style: italic;
36
36
  }
37
37
 
38
- .bbr-icon {
38
+ .bbr-icon:not(.bbr-dropdown-item__icon) {
39
39
  &:hover {
40
40
  color: #0d6efd;
41
41
  }
@@ -81,6 +81,10 @@
81
81
  background-color: #485fc7;
82
82
  color: #fff;
83
83
  }
84
+
85
+ &__icon {
86
+ padding-left: 0.05rem;
87
+ }
84
88
  }
85
89
 
86
90
  &.is-active {
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { DropdownProps } from "../../../dropdown";
3
- declare const DropdownCompact: ({ items, value, onSelect, deselectable, className, hideOnOuterClick, listMaxHeight, placeholder, compact, disabled, validationState, }: DropdownProps) => JSX.Element;
2
+ import { DropdownProps } from "../..";
3
+ declare const DropdownCompact: ({ items, value, onSelect, deselectable, hideOnOuterClick, listMaxHeight, placeholder, compact, disabled, validationState, className, title, data, hint, }: DropdownProps) => JSX.Element;
4
4
  export default DropdownCompact;
5
5
  //# 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":";AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAIzD,QAAA,MAAM,eAAe,2IAOlB,aAAa,KAAG,WA8GlB,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/dropdown/components/compact/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAItC,QAAA,MAAM,eAAe,8JAUlB,aAAa,KAAG,WAsHlB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,11 +1,12 @@
1
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
+ import { getStyleClassName, mapDataAttributes } from "../../../../utils";
5
5
  import { useComponentOutsideClick } from "../../../../hooks";
6
- import DropdownItem from "../../../dropdown/components/item";
7
- import DropdownLabel from "../../../dropdown/components/label";
8
- const DropdownCompact = ({ items, value, onSelect, deselectable = false, className, hideOnOuterClick, listMaxHeight, placeholder, compact = false, disabled = false, validationState, }) => {
6
+ import InternalHint from "../../../primitives/internal/hint";
7
+ import DropdownItem from "../../components/item";
8
+ import DropdownLabel from "../../components/label";
9
+ const DropdownCompact = ({ items, value, onSelect, deselectable = false, hideOnOuterClick, listMaxHeight, placeholder, compact = false, disabled = false, validationState, className, title, data, hint, }) => {
9
10
  const id = useId();
10
11
  const [isListVisible, setListVisible] = useState(false);
11
12
  const onItemClick = useCallback((event) => {
@@ -47,19 +48,21 @@ const DropdownCompact = ({ items, value, onSelect, deselectable = false, classNa
47
48
  }
48
49
  }, [onSelect, setListVisible, disabled]);
49
50
  useComponentOutsideClick(`[data-dropdown-id="${id}"]`, isListVisible, () => setListVisible(false), hideOnOuterClick);
50
- const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(undefined, validationState);
51
51
  const classNames = getClassName([
52
52
  "bbr-dropdown",
53
+ className,
53
54
  disabled ? "bbr-dropdown--disabled" : "",
54
55
  compact ? "bbr-dropdown--compact" : "",
55
56
  isListVisible ? "is-active" : "",
56
57
  isNullOrEmpty(listMaxHeight) ? "bbr-dropdown--height-default" : "",
57
- className,
58
58
  "dropdown",
59
59
  ]);
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
60
+ const labelComponentClassName = getStyleClassName(undefined, validationState);
61
+ const dataAttributes = isNullOrUndefined(data)
62
+ ? undefined
63
+ : mapDataAttributes(data);
64
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: classNames, "data-dropdown-id": id, title: title, ...dataAttributes, children: [_jsx(DropdownLabel, { selectedItem: value, caption: placeholder, onClick: onLabelClick, deselectable: deselectable, className: labelComponentClassName }), _jsx("div", { className: "dropdown-menu", children: items.length > 0
61
65
  ? _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") })] }));
66
+ : _jsx("span", { className: "dropdown-content dropdown-item", children: "No items found" }) })] }, id), _jsx(InternalHint, { hint: hint, validationState: validationState })] }));
64
67
  };
65
68
  export default DropdownCompact;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { SelectableItem } from "../../../dropdown";
2
+ import { SelectableItem } from "../..";
3
3
  /** Dropdown item props */
4
4
  interface DropdownItemProps {
5
5
  /** Item to present in dropdown */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/dropdown/components/item/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,0BAA0B;AAC1B,UAAU,iBAAiB;IACvB,kCAAkC;IAClC,IAAI,EAAE,cAAc,CAAC;IAErB,sBAAsB;IACtB,QAAQ,EAAE,OAAO,CAAC;IAElB,yBAAyB;IACzB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;CAC7D;AAED,wCAAwC;AACxC,QAAA,MAAM,YAAY,gCAAiC,iBAAiB,KAAG,WAYtE,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/dropdown/components/item/index.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,0BAA0B;AAC1B,UAAU,iBAAiB;IACvB,kCAAkC;IAClC,IAAI,EAAE,cAAc,CAAC;IAErB,sBAAsB;IACtB,QAAQ,EAAE,OAAO,CAAC;IAElB,yBAAyB;IACzB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;CAC7D;AAED,wCAAwC;AACxC,QAAA,MAAM,YAAY,gCAEf,iBAAiB,KAAG,WA4BtB,CAAC;AAEF,eAAe,YAAY,CAAC"}