@nswds/app 1.66.4 → 1.67.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
@@ -13689,7 +13689,7 @@ function FormatToggle({ format, setFormat }) {
13689
13689
 
13690
13690
  // package.json
13691
13691
  var package_default = {
13692
- version: "1.65.1"};
13692
+ version: "1.66.1"};
13693
13693
  function Heading({
13694
13694
  className,
13695
13695
  trim = "normal",
@@ -23733,6 +23733,178 @@ function NavigationMenuIndicator({
23733
23733
  }
23734
23734
  );
23735
23735
  }
23736
+ var styles4 = {
23737
+ base: [
23738
+ // Base
23739
+ "group relative mx-auto max-w-md overflow-hidden rounded-md",
23740
+ "bg-(--nsw-card-bg) border border-(--nsw-card-border) text-(--nsw-card-text)",
23741
+ // Focus
23742
+ "focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-primary-600",
23743
+ // Add transition
23744
+ "transition-colors duration-100 ease-out motion-reduce:transition-none"
23745
+ ],
23746
+ default: [
23747
+ // Base
23748
+ "",
23749
+ // Hover
23750
+ ""
23751
+ ],
23752
+ highlight: [
23753
+ "border-none",
23754
+ // Highlight
23755
+ "after:absolute after:inset-x-0 after:top-0 after:h-1 after:content-['']",
23756
+ "after:pointer-events-none after:z-10 after:rounded-t-md after:bg-[var(--nsw-card-top-border)]",
23757
+ // Hover
23758
+ "hover:bg-primary-800 hover:after:bg-primary-800"
23759
+ ],
23760
+ colors: {
23761
+ white: [
23762
+ // Base
23763
+ "[--nsw-card-bg:white] [--nsw-card-border:var(--color-grey-200)] [--nsw-card-text:grey-800]",
23764
+ // Hover
23765
+ "hover:[--nsw-card-bg:var(--color-primary-800)] hover:[--nsw-card-border:var(--color-primary-800)] hover:[--nsw-card-text:white]"
23766
+ ],
23767
+ primary: [
23768
+ // Base
23769
+ "[--nsw-card-bg:var(--color-primary-800)] [--nsw-card-border:var(--color-primary-800)] [--nsw-card-text:white]",
23770
+ // Hover
23771
+ "hover:[--nsw-card-bg:white] hover:[--nsw-card-border:var(--color-grey-200)] hover:[--nsw-card-text:grey-800]"
23772
+ ],
23773
+ secondary: [
23774
+ // Base
23775
+ "[--nsw-card-bg:var(--color-primary-200)] [--nsw-card-border:var(--color-primary-200)] [--nsw-card-text:var(--color-primary-800)]",
23776
+ // Hover
23777
+ "hover:[--nsw-card-bg:var(--color-primary-800)] hover:[--nsw-card-border:var(--color-primary-800)] hover:[--nsw-card-text:white]"
23778
+ ],
23779
+ tertiary: [
23780
+ // Base
23781
+ "[--nsw-card-bg:var(--color-primary-600)] [--nsw-card-border:var(--color-primary-600)] [--nsw-card-text:var(--color-primary-600)]",
23782
+ // Hover
23783
+ "hover:[--nsw-card-bg:var(--color-primary-800)] hover:[--nsw-card-border:var(--color-primary-800)] hover:[--nsw-card-text:white]"
23784
+ ]
23785
+ },
23786
+ size: {
23787
+ default: "",
23788
+ sm: "",
23789
+ lg: ""
23790
+ }
23791
+ };
23792
+ var cardVariants = classVarianceAuthority.cva(styles4.base, {
23793
+ variants: {
23794
+ variant: {
23795
+ highlight: styles4.highlight,
23796
+ default: styles4.default
23797
+ },
23798
+ color: {
23799
+ white: styles4.colors.white,
23800
+ primary: styles4.colors.primary,
23801
+ secondary: styles4.colors.secondary,
23802
+ tertiary: styles4.colors.tertiary
23803
+ },
23804
+ size: {
23805
+ default: styles4.size.default,
23806
+ sm: styles4.size.sm,
23807
+ lg: styles4.size.lg
23808
+ }
23809
+ },
23810
+ defaultVariants: {
23811
+ variant: "default",
23812
+ color: "white",
23813
+ size: "default"
23814
+ }
23815
+ });
23816
+ function NSWCardTitle({
23817
+ children,
23818
+ className,
23819
+ href,
23820
+ ...props
23821
+ }) {
23822
+ return /* @__PURE__ */ jsxRuntime.jsxs(
23823
+ Link,
23824
+ {
23825
+ className: cn(
23826
+ "mb-6 text-3xl font-bold text-grey-800",
23827
+ "group-hover:text-white",
23828
+ "group-data-[color=primary]:text-white",
23829
+ "group-hover:group-data-[color=primary]:text-grey-800",
23830
+ "group-data-[color=secondary]:text-primary-800",
23831
+ "group-hover:group-data-[color=secondary]:text-white",
23832
+ "group-data-[color=tertiary]:text-white",
23833
+ className
23834
+ ),
23835
+ href,
23836
+ ...props,
23837
+ children: [
23838
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute inset-0" }),
23839
+ children
23840
+ ]
23841
+ }
23842
+ );
23843
+ }
23844
+ function NSWCardDescription({
23845
+ children,
23846
+ className,
23847
+ ...props
23848
+ }) {
23849
+ return /* @__PURE__ */ jsxRuntime.jsx(
23850
+ "p",
23851
+ {
23852
+ className: cn(
23853
+ "mb-8 text-lg leading-relaxed text-grey-600",
23854
+ "group-hover:text-white",
23855
+ "group-data-[color=primary]:text-white",
23856
+ "group-hover:group-data-[color=primary]:text-grey-800",
23857
+ "group-data-[color=secondary]:text-primary-800",
23858
+ "group-hover:group-data-[color=secondary]:text-white",
23859
+ "group-data-[color=tertiary]:text-white",
23860
+ className
23861
+ ),
23862
+ ...props,
23863
+ children
23864
+ }
23865
+ );
23866
+ }
23867
+ function NSWCardArrow({ className, ...props }) {
23868
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
23869
+ Icons.east,
23870
+ {
23871
+ className: cn(
23872
+ "h-8 w-8",
23873
+ "group-hover:text-white",
23874
+ "group-data-[color=primary]:text-white",
23875
+ "group-hover:group-data-[color=primary]:text-grey-800",
23876
+ "group-data-[color=secondary]:text-primary-800",
23877
+ "group-hover:group-data-[color=secondary]:text-white",
23878
+ "group-data-[color=tertiary]:text-white"
23879
+ )
23880
+ }
23881
+ ) });
23882
+ }
23883
+ function NSWCard({
23884
+ children,
23885
+ topBorder = "var(--color-accent-600)",
23886
+ className,
23887
+ variant,
23888
+ color: color2,
23889
+ size,
23890
+ ...props
23891
+ }) {
23892
+ const classes = cn(cardVariants({ variant, color: color2, size }), className);
23893
+ const isHighlight = variant === "highlight";
23894
+ return /* @__PURE__ */ jsxRuntime.jsx(
23895
+ "div",
23896
+ {
23897
+ "data-slot": "card",
23898
+ "data-variant": variant,
23899
+ "data-color": color2,
23900
+ "data-size": size,
23901
+ style: isHighlight ? { ["--nsw-card-top-border"]: topBorder } : void 0,
23902
+ className: classes,
23903
+ ...props,
23904
+ children: variant === "highlight" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("rounded-md border border-grey-200", "hover:border-primary-800"), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-8", children }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-8", children })
23905
+ }
23906
+ );
23907
+ }
23736
23908
  function Wrapper({
23737
23909
  children,
23738
23910
  className,
@@ -23757,109 +23929,169 @@ function PageHeading({
23757
23929
  children
23758
23930
  ] }) });
23759
23931
  }
23760
- var buttonVariants4 = classVarianceAuthority.cva(
23761
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
23762
- {
23763
- variants: {
23764
- variant: {
23765
- outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
23766
- ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50"
23767
- },
23768
- size: {
23769
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
23770
- icon: "size-9"
23932
+ var PaginationVariantContext = React5__namespace.createContext("default");
23933
+ var containerStyles = {
23934
+ line: cn("flex items-center justify-between border-t px-4 sm:px-0", "border-grey-200"),
23935
+ default: cn("flex gap-x-2")
23936
+ };
23937
+ var listStyles = {
23938
+ line: cn("hidden md:-mt-px md:flex"),
23939
+ default: cn("hidden items-baseline gap-x-2 sm:flex")
23940
+ };
23941
+ function Pagination({
23942
+ variant = "default",
23943
+ className,
23944
+ "aria-label": ariaLabel = "Page navigation",
23945
+ children,
23946
+ ...props
23947
+ }) {
23948
+ return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": ariaLabel, className: clsx12__default.default(containerStyles[variant], className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(PaginationVariantContext.Provider, { value: variant, children }) });
23949
+ }
23950
+ function PaginationPrevious({ href = null, className, children = "Previous" }) {
23951
+ const variant = React5__namespace.useContext(PaginationVariantContext);
23952
+ if (variant === "line") {
23953
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "-mt-px flex w-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsxs(
23954
+ "a",
23955
+ {
23956
+ href: href ?? void 0,
23957
+ "aria-disabled": href === null,
23958
+ className: cn(
23959
+ "group inline-flex items-center border-t-2 pt-4 pr-1 text-sm font-medium",
23960
+ "border-transparent text-grey-800 hover:border-grey-400 hover:text-grey-700",
23961
+ href === null && "pointer-events-none text-grey-300",
23962
+ className
23963
+ ),
23964
+ children: [
23965
+ /* @__PURE__ */ jsxRuntime.jsx(Icons.west, { "aria-hidden": "true", className: "mr-3 size-5 group-hover:text-grey-700" }),
23966
+ children
23967
+ ]
23771
23968
  }
23772
- },
23773
- defaultVariants: {
23774
- size: "default"
23775
- }
23969
+ ) });
23776
23970
  }
23777
- );
23778
- function Pagination({ className, ...props }) {
23779
- return /* @__PURE__ */ jsxRuntime.jsx(
23780
- "nav",
23971
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx12__default.default(className, "grow basis-0"), children: /* @__PURE__ */ jsxRuntime.jsxs(
23972
+ Button2,
23781
23973
  {
23782
- role: "navigation",
23783
- "aria-label": "pagination",
23784
- "data-slot": "pagination",
23785
- className: cn("mx-auto flex w-full justify-center", className),
23786
- ...props
23974
+ ...href === null ? { disabled: true } : { href },
23975
+ variant: "ghost",
23976
+ "aria-label": "Previous page",
23977
+ children: [
23978
+ /* @__PURE__ */ jsxRuntime.jsx(Icons.west, { "aria-hidden": "true" }),
23979
+ children
23980
+ ]
23787
23981
  }
23788
- );
23982
+ ) });
23789
23983
  }
23790
- function PaginationContent({ className, ...props }) {
23791
- return /* @__PURE__ */ jsxRuntime.jsx(
23792
- "ul",
23984
+ function PaginationNext({ href = null, className, children = "Next" }) {
23985
+ const variant = React5__namespace.useContext(PaginationVariantContext);
23986
+ if (variant === "line") {
23987
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "-mt-px flex w-0 flex-1 justify-end", children: /* @__PURE__ */ jsxRuntime.jsxs(
23988
+ "a",
23989
+ {
23990
+ href: href ?? void 0,
23991
+ "aria-disabled": href === null,
23992
+ className: cn(
23993
+ "group inline-flex items-center border-t-2 pt-4 pl-1 text-sm font-medium",
23994
+ "border-transparent text-grey-800 hover:border-grey-400 hover:text-grey-700",
23995
+ href === null && "pointer-events-none text-grey-300",
23996
+ className
23997
+ ),
23998
+ children: [
23999
+ children,
24000
+ /* @__PURE__ */ jsxRuntime.jsx(Icons.east, { "aria-hidden": "true", className: "ml-3 size-5 group-hover:text-grey-700" })
24001
+ ]
24002
+ }
24003
+ ) });
24004
+ }
24005
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx12__default.default(className, "flex grow basis-0 justify-end"), children: /* @__PURE__ */ jsxRuntime.jsxs(
24006
+ Button2,
23793
24007
  {
23794
- "data-slot": "pagination-content",
23795
- className: cn("flex flex-row items-center gap-1", className),
23796
- ...props
24008
+ ...href === null ? { disabled: true } : { href },
24009
+ "aria-label": "Next page",
24010
+ variant: "ghost",
24011
+ children: [
24012
+ children,
24013
+ /* @__PURE__ */ jsxRuntime.jsx(Icons.east, { "aria-hidden": "true" })
24014
+ ]
23797
24015
  }
23798
- );
24016
+ ) });
23799
24017
  }
23800
- function PaginationItem({ ...props }) {
23801
- return /* @__PURE__ */ jsxRuntime.jsx("li", { "data-slot": "pagination-item", ...props });
24018
+ function PaginationList({ className, ...props }) {
24019
+ const variant = React5__namespace.useContext(PaginationVariantContext);
24020
+ if (variant === "line") {
24021
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx12__default.default(listStyles.line, className), ...props });
24022
+ }
24023
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx12__default.default(listStyles.default, className), ...props });
23802
24024
  }
23803
- function PaginationLink({ className, isActive, size = "icon", ...props }) {
24025
+ function PaginationPage({
24026
+ href,
24027
+ className,
24028
+ current = false,
24029
+ children
24030
+ }) {
24031
+ const variant = React5__namespace.useContext(PaginationVariantContext);
24032
+ if (variant === "line") {
24033
+ return /* @__PURE__ */ jsxRuntime.jsx(
24034
+ "a",
24035
+ {
24036
+ href,
24037
+ "aria-current": current ? "page" : void 0,
24038
+ className: cn(
24039
+ "inline-flex items-center border-t-2 px-4 pt-4 text-sm font-medium",
24040
+ current ? "border-accent-600 font-bold text-primary-800" : "border-transparent text-grey-800 hover:border-grey-400 hover:text-grey-600",
24041
+ className
24042
+ ),
24043
+ children
24044
+ }
24045
+ );
24046
+ }
23804
24047
  return /* @__PURE__ */ jsxRuntime.jsx(
23805
- "a",
24048
+ Button2,
23806
24049
  {
23807
- "aria-current": isActive ? "page" : void 0,
23808
- "data-slot": "pagination-link",
23809
- "data-active": isActive,
23810
- className: cn(
23811
- buttonVariants4({
23812
- variant: isActive ? "outline" : "ghost",
23813
- size
23814
- }),
23815
- className
24050
+ href,
24051
+ "aria-label": `Page ${children}`,
24052
+ "aria-current": current ? "page" : void 0,
24053
+ variant: current ? "solid" : "ghost",
24054
+ color: current ? "accent" : "light",
24055
+ className: clsx12__default.default(
24056
+ className,
24057
+ "leading-none before:absolute before:-inset-px before:rounded-sm",
24058
+ "min-h-8 min-w-8 sm:px-[calc(--spacing(4))] sm:py-[calc(--spacing(3))]",
24059
+ current && "before:bg-grey-950/5 dark:before:bg-white/10"
23816
24060
  ),
23817
- ...props
23818
- }
23819
- );
23820
- }
23821
- function PaginationPrevious({ className, ...props }) {
23822
- return /* @__PURE__ */ jsxRuntime.jsxs(
23823
- PaginationLink,
23824
- {
23825
- "aria-label": "Go to previous page",
23826
- size: "default",
23827
- className: cn("gap-1 px-2.5 sm:pl-2.5", className),
23828
- ...props,
23829
- children: [
23830
- /* @__PURE__ */ jsxRuntime.jsx(Icons.west, {}),
23831
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:block", children: "Previous" })
23832
- ]
23833
- }
23834
- );
23835
- }
23836
- function PaginationNext({ className, ...props }) {
23837
- return /* @__PURE__ */ jsxRuntime.jsxs(
23838
- PaginationLink,
23839
- {
23840
- "aria-label": "Go to next page",
23841
- size: "default",
23842
- className: cn("gap-1 px-2.5 sm:pr-2.5", className),
23843
- ...props,
23844
- children: [
23845
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:block", children: "Next" }),
23846
- /* @__PURE__ */ jsxRuntime.jsx(Icons.east, {})
23847
- ]
24061
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "-mx-0.5 leading-none", children })
23848
24062
  }
23849
24063
  );
23850
24064
  }
23851
- function PaginationEllipsis({ className, ...props }) {
23852
- return /* @__PURE__ */ jsxRuntime.jsxs(
24065
+ function PaginationGap({
24066
+ className,
24067
+ children = /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: "\u2026" }),
24068
+ ...props
24069
+ }) {
24070
+ const variant = React5__namespace.useContext(PaginationVariantContext);
24071
+ if (variant === "line") {
24072
+ return /* @__PURE__ */ jsxRuntime.jsx(
24073
+ "span",
24074
+ {
24075
+ "aria-hidden": "true",
24076
+ className: clsx12__default.default(
24077
+ "inline-flex items-center border-t-2 border-transparent px-4 pt-4 text-sm font-medium text-grey-800 select-none",
24078
+ className
24079
+ ),
24080
+ ...props,
24081
+ children
24082
+ }
24083
+ );
24084
+ }
24085
+ return /* @__PURE__ */ jsxRuntime.jsx(
23853
24086
  "span",
23854
24087
  {
23855
- "aria-hidden": true,
23856
- "data-slot": "pagination-ellipsis",
23857
- className: cn("flex size-9 items-center justify-center", className),
24088
+ "aria-hidden": "true",
23858
24089
  ...props,
23859
- children: [
23860
- /* @__PURE__ */ jsxRuntime.jsx(Icons.more_horiz, { className: "size-4" }),
23861
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "More pages" })
23862
- ]
24090
+ className: clsx12__default.default(
24091
+ className,
24092
+ "w-9 text-center text-sm/6 font-semibold text-grey-950 select-none dark:text-white"
24093
+ ),
24094
+ children
23863
24095
  }
23864
24096
  );
23865
24097
  }
@@ -26803,6 +27035,10 @@ exports.MenubarTrigger = MenubarTrigger;
26803
27035
  exports.MobileHeader = MobileHeader;
26804
27036
  exports.MobileSearch = MobileSearch;
26805
27037
  exports.MultiLevelPushMenu = MultiLevelPushMenu;
27038
+ exports.NSWCard = NSWCard;
27039
+ exports.NSWCardArrow = NSWCardArrow;
27040
+ exports.NSWCardDescription = NSWCardDescription;
27041
+ exports.NSWCardTitle = NSWCardTitle;
26806
27042
  exports.Navbar = Navbar;
26807
27043
  exports.NavbarDivider = NavbarDivider;
26808
27044
  exports.NavbarItem = NavbarItem;
@@ -26820,11 +27056,10 @@ exports.NavigationMenuTrigger = NavigationMenuTrigger;
26820
27056
  exports.NavigationMenuViewport = NavigationMenuViewport;
26821
27057
  exports.PageHeading = PageHeading;
26822
27058
  exports.Pagination = Pagination;
26823
- exports.PaginationContent = PaginationContent;
26824
- exports.PaginationEllipsis = PaginationEllipsis;
26825
- exports.PaginationItem = PaginationItem;
26826
- exports.PaginationLink = PaginationLink;
27059
+ exports.PaginationGap = PaginationGap;
27060
+ exports.PaginationList = PaginationList;
26827
27061
  exports.PaginationNext = PaginationNext;
27062
+ exports.PaginationPage = PaginationPage;
26828
27063
  exports.PaginationPrevious = PaginationPrevious;
26829
27064
  exports.Popover = Popover;
26830
27065
  exports.PopoverAnchor = PopoverAnchor;