datocms-react-ui 0.2.0-alpha.63 → 0.2.0-y.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.
- package/dist/cjs/Button/index.js +2 -2
- package/dist/cjs/Button/index.js.map +1 -1
- package/dist/cjs/Button/styles.module.css.json +1 -1
- package/dist/cjs/Canvas/index.js +10 -2
- package/dist/cjs/Canvas/index.js.map +1 -1
- package/dist/cjs/Canvas/styles.module.css.json +1 -1
- package/dist/cjs/FieldError/index.js +14 -0
- package/dist/cjs/FieldError/index.js.map +1 -0
- package/dist/cjs/FieldError/styles.module.css.json +1 -0
- package/dist/cjs/FieldGroup/index.js +38 -0
- package/dist/cjs/FieldGroup/index.js.map +1 -0
- package/dist/cjs/FieldGroup/styles.module.css.json +1 -0
- package/dist/cjs/FieldHint/index.js +14 -0
- package/dist/cjs/FieldHint/index.js.map +1 -0
- package/dist/cjs/FieldHint/styles.module.css.json +1 -0
- package/dist/cjs/Form/index.js +69 -0
- package/dist/cjs/Form/index.js.map +1 -0
- package/dist/cjs/Form/styles.module.css.json +1 -0
- package/dist/cjs/FormLabel/index.js +45 -0
- package/dist/cjs/FormLabel/index.js.map +1 -0
- package/dist/cjs/FormLabel/styles.module.css.json +1 -0
- package/dist/cjs/SwitchField/index.js +34 -0
- package/dist/cjs/SwitchField/index.js.map +1 -0
- package/dist/cjs/SwitchField/styles.module.css.json +1 -0
- package/dist/cjs/SwitchInput/index.js +61 -0
- package/dist/cjs/SwitchInput/index.js.map +1 -0
- package/dist/cjs/SwitchInput/styles.module.css.json +1 -0
- package/dist/cjs/TextField/index.js +29 -0
- package/dist/cjs/TextField/index.js.map +1 -0
- package/dist/cjs/TextField/styles.module.css.json +1 -0
- package/dist/cjs/TextInput/index.js +34 -8
- package/dist/cjs/TextInput/index.js.map +1 -1
- package/dist/cjs/TextInput/styles.module.css.json +1 -1
- package/dist/cjs/index.js +9 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/Button/index.d.ts +3 -2
- package/dist/esm/Button/index.js +2 -2
- package/dist/esm/Button/index.js.map +1 -1
- package/dist/esm/Button/styles.module.css.json +1 -1
- package/dist/esm/Canvas/index.js +10 -2
- package/dist/esm/Canvas/index.js.map +1 -1
- package/dist/esm/Canvas/styles.module.css.json +1 -1
- package/dist/esm/FieldError/index.d.ts +6 -0
- package/dist/esm/FieldError/index.js +7 -0
- package/dist/esm/FieldError/index.js.map +1 -0
- package/dist/esm/FieldError/styles.module.css.json +1 -0
- package/dist/esm/FieldGroup/index.d.ts +7 -0
- package/dist/esm/FieldGroup/index.js +31 -0
- package/dist/esm/FieldGroup/index.js.map +1 -0
- package/dist/esm/FieldGroup/styles.module.css.json +1 -0
- package/dist/esm/FieldHint/index.d.ts +6 -0
- package/dist/esm/FieldHint/index.js +7 -0
- package/dist/esm/FieldHint/index.js.map +1 -0
- package/dist/esm/FieldHint/styles.module.css.json +1 -0
- package/dist/esm/Form/index.d.ts +9 -0
- package/dist/esm/Form/index.js +43 -0
- package/dist/esm/Form/index.js.map +1 -0
- package/dist/esm/Form/styles.module.css.json +1 -0
- package/dist/esm/FormLabel/index.d.ts +10 -0
- package/dist/esm/FormLabel/index.js +38 -0
- package/dist/esm/FormLabel/index.js.map +1 -0
- package/dist/esm/FormLabel/styles.module.css.json +1 -0
- package/dist/esm/SwitchField/index.d.ts +16 -0
- package/dist/esm/SwitchField/index.js +27 -0
- package/dist/esm/SwitchField/index.js.map +1 -0
- package/dist/esm/SwitchField/styles.module.css.json +1 -0
- package/dist/esm/SwitchInput/index.d.ts +10 -0
- package/dist/esm/SwitchInput/index.js +54 -0
- package/dist/esm/SwitchInput/index.js.map +1 -0
- package/dist/esm/SwitchInput/styles.module.css.json +1 -0
- package/dist/esm/TextField/index.d.ts +17 -0
- package/dist/esm/TextField/index.js +22 -0
- package/dist/esm/TextField/index.js.map +1 -0
- package/dist/esm/TextField/styles.module.css.json +1 -0
- package/dist/esm/TextInput/index.d.ts +12 -7
- package/dist/esm/TextInput/index.js +16 -9
- package/dist/esm/TextInput/index.js.map +1 -1
- package/dist/esm/TextInput/styles.module.css.json +1 -1
- package/dist/esm/index.d.ts +9 -1
- package/dist/esm/index.js +9 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/types/Button/index.d.ts +3 -2
- package/dist/types/FieldError/index.d.ts +6 -0
- package/dist/types/FieldGroup/index.d.ts +7 -0
- package/dist/types/FieldHint/index.d.ts +6 -0
- package/dist/types/Form/index.d.ts +9 -0
- package/dist/types/FormLabel/index.d.ts +10 -0
- package/dist/types/SwitchField/index.d.ts +16 -0
- package/dist/types/SwitchInput/index.d.ts +10 -0
- package/dist/types/TextField/index.d.ts +17 -0
- package/dist/types/TextInput/index.d.ts +12 -7
- package/dist/types/index.d.ts +9 -1
- package/package.json +4 -3
- package/styles.css +1 -1
- package/types.json +9790 -434
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Canvas/index.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAa,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,MAAM,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Canvas/index.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAa,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAE9C,SAAS,WAAW,CAAC,GAAW;IAC9B,IAAI,GAAG,IAAI,GAAG,CAAC,WAAW,EAAE,EAAE;QAC5B,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,UAAC,CAAC,IAAK,OAAA,GAAG,GAAG,CAAC,CAAC,WAAW,EAAE,EAArB,CAAqB,CAAC,CAAC;KAC3D;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAQD,MAAM,UAAU,MAAM,CAAC,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AK,SAAS,EAAE,CAAC,CAAC,UAAU,IAAG,QAAQ,CAAO,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "fieldError": "_fieldError_qi0xk_1" }
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import cn from 'classnames';
|
|
25
|
+
import styles from './styles.module.css.json';
|
|
26
|
+
export function FieldGroup(_a) {
|
|
27
|
+
var children = _a.children, className = _a.className, otherProps = __rest(_a, ["children", "className"]);
|
|
28
|
+
var classNames = cn(styles.FieldGroup, className);
|
|
29
|
+
return (React.createElement("div", __assign({}, otherProps, { className: classNames }), React.Children.map(children, function (child) { return (React.createElement("div", { className: styles.FieldGroup__item }, child)); })));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/FieldGroup/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAQ9C,MAAM,UAAU,UAAU,CAAC,EAIT;IAHhB,IAAA,QAAQ,cAAA,EACR,SAAS,eAAA,EACN,UAAU,cAHY,yBAI1B,CADc;IAEb,IAAM,UAAU,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAEpD,OAAO,CACL,wCAAS,UAAU,IAAE,SAAS,EAAE,UAAU,KACvC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAC,KAAK,IAAK,OAAA,CACvC,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,IAAG,KAAK,CAAO,CACvD,EAFwC,CAExC,CAAC,CACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "FieldGroup": "_FieldGroup_uz9ju_1", "FieldGroup__item": "_FieldGroup__item_uz9ju_5" }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/FieldHint/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,CAAC,MAAM,0BAA0B,CAAC;AAMzC,MAAM,UAAU,SAAS,CAAC,EAA4B;QAA1B,QAAQ,cAAA;IAClC,OAAO,6BAAK,SAAS,EAAE,CAAC,CAAC,SAAS,IAAG,QAAQ,CAAO,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "fieldHint": "_fieldHint_1dor2_1" }
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CSSProperties, FormEventHandler, ReactNode } from 'react';
|
|
2
|
+
export interface FormProps {
|
|
3
|
+
onSubmit?: FormEventHandler;
|
|
4
|
+
spacing?: 'condensed' | 'default';
|
|
5
|
+
style?: CSSProperties;
|
|
6
|
+
className?: string;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const Form: ({ children, className, onSubmit, spacing, ...otherProps }: FormProps) => JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React, { Children, useCallback, } from 'react';
|
|
24
|
+
import cn from 'classnames';
|
|
25
|
+
import styles from './styles.module.css.json';
|
|
26
|
+
export var Form = function (_a) {
|
|
27
|
+
var children = _a.children, className = _a.className, onSubmit = _a.onSubmit, _b = _a.spacing, spacing = _b === void 0 ? 'default' : _b, otherProps = __rest(_a, ["children", "className", "onSubmit", "spacing"]);
|
|
28
|
+
var classNames = cn(styles.Form, className);
|
|
29
|
+
var formItemClassNames = cn(styles.Form__item, styles["Form__item--" + spacing]);
|
|
30
|
+
var handleSubmit = useCallback(function (event) {
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
if (onSubmit) {
|
|
33
|
+
onSubmit(event);
|
|
34
|
+
}
|
|
35
|
+
}, [onSubmit]);
|
|
36
|
+
return (React.createElement("form", __assign({ className: classNames, onSubmit: handleSubmit }, otherProps), Children.map(children, function (child) {
|
|
37
|
+
if (child) {
|
|
38
|
+
return React.createElement("div", { className: formItemClassNames }, child);
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
})));
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Form/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EACZ,QAAQ,EACR,WAAW,GAKZ,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAU9C,MAAM,CAAC,IAAM,IAAI,GAAG,UAAC,EAMT;IALV,IAAA,QAAQ,cAAA,EACR,SAAS,eAAA,EACT,QAAQ,cAAA,EACR,eAAmB,EAAnB,OAAO,mBAAG,SAAS,KAAA,EAChB,UAAU,cALM,gDAMpB,CADc;IAEb,IAAM,UAAU,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAE9C,IAAM,kBAAkB,GAAG,EAAE,CAC3B,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,iBAAe,OAAS,CAAC,CACjC,CAAC;IAEF,IAAM,YAAY,GAAG,WAAW,CAC9B,UAAC,KAAgB;QACf,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,IAAI,QAAQ,EAAE;YACZ,QAAQ,CAAC,KAAK,CAAC,CAAC;SACjB;IACH,CAAC,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,OAAO,CACL,uCAAM,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,IAAM,UAAU,GAChE,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAC,KAAK;QAC5B,IAAI,KAAK,EAAE;YACT,OAAO,6BAAK,SAAS,EAAE,kBAAkB,IAAG,KAAK,CAAO,CAAC;SAC1D;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CACG,CACR,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "Form": "_Form_5qspp_1", "Form__item": "_Form__item_5qspp_5", "Form__item--default": "_Form__item--default_5qspp_13", "Form__item--condensed": "_Form__item--condensed_5qspp_17" }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface FormLabelProps {
|
|
3
|
+
htmlFor: string;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
error?: boolean;
|
|
8
|
+
code?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const FormLabel: ({ children, className, htmlFor, code, required, error, ...otherProps }: FormLabelProps) => JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import cn from 'classnames';
|
|
25
|
+
import s from './styles.module.css.json';
|
|
26
|
+
export var FormLabel = function (_a) {
|
|
27
|
+
var _b;
|
|
28
|
+
var children = _a.children, className = _a.className, htmlFor = _a.htmlFor, code = _a.code, _c = _a.required, required = _c === void 0 ? false : _c, _d = _a.error, error = _d === void 0 ? false : _d, otherProps = __rest(_a, ["children", "className", "htmlFor", "code", "required", "error"]);
|
|
29
|
+
var classNames = cn(s.formLabel, className, (_b = {},
|
|
30
|
+
_b[s['formLabel--error']] = error,
|
|
31
|
+
_b));
|
|
32
|
+
return (React.createElement("label", __assign({ className: classNames, htmlFor: htmlFor }, otherProps),
|
|
33
|
+
React.createElement("span", { className: s.formLabel__label },
|
|
34
|
+
children,
|
|
35
|
+
required && React.createElement("span", { className: s.formLabel__required }, "*")),
|
|
36
|
+
code && React.createElement("span", { className: s.formLabel__code }, code)));
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/FormLabel/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,CAAC,MAAM,0BAA0B,CAAC;AAWzC,MAAM,CAAC,IAAM,SAAS,GAAG,UAAC,EAQT;;IAPf,IAAA,QAAQ,cAAA,EACR,SAAS,eAAA,EACT,OAAO,aAAA,EACP,IAAI,UAAA,EACJ,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,aAAa,EAAb,KAAK,mBAAG,KAAK,KAAA,EACV,UAAU,cAPW,iEAQzB,CADc;IAEb,IAAM,UAAU,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,SAAS;QAC1C,GAAC,CAAC,CAAC,kBAAkB,CAAC,IAAG,KAAK;YAC9B,CAAC;IAEH,OAAO,CACL,wCAAO,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,IAAM,UAAU;QAC5D,8BAAM,SAAS,EAAE,CAAC,CAAC,gBAAgB;YAChC,QAAQ;YACR,QAAQ,IAAI,8BAAM,SAAS,EAAE,CAAC,CAAC,mBAAmB,QAAU,CACxD;QACN,IAAI,IAAI,8BAAM,SAAS,EAAE,CAAC,CAAC,eAAe,IAAG,IAAI,CAAQ,CACpD,CACT,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "formLabel": "_formLabel_tcjrv_1", "formLabel__code": "_formLabel__code_tcjrv_8", "formLabel--error": "_formLabel--error_tcjrv_14", "formLabel__label": "_formLabel__label_tcjrv_18", "formLabel__required": "_formLabel__required_tcjrv_30" }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { FormLabelProps, SwitchInputProps } from '..';
|
|
3
|
+
declare type SwitchFieldProps = {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
hint?: ReactNode;
|
|
8
|
+
error?: ReactNode;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
formLabelProps?: FormLabelProps;
|
|
11
|
+
value: SwitchInputProps['value'];
|
|
12
|
+
onChange: SwitchInputProps['onChange'];
|
|
13
|
+
switchInputProps?: SwitchInputProps;
|
|
14
|
+
};
|
|
15
|
+
export declare function SwitchField({ id, name, label, hint, error, required, formLabelProps, value, onChange, switchInputProps, }: SwitchFieldProps): JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { FieldError, FieldHint, FormLabel, SwitchInput, } from '..';
|
|
14
|
+
import cn from 'classnames';
|
|
15
|
+
import s from './styles.module.css.json';
|
|
16
|
+
export function SwitchField(_a) {
|
|
17
|
+
var id = _a.id, name = _a.name, label = _a.label, hint = _a.hint, error = _a.error, required = _a.required, formLabelProps = _a.formLabelProps, value = _a.value, onChange = _a.onChange, switchInputProps = _a.switchInputProps;
|
|
18
|
+
return (React.createElement(React.Fragment, null,
|
|
19
|
+
React.createElement("div", { className: s.switchField__flex },
|
|
20
|
+
React.createElement("div", { className: s.switchField__switchInput },
|
|
21
|
+
React.createElement(SwitchInput, __assign({}, switchInputProps, { name: name, value: value, onChange: onChange }))),
|
|
22
|
+
React.createElement(FormLabel, __assign({}, formLabelProps, { htmlFor: id, required: required, className: cn(s.switchField__label, formLabelProps === null || formLabelProps === void 0 ? void 0 : formLabelProps.className) }), label)),
|
|
23
|
+
(hint || error) && (React.createElement("div", { className: s.switchField__below },
|
|
24
|
+
hint && React.createElement(FieldHint, null, hint),
|
|
25
|
+
error && React.createElement(FieldError, null, error)))));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/SwitchField/index.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EACL,UAAU,EACV,SAAS,EACT,SAAS,EAET,WAAW,GAEZ,MAAM,IAAI,CAAC;AACZ,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,CAAC,MAAM,0BAA0B,CAAC;AAezC,MAAM,UAAU,WAAW,CAAC,EAWT;QAVjB,EAAE,QAAA,EACF,IAAI,UAAA,EACJ,KAAK,WAAA,EACL,IAAI,UAAA,EACJ,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,cAAc,oBAAA,EACd,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,gBAAgB,sBAAA;IAEhB,OAAO,CACL;QACE,6BAAK,SAAS,EAAE,CAAC,CAAC,iBAAiB;YACjC,6BAAK,SAAS,EAAE,CAAC,CAAC,wBAAwB;gBACxC,oBAAC,WAAW,eACN,gBAAgB,IACpB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,IAClB,CACE;YACN,oBAAC,SAAS,eACJ,cAAc,IAClB,OAAO,EAAE,EAAE,EACX,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,kBAAkB,EAAE,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,SAAS,CAAC,KAE7D,KAAK,CACI,CACR;QACL,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAClB,6BAAK,SAAS,EAAE,CAAC,CAAC,kBAAkB;YACjC,IAAI,IAAI,oBAAC,SAAS,QAAE,IAAI,CAAa;YACrC,KAAK,IAAI,oBAAC,UAAU,QAAE,KAAK,CAAc,CACtC,CACP,CACA,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "switchField__flex": "_switchField__flex_16z4j_1", "switchField__switchInput": "_switchField__switchInput_16z4j_6", "switchField__label": "_switchField__label_16z4j_10", "switchField__below": "_switchField__below_16z4j_22" }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare type SwitchInputChangeEventHandler = (newValue: boolean, event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
3
|
+
export interface SwitchInputProps extends Omit<React.HTMLAttributes<HTMLButtonElement>, 'onChange'> {
|
|
4
|
+
name: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
onChange: SwitchInputChangeEventHandler;
|
|
7
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLButtonElement>;
|
|
8
|
+
value: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function SwitchInput({ className, value, disabled, onClick, onChange, onKeyDown, ...restProps }: SwitchInputProps): JSX.Element;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import cn from 'classnames';
|
|
25
|
+
import s from './styles.module.css.json';
|
|
26
|
+
export function SwitchInput(_a) {
|
|
27
|
+
var _b;
|
|
28
|
+
var className = _a.className, value = _a.value, disabled = _a.disabled, onClick = _a.onClick, onChange = _a.onChange, onKeyDown = _a.onKeyDown, restProps = __rest(_a, ["className", "value", "disabled", "onClick", "onChange", "onKeyDown"]);
|
|
29
|
+
function triggerChange(newValue, event) {
|
|
30
|
+
if (!disabled) {
|
|
31
|
+
onChange(newValue, event);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function onInternalKeyDown(e) {
|
|
35
|
+
if (e.key === 'ArrowLeft') {
|
|
36
|
+
triggerChange(false, e);
|
|
37
|
+
}
|
|
38
|
+
else if (e.key === 'ArrowRight') {
|
|
39
|
+
triggerChange(true, e);
|
|
40
|
+
}
|
|
41
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
42
|
+
}
|
|
43
|
+
function onInternalClick(e) {
|
|
44
|
+
triggerChange(!value, e);
|
|
45
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
46
|
+
}
|
|
47
|
+
var switchClassName = cn(s['switchInput'], className, (_b = {},
|
|
48
|
+
_b[s['switchInput__checked']] = value,
|
|
49
|
+
_b[s['switchInput__disabled']] = disabled,
|
|
50
|
+
_b));
|
|
51
|
+
return (React.createElement("button", __assign({}, restProps, { type: "button", role: "switch", "aria-checked": value, disabled: disabled, className: switchClassName, onKeyDown: onInternalKeyDown, onClick: onInternalClick }),
|
|
52
|
+
React.createElement("span", { className: s['switchInput__inner'] })));
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/SwitchInput/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KA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EAAE,iBAAiB,EAC5B,OAAO,EAAE,eAAe;QAExB,8BAAM,SAAS,EAAE,CAAC,CAAC,oBAAoB,CAAC,GAAI,CACrC,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "switchInput__inner": "_switchInput__inner_1knbg_1", "switchInput": "_switchInput_1knbg_1", "switchInput__off": "_switchInput__off_1knbg_1", "switchInput__on": "_switchInput__on_1knbg_1", "switchInput__checked": "_switchInput__checked_1knbg_47", "switchInput__disabled": "_switchInput__disabled_1knbg_60", "none": "_none_1knbg_1" }
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { FormLabelProps, TextInputProps } from '..';
|
|
3
|
+
declare type TextFieldProps = {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
hint?: ReactNode;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
error?: ReactNode;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
formLabelProps?: FormLabelProps;
|
|
12
|
+
value: TextInputProps['value'];
|
|
13
|
+
onChange: TextInputProps['onChange'];
|
|
14
|
+
textInputProps?: TextInputProps;
|
|
15
|
+
};
|
|
16
|
+
export declare function TextField({ id, name, label, hint, error, required, placeholder, formLabelProps, value, onChange, textInputProps, }: TextFieldProps): JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { FieldError, FieldHint, FormLabel, TextInput, } from '..';
|
|
14
|
+
export function TextField(_a) {
|
|
15
|
+
var id = _a.id, name = _a.name, label = _a.label, hint = _a.hint, error = _a.error, required = _a.required, placeholder = _a.placeholder, formLabelProps = _a.formLabelProps, value = _a.value, onChange = _a.onChange, textInputProps = _a.textInputProps;
|
|
16
|
+
return (React.createElement(React.Fragment, null,
|
|
17
|
+
React.createElement(FormLabel, __assign({}, formLabelProps, { htmlFor: id, required: required }), label),
|
|
18
|
+
React.createElement(TextInput, __assign({}, textInputProps, { id: id, name: name, value: value, placeholder: placeholder, onChange: onChange })),
|
|
19
|
+
hint && React.createElement(FieldHint, null, hint),
|
|
20
|
+
error && React.createElement(FieldError, null, error)));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/TextField/index.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EACL,UAAU,EACV,SAAS,EACT,SAAS,EAET,SAAS,GAEV,MAAM,IAAI,CAAC;AAkBZ,MAAM,UAAU,SAAS,CAAC,EAYT;QAXf,EAAE,QAAA,EACF,IAAI,UAAA,EACJ,KAAK,WAAA,EACL,IAAI,UAAA,EACJ,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,WAAW,iBAAA,EACX,cAAc,oBAAA,EACd,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,cAAc,oBAAA;IAEd,OAAO,CACL;QACE,oBAAC,SAAS,eAAK,cAAc,IAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,KAC3D,KAAK,CACI;QAEZ,oBAAC,SAAS,eACJ,cAAc,IAClB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,IAClB;QAED,IAAI,IAAI,oBAAC,SAAS,QAAE,IAAI,CAAa;QACrC,KAAK,IAAI,oBAAC,UAAU,QAAE,KAAK,CAAc,CACzC,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "switchField__flex": "_switchField__flex_16z4j_1", "switchField__switchInput": "_switchField__switchInput_16z4j_6", "switchField__label": "_switchField__label_16z4j_10", "switchField__below": "_switchField__below_16z4j_22" }
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import React, { RefObject } from 'react';
|
|
2
|
+
export declare type TextInputChangeEventHandler = (newValue: string, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
2
3
|
export declare type TextInputProps = {
|
|
4
|
+
type?: 'text' | 'password' | 'email' | 'number' | 'search' | 'url' | 'date' | 'time';
|
|
5
|
+
name?: string;
|
|
6
|
+
labelText?: string;
|
|
7
|
+
id?: string;
|
|
3
8
|
className?: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
export declare
|
|
9
|
+
onChange?: TextInputChangeEventHandler;
|
|
10
|
+
value: string;
|
|
11
|
+
inputRef?: RefObject<HTMLInputElement>;
|
|
12
|
+
error?: boolean;
|
|
13
|
+
} & JSX.IntrinsicElements['input'];
|
|
14
|
+
export declare const TextInput: ({ className, disabled, error, id, inputRef, maxLength, name, labelText, onBlur, onChange, placeholder, required, type, value, ...otherProps }: TextInputProps) => JSX.Element;
|
|
@@ -20,15 +20,22 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import React from 'react';
|
|
23
|
+
import React, { useCallback } from 'react';
|
|
24
24
|
import cn from 'classnames';
|
|
25
|
-
import
|
|
26
|
-
export function
|
|
25
|
+
import s from './styles.module.css.json';
|
|
26
|
+
export var TextInput = function (_a) {
|
|
27
27
|
var _b;
|
|
28
|
-
var className = _a.className,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
28
|
+
var className = _a.className, _c = _a.disabled, disabled = _c === void 0 ? false : _c, error = _a.error, id = _a.id, inputRef = _a.inputRef, maxLength = _a.maxLength, name = _a.name, labelText = _a.labelText, onBlur = _a.onBlur, onChange = _a.onChange, placeholder = _a.placeholder, _d = _a.required, required = _d === void 0 ? false : _d, type = _a.type, value = _a.value, otherProps = __rest(_a, ["className", "disabled", "error", "id", "inputRef", "maxLength", "name", "labelText", "onBlur", "onChange", "placeholder", "required", "type", "value"]);
|
|
29
|
+
var handleChange = useCallback(function (e) {
|
|
30
|
+
if (onChange) {
|
|
31
|
+
onChange(e.target.value, e);
|
|
32
|
+
}
|
|
33
|
+
}, [onChange]);
|
|
34
|
+
var classNames = cn(s['TextInput'], className, (_b = {},
|
|
35
|
+
_b[s['TextInput--disabled']] = disabled,
|
|
36
|
+
_b[s['TextInput--error']] = error,
|
|
37
|
+
_b));
|
|
38
|
+
return (React.createElement("div", { className: classNames },
|
|
39
|
+
React.createElement("input", __assign({ "aria-label": labelText, className: s['TextInput__input'], id: id, name: name, required: required, placeholder: placeholder, maxLength: maxLength, disabled: disabled, onBlur: onBlur, onChange: handleChange, value: value, type: type, ref: inputRef }, otherProps))));
|
|
40
|
+
};
|
|
34
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/TextInput/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/TextInput/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAA0B,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,MAAM,YAAY,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AC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "
|
|
1
|
+
{ "TextInput": "_TextInput_1m3nw_1", "TextInput--disabled": "_TextInput--disabled_1m3nw_4", "TextInput--error": "_TextInput--error_1m3nw_10", "TextInput__input": "_TextInput__input_1m3nw_18" }
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
export * from './Button';
|
|
2
|
-
export * from './TextInput';
|
|
3
2
|
export * from './Canvas';
|
|
3
|
+
export * from './FieldError';
|
|
4
|
+
export * from './FieldGroup';
|
|
5
|
+
export * from './FieldHint';
|
|
6
|
+
export * from './Form';
|
|
7
|
+
export * from './FormLabel';
|
|
8
|
+
export * from './SwitchField';
|
|
9
|
+
export * from './SwitchInput';
|
|
10
|
+
export * from './TextField';
|
|
11
|
+
export * from './TextInput';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
export * from './Button';
|
|
2
|
-
export * from './TextInput';
|
|
3
2
|
export * from './Canvas';
|
|
3
|
+
export * from './FieldError';
|
|
4
|
+
export * from './FieldGroup';
|
|
5
|
+
export * from './FieldHint';
|
|
6
|
+
export * from './Form';
|
|
7
|
+
export * from './FormLabel';
|
|
8
|
+
export * from './SwitchField';
|
|
9
|
+
export * from './SwitchInput';
|
|
10
|
+
export * from './TextField';
|
|
11
|
+
export * from './TextInput';
|
|
4
12
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { CSSProperties, MouseEventHandler, ReactNode } from 'react';
|
|
1
|
+
import React, { CSSProperties, MouseEventHandler, ReactNode } from 'react';
|
|
2
2
|
export declare type ButtonProps = {
|
|
3
3
|
children: ReactNode;
|
|
4
|
+
type: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
4
5
|
className?: string;
|
|
5
6
|
disabled?: boolean;
|
|
6
7
|
onClick?: MouseEventHandler;
|
|
@@ -9,4 +10,4 @@ export declare type ButtonProps = {
|
|
|
9
10
|
fullWidth?: boolean;
|
|
10
11
|
style?: CSSProperties;
|
|
11
12
|
};
|
|
12
|
-
export declare function Button({ children, className, disabled, buttonType, buttonSize, fullWidth, onClick, style, }: ButtonProps): JSX.Element;
|
|
13
|
+
export declare function Button({ children, className, disabled, buttonType, buttonSize, fullWidth, onClick, style, type, }: ButtonProps): JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CSSProperties, FormEventHandler, ReactNode } from 'react';
|
|
2
|
+
export interface FormProps {
|
|
3
|
+
onSubmit?: FormEventHandler;
|
|
4
|
+
spacing?: 'condensed' | 'default';
|
|
5
|
+
style?: CSSProperties;
|
|
6
|
+
className?: string;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const Form: ({ children, className, onSubmit, spacing, ...otherProps }: FormProps) => JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface FormLabelProps {
|
|
3
|
+
htmlFor: string;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
error?: boolean;
|
|
8
|
+
code?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const FormLabel: ({ children, className, htmlFor, code, required, error, ...otherProps }: FormLabelProps) => JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { FormLabelProps, SwitchInputProps } from '..';
|
|
3
|
+
declare type SwitchFieldProps = {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
hint?: ReactNode;
|
|
8
|
+
error?: ReactNode;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
formLabelProps?: FormLabelProps;
|
|
11
|
+
value: SwitchInputProps['value'];
|
|
12
|
+
onChange: SwitchInputProps['onChange'];
|
|
13
|
+
switchInputProps?: SwitchInputProps;
|
|
14
|
+
};
|
|
15
|
+
export declare function SwitchField({ id, name, label, hint, error, required, formLabelProps, value, onChange, switchInputProps, }: SwitchFieldProps): JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare type SwitchInputChangeEventHandler = (newValue: boolean, event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
3
|
+
export interface SwitchInputProps extends Omit<React.HTMLAttributes<HTMLButtonElement>, 'onChange'> {
|
|
4
|
+
name: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
onChange: SwitchInputChangeEventHandler;
|
|
7
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLButtonElement>;
|
|
8
|
+
value: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function SwitchInput({ className, value, disabled, onClick, onChange, onKeyDown, ...restProps }: SwitchInputProps): JSX.Element;
|