@circle-vibe/shared 1.1.12 → 1.1.13
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.
- package/build/index.js +1 -1
- package/build/src/components/form/checkbox/checkbox.d.ts +6 -0
- package/build/src/components/form/checkbox/checkbox.js +21 -0
- package/build/src/components/form/checkbox/checkbox.js.map +1 -0
- package/build/src/components/form/checkbox/index.d.ts +1 -0
- package/build/src/components/form/checkbox/index.js +18 -0
- package/build/src/components/form/checkbox/index.js.map +1 -0
- package/build/src/components/form/form-control-checkbox/form-control-checkbox.d.ts +3 -0
- package/build/src/components/form/form-control-checkbox/form-control-checkbox.js +43 -0
- package/build/src/components/form/form-control-checkbox/form-control-checkbox.js.map +1 -0
- package/build/src/components/form/form-control-checkbox/index.d.ts +1 -0
- package/build/src/components/form/form-control-checkbox/index.js +18 -0
- package/build/src/components/form/form-control-checkbox/index.js.map +1 -0
- package/build/src/components/form/index.d.ts +2 -0
- package/build/src/components/form/index.js +2 -0
- package/build/src/components/form/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExtendedReactFunctionalComponent } from 'src/types';
|
|
3
|
+
export interface CheckboxProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
isRequired?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const Checkbox: ExtendedReactFunctionalComponent<CheckboxProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Checkbox = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
9
|
+
const layout_1 = require("src/components/layout");
|
|
10
|
+
const label_1 = require("../label/label");
|
|
11
|
+
const Checkbox = ({ children, isRequired = false, ...props }) => {
|
|
12
|
+
return (react_1.default.createElement("label", { className: (0, classnames_1.default)({
|
|
13
|
+
'cursor-disabled': Boolean(props?.disabled),
|
|
14
|
+
'cursor-pointer': !Boolean(props?.disabled),
|
|
15
|
+
}) },
|
|
16
|
+
react_1.default.createElement(layout_1.CenteredVertialLayout, { space: "0.25rem" },
|
|
17
|
+
react_1.default.createElement("input", { ...props, type: "checkbox" }),
|
|
18
|
+
react_1.default.createElement(label_1.Label, { isRequired: isRequired }, children))));
|
|
19
|
+
};
|
|
20
|
+
exports.Checkbox = Checkbox;
|
|
21
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../../../src/components/form/checkbox/checkbox.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4DAAoC;AAEpC,kDAA8D;AAE9D,0CAAuC;AAMhC,MAAM,QAAQ,GAAoD,CAAC,EACxE,QAAQ,EACR,UAAU,GAAG,KAAK,EAClB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,OAAO,CACL,yCACE,SAAS,EAAE,IAAA,oBAAU,EAAC;YACpB,iBAAiB,EAAE,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC;YAC3C,gBAAgB,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC;SAC5C,CAAC;QAEF,8BAAC,8BAAqB,IAAC,KAAK,EAAC,SAAS;YACpC,4CAAW,KAAK,EAAE,IAAI,EAAC,UAAU,GAAG;YAEpC,8BAAC,aAAK,IAAC,UAAU,EAAE,UAAU,IAAG,QAAQ,CAAS,CAC3B,CAClB,CACT,CAAC;AACJ,CAAC,CAAC;AAnBW,QAAA,QAAQ,YAmBnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './checkbox';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./checkbox"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/form/checkbox/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.FormControlCheckbox = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const field_context_1 = require("../field-context/field-context");
|
|
29
|
+
const layout_1 = require("src/components/layout");
|
|
30
|
+
const form_control_error_1 = require("../form-control-error");
|
|
31
|
+
const checkbox_1 = require("../checkbox");
|
|
32
|
+
const utils_1 = require("src/utils");
|
|
33
|
+
const FormControlCheckbox = ({ children, ...props }) => {
|
|
34
|
+
const { value, setValue, isRequired } = (0, react_1.useContext)(field_context_1.FieldContext);
|
|
35
|
+
return (react_1.default.createElement(layout_1.StackLayout, { space: "0.5rem" },
|
|
36
|
+
react_1.default.createElement(checkbox_1.Checkbox, { ...props, isRequired: isRequired, onChange: (e) => {
|
|
37
|
+
const value = (0, utils_1.getFormikFormControlValue)(e);
|
|
38
|
+
setValue(value);
|
|
39
|
+
}, checked: Boolean(value) }),
|
|
40
|
+
react_1.default.createElement(form_control_error_1.FormControlError, null)));
|
|
41
|
+
};
|
|
42
|
+
exports.FormControlCheckbox = FormControlCheckbox;
|
|
43
|
+
//# sourceMappingURL=form-control-checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-control-checkbox.js","sourceRoot":"","sources":["../../../../../src/components/form/form-control-checkbox/form-control-checkbox.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAG1C,kEAA8D;AAC9D,kDAAoD;AACpD,8DAAyD;AACzD,0CAAuC;AACvC,qCAAsD;AAE/C,MAAM,mBAAmB,GAE5B,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC7B,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,IAAA,kBAAU,EAAC,4BAAY,CAAC,CAAC;IAEjE,OAAO,CACL,8BAAC,oBAAW,IAAC,KAAK,EAAC,QAAQ;QACzB,8BAAC,mBAAQ,OACH,KAAK,EACT,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;gBACd,MAAM,KAAK,GAAG,IAAA,iCAAyB,EAAC,CAAC,CAAC,CAAC;gBAC3C,QAAQ,CAAC,KAA0B,CAAC,CAAC;YACvC,CAAC,EACD,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GACvB;QAEF,8BAAC,qCAAgB,OAAG,CACR,CACf,CAAC;AACJ,CAAC,CAAC;AApBW,QAAA,mBAAmB,uBAoB9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './form-control-checkbox';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./form-control-checkbox"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/form/form-control-checkbox/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC"}
|
|
@@ -28,4 +28,6 @@ __exportStar(require("./form"), exports);
|
|
|
28
28
|
__exportStar(require("./form-submit-button"), exports);
|
|
29
29
|
__exportStar(require("./form-control-select"), exports);
|
|
30
30
|
__exportStar(require("./select"), exports);
|
|
31
|
+
__exportStar(require("./checkbox"), exports);
|
|
32
|
+
__exportStar(require("./form-control-checkbox"), exports);
|
|
31
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/form/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,gDAA8B;AAC9B,uDAAqC;AACrC,+CAA6B;AAC7B,uDAAqC;AACrC,iDAA+B;AAC/B,uDAAqC;AACrC,0CAAwB;AACxB,+CAA6B;AAC7B,uDAAqC;AACrC,yCAAuB;AACvB,uDAAqC;AACrC,wDAAsC;AACtC,2CAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/form/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,gDAA8B;AAC9B,uDAAqC;AACrC,+CAA6B;AAC7B,uDAAqC;AACrC,iDAA+B;AAC/B,uDAAqC;AACrC,0CAAwB;AACxB,+CAA6B;AAC7B,uDAAqC;AACrC,yCAAuB;AACvB,uDAAqC;AACrC,wDAAsC;AACtC,2CAAyB;AACzB,6CAA2B;AAC3B,0DAAwC"}
|