@nswds/ui 3.4.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/forgot-password-form.d.ts +0 -17
- package/dist/components/forgot-password-form.js +0 -44
- package/dist/components/forgot-password-form.js.map +0 -1
- package/dist/components/login-form.d.ts +0 -5
- package/dist/components/login-form.js +0 -68
- package/dist/components/login-form.js.map +0 -1
- package/dist/components/sign-up-form.d.ts +0 -24
- package/dist/components/sign-up-form.js +0 -110
- package/dist/components/sign-up-form.js.map +0 -1
|
@@ -6,7 +6,7 @@ import { Link } from './link.js';
|
|
|
6
6
|
|
|
7
7
|
declare const badgeVariants: (props?: ({
|
|
8
8
|
variant?: "solid" | "soft" | "surface" | "outline" | null | undefined;
|
|
9
|
-
color?: "
|
|
9
|
+
color?: "white" | "grey" | "primary" | "secondary" | "tertiary" | "accent" | "primary/grey" | "light" | "primary/white" | null | undefined;
|
|
10
10
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
11
11
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
12
|
type BadgeProps = VariantProps<typeof badgeVariants> & React__default.ComponentPropsWithoutRef<'span'> & {
|
|
@@ -5,7 +5,7 @@ import React__default from 'react';
|
|
|
5
5
|
import { Link } from './link.js';
|
|
6
6
|
|
|
7
7
|
declare const buttonVariants: (props?: ({
|
|
8
|
-
variant?: "solid" | "soft" | "surface" | "outline" | "
|
|
8
|
+
variant?: "solid" | "soft" | "surface" | "outline" | "ghost" | "link" | null | undefined;
|
|
9
9
|
color?: "white" | "grey" | "primary" | "secondary" | "tertiary" | "accent" | "danger" | "success" | "warning" | null | undefined;
|
|
10
10
|
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
11
11
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nswds/ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "UI components for NSW Government digital products, providing reusable design elements and patterns for consistent user interfaces.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/digitalnsw/nswds-ui#readme",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* ForgotPasswordForm — the password-reset request step that pairs with the
|
|
5
|
-
* "Forgot your password?" link in LoginForm.
|
|
6
|
-
*
|
|
7
|
-
* A composed pattern (Card + Field + Input + Button), published as a worked
|
|
8
|
-
* example: copy the source and wire the single email field to your own reset
|
|
9
|
-
* handler rather than configuring it through props.
|
|
10
|
-
*
|
|
11
|
-
* Single-field by design. The flow is intentionally minimal — collect the
|
|
12
|
-
* email, send the reset link, and (for account-enumeration safety) show the
|
|
13
|
-
* same confirmation whether or not the address is registered.
|
|
14
|
-
*/
|
|
15
|
-
declare function ForgotPasswordForm({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
16
|
-
|
|
17
|
-
export { ForgotPasswordForm };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import { Button } from '../components/button.js';
|
|
4
|
-
import { Card, CardHeader, CardTitle, CardDescription, CardContent } from '../components/card.js';
|
|
5
|
-
import { FieldGroup, Field, FieldLabel, FieldDescription } from '../components/field.js';
|
|
6
|
-
import { Input } from '../components/input.js';
|
|
7
|
-
import { Link } from '../components/link.js';
|
|
8
|
-
import { cn } from '../lib/utils.js';
|
|
9
|
-
|
|
10
|
-
function ForgotPasswordForm({
|
|
11
|
-
className,
|
|
12
|
-
...props
|
|
13
|
-
}) {
|
|
14
|
-
return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col gap-6", className), ...props, children: /* @__PURE__ */ jsxs(Card, { className: "w-full", children: [
|
|
15
|
-
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
16
|
-
/* @__PURE__ */ jsx(CardTitle, { children: "Forgot your password?" }),
|
|
17
|
-
/* @__PURE__ */ jsx(CardDescription, { children: "Enter the email address for your account and we'll send you a link to reset your password." })
|
|
18
|
-
] }),
|
|
19
|
-
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("form", { children: /* @__PURE__ */ jsxs(FieldGroup, { children: [
|
|
20
|
-
/* @__PURE__ */ jsxs(Field, { children: [
|
|
21
|
-
/* @__PURE__ */ jsx(FieldLabel, { htmlFor: "email", children: "Email" }),
|
|
22
|
-
/* @__PURE__ */ jsx(
|
|
23
|
-
Input,
|
|
24
|
-
{
|
|
25
|
-
id: "email",
|
|
26
|
-
type: "email",
|
|
27
|
-
autoComplete: "email",
|
|
28
|
-
placeholder: "m@example.com",
|
|
29
|
-
required: true
|
|
30
|
-
}
|
|
31
|
-
)
|
|
32
|
-
] }),
|
|
33
|
-
/* @__PURE__ */ jsx(Field, { children: /* @__PURE__ */ jsx(Button, { type: "submit", children: "Send reset link" }) }),
|
|
34
|
-
/* @__PURE__ */ jsx(Field, { children: /* @__PURE__ */ jsxs(FieldDescription, { className: "text-center", children: [
|
|
35
|
-
"Remembered your password? ",
|
|
36
|
-
/* @__PURE__ */ jsx(Link, { href: "#", children: "Back to login" })
|
|
37
|
-
] }) })
|
|
38
|
-
] }) }) })
|
|
39
|
-
] }) });
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export { ForgotPasswordForm };
|
|
43
|
-
//# sourceMappingURL=forgot-password-form.js.map
|
|
44
|
-
//# sourceMappingURL=forgot-password-form.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/forgot-password-form.tsx"],"names":[],"mappings":";;;;;;;;AAkCO,SAAS,kBAAA,CAAmB;AAAA,EACjC,SAAA;AAAA,EACA,GAA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QAAA,EAAA,eAAA,EAAa;AAAA,OAAA,EACxD,CAAA,EACF;AAAA,KAAA,EACF,GACF,CAAA,EACF;AAAA,GAAA,EACF,CAAA,EACF,CAAA;AAEJ","file":"forgot-password-form.js","sourcesContent":["'use client'\n\nimport type * as React from 'react'\n\nimport { Button } from '../components/button.js'\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from '../components/card.js'\nimport {\n Field,\n FieldDescription,\n FieldGroup,\n FieldLabel,\n} from '../components/field.js'\nimport { Input } from '../components/input.js'\nimport { Link } from '../components/link.js'\nimport { cn } from '../lib/utils.js'\n\n/**\n * ForgotPasswordForm — the password-reset request step that pairs with the\n * \"Forgot your password?\" link in LoginForm.\n *\n * A composed pattern (Card + Field + Input + Button), published as a worked\n * example: copy the source and wire the single email field to your own reset\n * handler rather than configuring it through props.\n *\n * Single-field by design. The flow is intentionally minimal — collect the\n * email, send the reset link, and (for account-enumeration safety) show the\n * same confirmation whether or not the address is registered.\n */\nexport function ForgotPasswordForm({\n className,\n ...props\n}: React.ComponentProps<'div'>) {\n return (\n <div className={cn('flex flex-col gap-6', className)} {...props}>\n <Card className=\"w-full\">\n <CardHeader>\n <CardTitle>Forgot your password?</CardTitle>\n <CardDescription>\n Enter the email address for your account and we'll send you a\n link to reset your password.\n </CardDescription>\n </CardHeader>\n <CardContent>\n <form>\n <FieldGroup>\n <Field>\n <FieldLabel htmlFor=\"email\">Email</FieldLabel>\n <Input\n id=\"email\"\n type=\"email\"\n autoComplete=\"email\"\n placeholder=\"m@example.com\"\n required\n />\n </Field>\n <Field>\n <Button type=\"submit\">Send reset link</Button>\n </Field>\n <Field>\n <FieldDescription className=\"text-center\">\n Remembered your password? <Link href=\"#\">Back to login</Link>\n </FieldDescription>\n </Field>\n </FieldGroup>\n </form>\n </CardContent>\n </Card>\n </div>\n )\n}\n"]}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import { Button } from '../components/button.js';
|
|
4
|
-
import { Card, CardHeader, CardTitle, CardDescription, CardContent } from '../components/card.js';
|
|
5
|
-
import { FieldGroup, Field, FieldLabel, FieldDescription } from '../components/field.js';
|
|
6
|
-
import { Input } from '../components/input.js';
|
|
7
|
-
import { LabeledSeparator } from '../components/labeled-separator.js';
|
|
8
|
-
import { Link } from '../components/link.js';
|
|
9
|
-
import { Separator } from '../components/separator.js';
|
|
10
|
-
import { IconLogin, IconKey, IconMail } from '../icons/index.js';
|
|
11
|
-
import { cn } from '../lib/utils.js';
|
|
12
|
-
|
|
13
|
-
function LoginForm({
|
|
14
|
-
className,
|
|
15
|
-
...props
|
|
16
|
-
}) {
|
|
17
|
-
return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col gap-6", className), ...props, children: /* @__PURE__ */ jsxs(Card, { className: "w-full", children: [
|
|
18
|
-
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
19
|
-
/* @__PURE__ */ jsx(CardTitle, { children: "Login to your account" }),
|
|
20
|
-
/* @__PURE__ */ jsx(CardDescription, { children: "Choose how you'd like to sign in" })
|
|
21
|
-
] }),
|
|
22
|
-
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("form", { children: /* @__PURE__ */ jsxs(FieldGroup, { children: [
|
|
23
|
-
/* @__PURE__ */ jsx(Field, { children: /* @__PURE__ */ jsxs(Button, { type: "button", children: [
|
|
24
|
-
/* @__PURE__ */ jsx(IconLogin, {}),
|
|
25
|
-
"Continue with single sign-on"
|
|
26
|
-
] }) }),
|
|
27
|
-
/* @__PURE__ */ jsx(LabeledSeparator, { children: "or sign in with email" }),
|
|
28
|
-
/* @__PURE__ */ jsxs(Field, { children: [
|
|
29
|
-
/* @__PURE__ */ jsx(FieldLabel, { htmlFor: "email", children: "Email" }),
|
|
30
|
-
/* @__PURE__ */ jsx(
|
|
31
|
-
Input,
|
|
32
|
-
{
|
|
33
|
-
id: "email",
|
|
34
|
-
type: "email",
|
|
35
|
-
placeholder: "m@example.com",
|
|
36
|
-
required: true
|
|
37
|
-
}
|
|
38
|
-
)
|
|
39
|
-
] }),
|
|
40
|
-
/* @__PURE__ */ jsxs(Field, { className: "relative [&>a]:w-auto", children: [
|
|
41
|
-
/* @__PURE__ */ jsx(FieldLabel, { htmlFor: "password", children: "Password" }),
|
|
42
|
-
/* @__PURE__ */ jsx(Input, { id: "password", type: "password", required: true }),
|
|
43
|
-
/* @__PURE__ */ jsx(Link, { href: "#", className: "absolute top-0 right-0 text-sm", children: "Forgot your password?" })
|
|
44
|
-
] }),
|
|
45
|
-
/* @__PURE__ */ jsx(Field, { children: /* @__PURE__ */ jsxs(Button, { type: "submit", variant: "outline", color: "primary", children: [
|
|
46
|
-
/* @__PURE__ */ jsx(IconKey, {}),
|
|
47
|
-
"Login"
|
|
48
|
-
] }) }),
|
|
49
|
-
/* @__PURE__ */ jsx(LabeledSeparator, { children: "or" }),
|
|
50
|
-
/* @__PURE__ */ jsxs(Field, { children: [
|
|
51
|
-
/* @__PURE__ */ jsxs(Button, { type: "button", variant: "outline", color: "grey", children: [
|
|
52
|
-
/* @__PURE__ */ jsx(IconMail, {}),
|
|
53
|
-
"Email me a magic link instead"
|
|
54
|
-
] }),
|
|
55
|
-
/* @__PURE__ */ jsx(FieldDescription, { children: "We'll send a password-free sign-in link to the email above." })
|
|
56
|
-
] }),
|
|
57
|
-
/* @__PURE__ */ jsx(Separator, { className: "bg-grey-200" }),
|
|
58
|
-
/* @__PURE__ */ jsx(Field, { children: /* @__PURE__ */ jsxs(FieldDescription, { className: "text-center", children: [
|
|
59
|
-
"Don't have an account? ",
|
|
60
|
-
/* @__PURE__ */ jsx(Link, { href: "#", children: "Sign up" })
|
|
61
|
-
] }) })
|
|
62
|
-
] }) }) })
|
|
63
|
-
] }) });
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export { LoginForm };
|
|
67
|
-
//# sourceMappingURL=login-form.js.map
|
|
68
|
-
//# s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AAC,KAAA,EAAA,EACC,QAAA,kBAAA,IAAA,CAAC,gBAAA,EAAA,EAAiB,WAAU,aAAA,EAAc,QAAA,EAAA;AAAA,QAAA,yBAAA;AAAA,wBACZ,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAK,GAAA,EAAI,QAAA,EAAA,SAAA,EAAO;AAAA,OAAA,EACpD,CAAA,EACF;AAAA,KAAA,EACF,GACF,CAAA,EACF;AAAA,GAAA,EACF,CAAA,EACF,CAAA;AAEJ","file":"login-form.js","sourcesContent":["'use client'\n\nimport type * as React from 'react'\n\nimport { Button } from '../components/button.js'\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from '../components/card.js'\nimport {\n Field,\n FieldDescription,\n FieldGroup,\n FieldLabel,\n} from '../components/field.js'\nimport { Input } from '../components/input.js'\nimport { LabeledSeparator } from '../components/labeled-separator.js'\nimport { Link } from '../components/link.js'\nimport { Separator } from '../components/separator.js'\nimport { IconKey, IconLogin, IconMail } from '../icons/index.js'\nimport { cn } from '../lib/utils.js'\n\nexport function LoginForm({\n className,\n ...props\n}: React.ComponentProps<'div'>) {\n return (\n <div className={cn('flex flex-col gap-6', className)} {...props}>\n <Card className=\"w-full\">\n <CardHeader>\n <CardTitle>Login to your account</CardTitle>\n <CardDescription>\n Choose how you'd like to sign in\n </CardDescription>\n </CardHeader>\n <CardContent>\n <form>\n <FieldGroup>\n {/*\n * Best-practice sign-in order, most-recommended first:\n * 1. Single sign-on (SSO) — the preferred path\n * 2. Email + password — the traditional fallback\n * 3. Magic link — passwordless, reuses the email\n * Each method is divided by a LabeledSeparator so it reads as a\n * distinct alternative. Only SSO carries primary (solid)\n * emphasis — one primary action per view — with password Login\n * and the magic link stepped down to outline treatments.\n */}\n {/* 1 — Single sign-on: the recommended first option */}\n <Field>\n <Button type=\"button\">\n <IconLogin />\n Continue with single sign-on\n </Button>\n </Field>\n <LabeledSeparator>or sign in with email</LabeledSeparator>\n {/* 2 — Email + password */}\n <Field>\n <FieldLabel htmlFor=\"email\">Email</FieldLabel>\n <Input\n id=\"email\"\n type=\"email\"\n placeholder=\"m@example.com\"\n required\n />\n </Field>\n <Field className=\"relative [&>a]:w-auto\">\n <FieldLabel htmlFor=\"password\">Password</FieldLabel>\n <Input id=\"password\" type=\"password\" required />\n {/*\n * Placed AFTER the input in DOM (rather than next to the\n * label) so keyboard tab order is email → password → forgot,\n * not email → forgot → password. Visually positioned at the\n * top-right via absolute positioning to preserve the\n * \"Forgot your password?\" alongside-label layout. See WCAG\n * 2.4.3 Focus Order test in\n * login-form.accessibility.stories.tsx.\n */}\n <Link href=\"#\" className=\"absolute top-0 right-0 text-sm\">\n Forgot your password?\n </Link>\n </Field>\n <Field>\n <Button type=\"submit\" variant=\"outline\" color=\"primary\">\n <IconKey />\n Login\n </Button>\n </Field>\n {/* 3 — Magic link: passwordless, sent to the email entered above */}\n <LabeledSeparator>or</LabeledSeparator>\n <Field>\n <Button type=\"button\" variant=\"outline\" color=\"grey\">\n <IconMail />\n Email me a magic link instead\n </Button>\n <FieldDescription>\n We'll send a password-free sign-in link to the email\n above.\n </FieldDescription>\n </Field>\n <Separator className=\"bg-grey-200\" />\n <Field>\n <FieldDescription className=\"text-center\">\n Don't have an account? <Link href=\"#\">Sign up</Link>\n </FieldDescription>\n </Field>\n </FieldGroup>\n </form>\n </CardContent>\n </Card>\n </div>\n )\n}\n"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* SignUpForm — the account-creation counterpart to LoginForm.
|
|
5
|
-
*
|
|
6
|
-
* A composed pattern (Card + Field + Input + Button), published as a worked
|
|
7
|
-
* example: copy the source and wire the fields to your own registration
|
|
8
|
-
* handler rather than configuring it through props.
|
|
9
|
-
*
|
|
10
|
-
* Best-practice notes baked in:
|
|
11
|
-
* - Single sign-on (Microsoft Entra ID) leads as the recommended path with
|
|
12
|
-
* solid emphasis; email + password registration is the fallback, grouped
|
|
13
|
-
* in a FieldSet whose legend names the set for assistive tech.
|
|
14
|
-
* - `autoComplete="new-password"` on both the password and confirm-password
|
|
15
|
-
* fields tells password managers to offer/save a generated password (vs.
|
|
16
|
-
* the `current-password` hint LoginForm uses).
|
|
17
|
-
* - A visible password-requirements hint is associated with the input via
|
|
18
|
-
* `aria-describedby` so screen readers announce the rules (WCAG 3.3.2).
|
|
19
|
-
* - Terms acceptance is communicated inline at the point of action rather
|
|
20
|
-
* than via a pre-checked checkbox.
|
|
21
|
-
*/
|
|
22
|
-
declare function SignUpForm({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
23
|
-
|
|
24
|
-
export { SignUpForm };
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import { Button } from '../components/button.js';
|
|
4
|
-
import { Card, CardHeader, CardTitle, CardDescription, CardContent } from '../components/card.js';
|
|
5
|
-
import { FieldGroup, Field, FieldDescription, FieldSet, FieldLegend, FieldLabel } from '../components/field.js';
|
|
6
|
-
import { Input } from '../components/input.js';
|
|
7
|
-
import { LabeledSeparator } from '../components/labeled-separator.js';
|
|
8
|
-
import { Link } from '../components/link.js';
|
|
9
|
-
import { IconLogin, IconPersonAdd } from '../icons/index.js';
|
|
10
|
-
import { cn } from '../lib/utils.js';
|
|
11
|
-
|
|
12
|
-
function SignUpForm({
|
|
13
|
-
className,
|
|
14
|
-
...props
|
|
15
|
-
}) {
|
|
16
|
-
return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col gap-6", className), ...props, children: /* @__PURE__ */ jsxs(Card, { className: "w-full", children: [
|
|
17
|
-
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
18
|
-
/* @__PURE__ */ jsx(CardTitle, { children: "Create your account" }),
|
|
19
|
-
/* @__PURE__ */ jsx(CardDescription, { children: "Enter your details below to create a new account." })
|
|
20
|
-
] }),
|
|
21
|
-
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("form", { children: /* @__PURE__ */ jsxs(FieldGroup, { children: [
|
|
22
|
-
/* @__PURE__ */ jsxs(Field, { children: [
|
|
23
|
-
/* @__PURE__ */ jsx(FieldDescription, { children: "Use your NSW Government Microsoft Entra ID account to sign up with a single click \u2014 no separate password required." }),
|
|
24
|
-
/* @__PURE__ */ jsxs(Button, { type: "button", children: [
|
|
25
|
-
/* @__PURE__ */ jsx(IconLogin, {}),
|
|
26
|
-
"Create account with Microsoft Entra ID"
|
|
27
|
-
] })
|
|
28
|
-
] }),
|
|
29
|
-
/* @__PURE__ */ jsx(LabeledSeparator, { children: "or" }),
|
|
30
|
-
/* @__PURE__ */ jsxs(FieldSet, { children: [
|
|
31
|
-
/* @__PURE__ */ jsx(FieldLegend, { className: "text-base", children: "Register with email and password" }),
|
|
32
|
-
/* @__PURE__ */ jsxs(Field, { children: [
|
|
33
|
-
/* @__PURE__ */ jsx(FieldLabel, { htmlFor: "name", children: "Full name" }),
|
|
34
|
-
/* @__PURE__ */ jsx(
|
|
35
|
-
Input,
|
|
36
|
-
{
|
|
37
|
-
id: "name",
|
|
38
|
-
type: "text",
|
|
39
|
-
autoComplete: "name",
|
|
40
|
-
placeholder: "Jane Citizen",
|
|
41
|
-
required: true
|
|
42
|
-
}
|
|
43
|
-
)
|
|
44
|
-
] }),
|
|
45
|
-
/* @__PURE__ */ jsxs(Field, { children: [
|
|
46
|
-
/* @__PURE__ */ jsx(FieldLabel, { htmlFor: "email", children: "Email" }),
|
|
47
|
-
/* @__PURE__ */ jsx(
|
|
48
|
-
Input,
|
|
49
|
-
{
|
|
50
|
-
id: "email",
|
|
51
|
-
type: "email",
|
|
52
|
-
autoComplete: "email",
|
|
53
|
-
placeholder: "m@example.com",
|
|
54
|
-
required: true
|
|
55
|
-
}
|
|
56
|
-
)
|
|
57
|
-
] }),
|
|
58
|
-
/* @__PURE__ */ jsxs(Field, { children: [
|
|
59
|
-
/* @__PURE__ */ jsx(FieldLabel, { htmlFor: "password", children: "Password" }),
|
|
60
|
-
/* @__PURE__ */ jsx(
|
|
61
|
-
Input,
|
|
62
|
-
{
|
|
63
|
-
id: "password",
|
|
64
|
-
type: "password",
|
|
65
|
-
autoComplete: "new-password",
|
|
66
|
-
"aria-describedby": "password-requirements",
|
|
67
|
-
required: true
|
|
68
|
-
}
|
|
69
|
-
),
|
|
70
|
-
/* @__PURE__ */ jsx(FieldDescription, { id: "password-requirements", children: "Use at least 8 characters, including a number and a symbol." })
|
|
71
|
-
] }),
|
|
72
|
-
/* @__PURE__ */ jsxs(Field, { children: [
|
|
73
|
-
/* @__PURE__ */ jsx(FieldLabel, { htmlFor: "confirm-password", children: "Confirm password" }),
|
|
74
|
-
/* @__PURE__ */ jsx(
|
|
75
|
-
Input,
|
|
76
|
-
{
|
|
77
|
-
id: "confirm-password",
|
|
78
|
-
type: "password",
|
|
79
|
-
autoComplete: "new-password",
|
|
80
|
-
required: true
|
|
81
|
-
}
|
|
82
|
-
)
|
|
83
|
-
] })
|
|
84
|
-
] }),
|
|
85
|
-
/* @__PURE__ */ jsxs(Field, { children: [
|
|
86
|
-
/* @__PURE__ */ jsxs(Button, { type: "submit", children: [
|
|
87
|
-
/* @__PURE__ */ jsx(IconPersonAdd, {}),
|
|
88
|
-
"Create account"
|
|
89
|
-
] }),
|
|
90
|
-
/* @__PURE__ */ jsxs(FieldDescription, { className: "text-center", children: [
|
|
91
|
-
"By creating an account you agree to our",
|
|
92
|
-
" ",
|
|
93
|
-
/* @__PURE__ */ jsx(Link, { href: "#", children: "Terms of Service" }),
|
|
94
|
-
" and",
|
|
95
|
-
" ",
|
|
96
|
-
/* @__PURE__ */ jsx(Link, { href: "#", children: "Privacy Policy" }),
|
|
97
|
-
"."
|
|
98
|
-
] })
|
|
99
|
-
] }),
|
|
100
|
-
/* @__PURE__ */ jsx(Field, { children: /* @__PURE__ */ jsxs(FieldDescription, { className: "text-center", children: [
|
|
101
|
-
"Already have an account? ",
|
|
102
|
-
/* @__PURE__ */ jsx(Link, { href: "#", children: "Login" })
|
|
103
|
-
] }) })
|
|
104
|
-
] }) }) })
|
|
105
|
-
] }) });
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export { SignUpForm };
|
|
109
|
-
//# sourceMappingURL=sign-up-form.js.map
|
|
110
|
-
//# sourceMappingURL=sign-up-form.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/sign-up-form.tsx"],"names":[],"mappings":";;;;;;;;;;AA6CO,SAAS,UAAA,CAAW;AAAA,EACzB,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAgC;AAC9B,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,EAAA,CAAG,qBAAA,EAAuB,SAAS,CAAA,EAAI,GAAG,KAAA,EACxD,QAAA,kBAAA,IAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAU,QAAA,EACd,QAAA,EAAA;AAAA,oBAAA,IAAA,CAAC,UAAA,EAAA,EACC,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,aAAU,QAAA,EAAA,qBAAA,EAAmB,CAAA;AAAA,sBAC9B,GAAA,CAAC,mBAAgB,QAAA,EAAA,mDAAA,EAEjB;AAAA,KAAA,EACF,CAAA;AAAA,oBACA,GAAA,CAAC,WAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EACC,+BAAC,UAAA,EAAA,EAOC,QAAA,EAAA;AAAA,sBAAA,IAAA,CAAC,KAAA,EAAA,EACC,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,oBAAiB,QAAA,EAAA,yHAAA,EAGlB,CAAA;AAAA,wBACA,IAAA,CAAC,MAAA,EAAA,EAAO,IAAA,EAAK,QAAA,EACX,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,SAAA,EAAA,EAAU,CAAA;AAAA,UAAE;AAAA,SAAA,EAEf;AAAA,OAAA,EACF,CAAA;AAA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Ac,QAAA,EAAA;AAAA,QAAA,2BAAA;AAAA,wBACf,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAK,GAAA,EAAI,QAAA,EAAA,OAAA,EAAK;AAAA,OAAA,EAC/C,CAAA,EACF;AAAA,KAAA,EACF,GACF,CAAA,EACF;AAAA,GAAA,EACF,CAAA,EACF,CAAA;AAEJ","file":"sign-up-form.js","sourcesContent":["'use client'\n\nimport type * as React from 'react'\n\nimport { Button } from '../components/button.js'\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from '../components/card.js'\nimport {\n Field,\n FieldDescription,\n FieldGroup,\n FieldLabel,\n FieldLegend,\n FieldSet,\n} from '../components/field.js'\nimport { Input } from '../components/input.js'\nimport { LabeledSeparator } from '../components/labeled-separator.js'\nimport { Link } from '../components/link.js'\nimport { IconLogin, IconPersonAdd } from '../icons/index.js'\nimport { cn } from '../lib/utils.js'\n\n/**\n * SignUpForm — the account-creation counterpart to LoginForm.\n *\n * A composed pattern (Card + Field + Input + Button), published as a worked\n * example: copy the source and wire the fields to your own registration\n * handler rather than configuring it through props.\n *\n * Best-practice notes baked in:\n * - Single sign-on (Microsoft Entra ID) leads as the recommended path with\n * solid emphasis; email + password registration is the fallback, grouped\n * in a FieldSet whose legend names the set for assistive tech.\n * - `autoComplete=\"new-password\"` on both the password and confirm-password\n * fields tells password managers to offer/save a generated password (vs.\n * the `current-password` hint LoginForm uses).\n * - A visible password-requirements hint is associated with the input via\n * `aria-describedby` so screen readers announce the rules (WCAG 3.3.2).\n * - Terms acceptance is communicated inline at the point of action rather\n * than via a pre-checked checkbox.\n */\nexport function SignUpForm({\n className,\n ...props\n}: React.ComponentProps<'div'>) {\n return (\n <div className={cn('flex flex-col gap-6', className)} {...props}>\n <Card className=\"w-full\">\n <CardHeader>\n <CardTitle>Create your account</CardTitle>\n <CardDescription>\n Enter your details below to create a new account.\n </CardDescription>\n </CardHeader>\n <CardContent>\n <form>\n <FieldGroup>\n {/*\n * Single sign-on first: NSW Government staff authenticate with\n * Microsoft Entra ID, so SSO is the recommended path and carries\n * primary (solid) emphasis. Email + password registration is the\n * fallback below the separator.\n */}\n <Field>\n <FieldDescription>\n Use your NSW Government Microsoft Entra ID account to sign up\n with a single click — no separate password required.\n </FieldDescription>\n <Button type=\"button\">\n <IconLogin />\n Create account with Microsoft Entra ID\n </Button>\n </Field>\n\n <LabeledSeparator>or</LabeledSeparator>\n\n {/*\n * Email + password registration grouped in a FieldSet so the\n * \"Register with email and password\" legend names the whole set\n * for assistive tech, not just one field.\n */}\n <FieldSet>\n <FieldLegend className=\"text-base\">\n Register with email and password\n </FieldLegend>\n <Field>\n <FieldLabel htmlFor=\"name\">Full name</FieldLabel>\n <Input\n id=\"name\"\n type=\"text\"\n autoComplete=\"name\"\n placeholder=\"Jane Citizen\"\n required\n />\n </Field>\n <Field>\n <FieldLabel htmlFor=\"email\">Email</FieldLabel>\n <Input\n id=\"email\"\n type=\"email\"\n autoComplete=\"email\"\n placeholder=\"m@example.com\"\n required\n />\n </Field>\n <Field>\n <FieldLabel htmlFor=\"password\">Password</FieldLabel>\n <Input\n id=\"password\"\n type=\"password\"\n autoComplete=\"new-password\"\n aria-describedby=\"password-requirements\"\n required\n />\n <FieldDescription id=\"password-requirements\">\n Use at least 8 characters, including a number and a symbol.\n </FieldDescription>\n </Field>\n <Field>\n <FieldLabel htmlFor=\"confirm-password\">\n Confirm password\n </FieldLabel>\n <Input\n id=\"confirm-password\"\n type=\"password\"\n autoComplete=\"new-password\"\n required\n />\n </Field>\n </FieldSet>\n <Field>\n <Button type=\"submit\">\n <IconPersonAdd />\n Create account\n </Button>\n <FieldDescription className=\"text-center\">\n By creating an account you agree to our{' '}\n <Link href=\"#\">Terms of Service</Link> and{' '}\n <Link href=\"#\">Privacy Policy</Link>.\n </FieldDescription>\n </Field>\n <Field>\n <FieldDescription className=\"text-center\">\n Already have an account? <Link href=\"#\">Login</Link>\n </FieldDescription>\n </Field>\n </FieldGroup>\n </form>\n </CardContent>\n </Card>\n </div>\n )\n}\n"]}
|