@nswds/app 1.123.0 → 1.124.1

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.js CHANGED
@@ -15108,6 +15108,12 @@ function getContrastTone(contrastRatio) {
15108
15108
  if (contrastRatio >= AA_LARGE_CONTRAST_RATIO) return "warning";
15109
15109
  return "danger";
15110
15110
  }
15111
+ function supportsNormalTextPreview(contrastRatio) {
15112
+ return contrastRatio >= AA_NORMAL_CONTRAST_RATIO;
15113
+ }
15114
+ function supportsLargeTextPreview(contrastRatio) {
15115
+ return contrastRatio >= AA_LARGE_CONTRAST_RATIO;
15116
+ }
15111
15117
  function getPreviewHeroRatingLabel(contrastRatio) {
15112
15118
  if (contrastRatio >= AAA_NORMAL_CONTRAST_RATIO) return "AAA normal";
15113
15119
  if (contrastRatio >= AA_NORMAL_CONTRAST_RATIO) return "AA normal";
@@ -15728,6 +15734,8 @@ function ColorPairingToolContent({ visibleFormats }) {
15728
15734
  const previewHeroRatingLabel = getPreviewHeroRatingLabel(contrastRatio);
15729
15735
  const previewHeroStatusLabel = getPreviewHeroStatusLabel(contrastRatio);
15730
15736
  const contrastTone = getContrastTone(contrastRatio);
15737
+ const showNormalTextPreview = supportsNormalTextPreview(contrastRatio);
15738
+ const showLargeTextPreview = supportsLargeTextPreview(contrastRatio);
15731
15739
  const resolvedCopyFormat = visibleFormats.includes(copyFormat) ? copyFormat : visibleFormats[0] ?? DEFAULT_VISIBLE_FORMATS[0];
15732
15740
  return /* @__PURE__ */ jsx("section", { className: "min-w-0 overflow-hidden rounded-sm bg-white text-grey-800", children: /* @__PURE__ */ jsxs("div", { className: "grid min-w-0 xl:min-h-[46rem] xl:grid-cols-[260px_minmax(0,1fr)] xl:gap-x-6", children: [
15733
15741
  /* @__PURE__ */ jsx("aside", { className: "border-b border-grey-200 px-4 py-5 sm:px-6 xl:border-b-0 xl:px-0", children: /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
@@ -15853,38 +15861,49 @@ function ColorPairingToolContent({ visibleFormats }) {
15853
15861
  }
15854
15862
  )
15855
15863
  ] }),
15856
- /* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center", children: /* @__PURE__ */ jsxs("div", { className: "max-w-[42rem] space-y-5 pb-12 sm:pb-8", children: [
15857
- /* @__PURE__ */ jsx("p", { className: "text-[0.82rem] font-semibold tracking-[0.12em] uppercase", children: "NSW Government Digital" }),
15858
- /* @__PURE__ */ jsx("h3", { className: "text-4xl leading-none font-bold sm:text-5xl", children: "Connecting communities to services that matter" }),
15859
- /* @__PURE__ */ jsx("p", { className: "max-w-[38rem] text-base leading-7 sm:text-lg sm:leading-8", children: "Review how each pairing performs against AA and AAA requirements for normal and large text across your selected primary, accent, and grey families." }),
15860
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3 pt-1", children: [
15861
- /* @__PURE__ */ jsx(
15862
- "span",
15863
- {
15864
- "aria-hidden": "true",
15865
- "data-variant": "solid",
15866
- className: cn(
15867
- buttonVariants({ variant: "solid", size: "default" }),
15868
- "pointer-events-none cursor-default px-6 text-[16px] font-[700] select-none sm:px-6 sm:text-[16px] sm:font-[700]"
15869
- ),
15870
- style: fauxButtonStyle,
15871
- children: "Get started"
15872
- }
15864
+ /* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center", children: /* @__PURE__ */ jsxs(
15865
+ "div",
15866
+ {
15867
+ className: cn(
15868
+ "max-w-[42rem] space-y-5",
15869
+ showNormalTextPreview && "pb-12 sm:pb-8"
15873
15870
  ),
15874
- /* @__PURE__ */ jsx(
15875
- "span",
15876
- {
15877
- "data-variant": "outline",
15878
- className: cn(
15879
- buttonVariants({ variant: "outline", size: "default" }),
15880
- "pointer-events-none cursor-default px-6 text-[16px] font-[700] select-none sm:px-6 sm:text-[16px] sm:font-[700]"
15881
- ),
15882
- style: fauxButtonStyle,
15883
- children: "Learn more"
15884
- }
15885
- )
15886
- ] })
15887
- ] }) }),
15871
+ children: [
15872
+ showNormalTextPreview ? /* @__PURE__ */ jsx("p", { className: "text-[0.82rem] font-semibold tracking-[0.12em] uppercase", children: "NSW Government Digital" }) : null,
15873
+ showLargeTextPreview ? /* @__PURE__ */ jsx("h3", { className: "text-4xl leading-none font-bold sm:text-5xl", children: "Connecting communities to services that matter" }) : null,
15874
+ showNormalTextPreview ? /* @__PURE__ */ jsxs(Fragment, { children: [
15875
+ /* @__PURE__ */ jsx("p", { className: "max-w-[38rem] text-base leading-7 sm:text-lg sm:leading-8", children: "Review how each pairing performs against AA and AAA requirements for normal and large text across your selected primary, accent, and grey families." }),
15876
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3 pt-1", children: [
15877
+ /* @__PURE__ */ jsx(
15878
+ "span",
15879
+ {
15880
+ "aria-hidden": "true",
15881
+ "data-variant": "solid",
15882
+ className: cn(
15883
+ buttonVariants({ variant: "solid", size: "default" }),
15884
+ "pointer-events-none cursor-default px-6 text-[16px] font-[700] select-none sm:px-6 sm:text-[16px] sm:font-[700]"
15885
+ ),
15886
+ style: fauxButtonStyle,
15887
+ children: "Get started"
15888
+ }
15889
+ ),
15890
+ /* @__PURE__ */ jsx(
15891
+ "span",
15892
+ {
15893
+ "data-variant": "outline",
15894
+ className: cn(
15895
+ buttonVariants({ variant: "outline", size: "default" }),
15896
+ "pointer-events-none cursor-default px-6 text-[16px] font-[700] select-none sm:px-6 sm:text-[16px] sm:font-[700]"
15897
+ ),
15898
+ style: fauxButtonStyle,
15899
+ children: "Learn more"
15900
+ }
15901
+ )
15902
+ ] })
15903
+ ] }) : null
15904
+ ]
15905
+ }
15906
+ ) }),
15888
15907
  /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
15889
15908
  /* @__PURE__ */ jsxs(
15890
15909
  "span",
@@ -16064,7 +16083,7 @@ function ColorPairingToolContent({ visibleFormats }) {
16064
16083
  optionCount === 1 ? "" : "s"
16065
16084
  ] })
16066
16085
  ] }),
16067
- /* @__PURE__ */ jsx("div", { className: "flex gap-2 overflow-x-auto pb-1", children: accessibleForegroundOptions.length > 0 ? accessibleForegroundOptions.map((candidate) => /* @__PURE__ */ jsx(
16086
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 pb-1", children: accessibleForegroundOptions.length > 0 ? accessibleForegroundOptions.map((candidate) => /* @__PURE__ */ jsx(
16068
16087
  ForegroundOption,
16069
16088
  {
16070
16089
  backgroundHex: backgroundShade.hex,
@@ -18974,7 +18993,7 @@ function FormatToggle({ format, setFormat }) {
18974
18993
 
18975
18994
  // package.json
18976
18995
  var package_default = {
18977
- version: "1.122.0"};
18996
+ version: "1.124.0"};
18978
18997
  var SluggerContext = React5__default.createContext(null);
18979
18998
  function flattenText(nodes) {
18980
18999
  if (nodes == null || typeof nodes === "boolean") return "";