@a-type/ui 6.0.4 → 6.0.5
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/components/forms/SubmitButton.d.ts +1 -1
- package/dist/components/forms/SubmitButton.js +16 -2
- package/dist/components/forms/SubmitButton.js.map +1 -1
- package/dist/components/forms/SubmitButton.module.css +3 -0
- package/package.json +1 -1
- package/src/components/forms/SubmitButton.module.css +3 -0
- package/src/components/forms/SubmitButton.tsx +4 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ButtonProps } from '../button/Button.js';
|
|
2
|
-
export declare function SubmitButton(props: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function SubmitButton({ className, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,22 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
1
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import clsx from 'clsx';
|
|
2
14
|
import { useFormikContext } from 'formik';
|
|
3
15
|
import { Button } from '../button/Button.js';
|
|
4
|
-
|
|
16
|
+
import cls from './SubmitButton.module.css';
|
|
17
|
+
export function SubmitButton(_a) {
|
|
18
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
5
19
|
const { isSubmitting, isValid } = useFormikContext();
|
|
6
|
-
return (_jsx(Button, Object.assign({ loading: isSubmitting, disabled: !isValid, emphasis: "primary" }, props, { type: "submit" })));
|
|
20
|
+
return (_jsx(Button, Object.assign({ loading: isSubmitting, disabled: !isValid, emphasis: "primary", className: clsx(cls.root, className) }, props, { type: "submit" })));
|
|
7
21
|
}
|
|
8
22
|
//# sourceMappingURL=SubmitButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubmitButton.js","sourceRoot":"","sources":["../../../src/components/forms/SubmitButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SubmitButton.js","sourceRoot":"","sources":["../../../src/components/forms/SubmitButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAe,MAAM,qBAAqB,CAAC;AAC1D,OAAO,GAAG,MAAM,2BAA2B,CAAC;AAE5C,MAAM,UAAU,YAAY,CAAC,EAAoC;QAApC,EAAE,SAAS,OAAyB,EAApB,KAAK,cAArB,aAAuB,CAAF;IACjD,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACrD,OAAO,CACN,KAAC,MAAM,kBACN,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,CAAC,OAAO,EAClB,QAAQ,EAAC,SAAS,EAClB,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,IAChC,KAAK,IACT,IAAI,EAAC,QAAQ,IACZ,CACF,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
1
2
|
import { useFormikContext } from 'formik';
|
|
2
3
|
import { Button, ButtonProps } from '../button/Button.js';
|
|
4
|
+
import cls from './SubmitButton.module.css';
|
|
3
5
|
|
|
4
|
-
export function SubmitButton(props: ButtonProps) {
|
|
6
|
+
export function SubmitButton({ className, ...props }: ButtonProps) {
|
|
5
7
|
const { isSubmitting, isValid } = useFormikContext();
|
|
6
8
|
return (
|
|
7
9
|
<Button
|
|
8
10
|
loading={isSubmitting}
|
|
9
11
|
disabled={!isValid}
|
|
10
12
|
emphasis="primary"
|
|
13
|
+
className={clsx(cls.root, className)}
|
|
11
14
|
{...props}
|
|
12
15
|
type="submit"
|
|
13
16
|
/>
|