@native-systems/ui 1.0.4 → 1.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/index.cjs CHANGED
@@ -112,7 +112,6 @@ const ForwardRef$4 = /*#__PURE__*/ React__namespace.forwardRef(EyeIcon);
112
112
  function InputField({
113
113
  id,
114
114
  label,
115
- hideLabel = false,
116
115
  register,
117
116
  type,
118
117
  required,
@@ -123,14 +122,12 @@ function InputField({
123
122
  return jsxRuntime.jsxs('div', {
124
123
  className: 'flex flex-col space-y-2',
125
124
  children: [
126
- !hideLabel
127
- ? jsxRuntime.jsx('label', {
128
- htmlFor: id,
129
- className:
130
- 'block ml-1 text-sm font-medium text-gray-700 dark:text-white',
131
- children: label,
132
- })
133
- : null,
125
+ jsxRuntime.jsx('label', {
126
+ htmlFor: id,
127
+ className:
128
+ 'block ml-1 text-sm font-medium text-gray-700 dark:text-white',
129
+ children: label,
130
+ }),
134
131
  isPasswordField
135
132
  ? jsxRuntime.jsxs('div', {
136
133
  className: 'relative w-full',
@@ -141,12 +138,12 @@ function InputField({
141
138
  type: isPasswordVisible ? 'text' : 'password',
142
139
  autoComplete: autoCompleteId,
143
140
  placeholder: label,
144
- className: `relative w-full block py-3 pr-10 pl-3 text-sm text-font-950 bg-base-0 border rounded-lg border-base-500/15 appearance-none focus:outline-none focus:ring-primary-500 placeholder-font-400 dark:text-font-0 dark:text-font-100 dark:bg-base-950 dark:placeholder-font-600 ${type === 'number' ? 'text-right' : ''}`,
141
+ className: `w-full block py-3 pr-8 pl-3 text-gray-600 bg-white border-none rounded-lg shadow-sm shadow-input appearance-none focus:outline-none focus:ring-primary placeholder-gray-400 sm:text-sm dark:text-black dark:placeholder-gray-500 ${type === 'number' ? 'text-right' : ''}`,
145
142
  ...register,
146
143
  }),
147
144
  jsxRuntime.jsx('div', {
148
145
  className:
149
- 'absolute top-1/2 right-2 size-5 -translate-y-1/2 text-font-400 dark:text-font-600 cursor-pointer transition-colors hover:text-font-300 dark:hover:text-font-500',
146
+ 'absolute top-1/2 right-2 w-5 h-5 -translate-y-1/2 text-text-color-300 hover:cursor-pointer',
150
147
  children: isPasswordVisible
151
148
  ? jsxRuntime.jsx(ForwardRef$5, {
152
149
  onClick: () => {
@@ -167,14 +164,14 @@ function InputField({
167
164
  type: type,
168
165
  autoComplete: autoCompleteId,
169
166
  placeholder: label,
170
- className: `relative w-full block py-3 pr-10 pl-3 text-sm text-font-950 bg-base-0 border rounded-lg border-base-500/15 appearance-none focus:outline-none focus:ring-primary-500 placeholder-font-400 dark:text-font-0 dark:text-font-100 dark:bg-base-950 dark:placeholder-font-600 ${type === 'number' ? 'text-right' : ''}`,
167
+ className: `relative w-full block py-3 pr-10 pl-3 text-gray-600 bg-white border-none rounded-lg shadow-sm shadow-input appearance-none focus:outline-none focus:ring-primary placeholder-gray-400 sm:text-sm dark:text-black dark:placeholder-gray-500 ${type === 'number' ? 'text-right' : ''}`,
171
168
  ...register,
172
169
  }),
173
170
  ],
174
171
  });
175
172
  }
176
173
 
177
- const SigninForm = ({ mapText, onSubmit, errorMessage, hideLabels }) => {
174
+ const SigninForm = ({ mapText, onSubmit, errorMessage, onForgotPassword }) => {
178
175
  const { register, handleSubmit } = reactHookForm.useForm({
179
176
  shouldUseNativeValidation: true,
180
177
  });
@@ -186,90 +183,97 @@ const SigninForm = ({ mapText, onSubmit, errorMessage, hideLabels }) => {
186
183
  id: 'email',
187
184
  label: mapText('auth:form.email.label'),
188
185
  type: 'text',
189
- hideLabel: hideLabels,
190
186
  required: true,
191
187
  autoCompleteId: 'email',
192
188
  register: register('email', {
193
189
  required: mapText('form.email.validations.required'),
194
190
  }),
195
191
  }),
196
- jsxRuntime.jsx(InputField, {
197
- id: 'password',
198
- label: mapText('auth:form.password.label'),
199
- type: 'password',
200
- hideLabel: hideLabels,
201
- required: true,
202
- autoCompleteId: 'password',
203
- register: register('password', {
204
- required: mapText('form.password.validations.required'),
192
+ jsxRuntime.jsx('div', {
193
+ className: 'relative',
194
+ children: jsxRuntime.jsx(InputField, {
195
+ id: 'password',
196
+ label: mapText('auth:form.password.label'),
197
+ type: 'password',
198
+ required: true,
199
+ autoCompleteId: 'password',
200
+ register: register('password', {
201
+ required: mapText('form.password.validations.required'),
202
+ }),
203
+ isPasswordField: true,
205
204
  }),
206
- isPasswordField: true,
207
205
  }),
208
206
  jsxRuntime.jsxs('div', {
209
207
  children: [
210
- jsxRuntime.jsx('input', {
208
+ jsxRuntime.jsx('button', {
211
209
  type: 'submit',
212
- value: mapText('auth:form.submit.text'),
213
210
  className:
214
- 'w-full flex justify-center px-4 py-3 text-sm text-white bg-[length:200%_200%] bg-primary-shimmer border-none border rounded-lg shadow-sm transition-transform animate-shimmerdelayed cursor-pointer hover:scale-105 focus:outline-none focus:ring-1 focus:ring-base-600/20 focus:ring-offset-0 dark:focus:ring-base-500',
211
+ 'w-full flex justify-center px-4 py-3 text-sm font-medium text-white bg-[length:200%_200%] bg-primary-shimmer border-none border rounded-lg shadow-sm transition-transform animate-shimmerdelayed hover:scale-105 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2',
212
+ children: mapText('auth:form.submit.text'),
213
+ }),
214
+ jsxRuntime.jsx('span', {
215
+ className: 'block mt-2 text-sm font-medium text-red-500',
216
+ children: errorMessage,
215
217
  }),
216
- errorMessage &&
217
- jsxRuntime.jsx('span', {
218
- className: 'block mt-2.5 text-sm text-red-600',
219
- children: errorMessage,
220
- }),
221
218
  ],
222
219
  }),
223
220
  jsxRuntime.jsx('div', {
224
221
  className: 'flex justify-between items-center',
225
- children: jsxRuntime.jsx('a', {
226
- href: '',
227
- className:
228
- 'text-sm text-font-600 transition-colors hover:text-primary-500 dark:text-font-400',
229
- children: mapText('auth:form.forgot.text'),
222
+ children: jsxRuntime.jsx('div', {
223
+ className: 'text-sm',
224
+ children: jsxRuntime.jsx('button', {
225
+ type: 'button',
226
+ onClick: () => {
227
+ if (onForgotPassword) {
228
+ onForgotPassword();
229
+ }
230
+ },
231
+ className:
232
+ 'font-medium text-primary transition-colors hover:text-primary-500 dark:text-white',
233
+ children: mapText('auth:form.forgot.text'),
234
+ }),
230
235
  }),
231
236
  }),
232
237
  ],
233
238
  });
234
239
  };
235
240
 
236
- function SigninLayout({
237
- mapText,
238
- onSubmit,
239
- errorMessage,
240
- logoSrc,
241
- hideLabels = false,
242
- }) {
243
- return jsxRuntime.jsx('div', {
244
- className:
245
- 'sign-in-layout-container size-full z-10 relative flex justify-end items-center p-5 sm:p-10',
246
- children: jsxRuntime.jsx('div', {
247
- className: 'w-full flex flex-row justify-center items-stretch max-w-xl',
248
- children: jsxRuntime.jsxs('div', {
241
+ function SigninLayout({ mapText, onSubmit, errorMessage, onForgotPassword }) {
242
+ return jsxRuntime.jsxs('div', {
243
+ className: 'h-full flex flex-col sm:flex-row',
244
+ children: [
245
+ jsxRuntime.jsx('div', {
249
246
  className:
250
- 'sign-in-dialog w-full p-5 bg-base-0/70 rounded-lg sm:p-10 dark:bg-base-950/70',
251
- children: [
252
- jsxRuntime.jsx('img', {
253
- className: 'w-auto h-10 mb-20 object-cover',
254
- src: logoSrc,
255
- alt: '',
256
- }),
257
- jsxRuntime.jsx('h2', {
258
- className: '',
259
- children: mapText('auth:form.submit.text'),
260
- }),
261
- jsxRuntime.jsx('div', {
262
- className: 'mt-5',
263
- children: jsxRuntime.jsx(SigninForm, {
264
- mapText: mapText,
265
- onSubmit: (values) => onSubmit(values.email, values.password),
266
- errorMessage: errorMessage,
267
- hideLabels: hideLabels,
268
- }),
247
+ "relative w-auto h-full bg-[url('/assets/signup_cover.png')] bg-no-repeat bg-center bg-cover sm:flex-1",
248
+ }),
249
+ jsxRuntime.jsx('div', {
250
+ className:
251
+ 'flex-1 w-auto flex flex-col lg:flex-none max-sm:absolute max-sm:top-1/2 max-sm:left-1/2 max-sm:w-full max-sm:-translate-x-1/2 max-sm:-translate-y-1/2 max-sm:max-w-96 dark:sm:bg-base-900',
252
+ children: jsxRuntime.jsx('div', {
253
+ className:
254
+ 'flex-1 flex flex-col p-4 sm:justify-center sm:px-6 sm:py-12 lg:px-20 xl:px-24 2xl:px-40 max-sm:px-5 max-sm:mx-5 max-sm:bg-white/80 max-sm:rounded-lg dark:max-sm:bg-base-900/80',
255
+ children: jsxRuntime.jsxs('div', {
256
+ className: 'w-full mx-auto lg:w-96 max-w-xl',
257
+ children: [
258
+ jsxRuntime.jsx('h2', {
259
+ className:
260
+ 'mt-6 text-3xl font-extrabold text-gray-900 select-none dark:text-white',
261
+ children: mapText('auth:page.title'),
262
+ }),
263
+ jsxRuntime.jsx('div', {
264
+ className: 'mt-10',
265
+ children: jsxRuntime.jsx(SigninForm, {
266
+ mapText: mapText,
267
+ onSubmit: (values) => onSubmit(values.email, values.password),
268
+ errorMessage: errorMessage,
269
+ onForgotPassword: onForgotPassword,
270
+ }),
271
+ }),
272
+ ],
269
273
  }),
270
- ],
274
+ }),
271
275
  }),
272
- }),
276
+ ],
273
277
  });
274
278
  }
275
279
 
package/dist/index.d.ts CHANGED
@@ -2,14 +2,13 @@ declare module "@native-systems/ui" {
2
2
  type InputFieldProps = {
3
3
  id: string;
4
4
  label: string;
5
- hideLabel?: boolean;
6
5
  register: any;
7
6
  type: string;
8
7
  required: boolean;
9
8
  autoCompleteId?: string;
10
9
  isPasswordField?: boolean;
11
10
  };
12
- export function InputField({ id, label, hideLabel, register, type, required, autoCompleteId, isPasswordField, }: InputFieldProps): import("react/jsx-runtime").JSX.Element;
11
+ export function InputField({ id, label, register, type, required, autoCompleteId, isPasswordField, }: InputFieldProps): import("react/jsx-runtime").JSX.Element;
13
12
  }
14
13
 
15
14
  declare module "@native-systems/ui" {
@@ -21,9 +20,9 @@ declare module "@native-systems/ui" {
21
20
  mapText: (key: string) => string;
22
21
  onSubmit: (values: any) => void;
23
22
  errorMessage: string | null;
24
- hideLabels: boolean;
23
+ onForgotPassword?: () => void;
25
24
  };
26
- export const SigninForm: ({ mapText, onSubmit, errorMessage, hideLabels }: ISigninFormProps) => import("react/jsx-runtime").JSX.Element;
25
+ export const SigninForm: ({ mapText, onSubmit, errorMessage, onForgotPassword }: ISigninFormProps) => import("react/jsx-runtime").JSX.Element;
27
26
  }
28
27
 
29
28
  declare module "@native-systems/ui" {
@@ -35,10 +34,9 @@ declare module "@native-systems/ui" {
35
34
  mapText: (key: string) => string;
36
35
  onSubmit: (email: string, password: string) => void;
37
36
  errorMessage: string | null;
38
- logoSrc?: string;
39
- hideLabels?: boolean;
37
+ onForgotPassword?: () => {};
40
38
  }
41
- export function SigninLayout({ mapText, onSubmit, errorMessage, logoSrc, hideLabels }: SigninLayoutProps): import("react/jsx-runtime").JSX.Element;
39
+ export function SigninLayout({ mapText, onSubmit, errorMessage, onForgotPassword, }: SigninLayoutProps): import("react/jsx-runtime").JSX.Element;
42
40
  }
43
41
 
44
42
  declare module "@native-systems/ui" {
@@ -149,11 +147,11 @@ declare module "@native-systems/ui" {
149
147
  SaveButton: typeof Util.SaveButton;
150
148
  Textarea: typeof Util.Textarea;
151
149
  SigninLayout: typeof UI.SigninLayout;
152
- SigninForm: ({ mapText, onSubmit, errorMessage, hideLabels }: {
150
+ SigninForm: ({ mapText, onSubmit, errorMessage, onForgotPassword }: {
153
151
  mapText: (key: string) => string;
154
152
  onSubmit: (values: any) => void;
155
153
  errorMessage: string | null;
156
- hideLabels: boolean;
154
+ onForgotPassword?: () => void;
157
155
  }) => import("react/jsx-runtime").JSX.Element;
158
156
  };
159
157
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["src/components/util/views/Input.tsx","src/components/auth/widgets/SigninForm.tsx","src/components/auth/layout/SigninLayout.tsx","src/components/util/layout/MainContentFrame.tsx","src/components/util/widgets/Pagination.tsx","src/components/util/views/CancelButton.tsx","src/components/util/views/ErrorDisplay.tsx","src/components/util/views/HowToCloseText.tsx","src/components/util/views/LoadingSpinner.tsx","src/components/util/views/SaveButton.tsx","src/components/util/views/Textarea.tsx","src/context/TemplateParserContext.tsx","src/index.ts"],"names":[],"mappings":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,OAAO,EAAiB,KAAK,SAAS,EAAsB,cAAc;IAE1E,OAAO,EAOL,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,gCAAgC;IAEjC,KAAK,0BAA0B,GAAG;QAChC,KAAK,EAAE,SAAS,CAAC;QACjB,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;KAC1D,CAAC;IAOF,MAAM,MAAM,2BAA2B,GAAG;QACxC,cAAc,EAAE,WAAW,CAAC;QAC5B,QAAQ,EAAE,SAAS,CAAC;KACrB,CAAC;IAEF,MAAM,CAAC,MAAM,sBAAsB,EAAA,CAAA,KAAA,EAAW,2BAA2B,KAAA,OAAA,mBAAA,EAAA,GAAA,CAAA,OA+CxE,CAAC;IAEF,MAAM,CAAC,MAAM,iBAAiB,EAAA,MAAA,0BAQ7B,CAAC;;;;IC/EF,OAAO,KAAK,EAAE,2BAA0B;IACxC,OAAO,KAAK,IAAI,2BAA0B;IAC1C,OAAO,KAAK,GAAG,2BAAkB;;;;;;;;;;;;;;;;;;;;;;;;IAEjC,eAAA,QAAA,CAIE","file":"index.d.ts","sourceRoot":".."}
1
+ {"version":3,"sources":["src/components/util/views/Input.tsx","src/components/auth/widgets/SigninForm.tsx","src/components/auth/layout/SigninLayout.tsx","src/components/util/layout/MainContentFrame.tsx","src/components/util/widgets/Pagination.tsx","src/components/util/views/CancelButton.tsx","src/components/util/views/ErrorDisplay.tsx","src/components/util/views/HowToCloseText.tsx","src/components/util/views/LoadingSpinner.tsx","src/components/util/views/SaveButton.tsx","src/components/util/views/Textarea.tsx","src/context/TemplateParserContext.tsx","src/index.ts"],"names":[],"mappings":";IAIA,KAAK,eAAe,GAAG;QACrB,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,GAAG,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,OAAO,CAAC;QAClB,cAAc,CAAC,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;IAOF,MAAM,MAAM,2BAA2B,GAAG;QACxC,cAAc,EAAE,WAAW,CAAC;QAC5B,QAAQ,EAAE,SAAS,CAAC;KACrB,CAAC;IAEF,MAAM,CAAC,MAAM,sBAAsB,EAAA,CAAA,KAAA,EAAW,2BAA2B,KAAA,OAAA,mBAAA,EAAA,GAAA,CAAA,OA+CxE,CAAC;IAEF,MAAM,CAAC,MAAM,iBAAiB,EAAA,MAAA,0BAQ7B,CAAC;;;;IC/EF,OAAO,KAAK,EAAE,2BAA0B;IACxC,OAAO,KAAK,IAAI,2BAA0B;IAC1C,OAAO,KAAK,GAAG,2BAAkB;;;;;;;;;;;;;;;;;;;;;;;;IAEjC,eAAA,QAAA,CAIE","file":"index.d.ts","sourceRoot":".."}
package/dist/index.esm.js CHANGED
@@ -89,7 +89,6 @@ const ForwardRef$4 = /*#__PURE__*/ React.forwardRef(EyeIcon);
89
89
  function InputField({
90
90
  id,
91
91
  label,
92
- hideLabel = false,
93
92
  register,
94
93
  type,
95
94
  required,
@@ -100,14 +99,12 @@ function InputField({
100
99
  return jsxs('div', {
101
100
  className: 'flex flex-col space-y-2',
102
101
  children: [
103
- !hideLabel
104
- ? jsx('label', {
105
- htmlFor: id,
106
- className:
107
- 'block ml-1 text-sm font-medium text-gray-700 dark:text-white',
108
- children: label,
109
- })
110
- : null,
102
+ jsx('label', {
103
+ htmlFor: id,
104
+ className:
105
+ 'block ml-1 text-sm font-medium text-gray-700 dark:text-white',
106
+ children: label,
107
+ }),
111
108
  isPasswordField
112
109
  ? jsxs('div', {
113
110
  className: 'relative w-full',
@@ -118,12 +115,12 @@ function InputField({
118
115
  type: isPasswordVisible ? 'text' : 'password',
119
116
  autoComplete: autoCompleteId,
120
117
  placeholder: label,
121
- className: `relative w-full block py-3 pr-10 pl-3 text-sm text-font-950 bg-base-0 border rounded-lg border-base-500/15 appearance-none focus:outline-none focus:ring-primary-500 placeholder-font-400 dark:text-font-0 dark:text-font-100 dark:bg-base-950 dark:placeholder-font-600 ${type === 'number' ? 'text-right' : ''}`,
118
+ className: `w-full block py-3 pr-8 pl-3 text-gray-600 bg-white border-none rounded-lg shadow-sm shadow-input appearance-none focus:outline-none focus:ring-primary placeholder-gray-400 sm:text-sm dark:text-black dark:placeholder-gray-500 ${type === 'number' ? 'text-right' : ''}`,
122
119
  ...register,
123
120
  }),
124
121
  jsx('div', {
125
122
  className:
126
- 'absolute top-1/2 right-2 size-5 -translate-y-1/2 text-font-400 dark:text-font-600 cursor-pointer transition-colors hover:text-font-300 dark:hover:text-font-500',
123
+ 'absolute top-1/2 right-2 w-5 h-5 -translate-y-1/2 text-text-color-300 hover:cursor-pointer',
127
124
  children: isPasswordVisible
128
125
  ? jsx(ForwardRef$5, {
129
126
  onClick: () => {
@@ -144,14 +141,14 @@ function InputField({
144
141
  type: type,
145
142
  autoComplete: autoCompleteId,
146
143
  placeholder: label,
147
- className: `relative w-full block py-3 pr-10 pl-3 text-sm text-font-950 bg-base-0 border rounded-lg border-base-500/15 appearance-none focus:outline-none focus:ring-primary-500 placeholder-font-400 dark:text-font-0 dark:text-font-100 dark:bg-base-950 dark:placeholder-font-600 ${type === 'number' ? 'text-right' : ''}`,
144
+ className: `relative w-full block py-3 pr-10 pl-3 text-gray-600 bg-white border-none rounded-lg shadow-sm shadow-input appearance-none focus:outline-none focus:ring-primary placeholder-gray-400 sm:text-sm dark:text-black dark:placeholder-gray-500 ${type === 'number' ? 'text-right' : ''}`,
148
145
  ...register,
149
146
  }),
150
147
  ],
151
148
  });
152
149
  }
153
150
 
154
- const SigninForm = ({ mapText, onSubmit, errorMessage, hideLabels }) => {
151
+ const SigninForm = ({ mapText, onSubmit, errorMessage, onForgotPassword }) => {
155
152
  const { register, handleSubmit } = useForm({
156
153
  shouldUseNativeValidation: true,
157
154
  });
@@ -163,90 +160,97 @@ const SigninForm = ({ mapText, onSubmit, errorMessage, hideLabels }) => {
163
160
  id: 'email',
164
161
  label: mapText('auth:form.email.label'),
165
162
  type: 'text',
166
- hideLabel: hideLabels,
167
163
  required: true,
168
164
  autoCompleteId: 'email',
169
165
  register: register('email', {
170
166
  required: mapText('form.email.validations.required'),
171
167
  }),
172
168
  }),
173
- jsx(InputField, {
174
- id: 'password',
175
- label: mapText('auth:form.password.label'),
176
- type: 'password',
177
- hideLabel: hideLabels,
178
- required: true,
179
- autoCompleteId: 'password',
180
- register: register('password', {
181
- required: mapText('form.password.validations.required'),
169
+ jsx('div', {
170
+ className: 'relative',
171
+ children: jsx(InputField, {
172
+ id: 'password',
173
+ label: mapText('auth:form.password.label'),
174
+ type: 'password',
175
+ required: true,
176
+ autoCompleteId: 'password',
177
+ register: register('password', {
178
+ required: mapText('form.password.validations.required'),
179
+ }),
180
+ isPasswordField: true,
182
181
  }),
183
- isPasswordField: true,
184
182
  }),
185
183
  jsxs('div', {
186
184
  children: [
187
- jsx('input', {
185
+ jsx('button', {
188
186
  type: 'submit',
189
- value: mapText('auth:form.submit.text'),
190
187
  className:
191
- 'w-full flex justify-center px-4 py-3 text-sm text-white bg-[length:200%_200%] bg-primary-shimmer border-none border rounded-lg shadow-sm transition-transform animate-shimmerdelayed cursor-pointer hover:scale-105 focus:outline-none focus:ring-1 focus:ring-base-600/20 focus:ring-offset-0 dark:focus:ring-base-500',
188
+ 'w-full flex justify-center px-4 py-3 text-sm font-medium text-white bg-[length:200%_200%] bg-primary-shimmer border-none border rounded-lg shadow-sm transition-transform animate-shimmerdelayed hover:scale-105 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2',
189
+ children: mapText('auth:form.submit.text'),
190
+ }),
191
+ jsx('span', {
192
+ className: 'block mt-2 text-sm font-medium text-red-500',
193
+ children: errorMessage,
192
194
  }),
193
- errorMessage &&
194
- jsx('span', {
195
- className: 'block mt-2.5 text-sm text-red-600',
196
- children: errorMessage,
197
- }),
198
195
  ],
199
196
  }),
200
197
  jsx('div', {
201
198
  className: 'flex justify-between items-center',
202
- children: jsx('a', {
203
- href: '',
204
- className:
205
- 'text-sm text-font-600 transition-colors hover:text-primary-500 dark:text-font-400',
206
- children: mapText('auth:form.forgot.text'),
199
+ children: jsx('div', {
200
+ className: 'text-sm',
201
+ children: jsx('button', {
202
+ type: 'button',
203
+ onClick: () => {
204
+ if (onForgotPassword) {
205
+ onForgotPassword();
206
+ }
207
+ },
208
+ className:
209
+ 'font-medium text-primary transition-colors hover:text-primary-500 dark:text-white',
210
+ children: mapText('auth:form.forgot.text'),
211
+ }),
207
212
  }),
208
213
  }),
209
214
  ],
210
215
  });
211
216
  };
212
217
 
213
- function SigninLayout({
214
- mapText,
215
- onSubmit,
216
- errorMessage,
217
- logoSrc,
218
- hideLabels = false,
219
- }) {
220
- return jsx('div', {
221
- className:
222
- 'sign-in-layout-container size-full z-10 relative flex justify-end items-center p-5 sm:p-10',
223
- children: jsx('div', {
224
- className: 'w-full flex flex-row justify-center items-stretch max-w-xl',
225
- children: jsxs('div', {
218
+ function SigninLayout({ mapText, onSubmit, errorMessage, onForgotPassword }) {
219
+ return jsxs('div', {
220
+ className: 'h-full flex flex-col sm:flex-row',
221
+ children: [
222
+ jsx('div', {
226
223
  className:
227
- 'sign-in-dialog w-full p-5 bg-base-0/70 rounded-lg sm:p-10 dark:bg-base-950/70',
228
- children: [
229
- jsx('img', {
230
- className: 'w-auto h-10 mb-20 object-cover',
231
- src: logoSrc,
232
- alt: '',
233
- }),
234
- jsx('h2', {
235
- className: '',
236
- children: mapText('auth:form.submit.text'),
237
- }),
238
- jsx('div', {
239
- className: 'mt-5',
240
- children: jsx(SigninForm, {
241
- mapText: mapText,
242
- onSubmit: (values) => onSubmit(values.email, values.password),
243
- errorMessage: errorMessage,
244
- hideLabels: hideLabels,
245
- }),
224
+ "relative w-auto h-full bg-[url('/assets/signup_cover.png')] bg-no-repeat bg-center bg-cover sm:flex-1",
225
+ }),
226
+ jsx('div', {
227
+ className:
228
+ 'flex-1 w-auto flex flex-col lg:flex-none max-sm:absolute max-sm:top-1/2 max-sm:left-1/2 max-sm:w-full max-sm:-translate-x-1/2 max-sm:-translate-y-1/2 max-sm:max-w-96 dark:sm:bg-base-900',
229
+ children: jsx('div', {
230
+ className:
231
+ 'flex-1 flex flex-col p-4 sm:justify-center sm:px-6 sm:py-12 lg:px-20 xl:px-24 2xl:px-40 max-sm:px-5 max-sm:mx-5 max-sm:bg-white/80 max-sm:rounded-lg dark:max-sm:bg-base-900/80',
232
+ children: jsxs('div', {
233
+ className: 'w-full mx-auto lg:w-96 max-w-xl',
234
+ children: [
235
+ jsx('h2', {
236
+ className:
237
+ 'mt-6 text-3xl font-extrabold text-gray-900 select-none dark:text-white',
238
+ children: mapText('auth:page.title'),
239
+ }),
240
+ jsx('div', {
241
+ className: 'mt-10',
242
+ children: jsx(SigninForm, {
243
+ mapText: mapText,
244
+ onSubmit: (values) => onSubmit(values.email, values.password),
245
+ errorMessage: errorMessage,
246
+ onForgotPassword: onForgotPassword,
247
+ }),
248
+ }),
249
+ ],
246
250
  }),
247
- ],
251
+ }),
248
252
  }),
249
- }),
253
+ ],
250
254
  });
251
255
  }
252
256
 
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
13
- "version": "1.0.4",
13
+ "version": "1.0.5",
14
14
  "license": "MIT",
15
15
  "private": false,
16
16
  "engines": {