@nswds/app 1.101.0 → 1.103.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/globals.css +102 -0
- package/dist/index.cjs +959 -154
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +954 -150
- package/dist/index.js.map +1 -1
- package/dist/styles.css +99 -0
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var AccordionPrimitive = require('@radix-ui/react-accordion');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var
|
|
5
|
+
var clsx13 = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
7
|
var classVarianceAuthority = require('class-variance-authority');
|
|
8
8
|
var AlertDialogPrimitive = require('@radix-ui/react-alert-dialog');
|
|
@@ -89,7 +89,7 @@ function _interopNamespace(e) {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
|
|
92
|
-
var
|
|
92
|
+
var clsx13__default = /*#__PURE__*/_interopDefault(clsx13);
|
|
93
93
|
var AlertDialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(AlertDialogPrimitive);
|
|
94
94
|
var React5__namespace = /*#__PURE__*/_interopNamespace(React5);
|
|
95
95
|
var Headless4__namespace = /*#__PURE__*/_interopNamespace(Headless4);
|
|
@@ -4054,7 +4054,7 @@ var Icons = {
|
|
|
4054
4054
|
zoom_out_map: (props) => /* @__PURE__ */ jsxRuntime.jsx("svg", { fill: "currentColor", "data-slot": "icon", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M256-200h64q17 0 28.5 11.5T360-160q0 17-11.5 28.5T320-120H160q-17 0-28.5-11.5T120-160v-160q0-17 11.5-28.5T160-360q17 0 28.5 11.5T200-320v64l96-96q11-11 28-11t28 11q11 11 11 28t-11 28l-96 96Zm448 0-96-96q-11-11-11-28t11-28q11-11 28-11t28 11l96 96v-64q0-17 11.5-28.5T800-360q17 0 28.5 11.5T840-320v160q0 17-11.5 28.5T800-120H640q-17 0-28.5-11.5T600-160q0-17 11.5-28.5T640-200h64ZM200-704v64q0 17-11.5 28.5T160-600q-17 0-28.5-11.5T120-640v-160q0-17 11.5-28.5T160-840h160q17 0 28.5 11.5T360-800q0 17-11.5 28.5T320-760h-64l96 96q11 11 11 28t-11 28q-11 11-28 11t-28-11l-96-96Zm560 0-96 96q-11 11-28 11t-28-11q-11-11-11-28t11-28l96-96h-64q-17 0-28.5-11.5T600-800q0-17 11.5-28.5T640-840h160q17 0 28.5 11.5T840-800v160q0 17-11.5 28.5T800-600q-17 0-28.5-11.5T760-640v-64Z" }) })
|
|
4055
4055
|
};
|
|
4056
4056
|
function cn(...inputs) {
|
|
4057
|
-
return tailwindMerge.twMerge(
|
|
4057
|
+
return tailwindMerge.twMerge(clsx13.clsx(inputs));
|
|
4058
4058
|
}
|
|
4059
4059
|
function truncate(text, maxLength) {
|
|
4060
4060
|
if (text.length <= maxLength) {
|
|
@@ -4553,7 +4553,7 @@ var Button2 = React5.forwardRef(function Button3({ className, variant, color: co
|
|
|
4553
4553
|
{
|
|
4554
4554
|
"data-variant": variant,
|
|
4555
4555
|
...props,
|
|
4556
|
-
className:
|
|
4556
|
+
className: clsx13__default.default(classes, "cursor-pointer"),
|
|
4557
4557
|
ref,
|
|
4558
4558
|
children: /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, { children })
|
|
4559
4559
|
}
|
|
@@ -6012,7 +6012,7 @@ var BadgeButton = React5.forwardRef(function BadgeButton2({
|
|
|
6012
6012
|
children,
|
|
6013
6013
|
...props
|
|
6014
6014
|
}, ref) {
|
|
6015
|
-
const classes =
|
|
6015
|
+
const classes = clsx13__default.default(className, focusOutline[color2], [
|
|
6016
6016
|
// Base
|
|
6017
6017
|
"group relative inline-flex rounded-sm",
|
|
6018
6018
|
// Focus
|
|
@@ -6034,7 +6034,7 @@ var BadgeButton = React5.forwardRef(function BadgeButton2({
|
|
|
6034
6034
|
{
|
|
6035
6035
|
"data-variant": variant,
|
|
6036
6036
|
...props,
|
|
6037
|
-
className:
|
|
6037
|
+
className: clsx13__default.default(classes, "cursor-pointer"),
|
|
6038
6038
|
ref,
|
|
6039
6039
|
children: /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, { children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant, color: color2, size, children }) })
|
|
6040
6040
|
}
|
|
@@ -14676,7 +14676,7 @@ function CodePreview({
|
|
|
14676
14676
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14677
14677
|
"div",
|
|
14678
14678
|
{
|
|
14679
|
-
className:
|
|
14679
|
+
className: clsx13.clsx(
|
|
14680
14680
|
"group mx-auto bg-white bg-gradient-to-r dark:bg-grey-900",
|
|
14681
14681
|
view === "desktop" && "w-full",
|
|
14682
14682
|
view === "tablet" && "max-w-lg",
|
|
@@ -14944,7 +14944,7 @@ function ColorCard({ name, token, hex: hex2, rgb: rgb2, hsl, oklch: oklch2, form
|
|
|
14944
14944
|
{
|
|
14945
14945
|
className: "flex h-24 w-full items-center justify-center",
|
|
14946
14946
|
style: { backgroundColor: hex2 },
|
|
14947
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("p", { className:
|
|
14947
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: clsx13.clsx("font-medium", isLightColor(hex2) ? "text-primary-950" : "text-white"), children: name })
|
|
14948
14948
|
}
|
|
14949
14949
|
),
|
|
14950
14950
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2 p-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -15277,7 +15277,7 @@ function Heading({
|
|
|
15277
15277
|
...props,
|
|
15278
15278
|
id: computedId,
|
|
15279
15279
|
"data-anchor": true,
|
|
15280
|
-
className:
|
|
15280
|
+
className: clsx13__default.default(
|
|
15281
15281
|
className,
|
|
15282
15282
|
trimClasses[trim],
|
|
15283
15283
|
"m-0",
|
|
@@ -15694,7 +15694,7 @@ function PairDetailCard({
|
|
|
15694
15694
|
]
|
|
15695
15695
|
}
|
|
15696
15696
|
);
|
|
15697
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "gap-0", children: [
|
|
15697
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "gap-0 pb-0", children: [
|
|
15698
15698
|
/* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "gap-4 border-b", children: [
|
|
15699
15699
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
15700
15700
|
/* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: role }),
|
|
@@ -15708,24 +15708,25 @@ function PairDetailCard({
|
|
|
15708
15708
|
}
|
|
15709
15709
|
)
|
|
15710
15710
|
] }),
|
|
15711
|
-
/* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: "px-0", children: /* @__PURE__ */ jsxRuntime.jsx("
|
|
15712
|
-
/* @__PURE__ */ jsxRuntime.
|
|
15713
|
-
|
|
15711
|
+
/* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: "px-0 pb-3", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "divide-y divide-grey-100 dark:divide-grey-800", children: valueRows.map((row) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4 px-6 py-3", children: [
|
|
15712
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
15713
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-semibold tracking-[0.16em] text-muted-foreground uppercase", children: row.label }),
|
|
15714
15714
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15715
|
-
"
|
|
15715
|
+
"p",
|
|
15716
15716
|
{
|
|
15717
15717
|
className: cn(
|
|
15718
|
-
"min-w-0
|
|
15718
|
+
"mt-2 min-w-0 text-base text-foreground",
|
|
15719
15719
|
row.mono && "font-mono text-sm break-all sm:text-base"
|
|
15720
15720
|
),
|
|
15721
15721
|
children: row.value
|
|
15722
15722
|
}
|
|
15723
|
-
)
|
|
15724
|
-
|
|
15725
|
-
|
|
15726
|
-
|
|
15727
|
-
)
|
|
15728
|
-
|
|
15723
|
+
)
|
|
15724
|
+
] }),
|
|
15725
|
+
row.copyable ? renderCopyButton(
|
|
15726
|
+
row.key,
|
|
15727
|
+
`Copy ${role.toLowerCase()} ${row.label.toLowerCase()}`,
|
|
15728
|
+
"mt-0.5"
|
|
15729
|
+
) : null
|
|
15729
15730
|
] }, row.key)) }) })
|
|
15730
15731
|
] });
|
|
15731
15732
|
}
|
|
@@ -16356,6 +16357,877 @@ function ColorPairingTool({
|
|
|
16356
16357
|
const normalizedVisibleFormats = [...new Set(visibleFormats)];
|
|
16357
16358
|
return /* @__PURE__ */ jsxRuntime.jsx(React5.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(ColorPairingToolLoading, {}), children: /* @__PURE__ */ jsxRuntime.jsx(ColorPairingToolContent, { visibleFormats: normalizedVisibleFormats }) });
|
|
16358
16359
|
}
|
|
16360
|
+
function Text({ className, trim = "normal", size = 2, label = false, ...props }) {
|
|
16361
|
+
const textSizeClasses = {
|
|
16362
|
+
1: "text-[length:var(--font-size-1)] leading-[var(--line-height-28)] tracking-[var(--letter-spacing-0)]",
|
|
16363
|
+
2: "text-[length:var(--font-size-2)] leading-[var(--line-height-24)] tracking-[var(--letter-spacing-0)]",
|
|
16364
|
+
3: "text-[length:var(--font-size-3)] leading-[var(--line-height-20)] tracking-[var(--letter-spacing-0)]",
|
|
16365
|
+
4: "text-[length:var(--font-size-4)] leading-[var(--line-height-20)] tracking-[var(--letter-spacing-0)]"
|
|
16366
|
+
};
|
|
16367
|
+
const labelSizeClasses = {
|
|
16368
|
+
1: "text-[length:var(--font-size-1)] leading-[var(--line-height-24)] tracking-[var(--letter-spacing-0)]",
|
|
16369
|
+
2: "text-[length:var(--font-size-2)] leading-[var(--line-height-20)] tracking-[var(--letter-spacing-0)]",
|
|
16370
|
+
3: "text-[length:var(--font-size-3)] leading-[var(--line-height-16)] tracking-[var(--letter-spacing-0)]",
|
|
16371
|
+
4: "text-[length:var(--font-size-4)] leading-[var(--line-height-16)] tracking-[var(--letter-spacing-0)]"
|
|
16372
|
+
};
|
|
16373
|
+
const sizeClass = label ? labelSizeClasses[size] : textSizeClasses[size];
|
|
16374
|
+
const trimClasses = {
|
|
16375
|
+
normal: ["before:content-none after:content-none"],
|
|
16376
|
+
start: [
|
|
16377
|
+
'before:content-[""] before:table after:content-none',
|
|
16378
|
+
"before:mb-[calc(var(--leading-trim-start,var(--default-leading-trim-start))-var(--line-height,calc(1em*var(--default-line-height)))/2)]"
|
|
16379
|
+
],
|
|
16380
|
+
end: [
|
|
16381
|
+
'before:content-none after:content-[""] after:table',
|
|
16382
|
+
"after:mt-[calc(var(--leading-trim-end,var(--default-leading-trim-end))-var(--line-height,calc(1em*var(--default-line-height)))/2)]"
|
|
16383
|
+
],
|
|
16384
|
+
both: [
|
|
16385
|
+
'before:content-[""] before:table after:content-[""] after:table',
|
|
16386
|
+
"before:mb-[calc(var(--leading-trim-start,var(--default-leading-trim-start))-var(--line-height,calc(1em*var(--default-line-height)))/2)]",
|
|
16387
|
+
"after:mt-[calc(var(--leading-trim-end,var(--default-leading-trim-end))-var(--line-height,calc(1em*var(--default-line-height)))/2)]"
|
|
16388
|
+
]
|
|
16389
|
+
};
|
|
16390
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16391
|
+
"p",
|
|
16392
|
+
{
|
|
16393
|
+
"data-slot": "text",
|
|
16394
|
+
...props,
|
|
16395
|
+
className: clsx13__default.default(className, trimClasses[trim], "text-grey-800 dark:text-grey-400", sizeClass)
|
|
16396
|
+
}
|
|
16397
|
+
);
|
|
16398
|
+
}
|
|
16399
|
+
function TextLink({ className, ...props }) {
|
|
16400
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16401
|
+
Link,
|
|
16402
|
+
{
|
|
16403
|
+
...props,
|
|
16404
|
+
className: clsx13__default.default(
|
|
16405
|
+
className,
|
|
16406
|
+
"text-primary-800 underline decoration-primary-800/50 data-hover:decoration-primary-800 dark:text-white dark:decoration-white/50 dark:data-hover:decoration-white"
|
|
16407
|
+
)
|
|
16408
|
+
}
|
|
16409
|
+
);
|
|
16410
|
+
}
|
|
16411
|
+
function Strong({ className, ...props }) {
|
|
16412
|
+
return /* @__PURE__ */ jsxRuntime.jsx("strong", { ...props, className: clsx13__default.default(className, "font-medium text-grey-950 dark:text-white") });
|
|
16413
|
+
}
|
|
16414
|
+
function Code({ className, ...props }) {
|
|
16415
|
+
const hasLanguageClass = typeof className === "string" && className.includes("language-");
|
|
16416
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16417
|
+
"code",
|
|
16418
|
+
{
|
|
16419
|
+
...props,
|
|
16420
|
+
className: clsx13__default.default(
|
|
16421
|
+
className,
|
|
16422
|
+
!hasLanguageClass && "language-plaintext",
|
|
16423
|
+
"text-sm sm:text-[0.8125rem]"
|
|
16424
|
+
)
|
|
16425
|
+
}
|
|
16426
|
+
);
|
|
16427
|
+
}
|
|
16428
|
+
var PREFERRED_BACKGROUND_TONES2 = [400, 600, 200, 800, 100, 50];
|
|
16429
|
+
var DEFAULT_VISIBLE_FORMATS2 = ["hex", "rgb", "hsl", "oklch"];
|
|
16430
|
+
var DEFAULT_INITIAL_BACKGROUND_TOKEN2 = "nsw-blue-800";
|
|
16431
|
+
var DEFAULT_INITIAL_PAIR_ID2 = "nsw-blue-800:nsw-blue-200";
|
|
16432
|
+
function getToneFromToken2(token) {
|
|
16433
|
+
if (!token) return null;
|
|
16434
|
+
const match = token.match(/-(\d+)$/);
|
|
16435
|
+
return match ? Number.parseInt(match[1], 10) : null;
|
|
16436
|
+
}
|
|
16437
|
+
function getFamilySwatchColor2(family, preferredTone = 600) {
|
|
16438
|
+
const exactMatch = family.colors.find((color2) => color2.tone === preferredTone);
|
|
16439
|
+
if (exactMatch) {
|
|
16440
|
+
return exactMatch.hex;
|
|
16441
|
+
}
|
|
16442
|
+
const closestMatch = [...family.colors].sort(
|
|
16443
|
+
(left, right) => Math.abs(left.tone - preferredTone) - Math.abs(right.tone - preferredTone)
|
|
16444
|
+
)[0];
|
|
16445
|
+
return closestMatch?.hex ?? "transparent";
|
|
16446
|
+
}
|
|
16447
|
+
function getFamilySelectorLabel2(family, themeCategory, selectionRole) {
|
|
16448
|
+
if (themeCategory !== "aboriginal") {
|
|
16449
|
+
return family.label;
|
|
16450
|
+
}
|
|
16451
|
+
const preferredTone = selectionRole === "primary colour" ? 800 : 600;
|
|
16452
|
+
return family.colors.find((color2) => color2.tone === preferredTone)?.name ?? family.label;
|
|
16453
|
+
}
|
|
16454
|
+
function getPairingColorDisplayName2(color2) {
|
|
16455
|
+
return color2.name ?? color2.token;
|
|
16456
|
+
}
|
|
16457
|
+
function isWhiteForegroundPair2(pair) {
|
|
16458
|
+
return pair.foreground.token === "white";
|
|
16459
|
+
}
|
|
16460
|
+
function getWhiteForegroundGuidance2(pair) {
|
|
16461
|
+
if (pair.passes.aaaText) {
|
|
16462
|
+
return "White is approved for headings, body copy, and calls to action on this background.";
|
|
16463
|
+
}
|
|
16464
|
+
if (pair.passes.aaaLarge) {
|
|
16465
|
+
return "Use white only for WCAG large text on this background, such as headings at 24px+ or bold text at 18.5px+. Keep sentence-case body copy at 16px+ and use a darker recommended foreground instead.";
|
|
16466
|
+
}
|
|
16467
|
+
return "Do not use white on this background. Choose one of the recommended foregrounds below instead.";
|
|
16468
|
+
}
|
|
16469
|
+
function getPreviewGuidance2(pair, isRecommended) {
|
|
16470
|
+
if (!isWhiteForegroundPair2(pair)) {
|
|
16471
|
+
return "Use only AAA-recommended combinations across your selected primary, accent, and grey families.";
|
|
16472
|
+
}
|
|
16473
|
+
if (isRecommended) {
|
|
16474
|
+
return "Use white text on dark colour only when it meets AAA for headings, body copy, and calls to action.";
|
|
16475
|
+
}
|
|
16476
|
+
return getWhiteForegroundGuidance2(pair);
|
|
16477
|
+
}
|
|
16478
|
+
function getReadableTextColor(tone) {
|
|
16479
|
+
return tone >= 600 ? "#ffffff" : "#002664";
|
|
16480
|
+
}
|
|
16481
|
+
function getPreferredPairForBackground2(pairs, preferredPairId) {
|
|
16482
|
+
if (preferredPairId) {
|
|
16483
|
+
const preferredPair = pairs.find((pair) => pair.id === preferredPairId);
|
|
16484
|
+
if (preferredPair) {
|
|
16485
|
+
return preferredPair;
|
|
16486
|
+
}
|
|
16487
|
+
}
|
|
16488
|
+
return pairs.find((pair) => !isWhiteForegroundPair2(pair)) ?? pairs[0] ?? null;
|
|
16489
|
+
}
|
|
16490
|
+
function getDefaultBackgroundToken2(context) {
|
|
16491
|
+
for (const tone of PREFERRED_BACKGROUND_TONES2) {
|
|
16492
|
+
for (const group of context.backgroundGroups) {
|
|
16493
|
+
const match = group.backgrounds.find(
|
|
16494
|
+
(background) => background.tone === tone && (context.pairsByBackground[background.token]?.length ?? 0) > 0
|
|
16495
|
+
);
|
|
16496
|
+
if (match) {
|
|
16497
|
+
return match.token;
|
|
16498
|
+
}
|
|
16499
|
+
}
|
|
16500
|
+
}
|
|
16501
|
+
for (const tone of PREFERRED_BACKGROUND_TONES2) {
|
|
16502
|
+
for (const group of context.backgroundGroups) {
|
|
16503
|
+
const match = group.backgrounds.find((background) => background.tone === tone);
|
|
16504
|
+
if (match) {
|
|
16505
|
+
return match.token;
|
|
16506
|
+
}
|
|
16507
|
+
}
|
|
16508
|
+
}
|
|
16509
|
+
return context.backgrounds[0]?.token ?? "";
|
|
16510
|
+
}
|
|
16511
|
+
function resolveBackgroundToken2(context, preferredToken, preferredTone) {
|
|
16512
|
+
if (preferredToken && context.backgrounds.some((background) => background.token === preferredToken)) {
|
|
16513
|
+
return preferredToken;
|
|
16514
|
+
}
|
|
16515
|
+
if (preferredTone !== null && preferredTone !== void 0) {
|
|
16516
|
+
for (const group of context.backgroundGroups) {
|
|
16517
|
+
const match = group.backgrounds.find((background) => background.tone === preferredTone);
|
|
16518
|
+
if (match) {
|
|
16519
|
+
return match.token;
|
|
16520
|
+
}
|
|
16521
|
+
}
|
|
16522
|
+
}
|
|
16523
|
+
return getDefaultBackgroundToken2(context);
|
|
16524
|
+
}
|
|
16525
|
+
function getInitialPairingState2(searchParams) {
|
|
16526
|
+
const paletteParam = searchParams.get("palette");
|
|
16527
|
+
const primaryParam = searchParams.get("primary");
|
|
16528
|
+
const accentParam = searchParams.get("accent");
|
|
16529
|
+
const pairParam = searchParams.get("pair");
|
|
16530
|
+
const backgroundParam = searchParams.get("background");
|
|
16531
|
+
const themeCategory = paletteParam === "brand" || paletteParam === "aboriginal" ? paletteParam : "brand";
|
|
16532
|
+
const context = getPairingContext(themeCategory, primaryParam, accentParam);
|
|
16533
|
+
const shouldUseDefaultBrandExample = !backgroundParam && !pairParam && themeCategory === "brand" && context.primary.key === "blue" && context.accent.key === "red";
|
|
16534
|
+
const defaultBackgroundToken = shouldUseDefaultBrandExample ? context.backgrounds.some(
|
|
16535
|
+
(background) => background.token === DEFAULT_INITIAL_BACKGROUND_TOKEN2
|
|
16536
|
+
) ? DEFAULT_INITIAL_BACKGROUND_TOKEN2 : null : null;
|
|
16537
|
+
const defaultPairId = shouldUseDefaultBrandExample && defaultBackgroundToken && context.pairsByBackground[defaultBackgroundToken]?.some(
|
|
16538
|
+
(pair) => pair.id === DEFAULT_INITIAL_PAIR_ID2
|
|
16539
|
+
) ? DEFAULT_INITIAL_PAIR_ID2 : null;
|
|
16540
|
+
const pairBackgroundToken = context.recommendedPairs.find((pair) => pair.id === pairParam)?.background.token ?? null;
|
|
16541
|
+
const selectedBackgroundToken = resolveBackgroundToken2(
|
|
16542
|
+
context,
|
|
16543
|
+
backgroundParam ?? pairBackgroundToken ?? defaultBackgroundToken,
|
|
16544
|
+
getToneFromToken2(backgroundParam ?? pairBackgroundToken ?? defaultBackgroundToken)
|
|
16545
|
+
);
|
|
16546
|
+
const selectedPairId = getPreferredPairForBackground2(
|
|
16547
|
+
context.pairsByBackground[selectedBackgroundToken] ?? [],
|
|
16548
|
+
pairParam ?? defaultPairId
|
|
16549
|
+
)?.id ?? "";
|
|
16550
|
+
return {
|
|
16551
|
+
accentKey: context.accent.key,
|
|
16552
|
+
primaryKey: context.primary.key,
|
|
16553
|
+
selectedBackgroundToken,
|
|
16554
|
+
selectedPairId,
|
|
16555
|
+
themeCategory
|
|
16556
|
+
};
|
|
16557
|
+
}
|
|
16558
|
+
function ColorPairingToolV2Loading() {
|
|
16559
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-8 lg:grid-cols-[18rem_minmax(0,1fr)]", children: [
|
|
16560
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6 bg-grey-50/70 p-6", children: [
|
|
16561
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-10 rounded-sm bg-grey-100" }),
|
|
16562
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-40 rounded-sm bg-grey-100" }),
|
|
16563
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-52 rounded-sm bg-grey-100" })
|
|
16564
|
+
] }),
|
|
16565
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
16566
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-12 rounded-sm bg-grey-100" }),
|
|
16567
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-64 rounded-sm bg-grey-100" }),
|
|
16568
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-40 rounded-sm bg-grey-100" }),
|
|
16569
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-4 md:grid-cols-2 xl:grid-cols-3", children: [
|
|
16570
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-44 rounded-sm bg-grey-100" }),
|
|
16571
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-44 rounded-sm bg-grey-100" }),
|
|
16572
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-44 rounded-sm bg-grey-100" })
|
|
16573
|
+
] })
|
|
16574
|
+
] })
|
|
16575
|
+
] });
|
|
16576
|
+
}
|
|
16577
|
+
function SidebarStep({
|
|
16578
|
+
children,
|
|
16579
|
+
description,
|
|
16580
|
+
step,
|
|
16581
|
+
title
|
|
16582
|
+
}) {
|
|
16583
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "space-y-4", children: [
|
|
16584
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
16585
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-[0.72rem] font-semibold tracking-[0.12em] text-muted-foreground uppercase", children: [
|
|
16586
|
+
"Step ",
|
|
16587
|
+
step
|
|
16588
|
+
] }),
|
|
16589
|
+
/* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 3, size: 6, className: "text-foreground", trim: "normal", children: title }),
|
|
16590
|
+
description ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm/6 text-muted-foreground", children: description }) : null
|
|
16591
|
+
] }),
|
|
16592
|
+
children
|
|
16593
|
+
] });
|
|
16594
|
+
}
|
|
16595
|
+
function PreviewHeroCard({
|
|
16596
|
+
familySummary,
|
|
16597
|
+
isRecommended,
|
|
16598
|
+
pair
|
|
16599
|
+
}) {
|
|
16600
|
+
const whiteForeground = isWhiteForegroundPair2(pair);
|
|
16601
|
+
const statusLabel = isRecommended ? "Pass" : pair.passes.aaaLarge ? "Large text only" : "Example only";
|
|
16602
|
+
const StatusIcon = isRecommended ? Icons.check : Icons.info;
|
|
16603
|
+
const fauxButtonStyle = {
|
|
16604
|
+
"--btn-bg": pair.foreground.hex,
|
|
16605
|
+
"--btn-border": pair.foreground.hex,
|
|
16606
|
+
"--btn-text": pair.background.hex,
|
|
16607
|
+
"--btn-icon": pair.background.hex,
|
|
16608
|
+
"--btn-hover-overlay": pair.background.hex
|
|
16609
|
+
};
|
|
16610
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Card, { className: "gap-0 overflow-hidden py-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16611
|
+
"div",
|
|
16612
|
+
{
|
|
16613
|
+
className: "p-6 sm:min-h-[26rem] sm:p-8",
|
|
16614
|
+
style: {
|
|
16615
|
+
backgroundColor: pair.background.hex,
|
|
16616
|
+
color: pair.foreground.hex
|
|
16617
|
+
},
|
|
16618
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-[22rem] flex-col justify-between gap-8", children: [
|
|
16619
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
16620
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16621
|
+
"span",
|
|
16622
|
+
{
|
|
16623
|
+
className: "inline-flex items-center gap-2 rounded-full border px-3 py-1 text-[0.72rem] font-semibold tracking-[0.16em] uppercase",
|
|
16624
|
+
style: {
|
|
16625
|
+
borderColor: pair.foreground.hex,
|
|
16626
|
+
backgroundColor: pair.foreground.hex,
|
|
16627
|
+
color: pair.background.hex
|
|
16628
|
+
},
|
|
16629
|
+
children: [
|
|
16630
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icons.palette, { "data-slot": "icon", className: "size-4" }),
|
|
16631
|
+
familySummary
|
|
16632
|
+
]
|
|
16633
|
+
}
|
|
16634
|
+
),
|
|
16635
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16636
|
+
"span",
|
|
16637
|
+
{
|
|
16638
|
+
className: "inline-flex rounded-full border px-3 py-1 text-[0.72rem] font-semibold tracking-[0.16em] uppercase",
|
|
16639
|
+
style: {
|
|
16640
|
+
borderColor: pair.foreground.hex
|
|
16641
|
+
},
|
|
16642
|
+
children: [
|
|
16643
|
+
pair.rating,
|
|
16644
|
+
" ",
|
|
16645
|
+
pair.contrastRatio.toFixed(2),
|
|
16646
|
+
":1"
|
|
16647
|
+
]
|
|
16648
|
+
}
|
|
16649
|
+
)
|
|
16650
|
+
] }),
|
|
16651
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-xl space-y-4 pb-12 sm:pb-16", children: [
|
|
16652
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold tracking-[0.22em] uppercase", children: whiteForeground && !isRecommended ? "White on colour example" : whiteForeground ? "White on colour" : "Colour on colour" }),
|
|
16653
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
16654
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "max-w-lg text-4xl leading-none font-bold text-current sm:text-5xl", children: "Pair colour with confidence." }),
|
|
16655
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-md text-base/6 sm:text-base/7", children: getPreviewGuidance2(pair, isRecommended) }),
|
|
16656
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16657
|
+
"span",
|
|
16658
|
+
{
|
|
16659
|
+
"aria-hidden": "true",
|
|
16660
|
+
"data-variant": "solid",
|
|
16661
|
+
className: cn(
|
|
16662
|
+
buttonVariants({ variant: "solid", size: "default" }),
|
|
16663
|
+
"pointer-events-none cursor-default px-6 text-[16px] font-[700] select-none sm:px-6 sm:text-[16px] sm:font-[700]"
|
|
16664
|
+
),
|
|
16665
|
+
style: fauxButtonStyle,
|
|
16666
|
+
children: "Get started"
|
|
16667
|
+
}
|
|
16668
|
+
)
|
|
16669
|
+
] })
|
|
16670
|
+
] }),
|
|
16671
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
16672
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16673
|
+
"span",
|
|
16674
|
+
{
|
|
16675
|
+
className: "inline-flex items-center gap-2 rounded-full px-4 py-2 text-sm font-semibold",
|
|
16676
|
+
style: {
|
|
16677
|
+
backgroundColor: pair.foreground.hex,
|
|
16678
|
+
color: pair.background.hex
|
|
16679
|
+
},
|
|
16680
|
+
children: [
|
|
16681
|
+
statusLabel,
|
|
16682
|
+
/* @__PURE__ */ jsxRuntime.jsx(StatusIcon, { "data-slot": "icon", className: "size-4" })
|
|
16683
|
+
]
|
|
16684
|
+
}
|
|
16685
|
+
),
|
|
16686
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16687
|
+
"span",
|
|
16688
|
+
{
|
|
16689
|
+
className: "inline-flex rounded-full border px-4 py-2 text-sm",
|
|
16690
|
+
style: {
|
|
16691
|
+
borderColor: pair.foreground.hex
|
|
16692
|
+
},
|
|
16693
|
+
children: [
|
|
16694
|
+
pair.background.token,
|
|
16695
|
+
" / ",
|
|
16696
|
+
pair.foreground.token
|
|
16697
|
+
]
|
|
16698
|
+
}
|
|
16699
|
+
)
|
|
16700
|
+
] })
|
|
16701
|
+
] })
|
|
16702
|
+
}
|
|
16703
|
+
) });
|
|
16704
|
+
}
|
|
16705
|
+
function PreviewFallbackCard2({ background }) {
|
|
16706
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Card, { className: "gap-0 overflow-hidden py-0", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16707
|
+
"div",
|
|
16708
|
+
{
|
|
16709
|
+
className: "space-y-6 px-6 py-7 sm:px-8 sm:py-8",
|
|
16710
|
+
style: {
|
|
16711
|
+
backgroundColor: background.hex,
|
|
16712
|
+
color: getReadableTextColor(background.tone)
|
|
16713
|
+
},
|
|
16714
|
+
children: [
|
|
16715
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold", children: "Hero preview" }),
|
|
16716
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-xl space-y-4", children: [
|
|
16717
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "max-w-lg text-3xl leading-tight font-bold sm:text-4xl", children: "No AAA combination available." }),
|
|
16718
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-lg text-base/7", children: "This background tone is approved, but there are no recommended AAA foreground pairings available for it in the current tool." })
|
|
16719
|
+
] })
|
|
16720
|
+
]
|
|
16721
|
+
}
|
|
16722
|
+
) });
|
|
16723
|
+
}
|
|
16724
|
+
function PairDetailCard2({
|
|
16725
|
+
color: color2,
|
|
16726
|
+
role,
|
|
16727
|
+
visibleFormats
|
|
16728
|
+
}) {
|
|
16729
|
+
const [, copyToClipboardRaw] = usehooks.useCopyToClipboard();
|
|
16730
|
+
const [copiedField, setCopiedField] = React5.useState(null);
|
|
16731
|
+
const copiedFieldTimeoutRef = React5.useRef(null);
|
|
16732
|
+
const hasDisplayTone = color2.token !== "white";
|
|
16733
|
+
const formatRows = visibleFormats.map((format) => ({
|
|
16734
|
+
key: format,
|
|
16735
|
+
label: format.toUpperCase(),
|
|
16736
|
+
value: color2[format],
|
|
16737
|
+
mono: true,
|
|
16738
|
+
copyable: true
|
|
16739
|
+
}));
|
|
16740
|
+
const valueRows = [
|
|
16741
|
+
{ key: "token", label: "Token", value: color2.token, mono: true, copyable: true },
|
|
16742
|
+
{
|
|
16743
|
+
key: "tone",
|
|
16744
|
+
label: "Tone",
|
|
16745
|
+
value: hasDisplayTone ? String(color2.tone) : "Not applicable",
|
|
16746
|
+
mono: false,
|
|
16747
|
+
copyable: hasDisplayTone
|
|
16748
|
+
},
|
|
16749
|
+
...formatRows
|
|
16750
|
+
];
|
|
16751
|
+
React5.useEffect(() => {
|
|
16752
|
+
return () => {
|
|
16753
|
+
if (copiedFieldTimeoutRef.current) {
|
|
16754
|
+
clearTimeout(copiedFieldTimeoutRef.current);
|
|
16755
|
+
}
|
|
16756
|
+
};
|
|
16757
|
+
}, []);
|
|
16758
|
+
const copyField = (field) => {
|
|
16759
|
+
if (field === "tone" && !hasDisplayTone) {
|
|
16760
|
+
return;
|
|
16761
|
+
}
|
|
16762
|
+
const fieldValue = valueRows.find((row) => row.key === field)?.value;
|
|
16763
|
+
if (!fieldValue) return;
|
|
16764
|
+
copyToClipboardRaw(fieldValue);
|
|
16765
|
+
setCopiedField(field);
|
|
16766
|
+
const toastLabel = valueRows.find((row) => row.key === field)?.label ?? "Value";
|
|
16767
|
+
sonner.toast(`${toastLabel} copied to clipboard`, {
|
|
16768
|
+
duration: 2e3
|
|
16769
|
+
});
|
|
16770
|
+
if (copiedFieldTimeoutRef.current) {
|
|
16771
|
+
clearTimeout(copiedFieldTimeoutRef.current);
|
|
16772
|
+
}
|
|
16773
|
+
copiedFieldTimeoutRef.current = setTimeout(() => {
|
|
16774
|
+
setCopiedField(null);
|
|
16775
|
+
copiedFieldTimeoutRef.current = null;
|
|
16776
|
+
}, 2e3);
|
|
16777
|
+
};
|
|
16778
|
+
const renderCopyButton = (field, srLabel, className) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16779
|
+
Button2,
|
|
16780
|
+
{
|
|
16781
|
+
variant: "ghost",
|
|
16782
|
+
size: "icon",
|
|
16783
|
+
className: cn("shrink-0", className),
|
|
16784
|
+
onClick: () => copyField(field),
|
|
16785
|
+
children: [
|
|
16786
|
+
copiedField === field ? /* @__PURE__ */ jsxRuntime.jsx(Icons.check, { "data-slot": "icon", className: "size-5" }) : /* @__PURE__ */ jsxRuntime.jsx(Icons.content_copy, { "data-slot": "icon", className: "size-5" }),
|
|
16787
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: srLabel })
|
|
16788
|
+
]
|
|
16789
|
+
}
|
|
16790
|
+
);
|
|
16791
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "gap-0 pb-0", children: [
|
|
16792
|
+
/* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "gap-4 border-b", children: [
|
|
16793
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
16794
|
+
/* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: role }),
|
|
16795
|
+
/* @__PURE__ */ jsxRuntime.jsx(CardDescription, { children: color2.name ?? color2.token })
|
|
16796
|
+
] }),
|
|
16797
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16798
|
+
"div",
|
|
16799
|
+
{
|
|
16800
|
+
className: "h-14 w-full rounded-sm border border-grey-200 shadow-sm dark:border-grey-700",
|
|
16801
|
+
style: { backgroundColor: color2.hex }
|
|
16802
|
+
}
|
|
16803
|
+
)
|
|
16804
|
+
] }),
|
|
16805
|
+
/* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: "px-0 pb-3", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "divide-y divide-grey-100 dark:divide-grey-800", children: valueRows.map((row) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4 px-6 py-3", children: [
|
|
16806
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
16807
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-semibold tracking-[0.16em] text-muted-foreground uppercase", children: row.label }),
|
|
16808
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16809
|
+
"p",
|
|
16810
|
+
{
|
|
16811
|
+
className: cn(
|
|
16812
|
+
"mt-2 min-w-0 text-base text-foreground",
|
|
16813
|
+
row.mono && "font-mono text-sm break-all sm:text-base"
|
|
16814
|
+
),
|
|
16815
|
+
children: row.value
|
|
16816
|
+
}
|
|
16817
|
+
)
|
|
16818
|
+
] }),
|
|
16819
|
+
row.copyable ? renderCopyButton(
|
|
16820
|
+
row.key,
|
|
16821
|
+
`Copy ${role.toLowerCase()} ${row.label.toLowerCase()}`,
|
|
16822
|
+
"mt-0.5"
|
|
16823
|
+
) : null
|
|
16824
|
+
] }, row.key)) }) })
|
|
16825
|
+
] });
|
|
16826
|
+
}
|
|
16827
|
+
function AccessibilityScoreCard({ pair }) {
|
|
16828
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "gap-0 py-0", children: [
|
|
16829
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-5 px-6 py-6 sm:flex-row sm:items-end sm:justify-between", children: [
|
|
16830
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
16831
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold text-foreground", children: "Accessibility score" }),
|
|
16832
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
16833
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-5xl leading-none font-bold text-foreground", children: pair ? `${pair.contrastRatio.toFixed(2)}:1` : "N/A" }),
|
|
16834
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base text-muted-foreground", children: "Contrast ratio" })
|
|
16835
|
+
] })
|
|
16836
|
+
] }),
|
|
16837
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16838
|
+
"span",
|
|
16839
|
+
{
|
|
16840
|
+
className: cn(
|
|
16841
|
+
"inline-flex items-center gap-2 rounded-full px-4 py-2 text-base font-semibold",
|
|
16842
|
+
pair ? "bg-success-700 text-white" : "border border-grey-300 bg-background text-foreground"
|
|
16843
|
+
),
|
|
16844
|
+
children: pair ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
16845
|
+
"Pass AAA",
|
|
16846
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icons.check, { "data-slot": "icon", className: "size-5" })
|
|
16847
|
+
] }) : "No AAA result"
|
|
16848
|
+
}
|
|
16849
|
+
)
|
|
16850
|
+
] }),
|
|
16851
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-grey-200 px-6 py-4 dark:border-grey-700", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: pair ? "Meets WCAG 2.1 AAA standards for large and normal text." : "Choose a different approved background tone to review recommended AAA pairings." }) })
|
|
16852
|
+
] });
|
|
16853
|
+
}
|
|
16854
|
+
function RecommendedPairCard({
|
|
16855
|
+
isSelected,
|
|
16856
|
+
onSelect,
|
|
16857
|
+
pair
|
|
16858
|
+
}) {
|
|
16859
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16860
|
+
"button",
|
|
16861
|
+
{
|
|
16862
|
+
type: "button",
|
|
16863
|
+
"aria-label": `Use ${getPairingColorDisplayName2(pair.foreground)} on ${getPairingColorDisplayName2(pair.background)}`,
|
|
16864
|
+
"aria-pressed": isSelected,
|
|
16865
|
+
onClick: onSelect,
|
|
16866
|
+
className: cn(
|
|
16867
|
+
"overflow-hidden rounded-sm border bg-background text-left transition-colors",
|
|
16868
|
+
isSelected ? "border-primary-700 ring-2 ring-primary-700 ring-offset-2 ring-offset-background" : "border-grey-200 hover:border-grey-400 dark:border-grey-700 dark:hover:border-grey-500"
|
|
16869
|
+
),
|
|
16870
|
+
children: [
|
|
16871
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16872
|
+
"div",
|
|
16873
|
+
{
|
|
16874
|
+
className: "min-h-32 space-y-3 px-4 py-4",
|
|
16875
|
+
style: {
|
|
16876
|
+
backgroundColor: pair.background.hex,
|
|
16877
|
+
color: pair.foreground.hex
|
|
16878
|
+
},
|
|
16879
|
+
children: [
|
|
16880
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-[0.68rem] font-semibold tracking-[0.12em] uppercase opacity-90", children: [
|
|
16881
|
+
pair.background.token,
|
|
16882
|
+
" / ",
|
|
16883
|
+
pair.foreground.token
|
|
16884
|
+
] }),
|
|
16885
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
16886
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-2xl leading-tight font-bold", children: getPairingColorDisplayName2(pair.foreground) }),
|
|
16887
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm/6 opacity-90", children: [
|
|
16888
|
+
pair.foreground.familyLabel,
|
|
16889
|
+
" on ",
|
|
16890
|
+
pair.background.familyLabel
|
|
16891
|
+
] })
|
|
16892
|
+
] })
|
|
16893
|
+
]
|
|
16894
|
+
}
|
|
16895
|
+
),
|
|
16896
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-4 px-4 py-3", children: [
|
|
16897
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-semibold text-foreground", children: [
|
|
16898
|
+
pair.contrastRatio.toFixed(2),
|
|
16899
|
+
":1"
|
|
16900
|
+
] }),
|
|
16901
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center gap-1 rounded-full bg-success-50 px-2.5 py-1 text-xs font-semibold text-success-800 dark:bg-success-950/30 dark:text-success-200", children: "AAA" })
|
|
16902
|
+
] })
|
|
16903
|
+
]
|
|
16904
|
+
}
|
|
16905
|
+
);
|
|
16906
|
+
}
|
|
16907
|
+
function ColorPairingToolV2Content({ visibleFormats }) {
|
|
16908
|
+
const searchParams = navigation.useSearchParams();
|
|
16909
|
+
const [initialState] = React5.useState(() => getInitialPairingState2(searchParams));
|
|
16910
|
+
const [themeCategory, setThemeCategory] = React5.useState(initialState.themeCategory);
|
|
16911
|
+
const [primaryFamilyKey, setPrimaryFamilyKey] = React5.useState(initialState.primaryKey);
|
|
16912
|
+
const [accentFamilyKey, setAccentFamilyKey] = React5.useState(initialState.accentKey);
|
|
16913
|
+
const [selectedBackgroundToken, setSelectedBackgroundToken] = React5.useState(
|
|
16914
|
+
initialState.selectedBackgroundToken
|
|
16915
|
+
);
|
|
16916
|
+
const [selectedPairId, setSelectedPairId] = React5.useState(initialState.selectedPairId);
|
|
16917
|
+
const themeFamilies = getPairingFamilies(themeCategory);
|
|
16918
|
+
const context = getPairingContext(themeCategory, primaryFamilyKey, accentFamilyKey);
|
|
16919
|
+
const selectableFamilies = themeFamilies.filter((family) => family.key !== context.grey.key);
|
|
16920
|
+
const selectableAccentFamilies = selectableFamilies.filter(
|
|
16921
|
+
(family) => family.key !== context.primary.key
|
|
16922
|
+
);
|
|
16923
|
+
const selectedBackground = context.backgrounds.find((background) => background.token === selectedBackgroundToken) ?? context.backgrounds[0] ?? null;
|
|
16924
|
+
const selectedBackgroundPairs = selectedBackground ? context.pairsByBackground[selectedBackground.token] ?? [] : [];
|
|
16925
|
+
const selectedPair = getPreferredPairForBackground2(selectedBackgroundPairs, selectedPairId);
|
|
16926
|
+
const detailForeground = selectedPair?.foreground ?? null;
|
|
16927
|
+
const familySummary = [context.primary.label, context.accent.label, context.grey.label].join(
|
|
16928
|
+
" + "
|
|
16929
|
+
);
|
|
16930
|
+
const updateUrlParams = (nextThemeCategory, nextPrimaryKey, nextAccentKey, nextSelectedBackgroundToken, nextSelectedPairId) => {
|
|
16931
|
+
const params = new URLSearchParams(window.location.search);
|
|
16932
|
+
params.delete("family");
|
|
16933
|
+
params.set("palette", nextThemeCategory);
|
|
16934
|
+
params.set("primary", nextPrimaryKey);
|
|
16935
|
+
params.set("accent", nextAccentKey);
|
|
16936
|
+
params.set("background", nextSelectedBackgroundToken);
|
|
16937
|
+
if (nextSelectedPairId) {
|
|
16938
|
+
params.set("pair", nextSelectedPairId);
|
|
16939
|
+
} else {
|
|
16940
|
+
params.delete("pair");
|
|
16941
|
+
}
|
|
16942
|
+
window.history.replaceState(
|
|
16943
|
+
null,
|
|
16944
|
+
"",
|
|
16945
|
+
`${window.location.pathname}?${params.toString()}${window.location.hash}`
|
|
16946
|
+
);
|
|
16947
|
+
};
|
|
16948
|
+
const syncSelection = (nextThemeCategory, nextPrimaryKey, nextAccentKey, preferredBackgroundToken, preferredPairId) => {
|
|
16949
|
+
const nextContext = getPairingContext(nextThemeCategory, nextPrimaryKey, nextAccentKey);
|
|
16950
|
+
const nextSelectedBackgroundToken = resolveBackgroundToken2(
|
|
16951
|
+
nextContext,
|
|
16952
|
+
preferredBackgroundToken,
|
|
16953
|
+
getToneFromToken2(preferredBackgroundToken)
|
|
16954
|
+
);
|
|
16955
|
+
const nextSelectedPairId = getPreferredPairForBackground2(
|
|
16956
|
+
nextContext.pairsByBackground[nextSelectedBackgroundToken] ?? [],
|
|
16957
|
+
preferredPairId
|
|
16958
|
+
)?.id ?? "";
|
|
16959
|
+
setThemeCategory(nextThemeCategory);
|
|
16960
|
+
setPrimaryFamilyKey(nextContext.primary.key);
|
|
16961
|
+
setAccentFamilyKey(nextContext.accent.key);
|
|
16962
|
+
setSelectedBackgroundToken(nextSelectedBackgroundToken);
|
|
16963
|
+
setSelectedPairId(nextSelectedPairId);
|
|
16964
|
+
updateUrlParams(
|
|
16965
|
+
nextThemeCategory,
|
|
16966
|
+
nextContext.primary.key,
|
|
16967
|
+
nextContext.accent.key,
|
|
16968
|
+
nextSelectedBackgroundToken,
|
|
16969
|
+
nextSelectedPairId
|
|
16970
|
+
);
|
|
16971
|
+
};
|
|
16972
|
+
const handleThemeCategoryChange = (nextThemeCategory) => {
|
|
16973
|
+
syncSelection(
|
|
16974
|
+
nextThemeCategory,
|
|
16975
|
+
primaryFamilyKey,
|
|
16976
|
+
accentFamilyKey,
|
|
16977
|
+
selectedBackgroundToken,
|
|
16978
|
+
selectedPairId
|
|
16979
|
+
);
|
|
16980
|
+
};
|
|
16981
|
+
const handlePrimaryColorChange = (nextPrimaryKey) => {
|
|
16982
|
+
const nextAccentKey = nextPrimaryKey === accentFamilyKey ? getDefaultAccentFamilyKey(themeCategory, nextPrimaryKey) : accentFamilyKey;
|
|
16983
|
+
syncSelection(
|
|
16984
|
+
themeCategory,
|
|
16985
|
+
nextPrimaryKey,
|
|
16986
|
+
nextAccentKey,
|
|
16987
|
+
selectedBackgroundToken,
|
|
16988
|
+
selectedPairId
|
|
16989
|
+
);
|
|
16990
|
+
};
|
|
16991
|
+
const handleAccentColorChange = (nextAccentKey) => {
|
|
16992
|
+
if (nextAccentKey === primaryFamilyKey) return;
|
|
16993
|
+
syncSelection(
|
|
16994
|
+
themeCategory,
|
|
16995
|
+
primaryFamilyKey,
|
|
16996
|
+
nextAccentKey,
|
|
16997
|
+
selectedBackgroundToken,
|
|
16998
|
+
selectedPairId
|
|
16999
|
+
);
|
|
17000
|
+
};
|
|
17001
|
+
const handleBackgroundChange = (nextSelectedBackgroundToken) => {
|
|
17002
|
+
const nextSelectedPairId = getPreferredPairForBackground2(
|
|
17003
|
+
context.pairsByBackground[nextSelectedBackgroundToken] ?? [],
|
|
17004
|
+
selectedPairId
|
|
17005
|
+
)?.id ?? "";
|
|
17006
|
+
setSelectedBackgroundToken(nextSelectedBackgroundToken);
|
|
17007
|
+
setSelectedPairId(nextSelectedPairId);
|
|
17008
|
+
updateUrlParams(
|
|
17009
|
+
themeCategory,
|
|
17010
|
+
context.primary.key,
|
|
17011
|
+
context.accent.key,
|
|
17012
|
+
nextSelectedBackgroundToken,
|
|
17013
|
+
nextSelectedPairId
|
|
17014
|
+
);
|
|
17015
|
+
};
|
|
17016
|
+
const handlePairChange = (nextSelectedPairId) => {
|
|
17017
|
+
if (!selectedBackground) return;
|
|
17018
|
+
setSelectedPairId(nextSelectedPairId);
|
|
17019
|
+
updateUrlParams(
|
|
17020
|
+
themeCategory,
|
|
17021
|
+
context.primary.key,
|
|
17022
|
+
context.accent.key,
|
|
17023
|
+
selectedBackground.token,
|
|
17024
|
+
nextSelectedPairId
|
|
17025
|
+
);
|
|
17026
|
+
};
|
|
17027
|
+
if (!selectedBackground) {
|
|
17028
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Card, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-6", children: [
|
|
17029
|
+
/* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 3, size: 5, className: "text-foreground", trim: "normal", children: "No approved background tones available" }),
|
|
17030
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-3 text-base text-muted-foreground", children: "No approved tones are available for the current palette." })
|
|
17031
|
+
] }) });
|
|
17032
|
+
}
|
|
17033
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-8 lg:grid-cols-[18rem_minmax(0,1fr)]", children: [
|
|
17034
|
+
/* @__PURE__ */ jsxRuntime.jsx("aside", { className: "bg-grey-50/60 p-6", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-8", children: [
|
|
17035
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
17036
|
+
/* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 3, size: 5, className: "text-foreground", trim: "normal", children: "Configuration" }),
|
|
17037
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text, { size: 2, children: "Choose a palette, set your primary and accent families, then select an approved background." })
|
|
17038
|
+
] }),
|
|
17039
|
+
/* @__PURE__ */ jsxRuntime.jsx(SidebarStep, { step: 1, title: "Select your palette", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-2", children: ["brand", "aboriginal"].map((palette) => {
|
|
17040
|
+
const isSelected = themeCategory === palette;
|
|
17041
|
+
const label = palette === "brand" ? "Brand palette" : "Aboriginal palette";
|
|
17042
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17043
|
+
"button",
|
|
17044
|
+
{
|
|
17045
|
+
type: "button",
|
|
17046
|
+
"aria-label": `Select ${label}`,
|
|
17047
|
+
"aria-pressed": isSelected,
|
|
17048
|
+
onClick: () => handleThemeCategoryChange(palette),
|
|
17049
|
+
className: cn(
|
|
17050
|
+
"rounded-sm border px-3 py-2.5 text-left text-sm font-semibold transition-colors",
|
|
17051
|
+
isSelected ? "border-primary-800 bg-primary-800 text-white" : "border-grey-300 bg-background text-foreground hover:border-primary-800 hover:bg-primary-50"
|
|
17052
|
+
),
|
|
17053
|
+
children: label
|
|
17054
|
+
},
|
|
17055
|
+
palette
|
|
17056
|
+
);
|
|
17057
|
+
}) }) }),
|
|
17058
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17059
|
+
SidebarStep,
|
|
17060
|
+
{
|
|
17061
|
+
step: 2,
|
|
17062
|
+
title: "Choose your colours",
|
|
17063
|
+
description: "Grey is added automatically from the selected palette.",
|
|
17064
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-5", children: [
|
|
17065
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
17066
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold text-foreground", children: "Primary colour" }),
|
|
17067
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-3 gap-2", children: selectableFamilies.map((family) => {
|
|
17068
|
+
const swatchTone = 800;
|
|
17069
|
+
const isSelected = family.key === context.primary.key;
|
|
17070
|
+
const label = getFamilySelectorLabel2(family, themeCategory, "primary colour");
|
|
17071
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17072
|
+
"button",
|
|
17073
|
+
{
|
|
17074
|
+
type: "button",
|
|
17075
|
+
"aria-label": `Select ${label} as primary colour`,
|
|
17076
|
+
"aria-pressed": isSelected,
|
|
17077
|
+
onClick: () => handlePrimaryColorChange(family.key),
|
|
17078
|
+
className: cn(
|
|
17079
|
+
"min-h-11 rounded-sm border px-2 py-2 text-center text-[0.8rem] leading-5 font-semibold transition-transform",
|
|
17080
|
+
isSelected ? "ring-2 ring-primary-700 ring-offset-2 ring-offset-grey-50/60" : "hover:-translate-y-px"
|
|
17081
|
+
),
|
|
17082
|
+
style: {
|
|
17083
|
+
backgroundColor: getFamilySwatchColor2(family, swatchTone),
|
|
17084
|
+
color: getReadableTextColor(swatchTone),
|
|
17085
|
+
borderColor: "rgba(0, 0, 0, 0.12)"
|
|
17086
|
+
},
|
|
17087
|
+
title: label,
|
|
17088
|
+
children: label
|
|
17089
|
+
},
|
|
17090
|
+
family.key
|
|
17091
|
+
);
|
|
17092
|
+
}) })
|
|
17093
|
+
] }),
|
|
17094
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
17095
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold text-foreground", children: "Accent colour" }),
|
|
17096
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-3 gap-2", children: selectableAccentFamilies.map((family) => {
|
|
17097
|
+
const swatchTone = 600;
|
|
17098
|
+
const isSelected = family.key === context.accent.key;
|
|
17099
|
+
const label = getFamilySelectorLabel2(family, themeCategory, "accent colour");
|
|
17100
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17101
|
+
"button",
|
|
17102
|
+
{
|
|
17103
|
+
type: "button",
|
|
17104
|
+
"aria-label": `Select ${label} as accent colour`,
|
|
17105
|
+
"aria-pressed": isSelected,
|
|
17106
|
+
onClick: () => handleAccentColorChange(family.key),
|
|
17107
|
+
className: cn(
|
|
17108
|
+
"min-h-11 rounded-sm border px-2 py-2 text-center text-[0.8rem] leading-5 font-semibold transition-transform",
|
|
17109
|
+
isSelected ? "ring-2 ring-primary-700 ring-offset-2 ring-offset-grey-50/60" : "hover:-translate-y-px"
|
|
17110
|
+
),
|
|
17111
|
+
style: {
|
|
17112
|
+
backgroundColor: getFamilySwatchColor2(family, swatchTone),
|
|
17113
|
+
color: getReadableTextColor(swatchTone),
|
|
17114
|
+
borderColor: "rgba(0, 0, 0, 0.12)"
|
|
17115
|
+
},
|
|
17116
|
+
title: label,
|
|
17117
|
+
children: label
|
|
17118
|
+
},
|
|
17119
|
+
family.key
|
|
17120
|
+
);
|
|
17121
|
+
}) })
|
|
17122
|
+
] })
|
|
17123
|
+
] })
|
|
17124
|
+
}
|
|
17125
|
+
),
|
|
17126
|
+
/* @__PURE__ */ jsxRuntime.jsx(SidebarStep, { step: 3, title: "Pick a background", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
17127
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-muted-foreground", children: [
|
|
17128
|
+
"Selected:",
|
|
17129
|
+
" ",
|
|
17130
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-foreground", children: selectedBackground.token })
|
|
17131
|
+
] }),
|
|
17132
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-4 gap-2", children: context.backgrounds.map((background) => {
|
|
17133
|
+
const hasPairs = (context.pairsByBackground[background.token]?.length ?? 0) > 0;
|
|
17134
|
+
const isSelected = selectedBackground.token === background.token;
|
|
17135
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17136
|
+
"button",
|
|
17137
|
+
{
|
|
17138
|
+
type: "button",
|
|
17139
|
+
"aria-label": hasPairs ? `Select ${background.token} background` : `Select ${background.token} background with no AAA pairings`,
|
|
17140
|
+
"aria-pressed": isSelected,
|
|
17141
|
+
onClick: () => handleBackgroundChange(background.token),
|
|
17142
|
+
className: cn(
|
|
17143
|
+
"relative aspect-square rounded-sm border transition-transform",
|
|
17144
|
+
isSelected ? "ring-2 ring-primary-700 ring-offset-2 ring-offset-grey-50/60" : "hover:-translate-y-px",
|
|
17145
|
+
!hasPairs && "opacity-80"
|
|
17146
|
+
),
|
|
17147
|
+
style: {
|
|
17148
|
+
backgroundColor: background.hex,
|
|
17149
|
+
borderColor: "rgba(0, 0, 0, 0.14)"
|
|
17150
|
+
},
|
|
17151
|
+
title: background.token,
|
|
17152
|
+
children: !hasPairs ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute top-1/2 left-1/2 h-0.5 w-5 -translate-x-1/2 -translate-y-1/2 rotate-45 rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.28)]" }) : null
|
|
17153
|
+
},
|
|
17154
|
+
background.token
|
|
17155
|
+
);
|
|
17156
|
+
}) })
|
|
17157
|
+
] }) })
|
|
17158
|
+
] }) }),
|
|
17159
|
+
/* @__PURE__ */ jsxRuntime.jsxs("main", { className: "space-y-8", children: [
|
|
17160
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
17161
|
+
/* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 3, size: 5, className: "text-foreground", trim: "normal", children: "Live Preview & Results" }),
|
|
17162
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text, { size: 2, children: "Review the selected pairing in context, then compare the available AAA combinations for your chosen background." })
|
|
17163
|
+
] }),
|
|
17164
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-5", children: [
|
|
17165
|
+
selectedPair ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
17166
|
+
PreviewHeroCard,
|
|
17167
|
+
{
|
|
17168
|
+
familySummary,
|
|
17169
|
+
isRecommended: Boolean(selectedPair),
|
|
17170
|
+
pair: selectedPair
|
|
17171
|
+
}
|
|
17172
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(PreviewFallbackCard2, { background: selectedBackground }),
|
|
17173
|
+
/* @__PURE__ */ jsxRuntime.jsx(AccessibilityScoreCard, { pair: selectedPair })
|
|
17174
|
+
] }),
|
|
17175
|
+
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "space-y-4", children: [
|
|
17176
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
17177
|
+
/* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 3, size: 5, className: "text-foreground", trim: "normal", children: "Recommended Combinations" }),
|
|
17178
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-base text-muted-foreground", children: [
|
|
17179
|
+
"AAA-recommended foregrounds for",
|
|
17180
|
+
" ",
|
|
17181
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-foreground", children: selectedBackground.token }),
|
|
17182
|
+
"."
|
|
17183
|
+
] })
|
|
17184
|
+
] }),
|
|
17185
|
+
selectedBackgroundPairs.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-4 md:grid-cols-2 xl:grid-cols-3", children: selectedBackgroundPairs.map((pair) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
17186
|
+
RecommendedPairCard,
|
|
17187
|
+
{
|
|
17188
|
+
pair,
|
|
17189
|
+
isSelected: selectedPair?.id === pair.id,
|
|
17190
|
+
onSelect: () => handlePairChange(pair.id)
|
|
17191
|
+
},
|
|
17192
|
+
pair.id
|
|
17193
|
+
)) }) : /* @__PURE__ */ jsxRuntime.jsx(Card, { className: "gap-0 py-0", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-6 py-6", children: [
|
|
17194
|
+
/* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 4, size: 6, className: "text-foreground", trim: "normal", children: "No recommended combinations" }),
|
|
17195
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-3 text-base text-muted-foreground", children: "Choose another approved background tone to review available AAA pairings." })
|
|
17196
|
+
] }) })
|
|
17197
|
+
] }),
|
|
17198
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-4 lg:grid-cols-2", children: [
|
|
17199
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17200
|
+
PairDetailCard2,
|
|
17201
|
+
{
|
|
17202
|
+
color: selectedBackground,
|
|
17203
|
+
role: "Background",
|
|
17204
|
+
visibleFormats
|
|
17205
|
+
}
|
|
17206
|
+
),
|
|
17207
|
+
detailForeground ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
17208
|
+
PairDetailCard2,
|
|
17209
|
+
{
|
|
17210
|
+
color: detailForeground,
|
|
17211
|
+
role: "Foreground",
|
|
17212
|
+
visibleFormats
|
|
17213
|
+
}
|
|
17214
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "gap-4", children: [
|
|
17215
|
+
/* @__PURE__ */ jsxRuntime.jsx(CardHeader, { className: "gap-3 border-b", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
17216
|
+
/* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: "Foreground" }),
|
|
17217
|
+
/* @__PURE__ */ jsxRuntime.jsx(CardDescription, { children: "No recommended foreground available" })
|
|
17218
|
+
] }) }),
|
|
17219
|
+
/* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Choose another approved tone or review the recommended foregrounds for the same background." }) })
|
|
17220
|
+
] })
|
|
17221
|
+
] })
|
|
17222
|
+
] })
|
|
17223
|
+
] });
|
|
17224
|
+
}
|
|
17225
|
+
function ColorPairingToolV2({
|
|
17226
|
+
visibleFormats = DEFAULT_VISIBLE_FORMATS2
|
|
17227
|
+
} = {}) {
|
|
17228
|
+
const normalizedVisibleFormats = [...new Set(visibleFormats)];
|
|
17229
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React5.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(ColorPairingToolV2Loading, {}), children: /* @__PURE__ */ jsxRuntime.jsx(ColorPairingToolV2Content, { visibleFormats: normalizedVisibleFormats }) });
|
|
17230
|
+
}
|
|
16359
17231
|
function ColorSwatches({ theme: theme2, format, viewMode }) {
|
|
16360
17232
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16361
17233
|
"div",
|
|
@@ -18131,7 +19003,7 @@ function DescriptionList({ className, ...props }) {
|
|
|
18131
19003
|
"dl",
|
|
18132
19004
|
{
|
|
18133
19005
|
...props,
|
|
18134
|
-
className:
|
|
19006
|
+
className: clsx13__default.default(
|
|
18135
19007
|
className,
|
|
18136
19008
|
"grid grid-cols-1 text-base/6 sm:grid-cols-[min(50%,--spacing(80))_auto] sm:text-sm/6"
|
|
18137
19009
|
)
|
|
@@ -18143,7 +19015,7 @@ function DescriptionTerm({ className, ...props }) {
|
|
|
18143
19015
|
"dt",
|
|
18144
19016
|
{
|
|
18145
19017
|
...props,
|
|
18146
|
-
className:
|
|
19018
|
+
className: clsx13__default.default(
|
|
18147
19019
|
className,
|
|
18148
19020
|
"col-start-1 border-t border-grey-950/5 pt-3 text-grey-600 first:border-none sm:border-t sm:border-grey-950/5 sm:py-3 dark:border-white/5 dark:text-grey-400 sm:dark:border-white/5"
|
|
18149
19021
|
)
|
|
@@ -18155,7 +19027,7 @@ function DescriptionDetails({ className, ...props }) {
|
|
|
18155
19027
|
"dd",
|
|
18156
19028
|
{
|
|
18157
19029
|
...props,
|
|
18158
|
-
className:
|
|
19030
|
+
className: clsx13__default.default(
|
|
18159
19031
|
className,
|
|
18160
19032
|
"pt-1 pb-3 text-grey-950 sm:border-t sm:border-grey-950/5 sm:py-3 sm:nth-2:border-none dark:text-white dark:sm:border-white/5"
|
|
18161
19033
|
)
|
|
@@ -18569,7 +19441,7 @@ function Fieldset2({
|
|
|
18569
19441
|
Headless4__namespace.Fieldset,
|
|
18570
19442
|
{
|
|
18571
19443
|
...props,
|
|
18572
|
-
className:
|
|
19444
|
+
className: clsx13__default.default(className, "*:data-[slot=text]:mt-1 [&>*+[data-slot=control]]:mt-6")
|
|
18573
19445
|
}
|
|
18574
19446
|
);
|
|
18575
19447
|
}
|
|
@@ -18582,7 +19454,7 @@ function Legend6({
|
|
|
18582
19454
|
{
|
|
18583
19455
|
"data-slot": "legend",
|
|
18584
19456
|
...props,
|
|
18585
|
-
className:
|
|
19457
|
+
className: clsx13__default.default(
|
|
18586
19458
|
className,
|
|
18587
19459
|
"text-base/6 font-semibold text-zinc-950 data-disabled:opacity-50 sm:text-sm/6 dark:text-white"
|
|
18588
19460
|
)
|
|
@@ -18590,7 +19462,7 @@ function Legend6({
|
|
|
18590
19462
|
);
|
|
18591
19463
|
}
|
|
18592
19464
|
function FieldGroup({ className, ...props }) {
|
|
18593
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "control", ...props, className:
|
|
19465
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "control", ...props, className: clsx13__default.default(className, "space-y-8") });
|
|
18594
19466
|
}
|
|
18595
19467
|
function Field2({
|
|
18596
19468
|
className,
|
|
@@ -18600,7 +19472,7 @@ function Field2({
|
|
|
18600
19472
|
Headless4__namespace.Field,
|
|
18601
19473
|
{
|
|
18602
19474
|
...props,
|
|
18603
|
-
className:
|
|
19475
|
+
className: clsx13__default.default(
|
|
18604
19476
|
className,
|
|
18605
19477
|
"[&>[data-slot=label]+[data-slot=control]]:mt-3",
|
|
18606
19478
|
"[&>[data-slot=label]+[data-slot=description]]:mt-1",
|
|
@@ -18621,7 +19493,7 @@ function FieldLabel({
|
|
|
18621
19493
|
{
|
|
18622
19494
|
"data-slot": "label",
|
|
18623
19495
|
...props,
|
|
18624
|
-
className:
|
|
19496
|
+
className: clsx13__default.default(
|
|
18625
19497
|
className,
|
|
18626
19498
|
"text-base/6 text-zinc-950 select-none data-disabled:opacity-50 sm:text-sm/6 dark:text-white"
|
|
18627
19499
|
)
|
|
@@ -18637,7 +19509,7 @@ function Description4({
|
|
|
18637
19509
|
{
|
|
18638
19510
|
"data-slot": "description",
|
|
18639
19511
|
...props,
|
|
18640
|
-
className:
|
|
19512
|
+
className: clsx13__default.default(
|
|
18641
19513
|
className,
|
|
18642
19514
|
"text-base/6 text-zinc-500 data-disabled:opacity-50 sm:text-sm/6 dark:text-zinc-400"
|
|
18643
19515
|
)
|
|
@@ -18653,7 +19525,7 @@ function ErrorMessage({
|
|
|
18653
19525
|
{
|
|
18654
19526
|
"data-slot": "error",
|
|
18655
19527
|
...props,
|
|
18656
|
-
className:
|
|
19528
|
+
className: clsx13__default.default(
|
|
18657
19529
|
className,
|
|
18658
19530
|
"text-base/6 text-red-600 data-disabled:opacity-50 sm:text-sm/6 dark:text-red-500"
|
|
18659
19531
|
)
|
|
@@ -18877,7 +19749,7 @@ var toggleVariants = classVarianceAuthority.cva(styles3.base, {
|
|
|
18877
19749
|
variants: {
|
|
18878
19750
|
variant: {
|
|
18879
19751
|
ghost: "",
|
|
18880
|
-
outline:
|
|
19752
|
+
outline: clsx13__default.default(styles3.outline)
|
|
18881
19753
|
},
|
|
18882
19754
|
size: {
|
|
18883
19755
|
default: "h-9 px-2 min-w-9",
|
|
@@ -18980,7 +19852,7 @@ function FormatToggle({ format, setFormat }) {
|
|
|
18980
19852
|
|
|
18981
19853
|
// package.json
|
|
18982
19854
|
var package_default = {
|
|
18983
|
-
version: "1.
|
|
19855
|
+
version: "1.102.0"};
|
|
18984
19856
|
function Logo(props) {
|
|
18985
19857
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
18986
19858
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "NSW Government" }),
|
|
@@ -19130,7 +20002,7 @@ function Header2({
|
|
|
19130
20002
|
"data-slot": "header",
|
|
19131
20003
|
"data-scrolled": isScrolled,
|
|
19132
20004
|
id: "nsw-header",
|
|
19133
|
-
className:
|
|
20005
|
+
className: clsx13__default.default(
|
|
19134
20006
|
"sticky top-0 z-50 hidden bg-white px-4 py-5 transition duration-500 sm:px-6 lg:flex lg:flex-none lg:flex-wrap lg:items-center lg:justify-between lg:px-12",
|
|
19135
20007
|
!hideShadow && "shadow-md shadow-slate-900/5 dark:shadow-none",
|
|
19136
20008
|
isScrolled ? "dark:bg-slate-900/95 dark:backdrop-blur-sm dark:[@supports(backdrop-filter:blur(0))]:bg-slate-900/75" : "dark:bg-transparent"
|
|
@@ -19984,7 +20856,7 @@ var LineChart = React5__namespace.default.forwardRef((props, ref) => {
|
|
|
19984
20856
|
});
|
|
19985
20857
|
LineChart.displayName = "LineChart";
|
|
19986
20858
|
function cn2(...inputs) {
|
|
19987
|
-
return tailwindMerge.twMerge(
|
|
20859
|
+
return tailwindMerge.twMerge(clsx13.clsx(inputs));
|
|
19988
20860
|
}
|
|
19989
20861
|
var sizeStyles = {
|
|
19990
20862
|
sm: "text-sm",
|
|
@@ -20046,7 +20918,7 @@ function Listbox2({
|
|
|
20046
20918
|
autoFocus,
|
|
20047
20919
|
"data-slot": "control",
|
|
20048
20920
|
"aria-label": ariaLabel,
|
|
20049
|
-
className:
|
|
20921
|
+
className: clsx13__default.default([
|
|
20050
20922
|
className,
|
|
20051
20923
|
// Basic layout
|
|
20052
20924
|
"group relative block w-full",
|
|
@@ -20070,7 +20942,7 @@ function Listbox2({
|
|
|
20070
20942
|
as: "span",
|
|
20071
20943
|
options,
|
|
20072
20944
|
placeholder: placeholder && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-grey-500", children: placeholder }),
|
|
20073
|
-
className:
|
|
20945
|
+
className: clsx13__default.default([
|
|
20074
20946
|
"cursor-pointer",
|
|
20075
20947
|
// Basic layout
|
|
20076
20948
|
"relative block w-full appearance-none rounded-sm py-[calc(--spacing(4.5)-1px)] sm:py-[calc(--spacing(3.5)-1px)]",
|
|
@@ -20100,7 +20972,7 @@ function Listbox2({
|
|
|
20100
20972
|
{
|
|
20101
20973
|
transition: true,
|
|
20102
20974
|
anchor: "selection start",
|
|
20103
|
-
className:
|
|
20975
|
+
className: clsx13__default.default(
|
|
20104
20976
|
// Anchor positioning
|
|
20105
20977
|
"[--anchor-offset:-1.625rem] [--anchor-padding:--spacing(4)] sm:[--anchor-offset:-1.375rem]",
|
|
20106
20978
|
// Base styles
|
|
@@ -20126,7 +20998,7 @@ function ListboxOption2({
|
|
|
20126
20998
|
className,
|
|
20127
20999
|
...props
|
|
20128
21000
|
}) {
|
|
20129
|
-
const sharedClasses =
|
|
21001
|
+
const sharedClasses = clsx13__default.default(
|
|
20130
21002
|
// Base
|
|
20131
21003
|
"flex min-w-0 items-center",
|
|
20132
21004
|
// Icons
|
|
@@ -20138,12 +21010,12 @@ function ListboxOption2({
|
|
|
20138
21010
|
);
|
|
20139
21011
|
return /* @__PURE__ */ jsxRuntime.jsx(Headless4__namespace.ListboxOption, { as: React5.Fragment, ...props, children: ({ selectedOption }) => {
|
|
20140
21012
|
if (selectedOption) {
|
|
20141
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
21013
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx13__default.default(className, sharedClasses), children });
|
|
20142
21014
|
}
|
|
20143
21015
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20144
21016
|
"div",
|
|
20145
21017
|
{
|
|
20146
|
-
className:
|
|
21018
|
+
className: clsx13__default.default(
|
|
20147
21019
|
// Basic layout
|
|
20148
21020
|
"group/option grid cursor-pointer grid-cols-[--spacing(5)_1fr] items-baseline gap-x-2 rounded-sm py-2.5 pr-3.5 pl-2 sm:grid-cols-[--spacing(4)_1fr] sm:py-1.5 sm:pr-3 sm:pl-1.5",
|
|
20149
21021
|
// Typography
|
|
@@ -20174,7 +21046,7 @@ function ListboxOption2({
|
|
|
20174
21046
|
)
|
|
20175
21047
|
}
|
|
20176
21048
|
),
|
|
20177
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
21049
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx13__default.default(className, sharedClasses, "col-start-2"), children })
|
|
20178
21050
|
]
|
|
20179
21051
|
}
|
|
20180
21052
|
);
|
|
@@ -20185,7 +21057,7 @@ function ListboxLabel({ className, ...props }) {
|
|
|
20185
21057
|
"span",
|
|
20186
21058
|
{
|
|
20187
21059
|
...props,
|
|
20188
|
-
className:
|
|
21060
|
+
className: clsx13__default.default(className, "ml-2.5 truncate first:ml-0 sm:ml-2 sm:first:ml-0")
|
|
20189
21061
|
}
|
|
20190
21062
|
);
|
|
20191
21063
|
}
|
|
@@ -20198,7 +21070,7 @@ function ListboxDescription({
|
|
|
20198
21070
|
"span",
|
|
20199
21071
|
{
|
|
20200
21072
|
...props,
|
|
20201
|
-
className:
|
|
21073
|
+
className: clsx13__default.default(
|
|
20202
21074
|
className,
|
|
20203
21075
|
"flex flex-1 overflow-hidden text-grey-500 group-data-focus/option:text-white before:w-2 before:min-w-0 before:shrink dark:text-grey-400"
|
|
20204
21076
|
),
|
|
@@ -20246,74 +21118,6 @@ function Spinner({ className, size = "md", ...props }) {
|
|
|
20246
21118
|
}
|
|
20247
21119
|
) });
|
|
20248
21120
|
}
|
|
20249
|
-
function Text({ className, trim = "normal", size = 2, label = false, ...props }) {
|
|
20250
|
-
const textSizeClasses = {
|
|
20251
|
-
1: "text-[length:var(--font-size-1)] leading-[var(--line-height-28)] tracking-[var(--letter-spacing-0)]",
|
|
20252
|
-
2: "text-[length:var(--font-size-2)] leading-[var(--line-height-24)] tracking-[var(--letter-spacing-0)]",
|
|
20253
|
-
3: "text-[length:var(--font-size-3)] leading-[var(--line-height-20)] tracking-[var(--letter-spacing-0)]",
|
|
20254
|
-
4: "text-[length:var(--font-size-4)] leading-[var(--line-height-20)] tracking-[var(--letter-spacing-0)]"
|
|
20255
|
-
};
|
|
20256
|
-
const labelSizeClasses = {
|
|
20257
|
-
1: "text-[length:var(--font-size-1)] leading-[var(--line-height-24)] tracking-[var(--letter-spacing-0)]",
|
|
20258
|
-
2: "text-[length:var(--font-size-2)] leading-[var(--line-height-20)] tracking-[var(--letter-spacing-0)]",
|
|
20259
|
-
3: "text-[length:var(--font-size-3)] leading-[var(--line-height-16)] tracking-[var(--letter-spacing-0)]",
|
|
20260
|
-
4: "text-[length:var(--font-size-4)] leading-[var(--line-height-16)] tracking-[var(--letter-spacing-0)]"
|
|
20261
|
-
};
|
|
20262
|
-
const sizeClass = label ? labelSizeClasses[size] : textSizeClasses[size];
|
|
20263
|
-
const trimClasses = {
|
|
20264
|
-
normal: ["before:content-none after:content-none"],
|
|
20265
|
-
start: [
|
|
20266
|
-
'before:content-[""] before:table after:content-none',
|
|
20267
|
-
"before:mb-[calc(var(--leading-trim-start,var(--default-leading-trim-start))-var(--line-height,calc(1em*var(--default-line-height)))/2)]"
|
|
20268
|
-
],
|
|
20269
|
-
end: [
|
|
20270
|
-
'before:content-none after:content-[""] after:table',
|
|
20271
|
-
"after:mt-[calc(var(--leading-trim-end,var(--default-leading-trim-end))-var(--line-height,calc(1em*var(--default-line-height)))/2)]"
|
|
20272
|
-
],
|
|
20273
|
-
both: [
|
|
20274
|
-
'before:content-[""] before:table after:content-[""] after:table',
|
|
20275
|
-
"before:mb-[calc(var(--leading-trim-start,var(--default-leading-trim-start))-var(--line-height,calc(1em*var(--default-line-height)))/2)]",
|
|
20276
|
-
"after:mt-[calc(var(--leading-trim-end,var(--default-leading-trim-end))-var(--line-height,calc(1em*var(--default-line-height)))/2)]"
|
|
20277
|
-
]
|
|
20278
|
-
};
|
|
20279
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20280
|
-
"p",
|
|
20281
|
-
{
|
|
20282
|
-
"data-slot": "text",
|
|
20283
|
-
...props,
|
|
20284
|
-
className: clsx12__default.default(className, trimClasses[trim], "text-grey-800 dark:text-grey-400", sizeClass)
|
|
20285
|
-
}
|
|
20286
|
-
);
|
|
20287
|
-
}
|
|
20288
|
-
function TextLink({ className, ...props }) {
|
|
20289
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20290
|
-
Link,
|
|
20291
|
-
{
|
|
20292
|
-
...props,
|
|
20293
|
-
className: clsx12__default.default(
|
|
20294
|
-
className,
|
|
20295
|
-
"text-primary-800 underline decoration-primary-800/50 data-hover:decoration-primary-800 dark:text-white dark:decoration-white/50 dark:data-hover:decoration-white"
|
|
20296
|
-
)
|
|
20297
|
-
}
|
|
20298
|
-
);
|
|
20299
|
-
}
|
|
20300
|
-
function Strong({ className, ...props }) {
|
|
20301
|
-
return /* @__PURE__ */ jsxRuntime.jsx("strong", { ...props, className: clsx12__default.default(className, "font-medium text-grey-950 dark:text-white") });
|
|
20302
|
-
}
|
|
20303
|
-
function Code({ className, ...props }) {
|
|
20304
|
-
const hasLanguageClass = typeof className === "string" && className.includes("language-");
|
|
20305
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20306
|
-
"code",
|
|
20307
|
-
{
|
|
20308
|
-
...props,
|
|
20309
|
-
className: clsx12__default.default(
|
|
20310
|
-
className,
|
|
20311
|
-
!hasLanguageClass && "language-plaintext",
|
|
20312
|
-
"text-sm sm:text-[0.8125rem]"
|
|
20313
|
-
)
|
|
20314
|
-
}
|
|
20315
|
-
);
|
|
20316
|
-
}
|
|
20317
21121
|
function Loading() {
|
|
20318
21122
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-screen items-center justify-center gap-4 bg-grey-50 dark:bg-grey-900", children: [
|
|
20319
21123
|
/* @__PURE__ */ jsxRuntime.jsx(Spinner, { "aria-label": "Loading...", size: "lg" }),
|
|
@@ -20873,7 +21677,7 @@ function MultiLevelPushMenu({
|
|
|
20873
21677
|
{
|
|
20874
21678
|
href: item.href,
|
|
20875
21679
|
onClick: (e) => handleItemClick(item, e),
|
|
20876
|
-
className:
|
|
21680
|
+
className: clsx13__default.default(
|
|
20877
21681
|
"relative flex w-full cursor-pointer items-center justify-between gap-x-6 border-l p-4 transition-colors hover:border-primary-800 hover:bg-primary-800/10",
|
|
20878
21682
|
pathname === item.href ? "border-primary-800 bg-primary-800/10 font-semibold text-primary-800" : "border-transparent text-grey-800",
|
|
20879
21683
|
isAnimating && "pointer-events-none"
|
|
@@ -20885,7 +21689,7 @@ function MultiLevelPushMenu({
|
|
|
20885
21689
|
{
|
|
20886
21690
|
onClick: (e) => handleItemClick(item, e),
|
|
20887
21691
|
disabled: isAnimating,
|
|
20888
|
-
className:
|
|
21692
|
+
className: clsx13__default.default(
|
|
20889
21693
|
"relative flex w-full cursor-pointer items-center justify-between gap-x-6 border-l p-4 transition-colors hover:border-primary-800 hover:bg-primary-800/10",
|
|
20890
21694
|
pathname === item.href ? "border-primary-800 bg-primary-800/10 font-semibold text-primary-800" : "border-transparent text-grey-800",
|
|
20891
21695
|
isAnimating && "pointer-events-none"
|
|
@@ -20952,7 +21756,7 @@ function MobileHeader({
|
|
|
20952
21756
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
20953
21757
|
"div",
|
|
20954
21758
|
{
|
|
20955
|
-
className:
|
|
21759
|
+
className: clsx13__default.default(
|
|
20956
21760
|
"relative flex w-full items-center py-4",
|
|
20957
21761
|
menu && !search && "justify-start",
|
|
20958
21762
|
search && "justify-between",
|
|
@@ -20968,7 +21772,7 @@ function MobileHeader({
|
|
|
20968
21772
|
{
|
|
20969
21773
|
href: "/",
|
|
20970
21774
|
"aria-label": "Home page",
|
|
20971
|
-
className:
|
|
21775
|
+
className: clsx13__default.default(
|
|
20972
21776
|
"flex items-center",
|
|
20973
21777
|
menu && !search && "justify-start",
|
|
20974
21778
|
search && !menu && "flex-row justify-between",
|
|
@@ -20979,7 +21783,7 @@ function MobileHeader({
|
|
|
20979
21783
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
20980
21784
|
"div",
|
|
20981
21785
|
{
|
|
20982
|
-
className:
|
|
21786
|
+
className: clsx13__default.default(
|
|
20983
21787
|
"flex flex-wrap items-center",
|
|
20984
21788
|
menu && !search && "justify-center text-left",
|
|
20985
21789
|
search && !menu && "justify-center text-left",
|
|
@@ -28990,7 +29794,7 @@ var featureBundle = {
|
|
|
28990
29794
|
// node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs
|
|
28991
29795
|
var motion = /* @__PURE__ */ createMotionProxy(featureBundle, createDomVisualElement);
|
|
28992
29796
|
function Navbar({ className, ...props }) {
|
|
28993
|
-
return /* @__PURE__ */ jsxRuntime.jsx("nav", { ...props, className:
|
|
29797
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { ...props, className: clsx13__default.default(className, "flex flex-1 items-center gap-4 py-2.5") });
|
|
28994
29798
|
}
|
|
28995
29799
|
function NavbarDivider({ className, ...props }) {
|
|
28996
29800
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -28998,16 +29802,16 @@ function NavbarDivider({ className, ...props }) {
|
|
|
28998
29802
|
{
|
|
28999
29803
|
"aria-hidden": "true",
|
|
29000
29804
|
...props,
|
|
29001
|
-
className:
|
|
29805
|
+
className: clsx13__default.default(className, "h-6 w-px bg-zinc-950/10 dark:bg-white/10")
|
|
29002
29806
|
}
|
|
29003
29807
|
);
|
|
29004
29808
|
}
|
|
29005
29809
|
function NavbarSection({ className, ...props }) {
|
|
29006
29810
|
const id3 = React5.useId();
|
|
29007
|
-
return /* @__PURE__ */ jsxRuntime.jsx(LayoutGroup, { id: id3, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, className:
|
|
29811
|
+
return /* @__PURE__ */ jsxRuntime.jsx(LayoutGroup, { id: id3, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, className: clsx13__default.default(className, "flex items-center gap-3") }) });
|
|
29008
29812
|
}
|
|
29009
29813
|
function NavbarSpacer({ className, ...props }) {
|
|
29010
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { "aria-hidden": "true", ...props, className:
|
|
29814
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "aria-hidden": "true", ...props, className: clsx13__default.default(className, "-ml-4 flex-1") });
|
|
29011
29815
|
}
|
|
29012
29816
|
var NavbarItem = React5.forwardRef(function NavbarItem2({
|
|
29013
29817
|
current,
|
|
@@ -29015,7 +29819,7 @@ var NavbarItem = React5.forwardRef(function NavbarItem2({
|
|
|
29015
29819
|
children,
|
|
29016
29820
|
...props
|
|
29017
29821
|
}, ref) {
|
|
29018
|
-
const classes =
|
|
29822
|
+
const classes = clsx13__default.default(
|
|
29019
29823
|
// Base
|
|
29020
29824
|
"relative flex min-w-0 items-center gap-3 rounded-lg p-2 text-left text-base/6 font-medium text-zinc-950 sm:text-sm/5",
|
|
29021
29825
|
// Leading icon/icon-only
|
|
@@ -29033,7 +29837,7 @@ var NavbarItem = React5.forwardRef(function NavbarItem2({
|
|
|
29033
29837
|
"dark:data-hover:bg-white/5 dark:data-hover:*:data-[slot=icon]:fill-white",
|
|
29034
29838
|
"dark:data-active:bg-white/5 dark:data-active:*:data-[slot=icon]:fill-white"
|
|
29035
29839
|
);
|
|
29036
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className:
|
|
29840
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: clsx13__default.default(className, "relative"), children: [
|
|
29037
29841
|
current && /* @__PURE__ */ jsxRuntime.jsx(
|
|
29038
29842
|
motion.span,
|
|
29039
29843
|
{
|
|
@@ -29054,7 +29858,7 @@ var NavbarItem = React5.forwardRef(function NavbarItem2({
|
|
|
29054
29858
|
Headless4__namespace.Button,
|
|
29055
29859
|
{
|
|
29056
29860
|
...props,
|
|
29057
|
-
className:
|
|
29861
|
+
className: clsx13__default.default("cursor-default", classes),
|
|
29058
29862
|
"data-current": current ? "true" : void 0,
|
|
29059
29863
|
ref,
|
|
29060
29864
|
children: /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, { children })
|
|
@@ -29063,14 +29867,14 @@ var NavbarItem = React5.forwardRef(function NavbarItem2({
|
|
|
29063
29867
|
] });
|
|
29064
29868
|
});
|
|
29065
29869
|
function NavbarLabel({ className, ...props }) {
|
|
29066
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { ...props, className:
|
|
29870
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { ...props, className: clsx13__default.default(className, "truncate") });
|
|
29067
29871
|
}
|
|
29068
29872
|
function Navigation({
|
|
29069
29873
|
className,
|
|
29070
29874
|
onLinkClick,
|
|
29071
29875
|
navigation
|
|
29072
29876
|
}) {
|
|
29073
|
-
return /* @__PURE__ */ jsxRuntime.jsx("nav", { className:
|
|
29877
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { className: clsx13__default.default("text-base lg:text-sm", className), children: /* @__PURE__ */ jsxRuntime.jsx("ul", { role: "list", className: "flex flex-col gap-9", children: navigation.map((section, index) => /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
|
|
29074
29878
|
section.links ? /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-display font-medium text-grey-800 dark:text-white", children: section.title }) : /* @__PURE__ */ jsxRuntime.jsx("ul", { role: "list", className: "mt-2 flex flex-col gap-2 border-l lg:mt-4", children: /* @__PURE__ */ jsxRuntime.jsx("li", { className: "-ml-px flex flex-col items-start gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
29075
29879
|
NavigationLink,
|
|
29076
29880
|
{
|
|
@@ -29093,7 +29897,7 @@ function NavigationLink({
|
|
|
29093
29897
|
{
|
|
29094
29898
|
href,
|
|
29095
29899
|
onClick,
|
|
29096
|
-
className:
|
|
29900
|
+
className: clsx13__default.default(
|
|
29097
29901
|
"inline-block w-full cursor-pointer rounded-r-sm border-l py-1 pr-2 pl-4 text-left text-base/8 sm:text-sm/6",
|
|
29098
29902
|
"hover:border-grey-950 hover:bg-primary-800/10 hover:font-semibold hover:text-grey-950",
|
|
29099
29903
|
"dark:text-grey-400 dark:hover:border-grey-400 dark:hover:text-white",
|
|
@@ -29566,7 +30370,7 @@ function Wrapper({
|
|
|
29566
30370
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29567
30371
|
"div",
|
|
29568
30372
|
{
|
|
29569
|
-
className:
|
|
30373
|
+
className: clsx13__default.default("max-w-8xl mx-auto space-y-8 px-4 py-6 sm:px-6 lg:px-12", className),
|
|
29570
30374
|
...props,
|
|
29571
30375
|
children
|
|
29572
30376
|
}
|
|
@@ -29580,7 +30384,7 @@ function PageHeading({
|
|
|
29580
30384
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29581
30385
|
"header",
|
|
29582
30386
|
{
|
|
29583
|
-
className:
|
|
30387
|
+
className: clsx13__default.default(
|
|
29584
30388
|
"border-b border-grey-300 bg-white dark:border-grey-700 dark:bg-grey-900",
|
|
29585
30389
|
className
|
|
29586
30390
|
),
|
|
@@ -29607,7 +30411,7 @@ function Pagination({
|
|
|
29607
30411
|
children,
|
|
29608
30412
|
...props
|
|
29609
30413
|
}) {
|
|
29610
|
-
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": ariaLabel, className:
|
|
30414
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": ariaLabel, className: clsx13__default.default(containerStyles[variant], className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(PaginationVariantContext.Provider, { value: variant, children }) });
|
|
29611
30415
|
}
|
|
29612
30416
|
function PaginationPrevious({ href = null, className, children = "Previous" }) {
|
|
29613
30417
|
const variant = React5__namespace.useContext(PaginationVariantContext);
|
|
@@ -29630,7 +30434,7 @@ function PaginationPrevious({ href = null, className, children = "Previous" }) {
|
|
|
29630
30434
|
}
|
|
29631
30435
|
) });
|
|
29632
30436
|
}
|
|
29633
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
30437
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx13__default.default(className, "grow basis-0"), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
29634
30438
|
Button2,
|
|
29635
30439
|
{
|
|
29636
30440
|
...href === null ? { disabled: true } : { href },
|
|
@@ -29664,7 +30468,7 @@ function PaginationNext({ href = null, className, children = "Next" }) {
|
|
|
29664
30468
|
}
|
|
29665
30469
|
) });
|
|
29666
30470
|
}
|
|
29667
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
30471
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx13__default.default(className, "flex grow basis-0 justify-end"), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
29668
30472
|
Button2,
|
|
29669
30473
|
{
|
|
29670
30474
|
...href === null ? { disabled: true } : { href },
|
|
@@ -29680,9 +30484,9 @@ function PaginationNext({ href = null, className, children = "Next" }) {
|
|
|
29680
30484
|
function PaginationList({ className, ...props }) {
|
|
29681
30485
|
const variant = React5__namespace.useContext(PaginationVariantContext);
|
|
29682
30486
|
if (variant === "line") {
|
|
29683
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
30487
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx13__default.default(listStyles.line, className), ...props });
|
|
29684
30488
|
}
|
|
29685
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
30489
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx13__default.default(listStyles.default, className), ...props });
|
|
29686
30490
|
}
|
|
29687
30491
|
function PaginationPage({
|
|
29688
30492
|
href,
|
|
@@ -29714,7 +30518,7 @@ function PaginationPage({
|
|
|
29714
30518
|
"aria-current": current ? "page" : void 0,
|
|
29715
30519
|
variant: current ? "solid" : "ghost",
|
|
29716
30520
|
color: current ? "accent" : "light",
|
|
29717
|
-
className:
|
|
30521
|
+
className: clsx13__default.default(
|
|
29718
30522
|
className,
|
|
29719
30523
|
"leading-none before:absolute before:-inset-px before:rounded-sm",
|
|
29720
30524
|
"min-h-8 min-w-8 sm:px-[calc(--spacing(4))] sm:py-[calc(--spacing(3))]",
|
|
@@ -29735,7 +30539,7 @@ function PaginationGap({
|
|
|
29735
30539
|
"span",
|
|
29736
30540
|
{
|
|
29737
30541
|
"aria-hidden": "true",
|
|
29738
|
-
className:
|
|
30542
|
+
className: clsx13__default.default(
|
|
29739
30543
|
"inline-flex items-center border-t-2 border-transparent px-4 pt-4 text-sm font-medium text-grey-800 select-none",
|
|
29740
30544
|
className
|
|
29741
30545
|
),
|
|
@@ -29749,7 +30553,7 @@ function PaginationGap({
|
|
|
29749
30553
|
{
|
|
29750
30554
|
"aria-hidden": "true",
|
|
29751
30555
|
...props,
|
|
29752
|
-
className:
|
|
30556
|
+
className: clsx13__default.default(
|
|
29753
30557
|
className,
|
|
29754
30558
|
"w-9 text-center text-sm/6 font-semibold text-grey-950 select-none dark:text-white"
|
|
29755
30559
|
),
|
|
@@ -29769,7 +30573,7 @@ function PrevNextLinksPageLink({
|
|
|
29769
30573
|
Link13__default.default,
|
|
29770
30574
|
{
|
|
29771
30575
|
href,
|
|
29772
|
-
className:
|
|
30576
|
+
className: clsx13__default.default(
|
|
29773
30577
|
"flex items-center gap-x-1 text-base font-semibold text-slate-500 hover:text-slate-600 dark:text-slate-400 dark:hover:text-slate-300",
|
|
29774
30578
|
dir === "previous" && "flex-row-reverse"
|
|
29775
30579
|
),
|
|
@@ -29778,7 +30582,7 @@ function PrevNextLinksPageLink({
|
|
|
29778
30582
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29779
30583
|
Icons.east,
|
|
29780
30584
|
{
|
|
29781
|
-
className:
|
|
30585
|
+
className: clsx13__default.default("size-5 flex-none fill-current", dir === "previous" && "-scale-x-100")
|
|
29782
30586
|
}
|
|
29783
30587
|
)
|
|
29784
30588
|
]
|
|
@@ -30052,7 +30856,7 @@ function Prose({
|
|
|
30052
30856
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30053
30857
|
Component2,
|
|
30054
30858
|
{
|
|
30055
|
-
className:
|
|
30859
|
+
className: clsx13__default.default(
|
|
30056
30860
|
className,
|
|
30057
30861
|
"prose max-w-none dark:!prose-invert",
|
|
30058
30862
|
// headings
|
|
@@ -30824,7 +31628,7 @@ function SidebarNavigation({
|
|
|
30824
31628
|
navigation: navigation$1
|
|
30825
31629
|
}) {
|
|
30826
31630
|
const pathname = navigation.usePathname();
|
|
30827
|
-
return /* @__PURE__ */ jsxRuntime.jsx("nav", { className:
|
|
31631
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { className: clsx13__default.default("text-base lg:text-sm", className), children: /* @__PURE__ */ jsxRuntime.jsx("ul", { role: "list", className: "flex flex-col gap-9", children: navigation$1.map((section, sectionIndex) => /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
|
|
30828
31632
|
section.links ? /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-display font-medium text-foreground dark:text-white", children: section.title }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
30829
31633
|
"ul",
|
|
30830
31634
|
{
|
|
@@ -30859,7 +31663,7 @@ function SidebarLink({ link, pathname, onLinkClick, depth }) {
|
|
|
30859
31663
|
const hasChildren = Array.isArray(link.links) && link.links.length > 0;
|
|
30860
31664
|
const isActive = pathname === link.href;
|
|
30861
31665
|
const isActiveOrHasActiveDescendant = isLinkOrDescendantActive(link, pathname);
|
|
30862
|
-
const baseLinkClasses =
|
|
31666
|
+
const baseLinkClasses = clsx13__default.default(
|
|
30863
31667
|
"w-full cursor-pointer rounded-r-sm border-l py-1 pr-2 pl-4 text-left text-base/8 sm:text-sm/6",
|
|
30864
31668
|
"hover:border-grey-950 hover:bg-primary-800/10 hover:font-semibold hover:text-grey-950",
|
|
30865
31669
|
"dark:text-grey-400 dark:hover:border-grey-400 dark:hover:text-white",
|
|
@@ -30869,13 +31673,13 @@ function SidebarLink({ link, pathname, onLinkClick, depth }) {
|
|
|
30869
31673
|
/* @__PURE__ */ jsxRuntime.jsx(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
30870
31674
|
"button",
|
|
30871
31675
|
{
|
|
30872
|
-
className:
|
|
31676
|
+
className: clsx13__default.default(baseLinkClasses, "group flex items-center justify-between gap-1"),
|
|
30873
31677
|
children: [
|
|
30874
31678
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: link.title }),
|
|
30875
31679
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
30876
31680
|
Icons.chevron_right,
|
|
30877
31681
|
{
|
|
30878
|
-
className:
|
|
31682
|
+
className: clsx13__default.default(
|
|
30879
31683
|
"ml-2 size-5 transition-transform duration-200",
|
|
30880
31684
|
"group-data-[state=open]:rotate-90"
|
|
30881
31685
|
)
|
|
@@ -30884,7 +31688,7 @@ function SidebarLink({ link, pathname, onLinkClick, depth }) {
|
|
|
30884
31688
|
]
|
|
30885
31689
|
}
|
|
30886
31690
|
) }),
|
|
30887
|
-
/* @__PURE__ */ jsxRuntime.jsx(CollapsibleContent2, { children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className:
|
|
31691
|
+
/* @__PURE__ */ jsxRuntime.jsx(CollapsibleContent2, { children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: clsx13__default.default("mt-2 ml-5 flex flex-col gap-1 border-l pl-0"), children: link.links && link.links.map((childLink) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
30888
31692
|
SidebarLink,
|
|
30889
31693
|
{
|
|
30890
31694
|
link: childLink,
|
|
@@ -31213,7 +32017,7 @@ var StepIndicator = React5__namespace.forwardRef(
|
|
|
31213
32017
|
return /* @__PURE__ */ jsxRuntime.jsx("ul", { role: "list", ref, className: cn("w-full", className), ...props, children: array.map((step, stepIdx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
31214
32018
|
"li",
|
|
31215
32019
|
{
|
|
31216
|
-
className:
|
|
32020
|
+
className: clsx13__default.default(stepIdx !== array.length - 1 ? "pb-3" : "", "relative"),
|
|
31217
32021
|
children: step.href === pathname && !(step.status === "completed" || step.status === "error" || step.status === "saved" || step.status === "cannot-start") ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: step.status === "in-progress" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
31218
32022
|
stepIdx !== array.length - 1 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
31219
32023
|
"div",
|
|
@@ -31459,7 +32263,7 @@ function StepNavigation({
|
|
|
31459
32263
|
})),
|
|
31460
32264
|
[navigation, formStatus, getStatus]
|
|
31461
32265
|
);
|
|
31462
|
-
return /* @__PURE__ */ jsxRuntime.jsx("nav", { className:
|
|
32266
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { className: clsx13__default.default("text-base lg:text-sm", className), children: /* @__PURE__ */ jsxRuntime.jsx("ul", { role: "list", className: "space-y-9", children: navigationWithStatus.map((section) => /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
|
|
31463
32267
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-display font-medium text-slate-900 dark:text-white", children: section.title }),
|
|
31464
32268
|
/* @__PURE__ */ jsxRuntime.jsx(StepIndicator, { className: "mt-2 lg:mt-4", array: section.links })
|
|
31465
32269
|
] }, section.title)) }) });
|
|
@@ -31487,7 +32291,7 @@ function SwitchGroup({ className, ...props }) {
|
|
|
31487
32291
|
{
|
|
31488
32292
|
"data-slot": "control",
|
|
31489
32293
|
...props,
|
|
31490
|
-
className:
|
|
32294
|
+
className: clsx13__default.default(
|
|
31491
32295
|
className,
|
|
31492
32296
|
// Basic groups
|
|
31493
32297
|
"space-y-3 **:data-[slot=label]:font-normal",
|
|
@@ -31506,7 +32310,7 @@ function SwitchField({
|
|
|
31506
32310
|
{
|
|
31507
32311
|
"data-slot": "field",
|
|
31508
32312
|
...props,
|
|
31509
|
-
className:
|
|
32313
|
+
className: clsx13__default.default(
|
|
31510
32314
|
className,
|
|
31511
32315
|
// Base layout
|
|
31512
32316
|
"grid grid-cols-[1fr_auto] gap-x-8 gap-y-1 sm:grid-cols-[1fr_auto]",
|
|
@@ -31570,7 +32374,7 @@ function Switch2({
|
|
|
31570
32374
|
{
|
|
31571
32375
|
"data-slot": "control",
|
|
31572
32376
|
...props,
|
|
31573
|
-
className:
|
|
32377
|
+
className: clsx13__default.default(
|
|
31574
32378
|
className,
|
|
31575
32379
|
// Base styles
|
|
31576
32380
|
"group relative isolate inline-flex h-6 w-10 cursor-default rounded-full p-[3px] sm:h-5 sm:w-8",
|
|
@@ -31597,7 +32401,7 @@ function Switch2({
|
|
|
31597
32401
|
"span",
|
|
31598
32402
|
{
|
|
31599
32403
|
"aria-hidden": "true",
|
|
31600
|
-
className:
|
|
32404
|
+
className: clsx13__default.default(
|
|
31601
32405
|
// Basic layout
|
|
31602
32406
|
"pointer-events-none relative inline-block size-4.5 rounded-full sm:size-3.5",
|
|
31603
32407
|
// Transition
|
|
@@ -31706,7 +32510,7 @@ function TableOfContents({ tableOfContents }) {
|
|
|
31706
32510
|
"ol",
|
|
31707
32511
|
{
|
|
31708
32512
|
role: "list",
|
|
31709
|
-
className:
|
|
32513
|
+
className: clsx13__default.default(
|
|
31710
32514
|
"mt-3 flex flex-col gap-2",
|
|
31711
32515
|
"border-l border-grey-900/10 dark:border-white/10",
|
|
31712
32516
|
"text-sm/6 text-grey-700 dark:text-grey-400"
|
|
@@ -31717,7 +32521,7 @@ function TableOfContents({ tableOfContents }) {
|
|
|
31717
32521
|
{
|
|
31718
32522
|
href: `#${section.id}`,
|
|
31719
32523
|
prefetch: false,
|
|
31720
|
-
className:
|
|
32524
|
+
className: clsx13__default.default(
|
|
31721
32525
|
"-ml-px inline-block border-l pl-4",
|
|
31722
32526
|
"hover:border-primary-800 dark:hover:border-white",
|
|
31723
32527
|
isActive(section) ? "border-primary-800 font-semibold text-primary-800 dark:border-white dark:text-white" : "border-transparent"
|
|
@@ -31730,7 +32534,7 @@ function TableOfContents({ tableOfContents }) {
|
|
|
31730
32534
|
{
|
|
31731
32535
|
href: `#${subSection.id}`,
|
|
31732
32536
|
prefetch: false,
|
|
31733
|
-
className:
|
|
32537
|
+
className: clsx13__default.default(
|
|
31734
32538
|
"-ml-px inline-block border-l pl-8",
|
|
31735
32539
|
"hover:border-primary-800 dark:hover:border-white",
|
|
31736
32540
|
isActive(subSection) ? "border-primary-800 font-semibold text-primary-800 dark:border-white dark:text-white" : "border-transparent"
|
|
@@ -35140,6 +35944,7 @@ exports.CollapsibleContent = CollapsibleContent2;
|
|
|
35140
35944
|
exports.CollapsibleTrigger = CollapsibleTrigger2;
|
|
35141
35945
|
exports.ColorCard = ColorCard;
|
|
35142
35946
|
exports.ColorPairingTool = ColorPairingTool;
|
|
35947
|
+
exports.ColorPairingToolV2 = ColorPairingToolV2;
|
|
35143
35948
|
exports.ColorSwatches = ColorSwatches;
|
|
35144
35949
|
exports.ColourScale = ColourScale;
|
|
35145
35950
|
exports.ComboChart = ComboChart;
|