quirk-ui 0.1.146 → 0.1.148

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.
Files changed (51) hide show
  1. package/dist/{CategoryFilters-BJ_M7DHy.js → CategoryFilters--D0RlQhF.js} +1 -1
  2. package/dist/{CategoryFilters-DTw0ob7y.cjs → CategoryFilters-CZEie9fX.cjs} +1 -1
  3. package/dist/core/components/Button/Button.test.cjs +1 -1
  4. package/dist/core/components/Button/Button.test.mjs +210 -171
  5. package/dist/core/components/Button/index.cjs +1 -1
  6. package/dist/core/components/Button/index.mjs +3 -2
  7. package/dist/core/components/Footer/index.cjs +1 -1
  8. package/dist/core/components/Footer/index.mjs +1 -1
  9. package/dist/core/components/Modal/Modal.test.cjs +1 -1
  10. package/dist/core/components/Modal/Modal.test.mjs +217 -164
  11. package/dist/core/components/Modal/index.cjs +1 -1
  12. package/dist/core/components/Modal/index.mjs +80 -75
  13. package/dist/core/components/NavBar/index.cjs +1 -1
  14. package/dist/core/components/NavBar/index.mjs +1 -1
  15. package/dist/core/context/ModalContext.cjs +1 -0
  16. package/dist/core/context/ModalContext.mjs +25 -0
  17. package/dist/core.cjs +1 -1
  18. package/dist/core.d.ts +49 -3
  19. package/dist/core.mjs +1 -1
  20. package/dist/index-0SVQqhAg.cjs +31 -0
  21. package/dist/{index-BnvfQt_k.js → index-aWdsapYP.js} +110 -95
  22. package/dist/index38.css +1 -1
  23. package/dist/main.cjs +1 -1
  24. package/dist/main.d.ts +49 -3
  25. package/dist/main.mjs +1 -1
  26. package/dist/next/blocks/DocumentListBlock/CategoryFilters.cjs +1 -1
  27. package/dist/next/blocks/DocumentListBlock/CategoryFilters.mjs +2 -2
  28. package/dist/next/blocks/DocumentListBlock/CategoryFilters.test.cjs +1 -1
  29. package/dist/next/blocks/DocumentListBlock/CategoryFilters.test.mjs +1 -1
  30. package/dist/next/blocks/DocumentListBlock/index.cjs +1 -1
  31. package/dist/next/blocks/DocumentListBlock/index.mjs +2 -2
  32. package/dist/next/blocks/FormBlock/index.cjs +1 -1
  33. package/dist/next/blocks/FormBlock/index.mjs +1 -1
  34. package/dist/next/blocks/TabsBlock/index.cjs +1 -1
  35. package/dist/next/blocks/TabsBlock/index.mjs +1 -1
  36. package/dist/next/blocks/WasHelpfulBlock/index.cjs +1 -1
  37. package/dist/next/blocks/WasHelpfulBlock/index.mjs +1 -1
  38. package/dist/next/cards/BioCard/index.cjs +1 -1
  39. package/dist/next/cards/BioCard/index.mjs +36 -35
  40. package/dist/next/cards/BlogArticleCard/index.cjs +2 -2
  41. package/dist/next/cards/BlogArticleCard/index.mjs +12 -11
  42. package/dist/next/cards/SegmentCard/index.cjs +1 -1
  43. package/dist/next/cards/SegmentCard/index.mjs +3 -2
  44. package/dist/next/cards/SpotlightCard/index.cjs +1 -1
  45. package/dist/next/cards/SpotlightCard/index.mjs +1 -1
  46. package/dist/next/ui/CallToAction/index.cjs +1 -1
  47. package/dist/next/ui/CallToAction/index.mjs +45 -44
  48. package/dist/next/ui/PortableTextRenderer/index.cjs +1 -1
  49. package/dist/next/ui/PortableTextRenderer/index.mjs +3 -2
  50. package/package.json +1 -1
  51. package/dist/index-D7SAxT5B.cjs +0 -31
@@ -1,5 +1,5 @@
1
1
  import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import { B as h } from "./index-BnvfQt_k.js";
2
+ import { B as h } from "./index-aWdsapYP.js";
3
3
  import { X as v } from "./x-CnsEH4Ox.js";
4
4
  import './CategoryFilters.css';const p = "_documentList_1vg9o_1", u = "_container_1vg9o_9", m = "_heading_1vg9o_20", b = "_title_1vg9o_25", f = "_eyebrow_1vg9o_30", H = "_listContainer_1vg9o_34", L = "_listWrapper_1vg9o_45", S = "_list_1vg9o_34", F = "_listHeader_1vg9o_66", w = "_listSearch_1vg9o_79", y = "_clearSearch_1vg9o_106", C = "_listHeaderFilters_1vg9o_125", k = "_listResults_1vg9o_136", x = "_listSort_1vg9o_140", N = "_filterToggle_1vg9o_163", I = "_filterHeader_1vg9o_178", M = "_loadMore_1vg9o_199", R = "_filterList_1vg9o_203", T = "_listFilters_1vg9o_210", W = "_applyFilters_1vg9o_218", j = "_show_1vg9o_247", B = "_hide_1vg9o_256", $ = "_buttonIsLoading_1vg9o_307", s = {
5
5
  documentList: p,
@@ -1 +1 @@
1
- "use strict";require('./CategoryFilters.css');const t=require("react/jsx-runtime"),g=require("./index-D7SAxT5B.cjs"),h=require("./x-Dft9NVe_.cjs"),v="_documentList_1vg9o_1",u="_container_1vg9o_9",p="_heading_1vg9o_20",x="_title_1vg9o_25",b="_eyebrow_1vg9o_30",y="_listContainer_1vg9o_34",F="_listWrapper_1vg9o_45",H="_list_1vg9o_34",L="_listHeader_1vg9o_66",S="_listSearch_1vg9o_79",j="_clearSearch_1vg9o_106",m="_listHeaderFilters_1vg9o_125",f="_listResults_1vg9o_136",w="_listSort_1vg9o_140",C="_filterToggle_1vg9o_163",k="_filterHeader_1vg9o_178",q="_loadMore_1vg9o_199",N="_filterList_1vg9o_203",$="_listFilters_1vg9o_210",I="_applyFilters_1vg9o_218",M="_show_1vg9o_247",R="_hide_1vg9o_256",T="_buttonIsLoading_1vg9o_307",e={documentList:v,container:u,heading:p,title:x,eyebrow:b,listContainer:y,listWrapper:F,list:H,listHeader:L,listSearch:S,clearSearch:j,listHeaderFilters:m,listResults:f,listSort:w,filterToggle:C,filterHeader:k,loadMore:q,filterList:N,listFilters:$,applyFilters:I,show:M,hide:R,buttonIsLoading:T};function W({categoryFilters:i,selectedCategories:o,onSelectionChange:n,showFilters:_,toggleFilters:l,isLoading:r}){return t.jsxs("div",{className:`${e.listFilters} ${_?e.show:e.hide}`,children:[t.jsxs("div",{className:e.filterHeader,children:[t.jsx("h5",{children:"Filters"}),t.jsx("button",{onClick:l,children:t.jsx(h.X,{size:24})})]}),t.jsx("div",{className:e.filterList,children:i==null?void 0:i.map(s=>t.jsxs("label",{children:[t.jsx("input",{type:"checkbox",value:s._id,checked:o.includes(s._id),onChange:c=>{const a=c.target.checked?[...o,s._id]:o.filter(d=>d!==s._id);n(a)}}),s.title]},s._id))}),t.jsx(g.Button,{as:"button",variant:"secondary",onClick:l,disabled:r,className:e.applyFilters,children:"Apply Filters"})]})}exports.CategoryFilters=W;exports.styles=e;
1
+ "use strict";require('./CategoryFilters.css');const t=require("react/jsx-runtime"),g=require("./index-0SVQqhAg.cjs"),h=require("./x-Dft9NVe_.cjs"),v="_documentList_1vg9o_1",u="_container_1vg9o_9",p="_heading_1vg9o_20",x="_title_1vg9o_25",b="_eyebrow_1vg9o_30",y="_listContainer_1vg9o_34",F="_listWrapper_1vg9o_45",H="_list_1vg9o_34",L="_listHeader_1vg9o_66",S="_listSearch_1vg9o_79",j="_clearSearch_1vg9o_106",m="_listHeaderFilters_1vg9o_125",f="_listResults_1vg9o_136",w="_listSort_1vg9o_140",C="_filterToggle_1vg9o_163",k="_filterHeader_1vg9o_178",q="_loadMore_1vg9o_199",N="_filterList_1vg9o_203",$="_listFilters_1vg9o_210",I="_applyFilters_1vg9o_218",M="_show_1vg9o_247",R="_hide_1vg9o_256",T="_buttonIsLoading_1vg9o_307",e={documentList:v,container:u,heading:p,title:x,eyebrow:b,listContainer:y,listWrapper:F,list:H,listHeader:L,listSearch:S,clearSearch:j,listHeaderFilters:m,listResults:f,listSort:w,filterToggle:C,filterHeader:k,loadMore:q,filterList:N,listFilters:$,applyFilters:I,show:M,hide:R,buttonIsLoading:T};function W({categoryFilters:i,selectedCategories:o,onSelectionChange:n,showFilters:_,toggleFilters:l,isLoading:r}){return t.jsxs("div",{className:`${e.listFilters} ${_?e.show:e.hide}`,children:[t.jsxs("div",{className:e.filterHeader,children:[t.jsx("h5",{children:"Filters"}),t.jsx("button",{onClick:l,children:t.jsx(h.X,{size:24})})]}),t.jsx("div",{className:e.filterList,children:i==null?void 0:i.map(s=>t.jsxs("label",{children:[t.jsx("input",{type:"checkbox",value:s._id,checked:o.includes(s._id),onChange:c=>{const a=c.target.checked?[...o,s._id]:o.filter(d=>d!==s._id);n(a)}}),s.title]},s._id))}),t.jsx(g.Button,{as:"button",variant:"secondary",onClick:l,disabled:r,className:e.applyFilters,children:"Apply Filters"})]})}exports.CategoryFilters=W;exports.styles=e;
@@ -1 +1 @@
1
- "use strict";const n=require("react/jsx-runtime"),e=require("../../../react.esm-C_9Ma9mj.cjs"),r=require("../../../index-D7SAxT5B.cjs");require("../../../index-CW_Ehh1q.cjs");e.describe("Button",()=>{e.describe("Rendering as button",()=>{e.it("renders as a button by default",()=>{e.render(n.jsx(r.Button,{variant:"primary",children:"Click Me"}));const t=e.screen.getByRole("button",{name:"Click Me"});e.globalExpect(t).toBeInTheDocument(),e.globalExpect(t.tagName).toBe("BUTTON")}),e.it("renders as a button when 'as' is set to 'button'",()=>{e.render(n.jsx(r.Button,{as:"button",variant:"primary",children:"Click Me"}));const t=e.screen.getByRole("button",{name:"Click Me"});e.globalExpect(t).toBeInTheDocument(),e.globalExpect(t).toHaveClass("button","primary")}),e.it("has type='button' by default",()=>{e.render(n.jsx(r.Button,{variant:"primary",children:"Click Me"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveAttribute("type","button")}),e.it("respects the disabled prop on buttons",()=>{e.render(n.jsx(r.Button,{as:"button",variant:"primary",disabled:!0,children:"Disabled"}));const t=e.screen.getByRole("button",{name:"Disabled"});e.globalExpect(t).toBeDisabled()}),e.it("calls onClick when clicked",()=>{const t=e.vi.fn();e.render(n.jsx(r.Button,{variant:"primary",onClick:t,children:"Click Me"}));const o=e.screen.getByRole("button");e.fireEvent.click(o),e.globalExpect(t).toHaveBeenCalledTimes(1)}),e.it("does not call onClick when disabled",()=>{const t=e.vi.fn();e.render(n.jsx(r.Button,{variant:"primary",onClick:t,disabled:!0,children:"Disabled"}));const o=e.screen.getByRole("button");e.fireEvent.click(o),e.globalExpect(t).not.toHaveBeenCalled()})}),e.describe("Rendering as anchor",()=>{e.it("renders as an anchor when 'as' is set to 'a'",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",children:"Click Me"}));const t=e.screen.getByRole("link",{name:"Click Me"});e.globalExpect(t).toBeInTheDocument(),e.globalExpect(t.tagName).toBe("A"),e.globalExpect(t).toHaveAttribute("href","/test"),e.globalExpect(t).toHaveClass("button","link")}),e.it("adds rel='noopener noreferrer' when target is '_blank'",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",target:"_blank",variant:"link",children:"External"}));const t=e.screen.getByRole("link",{name:"External"});e.globalExpect(t).toHaveAttribute("rel","noopener noreferrer")}),e.it("preserves custom rel attribute and adds security",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",target:"_blank",rel:"author",variant:"link",children:"External"}));const t=e.screen.getByRole("link");e.globalExpect(t).toHaveAttribute("rel","author noopener noreferrer")}),e.it("does not add security rel for internal links",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",children:"Internal"}));const t=e.screen.getByRole("link");e.globalExpect(t).not.toHaveAttribute("rel")}),e.it("adds aria-disabled when disabled",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",disabled:!0,children:"Disabled Link"}));const t=e.screen.getByRole("link");e.globalExpect(t).toHaveAttribute("aria-disabled","true")})}),e.describe("Scroll button",()=>{e.it("renders as a scroll button when 'as' is set to 'scroll'",()=>{e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"section-1",variant:"primary",children:"Scroll Down"}));const t=e.screen.getByRole("button",{name:"Scroll to section-1"});e.globalExpect(t).toBeInTheDocument()}),e.it("has proper aria-label for scroll button",()=>{e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"footer",variant:"primary",children:"To Footer"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveAttribute("aria-label","Scroll to footer")}),e.it("scrolls to target element when clicked",()=>{const t=document.createElement("div");t.id="target-section",document.body.appendChild(t);const o=e.vi.fn();t.scrollIntoView=o,e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"target-section",variant:"primary",children:"Scroll"}));const a=e.screen.getByRole("button");e.fireEvent.click(a),e.globalExpect(o).toHaveBeenCalledWith({behavior:"smooth",block:"start"}),document.body.removeChild(t)}),e.it("does not error if scroll target does not exist",()=>{e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"non-existent",variant:"primary",children:"Scroll"}));const t=e.screen.getByRole("button");e.globalExpect(()=>e.fireEvent.click(t)).not.toThrow()})}),e.describe("Variants",()=>{["primary","primaryInverted","secondary","secondaryInverted","link","linkInverted","underline","underlineInverted","blurred","blurredInverted"].forEach(o=>{e.it(`applies ${o} variant class`,()=>{e.render(n.jsx(r.Button,{variant:o,children:"Button"}));const a=e.screen.getByRole("button");e.globalExpect(a).toHaveClass(o)})}),e.it("uses primary variant by default",()=>{e.render(n.jsx(r.Button,{children:"Default"}));const o=e.screen.getByRole("button");e.globalExpect(o).toHaveClass("primary")})}),e.describe("Icons",()=>{e.it("includes icon when icon prop is provided",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-right",children:"Next"}));const t=document.querySelector(".icon");e.globalExpect(t).toBeInTheDocument();const o=t==null?void 0:t.querySelector("svg");e.globalExpect(o).toBeInTheDocument()}),e.it("places icon on the left when iconAlignment is 'left'",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-left",iconAlignment:"left",children:"Back"}));const t=document.querySelector(".content");e.globalExpect(t).toHaveClass("iconLeft")}),e.it("places icon on the right when iconAlignment is 'right'",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-right",iconAlignment:"right",children:"Next"}));const t=document.querySelector(".content");e.globalExpect(t).toHaveClass("iconRight")}),e.it("uses right alignment by default",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-right",children:"Default Icon"}));const t=document.querySelector(".content");e.globalExpect(t).toHaveClass("iconRight")}),e.it("icon has aria-hidden attribute",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"settings",children:"Settings"}));const t=document.querySelector(".icon");e.globalExpect(t).toHaveAttribute("aria-hidden","true")}),e.it("works with anchor links",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",icon:"new-tab",children:"External"}));const t=document.querySelector(".icon");e.globalExpect(t).toBeInTheDocument()})}),e.describe("Image display",()=>{e.it("renders image when displayType is 'image' and imageSrc is provided",()=>{e.render(n.jsx(r.Button,{variant:"primary",displayType:"image",imageSrc:"/logo.png",imageAlt:"Company Logo",children:"Text not shown"}));const t=document.querySelector("img");e.globalExpect(t).toBeInTheDocument(),e.globalExpect(t).toHaveAttribute("src","/logo.png"),e.globalExpect(t).toHaveAttribute("alt","Company Logo")}),e.it("renders ImageComponent when provided",()=>{const t=()=>n.jsx("div",{"data-testid":"custom-image",children:"Custom"});e.render(n.jsx(r.Button,{variant:"primary",displayType:"image",ImageComponent:n.jsx(t,{}),children:"Text"})),e.globalExpect(e.screen.getByTestId("custom-image")).toBeInTheDocument()}),e.it("applies image class when displayType is image",()=>{e.render(n.jsx(r.Button,{variant:"primary",displayType:"image",imageSrc:"/logo.png",children:"Text"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveClass("image"),e.globalExpect(t).not.toHaveClass("primary")})}),e.describe("Custom className",()=>{e.it("applies custom className",()=>{e.render(n.jsx(r.Button,{variant:"primary",className:"custom-button",children:"Custom"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveClass("custom-button"),e.globalExpect(t).toHaveClass("button"),e.globalExpect(t).toHaveClass("primary")})}),e.describe("Accessibility",()=>{e.it("has button role for button element",()=>{e.render(n.jsx(r.Button,{variant:"primary",children:"Click"})),e.globalExpect(e.screen.getByRole("button")).toBeInTheDocument()}),e.it("has link role for anchor element",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",children:"Link"})),e.globalExpect(e.screen.getByRole("link")).toBeInTheDocument()}),e.it("supports aria attributes",()=>{e.render(n.jsx(r.Button,{variant:"primary","aria-label":"Custom Label","aria-describedby":"desc",children:"Button"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveAttribute("aria-label","Custom Label"),e.globalExpect(t).toHaveAttribute("aria-describedby","desc")})}),e.describe("Edge cases",()=>{e.it("handles undefined variant",()=>{e.render(n.jsx(r.Button,{variant:void 0,children:"No Variant"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveClass("button")}),e.it("handles empty children",()=>{e.render(n.jsx(r.Button,{variant:"primary",children:"Primary"}));const t=e.screen.getByRole("button");e.globalExpect(t).toBeInTheDocument()}),e.it("handles complex children",()=>{e.render(n.jsxs(r.Button,{variant:"primary",children:[n.jsx("span",{children:"Complex"}),n.jsx("strong",{children:"Children"})]})),e.globalExpect(e.screen.getByText("Complex")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Children")).toBeInTheDocument()})})});
1
+ "use strict";const n=require("react/jsx-runtime"),e=require("../../../react.esm-C_9Ma9mj.cjs"),r=require("../../../index-0SVQqhAg.cjs");require("../../../index-CW_Ehh1q.cjs");const a=e.vi.fn();e.vi.mock("../../context/ModalContext",()=>({useModal:()=>({open:a})}));e.describe("Button",()=>{e.describe("Rendering as button",()=>{e.it("renders as a button by default",()=>{e.render(n.jsx(r.Button,{variant:"primary",children:"Click Me"}));const t=e.screen.getByRole("button",{name:"Click Me"});e.globalExpect(t).toBeInTheDocument(),e.globalExpect(t.tagName).toBe("BUTTON")}),e.it("renders as a button when 'as' is set to 'button'",()=>{e.render(n.jsx(r.Button,{as:"button",variant:"primary",children:"Click Me"}));const t=e.screen.getByRole("button",{name:"Click Me"});e.globalExpect(t).toBeInTheDocument(),e.globalExpect(t).toHaveClass("button","primary")}),e.it("has type='button' by default",()=>{e.render(n.jsx(r.Button,{variant:"primary",children:"Click Me"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveAttribute("type","button")}),e.it("respects the disabled prop on buttons",()=>{e.render(n.jsx(r.Button,{as:"button",variant:"primary",disabled:!0,children:"Disabled"}));const t=e.screen.getByRole("button",{name:"Disabled"});e.globalExpect(t).toBeDisabled()}),e.it("calls onClick when clicked",()=>{const t=e.vi.fn();e.render(n.jsx(r.Button,{variant:"primary",onClick:t,children:"Click Me"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(t).toHaveBeenCalledTimes(1)}),e.it("does not call onClick when disabled",()=>{const t=e.vi.fn();e.render(n.jsx(r.Button,{variant:"primary",onClick:t,disabled:!0,children:"Disabled"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(t).not.toHaveBeenCalled()})}),e.describe("Rendering as anchor",()=>{e.it("renders as an anchor when 'as' is set to 'a'",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",children:"Click Me"}));const t=e.screen.getByRole("link",{name:"Click Me"});e.globalExpect(t).toBeInTheDocument(),e.globalExpect(t.tagName).toBe("A"),e.globalExpect(t).toHaveAttribute("href","/test"),e.globalExpect(t).toHaveClass("button","link")}),e.it("adds rel='noopener noreferrer' when target is '_blank'",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",target:"_blank",variant:"link",children:"External"})),e.globalExpect(e.screen.getByRole("link",{name:"External"})).toHaveAttribute("rel","noopener noreferrer")}),e.it("preserves custom rel attribute and adds security",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",target:"_blank",rel:"author",variant:"link",children:"External"})),e.globalExpect(e.screen.getByRole("link")).toHaveAttribute("rel","author noopener noreferrer")}),e.it("does not add security rel for internal links",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",children:"Internal"})),e.globalExpect(e.screen.getByRole("link")).not.toHaveAttribute("rel")}),e.it("adds aria-disabled when disabled",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",disabled:!0,children:"Disabled Link"})),e.globalExpect(e.screen.getByRole("link")).toHaveAttribute("aria-disabled","true")})}),e.describe("Scroll button",()=>{e.it("renders as a scroll button when 'as' is set to 'scroll'",()=>{e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"section-1",variant:"primary",children:"Scroll Down"})),e.globalExpect(e.screen.getByRole("button",{name:"Scroll to section-1"})).toBeInTheDocument()}),e.it("has proper aria-label for scroll button",()=>{e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"footer",variant:"primary",children:"To Footer"})),e.globalExpect(e.screen.getByRole("button")).toHaveAttribute("aria-label","Scroll to footer")}),e.it("scrolls to target element when clicked",()=>{const t=document.createElement("div");t.id="target-section",document.body.appendChild(t);const o=e.vi.fn();t.scrollIntoView=o,e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"target-section",variant:"primary",children:"Scroll"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(o).toHaveBeenCalledWith({behavior:"smooth",block:"start"}),document.body.removeChild(t)}),e.it("uses scrollTo with offset when scrollOffset is set",()=>{const t=document.createElement("div");t.id="offset-section",document.body.appendChild(t);const o=e.vi.fn();window.scrollTo=o,e.vi.spyOn(t,"getBoundingClientRect").mockReturnValue({top:200}),e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"offset-section",scrollOffset:80,variant:"primary",children:"Scroll"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(o).toHaveBeenCalledWith({top:e.globalExpect.any(Number),behavior:"smooth"}),document.body.removeChild(t)}),e.it("does not error if scroll target does not exist",()=>{e.render(n.jsx(r.Button,{as:"scroll",scrollTarget:"non-existent",variant:"primary",children:"Scroll"})),e.globalExpect(()=>e.fireEvent.click(e.screen.getByRole("button"))).not.toThrow()})}),e.describe("Modal button",()=>{e.it("renders as a button when 'as' is set to 'modal'",()=>{e.render(n.jsx(r.Button,{as:"modal",modalPayload:{heading:"Contact Us"},variant:"primary",children:"Open Modal"})),e.globalExpect(e.screen.getByRole("button",{name:"Open Modal"})).toBeInTheDocument()}),e.it("calls useModal open with the payload when clicked",()=>{const t={heading:"Contact Us",formReference:{_id:"form-123",heading:"Contact"}};e.render(n.jsx(r.Button,{as:"modal",modalPayload:t,variant:"primary",children:"Open Form"})),e.fireEvent.click(e.screen.getByRole("button",{name:"Open Form"})),e.globalExpect(a).toHaveBeenCalledWith(t)}),e.it("is disabled when disabled prop is set",()=>{e.render(n.jsx(r.Button,{as:"modal",modalPayload:{heading:"Test"},variant:"primary",disabled:!0,children:"Disabled Modal"})),e.globalExpect(e.screen.getByRole("button")).toBeDisabled()}),e.it("does not call open when disabled",()=>{a.mockClear(),e.render(n.jsx(r.Button,{as:"modal",modalPayload:{heading:"Test"},variant:"primary",disabled:!0,children:"Disabled"})),e.fireEvent.click(e.screen.getByRole("button")),e.globalExpect(a).not.toHaveBeenCalled()})}),e.describe("Variants",()=>{["primary","primaryInverted","secondary","secondaryInverted","link","linkInverted","underline","underlineInverted","blurred","blurredInverted"].forEach(o=>{e.it(`applies ${o} variant class`,()=>{e.render(n.jsx(r.Button,{variant:o,children:"Button"})),e.globalExpect(e.screen.getByRole("button")).toHaveClass(o)})}),e.it("uses primary variant by default",()=>{e.render(n.jsx(r.Button,{children:"Default"})),e.globalExpect(e.screen.getByRole("button")).toHaveClass("primary")})}),e.describe("Icons",()=>{e.it("includes icon when icon prop is provided",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-right",children:"Next"})),e.globalExpect(document.querySelector(".icon")).toBeInTheDocument(),e.globalExpect(document.querySelector(".icon svg")).toBeInTheDocument()}),e.it("places icon on the left when iconAlignment is 'left'",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-left",iconAlignment:"left",children:"Back"})),e.globalExpect(document.querySelector(".content")).toHaveClass("iconLeft")}),e.it("places icon on the right when iconAlignment is 'right'",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-right",iconAlignment:"right",children:"Next"})),e.globalExpect(document.querySelector(".content")).toHaveClass("iconRight")}),e.it("uses right alignment by default",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"arrow-right",children:"Default Icon"})),e.globalExpect(document.querySelector(".content")).toHaveClass("iconRight")}),e.it("icon has aria-hidden attribute",()=>{e.render(n.jsx(r.Button,{variant:"primary",icon:"settings",children:"Settings"})),e.globalExpect(document.querySelector(".icon")).toHaveAttribute("aria-hidden","true")})}),e.describe("Image display",()=>{e.it("renders image when displayType is 'image' and imageSrc is provided",()=>{e.render(n.jsx(r.Button,{variant:"primary",displayType:"image",imageSrc:"/logo.png",imageAlt:"Company Logo",children:"Text not shown"}));const t=document.querySelector("img");e.globalExpect(t).toHaveAttribute("src","/logo.png"),e.globalExpect(t).toHaveAttribute("alt","Company Logo")}),e.it("renders ImageComponent when provided",()=>{const t=()=>n.jsx("div",{"data-testid":"custom-image",children:"Custom"});e.render(n.jsx(r.Button,{variant:"primary",displayType:"image",ImageComponent:n.jsx(t,{}),children:"Text"})),e.globalExpect(e.screen.getByTestId("custom-image")).toBeInTheDocument()}),e.it("applies image class when displayType is image",()=>{e.render(n.jsx(r.Button,{variant:"primary",displayType:"image",imageSrc:"/logo.png",children:"Text"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveClass("image"),e.globalExpect(t).not.toHaveClass("primary")})}),e.describe("Custom className",()=>{e.it("applies custom className",()=>{e.render(n.jsx(r.Button,{variant:"primary",className:"custom-button",children:"Custom"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveClass("custom-button","button","primary")})}),e.describe("Accessibility",()=>{e.it("has button role for button element",()=>{e.render(n.jsx(r.Button,{variant:"primary",children:"Click"})),e.globalExpect(e.screen.getByRole("button")).toBeInTheDocument()}),e.it("has link role for anchor element",()=>{e.render(n.jsx(r.Button,{as:"a",href:"/test",variant:"link",children:"Link"})),e.globalExpect(e.screen.getByRole("link")).toBeInTheDocument()}),e.it("supports aria attributes",()=>{e.render(n.jsx(r.Button,{variant:"primary","aria-label":"Custom Label","aria-describedby":"desc",children:"Button"}));const t=e.screen.getByRole("button");e.globalExpect(t).toHaveAttribute("aria-label","Custom Label"),e.globalExpect(t).toHaveAttribute("aria-describedby","desc")})}),e.describe("Edge cases",()=>{e.it("handles undefined variant",()=>{e.render(n.jsx(r.Button,{variant:void 0,children:"No Variant"})),e.globalExpect(e.screen.getByRole("button")).toHaveClass("button")}),e.it("handles complex children",()=>{e.render(n.jsxs(r.Button,{variant:"primary",children:[n.jsx("span",{children:"Complex"}),n.jsx("strong",{children:"Children"})]})),e.globalExpect(e.screen.getByText("Complex")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Children")).toBeInTheDocument()})})});
@@ -1,111 +1,175 @@
1
- import { jsx as n, jsxs as m } from "react/jsx-runtime";
2
- import { d as s, i as o, r as a, s as i, g as t, v as u, f as c } from "../../../react.esm-DjxyacK8.js";
3
- import { B as r } from "../../../index-BnvfQt_k.js";
1
+ import { jsx as o, jsxs as u } from "react/jsx-runtime";
2
+ import { v as d, d as l, i as n, r as a, s as i, g as e, f as c } from "../../../react.esm-DjxyacK8.js";
3
+ import { B as r } from "../../../index-aWdsapYP.js";
4
4
  import "../../../index-DPGXWTtt.js";
5
- s("Button", () => {
6
- s("Rendering as button", () => {
7
- o("renders as a button by default", () => {
8
- a(/* @__PURE__ */ n(r, { variant: "primary", children: "Click Me" }));
9
- const e = i.getByRole("button", { name: "Click Me" });
10
- t(e).toBeInTheDocument(), t(e.tagName).toBe("BUTTON");
11
- }), o("renders as a button when 'as' is set to 'button'", () => {
12
- a(
13
- /* @__PURE__ */ n(r, { as: "button", variant: "primary", children: "Click Me" })
14
- );
15
- const e = i.getByRole("button", { name: "Click Me" });
16
- t(e).toBeInTheDocument(), t(e).toHaveClass("button", "primary");
17
- }), o("has type='button' by default", () => {
18
- a(/* @__PURE__ */ n(r, { variant: "primary", children: "Click Me" }));
19
- const e = i.getByRole("button");
20
- t(e).toHaveAttribute("type", "button");
21
- }), o("respects the disabled prop on buttons", () => {
22
- a(
23
- /* @__PURE__ */ n(r, { as: "button", variant: "primary", disabled: !0, children: "Disabled" })
24
- );
25
- const e = i.getByRole("button", { name: "Disabled" });
26
- t(e).toBeDisabled();
27
- }), o("calls onClick when clicked", () => {
28
- const e = u.fn();
5
+ const m = d.fn();
6
+ d.mock("../../context/ModalContext", () => ({
7
+ useModal: () => ({ open: m })
8
+ }));
9
+ l("Button", () => {
10
+ l("Rendering as button", () => {
11
+ n("renders as a button by default", () => {
12
+ a(/* @__PURE__ */ o(r, { variant: "primary", children: "Click Me" }));
13
+ const t = i.getByRole("button", { name: "Click Me" });
14
+ e(t).toBeInTheDocument(), e(t.tagName).toBe("BUTTON");
15
+ }), n("renders as a button when 'as' is set to 'button'", () => {
29
16
  a(
30
- /* @__PURE__ */ n(r, { variant: "primary", onClick: e, children: "Click Me" })
17
+ /* @__PURE__ */ o(r, { as: "button", variant: "primary", children: "Click Me" })
31
18
  );
32
- const l = i.getByRole("button");
33
- c.click(l), t(e).toHaveBeenCalledTimes(1);
34
- }), o("does not call onClick when disabled", () => {
35
- const e = u.fn();
19
+ const t = i.getByRole("button", { name: "Click Me" });
20
+ e(t).toBeInTheDocument(), e(t).toHaveClass("button", "primary");
21
+ }), n("has type='button' by default", () => {
22
+ a(/* @__PURE__ */ o(r, { variant: "primary", children: "Click Me" }));
23
+ const t = i.getByRole("button");
24
+ e(t).toHaveAttribute("type", "button");
25
+ }), n("respects the disabled prop on buttons", () => {
36
26
  a(
37
- /* @__PURE__ */ n(r, { variant: "primary", onClick: e, disabled: !0, children: "Disabled" })
27
+ /* @__PURE__ */ o(r, { as: "button", variant: "primary", disabled: !0, children: "Disabled" })
38
28
  );
39
- const l = i.getByRole("button");
40
- c.click(l), t(e).not.toHaveBeenCalled();
29
+ const t = i.getByRole("button", { name: "Disabled" });
30
+ e(t).toBeDisabled();
31
+ }), n("calls onClick when clicked", () => {
32
+ const t = d.fn();
33
+ a(
34
+ /* @__PURE__ */ o(r, { variant: "primary", onClick: t, children: "Click Me" })
35
+ ), c.click(i.getByRole("button")), e(t).toHaveBeenCalledTimes(1);
36
+ }), n("does not call onClick when disabled", () => {
37
+ const t = d.fn();
38
+ a(
39
+ /* @__PURE__ */ o(r, { variant: "primary", onClick: t, disabled: !0, children: "Disabled" })
40
+ ), c.click(i.getByRole("button")), e(t).not.toHaveBeenCalled();
41
41
  });
42
- }), s("Rendering as anchor", () => {
43
- o("renders as an anchor when 'as' is set to 'a'", () => {
42
+ }), l("Rendering as anchor", () => {
43
+ n("renders as an anchor when 'as' is set to 'a'", () => {
44
44
  a(
45
- /* @__PURE__ */ n(r, { as: "a", href: "/test", variant: "link", children: "Click Me" })
45
+ /* @__PURE__ */ o(r, { as: "a", href: "/test", variant: "link", children: "Click Me" })
46
46
  );
47
- const e = i.getByRole("link", { name: "Click Me" });
48
- t(e).toBeInTheDocument(), t(e.tagName).toBe("A"), t(e).toHaveAttribute("href", "/test"), t(e).toHaveClass("button", "link");
49
- }), o("adds rel='noopener noreferrer' when target is '_blank'", () => {
47
+ const t = i.getByRole("link", { name: "Click Me" });
48
+ e(t).toBeInTheDocument(), e(t.tagName).toBe("A"), e(t).toHaveAttribute("href", "/test"), e(t).toHaveClass("button", "link");
49
+ }), n("adds rel='noopener noreferrer' when target is '_blank'", () => {
50
50
  a(
51
- /* @__PURE__ */ n(r, { as: "a", href: "/test", target: "_blank", variant: "link", children: "External" })
51
+ /* @__PURE__ */ o(r, { as: "a", href: "/test", target: "_blank", variant: "link", children: "External" })
52
+ ), e(i.getByRole("link", { name: "External" })).toHaveAttribute(
53
+ "rel",
54
+ "noopener noreferrer"
52
55
  );
53
- const e = i.getByRole("link", { name: "External" });
54
- t(e).toHaveAttribute("rel", "noopener noreferrer");
55
- }), o("preserves custom rel attribute and adds security", () => {
56
+ }), n("preserves custom rel attribute and adds security", () => {
56
57
  a(
57
- /* @__PURE__ */ n(r, { as: "a", href: "/test", target: "_blank", rel: "author", variant: "link", children: "External" })
58
+ /* @__PURE__ */ o(r, { as: "a", href: "/test", target: "_blank", rel: "author", variant: "link", children: "External" })
59
+ ), e(i.getByRole("link")).toHaveAttribute(
60
+ "rel",
61
+ "author noopener noreferrer"
58
62
  );
59
- const e = i.getByRole("link");
60
- t(e).toHaveAttribute("rel", "author noopener noreferrer");
61
- }), o("does not add security rel for internal links", () => {
63
+ }), n("does not add security rel for internal links", () => {
62
64
  a(
63
- /* @__PURE__ */ n(r, { as: "a", href: "/test", variant: "link", children: "Internal" })
64
- );
65
- const e = i.getByRole("link");
66
- t(e).not.toHaveAttribute("rel");
67
- }), o("adds aria-disabled when disabled", () => {
65
+ /* @__PURE__ */ o(r, { as: "a", href: "/test", variant: "link", children: "Internal" })
66
+ ), e(i.getByRole("link")).not.toHaveAttribute("rel");
67
+ }), n("adds aria-disabled when disabled", () => {
68
68
  a(
69
- /* @__PURE__ */ n(r, { as: "a", href: "/test", variant: "link", disabled: !0, children: "Disabled Link" })
70
- );
71
- const e = i.getByRole("link");
72
- t(e).toHaveAttribute("aria-disabled", "true");
69
+ /* @__PURE__ */ o(r, { as: "a", href: "/test", variant: "link", disabled: !0, children: "Disabled Link" })
70
+ ), e(i.getByRole("link")).toHaveAttribute("aria-disabled", "true");
73
71
  });
74
- }), s("Scroll button", () => {
75
- o("renders as a scroll button when 'as' is set to 'scroll'", () => {
72
+ }), l("Scroll button", () => {
73
+ n("renders as a scroll button when 'as' is set to 'scroll'", () => {
76
74
  a(
77
- /* @__PURE__ */ n(r, { as: "scroll", scrollTarget: "section-1", variant: "primary", children: "Scroll Down" })
78
- );
79
- const e = i.getByRole("button", {
80
- name: "Scroll to section-1"
81
- });
82
- t(e).toBeInTheDocument();
83
- }), o("has proper aria-label for scroll button", () => {
75
+ /* @__PURE__ */ o(r, { as: "scroll", scrollTarget: "section-1", variant: "primary", children: "Scroll Down" })
76
+ ), e(
77
+ i.getByRole("button", { name: "Scroll to section-1" })
78
+ ).toBeInTheDocument();
79
+ }), n("has proper aria-label for scroll button", () => {
84
80
  a(
85
- /* @__PURE__ */ n(r, { as: "scroll", scrollTarget: "footer", variant: "primary", children: "To Footer" })
86
- );
87
- const e = i.getByRole("button");
88
- t(e).toHaveAttribute("aria-label", "Scroll to footer");
89
- }), o("scrolls to target element when clicked", () => {
90
- const e = document.createElement("div");
91
- e.id = "target-section", document.body.appendChild(e);
92
- const l = u.fn();
93
- e.scrollIntoView = l, a(
94
- /* @__PURE__ */ n(r, { as: "scroll", scrollTarget: "target-section", variant: "primary", children: "Scroll" })
81
+ /* @__PURE__ */ o(r, { as: "scroll", scrollTarget: "footer", variant: "primary", children: "To Footer" })
82
+ ), e(i.getByRole("button")).toHaveAttribute(
83
+ "aria-label",
84
+ "Scroll to footer"
95
85
  );
96
- const d = i.getByRole("button");
97
- c.click(d), t(l).toHaveBeenCalledWith({
86
+ }), n("scrolls to target element when clicked", () => {
87
+ const t = document.createElement("div");
88
+ t.id = "target-section", document.body.appendChild(t);
89
+ const s = d.fn();
90
+ t.scrollIntoView = s, a(
91
+ /* @__PURE__ */ o(r, { as: "scroll", scrollTarget: "target-section", variant: "primary", children: "Scroll" })
92
+ ), c.click(i.getByRole("button")), e(s).toHaveBeenCalledWith({
98
93
  behavior: "smooth",
99
94
  block: "start"
100
- }), document.body.removeChild(e);
101
- }), o("does not error if scroll target does not exist", () => {
95
+ }), document.body.removeChild(t);
96
+ }), n("uses scrollTo with offset when scrollOffset is set", () => {
97
+ const t = document.createElement("div");
98
+ t.id = "offset-section", document.body.appendChild(t);
99
+ const s = d.fn();
100
+ window.scrollTo = s, d.spyOn(t, "getBoundingClientRect").mockReturnValue({
101
+ top: 200
102
+ }), a(
103
+ /* @__PURE__ */ o(
104
+ r,
105
+ {
106
+ as: "scroll",
107
+ scrollTarget: "offset-section",
108
+ scrollOffset: 80,
109
+ variant: "primary",
110
+ children: "Scroll"
111
+ }
112
+ )
113
+ ), c.click(i.getByRole("button")), e(s).toHaveBeenCalledWith({
114
+ top: e.any(Number),
115
+ behavior: "smooth"
116
+ }), document.body.removeChild(t);
117
+ }), n("does not error if scroll target does not exist", () => {
102
118
  a(
103
- /* @__PURE__ */ n(r, { as: "scroll", scrollTarget: "non-existent", variant: "primary", children: "Scroll" })
104
- );
105
- const e = i.getByRole("button");
106
- t(() => c.click(e)).not.toThrow();
119
+ /* @__PURE__ */ o(r, { as: "scroll", scrollTarget: "non-existent", variant: "primary", children: "Scroll" })
120
+ ), e(() => c.click(i.getByRole("button"))).not.toThrow();
107
121
  });
108
- }), s("Variants", () => {
122
+ }), l("Modal button", () => {
123
+ n("renders as a button when 'as' is set to 'modal'", () => {
124
+ a(
125
+ /* @__PURE__ */ o(
126
+ r,
127
+ {
128
+ as: "modal",
129
+ modalPayload: { heading: "Contact Us" },
130
+ variant: "primary",
131
+ children: "Open Modal"
132
+ }
133
+ )
134
+ ), e(
135
+ i.getByRole("button", { name: "Open Modal" })
136
+ ).toBeInTheDocument();
137
+ }), n("calls useModal open with the payload when clicked", () => {
138
+ const t = {
139
+ heading: "Contact Us",
140
+ formReference: { _id: "form-123", heading: "Contact" }
141
+ };
142
+ a(
143
+ /* @__PURE__ */ o(r, { as: "modal", modalPayload: t, variant: "primary", children: "Open Form" })
144
+ ), c.click(i.getByRole("button", { name: "Open Form" })), e(m).toHaveBeenCalledWith(t);
145
+ }), n("is disabled when disabled prop is set", () => {
146
+ a(
147
+ /* @__PURE__ */ o(
148
+ r,
149
+ {
150
+ as: "modal",
151
+ modalPayload: { heading: "Test" },
152
+ variant: "primary",
153
+ disabled: !0,
154
+ children: "Disabled Modal"
155
+ }
156
+ )
157
+ ), e(i.getByRole("button")).toBeDisabled();
158
+ }), n("does not call open when disabled", () => {
159
+ m.mockClear(), a(
160
+ /* @__PURE__ */ o(
161
+ r,
162
+ {
163
+ as: "modal",
164
+ modalPayload: { heading: "Test" },
165
+ variant: "primary",
166
+ disabled: !0,
167
+ children: "Disabled"
168
+ }
169
+ )
170
+ ), c.click(i.getByRole("button")), e(m).not.toHaveBeenCalled();
171
+ });
172
+ }), l("Variants", () => {
109
173
  [
110
174
  "primary",
111
175
  "primaryInverted",
@@ -117,61 +181,42 @@ s("Button", () => {
117
181
  "underlineInverted",
118
182
  "blurred",
119
183
  "blurredInverted"
120
- ].forEach((l) => {
121
- o(`applies ${l} variant class`, () => {
122
- a(/* @__PURE__ */ n(r, { variant: l, children: "Button" }));
123
- const d = i.getByRole("button");
124
- t(d).toHaveClass(l);
184
+ ].forEach((s) => {
185
+ n(`applies ${s} variant class`, () => {
186
+ a(/* @__PURE__ */ o(r, { variant: s, children: "Button" })), e(i.getByRole("button")).toHaveClass(s);
125
187
  });
126
- }), o("uses primary variant by default", () => {
127
- a(/* @__PURE__ */ n(r, { children: "Default" }));
128
- const l = i.getByRole("button");
129
- t(l).toHaveClass("primary");
188
+ }), n("uses primary variant by default", () => {
189
+ a(/* @__PURE__ */ o(r, { children: "Default" })), e(i.getByRole("button")).toHaveClass("primary");
130
190
  });
131
- }), s("Icons", () => {
132
- o("includes icon when icon prop is provided", () => {
133
- a(
134
- /* @__PURE__ */ n(r, { variant: "primary", icon: "arrow-right", children: "Next" })
135
- );
136
- const e = document.querySelector(".icon");
137
- t(e).toBeInTheDocument();
138
- const l = e == null ? void 0 : e.querySelector("svg");
139
- t(l).toBeInTheDocument();
140
- }), o("places icon on the left when iconAlignment is 'left'", () => {
191
+ }), l("Icons", () => {
192
+ n("includes icon when icon prop is provided", () => {
141
193
  a(
142
- /* @__PURE__ */ n(r, { variant: "primary", icon: "arrow-left", iconAlignment: "left", children: "Back" })
143
- );
144
- const e = document.querySelector(".content");
145
- t(e).toHaveClass("iconLeft");
146
- }), o("places icon on the right when iconAlignment is 'right'", () => {
194
+ /* @__PURE__ */ o(r, { variant: "primary", icon: "arrow-right", children: "Next" })
195
+ ), e(document.querySelector(".icon")).toBeInTheDocument(), e(document.querySelector(".icon svg")).toBeInTheDocument();
196
+ }), n("places icon on the left when iconAlignment is 'left'", () => {
147
197
  a(
148
- /* @__PURE__ */ n(r, { variant: "primary", icon: "arrow-right", iconAlignment: "right", children: "Next" })
149
- );
150
- const e = document.querySelector(".content");
151
- t(e).toHaveClass("iconRight");
152
- }), o("uses right alignment by default", () => {
198
+ /* @__PURE__ */ o(r, { variant: "primary", icon: "arrow-left", iconAlignment: "left", children: "Back" })
199
+ ), e(document.querySelector(".content")).toHaveClass("iconLeft");
200
+ }), n("places icon on the right when iconAlignment is 'right'", () => {
153
201
  a(
154
- /* @__PURE__ */ n(r, { variant: "primary", icon: "arrow-right", children: "Default Icon" })
155
- );
156
- const e = document.querySelector(".content");
157
- t(e).toHaveClass("iconRight");
158
- }), o("icon has aria-hidden attribute", () => {
202
+ /* @__PURE__ */ o(r, { variant: "primary", icon: "arrow-right", iconAlignment: "right", children: "Next" })
203
+ ), e(document.querySelector(".content")).toHaveClass("iconRight");
204
+ }), n("uses right alignment by default", () => {
159
205
  a(
160
- /* @__PURE__ */ n(r, { variant: "primary", icon: "settings", children: "Settings" })
161
- );
162
- const e = document.querySelector(".icon");
163
- t(e).toHaveAttribute("aria-hidden", "true");
164
- }), o("works with anchor links", () => {
206
+ /* @__PURE__ */ o(r, { variant: "primary", icon: "arrow-right", children: "Default Icon" })
207
+ ), e(document.querySelector(".content")).toHaveClass("iconRight");
208
+ }), n("icon has aria-hidden attribute", () => {
165
209
  a(
166
- /* @__PURE__ */ n(r, { as: "a", href: "/test", variant: "link", icon: "new-tab", children: "External" })
210
+ /* @__PURE__ */ o(r, { variant: "primary", icon: "settings", children: "Settings" })
211
+ ), e(document.querySelector(".icon")).toHaveAttribute(
212
+ "aria-hidden",
213
+ "true"
167
214
  );
168
- const e = document.querySelector(".icon");
169
- t(e).toBeInTheDocument();
170
215
  });
171
- }), s("Image display", () => {
172
- o("renders image when displayType is 'image' and imageSrc is provided", () => {
216
+ }), l("Image display", () => {
217
+ n("renders image when displayType is 'image' and imageSrc is provided", () => {
173
218
  a(
174
- /* @__PURE__ */ n(
219
+ /* @__PURE__ */ o(
175
220
  r,
176
221
  {
177
222
  variant: "primary",
@@ -182,45 +227,45 @@ s("Button", () => {
182
227
  }
183
228
  )
184
229
  );
185
- const e = document.querySelector("img");
186
- t(e).toBeInTheDocument(), t(e).toHaveAttribute("src", "/logo.png"), t(e).toHaveAttribute("alt", "Company Logo");
187
- }), o("renders ImageComponent when provided", () => {
230
+ const t = document.querySelector("img");
231
+ e(t).toHaveAttribute("src", "/logo.png"), e(t).toHaveAttribute("alt", "Company Logo");
232
+ }), n("renders ImageComponent when provided", () => {
188
233
  a(
189
- /* @__PURE__ */ n(
234
+ /* @__PURE__ */ o(
190
235
  r,
191
236
  {
192
237
  variant: "primary",
193
238
  displayType: "image",
194
- ImageComponent: /* @__PURE__ */ n(() => /* @__PURE__ */ n("div", { "data-testid": "custom-image", children: "Custom" }), {}),
239
+ ImageComponent: /* @__PURE__ */ o(() => /* @__PURE__ */ o("div", { "data-testid": "custom-image", children: "Custom" }), {}),
195
240
  children: "Text"
196
241
  }
197
242
  )
198
- ), t(i.getByTestId("custom-image")).toBeInTheDocument();
199
- }), o("applies image class when displayType is image", () => {
243
+ ), e(i.getByTestId("custom-image")).toBeInTheDocument();
244
+ }), n("applies image class when displayType is image", () => {
200
245
  a(
201
- /* @__PURE__ */ n(r, { variant: "primary", displayType: "image", imageSrc: "/logo.png", children: "Text" })
246
+ /* @__PURE__ */ o(r, { variant: "primary", displayType: "image", imageSrc: "/logo.png", children: "Text" })
202
247
  );
203
- const e = i.getByRole("button");
204
- t(e).toHaveClass("image"), t(e).not.toHaveClass("primary");
248
+ const t = i.getByRole("button");
249
+ e(t).toHaveClass("image"), e(t).not.toHaveClass("primary");
205
250
  });
206
- }), s("Custom className", () => {
207
- o("applies custom className", () => {
251
+ }), l("Custom className", () => {
252
+ n("applies custom className", () => {
208
253
  a(
209
- /* @__PURE__ */ n(r, { variant: "primary", className: "custom-button", children: "Custom" })
254
+ /* @__PURE__ */ o(r, { variant: "primary", className: "custom-button", children: "Custom" })
210
255
  );
211
- const e = i.getByRole("button");
212
- t(e).toHaveClass("custom-button"), t(e).toHaveClass("button"), t(e).toHaveClass("primary");
256
+ const t = i.getByRole("button");
257
+ e(t).toHaveClass("custom-button", "button", "primary");
213
258
  });
214
- }), s("Accessibility", () => {
215
- o("has button role for button element", () => {
216
- a(/* @__PURE__ */ n(r, { variant: "primary", children: "Click" })), t(i.getByRole("button")).toBeInTheDocument();
217
- }), o("has link role for anchor element", () => {
259
+ }), l("Accessibility", () => {
260
+ n("has button role for button element", () => {
261
+ a(/* @__PURE__ */ o(r, { variant: "primary", children: "Click" })), e(i.getByRole("button")).toBeInTheDocument();
262
+ }), n("has link role for anchor element", () => {
218
263
  a(
219
- /* @__PURE__ */ n(r, { as: "a", href: "/test", variant: "link", children: "Link" })
220
- ), t(i.getByRole("link")).toBeInTheDocument();
221
- }), o("supports aria attributes", () => {
264
+ /* @__PURE__ */ o(r, { as: "a", href: "/test", variant: "link", children: "Link" })
265
+ ), e(i.getByRole("link")).toBeInTheDocument();
266
+ }), n("supports aria attributes", () => {
222
267
  a(
223
- /* @__PURE__ */ n(
268
+ /* @__PURE__ */ o(
224
269
  r,
225
270
  {
226
271
  variant: "primary",
@@ -230,25 +275,19 @@ s("Button", () => {
230
275
  }
231
276
  )
232
277
  );
233
- const e = i.getByRole("button");
234
- t(e).toHaveAttribute("aria-label", "Custom Label"), t(e).toHaveAttribute("aria-describedby", "desc");
278
+ const t = i.getByRole("button");
279
+ e(t).toHaveAttribute("aria-label", "Custom Label"), e(t).toHaveAttribute("aria-describedby", "desc");
235
280
  });
236
- }), s("Edge cases", () => {
237
- o("handles undefined variant", () => {
238
- a(/* @__PURE__ */ n(r, { variant: void 0, children: "No Variant" }));
239
- const e = i.getByRole("button");
240
- t(e).toHaveClass("button");
241
- }), o("handles empty children", () => {
242
- a(/* @__PURE__ */ n(r, { variant: "primary", children: "Primary" }));
243
- const e = i.getByRole("button");
244
- t(e).toBeInTheDocument();
245
- }), o("handles complex children", () => {
246
- a(
247
- /* @__PURE__ */ m(r, { variant: "primary", children: [
248
- /* @__PURE__ */ n("span", { children: "Complex" }),
249
- /* @__PURE__ */ n("strong", { children: "Children" })
281
+ }), l("Edge cases", () => {
282
+ n("handles undefined variant", () => {
283
+ a(/* @__PURE__ */ o(r, { variant: void 0, children: "No Variant" })), e(i.getByRole("button")).toHaveClass("button");
284
+ }), n("handles complex children", () => {
285
+ a(
286
+ /* @__PURE__ */ u(r, { variant: "primary", children: [
287
+ /* @__PURE__ */ o("span", { children: "Complex" }),
288
+ /* @__PURE__ */ o("strong", { children: "Children" })
250
289
  ] })
251
- ), t(i.getByText("Complex")).toBeInTheDocument(), t(i.getByText("Children")).toBeInTheDocument();
290
+ ), e(i.getByText("Complex")).toBeInTheDocument(), e(i.getByText("Children")).toBeInTheDocument();
252
291
  });
253
292
  });
254
293
  });
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");const e=require("../../../index-D7SAxT5B.cjs");require("../../../index-CBK5rp6X.cjs");require("../../../external-link-DDShu-48.cjs");require("../../../play-CQBnZgNa.cjs");require("../../../chevron-right-motlyADs.cjs");require("../../../chevron-down-DfK1XBl3.cjs");require("../../../arrow-right-DO6S4vfx.cjs");require("../../../arrow-left-4E3t8axP.cjs");exports.Button=e.Button;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");require("../../context/ModalContext.cjs");const e=require("../../../index-0SVQqhAg.cjs");require("../../../index-CBK5rp6X.cjs");require("../../../external-link-DDShu-48.cjs");require("../../../play-CQBnZgNa.cjs");require("../../../chevron-right-motlyADs.cjs");require("../../../chevron-down-DfK1XBl3.cjs");require("../../../arrow-right-DO6S4vfx.cjs");require("../../../arrow-left-4E3t8axP.cjs");exports.Button=e.Button;
@@ -1,6 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { B as s } from "../../../index-BnvfQt_k.js";
3
+ import "../../context/ModalContext.mjs";
4
+ import { B as u } from "../../../index-aWdsapYP.js";
4
5
  import "../../../index-CeBA0PT0.js";
5
6
  import "../../../external-link-BOPobeQJ.js";
6
7
  import "../../../play-DYgKiSaf.js";
@@ -9,5 +10,5 @@ import "../../../chevron-down-DSUzBz9F.js";
9
10
  import "../../../arrow-right-QEwnX3Sk.js";
10
11
  import "../../../arrow-left-BIJvHwNQ.js";
11
12
  export {
12
- s as Button
13
+ u as Button
13
14
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index52.css');const e=require("react/jsx-runtime"),T=require("../../../index-D7SAxT5B.cjs"),k=require("../ButtonGroup/index.cjs"),s=require("../../../index-CBK5rp6X.cjs"),$=require("../../../external-link-DDShu-48.cjs"),F="_footer_1lalq_1",I="_container_1lalq_10",S="_primaryNav_1lalq_24",w="_secondaryNav_1lalq_35",L="_details_1lalq_72",A="_nav_1lalq_86",B="_logo_1lalq_94",E="_socialItems_1lalq_109",C="_group_1lalq_116",M="_groups_1lalq_126",z="_groupTitle_1lalq_137",G="_sublinks_1lalq_146",Y="_link_1lalq_154",O="_newTabIcon_1lalq_172",P="_bottom_1lalq_186",U="_left_1lalq_197",D="_center_1lalq_217",H="_right_1lalq_247",a={footer:F,container:I,primaryNav:S,secondaryNav:w,details:L,nav:A,logo:B,socialItems:E,group:C,groups:M,groupTitle:z,sublinks:G,link:Y,newTabIcon:O,bottom:P,left:U,center:D,right:H},J={Facebook:s.FaFacebook,Twitter:s.FaTwitter,LinkedIn:s.FaLinkedin,Instagram:s.FaInstagram,YouTube:s.FaYoutube},K={left:a.left,center:a.center,right:a.right};function Q({logo:d,items:u,primaryInfo:g,secondaryInfo:h,utilityItems:r,socialItems:t,alignment:m="left",copyright:v,className:b,style:j,...q}){const i=(l,o=!1)=>l.map((n,N)=>{var x;const f=n._key??`${n.label}-${N}`,c=!!((x=n.sublinks)!=null&&x.length),y=!!n.href,_=n.icon?J[n.icon]:void 0,p=e.jsxs(e.Fragment,{children:[!o&&n.label,_&&e.jsx(_,{"aria-hidden":"true"}),!_&&n.isExternal&&e.jsx($.ExternalLink,{className:a.newTabIcon,size:14,"aria-hidden":"true"})]});return e.jsxs("div",{className:a.group,children:[y?e.jsx("a",{href:n.href,className:`${a.link}${c?` ${a.groupTitle}`:""}`,target:n.isExternal?"_blank":"_self",rel:n.isExternal?"noopener noreferrer":void 0,"aria-label":o?n.label:void 0,onClick:n.onClick,children:p}):e.jsx("span",{className:c?a.groupTitle:void 0,children:p}),c&&e.jsx("div",{className:a.sublinks,"aria-label":`${n.label} links`,children:i(n.sublinks)})]},f)});return e.jsx("footer",{className:`${a.footer} ${K[m]}${b?` ${b}`:""}`,style:j,...q,children:e.jsxs("div",{className:a.container,children:[e.jsxs("div",{className:a.primaryNav,children:[e.jsxs("div",{className:a.details,children:[d&&e.jsx("div",{className:a.logo,children:d}),t&&t.length>0&&e.jsx("div",{className:a.socialItems,"aria-label":"Social media links",children:i(t,!0)}),g&&e.jsx("div",{children:g}),h&&e.jsx("div",{children:h})]}),u.length>0&&e.jsx("nav",{className:a.nav,id:"footer-nav","aria-label":"Footer navigation",children:e.jsx("div",{className:a.groups,children:i(u)})})]}),e.jsxs("div",{className:a.secondaryNav,children:[v&&e.jsx("div",{className:a.bottom,children:e.jsx("span",{children:v})}),r&&r.length>0&&e.jsx("nav",{"aria-label":"Utility links",children:e.jsx(k.ButtonGroup,{orientation:"horizontal",children:r.map((l,o)=>e.jsx(T.Button,{as:"a",href:l.href??"/",variant:l.variant??"primary",displayType:l.displayType??"text",imageSrc:l.imageSrc,imageAlt:l.imageAlt,"aria-label":l.ariaLabel??(typeof l.label=="string"?l.label:""),icon:l.icon,iconAlignment:l.iconAlignment,children:l.label},l._key??o))})})]})]})})}exports.Footer=Q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index52.css');const e=require("react/jsx-runtime"),T=require("../../../index-0SVQqhAg.cjs"),k=require("../ButtonGroup/index.cjs"),s=require("../../../index-CBK5rp6X.cjs"),$=require("../../../external-link-DDShu-48.cjs"),F="_footer_1lalq_1",I="_container_1lalq_10",S="_primaryNav_1lalq_24",w="_secondaryNav_1lalq_35",L="_details_1lalq_72",A="_nav_1lalq_86",B="_logo_1lalq_94",E="_socialItems_1lalq_109",C="_group_1lalq_116",M="_groups_1lalq_126",z="_groupTitle_1lalq_137",G="_sublinks_1lalq_146",Y="_link_1lalq_154",O="_newTabIcon_1lalq_172",P="_bottom_1lalq_186",U="_left_1lalq_197",D="_center_1lalq_217",H="_right_1lalq_247",a={footer:F,container:I,primaryNav:S,secondaryNav:w,details:L,nav:A,logo:B,socialItems:E,group:C,groups:M,groupTitle:z,sublinks:G,link:Y,newTabIcon:O,bottom:P,left:U,center:D,right:H},J={Facebook:s.FaFacebook,Twitter:s.FaTwitter,LinkedIn:s.FaLinkedin,Instagram:s.FaInstagram,YouTube:s.FaYoutube},K={left:a.left,center:a.center,right:a.right};function Q({logo:d,items:u,primaryInfo:g,secondaryInfo:h,utilityItems:r,socialItems:t,alignment:m="left",copyright:v,className:b,style:j,...q}){const i=(l,o=!1)=>l.map((n,N)=>{var x;const f=n._key??`${n.label}-${N}`,c=!!((x=n.sublinks)!=null&&x.length),y=!!n.href,_=n.icon?J[n.icon]:void 0,p=e.jsxs(e.Fragment,{children:[!o&&n.label,_&&e.jsx(_,{"aria-hidden":"true"}),!_&&n.isExternal&&e.jsx($.ExternalLink,{className:a.newTabIcon,size:14,"aria-hidden":"true"})]});return e.jsxs("div",{className:a.group,children:[y?e.jsx("a",{href:n.href,className:`${a.link}${c?` ${a.groupTitle}`:""}`,target:n.isExternal?"_blank":"_self",rel:n.isExternal?"noopener noreferrer":void 0,"aria-label":o?n.label:void 0,onClick:n.onClick,children:p}):e.jsx("span",{className:c?a.groupTitle:void 0,children:p}),c&&e.jsx("div",{className:a.sublinks,"aria-label":`${n.label} links`,children:i(n.sublinks)})]},f)});return e.jsx("footer",{className:`${a.footer} ${K[m]}${b?` ${b}`:""}`,style:j,...q,children:e.jsxs("div",{className:a.container,children:[e.jsxs("div",{className:a.primaryNav,children:[e.jsxs("div",{className:a.details,children:[d&&e.jsx("div",{className:a.logo,children:d}),t&&t.length>0&&e.jsx("div",{className:a.socialItems,"aria-label":"Social media links",children:i(t,!0)}),g&&e.jsx("div",{children:g}),h&&e.jsx("div",{children:h})]}),u.length>0&&e.jsx("nav",{className:a.nav,id:"footer-nav","aria-label":"Footer navigation",children:e.jsx("div",{className:a.groups,children:i(u)})})]}),e.jsxs("div",{className:a.secondaryNav,children:[v&&e.jsx("div",{className:a.bottom,children:e.jsx("span",{children:v})}),r&&r.length>0&&e.jsx("nav",{"aria-label":"Utility links",children:e.jsx(k.ButtonGroup,{orientation:"horizontal",children:r.map((l,o)=>e.jsx(T.Button,{as:"a",href:l.href??"/",variant:l.variant??"primary",displayType:l.displayType??"text",imageSrc:l.imageSrc,imageAlt:l.imageAlt,"aria-label":l.ariaLabel??(typeof l.label=="string"?l.label:""),icon:l.icon,iconAlignment:l.iconAlignment,children:l.label},l._key??o))})})]})]})})}exports.Footer=Q;
@@ -1,5 +1,5 @@
1
1
  import { jsx as l, jsxs as o, Fragment as F } from "react/jsx-runtime";
2
- import { B as $ } from "../../../index-BnvfQt_k.js";
2
+ import { B as $ } from "../../../index-aWdsapYP.js";
3
3
  import { ButtonGroup as x } from "../ButtonGroup/index.mjs";
4
4
  import { a as I, b as w, c as E, d as S, e as A } from "../../../index-CeBA0PT0.js";
5
5
  import { E as L } from "../../../external-link-BOPobeQJ.js";