@dartcom/ui-kit 3.8.1 → 3.8.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.
- package/dist/components/form/form.stories.d.ts.map +1 -1
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/index.cjs +8 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/lib/hooks/useLogout.d.ts.map +1 -1
- package/dist/lib/hooks/useSignIn.d.ts.map +1 -1
- package/dist/pages/auth/auth.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.stories.d.ts","sourceRoot":"","sources":["../../../src/components/form/form.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AAEzB,KAAK,QAAQ,GAAG,OAAO,IAAI,CAAC;AAE5B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,QAAQ,CAGxB,CAAC;AAOF,KAAK,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAEhC,eAAO,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"form.stories.d.ts","sourceRoot":"","sources":["../../../src/components/form/form.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AAEzB,KAAK,QAAQ,GAAG,OAAO,IAAI,CAAC;AAE5B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,QAAQ,CAGxB,CAAC;AAOF,KAAK,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAEhC,eAAO,MAAM,IAAI,EAAE,KAoDlB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,iBAAS,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,iBAAS,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,2CA0CjD;AAED,eAAe,WAAW,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -38656,7 +38656,7 @@ function CustomInput(props) {
|
|
|
38656
38656
|
const { name, type } = props;
|
|
38657
38657
|
const textFieldId = React__namespace.useId();
|
|
38658
38658
|
const { control } = useFormContext$1();
|
|
38659
|
-
return (jsxRuntime.jsx(Controller, { name: name, control: control, render: ({ field }) => (jsxRuntime.jsx(CustomTextField, { id: textFieldId, ...props, ...field, onChange: (event) => {
|
|
38659
|
+
return (jsxRuntime.jsx(Controller, { name: name, control: control, render: ({ field }) => (jsxRuntime.jsx(CustomTextField, { id: textFieldId, size: "small", ...props, ...field, onChange: (event) => {
|
|
38660
38660
|
const { target } = event;
|
|
38661
38661
|
const { value } = target;
|
|
38662
38662
|
switch (type) {
|
|
@@ -61547,13 +61547,13 @@ const encodeString = (string) => {
|
|
|
61547
61547
|
const useSignIn = () => {
|
|
61548
61548
|
return useMutation({
|
|
61549
61549
|
mutationKey: ['sign-in'],
|
|
61550
|
-
mutationFn: ({ body: { username, password } }) => {
|
|
61550
|
+
mutationFn: async ({ body: { username, password } }) => {
|
|
61551
61551
|
const values = {
|
|
61552
61552
|
username,
|
|
61553
61553
|
password: encodeString(password),
|
|
61554
61554
|
};
|
|
61555
61555
|
const body = Object.keys(values).reduce((request, key, index) => `${request}${index === 0 ? '' : '&'}${key}=${values[key]}`, '');
|
|
61556
|
-
|
|
61556
|
+
const response = await GlobalConfig.instance.apiService.post({
|
|
61557
61557
|
url: 'token',
|
|
61558
61558
|
body,
|
|
61559
61559
|
config: {
|
|
@@ -61562,6 +61562,7 @@ const useSignIn = () => {
|
|
|
61562
61562
|
},
|
|
61563
61563
|
},
|
|
61564
61564
|
});
|
|
61565
|
+
return response;
|
|
61565
61566
|
},
|
|
61566
61567
|
});
|
|
61567
61568
|
};
|
|
@@ -61576,11 +61577,7 @@ const useLogout = () => {
|
|
|
61576
61577
|
return response;
|
|
61577
61578
|
},
|
|
61578
61579
|
onError: showErrorSnackbar,
|
|
61579
|
-
onSuccess: () => {
|
|
61580
|
-
queryClient.invalidateQueries({
|
|
61581
|
-
queryKey: ['user'],
|
|
61582
|
-
});
|
|
61583
|
-
},
|
|
61580
|
+
onSuccess: () => { },
|
|
61584
61581
|
});
|
|
61585
61582
|
};
|
|
61586
61583
|
|
|
@@ -63900,7 +63897,7 @@ const AuthPage = ({ onSuccessSignIn }) => {
|
|
|
63900
63897
|
},
|
|
63901
63898
|
resolver: o(schema),
|
|
63902
63899
|
});
|
|
63903
|
-
const {
|
|
63900
|
+
const { register, formState: { isValid }, } = form;
|
|
63904
63901
|
const onSubmit = (body) => {
|
|
63905
63902
|
signIn.mutate({
|
|
63906
63903
|
body,
|
|
@@ -63926,19 +63923,12 @@ const AuthPage = ({ onSuccessSignIn }) => {
|
|
|
63926
63923
|
onSuccessSignIn(signIn.data);
|
|
63927
63924
|
}
|
|
63928
63925
|
}, [signIn.data]);
|
|
63929
|
-
return (jsxRuntime.jsx(AuthLayout$1, { children: jsxRuntime.jsxs(
|
|
63930
|
-
display: 'grid',
|
|
63926
|
+
return (jsxRuntime.jsx(AuthLayout$1, { children: jsxRuntime.jsxs(CustomForm, { form: form, onSubmit: onSubmit, sx: {
|
|
63931
63927
|
justifyContent: 'center',
|
|
63932
63928
|
justifyItems: 'center',
|
|
63933
63929
|
alignContent: 'center',
|
|
63934
63930
|
alignItems: 'center',
|
|
63935
|
-
|
|
63936
|
-
}, children: [jsxRuntime.jsx(Typography, { variant: "h4", sx: {
|
|
63937
|
-
margin: '0 auto',
|
|
63938
|
-
}, children: "Authorization" }), jsxRuntime.jsxs(Box, { component: "form", sx: {
|
|
63939
|
-
display: 'grid',
|
|
63940
|
-
gap: '15px',
|
|
63941
|
-
}, onSubmit: handleSubmit(onSubmit), children: [jsxRuntime.jsx(Controller, { name: "username", control: control, render: ({ field }) => (jsxRuntime.jsx(TextField, { label: "Login", size: "small", ...field })) }), jsxRuntime.jsx(Controller, { name: "password", control: control, render: ({ field }) => (jsxRuntime.jsx(TextField, { label: "Password", type: "password", size: "small", ...field })) }), jsxRuntime.jsx(Button$1, { type: "submit", variant: "contained", disabled: !isValid, children: "Sign in" })] })] }) }));
|
|
63931
|
+
}, children: [jsxRuntime.jsx(Typography, { variant: "h4", children: "Authorization" }), jsxRuntime.jsx(CustomInput, { ...register('username'), label: "Login", placeholder: "Enter your login" }), jsxRuntime.jsx(CustomInput, { ...register('password'), label: "Password", placeholder: "Enter your password", type: "password" }), jsxRuntime.jsx(Button$1, { type: "submit", variant: "contained", disabled: !isValid, children: "Sign in" })] }) }));
|
|
63942
63932
|
};
|
|
63943
63933
|
var auth = observer(AuthPage);
|
|
63944
63934
|
|