@nswds/app 1.123.0 → 1.124.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
@@ -15164,6 +15164,12 @@ function getContrastTone(contrastRatio) {
15164
15164
  if (contrastRatio >= AA_LARGE_CONTRAST_RATIO) return "warning";
15165
15165
  return "danger";
15166
15166
  }
15167
+ function supportsNormalTextPreview(contrastRatio) {
15168
+ return contrastRatio >= AA_NORMAL_CONTRAST_RATIO;
15169
+ }
15170
+ function supportsLargeTextPreview(contrastRatio) {
15171
+ return contrastRatio >= AA_LARGE_CONTRAST_RATIO;
15172
+ }
15167
15173
  function getPreviewHeroRatingLabel(contrastRatio) {
15168
15174
  if (contrastRatio >= AAA_NORMAL_CONTRAST_RATIO) return "AAA normal";
15169
15175
  if (contrastRatio >= AA_NORMAL_CONTRAST_RATIO) return "AA normal";
@@ -15784,6 +15790,8 @@ function ColorPairingToolContent({ visibleFormats }) {
15784
15790
  const previewHeroRatingLabel = getPreviewHeroRatingLabel(contrastRatio);
15785
15791
  const previewHeroStatusLabel = getPreviewHeroStatusLabel(contrastRatio);
15786
15792
  const contrastTone = getContrastTone(contrastRatio);
15793
+ const showNormalTextPreview = supportsNormalTextPreview(contrastRatio);
15794
+ const showLargeTextPreview = supportsLargeTextPreview(contrastRatio);
15787
15795
  const resolvedCopyFormat = visibleFormats.includes(copyFormat) ? copyFormat : visibleFormats[0] ?? DEFAULT_VISIBLE_FORMATS[0];
15788
15796
  return /* @__PURE__ */ jsxRuntime.jsx("section", { className: "min-w-0 overflow-hidden rounded-sm bg-white text-grey-800", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid min-w-0 xl:min-h-[46rem] xl:grid-cols-[260px_minmax(0,1fr)] xl:gap-x-6", children: [
15789
15797
  /* @__PURE__ */ jsxRuntime.jsx("aside", { className: "border-b border-grey-200 px-4 py-5 sm:px-6 xl:border-b-0 xl:px-0", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
@@ -15909,38 +15917,49 @@ function ColorPairingToolContent({ visibleFormats }) {
15909
15917
  }
15910
15918
  )
15911
15919
  ] }),
15912
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 items-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-[42rem] space-y-5 pb-12 sm:pb-8", children: [
15913
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[0.82rem] font-semibold tracking-[0.12em] uppercase", children: "NSW Government Digital" }),
15914
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-4xl leading-none font-bold sm:text-5xl", children: "Connecting communities to services that matter" }),
15915
- /* @__PURE__ */ jsxRuntime.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." }),
15916
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-3 pt-1", children: [
15917
- /* @__PURE__ */ jsxRuntime.jsx(
15918
- "span",
15919
- {
15920
- "aria-hidden": "true",
15921
- "data-variant": "solid",
15922
- className: cn(
15923
- buttonVariants({ variant: "solid", size: "default" }),
15924
- "pointer-events-none cursor-default px-6 text-[16px] font-[700] select-none sm:px-6 sm:text-[16px] sm:font-[700]"
15925
- ),
15926
- style: fauxButtonStyle,
15927
- children: "Get started"
15928
- }
15920
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 items-center", children: /* @__PURE__ */ jsxRuntime.jsxs(
15921
+ "div",
15922
+ {
15923
+ className: cn(
15924
+ "max-w-[42rem] space-y-5",
15925
+ showNormalTextPreview && "pb-12 sm:pb-8"
15929
15926
  ),
15930
- /* @__PURE__ */ jsxRuntime.jsx(
15931
- "span",
15932
- {
15933
- "data-variant": "outline",
15934
- className: cn(
15935
- buttonVariants({ variant: "outline", size: "default" }),
15936
- "pointer-events-none cursor-default px-6 text-[16px] font-[700] select-none sm:px-6 sm:text-[16px] sm:font-[700]"
15937
- ),
15938
- style: fauxButtonStyle,
15939
- children: "Learn more"
15940
- }
15941
- )
15942
- ] })
15943
- ] }) }),
15927
+ children: [
15928
+ showNormalTextPreview ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[0.82rem] font-semibold tracking-[0.12em] uppercase", children: "NSW Government Digital" }) : null,
15929
+ showLargeTextPreview ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-4xl leading-none font-bold sm:text-5xl", children: "Connecting communities to services that matter" }) : null,
15930
+ showNormalTextPreview ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
15931
+ /* @__PURE__ */ jsxRuntime.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." }),
15932
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-3 pt-1", children: [
15933
+ /* @__PURE__ */ jsxRuntime.jsx(
15934
+ "span",
15935
+ {
15936
+ "aria-hidden": "true",
15937
+ "data-variant": "solid",
15938
+ className: cn(
15939
+ buttonVariants({ variant: "solid", size: "default" }),
15940
+ "pointer-events-none cursor-default px-6 text-[16px] font-[700] select-none sm:px-6 sm:text-[16px] sm:font-[700]"
15941
+ ),
15942
+ style: fauxButtonStyle,
15943
+ children: "Get started"
15944
+ }
15945
+ ),
15946
+ /* @__PURE__ */ jsxRuntime.jsx(
15947
+ "span",
15948
+ {
15949
+ "data-variant": "outline",
15950
+ className: cn(
15951
+ buttonVariants({ variant: "outline", size: "default" }),
15952
+ "pointer-events-none cursor-default px-6 text-[16px] font-[700] select-none sm:px-6 sm:text-[16px] sm:font-[700]"
15953
+ ),
15954
+ style: fauxButtonStyle,
15955
+ children: "Learn more"
15956
+ }
15957
+ )
15958
+ ] })
15959
+ ] }) : null
15960
+ ]
15961
+ }
15962
+ ) }),
15944
15963
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
15945
15964
  /* @__PURE__ */ jsxRuntime.jsxs(
15946
15965
  "span",
@@ -19030,7 +19049,7 @@ function FormatToggle({ format, setFormat }) {
19030
19049
 
19031
19050
  // package.json
19032
19051
  var package_default = {
19033
- version: "1.122.0"};
19052
+ version: "1.123.0"};
19034
19053
  var SluggerContext = React5__namespace.default.createContext(null);
19035
19054
  function flattenText(nodes) {
19036
19055
  if (nodes == null || typeof nodes === "boolean") return "";