@nswds/app 1.105.0 → 1.106.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/index.cjs CHANGED
@@ -19003,6 +19003,7 @@ var DEFAULT_INITIAL_PAIR_ID4 = "nsw-blue-800:nsw-blue-200";
19003
19003
  var COLOR_PAIRING_TOOL_V4_PATH = "/core/colour/colour-pairing-tool-4";
19004
19004
  var MOBILE_RESULT_SCROLL_QUERY2 = "(max-width: 1023px)";
19005
19005
  var PERSISTENT_DRAWER_MIN_WIDTH_QUERY2 = "(min-width: 1280px)";
19006
+ var INITIAL_VISIBLE_ALTERNATIVES = 6;
19006
19007
  var COLOR_PAIRING_TOOL_DRAWER_STEPS2 = [
19007
19008
  {
19008
19009
  id: "colours",
@@ -19066,10 +19067,10 @@ function getWhiteForegroundGuidance4(pair) {
19066
19067
  }
19067
19068
  function getPreviewGuidance4(pair, isRecommended) {
19068
19069
  if (!isWhiteForegroundPair4(pair)) {
19069
- return "Use only AAA-recommended combinations across your selected primary, accent, and grey families.";
19070
+ return isRecommended ? "Use this pairing for headings, body copy, and actions on the selected background." : "Use this approved alternative when you need a different tone or stronger emphasis.";
19070
19071
  }
19071
19072
  if (isRecommended) {
19072
- return "Use white text on dark colour only when it meets AAA for headings, body copy, and calls to action.";
19073
+ return "Use white text on this background for headings, body copy, and actions only while it maintains AAA contrast.";
19073
19074
  }
19074
19075
  return getWhiteForegroundGuidance4(pair);
19075
19076
  }
@@ -19213,37 +19214,19 @@ function getRecommendationCategory2(pair, bestPair, context) {
19213
19214
  if (pair.foreground.familyKey === context.primary.key) return "primary-family";
19214
19215
  return "approved";
19215
19216
  }
19216
- function getRecommendationCategoryLabel2(category) {
19217
- switch (category) {
19218
- case "best":
19219
- return "Best recommended";
19220
- case "same-family":
19221
- return "Same family";
19222
- case "accent-family":
19223
- return "Accent family";
19224
- case "grey-option":
19225
- return "Grey option";
19226
- case "primary-family":
19227
- return "Primary family";
19228
- case "white":
19229
- return "White";
19230
- default:
19231
- return "Approved option";
19232
- }
19233
- }
19234
19217
  function getRecommendationSortRank2(category) {
19235
19218
  switch (category) {
19236
19219
  case "best":
19237
19220
  return 0;
19238
19221
  case "same-family":
19239
19222
  return 1;
19240
- case "accent-family":
19223
+ case "primary-family":
19241
19224
  return 2;
19242
- case "grey-option":
19225
+ case "accent-family":
19243
19226
  return 3;
19244
- case "white":
19227
+ case "grey-option":
19245
19228
  return 4;
19246
- case "primary-family":
19229
+ case "white":
19247
19230
  return 5;
19248
19231
  default:
19249
19232
  return 6;
@@ -19253,13 +19236,14 @@ function getRecommendationGroupId(category) {
19253
19236
  switch (category) {
19254
19237
  case "best":
19255
19238
  case "same-family":
19256
- case "accent-family":
19257
- case "grey-option":
19258
19239
  case "primary-family":
19259
- return "good-alternatives";
19240
+ return "closest";
19241
+ case "accent-family":
19260
19242
  case "white":
19261
19243
  case "approved":
19262
- return "edge-options";
19244
+ return "expressive";
19245
+ case "grey-option":
19246
+ return "neutral";
19263
19247
  default:
19264
19248
  return null;
19265
19249
  }
@@ -19275,22 +19259,29 @@ function buildRecommendationGroups(items) {
19275
19259
  return accumulator;
19276
19260
  },
19277
19261
  {
19278
- "edge-options": [],
19279
- "good-alternatives": []
19262
+ closest: [],
19263
+ expressive: [],
19264
+ neutral: []
19280
19265
  }
19281
19266
  );
19282
19267
  const groups = [
19283
19268
  {
19284
- id: "good-alternatives",
19285
- title: "Good alternatives",
19286
- description: "These pairings still meet AAA and stay close to the NSW recommendation in tone, neutrality, or emphasis.",
19287
- items: groupedItems["good-alternatives"]
19269
+ id: "closest",
19270
+ title: "Closest to default",
19271
+ description: "Stays closest to the NSW default in tone and overall treatment.",
19272
+ items: groupedItems.closest
19288
19273
  },
19289
19274
  {
19290
- id: "edge-options",
19291
- title: "Edge and less common options",
19292
- description: "These are valid AAA pairings, but they are less typical NSW defaults and should be used more deliberately.",
19293
- items: groupedItems["edge-options"]
19275
+ id: "expressive",
19276
+ title: "More expressive (accent)",
19277
+ description: "Brings more accent or emphasis into the foreground treatment.",
19278
+ items: groupedItems.expressive
19279
+ },
19280
+ {
19281
+ id: "neutral",
19282
+ title: "Neutral/system",
19283
+ description: "Uses quieter neutral contrast for system or utility treatments.",
19284
+ items: groupedItems.neutral
19294
19285
  }
19295
19286
  ];
19296
19287
  return groups.filter((group) => group.items.length > 0);
@@ -19336,6 +19327,18 @@ function getPairingCopyText2(pair) {
19336
19327
  accessibilityLine
19337
19328
  ].join("\n");
19338
19329
  }
19330
+ function getAccessibilitySummaryLine(pair) {
19331
+ if (!pair) {
19332
+ return "Contrast unavailable";
19333
+ }
19334
+ if (pair.passes.aaaText) {
19335
+ return `${pair.contrastRatio.toFixed(2)}:1 \u2014 AAA compliant (normal + large text)`;
19336
+ }
19337
+ if (pair.passes.aaaLarge) {
19338
+ return `${pair.contrastRatio.toFixed(2)}:1 \u2014 AAA compliant (large text only)`;
19339
+ }
19340
+ return `${pair.contrastRatio.toFixed(2)}:1 \u2014 Not AAA compliant`;
19341
+ }
19339
19342
  function getLiveAnnouncement2(pair, background) {
19340
19343
  if (!background) {
19341
19344
  return "No approved background tones available.";
@@ -19450,65 +19453,6 @@ function BackgroundSwatchButton2({
19450
19453
  }
19451
19454
  );
19452
19455
  }
19453
- function CompactAccessibilityStatus({ label, passes }) {
19454
- const status = passes === null ? "unavailable" : passes ? "pass" : "fail";
19455
- return /* @__PURE__ */ jsxRuntime.jsxs(
19456
- "div",
19457
- {
19458
- className: cn(
19459
- "flex items-center justify-between gap-3 rounded-sm border px-4 py-3",
19460
- status === "pass" && "border-success-200 bg-success-50",
19461
- status === "fail" && "border-danger-200 bg-danger-50",
19462
- status === "unavailable" && "border-grey-200 bg-white"
19463
- ),
19464
- children: [
19465
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold text-foreground", children: label }),
19466
- /* @__PURE__ */ jsxRuntime.jsxs(
19467
- "span",
19468
- {
19469
- className: cn(
19470
- "inline-flex items-center gap-1 rounded-sm px-2.5 py-1 text-[0.72rem] font-semibold tracking-[0.12em] uppercase",
19471
- status === "pass" && "bg-success-700 text-white",
19472
- status === "fail" && "bg-danger-700 text-white",
19473
- status === "unavailable" && "bg-grey-100 text-foreground"
19474
- ),
19475
- children: [
19476
- status === "pass" ? /* @__PURE__ */ jsxRuntime.jsx(Icons.check, { "data-slot": "icon", className: "size-4" }) : status === "fail" ? /* @__PURE__ */ jsxRuntime.jsx(Icons.close, { "data-slot": "icon", className: "size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(Icons.info, { "data-slot": "icon", className: "size-4" }),
19477
- status === "pass" ? "Pass" : status === "fail" ? "Fail" : "Unavailable"
19478
- ]
19479
- }
19480
- )
19481
- ]
19482
- }
19483
- );
19484
- }
19485
- function AccessibilitySummaryCard({ pair }) {
19486
- return /* @__PURE__ */ jsxRuntime.jsx(Card, { className: "gap-4 px-5 py-5", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-5 lg:flex-row lg:items-start lg:justify-between", children: [
19487
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
19488
- /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 2, size: 6, className: "text-foreground", trim: "normal", children: "Accessibility summary" }),
19489
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
19490
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold text-grey-700", children: "Contrast ratio" }),
19491
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-4xl leading-none font-bold text-foreground", children: pair ? `${pair.contrastRatio.toFixed(2)}:1` : "N/A" })
19492
- ] })
19493
- ] }),
19494
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-3 lg:max-w-[26rem] lg:min-w-[22rem]", children: [
19495
- /* @__PURE__ */ jsxRuntime.jsx(
19496
- CompactAccessibilityStatus,
19497
- {
19498
- label: "AAA normal text",
19499
- passes: pair ? pair.passes.aaaText : null
19500
- }
19501
- ),
19502
- /* @__PURE__ */ jsxRuntime.jsx(
19503
- CompactAccessibilityStatus,
19504
- {
19505
- label: "AAA large text",
19506
- passes: pair ? pair.passes.aaaLarge : null
19507
- }
19508
- )
19509
- ] })
19510
- ] }) });
19511
- }
19512
19456
  function CurrentResultCard2({
19513
19457
  bestPair,
19514
19458
  copiedKey,
@@ -19519,8 +19463,8 @@ function CurrentResultCard2({
19519
19463
  }) {
19520
19464
  const previewForeground = pair?.foreground.hex ?? getReadableTextColor3(selectedBackground.tone);
19521
19465
  const isRecommended = pair ? pair.id === bestPair?.id : false;
19522
- const whiteForeground = pair ? isWhiteForegroundPair4(pair) : false;
19523
19466
  const pairingLabel = getMainPairingLabel(pair, bestPair);
19467
+ const accessibilitySummary = getAccessibilitySummaryLine(pair);
19524
19468
  const fauxButtonStyle = pair ? {
19525
19469
  "--btn-bg": pair.foreground.hex,
19526
19470
  "--btn-border": pair.foreground.hex,
@@ -19528,74 +19472,79 @@ function CurrentResultCard2({
19528
19472
  "--btn-icon": pair.background.hex,
19529
19473
  "--btn-hover-overlay": pair.background.hex
19530
19474
  } : null;
19531
- return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: cn("gap-0 overflow-hidden py-0", isRecommended && "border-primary-200"), children: [
19532
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-grey-200 px-4 py-4 sm:px-6 sm:py-5", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between", children: [
19533
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 space-y-3", children: [
19534
- /* @__PURE__ */ jsxRuntime.jsxs(
19535
- "span",
19536
- {
19537
- className: cn(
19538
- "inline-flex items-center gap-2 rounded-sm px-3 py-1 text-[0.72rem] font-semibold tracking-[0.12em] uppercase",
19539
- isRecommended ? "bg-primary-800 text-white" : "border border-grey-300 bg-grey-50 text-foreground"
19540
- ),
19541
- children: [
19542
- isRecommended ? /* @__PURE__ */ jsxRuntime.jsx(Icons.check_circle, { "data-slot": "icon", className: "size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(Icons.info, { "data-slot": "icon", className: "size-4" }),
19543
- pairingLabel
19544
- ]
19545
- }
19546
- ),
19547
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
19548
- /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 2, size: 4, className: "text-foreground", trim: "normal", children: pair ? `${getPairingColorDisplayName4(pair.foreground)} on ${getPairingColorDisplayName4(pair.background)}` : `${getPairingColorDisplayName4(selectedBackground)} selected` }),
19549
- /* @__PURE__ */ jsxRuntime.jsx(Text, { size: 2, className: "max-w-3xl text-grey-700", children: supportText })
19550
- ] })
19551
- ] }),
19552
- pair ? /* @__PURE__ */ jsxRuntime.jsx(
19553
- Button2,
19554
- {
19555
- color: "primary",
19556
- className: "w-full justify-center lg:w-auto lg:min-w-48",
19557
- onClick: onCopyPairing,
19558
- children: copiedKey === "current-pairing" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
19559
- /* @__PURE__ */ jsxRuntime.jsx(Icons.check, { "data-slot": "icon", className: "size-5" }),
19560
- "Pairing copied"
19561
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
19562
- /* @__PURE__ */ jsxRuntime.jsx(Icons.content_copy, { "data-slot": "icon", className: "size-5" }),
19563
- "Copy pairing"
19564
- ] })
19565
- }
19566
- ) : null
19567
- ] }) }),
19568
- /* @__PURE__ */ jsxRuntime.jsx(
19569
- "div",
19570
- {
19571
- className: "p-4 sm:min-h-[26rem] sm:p-8",
19572
- style: {
19573
- backgroundColor: selectedBackground.hex,
19574
- color: previewForeground
19575
- },
19576
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-h-[18rem] flex-col justify-center gap-6 sm:min-h-[22rem]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-xl space-y-4", children: [
19577
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold tracking-[0.22em] uppercase", children: pair ? whiteForeground && !isRecommended ? "White on colour example" : whiteForeground ? "White on colour" : "Colour on colour" : "Approved background" }),
19578
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
19579
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "max-w-lg text-3xl leading-tight font-bold text-current sm:text-5xl sm:leading-none", children: "Pair colour with confidence." }),
19580
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-full text-base/6 sm:max-w-md sm:text-base/7", children: pair ? getPreviewGuidance4(pair, isRecommended) : "This approved background tone does not currently have a recommended AAA foreground in this tool. Choose another approved background tone to continue." }),
19581
- pair && fauxButtonStyle ? /* @__PURE__ */ jsxRuntime.jsx(
19475
+ return /* @__PURE__ */ jsxRuntime.jsx(Card, { className: cn("gap-0 overflow-hidden py-0", isRecommended && "border-primary-200"), children: /* @__PURE__ */ jsxRuntime.jsx(
19476
+ "div",
19477
+ {
19478
+ className: "p-4 sm:min-h-[24rem] sm:p-8",
19479
+ style: {
19480
+ backgroundColor: selectedBackground.hex,
19481
+ color: previewForeground
19482
+ },
19483
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-[18rem] flex-col justify-between gap-8 sm:min-h-[20rem]", children: [
19484
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-3xl rounded-sm bg-white px-4 py-4 text-foreground sm:px-6 sm:py-6", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-5 lg:flex-row lg:items-start lg:justify-between", children: [
19485
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 space-y-4", children: [
19486
+ /* @__PURE__ */ jsxRuntime.jsxs(
19582
19487
  "span",
19583
19488
  {
19584
- "aria-hidden": "true",
19585
- "data-variant": "solid",
19586
19489
  className: cn(
19587
- buttonVariants({ variant: "solid", size: "default" }),
19588
- "pointer-events-none cursor-default px-6 text-[16px] font-[700] select-none sm:px-6 sm:text-[16px] sm:font-[700]"
19490
+ "inline-flex items-center gap-2 rounded-sm px-3 py-1 text-[0.72rem] font-semibold tracking-[0.12em] uppercase",
19491
+ isRecommended ? "bg-primary-800 text-white" : "border border-grey-300 bg-grey-50 text-foreground"
19589
19492
  ),
19590
- style: fauxButtonStyle,
19591
- children: "Get started"
19493
+ children: [
19494
+ isRecommended ? /* @__PURE__ */ jsxRuntime.jsx(Icons.check_circle, { "data-slot": "icon", className: "size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(Icons.info, { "data-slot": "icon", className: "size-4" }),
19495
+ pairingLabel
19496
+ ]
19592
19497
  }
19593
- ) : null
19594
- ] })
19595
- ] }) })
19596
- }
19597
- )
19598
- ] });
19498
+ ),
19499
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
19500
+ /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 2, size: 4, className: "text-foreground", trim: "normal", children: pair ? `${getPairingColorDisplayName4(pair.foreground)} on ${getPairingColorDisplayName4(pair.background)}` : `${getPairingColorDisplayName4(selectedBackground)} selected` }),
19501
+ pair ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "font-mono text-[0.74rem] break-all text-muted-foreground", children: [
19502
+ pair.foreground.token,
19503
+ " on ",
19504
+ pair.background.token
19505
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-mono text-[0.74rem] break-all text-muted-foreground", children: selectedBackground.token }),
19506
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold text-foreground", children: accessibilitySummary }),
19507
+ /* @__PURE__ */ jsxRuntime.jsx(Text, { size: 2, className: "max-w-3xl text-grey-700", children: supportText })
19508
+ ] })
19509
+ ] }),
19510
+ pair ? /* @__PURE__ */ jsxRuntime.jsx(
19511
+ Button2,
19512
+ {
19513
+ color: "primary",
19514
+ className: "w-full justify-center lg:w-auto lg:min-w-48",
19515
+ onClick: onCopyPairing,
19516
+ children: copiedKey === "current-pairing" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
19517
+ /* @__PURE__ */ jsxRuntime.jsx(Icons.check, { "data-slot": "icon", className: "size-5" }),
19518
+ "Pairing copied"
19519
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
19520
+ /* @__PURE__ */ jsxRuntime.jsx(Icons.content_copy, { "data-slot": "icon", className: "size-5" }),
19521
+ "Copy pairing"
19522
+ ] })
19523
+ }
19524
+ ) : null
19525
+ ] }) }),
19526
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-xl space-y-4", children: [
19527
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
19528
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "max-w-lg text-3xl leading-tight font-bold text-current sm:text-4xl", children: "Example heading" }),
19529
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-md text-base/7", children: pair ? getPreviewGuidance4(pair, isRecommended) : "This approved background does not currently have an AAA foreground in this tool. Choose another approved background to continue." })
19530
+ ] }),
19531
+ pair && fauxButtonStyle ? /* @__PURE__ */ jsxRuntime.jsx(
19532
+ "span",
19533
+ {
19534
+ "aria-hidden": "true",
19535
+ "data-variant": "solid",
19536
+ className: cn(
19537
+ buttonVariants({ variant: "solid", size: "default" }),
19538
+ "pointer-events-none cursor-default self-start px-6 text-[16px] font-[700] select-none sm:px-6 sm:text-[16px] sm:font-[700]"
19539
+ ),
19540
+ style: fauxButtonStyle,
19541
+ children: "Primary action"
19542
+ }
19543
+ ) : null
19544
+ ] })
19545
+ ] })
19546
+ }
19547
+ ) });
19599
19548
  }
19600
19549
  function RecommendationCard2({
19601
19550
  copiedKey,
@@ -19609,8 +19558,8 @@ function RecommendationCard2({
19609
19558
  "div",
19610
19559
  {
19611
19560
  className: cn(
19612
- "relative rounded-sm border bg-white p-4 text-left transition-colors focus-visible:ring-2 focus-visible:ring-primary-700 focus-visible:ring-offset-2 focus-visible:outline-hidden",
19613
- isSelected ? "border-primary-800 bg-primary-50/60 ring-1 ring-primary-700" : "border-grey-200 hover:border-primary-500 hover:bg-grey-50"
19561
+ "relative rounded-sm border bg-white px-3 py-2.5 text-left transition-colors focus-visible:ring-2 focus-visible:ring-primary-700 focus-visible:ring-offset-2 focus-visible:outline-hidden",
19562
+ isSelected ? "border-primary-800 bg-primary-50/40" : "border-grey-200 hover:border-grey-400"
19614
19563
  ),
19615
19564
  children: [
19616
19565
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -19623,65 +19572,45 @@ function RecommendationCard2({
19623
19572
  className: "absolute inset-0 rounded-sm focus-visible:ring-2 focus-visible:ring-primary-700 focus-visible:ring-offset-2 focus-visible:outline-hidden"
19624
19573
  }
19625
19574
  ),
19626
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pointer-events-none relative z-10", children: [
19627
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-start gap-3 sm:flex-row sm:items-start sm:justify-between", children: [
19628
- /* @__PURE__ */ jsxRuntime.jsxs(
19629
- "span",
19630
- {
19631
- className: cn(
19632
- "inline-flex items-center gap-2 rounded-sm px-2.5 py-1 text-[0.68rem] font-semibold tracking-[0.12em] uppercase",
19633
- item.category === "best" ? "bg-primary-800 text-white" : "border border-grey-300 bg-grey-50 text-foreground"
19634
- ),
19635
- children: [
19636
- item.category === "best" ? /* @__PURE__ */ jsxRuntime.jsx(Icons.check_circle, { "data-slot": "icon", className: "size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(Icons.info, { "data-slot": "icon", className: "size-4" }),
19637
- item.categoryLabel
19638
- ]
19639
- }
19640
- ),
19641
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-auto shrink-0 self-start", children: /* @__PURE__ */ jsxRuntime.jsxs(
19642
- Button2,
19643
- {
19644
- variant: "ghost",
19645
- color: "grey",
19646
- size: "sm",
19647
- onClick: onCopyPairing,
19648
- "aria-label": `Copy pairing ${pair.background.token} and ${pair.foreground.token}`,
19649
- children: [
19650
- /* @__PURE__ */ jsxRuntime.jsx(Icons.content_copy, { "data-slot": "icon", className: "size-5" }),
19651
- copiedKey === `pair:${pair.id}` ? "Copied" : "Copy"
19652
- ]
19653
- }
19654
- ) })
19575
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pointer-events-none relative z-10 flex items-start gap-3", children: [
19576
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-0.5 w-12 shrink-0 overflow-hidden rounded-[2px] border border-black/10", children: [
19577
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-9 w-full", style: { backgroundColor: pair.background.hex } }),
19578
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-2.5 w-full", style: { backgroundColor: pair.foreground.hex } })
19655
19579
  ] }),
19656
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-4", children: [
19657
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-4 sm:grid-cols-[7.5rem_minmax(0,1fr)]", children: [
19658
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "overflow-hidden rounded-[2px] border border-black/10", children: [
19659
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-20 w-full", style: { backgroundColor: pair.background.hex } }),
19660
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-6 w-full", style: { backgroundColor: pair.foreground.hex } })
19580
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1 space-y-1", children: [
19581
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
19582
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm font-semibold text-foreground", children: [
19583
+ getPairingColorDisplayName4(pair.foreground),
19584
+ " on",
19585
+ " ",
19586
+ getPairingColorDisplayName4(pair.background)
19661
19587
  ] }),
19662
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 space-y-2", children: [
19663
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
19664
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-base font-semibold text-foreground", children: getPairingColorDisplayName4(pair.foreground) }),
19665
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 font-mono text-[0.74rem] break-all text-muted-foreground", children: pair.foreground.token })
19666
- ] }),
19667
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-muted-foreground", children: [
19668
- pair.foreground.familyLabel,
19669
- " on ",
19670
- pair.background.familyLabel
19671
- ] })
19672
- ] })
19588
+ item.category === "best" ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex rounded-sm bg-primary-800 px-2 py-1 text-[0.68rem] font-semibold tracking-[0.12em] text-white uppercase", children: "Default" }) : null,
19589
+ isSelected ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex rounded-sm border border-primary-800 px-2 py-1 text-[0.68rem] font-semibold tracking-[0.12em] text-primary-800 uppercase", children: "Current" }) : null
19673
19590
  ] }),
19674
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-4 flex flex-col items-start gap-3 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between", children: [
19675
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
19676
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex rounded-sm border border-grey-300 px-2.5 py-1 text-sm font-semibold text-foreground", children: [
19677
- pair.contrastRatio.toFixed(2),
19678
- ":1"
19679
- ] }),
19680
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex rounded-sm bg-success-700 px-2.5 py-1 text-[0.72rem] font-semibold tracking-[0.12em] text-white uppercase", children: "AAA" })
19681
- ] }),
19682
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-primary-800", children: isSelected ? "Selected answer" : "Use pairing" })
19591
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "font-mono text-[0.72rem] break-all text-muted-foreground", children: [
19592
+ pair.foreground.token,
19593
+ " on ",
19594
+ pair.background.token
19595
+ ] }),
19596
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-muted-foreground", children: [
19597
+ pair.contrastRatio.toFixed(2),
19598
+ ":1 contrast"
19683
19599
  ] })
19684
- ] })
19600
+ ] }),
19601
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-auto shrink-0 self-start", children: /* @__PURE__ */ jsxRuntime.jsx(
19602
+ Button2,
19603
+ {
19604
+ variant: "ghost",
19605
+ color: "grey",
19606
+ size: "icon",
19607
+ className: "size-8 text-muted-foreground hover:text-foreground",
19608
+ onClick: onCopyPairing,
19609
+ "aria-label": `Copy pairing ${pair.background.token} and ${pair.foreground.token}`,
19610
+ title: copiedKey === `pair:${pair.id}` ? "Copied" : "Copy pairing",
19611
+ children: copiedKey === `pair:${pair.id}` ? /* @__PURE__ */ jsxRuntime.jsx(Icons.check, { "data-slot": "icon", className: "size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(Icons.content_copy, { "data-slot": "icon", className: "size-4" })
19612
+ }
19613
+ ) })
19685
19614
  ] })
19686
19615
  ]
19687
19616
  }
@@ -19692,20 +19621,14 @@ function RecommendationGroupSection({
19692
19621
  description,
19693
19622
  title
19694
19623
  }) {
19695
- return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "space-y-3", children: [
19696
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
19624
+ return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "space-y-2", children: [
19625
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
19697
19626
  /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 3, size: 6, className: "text-foreground", trim: "normal", children: title }),
19698
- /* @__PURE__ */ jsxRuntime.jsx(Text, { size: 2, children: description })
19627
+ /* @__PURE__ */ jsxRuntime.jsx(Text, { size: 2, className: "text-muted-foreground", children: description })
19699
19628
  ] }),
19700
19629
  children
19701
19630
  ] });
19702
19631
  }
19703
- function DrawerSummaryItem({ label, value }) {
19704
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1 border-t border-grey-200 pt-3 first:border-t-0 first:pt-0", children: [
19705
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[0.72rem] font-semibold tracking-[0.12em] text-muted-foreground uppercase", children: label }),
19706
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold text-foreground", children: value })
19707
- ] });
19708
- }
19709
19632
  function TechnicalDetailsPanel2({
19710
19633
  color: color2,
19711
19634
  copiedKey,
@@ -19815,11 +19738,12 @@ function ColorPairingToolV4Content({
19815
19738
  const [selectedPairId, setSelectedPairId] = React5.useState(initialState.selectedPairId);
19816
19739
  const [drawerStepIndex, setDrawerStepIndex] = React5.useState(0);
19817
19740
  const [isCompactControlsOpen, setIsCompactControlsOpen] = React5.useState(false);
19741
+ const [isShowingAllAlternatives, setIsShowingAllAlternatives] = React5.useState(false);
19742
+ const [isTechnicalDetailsOpen, setIsTechnicalDetailsOpen] = React5.useState(false);
19818
19743
  const [, copyToClipboardRaw] = usehooks.useCopyToClipboard();
19819
19744
  const [copiedKey, setCopiedKey] = React5.useState(null);
19820
19745
  const copiedKeyTimeoutRef = React5.useRef(null);
19821
19746
  const resultSectionRef = React5.useRef(null);
19822
- const technicalDetailsSectionRef = React5.useRef(null);
19823
19747
  const noValidStateRef = React5.useRef(/* @__PURE__ */ new Set());
19824
19748
  const technicalDetailsViewedRef = React5.useRef(false);
19825
19749
  const emitAnalyticsEvent = React5.useCallback(
@@ -19902,7 +19826,6 @@ function ColorPairingToolV4Content({
19902
19826
  const category = getRecommendationCategory2(pair, bestRecommendedPair, context);
19903
19827
  return {
19904
19828
  category,
19905
- categoryLabel: getRecommendationCategoryLabel2(category),
19906
19829
  pair
19907
19830
  };
19908
19831
  }).sort(
@@ -19915,6 +19838,37 @@ function ColorPairingToolV4Content({
19915
19838
  ),
19916
19839
  [recommendationItems, selectedPair?.id]
19917
19840
  );
19841
+ const visibleAlternativeRecommendationGroups = React5.useMemo(() => {
19842
+ if (isShowingAllAlternatives) {
19843
+ return alternativeRecommendationGroups;
19844
+ }
19845
+ let remaining = INITIAL_VISIBLE_ALTERNATIVES;
19846
+ return alternativeRecommendationGroups.reduce((groups, group) => {
19847
+ if (remaining <= 0) {
19848
+ return groups;
19849
+ }
19850
+ const items = group.items.slice(0, remaining);
19851
+ if (items.length > 0) {
19852
+ groups.push({
19853
+ ...group,
19854
+ items
19855
+ });
19856
+ remaining -= items.length;
19857
+ }
19858
+ return groups;
19859
+ }, []);
19860
+ }, [alternativeRecommendationGroups, isShowingAllAlternatives]);
19861
+ const hiddenAlternativeCount = React5.useMemo(() => {
19862
+ const totalAlternatives = alternativeRecommendationGroups.reduce(
19863
+ (count, group) => count + group.items.length,
19864
+ 0
19865
+ );
19866
+ const visibleAlternatives = visibleAlternativeRecommendationGroups.reduce(
19867
+ (count, group) => count + group.items.length,
19868
+ 0
19869
+ );
19870
+ return Math.max(0, totalAlternatives - visibleAlternatives);
19871
+ }, [alternativeRecommendationGroups, visibleAlternativeRecommendationGroups]);
19918
19872
  const liveAnnouncement = React5.useMemo(
19919
19873
  () => getLiveAnnouncement2(previewPair, selectedBackground),
19920
19874
  [previewPair, selectedBackground]
@@ -20022,6 +19976,7 @@ function ColorPairingToolV4Content({
20022
19976
  selectedBackgroundToken,
20023
19977
  null
20024
19978
  );
19979
+ setIsShowingAllAlternatives(false);
20025
19980
  applyResolvedSelection(nextState);
20026
19981
  emitAnalyticsEvent({
20027
19982
  name: "palette_change",
@@ -20041,6 +19996,7 @@ function ColorPairingToolV4Content({
20041
19996
  selectedBackgroundToken,
20042
19997
  null
20043
19998
  );
19999
+ setIsShowingAllAlternatives(false);
20044
20000
  applyResolvedSelection(nextState);
20045
20001
  emitAnalyticsEvent({
20046
20002
  name: "primary_change",
@@ -20060,6 +20016,7 @@ function ColorPairingToolV4Content({
20060
20016
  selectedBackgroundToken,
20061
20017
  null
20062
20018
  );
20019
+ setIsShowingAllAlternatives(false);
20063
20020
  applyResolvedSelection(nextState);
20064
20021
  emitAnalyticsEvent({
20065
20022
  name: "accent_change",
@@ -20080,6 +20037,7 @@ function ColorPairingToolV4Content({
20080
20037
  selectedPairId: nextSelectedPairId,
20081
20038
  themeCategory
20082
20039
  };
20040
+ setIsShowingAllAlternatives(false);
20083
20041
  applyResolvedSelection(nextState);
20084
20042
  emitAnalyticsEvent({
20085
20043
  name: "background_selection",
@@ -20153,50 +20111,17 @@ function ColorPairingToolV4Content({
20153
20111
  themeCategory
20154
20112
  ]);
20155
20113
  React5.useEffect(() => {
20156
- if (technicalDetailsViewedRef.current) {
20114
+ if (!isTechnicalDetailsOpen || technicalDetailsViewedRef.current) {
20157
20115
  return;
20158
20116
  }
20159
- const section = technicalDetailsSectionRef.current;
20160
- if (!section) {
20161
- return;
20162
- }
20163
- const emitViewedEvent = () => {
20164
- if (technicalDetailsViewedRef.current) {
20165
- return;
20166
- }
20167
- technicalDetailsViewedRef.current = true;
20168
- emitAnalyticsEvent({
20169
- name: "technical_details_viewed",
20170
- ...buildAnalyticsContext({
20171
- source: "details"
20172
- })
20173
- });
20174
- };
20175
- if (typeof IntersectionObserver === "undefined") {
20176
- const rect = section.getBoundingClientRect();
20177
- const viewportHeight = window.innerHeight || document.documentElement.clientHeight;
20178
- if (rect.top < viewportHeight && rect.bottom > 0) {
20179
- emitViewedEvent();
20180
- }
20181
- return;
20182
- }
20183
- const observer = new IntersectionObserver(
20184
- (entries) => {
20185
- const [entry] = entries;
20186
- if (entry?.isIntersecting) {
20187
- emitViewedEvent();
20188
- observer.disconnect();
20189
- }
20190
- },
20191
- {
20192
- threshold: 0.2
20193
- }
20194
- );
20195
- observer.observe(section);
20196
- return () => {
20197
- observer.disconnect();
20198
- };
20199
- }, [buildAnalyticsContext, emitAnalyticsEvent]);
20117
+ technicalDetailsViewedRef.current = true;
20118
+ emitAnalyticsEvent({
20119
+ name: "technical_details_viewed",
20120
+ ...buildAnalyticsContext({
20121
+ source: "details"
20122
+ })
20123
+ });
20124
+ }, [buildAnalyticsContext, emitAnalyticsEvent, isTechnicalDetailsOpen]);
20200
20125
  if (!selectedBackground) {
20201
20126
  return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "px-6 py-6", children: [
20202
20127
  /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 2, size: 5, className: "text-foreground", trim: "normal", children: "No approved background tones available" }),
@@ -20342,36 +20267,10 @@ function ColorPairingToolV4Content({
20342
20267
  },
20343
20268
  group.key
20344
20269
  )) }) }),
20345
- /* @__PURE__ */ jsxRuntime.jsx("section", { className: "h-full w-full shrink-0 overflow-y-auto px-5 py-5", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6 pr-1", children: [
20346
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-sm border border-grey-200 bg-white px-4 py-4", children: [
20347
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
20348
- /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 4, size: 6, className: "text-foreground", trim: "normal", children: "Current configuration" }),
20349
- /* @__PURE__ */ jsxRuntime.jsx(Text, { size: 2, children: "The drawer only sets the palette, families, and background. The result panel is where the pairing is shown and, if needed, overridden." })
20350
- ] }),
20351
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-5 space-y-3", children: [
20352
- /* @__PURE__ */ jsxRuntime.jsx(
20353
- DrawerSummaryItem,
20354
- {
20355
- label: "Palette",
20356
- value: themeCategory === "brand" ? "Brand palette" : "Aboriginal palette"
20357
- }
20358
- ),
20359
- /* @__PURE__ */ jsxRuntime.jsx(DrawerSummaryItem, { label: "Primary family", value: context.primary.label }),
20360
- /* @__PURE__ */ jsxRuntime.jsx(DrawerSummaryItem, { label: "Accent family", value: context.accent.label }),
20361
- /* @__PURE__ */ jsxRuntime.jsx(
20362
- DrawerSummaryItem,
20363
- {
20364
- label: "Background",
20365
- value: getPairingColorDisplayName4(selectedBackground)
20366
- }
20367
- )
20368
- ] })
20369
- ] }),
20370
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-sm border border-grey-200 bg-grey-50 px-4 py-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
20371
- /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 4, size: 6, className: "text-foreground", trim: "normal", children: "Review the result on the right" }),
20372
- /* @__PURE__ */ jsxRuntime.jsx(Text, { size: 2, children: "The right panel always shows the current NSW default pairing for this selection. Alternative AAA options stay there as a secondary override path." })
20373
- ] }) })
20374
- ] }) })
20270
+ /* @__PURE__ */ jsxRuntime.jsx("section", { className: "h-full w-full shrink-0 overflow-y-auto px-5 py-5", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4 pr-1", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-sm border border-grey-200 bg-grey-50 px-4 py-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
20271
+ /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 4, size: 6, className: "text-foreground", trim: "normal", children: "Review the result on the right" }),
20272
+ /* @__PURE__ */ jsxRuntime.jsx(Text, { size: 2, children: "The right panel shows one recommended pairing first. Use approved alternatives there only when you need a different tone or emphasis." })
20273
+ ] }) }) }) })
20375
20274
  ]
20376
20275
  }
20377
20276
  ) }),
@@ -20409,7 +20308,7 @@ function ColorPairingToolV4Content({
20409
20308
  /* @__PURE__ */ jsxRuntime.jsx(Card, { className: "gap-4 px-5 py-5", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between", children: [
20410
20309
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
20411
20310
  /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 2, size: 5, className: "text-foreground", trim: "normal", children: "Configuration" }),
20412
- /* @__PURE__ */ jsxRuntime.jsx(Text, { size: 2, children: "Open the drawer to change palette, colour families, or background. The result panel always shows the current NSW pairing for this selection." }),
20311
+ /* @__PURE__ */ jsxRuntime.jsx(Text, { size: 2, children: "Open the drawer to set palette, colour families, and background. The result panel shows the NSW recommendation first." }),
20413
20312
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: compactControlsSummary })
20414
20313
  ] }),
20415
20314
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -20464,53 +20363,99 @@ function ColorPairingToolV4Content({
20464
20363
  }
20465
20364
  )
20466
20365
  ] }),
20467
- /* @__PURE__ */ jsxRuntime.jsx("section", { children: /* @__PURE__ */ jsxRuntime.jsx(AccessibilitySummaryCard, { pair: previewPair }) }),
20468
- bestRecommendedPair || alternativeRecommendationGroups.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "space-y-6", children: [
20469
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
20470
- /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 2, size: 5, className: "text-foreground", trim: "normal", children: "Alternative AAA options" }),
20471
- /* @__PURE__ */ jsxRuntime.jsx(Text, { size: 2, children: "These approved alternatives can be used when a different tone, stronger emphasis, or a more neutral system treatment is needed." })
20366
+ bestRecommendedPair || alternativeRecommendationGroups.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "space-y-4", children: [
20367
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
20368
+ /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 2, size: 5, className: "text-foreground", trim: "normal", children: "Approved alternatives" }),
20369
+ /* @__PURE__ */ jsxRuntime.jsx(Text, { size: 2, className: "text-muted-foreground", children: "These are approved alternatives for different tone or emphasis." })
20472
20370
  ] }),
20473
- alternativeRecommendationGroups.length > 0 ? alternativeRecommendationGroups.map((group) => /* @__PURE__ */ jsxRuntime.jsx(
20474
- RecommendationGroupSection,
20475
- {
20476
- title: group.title,
20477
- description: group.description,
20478
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: group.items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
20479
- RecommendationCard2,
20480
- {
20481
- copiedKey,
20482
- item,
20483
- isSelected: item.pair.id === selectedPair?.id,
20484
- onCopyPairing: () => copyValue(
20485
- `pair:${item.pair.id}`,
20486
- getPairingCopyText2(item.pair),
20487
- "Pairing copied",
20488
- item.pair.id === bestRecommendedPair?.id ? {
20489
- name: "best_recommendation_copied",
20490
- ...buildAnalyticsContext({
20491
- foregroundToken: item.pair.foreground.token,
20492
- pairId: item.pair.id,
20493
- source: "recommendations-list"
20494
- })
20495
- } : void 0
20496
- ),
20497
- onSelect: () => handlePairChange(item.pair.id, "recommendations-list")
20498
- },
20499
- item.pair.id
20500
- )) })
20501
- },
20502
- group.id
20503
- )) : /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "px-6 py-6", children: [
20371
+ alternativeRecommendationGroups.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
20372
+ visibleAlternativeRecommendationGroups.map((group) => /* @__PURE__ */ jsxRuntime.jsx(
20373
+ RecommendationGroupSection,
20374
+ {
20375
+ title: group.title,
20376
+ description: group.description,
20377
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: group.items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
20378
+ RecommendationCard2,
20379
+ {
20380
+ copiedKey,
20381
+ item,
20382
+ isSelected: item.pair.id === selectedPair?.id,
20383
+ onCopyPairing: () => copyValue(
20384
+ `pair:${item.pair.id}`,
20385
+ getPairingCopyText2(item.pair),
20386
+ "Pairing copied",
20387
+ item.pair.id === bestRecommendedPair?.id ? {
20388
+ name: "best_recommendation_copied",
20389
+ ...buildAnalyticsContext({
20390
+ foregroundToken: item.pair.foreground.token,
20391
+ pairId: item.pair.id,
20392
+ source: "recommendations-list"
20393
+ })
20394
+ } : void 0
20395
+ ),
20396
+ onSelect: () => handlePairChange(item.pair.id, "recommendations-list")
20397
+ },
20398
+ item.pair.id
20399
+ )) })
20400
+ },
20401
+ group.id
20402
+ )),
20403
+ hiddenAlternativeCount > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
20404
+ Button2,
20405
+ {
20406
+ variant: "ghost",
20407
+ color: "grey",
20408
+ className: "w-full justify-center border border-grey-200 bg-white sm:w-auto",
20409
+ onClick: () => setIsShowingAllAlternatives(true),
20410
+ children: [
20411
+ "Show ",
20412
+ hiddenAlternativeCount,
20413
+ " more"
20414
+ ]
20415
+ }
20416
+ ) : null
20417
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "px-6 py-6", children: [
20504
20418
  /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 3, size: 6, className: "text-foreground", trim: "normal", children: "No other AAA alternatives" }),
20505
20419
  /* @__PURE__ */ jsxRuntime.jsx(Text, { size: 2, className: "mt-3", children: "The NSW recommended pairing is the only AAA-compliant foreground option for this background." })
20506
20420
  ] })
20507
20421
  ] }) : null,
20508
- /* @__PURE__ */ jsxRuntime.jsx("section", { ref: technicalDetailsSectionRef, className: "space-y-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-sm border border-grey-200 bg-white", children: [
20509
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2 border-b border-grey-200 px-4 py-4 sm:px-5", children: [
20510
- /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 2, size: 5, className: "text-foreground", trim: "normal", children: "Technical colour values" }),
20511
- /* @__PURE__ */ jsxRuntime.jsx(Text, { size: 2, children: "Token, tone, HEX, RGB, HSL, and OKLCH values for the current selection." })
20512
- ] }),
20513
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 py-4 sm:px-5", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-4 lg:grid-cols-2", children: [
20422
+ /* @__PURE__ */ jsxRuntime.jsx("section", { className: "space-y-3", children: /* @__PURE__ */ jsxRuntime.jsx(Collapsible, { open: isTechnicalDetailsOpen, onOpenChange: setIsTechnicalDetailsOpen, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-sm border border-grey-200 bg-white", children: [
20423
+ /* @__PURE__ */ jsxRuntime.jsx(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
20424
+ "button",
20425
+ {
20426
+ type: "button",
20427
+ className: "flex w-full items-center justify-between gap-4 px-4 py-4 text-left transition-colors hover:bg-grey-50 focus-visible:ring-2 focus-visible:ring-primary-700 focus-visible:ring-offset-2 focus-visible:outline-hidden sm:px-5",
20428
+ children: [
20429
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
20430
+ /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 2, size: 6, className: "text-foreground", trim: "normal", children: "Technical colour values" }),
20431
+ /* @__PURE__ */ jsxRuntime.jsx(Text, { size: 2, className: "text-muted-foreground", children: "Token, tone, HEX, RGB, HSL, and OKLCH values for advanced use." })
20432
+ ] }),
20433
+ /* @__PURE__ */ jsxRuntime.jsxs(
20434
+ "span",
20435
+ {
20436
+ className: cn(
20437
+ "inline-flex items-center gap-2 text-sm font-semibold text-primary-800",
20438
+ isTechnicalDetailsOpen && "text-foreground"
20439
+ ),
20440
+ children: [
20441
+ isTechnicalDetailsOpen ? "Hide" : "Show",
20442
+ /* @__PURE__ */ jsxRuntime.jsx(
20443
+ Icons.keyboard_arrow_down,
20444
+ {
20445
+ "data-slot": "icon",
20446
+ className: cn(
20447
+ "size-5 transition-transform",
20448
+ isTechnicalDetailsOpen && "rotate-180"
20449
+ )
20450
+ }
20451
+ )
20452
+ ]
20453
+ }
20454
+ )
20455
+ ]
20456
+ }
20457
+ ) }),
20458
+ /* @__PURE__ */ jsxRuntime.jsx(CollapsibleContent2, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-grey-200 px-4 py-4 sm:px-5", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-4 lg:grid-cols-2", children: [
20514
20459
  /* @__PURE__ */ jsxRuntime.jsx(
20515
20460
  TechnicalDetailsPanel2,
20516
20461
  {
@@ -20531,20 +20476,20 @@ function ColorPairingToolV4Content({
20531
20476
  onCopyValue: (copyKey, value, toastLabel) => copyValue(copyKey, value, toastLabel)
20532
20477
  }
20533
20478
  )
20534
- ] }) })
20535
- ] }) }),
20536
- /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "space-y-3", children: [
20537
- /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 3, size: 6, className: "mb-4 text-foreground", trim: "normal", children: "Share colour pairing" }),
20538
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-sm border border-grey-200 bg-white p-4", children: [
20539
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row items-center justify-between", children: [
20540
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Copy this URL to share your current colour pairing:" }),
20479
+ ] }) }) })
20480
+ ] }) }) }),
20481
+ /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "space-y-2", children: [
20482
+ /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 3, size: 6, className: "text-foreground", trim: "normal", children: "Share colour pairing" }),
20483
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-sm border border-grey-200 bg-white px-4 py-4", children: [
20484
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [
20485
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Copy a link to this current result." }),
20541
20486
  /* @__PURE__ */ jsxRuntime.jsx(
20542
20487
  Button2,
20543
20488
  {
20544
20489
  variant: "ghost",
20545
20490
  color: "grey",
20546
20491
  size: "sm",
20547
- className: "shrink-0 self-center",
20492
+ className: "shrink-0 self-start sm:self-center",
20548
20493
  onClick: () => copyValue(
20549
20494
  "share-url",
20550
20495
  typeof window === "undefined" ? shareUrl : new URL(shareUrl, window.location.origin).toString(),
@@ -23206,7 +23151,7 @@ function FormatToggle({ format, setFormat }) {
23206
23151
 
23207
23152
  // package.json
23208
23153
  var package_default = {
23209
- version: "1.104.0"};
23154
+ version: "1.105.0"};
23210
23155
  function Logo(props) {
23211
23156
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
23212
23157
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "NSW Government" }),