nucleus-core-ts 0.9.881 → 0.9.883
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/.build-ok +1 -1
- package/dist/fe/components/ChatPanel/components/ConversationList.d.ts +1 -1
- package/dist/fe/components/ChatPanel/components/ConversationList.js +2 -2
- package/dist/fe/components/ChatPanel/components/MessageComposer.d.ts +1 -1
- package/dist/fe/components/ChatPanel/components/MessageComposer.js +2 -2
- package/dist/fe/components/ChatPanel/components/MessageThread.d.ts +1 -1
- package/dist/fe/components/ChatPanel/components/MessageThread.js +2 -2
- package/dist/fe/components/ForgotPasswordPage/components/ForgotPasswordForm.d.ts +1 -1
- package/dist/fe/components/ForgotPasswordPage/components/ForgotPasswordForm.js +20 -14
- package/dist/fe/components/ForgotPasswordPage/components/ForgotPasswordPage.d.ts +1 -1
- package/dist/fe/components/ForgotPasswordPage/components/ForgotPasswordPage.js +8 -2
- package/dist/fe/components/ForgotPasswordPage/index.d.ts +1 -0
- package/dist/fe/components/ForgotPasswordPage/index.js +1 -0
- package/dist/fe/components/ForgotPasswordPage/labels.d.ts +19 -0
- package/dist/fe/components/ForgotPasswordPage/labels.js +16 -0
- package/dist/fe/components/ForgotPasswordPage/types/index.d.ts +4 -0
- package/dist/fe/components/IntegrationsPage/components/FieldMappingRows.js +6 -6
- package/dist/fe/components/ResetPasswordPage/components/ResetPasswordForm.d.ts +1 -1
- package/dist/fe/components/ResetPasswordPage/components/ResetPasswordForm.js +12 -7
- package/dist/fe/components/ResetPasswordPage/components/ResetPasswordPage.d.ts +1 -1
- package/dist/fe/components/ResetPasswordPage/components/ResetPasswordPage.js +8 -2
- package/dist/fe/components/ResetPasswordPage/index.d.ts +1 -0
- package/dist/fe/components/ResetPasswordPage/index.js +1 -0
- package/dist/fe/components/ResetPasswordPage/labels.d.ts +14 -0
- package/dist/fe/components/ResetPasswordPage/labels.js +12 -0
- package/dist/fe/components/ResetPasswordPage/types/index.d.ts +4 -0
- package/dist/fe/components/SetPasswordPage/components/SetPasswordForm.d.ts +2 -2
- package/dist/fe/components/SetPasswordPage/components/SetPasswordForm.js +148 -0
- package/dist/fe/components/SetPasswordPage/components/SetPasswordPage.js +2 -2
- package/dist/fe/index.d.ts +2 -2
- package/dist/fe/index.js +2 -2
- package/package.json +1 -1
- package/scripts/build.ts +44 -1
package/dist/.build-ok
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.9.
|
|
1
|
+
0.9.883
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ChatPanelLabels } from '../labels';
|
|
2
1
|
import type { ReactElement } from 'react';
|
|
2
|
+
import { type ChatPanelLabels } from '../labels';
|
|
3
3
|
import type { ChatPanelTheme } from '../theme';
|
|
4
4
|
import type { ChatConversationDTO } from '../types';
|
|
5
5
|
type ConversationListProps = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { DEFAULT_CHAT_LABELS } from '../labels';
|
|
3
1
|
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
3
|
import { cn } from '../../../utils/cn';
|
|
5
4
|
import { conversationTitle, formatRelativeTime, initialsOf, otherParticipantId } from '../helpers';
|
|
5
|
+
import { DEFAULT_CHAT_LABELS } from '../labels';
|
|
6
6
|
export function ConversationList({ conversations, activeId, currentUserId, isLoading, theme, onSelect, resolveUserName, resolveUserAvatar, labels }) {
|
|
7
7
|
const say = {
|
|
8
8
|
...DEFAULT_CHAT_LABELS,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { DEFAULT_CHAT_LABELS } from '../labels';
|
|
3
1
|
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
4
3
|
import { useRef, useState } from 'react';
|
|
4
|
+
import { DEFAULT_CHAT_LABELS } from '../labels';
|
|
5
5
|
export function MessageComposer({ theme, value, disabled, uploadEnabled, onChange, onSendText, onSendFiles, labels }) {
|
|
6
6
|
const say = {
|
|
7
7
|
...DEFAULT_CHAT_LABELS,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ChatPanelLabels } from '../labels';
|
|
2
1
|
import type { ReactElement } from 'react';
|
|
2
|
+
import { type ChatPanelLabels } from '../labels';
|
|
3
3
|
import type { ChatPanelTheme } from '../theme';
|
|
4
4
|
import type { ChatConversationDTO, ChatMessageDTO, TypingIndicator } from '../types';
|
|
5
5
|
type MessageThreadProps = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { DEFAULT_CHAT_LABELS } from '../labels';
|
|
3
1
|
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
4
3
|
import { useEffect, useRef } from 'react';
|
|
5
4
|
import { cn } from '../../../utils/cn';
|
|
6
5
|
import { conversationTitle, formatClockTime } from '../helpers';
|
|
6
|
+
import { DEFAULT_CHAT_LABELS } from '../labels';
|
|
7
7
|
function Attachments({ message, theme }) {
|
|
8
8
|
if (message.attachments.length === 0) return null;
|
|
9
9
|
return /*#__PURE__*/ _jsx("span", {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { ForgotPasswordFormProps } from '../types';
|
|
3
|
-
export declare function ForgotPasswordForm({ forgotPasswordAction, onBackToLogin, backToLoginHref, }: ForgotPasswordFormProps): ReactElement;
|
|
3
|
+
export declare function ForgotPasswordForm({ labels, forgotPasswordAction, onBackToLogin, backToLoginHref, }: ForgotPasswordFormProps): ReactElement;
|
|
@@ -6,6 +6,7 @@ import { useRef } from 'react';
|
|
|
6
6
|
import { cn } from '../../../utils/cn';
|
|
7
7
|
import { Button } from '../../Button';
|
|
8
8
|
import { NucleusTextInput } from '../../NucleusTextInput';
|
|
9
|
+
import { DEFAULT_FORGOT_PASSWORD_LABELS } from '../labels';
|
|
9
10
|
import { useForgotPasswordStore } from '../store';
|
|
10
11
|
import { forgotPasswordPageTheme } from '../theme';
|
|
11
12
|
gsap.registerPlugin(useGSAP);
|
|
@@ -39,7 +40,11 @@ function CheckCircleIcon({ className }) {
|
|
|
39
40
|
})
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
|
-
export function ForgotPasswordForm({ forgotPasswordAction, onBackToLogin, backToLoginHref }) {
|
|
43
|
+
export function ForgotPasswordForm({ labels, forgotPasswordAction, onBackToLogin, backToLoginHref }) {
|
|
44
|
+
const say = {
|
|
45
|
+
...DEFAULT_FORGOT_PASSWORD_LABELS,
|
|
46
|
+
...labels
|
|
47
|
+
};
|
|
43
48
|
const theme = forgotPasswordPageTheme;
|
|
44
49
|
const formRef = useRef(null);
|
|
45
50
|
const successRef = useRef(null);
|
|
@@ -122,17 +127,18 @@ export function ForgotPasswordForm({ forgotPasswordAction, onBackToLogin, backTo
|
|
|
122
127
|
}),
|
|
123
128
|
/*#__PURE__*/ _jsx("h2", {
|
|
124
129
|
className: theme.success.title,
|
|
125
|
-
children:
|
|
130
|
+
children: say.checkYourEmail
|
|
126
131
|
}),
|
|
127
|
-
/*#__PURE__*/
|
|
132
|
+
/*#__PURE__*/ _jsx("p", {
|
|
128
133
|
className: theme.success.message,
|
|
129
|
-
children: [
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
children: say.sentTo.split('{email}').flatMap((part, i)=>i === 0 ? [
|
|
135
|
+
part
|
|
136
|
+
] : [
|
|
137
|
+
/*#__PURE__*/ _jsx("strong", {
|
|
138
|
+
children: store.email
|
|
139
|
+
}, "e"),
|
|
140
|
+
part
|
|
141
|
+
])
|
|
136
142
|
}),
|
|
137
143
|
/*#__PURE__*/ _jsx("div", {
|
|
138
144
|
className: theme.links.container,
|
|
@@ -142,7 +148,7 @@ export function ForgotPasswordForm({ forgotPasswordAction, onBackToLogin, backTo
|
|
|
142
148
|
className: theme.links.backToLogin,
|
|
143
149
|
children: [
|
|
144
150
|
/*#__PURE__*/ _jsx(ArrowLeftIcon, {}),
|
|
145
|
-
|
|
151
|
+
say.backToLogin
|
|
146
152
|
]
|
|
147
153
|
})
|
|
148
154
|
})
|
|
@@ -170,8 +176,8 @@ export function ForgotPasswordForm({ forgotPasswordAction, onBackToLogin, backTo
|
|
|
170
176
|
className: theme.input.wrapper,
|
|
171
177
|
children: /*#__PURE__*/ _jsx(NucleusTextInput, {
|
|
172
178
|
type: "email",
|
|
173
|
-
label:
|
|
174
|
-
placeholder:
|
|
179
|
+
label: say.emailLabel,
|
|
180
|
+
placeholder: say.emailPlaceholder,
|
|
175
181
|
value: store.email,
|
|
176
182
|
onChange: store.setEmail,
|
|
177
183
|
disabled: isLoading,
|
|
@@ -203,7 +209,7 @@ export function ForgotPasswordForm({ forgotPasswordAction, onBackToLogin, backTo
|
|
|
203
209
|
disabled: isLoading,
|
|
204
210
|
children: [
|
|
205
211
|
/*#__PURE__*/ _jsx(ArrowLeftIcon, {}),
|
|
206
|
-
|
|
212
|
+
say.backToLogin
|
|
207
213
|
]
|
|
208
214
|
})
|
|
209
215
|
})
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { ForgotPasswordPageConfig } from '../types';
|
|
3
|
-
export declare function ForgotPasswordPage({ logo, title, subtitle, forgotPasswordAction, onBackToLogin, backToLoginHref, showBackground, className, }: ForgotPasswordPageConfig): ReactElement;
|
|
3
|
+
export declare function ForgotPasswordPage({ labels, logo, title, subtitle, forgotPasswordAction, onBackToLogin, backToLoginHref, showBackground, className, }: ForgotPasswordPageConfig): ReactElement;
|
|
@@ -5,11 +5,16 @@ import gsap from 'gsap';
|
|
|
5
5
|
import { useRef } from 'react';
|
|
6
6
|
import { cn } from '../../../utils/cn';
|
|
7
7
|
import { AbstractAnimatedBackground } from '../../AbstractAnimatedBackground';
|
|
8
|
+
import { DEFAULT_FORGOT_PASSWORD_LABELS } from '../labels';
|
|
8
9
|
import { forgotPasswordPageTheme } from '../theme';
|
|
9
10
|
import { ForgotPasswordForm } from './ForgotPasswordForm';
|
|
10
11
|
import { ForgotPasswordHeader } from './ForgotPasswordHeader';
|
|
11
12
|
gsap.registerPlugin(useGSAP);
|
|
12
|
-
export function ForgotPasswordPage({ logo, title = 'Forgot Password?', subtitle = "No worries, we'll send you reset instructions.", forgotPasswordAction, onBackToLogin, backToLoginHref, showBackground = true, className }) {
|
|
13
|
+
export function ForgotPasswordPage({ labels, logo, title = 'Forgot Password?', subtitle = "No worries, we'll send you reset instructions.", forgotPasswordAction, onBackToLogin, backToLoginHref, showBackground = true, className }) {
|
|
14
|
+
const say = {
|
|
15
|
+
...DEFAULT_FORGOT_PASSWORD_LABELS,
|
|
16
|
+
...labels
|
|
17
|
+
};
|
|
13
18
|
const theme = forgotPasswordPageTheme;
|
|
14
19
|
const containerRef = useRef(null);
|
|
15
20
|
const cardRef = useRef(null);
|
|
@@ -32,7 +37,7 @@ export function ForgotPasswordPage({ logo, title = 'Forgot Password?', subtitle
|
|
|
32
37
|
return /*#__PURE__*/ _jsxs("main", {
|
|
33
38
|
ref: containerRef,
|
|
34
39
|
className: cn(theme.container.base, className),
|
|
35
|
-
"aria-label":
|
|
40
|
+
"aria-label": say.pageLabel,
|
|
36
41
|
children: [
|
|
37
42
|
showBackground && /*#__PURE__*/ _jsx(AbstractAnimatedBackground, {}),
|
|
38
43
|
/*#__PURE__*/ _jsx("div", {
|
|
@@ -47,6 +52,7 @@ export function ForgotPasswordPage({ logo, title = 'Forgot Password?', subtitle
|
|
|
47
52
|
subtitle: subtitle
|
|
48
53
|
}),
|
|
49
54
|
/*#__PURE__*/ _jsx(ForgotPasswordForm, {
|
|
55
|
+
labels: labels,
|
|
50
56
|
forgotPasswordAction: forgotPasswordAction,
|
|
51
57
|
onBackToLogin: onBackToLogin,
|
|
52
58
|
backToLoginHref: backToLoginHref
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { ForgotPasswordForm } from './components/ForgotPasswordForm';
|
|
2
2
|
export { ForgotPasswordHeader } from './components/ForgotPasswordHeader';
|
|
3
3
|
export { ForgotPasswordPage } from './components/ForgotPasswordPage';
|
|
4
|
+
export { DEFAULT_FORGOT_PASSWORD_LABELS, type ForgotPasswordLabels } from './labels';
|
|
4
5
|
export { useForgotPasswordStore } from './store';
|
|
5
6
|
export { extendForgotPasswordPageTheme, type ForgotPasswordPageTheme, forgotPasswordPageTheme, } from './theme';
|
|
6
7
|
export type { ForgotPasswordAction, ForgotPasswordFormProps, ForgotPasswordHeaderProps, ForgotPasswordPageConfig, ForgotPasswordStep, } from './types';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { ForgotPasswordForm } from './components/ForgotPasswordForm';
|
|
2
2
|
export { ForgotPasswordHeader } from './components/ForgotPasswordHeader';
|
|
3
3
|
export { ForgotPasswordPage } from './components/ForgotPasswordPage';
|
|
4
|
+
export { DEFAULT_FORGOT_PASSWORD_LABELS } from './labels';
|
|
4
5
|
export { useForgotPasswordStore } from './store';
|
|
5
6
|
export { extendForgotPasswordPageTheme, forgotPasswordPageTheme } from './theme';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every word this page says, so a portal can say them in its own language.
|
|
3
|
+
*
|
|
4
|
+
* `title` and `subtitle` were already props; everything under them was English
|
|
5
|
+
* — including the whole success state, which is the only screen somebody who
|
|
6
|
+
* has lost their password actually reads.
|
|
7
|
+
*
|
|
8
|
+
* Defaults stay English, so nothing that does not pass labels changes.
|
|
9
|
+
*/
|
|
10
|
+
export type ForgotPasswordLabels = {
|
|
11
|
+
emailLabel: string;
|
|
12
|
+
emailPlaceholder: string;
|
|
13
|
+
checkYourEmail: string;
|
|
14
|
+
/** `{email}` is replaced with the address the link went to. */
|
|
15
|
+
sentTo: string;
|
|
16
|
+
backToLogin: string;
|
|
17
|
+
pageLabel: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const DEFAULT_FORGOT_PASSWORD_LABELS: ForgotPasswordLabels;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every word this page says, so a portal can say them in its own language.
|
|
3
|
+
*
|
|
4
|
+
* `title` and `subtitle` were already props; everything under them was English
|
|
5
|
+
* — including the whole success state, which is the only screen somebody who
|
|
6
|
+
* has lost their password actually reads.
|
|
7
|
+
*
|
|
8
|
+
* Defaults stay English, so nothing that does not pass labels changes.
|
|
9
|
+
*/ export const DEFAULT_FORGOT_PASSWORD_LABELS = {
|
|
10
|
+
emailLabel: 'Email',
|
|
11
|
+
emailPlaceholder: 'you@example.com',
|
|
12
|
+
checkYourEmail: 'Check your email',
|
|
13
|
+
sentTo: "We've sent a password reset link to {email}. Please check your inbox and follow the instructions.",
|
|
14
|
+
backToLogin: 'Back to login',
|
|
15
|
+
pageLabel: 'Forgot password page'
|
|
16
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ForgotPasswordLabels } from '../labels';
|
|
2
3
|
export type ForgotPasswordStep = 'request' | 'success';
|
|
3
4
|
export type ForgotPasswordAction<TData = unknown, TError = unknown> = {
|
|
4
5
|
start: (config: {
|
|
@@ -17,6 +18,8 @@ export type ForgotPasswordAction<TData = unknown, TError = unknown> = {
|
|
|
17
18
|
export interface ForgotPasswordPageConfig {
|
|
18
19
|
title?: string;
|
|
19
20
|
subtitle?: string;
|
|
21
|
+
/** Every word the page says, so a portal can say them in its own language. */
|
|
22
|
+
labels?: Partial<ForgotPasswordLabels>;
|
|
20
23
|
logo?: ReactNode;
|
|
21
24
|
forgotPasswordAction: ForgotPasswordAction;
|
|
22
25
|
onBackToLogin?: () => void;
|
|
@@ -25,6 +28,7 @@ export interface ForgotPasswordPageConfig {
|
|
|
25
28
|
className?: string;
|
|
26
29
|
}
|
|
27
30
|
export interface ForgotPasswordFormProps {
|
|
31
|
+
labels?: Partial<ForgotPasswordLabels>;
|
|
28
32
|
forgotPasswordAction: ForgotPasswordAction;
|
|
29
33
|
onBackToLogin?: () => void;
|
|
30
34
|
backToLoginHref?: string;
|
|
@@ -120,21 +120,21 @@ export function FieldMappingRows({ rows, sourceFields, targetFields, disabled, o
|
|
|
120
120
|
/*#__PURE__*/ _jsxs("p", {
|
|
121
121
|
className: theme.field.hint,
|
|
122
122
|
children: [
|
|
123
|
-
"A single field inside the braces can be shaped on its own with",
|
|
124
|
-
' ',
|
|
123
|
+
"A single field inside the braces can be shaped on its own with ",
|
|
125
124
|
/*#__PURE__*/ _jsx("strong", {
|
|
126
125
|
children: '|'
|
|
127
126
|
}),
|
|
128
|
-
":
|
|
127
|
+
":",
|
|
128
|
+
' ',
|
|
129
129
|
/*#__PURE__*/ _jsx("strong", {
|
|
130
130
|
children: '{companyCode}-{departmentCode|pathLeaf}'
|
|
131
131
|
}),
|
|
132
|
-
|
|
133
|
-
"turns ",
|
|
132
|
+
" turns ",
|
|
134
133
|
/*#__PURE__*/ _jsx("em", {
|
|
135
134
|
children: "TAT"
|
|
136
135
|
}),
|
|
137
|
-
" and
|
|
136
|
+
" and",
|
|
137
|
+
' ',
|
|
138
138
|
/*#__PURE__*/ _jsx("em", {
|
|
139
139
|
children: "050/285/204"
|
|
140
140
|
}),
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { ResetPasswordFormProps } from '../types';
|
|
3
|
-
export declare function ResetPasswordForm({ token, resetPasswordAction, onBackToLogin, backToLoginHref, passwordPolicy, }: ResetPasswordFormProps): ReactElement;
|
|
3
|
+
export declare function ResetPasswordForm({ labels, token, resetPasswordAction, onBackToLogin, backToLoginHref, passwordPolicy, }: ResetPasswordFormProps): ReactElement;
|
|
@@ -7,6 +7,7 @@ import { cn } from '../../../utils/cn';
|
|
|
7
7
|
import { Button } from '../../Button';
|
|
8
8
|
import { NucleusTextInput } from '../../NucleusTextInput';
|
|
9
9
|
import { DEFAULT_PASSWORD_POLICY } from '../../SetPasswordPage/types';
|
|
10
|
+
import { DEFAULT_RESET_PASSWORD_LABELS } from '../labels';
|
|
10
11
|
import { useResetPasswordStore } from '../store';
|
|
11
12
|
import { resetPasswordPageTheme } from '../theme';
|
|
12
13
|
gsap.registerPlugin(useGSAP);
|
|
@@ -70,7 +71,11 @@ function XIcon({ className }) {
|
|
|
70
71
|
})
|
|
71
72
|
});
|
|
72
73
|
}
|
|
73
|
-
export function ResetPasswordForm({ token, resetPasswordAction, onBackToLogin, backToLoginHref, passwordPolicy = {} }) {
|
|
74
|
+
export function ResetPasswordForm({ labels, token, resetPasswordAction, onBackToLogin, backToLoginHref, passwordPolicy = {} }) {
|
|
75
|
+
const say = {
|
|
76
|
+
...DEFAULT_RESET_PASSWORD_LABELS,
|
|
77
|
+
...labels
|
|
78
|
+
};
|
|
74
79
|
const theme = resetPasswordPageTheme;
|
|
75
80
|
const formRef = useRef(null);
|
|
76
81
|
const successRef = useRef(null);
|
|
@@ -218,7 +223,7 @@ export function ResetPasswordForm({ token, resetPasswordAction, onBackToLogin, b
|
|
|
218
223
|
}),
|
|
219
224
|
/*#__PURE__*/ _jsx("h2", {
|
|
220
225
|
className: theme.success.title,
|
|
221
|
-
children:
|
|
226
|
+
children: say.success
|
|
222
227
|
}),
|
|
223
228
|
/*#__PURE__*/ _jsx("p", {
|
|
224
229
|
className: theme.success.message,
|
|
@@ -232,7 +237,7 @@ export function ResetPasswordForm({ token, resetPasswordAction, onBackToLogin, b
|
|
|
232
237
|
className: theme.links.backToLogin,
|
|
233
238
|
children: [
|
|
234
239
|
/*#__PURE__*/ _jsx(ArrowLeftIcon, {}),
|
|
235
|
-
|
|
240
|
+
say.backToLogin
|
|
236
241
|
]
|
|
237
242
|
})
|
|
238
243
|
})
|
|
@@ -260,7 +265,7 @@ export function ResetPasswordForm({ token, resetPasswordAction, onBackToLogin, b
|
|
|
260
265
|
className: theme.input.wrapper,
|
|
261
266
|
children: /*#__PURE__*/ _jsx(NucleusTextInput, {
|
|
262
267
|
type: "password",
|
|
263
|
-
label:
|
|
268
|
+
label: say.newPassword,
|
|
264
269
|
placeholder: "••••••••",
|
|
265
270
|
value: store.newPassword,
|
|
266
271
|
onChange: store.setNewPassword,
|
|
@@ -279,7 +284,7 @@ export function ResetPasswordForm({ token, resetPasswordAction, onBackToLogin, b
|
|
|
279
284
|
className: theme.input.wrapper,
|
|
280
285
|
children: /*#__PURE__*/ _jsx(NucleusTextInput, {
|
|
281
286
|
type: "password",
|
|
282
|
-
label:
|
|
287
|
+
label: say.confirmPassword,
|
|
283
288
|
placeholder: "••••••••",
|
|
284
289
|
value: store.confirmPassword,
|
|
285
290
|
onChange: store.setConfirmPassword,
|
|
@@ -298,7 +303,7 @@ export function ResetPasswordForm({ token, resetPasswordAction, onBackToLogin, b
|
|
|
298
303
|
children: [
|
|
299
304
|
/*#__PURE__*/ _jsx("p", {
|
|
300
305
|
className: theme.requirements.title,
|
|
301
|
-
children:
|
|
306
|
+
children: say.passwordRequirements
|
|
302
307
|
}),
|
|
303
308
|
/*#__PURE__*/ _jsx("ul", {
|
|
304
309
|
className: theme.requirements.list,
|
|
@@ -336,7 +341,7 @@ export function ResetPasswordForm({ token, resetPasswordAction, onBackToLogin, b
|
|
|
336
341
|
disabled: isLoading,
|
|
337
342
|
children: [
|
|
338
343
|
/*#__PURE__*/ _jsx(ArrowLeftIcon, {}),
|
|
339
|
-
|
|
344
|
+
say.backToLogin
|
|
340
345
|
]
|
|
341
346
|
})
|
|
342
347
|
})
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { ResetPasswordPageConfig } from '../types';
|
|
3
|
-
export declare function ResetPasswordPage({ logo, title, subtitle, token, resetPasswordAction, onBackToLogin, backToLoginHref, showBackground, className, passwordPolicy, }: ResetPasswordPageConfig): ReactElement;
|
|
3
|
+
export declare function ResetPasswordPage({ labels, logo, title, subtitle, token, resetPasswordAction, onBackToLogin, backToLoginHref, showBackground, className, passwordPolicy, }: ResetPasswordPageConfig): ReactElement;
|
|
@@ -5,11 +5,16 @@ import gsap from 'gsap';
|
|
|
5
5
|
import { useRef } from 'react';
|
|
6
6
|
import { cn } from '../../../utils/cn';
|
|
7
7
|
import { AbstractAnimatedBackground } from '../../AbstractAnimatedBackground';
|
|
8
|
+
import { DEFAULT_RESET_PASSWORD_LABELS } from '../labels';
|
|
8
9
|
import { resetPasswordPageTheme } from '../theme';
|
|
9
10
|
import { ResetPasswordForm } from './ResetPasswordForm';
|
|
10
11
|
import { ResetPasswordHeader } from './ResetPasswordHeader';
|
|
11
12
|
gsap.registerPlugin(useGSAP);
|
|
12
|
-
export function ResetPasswordPage({ logo, title = 'Reset Password', subtitle = 'Enter your new password below.', token, resetPasswordAction, onBackToLogin, backToLoginHref, showBackground = true, className, passwordPolicy }) {
|
|
13
|
+
export function ResetPasswordPage({ labels, logo, title = 'Reset Password', subtitle = 'Enter your new password below.', token, resetPasswordAction, onBackToLogin, backToLoginHref, showBackground = true, className, passwordPolicy }) {
|
|
14
|
+
const say = {
|
|
15
|
+
...DEFAULT_RESET_PASSWORD_LABELS,
|
|
16
|
+
...labels
|
|
17
|
+
};
|
|
13
18
|
const theme = resetPasswordPageTheme;
|
|
14
19
|
const containerRef = useRef(null);
|
|
15
20
|
const cardRef = useRef(null);
|
|
@@ -32,7 +37,7 @@ export function ResetPasswordPage({ logo, title = 'Reset Password', subtitle = '
|
|
|
32
37
|
return /*#__PURE__*/ _jsxs("main", {
|
|
33
38
|
ref: containerRef,
|
|
34
39
|
className: cn(theme.container.base, className),
|
|
35
|
-
"aria-label":
|
|
40
|
+
"aria-label": say.pageLabel,
|
|
36
41
|
children: [
|
|
37
42
|
showBackground && /*#__PURE__*/ _jsx(AbstractAnimatedBackground, {}),
|
|
38
43
|
/*#__PURE__*/ _jsx("div", {
|
|
@@ -47,6 +52,7 @@ export function ResetPasswordPage({ logo, title = 'Reset Password', subtitle = '
|
|
|
47
52
|
subtitle: subtitle
|
|
48
53
|
}),
|
|
49
54
|
/*#__PURE__*/ _jsx(ResetPasswordForm, {
|
|
55
|
+
labels: labels,
|
|
50
56
|
token: token,
|
|
51
57
|
resetPasswordAction: resetPasswordAction,
|
|
52
58
|
onBackToLogin: onBackToLogin,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { ResetPasswordForm } from './components/ResetPasswordForm';
|
|
2
2
|
export { ResetPasswordHeader } from './components/ResetPasswordHeader';
|
|
3
3
|
export { ResetPasswordPage } from './components/ResetPasswordPage';
|
|
4
|
+
export { DEFAULT_RESET_PASSWORD_LABELS, type ResetPasswordLabels } from './labels';
|
|
4
5
|
export { useResetPasswordStore } from './store';
|
|
5
6
|
export { extendResetPasswordPageTheme, type ResetPasswordPageTheme, resetPasswordPageTheme, } from './theme';
|
|
6
7
|
export type { ResetPasswordAction, ResetPasswordFormProps, ResetPasswordHeaderProps, ResetPasswordPageConfig, ResetPasswordStep, } from './types';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { ResetPasswordForm } from './components/ResetPasswordForm';
|
|
2
2
|
export { ResetPasswordHeader } from './components/ResetPasswordHeader';
|
|
3
3
|
export { ResetPasswordPage } from './components/ResetPasswordPage';
|
|
4
|
+
export { DEFAULT_RESET_PASSWORD_LABELS } from './labels';
|
|
4
5
|
export { useResetPasswordStore } from './store';
|
|
5
6
|
export { extendResetPasswordPageTheme, resetPasswordPageTheme } from './theme';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every word this page says, so a portal can say them in its own language.
|
|
3
|
+
*
|
|
4
|
+
* Defaults stay English, so nothing that does not pass labels changes.
|
|
5
|
+
*/
|
|
6
|
+
export type ResetPasswordLabels = {
|
|
7
|
+
newPassword: string;
|
|
8
|
+
confirmPassword: string;
|
|
9
|
+
passwordRequirements: string;
|
|
10
|
+
success: string;
|
|
11
|
+
backToLogin: string;
|
|
12
|
+
pageLabel: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const DEFAULT_RESET_PASSWORD_LABELS: ResetPasswordLabels;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every word this page says, so a portal can say them in its own language.
|
|
3
|
+
*
|
|
4
|
+
* Defaults stay English, so nothing that does not pass labels changes.
|
|
5
|
+
*/ export const DEFAULT_RESET_PASSWORD_LABELS = {
|
|
6
|
+
newPassword: 'New Password',
|
|
7
|
+
confirmPassword: 'Confirm Password',
|
|
8
|
+
passwordRequirements: 'Password requirements:',
|
|
9
|
+
success: 'Password Reset Successful',
|
|
10
|
+
backToLogin: 'Back to login',
|
|
11
|
+
pageLabel: 'Reset password page'
|
|
12
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { PasswordPolicy } from '../../SetPasswordPage/types';
|
|
3
|
+
import type { ResetPasswordLabels } from '../labels';
|
|
3
4
|
export type ResetPasswordStep = 'form' | 'success';
|
|
4
5
|
export type ResetPasswordAction<TData = unknown, TError = unknown> = {
|
|
5
6
|
start: (config: {
|
|
@@ -20,6 +21,8 @@ export type ResetPasswordAction<TData = unknown, TError = unknown> = {
|
|
|
20
21
|
export interface ResetPasswordPageConfig {
|
|
21
22
|
title?: string;
|
|
22
23
|
subtitle?: string;
|
|
24
|
+
/** Every word the page says, so a portal can say them in its own language. */
|
|
25
|
+
labels?: Partial<ResetPasswordLabels>;
|
|
23
26
|
logo?: ReactNode;
|
|
24
27
|
token: string;
|
|
25
28
|
resetPasswordAction: ResetPasswordAction;
|
|
@@ -30,6 +33,7 @@ export interface ResetPasswordPageConfig {
|
|
|
30
33
|
passwordPolicy?: PasswordPolicy;
|
|
31
34
|
}
|
|
32
35
|
export interface ResetPasswordFormProps {
|
|
36
|
+
labels?: Partial<ResetPasswordLabels>;
|
|
33
37
|
token: string;
|
|
34
38
|
resetPasswordAction: ResetPasswordAction;
|
|
35
39
|
onBackToLogin?: () => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { type SetPasswordLabels } from '../labels';
|
|
2
1
|
import type { ReactElement } from 'react';
|
|
3
|
-
|
|
2
|
+
import { type SetPasswordFormProps } from '../types';
|
|
3
|
+
export declare function SetPasswordForm({ labels, passwordChangeAction, passwordSetAction, isInvite, onSuccess, onBackToLogin, backToLoginHref, passwordPolicy, }: SetPasswordFormProps): ReactElement;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { NucleusTextInput } from '../../NucleusTextInput';
|
|
4
|
+
import { DEFAULT_SET_PASSWORD_LABELS } from '../labels';
|
|
5
|
+
import { useSetPasswordStore } from '../store';
|
|
6
|
+
import { setPasswordPageTheme } from '../theme';
|
|
7
|
+
import { DEFAULT_PASSWORD_POLICY } from '../types';
|
|
8
|
+
export function SetPasswordForm({ labels, passwordChangeAction, passwordSetAction, isInvite = false, onSuccess, onBackToLogin, backToLoginHref, passwordPolicy = {} }) {
|
|
9
|
+
const say = {
|
|
10
|
+
...DEFAULT_SET_PASSWORD_LABELS,
|
|
11
|
+
...labels
|
|
12
|
+
};
|
|
13
|
+
const theme = setPasswordPageTheme;
|
|
14
|
+
const store = useSetPasswordStore();
|
|
15
|
+
const policy = {
|
|
16
|
+
...DEFAULT_PASSWORD_POLICY,
|
|
17
|
+
...passwordPolicy
|
|
18
|
+
};
|
|
19
|
+
const activeAction = isInvite && passwordSetAction ? passwordSetAction : passwordChangeAction;
|
|
20
|
+
const validateForm = ()=>{
|
|
21
|
+
if (!store.newPassword) {
|
|
22
|
+
return 'Password is required';
|
|
23
|
+
}
|
|
24
|
+
if (store.newPassword.length < policy.minLength) {
|
|
25
|
+
return `Password must be at least ${policy.minLength} characters`;
|
|
26
|
+
}
|
|
27
|
+
if (policy.maxLength && store.newPassword.length > policy.maxLength) {
|
|
28
|
+
return `Password must be at most ${policy.maxLength} characters`;
|
|
29
|
+
}
|
|
30
|
+
if (policy.requireUppercase && !/[A-Z]/.test(store.newPassword)) {
|
|
31
|
+
return 'Password must contain at least one uppercase letter';
|
|
32
|
+
}
|
|
33
|
+
if (policy.requireLowercase && !/[a-z]/.test(store.newPassword)) {
|
|
34
|
+
return 'Password must contain at least one lowercase letter';
|
|
35
|
+
}
|
|
36
|
+
if (policy.requireNumber && !/[0-9]/.test(store.newPassword)) {
|
|
37
|
+
return 'Password must contain at least one number';
|
|
38
|
+
}
|
|
39
|
+
if (policy.requireSpecialChar) {
|
|
40
|
+
const specialCharsRegex = new RegExp(`[${policy.specialChars.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')}]`);
|
|
41
|
+
if (!specialCharsRegex.test(store.newPassword)) {
|
|
42
|
+
return 'Password must contain at least one special character';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (!store.confirmPassword) {
|
|
46
|
+
return 'Please confirm your password';
|
|
47
|
+
}
|
|
48
|
+
if (store.newPassword !== store.confirmPassword) {
|
|
49
|
+
return 'Passwords do not match';
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
};
|
|
53
|
+
const handleSubmit = (e)=>{
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
const validationError = validateForm();
|
|
56
|
+
if (validationError) {
|
|
57
|
+
store.setError(validationError);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
store.setError(null);
|
|
61
|
+
if (!activeAction) {
|
|
62
|
+
store.setError('No action configured');
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const onAfterHandle = ()=>{
|
|
66
|
+
store.setStep('success');
|
|
67
|
+
if (onSuccess) {
|
|
68
|
+
setTimeout(onSuccess, 2000);
|
|
69
|
+
} else if (onBackToLogin) {
|
|
70
|
+
setTimeout(onBackToLogin, 2000);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const onErrorHandle = (error)=>{
|
|
74
|
+
store.setError(error?.message || 'Failed to set password');
|
|
75
|
+
};
|
|
76
|
+
if (isInvite && passwordSetAction && store.userId) {
|
|
77
|
+
passwordSetAction.start({
|
|
78
|
+
payload: {
|
|
79
|
+
newPassword: store.newPassword,
|
|
80
|
+
userId: store.userId
|
|
81
|
+
},
|
|
82
|
+
onAfterHandle,
|
|
83
|
+
onErrorHandle
|
|
84
|
+
});
|
|
85
|
+
} else if (passwordChangeAction) {
|
|
86
|
+
passwordChangeAction.start({
|
|
87
|
+
payload: {
|
|
88
|
+
currentPassword: '',
|
|
89
|
+
newPassword: store.newPassword,
|
|
90
|
+
confirmPassword: store.confirmPassword
|
|
91
|
+
},
|
|
92
|
+
onAfterHandle,
|
|
93
|
+
onErrorHandle
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
return /*#__PURE__*/ _jsxs("form", {
|
|
98
|
+
onSubmit: handleSubmit,
|
|
99
|
+
className: theme.form.wrapper,
|
|
100
|
+
children: [
|
|
101
|
+
store.error && /*#__PURE__*/ _jsx("div", {
|
|
102
|
+
className: theme.alert.error,
|
|
103
|
+
role: "alert",
|
|
104
|
+
children: store.error
|
|
105
|
+
}),
|
|
106
|
+
/*#__PURE__*/ _jsx(NucleusTextInput, {
|
|
107
|
+
type: "password",
|
|
108
|
+
label: "New Password",
|
|
109
|
+
value: store.newPassword,
|
|
110
|
+
onChange: (val)=>store.setNewPassword(val, policy.minLength),
|
|
111
|
+
placeholder: say.newPasswordPlaceholder,
|
|
112
|
+
isNewPassword: true,
|
|
113
|
+
showPasswordStrength: policy.showStrengthIndicator,
|
|
114
|
+
maxInputLength: policy.maxLength,
|
|
115
|
+
enableValidation: false
|
|
116
|
+
}),
|
|
117
|
+
/*#__PURE__*/ _jsx(NucleusTextInput, {
|
|
118
|
+
type: "password",
|
|
119
|
+
label: "Confirm Password",
|
|
120
|
+
value: store.confirmPassword,
|
|
121
|
+
onChange: store.setConfirmPassword,
|
|
122
|
+
placeholder: say.confirmPasswordPlaceholder,
|
|
123
|
+
isNewPassword: true,
|
|
124
|
+
confirmValue: store.newPassword,
|
|
125
|
+
enableValidation: false
|
|
126
|
+
}),
|
|
127
|
+
/*#__PURE__*/ _jsx("button", {
|
|
128
|
+
type: "submit",
|
|
129
|
+
disabled: activeAction?.state.isPending,
|
|
130
|
+
className: theme.form.submitButton,
|
|
131
|
+
children: activeAction?.state.isPending ? 'Setting Password...' : 'Set Password'
|
|
132
|
+
}),
|
|
133
|
+
/*#__PURE__*/ _jsx("div", {
|
|
134
|
+
className: theme.form.backLink,
|
|
135
|
+
children: backToLoginHref ? /*#__PURE__*/ _jsx("a", {
|
|
136
|
+
href: backToLoginHref,
|
|
137
|
+
className: theme.form.backLinkText,
|
|
138
|
+
children: "Back to login"
|
|
139
|
+
}) : onBackToLogin ? /*#__PURE__*/ _jsx("button", {
|
|
140
|
+
type: "button",
|
|
141
|
+
onClick: onBackToLogin,
|
|
142
|
+
className: theme.form.backLinkText,
|
|
143
|
+
children: "Back to login"
|
|
144
|
+
}) : null
|
|
145
|
+
})
|
|
146
|
+
]
|
|
147
|
+
});
|
|
148
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { DEFAULT_SET_PASSWORD_LABELS } from '../labels';
|
|
3
1
|
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
3
|
import { useGSAP } from '@gsap/react';
|
|
5
4
|
import gsap from 'gsap';
|
|
6
5
|
import { useEffect, useEffectEvent, useRef } from 'react';
|
|
7
6
|
import { cn } from '../../../utils/cn';
|
|
8
7
|
import { AbstractAnimatedBackground } from '../../AbstractAnimatedBackground';
|
|
8
|
+
import { DEFAULT_SET_PASSWORD_LABELS } from '../labels';
|
|
9
9
|
import { useSetPasswordStore } from '../store';
|
|
10
10
|
import { setPasswordPageTheme } from '../theme';
|
|
11
11
|
import { SetPasswordForm } from './SetPasswordForm';
|
package/dist/fe/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export { ComponentCanvas, ComponentSidebar, createDefaultRegistry, DesignSystemP
|
|
|
18
18
|
export type { DeviceCardProps, DeviceInfo, DevicesHeaderProps, DevicesPageConfig, DevicesPageProps, DevicesPageVariant, DevicesState, DevicesStatsProps, SessionRevokeAction, SessionRevokeAllAction, SessionsAction, } from './components/DevicesPage';
|
|
19
19
|
export { DeviceCard, DevicesHeader, DevicesPage, useDevicesStore, } from './components/DevicesPage';
|
|
20
20
|
export type { ForgotPasswordAction, ForgotPasswordFormProps, ForgotPasswordHeaderProps, ForgotPasswordPageConfig, ForgotPasswordStep, } from './components/ForgotPasswordPage';
|
|
21
|
-
export { ForgotPasswordPage, useForgotPasswordStore, } from './components/ForgotPasswordPage';
|
|
21
|
+
export { DEFAULT_FORGOT_PASSWORD_LABELS, ForgotPasswordPage, useForgotPasswordStore, } from './components/ForgotPasswordPage';
|
|
22
22
|
export type { FormBuilderProps, FormFieldConfig, FormFieldProps, FormFieldRenderProps, FormFooterRenderProps, FormLayout, FormMode, FormSize, FormState, UseFormBuilderOptions, UseFormBuilderReturn, } from './components/FormBuilder';
|
|
23
23
|
export { FormBuilder, FormField, formBuilderTheme, useFormBuilder, } from './components/FormBuilder';
|
|
24
24
|
export { defaultIntegrationsLabels, extendIntegrationsTheme, IntegrationsPage, integrationsPageTheme, resolveIntegrationsLabels, useIntegrationsStore, } from './components/IntegrationsPage';
|
|
@@ -40,7 +40,7 @@ export { RangePicker } from './components/RangePicker';
|
|
|
40
40
|
export type { PasswordStrength, RegisterAction, RegisterFormData, RegisterFormProps, RegisterHeaderProps, RegisterPageConfig, RegisterPageProps, RegisterPageVariant, RegisterState, } from './components/RegisterPage';
|
|
41
41
|
export { PasswordStrengthIndicator, RegisterPage, useRegisterStore, } from './components/RegisterPage';
|
|
42
42
|
export type { ResetPasswordAction, ResetPasswordFormProps, ResetPasswordHeaderProps, ResetPasswordPageConfig, ResetPasswordStep, } from './components/ResetPasswordPage';
|
|
43
|
-
export { ResetPasswordPage, useResetPasswordStore, } from './components/ResetPasswordPage';
|
|
43
|
+
export { DEFAULT_RESET_PASSWORD_LABELS, ResetPasswordPage, useResetPasswordStore, } from './components/ResetPasswordPage';
|
|
44
44
|
export { SearchBox } from './components/SearchBox';
|
|
45
45
|
export { SelectBox } from './components/SelectBox';
|
|
46
46
|
export type { MagicLinkVerifyAction, PasswordChangeAction, PasswordPolicy, PasswordSetAction, SetPasswordFormProps, SetPasswordHeaderProps, SetPasswordLabels, SetPasswordPageConfig, SetPasswordStep, } from './components/SetPasswordPage';
|
package/dist/fe/index.js
CHANGED
|
@@ -13,7 +13,7 @@ export { DataTable } from './components/DataTable';
|
|
|
13
13
|
export { DatePicker } from './components/DatePicker';
|
|
14
14
|
export { ComponentCanvas, ComponentSidebar, createDefaultRegistry, DesignSystemPage, designSystemTheme, extendDesignSystemTheme, PropsPanel, useDesignSystemStore } from './components/DesignSystem';
|
|
15
15
|
export { DeviceCard, DevicesHeader, DevicesPage, useDevicesStore } from './components/DevicesPage';
|
|
16
|
-
export { ForgotPasswordPage, useForgotPasswordStore } from './components/ForgotPasswordPage';
|
|
16
|
+
export { DEFAULT_FORGOT_PASSWORD_LABELS, ForgotPasswordPage, useForgotPasswordStore } from './components/ForgotPasswordPage';
|
|
17
17
|
export { FormBuilder, FormField, formBuilderTheme, useFormBuilder } from './components/FormBuilder';
|
|
18
18
|
export { defaultIntegrationsLabels, extendIntegrationsTheme, IntegrationsPage, integrationsPageTheme, resolveIntegrationsLabels, useIntegrationsStore } from './components/IntegrationsPage';
|
|
19
19
|
export { LoginPage, useLoginStore } from './components/LoginPage';
|
|
@@ -24,7 +24,7 @@ export { NucleusTextInput } from './components/NucleusTextInput';
|
|
|
24
24
|
export { AddressCard, PhoneCard, ProfileHeader, ProfilePage, useProfileStore } from './components/ProfilePage';
|
|
25
25
|
export { RangePicker } from './components/RangePicker';
|
|
26
26
|
export { PasswordStrengthIndicator, RegisterPage, useRegisterStore } from './components/RegisterPage';
|
|
27
|
-
export { ResetPasswordPage, useResetPasswordStore } from './components/ResetPasswordPage';
|
|
27
|
+
export { DEFAULT_RESET_PASSWORD_LABELS, ResetPasswordPage, useResetPasswordStore } from './components/ResetPasswordPage';
|
|
28
28
|
export { SearchBox } from './components/SearchBox';
|
|
29
29
|
export { SelectBox } from './components/SelectBox';
|
|
30
30
|
export { DEFAULT_PASSWORD_POLICY, DEFAULT_SET_PASSWORD_LABELS, SetPasswordPage, useSetPasswordStore } from './components/SetPasswordPage';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nucleus-core-ts",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.883",
|
|
4
4
|
"description": "Production-ready, enterprise-grade TypeScript framework for building multi-tenant APIs",
|
|
5
5
|
"author": "Hidayet Can Özcan <hidayetcan@gmail.com>",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
package/scripts/build.ts
CHANGED
|
@@ -249,7 +249,50 @@ async function verifyPackageShape() {
|
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
|
|
252
|
+
/*
|
|
253
|
+
* A declaration with no JavaScript beside it.
|
|
254
|
+
*
|
|
255
|
+
* `SetPasswordForm.d.ts` shipped without `SetPasswordForm.js`: a stray
|
|
256
|
+
* character above the `'use client'` directive made swc skip the file, and
|
|
257
|
+
* nothing here noticed — the package published, the types resolved, and the
|
|
258
|
+
* customer's Next build was the thing that failed, with
|
|
259
|
+
* "Can't resolve './SetPasswordForm'". The types are emitted by tsc and the
|
|
260
|
+
* code by swc, so one can silently go missing while the other does not, and
|
|
261
|
+
* that gap is exactly what a consumer trips over.
|
|
262
|
+
*/
|
|
263
|
+
const declarations: string[] = []
|
|
264
|
+
const walkTypes = async (dir: string) => {
|
|
265
|
+
for (const entry of await readdir(dir, { withFileTypes: true })) {
|
|
266
|
+
const full = join(dir, entry.name)
|
|
267
|
+
if (entry.isDirectory()) await walkTypes(full)
|
|
268
|
+
else if (entry.name.endsWith('.d.ts')) declarations.push(full)
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/*
|
|
273
|
+
* Only the TRANSPILED trees, where a module is emitted one-for-one.
|
|
274
|
+
*
|
|
275
|
+
* `src/` is bundled into `dist/index.js`, so its declarations legitimately
|
|
276
|
+
* have no file of their own beside them, and `bin/` ships as TypeScript. The
|
|
277
|
+
* frontend is the one that maps file to file, and it is where the consumer's
|
|
278
|
+
* import resolves to a path rather than to a bundle.
|
|
279
|
+
*/
|
|
280
|
+
const oneForOne = ['fe', ...(config.transpileDirs || []).map((d) => d.replace('./', ''))]
|
|
281
|
+
for (const dir of new Set(oneForOne)) {
|
|
282
|
+
const full = join(config.build.outDir, dir)
|
|
283
|
+
if (await Bun.file(join(full, 'index.js')).exists()) await walkTypes(full)
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const emitted = new Set(shipped)
|
|
287
|
+
const orphans = declarations
|
|
288
|
+
.map((file) => file.replace(/\.d\.ts$/, '.js'))
|
|
289
|
+
.filter((expected) => !emitted.has(expected))
|
|
290
|
+
if (orphans.length > 0) {
|
|
291
|
+
log.error(`${orphans.length} declaration(s) shipped with no JavaScript, e.g. ${orphans[0]}`)
|
|
292
|
+
throw new Error('a module was typed but never emitted — the consumer cannot import it')
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
log.success(`Package shape verified (${shipped.length} files, no tests, no orphan types)`)
|
|
253
296
|
}
|
|
254
297
|
|
|
255
298
|
async function getJsFiles(dir: string): Promise<string[]> {
|