@bodynarf/react.components 1.6.1 → 1.6.3

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 (146) hide show
  1. package/components/anchor/component/index.d.ts +6 -0
  2. package/components/anchor/component/index.d.ts.map +1 -0
  3. package/components/anchor/component/index.js +20 -0
  4. package/components/anchor/{anchor.scss → component/style.scss} +15 -15
  5. package/components/anchor/index.d.ts +2 -23
  6. package/components/anchor/index.d.ts.map +1 -1
  7. package/components/anchor/index.js +2 -20
  8. package/components/anchor/types.d.ts +23 -4
  9. package/components/anchor/types.d.ts.map +1 -1
  10. package/components/button/component/index.d.ts +9 -0
  11. package/components/button/component/index.d.ts.map +1 -0
  12. package/components/button/component/index.js +36 -0
  13. package/components/button/{button.scss → component/style.scss} +12 -12
  14. package/components/button/index.d.ts +2 -33
  15. package/components/button/index.d.ts.map +1 -1
  16. package/components/button/index.js +2 -37
  17. package/components/button/types.d.ts +25 -2
  18. package/components/button/types.d.ts.map +1 -1
  19. package/components/button/types.js +1 -0
  20. package/components/dropdown/component/index.d.ts +7 -0
  21. package/components/dropdown/component/index.d.ts.map +1 -0
  22. package/components/dropdown/component/index.js +15 -0
  23. package/components/dropdown/index.d.ts +2 -42
  24. package/components/dropdown/index.d.ts.map +1 -1
  25. package/components/dropdown/index.js +2 -15
  26. package/components/dropdown/types.d.ts +38 -2
  27. package/components/dropdown/types.d.ts.map +1 -1
  28. package/components/icon/component/index.d.ts +8 -0
  29. package/components/icon/component/index.d.ts.map +1 -0
  30. package/components/icon/component/index.js +23 -0
  31. package/components/icon/{icon.scss → component/style.scss} +21 -21
  32. package/components/icon/index.d.ts +2 -21
  33. package/components/icon/index.d.ts.map +1 -1
  34. package/components/icon/index.js +2 -23
  35. package/components/icon/types.d.ts +16 -0
  36. package/components/icon/types.d.ts.map +1 -0
  37. package/components/icon/types.js +1 -0
  38. package/components/index.d.ts +3 -3
  39. package/components/index.d.ts.map +1 -1
  40. package/components/index.js +3 -3
  41. package/components/paginator/component/index.d.ts +8 -0
  42. package/components/paginator/component/index.d.ts.map +1 -0
  43. package/components/paginator/component/index.js +47 -0
  44. package/components/paginator/index.d.ts +3 -33
  45. package/components/paginator/index.d.ts.map +1 -1
  46. package/components/paginator/index.js +3 -47
  47. package/components/paginator/types.d.ts +28 -0
  48. package/components/paginator/types.d.ts.map +1 -0
  49. package/components/paginator/types.js +1 -0
  50. package/components/primitives/checkbox/component/index.d.ts +7 -0
  51. package/components/primitives/checkbox/component/index.d.ts.map +1 -0
  52. package/components/primitives/checkbox/component/index.js +37 -0
  53. package/components/primitives/checkbox/index.d.ts +2 -28
  54. package/components/primitives/checkbox/index.d.ts.map +1 -1
  55. package/components/primitives/checkbox/index.js +2 -38
  56. package/components/primitives/checkbox/types.d.ts +25 -0
  57. package/components/primitives/checkbox/types.d.ts.map +1 -0
  58. package/components/primitives/checkbox/types.js +1 -0
  59. package/components/primitives/date/component/index.d.ts +6 -0
  60. package/components/primitives/date/component/index.d.ts.map +1 -0
  61. package/components/primitives/date/component/index.js +48 -0
  62. package/components/primitives/date/index.d.ts +2 -13
  63. package/components/primitives/date/index.d.ts.map +1 -1
  64. package/components/primitives/date/index.js +2 -48
  65. package/components/primitives/date/types.d.ts +9 -0
  66. package/components/primitives/date/types.d.ts.map +1 -0
  67. package/components/primitives/date/types.js +1 -0
  68. package/components/primitives/index.d.ts +3 -1
  69. package/components/primitives/index.d.ts.map +1 -1
  70. package/components/primitives/index.js +3 -1
  71. package/components/primitives/multiline/component/index.d.ts +7 -0
  72. package/components/primitives/multiline/component/index.d.ts.map +1 -0
  73. package/components/primitives/multiline/component/index.js +15 -0
  74. package/components/primitives/multiline/index.d.ts +2 -15
  75. package/components/primitives/multiline/index.d.ts.map +1 -1
  76. package/components/primitives/multiline/index.js +2 -15
  77. package/components/primitives/multiline/types.d.ts +11 -0
  78. package/components/primitives/multiline/types.d.ts.map +1 -0
  79. package/components/primitives/multiline/types.js +1 -0
  80. package/components/primitives/number/component/index.d.ts +6 -0
  81. package/components/primitives/number/component/index.d.ts.map +1 -0
  82. package/components/primitives/number/component/index.js +14 -0
  83. package/components/primitives/number/index.d.ts +2 -16
  84. package/components/primitives/number/index.d.ts.map +1 -1
  85. package/components/primitives/number/index.js +2 -14
  86. package/components/primitives/number/types.d.ts +13 -0
  87. package/components/primitives/number/types.d.ts.map +1 -0
  88. package/components/primitives/number/types.js +1 -0
  89. package/components/primitives/password/component/index.d.ts +7 -0
  90. package/components/primitives/password/component/index.d.ts.map +1 -0
  91. package/components/primitives/password/component/index.js +13 -0
  92. package/components/primitives/password/index.d.ts +2 -14
  93. package/components/primitives/password/index.d.ts.map +1 -1
  94. package/components/primitives/password/index.js +2 -13
  95. package/components/primitives/password/types.d.ts +10 -0
  96. package/components/primitives/password/types.d.ts.map +1 -0
  97. package/components/primitives/password/types.js +1 -0
  98. package/components/primitives/text/component/index.d.ts +7 -0
  99. package/components/primitives/text/component/index.d.ts.map +1 -0
  100. package/components/primitives/text/component/index.js +15 -0
  101. package/components/primitives/text/index.d.ts +2 -11
  102. package/components/primitives/text/index.d.ts.map +1 -1
  103. package/components/primitives/text/index.js +2 -15
  104. package/components/primitives/text/types.d.ts +7 -0
  105. package/components/primitives/text/types.d.ts.map +1 -0
  106. package/components/primitives/text/types.js +1 -0
  107. package/components/primitives/types/baseProps.d.ts +2 -2
  108. package/components/primitives/types/baseProps.d.ts.map +1 -1
  109. package/components/primitives/types/label.d.ts +2 -2
  110. package/components/primitives/types/label.d.ts.map +1 -1
  111. package/components/search/component/index.d.ts +6 -0
  112. package/components/search/component/index.d.ts.map +1 -0
  113. package/components/search/component/index.js +37 -0
  114. package/components/search/index.d.ts +2 -29
  115. package/components/search/index.d.ts.map +1 -1
  116. package/components/search/index.js +2 -37
  117. package/components/search/types.d.ts +27 -0
  118. package/components/search/types.d.ts.map +1 -0
  119. package/components/search/types.js +1 -0
  120. package/components/tabs/component/index.d.ts +1 -0
  121. package/components/tabs/component/index.d.ts.map +1 -1
  122. package/components/tag/component/index.d.ts +7 -0
  123. package/components/tag/component/index.d.ts.map +1 -0
  124. package/components/tag/component/index.js +28 -0
  125. package/components/tag/index.d.ts +2 -31
  126. package/components/tag/index.d.ts.map +1 -1
  127. package/components/tag/index.js +2 -28
  128. package/components/tag/types.d.ts +27 -0
  129. package/components/tag/types.d.ts.map +1 -0
  130. package/components/tag/types.js +1 -0
  131. package/components/types.d.ts +4 -4
  132. package/components/types.d.ts.map +1 -1
  133. package/hooks/usePagination.d.ts.map +1 -1
  134. package/index.d.ts +2 -11
  135. package/index.d.ts.map +1 -1
  136. package/index.js +2 -11
  137. package/package.json +1 -1
  138. package/tsconfig.tsbuildinfo +1 -0
  139. package/components/primitives/types/enums.d.ts +0 -29
  140. package/components/primitives/types/enums.d.ts.map +0 -1
  141. package/components/primitives/types/enums.js +0 -31
  142. /package/components/dropdown/{dropdown.scss → component/style.scss} +0 -0
  143. /package/components/primitives/checkbox/{checkbox.scss → component/style.scss} +0 -0
  144. /package/components/primitives/password/{style.scss → component/style.scss} +0 -0
  145. /package/components/search/{search.scss → component/style.scss} +0 -0
  146. /package/components/tag/{style.scss → component/style.scss} +0 -0
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import "./style.scss";
3
+ import { AnchorProps } from "../..";
4
+ /** Anchor component */
5
+ export default function Anchor(props: AnchorProps): JSX.Element;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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,OAAO,CAAC;AAKjD,uBAAuB;AACvB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CA6B9D"}
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { isNullOrUndefined, isNullOrEmpty, getClassName } from "@bodynarf/utils";
3
+ import "./style.scss";
4
+ import { SimpleAnchor } from "../components/simpleAnchor";
5
+ import { AnchorWithIcon } from "../components/anchorWithIcon";
6
+ /** Anchor component */
7
+ export default function Anchor(props) {
8
+ if (isNullOrUndefined(props.caption) && isNullOrUndefined(props.icon)) {
9
+ throw new Error("No anchor content provided");
10
+ }
11
+ const className = getClassName([
12
+ "bbr-anchor",
13
+ !isNullOrEmpty(props.className) ? ` ${props.className}` : "",
14
+ props.disableHovering === true ? " bbr-anchor--unhoverable" : ""
15
+ ]);
16
+ if (isNullOrUndefined(props.icon)) {
17
+ return (_jsx(SimpleAnchor, { ...props, className: className, onClick: props.onClick }));
18
+ }
19
+ return (_jsx(AnchorWithIcon, { ...props, className: className, onClick: props.onClick, icon: props.icon }));
20
+ }
@@ -1,15 +1,15 @@
1
- .bbr-anchor {
2
- text-decoration: none;
3
- color: inherit;
4
-
5
- transition: 0.15s ease-in-out color;
6
-
7
- &:not(&--unhoverable):hover {
8
- text-decoration: underline;
9
- color: #3273dc;
10
- }
11
-
12
- .bbr-icon {
13
- transition: none;
14
- }
15
- }
1
+ .bbr-anchor {
2
+ text-decoration: none;
3
+ color: inherit;
4
+
5
+ transition: 0.15s ease-in-out color;
6
+
7
+ &:not(&--unhoverable):hover {
8
+ text-decoration: underline;
9
+ color: #3273dc;
10
+ }
11
+
12
+ .bbr-icon {
13
+ transition: none;
14
+ }
15
+ }
@@ -1,24 +1,3 @@
1
- /// <reference types="react" />
2
- import "./anchor.scss";
3
- import { ElementIcon } from "..";
4
- export declare type AnchorProps = {
5
- /** Link destination */
6
- href?: string;
7
- /** Link caption */
8
- caption?: string;
9
- /** Click handler */
10
- onClick?: () => void;
11
- /** Configuration od inner icon */
12
- icon?: ElementIcon;
13
- /** Title of anchor */
14
- title?: string;
15
- /** Where to open the linked document */
16
- target?: "_blank" | "_top";
17
- /** Additional class names */
18
- className?: string;
19
- /** Should css hovering effects be disabled */
20
- disableHovering?: boolean;
21
- };
22
- /** Anchor component */
23
- export default function Anchor(props: AnchorProps): JSX.Element;
1
+ export { default } from "./component";
2
+ export * from "./types";
24
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/anchor/index.tsx"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAKjC,oBAAY,WAAW,GAAG;IACtB,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,kCAAkC;IAClC,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,wCAAwC;IACxC,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAE3B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,8CAA8C;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,uBAAuB;AACvB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CA6B9D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/anchor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,cAAc,SAAS,CAAC"}
@@ -1,20 +1,2 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { isNullOrUndefined, isNullOrEmpty, getClassName } from "@bodynarf/utils";
3
- import "./anchor.scss";
4
- import { SimpleAnchor } from "./components/simpleAnchor";
5
- import { AnchorWithIcon } from "./components/anchorWithIcon";
6
- /** Anchor component */
7
- export default function Anchor(props) {
8
- if (isNullOrUndefined(props.caption) && isNullOrUndefined(props.icon)) {
9
- throw new Error("No anchor content provided");
10
- }
11
- const className = getClassName([
12
- "bbr-anchor",
13
- !isNullOrEmpty(props.className) ? ` ${props.className}` : "",
14
- props.disableHovering === true ? " bbr-anchor--unhoverable" : ""
15
- ]);
16
- if (isNullOrUndefined(props.icon)) {
17
- return (_jsx(SimpleAnchor, { ...props, className: className, onClick: props.onClick }));
18
- }
19
- return (_jsx(AnchorWithIcon, { ...props, className: className, onClick: props.onClick, icon: props.icon }));
20
- }
1
+ export { default } from "./component";
2
+ export * from "./types";
@@ -1,5 +1,24 @@
1
1
  import { ElementIcon } from "..";
2
- export declare type SimpleAnchorProps = {
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;
10
+ /** Configuration od inner icon */
11
+ icon?: ElementIcon;
12
+ /** Title of anchor */
13
+ title?: string;
14
+ /** Where to open the linked document */
15
+ target?: "_blank" | "_top";
16
+ /** Additional class names */
17
+ className?: string;
18
+ /** Should css hovering effects be disabled */
19
+ disableHovering?: boolean;
20
+ }
21
+ export interface SimpleAnchorProps {
3
22
  /** Link destination */
4
23
  href?: string;
5
24
  /** Class names */
@@ -12,9 +31,9 @@ export declare type SimpleAnchorProps = {
12
31
  title?: string;
13
32
  /** Where to open the linked document */
14
33
  target?: "_blank" | "_top";
15
- };
16
- export declare type AnchorWithIconProps = SimpleAnchorProps & {
34
+ }
35
+ export interface AnchorWithIconProps extends SimpleAnchorProps {
17
36
  /** Configuration of icon */
18
37
  icon: ElementIcon;
19
- };
38
+ }
20
39
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/anchor/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAEjC,oBAA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ErB,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"}
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import "./style.scss";
3
+ import { ButtonProps } from "../..";
4
+ /**
5
+ * Button component
6
+ * @throws Caption is not defined and icon configuration is not defined at the same time
7
+ */
8
+ export default function Button(props: ButtonProps): JSX.Element;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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,OAAO,CAAC;AAOjD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CA0C9D"}
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { isNullOrEmpty, isNullOrUndefined, getClassName } from "@bodynarf/utils";
3
+ import "./style.scss";
4
+ import { mapDataAttributes } from "../../../utils";
5
+ import { ButtonWithIcon } from "../components/buttonWithIcon";
6
+ import { SimpleButton } from "../components/simpleButton";
7
+ /**
8
+ * Button component
9
+ * @throws Caption is not defined and icon configuration is not defined at the same time
10
+ */
11
+ export default function Button(props) {
12
+ if (isNullOrEmpty(props.caption) && isNullOrUndefined(props.icon)) {
13
+ throw new Error("No button content provided.");
14
+ }
15
+ const className = getClassName([
16
+ "button",
17
+ "bbr-button",
18
+ props.className,
19
+ `is-${props.type}`,
20
+ props.light === true ? "is-light" : "",
21
+ !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" : "",
26
+ ]);
27
+ const data = isNullOrUndefined(props.data)
28
+ ? undefined
29
+ : mapDataAttributes(props.data);
30
+ if (!isNullOrUndefined(props.icon)) {
31
+ return (_jsx(ButtonWithIcon, { ...props, className: className, onClick: props.onClick, icon: props.icon, data: data }));
32
+ }
33
+ else {
34
+ return (_jsx(SimpleButton, { ...props, className: className, onClick: props.onClick, data: data }));
35
+ }
36
+ }
@@ -1,12 +1,12 @@
1
- .bbr-button {
2
- transition: 0.15s ease-in-out;
3
- transition-property: background-color, border-color;
4
-
5
- &--icon-only {
6
- padding: 0.55rem !important;
7
- }
8
-
9
- &.is-warning.is-outlined:not([disabled]):hover {
10
- color: #000 !important;
11
- }
12
- }
1
+ .bbr-button {
2
+ transition: 0.15s ease-in-out;
3
+ transition-property: background-color, border-color;
4
+
5
+ &--icon-only {
6
+ padding: 0.55rem !important;
7
+ }
8
+
9
+ &.is-warning.is-outlined:not([disabled]):hover {
10
+ color: #000 !important;
11
+ }
12
+ }
@@ -1,34 +1,3 @@
1
- /// <reference types="react" />
2
- import "./button.scss";
3
- import { BaseElementProps, ElementIcon, ElementSize } from "..";
4
- import { ButtonType } from "./types";
5
- export interface ButtonProps extends BaseElementProps {
6
- /** Button displaying text */
7
- caption?: string;
8
- /** Type of button (color) */
9
- type: ButtonType;
10
- /** Configuration of inner icon */
11
- icon?: ElementIcon;
12
- /** Button size */
13
- size?: ElementSize;
14
- /** Is button uses light version of color */
15
- light?: boolean;
16
- /** Is button outlined */
17
- outlined?: boolean;
18
- /** Should button corners be rounded */
19
- rounded?: boolean;
20
- /** Display loading icon */
21
- isLoading?: boolean;
22
- /** Is button disabled */
23
- disabled?: boolean;
24
- /** Is non-interactive button */
25
- static?: boolean;
26
- /** Click action handler */
27
- onClick?: () => void;
28
- }
29
- /**
30
- * Button component
31
- * @throws Caption is not defined and icon configuration is not defined at the same time
32
- */
33
- export default function Button(props: ButtonProps): JSX.Element;
1
+ export { default } from "./component";
2
+ export * from "./types";
34
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/button/index.tsx"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAIhE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIrC,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;;;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/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,cAAc,SAAS,CAAC"}
@@ -1,37 +1,2 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { isNullOrEmpty, isNullOrUndefined, getClassName } from "@bodynarf/utils";
3
- import "./button.scss";
4
- import { mapDataAttributes } from "../../utils";
5
- import { ButtonWithIcon } from "./components/buttonWithIcon";
6
- import { SimpleButton } from "./components/simpleButton";
7
- ;
8
- /**
9
- * Button component
10
- * @throws Caption is not defined and icon configuration is not defined at the same time
11
- */
12
- export default function Button(props) {
13
- if (isNullOrEmpty(props.caption) && isNullOrUndefined(props.icon)) {
14
- throw new Error("No button content provided.");
15
- }
16
- const className = getClassName([
17
- "button",
18
- "bbr-button",
19
- props.className,
20
- `is-${props.type}`,
21
- props.light === true ? "is-light" : "",
22
- !isNullOrUndefined(props.size) ? `is-${props.size}` : "",
23
- props.outlined === true ? "is-outlined" : "",
24
- props.rounded === true ? "is-rounded" : "",
25
- props.isLoading === true ? "is-loading" : "",
26
- props.static === true ? "is-static" : "",
27
- ]);
28
- const data = isNullOrUndefined(props.data)
29
- ? undefined
30
- : mapDataAttributes(props.data);
31
- if (!isNullOrUndefined(props.icon)) {
32
- return (_jsx(ButtonWithIcon, { ...props, className: className, onClick: props.onClick, icon: props.icon, data: data }));
33
- }
34
- else {
35
- return (_jsx(SimpleButton, { ...props, className: className, onClick: props.onClick, data: data }));
36
- }
37
- }
1
+ export { default } from "./component";
2
+ export * from "./types";
@@ -1,5 +1,28 @@
1
- import { ButtonProps } from ".";
2
- import { ElementIcon } from "../types";
1
+ import { BaseElementProps, ElementIcon, ElementSize } from "../types";
2
+ export interface ButtonProps extends BaseElementProps {
3
+ /** Button displaying text */
4
+ caption?: string;
5
+ /** Type of button (color) */
6
+ type: ButtonType;
7
+ /** Configuration of inner icon */
8
+ icon?: ElementIcon;
9
+ /** Button size */
10
+ size?: ElementSize;
11
+ /** Is button uses light version of color */
12
+ light?: boolean;
13
+ /** Is button outlined */
14
+ outlined?: boolean;
15
+ /** Should button corners be rounded */
16
+ rounded?: boolean;
17
+ /** Display loading icon */
18
+ isLoading?: boolean;
19
+ /** Is button disabled */
20
+ disabled?: boolean;
21
+ /** Is non-interactive button */
22
+ static?: boolean;
23
+ /** Click action handler */
24
+ onClick?: () => void;
25
+ }
3
26
  /** Button types according to Bulma framework */
4
27
  export declare type ButtonType = "default" /** color: transparent */ | "primary" /** color: seawave 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 */;
5
28
  /** Simple button props type */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,gDAAgD;AAChD,oBAAY,UAAU,GAClB,SAAS,CAAC,yBAAyB,GACjC,SAAS,CAAC,2BAA2B,GACrC,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,E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AAQ,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,3 +1,4 @@
1
1
  ;
2
2
  ;
3
+ ;
3
4
  export {};
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import "./style.scss";
3
+ import { DropdownProps } from "..";
4
+ /** Dropdown component */
5
+ declare const Dropdown: (props: DropdownProps) => JSX.Element;
6
+ export default Dropdown;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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,IAAI,CAAC;AAEnC,yBAAyB;AACzB,QAAA,MAAM,QAAQ,UAAW,aAAa,KAAG,WAMxC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { isNullOrUndefined } from "@bodynarf/utils";
3
+ import "./style.scss";
4
+ import DropdownWithLabel from "../components/withLabel";
5
+ import DropdownCompact from "../components/compact";
6
+ /** Dropdown component */
7
+ const Dropdown = (props) => {
8
+ if (!isNullOrUndefined(props.label)) {
9
+ return _jsx(DropdownWithLabel, { ...props });
10
+ }
11
+ else {
12
+ return _jsx(DropdownCompact, { ...props });
13
+ }
14
+ };
15
+ export default Dropdown;
@@ -1,43 +1,3 @@
1
- /// <reference types="react" />
2
- import "./dropdown.scss";
3
- import { BaseElementProps } from "..";
4
- import { InputLabel, ValidationState } from "../primitives";
5
- import { SelectableItem } from "./types";
6
- export declare type DropdownProps = BaseElementProps & {
7
- /** Items which can be selected */
8
- items: Array<SelectableItem>;
9
- /** Input element placeholder */
10
- placeholder: string;
11
- /**
12
- * Action to update selected value, which stored outside
13
- */
14
- onSelect: (item?: SelectableItem) => void;
15
- /**
16
- * Selected value.
17
- * Must be stored outside
18
- */
19
- value?: SelectableItem;
20
- /** Hide dropdown list when its opened and user click outside */
21
- hideOnOuterClick: boolean;
22
- /** Can user deselect */
23
- deselectable?: boolean;
24
- /** Custom dropdown list max-height property */
25
- listMaxHeight?: string;
26
- /**
27
- * Should dropdown be compact
28
- * Will have width by maximum current selection item width
29
- */
30
- compact?: boolean;
31
- /**
32
- * Is element disabled
33
- */
34
- disabled?: boolean;
35
- /** Label configuration */
36
- label?: InputLabel;
37
- /** Current validation state */
38
- validationState?: ValidationState;
39
- };
40
- /** Dropdown component */
41
- declare const Dropdown: (props: DropdownProps) => JSX.Element;
42
- export default Dropdown;
1
+ export { default } from "./component";
2
+ export * from "./types";
43
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown/index.tsx"],"names":[],"mappings":";AAEA,OAAO,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIzC,oBAAY,aAAa,GAAG,gBAAgB,GAAG;IAC3C,kCAAkC;IAClC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IAE7B,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IAEpB;;MAEE;IACF,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAE1C;;;MAGE;IACF,KAAK,CAAC,EAAE,cAAc,CAAC;IAEvB,gEAAgE;IAChE,gBAAgB,EAAE,OAAO,CAAC;IAE1B,wBAAwB;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,+CAA+C;IAC/C,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,0BAA0B;IAC1B,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB,+BAA+B;IAC/B,eAAe,CAAC,EAAE,eAAe,CAAC;CACrC,CAAA;AAED,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/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,cAAc,SAAS,CAAC"}
@@ -1,15 +1,2 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { isNullOrUndefined } from "@bodynarf/utils";
3
- import "./dropdown.scss";
4
- import DropdownWithLabel from "./components/withLabel";
5
- import DropdownCompact from "./components/compact";
6
- /** Dropdown component */
7
- const Dropdown = (props) => {
8
- if (!isNullOrUndefined(props.label)) {
9
- return _jsx(DropdownWithLabel, { ...props });
10
- }
11
- else {
12
- return _jsx(DropdownCompact, { ...props });
13
- }
14
- };
15
- export default Dropdown;
1
+ export { default } from "./component";
2
+ export * from "./types";
@@ -1,10 +1,46 @@
1
+ import { BaseElementProps, InputLabel, ValidationState } from "..";
1
2
  /** Dropdown item */
2
- export declare type SelectableItem = {
3
+ export interface SelectableItem {
3
4
  /** Unique item identifier */
4
5
  id: string;
5
6
  /** Item value */
6
7
  value: string;
7
8
  /** Displaying text */
8
9
  displayValue: string;
9
- };
10
+ }
11
+ /** Dropdown component props type */
12
+ export interface DropdownProps extends BaseElementProps {
13
+ /** Items which can be selected */
14
+ items: Array<SelectableItem>;
15
+ /** Input element placeholder */
16
+ placeholder: string;
17
+ /**
18
+ * Action to update selected value, which stored outside
19
+ */
20
+ onSelect: (item?: SelectableItem) => void;
21
+ /**
22
+ * Selected value.
23
+ * Must be stored outside
24
+ */
25
+ value?: SelectableItem;
26
+ /** Hide dropdown list when its opened and user click outside */
27
+ hideOnOuterClick: boolean;
28
+ /** Can user deselect */
29
+ deselectable?: boolean;
30
+ /** Custom dropdown list max-height property */
31
+ listMaxHeight?: string;
32
+ /**
33
+ * Should dropdown be compact
34
+ * Will have width by maximum current selection item width
35
+ */
36
+ compact?: boolean;
37
+ /**
38
+ * Is element disabled
39
+ */
40
+ disabled?: boolean;
41
+ /** Label configuration */
42
+ label?: InputLabel;
43
+ /** Current validation state */
44
+ validationState?: ValidationState;
45
+ }
10
46
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown/types.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAY,cAAc,GAAG;IACzB,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;IAEX,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IAEd,sBAAsB;IACtB,YAAY,EAAE,MAAM,CAAC;CACxB,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAEnE,oBAAoB;AACpB,MAAM,WAAW,cAAc;IAC3B,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;IAEX,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IAEd,sBAAsB;IACtB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,oCAAoC;AACpC,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACnD,kCAAkC;IAClC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IAE7B,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IAEpB;;MAEE;IACF,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAE1C;;;MAGE;IACF,KAAK,CAAC,EAAE,cAAc,CAAC;IAEvB,gEAAgE;IAChE,gBAAgB,EAAE,OAAO,CAAC;IAE1B,wBAAwB;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,+CAA+C;IAC/C,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,0BAA0B;IAC1B,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB,+BAA+B;IAC/B,eAAe,CAAC,EAAE,eAAe,CAAC;CACrC"}
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import "./style.scss";
3
+ import { IconProps } from "..";
4
+ /**
5
+ * Icon component. Based on bootstrap icons
6
+ */
7
+ export default function Icon({ name, size, className, }: IconProps): JSX.Element;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/icon/component/index.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAU/B;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EACzB,IAAI,EAAE,IAAyB,EAC/B,SAAS,GACZ,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAYzB"}
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { getClassName } from "@bodynarf/utils";
3
+ import "./style.scss";
4
+ import { ElementSize } from "../..";
5
+ const sizeToClassMap = new Map([
6
+ [ElementSize.Small, "bbr-icon--size-smal"],
7
+ [ElementSize.Normal, ""],
8
+ [ElementSize.Medium, "bbr-icon--size-medium"],
9
+ [ElementSize.Large, "bbr-icon--size-large"]
10
+ ]);
11
+ /**
12
+ * Icon component. Based on bootstrap icons
13
+ */
14
+ export default function Icon({ name, size = ElementSize.Normal, className, }) {
15
+ const classNames = getClassName([
16
+ "bbr-icon",
17
+ "bi",
18
+ `bi-${name}`,
19
+ sizeToClassMap.has(size) ? sizeToClassMap.get(size) : "",
20
+ className
21
+ ]);
22
+ return (_jsx("i", { className: classNames }));
23
+ }
@@ -1,21 +1,21 @@
1
- .bbr-icon {
2
- transition: 0.15s ease-in-out color;
3
- font-size: 1rem;
4
-
5
- &--size-small {
6
- font-size: 0.85rem;
7
- }
8
- &--size-medium {
9
- font-size: 1.25rem;
10
- }
11
- &--size-large {
12
- font-size: 2rem;
13
- }
14
-
15
- &--right {
16
- margin-left: 0.5rem;
17
- }
18
- &--left {
19
- margin-right: 0.5rem;
20
- }
21
- }
1
+ .bbr-icon {
2
+ transition: 0.15s ease-in-out color;
3
+ font-size: 1rem;
4
+
5
+ &--size-small {
6
+ font-size: 0.85rem;
7
+ }
8
+ &--size-medium {
9
+ font-size: 1.25rem;
10
+ }
11
+ &--size-large {
12
+ font-size: 2rem;
13
+ }
14
+
15
+ &--right {
16
+ margin-left: 0.5rem;
17
+ }
18
+ &--left {
19
+ margin-right: 0.5rem;
20
+ }
21
+ }
@@ -1,22 +1,3 @@
1
- /// <reference types="react" />
2
- import "./icon.scss";
3
- import { ElementSize } from "..";
4
- /** Icon component props */
5
- export declare type IconProps = {
6
- /**
7
- * Icon name. Must be without `bi-`
8
- * @example ["Arrow repeat", "arrow-repeat"]
9
- * // Icon name to icon class name.
10
- * // For class name check bootstrap icons website
11
- */
12
- name: string;
13
- /** Additional classname */
14
- className?: string;
15
- /** Icon size */
16
- size?: ElementSize;
17
- };
18
- /**
19
- * Icon component. Based on bootstrap icons
20
- */
21
- export default function Icon({ name, size, className, }: IconProps): JSX.Element;
1
+ export { default } from "./component";
2
+ export * from "./types";
22
3
  //# sourceMappingURL=index.d.ts.map