@humain/ui 2.1.62 → 2.1.65

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.
Files changed (160) hide show
  1. package/dist/components/organisms/ai/AIToolCall/AIToolCall.d.ts +9 -3
  2. package/dist/components/organisms/ai/AIToolRun/index.d.ts +1 -1
  3. package/dist/components/organisms/ai/AIToolRun/validation.d.ts +24 -3
  4. package/dist/components/organisms/ai/_shared/format-ai-duration.d.ts +1 -0
  5. package/dist/components/organisms/ai/_shared/workflow-step-renderer.d.ts +1 -0
  6. package/dist/index.js +52 -52
  7. package/dist/index151.js +1 -1
  8. package/dist/index174.js +10 -333
  9. package/dist/index174.js.map +1 -1
  10. package/dist/index175.js +310 -137
  11. package/dist/index175.js.map +1 -1
  12. package/dist/index176.js +148 -174
  13. package/dist/index176.js.map +1 -1
  14. package/dist/index177.js +186 -78
  15. package/dist/index177.js.map +1 -1
  16. package/dist/index178.js +74 -124
  17. package/dist/index178.js.map +1 -1
  18. package/dist/index179.js +133 -1
  19. package/dist/index179.js.map +1 -0
  20. package/dist/index180.js +2 -201
  21. package/dist/index181.js +201 -0
  22. package/dist/{index180.js.map → index181.js.map} +1 -1
  23. package/dist/index183.js +130 -166
  24. package/dist/index183.js.map +1 -1
  25. package/dist/index184.js +195 -983
  26. package/dist/index184.js.map +1 -1
  27. package/dist/index185.js +1069 -369
  28. package/dist/index185.js.map +1 -1
  29. package/dist/index186.js +395 -197
  30. package/dist/index186.js.map +1 -1
  31. package/dist/index187.js +198 -243
  32. package/dist/index187.js.map +1 -1
  33. package/dist/index188.js +263 -3
  34. package/dist/index188.js.map +1 -1
  35. package/dist/index189.js +3 -209
  36. package/dist/index189.js.map +1 -1
  37. package/dist/index190.js +190 -777
  38. package/dist/index190.js.map +1 -1
  39. package/dist/index191.js +771 -252
  40. package/dist/index191.js.map +1 -1
  41. package/dist/index192.js +250 -65
  42. package/dist/index192.js.map +1 -1
  43. package/dist/index193.js +72 -523
  44. package/dist/index193.js.map +1 -1
  45. package/dist/index194.js +537 -144
  46. package/dist/index194.js.map +1 -1
  47. package/dist/index195.js +139 -720
  48. package/dist/index195.js.map +1 -1
  49. package/dist/index196.js +707 -167
  50. package/dist/index196.js.map +1 -1
  51. package/dist/index197.js +175 -151
  52. package/dist/index197.js.map +1 -1
  53. package/dist/index198.js +152 -487
  54. package/dist/index198.js.map +1 -1
  55. package/dist/index199.js +472 -225
  56. package/dist/index199.js.map +1 -1
  57. package/dist/index200.js +236 -260
  58. package/dist/index200.js.map +1 -1
  59. package/dist/index201.js +265 -215
  60. package/dist/index201.js.map +1 -1
  61. package/dist/index202.js +207 -307
  62. package/dist/index202.js.map +1 -1
  63. package/dist/index203.js +302 -135
  64. package/dist/index203.js.map +1 -1
  65. package/dist/index204.js +140 -271
  66. package/dist/index204.js.map +1 -1
  67. package/dist/index205.js +263 -253
  68. package/dist/index205.js.map +1 -1
  69. package/dist/index206.js +244 -137
  70. package/dist/index206.js.map +1 -1
  71. package/dist/index207.js +100 -238
  72. package/dist/index207.js.map +1 -1
  73. package/dist/index208.js +278 -74
  74. package/dist/index208.js.map +1 -1
  75. package/dist/index209.js +56 -97
  76. package/dist/index209.js.map +1 -1
  77. package/dist/index210.js +142 -47
  78. package/dist/index210.js.map +1 -1
  79. package/dist/index211.js +38 -84
  80. package/dist/index211.js.map +1 -1
  81. package/dist/index212.js +72 -252
  82. package/dist/index212.js.map +1 -1
  83. package/dist/index213.js +274 -26
  84. package/dist/index213.js.map +1 -1
  85. package/dist/index214.js +29 -94
  86. package/dist/index214.js.map +1 -1
  87. package/dist/index215.js +98 -25
  88. package/dist/index215.js.map +1 -1
  89. package/dist/index216.js +20 -565
  90. package/dist/index216.js.map +1 -1
  91. package/dist/index217.js +564 -17
  92. package/dist/index217.js.map +1 -1
  93. package/dist/index218.js +20 -23
  94. package/dist/index218.js.map +1 -1
  95. package/dist/index219.js +20 -95
  96. package/dist/index219.js.map +1 -1
  97. package/dist/index220.js +92 -88
  98. package/dist/index220.js.map +1 -1
  99. package/dist/index221.js +97 -29
  100. package/dist/index221.js.map +1 -1
  101. package/dist/index222.js +24 -470
  102. package/dist/index222.js.map +1 -1
  103. package/dist/index223.js +446 -196
  104. package/dist/index223.js.map +1 -1
  105. package/dist/index224.js +199 -729
  106. package/dist/index224.js.map +1 -1
  107. package/dist/index225.js +750 -61
  108. package/dist/index225.js.map +1 -1
  109. package/dist/index226.js +58 -181
  110. package/dist/index226.js.map +1 -1
  111. package/dist/index227.js +175 -259
  112. package/dist/index227.js.map +1 -1
  113. package/dist/index228.js +246 -172
  114. package/dist/index228.js.map +1 -1
  115. package/dist/index229.js +195 -32
  116. package/dist/index229.js.map +1 -1
  117. package/dist/index230.js +12 -40
  118. package/dist/index230.js.map +1 -1
  119. package/dist/index231.js +23 -26
  120. package/dist/index231.js.map +1 -1
  121. package/dist/index232.js +45 -22
  122. package/dist/index232.js.map +1 -1
  123. package/dist/index233.js +27 -48
  124. package/dist/index233.js.map +1 -1
  125. package/dist/index234.js +52 -26
  126. package/dist/index234.js.map +1 -1
  127. package/dist/index235.js +40 -225
  128. package/dist/index235.js.map +1 -1
  129. package/dist/index236.js +217 -39
  130. package/dist/index236.js.map +1 -1
  131. package/dist/index237.js +50 -0
  132. package/dist/index237.js.map +1 -0
  133. package/dist/styles.css +1 -1
  134. package/dist/wc/AIToolCall.js +218 -0
  135. package/dist/wc/AIToolCall.js.map +1 -0
  136. package/dist/wc/hf-ai-tool-call.js +34 -219
  137. package/dist/wc/hf-ai-tool-call.js.map +1 -1
  138. package/dist/wc/hf-ai-tool-run.js +673 -576
  139. package/dist/wc/hf-ai-tool-run.js.map +1 -1
  140. package/dist/wc/workflow-step-renderer.js +94 -86
  141. package/dist/wc/workflow-step-renderer.js.map +1 -1
  142. package/dist/wc-react/AIToolCall.js +218 -0
  143. package/dist/wc-react/AIToolCall.js.map +1 -0
  144. package/dist/wc-react/hf-ai-tool-call.js +32 -217
  145. package/dist/wc-react/hf-ai-tool-call.js.map +1 -1
  146. package/dist/wc-react/hf-ai-tool-run.js +698 -601
  147. package/dist/wc-react/hf-ai-tool-run.js.map +1 -1
  148. package/dist/wc-react/workflow-step-renderer.js +76 -68
  149. package/dist/wc-react/workflow-step-renderer.js.map +1 -1
  150. package/package.json +1 -1
  151. package/skills/humain-ui/SKILL.md +1 -1
  152. package/skills/humain-ui-wc/SKILL.md +1 -1
  153. package/skills/humain-ui-wc.skill +0 -0
  154. package/skills/humain-ui.skill +0 -0
  155. package/dist/index182.js +0 -143
  156. package/dist/index182.js.map +0 -1
  157. package/dist/wc/wrench.js +0 -10
  158. package/dist/wc/wrench.js.map +0 -1
  159. package/dist/wc-react/wrench.js +0 -10
  160. package/dist/wc-react/wrench.js.map +0 -1
package/dist/index229.js CHANGED
@@ -1,40 +1,203 @@
1
1
  "use client";
2
+ import { cn } from "./index2.js";
3
+ import { Button } from "./index5.js";
2
4
  import { Input } from "./index33.js";
3
- import { AuthPageLayout } from "./index226.js";
4
- import { AuthForm, AuthGhostAction, AuthPrimaryButton, defaultForgotPasswordAside } from "./index228.js";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
- //#region src/components/pages/ForgotPasswordPage/ForgotPasswordPage.tsx
7
- function ForgotPasswordPage({ title = "Forgot Password?", description = "No worries, we'll send you reset instructions.", aside = defaultForgotPasswordAside, emailInputProps, loginAction = { label: "Back to login" }, submitLabel = "Send Reset Link", isSubmitting, onSubmit, ...layoutProps }) {
8
- return /* @__PURE__ */ jsx(AuthPageLayout, {
9
- title,
10
- description,
11
- aside,
12
- ...layoutProps,
13
- "data-slot": "auth-page-layout",
14
- "data-page-slot": "forgot-password-page",
15
- children: /* @__PURE__ */ jsxs(AuthForm, {
16
- onSubmit,
17
- children: [
18
- /* @__PURE__ */ jsx(Input, {
19
- autoComplete: "email",
20
- label: "Email",
21
- name: "email",
22
- placeholder: "Enter your email address",
23
- required: true,
24
- type: "email",
25
- ...emailInputProps
26
- }),
27
- /* @__PURE__ */ jsx(AuthPrimaryButton, {
28
- loading: isSubmitting,
29
- children: submitLabel
30
- }),
31
- /* @__PURE__ */ jsx(AuthGhostAction, { action: loginAction })
32
- ]
5
+ import { Separator } from "./index51.js";
6
+ import { renderActionElement } from "./index227.js";
7
+ import { Eye, EyeOff } from "lucide-react";
8
+ import * as React from "react";
9
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
+ //#region src/components/pages/_auth/auth-page-utils.tsx
11
+ function AuthForm({ children, className, ...props }) {
12
+ return /* @__PURE__ */ jsx("form", {
13
+ className: cn("flex flex-col gap-4", className),
14
+ ...props,
15
+ children
16
+ });
17
+ }
18
+ function AuthPasswordInput({ endIcon, visibilityLabel = "password", ...props }) {
19
+ const [isVisible, setIsVisible] = React.useState(false);
20
+ const label = `${isVisible ? "Hide" : "Show"} ${visibilityLabel}`;
21
+ const toggle = /* @__PURE__ */ jsx("button", {
22
+ type: "button",
23
+ "aria-label": label,
24
+ "aria-pressed": isVisible,
25
+ title: label,
26
+ onClick: () => setIsVisible((value) => !value),
27
+ className: "pointer-events-auto inline-flex size-5 items-center justify-center rounded-sm text-text-quaternary transition-colors duration-150 ease-smooth hover:text-secondary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
28
+ children: /* @__PURE__ */ jsx(isVisible ? EyeOff : Eye, {
29
+ "aria-hidden": true,
30
+ className: "size-4"
31
+ })
32
+ });
33
+ return /* @__PURE__ */ jsx(Input, {
34
+ ...props,
35
+ type: isVisible ? "text" : "password",
36
+ endIcon: endIcon ? /* @__PURE__ */ jsxs("span", {
37
+ className: "pointer-events-auto inline-flex items-center gap-2",
38
+ children: [endIcon, toggle]
39
+ }) : toggle
40
+ });
41
+ }
42
+ function AuthPrimaryButton({ children, loading }) {
43
+ return /* @__PURE__ */ jsx(Button, {
44
+ appearance: "solid",
45
+ loading,
46
+ shape: "rounded",
47
+ size: "md",
48
+ type: "submit",
49
+ className: "w-full",
50
+ children
51
+ });
52
+ }
53
+ function getNonNativeActionProps({ disabled: _disabled, ref: _ref, role: _role, tabIndex: _tabIndex, type: _type, ...props }) {
54
+ return props;
55
+ }
56
+ function renderActionLink(href) {
57
+ return function renderLinkAction(props) {
58
+ return /* @__PURE__ */ jsx("a", {
59
+ ...getNonNativeActionProps(props),
60
+ href
61
+ });
62
+ };
63
+ }
64
+ function renderCustomActionElement(action) {
65
+ return function renderCustomAction(buttonProps) {
66
+ const props = getNonNativeActionProps(buttonProps);
67
+ if (!action.render) return /* @__PURE__ */ jsx("button", {
68
+ type: "button",
69
+ ...props
70
+ });
71
+ return React.cloneElement(action.render, {
72
+ ...props,
73
+ className: cn(props.className, action.render.props.className),
74
+ onClick: action.onClick ?? action.render.props.onClick ?? props.onClick,
75
+ children: action.render.props.children ?? props.children ?? action.label
76
+ });
77
+ };
78
+ }
79
+ function renderActionButton(action) {
80
+ if (action.render) return renderCustomActionElement(action);
81
+ if (action.href) return renderActionLink(action.href);
82
+ return /* @__PURE__ */ jsx("button", {
83
+ type: "button",
84
+ children: action.label
85
+ });
86
+ }
87
+ function getPrimaryActionButtonType(action, isPolymorphic) {
88
+ if (isPolymorphic) return;
89
+ if (action.onClick) return "button";
90
+ return "submit";
91
+ }
92
+ function AuthPrimaryActionButton({ action, loading }) {
93
+ const isPolymorphic = !!(action.href || action.render);
94
+ return /* @__PURE__ */ jsx(Button, {
95
+ appearance: "solid",
96
+ loading: !isPolymorphic ? loading : void 0,
97
+ nativeButton: isPolymorphic ? false : void 0,
98
+ render: isPolymorphic ? renderActionButton(action) : void 0,
99
+ shape: "rounded",
100
+ size: "md",
101
+ type: getPrimaryActionButtonType(action, isPolymorphic),
102
+ onClick: action.onClick,
103
+ className: "w-full",
104
+ children: action.label
105
+ });
106
+ }
107
+ function AuthGhostAction({ action }) {
108
+ const isPolymorphic = !!(action.href || action.render);
109
+ return /* @__PURE__ */ jsx(Button, {
110
+ appearance: "ghost",
111
+ nativeButton: isPolymorphic ? false : void 0,
112
+ render: renderActionButton(action),
113
+ shape: "rounded",
114
+ size: "md",
115
+ type: isPolymorphic ? void 0 : "button",
116
+ onClick: action.onClick,
117
+ className: "w-full",
118
+ children: action.label
119
+ });
120
+ }
121
+ function AuthInlineAction({ prefix, action }) {
122
+ return /* @__PURE__ */ jsxs("p", {
123
+ className: "text-center text-md leading-normal text-secondary-foreground",
124
+ children: [/* @__PURE__ */ jsxs("span", { children: [prefix, " "] }), renderActionElement(action, "font-medium text-foreground transition-colors duration-150 ease-smooth hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background")]
125
+ });
126
+ }
127
+ function AuthSocialDivider({ label }) {
128
+ return /* @__PURE__ */ jsxs("div", {
129
+ className: "flex items-center gap-4",
130
+ children: [
131
+ /* @__PURE__ */ jsx(Separator, { className: "flex-1" }),
132
+ /* @__PURE__ */ jsx("span", {
133
+ className: "shrink-0 text-md text-foreground",
134
+ children: label
135
+ }),
136
+ /* @__PURE__ */ jsx(Separator, { className: "flex-1" })
137
+ ]
138
+ });
139
+ }
140
+ function AuthSsoActions({ actions }) {
141
+ if (!actions?.length) return null;
142
+ return /* @__PURE__ */ jsx("div", {
143
+ className: "flex flex-col gap-3",
144
+ children: actions.map((action, index) => {
145
+ const isPolymorphic = !!(action.href || action.render);
146
+ return /* @__PURE__ */ jsx(Button, {
147
+ appearance: "outline",
148
+ nativeButton: isPolymorphic ? false : void 0,
149
+ render: renderActionButton(action),
150
+ shape: "rounded",
151
+ size: "default",
152
+ type: isPolymorphic ? void 0 : "button",
153
+ onClick: action.onClick,
154
+ className: "w-full",
155
+ children: action.label
156
+ }, `${String(action.label)}-${index}`);
33
157
  })
34
158
  });
35
159
  }
36
- ForgotPasswordPage.displayName = "ForgotPasswordPage";
160
+ var defaultLoginAside = {
161
+ title: /* @__PURE__ */ jsxs(Fragment, { children: [
162
+ "Welcome back!",
163
+ /* @__PURE__ */ jsx("br", {}),
164
+ "Please sign in to your Create Studio account"
165
+ ] }),
166
+ description: "Thank you for registering! Please check your inbox and click the verification link to activate your account.",
167
+ cardTitle: "Please enter your login details",
168
+ cardDescription: "Stay connected with Shadcn Studio Subscribe now for the latest updates and news."
169
+ };
170
+ var defaultRegisterAside = {
171
+ title: "Create your account to get started.",
172
+ description: "Your account will allow you to securely save your progress, customize your preferences, and stay connected across all your devices.",
173
+ cardTitle: "We're excited to have you join our community",
174
+ cardDescription: "Your account will allow you to securely save your progress, customize your preferences."
175
+ };
176
+ var defaultForgotPasswordAside = {
177
+ title: "Don't worry, it happens! Resetting your password is quick and easy.",
178
+ description: "Just enter your registered email address below, and we'll send you a secure link to reset your password. Follow the instructions in the email, and you'll be back in your account in no time!",
179
+ cardTitle: "Follow the instructions",
180
+ cardDescription: "If you don't see the email in your inbox, be sure to check your spam or junk folder."
181
+ };
182
+ var defaultResetPasswordAside = {
183
+ title: "You're just one step away from regaining access to your account.",
184
+ description: "Please create a new password below. Make sure it's strong and secure, combining letters, numbers, and special characters.",
185
+ cardTitle: "Reset Your Password",
186
+ cardDescription: "You're just one step away from regaining access to your account."
187
+ };
188
+ var defaultTwoFactorAside = {
189
+ title: "Enable Two-Factor Authentication (2FA)",
190
+ description: "Enhance the security of your account by enabling Two-Factor Authentication (2FA). With 2FA, you'll add an extra layer of protection.",
191
+ cardTitle: "Keeps your information safe",
192
+ cardDescription: "To get started, choose your preferred verification method and follow the instructions."
193
+ };
194
+ var defaultVerifyEmailAside = {
195
+ title: "Ensure you entered the correct email address",
196
+ description: "Thank you for signing up! To complete your registration and secure your account, we need to verify your email address.",
197
+ cardTitle: "Verify Your Email Address",
198
+ cardDescription: "Verifying your email helps us keep your account secure and ensures you won't miss important updates."
199
+ };
37
200
  //#endregion
38
- export { ForgotPasswordPage };
201
+ export { AuthForm, AuthGhostAction, AuthInlineAction, AuthPasswordInput, AuthPrimaryActionButton, AuthPrimaryButton, AuthSocialDivider, AuthSsoActions, defaultForgotPasswordAside, defaultLoginAside, defaultRegisterAside, defaultResetPasswordAside, defaultTwoFactorAside, defaultVerifyEmailAside };
39
202
 
40
203
  //# sourceMappingURL=index229.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index229.js","names":[],"sources":["../src/components/pages/ForgotPasswordPage/ForgotPasswordPage.tsx"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { Input, type InputProps } from '@/components/atoms/forms/Input';\nimport {\n type AuthPageAction,\n type AuthPageAsideConfig,\n AuthPageLayout,\n type AuthPageLayoutProps,\n} from '@/components/templates/AuthPageLayout';\nimport {\n AuthForm,\n AuthGhostAction,\n AuthPrimaryButton,\n defaultForgotPasswordAside,\n} from '../_auth';\n\nexport interface ForgotPasswordPageProps\n extends Omit<\n AuthPageLayoutProps,\n 'title' | 'description' | 'children' | 'aside' | 'onSubmit'\n > {\n title?: React.ReactNode;\n description?: React.ReactNode;\n aside?: AuthPageAsideConfig | React.ReactNode;\n emailInputProps?: InputProps;\n loginAction?: AuthPageAction;\n submitLabel?: React.ReactNode;\n isSubmitting?: boolean;\n onSubmit?: React.FormEventHandler<HTMLFormElement>;\n}\n\nfunction ForgotPasswordPage({\n title = 'Forgot Password?',\n description = \"No worries, we'll send you reset instructions.\",\n aside = defaultForgotPasswordAside,\n emailInputProps,\n loginAction = { label: 'Back to login' },\n submitLabel = 'Send Reset Link',\n isSubmitting,\n onSubmit,\n ...layoutProps\n}: ForgotPasswordPageProps): React.ReactElement {\n return (\n <AuthPageLayout\n title={title}\n description={description}\n aside={aside}\n {...layoutProps}\n data-slot=\"auth-page-layout\"\n data-page-slot=\"forgot-password-page\"\n >\n <AuthForm onSubmit={onSubmit}>\n <Input\n autoComplete=\"email\"\n label=\"Email\"\n name=\"email\"\n placeholder=\"Enter your email address\"\n required\n type=\"email\"\n {...emailInputProps}\n />\n <AuthPrimaryButton loading={isSubmitting}>\n {submitLabel}\n </AuthPrimaryButton>\n <AuthGhostAction action={loginAction} />\n </AuthForm>\n </AuthPageLayout>\n );\n}\n\nForgotPasswordPage.displayName = 'ForgotPasswordPage';\n\nexport { ForgotPasswordPage };\n"],"mappings":";;;;;;AAgCA,SAAS,mBAAmB,EAC1B,QAAQ,oBACR,cAAc,kDACd,QAAQ,4BACR,iBACA,cAAc,EAAE,OAAO,gBAAgB,GACvC,cAAc,mBACd,cACA,UACA,GAAG,eAC2C;CAC9C,OACE,oBAAC,gBAAD;EACS;EACM;EACN;EACP,GAAI;EACJ,aAAU;EACV,kBAAe;YAEf,qBAAC,UAAD;GAAoB;aAApB;IACE,oBAAC,OAAD;KACE,cAAa;KACb,OAAM;KACN,MAAK;KACL,aAAY;KACZ,UAAA;KACA,MAAK;KACL,GAAI;IACL,CAAA;IACD,oBAAC,mBAAD;KAAmB,SAAS;eACzB;IACgB,CAAA;IACnB,oBAAC,iBAAD,EAAiB,QAAQ,YAAc,CAAA;GAC/B;;CACI,CAAA;AAEpB;AAEA,mBAAmB,cAAc"}
1
+ {"version":3,"file":"index229.js","names":[],"sources":["../src/components/pages/_auth/auth-page-utils.tsx"],"sourcesContent":["'use client';\n\nimport { Eye, EyeOff } from 'lucide-react';\nimport * as React from 'react';\nimport { Button } from '@/components/atoms/buttons/Button';\nimport { Input, type InputProps } from '@/components/atoms/forms/Input';\nimport { Separator } from '@/components/atoms/layout/Separator';\nimport type {\n AuthPageAction,\n AuthPageAsideConfig,\n} from '@/components/templates/AuthPageLayout';\nimport { renderActionElement } from '@/components/templates/AuthPageLayout';\nimport { cn } from '@/lib/utils';\n\nexport interface AuthFormProps\n extends Omit<React.ComponentProps<'form'>, 'children'> {\n children: React.ReactNode;\n}\n\ntype ActionButtonRenderProps = React.ComponentProps<'button'>;\ntype ActionButtonType = React.ComponentProps<'button'>['type'];\ntype ActionButtonRender = (\n props: ActionButtonRenderProps,\n) => React.ReactElement;\ntype ActionRenderTargetProps = Omit<\n ActionButtonRenderProps,\n 'disabled' | 'ref' | 'role' | 'tabIndex' | 'type'\n>;\ntype ActionAnchorProps = Omit<React.ComponentProps<'a'>, 'href'>;\n\ninterface AuthPrimaryButtonProps {\n children: React.ReactNode;\n loading?: boolean;\n}\n\ninterface AuthActionButtonProps {\n action: AuthPageAction;\n loading?: boolean;\n}\n\ninterface AuthActionProps {\n action: AuthPageAction;\n}\n\ninterface AuthInlineActionProps {\n prefix: React.ReactNode;\n action: AuthPageAction;\n}\n\ninterface AuthSocialDividerProps {\n label: React.ReactNode;\n}\n\ninterface AuthSsoActionsProps {\n actions?: AuthPageAction[];\n}\n\ninterface AuthPasswordInputProps extends InputProps {\n visibilityLabel?: string;\n}\n\nexport function AuthForm({\n children,\n className,\n ...props\n}: AuthFormProps): React.ReactElement {\n return (\n <form className={cn('flex flex-col gap-4', className)} {...props}>\n {children}\n </form>\n );\n}\n\nexport function AuthPasswordInput({\n endIcon,\n visibilityLabel = 'password',\n ...props\n}: AuthPasswordInputProps): React.ReactElement {\n const [isVisible, setIsVisible] = React.useState(false);\n const label = `${isVisible ? 'Hide' : 'Show'} ${visibilityLabel}`;\n const VisibilityIcon = isVisible ? EyeOff : Eye;\n const toggle = (\n <button\n type=\"button\"\n aria-label={label}\n aria-pressed={isVisible}\n title={label}\n onClick={() => setIsVisible((value) => !value)}\n className=\"pointer-events-auto inline-flex size-5 items-center justify-center rounded-sm text-text-quaternary transition-colors duration-150 ease-smooth hover:text-secondary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n >\n <VisibilityIcon aria-hidden className=\"size-4\" />\n </button>\n );\n\n return (\n <Input\n {...props}\n type={isVisible ? 'text' : 'password'}\n endIcon={\n endIcon ? (\n <span className=\"pointer-events-auto inline-flex items-center gap-2\">\n {endIcon}\n {toggle}\n </span>\n ) : (\n toggle\n )\n }\n />\n );\n}\n\nexport function AuthPrimaryButton({\n children,\n loading,\n}: AuthPrimaryButtonProps): React.ReactElement {\n return (\n <Button\n appearance=\"solid\"\n loading={loading}\n shape=\"rounded\"\n size=\"md\"\n type=\"submit\"\n className=\"w-full\"\n >\n {children}\n </Button>\n );\n}\n\nfunction getNonNativeActionProps({\n disabled: _disabled,\n ref: _ref,\n role: _role,\n tabIndex: _tabIndex,\n type: _type,\n ...props\n}: ActionButtonRenderProps): ActionRenderTargetProps {\n return props;\n}\n\nfunction renderActionLink(href: string): ActionButtonRender {\n return function renderLinkAction(\n props: ActionButtonRenderProps,\n ): React.ReactElement {\n const anchorProps = getNonNativeActionProps(props) as ActionAnchorProps;\n return <a {...anchorProps} href={href} />;\n };\n}\n\nfunction renderCustomActionElement(action: AuthPageAction): ActionButtonRender {\n return function renderCustomAction(\n buttonProps: ActionButtonRenderProps,\n ): React.ReactElement {\n const props = getNonNativeActionProps(buttonProps);\n if (!action.render) {\n return <button type=\"button\" {...props} />;\n }\n\n return React.cloneElement(action.render, {\n ...props,\n className: cn(props.className, action.render.props.className),\n onClick: action.onClick ?? action.render.props.onClick ?? props.onClick,\n children: action.render.props.children ?? props.children ?? action.label,\n });\n };\n}\n\nfunction renderActionButton(\n action: AuthPageAction,\n): React.ReactElement | ActionButtonRender {\n if (action.render) {\n return renderCustomActionElement(action);\n }\n\n if (action.href) {\n return renderActionLink(action.href);\n }\n\n return <button type=\"button\">{action.label}</button>;\n}\n\nfunction getPrimaryActionButtonType(\n action: AuthPageAction,\n isPolymorphic: boolean,\n): ActionButtonType {\n if (isPolymorphic) {\n return undefined;\n }\n\n if (action.onClick) {\n return 'button';\n }\n\n return 'submit';\n}\n\nexport function AuthPrimaryActionButton({\n action,\n loading,\n}: AuthActionButtonProps): React.ReactElement {\n const isPolymorphic = !!(action.href || action.render);\n const supportsLoading = !isPolymorphic;\n\n return (\n <Button\n appearance=\"solid\"\n loading={supportsLoading ? loading : undefined}\n nativeButton={isPolymorphic ? false : undefined}\n render={isPolymorphic ? renderActionButton(action) : undefined}\n shape=\"rounded\"\n size=\"md\"\n type={getPrimaryActionButtonType(action, isPolymorphic)}\n onClick={action.onClick}\n className=\"w-full\"\n >\n {action.label}\n </Button>\n );\n}\n\nexport function AuthGhostAction({\n action,\n}: AuthActionProps): React.ReactElement {\n const isPolymorphic = !!(action.href || action.render);\n\n return (\n <Button\n appearance=\"ghost\"\n nativeButton={isPolymorphic ? false : undefined}\n render={renderActionButton(action)}\n shape=\"rounded\"\n size=\"md\"\n type={isPolymorphic ? undefined : 'button'}\n onClick={action.onClick}\n className=\"w-full\"\n >\n {action.label}\n </Button>\n );\n}\n\nexport function AuthInlineAction({\n prefix,\n action,\n}: AuthInlineActionProps): React.ReactElement {\n const className =\n 'font-medium text-foreground transition-colors duration-150 ease-smooth hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background';\n\n return (\n <p className=\"text-center text-md leading-normal text-secondary-foreground\">\n <span>{prefix} </span>\n {renderActionElement(action, className)}\n </p>\n );\n}\n\nexport function AuthSocialDivider({\n label,\n}: AuthSocialDividerProps): React.ReactElement {\n return (\n <div className=\"flex items-center gap-4\">\n <Separator className=\"flex-1\" />\n <span className=\"shrink-0 text-md text-foreground\">{label}</span>\n <Separator className=\"flex-1\" />\n </div>\n );\n}\n\nexport function AuthSsoActions({\n actions,\n}: AuthSsoActionsProps): React.ReactElement | null {\n if (!actions?.length) return null;\n\n return (\n <div className=\"flex flex-col gap-3\">\n {actions.map((action, index) => {\n const isPolymorphic = !!(action.href || action.render);\n\n return (\n <Button\n key={`${String(action.label)}-${index}`}\n appearance=\"outline\"\n nativeButton={isPolymorphic ? false : undefined}\n render={renderActionButton(action)}\n shape=\"rounded\"\n size=\"default\"\n type={isPolymorphic ? undefined : 'button'}\n onClick={action.onClick}\n className=\"w-full\"\n >\n {action.label}\n </Button>\n );\n })}\n </div>\n );\n}\n\nexport const defaultLoginAside: AuthPageAsideConfig = {\n title: (\n <>\n Welcome back!\n <br />\n Please sign in to your Create Studio account\n </>\n ),\n description:\n 'Thank you for registering! Please check your inbox and click the verification link to activate your account.',\n cardTitle: 'Please enter your login details',\n cardDescription:\n 'Stay connected with Shadcn Studio Subscribe now for the latest updates and news.',\n};\n\nexport const defaultRegisterAside: AuthPageAsideConfig = {\n title: 'Create your account to get started.',\n description:\n 'Your account will allow you to securely save your progress, customize your preferences, and stay connected across all your devices.',\n cardTitle: \"We're excited to have you join our community\",\n cardDescription:\n 'Your account will allow you to securely save your progress, customize your preferences.',\n};\n\nexport const defaultForgotPasswordAside: AuthPageAsideConfig = {\n title: \"Don't worry, it happens! Resetting your password is quick and easy.\",\n description:\n \"Just enter your registered email address below, and we'll send you a secure link to reset your password. Follow the instructions in the email, and you'll be back in your account in no time!\",\n cardTitle: 'Follow the instructions',\n cardDescription:\n \"If you don't see the email in your inbox, be sure to check your spam or junk folder.\",\n};\n\nexport const defaultResetPasswordAside: AuthPageAsideConfig = {\n title: \"You're just one step away from regaining access to your account.\",\n description:\n \"Please create a new password below. Make sure it's strong and secure, combining letters, numbers, and special characters.\",\n cardTitle: 'Reset Your Password',\n cardDescription:\n \"You're just one step away from regaining access to your account.\",\n};\n\nexport const defaultTwoFactorAside: AuthPageAsideConfig = {\n title: 'Enable Two-Factor Authentication (2FA)',\n description:\n \"Enhance the security of your account by enabling Two-Factor Authentication (2FA). With 2FA, you'll add an extra layer of protection.\",\n cardTitle: 'Keeps your information safe',\n cardDescription:\n 'To get started, choose your preferred verification method and follow the instructions.',\n};\n\nexport const defaultVerifyEmailAside: AuthPageAsideConfig = {\n title: 'Ensure you entered the correct email address',\n description:\n 'Thank you for signing up! To complete your registration and secure your account, we need to verify your email address.',\n cardTitle: 'Verify Your Email Address',\n cardDescription:\n \"Verifying your email helps us keep your account secure and ensures you won't miss important updates.\",\n};\n"],"mappings":"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"}
package/dist/index230.js CHANGED
@@ -1,23 +1,18 @@
1
1
  "use client";
2
- import { cn } from "./index2.js";
3
- import { Checkbox } from "./index28.js";
4
2
  import { Input } from "./index33.js";
5
- import { AuthPageLayout, renderActionElement } from "./index226.js";
6
- import { AuthForm, AuthInlineAction, AuthPasswordInput, AuthPrimaryButton, AuthSocialDivider, AuthSsoActions, defaultLoginAside } from "./index228.js";
7
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
- //#region src/components/pages/LoginPage/LoginPage.tsx
9
- function LoginPage({ title = "Welcome Back", description = "Welcome back! Select method to login:", aside = defaultLoginAside, emailInputProps, passwordInputProps, rememberMeProps, rememberMeLabel = "Remember Me", ssoActions = [{ label: "Login with SSO" }], ssoDividerLabel = "or Continue with Email", forgotPasswordAction = { label: "Forgot Password?" }, registerAction = { label: "Create an account" }, submitLabel = "Sign in to HUMAIN", isSubmitting, onSubmit, formClassName, ...layoutProps }) {
10
- const hasSsoActions = ssoActions.length > 0;
11
- const rememberMeAriaLabel = typeof rememberMeLabel === "string" ? rememberMeLabel : void 0;
12
- return /* @__PURE__ */ jsxs(AuthPageLayout, {
3
+ import { AuthPageLayout } from "./index227.js";
4
+ import { AuthForm, AuthGhostAction, AuthPrimaryButton, defaultForgotPasswordAside } from "./index229.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/components/pages/ForgotPasswordPage/ForgotPasswordPage.tsx
7
+ function ForgotPasswordPage({ title = "Forgot Password?", description = "No worries, we'll send you reset instructions.", aside = defaultForgotPasswordAside, emailInputProps, loginAction = { label: "Back to login" }, submitLabel = "Send Reset Link", isSubmitting, onSubmit, ...layoutProps }) {
8
+ return /* @__PURE__ */ jsx(AuthPageLayout, {
13
9
  title,
14
10
  description,
15
11
  aside,
16
- formClassName: cn("lg:min-h-[528px]", formClassName),
17
12
  ...layoutProps,
18
13
  "data-slot": "auth-page-layout",
19
- "data-page-slot": "login-page",
20
- children: [hasSsoActions && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(AuthSsoActions, { actions: ssoActions }), /* @__PURE__ */ jsx(AuthSocialDivider, { label: ssoDividerLabel })] }), /* @__PURE__ */ jsxs(AuthForm, {
14
+ "data-page-slot": "forgot-password-page",
15
+ children: /* @__PURE__ */ jsxs(AuthForm, {
21
16
  onSubmit,
22
17
  children: [
23
18
  /* @__PURE__ */ jsx(Input, {
@@ -29,40 +24,17 @@ function LoginPage({ title = "Welcome Back", description = "Welcome back! Select
29
24
  type: "email",
30
25
  ...emailInputProps
31
26
  }),
32
- /* @__PURE__ */ jsx(AuthPasswordInput, {
33
- autoComplete: "current-password",
34
- label: "Password",
35
- name: "password",
36
- placeholder: "Enter your password",
37
- required: true,
38
- ...passwordInputProps
39
- }),
40
- /* @__PURE__ */ jsxs("div", {
41
- className: "flex items-center justify-between gap-4",
42
- children: [/* @__PURE__ */ jsx(Checkbox, {
43
- "aria-label": rememberMeAriaLabel,
44
- label: rememberMeLabel,
45
- name: "remember",
46
- ...rememberMeProps
47
- }), /* @__PURE__ */ jsx(AuthTextAction, { action: forgotPasswordAction })]
48
- }),
49
27
  /* @__PURE__ */ jsx(AuthPrimaryButton, {
50
28
  loading: isSubmitting,
51
29
  children: submitLabel
52
30
  }),
53
- /* @__PURE__ */ jsx(AuthInlineAction, {
54
- prefix: "New on our platform?",
55
- action: registerAction
56
- })
31
+ /* @__PURE__ */ jsx(AuthGhostAction, { action: loginAction })
57
32
  ]
58
- })]
33
+ })
59
34
  });
60
35
  }
61
- function AuthTextAction({ action }) {
62
- return renderActionElement(action, cn("shrink-0 whitespace-nowrap text-end text-md text-foreground transition-colors duration-150 ease-smooth hover:text-primary", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"));
63
- }
64
- LoginPage.displayName = "LoginPage";
36
+ ForgotPasswordPage.displayName = "ForgotPasswordPage";
65
37
  //#endregion
66
- export { LoginPage };
38
+ export { ForgotPasswordPage };
67
39
 
68
40
  //# sourceMappingURL=index230.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index230.js","names":[],"sources":["../src/components/pages/LoginPage/LoginPage.tsx"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport {\n Checkbox,\n type CheckboxProps,\n} from '@/components/atoms/forms/Checkbox';\nimport { Input, type InputProps } from '@/components/atoms/forms/Input';\nimport {\n type AuthPageAction,\n type AuthPageAsideConfig,\n AuthPageLayout,\n type AuthPageLayoutProps,\n renderActionElement,\n} from '@/components/templates/AuthPageLayout';\nimport { cn } from '@/lib/utils';\nimport {\n AuthForm,\n AuthInlineAction,\n AuthPasswordInput,\n AuthPrimaryButton,\n AuthSocialDivider,\n AuthSsoActions,\n defaultLoginAside,\n} from '../_auth';\n\nexport interface LoginPageProps\n extends Omit<\n AuthPageLayoutProps,\n 'title' | 'description' | 'children' | 'aside' | 'onSubmit'\n > {\n title?: React.ReactNode;\n description?: React.ReactNode;\n aside?: AuthPageAsideConfig | React.ReactNode;\n emailInputProps?: InputProps;\n passwordInputProps?: InputProps;\n rememberMeProps?: Omit<CheckboxProps, 'ref'>;\n rememberMeLabel?: string;\n ssoActions?: AuthPageAction[];\n ssoDividerLabel?: React.ReactNode;\n forgotPasswordAction?: AuthPageAction;\n registerAction?: AuthPageAction;\n submitLabel?: React.ReactNode;\n isSubmitting?: boolean;\n onSubmit?: React.FormEventHandler<HTMLFormElement>;\n}\n\ninterface AuthTextActionProps {\n action: AuthPageAction;\n}\n\nfunction LoginPage({\n title = 'Welcome Back',\n description = 'Welcome back! Select method to login:',\n aside = defaultLoginAside,\n emailInputProps,\n passwordInputProps,\n rememberMeProps,\n rememberMeLabel = 'Remember Me',\n ssoActions = [{ label: 'Login with SSO' }],\n ssoDividerLabel = 'or Continue with Email',\n forgotPasswordAction = { label: 'Forgot Password?' },\n registerAction = { label: 'Create an account' },\n submitLabel = 'Sign in to HUMAIN',\n isSubmitting,\n onSubmit,\n formClassName,\n ...layoutProps\n}: LoginPageProps): React.ReactElement {\n const hasSsoActions = ssoActions.length > 0;\n const rememberMeAriaLabel =\n typeof rememberMeLabel === 'string' ? rememberMeLabel : undefined;\n\n return (\n <AuthPageLayout\n title={title}\n description={description}\n aside={aside}\n formClassName={cn('lg:min-h-[528px]', formClassName)}\n {...layoutProps}\n data-slot=\"auth-page-layout\"\n data-page-slot=\"login-page\"\n >\n {hasSsoActions && (\n <>\n <AuthSsoActions actions={ssoActions} />\n <AuthSocialDivider label={ssoDividerLabel} />\n </>\n )}\n <AuthForm onSubmit={onSubmit}>\n <Input\n autoComplete=\"email\"\n label=\"Email\"\n name=\"email\"\n placeholder=\"Enter your email address\"\n required\n type=\"email\"\n {...emailInputProps}\n />\n <AuthPasswordInput\n autoComplete=\"current-password\"\n label=\"Password\"\n name=\"password\"\n placeholder=\"Enter your password\"\n required\n {...passwordInputProps}\n />\n <div className=\"flex items-center justify-between gap-4\">\n <Checkbox\n aria-label={rememberMeAriaLabel}\n label={rememberMeLabel}\n name=\"remember\"\n {...rememberMeProps}\n />\n <AuthTextAction action={forgotPasswordAction} />\n </div>\n <AuthPrimaryButton loading={isSubmitting}>\n {submitLabel}\n </AuthPrimaryButton>\n <AuthInlineAction\n prefix=\"New on our platform?\"\n action={registerAction}\n />\n </AuthForm>\n </AuthPageLayout>\n );\n}\n\nfunction AuthTextAction({ action }: AuthTextActionProps): React.ReactElement {\n const className = cn(\n 'shrink-0 whitespace-nowrap text-end text-md text-foreground transition-colors duration-150 ease-smooth hover:text-primary',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n );\n\n return renderActionElement(action, className);\n}\n\nLoginPage.displayName = 'LoginPage';\n\nexport { LoginPage };\n"],"mappings":";;;;;;;;AAmDA,SAAS,UAAU,EACjB,QAAQ,gBACR,cAAc,yCACd,QAAQ,mBACR,iBACA,oBACA,iBACA,kBAAkB,eAClB,aAAa,CAAC,EAAE,OAAO,iBAAiB,CAAC,GACzC,kBAAkB,0BAClB,uBAAuB,EAAE,OAAO,mBAAmB,GACnD,iBAAiB,EAAE,OAAO,oBAAoB,GAC9C,cAAc,qBACd,cACA,UACA,eACA,GAAG,eACkC;CACrC,MAAM,gBAAgB,WAAW,SAAS;CAC1C,MAAM,sBACJ,OAAO,oBAAoB,WAAW,kBAAkB,KAAA;CAE1D,OACE,qBAAC,gBAAD;EACS;EACM;EACN;EACP,eAAe,GAAG,oBAAoB,aAAa;EACnD,GAAI;EACJ,aAAU;EACV,kBAAe;YAPjB,CASG,iBACC,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,gBAAD,EAAgB,SAAS,WAAa,CAAA,GACtC,oBAAC,mBAAD,EAAmB,OAAO,gBAAkB,CAAA,CAC5C,EAAA,CAAA,GAEJ,qBAAC,UAAD;GAAoB;aAApB;IACE,oBAAC,OAAD;KACE,cAAa;KACb,OAAM;KACN,MAAK;KACL,aAAY;KACZ,UAAA;KACA,MAAK;KACL,GAAI;IACL,CAAA;IACD,oBAAC,mBAAD;KACE,cAAa;KACb,OAAM;KACN,MAAK;KACL,aAAY;KACZ,UAAA;KACA,GAAI;IACL,CAAA;IACD,qBAAC,OAAD;KAAK,WAAU;eAAf,CACE,oBAAC,UAAD;MACE,cAAY;MACZ,OAAO;MACP,MAAK;MACL,GAAI;KACL,CAAA,GACD,oBAAC,gBAAD,EAAgB,QAAQ,qBAAuB,CAAA,CAC5C;;IACL,oBAAC,mBAAD;KAAmB,SAAS;eACzB;IACgB,CAAA;IACnB,oBAAC,kBAAD;KACE,QAAO;KACP,QAAQ;IACT,CAAA;GACO;IACI;;AAEpB;AAEA,SAAS,eAAe,EAAE,UAAmD;CAM3E,OAAO,oBAAoB,QALT,GAChB,6HACA,0IAGiC,CAAS;AAC9C;AAEA,UAAU,cAAc"}
1
+ {"version":3,"file":"index230.js","names":[],"sources":["../src/components/pages/ForgotPasswordPage/ForgotPasswordPage.tsx"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { Input, type InputProps } from '@/components/atoms/forms/Input';\nimport {\n type AuthPageAction,\n type AuthPageAsideConfig,\n AuthPageLayout,\n type AuthPageLayoutProps,\n} from '@/components/templates/AuthPageLayout';\nimport {\n AuthForm,\n AuthGhostAction,\n AuthPrimaryButton,\n defaultForgotPasswordAside,\n} from '../_auth';\n\nexport interface ForgotPasswordPageProps\n extends Omit<\n AuthPageLayoutProps,\n 'title' | 'description' | 'children' | 'aside' | 'onSubmit'\n > {\n title?: React.ReactNode;\n description?: React.ReactNode;\n aside?: AuthPageAsideConfig | React.ReactNode;\n emailInputProps?: InputProps;\n loginAction?: AuthPageAction;\n submitLabel?: React.ReactNode;\n isSubmitting?: boolean;\n onSubmit?: React.FormEventHandler<HTMLFormElement>;\n}\n\nfunction ForgotPasswordPage({\n title = 'Forgot Password?',\n description = \"No worries, we'll send you reset instructions.\",\n aside = defaultForgotPasswordAside,\n emailInputProps,\n loginAction = { label: 'Back to login' },\n submitLabel = 'Send Reset Link',\n isSubmitting,\n onSubmit,\n ...layoutProps\n}: ForgotPasswordPageProps): React.ReactElement {\n return (\n <AuthPageLayout\n title={title}\n description={description}\n aside={aside}\n {...layoutProps}\n data-slot=\"auth-page-layout\"\n data-page-slot=\"forgot-password-page\"\n >\n <AuthForm onSubmit={onSubmit}>\n <Input\n autoComplete=\"email\"\n label=\"Email\"\n name=\"email\"\n placeholder=\"Enter your email address\"\n required\n type=\"email\"\n {...emailInputProps}\n />\n <AuthPrimaryButton loading={isSubmitting}>\n {submitLabel}\n </AuthPrimaryButton>\n <AuthGhostAction action={loginAction} />\n </AuthForm>\n </AuthPageLayout>\n );\n}\n\nForgotPasswordPage.displayName = 'ForgotPasswordPage';\n\nexport { ForgotPasswordPage };\n"],"mappings":";;;;;;AAgCA,SAAS,mBAAmB,EAC1B,QAAQ,oBACR,cAAc,kDACd,QAAQ,4BACR,iBACA,cAAc,EAAE,OAAO,gBAAgB,GACvC,cAAc,mBACd,cACA,UACA,GAAG,eAC2C;CAC9C,OACE,oBAAC,gBAAD;EACS;EACM;EACN;EACP,GAAI;EACJ,aAAU;EACV,kBAAe;YAEf,qBAAC,UAAD;GAAoB;aAApB;IACE,oBAAC,OAAD;KACE,cAAa;KACb,OAAM;KACN,MAAK;KACL,aAAY;KACZ,UAAA;KACA,MAAK;KACL,GAAI;IACL,CAAA;IACD,oBAAC,mBAAD;KAAmB,SAAS;eACzB;IACgB,CAAA;IACnB,oBAAC,iBAAD,EAAiB,QAAQ,YAAc,CAAA;GAC/B;;CACI,CAAA;AAEpB;AAEA,mBAAmB,cAAc"}
package/dist/index231.js CHANGED
@@ -2,32 +2,24 @@
2
2
  import { cn } from "./index2.js";
3
3
  import { Checkbox } from "./index28.js";
4
4
  import { Input } from "./index33.js";
5
- import { AuthPageLayout } from "./index226.js";
6
- import { AuthForm, AuthInlineAction, AuthPasswordInput, AuthPrimaryButton, AuthSocialDivider, AuthSsoActions, defaultRegisterAside } from "./index228.js";
5
+ import { AuthPageLayout, renderActionElement } from "./index227.js";
6
+ import { AuthForm, AuthInlineAction, AuthPasswordInput, AuthPrimaryButton, AuthSocialDivider, AuthSsoActions, defaultLoginAside } from "./index229.js";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
- //#region src/components/pages/RegisterPage/RegisterPage.tsx
9
- function RegisterPage({ title = "Create your account", description = "Let's get started with your 30-day free trial", aside = defaultRegisterAside, nameInputProps, emailInputProps, passwordInputProps, termsProps, termsLabel = "I agree to all terms, privacy policy, and fees", ssoActions = [{ label: "Login with SSO" }], ssoDividerLabel = "Or", loginAction = { label: "Log in" }, submitLabel = "Create account", isSubmitting, onSubmit, formClassName, ...layoutProps }) {
8
+ //#region src/components/pages/LoginPage/LoginPage.tsx
9
+ function LoginPage({ title = "Welcome Back", description = "Welcome back! Select method to login:", aside = defaultLoginAside, emailInputProps, passwordInputProps, rememberMeProps, rememberMeLabel = "Remember Me", ssoActions = [{ label: "Login with SSO" }], ssoDividerLabel = "or Continue with Email", forgotPasswordAction = { label: "Forgot Password?" }, registerAction = { label: "Create an account" }, submitLabel = "Sign in to HUMAIN", isSubmitting, onSubmit, formClassName, ...layoutProps }) {
10
10
  const hasSsoActions = ssoActions.length > 0;
11
- const termsAriaLabel = typeof termsLabel === "string" ? termsLabel : void 0;
11
+ const rememberMeAriaLabel = typeof rememberMeLabel === "string" ? rememberMeLabel : void 0;
12
12
  return /* @__PURE__ */ jsxs(AuthPageLayout, {
13
13
  title,
14
14
  description,
15
15
  aside,
16
- formClassName: cn("lg:min-h-[608px]", formClassName),
16
+ formClassName: cn("lg:min-h-[528px]", formClassName),
17
17
  ...layoutProps,
18
18
  "data-slot": "auth-page-layout",
19
- "data-page-slot": "register-page",
19
+ "data-page-slot": "login-page",
20
20
  children: [hasSsoActions && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(AuthSsoActions, { actions: ssoActions }), /* @__PURE__ */ jsx(AuthSocialDivider, { label: ssoDividerLabel })] }), /* @__PURE__ */ jsxs(AuthForm, {
21
21
  onSubmit,
22
22
  children: [
23
- /* @__PURE__ */ jsx(Input, {
24
- autoComplete: "name",
25
- label: "Name",
26
- name: "name",
27
- placeholder: "Enter your name",
28
- required: true,
29
- ...nameInputProps
30
- }),
31
23
  /* @__PURE__ */ jsx(Input, {
32
24
  autoComplete: "email",
33
25
  label: "Email",
@@ -38,34 +30,39 @@ function RegisterPage({ title = "Create your account", description = "Let's get
38
30
  ...emailInputProps
39
31
  }),
40
32
  /* @__PURE__ */ jsx(AuthPasswordInput, {
41
- autoComplete: "new-password",
33
+ autoComplete: "current-password",
42
34
  label: "Password",
43
35
  name: "password",
44
36
  placeholder: "Enter your password",
45
37
  required: true,
46
38
  ...passwordInputProps
47
39
  }),
48
- /* @__PURE__ */ jsx(Checkbox, {
49
- "aria-label": termsAriaLabel,
50
- label: termsLabel,
51
- name: "terms",
52
- required: true,
53
- ...termsProps
40
+ /* @__PURE__ */ jsxs("div", {
41
+ className: "flex items-center justify-between gap-4",
42
+ children: [/* @__PURE__ */ jsx(Checkbox, {
43
+ "aria-label": rememberMeAriaLabel,
44
+ label: rememberMeLabel,
45
+ name: "remember",
46
+ ...rememberMeProps
47
+ }), /* @__PURE__ */ jsx(AuthTextAction, { action: forgotPasswordAction })]
54
48
  }),
55
49
  /* @__PURE__ */ jsx(AuthPrimaryButton, {
56
50
  loading: isSubmitting,
57
51
  children: submitLabel
58
52
  }),
59
53
  /* @__PURE__ */ jsx(AuthInlineAction, {
60
- prefix: "Already have an account?",
61
- action: loginAction
54
+ prefix: "New on our platform?",
55
+ action: registerAction
62
56
  })
63
57
  ]
64
58
  })]
65
59
  });
66
60
  }
67
- RegisterPage.displayName = "RegisterPage";
61
+ function AuthTextAction({ action }) {
62
+ return renderActionElement(action, cn("shrink-0 whitespace-nowrap text-end text-md text-foreground transition-colors duration-150 ease-smooth hover:text-primary", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"));
63
+ }
64
+ LoginPage.displayName = "LoginPage";
68
65
  //#endregion
69
- export { RegisterPage };
66
+ export { LoginPage };
70
67
 
71
68
  //# sourceMappingURL=index231.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index231.js","names":[],"sources":["../src/components/pages/RegisterPage/RegisterPage.tsx"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport {\n Checkbox,\n type CheckboxProps,\n} from '@/components/atoms/forms/Checkbox';\nimport { Input, type InputProps } from '@/components/atoms/forms/Input';\nimport {\n type AuthPageAction,\n type AuthPageAsideConfig,\n AuthPageLayout,\n type AuthPageLayoutProps,\n} from '@/components/templates/AuthPageLayout';\nimport { cn } from '@/lib/utils';\nimport {\n AuthForm,\n AuthInlineAction,\n AuthPasswordInput,\n AuthPrimaryButton,\n AuthSocialDivider,\n AuthSsoActions,\n defaultRegisterAside,\n} from '../_auth';\n\nexport interface RegisterPageProps\n extends Omit<\n AuthPageLayoutProps,\n 'title' | 'description' | 'children' | 'aside' | 'onSubmit'\n > {\n title?: React.ReactNode;\n description?: React.ReactNode;\n aside?: AuthPageAsideConfig | React.ReactNode;\n nameInputProps?: InputProps;\n emailInputProps?: InputProps;\n passwordInputProps?: InputProps;\n termsProps?: Omit<CheckboxProps, 'ref'>;\n termsLabel?: string;\n ssoActions?: AuthPageAction[];\n ssoDividerLabel?: React.ReactNode;\n loginAction?: AuthPageAction;\n submitLabel?: React.ReactNode;\n isSubmitting?: boolean;\n onSubmit?: React.FormEventHandler<HTMLFormElement>;\n}\n\nfunction RegisterPage({\n title = 'Create your account',\n description = \"Let's get started with your 30-day free trial\",\n aside = defaultRegisterAside,\n nameInputProps,\n emailInputProps,\n passwordInputProps,\n termsProps,\n termsLabel = 'I agree to all terms, privacy policy, and fees',\n ssoActions = [{ label: 'Login with SSO' }],\n ssoDividerLabel = 'Or',\n loginAction = { label: 'Log in' },\n submitLabel = 'Create account',\n isSubmitting,\n onSubmit,\n formClassName,\n ...layoutProps\n}: RegisterPageProps): React.ReactElement {\n const hasSsoActions = ssoActions.length > 0;\n const termsAriaLabel =\n typeof termsLabel === 'string' ? termsLabel : undefined;\n\n return (\n <AuthPageLayout\n title={title}\n description={description}\n aside={aside}\n formClassName={cn('lg:min-h-[608px]', formClassName)}\n {...layoutProps}\n data-slot=\"auth-page-layout\"\n data-page-slot=\"register-page\"\n >\n {hasSsoActions && (\n <>\n <AuthSsoActions actions={ssoActions} />\n <AuthSocialDivider label={ssoDividerLabel} />\n </>\n )}\n <AuthForm onSubmit={onSubmit}>\n <Input\n autoComplete=\"name\"\n label=\"Name\"\n name=\"name\"\n placeholder=\"Enter your name\"\n required\n {...nameInputProps}\n />\n <Input\n autoComplete=\"email\"\n label=\"Email\"\n name=\"email\"\n placeholder=\"Enter your email address\"\n required\n type=\"email\"\n {...emailInputProps}\n />\n <AuthPasswordInput\n autoComplete=\"new-password\"\n label=\"Password\"\n name=\"password\"\n placeholder=\"Enter your password\"\n required\n {...passwordInputProps}\n />\n <Checkbox\n aria-label={termsAriaLabel}\n label={termsLabel}\n name=\"terms\"\n required\n {...termsProps}\n />\n <AuthPrimaryButton loading={isSubmitting}>\n {submitLabel}\n </AuthPrimaryButton>\n <AuthInlineAction\n prefix=\"Already have an account?\"\n action={loginAction}\n />\n </AuthForm>\n </AuthPageLayout>\n );\n}\n\nRegisterPage.displayName = 'RegisterPage';\n\nexport { RegisterPage };\n"],"mappings":";;;;;;;;AA8CA,SAAS,aAAa,EACpB,QAAQ,uBACR,cAAc,iDACd,QAAQ,sBACR,gBACA,iBACA,oBACA,YACA,aAAa,kDACb,aAAa,CAAC,EAAE,OAAO,iBAAiB,CAAC,GACzC,kBAAkB,MAClB,cAAc,EAAE,OAAO,SAAS,GAChC,cAAc,kBACd,cACA,UACA,eACA,GAAG,eACqC;CACxC,MAAM,gBAAgB,WAAW,SAAS;CAC1C,MAAM,iBACJ,OAAO,eAAe,WAAW,aAAa,KAAA;CAEhD,OACE,qBAAC,gBAAD;EACS;EACM;EACN;EACP,eAAe,GAAG,oBAAoB,aAAa;EACnD,GAAI;EACJ,aAAU;EACV,kBAAe;YAPjB,CASG,iBACC,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,gBAAD,EAAgB,SAAS,WAAa,CAAA,GACtC,oBAAC,mBAAD,EAAmB,OAAO,gBAAkB,CAAA,CAC5C,EAAA,CAAA,GAEJ,qBAAC,UAAD;GAAoB;aAApB;IACE,oBAAC,OAAD;KACE,cAAa;KACb,OAAM;KACN,MAAK;KACL,aAAY;KACZ,UAAA;KACA,GAAI;IACL,CAAA;IACD,oBAAC,OAAD;KACE,cAAa;KACb,OAAM;KACN,MAAK;KACL,aAAY;KACZ,UAAA;KACA,MAAK;KACL,GAAI;IACL,CAAA;IACD,oBAAC,mBAAD;KACE,cAAa;KACb,OAAM;KACN,MAAK;KACL,aAAY;KACZ,UAAA;KACA,GAAI;IACL,CAAA;IACD,oBAAC,UAAD;KACE,cAAY;KACZ,OAAO;KACP,MAAK;KACL,UAAA;KACA,GAAI;IACL,CAAA;IACD,oBAAC,mBAAD;KAAmB,SAAS;eACzB;IACgB,CAAA;IACnB,oBAAC,kBAAD;KACE,QAAO;KACP,QAAQ;IACT,CAAA;GACO;IACI;;AAEpB;AAEA,aAAa,cAAc"}
1
+ {"version":3,"file":"index231.js","names":[],"sources":["../src/components/pages/LoginPage/LoginPage.tsx"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport {\n Checkbox,\n type CheckboxProps,\n} from '@/components/atoms/forms/Checkbox';\nimport { Input, type InputProps } from '@/components/atoms/forms/Input';\nimport {\n type AuthPageAction,\n type AuthPageAsideConfig,\n AuthPageLayout,\n type AuthPageLayoutProps,\n renderActionElement,\n} from '@/components/templates/AuthPageLayout';\nimport { cn } from '@/lib/utils';\nimport {\n AuthForm,\n AuthInlineAction,\n AuthPasswordInput,\n AuthPrimaryButton,\n AuthSocialDivider,\n AuthSsoActions,\n defaultLoginAside,\n} from '../_auth';\n\nexport interface LoginPageProps\n extends Omit<\n AuthPageLayoutProps,\n 'title' | 'description' | 'children' | 'aside' | 'onSubmit'\n > {\n title?: React.ReactNode;\n description?: React.ReactNode;\n aside?: AuthPageAsideConfig | React.ReactNode;\n emailInputProps?: InputProps;\n passwordInputProps?: InputProps;\n rememberMeProps?: Omit<CheckboxProps, 'ref'>;\n rememberMeLabel?: string;\n ssoActions?: AuthPageAction[];\n ssoDividerLabel?: React.ReactNode;\n forgotPasswordAction?: AuthPageAction;\n registerAction?: AuthPageAction;\n submitLabel?: React.ReactNode;\n isSubmitting?: boolean;\n onSubmit?: React.FormEventHandler<HTMLFormElement>;\n}\n\ninterface AuthTextActionProps {\n action: AuthPageAction;\n}\n\nfunction LoginPage({\n title = 'Welcome Back',\n description = 'Welcome back! Select method to login:',\n aside = defaultLoginAside,\n emailInputProps,\n passwordInputProps,\n rememberMeProps,\n rememberMeLabel = 'Remember Me',\n ssoActions = [{ label: 'Login with SSO' }],\n ssoDividerLabel = 'or Continue with Email',\n forgotPasswordAction = { label: 'Forgot Password?' },\n registerAction = { label: 'Create an account' },\n submitLabel = 'Sign in to HUMAIN',\n isSubmitting,\n onSubmit,\n formClassName,\n ...layoutProps\n}: LoginPageProps): React.ReactElement {\n const hasSsoActions = ssoActions.length > 0;\n const rememberMeAriaLabel =\n typeof rememberMeLabel === 'string' ? rememberMeLabel : undefined;\n\n return (\n <AuthPageLayout\n title={title}\n description={description}\n aside={aside}\n formClassName={cn('lg:min-h-[528px]', formClassName)}\n {...layoutProps}\n data-slot=\"auth-page-layout\"\n data-page-slot=\"login-page\"\n >\n {hasSsoActions && (\n <>\n <AuthSsoActions actions={ssoActions} />\n <AuthSocialDivider label={ssoDividerLabel} />\n </>\n )}\n <AuthForm onSubmit={onSubmit}>\n <Input\n autoComplete=\"email\"\n label=\"Email\"\n name=\"email\"\n placeholder=\"Enter your email address\"\n required\n type=\"email\"\n {...emailInputProps}\n />\n <AuthPasswordInput\n autoComplete=\"current-password\"\n label=\"Password\"\n name=\"password\"\n placeholder=\"Enter your password\"\n required\n {...passwordInputProps}\n />\n <div className=\"flex items-center justify-between gap-4\">\n <Checkbox\n aria-label={rememberMeAriaLabel}\n label={rememberMeLabel}\n name=\"remember\"\n {...rememberMeProps}\n />\n <AuthTextAction action={forgotPasswordAction} />\n </div>\n <AuthPrimaryButton loading={isSubmitting}>\n {submitLabel}\n </AuthPrimaryButton>\n <AuthInlineAction\n prefix=\"New on our platform?\"\n action={registerAction}\n />\n </AuthForm>\n </AuthPageLayout>\n );\n}\n\nfunction AuthTextAction({ action }: AuthTextActionProps): React.ReactElement {\n const className = cn(\n 'shrink-0 whitespace-nowrap text-end text-md text-foreground transition-colors duration-150 ease-smooth hover:text-primary',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n );\n\n return renderActionElement(action, className);\n}\n\nLoginPage.displayName = 'LoginPage';\n\nexport { LoginPage };\n"],"mappings":";;;;;;;;AAmDA,SAAS,UAAU,EACjB,QAAQ,gBACR,cAAc,yCACd,QAAQ,mBACR,iBACA,oBACA,iBACA,kBAAkB,eAClB,aAAa,CAAC,EAAE,OAAO,iBAAiB,CAAC,GACzC,kBAAkB,0BAClB,uBAAuB,EAAE,OAAO,mBAAmB,GACnD,iBAAiB,EAAE,OAAO,oBAAoB,GAC9C,cAAc,qBACd,cACA,UACA,eACA,GAAG,eACkC;CACrC,MAAM,gBAAgB,WAAW,SAAS;CAC1C,MAAM,sBACJ,OAAO,oBAAoB,WAAW,kBAAkB,KAAA;CAE1D,OACE,qBAAC,gBAAD;EACS;EACM;EACN;EACP,eAAe,GAAG,oBAAoB,aAAa;EACnD,GAAI;EACJ,aAAU;EACV,kBAAe;YAPjB,CASG,iBACC,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,gBAAD,EAAgB,SAAS,WAAa,CAAA,GACtC,oBAAC,mBAAD,EAAmB,OAAO,gBAAkB,CAAA,CAC5C,EAAA,CAAA,GAEJ,qBAAC,UAAD;GAAoB;aAApB;IACE,oBAAC,OAAD;KACE,cAAa;KACb,OAAM;KACN,MAAK;KACL,aAAY;KACZ,UAAA;KACA,MAAK;KACL,GAAI;IACL,CAAA;IACD,oBAAC,mBAAD;KACE,cAAa;KACb,OAAM;KACN,MAAK;KACL,aAAY;KACZ,UAAA;KACA,GAAI;IACL,CAAA;IACD,qBAAC,OAAD;KAAK,WAAU;eAAf,CACE,oBAAC,UAAD;MACE,cAAY;MACZ,OAAO;MACP,MAAK;MACL,GAAI;KACL,CAAA,GACD,oBAAC,gBAAD,EAAgB,QAAQ,qBAAuB,CAAA,CAC5C;;IACL,oBAAC,mBAAD;KAAmB,SAAS;eACzB;IACgB,CAAA;IACnB,oBAAC,kBAAD;KACE,QAAO;KACP,QAAQ;IACT,CAAA;GACO;IACI;;AAEpB;AAEA,SAAS,eAAe,EAAE,UAAmD;CAM3E,OAAO,oBAAoB,QALT,GAChB,6HACA,0IAGiC,CAAS;AAC9C;AAEA,UAAU,cAAc"}
package/dist/index232.js CHANGED
@@ -1,48 +1,71 @@
1
1
  "use client";
2
- import { AuthPageLayout } from "./index226.js";
3
- import { AuthForm, AuthGhostAction, AuthPasswordInput, AuthPrimaryButton, defaultResetPasswordAside } from "./index228.js";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
- //#region src/components/pages/ResetPasswordPage/ResetPasswordPage.tsx
6
- function ResetPasswordPage({ title = "Set new password", description = "Must be at least 8 characters.", aside = defaultResetPasswordAside, passwordInputProps, confirmPasswordInputProps, loginAction = { label: "Back to login" }, submitLabel = "Reset Password", isSubmitting, onSubmit, ...layoutProps }) {
7
- return /* @__PURE__ */ jsx(AuthPageLayout, {
2
+ import { cn } from "./index2.js";
3
+ import { Checkbox } from "./index28.js";
4
+ import { Input } from "./index33.js";
5
+ import { AuthPageLayout } from "./index227.js";
6
+ import { AuthForm, AuthInlineAction, AuthPasswordInput, AuthPrimaryButton, AuthSocialDivider, AuthSsoActions, defaultRegisterAside } from "./index229.js";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ //#region src/components/pages/RegisterPage/RegisterPage.tsx
9
+ function RegisterPage({ title = "Create your account", description = "Let's get started with your 30-day free trial", aside = defaultRegisterAside, nameInputProps, emailInputProps, passwordInputProps, termsProps, termsLabel = "I agree to all terms, privacy policy, and fees", ssoActions = [{ label: "Login with SSO" }], ssoDividerLabel = "Or", loginAction = { label: "Log in" }, submitLabel = "Create account", isSubmitting, onSubmit, formClassName, ...layoutProps }) {
10
+ const hasSsoActions = ssoActions.length > 0;
11
+ const termsAriaLabel = typeof termsLabel === "string" ? termsLabel : void 0;
12
+ return /* @__PURE__ */ jsxs(AuthPageLayout, {
8
13
  title,
9
14
  description,
10
15
  aside,
16
+ formClassName: cn("lg:min-h-[608px]", formClassName),
11
17
  ...layoutProps,
12
18
  "data-slot": "auth-page-layout",
13
- "data-page-slot": "reset-password-page",
14
- children: /* @__PURE__ */ jsxs(AuthForm, {
19
+ "data-page-slot": "register-page",
20
+ children: [hasSsoActions && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(AuthSsoActions, { actions: ssoActions }), /* @__PURE__ */ jsx(AuthSocialDivider, { label: ssoDividerLabel })] }), /* @__PURE__ */ jsxs(AuthForm, {
15
21
  onSubmit,
16
22
  children: [
23
+ /* @__PURE__ */ jsx(Input, {
24
+ autoComplete: "name",
25
+ label: "Name",
26
+ name: "name",
27
+ placeholder: "Enter your name",
28
+ required: true,
29
+ ...nameInputProps
30
+ }),
31
+ /* @__PURE__ */ jsx(Input, {
32
+ autoComplete: "email",
33
+ label: "Email",
34
+ name: "email",
35
+ placeholder: "Enter your email address",
36
+ required: true,
37
+ type: "email",
38
+ ...emailInputProps
39
+ }),
17
40
  /* @__PURE__ */ jsx(AuthPasswordInput, {
18
41
  autoComplete: "new-password",
19
- label: "New password",
42
+ label: "Password",
20
43
  name: "password",
21
- placeholder: "Enter new password",
44
+ placeholder: "Enter your password",
22
45
  required: true,
23
- visibilityLabel: "new password",
24
46
  ...passwordInputProps
25
47
  }),
26
- /* @__PURE__ */ jsx(AuthPasswordInput, {
27
- autoComplete: "new-password",
28
- label: "Confirm password",
29
- name: "confirmPassword",
30
- placeholder: "Confirm new password",
48
+ /* @__PURE__ */ jsx(Checkbox, {
49
+ "aria-label": termsAriaLabel,
50
+ label: termsLabel,
51
+ name: "terms",
31
52
  required: true,
32
- visibilityLabel: "confirm password",
33
- ...confirmPasswordInputProps
53
+ ...termsProps
34
54
  }),
35
55
  /* @__PURE__ */ jsx(AuthPrimaryButton, {
36
56
  loading: isSubmitting,
37
57
  children: submitLabel
38
58
  }),
39
- /* @__PURE__ */ jsx(AuthGhostAction, { action: loginAction })
59
+ /* @__PURE__ */ jsx(AuthInlineAction, {
60
+ prefix: "Already have an account?",
61
+ action: loginAction
62
+ })
40
63
  ]
41
- })
64
+ })]
42
65
  });
43
66
  }
44
- ResetPasswordPage.displayName = "ResetPasswordPage";
67
+ RegisterPage.displayName = "RegisterPage";
45
68
  //#endregion
46
- export { ResetPasswordPage };
69
+ export { RegisterPage };
47
70
 
48
71
  //# sourceMappingURL=index232.js.map