@ludo.ninja/components 2.3.43 → 2.3.45

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.
@@ -1,9 +1,10 @@
1
1
  import React from "react";
2
2
  import { UseFormRegister } from "react-hook-form";
3
- declare const MyWalletItemCheckBox: ({ onChange, name, register, checked, }: {
3
+ type MyWalletItemCheckBoxProps = {
4
4
  onChange: (e?: React.ChangeEvent<HTMLInputElement>) => Promise<void>;
5
5
  name: string;
6
- register: UseFormRegister<any>;
6
+ register?: UseFormRegister<any>;
7
7
  checked?: boolean;
8
- }) => import("react/jsx-runtime").JSX.Element;
8
+ };
9
+ declare const MyWalletItemCheckBox: ({ onChange, name, register, checked }: MyWalletItemCheckBoxProps) => import("react/jsx-runtime").JSX.Element;
9
10
  export default MyWalletItemCheckBox;
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
- const Forms_1 = require("../../../../system/Forms");
8
- const styled_components_1 = __importDefault(require("styled-components"));
9
7
  const ScreenWidth_1 = require("../../../../styles/ScreenWidth");
8
+ const Forms_1 = require("../../../../system/Forms");
10
9
  const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
10
+ const styled_components_1 = __importDefault(require("styled-components"));
11
11
  const StyledCheckbox = styled_components_1.default.div `
12
12
  position: absolute;
13
13
  right: 12px;
@@ -15,7 +15,15 @@ const StyledCheckbox = styled_components_1.default.div `
15
15
  right: ${(0, _4k_1.adaptiveValueCalc)(12)};
16
16
  }
17
17
  `;
18
- const MyWalletItemCheckBox = ({ onChange, name, register, checked, }) => {
19
- return ((0, jsx_runtime_1.jsx)(StyledCheckbox, { children: (0, jsx_runtime_1.jsx)(Forms_1.CheckboxInput, { label: "", data: { name }, register: register(name, { onChange }), checked: checked }) }));
18
+ const MyWalletItemCheckBox = ({ onChange, name, register, checked }) => {
19
+ const inputProps = register
20
+ ? register(name, { onChange })
21
+ : {
22
+ name,
23
+ onChange,
24
+ onBlur: () => { },
25
+ ref: () => { },
26
+ };
27
+ return ((0, jsx_runtime_1.jsx)(StyledCheckbox, { children: (0, jsx_runtime_1.jsx)(Forms_1.CheckboxInput, { label: "", data: { name }, register: inputProps, checked: checked }) }));
20
28
  };
21
29
  exports.default = MyWalletItemCheckBox;
@@ -12,7 +12,7 @@ const typography_1 = require("../../../../styles/typography");
12
12
  const vars_1 = require("../../../../fonts/vars");
13
13
  // Styles
14
14
  const StyledSearchSuggestionsFooter = styled_components_1.default.div `
15
- .footer {
15
+ .suggestions-footer {
16
16
  font-family: ${vars_1.dmsansFontVarCss.css};
17
17
  ${typography_1.TextSmall};
18
18
  border-top: 1px solid ${colors_1.BorderColorLight};
@@ -21,7 +21,7 @@ const StyledSearchSuggestionsFooter = styled_components_1.default.div `
21
21
  margin-top: auto;
22
22
  user-select: none;
23
23
 
24
- .text {
24
+ .suggestions-text {
25
25
  padding: 12px 0;
26
26
 
27
27
  strong {
@@ -35,10 +35,10 @@ const StyledSearchSuggestionsFooter = styled_components_1.default.div `
35
35
  //border-bottom-left-radius: ${(0, _4k_1.adaptiveValueCalc)(28)};
36
36
  //border-bottom-right-radius: ${(0, _4k_1.adaptiveValueCalc)(28)};
37
37
 
38
- .footer {
38
+ .suggestions-footer {
39
39
  border-top: ${(0, _4k_1.adaptiveValueCalc)(1)} solid ${colors_1.BorderColorLight};
40
40
 
41
- .text {
41
+ .suggestions-text {
42
42
  padding: ${(0, _4k_1.adaptiveValueCalc)(12)} 0;
43
43
  }
44
44
  }
@@ -46,7 +46,7 @@ const StyledSearchSuggestionsFooter = styled_components_1.default.div `
46
46
  `;
47
47
  // Components
48
48
  const SearchSuggestionsFooter = () => {
49
- return ((0, jsx_runtime_1.jsx)(StyledSearchSuggestionsFooter, { children: (0, jsx_runtime_1.jsx)("div", { className: ` footer`, children: (0, jsx_runtime_1.jsxs)("p", { className: 'text', children: ["Press ", (0, jsx_runtime_1.jsx)("strong", { children: "Enter" }), " to search all results"] }) }) }));
49
+ return ((0, jsx_runtime_1.jsx)(StyledSearchSuggestionsFooter, { children: (0, jsx_runtime_1.jsx)("div", { className: `suggestions-footer`, children: (0, jsx_runtime_1.jsxs)("p", { className: 'suggestions-text', children: ["Press ", (0, jsx_runtime_1.jsx)("strong", { children: "Enter" }), " to search all results"] }) }) }));
50
50
  };
51
51
  // Export
52
52
  exports.default = SearchSuggestionsFooter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludo.ninja/components",
3
- "version": "2.3.43",
3
+ "version": "2.3.45",
4
4
  "private": false,
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",