@nswds/ui 1.4.0 → 1.6.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 +3 -1
- package/dist/components/badge.js +1 -0
- package/dist/components/badge.js.map +1 -1
- package/dist/components/button.d.ts +3 -1
- package/dist/components/button.js +1 -0
- package/dist/components/button.js.map +1 -1
- package/dist/components/card.d.ts +8 -8
- package/dist/components/card.js +6 -6
- package/dist/components/card.js.map +1 -1
- package/dist/components/field.d.ts +12 -12
- package/dist/components/field.js +7 -7
- package/dist/components/field.js.map +1 -1
- package/dist/components/forgot-password-form.d.ts +18 -0
- package/dist/components/forgot-password-form.js +44 -0
- package/dist/components/forgot-password-form.js.map +1 -0
- package/dist/components/label.d.ts +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/label.js.map +1 -1
- package/dist/components/labeled-separator.d.ts +19 -0
- package/dist/components/labeled-separator.js +34 -0
- package/dist/components/labeled-separator.js.map +1 -0
- package/dist/components/link.d.ts +45 -10
- package/dist/components/link.js +120 -4
- package/dist/components/link.js.map +1 -1
- package/dist/components/login-form.d.ts +1 -1
- package/dist/components/login-form.js +31 -22
- package/dist/components/login-form.js.map +1 -1
- package/dist/components/separator.d.ts +11 -2
- package/dist/components/separator.js +21 -9
- package/dist/components/separator.js.map +1 -1
- package/dist/components/sign-up-form.d.ts +25 -0
- package/dist/components/sign-up-form.js +110 -0
- package/dist/components/sign-up-form.js.map +1 -0
- package/dist/components/spinner.d.ts +7 -1
- package/dist/components/spinner.js +13 -2
- package/dist/components/spinner.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* SignUpForm — the account-creation counterpart to LoginForm.
|
|
6
|
+
*
|
|
7
|
+
* A composed pattern (Card + Field + Input + Button), published as a worked
|
|
8
|
+
* example: copy the source and wire the fields to your own registration
|
|
9
|
+
* handler rather than configuring it through props.
|
|
10
|
+
*
|
|
11
|
+
* Best-practice notes baked in:
|
|
12
|
+
* - Single sign-on (Microsoft Entra ID) leads as the recommended path with
|
|
13
|
+
* solid emphasis; email + password registration is the fallback, grouped
|
|
14
|
+
* in a FieldSet whose legend names the set for assistive tech.
|
|
15
|
+
* - `autoComplete="new-password"` on both the password and confirm-password
|
|
16
|
+
* fields tells password managers to offer/save a generated password (vs.
|
|
17
|
+
* the `current-password` hint LoginForm uses).
|
|
18
|
+
* - A visible password-requirements hint is associated with the input via
|
|
19
|
+
* `aria-describedby` so screen readers announce the rules (WCAG 3.3.2).
|
|
20
|
+
* - Terms acceptance is communicated inline at the point of action rather
|
|
21
|
+
* than via a pre-checked checkbox.
|
|
22
|
+
*/
|
|
23
|
+
declare function SignUpForm({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
24
|
+
|
|
25
|
+
export { SignUpForm };
|
|
@@ -0,0 +1,110 @@
|
|
|
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 { Icons } from '../components/icons.js';
|
|
7
|
+
import { Input } from '../components/input.js';
|
|
8
|
+
import { LabeledSeparator } from '../components/labeled-separator.js';
|
|
9
|
+
import { Link } from '../components/link.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(Icons.login, {}),
|
|
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(Icons.person_add, {}),
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,wBA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AAAA,0BAC3C,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAK,GAAA,EAAI,QAAA,EAAA,gBAAA,EAAc,CAAA;AAAA,UAAO;AAAA,SAAA,EACtC;AAAA,OAAA,EACF,CAAA;AAAA,sBACA,GAAA,CAAC,KAAA,EAAA,EACC,QAAA,kBAAA,IAAA,CAAC,gBAAA,EAAA,EAAiB,WAAU,aAAA,EAAc,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 { Icons } from '../components/icons.js'\nimport { Input } from '../components/input.js'\nimport { LabeledSeparator } from '../components/labeled-separator.js'\nimport { Link } from '../components/link.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 <Icons.login />\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 <Icons.person_add />\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"]}
|
|
@@ -9,11 +9,17 @@ declare const theme: {
|
|
|
9
9
|
lg: string;
|
|
10
10
|
xl: string;
|
|
11
11
|
};
|
|
12
|
+
color: {
|
|
13
|
+
primary: string;
|
|
14
|
+
accent: string;
|
|
15
|
+
white: string;
|
|
16
|
+
};
|
|
12
17
|
};
|
|
13
18
|
type SpinnerProps = {
|
|
14
19
|
className?: string;
|
|
15
20
|
size?: keyof typeof theme.size;
|
|
21
|
+
color?: keyof typeof theme.color;
|
|
16
22
|
} & React.HTMLAttributes<HTMLSpanElement>;
|
|
17
|
-
declare function Spinner({ className, size, ...props }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
23
|
+
declare function Spinner({ className, size, color, ...props }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
18
24
|
|
|
19
25
|
export { Spinner };
|
|
@@ -9,16 +9,27 @@ const theme = {
|
|
|
9
9
|
md: "h-6 w-6",
|
|
10
10
|
lg: "h-8 w-8",
|
|
11
11
|
xl: "h-10 w-10"
|
|
12
|
+
},
|
|
13
|
+
color: {
|
|
14
|
+
primary: "fill-primary-800 text-grey-400",
|
|
15
|
+
accent: "fill-accent-600 text-grey-400",
|
|
16
|
+
white: "fill-white text-white/30"
|
|
12
17
|
}
|
|
13
18
|
};
|
|
14
|
-
function Spinner({
|
|
19
|
+
function Spinner({
|
|
20
|
+
className,
|
|
21
|
+
size = "md",
|
|
22
|
+
color = "primary",
|
|
23
|
+
...props
|
|
24
|
+
}) {
|
|
15
25
|
return /* @__PURE__ */ jsx("span", { role: "status", ...props, children: /* @__PURE__ */ jsxs(
|
|
16
26
|
"svg",
|
|
17
27
|
{
|
|
18
28
|
fill: "none",
|
|
19
29
|
viewBox: "0 0 100 101",
|
|
20
30
|
className: cn(
|
|
21
|
-
"inline animate-spin
|
|
31
|
+
"inline animate-spin",
|
|
32
|
+
theme.color[color],
|
|
22
33
|
theme.size[size],
|
|
23
34
|
className
|
|
24
35
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/spinner.tsx"],"names":[],"mappings":";;;AAKA,MAAM,KAAA,GAAQ;AAAA,EACZ,IAAA,EAAM;AAAA,IACJ,EAAA,EAAI,SAAA;AAAA,IACJ,EAAA,EAAI,SAAA;AAAA,IACJ,EAAA,EAAI,SAAA;AAAA,IACJ,EAAA,EAAI,SAAA;AAAA,IACJ,EAAA,EAAI;AAAA;
|
|
1
|
+
{"version":3,"sources":["../../src/components/spinner.tsx"],"names":[],"mappings":";;;AAKA,MAAM,KAAA,GAAQ;AAAA,EACZ,IAAA,EAAM;AAAA,IACJ,EAAA,EAAI,SAAA;AAAA,IACJ,EAAA,EAAI,SAAA;AAAA,IACJ,EAAA,EAAI,SAAA;AAAA,IACJ,EAAA,EAAI,SAAA;AAAA,IACJ,EAAA,EAAI;AAAA,GACN;AAAA,EACA,KAAA,EAAO;AAAA,IACL,OAAA,EAAS,gCAAA;AAAA,IACT,MAAA,EAAQ,+BAAA;AAAA,IACR,KAAA,EAAO;AAAA;AAEX,CAAA;AAQA,SAAS,OAAA,CAAQ;AAAA,EACf,SAAA;AAAA,EACA,IAAA,GAAO,IAAA;AAAA,EACP,KAAA,GAAQ,SAAA;AAAA,EACR,GAAG;AACL,CAAA,EAAiB;AACf,EAAA,uBACE,GAAA,CAAC,MAAA,EAAA,EAAK,IAAA,EAAK,QAAA,EAAU,GAAG,KAAA,EACtB,QAAA,kBAAA,IAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,MAAA;AAAA,MACL,OAAA,EAAQ,aAAA;AAAA,MACR,SAAA,EAAW,EAAA;AAAA,QACT,qBAAA;AAAA,QACA,KAAA,CAAM,MAAM,KAAK,CAAA;AAAA,QACjB,KAAA,CAAM,KAAK,IAAI,CAAA;AAAA,QACf;AAAA,OACF;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,CAAA,EAAE,8WAAA;AAAA,YACF,IAAA,EAAK;AAAA;AAAA,SACP;AAAA,wBACA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,CAAA,EAAE,+kBAAA;AAAA,YACF,IAAA,EAAK;AAAA;AAAA;AACP;AAAA;AAAA,GACF,EACF,CAAA;AAEJ","file":"spinner.js","sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../lib/utils.js'\n\nconst theme = {\n size: {\n xs: 'h-3 w-3',\n sm: 'h-4 w-4',\n md: 'h-6 w-6',\n lg: 'h-8 w-8',\n xl: 'h-10 w-10',\n },\n color: {\n primary: 'fill-primary-800 text-grey-400',\n accent: 'fill-accent-600 text-grey-400',\n white: 'fill-white text-white/30',\n },\n}\n\ntype SpinnerProps = {\n className?: string\n size?: keyof typeof theme.size\n color?: keyof typeof theme.color\n} & React.HTMLAttributes<HTMLSpanElement>\n\nfunction Spinner({\n className,\n size = 'md',\n color = 'primary',\n ...props\n}: SpinnerProps) {\n return (\n <span role=\"status\" {...props}>\n <svg\n fill=\"none\"\n viewBox=\"0 0 100 101\"\n className={cn(\n 'inline animate-spin',\n theme.color[color],\n theme.size[size],\n className\n )}\n >\n <path\n d=\"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z\"\n fill=\"currentFill\"\n />\n </svg>\n </span>\n )\n}\n\nexport { Spinner }\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ export { Badge, BadgeButton, badgeVariants } from './components/badge.js';
|
|
|
2
2
|
export { Button, TouchTarget, buttonVariants } from './components/button.js';
|
|
3
3
|
export { DescriptionDetails, DescriptionList, DescriptionTerm } from './components/description-list.js';
|
|
4
4
|
export { IconName, Icons } from './components/icons.js';
|
|
5
|
-
export {
|
|
5
|
+
export { LabeledSeparator } from './components/labeled-separator.js';
|
|
6
|
+
export { ExternalLink, ExternalLinkProps, Link, LinkComponent, LinkProps, LinkProvider, linkVariants } from './components/link.js';
|
|
6
7
|
export { Logo } from './components/logo.js';
|
|
7
8
|
export { Spinner } from './components/spinner.js';
|
|
8
9
|
export { aboriginal, allPalettes, brand, colorThemes, colors, diverging, semantic, sequential } from './lib/color-palette.js';
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export * from './components/badge.js';
|
|
|
2
2
|
export * from './components/button.js';
|
|
3
3
|
export * from './components/description-list.js';
|
|
4
4
|
export * from './components/icons.js';
|
|
5
|
+
export * from './components/labeled-separator.js';
|
|
5
6
|
export * from './components/link.js';
|
|
6
7
|
export * from './components/logo.js';
|
|
7
8
|
export * from './components/spinner.js';
|